LAST_SIGNAL
};
-
typedef struct _ModestMainWindowPrivate ModestMainWindowPrivate;
struct _ModestMainWindowPrivate {
GtkWidget *msg_paned;
guint progress_bar_timeout;
+ /* Signal handler UIDs */
+ gint queue_changed_handler_uid;
};
#define MODEST_MAIN_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \
MODEST_TYPE_MAIN_WINDOW, \
{ "FolderViewCSMRenameFolder", NULL, N_("mcen_me_user_renamefolder"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_rename_folder) },
{ "FolderViewCSMPasteMsgs", NULL, N_("mcen_me_inbox_paste"), NULL, NULL, NULL },
{ "FolderViewCSMDeleteFolder", NULL, N_("mcen_me_inbox_delete"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_delete_folder) },
- { "FolderViewCSMSearchMessages", NULL, N_("mcen_me_inbox_search"), NULL, NULL, NULL },
+ { "FolderViewCSMSearchMessages", NULL, N_("mcen_me_inbox_search"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_search_messages) },
{ "FolderViewCSMHelp", NULL, N_("mcen_me_inbox_help"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_help) },
};
static const GtkActionEntry modest_header_view_action_entries [] = {
/* Header View CSM actions */
- { "HeaderViewCSMOpen", NULL, N_("mcen_me_inbox_open"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_new_folder) },
+ { "HeaderViewCSMOpen", NULL, N_("mcen_me_inbox_open"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_open) },
{ "HeaderViewCSMReply", NULL, N_("mcen_me_inbox_reply"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_reply) },
{ "HeaderViewCSMReplyAll", NULL, N_("mcen_me_inbox_replytoall"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_reply_all) },
{ "HeaderViewCSMForward", NULL, N_("mcen_me_inbox_forward"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_forward) },
priv->accounts_popup = NULL;
priv->details_widget = NULL;
priv->empty_view = NULL;
-
priv->progress_widgets = NULL;
priv->progress_bar = NULL;
priv->current_toolbar_mode = TOOLBAR_MODE_NORMAL;
-
priv->style = MODEST_MAIN_WINDOW_STYLE_SPLIT;
priv->contents_style = MODEST_MAIN_WINDOW_CONTENTS_STYLE_HEADERS;
-
priv->merge_ids = NULL;
-
priv->optimized_view = FALSE;
priv->send_receive_in_progress = FALSE;
priv->progress_bar_timeout = 0;
+ priv->queue_changed_handler_uid = 0;
}
static void
priv->progress_bar_timeout = 0;
}
+ /* Disconnect signal handlers */
+ if (priv->queue_changed_handler_uid)
+ g_signal_handler_disconnect (modest_runtime_get_mail_operation_queue (),
+ priv->queue_changed_handler_uid);
+
G_OBJECT_CLASS(parent_class)->finalize (obj);
}
priv = MODEST_MAIN_WINDOW_GET_PRIVATE(self);
parent_priv = MODEST_WINDOW_GET_PRIVATE(self);
-
+
/* folder view */
g_signal_connect (G_OBJECT(priv->folder_view), "key-press-event",
G_CALLBACK(on_inner_widgets_key_pressed), self);
G_CALLBACK(_folder_view_csm_menu_activated),
self);
/* header view */
-/* g_signal_connect (G_OBJECT(priv->header_view), "status_update", */
-/* G_CALLBACK(modest_ui_actions_on_header_status_update), self); */
g_signal_connect (G_OBJECT(priv->header_view), "header_selected",
G_CALLBACK(modest_ui_actions_on_header_selected), self);
g_signal_connect (G_OBJECT(priv->header_view), "header_activated",
G_CALLBACK (modest_main_window_window_state_event),
NULL);
g_signal_connect (G_OBJECT(self), "delete-event", G_CALLBACK(on_delete_event), self);
-
+
/* Mail Operation Queue */
- g_signal_connect (G_OBJECT (modest_runtime_get_mail_operation_queue ()),
- "queue-changed",
- G_CALLBACK (on_queue_changed),
- self);
+ priv->queue_changed_handler_uid =
+ g_signal_connect (G_OBJECT (modest_runtime_get_mail_operation_queue ()),
+ "queue-changed", G_CALLBACK (on_queue_changed), self);
/* Track changes in the device name */
g_signal_connect (G_OBJECT(modest_runtime_get_conf ()),
- "key_changed",
- G_CALLBACK (on_configuration_key_changed),
+ "key_changed", G_CALLBACK (on_configuration_key_changed),
self);
/* Track account changes. We need to refresh the toolbar */
g_signal_connect (G_OBJECT (modest_runtime_get_account_store ()),
- "account_update",
- G_CALLBACK (on_account_update),
+ "account_update", G_CALLBACK (on_account_update),
self);
/* Account store */
- g_signal_connect (G_OBJECT (modest_runtime_get_account_store()), "password_requested",
+ g_signal_connect (G_OBJECT (modest_runtime_get_account_store()),
+ "password_requested",
G_CALLBACK (modest_ui_actions_on_password_requested), self);
/* Device */
- g_signal_connect (G_OBJECT(modest_runtime_get_account_store()), "connecting-finished",
+ g_signal_connect (G_OBJECT(modest_runtime_get_account_store()),
+ "connecting-finished",
G_CALLBACK(on_account_store_connecting_finished), self);
}
tny_account_store_view_set_account_store (TNY_ACCOUNT_STORE_VIEW (priv->folder_view),
TNY_ACCOUNT_STORE (modest_runtime_get_account_store ()));
+ /* Check if accounts exist and show the account wizard if not */
+ gboolean accounts_exist =
+ modest_account_mgr_has_accounts(modest_runtime_get_account_mgr(), TRUE);
+
+ if (!accounts_exist)
+ {
+ /* This is necessary to have the main window shown behind the dialog
+ It's an ugly hack... jschmid */
+ gtk_widget_show_all(GTK_WIDGET(self));
+ modest_ui_actions_on_accounts (NULL, MODEST_WINDOW(self));
+ }
+
/* Do send & receive when we are idle */
/* TODO: Enable this again. I have commented it out because,
* at least in scratchbox, this can cause us to start a second
g_return_if_fail (MODEST_IS_MAIN_WINDOW (self));
- /* Tools menu options */
action = modest_window_get_action (MODEST_WINDOW(self), "/MenuBar/ToolsMenu/ToolsSendReceiveMainMenu/ToolsSendReceiveAllMenu");
gtk_action_set_sensitive (action, FALSE);
action = modest_window_get_action (MODEST_WINDOW(self), "/MenuBar/ToolsMenu/ToolsSendReceiveMainMenu/ToolsSendReceiveCancelSendingMenu");
gtk_action_set_sensitive (action, FALSE);
widget = modest_window_get_action_widget (MODEST_WINDOW(self), "/MenuBar/ToolsMenu/ToolsSendReceiveMainMenu/ToolsMenuAdditions");
gtk_widget_set_sensitive (widget, FALSE);
-
- /* Header view CSM */
- action = modest_window_get_action (MODEST_WINDOW(self), "/HeaderViewCSM/HeaderViewCSMCancelSending");
- gtk_action_set_sensitive (action, FALSE);
-
}
void
account = (TnyAccount *) modest_folder_view_get_selected (priv->folder_view);
if (TNY_IS_ACCOUNT (account) &&
- !strcmp (tny_account_get_id (account), MODEST_ACTUAL_LOCAL_FOLDERS_ACCOUNT_ID)) {
+ !strcmp (tny_account_get_id (account), MODEST_LOCAL_FOLDERS_ACCOUNT_ID)) {
GList *children;
GtkLabel *label;
const gchar *device_name;