diff --git a/src/dialogs/PasswordDlg.cpp b/src/dialogs/PasswordDlg.cpp index b070f0a..15a12ad 100644 --- a/src/dialogs/PasswordDlg.cpp +++ b/src/dialogs/PasswordDlg.cpp @@ -61,30 +61,36 @@ PasswordDialog::PasswordDialog(QWidget* parent,DlgMode mode,DlgFlags flags,const Check_Password->setChecked(true); Check_KeyFile->setChecked(false); Combo_KeyFile->setEditText(""); + Edit_Password->setFocus(Qt::OtherFocusReason); break; case KEYFILE: Check_Password->setChecked(false); Check_KeyFile->setChecked(true); Combo_KeyFile->setEditText(QDir::cleanPath(QDir::current().absoluteFilePath(config->lastKeyLocation()))); + Combo_KeyFile->setFocus(Qt::OtherFocusReason); break; case BOTH: Check_Password->setChecked(true); Check_KeyFile->setChecked(true); Combo_KeyFile->setEditText(QDir::cleanPath(QDir::current().absoluteFilePath(config->lastKeyLocation()))); + Edit_Password->setFocus(Qt::OtherFocusReason); break; } } + else{ + Edit_Password->setFocus(Qt::OtherFocusReason); + } if(Mode!=Mode_Set && Mode!=Mode_Change){ Button_GenKeyFile->hide(); } - if(flags & Flag_Auto){ - /* + /*if(flags & Flag_Auto){ + / * QPushButton* Button_Quit = buttonBox->addButton(tr("Quit"),QDialogButtonBox::DestructiveRole); connect(Button_Quit,SIGNAL(clicked()),this,SLOT(OnButtonQuit())); - */ + * / if(config->rememberLastKey()){ switch(config->lastKeyType()){ case PASSWORD: @@ -100,10 +106,10 @@ PasswordDialog::PasswordDialog(QWidget* parent,DlgMode mode,DlgFlags flags,const Check_Password->setChecked(true); Check_KeyFile->setChecked(true); Combo_KeyFile->setEditText(config->lastKeyLocation()); - break; + break; } } - } + }*/ // Setting up the bookmark button if(Mode==Mode_Ask && config->featureBookmarks()){ diff --git a/src/forms/AboutDlg.ui b/src/forms/AboutDlg.ui index eb41709..a06e6b7 100644 --- a/src/forms/AboutDlg.ui +++ b/src/forms/AboutDlg.ui @@ -42,7 +42,7 @@ QSizePolicy::Fixed - + 20 50 @@ -56,6 +56,14 @@ 0 + + + 0 + 0 + 397 + 171 + + About @@ -121,7 +129,7 @@ QSizePolicy::Fixed - + 10 20 @@ -161,6 +169,14 @@ General Public License (GPL) version 2. + + + 0 + 0 + 397 + 171 + + Credits @@ -178,6 +194,14 @@ General Public License (GPL) version 2. + + + 0 + 0 + 397 + 171 + + Translation @@ -195,6 +219,14 @@ General Public License (GPL) version 2. + + + 0 + 0 + 397 + 171 + + License @@ -230,6 +262,13 @@ General Public License (GPL) version 2.
../../src/lib/UrlLabel.h
+ + tabWidget + Edit_Thanks + Edit_Translation + Edit_License + ButtonBox + diff --git a/src/forms/AddBookmarkDlg.ui b/src/forms/AddBookmarkDlg.ui index 7bc7594..bfc938d 100644 --- a/src/forms/AddBookmarkDlg.ui +++ b/src/forms/AddBookmarkDlg.ui @@ -40,7 +40,7 @@ QSizePolicy::Fixed - + 20 50 @@ -89,13 +89,18 @@ - QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + QDialogButtonBox::Cancel|QDialogButtonBox::Ok
- + + Edit_Title + Edit_Filename + Button_Browse + buttonBox + diff --git a/src/forms/CustomizeDetailViewDlg.ui b/src/forms/CustomizeDetailViewDlg.ui index c228e9a..c646c30 100644 --- a/src/forms/CustomizeDetailViewDlg.ui +++ b/src/forms/CustomizeDetailViewDlg.ui @@ -22,6 +22,14 @@ 0
+ + + 0 + 0 + 509 + 324 + + Rich Text Editor @@ -262,7 +270,7 @@ Qt::Horizontal - + 40 20 @@ -278,6 +286,14 @@ + + + 0 + 0 + 509 + 324 + + HTML @@ -299,12 +315,28 @@ - QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults + QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults + + TabWidget + BtnBold + BtnItalic + BtnUnderline + BtnAlignLeft + BtnAlignCenter + BtnAlignRight + BtnAlignBlock + BtnColor + FontSize + BtnTemplates + RichEdit + HtmlEdit + ButtonBox + diff --git a/src/forms/DatabaseSettingsDlg.ui b/src/forms/DatabaseSettingsDlg.ui index 0f6f215..65fc3be 100644 --- a/src/forms/DatabaseSettingsDlg.ui +++ b/src/forms/DatabaseSettingsDlg.ui @@ -33,7 +33,7 @@ QSizePolicy::Fixed - + 20 50 @@ -96,13 +96,19 @@ - QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + ComboAlgo + EditRounds + ButtonBench + ButtonBox + diff --git a/src/forms/EditGroupDlg.ui b/src/forms/EditGroupDlg.ui index 5a5fc47..09e6b84 100644 --- a/src/forms/EditGroupDlg.ui +++ b/src/forms/EditGroupDlg.ui @@ -25,10 +25,7 @@ - - 6 - - + 6 @@ -53,7 +50,7 @@ Qt::Horizontal - + 172 20 @@ -89,7 +86,7 @@ - QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + QDialogButtonBox::Cancel|QDialogButtonBox::Ok @@ -99,6 +96,8 @@ EditTitle ComboIconPicker + Button_Icon + ButtonBox diff --git a/src/forms/ManageBookmarksDlg.ui b/src/forms/ManageBookmarksDlg.ui index 1c45508..08c84f3 100644 --- a/src/forms/ManageBookmarksDlg.ui +++ b/src/forms/ManageBookmarksDlg.ui @@ -27,7 +27,7 @@ QSizePolicy::Fixed - + 20 50 @@ -80,7 +80,7 @@ QSizePolicy::Fixed - + 20 10 @@ -113,7 +113,7 @@ Qt::Vertical - + 20 161 @@ -137,6 +137,15 @@ + + ListWidget + Button_Add + Button_Edit + Button_Delete + Button_Up + Button_Down + buttonBox + diff --git a/src/forms/PasswordDlg.ui b/src/forms/PasswordDlg.ui index b67796d..3f6619d 100644 --- a/src/forms/PasswordDlg.ui +++ b/src/forms/PasswordDlg.ui @@ -6,7 +6,7 @@ 0 0 578 - 255 + 273 @@ -44,7 +44,7 @@ QSizePolicy::Fixed - + 20 50 @@ -57,7 +57,7 @@ Qt::Horizontal - + 40 20 @@ -113,16 +113,7 @@ Key - - 0 - - - 0 - - - 0 - - + 0 @@ -131,6 +122,14 @@ 0 + + + 0 + 0 + 556 + 116 + + @@ -204,7 +203,7 @@ Qt::Horizontal - + 40 20 @@ -215,6 +214,14 @@ + + + 0 + 0 + 556 + 116 + + @@ -240,7 +247,7 @@ Qt::Horizontal - + 40 20 @@ -272,7 +279,7 @@ Qt::Vertical - + 20 40 @@ -290,7 +297,7 @@ - QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + QDialogButtonBox::Cancel|QDialogButtonBox::Ok @@ -298,17 +305,17 @@ - Edit_Password - Combo_KeyFile + Button_Bookmarks Check_Password - Check_KeyFile + Edit_Password ButtonChangeEchoMode + Check_KeyFile + Combo_KeyFile Button_Browse - Button_Bookmarks - buttonBox Button_GenKeyFile - Button_Back Edit_PwRepeat + Button_Back + buttonBox diff --git a/src/forms/SettingsDlg.ui b/src/forms/SettingsDlg.ui index 56600ad..4b05022 100644 --- a/src/forms/SettingsDlg.ui +++ b/src/forms/SettingsDlg.ui @@ -27,7 +27,7 @@ QSizePolicy::Fixed - + 20 50 @@ -47,6 +47,14 @@ 0 + + + 0 + 0 + 584 + 341 + + The integration plugins provide features like usage of the native file dialogs and message boxes of the particular desktop environments. @@ -71,7 +79,7 @@ QSizePolicy::Fixed - + 25 10 @@ -101,7 +109,7 @@ QSizePolicy::Fixed - + 25 10 @@ -143,7 +151,7 @@ QSizePolicy::Fixed - + 25 10 @@ -173,7 +181,7 @@ QSizePolicy::Fixed - + 25 10 @@ -203,7 +211,7 @@ QSizePolicy::Fixed - + 25 10 @@ -245,7 +253,7 @@ QSizePolicy::Fixed - + 10 20 @@ -265,7 +273,7 @@ Qt::Horizontal - + 40 20 @@ -294,7 +302,7 @@ Qt::Vertical - + 20 0 @@ -305,6 +313,14 @@ + + + 0 + 0 + 584 + 341 + + Appea&rance @@ -323,10 +339,7 @@ - - 6 - - + 6 @@ -344,7 +357,7 @@ QSizePolicy::Fixed - + 40 20 @@ -551,7 +564,7 @@ QSizePolicy::Minimum - + 40 20 @@ -588,7 +601,7 @@ Qt::Horizontal - + 40 20 @@ -602,10 +615,7 @@ - - 6 - - + 6 @@ -643,7 +653,7 @@ Qt::Horizontal - + 40 20 @@ -658,7 +668,7 @@ Qt::Vertical - + 20 0 @@ -669,6 +679,14 @@ + + + 0 + 0 + 584 + 341 + + Security @@ -812,7 +830,7 @@ Qt::Vertical - + 20 0 @@ -823,6 +841,14 @@ + + + 0 + 0 + 584 + 341 + + Features @@ -849,7 +875,7 @@ Qt::Vertical - + 20 0 @@ -860,6 +886,14 @@ + + + 0 + 0 + 584 + 341 + + Desktop Integration @@ -939,7 +973,7 @@ Qt::Horizontal - + 40 20 @@ -961,7 +995,7 @@ Qt::Vertical - + 20 0 @@ -972,6 +1006,14 @@ + + + 0 + 0 + 584 + 341 + + Advanced @@ -1045,10 +1087,7 @@ Auto-Type Fine Tuning - - 6 - - + 6 @@ -1079,7 +1118,7 @@ Qt::Horizontal - + 40 20 @@ -1134,7 +1173,7 @@ Qt::Horizontal - + 40 20 @@ -1156,7 +1195,7 @@ Qt::Vertical - + 20 0 @@ -1174,7 +1213,7 @@ Qt::Horizontal - QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok @@ -1213,6 +1252,8 @@ CheckBox_ShowPasswords_PasswordDlg SpinBox_ClipboardTime CheckBox_LockMinimize + CheckBox_InactivityLock + SpinBox_InacitivtyTime CheckBox_FeatureBookmarks Radio_IntPlugin_None Radio_IntPlugin_Gnome diff --git a/src/forms/SimplePasswordDlg.ui b/src/forms/SimplePasswordDlg.ui index 87656b9..08d80fc 100644 --- a/src/forms/SimplePasswordDlg.ui +++ b/src/forms/SimplePasswordDlg.ui @@ -94,13 +94,18 @@ Qt::Horizontal - QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + EditPassword + Button_HidePassword + buttonBox + diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 29f86c0..6176b3c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -385,10 +385,25 @@ void KeepassMainWindow::setupDatabaseConnections(IDatabase* DB){ bool KeepassMainWindow::openDatabase(QString filename,bool IsAuto){ if (!QFile::exists(filename)){ - QMessageBox::critical(this,tr("Error") - ,tr("The database file does not exist.")); + QMessageBox::critical(this, tr("Error"), tr("The database file does not exist.")); return false; } + + if (QFile::exists(filename+".lock")){ + QMessageBox::StandardButton buttonPressed = QMessageBox::question( + this, + tr("Database locked"), + tr("The database you are trying to open is locked.\n" + "This means that either someone else has opened the file or KeePassX crashed last time it opened the database.\n\n" + "Do you want to open it anyway?" + ), + QMessageBox::Yes|QMessageBox::No, + QMessageBox::No + ); + if (buttonPressed != QMessageBox::Yes) + return false; + } + if(!IsAuto){ config->setLastKeyLocation(QString()); config->setLastKeyType(PASSWORD); @@ -418,6 +433,14 @@ bool KeepassMainWindow::openDatabase(QString filename,bool IsAuto){ StatusBarGeneral->setText(tr("Loading Database...")); db->setKey(dlg.password(),dlg.keyFile()); if(db->load(filename)){ + if (!QFile::exists(filename+".lock")){ + QFile lock(filename+".lock"); + if (!lock.open(QIODevice::WriteOnly)){ + QMessageBox::critical(this, tr("Error"), tr("Couldn't create database lock file.")); + return false; + } + } + if (IsLocked) resetLock(); saveLastFilename(filename); @@ -446,13 +469,13 @@ bool KeepassMainWindow::openDatabase(QString filename,bool IsAuto){ } StatusBarGeneral->setText(tr("Ready")); inactivityCounter = 0; + return true; } void KeepassMainWindow::fakeOpenDatabase(const QString& filename){ if (!QFile::exists(filename)){ - QMessageBox::critical(this,tr("Error") - ,tr("The database file does not exist.")); + QMessageBox::critical(this, tr("Error"), tr("The database file does not exist.")); return; } @@ -473,13 +496,18 @@ bool KeepassMainWindow::closeDatabase(bool lock){ tr("The current file was modified. Do you want\nto save the changes?"), QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel, QMessageBox::Yes); if(r==QMessageBox::Cancel) return false; //Cancel - if(r==QMessageBox::Yes) //Yes (Save file) + if(r==QMessageBox::Yes){ //Yes (Save file) if(!OnFileSave()) return false; + } } } db->close(); delete db; db=NULL; + if (QFile::exists(currentFile+".lock")){ + if (!QFile::remove(currentFile+".lock")) + QMessageBox::critical(this, tr("Error"), tr("Couldn't remove database lock file.")); + } EntryView->db=NULL; EntryView->clear(); EntryView->Items.clear();