aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-03-31 04:52:07 +0800
committerDan Winship <danw@src.gnome.org>2000-03-31 04:52:07 +0800
commit04b899a36eb4f2b7e8fca477f676186e94a192f4 (patch)
tree9573a5418af04caa347f87e13332664e7d65bea1
parent0a26a651fccbd80c5c9213495d4c786ffa130a92 (diff)
downloadgsoc2013-evolution-04b899a36eb4f2b7e8fca477f676186e94a192f4.tar.gz
gsoc2013-evolution-04b899a36eb4f2b7e8fca477f676186e94a192f4.tar.zst
gsoc2013-evolution-04b899a36eb4f2b7e8fca477f676186e94a192f4.zip
Hold off on deactivating the "outgoing" control until after setting up the
* shell/e-shell-view.c (e_shell_view_set_view): Hold off on deactivating the "outgoing" control until after setting up the "incoming" control. That way if the new control takes a few seconds to load, there won't be an ugly empty spot where the toolbar used to be while the new control loads. svn path=/trunk/; revision=2262
-rw-r--r--ChangeLog6
-rw-r--r--shell/e-shell-view.c57
2 files changed, 38 insertions, 25 deletions
diff --git a/ChangeLog b/ChangeLog
index ab4f092155..3ab5bd2ba3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2000-03-30 Dan Winship <danw@helixcode.com>
+ * shell/e-shell-view.c (e_shell_view_set_view): Hold off on
+ deactivating the "outgoing" control until after setting up the
+ "incoming" control. That way if the new control takes a few
+ seconds to load, there won't be an ugly empty spot where the
+ toolbar used to be while the new control loads.
+
* configure.in:
* Makefile.am:
* art/Makefile.am: install new shortcut bar pixmaps.
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 2061c9b329..bc6e1f6b24 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -131,11 +131,6 @@ get_view (EShellView *eshell_view, EFolder *efolder, Bonobo_UIHandler uih)
Evolution_ServiceRepository corba_sr;
BonoboObjectClient *server =
bonobo_widget_get_server (BONOBO_WIDGET (w));
- BonoboControlFrame *control_frame =
- bonobo_widget_get_control_frame (BONOBO_WIDGET (w));
-
- bonobo_control_frame_set_autoactivate (control_frame, FALSE);
- bonobo_control_frame_control_activate (control_frame);
/* Does this control have the "ServiceRepository" interface? */
corba_sr = (Evolution_ServiceRepository)
@@ -173,52 +168,64 @@ get_view (EShellView *eshell_view, EFolder *efolder, Bonobo_UIHandler uih)
void
e_shell_view_set_view (EShellView *eshell_view, EFolder *efolder)
{
- GtkNotebook *notebook = GTK_NOTEBOOK (eshell_view->priv->notebook);
- GtkWidget *folder_view = g_hash_table_lookup (
- eshell_view->priv->folder_views, efolder);
- int current_page = gtk_notebook_get_current_page (notebook);
+ GtkNotebook *notebook;
+ GtkWidget *folder_view;
+ int current_page;
+ BonoboControlFrame *control_frame;
g_assert (eshell_view);
g_assert (efolder);
+ notebook = GTK_NOTEBOOK (eshell_view->priv->notebook);
+ current_page = gtk_notebook_get_current_page (notebook);
+
if (current_page != -1) {
GtkWidget *current;
current = gtk_notebook_get_nth_page (notebook, current_page);
- bonobo_control_frame_control_deactivate (bonobo_widget_get_control_frame (BONOBO_WIDGET (current)));
- }
+ control_frame = bonobo_widget_get_control_frame (
+ BONOBO_WIDGET (current));
+ } else
+ control_frame = NULL;
- /* if we found a notebook page in our hash, that represents
- this efolder, switch to it */
+ /* If there's a notebook page in our hash that represents this
+ * efolder, switch to it.
+ */
+ 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);
gtk_notebook_set_page (notebook, notebook_page);
- bonobo_control_frame_control_activate (bonobo_widget_get_control_frame (BONOBO_WIDGET (folder_view)));
- }
- else {
- /* get a new control that represents this efolder,
- * append it to our notebook, and put it in our hash */
+ } else {
+ /* Get a new control that represents this efolder,
+ * append it to our notebook, and put it in our hash.
+ */
Bonobo_UIHandler uih =
bonobo_object_corba_objref (
BONOBO_OBJECT (eshell_view->uih));
-
- GtkWidget *w = get_view (eshell_view, efolder, uih);
int new_page_index;
- if (!w) return;
-
- gtk_notebook_append_page (notebook, w, NULL);
+ folder_view = get_view (eshell_view, efolder, uih);
+ if (!folder_view)
+ return;
+ gtk_notebook_append_page (notebook, folder_view, NULL);
new_page_index = gtk_notebook_page_num (notebook,
folder_view);
-
g_hash_table_insert (eshell_view->priv->folder_views,
- efolder, w);
+ efolder, folder_view);
gtk_notebook_set_page (notebook, new_page_index);
}
+
+ if (control_frame)
+ bonobo_control_frame_control_deactivate (control_frame);
+
+ control_frame =
+ bonobo_widget_get_control_frame (BONOBO_WIDGET (folder_view));
+ bonobo_control_frame_control_activate (control_frame);
}
GtkWidget *