aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-storage-set-view.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2001-05-11 19:14:45 +0800
committerChris Toshok <toshok@src.gnome.org>2001-05-11 19:14:45 +0800
commit7da5a58462520d93415418c258acf0cb73972977 (patch)
tree622ff65e2a4a476014e463955fe6ccd33502316d /shell/e-storage-set-view.c
parentcbac81dad3f47593214799048830aec547154409 (diff)
downloadgsoc2013-evolution-7da5a58462520d93415418c258acf0cb73972977.tar
gsoc2013-evolution-7da5a58462520d93415418c258acf0cb73972977.tar.gz
gsoc2013-evolution-7da5a58462520d93415418c258acf0cb73972977.tar.bz2
gsoc2013-evolution-7da5a58462520d93415418c258acf0cb73972977.tar.lz
gsoc2013-evolution-7da5a58462520d93415418c258acf0cb73972977.tar.xz
gsoc2013-evolution-7da5a58462520d93415418c258acf0cb73972977.tar.zst
gsoc2013-evolution-7da5a58462520d93415418c258acf0cb73972977.zip
the only problematic area - pass NULL for now in as the BonoboUIContainer.
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. svn path=/trunk/; revision=9756
Diffstat (limited to 'shell/e-storage-set-view.c')
-rw-r--r--shell/e-storage-set-view.c59
1 files changed, 40 insertions, 19 deletions
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;
}