allow hints for user names
authorKonrad Rosenbaum <konrad@silmor.de>
Mon, 7 Oct 2013 18:36:25 +0000 (20:36 +0200)
committerKonrad Rosenbaum <konrad@silmor.de>
Mon, 7 Oct 2013 18:36:25 +0000 (20:36 +0200)
src/dialogs/configdialog.cpp
src/dialogs/configdialog.h
src/dialogs/login.cpp

index 896bad9..6b03e50 100644 (file)
@@ -126,9 +126,12 @@ MConfigDialog::MConfigDialog()
        gl->addWidget(lab=new QLabel(tr("Hostkey:")),++lctr,0);
        lab->setAlignment(Qt::AlignRight);
        gl->addWidget(hostkey=new QLineEdit,lctr,1);
-       gl->addWidget(lab=new QLabel(tr("Default Username:")),++lctr,0);
-       lab->setAlignment(Qt::AlignRight);
-       gl->addWidget(username=new QLineEdit,lctr,1);
+        gl->addWidget(lab=new QLabel(tr("Default Username:")),++lctr,0);
+        lab->setAlignment(Qt::AlignRight);
+        gl->addWidget(username=new QLineEdit,lctr,1);
+        gl->addWidget(lab=new QLabel(tr("Hint for Username:")),++lctr,0);
+        lab->setAlignment(Qt::AlignRight);
+        gl->addWidget(userhint=new QLineEdit,lctr,1);
        gl->setRowStretch(++lctr,10);
        gl->addLayout(hl=new QHBoxLayout,++lctr,0,1,2);
        
@@ -239,7 +242,8 @@ void MConfigDialog::loadProfile()
        proxyport->setEnabled(useproxy->isChecked());
        proxyuser->setEnabled(useproxy->isChecked());
        proxypass->setEnabled(useproxy->isChecked());
-       username->setText(set.value("username").toString());
+        username->setText(set.value("username").toString());
+        userhint->setText(set.value("usernamehint").toString());
        sslexcept=new MSslExceptions(dataDir+"/profile."+key+"/sslexceptions.xml");
        sslFillModel();
        abiscript->setChecked(set.value("script/allowbuiltin",true).toBool());
@@ -265,7 +269,8 @@ void MConfigDialog::saveProfile()
        set.setValue("proxyport",proxyport->value());
        set.setValue("proxyuser",proxyuser->text());
        set.setValue("proxypass",proxypass->text());
-       set.setValue("username",username->text());
+        set.setValue("username",username->text());
+        set.setValue("usernamehint",userhint->text());
        QDir(MApplication::dataDir()).mkdir("profile."+key);
        if(sslexcept)sslexcept->savesslexcept();
        set.setValue("script/allowbuiltin",abiscript->isChecked());
index 43fbb93..6200948 100644 (file)
@@ -38,7 +38,7 @@ class MConfigDialog:public QDialog
        private:
                QCheckBox*useproxy,*abiscript,*ausscript,*asrscript;
                QLineEdit*hostname,*hostkey,*serverurl,*proxyname,*username,
-                       *proxyuser,*proxypass,*usrscript;
+                       *userhint,*proxyuser,*proxypass,*usrscript;
                QSpinBox*proxyport,*pbiscript,*pusscript,*psrscript;
                QListView*profiles;
                QStandardItemModel*profilemodel,*sslmodel;
index badc067..528c5ce 100644 (file)
@@ -100,6 +100,7 @@ void MLogin::loadProfile()
        QSettings set;
        set.beginGroup("profiles/"+key);
        username->setText(set.value("username").toString());
+        username->setPlaceholderText(set.value("usernamehint").toString());
        password->setText("");
        password->setFocus();
 }