diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-06-01 21:07:50 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:42:22 +0800 |
commit | d6a1733667e7aa0b9d7c5e03d606f13fddf42f84 (patch) | |
tree | d1d9c635bf43af460cab23203eb214fb1862e702 /widgets | |
parent | 8154b46b3f9b78227253cf0565f55aebbe6715e0 (diff) | |
download | gsoc2013-evolution-d6a1733667e7aa0b9d7c5e03d606f13fddf42f84.tar gsoc2013-evolution-d6a1733667e7aa0b9d7c5e03d606f13fddf42f84.tar.gz gsoc2013-evolution-d6a1733667e7aa0b9d7c5e03d606f13fddf42f84.tar.bz2 gsoc2013-evolution-d6a1733667e7aa0b9d7c5e03d606f13fddf42f84.tar.lz gsoc2013-evolution-d6a1733667e7aa0b9d7c5e03d606f13fddf42f84.tar.xz gsoc2013-evolution-d6a1733667e7aa0b9d7c5e03d606f13fddf42f84.tar.zst gsoc2013-evolution-d6a1733667e7aa0b9d7c5e03d606f13fddf42f84.zip |
Move EPopupMenu to /widgets/table.
ETableHeaderItem is the last user of EPopupMenu. Move it to
/widgets/table to discourage further use and strip out unused features.
The functionality it provides has long since been superseded by
GtkUIManager and GtkAction.
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/misc/Makefile.am | 2 | ||||
-rw-r--r-- | widgets/table/Makefile.am | 2 | ||||
-rw-r--r-- | widgets/table/e-popup-menu.c (renamed from widgets/misc/e-popup-menu.c) | 54 | ||||
-rw-r--r-- | widgets/table/e-popup-menu.h (renamed from widgets/misc/e-popup-menu.h) | 23 | ||||
-rw-r--r-- | widgets/table/e-table-header-item.c | 2 |
5 files changed, 14 insertions, 69 deletions
diff --git a/widgets/misc/Makefile.am b/widgets/misc/Makefile.am index 4076249f19..05a5967b7f 100644 --- a/widgets/misc/Makefile.am +++ b/widgets/misc/Makefile.am @@ -46,7 +46,6 @@ widgetsinclude_HEADERS = \ e-paned.h \ e-picture-gallery.h \ e-popup-action.h \ - e-popup-menu.h \ e-port-entry.h \ e-preferences-window.h \ e-preview-pane.h \ @@ -126,7 +125,6 @@ libemiscwidgets_la_SOURCES = \ e-paned.c \ e-picture-gallery.c \ e-popup-action.c \ - e-popup-menu.c \ e-port-entry.c \ e-preferences-window.c \ e-preview-pane.c \ diff --git a/widgets/table/Makefile.am b/widgets/table/Makefile.am index 2764c96c81..0ae1e2b7e9 100644 --- a/widgets/table/Makefile.am +++ b/widgets/table/Makefile.am @@ -29,6 +29,7 @@ libetable_la_SOURCES = \ e-cell-tree.c \ e-cell-vbox.c \ e-cell-hbox.c \ + e-popup-menu.c \ e-table-click-to-add.c \ e-table-col.c \ e-table-column-specification.c \ @@ -104,6 +105,7 @@ libetableinclude_HEADERS = \ e-cell-tree.h \ e-cell-vbox.h \ e-cell-hbox.h \ + e-popup-menu.h \ e-table-click-to-add.h \ e-table-col-dnd.h \ e-table-col.h \ diff --git a/widgets/misc/e-popup-menu.c b/widgets/table/e-popup-menu.c index d166ac01b4..07589b1589 100644 --- a/widgets/misc/e-popup-menu.c +++ b/widgets/table/e-popup-menu.c @@ -38,7 +38,7 @@ * Creates an item with an optional icon */ static void -make_item (GtkMenu *menu, GtkMenuItem *item, const gchar *name, GtkWidget *pixmap) +make_item (GtkMenu *menu, GtkMenuItem *item, const gchar *name) { GtkWidget *label; @@ -53,24 +53,6 @@ make_item (GtkMenu *menu, GtkMenuItem *item, const gchar *name, GtkWidget *pixma gtk_widget_show (label); gtk_container_add (GTK_CONTAINER (item), label); - - if (pixmap && GTK_IS_IMAGE_MENU_ITEM (item)) { - gtk_widget_show (pixmap); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), pixmap); - } -} - -GtkMenu * -e_popup_menu_create (EPopupMenu *menu_list, - guint32 disable_mask, - guint32 hide_mask, - gpointer default_closure) -{ - return e_popup_menu_create_with_domain (menu_list, - disable_mask, - hide_mask, - default_closure, - NULL); } GtkMenu * @@ -81,7 +63,6 @@ e_popup_menu_create_with_domain (EPopupMenu *menu_list, const gchar *domain) { GtkMenu *menu = GTK_MENU (gtk_menu_new ()); - GSList *group = NULL; gboolean last_item_separator = TRUE; gint last_non_separator = -1; gint i; @@ -101,38 +82,19 @@ e_popup_menu_create_with_domain (EPopupMenu *menu_list, GtkWidget *item = NULL; if (!separator) { - if (menu_list[i].is_toggle) - item = gtk_check_menu_item_new (); - else if (menu_list[i].is_radio) - item = gtk_radio_menu_item_new (group); - else - item = menu_list[i].pixmap_widget ? gtk_image_menu_item_new () : gtk_menu_item_new (); - if (menu_list[i].is_toggle || menu_list[i].is_radio) - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), menu_list[i].is_active); - if (menu_list[i].is_radio) - group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item)); - - make_item (menu, GTK_MENU_ITEM (item), dgettext (domain, menu_list[i].name), menu_list[i].pixmap_widget); + item = gtk_menu_item_new (); + + make_item (menu, GTK_MENU_ITEM (item), dgettext (domain, menu_list[i].name)); } else { item = gtk_menu_item_new (); } gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); - if (!menu_list[i].submenu) { - if (menu_list[i].fn) - g_signal_connect (item, "activate", - G_CALLBACK (menu_list[i].fn), - menu_list[i].use_custom_closure ? menu_list[i].closure : default_closure); - } else { - /* submenu */ - GtkMenu *submenu; - - submenu = e_popup_menu_create (menu_list[i].submenu, disable_mask, hide_mask, - default_closure); - - gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), GTK_WIDGET (submenu)); - } + if (menu_list[i].fn) + g_signal_connect (item, "activate", + G_CALLBACK (menu_list[i].fn), + default_closure); if (menu_list[i].disable_mask & disable_mask) gtk_widget_set_sensitive (item, FALSE); diff --git a/widgets/misc/e-popup-menu.h b/widgets/table/e-popup-menu.h index 24a8fa6022..9fd3616eb2 100644 --- a/widgets/misc/e-popup-menu.h +++ b/widgets/table/e-popup-menu.h @@ -29,12 +29,11 @@ G_BEGIN_DECLS -#define E_POPUP_SEPARATOR { (gchar *) "", NULL, (NULL), NULL, 0 } -#define E_POPUP_TERMINATOR { NULL, NULL, (NULL), NULL, 0 } +#define E_POPUP_SEPARATOR { (gchar *) "", NULL, (NULL), 0 } +#define E_POPUP_TERMINATOR { NULL, NULL, (NULL), 0 } #define E_POPUP_ITEM(name,fn,disable_mask) \ - { (gchar *) (name), NULL, (fn), NULL, \ - (disable_mask), NULL, NULL, 0, 0, 0, 0 } + { (gchar *) (name), NULL, (fn), (disable_mask) } typedef struct _EPopupMenu EPopupMenu; @@ -42,25 +41,9 @@ struct _EPopupMenu { gchar *name; gchar *pixname; GCallback fn; - - EPopupMenu *submenu; guint32 disable_mask; - - /* Added post 0.19 */ - GtkWidget *pixmap_widget; - gpointer closure; - - guint is_toggle : 1; - guint is_radio : 1; - guint is_active : 1; - - guint use_custom_closure : 1; }; -GtkMenu * e_popup_menu_create (EPopupMenu *menu_list, - guint32 disable_mask, - guint32 hide_mask, - gpointer default_closure); GtkMenu * e_popup_menu_create_with_domain (EPopupMenu *menu_list, guint32 disable_mask, guint32 hide_mask, diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index 9215e7b2fb..d8a7d0d7a0 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -36,8 +36,8 @@ #include "e-util/e-util.h" #include "e-util/e-xml-utils.h" #include "misc/e-canvas.h" -#include "misc/e-popup-menu.h" +#include "e-popup-menu.h" #include "e-table.h" #include "e-table-col-dnd.h" #include "e-table-config.h" |