{ "ToolbarMessageReplyAll", MODEST_STOCK_REPLY_ALL, N_("mcen_me_inbox_replytoall"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_reply_all) },
{ "ToolbarMessageForward", MODEST_STOCK_FORWARD, N_("mcen_me_inbox_forward"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_forward) },
{ "ToolbarSendReceive", MODEST_STOCK_REFRESH, N_("qgn_toolb_gene_refresh"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_send_receive) },
-/* { "ToolbarToggleView", MODEST_STOCK_SPLIT_VIEW, N_("gqn_toolb_rss_fldonoff"), "<CTRL>t", NULL, G_CALLBACK (modest_ui_actions_toggle_folders_view) }, */
{ "ToolbarDeleteMessage", MODEST_STOCK_DELETE, N_("qgn_toolb_gene_deletebutton"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_delete_message_or_folder) },
{ "ToolbarSort", MODEST_STOCK_SORT, N_("qgn_list_sort"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_sort) },
{ "ToolbarFindInMessage", MODEST_TOOLBAR_ICON_FIND, N_("qgn_toolb_gene_find"), NULL, NULL, NULL },
};
static const GtkToggleActionEntry modest_toggle_action_entries [] = {
- { "ViewToggleFolders", NULL, N_("mcen_me_inbox_hidefolders"), NULL, NULL, G_CALLBACK (modest_ui_actions_toggle_folders_view), TRUE },
{ "ViewToggleFullscreen", GTK_STOCK_FULLSCREEN, N_("mcen_me_inbox_fullscreen"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_fullscreen), FALSE },
{ "ViewShowToolbarNormalScreen", NULL, N_("mcen_me_inbox_normalview"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_toolbar), TRUE },
{ "ViewShowToolbarFullScreen", NULL, N_("mcen_me_inbox_optimizedview"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_toolbar), TRUE },
};
static const GtkToggleActionEntry modest_main_window_toggle_action_entries [] = {
- { "ToolbarToggleView", MODEST_STOCK_SPLIT_VIEW, N_("gqn_toolb_rss_fldonoff"), "<CTRL>t", NULL, G_CALLBACK (modest_ui_actions_toggle_folders_view), FALSE },
+ { "ToggleFolders", MODEST_STOCK_SPLIT_VIEW, N_("mcen_me_inbox_hidefolders"), "<CTRL>t", NULL, G_CALLBACK (modest_ui_actions_toggle_folders_view), TRUE },
};
/************************************************************************/
ModestMainWindowPrivate *priv;
ModestWindowPrivate *parent_priv;
GtkAction *action;
+ gboolean active;
g_return_if_fail (MODEST_IS_MAIN_WINDOW (self));
if (priv->style == style)
return;
- /* Get toggle button */
- action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/ToolBar/ToolbarToggleView");
+ /* Get toggle button and update the state if needed. This will
+ happen only when the set_style is not invoked from the UI,
+ for example when it's called from widget memory */
+ action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/ToolBar/ToggleFolders");
+ active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+ if ((active && style == MODEST_MAIN_WINDOW_STYLE_SIMPLE) ||
+ (!active && style == MODEST_MAIN_WINDOW_STYLE_SPLIT)) {
+ g_signal_handlers_block_by_func (action, modest_ui_actions_toggle_folders_view, self);
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), !active);
+ g_signal_handlers_unblock_by_func (action, modest_ui_actions_toggle_folders_view, self);
+ }
priv->style = style;
switch (style) {
/* Reparent the contents widget to the main vbox */
gtk_widget_reparent (priv->contents_widget, priv->main_vbox);
- g_signal_handlers_block_by_func (action, modest_ui_actions_toggle_folders_view, self);
- gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
- g_signal_handlers_unblock_by_func (action, modest_ui_actions_toggle_folders_view, self);
-
if (modest_header_view_has_selected_headers (MODEST_HEADER_VIEW (priv->header_view))) {
TnyList *selection = modest_header_view_get_selected_headers (MODEST_HEADER_VIEW (priv->header_view));
TnyIterator *iterator = tny_list_create_iterator (selection);
gtk_paned_add2 (GTK_PANED (priv->main_paned), priv->contents_widget);
gtk_container_add (GTK_CONTAINER (priv->main_vbox), priv->main_paned);
- g_signal_handlers_block_by_func (action, modest_ui_actions_toggle_folders_view, self);
- gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), FALSE);
- g_signal_handlers_unblock_by_func (action, modest_ui_actions_toggle_folders_view, self);
-
break;
default:
g_return_if_reached ();
<menu name="ViewMenu" action="View">
<menuitem name="ViewSortMenu" action="ViewSort"/>
<separator/>
- <menuitem name="ViewToggleFoldersMenu" action="ViewToggleFolders"/>
+ <menuitem name="ViewToggleFoldersMenu" action="ToggleFolders"/>
<menuitem name="ViewToggleFullscreenMenu" action="ViewToggleFullscreen"/>
<separator/>
<menu name="ViewShowToolbarMainMenu" action="ViewShowToolbar">
<toolitem action="ToolbarMessageNew"/>
<toolitem action="ToolbarMessageReply"/>
<toolitem action="ToolbarDeleteMessage"/>
- <toolitem action="ToolbarToggleView"/>
+ <toolitem action="ToggleFolders"/>
<toolitem action="ToolbarSort"/>
<toolitem action="ToolbarSendReceive"/>
<placeholder name="ProgressBarView" />
ModestWindow *main_window =
modest_window_mgr_get_main_window (modest_runtime_get_window_mgr ());
-
+
+ gdk_threads_enter ();
gboolean created_dialog = FALSE;
if (!found || !dialog) {
dialog = modest_account_settings_dialog_new ();
else {
/* Just show it instead of showing it and deleting it when it closes,
* though it is probably open already: */
- gtk_widget_show (GTK_WIDGET (dialog));
+ gtk_window_present (GTK_WINDOW (dialog));
}
g_object_unref (account);
+ gdk_threads_leave ();
return FALSE; /* Dont' call this again. */
}
modest_ui_actions_toggle_folders_view (GtkAction *action,
ModestMainWindow *main_window)
{
- ModestConf *conf;
-
g_return_if_fail (MODEST_IS_MAIN_WINDOW(main_window));
- conf = modest_runtime_get_conf ();
-
- if (modest_main_window_get_style (main_window) == MODEST_MAIN_WINDOW_STYLE_SPLIT)
- modest_main_window_set_style (main_window, MODEST_MAIN_WINDOW_STYLE_SIMPLE);
- else
+ if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)))
modest_main_window_set_style (main_window, MODEST_MAIN_WINDOW_STYLE_SPLIT);
+ else
+ modest_main_window_set_style (main_window, MODEST_MAIN_WINDOW_STYLE_SIMPLE);
}
void
/* Current folder was unselected */
if (priv->cur_folder_store) {
if (TNY_IS_FOLDER(priv->cur_folder_store))
- tny_folder_sync (TNY_FOLDER(priv->cur_folder_store), FALSE, NULL);
+ tny_folder_sync_async (TNY_FOLDER(priv->cur_folder_store), FALSE, NULL, NULL, NULL);
/* FALSE --> don't expunge the messages */
g_signal_emit (G_OBJECT(tree_view), signals[FOLDER_SELECTION_CHANGED_SIGNAL], 0,