diff --git a/src/PwmConfig.cpp b/src/PwmConfig.cpp index ac7f6b1..199d086 100755 --- a/src/PwmConfig.cpp +++ b/src/PwmConfig.cpp @@ -24,6 +24,17 @@ #include using namespace std; +#ifdef Q_WS_MAC + #define DEFAULT_MOUNT_DIR "/Volumes/" +#endif +#ifdef Q_WS_X11 + #define DEFAULT_MOUNT_DIR "/media/" +#endif +#ifdef Q_WS_WIN + #define DEFAULT_MOUNT_DIR "/" +#endif + + bool CConfig::loadFromIni(QString filename){ ini.SetPath((const char*)filename); ini.ReadFile(); @@ -54,6 +65,11 @@ MainWinSplit2=ini.GetValueI("UI","MainWinSplit2",300); ParseIntString(ini.GetValue("UI","ColumnSizes","15,10,10,10,10,10,10,10,10,10").c_str(),ColumnSizes,10); ShowStatusbar=ini.GetValueB("UI","ShowStatusbar",true); AlternatingRowColors=ini.GetValueB("Options","AlternatingRowColors",true); +MountDir=ini.GetValue("Options","MountDir",DEFAULT_MOUNT_DIR).c_str(); +RememberLastKey=ini.GetValueB("Options","RememberLastKey",true); +LastKeyLocation=ini.GetValue("Options","LastKeyLocation","").c_str(); +LastKeyType=(tKeyType)ini.GetValueI("Option","LastKeyType",(int)PASSWORD); +if(!OpenLast)RememberLastKey=false; return true; } @@ -85,6 +101,14 @@ ini.SetValueI("UI","MainWinSplit2",MainWinSplit2); ini.SetValue("UI","ColumnSizes",(const char*)CreateIntString(ColumnSizes,10),true); ini.SetValueB("UI","ShowStatusbar",ShowStatusbar); ini.SetValueB("Options","AlternatingRowColors",AlternatingRowColors); +ini.SetValue("Options","MountDir",(const char*)MountDir); +ini.SetValueB("Options","RememberLastKey",RememberLastKey); +if(RememberLastKey){ + ini.SetValue("Options","LastKeyLocation",(const char*)LastKeyLocation); + ini.SetValueI("Options","LastKeyType",LastKeyType);} +else{ + ini.SetValue("Options","LastKeyLocation",""); + ini.SetValueI("Options","LastKeyType",0);} if(!ini.WriteFile())return false; else return true; } diff --git a/src/PwmConfig.h b/src/PwmConfig.h index 23e0456..289d517 100755 --- a/src/PwmConfig.h +++ b/src/PwmConfig.h @@ -20,6 +20,7 @@ #ifndef _PWMCONFIG_H_ #define _PWMCONFIG_H_ +#include "main.h" #include "lib/IniReader.h" #include @@ -53,6 +54,10 @@ public: int ColumnSizes[10]; bool ShowStatusbar; bool AlternatingRowColors; + QString MountDir; + bool RememberLastKey; //location and type, not the key itself + tKeyType LastKeyType; + QString LastKeyLocation; bool loadFromIni(QString filename); bool saveToIni(QString filename); diff --git a/src/dialogs/ChangeKeyDlg.cpp b/src/dialogs/ChangeKeyDlg.cpp index fa0a207..f248b11 100755 --- a/src/dialogs/ChangeKeyDlg.cpp +++ b/src/dialogs/ChangeKeyDlg.cpp @@ -18,6 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "main.h" +#include "PwmConfig.h" #include "PwManager.h" #include "../lib/random.h" #include "ChangeKeyDlg.h" @@ -93,7 +94,7 @@ Q_UINT8 pw_key[32]={0}; if(keyfile!=""){ QFile file(keyfile); if(file.exists()){ -int r=QMessageBox::warning(this,tr("Overwrite?"),tr("A file with this name already exists.\nDo you want to replace it?"),"Yes","No",NULL,1,1); +int r=QMessageBox::warning(this,tr("Overwrite?"),tr("A key file with this name already exists.\nDo you want to replace it?"),"Yes","No",NULL,1,1); if(r==1)return;} getRandomBytes(file_key,1,32,true); if(file.open(QIODevice::WriteOnly | QIODevice::Truncate)==false){ diff --git a/src/dialogs/EditEntryDlg.cpp b/src/dialogs/EditEntryDlg.cpp index 42de514..25a0b96 100755 --- a/src/dialogs/EditEntryDlg.cpp +++ b/src/dialogs/EditEntryDlg.cpp @@ -18,7 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "main.h" - +#include "PwmConfig.h" #include #include #include diff --git a/src/dialogs/PasswordDlg.cpp b/src/dialogs/PasswordDlg.cpp index 2a61417..b4d3c4c 100755 --- a/src/dialogs/PasswordDlg.cpp +++ b/src/dialogs/PasswordDlg.cpp @@ -19,30 +19,24 @@ ***************************************************************************/ #include "main.h" - +#include "PwmConfig.h" #include "PasswordDlg.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - +#include +#include +#include +#include +#include +#include +#include +#include -CPasswordDialog::CPasswordDialog(QWidget* parent, const char* name, bool modal, bool ShowExitButton, Qt::WFlags fl) +CPasswordDialog::CPasswordDialog(QWidget* parent, const char* name, bool modal, bool ShowExitButton,bool ChangeKeyMode, Qt::WFlags fl) : QDialog(parent,name, modal,fl) { setupUi(this); -ButtonExit->setVisible(ShowExitButton); -createBanner(Banner,Icon_Key32x32,tr("Open Database")); -Label_select=new LinkLabel((QWidget*)groupframe,"Select",tr("Select File Manually..."),410,100); -connect( Combo_Dirs, SIGNAL( activated(int) ), this, SLOT( OnComboSelectionChanged(int) ) ); -connect( ButtonBrowse, SIGNAL( clicked() ), this, SLOT( OnButtonBrowse() ) ); -connect( ButtonOK, SIGNAL( clicked() ), this, SLOT( OnOK() ) ); +createBanner(Banner,Icon_Key32x32,tr("Database Key")); +connect( Combo_Dirs, SIGNAL( editTextChanged(const QString&) ),this, SLOT( OnComboTextChanged(const QString&))); connect( ButtonCancel, SIGNAL( clicked() ), this, SLOT( OnCancel() ) ); connect( Edit_Password, SIGNAL( textChanged(const QString&) ), this, SLOT( OnPasswordChanged(const QString&) ) ); connect( CheckBox_Both, SIGNAL( stateChanged(int) ), this, SLOT( OnCheckBox_BothChanged(int) ) ); @@ -50,99 +44,85 @@ connect( ButtonChangeEchoMode, SIGNAL( clicked() ), this, SLOT( ChangeEchoMode() connect( Edit_Password, SIGNAL( returnPressed() ), this, SLOT( OnOK() ) ); connect( ButtonExit, SIGNAL( clicked()),this,SLOT(OnButtonExit())); -QDir media("/media"); -if(media.exists()){ -Paths=media.entryList("*",QDir::Dirs); -Paths.erase(Paths.begin()); // delete "." -Paths.erase(Paths.begin()); // delete ".." - -for(int i=0;i")); -} -for(int i=0;iinsertItem(0,Paths[i]); -IsFile.append(false); +ButtonExit->setVisible(ShowExitButton); +Mode_Set=ChangeKeyMode; +if(!ChangeKeyMode){ + Edit_PasswordRep->hide(); + Label_PasswordRep->hide(); + connect( ButtonOK, SIGNAL( clicked() ), this, SLOT( OnOK() ) ); + connect( ButtonBrowse, SIGNAL( clicked() ), this, SLOT( OnButtonBrowse() ) ); +}else{ + connect( ButtonOK, SIGNAL( clicked() ), this, SLOT( OnOK_Set() ) ); + connect( ButtonBrowse, SIGNAL( clicked() ), this, SLOT( OnButtonBrowse_Set() ) ); } -if(!config.ShowPasswords)ChangeEchoMode(); + +QDir media(config.MountDir); +if(media.exists()){ + QStringList Paths; + Paths=media.entryList("*",QDir::Dirs); + Paths.erase(Paths.begin()); // delete "." + Paths.erase(Paths.begin()); // delete ".." + for(int i=0;iaddItem(config.MountDir+Paths[i]); } -CPasswordDialog::~CPasswordDialog() -{ -delete Label_select; +Combo_Dirs->setEditText(QString()); +if(!config.ShowPasswords)ChangeEchoMode(); } -void CPasswordDialog::OnComboSelectionChanged(int i) -{ -if(i==0){ -keyfile=""; + +void CPasswordDialog::setStatePasswordOnly(){ +Combo_Dirs->setEnabled(false); +ButtonBrowse->setEnabled(false); +Label_KeyFile->setEnabled(false); +Label_Password->setEnabled(true); Edit_Password->setEnabled(true); -return; +ButtonChangeEchoMode->setEnabled(true); +KeyType=PASSWORD; } -QFile file; -if(IsFile[i]==true)file.setName(Paths[i]); -else file.setName(Paths[i]+"/pwsafe.key"); -if(file.exists()){ -keyfile=file.name(); -if(!CheckBox_Both->isChecked()){ -Edit_Password->setText(""); -Edit_Password->setDisabled(true);} -return; -} -QMessageBox::warning(this,tr("No key file found"),tr( -"No key file could be found in the chosen directory.\n\ -Make sure that the volume is mounted correctly.\n\ -Please use the manual file selection for key files with a filename other than 'pwsafe.key'.") -,tr("OK"),"","",0,0); + +void CPasswordDialog::setStateKeyFileOnly(){ +Combo_Dirs->setEnabled(true); +ButtonBrowse->setEnabled(true); +Label_KeyFile->setEnabled(true); +Label_Password->setEnabled(false); +Edit_Password->setEnabled(false); +ButtonChangeEchoMode->setEnabled(false); +KeyType=KEYFILE; +} + + +void CPasswordDialog::setStateBoth(){ +Combo_Dirs->setEnabled(true); +ButtonBrowse->setEnabled(true); +Label_KeyFile->setEnabled(true); +Label_Password->setEnabled(true); Edit_Password->setEnabled(true); -Combo_Dirs->setCurrentItem(0); -return; +ButtonChangeEchoMode->setEnabled(true); +KeyType=BOTH; } void CPasswordDialog::OnButtonBrowse() { -QString dir=Q3FileDialog::getExistingDirectory(QDir::homeDirPath(),NULL,tr("Browse...")); -if(dir=="")return; -QFile file(dir+"/pwsafe.key"); +QString filename=QFileDialog::getOpenFileName(this,tr("Select a Key File"),QDir::homeDirPath(),tr("*.key")); +if(filename=="")return; +QFile file(filename); if(file.exists()){ -keyfile=dir+"/pwsafe.key"; -Combo_Dirs->insertItem(dir); -Combo_Dirs->setCurrentItem(Combo_Dirs->count()-1); -if(!CheckBox_Both->isChecked()){ - Edit_Password->setDisabled(true); - Edit_Password->setText(""); - password=""; -} -Paths.append(dir); -IsFile.append(false); -return;} -QMessageBox::warning(this,tr("No key file found"),tr( -"No key file could be found in the chosen directory.\n\ -Make sure that the volume is mounted correctly.\n\ -Please use the manual file selection for key files with a filename other than 'pwsafe.key'.") -,tr("OK"),"","",0,0); -} - -void CPasswordDialog::OnSelectClicked() -{ -if(ButtonBrowse->isEnabled()){ -keyfile=Q3FileDialog::getOpenFileName(QDir::homeDirPath(),"",this,tr("Open Key File")); -if(keyfile=="")return; -Combo_Dirs->insertItem(keyfile); -Combo_Dirs->setCurrentItem(Combo_Dirs->count()-1); -if(!CheckBox_Both->isChecked()){ - Edit_Password->setDisabled(true); - Edit_Password->setText(""); - password=""; + Combo_Dirs->setEditText(filename); + return; } -Paths.append(keyfile); -IsFile.append(true); +QMessageBox::warning(this,tr("Error"),tr("Unexpected Error: File does not exist."),tr("OK"),"","",0,0); } + +void CPasswordDialog::OnButtonBrowse_Set() +{ +QString filename=QFileDialog::getSaveFileName(this,tr("Select a Key File"),QDir::homeDirPath(),tr("*.key")); +if(filename=="")return; +Combo_Dirs->setEditText(filename); } void CPasswordDialog::OnCancel() @@ -150,62 +130,117 @@ void CPasswordDialog::OnCancel() done(0); } -void CPasswordDialog::OnOK() -{ - -if(CheckBox_Both->isChecked()){ - if(password==""){QMessageBox::warning(this,tr("Error"),tr("Please enter a Password.") - ,tr("OK"),"","",0,0); - return;} - if(keyfile==""){QMessageBox::warning(this,tr("Error"),tr("Please choose a key file.") - ,tr("OK"),"","",0,0); - return;} -} -else -{ - if(password=="" && keyfile==""){QMessageBox::warning(this,tr("Error") - ,tr("Please enter a Password or select a key file.") - ,tr("OK"),"","",0,0); - return;} +void CPasswordDialog::OnOK(){ +password=Edit_Password->text(); +keyfile=Combo_Dirs->currentText(); + +if(password=="" && keyfile==""){ + QMessageBox::warning(this,tr("Error"),tr("Please enter a Password or select a key file."),tr("OK"),"","",0,0); + return;} + +if(KeyType==BOTH){ + if(password==""){ + QMessageBox::warning(this,tr("Error"),tr("Please enter a Password."),tr("OK"),"","",0,0); + return;} + if(keyfile==""){ + QMessageBox::warning(this,tr("Error"),tr("Please choose a key file."),tr("OK"),"","",0,0); + return;} +} + +if(KeyType==BOTH || KeyType==KEYFILE){ + QFileInfo fileinfo(keyfile); + if(!fileinfo.exists()){ + QMessageBox::warning(this,tr("Error"),tr("The selected key file or directory does not exist."),tr("OK"),"","",0,0); + return; + } + if(!fileinfo.isReadable()){ + QMessageBox::warning(this,tr("Error"),tr("The selected key file or directory is not readable\n.Please check your permissions."),tr("OK"),"","",0,0); + return; + } + if(fileinfo.isDir()){ + if(keyfile.right(1)!="/")keyfile+="/"; + QFile file(keyfile+"pwsafe.key"); + if(!file.exists()){ + QDir dir(keyfile); + QStringList files; + files=dir.entryList("*.key",QDir::Files); + if(!files.size()){ + QMessageBox::warning(this,tr("Error"),tr("The given directory does not contain any key files."),tr("OK"),"","",0,0); + return;} + if(files.size()>1){ + QMessageBox::warning(this,tr("Error"),tr("The given directory contains more then one key file.\nPlease specify the key file directly."),tr("OK"),"","",0,0); + return;} + QFile file(keyfile+files[0]); + Q_ASSERT(file.exists()); + if(!QFileInfo(file).isReadable()){ + QMessageBox::warning(this,tr("Error"),tr("The key file found in the given directory is not readable.\nPlease check your permissions."),tr("OK"),"","",0,0); + return;} + keyfile+=files[0]; + }else{ + if(!QFileInfo(file).isReadable()){ + QMessageBox::warning(this,tr("Error"),tr("The key file found in the given directory is not readable.\nPlease check your permissions."),tr("OK"),"","",0,0); + return;} + keyfile+="pwsafe.key"; + } + }else{ + QFile file(keyfile); + if(!file.exists()){ + QMessageBox::warning(this,tr("Error"),tr("Key file could not be found."),tr("OK"),"","",0,0); + return;} + if(!QFileInfo(file).isReadable()){ + QMessageBox::warning(this,tr("Error"),tr("Key file is not readable.\nPlease check your permissions."),tr("OK"),"","",0,0); + return;} + } } done(1); } -void CPasswordDialog::OnPasswordChanged(const QString &txt) -{ -password=Edit_Password->text(); -if(txt!="" && !(CheckBox_Both->isChecked())){ -Combo_Dirs->setDisabled(true); -ButtonBrowse->setDisabled(true);} -else{ -Combo_Dirs->setEnabled(true); -ButtonBrowse->setEnabled(true);} +void CPasswordDialog::OnOK_Set(){ + + } -void CPasswordDialog::OnCheckBox_BothChanged(int state) -{ -if(state==QCheckBox::On){ -Combo_Dirs->setEnabled(true); -ButtonBrowse->setEnabled(true); -Edit_Password->setEnabled(true);} -else{ -Edit_Password->setText(""); +void CPasswordDialog::OnPasswordChanged(const QString &txt){ +if(CheckBox_Both->isChecked() || txt==QString()) + setStateBoth(); +else + setStatePasswordOnly(); } + +void CPasswordDialog::OnComboTextChanged(const QString& txt){ +if(CheckBox_Both->isChecked() || txt==QString()) + setStateBoth(); +else + setStateKeyFileOnly(); } -void CPasswordDialog::ChangeEchoMode() -{ -if(Edit_Password->echoMode()==QLineEdit::Normal){ -Edit_Password->setEchoMode(QLineEdit::Password); + +void CPasswordDialog::OnCheckBox_BothChanged(int state){ +if(state==Qt::Checked) + setStateBoth(); +if(state==Qt::Unchecked){ + if(Edit_Password->text()!=QString() && Combo_Dirs->currentText()!=QString()){ + Combo_Dirs->setEditText(QString()); + setStatePasswordOnly(); + } + else{ + if(Edit_Password->text()==QString()) + setStateKeyFileOnly(); + else + setStatePasswordOnly(); + } + } -else -{ -Edit_Password->setEchoMode(QLineEdit::Normal); } +void CPasswordDialog::ChangeEchoMode(){ +if(Edit_Password->echoMode()==QLineEdit::Normal) + Edit_Password->setEchoMode(QLineEdit::Password); +else + Edit_Password->setEchoMode(QLineEdit::Normal); } diff --git a/src/dialogs/PasswordDlg.h b/src/dialogs/PasswordDlg.h index 8b826b4..204549f 100755 --- a/src/dialogs/PasswordDlg.h +++ b/src/dialogs/PasswordDlg.h @@ -22,43 +22,36 @@ #define PASSWORDDIALOG_H #include "lib/UrlLabel.h" #include "ui_PasswordDlg.h" -//Added by qt3to4: -#include class CPasswordDialog : public QDialog, public Ui_PasswordDlg { Q_OBJECT private: -int NumComboEntries; -QStringList Paths; -Q3ValueList IsFile; -LinkLabel* Label_select; - +bool Mode_Set; //true = Set, false = Get +void setStatePasswordOnly(); +void setStateKeyFileOnly(); +void setStateBoth(); public: - QString keyfile; QString password; +tKeyType KeyType; - - -public: - CPasswordDialog(QWidget* parent = 0, const char* name = 0, bool modal = false, - bool ShowExitButton = false, Qt::WFlags fl = 0 ); - ~CPasswordDialog(); +CPasswordDialog(QWidget* parent = 0, const char* name = 0, bool modal = false, + bool ShowExitButton = false, bool KeyMode_Set=false, Qt::WFlags fl = 0 ); public slots: - virtual void OnOK(); - virtual void OnCancel(); - virtual void OnSelectClicked(); - virtual void OnButtonBrowse(); - virtual void OnButtonExit(); - virtual void OnComboSelectionChanged(int); - virtual void OnPasswordChanged(const QString &txt); - virtual void OnCheckBox_BothChanged(int state); - virtual void ChangeEchoMode(); - + void OnOK(); + void OnOK_Set(); + void OnCancel(); + void OnButtonBrowse(); + void OnButtonBrowse_Set(); + void OnButtonExit(); + void OnPasswordChanged(const QString &txt); + void OnCheckBox_BothChanged(int state); + void ChangeEchoMode(); + void OnComboTextChanged(const QString&); }; #endif diff --git a/src/dialogs/SearchDlg.cpp b/src/dialogs/SearchDlg.cpp index a60dc8b..17909a4 100755 --- a/src/dialogs/SearchDlg.cpp +++ b/src/dialogs/SearchDlg.cpp @@ -19,6 +19,7 @@ ***************************************************************************/ #include "main.h" +#include "PwmConfig.h" #include "PwManager.h" #include "SearchDlg.h" #include diff --git a/src/dialogs/SettingsDlg.cpp b/src/dialogs/SettingsDlg.cpp index 6a26140..ee5c130 100755 --- a/src/dialogs/SettingsDlg.cpp +++ b/src/dialogs/SettingsDlg.cpp @@ -18,6 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "main.h" +#include "PwmConfig.h" #include #include #include @@ -62,6 +63,7 @@ CheckBox_ShowPasswords->setChecked(config.ShowPasswords); Edit_BrowserCmd->setText(config.OpenUrlCommand); CheckBox_ExpandGroupTree->setChecked(config.ExpandGroupTree); CheckBox_AlternatingRowColors->setChecked(config.AlternatingRowColors); +Edit_MountDir->setText(config.MountDir); } @@ -80,6 +82,9 @@ config.ShowPasswords=CheckBox_ShowPasswords->isChecked(); config.OpenUrlCommand=Edit_BrowserCmd->text(); config.ExpandGroupTree=CheckBox_ExpandGroupTree->isChecked(); config.AlternatingRowColors=CheckBox_AlternatingRowColors->isChecked(); +config.MountDir=Edit_MountDir->text(); +if(config.MountDir!="" && config.MountDir.right(1)!="/") + config.MountDir+="/"; close(); } diff --git a/src/forms/PasswordDlg.ui b/src/forms/PasswordDlg.ui index 6c00480..b293482 100644 --- a/src/forms/PasswordDlg.ui +++ b/src/forms/PasswordDlg.ui @@ -9,7 +9,7 @@ 0 0 578 - 270 + 275 @@ -23,13 +23,13 @@ 578 - 270 + 275 578 - 270 + 275 @@ -66,7 +66,7 @@ 10 - 230 + 240 561 31 @@ -114,34 +114,13 @@ - - - - 10 - 60 - 459 - 16 - - - - - 7 - 4 - 0 - 0 - - - - Enter a Password and/or choose a key file. - - 10 80 561 - 141 + 151 @@ -158,16 +137,16 @@ Qt::Vertical - + 10 - 30 - 531 - 30 + 20 + 541 + 123 - + 0 @@ -175,142 +154,170 @@ 6 - - - - 5 - 5 - 0 - 0 - + + + 0 - - Password: + + 6 - + + + + TextLabel + + + + + + + + + + + 5 + 5 + 0 + 0 + + + + Password: + + + + + + + ... + + + + + + + - - - - - - ... + + + 0 - - - - - - - - 10 - 60 - 531 - 30 - - - - - 0 - - - 6 - - - - - - 5 - 5 - 0 - 0 - + + 6 - - Key file or directory: - - + + + + + 5 + 5 + 0 + 0 + + + + Key file or directory: + + + + + + + + 7 + 0 + 0 + 0 + + + + true + + + + + + + + 5 + 0 + 0 + 0 + + + + &Browse... + + + Alt+B + + + + - - - - 7 - 0 - 0 - 0 - - - - - - - - - 5 - 0 - 0 - 0 - - - - &Browse... + + + 0 - - Alt+B + + 6 - - - - - - - - 10 - 90 - 531 - 30 - - - - - 0 - - - 6 - - - - - - 0 - 0 - 0 - 0 - - - - Use Password AND Key File - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - + + + + + 0 + 0 + 0 + 0 + + + + Use Password AND Key File + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 10 + 60 + 459 + 16 + + + + + 7 + 4 + 0 + 0 + + + + Enter a Password and/or choose a key file. + + diff --git a/src/forms/SettingsDlg.ui b/src/forms/SettingsDlg.ui index 7f2a4a9..e430803 100644 --- a/src/forms/SettingsDlg.ui +++ b/src/forms/SettingsDlg.ui @@ -464,32 +464,49 @@ Alt+Ö - + 10 50 531 - 25 + 58 - + 0 6 - - + + + + Browse... + + + + + Browser Command: - + + + + + + + + Media Directory: + + + @@ -514,7 +531,6 @@ ButtonTextColor ButtonColor2 CheckBox_OpenLast - Edit_BrowserCmd ButtonOK ButtonCancel diff --git a/src/lib/EntryView.cpp b/src/lib/EntryView.cpp index 3cbfc6e..776551a 100644 --- a/src/lib/EntryView.cpp +++ b/src/lib/EntryView.cpp @@ -18,6 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ + #include #include #include @@ -29,6 +30,7 @@ #include #include #include "main.h" +#include "PwmConfig.h" #include "EntryView.h" diff --git a/src/main.h b/src/main.h index b2d3204..8ebc64b 100644 --- a/src/main.h +++ b/src/main.h @@ -25,11 +25,13 @@ #include #include #include -#include "PwmConfig.h" #define KEEPASS_VERSION "0.2.0" #define NUM_CLIENT_ICONS 62 +typedef enum tKeyType {PASSWORD=0,KEYFILE=1,BOTH=2}; +class CConfig; + void createBanner(QLabel *Banner,QPixmap* symbol,QString text); void createBanner(QLabel *Banner,QPixmap* symbol,QString text,QColor color1,QColor color2,QColor textcolor); void openBrowser(QString url); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 76cc0dd..fe745d0 100755 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -246,7 +246,7 @@ CPasswordDialog PasswordDlg(this,"Password Dialog",true,s); PasswordDlg.setCaption(filename); int r=PasswordDlg.exec(); if(r==0) return; -if(r==2) {Start=false; close(); return;} +if(r==2) {Start=false; return;} Q_ASSERT(r==1); db = new PwDatabase(); GroupView->db=db; diff --git a/src/translations/keepass-ru_Ru.ts b/src/translations/keepass-ru_Ru.ts deleted file mode 100644 index 8078fc5..0000000 --- a/src/translations/keepass-ru_Ru.ts +++ /dev/null @@ -1,1497 +0,0 @@ - - - AboutDlg - - About - - - - Homepage: - - - - KeePassX - Cross Platform Password Manager - - - - Email: - - - - Copyright (C) 2005-2006 Tarek Saidi - - - - Thanks To - - - - <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Mattias Miller</span> (www.outofhanwell.com)</p><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Mac OS X Support</p></body></html> - - - - Übersetzung - - - - License - - - - - CAboutDialog - - KeePassX %1 - - - - Error - - - - File '%1' could not be found. - - - - Make sure that the program is installed correctly. - - - - OK - - - - Fehler - - - - Could not open file '%1' - - - - The following error occured: -%1 - - - - http://keepass.berlios.de/index.php - - - - - CChangeKeyDlg - - Change Master Key - - - - Error - - - - Please enter a password. - - - - OK - - - - Please choose a key file. - - - - Please select a key file or enter a password. - - - - Overwrite? - - - - A file with this name already exists. -Do you want to replace it? - - - - Could not open key file for writing. - - - - Key file could not be written. - - - - Password and password repetition are not equal. -Please check your input. - - - - Open key file - - - - Choose Directory - - - - - CDbSettingsDlg - - AES(Rijndael): 256 Bit (default) - - - - Twofish: 256 Bit - - - - Warning - - - - Please determine the number of encryption rounds. - - - - OK - - - - Error - - - - '%1' is not valid integer value. - - - - The number of encryption rounds have to be greater than 0. - - - - - CEditEntryDlg - - Eintrag bearbeiten - - - - Warning - - - - Password and password repetition are not equal. -Please check your input. - - - - OK - - - - Fehler - - - - Datei konnte nicht geöffnet werden. - - - - Save Attachment... - - - - Overwrite? - - - - A file with this name already exists. -Do you want to replace it? - - - - Yes - - - - No - - - - Error - - - - Could not remove old file. - - - - Could not create new file. - - - - Error while writing the file. - - - - Delete Attachment? - - - - You are about to delete the attachment of this entry. -Are you sure? - - - - No, Cancel - - - - - CGenPwDialog - - Notice - - - - You need to enter at least one character - - - - OK - - - - Error - - - - Could not open '/dev/random' or '/dev/urandom'. - - - - - CPasswordDialog - - Datenbank öffnen - - - - Datei manuell wählen... - - - - < keiner > - - - - No key file found - - - - No key file could be found in the chosen directory. -Make sure that the volume is mounted correctly. -Please use the manual file selection for key files with a filename other than 'pwsafe.key'. - - - - OK - - - - Browse... - - - - Open Key File - - - - Error - - - - Please enter a Password. - - - - Please choose a key file. - - - - Please enter a Password or select a key file. - - - - - CSearchDlg - - Suchen - - - - Notice - - - - Please enter a search string. - - - - OK - - - - - CSettingsDlg - - Settings - - - - - ChangeKeyDialog - - Change Master Key - - - - Key - - - - Use password AND key file - - - - Key file or directory: - - - - Password Repetition: - - - - Password: - - - - ... - - - - &Browse... - - - - Alt+B - - - - Enter a Password and/or choose a key file. - - - - &Cancel - - - - Alt+C - - - - O&K - - - - Alt+K - - - - - EditEntryDialog - - Edit Entry - - - - Username: - - - - Password Repet.: - - - - Title: - - - - URL: - - - - Password: - - - - Quality: - - - - Comment: - - - - Expires: - - - - Group: - - - - &Cancel - - - - Alt+C - - - - %1 - - - - Icon: - - - - % Bit - - - - Ge&n. - - - - ... - - - - O&K - - - - Alt+K - - - - Never - - - - Attachment: - - - - - EditGroupDialog - - Group Properties - - - - Title: - - - - Icon: - - - - &Cancel - - - - Alt+C - - - - O&K - - - - Alt+K - - - - - GenPwDlg - - Passwort Generator - - - - Akzep&tieren - - - - Abbre&chen - - - - Generieren - - - - Neues Passwort: - - - - Qualität: - - - - Optionen - - - - Gro&ßbuchstaben - - - - Alt+ß - - - - &Kleinbuchstaben - - - - Alt+K - - - - &Zahlen - - - - Alt+Z - - - - S&onderzeichen - - - - Bindestriche - - - - &Unterstriche - - - - Alt+U - - - - h&öhere ANSI-Zeichen - - - - Alt+ö - - - - &nur folgende Zeichen benutzen: - - - - Alt+N - - - - Zeichenanzahl: - - - - "/dev/rando&m" nutzen (empfohlen) - - - - Alt+M - - - - folgende Zeichengruppen &verwenden: - - - - Alt+V - - - - &Leerzeichen - - - - Alt+L - - - - - KeepassEntryView - - Title - - - - Username - - - - URL - - - - Password - - - - Comments - - - - Expires - - - - Creation - - - - Last Change - - - - Last Access - - - - Attachment - - - - - KeepassGroupView - - Gruppen - - - - Search Results - - - - - KeepassMainWindow - - Bereit - - - - Ctrl+N - - - - Ctrl+O - - - - Ctrl+S - - - - Ctrl+G - - - - Ctrl+C - - - - Ctrl+B - - - - Ctrl+U - - - - Ctrl+Y - - - - Ctrl+E - - - - Ctrl+D - - - - Ctrl+K - - - - Ctrl+F - - - - Ctrl+W - - - - Shift+Ctrl+S - - - - Shift+Ctrl+F - - - - Keepass - %1 - - - - Unknown error in PwDatabase::loadDatabase() - - - - Error - - - - The following error occured while opening the database: -%1 - - - - OK - - - - Save modified file? - - - - The current file was modified. Do you want -to save the changes? - - - - Yes - - - - No - - - - Cancel - - - - KeePassX - %1 - - - - [neu] - - - - Databank öffnen... - - - - <B>Group: </B>%1 <B>Title: </B>%2 <B>Username: </B>%3 <B>URL: </B><a href=%4>%4</a> <B>Password: </B>%5 <B>Creation: </B>%6 <B>Last Change: </B>%7 <B>LastAccess: </B>%8 <B>Expires: </B>%9 - - - - Clone Entry - - - - Delete Entry - - - - Clone Entries - - - - Delete Entries - - - - File could not be saved. -%1 - - - - Save Database As... - - - - - MainWindow - - KeePassX - - - - File - - - - Import from... - - - - Bearbeiten - - - - View - - - - Columns - - - - Extras - - - - Help - - - - New Database... - - - - Open Database... - - - - Close Database - - - - Save Database - - - - Save Database As... - - - - Database Settings... - - - - Change Master Key... - - - - Exit - - - - PwManager File (*.pwm) - - - - KWallet XML-File (*.xml) - - - - Add New Group... - - - - Edit Group... - - - - Delete Group - - - - Copy Password to Clipboard - - - - Copy Username to Clipboard - - - - Open URL - - - - Save Attachment As... - - - - Add New Entry... - - - - View/Edit Entry... - - - - Delete Entry - - - - Clone Entry - - - - Search In Database... - - - - Search in this group... - - - - Show Toolbar - - - - Show Entry Details - - - - Hide Usernames - - - - Hide Passwords - - - - Title - - - - Username - - - - URL - - - - Password - - - - Comment - - - - Expires - - - - Creation - - - - Last Change - - - - Last Access - - - - Attachment - - - - Settings... - - - - About... - - - - - PasswordDlg - - TextLabel - - - - OK - - - - Abbrechen - - - - Geben Sie das Passwort ein oder wählen Sie eine Schlüsseldatei. - - - - Schlüssel - - - - Passwort: - - - - ... - - - - Schlüsseldatei oder Datenträger: - - - - W&ählen... - - - - Alt+Ä - - - - Passwort UND Schlüsseldatei benutzen - - - - - PwDatabase - - Unknown Error - - - - Unexpected file size (DB_TOTAL_SIZE < DB_HEADER_SIZE) - - - - Wrong Signature - - - - Unsupported File Version - - - - Unknown Encryption Algorithm - - - - AES-Init Failed - - - - Decryption failed. -The key is wrong or the file is damaged - - - - Hash test failed. -The key is wrong or the file is damaged - - - - Unexpected error: Offset is out of range. [G1] - - - - Unexpected error: Offset is out of range. [G2] - - - - Unexpected error: Offset is out of range. [E1] - - - - Unexpected error: Offset is out of range. [E2] - - - - Unexpected error: Offset is out of range. [E3] - - - - - QObject - - dd'.'MM'.'yy' 'hh':'mm - - - - Warning - - - - Could not save configuration file. -Make sure you have write access to '~/.keepass'. - - - - OK - - - - Fehler - - - - File '%1' could not be found. - - - - File not found. - - - - Could not open file. - - - - Datei ist leer - - - - File is no valid PwManager file. - - - - Unsupported file version. - - - - Unsupported hash algorithm. - - - - Unsupported encryption algorithm. - - - - Compressed files are not supported yet. - - - - Wrong password. - - - - File is damaged (hash test failed). - - - - Invalid XML data (see stdout for details). - - - - File is empty. - - - - Invalid XML file (see stdout for details). - - - - Invalid XML file. - - - - Document does not contain data. - - - - Warnung: - - - - ungültiger RGB-Farbwert. - - - - - - Search_Dlg - - Suche... - - - - Suchbegriff: - - - - regul&ärer Ausdruck - - - - Alt+Ä - - - - Gro&ß- und Kleinschreibung beachten - - - - Alt+ß - - - - Suche nach - - - - &Titel - - - - Alt+T - - - - Benut&zername - - - - Alt+Z - - - - &Kommentar - - - - Alt+K - - - - &URL - - - - Alt+U - - - - A&nhang - - - - Alt+N - - - - Pass&wort - - - - Alt+W - - - - Suchen - - - - S&chließen - - - - Alt+C - - - - Untergruppen einbeziehen - - - - - SettingsDialog - - Einstellungen - - - - Sicherhei&t - - - - Zwischenablage löschen nach: - - - - Sekunden - - - - Passw&örter standardmäßig in Klartext anzeigen - - - - Alt+Ö - - - - E&rscheinungsbild - - - - Bannerfarbverlauf - - - - Farbe 1 - - - - &ändern... - - - - Alt+Ä - - - - Farbe 2 - - - - ändern... - - - - Textfarbe - - - - Gruppenbaum beim &Öffnen aufklappen - - - - S&onstiges - - - - zuletzt geöffnete Datei bei Programmstart &öffnen - - - - Browseraufruf: - - - - O&K - - - - Alt+K - - - - Abbre&chen - - - - Alt+C - - - - - SimplePasswordDialog - - Passworteingabe - - - - Passwort: - - - - O&K - - - - Alt+K - - - - Abbre&chen - - - - Alt+C - - - - ... - - - - - dbsettingdlg_base - - Database Settings - - - - Encryption - - - - Algorithm: - - - - ? - - - - Encryption Rounds: - - - - O&K - - - - Ctrl+K - - - - &Cancel - - - - Ctrl+C - - - -