diff --git a/retroshare-gui/src/gui/StartDialog.cpp b/retroshare-gui/src/gui/StartDialog.cpp index 6ac5ce1a5..6b100d319 100644 --- a/retroshare-gui/src/gui/StartDialog.cpp +++ b/retroshare-gui/src/gui/StartDialog.cpp @@ -19,11 +19,13 @@ * Boston, MA 02110-1301, USA. ****************************************************************/ -#include -#include +#include + +#include "rshare.h" +#include "retroshare/rsinit.h" #include "StartDialog.h" #include "LogoBar.h" -#include +#include "retroshare/rsnotify.h" #include "settings/rsharesettings.h" #include @@ -43,10 +45,6 @@ StartDialog::StartDialog(QWidget *parent) Settings->loadWidgetInformation(this); - ui.loadButton->setFocus(); - - connect(ui.loadButton, SIGNAL(clicked()), this, SLOT(loadPerson())); - /* get all available pgp private certificates.... * mark last one as default. */ @@ -75,12 +73,21 @@ StartDialog::StartDialog(QWidget *parent) } } + QObject::connect(ui.loadName,SIGNAL(currentIndexChanged(int)),this,SLOT(updateSelectedProfile(int))) ; + QObject::connect(ui.password_input,SIGNAL(returnPressed()),this,SLOT(loadPerson())) ; + if (pidx > 0) { ui.loadName->setCurrentIndex(pidx); } } +void StartDialog::updateSelectedProfile(int) +{ + ui.password_input->clear(); + ui.password_input->setFocus(); +} + void StartDialog::closeEvent (QCloseEvent * event) { Settings->saveWidgetInformation(this); @@ -101,18 +108,22 @@ void StartDialog::loadPerson() QVariant data = ui.loadName->itemData(pgpidx); RsPeerId accountId = RsPeerId((data.toString()).toStdString()); - if (Rshare::loadCertificate(accountId, ui.autologin_checkbox->isChecked())) { + // Cache the passphrase, so that it is not asked again. + + rsNotify->cachePgpPassphrase(ui.password_input->text().toUtf8().constData()) ; + + bool res = Rshare::loadCertificate(accountId, ui.autologin_checkbox->isChecked()) ; + + rsNotify->clearPgpPassphrase(); + + if(res) accept(); - } } void StartDialog::on_labelProfile_linkActivated(QString /*link*/) { -// if ((QMessageBox::question(this, tr("Create a New Profile"),tr("This will generate a new Profile\n Are you sure you want to continue?"),QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes))== QMessageBox::Yes) -// { reqNewCert = true; accept(); -// } } bool StartDialog::requestedNewCert() diff --git a/retroshare-gui/src/gui/StartDialog.h b/retroshare-gui/src/gui/StartDialog.h index 2cd9c2d34..26d7f9c54 100644 --- a/retroshare-gui/src/gui/StartDialog.h +++ b/retroshare-gui/src/gui/StartDialog.h @@ -39,6 +39,7 @@ protected: private slots: void loadPerson(); + void updateSelectedProfile(int); #ifdef RS_AUTOLOGIN /** diff --git a/retroshare-gui/src/gui/StartDialog.ui b/retroshare-gui/src/gui/StartDialog.ui index ae198d4a7..fb1554a32 100644 --- a/retroshare-gui/src/gui/StartDialog.ui +++ b/retroshare-gui/src/gui/StartDialog.ui @@ -6,8 +6,8 @@ 0 0 - 430 - 552 + 656 + 645 @@ -42,76 +42,6 @@ 0 - - - 0 - - - 6 - - - 0 - - - 6 - - - 6 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - QToolButton { - border-image: url(:/images/avatar_background.png); -} - - - - - - - :/images/user/personal64.png:/images/user/personal64.png - - - - 96 - 96 - - - - true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - @@ -134,12 +64,6 @@ 0 - - - 16777215 - 32 - - @@ -183,7 +107,10 @@ - Login + + + + :/images/logo/logo_splash.png @@ -202,7 +129,7 @@ - + true @@ -220,13 +147,27 @@ - Profile - Location + Profile - Location: + + + + Password: + + + + + + + QLineEdit::Password + + + @@ -240,56 +181,7 @@ - - - - 9 - - - 9 - - - - - Log In - - - true - - - false - - - - - - - Qt::Horizontal - - - - 61 - 20 - - - - - - - - Qt::Horizontal - - - - 71 - 20 - - - - - - - + Opens a dialog for creating a new profile or @@ -305,7 +197,7 @@ p, li { white-space: pre-wrap; } - + @@ -333,10 +225,6 @@ p, li { white-space: pre-wrap; } 1 - - loadButton - toolButton -