aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorMichael Meeks <michael@helixcode.com>2000-10-19 09:30:10 +0800
committerMichael Meeks <mmeeks@src.gnome.org>2000-10-19 09:30:10 +0800
commit85b15ae2a12828fdfd946133750705601ced2847 (patch)
treed935522aebf345a78f7406c472977c5c997e2103 /addressbook/gui
parent0e2492ca585ff69aae41b6b2b72a76c46daa7f47 (diff)
downloadgsoc2013-evolution-85b15ae2a12828fdfd946133750705601ced2847.tar.gz
gsoc2013-evolution-85b15ae2a12828fdfd946133750705601ced2847.tar.zst
gsoc2013-evolution-85b15ae2a12828fdfd946133750705601ced2847.zip
update to new UI handler. (update_view_type): split from
2000-10-19 Michael Meeks <michael@helixcode.com> * gui/component/addressbook.c (change_view_type): update to new UI handler. (update_view_type): split from (change_view_type). (control_activate): add an update_view_type. svn path=/trunk/; revision=6011
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/component/addressbook.c98
1 files changed, 53 insertions, 45 deletions
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index 51e6e297d3..b096b2bde7 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -46,8 +46,6 @@ typedef struct {
char *uri;
} AddressbookView;
-static void change_view_type (AddressbookView *view, EAddressbookViewType view_type);
-
static void
card_added_cb (EBook* book, EBookStatus status, const char *id,
gpointer user_data)
@@ -129,22 +127,6 @@ new_contact_cb (BonoboUIHandler *uih, void *user_data, const char *path)
gtk_object_sink(GTK_OBJECT(card));
}
-static void
-toggle_view_as_cb (BonoboUIHandler *uih, void *user_data, const char *path)
-{
- AddressbookView *view = user_data;
- EAddressbookViewType view_type;
-
- gtk_object_get(GTK_OBJECT(view),
- "type", &view_type,
- NULL);
-
- if (view_type == E_ADDRESSBOOK_VIEW_TABLE)
- change_view_type (view, E_ADDRESSBOOK_VIEW_MINICARD);
- else
- change_view_type (view, E_ADDRESSBOOK_VIEW_TABLE);
-}
-
#ifdef HAVE_LDAP
static void
null_cb (EBook *book, EBookStatus status, gpointer closure)
@@ -310,6 +292,57 @@ stop_loading_cb (BonoboUIHandler *uih, void *user_data, const char *path)
e_addressbook_view_stop(view->view);
}
+static void
+update_view_type (AddressbookView *view)
+{
+ BonoboUIComponent *uic = bonobo_control_get_ui_component (view->control);
+ EAddressbookViewType view_type;
+
+ if (!uic || bonobo_ui_component_get_container (uic) == CORBA_OBJECT_NIL)
+ return;
+
+ gtk_object_get (GTK_OBJECT (view->view), "type", &view_type, NULL);
+
+ switch (view_type) {
+ case E_ADDRESSBOOK_VIEW_TABLE:
+ if (uic)
+ bonobo_ui_component_set_prop (uic, "/menu/View/AsTable",
+ "label", N_("As _Minicards"), NULL);
+
+ break;
+ case E_ADDRESSBOOK_VIEW_MINICARD:
+ if (uic)
+ bonobo_ui_component_set_prop (uic, "/menu/View/AsTable",
+ "label", N_("As _Table"), NULL);
+ break;
+ default:
+ g_warning ("view_type must be either TABLE or MINICARD\n");
+ return;
+ }
+}
+
+static void
+change_view_type (AddressbookView *view, EAddressbookViewType view_type)
+{
+ gtk_object_set (GTK_OBJECT (view->view), "type", view_type, NULL);
+
+ update_view_type (view);
+}
+
+static void
+toggle_view_as_cb (BonoboUIHandler *uih, void *user_data, const char *path)
+{
+ AddressbookView *view = user_data;
+ EAddressbookViewType view_type;
+
+ gtk_object_get (GTK_OBJECT (view->view), "type", &view_type, NULL);
+
+ if (view_type == E_ADDRESSBOOK_VIEW_TABLE)
+ change_view_type (view, E_ADDRESSBOOK_VIEW_MINICARD);
+ else
+ change_view_type (view, E_ADDRESSBOOK_VIEW_TABLE);
+}
+
BonoboUIVerb verbs [] = {
BONOBO_UI_UNSAFE_VERB ("ContactsPrint", print_cb),
BONOBO_UI_UNSAFE_VERB ("ViewAsTable", toggle_view_as_cb),
@@ -366,6 +399,8 @@ control_activate (BonoboControl *control,
bonobo_object_corba_objref (BONOBO_OBJECT (search_control)),
NULL);
+ update_view_type (view);
+
bonobo_ui_component_thaw (uic, NULL);
}
@@ -515,33 +550,6 @@ set_prop (BonoboPropertyBag *bag,
}
}
-static void
-change_view_type (AddressbookView *view, EAddressbookViewType view_type)
-{
- BonoboUIHandler *uih = bonobo_control_get_ui_handler (view->control);
-
- gtk_object_set(GTK_OBJECT(view->view),
- "type", view_type,
- NULL);
-
- switch (view_type) {
- case E_ADDRESSBOOK_VIEW_TABLE:
- if (uih)
- bonobo_ui_handler_menu_set_label (uih, "/View/Toggle View",
- N_("As _Minicards"));
- break;
- case E_ADDRESSBOOK_VIEW_MINICARD:
- if (uih)
- bonobo_ui_handler_menu_set_label (uih, "/View/Toggle View",
- N_("As _Table"));
- break;
- default:
- g_warning ("view_type must be either TABLE or MINICARD\n");
- return;
- }
-}
-
-
BonoboControl *
addressbook_factory_new_control (void)
{
15-05-09 20:26:38 +0800'>2015-05-091-1/+2 * - Add CPE infoamdmi32015-05-091-1/+1 * Update to version 5.0.2pawel2015-05-082-3/+3 * Update ports in the [ef]* categories to not use GH_COMMIT.mat2015-05-066-15/+9 * - Update to 2.1.1wen2015-05-054-20/+21 * finance/electrum: Unbreak on DragonFly (staging)marino2015-04-281-2/+4 * - Simplify MASTER_SITESamdmi32015-04-231-3/+2 * - Update to 1.22sunpoet2015-04-232-3/+3 * - Update to 2.0.4amdmi32015-04-225-124/+169 * converters/libiconv:tijl2015-04-151-11/+0 * - Update to version 5.0.1pawel2015-04-153-9/+27 * - Add CPE infoamdmi32015-04-141-1/+1 * - Update to 2.6.6madpilot2015-04-114-12/+158 * Convert bsd.gnustep.mk to USES=gnustepbapt2015-04-091-4/+2 * Mark BROKEN: No public distfilesantoine2015-04-051-0/+2 * Upgrade to 1.57.vanilla2015-03-262-4/+4 * finance/php-tclink: Confirmed functional for all PHP versionsmarino2015-03-241-4/+1 * finance/R-cran-timeSeries: update to 3012.99.dbn2015-03-232-3/+3 * finance/R-cran-tseries: update to 0.10-34.dbn2015-03-232-4/+3 * php53 and fallout: Deprecate, set removal for 15 APR 2015marino2015-03-221-1/+4 * finance/libobx: Fix numerous issuesmarino2015-03-204-19/+18 * Update USE_GITHUB so it does not require GH_COMMIT.bdrewery2015-03-201-1/+1 * - Add LICENSEdecke2015-03-172-1/+3 * - Update to 2.15.2decke2015-03-173-45/+49 * Clean up the rest of the perl@ Makefiles a bit.adamw2015-03-143-15/+6 * finance/tryton28: version updaterm2015-03-0880-200/+160 * - Update to 4.12.2wen2015-03-072-3/+3 * - Update to 1.6.0.14wen2015-03-072-3/+3 * - Add PORTSCOUTsunpoet2015-03-071-0/+2 * Remove expired ports:rene2015-03-018-278/+0 * - Update to 4.7.1jhale2015-02-266-103/+169 * - Remove deprecated USE_KDE4=kdehiermakc2015-02-201-1/+1 * - Add LICENSEsunpoet2015-02-191-0/+3 * - Update to 1.37sunpoet2015-02-192-6/+5 * - Update to 3.1madpilot2015-02-134-66/+66 * Update to version 5.0.0pawel2015-02-123-99/+76 * Deprecate ports broken for more than 6 monthsantoine2015-01-301-0/+2 * Update finance/timeDate to 3012.100.dbn2015-01-292-3/+3 * - Upstream rerolled tarballtota2015-01-253-13/+68 * Switch some dependencies from a directory name or a file generated by pkg-ins...antoine2015-01-241-4/+4 * Python module to retrieve stock quote data from Yahoo Financeskreuzer2015-01-204-0/+24 * - Update to 1.6.0.11wen2015-01-203-7/+17 * - Update to 1.56wen2015-01-172-5/+6 * Properly depend on mysql server.ale2015-01-161-1/+1 * - Cosmetic changesunpoet2015-01-131-6/+1 * - Update to 3.03sunpoet2015-01-132-9/+5 * Update to 1.21.tobez2015-01-103-6/+3 * - Update to 4.11.5wen2015-01-102-3/+3 * Allow building with libc++ r224926antoine2015-01-102-0/+22 * - Convert <OPTION>_USE= PYTHON... to <OPTION>_USES= python...mva2015-01-031-1/+1 * - Add LICENSEsunpoet2015-01-022-4/+9 * Fix the build on 9.x and 8.x after the update of webkit-gtk2.kwm2014-12-311-0/+5 * Change my non-FreeBSD MAINTAINER mail to bofh@bofh2014-12-244-4/+4 * Update to 2.6.5madpilot2014-12-225-85/+95 * Get rid of gnomehierbapt2014-12-212-2/+4 * Cleanup plistbapt2014-12-211-1/+0 * - Update to version 0.92.3 [1]pawel2014-12-072-6/+10 * Update finance/R-cran-fBasics to 3011.87.dbn2014-12-052-4/+3 * - Update to 1.48jhale2014-12-013-5/+5 * Update to 1.10.0.rakuco2014-12-013-5/+58 * Split devel/gettext in devel/gettext-runtime and devel/gettext-tools. Thetijl2014-11-302-3/+3 * Change the way Perl modules are installed, update the default Perl to 5.18.mat2014-11-2684-66/+43 * Cleanup plistantoine2014-11-132-3/+3 * - Update to 1.6.0.9wen2014-11-082-4/+3 * Update finance/R-cran-timeSeries to 3011.98dbn2014-11-012-4/+3