Added OpenEditAccountsDialog service to libmodest dbus client
authorSergio Villar Senin <svillar@igalia.com>
Fri, 23 Oct 2009 11:36:57 +0000 (13:36 +0200)
committerSergio Villar Senin <svillar@igalia.com>
Mon, 2 Nov 2009 09:32:41 +0000 (10:32 +0100)
libmodest-dbus-client/src/libmodest-dbus-api.h
libmodest-dbus-client/src/libmodest-dbus-client.c
libmodest-dbus-client/src/libmodest-dbus-client.h

index 86159d0..b06ac27 100644 (file)
@@ -93,6 +93,8 @@ enum ModestDbusDeleteMessageArguments
 
 #define MODEST_DBUS_METHOD_OPEN_DEFAULT_INBOX "OpenDefaultInbox"
 
+#define MODEST_DBUS_METHOD_OPEN_EDIT_ACCOUNTS_DIALOG "OpenEditAccountsDialog"
+
 /*
  * these methods are for debugging only, and should _not_ be
  * exported through libmodest-dbus-client
index 88ac781..8b5f330 100644 (file)
@@ -274,6 +274,28 @@ libmodest_dbus_client_open_account (osso_context_t *osso_context,
        return TRUE;
 }
 
+gboolean
+libmodest_dbus_client_open_edit_accounts_dialog (osso_context_t *osso_context)
+{
+       osso_rpc_t retval = { 0 };
+       const osso_return_t ret =
+               osso_rpc_run_with_defaults(osso_context,
+                                          MODEST_DBUS_NAME,
+                                          MODEST_DBUS_METHOD_OPEN_EDIT_ACCOUNTS_DIALOG, &retval,
+                                          DBUS_TYPE_INVALID);
+
+       if (ret != OSSO_OK) {
+               printf("debug: %s: osso_rpc_run() failed.\n", __FUNCTION__);
+               return FALSE;
+       } else {
+               printf("debug: %s: osso_rpc_run() succeeded.\n", __FUNCTION__);
+       }
+
+       osso_rpc_free_val(&retval);
+
+       return TRUE;
+}
+
 /**
  * libmodest_dbus_client_delete_message:
  * @osso_context: a valid #osso_context_t object.
index e0aa53a..d196b17 100644 (file)
@@ -132,24 +132,43 @@ gboolean libmodest_dbus_client_send_and_receive_full (osso_context_t *osso_conte
 gboolean libmodest_dbus_client_open_default_inbox (osso_context_t *osso_context);
 
 /**
- * libmodest_dbus_client_open_account:
+ * libmodest_dbus_client_open_edit_accounts_dialog
+ * @osso_context: a valid osso_context instance
+ *
+ * Starts Modest showing the edit accounts dialog on top of the
+ * initial window. If there is no account then the new account dialog
+ * is automatically launched
+ *
+ * Returns: TRUE upon success, FALSE otherwise
+ */
+gboolean  libmodest_dbus_client_open_edit_accounts_dialog (osso_context_t *osso_context);
+
+/**
+ * libmodest_dbus_client_open_default_inbox:
  * @osso_context: a valid osso_context instance
- * @account_id: the unique ID of one account
  *
- * Starts Modest showing the account that is specified as
- * parametter. Note that this only makes sense when the folder view is
- * showing just one account
+ * start modest, and open the inbox for the default account
  *
  * Returns: TRUE upon success, FALSE otherwise
  */
-gboolean  libmodest_dbus_client_open_account (osso_context_t *osso_context,
-                                             const gchar *account_id);
+gboolean libmodest_dbus_client_open_default_inbox (osso_context_t *osso_context);
 
+/**
+ * libmodest_dbus_client_open_account:
+ * @osso_context: a valid osso_context instance
+ * @account_id: the id of the account to open
+ *
+ * Shows the folders of a given account
+ *
+ * Returns:  TRUE upon success, FALSE otherwise
+ **/
+gboolean libmodest_dbus_client_open_account (osso_context_t *osso_context,
+                                            const gchar *account_id);
 
 /*
  * below: functions specific to osso-global-search; not useful for other clients.
- * 
- */ 
+ *
+ */
 
 typedef enum {