fixed some minor bugs in password generation dialog,

added new options to settings dlg (no functions behind yet)

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@120 b624d157-de02-0410-bad0-e51aec6abb33
master
tarek_saidi 18 years ago
parent 08d9ff59c9
commit d5ed360fce
  1. 2
      src/dialogs/EditEntryDlg.cpp
  2. 33
      src/dialogs/PasswordGenDlg.cpp
  3. 3
      src/dialogs/PasswordGenDlg.h
  4. 4
      src/dialogs/SettingsDlg.cpp
  5. 34
      src/forms/MainWindow.ui
  6. 5
      src/forms/PasswordGenDlg.ui
  7. 468
      src/forms/SettingsDlg.ui
  8. 11
      src/mainwindow.cpp
  9. 2
      src/mainwindow.h

@ -361,7 +361,7 @@ void CEditEntryDlg::OnDeleteAttachment()
void CEditEntryDlg::OnButtonGenPw()
{
CGenPwDialog dlg(this,true);
CGenPwDialog dlg(this,false);
if(dlg.exec()){
Edit_Password->setText(dlg.Edit_dest->text());
Edit_Password_w->setText(dlg.Edit_dest->text());

@ -54,8 +54,9 @@ CGenPwDialog::CGenPwDialog(QWidget* parent, bool StandAloneMode,Qt::WFlags fl)
connect(Spin_Num,SIGNAL(valueChanged(int)),this,SLOT(estimateQuality()));
connect(Check_CollectEntropy,SIGNAL(stateChanged(int)),this,SLOT(OnCollectEntropyChanged(int)));
connect(Edit_chars,SIGNAL(textChanged(const QString&)),this,SLOT(estimateQuality()));
connect(Edit_chars,SIGNAL(textEdited(const QString&)),this,SLOT(OnCharsChanged(const QString&)));
if(StandAloneMode){
if(!StandAloneMode){
AcceptButton=DialogButtons->addButton(tr("Accept"),QDialogButtonBox::AcceptRole);
AcceptButton->setDisabled(true);
DialogButtons->addButton(QDialogButtonBox::Cancel);
@ -66,7 +67,7 @@ CGenPwDialog::CGenPwDialog(QWidget* parent, bool StandAloneMode,Qt::WFlags fl)
}
Radio_1->setChecked(config.PwGenOptions[0]);
Edit_chars->setDisabled(config.PwGenOptions[0]);
Radio_2->setChecked(!config.PwGenOptions[0]);
checkBox1->setChecked(config.PwGenOptions[1]);
checkBox2->setChecked(config.PwGenOptions[2]);
checkBox3->setChecked(config.PwGenOptions[3]);
@ -76,8 +77,8 @@ CGenPwDialog::CGenPwDialog(QWidget* parent, bool StandAloneMode,Qt::WFlags fl)
checkBox7->setChecked(config.PwGenOptions[7]);
Check_CollectEntropy->setChecked(config.PwGenOptions[8]);
Check_CollectOncePerSession->setChecked(config.PwGenOptions[9]);
estimateQuality();
OnRadio1StateChanged(config.PwGenOptions[0]);
OnRadio2StateChanged(!config.PwGenOptions[0]);
}
CGenPwDialog::~CGenPwDialog(){
@ -255,6 +256,30 @@ void CGenPwDialog::estimateQuality(){
Progress_Quali->setValue(bits);
}
void CGenPwDialog::OnCharsChanged(const QString& str){
bool multiple=false;
for(int i=0;i<str.size();i++){
int count=0;
for(int j=0;j<str.size();j++){
if(str[i]==str[j]){
if(count){multiple=true; break;}
else {count++;}
}
}
if(multiple)break;
}
if(!multiple)return;
QString newstr;
for(int i=0;i<str.size();i++){
if(!newstr.count(str[i])){
newstr+=str[i];
}
}
Edit_chars->setText(newstr);
}
void CGenPwDialog::OnAccept()
{
done(1);

@ -31,7 +31,7 @@ class CGenPwDialog : public QDialog, public Ui_GenPwDlg
{
Q_OBJECT
public:
CGenPwDialog(QWidget* parent = 0, bool ShowCancelButton=false, Qt::WFlags fl = 0 );
CGenPwDialog(QWidget* parent, bool StandAloneMode, Qt::WFlags fl = 0 );
~CGenPwDialog();
private:
@ -50,6 +50,7 @@ class CGenPwDialog : public QDialog, public Ui_GenPwDlg
virtual void OnAccept();
void estimateQuality();
void OnCollectEntropyChanged(int);
void OnCharsChanged(const QString& str);
};

@ -75,7 +75,7 @@ CSettingsDlg::CSettingsDlg(QWidget* parent):QDialog(parent,Qt::Dialog)
textcolor=config.BannerTextColor;
CheckBox_ShowPasswords->setChecked(config.ShowPasswords);
Edit_BrowserCmd->setText(config.OpenUrlCommand);
CheckBox_ExpandGroupTree->setChecked(config.ExpandGroupTree);
// CheckBox_ExpandGroupTree->setChecked(config.ExpandGroupTree);
CheckBox_AlternatingRowColors->setChecked(config.AlternatingRowColors);
Edit_MountDir->setText(config.MountDir);
CheckBox_RememberLastKey->setChecked(config.RememberLastKey);
@ -133,7 +133,7 @@ void CSettingsDlg::apply(){
config.BannerTextColor=textcolor;
config.ShowPasswords=CheckBox_ShowPasswords->isChecked();
config.OpenUrlCommand=Edit_BrowserCmd->text();
config.ExpandGroupTree=CheckBox_ExpandGroupTree->isChecked();
// config.ExpandGroupTree=CheckBox_ExpandGroupTree->isChecked();
config.AlternatingRowColors=CheckBox_AlternatingRowColors->isChecked();
config.MountDir=Edit_MountDir->text();
if(config.MountDir!="" && config.MountDir.right(1)!="/")

@ -140,20 +140,6 @@
<addaction name="EditSearchAction" />
<addaction name="EditGroupSearchAction" />
</widget>
<widget class="QMenu" name="menuExtras" >
<property name="title" >
<string>E&amp;xtras</string>
</property>
<addaction name="ExtrasSettingsAction" />
</widget>
<widget class="QMenu" name="menuHilfe" >
<property name="title" >
<string>&amp;Help</string>
</property>
<addaction name="HelpHandbookAction" />
<addaction name="separator" />
<addaction name="HelpAboutAction" />
</widget>
<widget class="QMenu" name="menuDatei" >
<property name="title" >
<string>&amp;File</string>
@ -223,6 +209,21 @@
<addaction name="menuSpalten" />
<addaction name="menuTool_Button_Sizes" />
</widget>
<widget class="QMenu" name="menuHilfe" >
<property name="title" >
<string>&amp;Help</string>
</property>
<addaction name="HelpHandbookAction" />
<addaction name="separator" />
<addaction name="HelpAboutAction" />
</widget>
<widget class="QMenu" name="menuExtras" >
<property name="title" >
<string>E&amp;xtras</string>
</property>
<addaction name="ExtrasSettingsAction" />
<addaction name="ExtrasPasswordGenAction" />
</widget>
<addaction name="menuDatei" />
<addaction name="menuBearbeiten" />
<addaction name="ViewMenu" />
@ -520,6 +521,11 @@
<string>New Database...</string>
</property>
</action>
<action name="ExtrasPasswordGenAction" >
<property name="text" >
<string>Password Generator...</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>

@ -44,9 +44,12 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<width>442</width>
<height>50</height>
</size>
</property>

@ -6,19 +6,19 @@
<x>0</x>
<y>0</y>
<width>571</width>
<height>341</height>
<height>420</height>
</rect>
</property>
<property name="minimumSize" >
<size>
<width>571</width>
<height>341</height>
<height>420</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>571</width>
<height>341</height>
<height>420</height>
</size>
</property>
<property name="windowTitle" >
@ -62,21 +62,34 @@
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex" >
<number>2</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab" >
<attribute name="title" >
<string>Securi&amp;ty</string>
<string>General</string>
</attribute>
<widget class="QWidget" name="widget" >
<property name="geometry" >
<rect>
<x>10</x>
<y>20</y>
<width>531</width>
<height>31</height>
</rect>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QCheckBox" name="checkBox_ShowSysTrayIcon" >
<property name="text" >
<string>Show system tray icon</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_MinimizeToTray" >
<property name="text" >
<string>Minimize to tray when clicking the main window's close button</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
@ -85,62 +98,108 @@
<number>6</number>
</property>
<item>
<widget class="QLabel" name="textLabel1" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<widget class="QCheckBox" name="CheckBox_OpenLast" >
<property name="text" >
<string>Remember last opened file</string>
</property>
<property name="shortcut" >
<string>Alt+Ö</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="CheckBox_RememberLastKey" >
<property name="text" >
<string>Clear clipboard after:</string>
<string>Remember last key type and location</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="SpinBox_ClipboardTime" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="maximumSize" >
<property name="sizeHint" >
<size>
<width>80</width>
<height>16777215</height>
<width>40</width>
<height>20</height>
</size>
</property>
<property name="maximum" >
<number>50000</number>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="value" >
<number>2</number>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QCheckBox" name="checkBox_SaveFileDlgHistory" >
<property name="text" >
<string>Save recent directories of file dialogs</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="textLabel2" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="Button_ClearFileDlgHistory" >
<property name="text" >
<string>Seconds</string>
<string>Clear</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QCheckBox" name="CheckBox_ShowPasswords" >
<property name="geometry" >
<rect>
<x>10</x>
<y>50</y>
<width>531</width>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</rect>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="CheckBox_ShowPasswords" >
<property name="text" >
<string>Sh&amp;ow passwords in plain text by default</string>
</property>
@ -148,32 +207,137 @@
<string>Alt+O</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_4" >
<property name="text" >
<string>Enable bookmark menu</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>Group tree at start-up:</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>0</number>
</property>
<item>
<widget class="QRadioButton" name="Radio_GroupTreeRestore" >
<property name="text" >
<string>Restore last state</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="Radio_GroupTreeExpand" >
<property name="text" >
<string>Expand all items</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="Radion_GroupTreeDoNothing" >
<property name="text" >
<string>Do not expand any item</string>
</property>
</widget>
</item>
</layout>
</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>
</layout>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="TabPage" >
<attribute name="title" >
<string>Appea&amp;rance</string>
</attribute>
<widget class="QGroupBox" name="groupBox1" >
<property name="geometry" >
<rect>
<x>20</x>
<y>10</y>
<width>520</width>
<height>90</height>
</rect>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox1" >
<property name="title" >
<string>Banner Color</string>
</property>
<widget class="QWidget" name="widget" >
<property name="geometry" >
<rect>
<x>11</x>
<y>20</y>
<width>501</width>
<height>62</height>
</rect>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
@ -428,37 +592,113 @@
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="CheckBox_AlternatingRowColors" >
<property name="text" >
<string>Alternating Row Colors</string>
</property>
</widget>
<widget class="QCheckBox" name="CheckBox_ExpandGroupTree" >
<property name="geometry" >
<rect>
<x>10</x>
<y>110</y>
<width>521</width>
<height>20</height>
</rect>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="text" >
<string>Expand group tree when opening a database</string>
<property name="sizeHint" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
<property name="shortcut" >
<string>Alt+Ö</string>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_3" >
<attribute name="title" >
<string>Security</string>
</attribute>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="textLabel1" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Clear clipboard after:</string>
</property>
</widget>
<widget class="QCheckBox" name="CheckBox_AlternatingRowColors" >
<property name="geometry" >
<rect>
<x>10</x>
<y>130</y>
<width>531</width>
<height>22</height>
</rect>
</item>
<item>
<widget class="QSpinBox" name="SpinBox_ClipboardTime" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="maximum" >
<number>50000</number>
</property>
<property name="value" >
<number>2</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="textLabel2" >
<property name="text" >
<string>Alternating Row Colors</string>
<string>Seconds</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2" >
<attribute name="title" >
@ -589,15 +829,14 @@
<attribute name="title" >
<string>&amp;Other</string>
</attribute>
<widget class="QWidget" name="widget" >
<property name="geometry" >
<rect>
<x>10</x>
<y>70</y>
<width>531</width>
<height>66</height>
</rect>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
@ -645,36 +884,21 @@
</widget>
</item>
</layout>
</widget>
<widget class="QCheckBox" name="CheckBox_RememberLastKey" >
<property name="geometry" >
<rect>
<x>30</x>
<y>40</y>
<width>501</width>
<height>22</height>
</rect>
</property>
<property name="text" >
<string>Remember last key type and location</string>
</property>
</widget>
<widget class="QCheckBox" name="CheckBox_OpenLast" >
<property name="geometry" >
<rect>
<x>10</x>
<y>20</y>
<width>521</width>
<height>20</height>
</rect>
</property>
<property name="text" >
<string>Remember last opened file</string>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="shortcut" >
<string>Alt+Ö</string>
<property name="sizeHint" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</widget>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
@ -693,12 +917,10 @@
<layoutdefault spacing="6" margin="11" />
<tabstops>
<tabstop>tabWidget4</tabstop>
<tabstop>SpinBox_ClipboardTime</tabstop>
<tabstop>CheckBox_ShowPasswords</tabstop>
<tabstop>ButtonColor1</tabstop>
<tabstop>ButtonTextColor</tabstop>
<tabstop>ButtonColor2</tabstop>
<tabstop>CheckBox_OpenLast</tabstop>
</tabstops>
<resources/>
<connections/>

@ -135,6 +135,7 @@ void KeepassMainWindow::setupConnections(){
connect(ViewShowStatusbarAction,SIGNAL(toggled(bool)),statusBar(),SLOT(setVisible(bool)));
connect(ExtrasSettingsAction,SIGNAL(triggered(bool)),this,SLOT(OnExtrasSettings()));
connect(ExtrasPasswordGenAction,SIGNAL(triggered(bool)),this,SLOT(OnExtrasPasswordGen()));
connect(HelpHandbookAction,SIGNAL(triggered()),this,SLOT(OnHelpHandbook()));
connect(HelpAboutAction,SIGNAL(triggered()),this,SLOT(OnHelpAbout()));
@ -249,6 +250,10 @@ void KeepassMainWindow::setupMenus(){
case 28: ViewToolButtonSize28Action->setChecked(true); break;
}
SysTrayMenu = new QMenu(tr("KeePassX"),this);
SysTrayMenu->addAction(FileExitAction);
SysTray->setContextMenu(SysTrayMenu);
//FileNewMenu->setShortcut(tr("Ctrl+N"));
FileOpenAction->setShortcut(tr("Ctrl+O"));
FileSaveAction->setShortcut(tr("Ctrl+S"));
@ -988,5 +993,11 @@ toolBar->setIconSize(QSize(config.ToolbarIconSize,config.ToolbarIconSize));
}
void KeepassMainWindow::OnSysTrayActivated(QSystemTrayIcon::ActivationReason reason){
if(reason!=QSystemTrayIcon::Context)
this->show();
}
void KeepassMainWindow::OnExtrasPasswordGen(){
CGenPwDialog dlg(this,true);
dlg.exec();
}

@ -85,6 +85,7 @@ private slots:
void OnUsernPasswVisibilityChanged(bool hide);
void OnFileModified();
void OnExtrasSettings();
void OnExtrasPasswordGen();
void OnHelpAbout();
void OnHelpHandbook();
void OnItemExpanded(QTreeWidgetItem*);
@ -118,6 +119,7 @@ private:
QToolBar* toolBar;
QSystemTrayIcon* SysTray;
QAction* ViewShowToolbarAction;
QMenu* SysTrayMenu;
bool ShutingDown;
protected:
void closeEvent(QCloseEvent* event);