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