Commit 01551e57 authored by Jakob Petsovits's avatar Jakob Petsovits
Browse files

Always keep "Show SSH Manager" text, let checkbox represent state

Having a checkable menu item combined with changing texts
is confusing. "Hide SSH Manager" in checked state would indicate
that the hidden state is active, which is not actually the case.

The menu item text should either indicate an action, in which case
renaming is okay but no checkbox should be added, or the
unchanging text should name the state that's either
active/checked or inactive/unchecked.

In the spirit of "Settings" -> "Show Menubar" / "Show Statusbar",
I'm picking the latter, so the text always remains
"Show SSH Manager" and only the checkbox state gets toggled.
parent 8b38d587
...@@ -64,18 +64,13 @@ void SSHManagerPlugin::createWidgetsForMainWindow(Konsole::MainWindow *mainWindo ...@@ -64,18 +64,13 @@ void SSHManagerPlugin::createWidgetsForMainWindow(Konsole::MainWindow *mainWindo
QList<QAction *> SSHManagerPlugin::menuBarActions(Konsole::MainWindow* mainWindow) const QList<QAction *> SSHManagerPlugin::menuBarActions(Konsole::MainWindow* mainWindow) const
{ {
Q_UNUSED(mainWindow); Q_UNUSED(mainWindow);
const QString show = i18n("Show SSH Manager");
const QString hide = i18n("Hide SSH Manager");
QAction *toggleVisibilityAction = new QAction(show, mainWindow); QAction *toggleVisibilityAction = new QAction(i18n("Show SSH Manager"), mainWindow);
toggleVisibilityAction->setCheckable(true); toggleVisibilityAction->setCheckable(true);
toggleVisibilityAction->setChecked(false); toggleVisibilityAction->setChecked(false);
toggleVisibilityAction->setText(show);
connect(toggleVisibilityAction, &QAction::triggered, this, [=] (bool visible) { connect(toggleVisibilityAction, &QAction::triggered,
d->dockForWindow[mainWindow]->setVisible(visible); d->dockForWindow[mainWindow], &QDockWidget::setVisible);
toggleVisibilityAction->setText(visible ? hide : show);
});
return {toggleVisibilityAction}; return {toggleVisibilityAction};
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment