transport_settings = modest_account_settings_get_transport_settings (priv->settings);
store_account_name = modest_server_account_settings_get_account_name (store_settings);
transport_account_name = modest_server_account_settings_get_account_name (transport_settings);
-
+
if (store_account_name) {
modest_account_mgr_notify_account_update (priv->account_manager,
store_account_name);
}
g_object_unref (store_settings);
g_object_unref (transport_settings);
-
+
modest_platform_information_banner(NULL, NULL, _("mcen_ib_advsetup_settings_saved"));
}
} else {
priv->modal_windows = g_queue_new ();
priv->queue_lock = g_mutex_new ();
-
+
/* Could not initialize it from gconf, singletons are not
ready yet */
- priv->destroy_handlers = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free);
+ priv->destroy_handlers = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free);
priv->viewer_handlers = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free);
priv->closing_time = 0;
g_mutex_unlock (priv->queue_lock);
}
g_mutex_free (priv->queue_lock);
-
+
/* Do not unref priv->main_window because it does not hold a
new reference */
-
G_OBJECT_CLASS(parent_class)->finalize (obj);
}
gtk_window_present (GTK_WINDOW (win));
return TRUE;
}
-
+
if (!MODEST_WINDOW_MGR_CLASS (parent_class)->register_window (self, window, parent))
goto fail;
-
+
/* Add to list. Keep a reference to the window */
g_object_ref (window);
priv->window_list = g_list_prepend (priv->window_list, window);
if (!parent || ((GtkWidget *) parent != current_top)) {
gboolean close_canceled = FALSE;
- if ((current_top != NULL) &&
+ if ((current_top != NULL) &&
window_has_modals (MODEST_WINDOW (current_top))) {
/* Window on top but it has opened dialogs */
goto fail;
*handler_id = g_signal_connect (window, "delete-event", G_CALLBACK (on_window_destroy), self);
g_hash_table_insert (priv->destroy_handlers, window, handler_id);
- /* Show toolbar always */
+ /* Show toolbar always */
modest_window_show_toolbar (window, TRUE);
return TRUE;
{
gboolean no_propagate = FALSE;
- if (!window_can_close (window)) {
+ if (!window_can_close (window))
return TRUE;
- }
- /* Specific stuff first */
- if (MODEST_IS_MAIN_WINDOW (window)) {
- ModestHildon2WindowMgrPrivate *priv;
- ModestMainWindowContentsStyle style;
- priv = MODEST_HILDON2_WINDOW_MGR_GET_PRIVATE (self);
-
- /* If we're on header view, then just go to folder view and don't close */
- style = modest_main_window_get_contents_style (MODEST_MAIN_WINDOW (window));
- if (style == MODEST_MAIN_WINDOW_CONTENTS_STYLE_HEADERS) {
- modest_main_window_set_contents_style (MODEST_MAIN_WINDOW (window),
- MODEST_MAIN_WINDOW_CONTENTS_STYLE_FOLDERS);
- return TRUE;
- }
-
- /* Do not unregister it, just hide */
- gtk_widget_hide_all (GTK_WIDGET (window));
-
- /* Cancel pending operations */
- cancel_window_operations (window);
- /* Fake the window system, make it think that there is no window */
- if (modest_window_mgr_num_windows (MODEST_WINDOW_MGR (self)) == 0)
- g_signal_emit_by_name (self, "window-list-empty");
+ if (MODEST_IS_MSG_EDIT_WINDOW (window)) {
+ gboolean sent = FALSE;
+ sent = modest_msg_edit_window_get_sent (MODEST_MSG_EDIT_WINDOW (window));
+ /* Save currently edited message to Drafts if it was not sent */
+ if (!sent && modest_msg_edit_window_is_modified (MODEST_MSG_EDIT_WINDOW (window))) {
- no_propagate = TRUE;
- }
- else {
- if (MODEST_IS_MSG_EDIT_WINDOW (window)) {
- gboolean sent = FALSE;
- sent = modest_msg_edit_window_get_sent (MODEST_MSG_EDIT_WINDOW (window));
- /* Save currently edited message to Drafts if it was not sent */
- if (!sent && modest_msg_edit_window_is_modified (MODEST_MSG_EDIT_WINDOW (window))) {
-
- if (!modest_ui_actions_on_save_to_drafts (NULL, MODEST_MSG_EDIT_WINDOW (window)))
- return TRUE;
- }
+ if (!modest_ui_actions_on_save_to_drafts (NULL, MODEST_MSG_EDIT_WINDOW (window)))
+ return TRUE;
}
- /* Unregister window */
- modest_window_mgr_unregister_window (MODEST_WINDOW_MGR (self), window);
- no_propagate = FALSE;
}
+ /* Unregister window */
+ modest_window_mgr_unregister_window (MODEST_WINDOW_MGR (self), window);
+ no_propagate = FALSE;
+
return no_propagate;
}
static void
-disconnect_msg_changed (gpointer key,
- gpointer value,
- gpointer user_data)
-{
- guint handler_id;
- handler_id = GPOINTER_TO_UINT(value);
-
- if (key && G_IS_OBJECT(key))
- g_signal_handler_disconnect (G_OBJECT (key), handler_id);
-}
-
-static void
modest_hildon2_window_mgr_unregister_window (ModestWindowMgr *self,
ModestWindow *window)
{
GList *win;
ModestHildon2WindowMgrPrivate *priv;
gulong *tmp, handler_id;
+ gboolean check_close_all = FALSE;
+ guint num_windows;
g_return_if_fail (MODEST_IS_HILDON2_WINDOW_MGR (self));
g_return_if_fail (MODEST_IS_WINDOW (window));
return;
}
- /* If it's the main window unset it */
- if (MODEST_IS_MAIN_WINDOW (window)) {
- modest_window_mgr_set_main_window (self, NULL);
-
- /* Disconnect all emissions of msg-changed */
- if (priv->viewer_handlers) {
- g_hash_table_foreach (priv->viewer_handlers,
- disconnect_msg_changed,
- NULL);
- g_hash_table_destroy (priv->viewer_handlers);
- priv->viewer_handlers = NULL;
- }
- }
+ /* Remember this for the end of the method */
+ if (MODEST_IS_FOLDER_WINDOW (window))
+ check_close_all = TRUE;
/* Remove the viewer window handler from the hash table. The
HashTable could not exist if the main window was closed
/* Disconnect the "window-state-event" handler, we won't need it anymore */
if (priv->window_state_uids) {
-#ifndef MODEST_TOOLKIT_GTK
priv->window_state_uids =
modest_signal_mgr_disconnect (priv->window_state_uids,
G_OBJECT (window),
"notify::is-topmost");
-#else
- priv->window_state_uids =
- modest_signal_mgr_disconnect (priv->window_state_uids,
- G_OBJECT (window),
- "window-state-event");
-#endif
}
-
+
/* Disconnect the "delete-event" handler, we won't need it anymore */
g_signal_handler_disconnect (window, handler_id);
/* Destroy the window */
g_object_unref (win->data);
g_list_free (win);
-
+
MODEST_WINDOW_MGR_CLASS (parent_class)->unregister_window (self, window);
+ /* We have to get the number of windows here in order not to
+ emit the signal too many times */
+ num_windows = modest_window_mgr_get_num_windows (self);
+
+ /* Check if we have to destroy the accounts window as
+ well. This happens if we only have one or none remote
+ accounts */
+ if (check_close_all) {
+ ModestTnyAccountStore *acc_store = modest_runtime_get_account_store ();
+ if (modest_tny_account_store_get_num_remote_accounts (acc_store) < 2)
+ modest_window_mgr_close_all_windows (self);
+ }
+
/* If there are no more windows registered emit the signal */
- if (modest_window_mgr_num_windows (self) == 0)
+ if (num_windows == 0)
g_signal_emit_by_name (self, "window-list-empty");
}
-
static void
modest_hildon2_window_mgr_set_fullscreen_mode (ModestWindowMgr *self,
gboolean on)
{
ModestHildon2WindowMgrPrivate *priv;
ModestWindow *result;
-
+
g_return_val_if_fail (MODEST_IS_HILDON2_WINDOW_MGR (self), NULL);
priv = MODEST_HILDON2_WINDOW_MGR_GET_PRIVATE (self);
/* TODO: make this return NULL always */
-
+
result = MODEST_WINDOW_MGR_CLASS (parent_class)->get_main_window (self, FALSE);
/* create the main window, if it hasn't been created yet */
if (!result && show) {
static ModestWindow *
modest_hildon2_window_mgr_show_initial_window (ModestWindowMgr *self)
{
- ModestWindow *window = NULL;
- ModestAccountMgr *mgr;
- GSList *account_names;
- gint count;
-
- mgr = modest_runtime_get_account_mgr ();
- account_names = modest_account_mgr_account_names (mgr, TRUE);
- count = g_slist_length (account_names);
-
- if (count > 1) {
- window = MODEST_WINDOW (modest_accounts_window_new ());
- } else {
- window = MODEST_WINDOW (modest_folder_window_new (NULL));
- if (count == 1)
- modest_folder_window_set_account (MODEST_FOLDER_WINDOW (window),
- account_names->data);
+ ModestWindow *initial_window = NULL;
+ ModestTnyAccountStore *acc_store;
+
+ /* Always create accounts window. We'll decide later if we
+ want to show it or not, depending the number of accounts */
+ initial_window = MODEST_WINDOW (modest_accounts_window_new ());
+ modest_window_mgr_register_window (self, initial_window, NULL);
+
+ /* If there are less than 2 remote accounts then directly show
+ the folder window and do not show the accounts window */
+ acc_store = modest_runtime_get_account_store ();
+ if (modest_tny_account_store_get_num_remote_accounts (acc_store) < 2) {
+ ModestAccountMgr *mgr;
+
+ /* Show first the accounts window to add it to the
+ stack. This has to be changed when the new
+ stackable API is available. There will be a method
+ to show all the windows that will only show the
+ last one to the user. The current code shows both
+ windows, one after the other */
+ gtk_widget_show (GTK_WIDGET (initial_window));
+
+ initial_window = MODEST_WINDOW (modest_folder_window_new (NULL));
+ mgr = modest_runtime_get_account_mgr ();
+ modest_folder_window_set_account (MODEST_FOLDER_WINDOW (initial_window),
+ modest_account_mgr_get_default_account (mgr));
+ modest_window_mgr_register_window (self, initial_window, NULL);
}
- modest_account_mgr_free_account_names (account_names);
- modest_window_mgr_register_window (self, window, NULL);
- return window;
+ return initial_window;
}
GType modest_hildon2_window_mgr_get_type (void) G_GNUC_CONST;
/* typical parameter-less _new function */
-ModestWindowMgr* modest_hildon2_window_mgr_new (void);
-
+ModestWindowMgr* modest_hildon2_window_mgr_new (void);
+
+/**
+ * modest_hildon2_window_mgr_set_account_store:
+ * @self: a #ModestHildon2WindowMgr
+ * @acc_store: a #TnyAccountStore
+ *
+ * The window manager will use this function to connect itself to the
+ * account-created and account-removed signals of the
+ * #TnyAccountStore, because it ill create/destroy the accounts window
+ * depending on the existence of 0, 1 or more accounts.
+ **/
+void modest_hildon2_window_mgr_set_account_store (ModestHildon2WindowMgr *self,
+ TnyAccountStore *acc_store);
+
G_END_DECLS
#endif /* __MODEST_HILDON2_WINDOW_MGR_H__ */
#include <hildon/hildon-sound.h>
#include <osso-mem.h>
#include "hildon2/modest-hildon2-details-dialog.h"
+#include "hildon2/modest-hildon2-window-mgr.h"
#ifdef MODEST_HAVE_MCE
#include <mce/dbus-names.h>
GtkWidget *banner, *banner_parent = NULL;
ModestWindowMgr *mgr = modest_runtime_get_window_mgr ();
- if (modest_window_mgr_num_windows (mgr) == 0)
+ if (modest_window_mgr_get_num_windows (mgr) == 0)
return;
if (parent && GTK_IS_WINDOW (parent)) {
{
GtkWidget *banner;
- if (modest_window_mgr_num_windows (modest_runtime_get_window_mgr ()) == 0)
+ if (modest_window_mgr_get_num_windows (modest_runtime_get_window_mgr ()) == 0)
return;
banner = hildon_banner_show_information (parent, icon_name, text);
g_return_val_if_fail (text != NULL, NULL);
- if (modest_window_mgr_num_windows (modest_runtime_get_window_mgr ()) == 0)
+ if (modest_window_mgr_get_num_windows (modest_runtime_get_window_mgr ()) == 0)
return NULL;
/* If the parent is not visible then do not show */
TnyHeader *header)
{
GtkWidget *dialog;
-
+
/* Create dialog */
dialog = modest_hildon2_details_dialog_new_with_header (parent_window, header);
g_object_unref (mgr);
}
-void
+void
modest_platform_information_banner (GtkWidget *parent,
const gchar *icon_name,
const gchar *text)
GtkWidget *banner, *banner_parent = NULL;
ModestWindowMgr *mgr = modest_runtime_get_window_mgr ();
- if (modest_window_mgr_num_windows (mgr) == 0)
+ if (modest_window_mgr_get_num_windows (mgr) == 0)
return;
if (parent && GTK_IS_WINDOW (parent)) {
banner_parent = parent;
/* If the window is not the topmost but it's visible
(it's minimized for example) then show the banner
- with no parent */
+ with no parent */
else if (GTK_WIDGET_VISIBLE (parent))
banner_parent = NULL;
/* If the window is hidden (like the main window when
{
GtkWidget *banner;
- if (modest_window_mgr_num_windows (modest_runtime_get_window_mgr ()) == 0)
+ if (modest_window_mgr_get_num_windows (modest_runtime_get_window_mgr ()) == 0)
return;
banner = hildon_banner_show_information (parent, icon_name, text);
g_return_val_if_fail (text != NULL, NULL);
- if (modest_window_mgr_num_windows (modest_runtime_get_window_mgr ()) == 0)
+ if (modest_window_mgr_get_num_windows (modest_runtime_get_window_mgr ()) == 0)
return NULL;
/* If the parent is not visible then do not show */
g_signal_handlers_disconnect_by_func (mail_op, G_CALLBACK (on_operation_finished), user_data);
MODEST_DEBUG_BLOCK (print_queue_item (mail_op, "cancel/remove"););
-
+
modest_mail_operation_cancel (mail_op);
g_queue_remove (priv->op_queue, mail_op);
g_object_unref (G_OBJECT (mail_op));
g_return_if_fail (MODEST_IS_MAIL_OPERATION_QUEUE (self));
g_return_if_fail (MODEST_IS_MAIL_OPERATION (mail_op));
-
+
priv = MODEST_MAIL_OPERATION_QUEUE_GET_PRIVATE(self);
priv->running_final_sync = (modest_mail_operation_get_type_operation (mail_op) == MODEST_MAIL_OPERATION_TYPE_SHUTDOWN);
g_mutex_lock (priv->queue_lock);
g_queue_push_tail (priv->op_queue, g_object_ref (mail_op));
g_mutex_unlock (priv->queue_lock);
-
+
MODEST_DEBUG_BLOCK (print_queue_item (mail_op, "add"););
/* Get notified when the operation ends to remove it from the
}
-void
+void
modest_mail_operation_queue_remove (ModestMailOperationQueue *self,
ModestMailOperation *mail_op)
{
}
}
-guint
+guint
modest_mail_operation_queue_num_elements (ModestMailOperationQueue *self)
{
ModestMailOperationQueuePrivate *priv;
guint length = 0;
g_return_val_if_fail (MODEST_IS_MAIL_OPERATION_QUEUE (self), 0);
-
+
priv = MODEST_MAIL_OPERATION_QUEUE_GET_PRIVATE(self);
g_mutex_lock (priv->queue_lock);
g_queue_foreach (priv->op_queue, (GFunc)accumulate_mail_op_strings, &str);
g_mutex_unlock (priv->queue_lock);
}
-
+
return str;
}
modest_mail_operation_queue_running_shutdown (ModestMailOperationQueue *self)
{
ModestMailOperationQueuePrivate *priv;
-
+
g_return_val_if_fail (MODEST_IS_MAIL_OPERATION_QUEUE (self), FALSE);
-
+
priv = MODEST_MAIL_OPERATION_QUEUE_GET_PRIVATE(self);
return priv->running_final_sync;
}
modest_mail_operation_queue_set_running_shutdown (ModestMailOperationQueue *self)
{
ModestMailOperationQueuePrivate *priv;
-
+
g_return_if_fail (MODEST_IS_MAIL_OPERATION_QUEUE (self));
-
+
priv = MODEST_MAIL_OPERATION_QUEUE_GET_PRIVATE(self);
priv->running_final_sync = TRUE;
}
#include <gdk/gdk.h>
#include <string.h>
#include <glib.h>
-#include <modest-runtime.h>
-#include <modest-init.h>
+#include "modest-runtime.h"
+#include "modest-init.h"
#include "modest-platform.h"
#include "modest-ui-actions.h"
-#include <widgets/modest-main-window.h>
-#ifdef MODEST_TOOLKIT_HILDON2
-#include <modest-accounts-window.h>
-#include <modest-folder-window.h>
-#endif
typedef struct {
gulong queue_handler;
/* Exit if the queue is empty and there are no more
windows. We can exit as well if the main window is hidden
and it's the only one */
- if (modest_window_mgr_num_windows (mgr) == 0)
+ if (modest_window_mgr_get_num_windows (mgr) == 0)
g_idle_add_full (G_PRIORITY_LOW, on_idle_exit_modest, user_data, NULL);
}
int
main (int argc, char *argv[])
{
- /* Usually we don't show the application at first,
- * because we wait for the top_application D-Bus method to
- * be called. But that's annoying when starting from the
+ /* Usually we don't show the application at first,
+ * because we wait for the top_application D-Bus method to
+ * be called. But that's annoying when starting from the
* command line.: */
gboolean show_ui_without_top_application_method = FALSE;
int retval = 0;
* modest_platform_run_folder_details_dialog:
* @parent_window: the parent #GtkWindow for the new dialog
* @folder: the #TnyFolder whose details will be shown
- *
+ *
* Shows the folder details dialog
**/
void modest_platform_run_folder_details_dialog (GtkWindow *parent_window,
* modest_platform_run_header_details_dialog:
* @parent_window: the parent #GtkWindow for the new dialog
* @header: the #TnyHeader whose details will be shown
- *
+ *
* Shows the header details dialog
**/
void modest_platform_run_header_details_dialog (GtkWindow *parent_window,
TnyHeader *header);
+/**
+ * modest_platform_on_runtime_initialized:
+ *
+ * This function will be used by platforms to connect objects between
+ * themselves once all the singletons have been created. So this
+ * function MUST be called *before* modest_init
+ **/
+void modest_platform_on_runtime_initialized ();
G_END_DECLS
#endif /* __MODEST_PLATFORM_UTILS_H__ */
-
g_printerr ("modest: modest_runtime_init can only be run once\n");
return FALSE;
}
-
+
_singletons = modest_singletons_new ();
if (!_singletons) {
g_printerr ("modest: failed to create singletons\n");
return FALSE;
}
-
+
return TRUE;
}
ModestTnyAccountStore*
modest_runtime_get_account_store (void)
{
- // we get the account store here instead of in Singletons
- // as it leads to various chicken & problems with initialization
- g_return_val_if_fail (_singletons, NULL);
+ g_return_val_if_fail (_singletons, NULL);
+ /* we get the account store here instead of in Singletons as
+ it leads to various chicken & egg problems with
+ initialization */
if (!_account_store) {
_account_store = modest_tny_account_store_new (modest_runtime_get_account_mgr(),
modest_runtime_get_device());
* environment, instantiates singletons and so on)
* modest_runtime_init should only be called once, and
* when done with it, modest_runtime_uninit should be called
- *
+ *
* TRUE if this succeeded, FALSE otherwise.
*/
gboolean modest_runtime_init (void);
* TRUE if this succeeded, FALSE otherwise
*/
gboolean modest_runtime_uninit (void);
-
+
/**
- * modest_runtime_get_debug_flags
+ * modest_runtime_get_debug_flags
*
* get the debug flags for modest; they are read from the MODEST_DEBUG
* environment variable; the flags specified as strings, separated by ':'.
TnyConnectionStatus status,
gpointer data);
-static gboolean only_local_accounts (ModestTnyAccountStore *self);
+static inline gboolean only_local_accounts (ModestTnyAccountStore *self);
/* list my signals */
enum {
g_object_unref (transport_account);
}
-static gboolean
+static inline gboolean
only_local_accounts (ModestTnyAccountStore *self)
{
- ModestTnyAccountStorePrivate *priv = NULL;
- gboolean only_local = TRUE;
- TnyIterator *iter;
-
- /* Check if this is the first remote account we add */
- priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE (self);
- iter = tny_list_create_iterator (priv->store_accounts);
-
- while (!tny_iterator_is_done (iter) && only_local) {
- TnyAccount *account = (TnyAccount *) tny_iterator_get_current (iter);
- if (modest_tny_folder_store_is_remote (TNY_FOLDER_STORE (account)))
- only_local = FALSE;
- g_object_unref (account);
- tny_iterator_next (iter);
- }
- g_object_unref (iter);
-
- return only_local;
+ return (modest_tny_account_store_get_num_remote_accounts (self) > 0) ? FALSE : TRUE;
}
static void
priv->send_mail_blocked = blocked;
}
+
+static void
+count_remote_accounts (gpointer data, gpointer user_data)
+{
+ TnyFolderStore *account = TNY_FOLDER_STORE (data);
+ gint *count = (gint *) user_data;
+
+ if (modest_tny_folder_store_is_remote (account))
+ (*count)++;
+}
+
+guint
+modest_tny_account_store_get_num_remote_accounts (ModestTnyAccountStore *self)
+{
+ ModestTnyAccountStorePrivate *priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE (self);
+ gint count = 0;
+
+ /* Count remote accounts */
+ tny_list_foreach (priv->store_accounts, (GFunc) count_remote_accounts, &count);
+
+ return count;
+}
*/
void modest_tny_account_store_set_send_mail_blocked (ModestTnyAccountStore *self, gboolean blocked);
+guint modest_tny_account_store_get_num_remote_accounts (ModestTnyAccountStore *self);
G_END_DECLS
#include <tny-gtk-folder-store-tree-model.h>
#endif
#include <tny-gtk-header-list-model.h>
+#include <tny-merge-folder.h>
#include <tny-folder.h>
#include <tny-folder-store-observer.h>
#include <tny-account-store.h>
if (priv->style == MODEST_FOLDER_VIEW_STYLE_SHOW_ONE &&
!gtk_tree_model_iter_parent (model, iter, &parent)) {
/* Only show special folders for current account if needed */
- if (TNY_IS_FOLDER (instance)) {
+ if (TNY_IS_FOLDER (instance) && !TNY_IS_MERGE_FOLDER (instance)) {
TnyAccount *account;
account = tny_folder_get_account (TNY_FOLDER (instance));
-
+
if (TNY_IS_ACCOUNT (account)) {
const gchar *account_id = tny_account_get_id (account);
g_object_unref (account);
}
}
-
+
}
}
cancel_window_operations (window);
/* Fake the window system, make it think that there is no window */
- if (modest_window_mgr_num_windows (MODEST_WINDOW_MGR (self)) == 0)
+ if (modest_window_mgr_get_num_windows (MODEST_WINDOW_MGR (self)) == 0)
g_signal_emit_by_name (self, "window-list-empty");
no_propagate = TRUE;
MODEST_WINDOW_MGR_CLASS (parent_class)->unregister_window (self, window);
/* If there are no more windows registered emit the signal */
- if (modest_window_mgr_num_windows (self) == 0)
+ if (modest_window_mgr_get_num_windows (self) == 0)
g_signal_emit_by_name (self, "window-list-empty");
}
/* This calls the vfunc,
* so each window can do its own thing: */
modest_window_save_state (window);
- }
-
+ }
+
node = g_list_next (node);
}
g_list_free (window_list);
}
-gint
-modest_window_mgr_num_windows (ModestWindowMgr *self)
+guint
+modest_window_mgr_get_num_windows (ModestWindowMgr *self)
{
ModestWindowMgrPrivate *priv;
gint num_windows = 0;
GList *window_list;
g_return_val_if_fail (self && MODEST_IS_WINDOW_MGR(self), -1);
-
+
priv = MODEST_WINDOW_MGR_GET_PRIVATE(self);
window_list = modest_window_mgr_get_window_list (self);
-
+
if (window_list) {
num_windows = g_list_length (window_list);
g_list_free (window_list);
}
/* Do not take into account the main window if it was hidden */
- if (priv->main_window && !GTK_WIDGET_VISIBLE (priv->main_window))
+ if (num_windows && priv->main_window && !GTK_WIDGET_VISIBLE (priv->main_window))
num_windows--;
return num_windows + priv->banner_counter;
priv = MODEST_WINDOW_MGR_GET_PRIVATE (self);
priv->banner_counter--;
- if (modest_window_mgr_num_windows (self) == 0)
+ if (modest_window_mgr_get_num_windows (self) == 0)
g_signal_emit (self, signals[WINDOW_LIST_EMPTY_SIGNAL], 0);
}
void modest_window_mgr_save_state_for_all_windows (ModestWindowMgr *self);
/**
- * modest_window_mgr_num_windows:
+ * modest_window_mgr_get_num_windows:
* @self: a #ModestWindowMgr
*
* Gets the number of already registered windows, and pending banners
*
* Returns: the number of already registered windows, and pending banners
**/
-gint modest_window_mgr_num_windows (ModestWindowMgr *self);
+guint modest_window_mgr_get_num_windows (ModestWindowMgr *self);
/**
* modest_window_mgr_get_msg_view_window: