Added support for opening the addressbook from the main window
authorJose Dapena Paz <jdapena@igalia.com>
Thu, 7 Jun 2007 19:54:25 +0000 (19:54 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Thu, 7 Jun 2007 19:54:25 +0000 (19:54 +0000)
through menu (fixes bug NB#57590):
* src/modest-platform.h:
        * Added method to show the addressbook UI.
* src/modest-ui-actions.[ch]:
        * Add action handler to open the addressbook UI.
* src/maemo/modest-main-window-ui.h:
        * Add callback handler to show addressbook from main
          window menu.
* src/maemo/modest-platform.c:
        * Added implementation to show the addressbook
          from modest using osso rpc.

pmo-trunk-r2113

src/maemo/modest-main-window-ui.h
src/maemo/modest-platform.c
src/modest-platform.h
src/modest-ui-actions.c
src/modest-ui-actions.h

index d18b37c..00fc7a2 100644 (file)
@@ -96,7 +96,7 @@ static const GtkActionEntry modest_action_entries [] = {
        { "ToolsSendReceive", NULL, N_("mcen_me_inbox_sendandreceive") }, /* submenu */
        { "ToolsSendReceiveAll",    NULL,      N_("mcen_me_inbox_sendandreceive_all"),          NULL, NULL, G_CALLBACK (modest_ui_actions_on_send_receive) },
        { "ToolsSendReceiveCancelSending",  NULL,      N_("mcen_me_outbox_cancelsend"),        NULL, NULL,  NULL },
-       { "ToolsContacts",            NULL,      N_("mcen_me_inbox_open_addressbook"),                      NULL, NULL,  NULL },
+       { "ToolsContacts",            NULL,      N_("mcen_me_inbox_open_addressbook"),                      NULL, NULL,  G_CALLBACK (modest_ui_actions_on_open_addressbook) },
        { "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,  G_CALLBACK (modest_ui_actions_on_search_messages) },
        { "ToolsHelp", NULL, N_("mcen_me_inbox_help"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_help) },
index cc30e48..ed0cf64 100644 (file)
@@ -840,3 +840,15 @@ modest_platform_show_search_messages (GtkWindow *parent_window)
                /* TODO: warning about error showing dialog */
        }
 }
+
+void 
+modest_platform_show_addressbook (GtkWindow *parent_window)
+{
+       osso_return_t result = OSSO_ERROR;
+       
+       result = osso_rpc_run_with_defaults (osso_context, "osso_addressbook", "top_application", NULL, DBUS_TYPE_INVALID);
+
+       if (result != OSSO_OK) {
+               /* TODO: warning about error showing dialog */
+       }
+}
index 2511e9d..d51dea4 100644 (file)
@@ -233,6 +233,14 @@ void modest_platform_show_help (GtkWindow *parent_window,
  **/
 void modest_platform_show_search_messages (GtkWindow *parent_window);
 
+/**
+ * modest_platform_show_addressbook:
+ * @parent_window: window the dialog will be child of
+ *
+ * shows the addressbook
+ **/
+void modest_platform_show_addressbook (GtkWindow *parent_window);
+
 G_END_DECLS
 
 #endif /* __MODEST_PLATFORM_UTILS_H__ */
index 8be6b6b..159a307 100644 (file)
@@ -3039,6 +3039,14 @@ modest_ui_actions_on_search_messages (GtkAction *action, ModestWindow *window)
        modest_platform_show_search_messages (GTK_WINDOW (window));
 }
 
+void     
+modest_ui_actions_on_open_addressbook (GtkAction *action, ModestWindow *win)
+{
+       g_return_if_fail (MODEST_IS_WINDOW (win));
+       modest_platform_show_addressbook (GTK_WINDOW (win));
+}
+
+
 void
 modest_ui_actions_on_toggle_find_in_page (GtkToggleAction *action,
                                          ModestWindow *window)
index 5261a1e..69b4784 100644 (file)
@@ -56,6 +56,8 @@ void     modest_ui_actions_on_add_to_contacts   (GtkAction *action, ModestWindow
 
 void     modest_ui_actions_on_select_contacts (GtkAction *action, ModestMsgEditWindow *win);
 
+void     modest_ui_actions_on_open_addressbook (GtkAction *action, ModestWindow *win);
+
 void     modest_ui_actions_on_check_names (GtkAction *action, ModestMsgEditWindow *win);
 
 void     modest_ui_actions_on_new_msg       (GtkAction *action, ModestWindow *win);