From 9d8de13bc46137931a2790969dcb1fb932c7bcc6 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Tue, 5 Jun 2007 15:28:49 +0000 Subject: [PATCH] Implement "search messages" action (fixes NB#57209). * src/modest-platform.h: * New method to invoke the search messages dialog * src/gnome/modest-platform.c: * Stub implementation for ...show_search_messages * src/widgets/modest_msg_edit_window-ui.h: * Added callback for search messages action * src/modest-ui-actions.[ch]: * Added new ui action to show the search messages dialog, relying on modest platform implementation. * src/maemo/modest-main-window-ui.h: * Added callback for search messages action * src/maemo/modest-platform.c: * New ..._show_search_messages method. Shows the osso global search dialog for searching emails. * src/maemo/ui/modest-msg-view-window-ui.xml: * Fix and show search messages action. Other issues: * libmodest-dbus-client/libmodest-dbus-client-1.0.pc.in: * Fixed -l declaration. pmo-trunk-r2071 --- .../libmodest-dbus-client-1.0.pc.in | 2 +- src/gnome/modest-platform.c | 6 ++++++ src/maemo/modest-main-window-ui.h | 2 +- src/maemo/modest-platform.c | 12 ++++++++++++ src/maemo/ui/modest-msg-view-window-ui.xml | 7 +++---- src/modest-platform.h | 8 ++++++++ src/modest-ui-actions.c | 8 ++++++++ src/modest-ui-actions.h | 10 ++++++++++ src/widgets/modest-msg-edit-window-ui.h | 2 +- 9 files changed, 50 insertions(+), 7 deletions(-) diff --git a/libmodest-dbus-client/libmodest-dbus-client-1.0.pc.in b/libmodest-dbus-client/libmodest-dbus-client-1.0.pc.in index c8d6edb..00245ee 100644 --- a/libmodest-dbus-client/libmodest-dbus-client-1.0.pc.in +++ b/libmodest-dbus-client/libmodest-dbus-client-1.0.pc.in @@ -7,5 +7,5 @@ Name: libmodest-dbus-client-1.0 Description: Some library. Requires: glib-2.0 dbus-1 Version: @VERSION@ -Libs: -L${libdir} -llibmodest-dbus-client-1.0 +Libs: -L${libdir} -lmodest-dbus-client-1.0 Cflags: -I${includedir}/libmodest-dbus-client-1.0 -I${libdir}/libmodest-dbus-client-1.0/include diff --git a/src/gnome/modest-platform.c b/src/gnome/modest-platform.c index 036829a..861eca3 100644 --- a/src/gnome/modest-platform.c +++ b/src/gnome/modest-platform.c @@ -223,3 +223,9 @@ modest_platform_show_help (GtkWidget *widget, const gchar *help_id) { return TRUE; /* TODO */ } + +void +modest_platform_show_search_messages (GtkWindow *parent_window) +{ + modest_runtime_not_implemented (NULL); +} diff --git a/src/maemo/modest-main-window-ui.h b/src/maemo/modest-main-window-ui.h index a63b12a..d18b37c 100644 --- a/src/maemo/modest-main-window-ui.h +++ b/src/maemo/modest-main-window-ui.h @@ -98,7 +98,7 @@ static const GtkActionEntry modest_action_entries [] = { { "ToolsSendReceiveCancelSending", NULL, N_("mcen_me_outbox_cancelsend"), NULL, NULL, NULL }, { "ToolsContacts", NULL, N_("mcen_me_inbox_open_addressbook"), NULL, NULL, NULL }, { "ToolsAddToContacts", NULL, N_("mcen_me_viewer_addtocontacts"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_add_to_contacts) }, - { "ToolsSearchMessages", NULL, N_("mcen_me_inbox_search"), NULL, NULL, NULL }, + { "ToolsSearchMessages", NULL, N_("mcen_me_inbox_search"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_search_messages) }, { "ToolsHelp", NULL, N_("mcen_me_inbox_help"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_help) }, /* Close */ diff --git a/src/maemo/modest-platform.c b/src/maemo/modest-platform.c index 455e12b..cc30e48 100644 --- a/src/maemo/modest-platform.c +++ b/src/maemo/modest-platform.c @@ -828,3 +828,15 @@ modest_platform_show_help (GtkWindow *parent_window, g_free (error_msg); } } + +void +modest_platform_show_search_messages (GtkWindow *parent_window) +{ + osso_return_t result = OSSO_ERROR; + + result = osso_rpc_run_with_defaults (osso_context, "osso_global_search", "search_email", NULL, DBUS_TYPE_INVALID); + + if (result != OSSO_OK) { + /* TODO: warning about error showing dialog */ + } +} diff --git a/src/maemo/ui/modest-msg-view-window-ui.xml b/src/maemo/ui/modest-msg-view-window-ui.xml index 39d1c5d..52bcfff 100644 --- a/src/maemo/ui/modest-msg-view-window-ui.xml +++ b/src/maemo/ui/modest-msg-view-window-ui.xml @@ -79,11 +79,10 @@ - + ---> diff --git a/src/modest-platform.h b/src/modest-platform.h index c0a1922..2511e9d 100644 --- a/src/modest-platform.h +++ b/src/modest-platform.h @@ -225,6 +225,14 @@ void modest_platform_on_new_msg (void); void modest_platform_show_help (GtkWindow *parent_window, const gchar *help_id); +/** + * modest_platform_show_search_messages: + * @parent_window: window the dialog will be child of + * + * shows the search messages dialog + **/ +void modest_platform_show_search_messages (GtkWindow *parent_window); + G_END_DECLS #endif /* __MODEST_PLATFORM_UTILS_H__ */ diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index aec999d..7d1d4ef 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -3003,3 +3003,11 @@ modest_ui_actions_check_toolbar_dimming_rules (ModestWindow *window) /* Update dimmed */ modest_window_check_dimming_rules_group (window, "ModestToolbarDimmingRules"); } + +void +modest_ui_actions_on_search_messages (GtkAction *action, ModestWindow *window) +{ + g_return_if_fail (MODEST_IS_WINDOW (window)); + + modest_platform_show_search_messages (GTK_WINDOW (window)); +} diff --git a/src/modest-ui-actions.h b/src/modest-ui-actions.h index e82d84a..7444cb7 100644 --- a/src/modest-ui-actions.h +++ b/src/modest-ui-actions.h @@ -365,5 +365,15 @@ modest_ui_actions_check_toolbar_dimming_rules (ModestWindow *window); void modest_ui_actions_move_folder_error_handler (ModestMailOperation *mail_op, gpointer user_data); +/** + * modest_ui_actions_on_search_messages: + * @action: a #GtkAction + * @window: a #ModestWindow + * + * Shows the search messages dialog + **/ +void modest_ui_actions_on_search_messages (GtkAction *action, + ModestWindow *window); + G_END_DECLS #endif /* __MODEST_UI_ACTIONS_H__ */ diff --git a/src/widgets/modest-msg-edit-window-ui.h b/src/widgets/modest-msg-edit-window-ui.h index 7e403a1..f9e7ac3 100644 --- a/src/widgets/modest-msg-edit-window-ui.h +++ b/src/widgets/modest-msg-edit-window-ui.h @@ -74,7 +74,7 @@ static const GtkActionEntry modest_msg_edit_action_entries [] = { { "CloseWindow", NULL, N_("mcen_me_inbox_close_window"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_close_window)}, { "CloseAllWindows", NULL, N_("mcen_me_inbox_close_windows"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_quit) }, { "Help", NULL, N_("mcen_me_inbox_help"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_help) }, - { "SearchMessages", NULL, N_("mcen_me_inbox_search"), NULL, NULL, NULL }, + { "SearchMessages", NULL, N_("mcen_me_inbox_search"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_search_messages) }, /* KEY ACCELERATOR ACTIONS */ -- 1.7.9.5