diff options
| author | Blaster goo <[email protected]> | 2021-10-11 17:41:42 +0000 |
|---|---|---|
| committer | Nate Graham <[email protected]> | 2021-10-11 17:41:42 +0000 |
| commit | 73082d2e42180d3795014738499109c839705622 (patch) | |
| tree | 1155551330e6139966416d8b401be206e50a6972 /src | |
| parent | 2f5e4cb02933e3317098bdf090b3f6103061d4ae (diff) | |
Currently, when changing Version Control settings in Configure -> Context Menu, it
tells you to restart to apply those settings. This commit changes that by asking you
if you would like to restart now or later.
FEATURE: 441192
FIXED-IN: 21.12
Diffstat (limited to 'src')
| -rw-r--r-- | src/settings/contextmenu/contextmenusettingspage.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/settings/contextmenu/contextmenusettingspage.cpp b/src/settings/contextmenu/contextmenusettingspage.cpp index c92bad43e..8ebac2e12 100644 --- a/src/settings/contextmenu/contextmenusettingspage.cpp +++ b/src/settings/contextmenu/contextmenusettingspage.cpp @@ -11,6 +11,7 @@ #include "dolphin_contextmenusettings.h" #include "settings/serviceitemdelegate.h" #include "settings/servicemodel.h" +#include "global.h" #include <KDesktopFile> #include <KLocalizedString> @@ -30,6 +31,7 @@ #include <QShowEvent> #include <QSortFilterProxyModel> #include <QLineEdit> +#include <QApplication> namespace { @@ -37,6 +39,8 @@ namespace const char VersionControlServicePrefix[] = "_version_control_"; const char DeleteService[] = "_delete"; const char CopyToMoveToService[] ="_copy_to_move_to"; + + bool laterSelected = false; } ContextMenuSettingsPage::ContextMenuSettingsPage(QWidget* parent, @@ -192,11 +196,21 @@ void ContextMenuSettingsPage::applySettings() VersionControlSettings::setEnabledPlugins(enabledPlugins); VersionControlSettings::self()->save(); - KMessageBox::information(window(), - i18nc("@info", "Dolphin must be restarted to apply the " - "updated version control systems settings."), - QString(), // default title - QStringLiteral("ShowVcsRestartInformation")); + if (!laterSelected) { + KMessageBox::ButtonCode promptRestart = KMessageBox::questionYesNo(window(), + i18nc("@info", "Dolphin must be restarted to apply the " + "updated version control system settings."), + i18nc("@info", "Restart now?"), + KGuiItem(QApplication::translate("KStandardGuiItem", "&Restart"), QStringLiteral("dialog-restart")), + KGuiItem(QApplication::translate("KStandardGuiItem", "&Later"), QStringLiteral("dialog-later")) + ); + if (promptRestart == KMessageBox::ButtonCode::Yes) { + Dolphin::openNewWindow(); + qApp->quit(); + } else { + laterSelected = true; + } + } } } |
