diff --git a/src/KpxConfig.h b/src/KpxConfig.h index 2229c8b..39c51a9 100644 --- a/src/KpxConfig.h +++ b/src/KpxConfig.h @@ -78,6 +78,7 @@ public: bool startLocked(){return settings.value("Options/StartLocked",false).toBool();} QString mountDir(){return settings.value("Options/MountDir",DEFAULT_MOUNT_DIR).toString();} bool openLastFile(){return settings.value("Options/OpenLastFile",true).toBool();} + bool autoSave(){return settings.value("Options/AutoSave",false).toBool();} QString pwGenCharList(){return settings.value("Options/PwGenCharList").toString();} int pwGenLength(){return settings.value("Options/PwGenLength",25).toInt();} QBitArray pwGenOptions(){return stringToBitArray(settings.value("Options/PwGenOptions","1111100001").toString(),10);} @@ -134,6 +135,7 @@ public: void setStartLocked(bool value){settings.setValue("Options/StartLocked",value);} void setMountDir(const QString& value){settings.setValue("Options/MountDir",value);} void setOpenLastFile(bool value){settings.setValue("Options/OpenLastFile",value);} + void setAutoSave(bool value){settings.setValue("Options/AutoSave",value);} void setPwGenCharList(const QString& value){settings.setValue("Options/PwGenCharList",value);} void setPwGenLength(int value){settings.setValue("Options/PwGenLength",value);} void setPwGenOptions(const QBitArray& value){settings.setValue("Options/PwGenOptions",bitArrayToString(value));} diff --git a/src/dialogs/AutoTypeDlg.cpp b/src/dialogs/AutoTypeDlg.cpp index 422d0e5..8b7bbe1 100644 --- a/src/dialogs/AutoTypeDlg.cpp +++ b/src/dialogs/AutoTypeDlg.cpp @@ -25,21 +25,25 @@ AutoTypeDlg::AutoTypeDlg(QList entries, QList numbers){ setupUi(this); - createBanner(&BannerPixmap,getPixmap("keepassx_large"),tr("Auto-Type"),width()); + setAttribute(Qt::WA_DeleteOnClose); setWindowFlags(windowFlags()|Qt::WindowStaysOnTopHint); setGeometry( QRect(QApplication::desktop()->screenGeometry(QCursor::pos()).center() - rect().center(), size()) ); setWindowIcon(getIcon("keepassx")); entryList->setAlternatingRowColors(config->alternatingRowColors()); + bool hideUsernames = config->hideUsernames(); + if (hideUsernames) + entryList->setHeaderLabels(QStringList() << tr("Group") << tr("Title")); + else + entryList->setHeaderLabels(QStringList() << tr("Group") << tr("Title") << tr("Username")); + QList itemList; AutoTypeEntry autoTypeEntry; for (int i=0; igroup()->title() << entries[i]->title(); - if (config->hideUsernames()) - cols << "****"; - else + if (!hideUsernames) cols << entries[i]->username(); QTreeWidgetItem* widgetItem = new QTreeWidgetItem(cols); @@ -55,7 +59,12 @@ AutoTypeDlg::AutoTypeDlg(QList entries, QList numbers){ entryList->resizeColumnToContents(0); entryList->resizeColumnToContents(1); - entryList->resizeColumnToContents(2); + if (!hideUsernames) + entryList->resizeColumnToContents(2); + + entryList->setColumnWidth(0, entryList->columnWidth(0)+10); + if (!hideUsernames) + entryList->setColumnWidth(1, entryList->columnWidth(1)+10); connect(ButtonBox, SIGNAL(rejected()), SLOT(close())); connect(entryList, SIGNAL(itemClicked(QTreeWidgetItem*,int)), SLOT(itemSelected(QTreeWidgetItem*))); @@ -77,6 +86,10 @@ void AutoTypeDlg::paintEvent(QPaintEvent* event){ painter.drawPixmap(QPoint(0,0),BannerPixmap); } +void AutoTypeDlg::resizeEvent(QResizeEvent* event){ + createBanner(&BannerPixmap,getPixmap("keepassx_large"),tr("Auto-Type"),width()); +} + void AutoTypeDlg::itemSelected(QTreeWidgetItem* item){ close(); QString err; diff --git a/src/dialogs/AutoTypeDlg.h b/src/dialogs/AutoTypeDlg.h index 6f4ba9c..056115b 100644 --- a/src/dialogs/AutoTypeDlg.h +++ b/src/dialogs/AutoTypeDlg.h @@ -29,6 +29,7 @@ class AutoTypeDlg : public QWidget, private Ui::AutoTypeDlg protected: void paintEvent(QPaintEvent* event); + void resizeEvent(QResizeEvent* event); private slots: void itemSelected(QTreeWidgetItem* item); diff --git a/src/dialogs/ManageBookmarksDlg.cpp b/src/dialogs/ManageBookmarksDlg.cpp index 6a8e9fd..192c9ad 100644 --- a/src/dialogs/ManageBookmarksDlg.cpp +++ b/src/dialogs/ManageBookmarksDlg.cpp @@ -26,7 +26,6 @@ ManageBookmarksDlg::ManageBookmarksDlg(QWidget* parent):QDialog(parent) { setupUi(this); - createBanner(&BannerPixmap,getPixmap("bookmark"),tr("Manage Bookmarks"),width()); for(int i=0;isetChecked(config->startMinimized()); CheckBox_StartLocked->setChecked(config->startLocked()); checkBox_SaveFileDlgHistory->setChecked(config->saveFileDlgHistory()); + CheckBox_AutoSave->setChecked(config->autoSave()); checkBox_AskBeforeDelete->setChecked(config->askBeforeDelete()); switch(config->groupTreeState()){ @@ -211,6 +212,7 @@ void CSettingsDlg::apply(){ else config->setGroupTreeState(KpxConfig::DoNothing); config->setOpenLastFile(CheckBox_OpenLast->isChecked()); config->setRememberLastKey(CheckBox_RememberLastKey->isChecked()); + config->setAutoSave(CheckBox_AutoSave->isChecked()); config->setAskBeforeDelete(checkBox_AskBeforeDelete->isChecked()); //Appearence diff --git a/src/forms/AutoTypeDlg.ui b/src/forms/AutoTypeDlg.ui index c22c180..bbecf6f 100644 --- a/src/forms/AutoTypeDlg.ui +++ b/src/forms/AutoTypeDlg.ui @@ -5,7 +5,7 @@ 0 0 - 502 + 439 300 @@ -23,7 +23,7 @@ - 481 + 1 50 @@ -50,21 +50,9 @@ true - - - Group - - - - - Title - - - - - Username - - + + 0 + diff --git a/src/forms/EditEntryDlg.ui b/src/forms/EditEntryDlg.ui index a2ba552..33849c4 100644 --- a/src/forms/EditEntryDlg.ui +++ b/src/forms/EditEntryDlg.ui @@ -556,11 +556,15 @@ + Combo_Group + Button_Icons Edit_Title Edit_UserName Edit_URL Edit_Password + ButtonEchoMode Edit_Password_w + ButtonGenPw Edit_Comment DateTime_Expire ButtonExpirePresets @@ -569,11 +573,7 @@ ButtonOpenAttachment ButtonSaveAttachment ButtonDeleteAttachment - ButtonEchoMode - ButtonGenPw buttonBox - Combo_Group - Button_Icons diff --git a/src/forms/MainWindow.ui b/src/forms/MainWindow.ui index 133ed72..670da92 100644 --- a/src/forms/MainWindow.ui +++ b/src/forms/MainWindow.ui @@ -154,7 +154,7 @@ - Bookmarks + &Bookmarks @@ -202,7 +202,7 @@ - Toolbar Icon Size + &Toolbar Icon Size @@ -210,7 +210,7 @@ - Columns + &Columns @@ -253,7 +253,7 @@ - Manage Bookmarks... + &Manage Bookmarks... @@ -366,7 +366,7 @@ true - Show Entry Details + Show &Entry Details @@ -374,7 +374,7 @@ true - Hide Usernames + Hide &Usernames @@ -382,7 +382,7 @@ true - Hide Passwords + Hide &Passwords @@ -390,7 +390,7 @@ true - Title + &Title @@ -398,7 +398,7 @@ true - Username + User&name @@ -406,7 +406,7 @@ true - URL + &URL @@ -414,7 +414,7 @@ true - Password + &Password @@ -422,7 +422,7 @@ true - Comment + &Comment @@ -430,7 +430,7 @@ true - Expires + E&xpires @@ -438,7 +438,7 @@ true - Creation + C&reation @@ -446,7 +446,7 @@ true - Last Change + &Last Change @@ -454,7 +454,7 @@ true - Last Access + Last &Access @@ -462,7 +462,7 @@ true - Attachment + A&ttachment @@ -480,7 +480,7 @@ true - Show Statusbar + Show &Statusbar @@ -506,7 +506,7 @@ true - 16x16 + &16x16 @@ -514,7 +514,7 @@ true - 22x22 + &22x22 @@ -522,7 +522,7 @@ true - 28x28 + 2&8x28 @@ -553,12 +553,12 @@ true - Group (search results only) + &Group (search results only) - Show Expired Entries... + Show &Expired Entries... @@ -571,12 +571,12 @@ - Add Bookmark... + &Add Bookmark... - Bookmark this Database... + Bookmark &this Database... diff --git a/src/forms/PasswordDlg.ui b/src/forms/PasswordDlg.ui index 266f559..a0575a5 100644 --- a/src/forms/PasswordDlg.ui +++ b/src/forms/PasswordDlg.ui @@ -317,12 +317,13 @@ Edit_Password + ButtonChangeEchoMode Edit_PasswordRep Combo_Dirs ButtonBrowse CheckBox_Both + ButtonBox Button_Bookmarks - ButtonChangeEchoMode diff --git a/src/forms/PasswordGenDlg.ui b/src/forms/PasswordGenDlg.ui index 7047782..ad70f81 100644 --- a/src/forms/PasswordGenDlg.ui +++ b/src/forms/PasswordGenDlg.ui @@ -10,9 +10,7 @@ - - 4 - 4 + 0 0 @@ -21,12 +19,21 @@ Password Generator - - 9 - 6 + + 9 + + + 9 + + + 9 + + + 9 + @@ -49,12 +56,21 @@ Options - - 9 - 6 + + 9 + + + 9 + + + 9 + + + 9 + @@ -67,12 +83,21 @@ - - 0 - 6 + + 0 + + + 0 + + + 0 + + + 0 + @@ -91,10 +116,22 @@ - + + 0 + + 0 - + + 0 + + + 0 + + + 6 + + 6 @@ -202,12 +239,21 @@ - - 0 - 6 + + 0 + + + 0 + + + 0 + + + 0 + @@ -251,12 +297,21 @@ - - 0 - 6 + + 0 + + + 0 + + + 0 + + + 0 + @@ -266,12 +321,12 @@ - - 10000 - 1 + + 10000 + 20 @@ -303,9 +358,7 @@ - - 7 - 1 + 0 0 @@ -331,12 +384,21 @@ - - 0 - 6 + + 0 + + + 0 + + + 0 + + + 0 + @@ -393,12 +455,21 @@ - - 0 - 6 + + 0 + + + 0 + + + 0 + + + 0 + @@ -445,6 +516,7 @@ + DialogButtons Radio_1 checkBox1 checkBox2 @@ -455,7 +527,9 @@ checkBox7 Radio_2 Edit_chars + Spin_Num Check_CollectEntropy + Check_CollectOncePerSession Edit_dest ButtonGenerate diff --git a/src/forms/SearchDlg.ui b/src/forms/SearchDlg.ui index fcd885d..570e9a8 100644 --- a/src/forms/SearchDlg.ui +++ b/src/forms/SearchDlg.ui @@ -270,12 +270,14 @@ Edit_Search checkBox_Cs checkBox_regExp + checkBox_Recursive checkBox_Title checkBox_Username checkBox_Password checkBox_Comment checkBox_URL checkBox_Attachment + ButtonBox diff --git a/src/forms/SettingsDlg.ui b/src/forms/SettingsDlg.ui index ebb82ce..c136e1b 100644 --- a/src/forms/SettingsDlg.ui +++ b/src/forms/SettingsDlg.ui @@ -299,6 +299,13 @@ + + + + Automatically save database on exit + + + @@ -1280,7 +1287,7 @@ - Use entry titles to match the window for Global Auto-Type + Use entries' title to match the window for Global Auto-Type @@ -1352,6 +1359,11 @@ IntPlugin_Button_Config SpinBox_AutoTypePreGap SpinBox_AutoTypeKeyStrokeDelay + Box_BrowserCmd + Edit_BrowserCmd + Button_BrowserCmdBrowse + Edit_MountDir + Button_MountDirBrowse CheckBox_SaveRelativePaths Edit_GlobalShortcut CheckBox_EntryTitlesMatch diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 9183362..c6466e9 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -38,7 +38,7 @@ #include -#include "KpxFirefox.h" +//#include "KpxFirefox.h" #include "lib/random.h" #include "lib/AutoType.h" #include "lib/FileDialogs.h" @@ -357,8 +357,9 @@ void KeepassMainWindow::setupMenus(){ _add_export(export_Txt); _add_export(export_KeePassX_Xml); - //FileNewMenu->setShortcut(tr("Ctrl+N")); + FileNewAction->setShortcut(tr("Ctrl+N")); FileOpenAction->setShortcut(tr("Ctrl+O")); + FileCloseAction->setShortcut(tr("Ctrl+W")); FileSaveAction->setShortcut(tr("Ctrl+S")); FileUnLockWorkspaceAction->setShortcut(tr("Ctrl+L")); FileExitAction->setShortcut(tr("Ctrl+Q")); @@ -371,11 +372,12 @@ void KeepassMainWindow::setupMenus(){ EditDeleteEntryAction->setShortcut(tr("Ctrl+D")); EditCloneEntryAction->setShortcut(tr("Ctrl+K")); EditSearchAction->setShortcut(tr("Ctrl+F")); + ExtrasPasswordGenAction->setShortcut(tr("Ctrl+P")); + ExtrasShowExpiredEntriesAction->setShortcut(tr("Ctrl+X")); #ifdef AUTOTYPE EditAutoTypeAction->setShortcut(tr("Ctrl+V")); #endif #ifdef Q_WS_MAC - FileCloseAction->setShortcut(tr("Ctrl+W")); FileSaveAsAction->setShortcut(tr("Shift+Ctrl+S")); EditGroupSearchAction->setShortcut(tr("Shift+Ctrl+F")); #endif @@ -471,11 +473,17 @@ bool KeepassMainWindow::closeDatabase(bool lock){ Q_ASSERT(FileOpen); Q_ASSERT(db!=NULL); if(ModFlag){ - int r=QMessageBox::question(this,tr("Save modified file?"), - tr("The current file was modified. Do you want\nto save the changes?"),tr("Yes"),tr("No"),tr("Cancel"),2,2); - if(r==2)return false; //Abbrechen - if(r==0) //Ja (Datei speichern) - if(!OnFileSave())return false; + if(config->autoSave()){ + if(!OnFileSave()) return false; + } + else{ + QMessageBox::StandardButton r=QMessageBox::question(this,tr("Save modified file?"), + 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(!OnFileSave()) return false; + } } db->close(); delete db; diff --git a/todo b/todo index deb35ad..5f0beb1 100644 --- a/todo +++ b/todo @@ -1,8 +1,5 @@ -Database: - -need to change the interface of the generic Database class so that no direct references - or pointers to group or entry objects are used: - 1. approach: CEntry e=getEntry( ...by any attrib...); //get a COPY - e.Title="Blubb"; - setEntey(e); - 2. approach: EntryID id=getEntryID(...by any attrib...); //get an ID (maybe the list index) - setEntryTitle(id,"Blubb"); \ No newline at end of file +Mass modify entries +Backup group (exclude from search) +Improve password generator +Manually select language +kde4 plugin: clear klipper history \ No newline at end of file