aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog13
-rw-r--r--shell/e-shell-view-menu.c84
-rw-r--r--shell/e-shell-view.c58
-rw-r--r--shell/e-shell-view.h2
-rw-r--r--shell/evolution-shell-component.h1
5 files changed, 83 insertions, 75 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index d986283db5..c73b26ca8a 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,16 @@
+2000-10-05 Michael Meeks <michael@helixcode.com>
+
+ * e-shell-view-menu.c (shortcut_bar_mode_changed_cb): upd.
+ (folder_bar_mode_changed_cb): upd.
+ (command_xml_dump): clobber.
+ (e_shell_view_menu_setup): upd.
+
+ * e-shell-view.c (shell_view_interface_set_message_cb): upd.
+ (shell_view_interface_unset_message_cb): upd.
+ (e_shell_view_construct): upd.
+ (get_control_for_uri): upd.
+ (e_shell_view_get_bonobo_ui_component): upd.
+
2000-10-04 Michael Meeks <michael@helixcode.com>
* e-shell-view.c (setup_progress_bar): remove evil usize set.
diff --git a/shell/e-shell-view-menu.c b/shell/e-shell-view-menu.c
index 6d6d55b7c7..dd7c244692 100644
--- a/shell/e-shell-view-menu.c
+++ b/shell/e-shell-view-menu.c
@@ -42,19 +42,19 @@ shortcut_bar_mode_changed_cb (EShellView *shell_view,
EShellViewSubwindowMode new_mode,
void *data)
{
- BonoboUIHandler *uih;
+ BonoboUIComponent *uic;
const char *path;
- gboolean toggle_state;
+ char *txt;
if (new_mode == E_SHELL_VIEW_SUBWINDOW_HIDDEN)
- toggle_state = FALSE;
+ txt = "0";
else
- toggle_state = TRUE;
+ txt = "1";
path = (const char *) data;
- uih = e_shell_view_get_bonobo_ui_handler (shell_view);
+ uic = e_shell_view_get_bonobo_ui_component (shell_view);
- bonobo_ui_handler_menu_set_toggle_state (uih, path, toggle_state);
+ bonobo_ui_component_set_prop (uic, path, "state", txt, NULL);
}
static void
@@ -62,19 +62,19 @@ folder_bar_mode_changed_cb (EShellView *shell_view,
EShellViewSubwindowMode new_mode,
void *data)
{
- BonoboUIHandler *uih;
+ BonoboUIComponent *uic;
const char *path;
- gboolean toggle_state;
+ char *txt;
if (new_mode == E_SHELL_VIEW_SUBWINDOW_HIDDEN)
- toggle_state = FALSE;
+ txt = "0";
else
- toggle_state = TRUE;
+ txt = "1";
path = (const char *) data;
- uih = e_shell_view_get_bonobo_ui_handler (shell_view);
+ uic = e_shell_view_get_bonobo_ui_component (shell_view);
- bonobo_ui_handler_menu_set_toggle_state (uih, path, toggle_state);
+ bonobo_ui_component_set_prop (uic, path, "state", txt, NULL);
}
@@ -360,17 +360,20 @@ command_create_folder (BonoboUIHandler *uih,
}
static void
-command_xml_dump (gpointer dummy,
- EShellView *view)
+command_xml_dump (gpointer dummy,
+ EShellView *view)
{
+#if 0
BonoboUIHandler *uih;
BonoboWin *win;
- uih = e_shell_view_get_bonobo_ui_handler (view);
+ uih = e_shell_view_get_bonobo_ui_component (view);
win = bonobo_ui_handler_get_app (uih);
bonobo_win_dump (win, "On demand");
+#endif
+ g_warning ("FIXME: to re-instate debugging dump we need to get the container");
}
@@ -378,7 +381,7 @@ command_xml_dump (gpointer dummy,
#define DEFINE_UNIMPLEMENTED(func) \
static void \
-func (BonoboUIHandler *uih, void *data, const char *path) \
+func (BonoboUIComponent *uic, void *data, const char *path) \
{ \
g_warning ("EShellView: %s: not implemented.", __FUNCTION__); \
} \
@@ -389,32 +392,32 @@ DEFINE_UNIMPLEMENTED (command_new_contact)
DEFINE_UNIMPLEMENTED (command_new_task_request)
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),
+ BONOBO_UI_UNSAFE_VERB ("NewView", command_new_view),
+ BONOBO_UI_UNSAFE_VERB ("NewFolder", command_new_folder),
+ BONOBO_UI_UNSAFE_VERB ("NewShortcut", command_new_shortcut),
+ BONOBO_UI_UNSAFE_VERB ("NewMailMessage", command_new_mail_message),
- BONOBO_UI_VERB ("NewAppointment", command_new_shortcut),
- BONOBO_UI_VERB ("NewContact", command_new_contact),
- BONOBO_UI_VERB ("NewTask", command_new_task_request),
+ BONOBO_UI_UNSAFE_VERB ("NewAppointment", command_new_shortcut),
+ BONOBO_UI_UNSAFE_VERB ("NewContact", command_new_contact),
+ BONOBO_UI_UNSAFE_VERB ("NewTask", command_new_task_request),
BONOBO_UI_VERB_END
};
BonoboUIVerb file_verbs [] = {
- BONOBO_UI_VERB ("FileGoToFolder", command_goto_folder),
- BONOBO_UI_VERB ("FileCreateFolder", command_create_folder),
- BONOBO_UI_VERB ("FileExit", command_quit),
+ BONOBO_UI_UNSAFE_VERB ("FileGoToFolder", command_goto_folder),
+ BONOBO_UI_UNSAFE_VERB ("FileCreateFolder", command_create_folder),
+ BONOBO_UI_UNSAFE_VERB ("FileExit", command_quit),
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 ("HelpUsingCalendar", command_help, "usage-calendar.html"),
- BONOBO_UI_VERB_DATA ("HelpUsingContact", command_help, "usage-contact.html"),
+ BONOBO_UI_UNSAFE_VERB_DATA ("HelpIndex", command_help, "index.html"),
+ BONOBO_UI_UNSAFE_VERB_DATA ("HelpGetStarted", command_help, "usage-mainwindow.html"),
+ BONOBO_UI_UNSAFE_VERB_DATA ("HelpUsingMail", command_help, "usage-mail.html"),
+ BONOBO_UI_UNSAFE_VERB_DATA ("HelpUsingCalendar", command_help, "usage-calendar.html"),
+ BONOBO_UI_UNSAFE_VERB_DATA ("HelpUsingContact", command_help, "usage-contact.html"),
BONOBO_UI_VERB_END
};
@@ -441,32 +444,29 @@ menu_do_misc (BonoboUIComponent *component,
}
-#define SHORTCUT_BAR_TOGGLE_PATH "/View/ShortcutBar"
-#define FOLDER_BAR_TOGGLE_PATH "/View/FolderBar"
+#define SHORTCUT_BAR_TOGGLE_PATH "/menu/View/ShortcutBar"
+#define FOLDER_BAR_TOGGLE_PATH "/menu/View/FolderBar"
void
e_shell_view_menu_setup (EShellView *shell_view)
{
- BonoboUIHandler *uih;
- BonoboUIComponent *component;
+ BonoboUIComponent *uic;
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);
-
- component = bonobo_ui_compat_get_component (uih);
+ uic = e_shell_view_get_bonobo_ui_component (shell_view);
bonobo_ui_component_add_verb_list_with_data (
- component, file_verbs, shell_view);
+ uic, file_verbs, shell_view);
bonobo_ui_component_add_verb_list_with_data (
- component, new_verbs, shell_view);
+ uic, new_verbs, shell_view);
bonobo_ui_component_add_verb_list (
- component, help_verbs);
+ uic, help_verbs);
- menu_do_misc (component, shell_view);
+ menu_do_misc (uic, shell_view);
gtk_signal_connect (GTK_OBJECT (shell_view), "shortcut_bar_mode_changed",
GTK_SIGNAL_FUNC (shortcut_bar_mode_changed_cb),
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 2b56a91317..6802e2008a 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -60,7 +60,7 @@ struct _EShellViewPrivate {
EShell *shell;
/* The UI handler. */
- BonoboUIHandler *uih;
+ BonoboUIComponent *ui_component;
/* Currently displayed URI. */
char *uri;
@@ -442,9 +442,8 @@ setup_progress_bar (EShellViewPrivate *priv)
control = bonobo_control_new (priv->progress_bar);
g_return_if_fail (control != NULL);
- bonobo_ui_container_object_set (
- bonobo_ui_compat_get_container (priv->uih),
- "/status/Progress",
+ bonobo_ui_component_object_set (
+ priv->ui_component, "/status/Progress",
bonobo_object_corba_objref (BONOBO_OBJECT (control)),
NULL);
}
@@ -555,7 +554,7 @@ destroy (GtkObject *object)
g_hash_table_foreach (priv->uri_to_control, hash_forall_destroy_control, NULL);
g_hash_table_destroy (priv->uri_to_control);
- bonobo_object_unref (BONOBO_OBJECT (priv->uih));
+ bonobo_object_unref (BONOBO_OBJECT (priv->ui_component));
g_free (priv->uri);
@@ -605,7 +604,7 @@ class_init (EShellViewClass *klass)
object_class->destroy = destroy;
- parent_class = gtk_type_class (BONOBO_WIN_TYPE);
+ parent_class = gtk_type_class (BONOBO_TYPE_WIN);
signals[SHORTCUT_BAR_MODE_CHANGED]
= gtk_signal_new ("shortcut_bar_mode_changed",
@@ -636,7 +635,7 @@ init (EShellView *shell_view)
priv = g_new (EShellViewPrivate, 1);
priv->shell = NULL;
- priv->uih = NULL;
+ priv->ui_component = NULL;
priv->uri = NULL;
priv->delayed_selection = NULL;
@@ -754,9 +753,8 @@ shell_view_interface_set_message_cb (EvolutionShellView *shell_view,
} else
status = g_strdup ("");
- bonobo_ui_container_set_status (
- bonobo_ui_compat_get_container (view->priv->uih),
- status, NULL);
+ bonobo_ui_component_set_status (
+ view->priv->ui_component, status, NULL);
g_free (status);
@@ -776,9 +774,8 @@ shell_view_interface_unset_message_cb (EvolutionShellView *shell_view,
g_return_if_fail (view != NULL);
- bonobo_ui_container_set_status (
- bonobo_ui_compat_get_container (view->priv->uih),
- "", NULL);
+ bonobo_ui_component_set_status (
+ view->priv->ui_component, "", NULL);
stop_progress_bar (E_SHELL_VIEW (data));
}
@@ -791,8 +788,7 @@ e_shell_view_construct (EShellView *shell_view,
EShellViewPrivate *priv;
EShellView *view;
GtkObject *window;
- Bonobo_UIContainer container;
- BonoboUIComponent *component;
+ BonoboUIContainer *container;
g_return_val_if_fail (shell != NULL, NULL);
g_return_val_if_fail (shell_view != NULL, NULL);
@@ -818,18 +814,18 @@ e_shell_view_construct (EShellView *shell_view,
priv->shell = shell;
- priv->uih = bonobo_ui_handler_new ();
- bonobo_ui_handler_set_app (priv->uih, BONOBO_WIN (shell_view));
+ container = bonobo_ui_container_new ();
+ bonobo_ui_container_set_win (container, BONOBO_WIN (shell_view));
- component = bonobo_ui_compat_get_component (priv->uih);
- container = bonobo_ui_compat_get_container (priv->uih);
- g_return_val_if_fail (container != CORBA_OBJECT_NIL, NULL);
+ priv->ui_component = bonobo_ui_component_new ("evolution");
+ bonobo_ui_component_set_container (
+ priv->ui_component,
+ bonobo_object_corba_objref (BONOBO_OBJECT (container)));
- bonobo_ui_container_freeze (container, NULL);
+ bonobo_ui_component_freeze (priv->ui_component, NULL);
- bonobo_ui_util_set_ui (component, container,
- EVOLUTION_DATADIR, "evolution.xml",
- "evolution");
+ bonobo_ui_util_set_ui (priv->ui_component, EVOLUTION_DATADIR,
+ "evolution.xml", "evolution");
setup_widgets (shell_view);
@@ -837,7 +833,7 @@ e_shell_view_construct (EShellView *shell_view,
e_shell_view_set_folder_bar_mode (shell_view, E_SHELL_VIEW_SUBWINDOW_HIDDEN);
- bonobo_ui_container_thaw (container, NULL);
+ bonobo_ui_component_thaw (priv->ui_component, NULL);
return view;
}
@@ -1122,7 +1118,7 @@ get_control_for_uri (EShellView *shell_view,
control = bonobo_widget_new_control_from_objref (
corba_control,
- bonobo_ui_compat_get_container (priv->uih));
+ bonobo_ui_component_get_container (priv->ui_component));
setup_evolution_shell_view_interface (shell_view, control);
@@ -1148,10 +1144,8 @@ show_existing_view (EShellView *shell_view,
control is dead; if it's zombie, we have to recreate it. */
if (bonobo_widget_is_dead (BONOBO_WIDGET (control))) {
GtkWidget *parent;
- Bonobo_UIContainer uih;
parent = control->parent;
- uih = bonobo_object_corba_objref (BONOBO_OBJECT (priv->uih));
/* Out with the old. */
gtk_container_remove (GTK_CONTAINER (parent), control);
@@ -1375,13 +1369,13 @@ e_shell_view_get_shell (EShellView *shell_view)
return shell_view->priv->shell;
}
-BonoboUIHandler *
-e_shell_view_get_bonobo_ui_handler (EShellView *shell_view)
+BonoboUIComponent *
+e_shell_view_get_bonobo_ui_component (EShellView *shell_view)
{
g_return_val_if_fail (shell_view != NULL, NULL);
g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
- return shell_view->priv->uih;
+ return shell_view->priv->ui_component;
}
GtkWidget *
@@ -1491,4 +1485,4 @@ e_shell_view_load_settings (EShellView *shell_view,
}
-E_MAKE_TYPE (e_shell_view, "EShellView", EShellView, class_init, init, BONOBO_WIN_TYPE)
+E_MAKE_TYPE (e_shell_view, "EShellView", EShellView, class_init, init, BONOBO_TYPE_WIN)
diff --git a/shell/e-shell-view.h b/shell/e-shell-view.h
index 0aa69a18c3..09b7a44f47 100644
--- a/shell/e-shell-view.h
+++ b/shell/e-shell-view.h
@@ -86,7 +86,7 @@ EShellViewSubwindowMode e_shell_view_get_shortcut_bar_mode (EShellView
EShellViewSubwindowMode e_shell_view_get_folder_bar_mode (EShellView *shell_view);
EShell *e_shell_view_get_shell (EShellView *shell_view);
-BonoboUIHandler *e_shell_view_get_bonobo_ui_handler (EShellView *shell_view);
+BonoboUIComponent *e_shell_view_get_bonobo_ui_component(EShellView *shell_view);
GtkWidget *e_shell_view_get_appbar (EShellView *shell_view);
const char *e_shell_view_get_current_uri (EShellView *shell_view);
diff --git a/shell/evolution-shell-component.h b/shell/evolution-shell-component.h
index 6b080e48c3..db6dfe69b4 100644
--- a/shell/evolution-shell-component.h
+++ b/shell/evolution-shell-component.h
@@ -30,6 +30,7 @@
#include <bonobo/bonobo-object.h>
#include <bonobo/bonobo-control.h>
+#include <bonobo/bonobo-ui-compat.h>
#include "Evolution.h"