diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 8147c40b97..21a52d6ba6 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -206,6 +206,13 @@ MainWindow::MainWindow() connect(sshAgent(), SIGNAL(error(QString)), this, SLOT(showErrorMessage(QString))); connect(sshAgent(), SIGNAL(enabledChanged(bool)), this, SLOT(agentEnabled(bool))); m_ui->settingsWidget->addSettingsPage(new AgentSettingsPage()); + if (!sshAgent()->isEnabled()) { + m_ui->actionFlushSSHAgent->setEnabled(false); + m_ui->actionFlushSSHAgent->setVisible(false); + } +#else + m_ui->actionFlushSSHAgent->setVisible(false); + m_ui->actionFlushSSHAgent->setEnabled(false); #endif #if defined(WITH_XC_KEESHARE) @@ -397,8 +404,10 @@ MainWindow::MainWindow() m_ui->actionGroupDownloadFavicons->setIcon(icons()->icon("favicon-download")); m_ui->actionSettings->setIcon(icons()->icon("configure")); - m_ui->actionPasswordGenerator->setIcon(icons()->icon("password-generator")); +#ifdef WITH_XC_SSHAGENT m_ui->actionFlushSSHAgent->setIcon(icons()->icon("utilities-terminal")); +#endif + m_ui->actionPasswordGenerator->setIcon(icons()->icon("password-generator")); m_ui->actionAbout->setIcon(icons()->icon("help-about")); m_ui->actionDonate->setIcon(icons()->icon("donate")); @@ -969,8 +978,6 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode) m_ui->actionEntryAddToAgent->setEnabled(singleEntryHasSshKey); m_ui->actionEntryRemoveFromAgent->setVisible(singleEntryHasSshKey); m_ui->actionEntryRemoveFromAgent->setEnabled(singleEntryHasSshKey); - m_ui->actionFlushSSHAgent->setVisible(true); - m_ui->actionFlushSSHAgent->setEnabled(true); #endif m_searchWidgetAction->setEnabled(true); @@ -1605,6 +1612,7 @@ void MainWindow::agentEnabled(bool enabled) { m_ui->actionEntryAddToAgent->setVisible(enabled); m_ui->actionEntryRemoveFromAgent->setVisible(enabled); + m_ui->actionFlushSSHAgent->setEnabled(enabled); m_ui->actionFlushSSHAgent->setVisible(enabled); } @@ -2115,7 +2123,9 @@ void MainWindow::initActionCollection() m_ui->actionGroupEmptyRecycleBin, // Tools Menu m_ui->actionPasswordGenerator, +#ifdef WITH_XC_SSHAGENT m_ui->actionFlushSSHAgent, +#endif m_ui->actionSettings, // View Menu m_ui->actionThemeAuto,