From 9aaf6d5cc06579078bb67ed6eab0bd6337c79bc1 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Wed, 3 Oct 2007 16:55:20 +0000 Subject: [PATCH] * src/modest-platform.h, src/maemo/modest-platform.c: * Added method (modest_platform_set_dialog_help) and implementation for maemo using hildon/osso help. This method sets a topic for contextual help of a dialog. * src/maemo/modest-account-view-window.c: * Attach help topic for accounts settings dialog. This fixes NB#64313 at modest side. We still need the topic help in help contents. pmo-trunk-r3463 --- src/maemo/modest-account-settings-dialog.c | 2 +- src/maemo/modest-account-view-window.c | 5 +++++ src/maemo/modest-platform.c | 21 +++++++++++++++++++++ src/modest-platform.h | 11 +++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/maemo/modest-account-settings-dialog.c b/src/maemo/modest-account-settings-dialog.c index b5f25c4..875aea0 100644 --- a/src/maemo/modest-account-settings-dialog.c +++ b/src/maemo/modest-account-settings-dialog.c @@ -1210,7 +1210,7 @@ modest_account_settings_dialog_init (ModestAccountSettingsDialog *self) G_CALLBACK (on_response), self); self->modified = FALSE; - + /* When this window is shown, hibernation should not be possible, * because there is no sensible way to save the state: */ modest_window_mgr_prevent_hibernation_while_window_is_shown ( diff --git a/src/maemo/modest-account-view-window.c b/src/maemo/modest-account-view-window.c index 3c92994..f6cb3d3 100644 --- a/src/maemo/modest-account-view-window.c +++ b/src/maemo/modest-account-view-window.c @@ -34,6 +34,7 @@ #include #include +#include "modest-platform.h" #include #include #include "modest-tny-platform-factory.h" @@ -421,6 +422,7 @@ modest_account_view_window_init (ModestAccountViewWindow *obj) TRUE, TRUE, 2); gtk_window_set_title (GTK_WINDOW (obj), _("mcen_ti_emailsetup_accounts")); + } GtkWidget* @@ -428,5 +430,8 @@ modest_account_view_window_new (void) { GObject *obj = g_object_new(MODEST_TYPE_ACCOUNT_VIEW_WINDOW, NULL); + /* Attach dialog help */ + modest_platform_set_dialog_help (GTK_DIALOG (obj), "applications_email_accountsettings"); + return GTK_WIDGET(obj); } diff --git a/src/maemo/modest-platform.c b/src/maemo/modest-platform.c index f521639..f82ffb9 100644 --- a/src/maemo/modest-platform.c +++ b/src/maemo/modest-platform.c @@ -1335,6 +1335,27 @@ modest_platform_show_help (GtkWindow *parent_window, } } +void +modest_platform_set_dialog_help (GtkDialog *parent_window, + const gchar *help_id) +{ + gboolean result; + g_return_if_fail (help_id); + g_return_if_fail (osso_context); + g_return_if_fail (GTK_IS_DIALOG (parent_window)); + + /* Show help */ +#ifdef MODEST_HAVE_OSSO_HELP + result = ossohelp_dialog_help_enable (parent_window, help_id, osso_context); +#else + result = hildon_help_dialog_help_enable (parent_window, help_id, osso_context); +#endif + + if (!result) + g_warning ("Help topic %s not found", help_id); + +} + void modest_platform_show_search_messages (GtkWindow *parent_window) { diff --git a/src/modest-platform.h b/src/modest-platform.h index e897c87..e1f35ba 100644 --- a/src/modest-platform.h +++ b/src/modest-platform.h @@ -289,6 +289,17 @@ void modest_platform_show_help (GtkWindow *parent_window, const gchar *help_id); /** + * modest_platform_set_dialog_help: + * @dialog: a #GtkDialog + * @help_id: the help topic id to be shown on requesting + * help in the dialog + * + * attachs a help topic to the dialog + **/ +void modest_platform_set_dialog_help (GtkDialog *parent_window, + const gchar *help_id); + +/** * modest_platform_show_search_messages: * @parent_window: window the dialog will be child of * -- 1.7.9.5