Commit 103a947c authored by Nick Schermer's avatar Nick Schermer

Support alternative component for help pages.

parent 31f2aebd
...@@ -74,6 +74,7 @@ struct _XfceSettingsManagerDialog ...@@ -74,6 +74,7 @@ struct _XfceSettingsManagerDialog
const gchar *default_icon; const gchar *default_icon;
gchar *help_page; gchar *help_page;
gchar *help_component;
GPid last_pid; GPid last_pid;
}; };
...@@ -93,6 +94,7 @@ enum ...@@ -93,6 +94,7 @@ enum
#ifdef ENABLE_PLUGGABLE_DIALOGS #ifdef ENABLE_PLUGGABLE_DIALOGS
COL_PLUGGABLE, COL_PLUGGABLE,
COL_HELP_PAGE, COL_HELP_PAGE,
COL_HELP_COMPONENT,
#endif #endif
COL_DIALOG_NAME, COL_DIALOG_NAME,
N_COLS N_COLS
...@@ -156,8 +158,6 @@ xfce_settings_manager_dialog_init(XfceSettingsManagerDialog *dialog) ...@@ -156,8 +158,6 @@ xfce_settings_manager_dialog_init(XfceSettingsManagerDialog *dialog)
#ifdef ENABLE_PLUGGABLE_DIALOGS #ifdef ENABLE_PLUGGABLE_DIALOGS
dialog->socket = NULL; dialog->socket = NULL;
dialog->last_pid = -1; dialog->last_pid = -1;
dialog->help_page = NULL;
#endif #endif
dialog->default_title = _("Settings"); dialog->default_title = _("Settings");
...@@ -304,6 +304,7 @@ xfce_settings_manager_dialog_finalize(GObject *obj) ...@@ -304,6 +304,7 @@ xfce_settings_manager_dialog_finalize(GObject *obj)
XfceSettingsManagerDialog *dialog = XFCE_SETTINGS_MANAGER_DIALOG(obj); XfceSettingsManagerDialog *dialog = XFCE_SETTINGS_MANAGER_DIALOG(obj);
g_free (dialog->help_page); g_free (dialog->help_page);
g_free (dialog->help_component);
g_object_unref(dialog->ls); g_object_unref(dialog->ls);
G_OBJECT_CLASS(xfce_settings_manager_dialog_parent_class)->finalize(obj); G_OBJECT_CLASS(xfce_settings_manager_dialog_parent_class)->finalize(obj);
...@@ -331,6 +332,8 @@ xfce_settings_manager_dialog_reset_view(XfceSettingsManagerDialog *dialog, ...@@ -331,6 +332,8 @@ xfce_settings_manager_dialog_reset_view(XfceSettingsManagerDialog *dialog,
/* Use default help url */ /* Use default help url */
g_free(dialog->help_page); g_free(dialog->help_page);
dialog->help_page = NULL; dialog->help_page = NULL;
g_free(dialog->help_component);
dialog->help_component = NULL;
#endif #endif
/* Show the help button */ /* Show the help button */
...@@ -398,6 +401,7 @@ xfce_settings_manager_dialog_create_liststore(XfceSettingsManagerDialog *dialog) ...@@ -398,6 +401,7 @@ xfce_settings_manager_dialog_create_liststore(XfceSettingsManagerDialog *dialog)
#ifdef ENABLE_PLUGGABLE_DIALOGS #ifdef ENABLE_PLUGGABLE_DIALOGS
G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_STRING,
#endif #endif
G_TYPE_STRING); G_TYPE_STRING);
...@@ -510,7 +514,8 @@ xfce_settings_manager_dialog_create_liststore(XfceSettingsManagerDialog *dialog) ...@@ -510,7 +514,8 @@ xfce_settings_manager_dialog_create_liststore(XfceSettingsManagerDialog *dialog)
COL_SNOTIFY, xfce_rc_read_bool_entry(rcfile, "StartupNotify", FALSE), COL_SNOTIFY, xfce_rc_read_bool_entry(rcfile, "StartupNotify", FALSE),
#ifdef ENABLE_PLUGGABLE_DIALOGS #ifdef ENABLE_PLUGGABLE_DIALOGS
COL_PLUGGABLE, xfce_rc_read_bool_entry(rcfile, "X-XfcePluggable", FALSE), COL_PLUGGABLE, xfce_rc_read_bool_entry(rcfile, "X-XfcePluggable", FALSE),
COL_HELP_PAGE, xfce_rc_read_entry(rcfile, "X-XfceHelpPage", FALSE), COL_HELP_PAGE, xfce_rc_read_entry(rcfile, "X-XfceHelpPage", NULL),
COL_HELP_COMPONENT, xfce_rc_read_entry(rcfile, "X-XfceHelpComponent", NULL),
#endif #endif
COL_DIALOG_NAME, dialog_name, COL_DIALOG_NAME, dialog_name,
-1); -1);
...@@ -544,6 +549,7 @@ xfce_settings_manager_dialog_item_activated(ExoIconView *iconview, ...@@ -544,6 +549,7 @@ xfce_settings_manager_dialog_item_activated(ExoIconView *iconview,
#ifdef ENABLE_PLUGGABLE_DIALOGS #ifdef ENABLE_PLUGGABLE_DIALOGS
gboolean pluggable = FALSE; gboolean pluggable = FALSE;
gchar *help_page, *command; gchar *help_page, *command;
gchar *help_component;
#endif #endif
GError *error = NULL; GError *error = NULL;
...@@ -559,6 +565,7 @@ xfce_settings_manager_dialog_item_activated(ExoIconView *iconview, ...@@ -559,6 +565,7 @@ xfce_settings_manager_dialog_item_activated(ExoIconView *iconview,
#ifdef ENABLE_PLUGGABLE_DIALOGS #ifdef ENABLE_PLUGGABLE_DIALOGS
COL_PLUGGABLE, &pluggable, COL_PLUGGABLE, &pluggable,
COL_HELP_PAGE, &help_page, COL_HELP_PAGE, &help_page,
COL_HELP_COMPONENT, &help_component,
#endif #endif
-1); -1);
...@@ -576,13 +583,13 @@ xfce_settings_manager_dialog_item_activated(ExoIconView *iconview, ...@@ -576,13 +583,13 @@ xfce_settings_manager_dialog_item_activated(ExoIconView *iconview,
xfce_settings_manager_dialog_reset_view(dialog, FALSE); xfce_settings_manager_dialog_reset_view(dialog, FALSE);
/* If the dialog supports help, show the help button */ /* If the dialog supports help, show the help button */
if(help_page) { gtk_widget_set_visible (dialog->help_button, help_page != NULL);
gtk_widget_show (dialog->help_button);
/* Replace the current help url */ /* Replace the current help url */
g_free(dialog->help_page); g_free(dialog->help_page);
dialog->help_page = g_strdup(help_page); dialog->help_page = g_strdup(help_page);
} g_free(dialog->help_component);
dialog->help_component = g_strdup(help_component);
/* Build the dialog command */ /* Build the dialog command */
command = g_strdup_printf("%s --socket-id=%d", exec, command = g_strdup_printf("%s --socket-id=%d", exec,
...@@ -621,6 +628,7 @@ xfce_settings_manager_dialog_item_activated(ExoIconView *iconview, ...@@ -621,6 +628,7 @@ xfce_settings_manager_dialog_item_activated(ExoIconView *iconview,
} }
g_free(help_page); g_free(help_page);
g_free(help_component);
#endif #endif
g_free(exec); g_free(exec);
g_free(name); g_free(name);
...@@ -643,7 +651,8 @@ static void ...@@ -643,7 +651,8 @@ static void
xfce_settings_manager_dialog_help_button_clicked(GtkWidget *button, xfce_settings_manager_dialog_help_button_clicked(GtkWidget *button,
XfceSettingsManagerDialog *dialog) XfceSettingsManagerDialog *dialog)
{ {
xfce_dialog_show_help (GTK_WINDOW (dialog), "xfce4-settings", xfce_dialog_show_help (GTK_WINDOW (dialog),
dialog->help_component ? dialog->help_component : "xfce4-settings",
dialog->help_page ? dialog->help_page : "manager", dialog->help_page ? dialog->help_page : "manager",
NULL); NULL);
} }
......
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