Skip to content

Commit

Permalink
SSH Agent: Fix menu entry visibility (keepassxreboot#8346)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexpFr committed May 5, 2024
1 parent d91d62e commit e1b42e3
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"));
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit e1b42e3

Please sign in to comment.