all */
return TRUE;
}
+
+void
+modest_main_window_set_style (ModestMainWindow *self,
+ ModestMainWindowStyle style)
+{
+ /* TODO */
+}
+
+ModestMainWindowStyle
+modest_main_window_get_style (ModestMainWindow *self)
+{
+ /* TODO */
+ return MODEST_MAIN_WINDOW_STYLE_SPLITTED;
+}
/* View */
{ "ViewSort", NULL, N_("mcen_me_inbox_sort"), NULL, NULL, NULL },
-/* { "ViewFolders", NULL, N_("mcen_me_inbox_hidefolders"), NULL, NULL, NULL }, */
-/* { "ViewFullscreen", NULL, N_("mcen_me_inbox_fullscreen"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_fullscreen) }, */
{ "ViewShowToolbar", NULL, N_("mcen_me_inbox_toolbar") }, /* submenu */
{ "ViewShowToolbarNormalScreen", NULL, N_("mcen_me_inbox_normalview"), NULL, NULL, NULL },
{ "ViewShowToolbarFullScreen", NULL, N_("mcen_me_inbox_optimizedview"), NULL, NULL, NULL },
{ "ToolbarMessageReplyAll", MODEST_STOCK_REPLY_ALL, N_("qgn_toolb_messagin_replyall"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_reply_all) },
{ "ToolbarMessageForward", MODEST_STOCK_FORWARD, N_("qgn_toolb_messagin_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_view) },
+ { "ToolbarToggleView", MODEST_STOCK_SPLIT_VIEW, N_("gqn_toolb_rss_fldonoff"), "<CTRL>t", NULL, G_CALLBACK (modest_ui_actions_toggle_main_view) },
{ "ToolbarDeleteMessage", MODEST_STOCK_DELETE, N_("qgn_toolb_gene_deletebutton"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_delete) },
{ "ToolbarSort", MODEST_STOCK_SORT, N_("qgn_list_sort"), NULL, NULL, NULL },
{ "ToolbarFindInMessage", GTK_STOCK_FIND, N_("qgn_toolb_gene_find"), NULL, NULL, NULL },
struct _ModestMainWindowPrivate {
GtkWidget *msg_paned;
GtkWidget *main_paned;
+ GtkWidget *main_vbox;
GtkWidget *progress_bar;
ModestHeaderView *header_view;
ModestFolderView *folder_view;
+ ModestMainWindowStyle style;
};
#define MODEST_MAIN_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \
MODEST_TYPE_MAIN_WINDOW, \
priv->msg_paned = NULL;
priv->main_paned = NULL;
+ priv->main_vbox = NULL;
priv->header_view = NULL;
priv->folder_view = NULL;
+ priv->style = MODEST_MAIN_WINDOW_STYLE_SPLITTED;
/* progress bar */
priv->progress_bar = gtk_progress_bar_new ();
ModestMainWindow *self;
ModestMainWindowPrivate *priv;
ModestWindowPrivate *parent_priv;
- GtkWidget *main_vbox;
GtkWidget *header_win, *folder_win;
GtkActionGroup *action_group;
GError *error = NULL;
modest_header_view_set_style (priv->header_view, MODEST_HEADER_VIEW_STYLE_TWOLINES);
folder_win = wrapped_in_scrolled_window (GTK_WIDGET(priv->folder_view), FALSE);
- header_win = wrapped_in_scrolled_window (GTK_WIDGET(priv->header_view), FALSE);
+ header_win = wrapped_in_scrolled_window (GTK_WIDGET(priv->header_view), FALSE);
+
/* paned */
priv->main_paned = gtk_hpaned_new ();
gtk_paned_add1 (GTK_PANED(priv->main_paned), folder_win);
gtk_tree_view_columns_autosize (GTK_TREE_VIEW(priv->header_view));
/* putting it all together... */
- main_vbox = gtk_vbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX(main_vbox), priv->main_paned, TRUE, TRUE,0);
+ priv->main_vbox = gtk_vbox_new (FALSE, 6);
+ gtk_box_pack_start (GTK_BOX(priv->main_vbox), priv->main_paned, TRUE, TRUE,0);
- gtk_container_add (GTK_CONTAINER(self), main_vbox);
+ gtk_container_add (GTK_CONTAINER(self), priv->main_vbox);
restore_sizes (MODEST_MAIN_WINDOW(self));
gtk_window_set_title (GTK_WINDOW(self), _("Modest"));
gtk_window_set_icon_from_file (GTK_WINDOW(self), MODEST_APP_ICON, NULL);
- gtk_widget_show_all (main_vbox);
+ gtk_widget_show_all (priv->main_vbox);
/* /\* should we hide the toolbar? *\/ */
/* if (!modest_conf_get_bool (modest_runtime_get_conf (), MODEST_CONF_SHOW_TOOLBAR, NULL)) */
return FALSE;
}
+void
+modest_main_window_set_style (ModestMainWindow *self,
+ ModestMainWindowStyle style)
+{
+ ModestMainWindowPrivate *priv;
+ GtkWidget *scrolled_win;
+
+ g_return_if_fail (MODEST_IS_MAIN_WINDOW (self));
+
+ priv = MODEST_MAIN_WINDOW_GET_PRIVATE(self);
+
+ /* no change -> nothing to do */
+ if (priv->style == style)
+ return;
+
+ priv->style = style;
+ scrolled_win = gtk_widget_get_parent (GTK_WIDGET (priv->header_view));
+
+ switch (style) {
+ case MODEST_MAIN_WINDOW_STYLE_SIMPLE:
+ /* Remove main paned */
+ g_object_ref (priv->main_paned);
+ gtk_container_remove (GTK_CONTAINER (priv->main_vbox), priv->main_paned);
+
+ /* Reparent header view with scrolled window */
+ gtk_widget_reparent (scrolled_win, priv->main_vbox);
+ break;
+ case MODEST_MAIN_WINDOW_STYLE_SPLITTED:
+ /* Remove header view */
+ g_object_ref (scrolled_win);
+ gtk_container_remove (GTK_CONTAINER (priv->main_vbox), scrolled_win);
+
+ /* Reparent the main paned */
+ gtk_paned_add2 (GTK_PANED (priv->main_paned), scrolled_win);
+ gtk_container_add (GTK_CONTAINER (priv->main_vbox), priv->main_paned);
+ break;
+ default:
+ g_return_if_reached ();
+ }
+
+ /* Show changes */
+ gtk_widget_show (GTK_WIDGET (priv->main_vbox));
+}
+
+ModestMainWindowStyle
+modest_main_window_get_style (ModestMainWindow *self)
+{
+ ModestMainWindowPrivate *priv;
+
+ g_return_val_if_fail (MODEST_IS_MAIN_WINDOW (self), -1);
+
+ priv = MODEST_MAIN_WINDOW_GET_PRIVATE(self);
+ return priv->style;
+}
+
static gboolean
modest_main_window_window_state_event (GtkWidget *widget, GdkEventWindowState *event, gpointer userdata)
{
#include <hildon-widgets/hildon-color-button.h>
#include <hildon-widgets/hildon-banner.h>
#include <hildon-widgets/hildon-caption.h>
+#include "widgets/modest-msg-edit-window-ui.h"
#ifdef MODEST_HILDON_VERSION_0
#include <hildon-widgets/hildon-file-chooser-dialog.h>
#else
#include <hildon/hildon-file-chooser-dialog.h>
-#include <widgets/modest-msg-edit-window-ui.h>
#endif /*MODEST_HILDON_VERSION_0 */
void
-modest_ui_actions_toggle_view (GtkAction *action, ModestMainWindow *main_window)
+modest_ui_actions_toggle_header_list_view (GtkAction *action, ModestMainWindow *main_window)
{
ModestConf *conf;
GtkWidget *header_view;
modest_msg_edit_window_show_bcc (window, gtk_toggle_action_get_active (toggle));
}
+
+void
+modest_ui_actions_toggle_main_view (GtkAction *action,
+ ModestMainWindow *main_window)
+{
+ ModestConf *conf;
+
+ g_return_if_fail (MODEST_IS_MAIN_WINDOW(main_window));
+
+ conf = modest_runtime_get_conf ();
+
+/* modest_widget_memory_save (conf, G_OBJECT(header_view), "header-view"); */
+
+ if (modest_main_window_get_style (main_window) == MODEST_MAIN_WINDOW_STYLE_SPLITTED)
+ modest_main_window_set_style (main_window, MODEST_MAIN_WINDOW_STYLE_SIMPLE);
+ else
+ modest_main_window_set_style (main_window, MODEST_MAIN_WINDOW_STYLE_SPLITTED);
+
+/* modest_widget_memory_restore (conf, G_OBJECT(header_view), */
+/* "header-view"); */
+}
void modest_ui_actions_on_message_details (GtkAction *action, ModestWindow *win);
-void modest_ui_actions_toggle_view (GtkAction *action, ModestMainWindow *main_window);
+
+/**
+ * modest_ui_actions_toggle_main_view:
+ * @action: the #GtkAction
+ * @main_window: the #ModestMainWindow
+ *
+ * this action switches between split view (with a folders pane at the
+ * left) and simple view without the left pane with the folders and
+ * accounts. Maybe it's only useful for Maemo code, but as it uses
+ * generic code could be used also by the GNOME UI
+ **/
+void modest_ui_actions_toggle_main_view (GtkAction *action,
+ ModestMainWindow *main_window);
+
+/**
+ * modest_ui_actions_toggle_header_list_view:
+ * @action: the #GtkAction
+ * @main_window: the #ModestMainWindow
+ *
+ * this action shows or hides the column titles of the header list
+ * view. It also enables the two lines rendering for the treeview rows
+ **/
+void modest_ui_actions_toggle_header_list_view (GtkAction *action,
+ ModestMainWindow *main_window);
/* Widget actions */
void modest_ui_actions_on_header_selected (ModestHeaderView *folder_view,
void modest_ui_actions_on_toggle_fullscreen (GtkToggleAction *toggle,
ModestWindow *window);
+
+void modest_ui_actions_on_change_fullscreen (GtkAction *action,
+ ModestWindow *window);
+
void modest_ui_actions_on_paste (GtkAction *action,
ModestWindow *window);
-void modest_ui_actions_on_change_fullscreen (GtkAction *toggle,
- ModestWindow *window);
void modest_ui_actions_on_select_all (GtkAction *action,
ModestWindow *window);
ModestWindow *window);
+
+
+
G_END_DECLS
#endif /* __MODEST_UI_ACTIONS_H__ */
ModestWindowClass parent_class;
};
+typedef enum _ModestMainWindowStyle {
+ MODEST_MAIN_WINDOW_STYLE_SIMPLE,
+ MODEST_MAIN_WINDOW_STYLE_SPLITTED
+} ModestMainWindowStyle;
+
/**
* modest_main_window_get_type:
*
**/
gboolean modest_main_window_close_all (ModestMainWindow *self);
+
+/**
+ * modest_main_window_set_style:
+ * @self: the #ModestMainWindow
+ * @style: a #ModestMainWindowStyle that will be set
+ *
+ * sets the style of the main window, a splitted view with folders at
+ * the left and messages at the right, or the simple view, with just
+ * messages.
+ **/
+void modest_main_window_set_style (ModestMainWindow *self,
+ ModestMainWindowStyle style);
+
+/**
+ * modest_main_window_get_style:
+ * @self:
+ *
+ * gets the current show style of the main window
+ *
+ * Return value: the current #ModestWindowStyle
+ **/
+ModestMainWindowStyle modest_main_window_get_style (ModestMainWindow *self);
+
G_END_DECLS
#endif /* __MODEST_MAIN_WINDOW_H__ */
#define __MODEST_MSG_EDIT_WINDOW_UI_H__
#include <glib/gi18n.h>
+#include <gtk/gtk.h>
#include "modest-icon-names.h"
#include "modest-ui-actions.h"