Implement "search messages" action (fixes NB#57209).
authorJose Dapena Paz <jdapena@igalia.com>
Tue, 5 Jun 2007 15:28:49 +0000 (15:28 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Tue, 5 Jun 2007 15:28:49 +0000 (15:28 +0000)
* 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/libmodest-dbus-client-1.0.pc.in
src/gnome/modest-platform.c
src/maemo/modest-main-window-ui.h
src/maemo/modest-platform.c
src/maemo/ui/modest-msg-view-window-ui.xml
src/modest-platform.h
src/modest-ui-actions.c
src/modest-ui-actions.h
src/widgets/modest-msg-edit-window-ui.h

index c8d6edb..00245ee 100644 (file)
@@ -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
index 036829a..861eca3 100644 (file)
@@ -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);
+}
index a63b12a..d18b37c 100644 (file)
@@ -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 */
index 455e12b..cc30e48 100644 (file)
@@ -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 */
+       }
+}
index 39d1c5d..52bcfff 100644 (file)
    <menu name="ToolsMenu" action="Tools">
       <menuitem name="ToolsAddToContactsMenu" action="ToolsAddToContacts"/>
       <separator/>
-<!--
-      <menuitem name="ToolsFindOnPageMenu" action="ToolsFindOnPage"/>
-      <menuitem name="ToolSearchMessagesMenu" action="ToolSearchMessages"/>
+
+<!--       <menuitem name="ToolsFindOnPageMenu" action="ToolsFindOnPage"/> -->
+      <menuitem name="ToolsSearchMessagesMenu" action="ToolsSearchMessages"/>
       <separator/>
--->
       <menuitem name="ToolsHelpMenu" action="ToolsHelp"/>
    </menu>
 
index c0a1922..2511e9d 100644 (file)
@@ -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__ */
index aec999d..7d1d4ef 100644 (file)
@@ -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));
+}
index e82d84a..7444cb7 100644 (file)
@@ -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__ */
index 7e403a1..f9e7ac3 100644 (file)
@@ -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 */