mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-25 12:47:44 +01:00
Remember passwords
This commit is contained in:
parent
54761aed6f
commit
26ba70abb0
@ -112,11 +112,13 @@ class FWWindow : public QMainWindow {
|
||||
ProjectPanel *newProjectPanel();
|
||||
void showSub(ProjectPanel *projectW);
|
||||
void attachEditorToProjectPanel(ProjectPanel *pp);
|
||||
|
||||
|
||||
public:
|
||||
QVector <QString> windowsTitles;
|
||||
QVector <QMdiSubWindow*> windowsPainters;
|
||||
|
||||
QMap<QPair<int, QString>, QPair<QString, QString> > passwords;
|
||||
|
||||
ObjectEditor *oe;
|
||||
FindObjectWidget *findObjectWidget;
|
||||
FindWhereUsedWidget *findWhereUsedWidget;
|
||||
|
||||
@ -131,8 +131,9 @@ PrefsDialog::PrefsDialog(QWidget *parent) : QDialog(parent)
|
||||
|
||||
m_dialog->sshPath->setText( st->getSSHPath() );
|
||||
m_dialog->scpPath->setText( st->getSCPPath() );
|
||||
m_dialog->rememberSshPass->setChecked( st->getBool("Environment/RememberSshPassEnabled") );
|
||||
|
||||
m_dialog->showTips->setChecked(st->getBool("UI/NoStartTip"));
|
||||
m_dialog->showTips->setChecked( st->getBool("UI/NoStartTip") );
|
||||
|
||||
// set label icons colors and text strings using user's settings
|
||||
|
||||
@ -449,6 +450,7 @@ void PrefsDialog::accept()
|
||||
|
||||
st->setSSHPath( m_dialog->sshPath->text() );
|
||||
st->setSCPPath( m_dialog->scpPath->text() );
|
||||
st->setBool("Environment/RememberSshPassEnabled", m_dialog->rememberSshPass->isChecked());
|
||||
|
||||
for (int row=0; row < m_dialog->enabled_platforms->rowCount(); ++row)
|
||||
{
|
||||
|
||||
@ -45,6 +45,9 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "FWBSettings.h"
|
||||
#include "FWWindow.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace libfwbuilder;
|
||||
|
||||
@ -54,6 +57,21 @@ instOptionsDialog::instOptionsDialog(QWidget *parent, instConf *_cnf) :
|
||||
m_dialog = new Ui::instOptionsDialog_q;
|
||||
m_dialog->setupUi(this);
|
||||
cnf = _cnf;
|
||||
FWBSettings sets;
|
||||
|
||||
bool savePassEnabled = sets.getBool("Environment/RememberSshPassEnabled");
|
||||
m_dialog->rememberPass->setEnabled( savePassEnabled );
|
||||
if (savePassEnabled)
|
||||
{
|
||||
m_dialog->rememberPass->setChecked( sets.getBool("Environment/RememberSshPass") );
|
||||
FWWindow *fwwin = dynamic_cast<FWWindow*>(this->parent()->parent());
|
||||
QPair<QString, QString> passwds = fwwin->passwords[qMakePair(cnf->fwobj->getId(),
|
||||
cnf->user)];
|
||||
m_dialog->pwd->setText(passwds.first);
|
||||
m_dialog->epwd->setText(passwds.second);
|
||||
}
|
||||
else
|
||||
m_dialog->rememberPass->setChecked( false );
|
||||
|
||||
m_dialog->pwd->setEchoMode( QLineEdit::Password );
|
||||
m_dialog->epwd->setEchoMode( QLineEdit::Password );
|
||||
@ -171,6 +189,14 @@ instOptionsDialog::instOptionsDialog(QWidget *parent, instConf *_cnf) :
|
||||
|
||||
instOptionsDialog::~instOptionsDialog()
|
||||
{
|
||||
FWWindow *fwwin = dynamic_cast<FWWindow*>(this->parent()->parent());
|
||||
if ( m_dialog->rememberPass->isChecked() )
|
||||
fwwin->passwords[qMakePair(cnf->fwobj->getId(), m_dialog->uname->text())] =
|
||||
qMakePair(m_dialog->pwd->text(), m_dialog->epwd->text());
|
||||
else
|
||||
fwwin->passwords.remove(qMakePair(cnf->fwobj->getId(), m_dialog->uname->text()));
|
||||
FWBSettings sets;
|
||||
sets.setBool("Environment/RememberSshPass", m_dialog->rememberPass->isChecked());
|
||||
delete m_dialog;
|
||||
}
|
||||
|
||||
|
||||
@ -500,7 +500,7 @@
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="rememberPass">
|
||||
<property name="text">
|
||||
<string>Rememeber passwords</string>
|
||||
<string>Remember passwords</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tabGeneral">
|
||||
<attribute name="title">
|
||||
@ -492,7 +492,7 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<item row="7" column="0">
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@ -508,6 +508,20 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QCheckBox" name="rememberSshPass">
|
||||
<property name="toolTip">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Verdana ,Arial ,Bitstream Vera Sans ,Helvetica ,sans-serif'; font-size:medium; color:#000000;">Enable in-memory caching password for the current session.</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable remember password feature</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabLabels">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user