diff options
author | Leandro Pereira <leandro@hardinfo.org> | 2010-01-03 13:20:55 -0200 |
---|---|---|
committer | Leandro Pereira <leandro@hardinfo.org> | 2010-01-03 13:20:55 -0200 |
commit | 9197f8f7599be83c22eb6aa0649e7be4f102a187 (patch) | |
tree | 3a3a0b0b1d096aaefa79a44dd4654e55d93e6d26 /hardinfo2/callbacks.c | |
parent | 679cf487bceb54949f7fe51523f54b5962a7466f (diff) |
Add ability to include context-sensitive help files.
Diffstat (limited to 'hardinfo2/callbacks.c')
-rw-r--r-- | hardinfo2/callbacks.c | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/hardinfo2/callbacks.c b/hardinfo2/callbacks.c index c3b3b972..42a9c642 100644 --- a/hardinfo2/callbacks.c +++ b/hardinfo2/callbacks.c @@ -125,7 +125,7 @@ void cb_local_computer() shell_view_set_enabled(TRUE); shell_status_update("Done."); - shell_set_remote_label(shell, "Local"); + shell_set_remote_label(shell, ""); #endif /* HAS_LIBSOUP */ } @@ -186,6 +186,45 @@ void cb_open_online_docs() } } +void cb_open_online_docs_context() +{ + Shell *shell; + + shell = shell_get_main_shell(); + + if (shell->selected->flags & MODULE_FLAG_HAS_HELP) { + gchar *temp; + + /* FIXME: better naming for context-help files */ + temp = g_strdup_printf("context-help-%s-%d.hlp", + shell->selected_module_name, + shell->selected->number); + + if (shell->help_viewer) { + help_viewer_open_page(shell->help_viewer, temp); + } else { + gchar *help_dir; + + help_dir = g_build_filename(params.path_data, "doc", NULL); + shell->help_viewer = help_viewer_new(help_dir, temp); + g_free(help_dir); + } + + g_free(temp); + } else { + GtkWidget *dialog; + + dialog = gtk_message_dialog_new(GTK_WINDOW(shell->window), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + "No context help available."); + + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); + } +} + void cb_report_bug() { open_url("http://wiki.hardinfo.org/BugReports"); |