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:
@@ -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)!="/")
|
||||
|
||||
Reference in New Issue
Block a user