aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-10-14 11:40:16 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-10-14 19:12:52 +0800
commit1e663aa13266cad55e5019c03e768a38955166eb (patch)
tree6d7a3e20d3a24f004d0db4ab1c06d8a768b2f112 /shell
parent3f58ba3d833953c29bb6aa5e1834e2f367f15202 (diff)
downloadgsoc2013-evolution-1e663aa13266cad55e5019c03e768a38955166eb.tar
gsoc2013-evolution-1e663aa13266cad55e5019c03e768a38955166eb.tar.gz
gsoc2013-evolution-1e663aa13266cad55e5019c03e768a38955166eb.tar.bz2
gsoc2013-evolution-1e663aa13266cad55e5019c03e768a38955166eb.tar.lz
gsoc2013-evolution-1e663aa13266cad55e5019c03e768a38955166eb.tar.xz
gsoc2013-evolution-1e663aa13266cad55e5019c03e768a38955166eb.tar.zst
gsoc2013-evolution-1e663aa13266cad55e5019c03e768a38955166eb.zip
Replace EBinding with GBinding.
GObject now does property bindings itself. Requires GLib >= 2.26.
Diffstat (limited to 'shell')
-rw-r--r--shell/e-shell-content.c1
-rw-r--r--shell/e-shell-searchbar.c56
-rw-r--r--shell/e-shell-sidebar.c16
-rw-r--r--shell/e-shell-utils.c16
-rw-r--r--shell/e-shell-view.c6
-rw-r--r--shell/e-shell-window-actions.c54
-rw-r--r--shell/e-shell-window-private.c44
-rw-r--r--shell/e-shell-window-private.h1
-rw-r--r--shell/e-shell-window.c38
9 files changed, 144 insertions, 88 deletions
diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c
index 527ef250a6..fd7645fe9f 100644
--- a/shell/e-shell-content.c
+++ b/shell/e-shell-content.c
@@ -29,7 +29,6 @@
#include <glib/gi18n.h>
-#include "e-util/e-binding.h"
#include "e-util/e-extensible.h"
#include "e-util/e-util.h"
#include "e-util/e-alert-dialog.h"
diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c
index ce433592b4..6597eb0597 100644
--- a/shell/e-shell-searchbar.c
+++ b/shell/e-shell-searchbar.c
@@ -31,7 +31,6 @@
#include <glib/gi18n-lib.h>
#include "e-util/e-util.h"
-#include "e-util/e-binding.h"
#include "e-util/e-extensible.h"
#include "widgets/misc/e-action-combo-box.h"
#include "widgets/misc/e-hinted-entry.h"
@@ -706,27 +705,33 @@ shell_searchbar_constructed (GObject *object)
action = E_SHELL_WINDOW_ACTION_SEARCH_CLEAR (shell_window);
- e_binding_new (
+ g_object_bind_property (
action, "sensitive",
- widget, "secondary-icon-sensitive");
- e_binding_new (
+ widget, "secondary-icon-sensitive",
+ G_BINDING_SYNC_CREATE);
+ g_object_bind_property (
action, "stock-id",
- widget, "secondary-icon-stock");
- e_binding_new (
+ widget, "secondary-icon-stock",
+ G_BINDING_SYNC_CREATE);
+ g_object_bind_property (
action, "tooltip",
- widget, "secondary-icon-tooltip-text");
+ widget, "secondary-icon-tooltip-text",
+ G_BINDING_SYNC_CREATE);
action = E_SHELL_WINDOW_ACTION_SEARCH_OPTIONS (shell_window);
- e_binding_new (
+ g_object_bind_property (
action, "sensitive",
- widget, "primary-icon-sensitive");
- e_binding_new (
+ widget, "primary-icon-sensitive",
+ G_BINDING_SYNC_CREATE);
+ g_object_bind_property (
action, "stock-id",
- widget, "primary-icon-stock");
- e_binding_new (
+ widget, "primary-icon-stock",
+ G_BINDING_SYNC_CREATE);
+ g_object_bind_property (
action, "tooltip",
- widget, "primary-icon-tooltip-text");
+ widget, "primary-icon-tooltip-text",
+ G_BINDING_SYNC_CREATE);
widget = GTK_WIDGET (searchbar);
gtk_size_group_add_widget (size_group, widget);
@@ -919,9 +924,10 @@ e_shell_searchbar_init (EShellSearchbar *searchbar)
widget = gtk_hbox_new (FALSE, 3);
gtk_box_pack_start (box, widget, FALSE, FALSE, 0);
- e_binding_new (
+ g_object_bind_property (
searchbar, "filter-visible",
- widget, "visible");
+ widget, "visible",
+ G_BINDING_SYNC_CREATE);
box = GTK_BOX (widget);
@@ -933,9 +939,10 @@ e_shell_searchbar_init (EShellSearchbar *searchbar)
gtk_box_pack_start (box, widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
- e_binding_new (
+ g_object_bind_property (
searchbar, "labels-visible",
- widget, "visible");
+ widget, "visible",
+ G_BINDING_SYNC_CREATE);
label = GTK_LABEL (widget);
@@ -952,9 +959,10 @@ e_shell_searchbar_init (EShellSearchbar *searchbar)
widget = gtk_hbox_new (FALSE, 3);
gtk_box_pack_start (box, widget, TRUE, TRUE, 0);
- e_binding_new (
+ g_object_bind_property (
searchbar, "search-visible",
- widget, "visible");
+ widget, "visible",
+ G_BINDING_SYNC_CREATE);
box = GTK_BOX (widget);
@@ -964,9 +972,10 @@ e_shell_searchbar_init (EShellSearchbar *searchbar)
gtk_box_pack_start (box, widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
- e_binding_new (
+ g_object_bind_property (
searchbar, "labels-visible",
- widget, "visible");
+ widget, "visible",
+ G_BINDING_SYNC_CREATE);
label = GTK_LABEL (widget);
@@ -1013,9 +1022,10 @@ e_shell_searchbar_init (EShellSearchbar *searchbar)
widget = gtk_hbox_new (FALSE, 3);
gtk_box_pack_start (box, widget, FALSE, FALSE, 0);
- e_binding_new (
+ g_object_bind_property (
searchbar, "scope-visible",
- widget, "visible");
+ widget, "visible",
+ G_BINDING_SYNC_CREATE);
box = GTK_BOX (widget);
diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c
index 4e4ace07c9..b56e4c061d 100644
--- a/shell/e-shell-sidebar.c
+++ b/shell/e-shell-sidebar.c
@@ -27,7 +27,6 @@
#include "e-shell-sidebar.h"
-#include <e-util/e-binding.h>
#include <e-util/e-extensible.h>
#include <e-util/e-unicode.h>
#include <shell/e-shell-view.h>
@@ -414,7 +413,10 @@ e_shell_sidebar_init (EShellSidebar *shell_sidebar)
gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
- e_binding_new (shell_sidebar, "icon-name", widget, "icon-name");
+ g_object_bind_property (
+ shell_sidebar, "icon-name",
+ widget, "icon-name",
+ G_BINDING_SYNC_CREATE);
widget = gtk_label_new (NULL);
gtk_label_set_ellipsize (GTK_LABEL (widget), PANGO_ELLIPSIZE_END);
@@ -428,7 +430,10 @@ e_shell_sidebar_init (EShellSidebar *shell_sidebar)
gtk_label_set_attributes (GTK_LABEL (widget), attribute_list);
pango_attr_list_unref (attribute_list);
- e_binding_new (shell_sidebar, "primary-text", widget, "label");
+ g_object_bind_property (
+ shell_sidebar, "primary-text",
+ widget, "label",
+ G_BINDING_SYNC_CREATE);
widget = gtk_label_new (NULL);
gtk_misc_set_alignment (GTK_MISC (widget), 1.0, 0.5);
@@ -441,7 +446,10 @@ e_shell_sidebar_init (EShellSidebar *shell_sidebar)
gtk_label_set_attributes (GTK_LABEL (widget), attribute_list);
pango_attr_list_unref (attribute_list);
- e_binding_new (shell_sidebar, "secondary-text", widget, "label");
+ g_object_bind_property (
+ shell_sidebar, "secondary-text",
+ widget, "label",
+ G_BINDING_SYNC_CREATE);
}
/**
diff --git a/shell/e-shell-utils.c b/shell/e-shell-utils.c
index ee1af8e3be..9d2d4ca584 100644
--- a/shell/e-shell-utils.c
+++ b/shell/e-shell-utils.c
@@ -29,7 +29,6 @@
#include <glib/gi18n-lib.h>
-#include "e-util/e-binding.h"
#include "widgets/misc/e-import-assistant.h"
/**
@@ -52,9 +51,10 @@ e_shell_configure_ui_manager (EShell *shell,
shell_settings = e_shell_get_shell_settings (shell);
- e_binding_new (
+ g_object_bind_property (
shell, "express-mode",
- ui_manager, "express-mode");
+ ui_manager, "express-mode",
+ G_BINDING_SYNC_CREATE);
}
/**
@@ -77,13 +77,15 @@ e_shell_configure_web_view (EShell *shell,
shell_settings = e_shell_get_shell_settings (shell);
#ifndef G_OS_WIN32
- e_binding_new (
+ g_object_bind_property (
shell_settings, "disable-printing",
- web_view, "disable-printing");
+ web_view, "disable-printing",
+ G_BINDING_SYNC_CREATE);
- e_binding_new (
+ g_object_bind_property (
shell_settings, "disable-save-to-disk",
- web_view, "disable-save-to-disk");
+ web_view, "disable-save-to-disk",
+ G_BINDING_SYNC_CREATE);
#endif
}
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index e6731af1b4..ab3f3973de 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -30,7 +30,6 @@
#include <string.h>
#include <glib/gi18n.h>
-#include "e-util/e-binding.h"
#include "e-util/e-extensible.h"
#include "e-util/e-file-utils.h"
#include "e-util/e-plugin-ui.h"
@@ -655,7 +654,10 @@ shell_view_construct_searchbar (EShellView *shell_view)
gtk_widget_show (GTK_WIDGET (item));
action = e_shell_view_get_action (shell_view);
- e_binding_new (action, "active", widget, "visible");
+ g_object_bind_property (
+ action, "active",
+ widget, "visible",
+ G_BINDING_SYNC_CREATE);
gtk_toolbar_insert (GTK_TOOLBAR (main_toolbar), item, -1);
diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c
index c619ac27cd..740adcc9f7 100644
--- a/shell/e-shell-window-actions.c
+++ b/shell/e-shell-window-actions.c
@@ -1937,45 +1937,59 @@ e_shell_window_actions_init (EShellWindow *shell_window)
g_object_set (ACTION (SEND_RECEIVE), "is-important", TRUE, NULL);
- e_mutual_binding_new (
+ g_object_bind_property (
shell_window, "sidebar-visible",
- ACTION (SHOW_SIDEBAR), "active");
+ ACTION (SHOW_SIDEBAR), "active",
+ G_BINDING_BIDIRECTIONAL |
+ G_BINDING_SYNC_CREATE);
- e_mutual_binding_new (
+ g_object_bind_property (
shell_window, "switcher-visible",
- ACTION (SHOW_SWITCHER), "active");
+ ACTION (SHOW_SWITCHER), "active",
+ G_BINDING_BIDIRECTIONAL |
+ G_BINDING_SYNC_CREATE);
- e_mutual_binding_new (
+ g_object_bind_property (
shell_window, "taskbar-visible",
- ACTION (SHOW_TASKBAR), "active");
+ ACTION (SHOW_TASKBAR), "active",
+ G_BINDING_BIDIRECTIONAL |
+ G_BINDING_SYNC_CREATE);
- e_mutual_binding_new (
+ g_object_bind_property (
shell_window, "toolbar-visible",
- ACTION (SHOW_TOOLBAR), "active");
+ ACTION (SHOW_TOOLBAR), "active",
+ G_BINDING_BIDIRECTIONAL |
+ G_BINDING_SYNC_CREATE);
- e_binding_new (
+ g_object_bind_property (
ACTION (SHOW_SIDEBAR), "active",
- ACTION (SHOW_SWITCHER), "sensitive");
+ ACTION (SHOW_SWITCHER), "sensitive",
+ G_BINDING_SYNC_CREATE);
- e_binding_new (
+ g_object_bind_property (
ACTION (SHOW_SIDEBAR), "active",
- ACTION (SWITCHER_STYLE_BOTH), "sensitive");
+ ACTION (SWITCHER_STYLE_BOTH), "sensitive",
+ G_BINDING_SYNC_CREATE);
- e_binding_new (
+ g_object_bind_property (
ACTION (SHOW_SIDEBAR), "active",
- ACTION (SWITCHER_STYLE_ICONS), "sensitive");
+ ACTION (SWITCHER_STYLE_ICONS), "sensitive",
+ G_BINDING_SYNC_CREATE);
- e_binding_new (
+ g_object_bind_property (
ACTION (SHOW_SIDEBAR), "active",
- ACTION (SWITCHER_STYLE_TEXT), "sensitive");
+ ACTION (SWITCHER_STYLE_TEXT), "sensitive",
+ G_BINDING_SYNC_CREATE);
- e_binding_new (
+ g_object_bind_property (
ACTION (SHOW_SIDEBAR), "active",
- ACTION (SWITCHER_STYLE_USER), "sensitive");
+ ACTION (SWITCHER_STYLE_USER), "sensitive",
+ G_BINDING_SYNC_CREATE);
- e_binding_new (
+ g_object_bind_property (
ACTION (SHOW_SIDEBAR), "active",
- ACTION (SWITCHER_MENU), "sensitive");
+ ACTION (SWITCHER_MENU), "sensitive",
+ G_BINDING_SYNC_CREATE);
/* Submitting bug reports requires bug-buddy. */
path = g_find_program_in_path ("bug-buddy");
diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c
index 200a56dbe6..5c4e1217ca 100644
--- a/shell/e-shell-window-private.c
+++ b/shell/e-shell-window-private.c
@@ -365,50 +365,62 @@ e_shell_window_private_constructed (EShellWindow *shell_window)
action_group = ACTION_GROUP (LOCKDOWN_PRINTING);
- e_binding_new_with_negation (
+ g_object_bind_property (
shell_settings, "disable-printing",
- action_group, "visible");
+ action_group, "visible",
+ G_BINDING_SYNC_CREATE |
+ G_BINDING_INVERT_BOOLEAN);
action_group = ACTION_GROUP (LOCKDOWN_PRINT_SETUP);
- e_binding_new_with_negation (
+ g_object_bind_property (
shell_settings, "disable-print-setup",
- action_group, "visible");
+ action_group, "visible",
+ G_BINDING_SYNC_CREATE |
+ G_BINDING_INVERT_BOOLEAN);
action_group = ACTION_GROUP (LOCKDOWN_SAVE_TO_DISK);
- e_binding_new_with_negation (
+ g_object_bind_property (
shell_settings, "disable-save-to-disk",
- action_group, "visible");
+ action_group, "visible",
+ G_BINDING_SYNC_CREATE |
+ G_BINDING_INVERT_BOOLEAN);
#endif
/* Bind GObject properties to GObject properties. */
action = ACTION (SEND_RECEIVE);
- e_binding_new (
+ g_object_bind_property (
shell, "online",
- action, "sensitive");
+ action, "sensitive",
+ G_BINDING_SYNC_CREATE);
action = ACTION (WORK_OFFLINE);
- e_binding_new (
+ g_object_bind_property (
shell, "online",
- action, "visible");
+ action, "visible",
+ G_BINDING_SYNC_CREATE);
- e_binding_new (
+ g_object_bind_property (
shell, "network-available",
- action, "sensitive");
+ action, "sensitive",
+ G_BINDING_SYNC_CREATE);
action = ACTION (WORK_ONLINE);
- e_binding_new_with_negation (
+ g_object_bind_property (
shell, "online",
- action, "visible");
+ action, "visible",
+ G_BINDING_SYNC_CREATE |
+ G_BINDING_INVERT_BOOLEAN);
- e_binding_new (
+ g_object_bind_property (
shell, "network-available",
- action, "sensitive");
+ action, "sensitive",
+ G_BINDING_SYNC_CREATE);
/* Bind GObject properties to GConf keys. */
diff --git a/shell/e-shell-window-private.h b/shell/e-shell-window-private.h
index de2b32471a..960fc74773 100644
--- a/shell/e-shell-window-private.h
+++ b/shell/e-shell-window-private.h
@@ -28,7 +28,6 @@
#include <glib/gi18n.h>
#include <e-util/e-util.h>
-#include <e-util/e-binding.h>
#include <e-util/e-plugin-ui.h>
#include <e-util/gconf-bridge.h>
#include <widgets/misc/e-import-assistant.h>
diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c
index e8be087560..7704fb5e71 100644
--- a/shell/e-shell-window.c
+++ b/shell/e-shell-window.c
@@ -359,8 +359,12 @@ shell_window_construct_menubar (EShellWindow *shell_window)
gtk_container_add ((GtkContainer *)parent, child);
shell_window->priv->menubar_box = child;
- e_mutual_binding_new (main_menu, "visible",
- child, "visible");
+ g_object_bind_property (
+ main_menu, "visible",
+ child, "visible",
+ G_BINDING_BIDIRECTIONAL |
+ G_BINDING_SYNC_CREATE);
+
main_menu = child;
}
@@ -392,9 +396,10 @@ shell_window_construct_toolbar (EShellWindow *shell_window)
box = gtk_hbox_new (FALSE, 0);
gtk_widget_show (box);
- e_binding_new (
+ g_object_bind_property (
shell_window, "toolbar-visible",
- box, "visible");
+ box, "visible",
+ G_BINDING_SYNC_CREATE);
toolbar = e_shell_window_get_managed_widget (
shell_window, "/main-toolbar");
@@ -460,13 +465,15 @@ shell_window_construct_sidebar (EShellWindow *shell_window)
switcher = e_shell_switcher_new ();
shell_window->priv->switcher = g_object_ref_sink (switcher);
- e_binding_new (
+ g_object_bind_property (
shell_window, "sidebar-visible",
- switcher, "visible");
+ switcher, "visible",
+ G_BINDING_SYNC_CREATE);
- e_binding_new (
+ g_object_bind_property (
shell_window, "switcher-visible",
- switcher, "toolbar-visible");
+ switcher, "toolbar-visible",
+ G_BINDING_SYNC_CREATE);
notebook = gtk_notebook_new ();
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE);
@@ -515,9 +522,10 @@ shell_window_construct_taskbar (EShellWindow *shell_window)
status_area = gtk_hbox_new (FALSE, 3);
gtk_container_set_border_width (GTK_CONTAINER (status_area), 3);
- e_binding_new (
+ g_object_bind_property (
shell_window, "taskbar-visible",
- status_area, "visible");
+ status_area, "visible",
+ G_BINDING_SYNC_CREATE);
/* Make the status area as large as the task bar. */
gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, NULL, &height);
@@ -528,13 +536,15 @@ shell_window_construct_taskbar (EShellWindow *shell_window)
GTK_BOX (status_area), online_button, FALSE, TRUE, 0);
gtk_widget_show (online_button);
- e_binding_new (
+ g_object_bind_property (
shell, "online",
- online_button, "online");
+ online_button, "online",
+ G_BINDING_SYNC_CREATE);
- e_binding_new (
+ g_object_bind_property (
shell, "network-available",
- online_button, "sensitive");
+ online_button, "sensitive",
+ G_BINDING_SYNC_CREATE);
g_signal_connect (
online_button, "clicked",