From: Sergio Villar Senin Date: Fri, 23 Oct 2009 14:47:28 +0000 (+0200) Subject: Added the dbus method handler for OpenEditAccountsDialog X-Git-Tag: 3.1.9~6 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=f077d0809138e8192dbba9e06b97f078839c095d Added the dbus method handler for OpenEditAccountsDialog --- diff --git a/configure.ac b/configure.ac index 8d49976..d665ef1 100644 --- a/configure.ac +++ b/configure.ac @@ -121,7 +121,7 @@ else fi -PKG_CHECK_MODULES(LIBMODEST_DBUS_CLIENT,libmodest-dbus-client-1.0 >= 3.1.0) +PKG_CHECK_MODULES(LIBMODEST_DBUS_CLIENT,libmodest-dbus-client-1.0 >= 3.2.0) dnl # GLib/Gobject/Gtk/Gconf => mandatory diff --git a/debian/control b/debian/control index e67d69e..e19e5c1 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: modest Section: mail Priority: optional Maintainer: Moises Martinez -Build-Depends: debhelper (>= 4.0.0), cdbs, libmodest-dbus-client-dev (>= 3.1.0), gnome-common, gtkhtml3.14-dev, +Build-Depends: debhelper (>= 4.0.0), cdbs, libmodest-dbus-client-dev (>= 3.2.0), gnome-common, gtkhtml3.14-dev, libconic0-dev, libhildon1-dev, libdbus-1-dev, libdbus-glib-1-dev, libebook-dev, osso-af-settings, libedataserver-dev, libhildonnotify-dev, libgconf2-dev, libglib2.0-dev, libosso-gnomevfs2-dev, libhildonmime-dev, libtinymail-1.0-0-dev, libtinymail-camel-1.0-0-dev, libtinymail-maemo-1.0-0-dev, libtinymailui-1.0-0-dev, libtinymail-gnomevfs-1.0-0-dev, @@ -12,7 +12,7 @@ Standards-Version: 3.6.0 Package: modest Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, ${launcher:Depends}, libmodest-dbus-client (>= 3.1.0), +Depends: ${shlibs:Depends}, ${misc:Depends}, ${launcher:Depends}, libmodest-dbus-client (>= 3.2.0), modest-providers-data, modest-l10n-mr | modest-l10n-mr0, osso-icons-theme, operator-wizard-settings, osso-countries-l10n-mr | osso-countries-l10n-mr0, microb-engine Description: an e-mail client for platforms with modest resources diff --git a/libmodest-dbus-client/configure.ac b/libmodest-dbus-client/configure.ac index c2ff6fb..e820261 100644 --- a/libmodest-dbus-client/configure.ac +++ b/libmodest-dbus-client/configure.ac @@ -26,12 +26,12 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -AC_INIT([libmodestclient],[3.1.0],[http://maemo.org]) +AC_INIT([libmodestclient],[3.2.0],[http://maemo.org]) AC_CONFIG_HEADERS([config.h]) m4_define([modest_api_major_version], [1]) m4_define([modest_api_minor_version], [99]) -m4_define([modest_api_micro_version], [1]) +m4_define([modest_api_micro_version], [2]) m4_define([modest_api_version], [modest_api_major_version.modest_api_minor_version.modest_api_micro_version]) diff --git a/libmodest-dbus-client/debian/changelog b/libmodest-dbus-client/debian/changelog index 6f247ff..8b8e02f 100644 --- a/libmodest-dbus-client/debian/changelog +++ b/libmodest-dbus-client/debian/changelog @@ -1,3 +1,10 @@ +libmodest-dbus-client (4:3.2.0-0) unstable; urgency=low + + * Week 43, 2009 - third release + * Add API method OpenEditAccountsDialog + + -- Moises Martinez Wed, 23 Oct 2009 11:18:00 +0200 + libmodest-dbus-client (4:3.1.0-0) unstable; urgency=low * Week 42, 2009 - second release diff --git a/src/dbus_api/modest-dbus-callbacks.c b/src/dbus_api/modest-dbus-callbacks.c index db458b6..d6be5e6 100644 --- a/src/dbus_api/modest-dbus-callbacks.c +++ b/src/dbus_api/modest-dbus-callbacks.c @@ -1429,7 +1429,61 @@ on_top_application(GArray * arguments, gpointer data, osso_rpc_t * retval) { /* Use g_idle to context-switch into the application's thread: */ g_idle_add(on_idle_top_application, NULL); - + + return OSSO_OK; +} + +static gboolean +on_idle_open_edit_accounts_dialog (gpointer user_data) +{ + ModestWindow *top; + ModestWindowMgr *mgr; + gboolean closed; + + /* This is a GDK lock because we are an idle callback and + * the code below is or does Gtk+ code */ + + gdk_threads_enter (); /* CHECKED */ + + mgr = modest_runtime_get_window_mgr (); + closed = modest_window_mgr_close_all_but_initial (mgr); + top = modest_window_mgr_get_current_top (mgr); + + if (closed) { + /* Show edit accounts dialog */ + modest_ui_actions_on_accounts (NULL, top); + } else { + gboolean has_accounts; + + has_accounts = modest_account_mgr_has_accounts (modest_runtime_get_account_mgr (), + TRUE); + + /* Present the current top window */ + gdk_threads_leave (); + on_idle_top_application (NULL); + gdk_threads_enter (); + + /* Show edit accounts dialog if we're launching the + program and there is no account (if there is at + least one account then on_idle_top_application will + show the accounts wizard */ + if (!top && has_accounts) { + top = modest_window_mgr_get_current_top (mgr); + modest_ui_actions_on_accounts (NULL, top); + } + } + + gdk_threads_leave (); /* CHECKED */ + + return FALSE; /* Do not call this callback again. */ +} + +static gint +on_open_edit_accounts_dialog (GArray * arguments, gpointer data, osso_rpc_t * retval) +{ + /* Use g_idle to context-switch into the application's thread: */ + g_idle_add (on_idle_open_edit_accounts_dialog, NULL); + return OSSO_OK; } @@ -1521,8 +1575,13 @@ modest_dbus_req_handler(const gchar * interface, const gchar * method, if (arguments->len != 0) goto param_error; modest_runtime_set_allow_shutdown (TRUE); - return on_top_application (arguments, data, retval); - } else { + return on_top_application (arguments, data, retval); + } else if (g_ascii_strcasecmp (method, MODEST_DBUS_METHOD_OPEN_EDIT_ACCOUNTS_DIALOG) == 0) { + if (arguments->len != 0) + goto param_error; + modest_runtime_set_allow_shutdown (TRUE); + return on_open_edit_accounts_dialog (arguments, data, retval); + } else { /* We need to return INVALID here so * libosso will return DBUS_HANDLER_RESULT_NOT_YET_HANDLED, * so that our modest_dbus_req_filter will then be tried instead.