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
This commit is contained in:
parent
08d9ff59c9
commit
d5ed360fce
|
@ -361,7 +361,7 @@ void CEditEntryDlg::OnDeleteAttachment()
|
||||||
|
|
||||||
void CEditEntryDlg::OnButtonGenPw()
|
void CEditEntryDlg::OnButtonGenPw()
|
||||||
{
|
{
|
||||||
CGenPwDialog dlg(this,true);
|
CGenPwDialog dlg(this,false);
|
||||||
if(dlg.exec()){
|
if(dlg.exec()){
|
||||||
Edit_Password->setText(dlg.Edit_dest->text());
|
Edit_Password->setText(dlg.Edit_dest->text());
|
||||||
Edit_Password_w->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(Spin_Num,SIGNAL(valueChanged(int)),this,SLOT(estimateQuality()));
|
||||||
connect(Check_CollectEntropy,SIGNAL(stateChanged(int)),this,SLOT(OnCollectEntropyChanged(int)));
|
connect(Check_CollectEntropy,SIGNAL(stateChanged(int)),this,SLOT(OnCollectEntropyChanged(int)));
|
||||||
connect(Edit_chars,SIGNAL(textChanged(const QString&)),this,SLOT(estimateQuality()));
|
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=DialogButtons->addButton(tr("Accept"),QDialogButtonBox::AcceptRole);
|
||||||
AcceptButton->setDisabled(true);
|
AcceptButton->setDisabled(true);
|
||||||
DialogButtons->addButton(QDialogButtonBox::Cancel);
|
DialogButtons->addButton(QDialogButtonBox::Cancel);
|
||||||
|
@ -66,7 +67,7 @@ CGenPwDialog::CGenPwDialog(QWidget* parent, bool StandAloneMode,Qt::WFlags fl)
|
||||||
}
|
}
|
||||||
|
|
||||||
Radio_1->setChecked(config.PwGenOptions[0]);
|
Radio_1->setChecked(config.PwGenOptions[0]);
|
||||||
Edit_chars->setDisabled(config.PwGenOptions[0]);
|
Radio_2->setChecked(!config.PwGenOptions[0]);
|
||||||
checkBox1->setChecked(config.PwGenOptions[1]);
|
checkBox1->setChecked(config.PwGenOptions[1]);
|
||||||
checkBox2->setChecked(config.PwGenOptions[2]);
|
checkBox2->setChecked(config.PwGenOptions[2]);
|
||||||
checkBox3->setChecked(config.PwGenOptions[3]);
|
checkBox3->setChecked(config.PwGenOptions[3]);
|
||||||
|
@ -76,8 +77,8 @@ CGenPwDialog::CGenPwDialog(QWidget* parent, bool StandAloneMode,Qt::WFlags fl)
|
||||||
checkBox7->setChecked(config.PwGenOptions[7]);
|
checkBox7->setChecked(config.PwGenOptions[7]);
|
||||||
Check_CollectEntropy->setChecked(config.PwGenOptions[8]);
|
Check_CollectEntropy->setChecked(config.PwGenOptions[8]);
|
||||||
Check_CollectOncePerSession->setChecked(config.PwGenOptions[9]);
|
Check_CollectOncePerSession->setChecked(config.PwGenOptions[9]);
|
||||||
estimateQuality();
|
OnRadio1StateChanged(config.PwGenOptions[0]);
|
||||||
|
OnRadio2StateChanged(!config.PwGenOptions[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
CGenPwDialog::~CGenPwDialog(){
|
CGenPwDialog::~CGenPwDialog(){
|
||||||
|
@ -255,6 +256,30 @@ void CGenPwDialog::estimateQuality(){
|
||||||
Progress_Quali->setValue(bits);
|
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()
|
void CGenPwDialog::OnAccept()
|
||||||
{
|
{
|
||||||
done(1);
|
done(1);
|
||||||
|
|
|
@ -31,7 +31,7 @@ class CGenPwDialog : public QDialog, public Ui_GenPwDlg
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
CGenPwDialog(QWidget* parent = 0, bool ShowCancelButton=false, Qt::WFlags fl = 0 );
|
CGenPwDialog(QWidget* parent, bool StandAloneMode, Qt::WFlags fl = 0 );
|
||||||
~CGenPwDialog();
|
~CGenPwDialog();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -50,6 +50,7 @@ class CGenPwDialog : public QDialog, public Ui_GenPwDlg
|
||||||
virtual void OnAccept();
|
virtual void OnAccept();
|
||||||
void estimateQuality();
|
void estimateQuality();
|
||||||
void OnCollectEntropyChanged(int);
|
void OnCollectEntropyChanged(int);
|
||||||
|
void OnCharsChanged(const QString& str);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ CSettingsDlg::CSettingsDlg(QWidget* parent):QDialog(parent,Qt::Dialog)
|
||||||
textcolor=config.BannerTextColor;
|
textcolor=config.BannerTextColor;
|
||||||
CheckBox_ShowPasswords->setChecked(config.ShowPasswords);
|
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);
|
Edit_MountDir->setText(config.MountDir);
|
||||||
CheckBox_RememberLastKey->setChecked(config.RememberLastKey);
|
CheckBox_RememberLastKey->setChecked(config.RememberLastKey);
|
||||||
|
@ -133,7 +133,7 @@ void CSettingsDlg::apply(){
|
||||||
config.BannerTextColor=textcolor;
|
config.BannerTextColor=textcolor;
|
||||||
config.ShowPasswords=CheckBox_ShowPasswords->isChecked();
|
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();
|
config.MountDir=Edit_MountDir->text();
|
||||||
if(config.MountDir!="" && config.MountDir.right(1)!="/")
|
if(config.MountDir!="" && config.MountDir.right(1)!="/")
|
||||||
|
|
|
@ -140,20 +140,6 @@
|
||||||
<addaction name="EditSearchAction" />
|
<addaction name="EditSearchAction" />
|
||||||
<addaction name="EditGroupSearchAction" />
|
<addaction name="EditGroupSearchAction" />
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menuExtras" >
|
|
||||||
<property name="title" >
|
|
||||||
<string>E&xtras</string>
|
|
||||||
</property>
|
|
||||||
<addaction name="ExtrasSettingsAction" />
|
|
||||||
</widget>
|
|
||||||
<widget class="QMenu" name="menuHilfe" >
|
|
||||||
<property name="title" >
|
|
||||||
<string>&Help</string>
|
|
||||||
</property>
|
|
||||||
<addaction name="HelpHandbookAction" />
|
|
||||||
<addaction name="separator" />
|
|
||||||
<addaction name="HelpAboutAction" />
|
|
||||||
</widget>
|
|
||||||
<widget class="QMenu" name="menuDatei" >
|
<widget class="QMenu" name="menuDatei" >
|
||||||
<property name="title" >
|
<property name="title" >
|
||||||
<string>&File</string>
|
<string>&File</string>
|
||||||
|
@ -223,6 +209,21 @@
|
||||||
<addaction name="menuSpalten" />
|
<addaction name="menuSpalten" />
|
||||||
<addaction name="menuTool_Button_Sizes" />
|
<addaction name="menuTool_Button_Sizes" />
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QMenu" name="menuHilfe" >
|
||||||
|
<property name="title" >
|
||||||
|
<string>&Help</string>
|
||||||
|
</property>
|
||||||
|
<addaction name="HelpHandbookAction" />
|
||||||
|
<addaction name="separator" />
|
||||||
|
<addaction name="HelpAboutAction" />
|
||||||
|
</widget>
|
||||||
|
<widget class="QMenu" name="menuExtras" >
|
||||||
|
<property name="title" >
|
||||||
|
<string>E&xtras</string>
|
||||||
|
</property>
|
||||||
|
<addaction name="ExtrasSettingsAction" />
|
||||||
|
<addaction name="ExtrasPasswordGenAction" />
|
||||||
|
</widget>
|
||||||
<addaction name="menuDatei" />
|
<addaction name="menuDatei" />
|
||||||
<addaction name="menuBearbeiten" />
|
<addaction name="menuBearbeiten" />
|
||||||
<addaction name="ViewMenu" />
|
<addaction name="ViewMenu" />
|
||||||
|
@ -520,6 +521,11 @@
|
||||||
<string>New Database...</string>
|
<string>New Database...</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="ExtrasPasswordGenAction" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Password Generator...</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
|
|
|
@ -44,9 +44,12 @@
|
||||||
<property name="orientation" >
|
<property name="orientation" >
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="sizeType" >
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="sizeHint" >
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>442</width>
|
||||||
<height>50</height>
|
<height>50</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -135,6 +135,7 @@ void KeepassMainWindow::setupConnections(){
|
||||||
connect(ViewShowStatusbarAction,SIGNAL(toggled(bool)),statusBar(),SLOT(setVisible(bool)));
|
connect(ViewShowStatusbarAction,SIGNAL(toggled(bool)),statusBar(),SLOT(setVisible(bool)));
|
||||||
|
|
||||||
connect(ExtrasSettingsAction,SIGNAL(triggered(bool)),this,SLOT(OnExtrasSettings()));
|
connect(ExtrasSettingsAction,SIGNAL(triggered(bool)),this,SLOT(OnExtrasSettings()));
|
||||||
|
connect(ExtrasPasswordGenAction,SIGNAL(triggered(bool)),this,SLOT(OnExtrasPasswordGen()));
|
||||||
|
|
||||||
connect(HelpHandbookAction,SIGNAL(triggered()),this,SLOT(OnHelpHandbook()));
|
connect(HelpHandbookAction,SIGNAL(triggered()),this,SLOT(OnHelpHandbook()));
|
||||||
connect(HelpAboutAction,SIGNAL(triggered()),this,SLOT(OnHelpAbout()));
|
connect(HelpAboutAction,SIGNAL(triggered()),this,SLOT(OnHelpAbout()));
|
||||||
|
@ -249,6 +250,10 @@ void KeepassMainWindow::setupMenus(){
|
||||||
case 28: ViewToolButtonSize28Action->setChecked(true); break;
|
case 28: ViewToolButtonSize28Action->setChecked(true); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SysTrayMenu = new QMenu(tr("KeePassX"),this);
|
||||||
|
SysTrayMenu->addAction(FileExitAction);
|
||||||
|
SysTray->setContextMenu(SysTrayMenu);
|
||||||
|
|
||||||
//FileNewMenu->setShortcut(tr("Ctrl+N"));
|
//FileNewMenu->setShortcut(tr("Ctrl+N"));
|
||||||
FileOpenAction->setShortcut(tr("Ctrl+O"));
|
FileOpenAction->setShortcut(tr("Ctrl+O"));
|
||||||
FileSaveAction->setShortcut(tr("Ctrl+S"));
|
FileSaveAction->setShortcut(tr("Ctrl+S"));
|
||||||
|
@ -988,5 +993,11 @@ toolBar->setIconSize(QSize(config.ToolbarIconSize,config.ToolbarIconSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeepassMainWindow::OnSysTrayActivated(QSystemTrayIcon::ActivationReason reason){
|
void KeepassMainWindow::OnSysTrayActivated(QSystemTrayIcon::ActivationReason reason){
|
||||||
this->show();
|
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 OnUsernPasswVisibilityChanged(bool hide);
|
||||||
void OnFileModified();
|
void OnFileModified();
|
||||||
void OnExtrasSettings();
|
void OnExtrasSettings();
|
||||||
|
void OnExtrasPasswordGen();
|
||||||
void OnHelpAbout();
|
void OnHelpAbout();
|
||||||
void OnHelpHandbook();
|
void OnHelpHandbook();
|
||||||
void OnItemExpanded(QTreeWidgetItem*);
|
void OnItemExpanded(QTreeWidgetItem*);
|
||||||
|
@ -118,6 +119,7 @@ private:
|
||||||
QToolBar* toolBar;
|
QToolBar* toolBar;
|
||||||
QSystemTrayIcon* SysTray;
|
QSystemTrayIcon* SysTray;
|
||||||
QAction* ViewShowToolbarAction;
|
QAction* ViewShowToolbarAction;
|
||||||
|
QMenu* SysTrayMenu;
|
||||||
bool ShutingDown;
|
bool ShutingDown;
|
||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent* event);
|
void closeEvent(QCloseEvent* event);
|
||||||
|
|
Loading…
Reference in New Issue