From 1ca2b18e67672b7b2ec87c43e99d246a7208943d Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 7 Nov 2010 22:48:23 -0500 Subject: Fix distcheck errors. --- shell/test/e-test-shell-view.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/test/e-test-shell-view.c b/shell/test/e-test-shell-view.c index 924f9891f4..68d4ff9a7b 100644 --- a/shell/test/e-test-shell-view.c +++ b/shell/test/e-test-shell-view.c @@ -56,7 +56,7 @@ test_shell_view_dispose (GObject *object) priv = E_TEST_SHELL_VIEW_GET_PRIVATE (object); if (priv->activity != NULL) { - e_activity_complete (priv->activity); + e_activity_set_state (priv->activity, E_ACTIVITY_COMPLETED); g_object_unref (priv->activity); priv->activity = NULL; } -- cgit v1.2.3 From 0c01510b4ffada8b6cbd15c5c55a96de9c6895ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Tue, 9 Nov 2010 02:46:17 +0100 Subject: Use gtk_paned_new() instead gtk_[v|h]paned_new() --- shell/e-shell-window-private.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c index dee6450bcd..35f0fb3004 100644 --- a/shell/e-shell-window-private.c +++ b/shell/e-shell-window-private.c @@ -314,7 +314,7 @@ e_shell_window_private_constructed (EShellWindow *shell_window) if (widget != NULL) gtk_box_pack_start (box, widget, FALSE, FALSE, 0); - widget = gtk_hpaned_new (); + widget = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); gtk_box_pack_start (box, widget, TRUE, TRUE, 0); priv->content_pane = g_object_ref (widget); gtk_widget_show (widget); -- cgit v1.2.3 From f17e29a63a2e5d51001eded304b0de37c3457e8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Tue, 9 Nov 2010 02:49:40 +0100 Subject: Add a compatibility code to previous patch --- shell/e-shell-window-private.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'shell') diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c index 35f0fb3004..39c6ca971d 100644 --- a/shell/e-shell-window-private.c +++ b/shell/e-shell-window-private.c @@ -314,7 +314,11 @@ e_shell_window_private_constructed (EShellWindow *shell_window) if (widget != NULL) gtk_box_pack_start (box, widget, FALSE, FALSE, 0); +#if GTK_CHECK_VERSION(2,90,7) widget = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); +#else + widget = gtk_hpaned_new (); +#endif gtk_box_pack_start (box, widget, TRUE, TRUE, 0); priv->content_pane = g_object_ref (widget); gtk_widget_show (widget); -- cgit v1.2.3 From e3dda0436d981d9632a529aa5ca7230cb343694b Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Tue, 23 Nov 2010 01:58:24 +0530 Subject: Migrate the local store from mbox to maildir format --- shell/e-shell-migrate.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c index f4ac0b7de5..3f3f6f563b 100644 --- a/shell/e-shell-migrate.c +++ b/shell/e-shell-migrate.c @@ -822,11 +822,8 @@ e_shell_migrate_attempt (EShell *shell) if (curr_major <= 2 && curr_minor <= 30) fix_folder_permissions (e_get_user_data_dir ()); - if (!(curr_major > major || - (curr_major == major && curr_minor > minor) || - (curr_major == major && curr_minor == minor && curr_micro > micro))) - goto check_old; - + /* Attempt to run migration all the time and let the backend + make the choice */ if (!shell_migrate_attempt (shell, major, minor, micro)) _exit (EXIT_SUCCESS); @@ -837,9 +834,6 @@ e_shell_migrate_attempt (EShell *shell) g_free (string); migrated = TRUE; - -check_old: - key = GCONF_LAST_VERSION_KEY; /* Try to retrieve the last migrated version from GConf. */ -- cgit v1.2.3 From 863b9bf6391eb64bb28106b37df206d24312e54d Mon Sep 17 00:00:00 2001 From: Mathieu Trudel-Lapierre Date: Tue, 23 Nov 2010 10:46:54 +0100 Subject: Bug #635087 - Leftover files after migration of config/data/cache to XDG directories --- shell/e-shell-migrate.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c index 3f3f6f563b..878b121488 100644 --- a/shell/e-shell-migrate.c +++ b/shell/e-shell-migrate.c @@ -433,14 +433,15 @@ shell_xdg_migrate_config_dir_mail (EShell *shell, } static void -shell_xdg_migrate_config_dir_cleanup (EShell *shell, +shell_xdg_migrate_dir_cleanup (EShell *shell, const gchar *old_base_dir, - const gchar *backend_name) + const gchar *backend_name, + const gchar *dir_name) { gchar *dirname; dirname = g_build_filename ( - old_base_dir, backend_name, "config", NULL); + old_base_dir, backend_name, dir_name, NULL); shell_xdg_migrate_rmdir (dirname); @@ -467,10 +468,13 @@ shell_xdg_migrate_config_dir (EShell *shell, /* Handle backend-specific files. */ shell_xdg_migrate_config_dir_mail (shell, old_base_dir); - /* Remove leftover "config" directories. */ - for (ii = 0; shell_backend_names[ii] != NULL; ii++) - shell_xdg_migrate_config_dir_cleanup ( - shell, old_base_dir, shell_backend_names[ii]); + /* Remove leftover config directories. */ + for (ii = 0; shell_backend_names[ii] != NULL; ii++) { + shell_xdg_migrate_dir_cleanup ( + shell, old_base_dir, shell_backend_names[ii], "config"); + shell_xdg_migrate_dir_cleanup ( + shell, old_base_dir, shell_backend_names[ii], "views"); + } /*** Miscellaneous configuration files. ***/ -- cgit v1.2.3 From e39dd931bcff0dfd6964a75c5b23c8e89f75d297 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 25 Nov 2010 18:10:14 +0100 Subject: Bug #207580 - Allow new mail check on individual accounts --- shell/e-shell-view.c | 1 - shell/e-shell-window-actions.c | 27 --------------------------- shell/e-shell-window-actions.h | 2 -- shell/e-shell-window-private.c | 7 ------- shell/e-shell.c | 36 ------------------------------------ shell/e-shell.h | 4 ---- shell/test/e-test-shell-backend.c | 12 ------------ 7 files changed, 89 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index e07b76213a..26b22645c4 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -724,7 +724,6 @@ shell_view_toggled (EShellView *shell_view) priv->merge_id = e_ui_manager_add_ui_from_file ( E_UI_MANAGER (ui_manager), basename); e_plugin_ui_enable_manager (ui_manager, id); - } else if (!view_is_active && priv->merge_id != 0) { e_plugin_ui_disable_manager (ui_manager, id); gtk_ui_manager_remove_ui (ui_manager, priv->merge_id); diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index a77bd35e97..949183133d 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1152,24 +1152,6 @@ action_search_save_cb (GtkAction *action, e_shell_window_update_search_menu (shell_window); } -/** - * E_SHELL_WINDOW_ACTION_SEND_RECEIVE: - * @window: an #EShellWindow - * - * Activation of this action opens the Send & Receive Mail dialog. - * - * Main menu item: File -> Send / Receive - **/ -static void -action_send_receive_cb (GtkAction *action, - EShellWindow *shell_window) -{ - EShell *shell; - - shell = e_shell_window_get_shell (shell_window); - e_shell_send_receive (shell, GTK_WINDOW (shell_window)); -} - /** * E_SHELL_WINDOW_ACTION_SHOW_SIDEBAR: * @window: an #EShellWindow @@ -1571,13 +1553,6 @@ static GtkActionEntry shell_entries[] = { N_("Select all text"), NULL }, /* Handled by EFocusTracker */ - { "send-receive", - "mail-send-receive", - N_("Send / _Receive"), - "F9", - N_("Send queued items and retrieve new items"), - G_CALLBACK (action_send_receive_cb) }, - { "submit-bug", NULL, N_("Submit _Bug Report..."), @@ -1933,8 +1908,6 @@ e_shell_window_actions_init (EShellWindow *shell_window) gtk_action_set_sensitive (ACTION (SEARCH_QUICK), FALSE); - g_object_set (ACTION (SEND_RECEIVE), "is-important", TRUE, NULL); - g_object_bind_property ( shell_window, "sidebar-visible", ACTION (SHOW_SIDEBAR), "active", diff --git a/shell/e-shell-window-actions.h b/shell/e-shell-window-actions.h index a3f752c15e..3746fe92c8 100644 --- a/shell/e-shell-window-actions.h +++ b/shell/e-shell-window-actions.h @@ -79,8 +79,6 @@ E_SHELL_WINDOW_ACTION ((window), "search-save") #define E_SHELL_WINDOW_ACTION_SELECT_ALL(window) \ E_SHELL_WINDOW_ACTION ((window), "select-all") -#define E_SHELL_WINDOW_ACTION_SEND_RECEIVE(window) \ - E_SHELL_WINDOW_ACTION ((window), "send-receive") #define E_SHELL_WINDOW_ACTION_SHOW_SIDEBAR(window) \ E_SHELL_WINDOW_ACTION ((window), "show-sidebar") #define E_SHELL_WINDOW_ACTION_SHOW_SWITCHER(window) \ diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c index 39c6ca971d..cf0ee93df2 100644 --- a/shell/e-shell-window-private.c +++ b/shell/e-shell-window-private.c @@ -390,13 +390,6 @@ e_shell_window_private_constructed (EShellWindow *shell_window) /* Bind GObject properties to GObject properties. */ - action = ACTION (SEND_RECEIVE); - - g_object_bind_property ( - shell, "online", - action, "sensitive", - G_BINDING_SYNC_CREATE); - action = ACTION (WORK_OFFLINE); g_object_bind_property ( diff --git a/shell/e-shell.c b/shell/e-shell.c index b983b18403..7ffe91b40d 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -96,7 +96,6 @@ enum { PREPARE_FOR_ONLINE, PREPARE_FOR_QUIT, QUIT_REQUESTED, - SEND_RECEIVE, WINDOW_CREATED, WINDOW_DESTROYED, LAST_SIGNAL @@ -1108,24 +1107,6 @@ e_shell_class_init (EShellClass *class) G_TYPE_NONE, 1, E_TYPE_SHELL_QUIT_REASON); - /** - * EShell::send-receive - * @shell: the #EShell which emitted the signal - * @parent: a parent #GtkWindow - * - * Emitted when the user chooses the "Send / Receive" action. - * The parent window can be used for showing transient windows. - **/ - signals[SEND_RECEIVE] = g_signal_new ( - "send-receive", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, - G_STRUCT_OFFSET (EShellClass, send_receive), - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - GTK_TYPE_WINDOW); - /** * EShell::window-created * @shell: the #EShell which emitted the signal @@ -1688,23 +1669,6 @@ e_shell_get_active_window (EShell *shell) return GTK_WINDOW (watched_windows->data); } -/** - * e_shell_send_receive: - * @shell: an #EShell - * @parent: the parent #GtkWindow - * - * Emits the #EShell::send-receive signal. - **/ -void -e_shell_send_receive (EShell *shell, - GtkWindow *parent) -{ - g_return_if_fail (E_IS_SHELL (shell)); - g_return_if_fail (GTK_IS_WINDOW (parent)); - - g_signal_emit (shell, signals[SEND_RECEIVE], 0, parent); -} - /** * e_shell_get_express_mode: * @shell: an #EShell diff --git a/shell/e-shell.h b/shell/e-shell.h index 15bcbb3694..3f037ba2d6 100644 --- a/shell/e-shell.h +++ b/shell/e-shell.h @@ -106,8 +106,6 @@ struct _EShellClass { EActivity *activity); void (*quit_requested) (EShell *shell, EShellQuitReason reason); - void (*send_receive) (EShell *shell, - GtkWindow *parent); void (*window_created) (EShell *shell, GtkWindow *window); void (*window_destroyed) (EShell *shell); @@ -134,8 +132,6 @@ void e_shell_watch_window (EShell *shell, GtkWindow *window); GList * e_shell_get_watched_windows (EShell *shell); GtkWindow * e_shell_get_active_window (EShell *shell); -void e_shell_send_receive (EShell *shell, - GtkWindow *parent); gboolean e_shell_get_meego_mode (EShell *shell); gboolean e_shell_get_express_mode (EShell *shell); gboolean e_shell_get_small_screen_mode (EShell *shell); diff --git a/shell/test/e-test-shell-backend.c b/shell/test/e-test-shell-backend.c index 58fe1aa17f..cbbd07cdb8 100644 --- a/shell/test/e-test-shell-backend.c +++ b/shell/test/e-test-shell-backend.c @@ -100,13 +100,6 @@ test_shell_backend_handle_uri_cb (EShellBackend *shell_backend, return FALSE; } -static void -test_shell_backend_send_receive_cb (EShellBackend *shell_backend, - GtkWindow *parent_window) -{ - g_debug ("%s (window=%p)", G_STRFUNC, parent_window); -} - static void test_shell_backend_window_created_cb (EShellBackend *shell_backend, GtkWindow *window) @@ -149,11 +142,6 @@ test_shell_backend_constructed (GObject *object) G_CALLBACK (test_shell_backend_handle_uri_cb), shell_backend); - g_signal_connect_swapped ( - shell, "send-receive", - G_CALLBACK (test_shell_backend_send_receive_cb), - shell_backend); - g_signal_connect_swapped ( shell, "window-created", G_CALLBACK (test_shell_backend_window_created_cb), -- cgit v1.2.3 From b2209c2abdea90944f3d47230ad82e4e62af00d6 Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Sat, 4 Dec 2010 16:10:06 +0100 Subject: Clarify command line parameter string --- shell/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/main.c b/shell/main.c index 7f2bd0673b..b80283b6db 100644 --- a/shell/main.c +++ b/shell/main.c @@ -335,7 +335,8 @@ static GOptionEntry entries[] = { NULL, NULL }, #endif /* G_OS_WIN32 */ { "component", 'c', 0, G_OPTION_ARG_STRING, &requested_view, - N_("Start Evolution activating the specified component"), NULL }, + /* Translators: Do NOT translate the five component names, they MUST remain in English! */ + N_("Start Evolution showing the specified component. Available options are 'mail', 'calendar', 'contacts', 'tasks', and 'memos'"), NULL }, { "geometry", 'g', 0, G_OPTION_ARG_STRING, &geometry, N_("Apply the given geometry to the main window"), "GEOMETRY" }, { "offline", '\0', 0, G_OPTION_ARG_NONE, &start_offline, -- cgit v1.2.3 From 22b2d26d048476d4909bfcf348ce6567e0d006a0 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 6 Dec 2010 14:23:20 +0100 Subject: Free/busy meeting view doesn't work due to non-working extension --- shell/e-shell-content.c | 3 +++ shell/e-shell-searchbar.c | 3 +++ shell/e-shell-sidebar.c | 3 +++ shell/e-shell-taskbar.c | 3 +++ shell/e-shell-view.c | 3 +++ shell/e-shell-window.c | 3 +++ shell/e-shell.c | 3 +++ shell/test/e-test-shell-backend.c | 3 +++ 8 files changed, 24 insertions(+) (limited to 'shell') diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index afd69ffdfa..62cfdd4176 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -207,6 +207,9 @@ shell_content_constructed (GObject *object) g_build_filename (config_dir, "searches.xml", NULL); e_extensible_load_extensions (E_EXTENSIBLE (object)); + + if (G_OBJECT_CLASS (e_shell_content_parent_class)->constructed) + G_OBJECT_CLASS (e_shell_content_parent_class)->constructed (object); } static void diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c index 6597eb0597..2200ed3fd1 100644 --- a/shell/e-shell-searchbar.c +++ b/shell/e-shell-searchbar.c @@ -737,6 +737,9 @@ shell_searchbar_constructed (GObject *object) gtk_size_group_add_widget (size_group, widget); e_extensible_load_extensions (E_EXTENSIBLE (object)); + + if (G_OBJECT_CLASS (e_shell_searchbar_parent_class)->constructed) + G_OBJECT_CLASS (e_shell_searchbar_parent_class)->constructed (object); } static void diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c index b56e4c061d..a7cb28e803 100644 --- a/shell/e-shell-sidebar.c +++ b/shell/e-shell-sidebar.c @@ -214,6 +214,9 @@ shell_sidebar_constructed (GObject *object) g_free (label); e_extensible_load_extensions (E_EXTENSIBLE (object)); + + if (G_OBJECT_CLASS (e_shell_sidebar_parent_class)->constructed) + G_OBJECT_CLASS (e_shell_sidebar_parent_class)->constructed (object); } static void diff --git a/shell/e-shell-taskbar.c b/shell/e-shell-taskbar.c index 9be7c1564e..41863b6750 100644 --- a/shell/e-shell-taskbar.c +++ b/shell/e-shell-taskbar.c @@ -272,6 +272,9 @@ shell_taskbar_constructed (GObject *object) gtk_widget_set_size_request (GTK_WIDGET (shell_taskbar), 0, -1); e_extensible_load_extensions (E_EXTENSIBLE (object)); + + if (G_OBJECT_CLASS (e_shell_taskbar_parent_class)->constructed) + G_OBJECT_CLASS (e_shell_taskbar_parent_class)->constructed (object); } static void diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 26b22645c4..fafab518aa 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -606,6 +606,9 @@ shell_view_constructed (GObject *object) shell_view->priv->size_group = NULL; e_extensible_load_extensions (E_EXTENSIBLE (object)); + + if (G_OBJECT_CLASS (parent_class)->constructed) + G_OBJECT_CLASS (parent_class)->constructed (object); } static GtkWidget * diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index 4f4e5c1b82..0ca0a5a541 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -343,6 +343,9 @@ shell_window_constructed (GObject *object) if (e_shell_get_meego_mode (shell_window->priv->shell) && e_shell_get_small_screen_mode (shell_window->priv->shell)) gtk_window_set_decorated (GTK_WINDOW (object), FALSE); + + if (G_OBJECT_CLASS (e_shell_window_parent_class)->constructed) + G_OBJECT_CLASS (e_shell_window_parent_class)->constructed (object); } static GtkWidget * diff --git a/shell/e-shell.c b/shell/e-shell.c index 7ffe91b40d..b52d77186b 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -690,6 +690,9 @@ shell_constructed (GObject *object) if (!unique_app_is_running (UNIQUE_APP (object))) e_file_lock_create (); + + if (G_OBJECT_CLASS (e_shell_parent_class)->constructed) + G_OBJECT_CLASS (e_shell_parent_class)->constructed (object); } static UniqueResponse diff --git a/shell/test/e-test-shell-backend.c b/shell/test/e-test-shell-backend.c index cbbd07cdb8..2891f53b64 100644 --- a/shell/test/e-test-shell-backend.c +++ b/shell/test/e-test-shell-backend.c @@ -151,6 +151,9 @@ test_shell_backend_constructed (GObject *object) shell, "window-destroyed", G_CALLBACK (test_shell_backend_window_destroyed_cb), shell_backend); + + if (G_OBJECT_CLASS (parent_class)->constructed) + G_OBJECT_CLASS (parent_class)->constructed (object); } static void -- cgit v1.2.3 From 7ddb3931b153c95641712a1e79732a359311bcec Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 7 Dec 2010 15:40:32 +0100 Subject: Bug #590245 - 'evolution --force-shutdown' should kill factories --- shell/killev.c | 41 +++++++++++++++++++++++++++++++++-------- shell/main.c | 44 ++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 73 insertions(+), 12 deletions(-) (limited to 'shell') diff --git a/shell/killev.c b/shell/killev.c index 16849eec42..948523dccb 100644 --- a/shell/killev.c +++ b/shell/killev.c @@ -94,6 +94,18 @@ exit: return success; } +static void +kill_factories (void) +{ + #ifdef KILL_PROCESS_CMD + + system (KILL_PROCESS_CMD " -QUIT evolution 2> /dev/null"); + system (KILL_PROCESS_CMD " -QUIT e-calendar-factory 2> /dev/null"); + system (KILL_PROCESS_CMD " -QUIT e-addressbook-factory 2> /dev/null"); + + #endif +} + gint main (gint argc, gchar **argv) { @@ -116,17 +128,27 @@ main (gint argc, gchar **argv) if (!get_evolution_pid (pid_file)) { g_printerr ("Could not find Evolution's process ID\n"); + kill_factories (); exit (EXIT_FAILURE); } - /* Play it safe here and bail if something goes wrong. We don't - * want to just skip to the killing if we can't ask Evolution to - * terminate gracefully. Despite our name we actually want to - * -avoid- killing Evolution if at all possible. */ - if (!g_spawn_command_line_async ("evolution --quit", &error)) { - g_printerr ("%s", error->message); - g_error_free (error); - exit (EXIT_FAILURE); + if (g_getenv ("DISPLAY") == NULL) { + #ifdef KILL_PROCESS_CMD + + system (KILL_PROCESS_CMD " -QUIT evolution 2> /dev/null"); + + #endif + } else { + /* Play it safe here and bail if something goes wrong. We don't + * want to just skip to the killing if we can't ask Evolution to + * terminate gracefully. Despite our name we actually want to + * -avoid- killing Evolution if at all possible. */ + if (!g_spawn_command_line_async ("evolution --quit", &error)) { + g_printerr ("%s", error->message); + g_error_free (error); + kill_factories (); + exit (EXIT_FAILURE); + } } /* Now we set up a monitor on Evolution's .running file. @@ -136,6 +158,7 @@ main (gint argc, gchar **argv) if (error != NULL) { g_printerr ("%s", error->message); g_error_free (error); + kill_factories (); exit (EXIT_FAILURE); } @@ -155,5 +178,7 @@ main (gint argc, gchar **argv) g_object_unref (monitor); + kill_factories (); + return EXIT_SUCCESS; } diff --git a/shell/main.c b/shell/main.c index b80283b6db..da7a235a0a 100644 --- a/shell/main.c +++ b/shell/main.c @@ -317,8 +317,36 @@ setup_segv_redirect (void) g_static_mutex_lock (&segv_mutex); } +static void +quit_signal (gint sig) +{ + EShell *shell; + + g_return_if_fail (sig == SIGQUIT); + + g_print ("Received quit signal...\n"); + + shell = e_shell_get_default (); + if (shell) + e_shell_quit (shell, E_SHELL_QUIT_OPTION); +} + +static void +setup_quit_signal (void) +{ + struct sigaction sa, osa; + + sigaction (SIGQUIT, NULL, &osa); + + sa.sa_flags = 0; + sigemptyset (&sa.sa_mask); + sa.sa_handler = quit_signal; + sigaction (SIGQUIT, &sa, NULL); +} + #else #define setup_segv_redirect() (void)0 +#define setup_quit_signal() (void)0 #endif static GOptionEntry entries[] = { @@ -512,6 +540,17 @@ main (gint argc, gchar **argv) bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); + g_type_init (); + if (!g_thread_get_initialized ()) + g_thread_init (NULL); + + /* do not require Gtk+ for --force-shutdown */ + if (argc == 2 && argv[1] && g_str_equal (argv[1], "--force-shutdown")) { + shell_force_shutdown (); + + return 0; + } + #if HAVE_CLUTTER gtk_clutter_init_with_args ( &argc, &argv, @@ -532,10 +571,6 @@ main (gint argc, gchar **argv) exit (1); } - g_type_init (); - if (!g_thread_get_initialized ()) - g_thread_init (NULL); - #ifdef HAVE_ICAL_UNKNOWN_TOKEN_HANDLING ical_set_unknown_token_handling_setting (ICAL_DISCARD_TOKEN); #endif @@ -623,6 +658,7 @@ main (gint argc, gchar **argv) } setup_segv_redirect (); + setup_quit_signal (); if (evolution_debug_log) { gint fd; -- cgit v1.2.3 From 59928e69ed7b769585282ae2b11bca1a9e9a1ca9 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 19 Dec 2010 13:30:45 -0500 Subject: Add e_shell_submit_alert(). An easy way to broadcast application-wide alerts to shell windows. These alerts will persist in all current and future shell windows until responded to (either programmatically or by the user). --- shell/e-shell.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ shell/e-shell.h | 3 +++ 2 files changed, 69 insertions(+) (limited to 'shell') diff --git a/shell/e-shell.c b/shell/e-shell.c index b52d77186b..b1891ce3b8 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -47,6 +47,7 @@ ((obj), E_TYPE_SHELL, EShellPrivate)) struct _EShellPrivate { + GQueue alerts; GList *watched_windows; EShellSettings *settings; GConfClient *gconf_client; @@ -132,6 +133,19 @@ shell_parse_debug_string (EShell *shell) e_shell_settings_enable_debug (shell->priv->settings); } +static void +shell_alert_response_cb (EShell *shell, + gint response_id, + EAlert *alert) +{ + g_signal_handlers_disconnect_by_func ( + alert, shell_alert_response_cb, shell); + + g_queue_remove (&shell->priv->alerts, alert); + + g_object_unref (alert); +} + static void shell_notify_online_cb (EShell *shell) { @@ -623,9 +637,16 @@ static void shell_dispose (GObject *object) { EShellPrivate *priv; + EAlert *alert; priv = E_SHELL_GET_PRIVATE (object); + while ((alert = g_queue_pop_head (&priv->alerts)) != NULL) { + g_signal_handlers_disconnect_by_func ( + alert, shell_alert_response_cb, object); + g_object_unref (alert); + } + if (priv->startup_view != NULL) { g_free (priv->startup_view); priv->startup_view = NULL; @@ -1156,6 +1177,8 @@ e_shell_init (EShell *shell) backends_by_name = g_hash_table_new (g_str_hash, g_str_equal); backends_by_scheme = g_hash_table_new (g_str_hash, g_str_equal); + g_queue_init (&shell->priv->alerts); + shell->priv->settings = g_object_new (E_TYPE_SHELL_SETTINGS, NULL); shell->priv->gconf_client = gconf_client_get_default (); shell->priv->preferences_window = e_preferences_window_new (shell); @@ -1432,6 +1455,7 @@ e_shell_create_shell_window (EShell *shell, GtkWidget *shell_window; UniqueMessageData *data; UniqueApp *app; + GList *link; g_return_val_if_fail (E_IS_SHELL (shell), NULL); @@ -1464,6 +1488,15 @@ e_shell_create_shell_window (EShell *shell, shell->priv->safe_mode, shell->priv->geometry); + /* Submit any outstanding alerts. */ + link = g_queue_peek_head_link (&shell->priv->alerts); + while (link != NULL) { + e_alert_sink_submit_alert ( + E_ALERT_SINK (shell_window), + E_ALERT (link->data)); + link = g_list_next (link); + } + /* Clear the first-time-only options. */ shell->priv->safe_mode = FALSE; g_free (shell->priv->geometry); @@ -1564,6 +1597,39 @@ unique: /* Send a message to the other Evolution process. */ return g_strv_length (uris); } +/** + * e_shell_submit_alert: + * @shell: an #EShell + * @alert: an #EAlert + * + * Broadcasts @alert to all #EShellWindows. This should only + * be used for application-wide alerts such as a network outage. Submit + * view-specific alerts to the appropriate #EShellContent instance. + **/ +void +e_shell_submit_alert (EShell *shell, + EAlert *alert) +{ + GList *list, *iter; + + g_return_if_fail (E_IS_SHELL (shell)); + g_return_if_fail (E_IS_ALERT (alert)); + + g_queue_push_tail (&shell->priv->alerts, g_object_ref (alert)); + + g_signal_connect_swapped ( + alert, "response", + G_CALLBACK (shell_alert_response_cb), shell); + + list = e_shell_get_watched_windows (shell); + + /* Submit the alert to all available EShellWindows. */ + for (iter = list; iter != NULL; iter = g_list_next (iter)) + if (E_IS_SHELL_WINDOW (iter->data)) + e_alert_sink_submit_alert ( + E_ALERT_SINK (iter->data), alert); +} + /** * e_shell_watch_window: * @shell: an #EShell diff --git a/shell/e-shell.h b/shell/e-shell.h index 3f037ba2d6..22aef9252f 100644 --- a/shell/e-shell.h +++ b/shell/e-shell.h @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -128,6 +129,8 @@ GtkWidget * e_shell_create_shell_window (EShell *shell, guint e_shell_handle_uris (EShell *shell, gchar **uris, gboolean do_import); +void e_shell_submit_alert (EShell *shell, + EAlert *alert); void e_shell_watch_window (EShell *shell, GtkWindow *window); GList * e_shell_get_watched_windows (EShell *shell); -- cgit v1.2.3 From 28c3b67bb1f007c5ad06a9695d2d750531d2139d Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 11 Jan 2011 10:33:03 +0100 Subject: Bug #638808 - camel_shutdown() called too early --- shell/e-shell.c | 1 + 1 file changed, 1 insertion(+) (limited to 'shell') diff --git a/shell/e-shell.c b/shell/e-shell.c index b1891ce3b8..123a9751e7 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -691,6 +691,7 @@ shell_finalize (GObject *object) if (!unique_app_is_running (UNIQUE_APP (object))) e_file_lock_destroy (); + g_list_foreach (priv->loaded_backends, (GFunc) g_object_unref, NULL); g_list_free (priv->loaded_backends); g_free (priv->geometry); -- cgit v1.2.3 From 0af3ff804c0d71c76fd63f0a2a152cac7de64863 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 13 Jan 2011 10:54:58 -0500 Subject: Fudge gtk_widget_get_preferred_size() for gtk2. Easy enough to fake gtk_widget_get_preferred_size() in gtk2 using gtk_widget_size_request(). Reduces diff noise with gtk3 branch. --- shell/e-shell-content.c | 13 ++++++++----- shell/e-shell-sidebar.c | 9 ++++++--- shell/e-shell-switcher.c | 9 ++++++--- 3 files changed, 20 insertions(+), 11 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index 62cfdd4176..a97c095947 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -44,6 +44,9 @@ #include "e-shell-view.h" #include "e-shell-window-actions.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_SHELL_CONTENT_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_SHELL_CONTENT, EShellContentPrivate)) @@ -226,16 +229,16 @@ shell_content_size_request (GtkWidget *widget, requisition->height = 0; child = gtk_bin_get_child (GTK_BIN (widget)); - gtk_widget_size_request (child, requisition); + gtk_widget_get_preferred_size (child, requisition, NULL); - gtk_widget_size_request (priv->alert_bar, &child_requisition); + gtk_widget_get_preferred_size (priv->alert_bar, &child_requisition, NULL); requisition->width = MAX (requisition->width, child_requisition.width); requisition->height += child_requisition.height; if (priv->searchbar == NULL) return; - gtk_widget_size_request (priv->searchbar, &child_requisition); + gtk_widget_get_preferred_size (priv->searchbar, &child_requisition, NULL); requisition->width = MAX (requisition->width, child_requisition.width); requisition->height += child_requisition.height; } @@ -267,7 +270,7 @@ shell_content_size_allocate (GtkWidget *widget, child_allocation.y += child_requisition.height; if (gtk_widget_get_visible (child)) - gtk_widget_size_request (child, &child_requisition); + gtk_widget_get_preferred_size (child, &child_requisition, NULL); else child_requisition.height = 0; @@ -282,7 +285,7 @@ shell_content_size_allocate (GtkWidget *widget, child_allocation.y += child_requisition.height; if (child != NULL) - gtk_widget_size_request (child, &child_requisition); + gtk_widget_get_preferred_size (child, &child_requisition, NULL); else child_requisition.height = 0; diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c index a7cb28e803..e460d30100 100644 --- a/shell/e-shell-sidebar.c +++ b/shell/e-shell-sidebar.c @@ -31,6 +31,9 @@ #include #include +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_SHELL_SIDEBAR_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_SHELL_SIDEBAR, EShellSidebarPrivate)) @@ -233,10 +236,10 @@ shell_sidebar_size_request (GtkWidget *widget, requisition->height = 0; child = gtk_bin_get_child (GTK_BIN (widget)); - gtk_widget_size_request (child, requisition); + gtk_widget_get_preferred_size (child, requisition, NULL); child = priv->event_box; - gtk_widget_size_request (child, &child_requisition); + gtk_widget_get_preferred_size (child, &child_requisition, NULL); requisition->width = MAX (requisition->width, child_requisition.width); requisition->height += child_requisition.height; } @@ -255,7 +258,7 @@ shell_sidebar_size_allocate (GtkWidget *widget, gtk_widget_set_allocation (widget, allocation); child = priv->event_box; - gtk_widget_size_request (child, &child_requisition); + gtk_widget_get_preferred_size (child, &child_requisition, NULL); child_allocation.x = allocation->x; child_allocation.y = allocation->y; diff --git a/shell/e-shell-switcher.c b/shell/e-shell-switcher.c index fec943c021..6dbcc86fb1 100644 --- a/shell/e-shell-switcher.c +++ b/shell/e-shell-switcher.c @@ -30,6 +30,9 @@ #include #include +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_SHELL_SWITCHER_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_SHELL_SWITCHER, EShellSwitcherPrivate)) @@ -100,7 +103,7 @@ shell_switcher_layout_actions (EShellSwitcher *switcher) GtkWidget *widget = p->data; GtkRequisition requisition; - gtk_widget_size_request (widget, &requisition); + gtk_widget_get_preferred_size (widget, &requisition, NULL); max_height = MAX (max_height, requisition.height); max_width = MAX (max_width, requisition.width); } @@ -261,7 +264,7 @@ shell_switcher_size_request (GtkWidget *widget, child = gtk_bin_get_child (GTK_BIN (widget)); if (child != NULL) - gtk_widget_size_request (child, requisition); + gtk_widget_get_preferred_size (child, requisition, NULL); if (!priv->toolbar_visible) return; @@ -270,7 +273,7 @@ shell_switcher_size_request (GtkWidget *widget, GtkWidget *widget = iter->data; GtkRequisition child_requisition; - gtk_widget_size_request (widget, &child_requisition); + gtk_widget_get_preferred_size (widget, &child_requisition, NULL); child_requisition.width += H_PADDING; child_requisition.height += V_PADDING; -- cgit v1.2.3 From 3cce94edcbd2c0969e72bdb53dfeefe4d76551f0 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 19 Jan 2011 14:56:35 +0100 Subject: Bug #634403 - Mails Label popup menu is not updated properly --- shell/e-shell-view.c | 1 + shell/e-shell-window-actions.c | 2 ++ 2 files changed, 3 insertions(+) (limited to 'shell') diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index fafab518aa..cb682b7814 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -730,6 +730,7 @@ shell_view_toggled (EShellView *shell_view) } else if (!view_is_active && priv->merge_id != 0) { e_plugin_ui_disable_manager (ui_manager, id); gtk_ui_manager_remove_ui (ui_manager, priv->merge_id); + gtk_ui_manager_ensure_update (ui_manager); priv->merge_id = 0; } diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 949183133d..6547ba6d76 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -2252,6 +2252,7 @@ e_shell_window_update_view_menu (EShellWindow *shell_window) /* Unmerge the previous menu. */ gtk_ui_manager_remove_ui (ui_manager, merge_id); e_action_group_remove_all_actions (action_group); + gtk_ui_manager_ensure_update (ui_manager); /* We have a view ID, so forge ahead. */ count = gal_view_collection_get_count (view_collection); @@ -2362,6 +2363,7 @@ e_shell_window_update_search_menu (EShellWindow *shell_window) /* Unmerge the previous menu. */ gtk_ui_manager_remove_ui (ui_manager, merge_id); e_action_group_remove_all_actions (action_group); + gtk_ui_manager_ensure_update (ui_manager); rule = e_rule_context_next_rule (context, NULL, source); while (rule != NULL) { -- cgit v1.2.3 From 753c60fc67a0a56a5f119c14ffa54ea9af95c208 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 9 Nov 2010 08:48:33 -0500 Subject: Drop backward-compatibility cruft. --- shell/e-shell-content.c | 3 --- shell/e-shell-searchbar.c | 3 --- shell/e-shell-sidebar.c | 3 --- shell/e-shell-switcher.c | 3 --- shell/e-shell-window-private.c | 4 ---- shell/e-shell-window-private.h | 3 --- shell/main.c | 3 --- 7 files changed, 22 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index a97c095947..6af94ddc37 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -44,9 +44,6 @@ #include "e-shell-view.h" #include "e-shell-window-actions.h" -/* backward-compatibility cruft */ -#include "e-util/gtk-compat.h" - #define E_SHELL_CONTENT_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_SHELL_CONTENT, EShellContentPrivate)) diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c index 2200ed3fd1..9244d792a7 100644 --- a/shell/e-shell-searchbar.c +++ b/shell/e-shell-searchbar.c @@ -37,9 +37,6 @@ #include "e-shell-window-actions.h" -/* backward-compatibility cruft */ -#include "e-util/gtk-compat.h" - #define E_SHELL_SEARCHBAR_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_SHELL_SEARCHBAR, EShellSearchbarPrivate)) diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c index e460d30100..5aa16e019d 100644 --- a/shell/e-shell-sidebar.c +++ b/shell/e-shell-sidebar.c @@ -31,9 +31,6 @@ #include #include -/* backward-compatibility cruft */ -#include "e-util/gtk-compat.h" - #define E_SHELL_SIDEBAR_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_SHELL_SIDEBAR, EShellSidebarPrivate)) diff --git a/shell/e-shell-switcher.c b/shell/e-shell-switcher.c index 6dbcc86fb1..2d2d13c153 100644 --- a/shell/e-shell-switcher.c +++ b/shell/e-shell-switcher.c @@ -30,9 +30,6 @@ #include #include -/* backward-compatibility cruft */ -#include "e-util/gtk-compat.h" - #define E_SHELL_SWITCHER_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_SHELL_SWITCHER, EShellSwitcherPrivate)) diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c index cf0ee93df2..1c9ee99de0 100644 --- a/shell/e-shell-window-private.c +++ b/shell/e-shell-window-private.c @@ -314,11 +314,7 @@ e_shell_window_private_constructed (EShellWindow *shell_window) if (widget != NULL) gtk_box_pack_start (box, widget, FALSE, FALSE, 0); -#if GTK_CHECK_VERSION(2,90,7) widget = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); -#else - widget = gtk_hpaned_new (); -#endif gtk_box_pack_start (box, widget, TRUE, TRUE, 0); priv->content_pane = g_object_ref (widget); gtk_widget_show (widget); diff --git a/shell/e-shell-window-private.h b/shell/e-shell-window-private.h index 79f15acb68..3faf3be50c 100644 --- a/shell/e-shell-window-private.h +++ b/shell/e-shell-window-private.h @@ -49,9 +49,6 @@ #include #include -/* backward-compatibility cruft */ -#include "e-util/gtk-compat.h" - #define E_SHELL_WINDOW_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_SHELL_WINDOW, EShellWindowPrivate)) diff --git a/shell/main.c b/shell/main.c index da7a235a0a..bad10a3f5a 100644 --- a/shell/main.c +++ b/shell/main.c @@ -171,9 +171,6 @@ show_development_warning (void) gtk_dialog_add_button ( GTK_DIALOG (warning_dialog), GTK_STOCK_OK, GTK_RESPONSE_OK); -#if !GTK_CHECK_VERSION(2,90,7) - g_object_set (warning_dialog, "has-separator", FALSE, NULL); -#endif action_area = gtk_dialog_get_action_area (GTK_DIALOG (warning_dialog)); content_area = gtk_dialog_get_content_area (GTK_DIALOG (warning_dialog)); -- cgit v1.2.3 From ba05584de52f5f953eee7e458ebf4d45da5a3319 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 13 Jan 2011 22:55:52 -0500 Subject: Dialogs no longer have separators. --- shell/e-shell-content.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index 6af94ddc37..38b62738be 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -611,7 +611,7 @@ e_shell_content_run_advanced_search_dialog (EShellContent *shell_content) dialog = gtk_dialog_new_with_buttons ( _("Advanced Search"), GTK_WINDOW (shell_window), - GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, + GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_APPLY, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); @@ -715,7 +715,7 @@ e_shell_content_run_save_search_dialog (EShellContent *shell_content) dialog = gtk_dialog_new_with_buttons ( _("Save Search"), GTK_WINDOW (shell_window), - GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, + GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); -- cgit v1.2.3 From b7c2f49973b93c2e80bed6f10c534af17b757c04 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Fri, 10 Dec 2010 13:15:27 +0100 Subject: Adapt size_request vfuncs to latest gtk+-3.0 API. --- shell/e-shell-content.c | 50 ++++++++++++++++++++++++++++---------- shell/e-shell-meego.c | 2 +- shell/e-shell-sidebar.c | 42 +++++++++++++++++++++++--------- shell/e-shell-switcher.c | 62 ++++++++++++++++++++++++++++++++++++++---------- 4 files changed, 118 insertions(+), 38 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index 38b62738be..586b706859 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -213,31 +213,54 @@ shell_content_constructed (GObject *object) } static void -shell_content_size_request (GtkWidget *widget, - GtkRequisition *requisition) +shell_content_get_preferred_width (GtkWidget *widget, + gint *minimum, + gint *natural) { EShellContentPrivate *priv; - GtkRequisition child_requisition; + gint min, nat; + gint child_min, child_nat; GtkWidget *child; priv = E_SHELL_CONTENT_GET_PRIVATE (widget); - requisition->width = 0; - requisition->height = 0; + *minimum = *natural = 0; child = gtk_bin_get_child (GTK_BIN (widget)); - gtk_widget_get_preferred_size (child, requisition, NULL); + gtk_widget_get_preferred_width (child, &child_min, &child_nat); + gtk_widget_get_preferred_width (priv->alert_bar, &min, &nat); + + *minimum = MAX (min, child_min); + *natural = MAX (nat, child_nat); + + if (priv->searchbar == NULL) + return; + + gtk_widget_get_preferred_width (priv->searchbar, &min, &nat); + *minimum = MAX (*minimum, min); + *natural = MAX (*natural, nat); +} - gtk_widget_get_preferred_size (priv->alert_bar, &child_requisition, NULL); - requisition->width = MAX (requisition->width, child_requisition.width); - requisition->height += child_requisition.height; +static void +shell_content_get_preferred_height (GtkWidget *widget, + gint *minimum, + gint *natural) +{ + EShellContentPrivate *priv; + gint min, nat; + GtkWidget *child; + + priv = E_SHELL_CONTENT_GET_PRIVATE (widget); + + child = gtk_bin_get_child (GTK_BIN (widget)); + gtk_widget_get_preferred_height (child, minimum, natural); if (priv->searchbar == NULL) return; - gtk_widget_get_preferred_size (priv->searchbar, &child_requisition, NULL); - requisition->width = MAX (requisition->width, child_requisition.width); - requisition->height += child_requisition.height; + gtk_widget_get_preferred_height (priv->searchbar, &min, &nat); + *minimum += min; + *natural += nat; } static void @@ -398,7 +421,8 @@ e_shell_content_class_init (EShellContentClass *class) object_class->constructed = shell_content_constructed; widget_class = GTK_WIDGET_CLASS (class); - widget_class->size_request = shell_content_size_request; + widget_class->get_preferred_width = shell_content_get_preferred_width; + widget_class->get_preferred_height = shell_content_get_preferred_height; widget_class->size_allocate = shell_content_size_allocate; container_class = GTK_CONTAINER_CLASS (class); diff --git a/shell/e-shell-meego.c b/shell/e-shell-meego.c index 29c7f293fd..51a2da9cf1 100644 --- a/shell/e-shell-meego.c +++ b/shell/e-shell-meego.c @@ -106,7 +106,7 @@ e_shell_detect_meego (gboolean *is_meego, &dummy_t, &dummy_i, &dummy_l, &dummy_l, &moblin_string); - gdk_error_trap_pop (); + gdk_error_trap_pop_ignored (); } if (moblin_string) { diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c index 5aa16e019d..618910a600 100644 --- a/shell/e-shell-sidebar.c +++ b/shell/e-shell-sidebar.c @@ -220,25 +220,44 @@ shell_sidebar_constructed (GObject *object) } static void -shell_sidebar_size_request (GtkWidget *widget, - GtkRequisition *requisition) +shell_sidebar_get_preferred_width (GtkWidget *widget, + gint *minimum, + gint *natural) { EShellSidebarPrivate *priv; - GtkRequisition child_requisition; + gint child_min, child_nat; GtkWidget *child; priv = E_SHELL_SIDEBAR_GET_PRIVATE (widget); - requisition->width = 0; - requisition->height = 0; + child = gtk_bin_get_child (GTK_BIN (widget)); + gtk_widget_get_preferred_width (child, minimum, natural); + + child = priv->event_box; + gtk_widget_get_preferred_width (child, &child_min, &child_nat); + *minimum = MAX (*minimum, child_min); + *natural = MAX (*natural, child_nat); +} + +static void +shell_sidebar_get_preferred_height (GtkWidget *widget, + gint *minimum, + gint *natural) +{ + EShellSidebarPrivate *priv; + gint child_min, child_nat; + GtkWidget *child; + + priv = E_SHELL_SIDEBAR_GET_PRIVATE (widget); child = gtk_bin_get_child (GTK_BIN (widget)); - gtk_widget_get_preferred_size (child, requisition, NULL); + gtk_widget_get_preferred_height (child, minimum, natural); child = priv->event_box; - gtk_widget_get_preferred_size (child, &child_requisition, NULL); - requisition->width = MAX (requisition->width, child_requisition.width); - requisition->height += child_requisition.height; + gtk_widget_get_preferred_height (child, &child_min, &child_nat); + + *minimum += child_min; + *natural += child_nat; } static void @@ -283,7 +302,7 @@ shell_sidebar_forall (GtkContainer *container, priv = E_SHELL_SIDEBAR_GET_PRIVATE (container); - if (include_internals) + if (include_internals && callback_data) callback (priv->event_box, callback_data); /* Chain up to parent's forall() method. */ @@ -308,7 +327,8 @@ e_shell_sidebar_class_init (EShellSidebarClass *class) object_class->constructed = shell_sidebar_constructed; widget_class = GTK_WIDGET_CLASS (class); - widget_class->size_request = shell_sidebar_size_request; + widget_class->get_preferred_width = shell_sidebar_get_preferred_width; + widget_class->get_preferred_height = shell_sidebar_get_preferred_height; widget_class->size_allocate = shell_sidebar_size_allocate; container_class = GTK_CONTAINER_CLASS (class); diff --git a/shell/e-shell-switcher.c b/shell/e-shell-switcher.c index 2d2d13c153..f785054c08 100644 --- a/shell/e-shell-switcher.c +++ b/shell/e-shell-switcher.c @@ -247,8 +247,9 @@ shell_switcher_dispose (GObject *object) } static void -shell_switcher_size_request (GtkWidget *widget, - GtkRequisition *requisition) +shell_switcher_get_preferred_width (GtkWidget *widget, + gint *minimum, + gint *natural) { EShellSwitcherPrivate *priv; GtkWidget *child; @@ -256,28 +257,62 @@ shell_switcher_size_request (GtkWidget *widget, priv = E_SHELL_SWITCHER_GET_PRIVATE (widget); - requisition->width = 0; - requisition->height = 0; + *minimum = *natural = 0; child = gtk_bin_get_child (GTK_BIN (widget)); if (child != NULL) - gtk_widget_get_preferred_size (child, requisition, NULL); + gtk_widget_get_preferred_width (child, minimum, natural); + + if (!priv->toolbar_visible) + return; + + for (iter = priv->proxies; iter != NULL; iter = iter->next) { + GtkWidget *widget_proxy = iter->data; + gint child_min, child_nat; + + gtk_widget_get_preferred_width ( + widget_proxy, &child_min, &child_nat); + + child_min += H_PADDING; + child_nat += H_PADDING; + + *minimum = MAX (*minimum, child_min); + *natural = MAX (*natural, child_nat); + } +} + +static void +shell_switcher_get_preferred_height (GtkWidget *widget, + gint *minimum, + gint *natural) +{ + EShellSwitcherPrivate *priv; + GtkWidget *child; + GList *iter; + + priv = E_SHELL_SWITCHER_GET_PRIVATE (widget); + + *minimum = *natural = 0; + + child = gtk_bin_get_child (GTK_BIN (widget)); + if (child != NULL) + gtk_widget_get_preferred_height (child, minimum, natural); if (!priv->toolbar_visible) return; for (iter = priv->proxies; iter != NULL; iter = iter->next) { GtkWidget *widget = iter->data; - GtkRequisition child_requisition; + gint child_min, child_nat; - gtk_widget_get_preferred_size (widget, &child_requisition, NULL); + gtk_widget_get_preferred_height ( + widget, &child_min, &child_nat); - child_requisition.width += H_PADDING; - child_requisition.height += V_PADDING; + child_min += V_PADDING; + child_nat += V_PADDING; - requisition->width = MAX ( - requisition->width, child_requisition.width); - requisition->height += child_requisition.height; + *minimum += child_min; + *natural += child_nat; } } @@ -451,7 +486,8 @@ e_shell_switcher_class_init (EShellSwitcherClass *class) object_class->dispose = shell_switcher_dispose; widget_class = GTK_WIDGET_CLASS (class); - widget_class->size_request = shell_switcher_size_request; + widget_class->get_preferred_width = shell_switcher_get_preferred_width; + widget_class->get_preferred_height = shell_switcher_get_preferred_height; widget_class->size_allocate = shell_switcher_size_allocate; widget_class->screen_changed = shell_switcher_screen_changed; -- cgit v1.2.3 From 66404fc4d98d1007dd21a74e5bb2c44596524435 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 25 Jan 2011 16:59:59 +0100 Subject: Bug #640516 - Information bar above folder list is empty --- shell/e-shell-sidebar.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c index 618910a600..3860a498c4 100644 --- a/shell/e-shell-sidebar.c +++ b/shell/e-shell-sidebar.c @@ -225,7 +225,6 @@ shell_sidebar_get_preferred_width (GtkWidget *widget, gint *natural) { EShellSidebarPrivate *priv; - gint child_min, child_nat; GtkWidget *child; priv = E_SHELL_SIDEBAR_GET_PRIVATE (widget); @@ -233,10 +232,7 @@ shell_sidebar_get_preferred_width (GtkWidget *widget, child = gtk_bin_get_child (GTK_BIN (widget)); gtk_widget_get_preferred_width (child, minimum, natural); - child = priv->event_box; - gtk_widget_get_preferred_width (child, &child_min, &child_nat); - *minimum = MAX (*minimum, child_min); - *natural = MAX (*natural, child_nat); + /* do not use priv->event_box here, otherwise it'll not ellipsize */ } static void @@ -302,7 +298,7 @@ shell_sidebar_forall (GtkContainer *container, priv = E_SHELL_SIDEBAR_GET_PRIVATE (container); - if (include_internals && callback_data) + if (include_internals && callback && priv->event_box) callback (priv->event_box, callback_data); /* Chain up to parent's forall() method. */ -- cgit v1.2.3 From 21ab8044dab93b6367463593628ec42befda4f67 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 29 Jan 2011 10:50:53 -0500 Subject: Coding style and whitespace cleanup. --- shell/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'shell') diff --git a/shell/main.c b/shell/main.c index bad10a3f5a..f9c9651e49 100644 --- a/shell/main.c +++ b/shell/main.c @@ -360,8 +360,11 @@ static GOptionEntry entries[] = { NULL, NULL }, #endif /* G_OS_WIN32 */ { "component", 'c', 0, G_OPTION_ARG_STRING, &requested_view, - /* Translators: Do NOT translate the five component names, they MUST remain in English! */ - N_("Start Evolution showing the specified component. Available options are 'mail', 'calendar', 'contacts', 'tasks', and 'memos'"), NULL }, + /* Translators: Do NOT translate the five component + * names, they MUST remain in English! */ + N_("Start Evolution showing the specified component. " + "Available options are 'mail', 'calendar', 'contacts', " + "'tasks', and 'memos'"), NULL }, { "geometry", 'g', 0, G_OPTION_ARG_STRING, &geometry, N_("Apply the given geometry to the main window"), "GEOMETRY" }, { "offline", '\0', 0, G_OPTION_ARG_NONE, &start_offline, -- cgit v1.2.3 From 0109aa3a92b484ebb85c6481e5a8e39819b1f011 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 30 Jan 2011 11:32:55 -0500 Subject: More whitespace cleanup. --- shell/e-shell-content.c | 16 ++++++++-------- shell/e-shell-sidebar.c | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index 586b706859..ccd121fa48 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -218,8 +218,8 @@ shell_content_get_preferred_width (GtkWidget *widget, gint *natural) { EShellContentPrivate *priv; - gint min, nat; - gint child_min, child_nat; + gint min, nat; + gint child_min, child_nat; GtkWidget *child; priv = E_SHELL_CONTENT_GET_PRIVATE (widget); @@ -227,8 +227,8 @@ shell_content_get_preferred_width (GtkWidget *widget, *minimum = *natural = 0; child = gtk_bin_get_child (GTK_BIN (widget)); - gtk_widget_get_preferred_width (child, &child_min, &child_nat); - gtk_widget_get_preferred_width (priv->alert_bar, &min, &nat); + gtk_widget_get_preferred_width (child, &child_min, &child_nat); + gtk_widget_get_preferred_width (priv->alert_bar, &min, &nat); *minimum = MAX (min, child_min); *natural = MAX (nat, child_nat); @@ -236,7 +236,7 @@ shell_content_get_preferred_width (GtkWidget *widget, if (priv->searchbar == NULL) return; - gtk_widget_get_preferred_width (priv->searchbar, &min, &nat); + gtk_widget_get_preferred_width (priv->searchbar, &min, &nat); *minimum = MAX (*minimum, min); *natural = MAX (*natural, nat); } @@ -247,7 +247,7 @@ shell_content_get_preferred_height (GtkWidget *widget, gint *natural) { EShellContentPrivate *priv; - gint min, nat; + gint min, nat; GtkWidget *child; priv = E_SHELL_CONTENT_GET_PRIVATE (widget); @@ -421,8 +421,8 @@ e_shell_content_class_init (EShellContentClass *class) object_class->constructed = shell_content_constructed; widget_class = GTK_WIDGET_CLASS (class); - widget_class->get_preferred_width = shell_content_get_preferred_width; - widget_class->get_preferred_height = shell_content_get_preferred_height; + widget_class->get_preferred_width = shell_content_get_preferred_width; + widget_class->get_preferred_height = shell_content_get_preferred_height; widget_class->size_allocate = shell_content_size_allocate; container_class = GTK_CONTAINER_CLASS (class); diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c index 3860a498c4..3e60096fc8 100644 --- a/shell/e-shell-sidebar.c +++ b/shell/e-shell-sidebar.c @@ -230,7 +230,7 @@ shell_sidebar_get_preferred_width (GtkWidget *widget, priv = E_SHELL_SIDEBAR_GET_PRIVATE (widget); child = gtk_bin_get_child (GTK_BIN (widget)); - gtk_widget_get_preferred_width (child, minimum, natural); + gtk_widget_get_preferred_width (child, minimum, natural); /* do not use priv->event_box here, otherwise it'll not ellipsize */ } @@ -241,7 +241,7 @@ shell_sidebar_get_preferred_height (GtkWidget *widget, gint *natural) { EShellSidebarPrivate *priv; - gint child_min, child_nat; + gint child_min, child_nat; GtkWidget *child; priv = E_SHELL_SIDEBAR_GET_PRIVATE (widget); @@ -323,8 +323,8 @@ e_shell_sidebar_class_init (EShellSidebarClass *class) object_class->constructed = shell_sidebar_constructed; widget_class = GTK_WIDGET_CLASS (class); - widget_class->get_preferred_width = shell_sidebar_get_preferred_width; - widget_class->get_preferred_height = shell_sidebar_get_preferred_height; + widget_class->get_preferred_width = shell_sidebar_get_preferred_width; + widget_class->get_preferred_height = shell_sidebar_get_preferred_height; widget_class->size_allocate = shell_sidebar_size_allocate; container_class = GTK_CONTAINER_CLASS (class); -- cgit v1.2.3 From 9a8f21c44bfe5d0efad1ae0ca1758c0d7c41f590 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 3 Feb 2011 14:09:50 -0500 Subject: Composer: Add Edit -> Preferences Opens the Preferences window to the Composer Preferences section. --- shell/e-shell-window-actions.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 6547ba6d76..928cab79c3 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -930,15 +930,14 @@ action_preferences_cb (GtkAction *action, shell_backend_class = E_SHELL_BACKEND_GET_CLASS (shell_backend); if (shell_backend_class->preferences_page != NULL) { - if (e_shell_get_express_mode (shell)) { + if (e_shell_get_express_mode (shell)) e_preferences_window_filter_page ( E_PREFERENCES_WINDOW (preferences_window), shell_backend_class->preferences_page); - } else { + else e_preferences_window_show_page ( E_PREFERENCES_WINDOW (preferences_window), shell_backend_class->preferences_page); - } } } -- cgit v1.2.3 From 2c31a5bc23cf5a092c0621bf34554ffb2b6ae2ec Mon Sep 17 00:00:00 2001 From: Kjartan Maraas Date: Tue, 8 Feb 2011 11:57:50 -0500 Subject: Bug 641756 - Fix warnings from GCC 4.6 GCC learned how to find dead assignments. --- shell/e-shell-sidebar.c | 17 +++++++---------- shell/e-shell-utils.c | 4 ---- 2 files changed, 7 insertions(+), 14 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c index 3e60096fc8..b8ee23b6d0 100644 --- a/shell/e-shell-sidebar.c +++ b/shell/e-shell-sidebar.c @@ -221,24 +221,21 @@ shell_sidebar_constructed (GObject *object) static void shell_sidebar_get_preferred_width (GtkWidget *widget, - gint *minimum, - gint *natural) + gint *minimum, + gint *natural) { - EShellSidebarPrivate *priv; GtkWidget *child; - priv = E_SHELL_SIDEBAR_GET_PRIVATE (widget); - child = gtk_bin_get_child (GTK_BIN (widget)); gtk_widget_get_preferred_width (child, minimum, natural); - /* do not use priv->event_box here, otherwise it'll not ellipsize */ + /* Do not use priv->event_box here, otherwise it won't ellipsize. */ } static void shell_sidebar_get_preferred_height (GtkWidget *widget, - gint *minimum, - gint *natural) + gint *minimum, + gint *natural) { EShellSidebarPrivate *priv; gint child_min, child_nat; @@ -252,8 +249,8 @@ shell_sidebar_get_preferred_height (GtkWidget *widget, child = priv->event_box; gtk_widget_get_preferred_height (child, &child_min, &child_nat); - *minimum += child_min; - *natural += child_nat; + *minimum += child_min; + *natural += child_nat; } static void diff --git a/shell/e-shell-utils.c b/shell/e-shell-utils.c index 9d2d4ca584..e5cd6c5546 100644 --- a/shell/e-shell-utils.c +++ b/shell/e-shell-utils.c @@ -44,13 +44,9 @@ void e_shell_configure_ui_manager (EShell *shell, EUIManager *ui_manager) { - EShellSettings *shell_settings; - g_return_if_fail (E_IS_SHELL (shell)); g_return_if_fail (E_IS_UI_MANAGER (ui_manager)); - shell_settings = e_shell_get_shell_settings (shell); - g_object_bind_property ( shell, "express-mode", ui_manager, "express-mode", -- cgit v1.2.3 From c2954322eb09c096b66d62142963e244005f66b6 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 11 Feb 2011 14:46:13 +0100 Subject: Bug #638057 - Evolution --express doesn't remember status bar setting --- shell/e-shell-window-private.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c index 1c9ee99de0..6ad1875bd0 100644 --- a/shell/e-shell-window-private.c +++ b/shell/e-shell-window-private.c @@ -427,19 +427,13 @@ e_shell_window_private_constructed (EShellWindow *shell_window) key = "/apps/evolution/shell/view_defaults/sidebar_visible"; gconf_bridge_bind_property (bridge, key, object, "sidebar-visible"); - if (e_shell_get_express_mode (shell)) { - const gchar *active_view; - gboolean taskbar_visible; + object = G_OBJECT (shell_window); + key = "/apps/evolution/shell/view_defaults/statusbar_visible"; + gconf_bridge_bind_property (bridge, key, object, "taskbar-visible"); - active_view = e_shell_window_get_active_view (shell_window); - taskbar_visible = (g_strcmp0 (active_view, "mail") == 0); + if (e_shell_get_express_mode (shell)) { e_shell_window_set_switcher_visible (shell_window, FALSE); - e_shell_window_set_taskbar_visible (shell_window, taskbar_visible); } else { - object = G_OBJECT (shell_window); - key = "/apps/evolution/shell/view_defaults/statusbar_visible"; - gconf_bridge_bind_property (bridge, key, object, "taskbar-visible"); - object = G_OBJECT (shell_window); key = "/apps/evolution/shell/view_defaults/buttons_visible"; gconf_bridge_bind_property (bridge, key, object, "switcher-visible"); -- cgit v1.2.3 From 7a1677520d439aee68c5ab0268a951d0b411e3a0 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 12 Feb 2011 11:37:05 -0500 Subject: Remove NULL checks for GObject methods. As of GLib 2.28 all GObject virtual methods, including constructed(), are safe to chain up to unconditionally. Remove unnecessary checks. --- shell/e-shell-content.c | 4 ++-- shell/e-shell-searchbar.c | 4 ++-- shell/e-shell-sidebar.c | 4 ++-- shell/e-shell-taskbar.c | 4 ++-- shell/e-shell-view.c | 4 ++-- shell/e-shell-window.c | 4 ++-- shell/e-shell.c | 4 ++-- shell/test/e-test-shell-backend.c | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index ccd121fa48..5b53fb5334 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -208,8 +208,8 @@ shell_content_constructed (GObject *object) e_extensible_load_extensions (E_EXTENSIBLE (object)); - if (G_OBJECT_CLASS (e_shell_content_parent_class)->constructed) - G_OBJECT_CLASS (e_shell_content_parent_class)->constructed (object); + /* Chain up to parent's constructed() method. */ + G_OBJECT_CLASS (e_shell_content_parent_class)->constructed (object); } static void diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c index 9244d792a7..4b7dc88ae2 100644 --- a/shell/e-shell-searchbar.c +++ b/shell/e-shell-searchbar.c @@ -735,8 +735,8 @@ shell_searchbar_constructed (GObject *object) e_extensible_load_extensions (E_EXTENSIBLE (object)); - if (G_OBJECT_CLASS (e_shell_searchbar_parent_class)->constructed) - G_OBJECT_CLASS (e_shell_searchbar_parent_class)->constructed (object); + /* Chain up to parent's constructed() method. */ + G_OBJECT_CLASS (e_shell_searchbar_parent_class)->constructed (object); } static void diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c index b8ee23b6d0..ed5567e406 100644 --- a/shell/e-shell-sidebar.c +++ b/shell/e-shell-sidebar.c @@ -215,8 +215,8 @@ shell_sidebar_constructed (GObject *object) e_extensible_load_extensions (E_EXTENSIBLE (object)); - if (G_OBJECT_CLASS (e_shell_sidebar_parent_class)->constructed) - G_OBJECT_CLASS (e_shell_sidebar_parent_class)->constructed (object); + /* Chain up to parent's constructed() method. */ + G_OBJECT_CLASS (e_shell_sidebar_parent_class)->constructed (object); } static void diff --git a/shell/e-shell-taskbar.c b/shell/e-shell-taskbar.c index 41863b6750..8b8cc1d4a7 100644 --- a/shell/e-shell-taskbar.c +++ b/shell/e-shell-taskbar.c @@ -273,8 +273,8 @@ shell_taskbar_constructed (GObject *object) e_extensible_load_extensions (E_EXTENSIBLE (object)); - if (G_OBJECT_CLASS (e_shell_taskbar_parent_class)->constructed) - G_OBJECT_CLASS (e_shell_taskbar_parent_class)->constructed (object); + /* Chain up to parent's constructed() method. */ + G_OBJECT_CLASS (e_shell_taskbar_parent_class)->constructed (object); } static void diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index cb682b7814..e513eea681 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -607,8 +607,8 @@ shell_view_constructed (GObject *object) e_extensible_load_extensions (E_EXTENSIBLE (object)); - if (G_OBJECT_CLASS (parent_class)->constructed) - G_OBJECT_CLASS (parent_class)->constructed (object); + /* Chain up to parent's constructed() method. */ + G_OBJECT_CLASS (parent_class)->constructed (object); } static GtkWidget * diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index 0ca0a5a541..25986f07a7 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -344,8 +344,8 @@ shell_window_constructed (GObject *object) e_shell_get_small_screen_mode (shell_window->priv->shell)) gtk_window_set_decorated (GTK_WINDOW (object), FALSE); - if (G_OBJECT_CLASS (e_shell_window_parent_class)->constructed) - G_OBJECT_CLASS (e_shell_window_parent_class)->constructed (object); + /* Chain up to parent's constructed() method. */ + G_OBJECT_CLASS (e_shell_window_parent_class)->constructed (object); } static GtkWidget * diff --git a/shell/e-shell.c b/shell/e-shell.c index 123a9751e7..82ccf6df9e 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -713,8 +713,8 @@ shell_constructed (GObject *object) if (!unique_app_is_running (UNIQUE_APP (object))) e_file_lock_create (); - if (G_OBJECT_CLASS (e_shell_parent_class)->constructed) - G_OBJECT_CLASS (e_shell_parent_class)->constructed (object); + /* Chain up to parent's constructed() method. */ + G_OBJECT_CLASS (e_shell_parent_class)->constructed (object); } static UniqueResponse diff --git a/shell/test/e-test-shell-backend.c b/shell/test/e-test-shell-backend.c index 2891f53b64..983b40e8d9 100644 --- a/shell/test/e-test-shell-backend.c +++ b/shell/test/e-test-shell-backend.c @@ -152,8 +152,8 @@ test_shell_backend_constructed (GObject *object) G_CALLBACK (test_shell_backend_window_destroyed_cb), shell_backend); - if (G_OBJECT_CLASS (parent_class)->constructed) - G_OBJECT_CLASS (parent_class)->constructed (object); + /* Chain up to parent's constructed() method. */ + G_OBJECT_CLASS (parent_class)->constructed (object); } static void -- cgit v1.2.3 From 1afbba4a8b49c9911337f42d040608a8e35e6577 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 12 Feb 2011 13:40:33 -0500 Subject: Bug 642171 - Implicit libgnome dependency for lockdown GConf keys Lockdown keys have moved to gsettings-desktop-schemas, so disable lockdown integration until we're ready for GSettings. --- shell/e-shell-utils.c | 4 ++++ shell/e-shell-window-private.c | 4 ++++ shell/e-shell.c | 4 ++++ 3 files changed, 12 insertions(+) (limited to 'shell') diff --git a/shell/e-shell-utils.c b/shell/e-shell-utils.c index e5cd6c5546..327033d514 100644 --- a/shell/e-shell-utils.c +++ b/shell/e-shell-utils.c @@ -72,6 +72,9 @@ e_shell_configure_web_view (EShell *shell, shell_settings = e_shell_get_shell_settings (shell); +#if 0 /* XXX Lockdown keys have moved to gsettings-desktop-scheams, + * so disable lockdown integration until we're ready for + * GSettings. */ #ifndef G_OS_WIN32 g_object_bind_property ( shell_settings, "disable-printing", @@ -83,6 +86,7 @@ e_shell_configure_web_view (EShell *shell, web_view, "disable-save-to-disk", G_BINDING_SYNC_CREATE); #endif +#endif } /** diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c index 6ad1875bd0..1f12c9c41e 100644 --- a/shell/e-shell-window-private.c +++ b/shell/e-shell-window-private.c @@ -356,6 +356,9 @@ e_shell_window_private_constructed (EShellWindow *shell_window) shell_window, "notify::active-view", G_CALLBACK (e_shell_window_update_search_menu), NULL); +#if 0 /* XXX Lockdown keys have moved to gsettings-desktop-schemas, + * so disable lockdown integration until we're ready for + * GSettings. */ #ifndef G_OS_WIN32 /* Support lockdown. */ @@ -382,6 +385,7 @@ e_shell_window_private_constructed (EShellWindow *shell_window) action_group, "visible", G_BINDING_SYNC_CREATE | G_BINDING_INVERT_BOOLEAN); +#endif /* G_OS_WIN32 */ #endif /* Bind GObject properties to GObject properties. */ diff --git a/shell/e-shell.c b/shell/e-shell.c index 82ccf6df9e..6e37e7e533 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -1213,6 +1213,9 @@ e_shell_init (EShell *shell) "start-offline", "/apps/evolution/shell/start_offline"); +#if 0 /* XXX Lockdown keys have moved to gsettings-desktop-schemas, + * so disable lockdown integration until we're ready for + * GSettings. */ #ifndef G_OS_WIN32 e_shell_settings_install_property_for_key ( "disable-application-handlers", @@ -1234,6 +1237,7 @@ e_shell_init (EShell *shell) "disable-save-to-disk", "/desktop/gnome/lockdown/disable_save_to_disk"); #endif /* G_OS_WIN32 */ +#endif /*** Session Management ***/ -- cgit v1.2.3 From 4b9ac3879d25d14cbaaab9237626257c3561f7ff Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 14 Feb 2011 19:15:36 +0100 Subject: Fix few memory leaks --- shell/e-shell-view.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index e513eea681..87ec90d058 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -108,8 +108,6 @@ shell_view_init_search_context (EShellViewClass *class) { EShellBackend *shell_backend; ERuleContext *search_context; - EFilterRule *rule; - EFilterPart *part; const gchar *config_dir; gchar *system_filename; gchar *user_filename; @@ -145,15 +143,6 @@ shell_view_init_search_context (EShellViewClass *class) e_rule_context_add_rule, e_rule_context_next_rule); e_rule_context_load (search_context, system_filename, user_filename); - rule = e_filter_rule_new (); - part = e_rule_context_next_part (search_context, NULL); - if (part == NULL) - g_warning ( - "Could not load %s search: no parts", - G_OBJECT_CLASS_NAME (class)); - else - e_filter_rule_add_part (rule, e_filter_part_clone (part)); - g_free (system_filename); g_free (user_filename); } -- cgit v1.2.3 From 94e43758de5e90ff3acf70654a53ddf787495f1b Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 16 Feb 2011 13:14:49 +0100 Subject: Bug #638333 - Critical warning when invoking File->New->Mail Folder --- shell/e-shell-window-private.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'shell') diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c index 1f12c9c41e..6dcba975bc 100644 --- a/shell/e-shell-window-private.c +++ b/shell/e-shell-window-private.c @@ -266,7 +266,9 @@ e_shell_window_private_constructed (EShellWindow *shell_window) GConfBridge *bridge; GtkAction *action; GtkAccelGroup *accel_group; +#if 0 GtkActionGroup *action_group; +#endif GtkUIManager *ui_manager; GtkBox *box; GtkPaned *paned; -- cgit v1.2.3 From fcb29478f605deb787c62fc7567c5c7f897585bb Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 18 Feb 2011 19:35:59 -0500 Subject: Coding style and whitespace cleanup. --- shell/e-shell-utils.c | 6 +++--- shell/e-shell-window-private.c | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-utils.c b/shell/e-shell-utils.c index 327033d514..b1de7119a8 100644 --- a/shell/e-shell-utils.c +++ b/shell/e-shell-utils.c @@ -65,6 +65,9 @@ void e_shell_configure_web_view (EShell *shell, EWebView *web_view) { +#if 0 /* XXX Lockdown keys have moved to gsettings-desktop-scheams, + * so disable lockdown integration until we're ready for + * GSettings. */ EShellSettings *shell_settings; g_return_if_fail (E_IS_SHELL (shell)); @@ -72,9 +75,6 @@ e_shell_configure_web_view (EShell *shell, shell_settings = e_shell_get_shell_settings (shell); -#if 0 /* XXX Lockdown keys have moved to gsettings-desktop-scheams, - * so disable lockdown integration until we're ready for - * GSettings. */ #ifndef G_OS_WIN32 g_object_bind_property ( shell_settings, "disable-printing", diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c index 6dcba975bc..db2bf069a9 100644 --- a/shell/e-shell-window-private.c +++ b/shell/e-shell-window-private.c @@ -261,7 +261,9 @@ void e_shell_window_private_constructed (EShellWindow *shell_window) { EShellWindowPrivate *priv = shell_window->priv; +#if 0 EShellSettings *shell_settings; +#endif EShell *shell; GConfBridge *bridge; GtkAction *action; @@ -282,7 +284,9 @@ e_shell_window_private_constructed (EShellWindow *shell_window) window = GTK_WINDOW (shell_window); shell = e_shell_window_get_shell (shell_window); +#if 0 shell_settings = e_shell_get_shell_settings (shell); +#endif ui_manager = e_shell_window_get_ui_manager (shell_window); e_shell_configure_ui_manager (shell, E_UI_MANAGER (ui_manager)); -- cgit v1.2.3 From fde6eab197d3e3c253d8479eb9bd1a377a426fa4 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 24 Feb 2011 13:24:15 +0100 Subject: Write state.ini immediately in EShellView::dispose method --- shell/e-shell-view.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 87ec90d058..6911b54f59 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -247,7 +247,7 @@ shell_view_save_state_done_cb (GFile *file, } static EActivity * -shell_view_save_state (EShellView *shell_view) +shell_view_save_state (EShellView *shell_view, gboolean immediately) { EShellBackend *shell_backend; SaveStateData *data; @@ -266,6 +266,15 @@ shell_view_save_state (EShellView *shell_view) g_return_val_if_fail (contents != NULL, NULL); path = g_build_filename (config_dir, "state.ini", NULL); + if (immediately) { + g_file_set_contents (path, contents, -1, NULL); + + g_free (path); + g_free (contents); + + return NULL; + } + file = g_file_new_for_path (path); g_free (path); @@ -301,7 +310,7 @@ shell_view_state_timeout_cb (EShellView *shell_view) if (shell_view->priv->state_save_activity != NULL) return TRUE; - activity = shell_view_save_state (shell_view); + activity = shell_view_save_state (shell_view, FALSE); /* Set up a weak pointer that gets set to NULL when the * activity finishes. This will tell us if we're still @@ -496,7 +505,7 @@ shell_view_dispose (GObject *object) g_source_remove (priv->state_save_timeout_id); priv->state_save_timeout_id = 0; if (priv->state_save_activity == NULL) - shell_view_save_state (E_SHELL_VIEW (object)); + shell_view_save_state (E_SHELL_VIEW (object), TRUE); } if (priv->state_save_activity != NULL) { -- cgit v1.2.3 From 1301cf02efdacd20fb5ce3e2554ae15b8f146e8a Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 25 Feb 2011 16:20:41 +0100 Subject: Bug #614480 - Avoid using G_TYPE_INSTANCE_GET_PRIVATE repeatedly --- shell/e-shell-backend.c | 10 +++------- shell/e-shell-content.c | 20 ++++++++------------ shell/e-shell-searchbar.c | 8 ++------ shell/e-shell-settings.c | 12 ++++-------- shell/e-shell-sidebar.c | 16 ++++++---------- shell/e-shell-switcher.c | 18 +++++++----------- shell/e-shell-taskbar.c | 10 +++------- shell/e-shell-view.c | 10 +++------- shell/e-shell-window-private.h | 4 ---- shell/e-shell-window.c | 2 +- shell/e-shell.c | 10 +++------- shell/test/e-test-shell-backend.c | 7 +------ shell/test/e-test-shell-view.c | 11 +++-------- 13 files changed, 44 insertions(+), 94 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-backend.c b/shell/e-shell-backend.c index c2abb470a2..cd672842f1 100644 --- a/shell/e-shell-backend.c +++ b/shell/e-shell-backend.c @@ -37,10 +37,6 @@ #include "e-shell.h" #include "e-shell-view.h" -#define E_SHELL_BACKEND_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_SHELL_BACKEND, EShellBackendPrivate)) - struct _EShellBackendPrivate { /* We keep a reference to corresponding EShellView subclass @@ -171,7 +167,7 @@ shell_backend_dispose (GObject *object) { EShellBackendPrivate *priv; - priv = E_SHELL_BACKEND_GET_PRIVATE (object); + priv = E_SHELL_BACKEND (object)->priv; if (priv->shell_view_class != NULL) { g_type_class_unref (priv->shell_view_class); @@ -187,7 +183,7 @@ shell_backend_finalize (GObject *object) { EShellBackendPrivate *priv; - priv = E_SHELL_BACKEND_GET_PRIVATE (object); + priv = E_SHELL_BACKEND (object)->priv; g_warn_if_fail (g_queue_is_empty (priv->activities)); g_queue_free (priv->activities); @@ -294,7 +290,7 @@ e_shell_backend_class_init (EShellBackendClass *class) static void e_shell_backend_init (EShellBackend *shell_backend) { - shell_backend->priv = E_SHELL_BACKEND_GET_PRIVATE (shell_backend); + shell_backend->priv = G_TYPE_INSTANCE_GET_PRIVATE (shell_backend, E_TYPE_SHELL_BACKEND, EShellBackendPrivate); shell_backend->priv->activities = g_queue_new (); } diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index 5b53fb5334..96e56f75a9 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -44,10 +44,6 @@ #include "e-shell-view.h" #include "e-shell-window-actions.h" -#define E_SHELL_CONTENT_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_SHELL_CONTENT, EShellContentPrivate)) - struct _EShellContentPrivate { gpointer shell_view; /* weak pointer */ @@ -150,7 +146,7 @@ shell_content_dispose (GObject *object) { EShellContentPrivate *priv; - priv = E_SHELL_CONTENT_GET_PRIVATE (object); + priv = E_SHELL_CONTENT (object)->priv; if (priv->shell_view != NULL) { g_object_remove_weak_pointer ( @@ -172,7 +168,7 @@ shell_content_finalize (GObject *object) { EShellContentPrivate *priv; - priv = E_SHELL_CONTENT_GET_PRIVATE (object); + priv = E_SHELL_CONTENT (object)->priv; g_free (priv->user_filename); @@ -222,7 +218,7 @@ shell_content_get_preferred_width (GtkWidget *widget, gint child_min, child_nat; GtkWidget *child; - priv = E_SHELL_CONTENT_GET_PRIVATE (widget); + priv = E_SHELL_CONTENT (widget)->priv; *minimum = *natural = 0; @@ -250,7 +246,7 @@ shell_content_get_preferred_height (GtkWidget *widget, gint min, nat; GtkWidget *child; - priv = E_SHELL_CONTENT_GET_PRIVATE (widget); + priv = E_SHELL_CONTENT (widget)->priv; child = gtk_bin_get_child (GTK_BIN (widget)); gtk_widget_get_preferred_height (child, minimum, natural); @@ -273,7 +269,7 @@ shell_content_size_allocate (GtkWidget *widget, GtkWidget *child; gint remaining_height; - priv = E_SHELL_CONTENT_GET_PRIVATE (widget); + priv = E_SHELL_CONTENT (widget)->priv; remaining_height = allocation->height; gtk_widget_set_allocation (widget, allocation); @@ -332,7 +328,7 @@ shell_content_remove (GtkContainer *container, GtkContainerClass *container_class; EShellContentPrivate *priv; - priv = E_SHELL_CONTENT_GET_PRIVATE (container); + priv = E_SHELL_CONTENT (container)->priv; if (widget == priv->alert_bar) { gtk_widget_unparent (priv->alert_bar); @@ -359,7 +355,7 @@ shell_content_forall (GtkContainer *container, { EShellContentPrivate *priv; - priv = E_SHELL_CONTENT_GET_PRIVATE (container); + priv = E_SHELL_CONTENT (container)->priv; if (priv->alert_bar != NULL) callback (priv->alert_bar, callback_data); @@ -470,7 +466,7 @@ e_shell_content_alert_sink_init (EAlertSinkInterface *interface) static void e_shell_content_init (EShellContent *shell_content) { - shell_content->priv = E_SHELL_CONTENT_GET_PRIVATE (shell_content); + shell_content->priv = G_TYPE_INSTANCE_GET_PRIVATE (shell_content, E_TYPE_SHELL_CONTENT, EShellContentPrivate); gtk_widget_set_has_window (GTK_WIDGET (shell_content), FALSE); } diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c index 4b7dc88ae2..97349f9b89 100644 --- a/shell/e-shell-searchbar.c +++ b/shell/e-shell-searchbar.c @@ -37,10 +37,6 @@ #include "e-shell-window-actions.h" -#define E_SHELL_SEARCHBAR_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_SHELL_SEARCHBAR, EShellSearchbarPrivate)) - #define SEARCH_OPTION_ADVANCED (-1) /* Default "state key file" group: [Search Bar] */ @@ -631,7 +627,7 @@ shell_searchbar_dispose (GObject *object) { EShellSearchbarPrivate *priv; - priv = E_SHELL_SEARCHBAR_GET_PRIVATE (object); + priv = E_SHELL_SEARCHBAR (object)->priv; if (priv->shell_view != NULL) { g_object_remove_weak_pointer ( @@ -913,7 +909,7 @@ e_shell_searchbar_init (EShellSearchbar *searchbar) GtkLabel *label; GtkWidget *widget; - searchbar->priv = E_SHELL_SEARCHBAR_GET_PRIVATE (searchbar); + searchbar->priv = G_TYPE_INSTANCE_GET_PRIVATE (searchbar, E_TYPE_SHELL_SEARCHBAR, EShellSearchbarPrivate); gtk_box_set_spacing (GTK_BOX (searchbar), 24); diff --git a/shell/e-shell-settings.c b/shell/e-shell-settings.c index 9503f967f7..c8a507e630 100644 --- a/shell/e-shell-settings.c +++ b/shell/e-shell-settings.c @@ -29,10 +29,6 @@ #include "e-util/gconf-bridge.h" -#define E_SHELL_SETTINGS_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_SHELL_SETTINGS, EShellSettingsPrivate)) - struct _EShellSettingsPrivate { GArray *value_array; guint debug : 1; @@ -180,7 +176,7 @@ shell_settings_set_property (GObject *object, EShellSettingsPrivate *priv; GValue *dest_value; - priv = E_SHELL_SETTINGS_GET_PRIVATE (object); + priv = E_SHELL_SETTINGS (object)->priv; dest_value = &g_array_index ( priv->value_array, GValue, property_id - 1); @@ -208,7 +204,7 @@ shell_settings_get_property (GObject *object, EShellSettingsPrivate *priv; GValue *src_value; - priv = E_SHELL_SETTINGS_GET_PRIVATE (object); + priv = E_SHELL_SETTINGS (object)->priv; src_value = &g_array_index ( priv->value_array, GValue, property_id - 1); @@ -222,7 +218,7 @@ shell_settings_finalize (GObject *object) EShellSettingsPrivate *priv; guint ii; - priv = E_SHELL_SETTINGS_GET_PRIVATE (object); + priv = E_SHELL_SETTINGS (object)->priv; for (ii = 0; ii < priv->value_array->len; ii++) g_value_unset (&g_array_index (priv->value_array, GValue, ii)); @@ -260,7 +256,7 @@ shell_settings_init (EShellSettings *shell_settings, value_array = g_array_new (FALSE, TRUE, sizeof (GValue)); g_array_set_size (value_array, property_count); - shell_settings->priv = E_SHELL_SETTINGS_GET_PRIVATE (shell_settings); + shell_settings->priv = G_TYPE_INSTANCE_GET_PRIVATE (shell_settings, E_TYPE_SHELL_SETTINGS, EShellSettingsPrivate); shell_settings->priv->value_array = value_array; g_object_freeze_notify (G_OBJECT (shell_settings)); diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c index ed5567e406..1a9f7d7c22 100644 --- a/shell/e-shell-sidebar.c +++ b/shell/e-shell-sidebar.c @@ -31,10 +31,6 @@ #include #include -#define E_SHELL_SIDEBAR_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_SHELL_SIDEBAR, EShellSidebarPrivate)) - struct _EShellSidebarPrivate { gpointer shell_view; /* weak pointer */ @@ -149,7 +145,7 @@ shell_sidebar_dispose (GObject *object) { EShellSidebarPrivate *priv; - priv = E_SHELL_SIDEBAR_GET_PRIVATE (object); + priv = E_SHELL_SIDEBAR (object)->priv; if (priv->shell_view != NULL) { g_object_remove_weak_pointer ( @@ -176,7 +172,7 @@ shell_sidebar_finalize (GObject *object) { EShellSidebarPrivate *priv; - priv = E_SHELL_SIDEBAR_GET_PRIVATE (object); + priv = E_SHELL_SIDEBAR (object)->priv; g_free (priv->icon_name); g_free (priv->primary_text); @@ -241,7 +237,7 @@ shell_sidebar_get_preferred_height (GtkWidget *widget, gint child_min, child_nat; GtkWidget *child; - priv = E_SHELL_SIDEBAR_GET_PRIVATE (widget); + priv = E_SHELL_SIDEBAR (widget)->priv; child = gtk_bin_get_child (GTK_BIN (widget)); gtk_widget_get_preferred_height (child, minimum, natural); @@ -262,7 +258,7 @@ shell_sidebar_size_allocate (GtkWidget *widget, GtkRequisition child_requisition; GtkWidget *child; - priv = E_SHELL_SIDEBAR_GET_PRIVATE (widget); + priv = E_SHELL_SIDEBAR (widget)->priv; gtk_widget_set_allocation (widget, allocation); @@ -293,7 +289,7 @@ shell_sidebar_forall (GtkContainer *container, { EShellSidebarPrivate *priv; - priv = E_SHELL_SIDEBAR_GET_PRIVATE (container); + priv = E_SHELL_SIDEBAR (container)->priv; if (include_internals && callback && priv->event_box) callback (priv->event_box, callback_data); @@ -401,7 +397,7 @@ e_shell_sidebar_init (EShellSidebar *shell_sidebar) const GdkColor *color; const gchar *icon_name; - shell_sidebar->priv = E_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar); + shell_sidebar->priv = G_TYPE_INSTANCE_GET_PRIVATE (shell_sidebar, E_TYPE_SHELL_SIDEBAR, EShellSidebarPrivate); gtk_widget_set_has_window (GTK_WIDGET (shell_sidebar), FALSE); diff --git a/shell/e-shell-switcher.c b/shell/e-shell-switcher.c index f785054c08..b1d896dee0 100644 --- a/shell/e-shell-switcher.c +++ b/shell/e-shell-switcher.c @@ -30,10 +30,6 @@ #include #include -#define E_SHELL_SWITCHER_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_SHELL_SWITCHER, EShellSwitcherPrivate)) - #define H_PADDING 6 #define V_PADDING 6 @@ -235,7 +231,7 @@ shell_switcher_dispose (GObject *object) { EShellSwitcherPrivate *priv; - priv = E_SHELL_SWITCHER_GET_PRIVATE (object); + priv = E_SHELL_SWITCHER (object)->priv; while (priv->proxies != NULL) { GtkWidget *widget = priv->proxies->data; @@ -255,7 +251,7 @@ shell_switcher_get_preferred_width (GtkWidget *widget, GtkWidget *child; GList *iter; - priv = E_SHELL_SWITCHER_GET_PRIVATE (widget); + priv = E_SHELL_SWITCHER (widget)->priv; *minimum = *natural = 0; @@ -290,7 +286,7 @@ shell_switcher_get_preferred_height (GtkWidget *widget, GtkWidget *child; GList *iter; - priv = E_SHELL_SWITCHER_GET_PRIVATE (widget); + priv = E_SHELL_SWITCHER (widget)->priv; *minimum = *natural = 0; @@ -351,7 +347,7 @@ shell_switcher_screen_changed (GtkWidget *widget, EShellSwitcherPrivate *priv; GtkSettings *settings; - priv = E_SHELL_SWITCHER_GET_PRIVATE (widget); + priv = E_SHELL_SWITCHER (widget)->priv; if (gtk_widget_has_screen (widget)) settings = gtk_widget_get_settings (widget); @@ -386,7 +382,7 @@ shell_switcher_remove (GtkContainer *container, EShellSwitcherPrivate *priv; GList *link; - priv = E_SHELL_SWITCHER_GET_PRIVATE (container); + priv = E_SHELL_SWITCHER (container)->priv; /* Look in the internal widgets first. */ @@ -413,7 +409,7 @@ shell_switcher_forall (GtkContainer *container, { EShellSwitcherPrivate *priv; - priv = E_SHELL_SWITCHER_GET_PRIVATE (container); + priv = E_SHELL_SWITCHER (container)->priv; if (include_internals) g_list_foreach ( @@ -551,7 +547,7 @@ e_shell_switcher_class_init (EShellSwitcherClass *class) static void e_shell_switcher_init (EShellSwitcher *switcher) { - switcher->priv = E_SHELL_SWITCHER_GET_PRIVATE (switcher); + switcher->priv = G_TYPE_INSTANCE_GET_PRIVATE (switcher, E_TYPE_SHELL_SWITCHER, EShellSwitcherPrivate); gtk_widget_set_has_window (GTK_WIDGET (switcher), FALSE); diff --git a/shell/e-shell-taskbar.c b/shell/e-shell-taskbar.c index 8b8cc1d4a7..f4621fc780 100644 --- a/shell/e-shell-taskbar.c +++ b/shell/e-shell-taskbar.c @@ -32,10 +32,6 @@ #include #include -#define E_SHELL_TASKBAR_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_SHELL_TASKBAR, EShellTaskbarPrivate)) - struct _EShellTaskbarPrivate { gpointer shell_view; /* weak pointer */ @@ -202,7 +198,7 @@ shell_taskbar_dispose (GObject *object) { EShellTaskbarPrivate *priv; - priv = E_SHELL_TASKBAR_GET_PRIVATE (object); + priv = E_SHELL_TASKBAR (object)->priv; g_hash_table_foreach_remove ( priv->proxy_table, (GHRFunc) @@ -241,7 +237,7 @@ shell_taskbar_finalize (GObject *object) { EShellTaskbarPrivate *priv; - priv = E_SHELL_TASKBAR_GET_PRIVATE (object); + priv = E_SHELL_TASKBAR (object)->priv; g_hash_table_destroy (priv->proxy_table); @@ -330,7 +326,7 @@ e_shell_taskbar_init (EShellTaskbar *shell_taskbar) GtkWidget *widget; gint height; - shell_taskbar->priv = E_SHELL_TASKBAR_GET_PRIVATE (shell_taskbar); + shell_taskbar->priv = G_TYPE_INSTANCE_GET_PRIVATE (shell_taskbar, E_TYPE_SHELL_TASKBAR, EShellTaskbarPrivate); shell_taskbar->priv->proxy_table = g_hash_table_new (NULL, NULL); gtk_box_set_spacing (GTK_BOX (shell_taskbar), 12); diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 6911b54f59..379b5ab528 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -41,10 +41,6 @@ #include "e-shell-searchbar.h" #include "e-shell-window-actions.h" -#define E_SHELL_VIEW_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_SHELL_VIEW, EShellViewPrivate)) - #define SIMPLE_SEARCHBAR_WIDTH 300 #define STATE_SAVE_TIMEOUT_SECONDS 3 @@ -498,7 +494,7 @@ shell_view_dispose (GObject *object) { EShellViewPrivate *priv; - priv = E_SHELL_VIEW_GET_PRIVATE (object); + priv = E_SHELL_VIEW (object)->priv; /* Expedite any pending state saves. */ if (priv->state_save_timeout_id > 0) { @@ -555,7 +551,7 @@ shell_view_finalize (GObject *object) { EShellViewPrivate *priv; - priv = E_SHELL_VIEW_GET_PRIVATE (object); + priv = E_SHELL_VIEW (object)->priv; g_key_file_free (priv->state_key_file); @@ -1082,7 +1078,7 @@ e_shell_view_init (EShellView *shell_view, size_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL); - shell_view->priv = E_SHELL_VIEW_GET_PRIVATE (shell_view); + shell_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (shell_view, E_TYPE_SHELL_VIEW, EShellViewPrivate); shell_view->priv->state_key_file = g_key_file_new (); shell_view->priv->size_group = size_group; } diff --git a/shell/e-shell-window-private.h b/shell/e-shell-window-private.h index 3faf3be50c..6a9744d971 100644 --- a/shell/e-shell-window-private.h +++ b/shell/e-shell-window-private.h @@ -49,10 +49,6 @@ #include #include -#define E_SHELL_WINDOW_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_SHELL_WINDOW, EShellWindowPrivate)) - /* Shorthand, requires a variable named "shell_window". */ #define ACTION(name) \ (E_SHELL_WINDOW_ACTION_##name (shell_window)) diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index 25986f07a7..c62bd6411a 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -947,7 +947,7 @@ e_shell_window_alert_sink_init (EAlertSinkInterface *interface) static void e_shell_window_init (EShellWindow *shell_window) { - shell_window->priv = E_SHELL_WINDOW_GET_PRIVATE (shell_window); + shell_window->priv = G_TYPE_INSTANCE_GET_PRIVATE (shell_window, E_TYPE_SHELL_WINDOW, EShellWindowPrivate); e_shell_window_private_init (shell_window); } diff --git a/shell/e-shell.c b/shell/e-shell.c index 6e37e7e533..79ca26cb1c 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -42,10 +42,6 @@ #include "e-shell-window.h" #include "e-shell-utils.h" -#define E_SHELL_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_SHELL, EShellPrivate)) - struct _EShellPrivate { GQueue alerts; GList *watched_windows; @@ -639,7 +635,7 @@ shell_dispose (GObject *object) EShellPrivate *priv; EAlert *alert; - priv = E_SHELL_GET_PRIVATE (object); + priv = E_SHELL (object)->priv; while ((alert = g_queue_pop_head (&priv->alerts)) != NULL) { g_signal_handlers_disconnect_by_func ( @@ -682,7 +678,7 @@ shell_finalize (GObject *object) { EShellPrivate *priv; - priv = E_SHELL_GET_PRIVATE (object); + priv = E_SHELL (object)->priv; g_hash_table_destroy (priv->backends_by_name); g_hash_table_destroy (priv->backends_by_scheme); @@ -1173,7 +1169,7 @@ e_shell_init (EShell *shell) GtkIconTheme *icon_theme; EggSMClient *sm_client; - shell->priv = E_SHELL_GET_PRIVATE (shell); + shell->priv = G_TYPE_INSTANCE_GET_PRIVATE (shell, E_TYPE_SHELL, EShellPrivate); backends_by_name = g_hash_table_new (g_str_hash, g_str_equal); backends_by_scheme = g_hash_table_new (g_str_hash, g_str_equal); diff --git a/shell/test/e-test-shell-backend.c b/shell/test/e-test-shell-backend.c index 983b40e8d9..9e5f757490 100644 --- a/shell/test/e-test-shell-backend.c +++ b/shell/test/e-test-shell-backend.c @@ -28,10 +28,6 @@ #include "e-test-shell-view.h" -#define E_TEST_SHELL_BACKEND_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_TEST_SHELL_BACKEND, ETestShellBackendPrivate)) - struct _ETestShellBackendPrivate { gint placeholder; }; @@ -182,8 +178,7 @@ test_shell_backend_class_init (ETestShellBackendClass *class) static void test_shell_backend_init (ETestShellBackend *test_shell_backend) { - test_shell_backend->priv = - E_TEST_SHELL_BACKEND_GET_PRIVATE (test_shell_backend); + test_shell_backend->priv = G_TYPE_INSTANCE_GET_PRIVATE (test_shell_backend, E_TYPE_TEST_SHELL_BACKEND, ETestShellBackendPrivate); } GType diff --git a/shell/test/e-test-shell-view.c b/shell/test/e-test-shell-view.c index 68d4ff9a7b..7080009dd4 100644 --- a/shell/test/e-test-shell-view.c +++ b/shell/test/e-test-shell-view.c @@ -24,10 +24,6 @@ #include "shell/e-shell-content.h" #include "shell/e-shell-sidebar.h" -#define E_TEST_SHELL_VIEW_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE \ - ((obj), E_TYPE_TEST_SHELL_VIEW, ETestShellViewPrivate)) - struct _ETestShellViewPrivate { EActivity *activity; }; @@ -53,7 +49,7 @@ test_shell_view_dispose (GObject *object) { ETestShellViewPrivate *priv; - priv = E_TEST_SHELL_VIEW_GET_PRIVATE (object); + priv = E_TEST_SHELL_VIEW (object)->priv; if (priv->activity != NULL) { e_activity_set_state (priv->activity, E_ACTIVITY_COMPLETED); @@ -80,7 +76,7 @@ test_shell_view_constructed (GObject *object) /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (parent_class)->constructed (object); - priv = E_TEST_SHELL_VIEW_GET_PRIVATE (object); + priv = E_TEST_SHELL_VIEW (object)->priv; shell_view = E_SHELL_VIEW (object); shell_backend = e_shell_view_get_shell_backend (shell_view); @@ -127,8 +123,7 @@ test_shell_view_class_init (ETestShellViewClass *class, static void test_shell_view_init (ETestShellView *test_shell_view) { - test_shell_view->priv = - E_TEST_SHELL_VIEW_GET_PRIVATE (test_shell_view); + test_shell_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (test_shell_view, E_TYPE_TEST_SHELL_VIEW, ETestShellViewPrivate); } GType -- cgit v1.2.3 From 8e33ff0fbb5908d06c9f32f58f35eca694b3f50c Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 3 Mar 2011 11:26:41 +0100 Subject: Merge duplicate local sources --- shell/e-shell-migrate.c | 88 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) (limited to 'shell') diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c index 878b121488..01b3f9f10e 100644 --- a/shell/e-shell-migrate.c +++ b/shell/e-shell-migrate.c @@ -793,6 +793,87 @@ fix_folder_permissions (const gchar *data_dir) change_dir_modes (data_dir); } +static void +merge_duplicate_local_sources (GConfClient *client, const gchar *gconf_key) +{ + ESourceList *source_list; + GSList *iter, *to_remove = NULL; + ESourceGroup *first_local = NULL; + + g_return_if_fail (client != NULL); + g_return_if_fail (gconf_key != NULL); + + source_list = e_source_list_new_for_gconf (client, gconf_key); + + for (iter = e_source_list_peek_groups (source_list); iter; iter = iter->next) { + GSList *sources; + ESourceGroup *group = iter->data; + + if (!group || !e_source_group_peek_base_uri (group) + || g_ascii_strncasecmp (e_source_group_peek_base_uri (group), "local:", 6) != 0) + continue; + + if (!first_local) { + first_local = group; + continue; + } + + /* merging respective sources */ + for (sources = e_source_group_peek_sources (group); sources; sources = sources->next) { + GSList *liter; + ESource *dupe_source = sources->data; + + if (!dupe_source) + continue; + + for (liter = e_source_group_peek_sources (first_local); liter != NULL; liter = liter->next) { + ESource *my_source = liter->data; + const gchar *val1, *val2; + + if (!my_source) + continue; + + /* pretty unlikely, but just in case */ + val1 = e_source_peek_uid (dupe_source); + val2 = e_source_peek_uid (my_source); + if (g_strcmp0 (val1, val2) == 0) + break; + + /* relative uri should not be empty (but adressbook can have it empty) */ + val1 = e_source_peek_relative_uri (dupe_source); + val2 = e_source_peek_relative_uri (my_source); + if (g_strcmp0 (val1, val2) == 0 && val1 && *val1) + break; + } + + /* didn't find matching source, thus add its copy */ + if (liter == NULL) { + ESource *copy; + + copy = e_source_copy (dupe_source); + e_source_group_add_source (first_local, copy, -1); + g_object_unref (copy); + } + } + + to_remove = g_slist_prepend (to_remove, group); + } + + if (!to_remove) { + g_object_unref (source_list); + return; + } + + for (iter = to_remove; iter; iter = iter->next) { + e_source_list_remove_group (source_list, iter->data); + } + + e_source_list_sync (source_list, NULL); + + g_object_unref (source_list); + g_slist_free (to_remove); +} + gboolean e_shell_migrate_attempt (EShell *shell) { @@ -831,6 +912,13 @@ e_shell_migrate_attempt (EShell *shell) if (!shell_migrate_attempt (shell, major, minor, micro)) _exit (EXIT_SUCCESS); + /* The 2.32.x (except of 2.32.2) lefts duplicate On This Computer/Personal sources, + thus clean the mess up */ + merge_duplicate_local_sources (client, "/apps/evolution/addressbook/sources"); + merge_duplicate_local_sources (client, "/apps/evolution/calendar/sources"); + merge_duplicate_local_sources (client, "/apps/evolution/tasks/sources"); + merge_duplicate_local_sources (client, "/apps/evolution/memos/sources"); + /* Record a successful migration. */ string = g_strdup_printf ( "%d.%d.%d", curr_major, curr_minor, curr_micro); -- cgit v1.2.3 From 744f785a9c70b860a23c9d8982e755caf99c9b2c Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 4 Mar 2011 10:00:26 +0100 Subject: Do not flush Outbox when mail shell backend not started --- shell/e-shell-backend.c | 15 +++++++++++++++ shell/e-shell-backend.h | 1 + 2 files changed, 16 insertions(+) (limited to 'shell') diff --git a/shell/e-shell-backend.c b/shell/e-shell-backend.c index cd672842f1..03acc0ef04 100644 --- a/shell/e-shell-backend.c +++ b/shell/e-shell-backend.c @@ -507,6 +507,21 @@ e_shell_backend_start (EShellBackend *shell_backend) shell_backend->priv->started = TRUE; } +/** + * e_shell_backend_is_started: + * @shell_backend: an #EShellBackend + * + * Returns whether was shelll_backend already started, by + * calling e_shell_backend_start(). + **/ +gboolean +e_shell_backend_is_started (EShellBackend *shell_backend) +{ + g_return_val_if_fail (E_IS_SHELL_BACKEND (shell_backend), FALSE); + + return shell_backend->priv->started; +} + /** * e_shell_backend_migrate: * @shell_backend: an #EShellBackend diff --git a/shell/e-shell-backend.h b/shell/e-shell-backend.h index 1810c8c6e5..3364b16589 100644 --- a/shell/e-shell-backend.h +++ b/shell/e-shell-backend.h @@ -127,6 +127,7 @@ void e_shell_backend_add_activity (EShellBackend *shell_backend, gboolean e_shell_backend_is_busy (EShellBackend *shell_backend); void e_shell_backend_cancel_all (EShellBackend *shell_backend); void e_shell_backend_start (EShellBackend *shell_backend); +gboolean e_shell_backend_is_started (EShellBackend *shell_backend); gboolean e_shell_backend_migrate (EShellBackend *shell_backend, gint major, gint minor, -- cgit v1.2.3 From c6fd77460f5baf88528f5da2ffb99e86a2885ff0 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 5 Mar 2011 12:33:49 -0500 Subject: Coding style and whitespace cleanup. --- shell/e-shell-backend.c | 3 ++- shell/e-shell-content.c | 3 ++- shell/e-shell-migrate.c | 6 ++++-- shell/e-shell-searchbar.c | 3 ++- shell/e-shell-settings.c | 3 ++- shell/e-shell-sidebar.c | 3 ++- shell/e-shell-switcher.c | 3 ++- shell/e-shell-taskbar.c | 3 ++- shell/e-shell-view.c | 3 ++- shell/e-shell-window.c | 3 ++- shell/e-shell.c | 3 ++- shell/test/e-test-shell-backend.c | 4 +++- shell/test/e-test-shell-view.c | 4 +++- 13 files changed, 30 insertions(+), 14 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-backend.c b/shell/e-shell-backend.c index 03acc0ef04..b1dadce99d 100644 --- a/shell/e-shell-backend.c +++ b/shell/e-shell-backend.c @@ -290,7 +290,8 @@ e_shell_backend_class_init (EShellBackendClass *class) static void e_shell_backend_init (EShellBackend *shell_backend) { - shell_backend->priv = G_TYPE_INSTANCE_GET_PRIVATE (shell_backend, E_TYPE_SHELL_BACKEND, EShellBackendPrivate); + shell_backend->priv = G_TYPE_INSTANCE_GET_PRIVATE ( + shell_backend, E_TYPE_SHELL_BACKEND, EShellBackendPrivate); shell_backend->priv->activities = g_queue_new (); } diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index 96e56f75a9..91a6d1f69b 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -466,7 +466,8 @@ e_shell_content_alert_sink_init (EAlertSinkInterface *interface) static void e_shell_content_init (EShellContent *shell_content) { - shell_content->priv = G_TYPE_INSTANCE_GET_PRIVATE (shell_content, E_TYPE_SHELL_CONTENT, EShellContentPrivate); + shell_content->priv = G_TYPE_INSTANCE_GET_PRIVATE ( + shell_content, E_TYPE_SHELL_CONTENT, EShellContentPrivate); gtk_widget_set_has_window (GTK_WIDGET (shell_content), FALSE); } diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c index 01b3f9f10e..fbcd701bea 100644 --- a/shell/e-shell-migrate.c +++ b/shell/e-shell-migrate.c @@ -819,14 +819,16 @@ merge_duplicate_local_sources (GConfClient *client, const gchar *gconf_key) } /* merging respective sources */ - for (sources = e_source_group_peek_sources (group); sources; sources = sources->next) { + for (sources = e_source_group_peek_sources (group); + sources != NULL; sources = sources->next) { GSList *liter; ESource *dupe_source = sources->data; if (!dupe_source) continue; - for (liter = e_source_group_peek_sources (first_local); liter != NULL; liter = liter->next) { + for (liter = e_source_group_peek_sources (first_local); + liter != NULL; liter = liter->next) { ESource *my_source = liter->data; const gchar *val1, *val2; diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c index 97349f9b89..7a0f3c7d42 100644 --- a/shell/e-shell-searchbar.c +++ b/shell/e-shell-searchbar.c @@ -909,7 +909,8 @@ e_shell_searchbar_init (EShellSearchbar *searchbar) GtkLabel *label; GtkWidget *widget; - searchbar->priv = G_TYPE_INSTANCE_GET_PRIVATE (searchbar, E_TYPE_SHELL_SEARCHBAR, EShellSearchbarPrivate); + searchbar->priv = G_TYPE_INSTANCE_GET_PRIVATE ( + searchbar, E_TYPE_SHELL_SEARCHBAR, EShellSearchbarPrivate); gtk_box_set_spacing (GTK_BOX (searchbar), 24); diff --git a/shell/e-shell-settings.c b/shell/e-shell-settings.c index c8a507e630..e43139acb4 100644 --- a/shell/e-shell-settings.c +++ b/shell/e-shell-settings.c @@ -256,7 +256,8 @@ shell_settings_init (EShellSettings *shell_settings, value_array = g_array_new (FALSE, TRUE, sizeof (GValue)); g_array_set_size (value_array, property_count); - shell_settings->priv = G_TYPE_INSTANCE_GET_PRIVATE (shell_settings, E_TYPE_SHELL_SETTINGS, EShellSettingsPrivate); + shell_settings->priv = G_TYPE_INSTANCE_GET_PRIVATE ( + shell_settings, E_TYPE_SHELL_SETTINGS, EShellSettingsPrivate); shell_settings->priv->value_array = value_array; g_object_freeze_notify (G_OBJECT (shell_settings)); diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c index 1a9f7d7c22..d99e66ac61 100644 --- a/shell/e-shell-sidebar.c +++ b/shell/e-shell-sidebar.c @@ -397,7 +397,8 @@ e_shell_sidebar_init (EShellSidebar *shell_sidebar) const GdkColor *color; const gchar *icon_name; - shell_sidebar->priv = G_TYPE_INSTANCE_GET_PRIVATE (shell_sidebar, E_TYPE_SHELL_SIDEBAR, EShellSidebarPrivate); + shell_sidebar->priv = G_TYPE_INSTANCE_GET_PRIVATE ( + shell_sidebar, E_TYPE_SHELL_SIDEBAR, EShellSidebarPrivate); gtk_widget_set_has_window (GTK_WIDGET (shell_sidebar), FALSE); diff --git a/shell/e-shell-switcher.c b/shell/e-shell-switcher.c index b1d896dee0..594862df8a 100644 --- a/shell/e-shell-switcher.c +++ b/shell/e-shell-switcher.c @@ -547,7 +547,8 @@ e_shell_switcher_class_init (EShellSwitcherClass *class) static void e_shell_switcher_init (EShellSwitcher *switcher) { - switcher->priv = G_TYPE_INSTANCE_GET_PRIVATE (switcher, E_TYPE_SHELL_SWITCHER, EShellSwitcherPrivate); + switcher->priv = G_TYPE_INSTANCE_GET_PRIVATE ( + switcher, E_TYPE_SHELL_SWITCHER, EShellSwitcherPrivate); gtk_widget_set_has_window (GTK_WIDGET (switcher), FALSE); diff --git a/shell/e-shell-taskbar.c b/shell/e-shell-taskbar.c index f4621fc780..c424d504c8 100644 --- a/shell/e-shell-taskbar.c +++ b/shell/e-shell-taskbar.c @@ -326,7 +326,8 @@ e_shell_taskbar_init (EShellTaskbar *shell_taskbar) GtkWidget *widget; gint height; - shell_taskbar->priv = G_TYPE_INSTANCE_GET_PRIVATE (shell_taskbar, E_TYPE_SHELL_TASKBAR, EShellTaskbarPrivate); + shell_taskbar->priv = G_TYPE_INSTANCE_GET_PRIVATE ( + shell_taskbar, E_TYPE_SHELL_TASKBAR, EShellTaskbarPrivate); shell_taskbar->priv->proxy_table = g_hash_table_new (NULL, NULL); gtk_box_set_spacing (GTK_BOX (shell_taskbar), 12); diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 379b5ab528..43d843108d 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -1078,7 +1078,8 @@ e_shell_view_init (EShellView *shell_view, size_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL); - shell_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (shell_view, E_TYPE_SHELL_VIEW, EShellViewPrivate); + shell_view->priv = G_TYPE_INSTANCE_GET_PRIVATE ( + shell_view, E_TYPE_SHELL_VIEW, EShellViewPrivate); shell_view->priv->state_key_file = g_key_file_new (); shell_view->priv->size_group = size_group; } diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index c62bd6411a..8c0258eb87 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -947,7 +947,8 @@ e_shell_window_alert_sink_init (EAlertSinkInterface *interface) static void e_shell_window_init (EShellWindow *shell_window) { - shell_window->priv = G_TYPE_INSTANCE_GET_PRIVATE (shell_window, E_TYPE_SHELL_WINDOW, EShellWindowPrivate); + shell_window->priv = G_TYPE_INSTANCE_GET_PRIVATE ( + shell_window, E_TYPE_SHELL_WINDOW, EShellWindowPrivate); e_shell_window_private_init (shell_window); } diff --git a/shell/e-shell.c b/shell/e-shell.c index 79ca26cb1c..f3402dd101 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -1169,7 +1169,8 @@ e_shell_init (EShell *shell) GtkIconTheme *icon_theme; EggSMClient *sm_client; - shell->priv = G_TYPE_INSTANCE_GET_PRIVATE (shell, E_TYPE_SHELL, EShellPrivate); + shell->priv = G_TYPE_INSTANCE_GET_PRIVATE ( + shell, E_TYPE_SHELL, EShellPrivate); backends_by_name = g_hash_table_new (g_str_hash, g_str_equal); backends_by_scheme = g_hash_table_new (g_str_hash, g_str_equal); diff --git a/shell/test/e-test-shell-backend.c b/shell/test/e-test-shell-backend.c index 9e5f757490..a30cb8a7b5 100644 --- a/shell/test/e-test-shell-backend.c +++ b/shell/test/e-test-shell-backend.c @@ -178,7 +178,9 @@ test_shell_backend_class_init (ETestShellBackendClass *class) static void test_shell_backend_init (ETestShellBackend *test_shell_backend) { - test_shell_backend->priv = G_TYPE_INSTANCE_GET_PRIVATE (test_shell_backend, E_TYPE_TEST_SHELL_BACKEND, ETestShellBackendPrivate); + test_shell_backend->priv = G_TYPE_INSTANCE_GET_PRIVATE ( + test_shell_backend, E_TYPE_TEST_SHELL_BACKEND, + ETestShellBackendPrivate); } GType diff --git a/shell/test/e-test-shell-view.c b/shell/test/e-test-shell-view.c index 7080009dd4..825e27fa37 100644 --- a/shell/test/e-test-shell-view.c +++ b/shell/test/e-test-shell-view.c @@ -123,7 +123,9 @@ test_shell_view_class_init (ETestShellViewClass *class, static void test_shell_view_init (ETestShellView *test_shell_view) { - test_shell_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (test_shell_view, E_TYPE_TEST_SHELL_VIEW, ETestShellViewPrivate); + test_shell_view->priv = G_TYPE_INSTANCE_GET_PRIVATE ( + test_shell_view, E_TYPE_TEST_SHELL_VIEW, + ETestShellViewPrivate); } GType -- cgit v1.2.3 From 40da2dc117f398fd1140f804e9501fe975b8c184 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Mon, 7 Mar 2011 08:14:00 +0100 Subject: Typo in comment: s/datefime-formats/datetime-formats/ --- shell/e-shell-migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c index fbcd701bea..dbed197dce 100644 --- a/shell/e-shell-migrate.c +++ b/shell/e-shell-migrate.c @@ -481,7 +481,7 @@ shell_xdg_migrate_config_dir (EShell *shell, old_config_dir = old_base_dir; new_config_dir = e_get_user_config_dir (); - /* Subtle name change: datetime-formats --> datefime-formats.ini */ + /* Subtle name change: datetime-formats --> datetime-formats.ini */ old_filename = g_build_filename (old_config_dir, "datetime-formats", NULL); new_filename = g_build_filename (new_config_dir, "datetime-formats.ini", NULL); shell_xdg_migrate_rename (old_filename, new_filename); -- cgit v1.2.3 From 6ad4de8a4ef6139d48bf13e9c817002bf1591e53 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 7 Mar 2011 12:32:32 +0100 Subject: Bug #644107 - Local addressbooks created without relative_uri set --- shell/e-shell-migrate.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c index dbed197dce..41d829b9e6 100644 --- a/shell/e-shell-migrate.c +++ b/shell/e-shell-migrate.c @@ -819,16 +819,14 @@ merge_duplicate_local_sources (GConfClient *client, const gchar *gconf_key) } /* merging respective sources */ - for (sources = e_source_group_peek_sources (group); - sources != NULL; sources = sources->next) { + for (sources = e_source_group_peek_sources (group); sources != NULL; sources = sources->next) { GSList *liter; ESource *dupe_source = sources->data; if (!dupe_source) continue; - for (liter = e_source_group_peek_sources (first_local); - liter != NULL; liter = liter->next) { + for (liter = e_source_group_peek_sources (first_local); liter != NULL; liter = liter->next) { ESource *my_source = liter->data; const gchar *val1, *val2; @@ -861,6 +859,22 @@ merge_duplicate_local_sources (GConfClient *client, const gchar *gconf_key) to_remove = g_slist_prepend (to_remove, group); } + if (first_local) { + GSList *sources; + + for (sources = e_source_group_peek_sources (first_local); sources != NULL; sources = sources->next) { + ESource *source = sources->data; + const gchar *relative_uri; + + if (!source) + continue; + + relative_uri = e_source_peek_relative_uri (source); + if (!relative_uri || !*relative_uri) + e_source_set_relative_uri (source, e_source_peek_uid (source)); + } + } + if (!to_remove) { g_object_unref (source_list); return; -- cgit v1.2.3 From 5bcf04619f76183562f0649c66e7d22a7be5b35e Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 8 Mar 2011 07:39:47 -0500 Subject: Bug 644166 - Add style class to primary toolbars Requires GTK+ >= 3.0.2 since GTK_STYLE_CLASS_PRIMARY_TOOLBAR is a very recent addition. --- shell/e-shell-window.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'shell') diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index 8c0258eb87..1ba075d957 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -414,6 +414,10 @@ shell_window_construct_toolbar (EShellWindow *shell_window) toolbar = e_shell_window_get_managed_widget ( shell_window, "/main-toolbar"); + gtk_style_context_add_class ( + gtk_widget_get_style_context (toolbar), + GTK_STYLE_CLASS_PRIMARY_TOOLBAR); + if (e_shell_get_meego_mode (shell)) gtk_widget_set_name (GTK_WIDGET (toolbar), "MeeGoToolbar"); -- cgit v1.2.3 From 8937cee7f4f4a5f573c47e3528d796f51a34c084 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 24 Mar 2011 14:18:26 -0400 Subject: Bug 645551 - Mailer statusbar jumping in size --- shell/e-shell-taskbar.c | 50 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 8 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-taskbar.c b/shell/e-shell-taskbar.c index c424d504c8..943a098dd2 100644 --- a/shell/e-shell-taskbar.c +++ b/shell/e-shell-taskbar.c @@ -44,6 +44,8 @@ struct _EShellTaskbarPrivate { GtkWidget *hbox; GHashTable *proxy_table; + + gint fixed_height; }; enum { @@ -273,10 +275,46 @@ shell_taskbar_constructed (GObject *object) G_OBJECT_CLASS (e_shell_taskbar_parent_class)->constructed (object); } +static void +shell_taskbar_size_allocate (GtkWidget *widget, + GtkAllocation *allocation) +{ + EShellTaskbar *shell_taskbar; + gint fixed_height; + + shell_taskbar = E_SHELL_TASKBAR (widget); + + /* Maximum height allocation sticks. */ + fixed_height = shell_taskbar->priv->fixed_height; + fixed_height = MAX (fixed_height, allocation->height); + shell_taskbar->priv->fixed_height = fixed_height; + + /* Chain up to parent's size_allocate() method. */ + GTK_WIDGET_CLASS (e_shell_taskbar_parent_class)-> + size_allocate (widget, allocation); +} + +static void +shell_taskbar_get_preferred_height (GtkWidget *widget, + gint *minimum_height, + gint *natural_height) +{ + EShellTaskbar *shell_taskbar; + + shell_taskbar = E_SHELL_TASKBAR (widget); + + if (minimum_height != NULL) + *minimum_height = shell_taskbar->priv->fixed_height; + + if (natural_height != NULL) + *natural_height = shell_taskbar->priv->fixed_height; +} + static void e_shell_taskbar_class_init (EShellTaskbarClass *class) { GObjectClass *object_class; + GtkWidgetClass *widget_class; g_type_class_add_private (class, sizeof (EShellTaskbarPrivate)); @@ -287,6 +325,10 @@ e_shell_taskbar_class_init (EShellTaskbarClass *class) object_class->finalize = shell_taskbar_finalize; object_class->constructed = shell_taskbar_constructed; + widget_class = GTK_WIDGET_CLASS (class); + widget_class->size_allocate = shell_taskbar_size_allocate; + widget_class->get_preferred_height = shell_taskbar_get_preferred_height; + /** * EShellTaskbar:message * @@ -324,7 +366,6 @@ static void e_shell_taskbar_init (EShellTaskbar *shell_taskbar) { GtkWidget *widget; - gint height; shell_taskbar->priv = G_TYPE_INSTANCE_GET_PRIVATE ( shell_taskbar, E_TYPE_SHELL_TASKBAR, EShellTaskbarPrivate); @@ -343,13 +384,6 @@ e_shell_taskbar_init (EShellTaskbar *shell_taskbar) gtk_box_pack_start (GTK_BOX (shell_taskbar), widget, TRUE, TRUE, 0); shell_taskbar->priv->hbox = g_object_ref (widget); gtk_widget_hide (widget); - - /* Make the taskbar large enough to accomodate a small icon. - * XXX The "* 2" is a fudge factor to allow for some padding - * The true value is probably buried in a style property. */ - gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, NULL, &height); - gtk_widget_set_size_request ( - GTK_WIDGET (shell_taskbar), -1, (height * 2)); } /** -- cgit v1.2.3 From 5399f35bbce8f4e5775fa96b795c527002c48969 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 30 Jan 2011 23:11:14 -0500 Subject: Port EShell to GtkApplication. --- shell/e-shell.c | 306 +++++++++++++++++++++++++++++--------------------------- shell/e-shell.h | 7 +- shell/main.c | 32 ++++-- 3 files changed, 182 insertions(+), 163 deletions(-) (limited to 'shell') diff --git a/shell/e-shell.c b/shell/e-shell.c index f3402dd101..d9dcb5de9a 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -47,6 +47,7 @@ struct _EShellPrivate { GList *watched_windows; EShellSettings *settings; GConfClient *gconf_client; + GActionGroup *action_group; GtkWidget *preferences_window; /* Shell Backends */ @@ -109,10 +110,15 @@ static GDebugKey debug_keys[] = { static gpointer default_shell; static guint signals[LAST_SIGNAL]; +/* Forward Declarations */ +static void e_shell_initable_init (GInitableIface *interface); + G_DEFINE_TYPE_WITH_CODE ( EShell, e_shell, - UNIQUE_TYPE_APP, + GTK_TYPE_APPLICATION, + G_IMPLEMENT_INTERFACE ( + G_TYPE_INITABLE, e_shell_initable_init) G_IMPLEMENT_INTERFACE ( E_TYPE_EXTENSIBLE, NULL)) @@ -218,6 +224,57 @@ shell_window_weak_notify_cb (EShell *shell, g_object_ref (shell)); } +static void +shell_action_new_window_cb (GSimpleAction *action, + GVariant *parameter, + EShell *shell) +{ + const gchar *view_name; + + view_name = g_variant_get_string (parameter, NULL); + e_shell_create_shell_window (shell, view_name); +} + +static void +shell_action_quit_cb (GSimpleAction *action, + GVariant *parameter, + EShell *shell) +{ + e_shell_quit (shell, E_SHELL_QUIT_REMOTE_REQUEST); +} + +static void +shell_add_actions (GApplication *application) +{ + EShell *shell; + GSimpleActionGroup *action_group; + GSimpleAction *action; + + /* Add actions that remote instances can invoke. */ + + action_group = g_simple_action_group_new (); + + action = g_simple_action_new ("new-window", G_VARIANT_TYPE_STRING); + g_signal_connect ( + action, "activate", + G_CALLBACK (shell_action_new_window_cb), application); + g_simple_action_group_insert (action_group, G_ACTION (action)); + g_object_unref (action); + + action = g_simple_action_new ("quit", NULL); + g_signal_connect ( + action, "activate", + G_CALLBACK (shell_action_quit_cb), application); + g_simple_action_group_insert (action_group, G_ACTION (action)); + g_object_unref (action); + + shell = E_SHELL (application); + shell->priv->action_group = G_ACTION_GROUP (action_group); + + g_application_set_action_group ( + application, shell->priv->action_group); +} + static void shell_ready_for_offline (EShell *shell, EActivity *activity, @@ -658,6 +715,11 @@ shell_dispose (GObject *object) priv->gconf_client = NULL; } + if (priv->action_group != NULL) { + g_object_unref (priv->action_group); + priv->action_group = NULL; + } + if (priv->preferences_window != NULL) { g_object_unref (priv->preferences_window); priv->preferences_window = NULL; @@ -683,10 +745,6 @@ shell_finalize (GObject *object) g_hash_table_destroy (priv->backends_by_name); g_hash_table_destroy (priv->backends_by_scheme); - /* Indicates a clean shut down to the next session. */ - if (!unique_app_is_running (UNIQUE_APP (object))) - e_file_lock_destroy (); - g_list_foreach (priv->loaded_backends, (GFunc) g_object_unref, NULL); g_list_free (priv->loaded_backends); @@ -706,21 +764,34 @@ shell_constructed (GObject *object) g_object_add_weak_pointer (object, &default_shell); } - if (!unique_app_is_running (UNIQUE_APP (object))) - e_file_lock_create (); - /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (e_shell_parent_class)->constructed (object); } -static UniqueResponse -shell_message_handle_activate (EShell *shell, - UniqueMessageData *data) +static void +shell_startup (GApplication *application) +{ + e_file_lock_create (); + + /* Destroy the lock file when the EShell is finalized + * to indicate a clean shut down to the next session. */ + g_object_weak_ref ( + G_OBJECT (application), + (GWeakNotify) e_file_lock_destroy, NULL); + + /* Chain up to parent's startup() method. */ + G_APPLICATION_CLASS (e_shell_parent_class)->startup (application); +} + +static void +shell_activate (GApplication *application) { + EShell *shell; GList *watched_windows; - GdkScreen *screen; - screen = unique_message_data_get_screen (data); + /* Do not chain up. Default method just emits a warning. */ + + shell = E_SHELL (application); watched_windows = e_shell_get_watched_windows (shell); /* Present the first EShellWindow, if found. */ @@ -728,9 +799,8 @@ shell_message_handle_activate (EShell *shell, GtkWindow *window = GTK_WINDOW (watched_windows->data); if (E_IS_SHELL_WINDOW (window)) { - gtk_window_set_screen (window, screen); gtk_window_present (window); - return UNIQUE_RESPONSE_OK; + return; } watched_windows = g_list_next (watched_windows); @@ -738,108 +808,55 @@ shell_message_handle_activate (EShell *shell, /* No EShellWindow found, so create one. */ e_shell_create_shell_window (shell, NULL); - - return UNIQUE_RESPONSE_OK; } -static UniqueResponse -shell_message_handle_new (EShell *shell, - UniqueMessageData *data) -{ - gchar *view_name; - - view_name = unique_message_data_get_text (data); - e_shell_create_shell_window (shell, view_name); - g_free (view_name); - - return UNIQUE_RESPONSE_OK; -} - -static UniqueResponse -shell_message_handle_open (EShell *shell, - UniqueMessageData *data) +static void +shell_open (GApplication *application, + GFile **files, + gint n_files, + const gchar *hint) { + EShell *shell; gchar **uris; + gint ii; - uris = unique_message_data_get_uris (data); - if (uris && uris[0] && g_str_equal (uris[0], "--import")) { - gint ii; - GPtrArray *arr = g_ptr_array_new (); + /* Do not chain up. Default method just emits a warning. */ - /* skip the first argument */ - for (ii = 1; uris[ii] != NULL; ii++) { - g_ptr_array_add (arr, uris[ii]); - } + shell = E_SHELL (application); + uris = g_new0 (gchar *, n_files + 1); - g_ptr_array_add (arr, NULL); + for (ii = 0; ii < n_files; ii++) + uris[ii] = g_file_get_uri (files[ii]); - e_shell_handle_uris (shell, (gchar **)arr->pdata, TRUE); + e_shell_handle_uris (shell, uris, FALSE); - g_ptr_array_free (arr, TRUE); - } else { - e_shell_handle_uris (shell, uris, FALSE); - } g_strfreev (uris); - - return UNIQUE_RESPONSE_OK; } -static UniqueResponse -shell_message_handle_close (EShell *shell, - UniqueMessageData *data) +static void +shell_window_destroyed (EShell *shell) { - UniqueResponse response; - - if (e_shell_quit (shell, E_SHELL_QUIT_REMOTE_REQUEST)) - response = UNIQUE_RESPONSE_OK; - else - response = UNIQUE_RESPONSE_CANCEL; - - return response; + if (e_shell_get_watched_windows (shell) == NULL) + gtk_main_quit (); } -static UniqueResponse -shell_message_received (UniqueApp *app, - gint command, - UniqueMessageData *data, - guint time_) +static gboolean +shell_initable_init (GInitable *initable, + GCancellable *cancellable, + GError **error) { - EShell *shell = E_SHELL (app); - - switch (command) { - case UNIQUE_ACTIVATE: - return shell_message_handle_activate (shell, data); - - case UNIQUE_NEW: - return shell_message_handle_new (shell, data); + GApplication *application = G_APPLICATION (initable); - case UNIQUE_OPEN: - return shell_message_handle_open (shell, data); - - case UNIQUE_CLOSE: - return shell_message_handle_close (shell, data); - - default: - break; - } + shell_add_actions (application); - /* Chain up to parent's message_received() method. */ - return UNIQUE_APP_CLASS (e_shell_parent_class)-> - message_received (app, command, data, time_); -} - -static void -shell_window_destroyed (EShell *shell) -{ - if (e_shell_get_watched_windows (shell) == NULL) - gtk_main_quit (); + return g_application_register (application, cancellable, error); } static void e_shell_class_init (EShellClass *class) { GObjectClass *object_class; - UniqueAppClass *unique_app_class; + GApplicationClass *application_class; g_type_class_add_private (class, sizeof (EShellPrivate)); @@ -850,8 +867,10 @@ e_shell_class_init (EShellClass *class) object_class->finalize = shell_finalize; object_class->constructed = shell_constructed; - unique_app_class = UNIQUE_APP_CLASS (class); - unique_app_class->message_received = shell_message_received; + application_class = G_APPLICATION_CLASS (class); + application_class->startup = shell_startup; + application_class->activate = shell_activate; + application_class->open = shell_open; class->window_destroyed = shell_window_destroyed; @@ -1161,6 +1180,12 @@ e_shell_class_init (EShellClass *class) G_TYPE_NONE, 0); } +static void +e_shell_initable_init (GInitableIface *interface) +{ + interface->init = shell_initable_init; +} + static void e_shell_init (EShell *shell) { @@ -1347,8 +1372,8 @@ e_shell_get_canonical_name (EShell *shell, g_return_val_if_fail (E_IS_SHELL (shell), NULL); - /* Handle NULL name arguments silently. */ - if (name == NULL) + /* Handle NULL or empty name arguments silently. */ + if (name == NULL || *name == '\0') return NULL; shell_backend = e_shell_get_backend_by_name (shell, name); @@ -1455,16 +1480,12 @@ e_shell_create_shell_window (EShell *shell, const gchar *view_name) { GtkWidget *shell_window; - UniqueMessageData *data; - UniqueApp *app; GList *link; g_return_val_if_fail (E_IS_SHELL (shell), NULL); - app = UNIQUE_APP (shell); - - if (unique_app_is_running (app)) - goto unique; + if (g_application_get_is_remote (G_APPLICATION (shell))) + goto remote; view_name = e_shell_get_canonical_name (shell, view_name); @@ -1508,17 +1529,14 @@ e_shell_create_shell_window (EShell *shell, return shell_window; -unique: /* Send a message to the other Evolution process. */ - - /* XXX Do something with UniqueResponse? */ +remote: /* Send a message to the other Evolution process. */ if (view_name != NULL) { - data = unique_message_data_new (); - unique_message_data_set_text (data, view_name, -1); - unique_app_send_message (app, UNIQUE_NEW, data); - unique_message_data_free (data); + g_action_group_activate_action ( + shell->priv->action_group, "new-window", + g_variant_new_string (view_name)); } else - unique_app_send_message (app, UNIQUE_ACTIVATE, NULL); + g_application_activate (G_APPLICATION (shell)); return NULL; } @@ -1538,18 +1556,15 @@ e_shell_handle_uris (EShell *shell, gchar **uris, gboolean do_import) { - UniqueApp *app; - UniqueMessageData *data; + GFile **files; guint n_handled = 0; - gint ii; + guint length, ii; g_return_val_if_fail (E_IS_SHELL (shell), FALSE); g_return_val_if_fail (uris != NULL, FALSE); - app = UNIQUE_APP (shell); - - if (unique_app_is_running (app)) - goto unique; + if (g_application_get_is_remote (G_APPLICATION (shell))) + goto remote; if (do_import) { n_handled = e_shell_utils_import_uris (shell, uris); @@ -1569,34 +1584,23 @@ e_shell_handle_uris (EShell *shell, return n_handled; -unique: /* Send a message to the other Evolution process. */ +remote: /* Send a message to the other Evolution process. */ - /* XXX Do something with UniqueResponse? */ + length = g_strv_length (uris); - data = unique_message_data_new (); - if (do_import) { - GPtrArray *arr = g_ptr_array_new (); + files = g_new0 (GFile *, length + 1); + for (ii = 0; ii < length; ii++) + files[ii] = g_file_new_for_uri (uris[ii]); - g_ptr_array_add (arr, (gpointer)"--import"); + g_application_open (G_APPLICATION (shell), files, length, ""); - for (ii = 0; uris[ii] != NULL; ii++) { - g_ptr_array_add (arr, uris[ii]); - } - - g_ptr_array_add (arr, NULL); - - unique_message_data_set_uris (data, (gchar **)arr->pdata); - - g_ptr_array_free (arr, TRUE); - } else { - unique_message_data_set_uris (data, uris); - } - unique_app_send_message (app, UNIQUE_OPEN, data); - unique_message_data_free (data); + for (ii = 0; ii < length; ii++) + g_object_unref (files[ii]); + g_free (files); /* As far as we're concerned, all URIs have been handled. */ - return g_strv_length (uris); + return length; } /** @@ -1655,6 +1659,12 @@ e_shell_watch_window (EShell *shell, list = shell->priv->watched_windows; + /* XXX If my suggestion in [1] is accepted for GtkApplication + * then we can get rid of our own watched_windows list. + * + * [1] https://bugzilla.gnome.org/show_bug.cgi?id=624539 + */ + /* Ignore duplicates. */ if (g_list_find (list, window) != NULL) return; @@ -1662,7 +1672,7 @@ e_shell_watch_window (EShell *shell, list = g_list_prepend (list, window); shell->priv->watched_windows = list; - unique_app_watch_window (UNIQUE_APP (shell), window); + gtk_application_add_window (GTK_APPLICATION (shell), window); /* We use the window's own type name and memory * address to form a unique window role for X11. */ @@ -1987,15 +1997,10 @@ gboolean e_shell_quit (EShell *shell, EShellQuitReason reason) { - UniqueApp *app; - UniqueResponse response; - g_return_val_if_fail (E_IS_SHELL (shell), FALSE); - app = UNIQUE_APP (shell); - - if (unique_app_is_running (app)) - goto unique; + if (g_application_get_is_remote (G_APPLICATION (shell))) + goto remote; if (!shell_request_quit (shell, reason)) return FALSE; @@ -2004,11 +2009,12 @@ e_shell_quit (EShell *shell, return TRUE; -unique: /* Send a message to the other Evolution process. */ +remote: /* Send a message to the other Evolution process. */ - response = unique_app_send_message (app, UNIQUE_CLOSE, NULL); + g_action_group_activate_action ( + shell->priv->action_group, "quit", NULL); - return (response == UNIQUE_RESPONSE_OK); + return TRUE; } /** diff --git a/shell/e-shell.h b/shell/e-shell.h index 22aef9252f..bbb11467fc 100644 --- a/shell/e-shell.h +++ b/shell/e-shell.h @@ -22,7 +22,6 @@ #ifndef E_SHELL_H #define E_SHELL_H -#include #include #include @@ -90,12 +89,12 @@ typedef enum { * functions below. **/ struct _EShell { - UniqueApp parent; + GtkApplication parent; EShellPrivate *priv; }; struct _EShellClass { - UniqueAppClass parent_class; + GtkApplicationClass parent_class; gboolean (*handle_uri) (EShell *shell, const gchar *uri); @@ -154,7 +153,7 @@ gboolean e_shell_quit (EShell *shell, EShellQuitReason reason); void e_shell_cancel_quit (EShell *shell); -void e_shell_adapt_window_size (EShell *shell, +void e_shell_adapt_window_size (EShell *shell, GtkWindow *window); void e_shell_set_startup_view (EShell *shell, const gchar *view); diff --git a/shell/main.c b/shell/main.c index f9c9651e49..a27b6b9495 100644 --- a/shell/main.c +++ b/shell/main.c @@ -84,6 +84,8 @@ #include #endif +#define APPLICATION_ID "org.gnome.Evolution" + #define SKIP_WARNING_DIALOG_KEY \ "/apps/evolution/shell/skip_warning_dialog" @@ -257,7 +259,7 @@ idle_cb (gchar **uris) } /* If another Evolution process is running, we're done. */ - if (unique_app_is_running (UNIQUE_APP (shell))) + if (g_application_get_is_remote (G_APPLICATION (shell))) gtk_main_quit (); return FALSE; @@ -324,7 +326,8 @@ quit_signal (gint sig) g_print ("Received quit signal...\n"); shell = e_shell_get_default (); - if (shell) + + if (shell != NULL) e_shell_quit (shell, E_SHELL_QUIT_OPTION); } @@ -411,10 +414,12 @@ create_default_shell (void) { EShell *shell; GConfClient *client; - gboolean online = TRUE; + GApplicationFlags flags; const gchar *key; + gboolean online = TRUE; + gboolean is_meego = FALSE; + gboolean small_screen = FALSE; GError *error = NULL; - gboolean is_meego = FALSE, small_screen = FALSE; client = gconf_client_get_default (); @@ -457,9 +462,13 @@ create_default_shell (void) g_clear_error (&error); } - shell = g_object_new ( - E_TYPE_SHELL, - "name", "org.gnome.Evolution", + flags = G_APPLICATION_HANDLES_OPEN | + G_APPLICATION_HANDLES_COMMAND_LINE; + + shell = g_initable_new ( + E_TYPE_SHELL, NULL, &error, + "application-id", APPLICATION_ID, + "flags", flags, "geometry", geometry, "module-directory", EVOLUTION_MODULEDIR, "meego-mode", is_meego, @@ -468,6 +477,10 @@ create_default_shell (void) "online", online, NULL); + /* Failure to register is fatal. */ + if (error != NULL) + g_error ("%s", error->message); + if (force_online) e_shell_lock_network_available (shell); @@ -571,9 +584,9 @@ main (gint argc, gchar **argv) exit (1); } - #ifdef HAVE_ICAL_UNKNOWN_TOKEN_HANDLING +#ifdef HAVE_ICAL_UNKNOWN_TOKEN_HANDLING ical_set_unknown_token_handling_setting (ICAL_DISCARD_TOKEN); - #endif +#endif #ifdef G_OS_WIN32 path = g_build_path (";", _e_get_bindir (), g_getenv ("PATH"), NULL); @@ -622,6 +635,7 @@ main (gint argc, gchar **argv) setlocale (LC_ALL, "C"); } #endif + if (start_online && start_offline) { g_printerr ( _("%s: --online and --offline cannot be used " -- cgit v1.2.3 From c8be2c5fe1a1dc943bc293bb269da116a7f237ad Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 25 Mar 2011 10:53:54 -0400 Subject: Fix an EShell reference leak. GApplication calls g_main_loop_quit() immediately when the last window is destroyed, whereas we do it from an idle callback with an extra ref on EShell to keep it alive until the idle callback runs. But because GApplication beats us to the punch, our idle callback never runs and the EShell reference leaks. For now, we'll just disable the quit_mainloop() method of GApplication. If GtkApplication grows a signal equivalent to EShell::window-destroyed, EShell could drop its window_destroyed() method and let G[tk]Application handle things normally. --- shell/e-shell.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'shell') diff --git a/shell/e-shell.c b/shell/e-shell.c index d9dcb5de9a..d7ecf69d8c 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -833,6 +833,14 @@ shell_open (GApplication *application, g_strfreev (uris); } +static void +shell_quit_mainloop (GApplication *application) +{ + /* XXX Don't allow GApplication to quit the main loop. + * We'll do that ourselves until GtkApplication gets + * a signal equivalent to EShell::window-destroyed. */ +} + static void shell_window_destroyed (EShell *shell) { @@ -871,6 +879,7 @@ e_shell_class_init (EShellClass *class) application_class->startup = shell_startup; application_class->activate = shell_activate; application_class->open = shell_open; + application_class->quit_mainloop = shell_quit_mainloop; class->window_destroyed = shell_window_destroyed; -- cgit v1.2.3 From 7d9988c456479baa23265a4d8c3e4ea7ac2931be Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 25 Mar 2011 12:02:16 -0400 Subject: EShellContent: Whitespace cleanup. --- shell/e-shell-content.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index 91a6d1f69b..d32671e732 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -210,8 +210,8 @@ shell_content_constructed (GObject *object) static void shell_content_get_preferred_width (GtkWidget *widget, - gint *minimum, - gint *natural) + gint *minimum, + gint *natural) { EShellContentPrivate *priv; gint min, nat; @@ -220,27 +220,27 @@ shell_content_get_preferred_width (GtkWidget *widget, priv = E_SHELL_CONTENT (widget)->priv; - *minimum = *natural = 0; + *minimum = *natural = 0; child = gtk_bin_get_child (GTK_BIN (widget)); gtk_widget_get_preferred_width (child, &child_min, &child_nat); gtk_widget_get_preferred_width (priv->alert_bar, &min, &nat); - *minimum = MAX (min, child_min); - *natural = MAX (nat, child_nat); + *minimum = MAX (min, child_min); + *natural = MAX (nat, child_nat); if (priv->searchbar == NULL) return; gtk_widget_get_preferred_width (priv->searchbar, &min, &nat); - *minimum = MAX (*minimum, min); - *natural = MAX (*natural, nat); + *minimum = MAX (*minimum, min); + *natural = MAX (*natural, nat); } static void shell_content_get_preferred_height (GtkWidget *widget, - gint *minimum, - gint *natural) + gint *minimum, + gint *natural) { EShellContentPrivate *priv; gint min, nat; @@ -255,8 +255,8 @@ shell_content_get_preferred_height (GtkWidget *widget, return; gtk_widget_get_preferred_height (priv->searchbar, &min, &nat); - *minimum += min; - *natural += nat; + *minimum += min; + *natural += nat; } static void -- cgit v1.2.3 From ba6a2343869f6be82f44261f183cd6925659d5ee Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 27 Mar 2011 15:16:39 -0400 Subject: Restore lockdown integration. With lockdown settings available through GSettings, widgets can handle lockdown integration themselves without having to use EShellSettings. Also fixed a few places where printing or save-to-disk actions were either not properly wired up or not responding to lockdown settings, but much more work needs done. Attachments, for example, are not honoring the disable-save-to-disk setting at all. This too requires the recently-added gsettings-desktop-schemas dependency. --- shell/e-shell-utils.c | 36 --------------------------------- shell/e-shell-utils.h | 3 --- shell/e-shell-window-private.c | 46 +++++++++++++++++++----------------------- shell/e-shell.c | 26 ------------------------ 4 files changed, 21 insertions(+), 90 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-utils.c b/shell/e-shell-utils.c index b1de7119a8..4676a2d2e9 100644 --- a/shell/e-shell-utils.c +++ b/shell/e-shell-utils.c @@ -53,42 +53,6 @@ e_shell_configure_ui_manager (EShell *shell, G_BINDING_SYNC_CREATE); } -/** - * e_shell_configure_web_view: - * @shell: an #EShell - * @web_view: an #EWebView - * - * Adds shell integration to @web_view. In particular, it configures - * @web_view to honor the printing and save-to-disk lockdown options. - **/ -void -e_shell_configure_web_view (EShell *shell, - EWebView *web_view) -{ -#if 0 /* XXX Lockdown keys have moved to gsettings-desktop-scheams, - * so disable lockdown integration until we're ready for - * GSettings. */ - EShellSettings *shell_settings; - - g_return_if_fail (E_IS_SHELL (shell)); - g_return_if_fail (E_IS_WEB_VIEW (web_view)); - - shell_settings = e_shell_get_shell_settings (shell); - -#ifndef G_OS_WIN32 - g_object_bind_property ( - shell_settings, "disable-printing", - web_view, "disable-printing", - G_BINDING_SYNC_CREATE); - - g_object_bind_property ( - shell_settings, "disable-save-to-disk", - web_view, "disable-save-to-disk", - G_BINDING_SYNC_CREATE); -#endif -#endif -} - /** * e_shell_run_open_dialog: * @shell: an #EShell diff --git a/shell/e-shell-utils.h b/shell/e-shell-utils.h index a45ecdb1ca..178c26d20f 100644 --- a/shell/e-shell-utils.h +++ b/shell/e-shell-utils.h @@ -31,9 +31,6 @@ G_BEGIN_DECLS void e_shell_configure_ui_manager (EShell *shell, EUIManager *ui_manager); -void e_shell_configure_web_view (EShell *shell, - EWebView *web_view); - GFile * e_shell_run_open_dialog (EShell *shell, const gchar *title, GtkCallback customize_func, diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c index db2bf069a9..613529419b 100644 --- a/shell/e-shell-window-private.c +++ b/shell/e-shell-window-private.c @@ -261,16 +261,10 @@ void e_shell_window_private_constructed (EShellWindow *shell_window) { EShellWindowPrivate *priv = shell_window->priv; -#if 0 - EShellSettings *shell_settings; -#endif EShell *shell; GConfBridge *bridge; GtkAction *action; GtkAccelGroup *accel_group; -#if 0 - GtkActionGroup *action_group; -#endif GtkUIManager *ui_manager; GtkBox *box; GtkPaned *paned; @@ -281,12 +275,14 @@ e_shell_window_private_constructed (EShellWindow *shell_window) const gchar *key; const gchar *id; +#ifndef G_OS_WIN32 + GSettings *settings; + GtkActionGroup *action_group; +#endif + window = GTK_WINDOW (shell_window); shell = e_shell_window_get_shell (shell_window); -#if 0 - shell_settings = e_shell_get_shell_settings (shell); -#endif ui_manager = e_shell_window_get_ui_manager (shell_window); e_shell_configure_ui_manager (shell, E_UI_MANAGER (ui_manager)); @@ -362,37 +358,37 @@ e_shell_window_private_constructed (EShellWindow *shell_window) shell_window, "notify::active-view", G_CALLBACK (e_shell_window_update_search_menu), NULL); -#if 0 /* XXX Lockdown keys have moved to gsettings-desktop-schemas, - * so disable lockdown integration until we're ready for - * GSettings. */ #ifndef G_OS_WIN32 /* Support lockdown. */ + settings = g_settings_new ("org.gnome.desktop.lockdown"); + action_group = ACTION_GROUP (LOCKDOWN_PRINTING); - g_object_bind_property ( - shell_settings, "disable-printing", + g_settings_bind ( + settings, "disable-printing", action_group, "visible", - G_BINDING_SYNC_CREATE | - G_BINDING_INVERT_BOOLEAN); + G_SETTINGS_BIND_GET | + G_SETTINGS_BIND_INVERT_BOOLEAN); action_group = ACTION_GROUP (LOCKDOWN_PRINT_SETUP); - g_object_bind_property ( - shell_settings, "disable-print-setup", + g_settings_bind ( + settings, "disable-print-setup", action_group, "visible", - G_BINDING_SYNC_CREATE | - G_BINDING_INVERT_BOOLEAN); + G_SETTINGS_BIND_GET | + G_SETTINGS_BIND_INVERT_BOOLEAN); action_group = ACTION_GROUP (LOCKDOWN_SAVE_TO_DISK); - g_object_bind_property ( - shell_settings, "disable-save-to-disk", + g_settings_bind ( + settings, "disable-save-to-disk", action_group, "visible", - G_BINDING_SYNC_CREATE | - G_BINDING_INVERT_BOOLEAN); + G_SETTINGS_BIND_GET | + G_SETTINGS_BIND_INVERT_BOOLEAN); + + g_object_unref (settings); #endif /* G_OS_WIN32 */ -#endif /* Bind GObject properties to GObject properties. */ diff --git a/shell/e-shell.c b/shell/e-shell.c index d7ecf69d8c..d9c3508161 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -1244,32 +1244,6 @@ e_shell_init (EShell *shell) "start-offline", "/apps/evolution/shell/start_offline"); -#if 0 /* XXX Lockdown keys have moved to gsettings-desktop-schemas, - * so disable lockdown integration until we're ready for - * GSettings. */ -#ifndef G_OS_WIN32 - e_shell_settings_install_property_for_key ( - "disable-application-handlers", - "/desktop/gnome/lockdown/disable_application_handlers"); - - e_shell_settings_install_property_for_key ( - "disable-command-line", - "/desktop/gnome/lockdown/disable_command_line"); - - e_shell_settings_install_property_for_key ( - "disable-printing", - "/desktop/gnome/lockdown/disable_printing"); - - e_shell_settings_install_property_for_key ( - "disable-print-setup", - "/desktop/gnome/lockdown/disable_print_setup"); - - e_shell_settings_install_property_for_key ( - "disable-save-to-disk", - "/desktop/gnome/lockdown/disable_save_to_disk"); -#endif /* G_OS_WIN32 */ -#endif - /*** Session Management ***/ sm_client = egg_sm_client_get (); -- cgit v1.2.3 From ea8326df3a64c21ddbcacad5941648b1a86bc7e2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 28 Mar 2011 15:53:39 -0400 Subject: Remove the profiler plugin. This plugin was for developers, but no one uses it anymore. Plus the only profiling hooks left in Evolution were in the MessageList widget, which performs fine. There's better ways to collect profiling data these days anyway (sysprof, systemtap, etc.). --- shell/main.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'shell') diff --git a/shell/main.c b/shell/main.c index a27b6b9495..001d6bd843 100644 --- a/shell/main.c +++ b/shell/main.c @@ -66,7 +66,6 @@ #include "e-util/e-import.h" #include "e-util/e-plugin.h" #include "e-util/e-plugin-ui.h" -#include "e-util/e-profile-event.h" #include "e-util/e-util-private.h" #include "e-util/e-util.h" #ifdef G_OS_WIN32 @@ -721,9 +720,6 @@ main (gint argc, gchar **argv) /* Register built-in plugin hook types. */ es_event_hook_get_type (); e_import_hook_get_type (); -#ifdef ENABLE_PROFILING - e_profile_event_hook_get_type (); -#endif e_plugin_ui_hook_get_type (); /* All EPlugin and EPluginHook subclasses should be -- cgit v1.2.3 From a27e5eb99ec458993f631e5617483701a482f42d Mon Sep 17 00:00:00 2001 From: Abner Silva Date: Wed, 20 Apr 2011 23:04:43 +0100 Subject: Bug 648317 - MeeGo shell looking for the wrong atom Yet another s/MOBLIN/MEEGO/ https://bugs.meego.com/show_bug.cgi?id=13756 --- shell/e-shell-meego.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/e-shell-meego.c b/shell/e-shell-meego.c index 51a2da9cf1..2c95bef060 100644 --- a/shell/e-shell-meego.c +++ b/shell/e-shell-meego.c @@ -71,7 +71,7 @@ e_shell_detect_meego (gboolean *is_meego, return; wm_win = gdk_atom_intern ("_NET_SUPPORTING_WM_CHECK", TRUE); - mob_atom = gdk_atom_intern ("_MOBLIN", TRUE); + mob_atom = gdk_atom_intern ("_MEEGO", TRUE); if (!wm_win || !mob_atom) return; -- cgit v1.2.3 From f2a4427777d4f59e1216bbce44770f0aa3174025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Vr=C3=A1til?= Date: Thu, 28 Apr 2011 15:44:51 -0400 Subject: Bug 645825 - Search bar not changing color when showing results --- shell/e-shell-searchbar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c index 7a0f3c7d42..cf2f6ef1ee 100644 --- a/shell/e-shell-searchbar.c +++ b/shell/e-shell-searchbar.c @@ -246,11 +246,11 @@ shell_searchbar_update_search_widgets (EShellSearchbar *searchbar) style = gtk_widget_get_style (widget); color = &style->mid[GTK_STATE_SELECTED]; - gtk_widget_modify_base (widget, GTK_STATE_NORMAL, color); + gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, color); gtk_widget_modify_text (widget, GTK_STATE_NORMAL, NULL); } else { /* Text color will be updated when we move the focus. */ - gtk_widget_modify_base (widget, GTK_STATE_NORMAL, NULL); + gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, NULL); } action = E_SHELL_WINDOW_ACTION_SEARCH_CLEAR (shell_window); -- cgit v1.2.3 From 8195647e9b92dc3928a66893e8ac1fba88019b66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Vr=C3=A1til?= Date: Thu, 5 May 2011 09:57:48 -0400 Subject: Bug 332497 - Add Edit -> Available Categories Opens a window to manage categories without having to edit a contact or appointment. Not available in the Mail shell view since it doesn't use categories. --- shell/e-shell-window-actions.c | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'shell') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 928cab79c3..60792ba5b6 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -27,6 +27,7 @@ #include #include +#include #define EVOLUTION_COPYRIGHT \ "Copyright \xC2\xA9 1999 - 2008 Novell, Inc. and Others" @@ -892,6 +893,42 @@ action_page_setup_cb (GtkAction *action, e_print_run_page_setup_dialog (GTK_WINDOW (shell_window)); } +/** + * E_SHELL_WINDOW_ACTION_CATEGORIES + * @window: and #EShellWindow + * + * Activation of this action opens the Categories Editor dialog. + * + * Main menu item: Edit -> Available categories + **/ +static void +action_categories_cb (GtkAction *action, + EShellWindow *shell_window) +{ + GtkWidget *content_area; + GtkWidget *dialog; + GtkWidget *editor; + + editor = e_categories_editor_new (); + e_categories_editor_set_entry_visible ( + E_CATEGORIES_EDITOR (editor), FALSE); + + dialog = gtk_dialog_new_with_buttons ( + _("Categories Editor"), + GTK_WINDOW (shell_window), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); + gtk_container_set_border_width (GTK_CONTAINER (dialog), 12); + content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); + gtk_box_pack_start ( + GTK_BOX (content_area), GTK_WIDGET (editor), TRUE, TRUE, 6); + gtk_box_set_spacing (GTK_BOX (content_area), 12); + + gtk_dialog_run (GTK_DIALOG (dialog)); + + gtk_widget_destroy (dialog); +} + /** * E_SHELL_WINDOW_ACTION_PREFERENCES: * @window: an #EShellWindow @@ -1482,6 +1519,13 @@ static GtkActionEntry shell_entries[] = { N_("Paste the clipboard"), NULL }, /* Handled by EFocusTracker */ + { "categories", + NULL, + N_("Available Cate_gories"), + NULL, + N_("Manage available categories"), + G_CALLBACK (action_categories_cb) }, + { "preferences", GTK_STOCK_PREFERENCES, NULL, -- cgit v1.2.3 From 4cfb84c573f21ca7519e24cff1c5742b715355c4 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 7 May 2011 12:22:36 -0400 Subject: Whitespace and coding style cleanups. --- shell/e-shell-migrate.c | 14 +++++++++----- shell/es-event.c | 8 ++++++-- shell/main.c | 8 ++++---- 3 files changed, 19 insertions(+), 11 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c index 41d829b9e6..6874c2e304 100644 --- a/shell/e-shell-migrate.c +++ b/shell/e-shell-migrate.c @@ -809,8 +809,9 @@ merge_duplicate_local_sources (GConfClient *client, const gchar *gconf_key) GSList *sources; ESourceGroup *group = iter->data; - if (!group || !e_source_group_peek_base_uri (group) - || g_ascii_strncasecmp (e_source_group_peek_base_uri (group), "local:", 6) != 0) + if (!group || !e_source_group_peek_base_uri (group) || + g_ascii_strncasecmp ( + e_source_group_peek_base_uri (group), "local:", 6) != 0) continue; if (!first_local) { @@ -819,14 +820,16 @@ merge_duplicate_local_sources (GConfClient *client, const gchar *gconf_key) } /* merging respective sources */ - for (sources = e_source_group_peek_sources (group); sources != NULL; sources = sources->next) { + for (sources = e_source_group_peek_sources (group); + sources != NULL; sources = sources->next) { GSList *liter; ESource *dupe_source = sources->data; if (!dupe_source) continue; - for (liter = e_source_group_peek_sources (first_local); liter != NULL; liter = liter->next) { + for (liter = e_source_group_peek_sources (first_local); + liter != NULL; liter = liter->next) { ESource *my_source = liter->data; const gchar *val1, *val2; @@ -862,7 +865,8 @@ merge_duplicate_local_sources (GConfClient *client, const gchar *gconf_key) if (first_local) { GSList *sources; - for (sources = e_source_group_peek_sources (first_local); sources != NULL; sources = sources->next) { + for (sources = e_source_group_peek_sources (first_local); + sources != NULL; sources = sources->next) { ESource *source = sources->data; const gchar *relative_uri; diff --git a/shell/es-event.c b/shell/es-event.c index c260faebee..6fc6751d3a 100644 --- a/shell/es-event.c +++ b/shell/es-event.c @@ -220,8 +220,12 @@ es_event_hook_get_type (void) if (!type) { static const GTypeInfo info = { - sizeof (ESEventHookClass), NULL, NULL, (GClassInitFunc) emeh_class_init, NULL, NULL, - sizeof (ESEventHook), 0, (GInstanceInitFunc) NULL, + sizeof (ESEventHookClass), + NULL, NULL, + (GClassInitFunc) emeh_class_init, + NULL, NULL, + sizeof (ESEventHook), + 0, (GInstanceInitFunc) NULL }; emeh_parent_class = g_type_class_ref (e_event_hook_get_type ()); diff --git a/shell/main.c b/shell/main.c index 001d6bd843..62d19259aa 100644 --- a/shell/main.c +++ b/shell/main.c @@ -350,16 +350,16 @@ setup_quit_signal (void) static GOptionEntry entries[] = { #ifdef G_OS_WIN32 - { "register-handlers", '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, ®ister_handlers, - NULL, NULL }, + { "register-handlers", '\0', G_OPTION_FLAG_HIDDEN, + G_OPTION_ARG_NONE, ®ister_handlers, NULL, NULL }, { "reinstall", '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &reinstall, NULL, NULL }, { "show-icons", '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &show_icons, NULL, NULL }, { "hide-icons", '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &hide_icons, NULL, NULL }, - { "unregister-handlers", '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &unregister_handlers, - NULL, NULL }, + { "unregister-handlers", '\0', G_OPTION_FLAG_HIDDEN, + G_OPTION_ARG_NONE, &unregister_handlers, NULL, NULL }, #endif /* G_OS_WIN32 */ { "component", 'c', 0, G_OPTION_ARG_STRING, &requested_view, /* Translators: Do NOT translate the five component -- cgit v1.2.3 From 8a186c3588d3598857c36e2122fa68d01eba30fd Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 8 May 2011 13:24:42 -0400 Subject: Coding style cleanups. --- shell/e-shell-window.c | 6 +++--- shell/es-event.c | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index 1ba075d957..7d8e6c5f85 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -362,11 +362,11 @@ shell_window_construct_menubar (EShellWindow *shell_window) parent = gtk_widget_get_parent (main_menu); g_object_ref (parent); - gtk_container_remove ((GtkContainer *)parent, main_menu); + gtk_container_remove ((GtkContainer *) parent, main_menu); child = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start ((GtkBox *)child, main_menu, TRUE, TRUE, 0); + gtk_box_pack_start ((GtkBox *) child, main_menu, TRUE, TRUE, 0); gtk_widget_show (child); - gtk_container_add ((GtkContainer *)parent, child); + gtk_container_add ((GtkContainer *) parent, child); shell_window->priv->menubar_box = child; g_object_bind_property ( diff --git a/shell/es-event.c b/shell/es-event.c index 6fc6751d3a..f079afd8b5 100644 --- a/shell/es-event.c +++ b/shell/es-event.c @@ -44,7 +44,7 @@ eme_init (GObject *o) static void eme_finalise (GObject *o) { - ((GObjectClass *)eme_parent)->finalize (o); + ((GObjectClass *) eme_parent)->finalize (o); } static void @@ -52,20 +52,20 @@ eme_target_free (EEvent *ep, EEventTarget *t) { switch (t->type) { case ES_EVENT_TARGET_STATE: { - ESEventTargetState *s = (ESEventTargetState *)t; + ESEventTargetState *s = (ESEventTargetState *) t; s = s; break; } } - ((EEventClass *)eme_parent)->target_free (ep, t); + ((EEventClass *) eme_parent)->target_free (ep, t); } static void eme_class_init (GObjectClass *klass) { klass->finalize = eme_finalise; - ((EEventClass *)klass)->target_free = eme_target_free; + ((EEventClass *) klass)->target_free = eme_target_free; } GType @@ -77,10 +77,10 @@ es_event_get_type (void) static const GTypeInfo info = { sizeof (ESEventClass), NULL, NULL, - (GClassInitFunc)eme_class_init, + (GClassInitFunc) eme_class_init, NULL, NULL, sizeof (ESEvent), 0, - (GInstanceInitFunc)eme_init + (GInstanceInitFunc) eme_init }; eme_parent = g_type_class_ref (e_event_get_type ()); type = g_type_register_static(e_event_get_type(), "ESEvent", &info, 0); @@ -189,7 +189,7 @@ emeh_finalise (GObject *o) { /*EPluginHook *eph = (EPluginHook *)o;*/ - ((GObjectClass *)emeh_parent_class)->finalize (o); + ((GObjectClass *) emeh_parent_class)->finalize (o); } static void @@ -204,13 +204,13 @@ emeh_class_init (EPluginHookClass *klass) * A hook for events coming from the shell. **/ - ((GObjectClass *)klass)->finalize = emeh_finalise; + ((GObjectClass *) klass)->finalize = emeh_finalise; ((EPluginHookClass *)klass)->id = "org.gnome.evolution.shell.events:1.0"; for (i=0;emeh_targets[i].type;i++) - e_event_hook_class_add_target_map ((EEventHookClass *)klass, &emeh_targets[i]); + e_event_hook_class_add_target_map ((EEventHookClass *) klass, &emeh_targets[i]); - ((EEventHookClass *)klass)->event = (EEvent *)es_event_peek (); + ((EEventHookClass *) klass)->event = (EEvent *) es_event_peek (); } GType -- cgit v1.2.3 From cb97c2dc8fd97b381af048f206333d5e557892ae Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 21 May 2011 10:02:58 -0400 Subject: Coding style and whitespace cleanup. --- shell/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/main.c b/shell/main.c index 62d19259aa..e6ba19a3e4 100644 --- a/shell/main.c +++ b/shell/main.c @@ -393,7 +393,8 @@ static GOptionEntry entries[] = { N_("Import URIs or file names given as rest of arguments."), NULL }, { "quit", 'q', 0, G_OPTION_ARG_NONE, &quit, N_("Request a running Evolution process to quit"), NULL }, - { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &remaining_args, NULL, NULL }, + { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, + &remaining_args, NULL, NULL }, { NULL } }; -- cgit v1.2.3 From f3c0b07212be3d3e5bcc7e1f9b904c675d488aab Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sat, 21 May 2011 17:26:46 -0400 Subject: Bug 650525 - Don't install a SEGV handler Assume the operating system ships with a system-wide crash catching service like ABRT or Apport. --- shell/main.c | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) (limited to 'shell') diff --git a/shell/main.c b/shell/main.c index e6ba19a3e4..94064034fa 100644 --- a/shell/main.c +++ b/shell/main.c @@ -266,55 +266,6 @@ idle_cb (gchar **uris) #ifndef G_OS_WIN32 -/* SIGSEGV handling. - - The GNOME SEGV handler will lose if it's not run from the main Gtk - thread. So if we have to redirect the signal if the crash happens in another - thread. */ - -static void (*gnome_segv_handler) (gint); -static GStaticMutex segv_mutex = G_STATIC_MUTEX_INIT; -static GThread *main_thread = NULL; - -static void -segv_redirect (gint sig) -{ - gnome_segv_handler (sig); - - if (g_thread_self () != main_thread) { - /* We can't return from the signal handler or the thread may - SEGV again. But we can't g_thread_exit, because then the - thread may get cleaned up before bug-buddy can get a stack - trace. So we block by trying to lock a mutex we know is - already locked. */ - g_static_mutex_lock (&segv_mutex); - } -} - -static void -setup_segv_redirect (void) -{ - struct sigaction sa, osa; - - sigaction (SIGSEGV, NULL, &osa); - if (osa.sa_handler == SIG_DFL) - return; - - main_thread = g_thread_self (); - - sa.sa_flags = 0; - sigemptyset (&sa.sa_mask); - sa.sa_handler = segv_redirect; - sigaction (SIGSEGV, &sa, NULL); - sigaction (SIGBUS, &sa, NULL); - sigaction (SIGFPE, &sa, NULL); - - sa.sa_handler = SIG_IGN; - sigaction (SIGXFSZ, &sa, NULL); - gnome_segv_handler = osa.sa_handler; - g_static_mutex_lock (&segv_mutex); -} - static void quit_signal (gint sig) { @@ -344,7 +295,6 @@ setup_quit_signal (void) } #else -#define setup_segv_redirect() (void)0 #define setup_quit_signal() (void)0 #endif @@ -671,7 +621,6 @@ main (gint argc, gchar **argv) gconf_client_set_bool (client, key, FALSE, NULL); } - setup_segv_redirect (); setup_quit_signal (); if (evolution_debug_log) { -- cgit v1.2.3 From 1d9a11e381c1c2d29af7852aa655b4a504b5a7af Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 21 May 2011 20:52:17 -0400 Subject: Handle SIGTERM instead of SIGQUIT. SIGQUIT is supposed to produce a core dump. We don't want that. --- shell/main.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'shell') diff --git a/shell/main.c b/shell/main.c index 94064034fa..cab5ab9717 100644 --- a/shell/main.c +++ b/shell/main.c @@ -267,13 +267,13 @@ idle_cb (gchar **uris) #ifndef G_OS_WIN32 static void -quit_signal (gint sig) +term_signal (gint sig) { EShell *shell; - g_return_if_fail (sig == SIGQUIT); + g_return_if_fail (sig == SIGTERM); - g_print ("Received quit signal...\n"); + g_print ("Received terminate signal...\n"); shell = e_shell_get_default (); @@ -282,20 +282,20 @@ quit_signal (gint sig) } static void -setup_quit_signal (void) +setup_term_signal (void) { struct sigaction sa, osa; - sigaction (SIGQUIT, NULL, &osa); + sigaction (SIGTERM, NULL, &osa); sa.sa_flags = 0; sigemptyset (&sa.sa_mask); - sa.sa_handler = quit_signal; - sigaction (SIGQUIT, &sa, NULL); + sa.sa_handler = term_signal; + sigaction (SIGTERM, &sa, NULL); } #else -#define setup_quit_signal() (void)0 +#define setup_term_signal() (void)0 #endif static GOptionEntry entries[] = { @@ -621,7 +621,7 @@ main (gint argc, gchar **argv) gconf_client_set_bool (client, key, FALSE, NULL); } - setup_quit_signal (); + setup_term_signal (); if (evolution_debug_log) { gint fd; -- cgit v1.2.3 From 82b7348f1964dca50519140e3cfc062baa2996ef Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sat, 21 May 2011 22:48:51 -0400 Subject: Bug 650524 - Use g_unix_signal_add_watch_full() for SIGTERM We can't call anything safely except write() inside a signal handler, g_unix_signal_add_watch_full() handles this for us nicely. --- shell/main.c | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) (limited to 'shell') diff --git a/shell/main.c b/shell/main.c index cab5ab9717..e1b768187d 100644 --- a/shell/main.c +++ b/shell/main.c @@ -26,6 +26,12 @@ #include #include +#ifdef G_OS_UNIX +#if GLIB_CHECK_VERSION(2,29,5) +#include +#endif +#endif + #if HAVE_CLUTTER #include #include @@ -264,38 +270,23 @@ idle_cb (gchar **uris) return FALSE; } -#ifndef G_OS_WIN32 - -static void -term_signal (gint sig) +#ifdef G_OS_UNIX +#if GLIB_CHECK_VERSION(2,29,5) +static gboolean +handle_term_signal (gpointer data) { EShell *shell; - g_return_if_fail (sig == SIGTERM); - g_print ("Received terminate signal...\n"); shell = e_shell_get_default (); if (shell != NULL) e_shell_quit (shell, E_SHELL_QUIT_OPTION); -} - -static void -setup_term_signal (void) -{ - struct sigaction sa, osa; - - sigaction (SIGTERM, NULL, &osa); - sa.sa_flags = 0; - sigemptyset (&sa.sa_mask); - sa.sa_handler = term_signal; - sigaction (SIGTERM, &sa, NULL); + return FALSE; } - -#else -#define setup_term_signal() (void)0 +#endif #endif static GOptionEntry entries[] = { @@ -621,7 +612,13 @@ main (gint argc, gchar **argv) gconf_client_set_bool (client, key, FALSE, NULL); } - setup_term_signal (); +#ifdef G_OS_UNIX +#if GLIB_CHECK_VERSION(2,29,5) + g_unix_signal_add_watch_full ( + SIGTERM, G_PRIORITY_DEFAULT, + handle_term_signal, NULL, NULL); +#endif +#endif if (evolution_debug_log) { gint fd; -- cgit v1.2.3 From cec324e80ae88463e97e79ce16806127b512f931 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 22 May 2011 11:04:27 -0400 Subject: Bug 650491 - Shell handles forwarding uris to existing process wrong This adds a "handle-uris" GAction which takes a string array argument, so the URIs can be passed to the primary process verbatim. --- shell/e-shell-utils.c | 4 +-- shell/e-shell-utils.h | 2 +- shell/e-shell.c | 70 +++++++++++++++++++++------------------------------ shell/e-shell.h | 2 +- shell/main.c | 2 +- 5 files changed, 34 insertions(+), 46 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-utils.c b/shell/e-shell-utils.c index 4676a2d2e9..43ddd0562c 100644 --- a/shell/e-shell-utils.c +++ b/shell/e-shell-utils.c @@ -282,7 +282,7 @@ exit: **/ guint e_shell_utils_import_uris (EShell *shell, - gchar **uris) + const gchar * const *uris) { GtkWindow *parent; GtkWidget *assistant; @@ -308,7 +308,7 @@ e_shell_utils_import_uris (EShell *shell, } else g_warning ("Cannot import any of the given URIs"); - return g_strv_length (uris); + return g_strv_length ((gchar **) uris); } /** diff --git a/shell/e-shell-utils.h b/shell/e-shell-utils.h index 178c26d20f..897981e0d0 100644 --- a/shell/e-shell-utils.h +++ b/shell/e-shell-utils.h @@ -44,7 +44,7 @@ GFile * e_shell_run_save_dialog (EShell *shell, gpointer customize_data); guint e_shell_utils_import_uris (EShell *shell, - gchar **uris); + const gchar * const *uris); void e_shell_hide_widgets_for_express_mode (EShell *shell, diff --git a/shell/e-shell.c b/shell/e-shell.c index d9c3508161..eb3cb8e407 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -235,6 +235,19 @@ shell_action_new_window_cb (GSimpleAction *action, e_shell_create_shell_window (shell, view_name); } +static void +shell_action_handle_uris_cb (GSimpleAction *action, + GVariant *parameter, + EShell *shell) +{ + const gchar **uris; + + /* Do not use g_strfreev() here. */ + uris = g_variant_get_strv (parameter, NULL); + e_shell_handle_uris (shell, uris, FALSE); + g_free (uris); +} + static void shell_action_quit_cb (GSimpleAction *action, GVariant *parameter, @@ -261,6 +274,14 @@ shell_add_actions (GApplication *application) g_simple_action_group_insert (action_group, G_ACTION (action)); g_object_unref (action); + action = g_simple_action_new ( + "handle-uris", G_VARIANT_TYPE_STRING_ARRAY); + g_signal_connect ( + action, "activate", + G_CALLBACK (shell_action_handle_uris_cb), application); + g_simple_action_group_insert (action_group, G_ACTION (action)); + g_object_unref (action); + action = g_simple_action_new ("quit", NULL); g_signal_connect ( action, "activate", @@ -810,29 +831,6 @@ shell_activate (GApplication *application) e_shell_create_shell_window (shell, NULL); } -static void -shell_open (GApplication *application, - GFile **files, - gint n_files, - const gchar *hint) -{ - EShell *shell; - gchar **uris; - gint ii; - - /* Do not chain up. Default method just emits a warning. */ - - shell = E_SHELL (application); - uris = g_new0 (gchar *, n_files + 1); - - for (ii = 0; ii < n_files; ii++) - uris[ii] = g_file_get_uri (files[ii]); - - e_shell_handle_uris (shell, uris, FALSE); - - g_strfreev (uris); -} - static void shell_quit_mainloop (GApplication *application) { @@ -878,7 +876,6 @@ e_shell_class_init (EShellClass *class) application_class = G_APPLICATION_CLASS (class); application_class->startup = shell_startup; application_class->activate = shell_activate; - application_class->open = shell_open; application_class->quit_mainloop = shell_quit_mainloop; class->window_destroyed = shell_window_destroyed; @@ -1516,7 +1513,7 @@ remote: /* Send a message to the other Evolution process. */ if (view_name != NULL) { g_action_group_activate_action ( - shell->priv->action_group, "new-window", + G_ACTION_GROUP (shell), "new-window", g_variant_new_string (view_name)); } else g_application_activate (G_APPLICATION (shell)); @@ -1536,12 +1533,11 @@ remote: /* Send a message to the other Evolution process. */ **/ guint e_shell_handle_uris (EShell *shell, - gchar **uris, + const gchar * const *uris, gboolean do_import) { - GFile **files; guint n_handled = 0; - guint length, ii; + guint ii; g_return_val_if_fail (E_IS_SHELL (shell), FALSE); g_return_val_if_fail (uris != NULL, FALSE); @@ -1569,21 +1565,13 @@ e_shell_handle_uris (EShell *shell, remote: /* Send a message to the other Evolution process. */ - length = g_strv_length (uris); - - files = g_new0 (GFile *, length + 1); - for (ii = 0; ii < length; ii++) - files[ii] = g_file_new_for_uri (uris[ii]); - - g_application_open (G_APPLICATION (shell), files, length, ""); - - for (ii = 0; ii < length; ii++) - g_object_unref (files[ii]); - g_free (files); + g_action_group_activate_action ( + G_ACTION_GROUP (shell), "handle-uris", + g_variant_new_strv (uris, -1)); /* As far as we're concerned, all URIs have been handled. */ - return length; + return g_strv_length ((gchar **) uris); } /** @@ -1995,7 +1983,7 @@ e_shell_quit (EShell *shell, remote: /* Send a message to the other Evolution process. */ g_action_group_activate_action ( - shell->priv->action_group, "quit", NULL); + G_ACTION_GROUP (shell), "quit", NULL); return TRUE; } diff --git a/shell/e-shell.h b/shell/e-shell.h index bbb11467fc..ede071e2e3 100644 --- a/shell/e-shell.h +++ b/shell/e-shell.h @@ -126,7 +126,7 @@ GConfClient * e_shell_get_gconf_client (EShell *shell); GtkWidget * e_shell_create_shell_window (EShell *shell, const gchar *view_name); guint e_shell_handle_uris (EShell *shell, - gchar **uris, + const gchar * const *uris, gboolean do_import); void e_shell_submit_alert (EShell *shell, EAlert *alert); diff --git a/shell/main.c b/shell/main.c index e1b768187d..95dc1b9ff4 100644 --- a/shell/main.c +++ b/shell/main.c @@ -246,7 +246,7 @@ show_development_warning (void) /* This is for doing stuff that requires the GTK+ loop to be running already. */ static gboolean -idle_cb (gchar **uris) +idle_cb (const gchar * const *uris) { EShell *shell; -- cgit v1.2.3 From 0a0fe0a2f5d1c32e15717c80c7a09763d86fde23 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 23 May 2011 21:59:58 -0400 Subject: Bug 649993 - Change behavior of --component option This is primarily for the GNOME Shell calendar. If, for example, "evolution --component calendar" is invoked and there is already an Evolution window opened to the calendar view, present that window. Otherwise open a new Evolution window to the requested view. Same behavior applies to all requested views. --- shell/e-shell.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'shell') diff --git a/shell/e-shell.c b/shell/e-shell.c index eb3cb8e407..60f145e7d0 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -229,9 +229,31 @@ shell_action_new_window_cb (GSimpleAction *action, GVariant *parameter, EShell *shell) { + GList *watched_windows; const gchar *view_name; view_name = g_variant_get_string (parameter, NULL); + watched_windows = e_shell_get_watched_windows (shell); + + /* Present the first EShellWindow showing 'view_name'. */ + while (watched_windows != NULL) { + GtkWindow *window = GTK_WINDOW (watched_windows->data); + + if (E_IS_SHELL_WINDOW (window)) { + const gchar *active_view; + + active_view = e_shell_window_get_active_view ( + E_SHELL_WINDOW (window)); + if (g_strcmp0 (active_view, view_name) == 0) { + gtk_window_present (window); + return; + } + } + + watched_windows = g_list_next (watched_windows); + } + + /* No suitable EShellWindow found, so create one. */ e_shell_create_shell_window (shell, view_name); } -- cgit v1.2.3 From ff9fcffeca2bdc37a91e0c2f0cb51f871a3cd7a1 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 24 May 2011 11:02:59 -0400 Subject: EMFolderTree: Add an EAlertSink property. Now EMFolderTree has access to both an EShellBackend and an EAlertSink; everything it needs to build and submit EActivity instances. --- shell/e-shell-sidebar.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'shell') diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c index d99e66ac61..b72a210300 100644 --- a/shell/e-shell-sidebar.c +++ b/shell/e-shell-sidebar.c @@ -27,6 +27,7 @@ #include "e-shell-sidebar.h" +#include #include #include #include @@ -50,10 +51,16 @@ enum { PROP_SHELL_VIEW }; +/* Forward Declarations */ +static void e_shell_sidebar_alert_sink_init + (EAlertSinkInterface *interface); + G_DEFINE_TYPE_WITH_CODE ( EShellSidebar, e_shell_sidebar, GTK_TYPE_BIN, + G_IMPLEMENT_INTERFACE ( + E_TYPE_ALERT_SINK, e_shell_sidebar_alert_sink_init) G_IMPLEMENT_INTERFACE ( E_TYPE_EXTENSIBLE, NULL)) @@ -299,6 +306,25 @@ shell_sidebar_forall (GtkContainer *container, container, include_internals, callback, callback_data); } +static void +shell_sidebar_submit_alert (EAlertSink *alert_sink, + EAlert *alert) +{ + EShellView *shell_view; + EShellContent *shell_content; + EShellSidebar *shell_sidebar; + + /* EShellSidebar is a proxy alert sink. Forward the alert + * to the EShellContent widget for display to the user. */ + + shell_sidebar = E_SHELL_SIDEBAR (alert_sink); + shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_content = e_shell_view_get_shell_content (shell_view); + + alert_sink = E_ALERT_SINK (shell_content); + e_alert_sink_submit_alert (alert_sink, alert); +} + static void e_shell_sidebar_class_init (EShellSidebarClass *class) { @@ -386,6 +412,12 @@ e_shell_sidebar_class_init (EShellSidebarClass *class) G_PARAM_CONSTRUCT_ONLY)); } +static void +e_shell_sidebar_alert_sink_init (EAlertSinkInterface *interface) +{ + interface->submit_alert = shell_sidebar_submit_alert; +} + static void e_shell_sidebar_init (EShellSidebar *shell_sidebar) { -- cgit v1.2.3 From 756c8abcb840b8da588031f4a0d7e1fc979fab70 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 27 May 2011 15:23:07 +0200 Subject: Bug #646109 - Fix use of include to make sure translations work --- shell/e-shell-backend.c | 4 ++++ shell/e-shell-common.h | 4 ---- shell/e-shell-content.c | 4 ++++ shell/e-shell-meego.c | 4 ++++ shell/e-shell-migrate.c | 4 ++++ shell/e-shell-searchbar.c | 5 ++++- shell/e-shell-settings.c | 4 ++++ shell/e-shell-sidebar.c | 4 ++++ shell/e-shell-switcher.c | 4 ++++ shell/e-shell-taskbar.c | 4 ++++ shell/e-shell-utils.c | 4 ++++ shell/e-shell-view.c | 4 ++++ shell/e-shell-window-actions.c | 4 ++++ shell/e-shell-window-private.c | 4 ++++ shell/e-shell-window.c | 4 ++++ shell/e-shell.c | 4 ++++ 16 files changed, 60 insertions(+), 5 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-backend.c b/shell/e-shell-backend.c index b1dadce99d..d8af58c6b3 100644 --- a/shell/e-shell-backend.c +++ b/shell/e-shell-backend.c @@ -27,6 +27,10 @@ * @include: shell/e-shell-backend.h **/ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "e-shell-backend.h" #include diff --git a/shell/e-shell-common.h b/shell/e-shell-common.h index 7ff35091aa..bb5529bd5c 100644 --- a/shell/e-shell-common.h +++ b/shell/e-shell-common.h @@ -22,10 +22,6 @@ #ifndef E_SHELL_COMMON_H #define E_SHELL_COMMON_H -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include #include diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index d32671e732..51ca37e92e 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -25,6 +25,10 @@ * @include: shell/e-shell-content.h **/ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "e-shell-content.h" #include diff --git a/shell/e-shell-meego.c b/shell/e-shell-meego.c index 2c95bef060..7bc23d5be4 100644 --- a/shell/e-shell-meego.c +++ b/shell/e-shell-meego.c @@ -21,6 +21,10 @@ * Chris Lord */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c index 6874c2e304..5863e1c4a0 100644 --- a/shell/e-shell-migrate.c +++ b/shell/e-shell-migrate.c @@ -19,6 +19,10 @@ * */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "e-shell-migrate.h" #include diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c index cf2f6ef1ee..e0c10c656a 100644 --- a/shell/e-shell-searchbar.c +++ b/shell/e-shell-searchbar.c @@ -25,9 +25,12 @@ * @include: shell/e-shell-searchbar.h **/ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "e-shell-searchbar.h" -#include #include #include "e-util/e-util.h" diff --git a/shell/e-shell-settings.c b/shell/e-shell-settings.c index e43139acb4..5e5f3428fe 100644 --- a/shell/e-shell-settings.c +++ b/shell/e-shell-settings.c @@ -25,6 +25,10 @@ * @include: shell/e-shell-settings.h **/ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "e-shell-settings.h" #include "e-util/gconf-bridge.h" diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c index b72a210300..abe37b7cbd 100644 --- a/shell/e-shell-sidebar.c +++ b/shell/e-shell-sidebar.c @@ -25,6 +25,10 @@ * @include: shell/e-shell-sidebar.h **/ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "e-shell-sidebar.h" #include diff --git a/shell/e-shell-switcher.c b/shell/e-shell-switcher.c index 594862df8a..f70697b8bc 100644 --- a/shell/e-shell-switcher.c +++ b/shell/e-shell-switcher.c @@ -25,6 +25,10 @@ * @include: shell/e-shell-switcher.h **/ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "e-shell-switcher.h" #include diff --git a/shell/e-shell-taskbar.c b/shell/e-shell-taskbar.c index 943a098dd2..1ddbd357e0 100644 --- a/shell/e-shell-taskbar.c +++ b/shell/e-shell-taskbar.c @@ -25,6 +25,10 @@ * @include: shell/e-shell-taskbar.h **/ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "e-shell-taskbar.h" #include diff --git a/shell/e-shell-utils.c b/shell/e-shell-utils.c index 43ddd0562c..749eb22bd5 100644 --- a/shell/e-shell-utils.c +++ b/shell/e-shell-utils.c @@ -25,6 +25,10 @@ * @include: shell/e-shell-utils.h **/ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "e-shell-utils.h" #include diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 43d843108d..10842014d4 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -25,6 +25,10 @@ * @include: shell/e-shell-view.h **/ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "e-shell-view.h" #include diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 60792ba5b6..cba0c52428 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -19,6 +19,10 @@ * */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "e-shell-window-private.h" #include "e-preferences-window.h" diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c index 613529419b..105e45e6a6 100644 --- a/shell/e-shell-window-private.c +++ b/shell/e-shell-window-private.c @@ -19,6 +19,10 @@ * */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "e-shell-window-private.h" static void diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index 7d8e6c5f85..25dfe43660 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -25,6 +25,10 @@ * @include: shell/e-shell-window.h **/ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "e-shell-window-private.h" enum { diff --git a/shell/e-shell.c b/shell/e-shell.c index 60f145e7d0..dbcb55b36a 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -25,6 +25,10 @@ * @include: shell/e-shell.h **/ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "e-shell.h" #include -- cgit v1.2.3 From 394e580dfdb04342c2e457ced400908e4dd5c88e Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 28 May 2011 10:18:56 -0400 Subject: Including directly is rarely needed. --- shell/e-shell-meego.c | 1 - shell/e-shell-meego.h | 2 ++ shell/es-event.c | 2 -- 3 files changed, 2 insertions(+), 3 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-meego.c b/shell/e-shell-meego.c index 7bc23d5be4..0845e63735 100644 --- a/shell/e-shell-meego.c +++ b/shell/e-shell-meego.c @@ -25,7 +25,6 @@ #include #endif -#include #include #ifndef G_OS_WIN32 diff --git a/shell/e-shell-meego.h b/shell/e-shell-meego.h index 54a7d528b4..ba0b23d50c 100644 --- a/shell/e-shell-meego.h +++ b/shell/e-shell-meego.h @@ -19,6 +19,8 @@ #ifndef E_SHELL_MEEGO_H #define E_SHELL_MEEGO_H +#include + extern void e_shell_detect_meego (gboolean *is_meego, gboolean *small_screen); #endif /* E_SHELL_MEEGO_H */ diff --git a/shell/es-event.c b/shell/es-event.c index f079afd8b5..7628f64869 100644 --- a/shell/es-event.c +++ b/shell/es-event.c @@ -27,8 +27,6 @@ #include #include -#include - #include "es-event.h" #include "e-shell.h" -- cgit v1.2.3 From de752b010fb47177e91b0fdaba86b8bed0953a23 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 28 May 2011 11:12:08 -0400 Subject: Including directly is rarely needed. --- shell/es-event.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'shell') diff --git a/shell/es-event.h b/shell/es-event.h index 9729d6f481..31823d118f 100644 --- a/shell/es-event.h +++ b/shell/es-event.h @@ -24,8 +24,6 @@ #ifndef __ES_EVENT_H__ #define __ES_EVENT_H__ -#include - #include "e-util/e-event.h" G_BEGIN_DECLS -- cgit v1.2.3 From f014ab82c81078d60cb1df8c986305c2cc9948c2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 4 Jun 2011 15:53:10 -0500 Subject: Coding style and whitespace cleanups. --- shell/e-shell-meego.c | 28 +++++++++------ shell/e-shell-migrate.c | 3 +- shell/es-event.c | 91 ++++++------------------------------------------- shell/es-event.h | 38 +-------------------- 4 files changed, 31 insertions(+), 129 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-meego.c b/shell/e-shell-meego.c index 0845e63735..6b5c0f22d0 100644 --- a/shell/e-shell-meego.c +++ b/shell/e-shell-meego.c @@ -90,24 +90,30 @@ e_shell_detect_meego (gboolean *is_meego, } display = gdk_display_get_default (); - screen = gdk_display_get_default_screen (gdk_display_get_default ()); + screen = gdk_display_get_default_screen (display); gdk_error_trap_push (); /* get the window manager's supporting window */ - fns.XGetWindowProperty (gdk_x11_display_get_xdisplay (display), - GDK_WINDOW_XID (gdk_screen_get_root_window (screen)), - gdk_x11_atom_to_xatom_for_display (display, wm_win), - 0, 1, False, XA_WINDOW, &dummy_t, &dummy_i, - &dummy_l, &dummy_l, (guchar **)(&wm_window_v)); + fns.XGetWindowProperty ( + gdk_x11_display_get_xdisplay (display), + GDK_WINDOW_XID (gdk_screen_get_root_window (screen)), + gdk_x11_atom_to_xatom_for_display (display, wm_win), + 0, 1, False, XA_WINDOW, + &dummy_t, &dummy_i, + &dummy_l, &dummy_l, + (guchar **) (&wm_window_v)); /* get the '_Moblin' setting */ if (wm_window_v && (*wm_window_v != None)) - fns.XGetWindowProperty (gdk_x11_display_get_xdisplay (display), *wm_window_v, - gdk_x11_atom_to_xatom_for_display (display, mob_atom), - 0, 8192, False, XA_STRING, - &dummy_t, &dummy_i, &dummy_l, &dummy_l, - &moblin_string); + fns.XGetWindowProperty ( + gdk_x11_display_get_xdisplay (display), + *wm_window_v, + gdk_x11_atom_to_xatom_for_display (display, mob_atom), + 0, 8192, False, XA_STRING, + &dummy_t, &dummy_i, + &dummy_l, &dummy_l, + &moblin_string); gdk_error_trap_pop_ignored (); } diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c index 5863e1c4a0..f5e1174729 100644 --- a/shell/e-shell-migrate.c +++ b/shell/e-shell-migrate.c @@ -846,7 +846,8 @@ merge_duplicate_local_sources (GConfClient *client, const gchar *gconf_key) if (g_strcmp0 (val1, val2) == 0) break; - /* relative uri should not be empty (but adressbook can have it empty) */ + /* relative uri should not be empty + * (but adressbook can have it empty) */ val1 = e_source_peek_relative_uri (dupe_source); val2 = e_source_peek_relative_uri (my_source); if (g_strcmp0 (val1, val2) == 0 && val1 && *val1) diff --git a/shell/es-event.c b/shell/es-event.c index 7628f64869..9d31f390e9 100644 --- a/shell/es-event.c +++ b/shell/es-event.c @@ -34,36 +34,14 @@ static GObjectClass *eme_parent; static ESEvent *es_event; static void -eme_init (GObject *o) -{ - /*ESEvent *eme = (ESEvent *)o; */ -} - -static void -eme_finalise (GObject *o) +eme_class_init (GObjectClass *class) { - ((GObjectClass *) eme_parent)->finalize (o); } static void -eme_target_free (EEvent *ep, EEventTarget *t) -{ - switch (t->type) { - case ES_EVENT_TARGET_STATE: { - ESEventTargetState *s = (ESEventTargetState *) t; - - s = s; - break; } - } - - ((EEventClass *) eme_parent)->target_free (ep, t); -} - -static void -eme_class_init (GObjectClass *klass) +eme_init (GObject *o) { - klass->finalize = eme_finalise; - ((EEventClass *) klass)->target_free = eme_target_free; + /*ESEvent *eme = (ESEvent *)o; */ } GType @@ -109,34 +87,6 @@ ESEvent *es_event_peek (void) return es_event; } -ESEventTargetShell * -es_event_target_new (ESEvent *eme) -{ - return e_event_target_new ( - &eme->event, ES_EVENT_TARGET_SHELL, - sizeof (ESEventTargetShell)); -} - -ESEventTargetState * -es_event_target_new_state (ESEvent *eme, gint state) -{ - ESEventTargetState *t; - guint32 mask = ~0; - - t = e_event_target_new ( - &eme->event, ES_EVENT_TARGET_STATE, sizeof (*t)); - t->state = state; - - if (state) - mask &= ~ES_EVENT_STATE_ONLINE; - else - mask &= ~ES_EVENT_STATE_OFFLINE; - - t->target.mask = mask; - - return t; -} - ESEventTargetUpgrade * es_event_target_new_upgrade (ESEvent *eme, gint major, gint minor, gint revision) { @@ -151,34 +101,13 @@ es_event_target_new_upgrade (ESEvent *eme, gint major, gint minor, gint revision return t; } -ESEventTargetComponent * -es_event_target_new_component (ESEvent *eme, const gchar *id) -{ - ESEventTargetComponent *t; - - t = e_event_target_new ( - &eme->event, ES_EVENT_TARGET_COMPONENT, sizeof (*t)); - t->id = id; - - return t; -} - /* ********************************************************************** */ static gpointer emeh_parent_class; #define emeh ((ESEventHook *)eph) -static const EEventHookTargetMask emeh_state_masks[] = { - { "online", ES_EVENT_STATE_ONLINE }, - { "offline", ES_EVENT_STATE_OFFLINE }, - { NULL } -}; - static const EEventHookTargetMap emeh_targets[] = { - { "state", ES_EVENT_TARGET_STATE, emeh_state_masks }, { "upgrade", ES_EVENT_TARGET_UPGRADE, NULL }, - { "shell", ES_EVENT_TARGET_SHELL, NULL }, - { "component", ES_EVENT_TARGET_COMPONENT, NULL }, { NULL } }; @@ -191,7 +120,7 @@ emeh_finalise (GObject *o) } static void -emeh_class_init (EPluginHookClass *klass) +emeh_class_init (EPluginHookClass *class) { gint i; @@ -202,13 +131,14 @@ emeh_class_init (EPluginHookClass *klass) * A hook for events coming from the shell. **/ - ((GObjectClass *) klass)->finalize = emeh_finalise; - ((EPluginHookClass *)klass)->id = "org.gnome.evolution.shell.events:1.0"; + ((GObjectClass *) class)->finalize = emeh_finalise; + ((EPluginHookClass *)class)->id = "org.gnome.evolution.shell.events:1.0"; for (i=0;emeh_targets[i].type;i++) - e_event_hook_class_add_target_map ((EEventHookClass *) klass, &emeh_targets[i]); + e_event_hook_class_add_target_map ( + (EEventHookClass *) class, &emeh_targets[i]); - ((EEventHookClass *) klass)->event = (EEvent *) es_event_peek (); + ((EEventHookClass *) class)->event = (EEvent *) es_event_peek (); } GType @@ -227,7 +157,8 @@ es_event_hook_get_type (void) }; emeh_parent_class = g_type_class_ref (e_event_hook_get_type ()); - type = g_type_register_static(e_event_hook_get_type(), "ESEventHook", &info, 0); + type = g_type_register_static ( + e_event_hook_get_type(), "ESEventHook", &info, 0); } return type; diff --git a/shell/es-event.h b/shell/es-event.h index 31823d118f..eba3f3d6b6 100644 --- a/shell/es-event.h +++ b/shell/es-event.h @@ -33,32 +33,10 @@ typedef struct _ESEventClass ESEventClass; /* Current target description */ enum _es_event_target_t { - ES_EVENT_TARGET_STATE, - ES_EVENT_TARGET_UPGRADE, - ES_EVENT_TARGET_SHELL, - ES_EVENT_TARGET_COMPONENT + ES_EVENT_TARGET_UPGRADE }; -/* Flags that qualify TARGET_STATE */ -enum { - ES_EVENT_STATE_ONLINE = 1<<0, - ES_EVENT_STATE_OFFLINE = 1<<1 -}; - -typedef struct _ESEventTargetState ESEventTargetState; typedef struct _ESEventTargetUpgrade ESEventTargetUpgrade; -typedef struct _ESEventTargetShell ESEventTargetShell; -typedef struct _ESEventTargetComponent ESEventTargetComponent; - -struct _ESEventTargetShell { - EEventTarget target; -}; - -struct _ESEventTargetState { - EEventTarget target; - - gint state; -}; struct _ESEventTargetUpgrade { EEventTarget target; @@ -68,12 +46,6 @@ struct _ESEventTargetUpgrade { gint revision; }; -struct _ESEventTargetComponent { - EEventTarget target; - - const gchar *id; -}; - typedef struct _EEventItem ESEventItem; /* The object */ @@ -89,19 +61,11 @@ struct _ESEventClass { GType es_event_get_type (void); ESEvent * es_event_peek (void); -ESEventTargetShell * - es_event_target_new (ESEvent *eme); -ESEventTargetState * - es_event_target_new_state (ESEvent *emp, - gint state); ESEventTargetUpgrade * es_event_target_new_upgrade (ESEvent *event, gint major, gint minor, gint revision); -ESEventTargetComponent * - es_event_target_new_component (ESEvent *event, - const gchar *id); /* ********************************************************************** */ -- cgit v1.2.3 From 985ad2d4a4f10954329f8b8ab645e3c7d2ceea0a Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 6 Jul 2011 19:46:14 -0400 Subject: EShellContent: Fix underallocation of EAlertBar. Keeps GTK+ from going crazy with runtime warnings. --- shell/e-shell-content.c | 81 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 54 insertions(+), 27 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index 51ca37e92e..886816330f 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -48,6 +48,10 @@ #include "e-shell-view.h" #include "e-shell-window-actions.h" +#define E_SHELL_CONTENT_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_SHELL_CONTENT, EShellContentPrivate)) + struct _EShellContentPrivate { gpointer shell_view; /* weak pointer */ @@ -150,7 +154,7 @@ shell_content_dispose (GObject *object) { EShellContentPrivate *priv; - priv = E_SHELL_CONTENT (object)->priv; + priv = E_SHELL_CONTENT_GET_PRIVATE (object); if (priv->shell_view != NULL) { g_object_remove_weak_pointer ( @@ -172,7 +176,7 @@ shell_content_finalize (GObject *object) { EShellContentPrivate *priv; - priv = E_SHELL_CONTENT (object)->priv; + priv = E_SHELL_CONTENT_GET_PRIVATE (object); g_free (priv->user_filename); @@ -218,27 +222,36 @@ shell_content_get_preferred_width (GtkWidget *widget, gint *natural) { EShellContentPrivate *priv; - gint min, nat; - gint child_min, child_nat; GtkWidget *child; - priv = E_SHELL_CONTENT (widget)->priv; + priv = E_SHELL_CONTENT_GET_PRIVATE (widget); *minimum = *natural = 0; child = gtk_bin_get_child (GTK_BIN (widget)); - gtk_widget_get_preferred_width (child, &child_min, &child_nat); - gtk_widget_get_preferred_width (priv->alert_bar, &min, &nat); + gtk_widget_get_preferred_width (child, minimum, natural); - *minimum = MAX (min, child_min); - *natural = MAX (nat, child_nat); + if (gtk_widget_get_visible (priv->alert_bar)) { + gint child_minimum; + gint child_natural; - if (priv->searchbar == NULL) - return; + gtk_widget_get_preferred_width ( + priv->alert_bar, &child_minimum, &child_natural); + + *minimum = MAX (*minimum, child_minimum); + *natural = MAX (*natural, child_natural); + } - gtk_widget_get_preferred_width (priv->searchbar, &min, &nat); - *minimum = MAX (*minimum, min); - *natural = MAX (*natural, nat); + if (priv->searchbar != NULL) { + gint child_minimum; + gint child_natural; + + gtk_widget_get_preferred_width ( + priv->searchbar, &child_minimum, &child_natural); + + *minimum = MAX (*minimum, child_minimum); + *natural = MAX (*natural, child_natural); + } } static void @@ -247,20 +260,34 @@ shell_content_get_preferred_height (GtkWidget *widget, gint *natural) { EShellContentPrivate *priv; - gint min, nat; GtkWidget *child; - priv = E_SHELL_CONTENT (widget)->priv; + priv = E_SHELL_CONTENT_GET_PRIVATE (widget); child = gtk_bin_get_child (GTK_BIN (widget)); gtk_widget_get_preferred_height (child, minimum, natural); - if (priv->searchbar == NULL) - return; + if (gtk_widget_get_visible (priv->alert_bar)) { + gint child_minimum; + gint child_natural; - gtk_widget_get_preferred_height (priv->searchbar, &min, &nat); - *minimum += min; - *natural += nat; + gtk_widget_get_preferred_height ( + priv->alert_bar, &child_minimum, &child_natural); + + *minimum += child_minimum; + *natural += child_natural; + } + + if (priv->searchbar != NULL) { + gint child_minimum; + gint child_natural; + + gtk_widget_get_preferred_height ( + priv->searchbar, &child_minimum, &child_natural); + + *minimum += child_minimum; + *natural += child_natural; + } } static void @@ -273,7 +300,7 @@ shell_content_size_allocate (GtkWidget *widget, GtkWidget *child; gint remaining_height; - priv = E_SHELL_CONTENT (widget)->priv; + priv = E_SHELL_CONTENT_GET_PRIVATE (widget); remaining_height = allocation->height; gtk_widget_set_allocation (widget, allocation); @@ -297,7 +324,8 @@ shell_content_size_allocate (GtkWidget *widget, remaining_height -= child_requisition.height; child_allocation.height = child_requisition.height; - gtk_widget_size_allocate (child, &child_allocation); + if (child_allocation.height > 0) + gtk_widget_size_allocate (child, &child_allocation); /* Search bar gets to be as tall as it wants (if we have one). */ @@ -332,7 +360,7 @@ shell_content_remove (GtkContainer *container, GtkContainerClass *container_class; EShellContentPrivate *priv; - priv = E_SHELL_CONTENT (container)->priv; + priv = E_SHELL_CONTENT_GET_PRIVATE (container); if (widget == priv->alert_bar) { gtk_widget_unparent (priv->alert_bar); @@ -359,7 +387,7 @@ shell_content_forall (GtkContainer *container, { EShellContentPrivate *priv; - priv = E_SHELL_CONTENT (container)->priv; + priv = E_SHELL_CONTENT_GET_PRIVATE (container); if (priv->alert_bar != NULL) callback (priv->alert_bar, callback_data); @@ -470,8 +498,7 @@ e_shell_content_alert_sink_init (EAlertSinkInterface *interface) static void e_shell_content_init (EShellContent *shell_content) { - shell_content->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - shell_content, E_TYPE_SHELL_CONTENT, EShellContentPrivate); + shell_content->priv = E_SHELL_CONTENT_GET_PRIVATE (shell_content); gtk_widget_set_has_window (GTK_WIDGET (shell_content), FALSE); } -- cgit v1.2.3 From d24bf99f46989bba098e3f4a19c3d0c7f706bb8a Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 10 Jul 2011 19:05:41 -0400 Subject: Bug 652634 - Runtime warning on second search dialog A signal handler connected to an EFilterRule was passing a GtkDialog instance as the closure. Eventually, the GtkDialog is destroyed but we never disconnected the signal handler. --- shell/e-shell-content.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index 886816330f..a109ffb4a7 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -641,6 +641,7 @@ e_shell_content_run_advanced_search_dialog (EShellContent *shell_content) EFilterRule *rule; ERuleContext *context; const gchar *user_filename; + gulong handler_id; gint response; EAlert *alert = NULL; @@ -675,7 +676,7 @@ e_shell_content_run_advanced_search_dialog (EShellContent *shell_content) content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); gtk_box_pack_start (GTK_BOX (content_area), widget, TRUE, TRUE, 0); - g_signal_connect_swapped ( + handler_id = g_signal_connect_swapped ( rule, "changed", G_CALLBACK ( shell_content_dialog_rule_changed), dialog); @@ -704,6 +705,8 @@ run: } exit: + g_signal_handler_disconnect (rule, handler_id); + g_object_unref (rule); gtk_widget_destroy (dialog); } @@ -744,6 +747,7 @@ e_shell_content_run_save_search_dialog (EShellContent *shell_content) ERuleContext *context; const gchar *user_filename; gchar *search_name; + gulong handler_id; gint response; EAlert *alert = NULL; @@ -778,7 +782,7 @@ e_shell_content_run_save_search_dialog (EShellContent *shell_content) content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); gtk_box_pack_start (GTK_BOX (content_area), widget, TRUE, TRUE, 0); - g_signal_connect_swapped ( + handler_id = g_signal_connect_swapped ( rule, "changed", G_CALLBACK ( shell_content_dialog_rule_changed), dialog); @@ -804,6 +808,8 @@ run: e_rule_context_save (context, user_filename); exit: + g_signal_handler_disconnect (rule, handler_id); + g_object_unref (rule); gtk_widget_destroy (dialog); } -- cgit v1.2.3 From a85e76fd0f824853014652c214bded61c957cc28 Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Thu, 28 Jul 2011 12:08:53 +0200 Subject: Replace user name by username as used anywhere else in Evolution --- shell/apps_evolution_shell.schemas.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/apps_evolution_shell.schemas.in b/shell/apps_evolution_shell.schemas.in index a0b94b3f49..dd5544284c 100644 --- a/shell/apps_evolution_shell.schemas.in +++ b/shell/apps_evolution_shell.schemas.in @@ -351,7 +351,7 @@ string HTTP proxy username - User name to pass as authentication when doing HTTP proxying. + Username to pass as authentication when doing HTTP proxying. -- cgit v1.2.3 From ce6f467e3e139926d3a4241429a0f2e9fcbf3294 Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Thu, 4 Aug 2011 18:08:32 +0200 Subject: Remove link to FAQ as content is covered by new user docs --- shell/e-shell-window-actions.c | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index cba0c52428..2700a5152f 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -36,9 +36,6 @@ #define EVOLUTION_COPYRIGHT \ "Copyright \xC2\xA9 1999 - 2008 Novell, Inc. and Others" -#define EVOLUTION_FAQ \ - "http://live.gnome.org/Evolution/FAQ" - #define EVOLUTION_WEBSITE \ "http://www.gnome.org/projects/evolution/" @@ -727,22 +724,6 @@ action_custom_rule_cb (GtkAction *action, e_shell_view_custom_search (shell_view, rule); } -/** - * E_SHELL_WINDOW_ACTION_FAQ: - * @window: an #EShellWindow - * - * Activation of this action opens a web page with answers to frequently - * asked questions about this application. - * - * Main menu item: Help -> Evolution FAQ - **/ -static void -action_faq_cb (GtkAction *action, - EShellWindow *shell_window) -{ - e_show_uri (GTK_WINDOW (shell_window), EVOLUTION_FAQ); -} - /** * E_SHELL_WINDOW_ACTION_FORGET_PASSWORDS: * @window: an #EShellWindow @@ -1488,13 +1469,6 @@ static GtkActionEntry shell_entries[] = { N_("Delete the selection"), NULL }, /* Handled by EFocusTracker */ - { "faq", - "help-faq", - N_("Evolution _FAQ"), - NULL, - N_("Open the Frequently Asked Questions webpage"), - G_CALLBACK (action_faq_cb) }, - { "forget-passwords", NULL, N_("_Forget Passwords"), -- cgit v1.2.3 From 0d4cdfbc9cd14569a3d4c8b75e54e74acca04033 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 8 Aug 2011 09:29:40 -0400 Subject: EShell: Remove unused macro. --- shell/e-shell-window-actions.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-window-actions.h b/shell/e-shell-window-actions.h index 3746fe92c8..42618ee89f 100644 --- a/shell/e-shell-window-actions.h +++ b/shell/e-shell-window-actions.h @@ -41,8 +41,6 @@ E_SHELL_WINDOW_ACTION ((window), "cut-clipboard") #define E_SHELL_WINDOW_ACTION_DELETE_SELECTION(window) \ E_SHELL_WINDOW_ACTION ((window), "delete-selection") -#define E_SHELL_WINDOW_ACTION_FAQ(window) \ - E_SHELL_WINDOW_ACTION ((window), "faq") #define E_SHELL_WINDOW_ACTION_FORGET_PASSWORDS(window) \ E_SHELL_WINDOW_ACTION ((window), "forget-passwords") #define E_SHELL_WINDOW_ACTION_GAL_CUSTOM_VIEW(window) \ -- cgit v1.2.3 From 5e3b6a4d268e3a4476b7b8cfd6a79e8a2328ffa0 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 28 Aug 2011 12:38:15 -0400 Subject: Fix build break in libeshell. --- shell/Makefile.am | 1 + 1 file changed, 1 insertion(+) (limited to 'shell') diff --git a/shell/Makefile.am b/shell/Makefile.am index fe0abd89b3..2b312038ba 100644 --- a/shell/Makefile.am +++ b/shell/Makefile.am @@ -12,6 +12,7 @@ eshellincludedir = $(privincludedir)/shell include $(top_srcdir)/glib-gen.mak glib_enum_headers=e-shell.h +glib_enum_output=e-shell-enumtypes glib_enum_define=E_SHELL glib_enum_prefix=e_shell -- cgit v1.2.3 From 3e3860e0ecc9f330c7c0df143641a01073ad976c Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 31 Aug 2011 12:30:56 -0400 Subject: Bug 657836 - Work around g_unix_signal API changes. Work around GLib API churn with regard to registering UNIX signal callbacks on the main loop. GLib >= 2.29.5 calls the function one thing, GLib >= 2.29.19 calls it another. --- shell/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/main.c b/shell/main.c index 95dc1b9ff4..8e1d533546 100644 --- a/shell/main.c +++ b/shell/main.c @@ -613,7 +613,11 @@ main (gint argc, gchar **argv) } #ifdef G_OS_UNIX -#if GLIB_CHECK_VERSION(2,29,5) +#if GLIB_CHECK_VERSION(2,29,19) + g_unix_signal_add_full ( + G_PRIORITY_DEFAULT, SIGTERM, + handle_term_signal, NULL, NULL); +#elif GLIB_CHECK_VERSION(2,29,5) g_unix_signal_add_watch_full ( SIGTERM, G_PRIORITY_DEFAULT, handle_term_signal, NULL, NULL); -- cgit v1.2.3 From fcbbdfbd18e15b4ee8322a0217cf03a689a5e033 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 16 Aug 2011 11:25:56 -0400 Subject: Coding style and whitespace cleanup. --- shell/e-shell-meego.c | 8 +++--- shell/e-shell-migrate.c | 7 ++--- shell/e-shell-switcher.c | 18 ++++++------- shell/e-shell-utils.c | 2 +- shell/e-shell-view.c | 3 ++- shell/e-shell-window-actions.c | 58 +++++++++++++++++++++++++----------------- shell/e-shell-window.c | 8 +++--- shell/es-event.c | 11 +++++--- shell/killev.c | 3 ++- shell/main.c | 3 ++- 10 files changed, 69 insertions(+), 52 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-meego.c b/shell/e-shell-meego.c index 6b5c0f22d0..1f1e3ee25e 100644 --- a/shell/e-shell-meego.c +++ b/shell/e-shell-meego.c @@ -54,9 +54,9 @@ e_shell_detect_meego (gboolean *is_meego, */ struct { gint (*XFree) (gpointer); - gint (*XGetWindowProperty) (Display*, XID, Atom, long, long, Bool, - Atom, Atom *, gint *, unsigned long*, - unsigned long*, guchar **); + gint (*XGetWindowProperty) (Display *, XID, Atom, long, long, Bool, + Atom, Atom *, gint *, gulong *, + gulong *, guchar **); } fns = { 0, 0 }; *is_meego = *small_screen = FALSE; @@ -67,7 +67,7 @@ e_shell_detect_meego (gboolean *is_meego, GdkDisplay *display; GdkAtom wm_win, mob_atom; Atom dummy_t; - unsigned long dummy_l; + gulong dummy_l; gint dummy_i; if (!gdk_display_get_default ()) diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c index f5e1174729..89f94b0f83 100644 --- a/shell/e-shell-migrate.c +++ b/shell/e-shell-migrate.c @@ -798,7 +798,8 @@ fix_folder_permissions (const gchar *data_dir) } static void -merge_duplicate_local_sources (GConfClient *client, const gchar *gconf_key) +merge_duplicate_local_sources (GConfClient *client, + const gchar *gconf_key) { ESourceList *source_list; GSList *iter, *to_remove = NULL; @@ -933,12 +934,12 @@ e_shell_migrate_attempt (EShell *shell) fix_folder_permissions (e_get_user_data_dir ()); /* Attempt to run migration all the time and let the backend - make the choice */ + * make the choice */ if (!shell_migrate_attempt (shell, major, minor, micro)) _exit (EXIT_SUCCESS); /* The 2.32.x (except of 2.32.2) lefts duplicate On This Computer/Personal sources, - thus clean the mess up */ + * thus clean the mess up */ merge_duplicate_local_sources (client, "/apps/evolution/addressbook/sources"); merge_duplicate_local_sources (client, "/apps/evolution/calendar/sources"); merge_duplicate_local_sources (client, "/apps/evolution/tasks/sources"); diff --git a/shell/e-shell-switcher.c b/shell/e-shell-switcher.c index f70697b8bc..1bfe01ef25 100644 --- a/shell/e-shell-switcher.c +++ b/shell/e-shell-switcher.c @@ -248,8 +248,8 @@ shell_switcher_dispose (GObject *object) static void shell_switcher_get_preferred_width (GtkWidget *widget, - gint *minimum, - gint *natural) + gint *minimum, + gint *natural) { EShellSwitcherPrivate *priv; GtkWidget *child; @@ -283,8 +283,8 @@ shell_switcher_get_preferred_width (GtkWidget *widget, static void shell_switcher_get_preferred_height (GtkWidget *widget, - gint *minimum, - gint *natural) + gint *minimum, + gint *natural) { EShellSwitcherPrivate *priv; GtkWidget *child; @@ -601,9 +601,9 @@ tool_item_get_button (GtkWidget *widget) } static gboolean -tool_item_button_cb (GtkWidget *internal_widget, - GdkEventButton *event, - GtkAction *action) +tool_item_button_cb (GtkWidget *internal_widget, + GdkEventButton *event, + GtkAction *action) { g_return_val_if_fail (GTK_IS_ACTION (action), FALSE); @@ -629,8 +629,8 @@ tool_item_button_cb (GtkWidget *internal_widget, **/ void e_shell_switcher_add_action (EShellSwitcher *switcher, - GtkAction *switch_action, - GtkAction *new_window_action) + GtkAction *switch_action, + GtkAction *new_window_action) { GtkWidget *widget; GtkButton *button; diff --git a/shell/e-shell-utils.c b/shell/e-shell-utils.c index 749eb22bd5..740960f555 100644 --- a/shell/e-shell-utils.c +++ b/shell/e-shell-utils.c @@ -160,7 +160,7 @@ GFile * e_shell_run_save_dialog (EShell *shell, const gchar *title, const gchar *suggestion, - const gchar *filters, + const gchar *filters, GtkCallback customize_func, gpointer customize_data) { diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 10842014d4..49e05baf36 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -247,7 +247,8 @@ shell_view_save_state_done_cb (GFile *file, } static EActivity * -shell_view_save_state (EShellView *shell_view, gboolean immediately) +shell_view_save_state (EShellView *shell_view, + gboolean immediately) { EShellBackend *shell_backend; SaveStateData *data; diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 2700a5152f..f389b4ea00 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1255,7 +1255,7 @@ action_switcher_cb (GtkRadioAction *action, static void action_new_view_window_cb (GtkAction *action, - EShellWindow *shell_window) + EShellWindow *shell_window) { EShell *shell; const gchar *view_name; @@ -2097,20 +2097,25 @@ e_shell_window_create_new_menu (EShellWindow *shell_window) } static GtkAction * -e_shell_window_create_switcher_action (GType type, EShellViewClass *class, - const gchar *name, const gchar *tooltip, - const gchar *view_name) +e_shell_window_create_switcher_action (GType type, + EShellViewClass *class, + const gchar *name, + const gchar *tooltip, + const gchar *view_name) { GtkAction *action; - action = g_object_new (type, "name", name, - "label", class->label, - "tooltip", tooltip, - "icon-name", class->icon_name, - NULL); + action = g_object_new ( + type, + "name", name, + "label", class->label, + "tooltip", tooltip, + "icon-name", class->icon_name, + NULL); - g_object_set_data (G_OBJECT (action), "view-name", - (gpointer) view_name); + g_object_set_data ( + G_OBJECT (action), + "view-name", (gpointer) view_name); return action; } @@ -2188,17 +2193,19 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) tooltip = g_strdup_printf (_("Switch to %s"), class->label); - s_action_name = g_strdup_printf (E_SHELL_SWITCHER_FORMAT, view_name); + s_action_name = g_strdup_printf ( + E_SHELL_SWITCHER_FORMAT, view_name); /* Note, we have to set "icon-name" separately because * gtk_radio_action_new() expects a "stock-id". Sadly, * GTK+ still distinguishes between the two. */ s_action = GTK_RADIO_ACTION ( - e_shell_window_create_switcher_action (GTK_TYPE_RADIO_ACTION, - class, s_action_name, - tooltip, view_name)); - g_object_set (G_OBJECT (s_action), "value", ii++, NULL); + e_shell_window_create_switcher_action ( + GTK_TYPE_RADIO_ACTION, + class, s_action_name, + tooltip, view_name)); + g_object_set (s_action, "value", ii++, NULL); gtk_radio_action_set_group (s_action, group); group = gtk_radio_action_get_group (s_action); @@ -2221,16 +2228,19 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) g_free (s_action_name); /* Create in new window actions */ - n_action_name = g_strdup_printf (E_SHELL_NEW_WINDOW_FORMAT, view_name); - n_action = e_shell_window_create_switcher_action (GTK_TYPE_ACTION, - class, n_action_name, - tooltip, view_name); - g_signal_connect (G_OBJECT (n_action), "activate", - G_CALLBACK (action_new_view_window_cb), - shell_window); + n_action_name = g_strdup_printf ( + E_SHELL_NEW_WINDOW_FORMAT, view_name); + n_action = e_shell_window_create_switcher_action ( + GTK_TYPE_ACTION, + class, n_action_name, + tooltip, view_name); + g_signal_connect ( + n_action, "activate", + G_CALLBACK (action_new_view_window_cb), shell_window); gtk_action_group_add_action (n_action_group, n_action); - e_shell_switcher_add_action (switcher, GTK_ACTION (s_action), n_action); + e_shell_switcher_add_action ( + switcher, GTK_ACTION (s_action), n_action); g_free (n_action_name); g_free (tooltip); diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index 25dfe43660..8e9f39c5ce 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -190,8 +190,8 @@ shell_window_set_shell (EShellWindow *shell_window, static void shell_window_set_property (GObject *object, guint property_id, - const GValue *value, - GParamSpec *pspec) + const GValue *value, + GParamSpec *pspec) { switch (property_id) { case PROP_ACTIVE_VIEW: @@ -249,8 +249,8 @@ shell_window_set_property (GObject *object, static void shell_window_get_property (GObject *object, guint property_id, - GValue *value, - GParamSpec *pspec) + GValue *value, + GParamSpec *pspec) { switch (property_id) { case PROP_ACTIVE_VIEW: diff --git a/shell/es-event.c b/shell/es-event.c index 9d31f390e9..f6920e5d09 100644 --- a/shell/es-event.c +++ b/shell/es-event.c @@ -88,7 +88,10 @@ ESEvent *es_event_peek (void) } ESEventTargetUpgrade * -es_event_target_new_upgrade (ESEvent *eme, gint major, gint minor, gint revision) +es_event_target_new_upgrade (ESEvent *eme, + gint major, + gint minor, + gint revision) { ESEventTargetUpgrade *t; @@ -112,7 +115,7 @@ static const EEventHookTargetMap emeh_targets[] = { }; static void -emeh_finalise (GObject *o) +emeh_finalize (GObject *o) { /*EPluginHook *eph = (EPluginHook *)o;*/ @@ -131,10 +134,10 @@ emeh_class_init (EPluginHookClass *class) * A hook for events coming from the shell. **/ - ((GObjectClass *) class)->finalize = emeh_finalise; + ((GObjectClass *) class)->finalize = emeh_finalize; ((EPluginHookClass *)class)->id = "org.gnome.evolution.shell.events:1.0"; - for (i=0;emeh_targets[i].type;i++) + for (i = 0; emeh_targets[i].type; i++) e_event_hook_class_add_target_map ( (EEventHookClass *) class, &emeh_targets[i]); diff --git a/shell/killev.c b/shell/killev.c index 948523dccb..f444fad0b8 100644 --- a/shell/killev.c +++ b/shell/killev.c @@ -107,7 +107,8 @@ kill_factories (void) } gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { GFile *pid_file; GFileMonitor *monitor; diff --git a/shell/main.c b/shell/main.c index 8e1d533546..fd0b0508e6 100644 --- a/shell/main.c +++ b/shell/main.c @@ -431,7 +431,8 @@ create_default_shell (void) } gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { EShell *shell; GConfClient *client; -- cgit v1.2.3 From bd4898c8a01f2fa9a7f6abadf91c2b51fd411695 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 14 Sep 2011 12:36:54 +0200 Subject: Make sure GConf schemas have defined default values --- shell/apps_evolution_shell.schemas.in | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'shell') diff --git a/shell/apps_evolution_shell.schemas.in b/shell/apps_evolution_shell.schemas.in index dd5544284c..09c376edda 100644 --- a/shell/apps_evolution_shell.schemas.in +++ b/shell/apps_evolution_shell.schemas.in @@ -8,6 +8,7 @@ /apps/evolution/version evolution string + Configuration version The configuration version of Evolution, with major/minor/configuration level (for example "2.6.0"). @@ -21,6 +22,7 @@ /apps/evolution/last_version evolution string + Last upgraded configuration version The last upgraded configuration version of Evolution, with major/minor/configuration level (for example "2.6.0"). @@ -63,6 +65,7 @@ /apps/evolution/shell/file_chooser_folder evolution string + Initial file chooser folder Initial folder for GtkFileChooser dialogs. @@ -103,6 +106,7 @@ /apps/evolution/shell/view_defaults/window_y evolution int + 0 Default window Y coordinate The default Y coordinate for the main window. @@ -114,6 +118,7 @@ /apps/evolution/shell/view_defaults/window_x evolution int + 0 Default window X coordinate The default X coordinate for the main window. @@ -149,7 +154,7 @@ /apps/evolution/shell/view_defaults/window_maximized evolution bool - TRUE + true Default window state Whether or not the window should be maximized. @@ -161,7 +166,7 @@ /apps/evolution/shell/view_defaults/buttons_visible evolution bool - TRUE + true Window buttons are visible Whether the window buttons should be visible. @@ -185,7 +190,7 @@ /apps/evolution/shell/view_defaults/toolbar_visible evolution bool - TRUE + true Toolbar is visible Whether the toolbar should be visible. @@ -197,7 +202,7 @@ /apps/evolution/shell/view_defaults/sidebar_visible evolution bool - TRUE + true Sidebar is visible Whether the sidebar should be visible. @@ -209,7 +214,7 @@ /apps/evolution/shell/view_defaults/statusbar_visible evolution bool - TRUE + true Statusbar is visible Whether the status bar should be visible. @@ -261,6 +266,7 @@ /apps/evolution/shell/network_config/http_port evolution int + 0 HTTP proxy port The port on the machine defined by "/apps/evolution/shell/network_config/http_host" that you proxy through. @@ -272,6 +278,7 @@ /apps/evolution/shell/network_config/http_host evolution string + HTTP proxy host name The machine name to proxy HTTP through. @@ -283,6 +290,7 @@ /apps/evolution/shell/network_config/secure_port evolution int + 0 Secure HTTP proxy port The port on the machine defined by "/apps/evolution/shell/network_config/secure_host" that you proxy through. @@ -294,6 +302,7 @@ /apps/evolution/shell/network_config/secure_host evolution string + Secure HTTP proxy host name The machine name to proxy secure HTTP through. @@ -305,6 +314,7 @@ /apps/evolution/shell/network_config/socks_port evolution int + 0 SOCKS proxy port The port on the machine defined by "/apps/evolution/shell/network_config/socks_host" that you proxy through. @@ -316,6 +326,7 @@ /apps/evolution/shell/network_config/socks_host evolution string + SOCKS proxy host name The machine name to proxy socks through. @@ -327,6 +338,7 @@ /apps/evolution/shell/network_config/use_http_proxy evolution bool + false Use HTTP proxy Enables the proxy settings when accessing HTTP/Secure HTTP over the Internet. @@ -338,6 +350,7 @@ /apps/evolution/shell/network_config/use_authentication evolution bool + false Authenticate proxy server connections If true, then connections to the proxy server require authentication. The username is retrieved from the "/apps/evolution/shell/network_config/authentication_user" GConf key, and the password is retrieved from either gnome-keyring or the ~/.gnome2_private/Evolution password file. @@ -349,6 +362,7 @@ /apps/evolution/shell/network_config/authentication_user evolution string + HTTP proxy username Username to pass as authentication when doing HTTP proxying. @@ -360,6 +374,7 @@ /apps/evolution/shell/network_config/authentication_password evolution string + HTTP proxy password Password to pass as authentication when doing HTTP proxying. @@ -372,6 +387,7 @@ evolution list string + [] Non-proxy hosts This key contains a list of hosts which are connected to directly, rather than via the proxy (if it is active). The values can be hostnames, domains (using an initial wildcard like *.foo.com), IP host addresses (both IPv4 and IPv6) and network addresses with a netmask (something like 192.168.0.0/24). @@ -383,6 +399,7 @@ /apps/evolution/shell/network_config/autoconfig_url evolution string + Automatic proxy configuration URL URL that provides proxy configuration values. -- cgit v1.2.3 From 53bc6ffc531d7a7188e15be245a31f301090ee15 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 10 Sep 2011 11:47:15 -0400 Subject: The EExtension framework is now in libebackend. The EModule, EExtensible and EExtension classes as well as the e_type_traverse() function have been moved to Evolution-Data-Server's libebackend library to replace e-data-server-module.c. Now Evolution-Data-Server modules use the same framework as Evolution. --- shell/e-shell-backend.h | 3 ++- shell/e-shell-content.c | 5 ++--- shell/e-shell-searchbar.c | 2 +- shell/e-shell-sidebar.c | 3 ++- shell/e-shell-switcher.c | 2 +- shell/e-shell-taskbar.c | 4 ++-- shell/e-shell-view.c | 2 +- shell/e-shell-window-private.h | 2 +- shell/e-shell.c | 6 +++--- 9 files changed, 15 insertions(+), 14 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-backend.h b/shell/e-shell-backend.h index 3364b16589..ae600bac3d 100644 --- a/shell/e-shell-backend.h +++ b/shell/e-shell-backend.h @@ -22,9 +22,10 @@ #ifndef E_SHELL_BACKEND_H #define E_SHELL_BACKEND_H +#include + #include #include -#include /* Standard GObject macros */ #define E_TYPE_SHELL_BACKEND \ diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index a109ffb4a7..c7a41510f2 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -32,12 +32,11 @@ #include "e-shell-content.h" #include +#include -#include "e-util/e-alert-dialog.h" -#include "e-util/e-alert-sink.h" -#include "e-util/e-extensible.h" #include "e-util/e-util.h" #include "e-util/e-alert-dialog.h" +#include "e-util/e-alert-sink.h" #include "filter/e-rule-editor.h" #include "widgets/misc/e-action-combo-box.h" #include "widgets/misc/e-alert-bar.h" diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c index e0c10c656a..13b0b49349 100644 --- a/shell/e-shell-searchbar.c +++ b/shell/e-shell-searchbar.c @@ -32,9 +32,9 @@ #include "e-shell-searchbar.h" #include +#include #include "e-util/e-util.h" -#include "e-util/e-extensible.h" #include "widgets/misc/e-action-combo-box.h" #include "widgets/misc/e-hinted-entry.h" diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c index abe37b7cbd..62652dee1f 100644 --- a/shell/e-shell-sidebar.c +++ b/shell/e-shell-sidebar.c @@ -31,8 +31,9 @@ #include "e-shell-sidebar.h" +#include + #include -#include #include #include diff --git a/shell/e-shell-switcher.c b/shell/e-shell-switcher.c index 1bfe01ef25..77c1fd2929 100644 --- a/shell/e-shell-switcher.c +++ b/shell/e-shell-switcher.c @@ -32,7 +32,7 @@ #include "e-shell-switcher.h" #include -#include +#include #define H_PADDING 6 #define V_PADDING 6 diff --git a/shell/e-shell-taskbar.c b/shell/e-shell-taskbar.c index 1ddbd357e0..adc0d27980 100644 --- a/shell/e-shell-taskbar.c +++ b/shell/e-shell-taskbar.c @@ -31,9 +31,9 @@ #include "e-shell-taskbar.h" -#include +#include -#include +#include #include struct _EShellTaskbarPrivate { diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 49e05baf36..370aa90403 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -33,8 +33,8 @@ #include #include +#include -#include "e-util/e-extensible.h" #include "e-util/e-file-utils.h" #include "e-util/e-plugin-ui.h" #include "e-util/e-ui-manager.h" diff --git a/shell/e-shell-window-private.h b/shell/e-shell-window-private.h index 6a9744d971..d36a3e64f6 100644 --- a/shell/e-shell-window-private.h +++ b/shell/e-shell-window-private.h @@ -28,12 +28,12 @@ #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/shell/e-shell.c b/shell/e-shell.c index dbcb55b36a..2954765d15 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -32,12 +32,12 @@ #include "e-shell.h" #include +#include +#include #include -#include "e-util/e-module.h" -#include "e-util/e-extensible.h" -#include "e-util/e-util-private.h" #include "e-util/e-util.h" +#include "e-util/e-util-private.h" #include "smclient/eggsmclient.h" #include "widgets/misc/e-preferences-window.h" -- cgit v1.2.3 From e2b6ff7a6c1e1580c26ee0719b349151e8dad6fd Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 27 Sep 2011 01:13:42 -0400 Subject: Miscellaneous cleanups from the account-mgmt branch. Reducing diff noise so I can see important changes easier when comparing branches. A few API changes, but nothing that affects functionality. --- shell/e-shell.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'shell') diff --git a/shell/e-shell.c b/shell/e-shell.c index 2954765d15..dce7b21070 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -46,6 +46,10 @@ #include "e-shell-window.h" #include "e-shell-utils.h" +#define E_SHELL_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_SHELL, EShellPrivate)) + struct _EShellPrivate { GQueue alerts; GList *watched_windows; @@ -739,7 +743,7 @@ shell_dispose (GObject *object) EShellPrivate *priv; EAlert *alert; - priv = E_SHELL (object)->priv; + priv = E_SHELL_GET_PRIVATE (object); while ((alert = g_queue_pop_head (&priv->alerts)) != NULL) { g_signal_handlers_disconnect_by_func ( @@ -787,7 +791,7 @@ shell_finalize (GObject *object) { EShellPrivate *priv; - priv = E_SHELL (object)->priv; + priv = E_SHELL_GET_PRIVATE (object); g_hash_table_destroy (priv->backends_by_name); g_hash_table_destroy (priv->backends_by_scheme); @@ -1226,8 +1230,7 @@ e_shell_init (EShell *shell) GtkIconTheme *icon_theme; EggSMClient *sm_client; - shell->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - shell, E_TYPE_SHELL, EShellPrivate); + shell->priv = E_SHELL_GET_PRIVATE (shell); backends_by_name = g_hash_table_new (g_str_hash, g_str_equal); backends_by_scheme = g_hash_table_new (g_str_hash, g_str_equal); -- cgit v1.2.3 From 3d98af62e582b48fe9c23c8f6e2397911cbce27c Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 29 Sep 2011 12:05:23 -0400 Subject: Require GLib 2.30. Drop all GLIB_CHECK_VERSION macros. --- shell/main.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'shell') diff --git a/shell/main.c b/shell/main.c index fd0b0508e6..bb056e3ded 100644 --- a/shell/main.c +++ b/shell/main.c @@ -27,10 +27,8 @@ #include #ifdef G_OS_UNIX -#if GLIB_CHECK_VERSION(2,29,5) #include #endif -#endif #if HAVE_CLUTTER #include @@ -271,7 +269,6 @@ idle_cb (const gchar * const *uris) } #ifdef G_OS_UNIX -#if GLIB_CHECK_VERSION(2,29,5) static gboolean handle_term_signal (gpointer data) { @@ -287,7 +284,6 @@ handle_term_signal (gpointer data) return FALSE; } #endif -#endif static GOptionEntry entries[] = { #ifdef G_OS_WIN32 @@ -614,15 +610,9 @@ main (gint argc, } #ifdef G_OS_UNIX -#if GLIB_CHECK_VERSION(2,29,19) g_unix_signal_add_full ( G_PRIORITY_DEFAULT, SIGTERM, handle_term_signal, NULL, NULL); -#elif GLIB_CHECK_VERSION(2,29,5) - g_unix_signal_add_watch_full ( - SIGTERM, G_PRIORITY_DEFAULT, - handle_term_signal, NULL, NULL); -#endif #endif if (evolution_debug_log) { -- cgit v1.2.3 From 1f38f4d92ca8eb97381b2c9a7022830a6d4bcaba Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 4 Oct 2011 21:32:41 -0400 Subject: Simplify library dependency flags. We have a confusing array of nearly-identical CFLAGS/LIBS definitions in configure.ac. Time to simplify. Instead let's just have one definition that includes all the libraries provided by Evolution-Data-Server (incl. Camel). That, in combination with GNOME_PLATFORM, gives us most of what we need for compliation and linking, and we can sprinkle definitions for additional library dependencies in Makefile.am's as needed. --- shell/Makefile.am | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'shell') diff --git a/shell/Makefile.am b/shell/Makefile.am index 2b312038ba..ad9a0bb308 100644 --- a/shell/Makefile.am +++ b/shell/Makefile.am @@ -61,9 +61,8 @@ libeshell_la_CPPFLAGS = \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ $(EGG_SMCLIENT_CFLAGS) \ - $(CLUTTER_CFLAGS) \ - $(TZDIALOG_CFLAGS) \ - $(SHELL_CFLAGS) + $(GTKHTML_CFLAGS) \ + $(CLUTTER_CFLAGS) libeshell_la_SOURCES = \ $(eshellinclude_HEADERS) \ @@ -99,8 +98,7 @@ libeshell_la_LIBADD = \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ $(EGG_SMCLIENT_LIBS) \ - $(CLUTTER_LIBS) \ - $(SHELL_LIBS) + $(CLUTTER_LIBS) # Evolution executable @@ -131,10 +129,10 @@ evolution_CPPFLAGS = \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ -DDATADIR=\""$(datadir)"\" \ -DLIBDIR=\""$(datadir)"\" \ + $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ - $(TZDIALOG_CFLAGS) \ - $(CLUTTER_CFLAGS) \ - $(SHELL_CFLAGS) + $(GTKHTML_CFLAGS) \ + $(CLUTTER_CFLAGS) evolution_SOURCES = \ main.c @@ -146,8 +144,7 @@ evolution_LDADD = \ $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/filter/libfilter.la \ - $(TZDIALOG_LIBS) \ - $(SHELL_LIBS) \ + $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ $(CLUTTER_LIBS) \ $(EVOLUTIONICON) -- cgit v1.2.3