diff options
author | infirit <[email protected]> | 2014-12-18 00:52:49 +0100 |
---|---|---|
committer | infirit <[email protected]> | 2014-12-18 01:01:48 +0100 |
commit | 3d4bef6f6a0e2649b9236352f6ce73e57c0feff7 (patch) | |
tree | 2b4760755dd03d5c9d9f43557dc018c28d1d8c73 | |
parent | de90d534cbba7c1a76b2435342ff73dc3da2ba25 (diff) | |
download | mate-system-monitor-3d4bef6f6a0e2649b9236352f6ce73e57c0feff7.tar.bz2 mate-system-monitor-3d4bef6f6a0e2649b9236352f6ce73e57c0feff7.tar.xz |
Add Help button to the preferences dialog
Taken from GSM commit: 6bd176c2efeec0375b5d9e5e1d3f3d1c2f1138bd
From: Robert Roth <[email protected]>
Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=501070
-rw-r--r-- | src/procdialogs.cpp | 20 |
1 files 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; } - - |