|
|
@ -451,13 +451,13 @@ bool KeepassMainWindow::openDatabase(QString filename,bool IsAuto){ |
|
|
|
|
|
|
|
|
|
|
|
if (IsLocked) |
|
|
|
if (IsLocked) |
|
|
|
resetLock(); |
|
|
|
resetLock(); |
|
|
|
|
|
|
|
currentFile = filename; |
|
|
|
saveLastFilename(filename); |
|
|
|
saveLastFilename(filename); |
|
|
|
setWindowTitle(QString("%1[*] - KeePassX").arg(filename)); |
|
|
|
setWindowTitle(QString("%1[*] - KeePassX").arg(filename)); |
|
|
|
GroupView->createItems(); |
|
|
|
GroupView->createItems(); |
|
|
|
EntryView->showGroup(NULL); |
|
|
|
EntryView->showGroup(NULL); |
|
|
|
setStateFileOpen(true); |
|
|
|
setStateFileOpen(true); |
|
|
|
setStateFileModified(false); |
|
|
|
setStateFileModified(false); |
|
|
|
currentFile = filename; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else{ |
|
|
|
else{ |
|
|
|
statusbarState = 2; |
|
|
|
statusbarState = 2; |
|
|
@ -549,6 +549,7 @@ void KeepassMainWindow::OnFileNewKdb(){ |
|
|
|
db=db_new; |
|
|
|
db=db_new; |
|
|
|
db->setKey(dlg.password(),dlg.keyFile()); |
|
|
|
db->setKey(dlg.password(),dlg.keyFile()); |
|
|
|
db->generateMasterKey(); |
|
|
|
db->generateMasterKey(); |
|
|
|
|
|
|
|
currentFile.clear(); |
|
|
|
setWindowTitle(QString("[%1][*] - KeePassX").arg(tr("new"))); |
|
|
|
setWindowTitle(QString("[%1][*] - KeePassX").arg(tr("new"))); |
|
|
|
GroupView->db=db; |
|
|
|
GroupView->db=db; |
|
|
|
EntryView->db=db; |
|
|
|
EntryView->db=db; |
|
|
@ -610,7 +611,7 @@ void KeepassMainWindow::setStateFileOpen(bool IsOpen){ |
|
|
|
DetailView->setEnabled(IsOpen); |
|
|
|
DetailView->setEnabled(IsOpen); |
|
|
|
QuickSearchEdit->setEnabled(IsOpen); |
|
|
|
QuickSearchEdit->setEnabled(IsOpen); |
|
|
|
ExtrasShowExpiredEntriesAction->setEnabled(IsOpen); |
|
|
|
ExtrasShowExpiredEntriesAction->setEnabled(IsOpen); |
|
|
|
AddThisAsBookmarkAction->setEnabled(IsOpen); |
|
|
|
AddThisAsBookmarkAction->setEnabled(IsOpen && db->file()); |
|
|
|
FileUnLockWorkspaceAction->setEnabled(IsOpen||IsLocked); |
|
|
|
FileUnLockWorkspaceAction->setEnabled(IsOpen||IsLocked); |
|
|
|
|
|
|
|
|
|
|
|
if(!IsOpen){ |
|
|
|
if(!IsOpen){ |
|
|
@ -871,6 +872,7 @@ bool KeepassMainWindow::OnFileSave(){ |
|
|
|
return OnFileSaveAs(); |
|
|
|
return OnFileSaveAs(); |
|
|
|
saveLastFilename(db->file()->fileName()); |
|
|
|
saveLastFilename(db->file()->fileName()); |
|
|
|
if(db->save()){ |
|
|
|
if(db->save()){ |
|
|
|
|
|
|
|
setStateFileOpen(true); // necessary for AddThisAsBookmarkAction
|
|
|
|
setStateFileModified(false); |
|
|
|
setStateFileModified(false); |
|
|
|
if (config->backup() && config->backupDelete() && config->backupDeleteAfter()>0){ |
|
|
|
if (config->backup() && config->backupDelete() && config->backupDeleteAfter()>0){ |
|
|
|
IGroupHandle* backupGroup = db->backupGroup(); |
|
|
|
IGroupHandle* backupGroup = db->backupGroup(); |
|
|
@ -1369,18 +1371,14 @@ void KeepassMainWindow::OnBookmarkTriggered(QAction* action){ |
|
|
|
action->setIcon(getIcon("document")); |
|
|
|
action->setIcon(getIcon("document")); |
|
|
|
menuBookmarks->addAction(action); |
|
|
|
menuBookmarks->addAction(action); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else if(action==ManageBookmarksAction){ |
|
|
|
if(action==ManageBookmarksAction){ |
|
|
|
|
|
|
|
ManageBookmarksDlg dlg(this); |
|
|
|
ManageBookmarksDlg dlg(this); |
|
|
|
dlg.exec(); |
|
|
|
dlg.exec(); |
|
|
|
menuBookmarks->clear(); |
|
|
|
menuBookmarks->clear(); |
|
|
|
createBookmarkActions(); |
|
|
|
createBookmarkActions(); |
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else if(action==AddThisAsBookmarkAction){ |
|
|
|
if(action==AddThisAsBookmarkAction){ |
|
|
|
|
|
|
|
AddBookmarkDlg dlg(this,db->file()->fileName()); |
|
|
|
AddBookmarkDlg dlg(this,db->file()->fileName()); |
|
|
|
if(dlg.exec()){ |
|
|
|
if(dlg.exec()){ |
|
|
|
int id=dlg.ItemID; |
|
|
|
int id=dlg.ItemID; |
|
|
@ -1390,10 +1388,10 @@ void KeepassMainWindow::OnBookmarkTriggered(QAction* action){ |
|
|
|
action->setIcon(getIcon("document")); |
|
|
|
action->setIcon(getIcon("document")); |
|
|
|
menuBookmarks->addAction(action); |
|
|
|
menuBookmarks->addAction(action); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
openDatabase(KpxBookmarks::path(action->data().toInt())); |
|
|
|
openDatabase(KpxBookmarks::path(action->data().toInt())); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void KeepassMainWindow::createBookmarkActions(){ |
|
|
|
void KeepassMainWindow::createBookmarkActions(){ |
|
|
|