aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog44
-rw-r--r--shell/e-shell-folder-creation-dialog.c2
-rw-r--r--shell/e-shell-folder-selection-dialog.c2
-rw-r--r--shell/e-shell-view.c24
-rw-r--r--shell/e-shell-view.h1
-rw-r--r--shell/e-storage-set-view.c59
-rw-r--r--shell/e-storage-set-view.h7
-rw-r--r--shell/e-storage-set.c4
-rw-r--r--shell/e-storage-set.h5
-rw-r--r--shell/evolution-storage-set-view-factory.c2
10 files changed, 116 insertions, 34 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index c0755b52cb..3c4ff1f1ff 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,47 @@
+2001-05-11 Chris Toshok <toshok@ximian.com>
+
+ * evolution-storage-set-view-factory.c
+ (evolution_storage_set_view_factory_new_view): the only
+ problematic area - pass NULL for now in as the BonoboUIContainer.
+ how do we pass this container to the control?
+
+ * e-storage-set-view.c (folder_context_menu_activate): un-#if 0
+ this function.
+ (populate_folder_context_menu_with_common_items): build our popup
+ using the new xml bonobo stuffs.
+ (popup_folder_menu): convert to using the new xml bonobo stuffs.
+ (right_click): only do the popup menu if we have a
+ BonoboUIContainer.
+ (e_storage_set_view_new): add BonoboUIContainer* arg.
+ (e_storage_set_view_construct): same.
+
+ * e-storage-set-view.h: add BonoboUIContainer* args to
+ e_storage_set_view_new and e_storage_set_view_construct.
+
+ * e-shell-folder-creation-dialog.c (add_storage_set_view): pass
+ NULL for the BonoboUIContainer, since we shouldn't (?) have a
+ popup in this dialog.
+
+ * e-shell-folder-selection-dialog.c
+ (e_shell_folder_selection_dialog_construct): pass NULL for the
+ BonoboUIContainer, since we shouldn't (?) have a popup in this
+ dialog.
+
+ * e-storage-set.h: add BonoboUIContainer* arg to
+ e_storage_set_new_view.
+
+ * e-storage-set.c (e_storage_set_new_view): add arg, and track
+ change to e_storage_set_view_new.
+
+ * e-shell-view.h: add prototype for
+ e_shell_view_get_bonobo_ui_container.
+
+ * e-shell-view.c (setup_storage_set_subwindow): track change to
+ e_storage_set_view_new.
+ (e_shell_view_construct): the BonoboUIContainer is now part of our
+ private structure.
+ (e_shell_view_get_bonobo_ui_container): new function.
+
2001-05-09 Christopher James Lahey <clahey@ximian.com>
* importer/intelligent.c (create_gui): Made this function static.
diff --git a/shell/e-shell-folder-creation-dialog.c b/shell/e-shell-folder-creation-dialog.c
index 13c3a74abe..5e6c5e5556 100644
--- a/shell/e-shell-folder-creation-dialog.c
+++ b/shell/e-shell-folder-creation-dialog.c
@@ -292,7 +292,7 @@ add_storage_set_view (GtkWidget *dialog,
GtkWidget *vbox;
storage_set = e_shell_get_storage_set (shell);
- storage_set_view = e_storage_set_new_view (storage_set);
+ storage_set_view = e_storage_set_new_view (storage_set, NULL/*XXX*/);
GTK_WIDGET_SET_FLAGS (storage_set_view, GTK_CAN_FOCUS);
diff --git a/shell/e-shell-folder-selection-dialog.c b/shell/e-shell-folder-selection-dialog.c
index 739ec0b62c..8674b5b599 100644
--- a/shell/e-shell-folder-selection-dialog.c
+++ b/shell/e-shell-folder-selection-dialog.c
@@ -333,7 +333,7 @@ e_shell_folder_selection_dialog_construct (EShellFolderSelectionDialog *folder_s
priv->storage_set = e_shell_get_storage_set (shell);
gtk_object_ref (GTK_OBJECT (priv->storage_set));
- priv->storage_set_view = e_storage_set_new_view (priv->storage_set);
+ priv->storage_set_view = e_storage_set_new_view (priv->storage_set, NULL /* No BonoboUIContainer */);
GTK_WIDGET_SET_FLAGS (priv->storage_set_view, GTK_CAN_FOCUS);
gtk_signal_connect (GTK_OBJECT (priv->storage_set_view),
"double_click", GTK_SIGNAL_FUNC (dbl_click_cb),
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index f96daac3dc..f6e2a28dc1 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -71,8 +71,9 @@ struct _EShellViewPrivate {
Evolution::ShellView interface. */
EvolutionShellView *corba_interface;
- /* The UI handler. */
+ /* The UI handler & container. */
BonoboUIComponent *ui_component;
+ BonoboUIContainer *ui_container;
/* Currently displayed URI. */
char *uri;
@@ -535,7 +536,7 @@ setup_storage_set_subwindow (EShellView *shell_view)
priv = shell_view->priv;
- storage_set_view = e_storage_set_view_new (e_shell_get_storage_set (priv->shell));
+ storage_set_view = e_storage_set_view_new (e_shell_get_storage_set (priv->shell), priv->ui_container);
gtk_signal_connect (GTK_OBJECT (storage_set_view), "folder_selected",
GTK_SIGNAL_FUNC (folder_selected_cb), shell_view);
gtk_signal_connect (GTK_OBJECT (storage_set_view), "storage_selected",
@@ -996,7 +997,6 @@ e_shell_view_construct (EShellView *shell_view,
EShellViewPrivate *priv;
EShellView *view;
GtkObject *window;
- BonoboUIContainer *container;
g_return_val_if_fail (shell != NULL, NULL);
g_return_val_if_fail (shell_view != NULL, NULL);
@@ -1021,13 +1021,14 @@ e_shell_view_construct (EShellView *shell_view,
gtk_signal_connect_while_alive (GTK_OBJECT (e_shell_get_storage_set (priv->shell)), "updated_folder",
updated_folder_cb, shell_view, GTK_OBJECT (shell_view));
- container = bonobo_ui_container_new ();
- bonobo_ui_container_set_win (container, BONOBO_WINDOW (shell_view));
- gtk_signal_connect (GTK_OBJECT (container), "system_exception", GTK_SIGNAL_FUNC (unmerge_on_error), NULL);
+ priv->ui_container = bonobo_ui_container_new ();
+ bonobo_ui_container_set_win (priv->ui_container, BONOBO_WINDOW (shell_view));
+ gtk_signal_connect (GTK_OBJECT (priv->ui_container),
+ "system_exception", GTK_SIGNAL_FUNC (unmerge_on_error), 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_object_corba_objref (BONOBO_OBJECT (priv->ui_container)));
bonobo_ui_component_freeze (priv->ui_component, NULL);
@@ -1752,6 +1753,15 @@ e_shell_view_get_bonobo_ui_component (EShellView *shell_view)
return shell_view->priv->ui_component;
}
+BonoboUIContainer *
+e_shell_view_get_bonobo_ui_container (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->ui_container;
+}
+
GtkWidget *
e_shell_view_get_appbar (EShellView *shell_view)
{
diff --git a/shell/e-shell-view.h b/shell/e-shell-view.h
index 2585c3aa68..3f94a0b2f8 100644
--- a/shell/e-shell-view.h
+++ b/shell/e-shell-view.h
@@ -86,6 +86,7 @@ EShellViewSubwindowMode e_shell_view_get_folder_bar_mode (EShellView
EShell *e_shell_view_get_shell (EShellView *shell_view);
BonoboUIComponent *e_shell_view_get_bonobo_ui_component (EShellView *shell_view);
+BonoboUIContainer *e_shell_view_get_bonobo_ui_container (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/e-storage-set-view.c b/shell/e-storage-set-view.c
index efac355c0c..a72c3881fd 100644
--- a/shell/e-storage-set-view.c
+++ b/shell/e-storage-set-view.c
@@ -29,6 +29,7 @@
#include "e-storage-set-view.h"
#include <glib.h>
+#include <gnome.h>
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-util.h>
#include <gal/util/e-util.h>
@@ -79,6 +80,8 @@ static ETreeClass *parent_class = NULL;
struct _EStorageSetViewPrivate {
EStorageSet *storage_set;
+ BonoboUIContainer *container;
+
ETreeModel *etree_model;
ETreePath root_node;
@@ -626,7 +629,6 @@ folder_xfer_callback (EStorageSet *storage_set,
/* FIXME: This should be moved somewhere else, so that also the shortcut code
can share it. */
-#if 0
static void
folder_context_menu_activate_cb (BonoboUIComponent *uih,
void *data,
@@ -646,31 +648,32 @@ static void
populate_folder_context_menu_with_common_items (EStorageSetView *storage_set_view,
BonoboUIComponent *uih)
{
- bonobo_ui_handler_menu_new_item (uih, "/Activate",
- _("_View"), _("View the selected folder"),
- 0, BONOBO_UI_HANDLER_PIXMAP_NONE,
- NULL, 0, 0,
- folder_context_menu_activate_cb,
- storage_set_view);
+ static char popup_xml[] =
+ "<submenu name=\"Folder\" _label=\"Folder\">\n"
+ " <menuitem name=\"Activate\" verb=\"ActivateView\" _label=\"_View\" _tip=\"View the selected folder\"/>\n"
+ " <placeholder name=\"componentPlaceholder\" delimit=\"top\"/>\n"
+ "</submenu>\n";
+
+ bonobo_ui_component_add_verb (uih, "ActivateView",
+ folder_context_menu_activate_cb,
+ storage_set_view);
+
+ bonobo_ui_component_set_translate (uih, "/popups/folderPopup", popup_xml, NULL);
}
-#endif
static void
popup_folder_menu (EStorageSetView *storage_set_view,
GdkEventButton *event)
{
-#if 0
EvolutionShellComponentClient *handler;
EStorageSetViewPrivate *priv;
EFolderTypeRegistry *folder_type_registry;
BonoboUIComponent *uih;
EFolder *folder;
+ GtkWidget *menu;
priv = storage_set_view->priv;
- uih = bonobo_ui_handler_new ();
- bonobo_ui_handler_create_popup_menu (uih);
-
folder = e_storage_set_get_folder (priv->storage_set, priv->selected_row_path);
if (folder == NULL) {
/* Uh!? */
@@ -684,6 +687,14 @@ popup_folder_menu (EStorageSetView *storage_set_view,
e_folder_get_type_string (folder));
g_assert (handler != NULL);
+ uih = bonobo_ui_component_new ("folder-popup");
+
+ bonobo_ui_component_set_container (uih,
+ bonobo_object_corba_objref (BONOBO_OBJECT (priv->container)));
+
+ bonobo_ui_component_set (uih, "/",
+ "<popups> <popup name=\"folderPopup\"/> </popups>", NULL);
+
evolution_shell_component_client_populate_folder_context_menu (handler,
uih,
e_folder_get_physical_uri (folder),
@@ -691,10 +702,15 @@ popup_folder_menu (EStorageSetView *storage_set_view,
populate_folder_context_menu_with_common_items (storage_set_view, uih);
- bonobo_ui_handler_do_popup_menu (uih);
+ menu = gtk_menu_new ();
+
+ bonobo_window_add_popup (bonobo_ui_container_get_win (priv->container),
+ GTK_MENU (menu), "/popups/folderPopup");
+
+ gtk_widget_show (GTK_WIDGET (menu));
+ gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 3, 0);
bonobo_object_unref (BONOBO_OBJECT (uih));
-#endif
}
@@ -1227,7 +1243,8 @@ right_click (ETree *etree,
storage_set_view = E_STORAGE_SET_VIEW (etree);
priv = storage_set_view->priv;
- popup_folder_menu (storage_set_view, (GdkEventButton *) event);
+ if (priv->container)
+ popup_folder_menu (storage_set_view, (GdkEventButton *) event);
return TRUE;
}
@@ -1773,8 +1790,9 @@ insert_storages (EStorageSetView *storage_set_view)
}
void
-e_storage_set_view_construct (EStorageSetView *storage_set_view,
- EStorageSet *storage_set)
+e_storage_set_view_construct (EStorageSetView *storage_set_view,
+ EStorageSet *storage_set,
+ BonoboUIContainer *container)
{
EStorageSetViewPrivate *priv;
ETableExtras *extras;
@@ -1787,6 +1805,8 @@ e_storage_set_view_construct (EStorageSetView *storage_set_view,
priv = storage_set_view->priv;
+ priv->container = container;
+
priv->etree_model = e_tree_memory_callbacks_new (etree_icon_at,
etree_column_count,
@@ -1848,7 +1868,8 @@ e_storage_set_view_construct (EStorageSetView *storage_set_view,
}
GtkWidget *
-e_storage_set_view_new (EStorageSet *storage_set)
+e_storage_set_view_new (EStorageSet *storage_set,
+ BonoboUIContainer *container)
{
GtkWidget *new;
@@ -1856,7 +1877,7 @@ e_storage_set_view_new (EStorageSet *storage_set)
g_return_val_if_fail (E_IS_STORAGE_SET (storage_set), NULL);
new = gtk_type_new (e_storage_set_view_get_type ());
- e_storage_set_view_construct (E_STORAGE_SET_VIEW (new), storage_set);
+ e_storage_set_view_construct (E_STORAGE_SET_VIEW (new), storage_set, container);
return new;
}
diff --git a/shell/e-storage-set-view.h b/shell/e-storage-set-view.h
index 361af21721..80bdf441e7 100644
--- a/shell/e-storage-set-view.h
+++ b/shell/e-storage-set-view.h
@@ -25,6 +25,7 @@
#define __E_STORAGE_SET_VIEW_H__
#include <gal/e-table/e-tree.h>
+#include <bonobo/bonobo-ui-container.h>
#include "e-storage-set.h"
#ifdef __cplusplus
@@ -68,9 +69,11 @@ struct _EStorageSetViewClass {
GtkType e_storage_set_view_get_type (void);
-GtkWidget *e_storage_set_view_new (EStorageSet *storage_set);
+GtkWidget *e_storage_set_view_new (EStorageSet *storage_set,
+ BonoboUIContainer *container);
void e_storage_set_view_construct (EStorageSetView *storage_set_view,
- EStorageSet *storage_set);
+ EStorageSet *storage_set,
+ BonoboUIContainer *container);
void e_storage_set_view_set_current_folder (EStorageSetView *storage_set_view,
const char *path);
const char *e_storage_set_view_get_current_folder (EStorageSetView *storage_set_view);
diff --git a/shell/e-storage-set.c b/shell/e-storage-set.c
index f7aaf4e03d..a9acc09a46 100644
--- a/shell/e-storage-set.c
+++ b/shell/e-storage-set.c
@@ -529,14 +529,14 @@ e_storage_set_get_folder (EStorageSet *storage_set,
GtkWidget *
-e_storage_set_new_view (EStorageSet *storage_set)
+e_storage_set_new_view (EStorageSet *storage_set, BonoboUIContainer *container)
{
GtkWidget *storage_set_view;
g_return_val_if_fail (storage_set != NULL, NULL);
g_return_val_if_fail (E_IS_STORAGE_SET (storage_set), NULL);
- storage_set_view = e_storage_set_view_new (storage_set);
+ storage_set_view = e_storage_set_view_new (storage_set, container);
return storage_set_view;
}
diff --git a/shell/e-storage-set.h b/shell/e-storage-set.h
index 8e5d8e379e..30bff0f674 100644
--- a/shell/e-storage-set.h
+++ b/shell/e-storage-set.h
@@ -26,6 +26,8 @@
#include <gtk/gtkwidget.h>
+#include <bonobo/bonobo-ui-container.h>
+
#include "e-folder-type-registry.h"
#include "e-storage.h"
@@ -81,7 +83,8 @@ EStorage *e_storage_set_get_storage (EStorageSet *storage
const char *storage_name);
EFolder *e_storage_set_get_folder (EStorageSet *storage_set,
const char *path);
-GtkWidget *e_storage_set_new_view (EStorageSet *storage_set);
+GtkWidget *e_storage_set_new_view (EStorageSet *storage_set,
+ BonoboUIContainer *container);
void e_storage_set_async_create_folder (EStorageSet *storage_set,
const char *path,
diff --git a/shell/evolution-storage-set-view-factory.c b/shell/evolution-storage-set-view-factory.c
index 93359def10..ee71776186 100644
--- a/shell/evolution-storage-set-view-factory.c
+++ b/shell/evolution-storage-set-view-factory.c
@@ -44,7 +44,7 @@ evolution_storage_set_view_factory_new_view (EShell *shell)
g_return_val_if_fail (E_IS_SHELL (shell), NULL);
storage_set = e_shell_get_storage_set (shell);
- storage_set_view = e_storage_set_view_new (storage_set);
+ storage_set_view = e_storage_set_view_new (storage_set, NULL /*XXX*/);
gtk_widget_show (storage_set_view);
storage_set_view_interface = evolution_storage_set_view_new (E_STORAGE_SET_VIEW (storage_set_view));