aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-10-23 07:59:54 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-10-23 07:59:54 +0800
commit5125a8f870ed07b8bf477bda27a9a9fc814ebfad (patch)
treeaa0b180ee678e362cd9a3b9b8fd321366ad10645 /shell
parent93c01a6835f973afefba9de36823951717a868ed (diff)
downloadgsoc2013-evolution-5125a8f870ed07b8bf477bda27a9a9fc814ebfad.tar
gsoc2013-evolution-5125a8f870ed07b8bf477bda27a9a9fc814ebfad.tar.gz
gsoc2013-evolution-5125a8f870ed07b8bf477bda27a9a9fc814ebfad.tar.bz2
gsoc2013-evolution-5125a8f870ed07b8bf477bda27a9a9fc814ebfad.tar.lz
gsoc2013-evolution-5125a8f870ed07b8bf477bda27a9a9fc814ebfad.tar.xz
gsoc2013-evolution-5125a8f870ed07b8bf477bda27a9a9fc814ebfad.tar.zst
gsoc2013-evolution-5125a8f870ed07b8bf477bda27a9a9fc814ebfad.zip
No need to gtk_widget_show() the view anymore.
* e-shell-view-menu.c (command_open_folder_in_new_window): No need to gtk_widget_show() the view anymore. * e-shell-view.c (activate_shortcut_cb): No need to gtk_widget_show() the view anymore. * e-shell.c (impl_Shell_createNewView): Don't explicitly show the new view. (e_shell_create_view): gtk_widget_show() the new view and flush the GTK+ event loop before sending the ::interactive notification. (create_view): New helper function. (e_shell_create_view): Use it. (e_shell_create_view_from_settings): New. (e_shell_restore_from_settings): Use `e_shell_create_view_from_settings()'. svn path=/trunk/; revision=13918
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog23
-rw-r--r--shell/e-shell-view-menu.c2
-rw-r--r--shell/e-shell-view.c1
-rw-r--r--shell/e-shell.c98
-rw-r--r--shell/e-shell.h11
5 files changed, 99 insertions, 36 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 6a6fbde975..2e65cd6b7c 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,28 @@
2001-10-22 Ettore Perazzoli <ettore@ximian.com>
+ * e-shell-view-menu.c (command_open_folder_in_new_window): No need
+ to gtk_widget_show() the view anymore.
+
+ * e-shell-view.c (activate_shortcut_cb): No need to
+ gtk_widget_show() the view anymore.
+
+ * e-shell.c (impl_Shell_createNewView): Don't explicitly show the
+ new view.
+ (e_shell_create_view): gtk_widget_show() the new view and flush
+ the GTK+ event loop before sending the ::interactive notification.
+ (create_view): New helper function.
+ (e_shell_create_view): Use it.
+ (e_shell_create_view_from_settings): New.
+ (e_shell_restore_from_settings): Use
+ `e_shell_create_view_from_settings()'.
+
+2001-10-22 Ettore Perazzoli <ettore@ximian.com>
+
+ * e-shell-view-menu.c (command_open_folder_in_new_window): Don't
+ explicitly show the new view.
+
+2001-10-22 Ettore Perazzoli <ettore@ximian.com>
+
* evolution-shell-component.c (impl_unsetOwner): Remove the ping
timeout.
diff --git a/shell/e-shell-view-menu.c b/shell/e-shell-view-menu.c
index e32a1a9d92..3b3844d7b3 100644
--- a/shell/e-shell-view-menu.c
+++ b/shell/e-shell-view-menu.c
@@ -298,8 +298,6 @@ command_open_folder_in_new_window (BonoboUIComponent *uih,
uri = g_strconcat (E_SHELL_URI_PREFIX, get_path_for_folder_op (shell_view), NULL);
new_view = e_shell_create_view (shell, uri, shell_view);
g_free (uri);
-
- gtk_widget_show (GTK_WIDGET (new_view));
}
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 7d0f67c338..5e501d55a5 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -669,7 +669,6 @@ activate_shortcut_cb (EShortcutsView *shortcut_view,
EShellView *new_view;
new_view = e_shell_create_view (e_shell_view_get_shell (shell_view), uri, shell_view);
- gtk_widget_show (GTK_WIDGET (new_view));
} else {
e_shell_view_display_uri (shell_view, uri);
}
diff --git a/shell/e-shell.c b/shell/e-shell.c
index 6de1b38912..0b746c8589 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -349,8 +349,6 @@ impl_Shell_createNewView (PortableServer_Servant servant,
return CORBA_OBJECT_NIL;
}
- gtk_widget_show (GTK_WIDGET (shell_view));
-
shell_view_interface = e_shell_view_get_corba_interface (shell_view);
if (shell_view_interface == CORBA_OBJECT_NIL) {
CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
@@ -806,7 +804,7 @@ set_owner_on_components (EShell *shell)
}
-/* EShellView destruction callback. */
+/* EShellView handling and bookkeeping. */
static int
view_delete_event_cb (GtkWidget *widget,
@@ -854,6 +852,45 @@ view_destroy_cb (GtkObject *object,
}
}
+static EShellView *
+create_view (EShell *shell,
+ const char *uri,
+ EShellView *template_view)
+{
+ EShellPrivate *priv;
+ EShellView *view;
+ ETaskBar *task_bar;
+
+ priv = shell->priv;
+
+ view = e_shell_view_new (shell);
+
+ gtk_signal_connect (GTK_OBJECT (view), "delete_event",
+ GTK_SIGNAL_FUNC (view_delete_event_cb), shell);
+ gtk_signal_connect (GTK_OBJECT (view), "destroy",
+ GTK_SIGNAL_FUNC (view_destroy_cb), shell);
+
+ if (uri != NULL) {
+ if (!e_shell_view_display_uri (E_SHELL_VIEW (view), uri)) {
+ /* FIXME: Consider popping a dialog box up about how the provided URI does not
+ exist/could not be displayed. */
+ e_shell_view_display_uri (E_SHELL_VIEW (view), E_SHELL_VIEW_DEFAULT_URI);
+ }
+ }
+
+ shell->priv->views = g_list_prepend (shell->priv->views, view);
+
+ task_bar = e_shell_view_get_task_bar (view);
+ e_activity_handler_attach_task_bar (priv->activity_handler, task_bar);
+
+ if (template_view != NULL) {
+ e_shell_view_show_folder_bar (view, e_shell_view_folder_bar_shown (template_view));
+ e_shell_view_show_shortcut_bar (view, e_shell_view_shortcut_bar_shown (template_view));
+ }
+
+ return view;
+}
+
/* GtkObject methods. */
@@ -1204,37 +1241,42 @@ e_shell_create_view (EShell *shell,
{
EShellView *view;
EShellPrivate *priv;
- ETaskBar *task_bar;
g_return_val_if_fail (shell != NULL, NULL);
g_return_val_if_fail (E_IS_SHELL (shell), NULL);
priv = shell->priv;
- view = e_shell_view_new (shell);
+ view = create_view (shell, uri, template_view);
- gtk_signal_connect (GTK_OBJECT (view), "delete_event",
- GTK_SIGNAL_FUNC (view_delete_event_cb), shell);
- gtk_signal_connect (GTK_OBJECT (view), "destroy",
- GTK_SIGNAL_FUNC (view_destroy_cb), shell);
+ gtk_widget_show (GTK_WIDGET (view));
+ while (gtk_events_pending ())
+ gtk_main_iteration ();
- if (uri != NULL) {
- if (!e_shell_view_display_uri (E_SHELL_VIEW (view), uri)) {
- /* FIXME: Consider popping a dialog box up about how the provided URI does not
- exist/could not be displayed. */
- e_shell_view_display_uri (E_SHELL_VIEW (view), E_SHELL_VIEW_DEFAULT_URI);
- }
- }
+ set_interactive (shell, TRUE);
- shell->priv->views = g_list_prepend (shell->priv->views, view);
+ return view;
+}
- task_bar = e_shell_view_get_task_bar (view);
- e_activity_handler_attach_task_bar (priv->activity_handler, task_bar);
+EShellView *
+e_shell_create_view_from_settings (EShell *shell,
+ const char *uri,
+ EShellView *template_view,
+ int view_num,
+ gboolean *settings_found)
+{
+ EShellView *view;
- if (template_view != NULL) {
- e_shell_view_show_folder_bar (view, e_shell_view_folder_bar_shown (template_view));
- e_shell_view_show_shortcut_bar (view, e_shell_view_shortcut_bar_shown (template_view));
- }
+ g_return_val_if_fail (shell != NULL, NULL);
+ g_return_val_if_fail (E_IS_SHELL (shell), NULL);
+
+ view = create_view (shell, uri, template_view);
+
+ *settings_found = e_shell_view_load_settings (view, view_num);
+
+ gtk_widget_show (GTK_WIDGET (view));
+ while (gtk_events_pending ())
+ gtk_main_iteration ();
set_interactive (shell, TRUE);
@@ -1504,15 +1546,11 @@ e_shell_restore_from_settings (EShell *shell)
for (i = 0; i < num_views; i++) {
EShellView *view;
+ gboolean settings_found;
- view = e_shell_create_view (shell, NULL, NULL);
-
- if (! e_shell_view_load_settings (view, i))
+ view = e_shell_create_view_from_settings (shell, NULL, NULL, i, &settings_found);
+ if (! settings_found)
retval = FALSE;
-
- /* This needs to be done after loading the settings as the
- default size is in the settings as well. */
- gtk_widget_show (GTK_WIDGET (view));
}
return retval;
diff --git a/shell/e-shell.h b/shell/e-shell.h
index 8f413902bf..e3e9c929ba 100644
--- a/shell/e-shell.h
+++ b/shell/e-shell.h
@@ -100,9 +100,14 @@ EShell *e_shell_new (const char *local_director
gboolean show_splash,
EShellConstructResult *construct_result_return);
-EShellView *e_shell_create_view (EShell *shell,
- const char *uri,
- EShellView *template_view);
+EShellView *e_shell_create_view (EShell *shell,
+ const char *uri,
+ EShellView *template_view);
+EShellView *e_shell_create_view_from_settings (EShell *shell,
+ const char *uri,
+ EShellView *template_view,
+ int view_num,
+ gboolean *settings_found);
const char *e_shell_get_local_directory (EShell *shell);
EShortcuts *e_shell_get_shortcuts (EShell *shell);