aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-view.c
diff options
context:
space:
mode:
authorMatthew Loper <mloper@src.gnome.org>2000-04-27 03:28:22 +0800
committerMatthew Loper <mloper@src.gnome.org>2000-04-27 03:28:22 +0800
commit0ad8dad44a2c002f2da596ae886dea2a544ff061 (patch)
treea97a7e30d4c1ceffd5cfbd32eb269b01b1d3e3d8 /shell/e-shell-view.c
parent04195ce9da66c08ae991f29de8a0f797ad246ace (diff)
downloadgsoc2013-evolution-0ad8dad44a2c002f2da596ae886dea2a544ff061.tar.gz
gsoc2013-evolution-0ad8dad44a2c002f2da596ae886dea2a544ff061.tar.zst
gsoc2013-evolution-0ad8dad44a2c002f2da596ae886dea2a544ff061.zip
+ * widgets/e-text/e-text.c (e_text_destroy): Kill text->timer and
+ text->timeout on destroy. + + * e-shell-view.c (bonobo_widget_is_dead): Helper function to see + whether a bonobo widget is a zombie (ie the remote bonobo control + died). + (e_shell_view_set_view): Try to respawn dead bonobo widgets. svn path=/trunk/; revision=2638
Diffstat (limited to 'shell/e-shell-view.c')
-rw-r--r--shell/e-shell-view.c92
1 files changed, 74 insertions, 18 deletions
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index d6f4eeed2b..838bc6ccb8 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -19,6 +19,7 @@
#include <bonobo.h>
#include <libgnorba/gnorba.h>
+#include <gtk/gtkprivate.h>
#define PARENT_TYPE gnome_app_get_type ()
@@ -32,8 +33,9 @@ struct _EShellViewPrivate
};
static void
-destroy_folder_view (EFolder *unused, GtkWidget *folder_view, gpointer unused2)
+destroy_folder_view (gpointer unused, gpointer pfolder_view, gpointer unused2)
{
+ GtkWidget *folder_view = GTK_WIDGET (pfolder_view);
BonoboWidget *bonobo_widget;
BonoboObject *bonobo_object;
CORBA_Object corba_control;
@@ -107,7 +109,7 @@ e_shell_view_setup_shortcut_display (EShellView *eshell_view)
eshell_view->hpaned = e_paned_new (TRUE);
- e_paned_insert (eshell_view->hpaned, 0,
+ e_paned_insert (E_PANED (eshell_view->hpaned), 0,
eshell_view->shortcut_bar,
100);
@@ -161,17 +163,21 @@ get_view (EShellView *eshell_view, EFolder *efolder, Bonobo_UIHandler uih)
BonoboControlFrame *cf;
w = bonobo_widget_new_control ("control:calendar", uih);
- cf = bonobo_widget_get_control_frame (BONOBO_WIDGET (w));
- pbc = bonobo_control_frame_get_control_property_bag (cf);
- /*pbc = bonobo_control_get_property_bag (w);*/
- user_cal_file =
- g_concat_dir_and_file (gnome_util_user_home (),
- ".gnome/user-cal.vcf");
-
- bonobo_property_bag_client_set_value_string (pbc,
- "calendar_uri",
- user_cal_file);
+ if (w) {
+ cf = bonobo_widget_get_control_frame (BONOBO_WIDGET (w));
+ pbc = bonobo_control_frame_get_control_property_bag (cf);
+ /*pbc = bonobo_control_get_property_bag (w);*/
+
+ user_cal_file =
+ g_concat_dir_and_file (gnome_util_user_home (),
+ ".gnome/user-cal.vcf");
+
+ bonobo_property_bag_client_set_value_string (pbc,
+ "calendar_uri",
+ user_cal_file);
+ }
+
break;
}
@@ -233,10 +239,10 @@ void e_shell_view_toggle_shortcut_bar (EShellView *eshell_view)
if (shortcut_bar->parent) {
gtk_widget_ref (shortcut_bar);
- e_paned_remove (hpaned, shortcut_bar);
+ e_paned_remove (E_PANED (hpaned), shortcut_bar);
}
else
- e_paned_insert (hpaned, 0, shortcut_bar,
+ e_paned_insert (E_PANED (hpaned), 0, shortcut_bar,
100);
gtk_widget_show_all (GTK_WIDGET (hpaned));
}
@@ -246,6 +252,24 @@ void e_shell_view_toggle_treeview (EShellView *eshell_view)
}
+static gboolean
+bonobo_widget_is_dead (BonoboWidget *bw)
+{
+ BonoboObject *boc = BONOBO_OBJECT (bonobo_widget_get_server (bw));
+ CORBA_Object obj = bonobo_object_corba_objref (boc);
+
+ CORBA_Environment ev;
+
+ gboolean is_dead = FALSE;
+
+ CORBA_exception_init (&ev);
+ if (CORBA_Object_non_existent(obj, &ev))
+ is_dead = TRUE;
+ CORBA_exception_free (&ev);
+
+ return is_dead;
+}
+
void
e_shell_view_set_view (EShellView *eshell_view, EFolder *efolder)
@@ -276,11 +300,43 @@ e_shell_view_set_view (EShellView *eshell_view, EFolder *efolder)
folder_view = g_hash_table_lookup (eshell_view->priv->folder_views,
efolder);
if (folder_view) {
- int notebook_page = gtk_notebook_page_num (notebook,
- folder_view);
- g_assert (notebook_page != -1);
+ int notebook_page;
+ g_assert (GTK_IS_NOTEBOOK (notebook));
+ g_assert (GTK_IS_WIDGET (folder_view));
+
+ notebook_page = gtk_notebook_page_num (notebook,
+ folder_view);
+ g_assert (notebook_page != -1);
+
+ /* a BonoboWidget can be a "zombie" in the sense that its
+ actual control is dead; if it's zombie, let's recreate it*/
+ if (bonobo_widget_is_dead (BONOBO_WIDGET (folder_view))) {
+
+ GtkWidget *parent = folder_view->parent;
+ Bonobo_UIHandler uih =
+ bonobo_object_corba_objref (
+ BONOBO_OBJECT (eshell_view->uih));
+
+ /* out with the old */
+ gtk_container_remove (GTK_CONTAINER (parent), folder_view);
+
+ /* in with the new */
+ folder_view = get_view (eshell_view, efolder, uih);
+ gtk_container_add (GTK_CONTAINER (parent), folder_view);
+
+ /* make sure it's in our hashtable, so we can get to
+ it from the shortcut bar */
+ g_hash_table_insert (eshell_view->priv->folder_views,
+ efolder, folder_view);
+ gtk_widget_show_all (folder_view);
+ }
+
+
gtk_notebook_set_page (notebook, notebook_page);
+
+ return;
+
} else {
/* Get a new control that represents this efolder,
* append it to our notebook, and put it in our hash.
@@ -345,7 +401,7 @@ e_shell_view_new (EShell *eshell, EFolder *efolder, gboolean show_shortcut_bar)
FALSE);
gtk_widget_show (eshell_view->priv->notebook);
-
+
e_paned_insert (E_PANED (eshell_view->hpaned),
1,
eshell_view->priv->notebook,
8-27 03:46:08 +0800'>2014-08-271-1/+1 * Stage chinese/fcitx-sunpinyinmarino2014-08-221-5/+1 * Berkeley DB cleanup, remove versions 4.0 ... 4.7.mandree2014-08-225-5/+5 * Stage chinese/sunpinyin and unbreak on FreeBSD 10+marino2014-08-212-1/+14 * chinese/kcfonts: Yes, it really is jobs unsafe. Believe me.marino2014-08-211-1/+1 * Add new port ibus-table-chinesemarino2014-08-195-0/+77 * Finish chinese/unzip removalantoine2014-08-181-1/+0 * Upgrade OpenEXR and ilmbase to 2.2.0.mandree2014-08-164-2/+4 * - Strip shared librarysunpoet2014-08-151-0/+3 * Merge 4 unzip slave ports into archivers/unzip as non-default optionsmarino2014-08-152-28/+0 * - Convert PYTHON_FEATURES to USE_PYTHON (which was landed several hours ago)sunpoet2014-08-151-1/+1 * - Use USES=pythonsunpoet2014-08-151-3/+2 * 1: Stagify.vanilla2014-08-082-18/+11 * Stagify.vanilla2014-08-082-22/+16 * Stagify.vanilla2014-08-081-6/+5 * 1: Stagify.vanilla2014-08-086-20/+18 * - Switch to USES=libtool, drop .la filesamdmi32014-08-062-3/+3 * In some straightforward situations, protect examples behind PORTEXAMPLES,adamw2014-08-062-4/+6 * - mark BROKEN on 11-CURRENTleeym2014-08-021-0/+4 * Fix patch.adamw2014-07-311-1/+1 * Fix patchadamw2014-07-311-3/+3 * Convert some more USE_BZIP2 to USES=tar:bzip2adamw2014-07-301-1/+1 * Convert a bunch of USE_XZ to USES=tar:xz.adamw2014-07-303-6/+3 * Rename all patches that contain '::' as a path separator, and useadamw2014-07-3011-0/+0 * Rename chinese/ patch-xy patches to reflect the files the modify.adamw2014-07-2830-18/+11 * Remove expired ports:rene2014-07-2514-263/+0 * Reset maintainership for ports not staged with no pending PRbapt2014-07-247-7/+7 * Remove backslashes from single- and double-quotes in COMMENT and _DESCadamw2014-07-231-1/+1 * - Switch to USES=libtoolamdmi32014-07-233-2/+22 * - Switch to USES=libtoolamdmi32014-07-231-2/+2 * Fix with TEX_DEFAULT=texlivebapt2014-07-221-2/+1 * Convert 6 chinese font ponts to include with .CURDIRmarino2014-07-206-18/+12 * - Fix MASTER_SITESsunpoet2014-07-191-1/+1 * chinese/moetff: MASTER_SITES is LOCAL/marino not LOCAL/MARINOmarino2014-07-191-1/+1 * chinese/moettf: Unbreak, stage, restore public distfilesmarino2014-07-192-33/+22 * - disable X11 by defaultleeym2014-07-195-38/+14 * Add OPTIONS_DEFINE=DOCS for ports with %%PORTDOCS%% in the plist.adamw2014-07-161-1/+1 * Correct all instances where OPTIONS_DEFINE was being overwrittenadamw2014-07-161-3/+1 * - Unbreaklwhsu2014-07-165-17/+14 * - fix improper stageleeym2014-07-152-2/+5 * - Simplify Makefilesunpoet2014-07-121-4/+0 * - add LICENSEleeym2014-07-101-1/+2 * Update to 1.5.0delphij2014-07-084-65/+34 * New port: The Chinese PinYin and Bopomofo conversion library.delphij2014-07-085-0/+101 * - Add LICENSEsunpoet2014-07-073-12/+14 * - Add LICENSEsunpoet2014-07-073-11/+12 * - Add LICENSEsunpoet2014-07-073-6/+8 * - support stageleeym2014-07-061-4/+3 * chinese/scim-tables: Add scim as BUILD_DEPENDS (dports)marino2014-07-051-1/+2 * Bump more ports that depend on libsqlite3.so:tijl2014-07-051-1/+1 * - remove MAN1leeym2014-07-051-1/+0 * - support stageleeym2014-07-053-11/+8 * - support stage and optionsleeym2014-07-053-25/+24 * Remove NOPORTDOCS.adamw2014-07-041-1/+3 * - Switch to USES=libtool, drop .la filesamdmi32014-07-032-8/+3 * - Switch to USES=libtool, drop .la filesamdmi32014-07-012-3/+3 * - Switch to USES=libtool, drop .la filesamdmi32014-07-012-3/+2 * this one should have gone as wellbapt2014-07-015-617/+0 * Removed unmaintained upstream xemacs ports and dependenciesbapt2014-07-011-1/+0 * - Take maintainershipsunpoet2014-07-013-3/+3 * multiple: reset gslin's maintainereadler2014-06-304-4/+4 * - Chase database/sqlite3 slib bumpmiwi2014-06-281-0/+1 * Mark as broken: almost all command call are hardcodedbapt2014-06-251-1/+2 * Update to 4.2.5.jkim2014-06-242-8/+8 * Deprecate ports failing to build with new utmpxantoine2014-06-242-0/+5 * Mark as broken: no distinfo providedbapt2014-06-231-1/+2 * - Switch to USES=libtool, drop .la filesamdmi32014-06-192-2/+3 * remove NO_STAGE, editors/joe staging ready already.vanilla2014-06-131-1/+0 * Support LIBS like LDFLAGS.tijl2014-06-112-3/+3 * Update to libreoffice 4.2.4bapt2014-06-112-8/+8 * chinese/bitchx: Bump to acquire MASTERDIR fix, stage toomarino2014-06-111-2/+1 * - Fix plist (clean up shared directory)amdmi32014-06-111-0/+1 * Remove all the bootstrap files (.bs) from the plists.mat2014-06-105-5/+0 * Remove indefinite articles and trailing periods from COMMENT, plusolgeni2014-06-0921-21/+21 * Remove all space characters from Makefile assignments.olgeni2014-06-091-2/+2 * - Support stagingbdrewery2014-06-061-1/+0 * Fix pkg-plist after previous commit.tijl2014-06-032-1/+2 * Properly respect CFLAGS, LDFLAGS, etc.tijl2014-06-033-22/+24 * - USE_(BZIP2|XZ) -> USES=tar:(bzip2|xz)ohauer2014-06-0216-31/+16 * Fix patch files to chase irc/irssi.vanilla2014-06-011-4/+11 * Unbreak: @exec/@unexec already handle the symlink in the plistantoine2014-05-312-6/+0 * Staging supportrafan2014-05-301-6/+5 * Staging supportrafan2014-05-301-4/+3 * Staging supportrafan2014-05-301-2/+1 * mail/mutt supports STAGE so does thisrafan2014-05-301-1/+0 * Convert to USES=dos2unixbapt2014-05-261-1/+1 * STAGEDIR support.hrs2014-05-252-9/+13 * Hand back to ports@.lx2014-05-241-1/+1 * Quote ${CC} and similar variables in MAKE_ARGS.tijl2014-05-211-1/+1 * Add missing patch file on prev commit, and fix building.vanilla2014-05-202-8/+25 * Make it possible to stage without privilege.delphij2014-05-202-1/+6 * Staging support, LICENSE, and remove pkg-plist in favor of PLIST_FILES.delphij2014-05-193-6/+10 * Support staging.vanilla2014-05-197-5/+56 * Mark BROKEN: Fails to patchantoine2014-05-181-0/+2 * Support STAGEDIR.vanilla2014-05-161-2/+0 * KDE/FreeBSD team presents KDE SC 4.12.5 and KDE Workspace 4.11.9!makc2014-05-112-4/+4 * - Update to 3.9.1sunpoet2014-05-112-3/+3 * Support stagebapt2014-05-091-19/+9 * Support stagebapt2014-05-092-2/+0 * chinese/exim: Unbreak on F10+ by satisfying explicit linking requirementsmarino2014-05-071-3/+4 * Update to 4.1.6.jkim2014-05-072-8/+8 * Convert all :U to :tu and :L to :tlbapt2014-05-051-1/+1 * - Update to 3.9sunpoet2014-04-272-23/+15 * - Update to 3.9sunpoet2014-04-272-23/+15 * Convert to USES=libtool.tijl2014-04-251-3/+3 * Remove the last @comment $FreeBSD$ from plists.mat2014-04-252-2/+0 * 1: fix pkg-plistvanilla2014-04-173-19/+30 * The FreeBSD x11@ and graphics team proudly presentszeising2014-04-17