Updated local fingerprint after wizard is finished #4557

This commit is contained in:
XinyuHou 2015-04-21 17:56:01 +01:00
parent 018480412a
commit 363dc78ca8
3 changed files with 16 additions and 9 deletions

View File

@ -135,15 +135,7 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) :
m_pLabelPadlock->hide(); m_pLabelPadlock->hide();
if (Fingerprint::local().fileExists()) { updateLocalFingerprint();
m_pLabelFingerprint->setVisible(true);
m_pLabelLocalFingerprint->setVisible(true);
m_pLabelLocalFingerprint->setText(Fingerprint::local().readFirst());
}
else {
m_pLabelFingerprint->setVisible(false);
m_pLabelLocalFingerprint->setVisible(false);
}
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()
@ -940,6 +932,19 @@ void MainWindow::setEdition(int type)
setWindowTitle(title); setWindowTitle(title);
} }
void MainWindow::updateLocalFingerprint()
{
if (Fingerprint::local().fileExists()) {
m_pLabelFingerprint->setVisible(true);
m_pLabelLocalFingerprint->setVisible(true);
m_pLabelLocalFingerprint->setText(Fingerprint::local().readFirst());
}
else {
m_pLabelFingerprint->setVisible(false);
m_pLabelLocalFingerprint->setVisible(false);
}
}
void MainWindow::on_m_pGroupClient_toggled(bool on) void MainWindow::on_m_pGroupClient_toggled(bool on)
{ {
m_pGroupServer->setChecked(!on); m_pGroupServer->setChecked(!on);

View File

@ -106,6 +106,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
void updateZeroconfService(); void updateZeroconfService();
void serverDetected(const QString name); void serverDetected(const QString name);
void setEdition(int type); void setEdition(int type);
void updateLocalFingerprint();
public slots: public slots:
void appendLogRaw(const QString& text); void appendLogRaw(const QString& text);

View File

@ -169,6 +169,7 @@ void SetupWizard::accept()
appConfig.setEdition(m_Edition); appConfig.setEdition(m_Edition);
} }
m_MainWindow.setEdition(m_Edition); m_MainWindow.setEdition(m_Edition);
m_MainWindow.updateLocalFingerprint();
settings.sync(); settings.sync();