aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-view.c
diff options
context:
space:
mode:
authorMichael Meeks <mmeeks@src.gnome.org>2000-09-14 07:40:42 +0800
committerMichael Meeks <mmeeks@src.gnome.org>2000-09-14 07:40:42 +0800
commit9964204c9c080650f79863a483a4c42886d55239 (patch)
tree3c0693385a73461319ab94b63fb15cbe80ae88e5 /shell/e-shell-view.c
parent5678a57e33c55ab2622a3fbb823b42e4f80c31cc (diff)
downloadgsoc2013-evolution-9964204c9c080650f79863a483a4c42886d55239.tar
gsoc2013-evolution-9964204c9c080650f79863a483a4c42886d55239.tar.gz
gsoc2013-evolution-9964204c9c080650f79863a483a4c42886d55239.tar.bz2
gsoc2013-evolution-9964204c9c080650f79863a483a4c42886d55239.tar.lz
gsoc2013-evolution-9964204c9c080650f79863a483a4c42886d55239.tar.xz
gsoc2013-evolution-9964204c9c080650f79863a483a4c42886d55239.tar.zst
gsoc2013-evolution-9964204c9c080650f79863a483a4c42886d55239.zip
The Commit from hell that breaks all UI related stuff;
Anything UI related that breaks is now my fault; apologies in advance. svn path=/trunk/; revision=5415
Diffstat (limited to 'shell/e-shell-view.c')
-rw-r--r--shell/e-shell-view.c101
1 files changed, 65 insertions, 36 deletions
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index f2a568b9b9..8ac1aef4ec 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -53,8 +53,7 @@
#include <widgets/e-paned/e-hpaned.h>
-#define PARENT_TYPE gnome_app_get_type () /* Losing GnomeApp does not define GNOME_TYPE_APP. */
-static GnomeAppClass *parent_class = NULL;
+static BonoboWinClass *parent_class = NULL;
struct _EShellViewPrivate {
/* The shell. */
@@ -425,10 +424,13 @@ static void
setup_widgets (EShellView *shell_view)
{
EShellViewPrivate *priv;
+#if 0
GtkWidget *progress_bar;
+#endif
priv = shell_view->priv;
+#if 0
/* The application bar. */
priv->appbar = gnome_appbar_new (TRUE, TRUE, GNOME_PREFERENCES_NEVER);
@@ -440,6 +442,7 @@ setup_widgets (EShellView *shell_view)
gtk_progress_bar_set_orientation (GTK_PROGRESS_BAR (progress_bar), GTK_PROGRESS_LEFT_TO_RIGHT);
gtk_progress_bar_set_bar_style (GTK_PROGRESS_BAR (progress_bar), GTK_PROGRESS_CONTINUOUS);
+#endif
/* The shortcut bar. */
@@ -485,7 +488,7 @@ setup_widgets (EShellView *shell_view)
e_paned_add2 (E_PANED (priv->hpaned), priv->view_vbox);
e_paned_set_position (E_PANED (priv->hpaned), DEFAULT_SHORTCUT_BAR_WIDTH);
- gnome_app_set_contents (GNOME_APP (shell_view), priv->hpaned);
+ bonobo_win_set_contents (BONOBO_WIN (shell_view), priv->hpaned);
/* Show stuff. */
@@ -503,7 +506,9 @@ setup_widgets (EShellView *shell_view)
priv->folder_bar_mode = E_SHELL_VIEW_SUBWINDOW_STICKY;
/* FIXME: Session management and stuff? */
- gtk_window_set_default_size (GTK_WINDOW (shell_view), DEFAULT_WIDTH, DEFAULT_HEIGHT);
+ gtk_window_set_default_size (
+ GTK_WINDOW (shell_view),
+ DEFAULT_WIDTH, DEFAULT_HEIGHT);
}
@@ -519,10 +524,10 @@ setup_bonobo_ui_handler (EShellView *shell_view)
uih = bonobo_ui_handler_new ();
- bonobo_ui_handler_set_app (uih, GNOME_APP (shell_view));
+ bonobo_ui_handler_set_app (uih, BONOBO_WIN (shell_view));
bonobo_ui_handler_create_menubar (uih);
- /* bonobo_ui_handler_create_toolbar (uih, "Toolbar"); */
- bonobo_ui_handler_set_statusbar (uih, priv->appbar);
+ bonobo_ui_handler_create_toolbar (uih, "Toolbar");
+/* bonobo_ui_handler_set_statusbar (uih, priv->appbar);*/
priv->uih = uih;
}
@@ -571,9 +576,6 @@ destroy (GtkObject *object)
static void
unrealize (GtkWidget *widget)
{
- if (GTK_WIDGET_CLASS (parent_class)->unrealize)
- (* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
-
/* We flush so that all the destroy window requests for foreign windows
* get sent over the X wire. Hopefully this will diminish the chance of
* hitting the CORBA (sync) vs. Xlib (async) race conditions. This is
@@ -587,13 +589,11 @@ static int
delete_event (GtkWidget *widget,
GdkEventAny *event)
{
- EShellView *shell_view;
EShell *shell;
- shell_view = E_SHELL_VIEW (widget);
-
- shell = e_shell_view_get_shell (shell_view);
+ shell = e_shell_view_get_shell (E_SHELL_VIEW (widget));
e_shell_quit (shell);
+
/* FIXME: Is this right, or should it be FALSE? */
return TRUE;
}
@@ -605,17 +605,12 @@ static void
class_init (EShellViewClass *klass)
{
GtkObjectClass *object_class;
- GtkWidgetClass *widget_class;
object_class = (GtkObjectClass *) klass;
- widget_class = (GtkWidgetClass *) klass;
object_class->destroy = destroy;
- widget_class->unrealize = unrealize;
- widget_class->delete_event = delete_event;
-
- parent_class = gtk_type_class (gnome_app_get_type ());
+ parent_class = gtk_type_class (BONOBO_WIN_TYPE);
signals[SHORTCUT_BAR_MODE_CHANGED]
= gtk_signal_new ("shortcut_bar_mode_changed",
@@ -683,16 +678,19 @@ init (EShellView *shell_view)
static int
progress_bar_timeout_cb (void *data)
{
+#if 0
EShellView *shell_view;
EShellViewPrivate *priv;
GtkWidget *progress_bar;
+#warning FIXME: I broke it
shell_view = E_SHELL_VIEW (data);
priv = shell_view->priv;
progress_bar = GNOME_APPBAR (GNOME_APP (shell_view)->statusbar)->progress;
priv->progress_bar_value = ! priv->progress_bar_value;
gtk_progress_set_value (GTK_PROGRESS (progress_bar), priv->progress_bar_value);
+#endif
return TRUE;
}
@@ -700,9 +698,11 @@ progress_bar_timeout_cb (void *data)
static void
start_progress_bar (EShellView *shell_view)
{
+#if 0
EShellViewPrivate *priv;
GtkWidget *progress_bar;
+#warning FIXME: I broke it
priv = shell_view->priv;
progress_bar = GNOME_APPBAR (GNOME_APP (shell_view)->statusbar)->progress;
@@ -715,14 +715,17 @@ start_progress_bar (EShellView *shell_view)
gtk_progress_set_activity_mode (GTK_PROGRESS (progress_bar), TRUE);
gtk_progress_set_value (GTK_PROGRESS (progress_bar), priv->progress_bar_value);
+#endif
}
static void
stop_progress_bar (EShellView *shell_view)
{
+#if 0
EShellViewPrivate *priv;
GtkWidget *progress_bar;
+#warning FIXME: I broke it
priv = shell_view->priv;
progress_bar = GNOME_APPBAR (GNOME_APP (shell_view)->statusbar)->progress;
@@ -733,6 +736,7 @@ stop_progress_bar (EShellView *shell_view)
gtk_progress_set_activity_mode (GTK_PROGRESS (progress_bar), FALSE);
gtk_progress_set_value (GTK_PROGRESS (progress_bar), 0);
+#endif
}
@@ -744,9 +748,11 @@ shell_view_interface_set_message_cb (EvolutionShellView *shell_view,
gboolean busy,
void *data)
{
+#if 0
GnomeApp *app;
GnomeAppBar *app_bar;
+#warning FIXME: I broke it
app = GNOME_APP (data);
app_bar = GNOME_APPBAR (app->statusbar);
@@ -773,38 +779,58 @@ shell_view_interface_set_message_cb (EvolutionShellView *shell_view,
start_progress_bar (E_SHELL_VIEW (data));
else
stop_progress_bar (E_SHELL_VIEW (data));
+#endif
}
static void
shell_view_interface_unset_message_cb (EvolutionShellView *shell_view,
void *data)
{
+#if 0
GnomeApp *app;
GnomeAppBar *app_bar;
+#warning FIXME: I broke it
app = GNOME_APP (data);
app_bar = GNOME_APPBAR (app->statusbar);
gnome_appbar_set_status (app_bar, "");
stop_progress_bar (E_SHELL_VIEW (data));
+#endif
}
-void
+EShellView *
e_shell_view_construct (EShellView *shell_view,
- EShell *shell)
+ EShell *shell)
{
EShellViewPrivate *priv;
+ Bonobo_UIContainer container;
+ EShellView *view;
+ GtkObject *window;
- g_return_if_fail (shell_view != NULL);
- g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
- g_return_if_fail (shell != NULL);
- g_return_if_fail (E_IS_SHELL (shell));
+ g_return_val_if_fail (shell != NULL, NULL);
+ g_return_val_if_fail (shell_view != NULL, NULL);
+ g_return_val_if_fail (E_IS_SHELL (shell), NULL);
+ g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
priv = shell_view->priv;
- gnome_app_construct (GNOME_APP (shell_view), "evolution", "Evolution");
+ view = E_SHELL_VIEW (bonobo_win_construct (
+ BONOBO_WIN (shell_view), "evolution", "Evolution"));
+
+ if (!view) {
+ gtk_object_unref (GTK_OBJECT (shell_view));
+ return NULL;
+ }
+
+ window = GTK_OBJECT (view);
+ gtk_signal_connect_after (window, "unrealize",
+ (GtkSignalFunc) unrealize, NULL);
+
+ gtk_signal_connect (window, "delete_event",
+ (GtkSignalFunc) delete_event, NULL);
priv->shell = shell;
@@ -814,9 +840,11 @@ e_shell_view_construct (EShellView *shell_view,
e_shell_view_menu_setup (shell_view);
e_shell_view_set_folder_bar_mode (shell_view, E_SHELL_VIEW_SUBWINDOW_HIDDEN);
+
+ return view;
}
-GtkWidget *
+EShellView *
e_shell_view_new (EShell *shell)
{
GtkWidget *new;
@@ -825,9 +853,8 @@ e_shell_view_new (EShell *shell)
g_return_val_if_fail (E_IS_SHELL (shell), NULL);
new = gtk_type_new (e_shell_view_get_type ());
- e_shell_view_construct (E_SHELL_VIEW (new), shell);
- return new;
+ return e_shell_view_construct (E_SHELL_VIEW (new), shell);
}
@@ -885,9 +912,11 @@ update_window_icon (EShellView *shell_view,
}
if (icon_path == NULL) {
- gnome_window_icon_set_from_default (GTK_WINDOW (shell_view));
+ gnome_window_icon_set_from_default (
+ GTK_WINDOW (shell_view));
} else {
- gnome_window_icon_set_from_file (GTK_WINDOW (shell_view), icon_path);
+ gnome_window_icon_set_from_file (
+ GTK_WINDOW (shell_view), icon_path);
g_free (icon_path);
}
}
@@ -1044,7 +1073,6 @@ get_control_for_uri (EShellView *shell_view,
EFolderTypeRegistry *folder_type_registry;
EStorageSet *storage_set;
EFolder *folder;
- Bonobo_UIHandler corba_uih;
EvolutionShellComponentClient *handler_client;
Bonobo_Control corba_control;
Evolution_ShellComponent handler;
@@ -1094,8 +1122,9 @@ get_control_for_uri (EShellView *shell_view,
CORBA_exception_free (&ev);
- corba_uih = bonobo_object_corba_objref (BONOBO_OBJECT (priv->uih));
- control = bonobo_widget_new_control_from_objref (corba_control, corba_uih);
+ control = bonobo_widget_new_control_from_objref (
+ corba_control,
+ bonobo_ui_compat_get_container (priv->uih));
setup_evolution_shell_view_interface (shell_view, control);
@@ -1459,4 +1488,4 @@ e_shell_view_load_settings (EShellView *shell_view,
}
-E_MAKE_TYPE (e_shell_view, "EShellView", EShellView, class_init, init, PARENT_TYPE)
+E_MAKE_TYPE (e_shell_view, "EShellView", EShellView, class_init, init, BONOBO_WIN_TYPE)