aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog26
-rw-r--r--shell/e-shell-view-menu.c309
-rw-r--r--shell/e-shell-view.c101
-rw-r--r--shell/e-shell-view.h11
-rw-r--r--shell/e-shell.c34
-rw-r--r--shell/e-shell.h16
-rw-r--r--shell/e-storage-set-view.c2
-rw-r--r--shell/main.c2
8 files changed, 213 insertions, 288 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 2324654892..45a345993d 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,29 @@
+2000-09-07 Michael Meeks <michael@helixcode.com>
+
+ * e-shell-view-menu.c: Re-hash pretty much the whole file
+
+ * ui.xml: Add.
+
+ * e-shell-view.c (e_shell_view_construct): connect unrealize & delete_event
+ to theit signals on the window (class_init): remove widget_class bits.
+
+2000-09-06 Michael Meeks <michael@helixcode.com>
+
+ * e-shell.c (view_destroy_cb, destroy, e_shell_new_view, e_shell_quit):
+ update to track object type change.
+
+ * e-shell.c (e_shell_restore_from_settings): ditto.
+
+ * main.c (idle_cb): ditto.
+
+ * e-shell-view.c (e_shell_view_new, e_shell_view_construct, setup_widgets):
+ updated for BonoboApp.
+ (progress_bar_timeout_cb, start_progress_bar, stop_progress_bar),
+ (shell_view_interface_set_message_cb, shell_view_interface_unset_message_cb):
+ emasculated for now.
+
+ * e-storage-set-view.c (popup_folder_menu): disable popup menu for now.
+
2000-09-13 Ettore Perazzoli <ettore@helixcode.com>
* e-shell-view.c (popdown_transient_folder_bar): New.
diff --git a/shell/e-shell-view-menu.c b/shell/e-shell-view-menu.c
index 6cf7fe826a..c736ddd907 100644
--- a/shell/e-shell-view-menu.c
+++ b/shell/e-shell-view-menu.c
@@ -32,6 +32,7 @@
#include "e-shell-constants.h"
#include "e-shell-view-menu.h"
+#include <bonobo.h>
/* EShellView callbacks. */
@@ -53,6 +54,7 @@ shortcut_bar_mode_changed_cb (EShellView *shell_view,
path = (const char *) data;
uih = e_shell_view_get_bonobo_ui_handler (shell_view);
+#warning FIXME: use node_set
bonobo_ui_handler_menu_set_toggle_state (uih, path, toggle_state);
}
@@ -73,6 +75,7 @@ folder_bar_mode_changed_cb (EShellView *shell_view,
path = (const char *) data;
uih = e_shell_view_get_bonobo_ui_handler (shell_view);
+#warning FIXME: use node_set
bonobo_ui_handler_menu_set_toggle_state (uih, path, toggle_state);
}
@@ -189,17 +192,19 @@ command_help (BonoboUIHandler *uih,
}
static void
-command_toggle_folder_bar (BonoboUIHandler *uih,
- void *data,
- const char *path)
+command_toggle_folder_bar (BonoboUIComponent *component,
+ const char *path,
+ Bonobo_UIComponent_EventType type,
+ const char *state,
+ gpointer user_data)
{
EShellView *shell_view;
EShellViewSubwindowMode mode;
gboolean show;
- shell_view = E_SHELL_VIEW (data);
+ shell_view = E_SHELL_VIEW (user_data);
- show = bonobo_ui_handler_menu_get_toggle_state (uih, path);
+ show = atoi (state);
if (show)
mode = E_SHELL_VIEW_SUBWINDOW_STICKY;
else
@@ -209,17 +214,20 @@ command_toggle_folder_bar (BonoboUIHandler *uih,
}
static void
-command_toggle_shortcut_bar (BonoboUIHandler *uih,
- void *data,
- const char *path)
+command_toggle_shortcut_bar (BonoboUIComponent *component,
+ const char *path,
+ Bonobo_UIComponent_EventType type,
+ const char *state,
+ gpointer user_data)
+
{
EShellView *shell_view;
EShellViewSubwindowMode mode;
gboolean show;
- shell_view = E_SHELL_VIEW (data);
+ shell_view = E_SHELL_VIEW (user_data);
- show = bonobo_ui_handler_menu_get_toggle_state (uih, path);
+ show = atoi (state);
if (show)
mode = E_SHELL_VIEW_SUBWINDOW_STICKY;
@@ -368,219 +376,53 @@ DEFINE_UNIMPLEMENTED (command_new_mail_message)
DEFINE_UNIMPLEMENTED (command_new_contact)
DEFINE_UNIMPLEMENTED (command_new_task_request)
-
-static void
-menu_create_file_new (BonoboUIHandler *uih,
- void *data)
-{
- bonobo_ui_handler_menu_new_subtree (uih, "/File/New",
- _("_New"),
- NULL, -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 0, 0);
-
- bonobo_ui_handler_menu_new_item (uih, "/File/New/View",
- _("_View"),
- NULL, -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 'v', GDK_CONTROL_MASK | GDK_SHIFT_MASK,
- command_new_view, data);
- bonobo_ui_handler_menu_new_item (uih, "/File/New/View",
- _("_Folder"),
- NULL, -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 'f', GDK_CONTROL_MASK | GDK_SHIFT_MASK,
- command_new_folder, data);
- bonobo_ui_handler_menu_new_item (uih, "/File/New/Evolution bar shortcut",
- _("Evolution bar _shortcut"),
- NULL, -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 's', GDK_CONTROL_MASK | GDK_SHIFT_MASK,
- command_new_shortcut, data);
-
- bonobo_ui_handler_menu_new_separator (uih, "/File/New/Separator1", -1);
-
- bonobo_ui_handler_menu_new_item (uih, "/File/New/Mail message",
- _("_Mail message (FIXME)"),
- NULL, -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 'm', GDK_CONTROL_MASK | GDK_SHIFT_MASK,
- command_new_mail_message, data);
- bonobo_ui_handler_menu_new_item (uih, "/File/New/Appointment",
- _("_Appointment (FIXME)"),
- NULL, -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 'a', GDK_CONTROL_MASK | GDK_SHIFT_MASK,
- command_new_shortcut, data);
- bonobo_ui_handler_menu_new_item (uih, "/File/New/Contact",
- _("_Contact (FIXME)"),
- NULL, -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 'c', GDK_CONTROL_MASK | GDK_SHIFT_MASK,
- command_new_contact, data);
- bonobo_ui_handler_menu_new_item (uih, "/File/New/Contact",
- _("_Task (FIXME)"),
- NULL, -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 't', GDK_CONTROL_MASK | GDK_SHIFT_MASK,
- command_new_task_request, data);
-}
+BonoboUIVerb new_verbs [] = {
+ BONOBO_UI_VERB ("NewView", command_new_view),
+ BONOBO_UI_VERB ("NewFolder", command_new_folder),
+ BONOBO_UI_VERB ("NewShortcut", command_new_shortcut),
+ BONOBO_UI_VERB ("NewMailMessage", command_new_mail_message),
-static void
-menu_create_file (BonoboUIHandler *uih,
- void *data)
-{
- bonobo_ui_handler_menu_new_subtree (uih, "/File",
- _("_File"),
- NULL, -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 0, 0);
-
- menu_create_file_new (uih, data);
-
- bonobo_ui_handler_menu_new_separator (uih, "/File/Separator1", -1);
-
- bonobo_ui_handler_menu_new_item (uih, "/File/Go to folder",
- _("_Go to Folder..."),
- _("Display a different folder"),
- -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 0, 0,
- command_goto_folder, data);
-
- bonobo_ui_handler_menu_new_item (uih, "/File/Create new folder",
- _("_Create New Folder..."),
- _("Create a new folder"),
- -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 0, 0,
- command_create_folder, data);
-
- bonobo_ui_handler_menu_new_placeholder (uih, "/File/<Print Placeholder>");
-
- bonobo_ui_handler_menu_new_separator (uih, "/File/Separator2", -1);
-
- bonobo_ui_handler_menu_new_item (uih, "/File/Exit",
- _("E_xit..."),
- _("Create a new folder"),
- -1,
- BONOBO_UI_HANDLER_PIXMAP_STOCK,
- GNOME_STOCK_MENU_EXIT,
- 0, 0,
- command_quit, data);
-}
+ BONOBO_UI_VERB ("NewAppointment", command_new_shortcut),
+ BONOBO_UI_VERB ("NewContact", command_new_contact),
+ BONOBO_UI_VERB ("NewTask", command_new_task_request),
-static void
-menu_create_edit (BonoboUIHandler *uih,
- void *data)
-{
- bonobo_ui_handler_menu_new_subtree (uih, "/Edit",
- _("_Edit"),
- NULL, -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 0, 0);
-}
+ BONOBO_UI_VERB_END
+};
-static void
-menu_create_view (BonoboUIHandler *uih,
- void *data)
-{
- bonobo_ui_handler_menu_new_subtree (uih, "/View",
- _("_View"),
- NULL, -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 0, 0);
-
- bonobo_ui_handler_menu_new_toggleitem (uih, "/View/Show shortcut bar",
- _("Show _Shortcut Bar"),
- _("Show the shortcut bar"),
- -1,
- 0, 0,
- command_toggle_shortcut_bar, data);
- bonobo_ui_handler_menu_new_toggleitem (uih, "/View/Show folder bar",
- _("Show _Folder Bar"),
- _("Show the folder bar"),
- -1,
- 0, 0,
- command_toggle_folder_bar, data);
-}
+BonoboUIVerb file_verbs [] = {
+ BONOBO_UI_VERB ("FileGoToFolder", command_goto_folder),
+ BONOBO_UI_VERB ("FileCreateFolder", command_create_folder),
+ BONOBO_UI_VERB ("FileExit", command_quit),
-static void
-menu_create_settings (BonoboUIHandler *uih,
- void *data)
-{
- bonobo_ui_handler_menu_new_subtree (uih, "/Settings",
- _("_Settings"),
- NULL, -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 0, 0);
-}
+ BONOBO_UI_VERB_END
+};
+
+BonoboUIVerb help_verbs [] = {
+ BONOBO_UI_VERB_DATA ("HelpIndex", command_help, "index.html"),
+ BONOBO_UI_VERB_DATA ("HelpGetStarted", command_help, "usage-mainwindow.html"),
+ BONOBO_UI_VERB_DATA ("HelpUsingMail", command_help, "usage-mail.html"),
+ BONOBO_UI_VERB_DATA ("HelpUsingCalender", command_help, "usage-calender.html"),
+ BONOBO_UI_VERB_DATA ("HelpUsingContact", command_help, "usage-contact.html"),
+
+ BONOBO_UI_VERB_END
+};
static void
-menu_create_help (BonoboUIHandler *uih,
- void *data)
+menu_do_misc (BonoboUIComponent *component,
+ EShellView *shell_view)
{
- bonobo_ui_handler_menu_new_subtree (uih, "/Help",
- _("_Help"),
- NULL, -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 0, 0);
-
- bonobo_ui_handler_menu_new_item (uih, "/Help/Help index",
- _("Help _Index"),
- NULL,
- -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 0, 0,
- command_help, "index.html");
- bonobo_ui_handler_menu_new_item (uih, "/Help/Getting started",
- _("Getting _Started"),
- NULL,
- -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 0, 0,
- command_help, "usage-mainwindow.html");
- bonobo_ui_handler_menu_new_item (uih, "/Help/Using the mailer",
- _("Using the _Mailer"),
- NULL,
- -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 0, 0,
- command_help, "usage-mail.html");
- bonobo_ui_handler_menu_new_item (uih, "/Help/Using the calendar",
- _("Using the _Calendar"),
- NULL,
- -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 0, 0,
- command_help, "usage-calendar.html");
- bonobo_ui_handler_menu_new_item (uih, "/Help/Using the contact manager",
- _("Using the C_ontact Manager"),
- NULL,
- -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 0, 0,
- command_help, "usage-contact.html");
-
- bonobo_ui_handler_menu_new_separator (uih, "/Help/Separator1", -1);
-
- bonobo_ui_handler_menu_new_item (uih, "/Help/Submit bug report",
- _("_Submit Bug Report"),
- _("Submit bug report using Bug Buddy"),
- -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 0, 0,
- command_run_bugbuddy, data);
-
- bonobo_ui_handler_menu_new_separator (uih, "/Help/Separator2", -1);
-
- bonobo_ui_handler_menu_new_item (uih, "/Help/About Evolution",
- _("_About Evolution..."),
- _("Show information about Evolution"),
- -1,
- BONOBO_UI_HANDLER_PIXMAP_NONE, NULL,
- 0, 0,
- command_about_box, data);
+ bonobo_ui_component_add_listener (
+ component, "ViewShortcutBar",
+ command_toggle_shortcut_bar, shell_view);
+ bonobo_ui_component_add_listener (
+ component, "ViewFolderBar",
+ command_toggle_folder_bar, shell_view);
+ bonobo_ui_component_add_verb (
+ component, "HelpSubmitBug",
+ (BonoboUIVerbFn) command_run_bugbuddy, shell_view);
+ bonobo_ui_component_add_verb (
+ component, "HelpAbout",
+ (BonoboUIVerbFn) command_about_box, shell_view);
}
@@ -592,20 +434,28 @@ void
e_shell_view_menu_setup (EShellView *shell_view)
{
BonoboUIHandler *uih;
+ Bonobo_UIContainer container;
+ BonoboUIComponent *component;
+ char *fname;
+ xmlNode *ui;
g_return_if_fail (shell_view != NULL);
g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
uih = e_shell_view_get_bonobo_ui_handler (shell_view);
- menu_create_file (uih, shell_view);
- menu_create_edit (uih, shell_view);
- menu_create_view (uih, shell_view);
- menu_create_settings (uih, shell_view);
+ component = bonobo_ui_compat_get_component (uih);
+
+ bonobo_ui_component_add_verb_list_with_data (
+ component, file_verbs, shell_view);
- bonobo_ui_handler_menu_new_placeholder (uih, "/<Component Placeholder>");
-
- menu_create_help (uih, shell_view);
+ bonobo_ui_component_add_verb_list_with_data (
+ component, new_verbs, shell_view);
+
+ bonobo_ui_component_add_verb_list_with_data (
+ component, help_verbs, shell_view);
+
+ menu_do_misc (component, shell_view);
gtk_signal_connect (GTK_OBJECT (shell_view), "shortcut_bar_mode_changed",
GTK_SIGNAL_FUNC (shortcut_bar_mode_changed_cb),
@@ -615,9 +465,20 @@ e_shell_view_menu_setup (EShellView *shell_view)
FOLDER_BAR_TOGGLE_PATH);
/* Initialize the toggles. Yeah, this is, well, yuck. */
-
folder_bar_mode_changed_cb (shell_view, e_shell_view_get_folder_bar_mode (shell_view),
FOLDER_BAR_TOGGLE_PATH);
shortcut_bar_mode_changed_cb (shell_view, e_shell_view_get_shortcut_bar_mode (shell_view),
SHORTCUT_BAR_TOGGLE_PATH);
+
+ container = bonobo_ui_compat_get_container (uih);
+ g_return_if_fail (container != CORBA_OBJECT_NIL);
+
+ fname = bonobo_ui_util_get_ui_fname ("evolution.xml");
+ g_warning ("Attempting ui load from '%s'", fname);
+
+ ui = bonobo_ui_util_new_ui (component, fname, "evolution");
+
+ bonobo_ui_component_set_tree (component, container, "/", ui, NULL);
+ g_free (fname);
+ xmlFreeNode (ui);
}
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)
diff --git a/shell/e-shell-view.h b/shell/e-shell-view.h
index 69a0e5c22c..bd2b9a126e 100644
--- a/shell/e-shell-view.h
+++ b/shell/e-shell-view.h
@@ -28,8 +28,7 @@
#include <config.h>
#endif
-#include <libgnomeui/gnome-app.h>
-#include <bonobo/bonobo-ui-handler.h>
+#include <bonobo/bonobo-app.h>
#include "e-shell.h"
@@ -57,13 +56,13 @@ enum _EShellViewSubwindowMode {
typedef enum _EShellViewSubwindowMode EShellViewSubwindowMode;
struct _EShellView {
- GnomeApp parent;
+ BonoboWin parent;
EShellViewPrivate *priv;
};
struct _EShellViewClass {
- GnomeAppClass parent_class;
+ BonoboWinClass parent_class;
/* Signals. */
void (* shortcut_bar_mode_changed) (EShellView *shell_view, EShellViewSubwindowMode new_mode);
@@ -72,9 +71,9 @@ struct _EShellViewClass {
GtkType e_shell_view_get_type (void);
-void e_shell_view_construct (EShellView *shell_view,
+EShellView *e_shell_view_construct (EShellView *shell_view,
EShell *shell);
-GtkWidget *e_shell_view_new (EShell *shell);
+EShellView *e_shell_view_new (EShell *shell);
gboolean e_shell_view_display_uri (EShellView *shell_view,
const char *uri);
diff --git a/shell/e-shell.c b/shell/e-shell.c
index 87f19fb4db..0ddbd5248b 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -321,6 +321,8 @@ setup_local_storage (EShell *shell)
e_storage_set_add_storage (priv->storage_set, local_storage);
priv->local_storage = E_LOCAL_STORAGE (local_storage);
+ gtk_object_unref (GTK_OBJECT (local_storage));
+
return TRUE;
}
@@ -405,12 +407,13 @@ view_destroy_cb (GtkObject *object,
g_assert (E_IS_SHELL_VIEW (object));
shell = E_SHELL (data);
- shell->priv->views = g_list_remove (shell->priv->views, object);
+ shell->priv->views = g_list_remove (
+ shell->priv->views, object);
if (shell->priv->views == NULL) {
/* FIXME: This looks like a Bonobo bug to me. */
bonobo_object_ref (BONOBO_OBJECT (shell));
- gtk_signal_emit (GTK_OBJECT (shell), signals[NO_VIEWS_LEFT]);
+ gtk_signal_emit (GTK_OBJECT (shell), signals [NO_VIEWS_LEFT]);
bonobo_object_unref (BONOBO_OBJECT (shell));
}
}
@@ -450,8 +453,10 @@ destroy (GtkObject *object)
view = E_SHELL_VIEW (p->data);
- gtk_signal_disconnect_by_func (GTK_OBJECT (view),
- GTK_SIGNAL_FUNC (view_destroy_cb), shell);
+ gtk_signal_disconnect_by_func (
+ GTK_OBJECT (view),
+ GTK_SIGNAL_FUNC (view_destroy_cb), shell);
+
gtk_object_destroy (GTK_OBJECT (view));
}
@@ -640,20 +645,20 @@ e_shell_new (const char *local_directory)
*
* Create a new view for @uri.
*
- * Return value: The widget for the new view.
+ * Return value: The new view.
**/
-GtkWidget *
+EShellView *
e_shell_new_view (EShell *shell,
const char *uri)
{
- GtkWidget *view;
+ EShellView *view;
g_return_val_if_fail (shell != NULL, NULL);
g_return_val_if_fail (E_IS_SHELL (shell), NULL);
view = e_shell_view_new (shell);
- gtk_widget_show (view);
+ gtk_widget_show (GTK_WIDGET (view));
gtk_signal_connect (GTK_OBJECT (view), "destroy",
GTK_SIGNAL_FUNC (view_destroy_cb), shell);
@@ -899,16 +904,16 @@ e_shell_restore_from_settings (EShell *shell)
retval = TRUE;
for (i = 0; i < num_views; i++) {
- GtkWidget *view_widget;
+ EShellView *view;
prefix = g_strdup_printf ("=%s/config/Shell=/Views/%d/",
priv->local_directory, i);
/* FIXME restore the URI here. There should be an
e_shell_view_new_from_configuration() thingie. */
- view_widget = e_shell_new_view (shell, NULL);
+ view = e_shell_new_view (shell, NULL);
- if (! e_shell_view_load_settings (E_SHELL_VIEW (view_widget), prefix))
+ if (! e_shell_view_load_settings (view, prefix))
retval = FALSE;
g_free (prefix);
@@ -941,9 +946,10 @@ e_shell_quit (EShell *shell)
EShellView *shell_view;
shell_view = E_SHELL_VIEW (p->data);
- gtk_signal_disconnect_by_func (GTK_OBJECT (shell_view),
- GTK_SIGNAL_FUNC (view_destroy_cb), shell);
- gtk_widget_destroy (GTK_WIDGET (shell_view));
+ gtk_signal_disconnect_by_func (
+ GTK_OBJECT (shell_view),
+ GTK_SIGNAL_FUNC (view_destroy_cb), shell);
+ gtk_object_destroy (GTK_OBJECT (shell_view));
}
g_list_free (priv->views);
diff --git a/shell/e-shell.h b/shell/e-shell.h
index ca63c4776d..b3a5d80c98 100644
--- a/shell/e-shell.h
+++ b/shell/e-shell.h
@@ -30,14 +30,19 @@
#include <bonobo/bonobo-object.h>
-#include "Evolution.h"
-#include "e-shortcuts.h"
-
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
+typedef struct _EShell EShell;
+typedef struct _EShellPrivate EShellPrivate;
+typedef struct _EShellClass EShellClass;
+
+#include "Evolution.h"
+#include "e-shortcuts.h"
+#include "e-shell-view.h"
+
#define E_TYPE_SHELL (e_shell_get_type ())
#define E_SHELL(obj) (GTK_CHECK_CAST ((obj), E_TYPE_SHELL, EShell))
#define E_SHELL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_SHELL, EShellClass))
@@ -45,9 +50,6 @@ extern "C" {
#define E_IS_SHELL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_TYPE_SHELL))
-typedef struct _EShell EShell;
-typedef struct _EShellPrivate EShellPrivate;
-typedef struct _EShellClass EShellClass;
struct _EShell {
BonoboObject parent;
@@ -68,7 +70,7 @@ void e_shell_construct (EShell *shell,
const char *local_directory);
EShell *e_shell_new (const char *local_directory);
-GtkWidget *e_shell_new_view (EShell *shell,
+EShellView *e_shell_new_view (EShell *shell,
const char *uri);
const char *e_shell_get_local_directory (EShell *shell);
diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c
index 9b11f57a94..f57cb6280c 100644
--- a/shell/e-storage-set-view.c
+++ b/shell/e-storage-set-view.c
@@ -237,6 +237,7 @@ popup_folder_menu (EStorageSetView *storage_set_view,
BonoboUIHandler *uih;
EFolder *folder;
+#if 0
priv = storage_set_view->priv;
uih = bonobo_ui_handler_new ();
@@ -265,6 +266,7 @@ popup_folder_menu (EStorageSetView *storage_set_view,
bonobo_ui_handler_do_popup_menu (uih);
bonobo_object_unref (BONOBO_OBJECT (uih));
+#endif
}
diff --git a/shell/main.c b/shell/main.c
index 44fa09d802..df3a571048 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -110,7 +110,7 @@ development_warning ()
static gint
idle_cb (gpointer data)
{
- GtkWidget *view;
+ EShellView *view;
char *evolution_directory;
evolution_directory = (char *) data;