|
|
|
@ -57,7 +57,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
KeepassMainWindow::KeepassMainWindow(QWidget *parent, Qt::WFlags flags):QMainWindow(parent,flags){ |
|
|
|
|
KeepassMainWindow::KeepassMainWindow(const QString& ArgFile,QWidget *parent, Qt::WFlags flags):QMainWindow(parent,flags){ |
|
|
|
|
Start=true; |
|
|
|
|
setupUi(this); |
|
|
|
|
setGeometry(geometry().x(),geometry().y(),config.MainWinWidth,config.MainWinHeight); |
|
|
|
@ -76,7 +76,9 @@ KeepassMainWindow::KeepassMainWindow(QWidget *parent, Qt::WFlags flags):QMainWin |
|
|
|
|
setupConnections(); |
|
|
|
|
FileOpen=false; |
|
|
|
|
Clipboard=QApplication::clipboard(); |
|
|
|
|
if(config.OpenLast && (config.LastFile!=QString()) ){ |
|
|
|
|
if(ArgFile!=QString()) |
|
|
|
|
openDatabase(ArgFile,false); |
|
|
|
|
else if(config.OpenLast && (config.LastFile!=QString()) ){ |
|
|
|
|
QFileInfo file(config.LastFile); |
|
|
|
|
if(file.exists()) |
|
|
|
|
openDatabase(config.LastFile,true); |
|
|
|
@ -130,15 +132,17 @@ void KeepassMainWindow::setupConnections(){ |
|
|
|
|
|
|
|
|
|
connect(ExtrasSettingsAction,SIGNAL(triggered(bool)),this,SLOT(OnExtrasSettings())); |
|
|
|
|
|
|
|
|
|
connect(HelpHandbookAction,SIGNAL(triggered()),this,SLOT(OnHelpHandbook())); |
|
|
|
|
connect(HelpAboutAction,SIGNAL(triggered()),this,SLOT(OnHelpAbout())); |
|
|
|
|
|
|
|
|
|
connect(GroupView,SIGNAL(entryDropped()),EntryView,SLOT(updateItems())); |
|
|
|
|
connect(this,SIGNAL(entryChanged()),EntryView,SLOT(updateItems()),Qt::QueuedConnection); |
|
|
|
|
connect(&ClipboardTimer, SIGNAL(timeout()), this, SLOT(OnClipboardTimeOut())); |
|
|
|
|
connect(GroupView,SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),this, |
|
|
|
|
SLOT(OnCurrentGroupChanged(QTreeWidgetItem*,QTreeWidgetItem*))); |
|
|
|
|
connect(GroupView,SIGNAL(itemExpanded(QTreeWidgetItem*)),this,SLOT(OnItemExpanded(QTreeWidgetItem*))); |
|
|
|
|
connect(GroupView,SIGNAL(itemCollapsed(QTreeWidgetItem*)),this,SLOT(OnItemCollaped(QTreeWidgetItem*))); |
|
|
|
|
connect(EntryView,SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),this, |
|
|
|
|
connect(EntryView,SIGNAL(itemActivated(QTreeWidgetItem*,int)),this, |
|
|
|
|
SLOT(OnEntryItemDoubleClicked(QTreeWidgetItem*,int))); |
|
|
|
|
connect(EntryView,SIGNAL(itemSelectionChanged()), this, SLOT(OnEntrySelectionChanged())); |
|
|
|
|
connect(GroupView,SIGNAL(itemSelectionChanged()), this, SLOT(OnGroupSelectionChanged())); |
|
|
|
@ -410,7 +414,7 @@ switch(dlg.exec()){ |
|
|
|
|
setStateFileModified(true); |
|
|
|
|
break; |
|
|
|
|
case 2: //entry moved to another group
|
|
|
|
|
EntryView->updateItems(currentGroup()->ID); |
|
|
|
|
emit entryChanged(); //a direct call of updateItems() would cause a SegFault because of the TreeView base class slots
|
|
|
|
|
setStateFileModified(true); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
@ -977,6 +981,10 @@ CAboutDialog dlg(this,"AboutDlg"); |
|
|
|
|
dlg.exec(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void KeepassMainWindow::OnHelpHandbook(){ |
|
|
|
|
openBrowser(AppDir+"/../share/doc/keepass/index.html"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void KeepassMainWindow::OnViewShowToolbar(bool show){ |
|
|
|
|
config.Toolbar=show; |
|
|
|
|
toolBar->setVisible(config.Toolbar); |
|
|
|
|