aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@novell.com>2010-05-08 01:12:48 +0800
committerFederico Mena Quintero <federico@novell.com>2010-05-08 01:12:48 +0800
commit2aa44ca3df3a60357397a47316465ffbeda1e82c (patch)
tree9b5c20341f42d9b1bb53cfbf59207f3dd85704b9
parentac2ef9fb41e51292b379c6dee62dd765f783dae0 (diff)
parent4aa2552cb46f0daa67e135231f82f7d5403e2d19 (diff)
downloadgsoc2013-evolution-2aa44ca3df3a60357397a47316465ffbeda1e82c.tar.gz
gsoc2013-evolution-2aa44ca3df3a60357397a47316465ffbeda1e82c.tar.zst
gsoc2013-evolution-2aa44ca3df3a60357397a47316465ffbeda1e82c.zip
Merge express2 into relayout-composer
-rw-r--r--capplet/settings/mail-account-view.c2
-rw-r--r--composer/e-msg-composer.c7
-rw-r--r--mail/e-mail-backend.c6
-rw-r--r--shell/e-shell-window-actions.c15
-rw-r--r--ui/evolution-calendars.ui4
-rw-r--r--widgets/misc/e-preferences-window.c89
-rw-r--r--widgets/misc/e-preferences-window.h2
7 files changed, 116 insertions, 9 deletions
diff --git a/capplet/settings/mail-account-view.c b/capplet/settings/mail-account-view.c
index 1446923c5a..a6751b9a1b 100644
--- a/capplet/settings/mail-account-view.c
+++ b/capplet/settings/mail-account-view.c
@@ -166,6 +166,8 @@ validate_identity (MailAccountView *view)
return ERROR_NO_FULLNAME;
if (!email || !*email)
return ERROR_NO_EMAIL;
+ if (view->original) /* We don't query/store pwd on edit. */
+ return 0;
if (!pwd || !*pwd)
return ERROR_NO_PASSWORD;
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index ca8e487223..888705d0d1 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -2145,7 +2145,14 @@ msg_composer_class_init (EMsgComposerClass *class)
static void
msg_composer_init (EMsgComposer *composer)
{
+ EShell *shell = e_shell_get_default ();
+
composer->priv = E_MSG_COMPOSER_GET_PRIVATE (composer);
+
+ if (e_shell_get_express_mode (shell)) {
+ GtkWindow *window = e_shell_get_active_window(shell);
+ gtk_window_set_transient_for (GTK_WINDOW(composer), window);
+ }
}
GType
diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c
index 4ab444027f..734fefbd72 100644
--- a/mail/e-mail-backend.c
+++ b/mail/e-mail-backend.c
@@ -22,6 +22,7 @@
*
*/
+#include <string.h>
#include "e-mail-backend.h"
#include <camel/camel.h>
@@ -283,6 +284,11 @@ mail_backend_quit_requested_cb (EShell *shell,
/* We can quit immediately if offline. */
if (!e_shell_get_online (shell))
return;
+
+ /* In express mode, don't raise mail request in non mail window. */
+ if (e_shell_get_express_mode(shell) &&
+ strcmp(e_shell_window_get_active_view((EShellWindow *)window), "mail") != 0)
+ return;
/* Check Outbox for any unsent messages. */
diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c
index 2cb53c1a02..06fce0fe69 100644
--- a/shell/e-shell-window-actions.c
+++ b/shell/e-shell-window-actions.c
@@ -926,10 +926,17 @@ action_preferences_cb (GtkAction *action,
shell_backend = e_shell_view_get_shell_backend (shell_view);
shell_backend_class = E_SHELL_BACKEND_GET_CLASS (shell_backend);
- if (shell_backend_class->preferences_page != NULL)
- e_preferences_window_show_page (
- E_PREFERENCES_WINDOW (preferences_window),
- shell_backend_class->preferences_page);
+ if (shell_backend_class->preferences_page != NULL) {
+ if (e_shell_get_express_mode (shell)) {
+ e_preferences_window_filter_page (
+ E_PREFERENCES_WINDOW (preferences_window),
+ shell_backend_class->preferences_page);
+ } else {
+ e_preferences_window_show_page (
+ E_PREFERENCES_WINDOW (preferences_window),
+ shell_backend_class->preferences_page);
+ }
+ }
}
/**
diff --git a/ui/evolution-calendars.ui b/ui/evolution-calendars.ui
index 404101910b..cbffb867b0 100644
--- a/ui/evolution-calendars.ui
+++ b/ui/evolution-calendars.ui
@@ -55,6 +55,10 @@
#if !EXPRESS
<toolitem action='calendar-view-list'/>
#endif
+#if EXPRESS
+ <separator/>
+ <toolitem action='preferences'/>
+#endif
</toolbar>
<popup name='calendar-popup'>
diff --git a/widgets/misc/e-preferences-window.c b/widgets/misc/e-preferences-window.c
index f40dee180b..8fa4fcf85f 100644
--- a/widgets/misc/e-preferences-window.c
+++ b/widgets/misc/e-preferences-window.c
@@ -33,11 +33,17 @@
struct _EPreferencesWindowPrivate {
GtkWidget *icon_view;
+ GtkWidget *scroll;
GtkWidget *notebook;
GHashTable *index;
+
+ GtkListStore *store;
+ GtkTreeModelFilter *filter;
+ const char *filter_view;
};
enum {
+ COLUMN_ID, /* G_TYPE_STRING */
COLUMN_TEXT, /* G_TYPE_STRING */
COLUMN_PIXBUF, /* GDK_TYPE_PIXBUF */
COLUMN_PAGE, /* G_TYPE_INT */
@@ -102,7 +108,7 @@ preferences_window_selection_changed_cb (EPreferencesWindow *window)
if (list == NULL)
return;
- model = gtk_icon_view_get_model (icon_view);
+ model = window->priv->store;
gtk_tree_model_get_iter (model, &iter, list->data);
gtk_tree_model_get (model, &iter, COLUMN_PAGE, &page, -1);
@@ -190,6 +196,40 @@ preferences_window_class_init (EPreferencesWindowClass *class)
widget_class->show = preferences_window_show;
}
+static gboolean
+filter_view (GtkTreeModel *model,
+ GtkTreeIter *iter,
+ gpointer data)
+{
+ EPreferencesWindow *window = (EPreferencesWindow *)data;
+ gchar *str;
+ gboolean visible = FALSE;
+
+ if (!window->priv->filter_view)
+ return TRUE;
+
+ gtk_tree_model_get (model, iter, COLUMN_ID, &str, -1);
+ if (strncmp(window->priv->filter_view, "mail", 4) == 0) {
+ /* Show everything except calendar */
+ if (str && (strncmp (str, "cal", 3) == 0))
+ visible = FALSE;
+ else
+ visible = TRUE;
+ } else if (strncmp(window->priv->filter_view, "cal", 3) == 0) {
+ /* Show only calendar and nothing else */
+ if (str && (strncmp (str, "cal", 3) != 0))
+ visible = FALSE;
+ else
+ visible = TRUE;
+
+ } else /* In any other case, show everything */
+ visible = TRUE;
+
+ g_free (str);
+
+ return visible;
+}
+
static void
preferences_window_init (EPreferencesWindow *window)
{
@@ -209,11 +249,16 @@ preferences_window_init (EPreferencesWindow *window)
window->priv = E_PREFERENCES_WINDOW_GET_PRIVATE (window);
window->priv->index = index;
+ window->priv->filter_view = NULL;
store = gtk_list_store_new (
- 4, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_INT, G_TYPE_INT);
+ 5, G_TYPE_STRING, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_INT, G_TYPE_INT);
gtk_tree_sortable_set_sort_column_id (
GTK_TREE_SORTABLE (store), COLUMN_SORT, GTK_SORT_ASCENDING);
+ window->priv->store = store;
+
+ window->priv->filter = (GtkTreeModelFilter *)gtk_tree_model_filter_new ((GtkTreeModel *)store, NULL);
+ gtk_tree_model_filter_set_visible_func (window->priv->filter, filter_view, window, NULL);
title = _("Evolution Preferences");
gtk_window_set_title (GTK_WINDOW (window), title);
@@ -243,11 +288,12 @@ preferences_window_init (EPreferencesWindow *window)
gtk_scrolled_window_set_shadow_type (
GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, TRUE, 0);
+ window->priv->scroll = widget;
gtk_widget_show (widget);
-
+
container = widget;
- widget = gtk_icon_view_new_with_model (GTK_TREE_MODEL (store));
+ widget = gtk_icon_view_new_with_model (GTK_TREE_MODEL (window->priv->filter));
gtk_icon_view_set_columns (GTK_ICON_VIEW (widget), 1);
gtk_icon_view_set_text_column (GTK_ICON_VIEW (widget), COLUMN_TEXT);
gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (widget), COLUMN_PIXBUF);
@@ -359,13 +405,14 @@ e_preferences_window_add_page (EPreferencesWindow *window,
notebook = GTK_NOTEBOOK (window->priv->notebook);
page = gtk_notebook_get_n_pages (notebook);
- model = gtk_icon_view_get_model (icon_view);
+ model = window->priv->store;
pixbuf = preferences_window_load_pixbuf (icon_name);
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
gtk_list_store_set (
GTK_LIST_STORE (model), &iter,
+ COLUMN_ID, page_name,
COLUMN_TEXT, caption, COLUMN_PIXBUF, pixbuf,
COLUMN_PAGE, page, COLUMN_SORT, sort_order, -1);
@@ -405,3 +452,35 @@ e_preferences_window_show_page (EPreferencesWindow *window,
gtk_icon_view_scroll_to_path (icon_view, path, FALSE, 0.0, 0.0);
gtk_tree_path_free (path);
}
+
+void
+e_preferences_window_filter_page (EPreferencesWindow *window,
+ const gchar *page_name)
+{
+ GtkTreeRowReference *reference;
+ GtkIconView *icon_view;
+ GtkTreePath *path;
+
+ g_return_if_fail (E_IS_PREFERENCES_WINDOW (window));
+ g_return_if_fail (page_name != NULL);
+
+ icon_view = GTK_ICON_VIEW (window->priv->icon_view);
+ reference = g_hash_table_lookup (window->priv->index, page_name);
+ g_return_if_fail (reference != NULL);
+
+ path = gtk_tree_row_reference_get_path (reference);
+ gtk_icon_view_select_path (icon_view, path);
+ gtk_icon_view_scroll_to_path (icon_view, path, FALSE, 0.0, 0.0);
+ gtk_tree_path_free (path);
+
+ window->priv->filter_view = page_name;
+ gtk_tree_model_filter_refilter (window->priv->filter);
+
+ /* XXX: We need a better solution to hide the icon view when
+ * there is just one entry */
+ if (strncmp(page_name, "cal", 3) == 0) {
+ gtk_widget_hide (window->priv->scroll);
+ } else
+ gtk_widget_show (window->priv->scroll);
+}
+
diff --git a/widgets/misc/e-preferences-window.h b/widgets/misc/e-preferences-window.h
index 4944a89e58..97f0da85e2 100644
--- a/widgets/misc/e-preferences-window.h
+++ b/widgets/misc/e-preferences-window.h
@@ -68,6 +68,8 @@ void e_preferences_window_add_page (EPreferencesWindow *window,
gint sort_order);
void e_preferences_window_show_page (EPreferencesWindow *window,
const gchar *page_name);
+void e_preferences_window_filter_page (EPreferencesWindow *window,
+ const gchar *page_name);
G_END_DECLS