+static void
+on_row_deleted (GtkTreeModel *tree_model,
+ GtkTreePath *path,
+ gpointer user_data)
+{
+ ModestAccountsWindow *self;
+
+ self = (ModestAccountsWindow *) user_data;
+
+ row_count_changed (self);
+}
+
+static void
+row_count_changed (ModestAccountsWindow *self)
+{
+ ModestAccountsWindowPrivate *priv;
+ GtkTreeModel *model;
+ gint count;
+
+ priv = MODEST_ACCOUNTS_WINDOW_GET_PRIVATE (self);
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->account_view));
+
+ count = gtk_tree_model_iter_n_children (model, NULL);
+
+ if (count == 0) {
+ gtk_widget_hide (priv->account_view);
+ gtk_widget_show (priv->no_accounts_container);
+ g_debug ("%s: hiding accounts view", __FUNCTION__);
+ } else {
+ gtk_widget_hide (priv->no_accounts_container);
+ gtk_widget_show (priv->account_view);
+ g_debug ("%s: showing accounts view", __FUNCTION__);
+ }
+ gtk_container_child_set (GTK_CONTAINER(priv->box), priv->pannable,
+ "expand", count > 0,
+ "fill", count > 0,
+ NULL);
+}
+
+static void
+on_mail_operation_started (ModestMailOperation *mail_op,
+ gpointer user_data)
+{
+ ModestAccountsWindow *self;
+ ModestMailOperationTypeOperation op_type;
+ GObject *source = NULL;
+
+ self = MODEST_ACCOUNTS_WINDOW (user_data);
+ op_type = modest_mail_operation_get_type_operation (mail_op);
+ source = modest_mail_operation_get_source(mail_op);
+ if (G_OBJECT (self) == source) {
+ update_progress_hint (self);
+ }
+ g_object_unref (source);
+}
+
+static void
+on_mail_operation_finished (ModestMailOperation *mail_op,
+ gpointer user_data)
+{
+ ModestAccountsWindow *self;
+
+ self = MODEST_ACCOUNTS_WINDOW (user_data);
+
+ /* Don't disable the progress hint if there are more pending
+ operations from this window */
+ update_progress_hint (self);
+
+ modest_ui_actions_check_menu_dimming_rules (MODEST_WINDOW (self));