work on CPasswordDlg (incomplete)

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@54 b624d157-de02-0410-bad0-e51aec6abb33
master
tariq 19 years ago
parent 853747bce1
commit e0a2197b53
  1. 24
      src/PwmConfig.cpp
  2. 5
      src/PwmConfig.h
  3. 3
      src/dialogs/ChangeKeyDlg.cpp
  4. 2
      src/dialogs/EditEntryDlg.cpp
  5. 301
      src/dialogs/PasswordDlg.cpp
  6. 41
      src/dialogs/PasswordDlg.h
  7. 1
      src/dialogs/SearchDlg.cpp
  8. 5
      src/dialogs/SettingsDlg.cpp
  9. 313
      src/forms/PasswordDlg.ui
  10. 30
      src/forms/SettingsDlg.ui
  11. 2
      src/lib/EntryView.cpp
  12. 4
      src/main.h
  13. 2
      src/mainwindow.cpp
  14. 1497
      src/translations/keepass-ru_Ru.ts

@ -24,6 +24,17 @@
#include <iostream> #include <iostream>
using namespace std; 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){ bool CConfig::loadFromIni(QString filename){
ini.SetPath((const char*)filename); ini.SetPath((const char*)filename);
ini.ReadFile(); 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); 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); ShowStatusbar=ini.GetValueB("UI","ShowStatusbar",true);
AlternatingRowColors=ini.GetValueB("Options","AlternatingRowColors",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; return true;
} }
@ -85,6 +101,14 @@ ini.SetValueI("UI","MainWinSplit2",MainWinSplit2);
ini.SetValue("UI","ColumnSizes",(const char*)CreateIntString(ColumnSizes,10),true); ini.SetValue("UI","ColumnSizes",(const char*)CreateIntString(ColumnSizes,10),true);
ini.SetValueB("UI","ShowStatusbar",ShowStatusbar); ini.SetValueB("UI","ShowStatusbar",ShowStatusbar);
ini.SetValueB("Options","AlternatingRowColors",AlternatingRowColors); 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; if(!ini.WriteFile())return false;
else return true; else return true;
} }

@ -20,6 +20,7 @@
#ifndef _PWMCONFIG_H_ #ifndef _PWMCONFIG_H_
#define _PWMCONFIG_H_ #define _PWMCONFIG_H_
#include "main.h"
#include "lib/IniReader.h" #include "lib/IniReader.h"
#include <qcolor.h> #include <qcolor.h>
@ -53,6 +54,10 @@ public:
int ColumnSizes[10]; int ColumnSizes[10];
bool ShowStatusbar; bool ShowStatusbar;
bool AlternatingRowColors; bool AlternatingRowColors;
QString MountDir;
bool RememberLastKey; //location and type, not the key itself
tKeyType LastKeyType;
QString LastKeyLocation;
bool loadFromIni(QString filename); bool loadFromIni(QString filename);
bool saveToIni(QString filename); bool saveToIni(QString filename);

@ -18,6 +18,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/ ***************************************************************************/
#include "main.h" #include "main.h"
#include "PwmConfig.h"
#include "PwManager.h" #include "PwManager.h"
#include "../lib/random.h" #include "../lib/random.h"
#include "ChangeKeyDlg.h" #include "ChangeKeyDlg.h"
@ -93,7 +94,7 @@ Q_UINT8 pw_key[32]={0};
if(keyfile!=""){ if(keyfile!=""){
QFile file(keyfile); QFile file(keyfile);
if(file.exists()){ 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;} if(r==1)return;}
getRandomBytes(file_key,1,32,true); getRandomBytes(file_key,1,32,true);
if(file.open(QIODevice::WriteOnly | QIODevice::Truncate)==false){ if(file.open(QIODevice::WriteOnly | QIODevice::Truncate)==false){

@ -18,7 +18,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/ ***************************************************************************/
#include "main.h" #include "main.h"
#include "PwmConfig.h"
#include <qpushbutton.h> #include <qpushbutton.h>
#include <qpalette.h> #include <qpalette.h>
#include <qfont.h> #include <qfont.h>

@ -19,30 +19,24 @@
***************************************************************************/ ***************************************************************************/
#include "main.h" #include "main.h"
#include "PwmConfig.h"
#include "PasswordDlg.h" #include "PasswordDlg.h"
#include <qdir.h> #include <QFileDialog>
#include <qstringlist.h> #include <QDir>
#include <qcheckbox.h> #include <QStringList>
#include <q3valuelist.h> #include <QCheckBox>
#include <qlineedit.h> #include <QLineEdit>
#include <qcombobox.h> #include <QComboBox>
#include <qpushbutton.h> #include <QPushButton>
#include <q3filedialog.h> #include <QMessageBox>
#include <qmessagebox.h>
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) : QDialog(parent,name, modal,fl)
{ {
setupUi(this); setupUi(this);
ButtonExit->setVisible(ShowExitButton); createBanner(Banner,Icon_Key32x32,tr("Database Key"));
createBanner(Banner,Icon_Key32x32,tr("Open Database")); connect( Combo_Dirs, SIGNAL( editTextChanged(const QString&) ),this, SLOT( OnComboTextChanged(const QString&)));
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() ) );
connect( ButtonCancel, SIGNAL( clicked() ), this, SLOT( OnCancel() ) ); connect( ButtonCancel, SIGNAL( clicked() ), this, SLOT( OnCancel() ) );
connect( Edit_Password, SIGNAL( textChanged(const QString&) ), this, SLOT( OnPasswordChanged(const QString&) ) ); connect( Edit_Password, SIGNAL( textChanged(const QString&) ), this, SLOT( OnPasswordChanged(const QString&) ) );
connect( CheckBox_Both, SIGNAL( stateChanged(int) ), this, SLOT( OnCheckBox_BothChanged(int) ) ); 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( Edit_Password, SIGNAL( returnPressed() ), this, SLOT( OnOK() ) );
connect( ButtonExit, SIGNAL( clicked()),this,SLOT(OnButtonExit())); connect( ButtonExit, SIGNAL( clicked()),this,SLOT(OnButtonExit()));
QDir media("/media"); ButtonExit->setVisible(ShowExitButton);
if(media.exists()){ Mode_Set=ChangeKeyMode;
Paths=media.entryList("*",QDir::Dirs); if(!ChangeKeyMode){
Paths.erase(Paths.begin()); // delete "." Edit_PasswordRep->hide();
Paths.erase(Paths.begin()); // delete ".." Label_PasswordRep->hide();
connect( ButtonOK, SIGNAL( clicked() ), this, SLOT( OnOK() ) );
for(int i=0;i<Paths.count();i++){ connect( ButtonBrowse, SIGNAL( clicked() ), this, SLOT( OnButtonBrowse() ) );
Paths[i]="/media/"+Paths[i]; }else{
} connect( ButtonOK, SIGNAL( clicked() ), this, SLOT( OnOK_Set() ) );
Paths.prepend(tr("< none >")); connect( ButtonBrowse, SIGNAL( clicked() ), this, SLOT( OnButtonBrowse_Set() ) );
}
for(int i=0;i<Paths.count();i++){
Combo_Dirs->insertItem(0,Paths[i]);
IsFile.append(false);
} }
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;i<Paths.count();i++)
Combo_Dirs->addItem(config.MountDir+Paths[i]);
} }
CPasswordDialog::~CPasswordDialog() Combo_Dirs->setEditText(QString());
{ if(!config.ShowPasswords)ChangeEchoMode();
delete Label_select;
} }
void CPasswordDialog::OnComboSelectionChanged(int i)
{ void CPasswordDialog::setStatePasswordOnly(){
if(i==0){ Combo_Dirs->setEnabled(false);
keyfile=""; ButtonBrowse->setEnabled(false);
Label_KeyFile->setEnabled(false);
Label_Password->setEnabled(true);
Edit_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(); void CPasswordDialog::setStateKeyFileOnly(){
if(!CheckBox_Both->isChecked()){ Combo_Dirs->setEnabled(true);
Edit_Password->setText(""); ButtonBrowse->setEnabled(true);
Edit_Password->setDisabled(true);} Label_KeyFile->setEnabled(true);
return; Label_Password->setEnabled(false);
} Edit_Password->setEnabled(false);
QMessageBox::warning(this,tr("No key file found"),tr( ButtonChangeEchoMode->setEnabled(false);
"No key file could be found in the chosen directory.\n\ KeyType=KEYFILE;
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::setStateBoth(){
Combo_Dirs->setEnabled(true);
ButtonBrowse->setEnabled(true);
Label_KeyFile->setEnabled(true);
Label_Password->setEnabled(true);
Edit_Password->setEnabled(true); Edit_Password->setEnabled(true);
Combo_Dirs->setCurrentItem(0); ButtonChangeEchoMode->setEnabled(true);
return; KeyType=BOTH;
} }
void CPasswordDialog::OnButtonBrowse() void CPasswordDialog::OnButtonBrowse()
{ {
QString dir=Q3FileDialog::getExistingDirectory(QDir::homeDirPath(),NULL,tr("Browse...")); QString filename=QFileDialog::getOpenFileName(this,tr("Select a Key File"),QDir::homeDirPath(),tr("*.key"));
if(dir=="")return; if(filename=="")return;
QFile file(dir+"/pwsafe.key"); QFile file(filename);
if(file.exists()){ if(file.exists()){
keyfile=dir+"/pwsafe.key"; Combo_Dirs->setEditText(filename);
Combo_Dirs->insertItem(dir); return;
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="";
} }
Paths.append(keyfile); QMessageBox::warning(this,tr("Error"),tr("Unexpected Error: File does not exist."),tr("OK"),"","",0,0);
IsFile.append(true);
} }
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() void CPasswordDialog::OnCancel()
@ -150,62 +130,117 @@ void CPasswordDialog::OnCancel()
done(0); done(0);
} }
void CPasswordDialog::OnOK() void CPasswordDialog::OnOK(){
{ password=Edit_Password->text();
keyfile=Combo_Dirs->currentText();
if(CheckBox_Both->isChecked()){
if(password==""){QMessageBox::warning(this,tr("Error"),tr("Please enter a Password.") if(password=="" && keyfile==""){
,tr("OK"),"","",0,0); QMessageBox::warning(this,tr("Error"),tr("Please enter a Password or select a key file."),tr("OK"),"","",0,0);
return;} return;}
if(keyfile==""){QMessageBox::warning(this,tr("Error"),tr("Please choose a key file.")
,tr("OK"),"","",0,0); if(KeyType==BOTH){
return;} if(password==""){
} QMessageBox::warning(this,tr("Error"),tr("Please enter a Password."),tr("OK"),"","",0,0);
else return;}
{ if(keyfile==""){
if(password=="" && keyfile==""){QMessageBox::warning(this,tr("Error") QMessageBox::warning(this,tr("Error"),tr("Please choose a key file."),tr("OK"),"","",0,0);
,tr("Please enter a Password or select a key file.") return;}
,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); done(1);
} }
void CPasswordDialog::OnPasswordChanged(const QString &txt) void CPasswordDialog::OnOK_Set(){
{
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::OnCheckBox_BothChanged(int state) void CPasswordDialog::OnPasswordChanged(const QString &txt){
{ if(CheckBox_Both->isChecked() || txt==QString())
if(state==QCheckBox::On){ setStateBoth();
Combo_Dirs->setEnabled(true); else
ButtonBrowse->setEnabled(true); setStatePasswordOnly();
Edit_Password->setEnabled(true);}
else{
Edit_Password->setText("");
} }
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);
} }

@ -22,43 +22,36 @@
#define PASSWORDDIALOG_H #define PASSWORDDIALOG_H
#include "lib/UrlLabel.h" #include "lib/UrlLabel.h"
#include "ui_PasswordDlg.h" #include "ui_PasswordDlg.h"
//Added by qt3to4:
#include <Q3ValueList>
class CPasswordDialog : public QDialog, public Ui_PasswordDlg class CPasswordDialog : public QDialog, public Ui_PasswordDlg
{ {
Q_OBJECT Q_OBJECT
private: private:
int NumComboEntries; bool Mode_Set; //true = Set, false = Get
QStringList Paths; void setStatePasswordOnly();
Q3ValueList<bool> IsFile; void setStateKeyFileOnly();
LinkLabel* Label_select; void setStateBoth();
public: public:
QString keyfile; QString keyfile;
QString password; QString password;
tKeyType KeyType;
CPasswordDialog(QWidget* parent = 0, const char* name = 0, bool modal = false,
bool ShowExitButton = false, bool KeyMode_Set=false, Qt::WFlags fl = 0 );
public:
CPasswordDialog(QWidget* parent = 0, const char* name = 0, bool modal = false,
bool ShowExitButton = false, Qt::WFlags fl = 0 );
~CPasswordDialog();
public slots: public slots:
virtual void OnOK(); void OnOK();
virtual void OnCancel(); void OnOK_Set();
virtual void OnSelectClicked(); void OnCancel();
virtual void OnButtonBrowse(); void OnButtonBrowse();
virtual void OnButtonExit(); void OnButtonBrowse_Set();
virtual void OnComboSelectionChanged(int); void OnButtonExit();
virtual void OnPasswordChanged(const QString &txt); void OnPasswordChanged(const QString &txt);
virtual void OnCheckBox_BothChanged(int state); void OnCheckBox_BothChanged(int state);
virtual void ChangeEchoMode(); void ChangeEchoMode();
void OnComboTextChanged(const QString&);
}; };
#endif #endif

@ -19,6 +19,7 @@
***************************************************************************/ ***************************************************************************/
#include "main.h" #include "main.h"
#include "PwmConfig.h"
#include "PwManager.h" #include "PwManager.h"
#include "SearchDlg.h" #include "SearchDlg.h"
#include <qlineedit.h> #include <qlineedit.h>

@ -18,6 +18,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/ ***************************************************************************/
#include "main.h" #include "main.h"
#include "PwmConfig.h"
#include <qpixmap.h> #include <qpixmap.h>
#include <qcheckbox.h> #include <qcheckbox.h>
#include <qspinbox.h> #include <qspinbox.h>
@ -62,6 +63,7 @@ CheckBox_ShowPasswords->setChecked(config.ShowPasswords);
Edit_BrowserCmd->setText(config.OpenUrlCommand); Edit_BrowserCmd->setText(config.OpenUrlCommand);
CheckBox_ExpandGroupTree->setChecked(config.ExpandGroupTree); CheckBox_ExpandGroupTree->setChecked(config.ExpandGroupTree);
CheckBox_AlternatingRowColors->setChecked(config.AlternatingRowColors); 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.OpenUrlCommand=Edit_BrowserCmd->text();
config.ExpandGroupTree=CheckBox_ExpandGroupTree->isChecked(); config.ExpandGroupTree=CheckBox_ExpandGroupTree->isChecked();
config.AlternatingRowColors=CheckBox_AlternatingRowColors->isChecked(); config.AlternatingRowColors=CheckBox_AlternatingRowColors->isChecked();
config.MountDir=Edit_MountDir->text();
if(config.MountDir!="" && config.MountDir.right(1)!="/")
config.MountDir+="/";
close(); close();
} }

@ -9,7 +9,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>578</width> <width>578</width>
<height>270</height> <height>275</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy" > <property name="sizePolicy" >
@ -23,13 +23,13 @@
<property name="minimumSize" > <property name="minimumSize" >
<size> <size>
<width>578</width> <width>578</width>
<height>270</height> <height>275</height>
</size> </size>
</property> </property>
<property name="maximumSize" > <property name="maximumSize" >
<size> <size>
<width>578</width> <width>578</width>
<height>270</height> <height>275</height>
</size> </size>
</property> </property>
<property name="windowTitle" > <property name="windowTitle" >
@ -66,7 +66,7 @@
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>10</x> <x>10</x>
<y>230</y> <y>240</y>
<width>561</width> <width>561</width>
<height>31</height> <height>31</height>
</rect> </rect>
@ -114,34 +114,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QLabel" name="textLabel1" >
<property name="geometry" >
<rect>
<x>10</x>
<y>60</y>
<width>459</width>
<height>16</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>4</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Enter a Password and/or choose a key file.</string>
</property>
</widget>
<widget class="Q3GroupBox" name="groupframe" > <widget class="Q3GroupBox" name="groupframe" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>10</x> <x>10</x>
<y>80</y> <y>80</y>
<width>561</width> <width>561</width>
<height>141</height> <height>151</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy" > <property name="sizePolicy" >
@ -158,16 +137,16 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<widget class="QWidget" name="layoutWidget" > <widget class="QWidget" name="" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>10</x> <x>10</x>
<y>30</y> <y>20</y>
<width>531</width> <width>541</width>
<height>30</height> <height>123</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" > <layout class="QVBoxLayout" >
<property name="margin" > <property name="margin" >
<number>0</number> <number>0</number>
</property> </property>
@ -175,142 +154,170 @@
<number>6</number> <number>6</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="textLabel2" > <layout class="QGridLayout" >
<property name="sizePolicy" > <property name="margin" >
<sizepolicy> <number>0</number>
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="text" > <property name="spacing" >
<string>Password:</string> <number>6</number>
</property> </property>
</widget> <item row="1" column="0" >
<widget class="QLabel" name="Label_PasswordRep" >
<property name="text" >
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="Edit_Password" />
</item>
<item row="0" column="0" >
<widget class="QLabel" name="Label_Password" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Password:</string>
</property>
</widget>
</item>
<item row="0" column="2" >
<widget class="QToolButton" name="ButtonChangeEchoMode" >
<property name="text" >
<string>...</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="Edit_PasswordRep" />
</item>
</layout>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="Edit_Password" /> <layout class="QHBoxLayout" >
</item> <property name="margin" >
<item> <number>0</number>
<widget class="QToolButton" name="ButtonChangeEchoMode" >
<property name="text" >
<string>...</string>
</property> </property>
</widget> <property name="spacing" >
</item> <number>6</number>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget" >
<property name="geometry" >
<rect>
<x>10</x>
<y>60</y>
<width>531</width>
<height>30</height>
</rect>
</property>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="textLabel3" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="text" > <item>
<string>Key file or directory:</string> <widget class="QLabel" name="Label_KeyFile" >
</property> <property name="sizePolicy" >
</widget> <sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Key file or directory:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="Combo_Dirs" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editable" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ButtonBrowse" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>&amp;Browse...</string>
</property>
<property name="shortcut" >
<string>Alt+B</string>
</property>
</widget>
</item>
</layout>
</item> </item>
<item> <item>
<widget class="QComboBox" name="Combo_Dirs" > <layout class="QHBoxLayout" >
<property name="sizePolicy" > <property name="margin" >
<sizepolicy> <number>0</number>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ButtonBrowse" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>&amp;Browse...</string>
</property> </property>
<property name="shortcut" > <property name="spacing" >
<string>Alt+B</string> <number>6</number>
</property> </property>
</widget> <item>
</item> <widget class="QCheckBox" name="CheckBox_Both" >
</layout> <property name="sizePolicy" >
</widget> <sizepolicy>
<widget class="QWidget" name="layoutWidget" > <hsizetype>0</hsizetype>
<property name="geometry" > <vsizetype>0</vsizetype>
<rect> <horstretch>0</horstretch>
<x>10</x> <verstretch>0</verstretch>
<y>90</y> </sizepolicy>
<width>531</width> </property>
<height>30</height> <property name="text" >
</rect> <string>Use Password AND Key File</string>
</property> </property>
<layout class="QHBoxLayout" > </widget>
<property name="margin" > </item>
<number>0</number> <item>
</property> <spacer>
<property name="spacing" > <property name="orientation" >
<number>6</number> <enum>Qt::Horizontal</enum>
</property> </property>
<item> <property name="sizeHint" >
<widget class="QCheckBox" name="CheckBox_Both" > <size>
<property name="sizePolicy" > <width>40</width>
<sizepolicy> <height>20</height>
<hsizetype>0</hsizetype> </size>
<vsizetype>0</vsizetype> </property>
<horstretch>0</horstretch> </spacer>
<verstretch>0</verstretch> </item>
</sizepolicy> </layout>
</property>
<property name="text" >
<string>Use Password AND Key File</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
<widget class="QLabel" name="textLabel1" >
<property name="geometry" >
<rect>
<x>10</x>
<y>60</y>
<width>459</width>
<height>16</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>4</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Enter a Password and/or choose a key file.</string>
</property>
</widget>
</widget> </widget>
<layoutdefault spacing="6" margin="11" /> <layoutdefault spacing="6" margin="11" />
<pixmapfunction></pixmapfunction> <pixmapfunction></pixmapfunction>

@ -464,32 +464,49 @@
<string>Alt+Ö</string> <string>Alt+Ö</string>
</property> </property>
</widget> </widget>
<widget class="QWidget" name="widget" > <widget class="QWidget" name="" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>10</x> <x>10</x>
<y>50</y> <y>50</y>
<width>531</width> <width>531</width>
<height>25</height> <height>58</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" > <layout class="QGridLayout" >
<property name="margin" > <property name="margin" >
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<item> <item row="1" column="2" >
<widget class="QLabel" name="textLabel1_4" > <widget class="QPushButton" name="Button_MountDirBrowse" >
<property name="text" >
<string>Browse...</string>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" > <property name="text" >
<string>Browser Command:</string> <string>Browser Command:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="1" column="1" >
<widget class="QLineEdit" name="Edit_MountDir" />
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="Edit_BrowserCmd" /> <widget class="QLineEdit" name="Edit_BrowserCmd" />
</item> </item>
<item row="1" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>Media Directory:</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
@ -514,7 +531,6 @@
<tabstop>ButtonTextColor</tabstop> <tabstop>ButtonTextColor</tabstop>
<tabstop>ButtonColor2</tabstop> <tabstop>ButtonColor2</tabstop>
<tabstop>CheckBox_OpenLast</tabstop> <tabstop>CheckBox_OpenLast</tabstop>
<tabstop>Edit_BrowserCmd</tabstop>
<tabstop>ButtonOK</tabstop> <tabstop>ButtonOK</tabstop>
<tabstop>ButtonCancel</tabstop> <tabstop>ButtonCancel</tabstop>
</tabstops> </tabstops>

@ -18,6 +18,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/ ***************************************************************************/
#include <math.h> #include <math.h>
#include <QDragEnterEvent> #include <QDragEnterEvent>
#include <QDragMoveEvent> #include <QDragMoveEvent>
@ -29,6 +30,7 @@
#include <QApplication> #include <QApplication>
#include <QPainter> #include <QPainter>
#include "main.h" #include "main.h"
#include "PwmConfig.h"
#include "EntryView.h" #include "EntryView.h"

@ -25,11 +25,13 @@
#include <QString> #include <QString>
#include <QColor> #include <QColor>
#include <QIcon> #include <QIcon>
#include "PwmConfig.h"
#define KEEPASS_VERSION "0.2.0" #define KEEPASS_VERSION "0.2.0"
#define NUM_CLIENT_ICONS 62 #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);
void createBanner(QLabel *Banner,QPixmap* symbol,QString text,QColor color1,QColor color2,QColor textcolor); void createBanner(QLabel *Banner,QPixmap* symbol,QString text,QColor color1,QColor color2,QColor textcolor);
void openBrowser(QString url); void openBrowser(QString url);

@ -246,7 +246,7 @@ CPasswordDialog PasswordDlg(this,"Password Dialog",true,s);
PasswordDlg.setCaption(filename); PasswordDlg.setCaption(filename);
int r=PasswordDlg.exec(); int r=PasswordDlg.exec();
if(r==0) return; if(r==0) return;
if(r==2) {Start=false; close(); return;} if(r==2) {Start=false; return;}
Q_ASSERT(r==1); Q_ASSERT(r==1);
db = new PwDatabase(); db = new PwDatabase();
GroupView->db=db; GroupView->db=db;

File diff suppressed because it is too large Load Diff