Add help button to properties dialog

master
Simon Steinbeiss 2021-03-10 16:31:08 +01:00
parent 876dfd10a7
commit bd012459a5
1 changed files with 25 additions and 14 deletions

View File

@ -940,6 +940,16 @@ static void change_color_out(GtkWidget *button, t_global_monitor *global)
static void static void
monitor_dialog_response (GtkWidget *dlg, int response, t_global_monitor *global) monitor_dialog_response (GtkWidget *dlg, int response, t_global_monitor *global)
{ {
if (response == GTK_RESPONSE_HELP) {
xfce_dialog_show_help (GTK_WINDOW (dlg), PACKAGE_VERSION, NULL, NULL);
}
else {
monitor_apply_options (global);
gtk_widget_destroy (dlg);
xfce_panel_plugin_unblock_menu (global->plugin);
monitor_write_config (global->plugin, global);
}
}
monitor_apply_options (global); monitor_apply_options (global);
gtk_widget_destroy (dlg); gtk_widget_destroy (dlg);
@ -1014,12 +1024,13 @@ static void monitor_create_options(XfcePanelPlugin *plugin, t_global_monitor *gl
xfce_panel_plugin_block_menu (plugin); xfce_panel_plugin_block_menu (plugin);
dlg = xfce_titled_dialog_new_with_buttons (_("Network Monitor"), NULL, dlg = xfce_titled_dialog_new_with_mixed_buttons (_("Network Monitor"), NULL,
GTK_DIALOG_DESTROY_WITH_PARENT, GTK_DIALOG_DESTROY_WITH_PARENT,
"gtk-close", GTK_RESPONSE_OK, "window-close-symbolic", _("_Close"), GTK_RESPONSE_OK,
NULL); "help-browser", _("_Help"), GTK_RESPONSE_HELP,
NULL);
gtk_window_set_icon_name (GTK_WINDOW (dlg), "xfce4-settings"); gtk_window_set_icon_name (GTK_WINDOW (dlg), "org.xfce.panel.netload");
g_signal_connect (dlg, "response", G_CALLBACK (monitor_dialog_response), g_signal_connect (dlg, "response", G_CALLBACK (monitor_dialog_response),
global); global);