From 3d4bef6f6a0e2649b9236352f6ce73e57c0feff7 Mon Sep 17 00:00:00 2001 From: infirit Date: Thu, 18 Dec 2014 00:52:49 +0100 Subject: Add Help button to the preferences dialog Taken from GSM commit: 6bd176c2efeec0375b5d9e5e1d3f3d1c2f1138bd From: Robert Roth Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=501070 --- src/procdialogs.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/procdialogs.cpp b/src/procdialogs.cpp index b35265d..2aff3ff 100644 --- a/src/procdialogs.cpp +++ b/src/procdialogs.cpp @@ -247,9 +247,20 @@ procdialog_create_renice_dialog (ProcData *procdata) static void prefs_dialog_button_pressed (GtkDialog *dialog, gint id, gpointer data) { - gtk_widget_destroy (GTK_WIDGET (dialog)); - - prefs_dialog = NULL; + if (id == GTK_RESPONSE_HELP) + { + GError* error = 0; + if (!g_app_info_launch_default_for_uri("help:mate-system-monitor/mate-system-monitor-prefs", NULL, &error)) + { + g_warning("Could not display preferences help : %s", error->message); + g_error_free(error); + } + } + else + { + gtk_widget_destroy (GTK_WIDGET (dialog)); + prefs_dialog = NULL; + } } @@ -490,6 +501,7 @@ procdialog_create_preferences_dialog (ProcData *procdata) dialog = gtk_dialog_new_with_buttons (_("System Monitor Preferences"), GTK_WINDOW (procdata->app), GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_HELP, GTK_RESPONSE_HELP, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); /* FIXME: we should not declare the window size, but let it's */ @@ -823,5 +835,3 @@ procdialog_create_root_password_dialog(ProcmanActionType type, g_free(command); return ret; } - - -- cgit v1.2.1