aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-09-04 21:48:24 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-10-06 20:16:21 +0800
commit224f26b84d9c12b0dd1d337f51c14b6ebb901007 (patch)
treec88109d0fe00df4b14dcf1ce641cd5ed91013f0f /modules
parentda3e201c064f877c884befc0a0b434619b056e09 (diff)
downloadgsoc2013-evolution-224f26b84d9c12b0dd1d337f51c14b6ebb901007.tar.gz
gsoc2013-evolution-224f26b84d9c12b0dd1d337f51c14b6ebb901007.tar.zst
gsoc2013-evolution-224f26b84d9c12b0dd1d337f51c14b6ebb901007.zip
GtkApplication has some new EShell-like features.
I pushed a few EShell features up to GtkApplication for GTK+ 3.2, so we can now trim off the redundancies in EShell. 1) GtkApplication has a new "window-added" signal which replaces EShell's own "window-created" signal. 2) GtkApplication has a new "window-removed" signal which replaces EShell's own "window-destroyed" signal. 3) gtk_application_get_windows() now returns a list of windows sorted by most recently focused, replacing e_shell_get_watched_windows(). 4) GtkApplication now provides enough hooks to subclasses that we can remove e_shell_watch_window() and call gtk_application_add_window() directly.
Diffstat (limited to 'modules')
-rw-r--r--modules/addressbook/e-book-shell-backend.c8
-rw-r--r--modules/calendar/e-cal-shell-backend.c21
-rw-r--r--modules/calendar/e-memo-shell-backend.c8
-rw-r--r--modules/calendar/e-task-shell-backend.c8
-rw-r--r--modules/composer-autosave/e-composer-registry.c10
-rw-r--r--modules/mail/e-mail-shell-backend.c11
-rw-r--r--modules/mail/em-composer-prefs.c4
-rw-r--r--modules/offline-alert/evolution-offline-alert.c13
8 files changed, 44 insertions, 39 deletions
diff --git a/modules/addressbook/e-book-shell-backend.c b/modules/addressbook/e-book-shell-backend.c
index c52b39b9fa..92341e4a3f 100644
--- a/modules/addressbook/e-book-shell-backend.c
+++ b/modules/addressbook/e-book-shell-backend.c
@@ -440,8 +440,8 @@ book_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
}
static void
-book_shell_backend_window_created_cb (EShellBackend *shell_backend,
- GtkWindow *window)
+book_shell_backend_window_added_cb (EShellBackend *shell_backend,
+ GtkWindow *window)
{
const gchar *backend_name;
@@ -525,8 +525,8 @@ book_shell_backend_constructed (GObject *object)
shell_backend);
g_signal_connect_swapped (
- shell, "window-created",
- G_CALLBACK (book_shell_backend_window_created_cb),
+ shell, "window-added",
+ G_CALLBACK (book_shell_backend_window_added_cb),
shell_backend);
e_book_shell_backend_init_settings (shell);
diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c
index 96077cf19e..5693994277 100644
--- a/modules/calendar/e-cal-shell-backend.c
+++ b/modules/calendar/e-cal-shell-backend.c
@@ -699,8 +699,8 @@ exit:
}
static void
-cal_shell_backend_window_created_cb (EShellBackend *shell_backend,
- GtkWindow *window)
+cal_shell_backend_window_added_cb (EShellBackend *shell_backend,
+ GtkWindow *window)
{
const gchar *backend_name;
@@ -770,8 +770,8 @@ cal_shell_backend_constructed (GObject *object)
shell_backend);
g_signal_connect_swapped (
- shell, "window-created",
- G_CALLBACK (cal_shell_backend_window_created_cb),
+ shell, "window-added",
+ G_CALLBACK (cal_shell_backend_window_added_cb),
shell_backend);
cal_shell_backend_init_importers ();
@@ -943,18 +943,21 @@ e_cal_shell_backend_open_date_range (ECalShellBackend *cal_shell_backend,
EShellBackend *shell_backend;
EShellSidebar *shell_sidebar;
GtkWidget *shell_window = NULL;
+ GtkApplication *application;
ECalendar *navigator;
- GList *watched_windows;
+ GList *list;
g_return_if_fail (E_IS_CAL_SHELL_BACKEND (cal_shell_backend));
shell_backend = E_SHELL_BACKEND (cal_shell_backend);
shell = e_shell_backend_get_shell (shell_backend);
- watched_windows = e_shell_get_watched_windows (shell);
+
+ application = GTK_APPLICATION (shell);
+ list = gtk_application_get_windows (application);
/* Try to find an EShellWindow already in calendar view. */
- while (watched_windows != NULL) {
- GtkWidget *window = GTK_WIDGET (watched_windows->data);
+ while (list != NULL) {
+ GtkWidget *window = GTK_WIDGET (list->data);
if (E_IS_SHELL_WINDOW (window)) {
const gchar *active_view;
@@ -968,7 +971,7 @@ e_cal_shell_backend_open_date_range (ECalShellBackend *cal_shell_backend,
}
}
- watched_windows = g_list_next (watched_windows);
+ list = g_list_next (list);
}
/* Otherwise create a new EShellWindow in calendar view. */
diff --git a/modules/calendar/e-memo-shell-backend.c b/modules/calendar/e-memo-shell-backend.c
index 7edb82d6bb..ed4e81d559 100644
--- a/modules/calendar/e-memo-shell-backend.c
+++ b/modules/calendar/e-memo-shell-backend.c
@@ -485,8 +485,8 @@ exit:
}
static void
-memo_shell_backend_window_created_cb (EShellBackend *shell_backend,
- GtkWindow *window)
+memo_shell_backend_window_added_cb (EShellBackend *shell_backend,
+ GtkWindow *window)
{
const gchar *module_name;
@@ -555,8 +555,8 @@ memo_shell_backend_constructed (GObject *object)
shell_backend);
g_signal_connect_swapped (
- shell, "window-created",
- G_CALLBACK (memo_shell_backend_window_created_cb),
+ shell, "window-added",
+ G_CALLBACK (memo_shell_backend_window_added_cb),
shell_backend);
/* Chain up to parent's constructed() method. */
diff --git a/modules/calendar/e-task-shell-backend.c b/modules/calendar/e-task-shell-backend.c
index f6a5e14588..2fc8ce1e5f 100644
--- a/modules/calendar/e-task-shell-backend.c
+++ b/modules/calendar/e-task-shell-backend.c
@@ -490,8 +490,8 @@ exit:
}
static void
-task_shell_backend_window_created_cb (EShellBackend *shell_backend,
- GtkWindow *window)
+task_shell_backend_window_added_cb (EShellBackend *shell_backend,
+ GtkWindow *window)
{
const gchar *module_name;
@@ -560,8 +560,8 @@ task_shell_backend_constructed (GObject *object)
shell_backend);
g_signal_connect_swapped (
- shell, "window-created",
- G_CALLBACK (task_shell_backend_window_created_cb),
+ shell, "window-added",
+ G_CALLBACK (task_shell_backend_window_added_cb),
shell_backend);
/* Chain up to parent's constructed() method. */
diff --git a/modules/composer-autosave/e-composer-registry.c b/modules/composer-autosave/e-composer-registry.c
index 9fcba43ff9..3b69e166a7 100644
--- a/modules/composer-autosave/e-composer-registry.c
+++ b/modules/composer-autosave/e-composer-registry.c
@@ -149,9 +149,9 @@ composer_registry_notify_cb (EComposerRegistry *registry,
}
static void
-composer_registry_window_created_cb (EShell *shell,
- GtkWindow *window,
- EComposerRegistry *registry)
+composer_registry_window_added_cb (GtkApplication *application,
+ GtkWindow *window,
+ EComposerRegistry *registry)
{
/* Offer to restore any orphaned auto-save files from the
* previous session once the first EShellWindow is mapped. */
@@ -201,8 +201,8 @@ composer_registry_constructed (GObject *object)
/* Listen for new watched windows. */
g_signal_connect (
- extensible, "window-created",
- G_CALLBACK (composer_registry_window_created_cb),
+ extensible, "window-added",
+ G_CALLBACK (composer_registry_window_added_cb),
object);
}
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c
index 4cf3cb78a5..ba812c1440 100644
--- a/modules/mail/e-mail-shell-backend.c
+++ b/modules/mail/e-mail-shell-backend.c
@@ -298,10 +298,11 @@ mail_shell_backend_window_weak_notify_cb (EShell *shell,
}
static void
-mail_shell_backend_window_created_cb (EShell *shell,
- GtkWindow *window,
- EShellBackend *shell_backend)
+mail_shell_backend_window_added_cb (GtkApplication *application,
+ GtkWindow *window,
+ EShellBackend *shell_backend)
{
+ EShell *shell = E_SHELL (application);
const gchar *backend_name;
/* This applies to both the composer and signature editor. */
@@ -392,8 +393,8 @@ mail_shell_backend_constructed (GObject *object)
shell_backend);
g_signal_connect (
- shell, "window-created",
- G_CALLBACK (mail_shell_backend_window_created_cb),
+ shell, "window-added",
+ G_CALLBACK (mail_shell_backend_window_added_cb),
shell_backend);
e_mail_shell_settings_init (shell_backend);
diff --git a/modules/mail/em-composer-prefs.c b/modules/mail/em-composer-prefs.c
index 12a521b454..8453b88540 100644
--- a/modules/mail/em-composer-prefs.c
+++ b/modules/mail/em-composer-prefs.c
@@ -547,11 +547,11 @@ em_composer_prefs_construct (EMComposerPrefs *prefs,
gtk_container_add (GTK_CONTAINER (container), widget);
gtk_widget_show (widget);
- /* The mail shell backend responds to the "window-created" signal
+ /* The mail shell backend responds to the "window-added" signal
* that this triggers and configures it with composer preferences. */
g_signal_connect_swapped (
widget, "editor-created",
- G_CALLBACK (e_shell_watch_window), shell);
+ G_CALLBACK (gtk_application_add_window), shell);
/* Express mode does not honor this setting. */
if (!e_shell_get_express_mode (shell))
diff --git a/modules/offline-alert/evolution-offline-alert.c b/modules/offline-alert/evolution-offline-alert.c
index 9fb5d2a60c..c685815b17 100644
--- a/modules/offline-alert/evolution-offline-alert.c
+++ b/modules/offline-alert/evolution-offline-alert.c
@@ -97,10 +97,11 @@ offline_alert_network_available_cb (EShell *shell,
}
static void
-offline_alert_window_created_cb (EShell *shell,
- GtkWindow *window,
- EOfflineAlert *extension)
+offline_alert_window_added_cb (GtkApplication *application,
+ GtkWindow *window,
+ EOfflineAlert *extension)
{
+ EShell *shell = E_SHELL (application);
GtkAction *action;
if (!E_IS_SHELL_WINDOW (window))
@@ -118,7 +119,7 @@ offline_alert_window_created_cb (EShell *shell,
G_CALLBACK (offline_alert_network_available_cb), extension);
g_signal_handlers_disconnect_by_func (
- shell, offline_alert_window_created_cb, extension);
+ shell, offline_alert_window_added_cb, extension);
if (e_shell_get_online (shell))
return;
@@ -175,8 +176,8 @@ offline_alert_constructed (GObject *object)
/* Watch for the first EShellWindow. */
g_signal_connect (
- shell, "window-created",
- G_CALLBACK (offline_alert_window_created_cb), extension);
+ shell, "window-added",
+ G_CALLBACK (offline_alert_window_added_cb), extension);
/* Chain up to parent's constructed() method. */
G_OBJECT_CLASS (e_offline_alert_parent_class)->constructed (object);