aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2007-12-17 13:40:53 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2007-12-17 13:40:53 +0800
commit2093e3100243fb209ceb2c3a26d917124903dd8a (patch)
tree7974536b2cc4f091d51cfffdf67cc1b862134a06 /e-util
parentaec1cc466636e8630eccbf4cf5a593dca84dde95 (diff)
downloadgsoc2013-evolution-2093e3100243fb209ceb2c3a26d917124903dd8a.tar
gsoc2013-evolution-2093e3100243fb209ceb2c3a26d917124903dd8a.tar.gz
gsoc2013-evolution-2093e3100243fb209ceb2c3a26d917124903dd8a.tar.bz2
gsoc2013-evolution-2093e3100243fb209ceb2c3a26d917124903dd8a.tar.lz
gsoc2013-evolution-2093e3100243fb209ceb2c3a26d917124903dd8a.tar.xz
gsoc2013-evolution-2093e3100243fb209ceb2c3a26d917124903dd8a.tar.zst
gsoc2013-evolution-2093e3100243fb209ceb2c3a26d917124903dd8a.zip
** Fix for bug #211353
2007-12-14 Milan Crha <mcrha@redhat.com> ** Fix for bug #211353 * message-list.etspec: * message-list.h: * message-list.c: Added new column to show labels. * filtertypes.xml: * vfoldertypes.xml: Code for label filters/search folders has been changed. * mail-config.glade: * em-folder-view.c: (emfv_set_label), (emfv_unset_label), (emfv_popup_label_clear), (emfv_popup_label_set), (emfv_popup_labels_get_state_for_tag), (emfv_popup): Labels popup submenu is now shown with checkboxes so one can set more than one label to the message and unset only one label from message. There has been added new function, because of this. * mail-config.h: * mail-config.c: New "interface" functions to work with labels. * em-mailer-prefs.h: * em-mailer-prefs.c: Editing labels in tree. * em-folder-browser.c: Labels in show menu reflect changes in preferences. 2007-12-14 Milan Crha <mcrha@redhat.com> ** Part of fix for bug #211353 * filter-label.c: Use global label's setup, not its own copy. 2007-12-14 Milan Crha <mcrha@redhat.com> ** Part of fix for bug #211353 * e-popup.h: * e-popup.c: (ep_build_tree): Toggles can be in inconsistent state now, and can also contain an image, which is a pointer to GtkImage widget. 2007-12-14 Milan Crha <mcrha@redhat.com> ** Part of fix for bug #211353 * e-search-bar.c: (e_search_bar_get_viewitem_id): Return -1 if no viewmenu is setup yet. svn path=/trunk/; revision=34715
Diffstat (limited to 'e-util')
-rw-r--r--e-util/ChangeLog9
-rw-r--r--e-util/e-popup.c21
-rw-r--r--e-util/e-popup.h7
3 files changed, 34 insertions, 3 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index f33a5bef7a..c5ccab7aa7 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,12 @@
+2007-12-14 Milan Crha <mcrha@redhat.com>
+
+ ** Part of fix for bug #211353
+
+ * e-popup.h:
+ * e-popup.c: (ep_build_tree):
+ Toggles can be in inconsistent state now, and can also contain
+ an image, which is a pointer to GtkImage widget.
+
2007-12-17 Srinivasa Ragavan <sragavan@novell.com>
* Makefile.am: Add e-logger.[ch] to compilation
diff --git a/e-util/e-popup.c b/e-util/e-popup.c
index edeb6cebdc..b7d904a6eb 100644
--- a/e-util/e-popup.c
+++ b/e-util/e-popup.c
@@ -37,6 +37,7 @@
#include <gtk/gtkseparatormenuitem.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkimage.h>
+#include <gtk/gtkhbox.h>
#include "e-popup.h"
@@ -381,7 +382,13 @@ ep_build_tree(struct _item_node *inode, guint32 mask)
break;
case E_POPUP_TOGGLE:
menuitem = (GtkMenuItem *)gtk_check_menu_item_new();
- gtk_check_menu_item_set_active((GtkCheckMenuItem *)menuitem, item->type & E_POPUP_ACTIVE);
+ if (item->type & E_POPUP_INCONSISTENT)
+ gtk_check_menu_item_set_inconsistent (GTK_CHECK_MENU_ITEM (menuitem), TRUE);
+ else
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), item->type & E_POPUP_ACTIVE);
+
+ if (item->image)
+ gtk_widget_show (item->image);
break;
case E_POPUP_RADIO: {
char *ppath = inode->parent?inode->parent->item->path:NULL;
@@ -411,7 +418,17 @@ ep_build_tree(struct _item_node *inode, guint32 mask)
label = gtk_label_new_with_mnemonic(dgettext(inode->menu->domain, item->label));
gtk_misc_set_alignment((GtkMisc *)label, 0.0, 0.5);
gtk_widget_show(label);
- gtk_container_add((GtkContainer *)menuitem, label);
+ if (item->image && (item->type & E_POPUP_TYPE_MASK) == E_POPUP_TOGGLE) {
+ GtkWidget *hbox = gtk_hbox_new (FALSE, 4);
+
+ gtk_box_pack_start (GTK_BOX (hbox), item->image, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
+ gtk_widget_show (hbox);
+ gtk_container_add (GTK_CONTAINER (menuitem), hbox);
+ } else
+ gtk_container_add((GtkContainer *)menuitem, label);
+ } else if (item->image && (item->type & E_POPUP_TYPE_MASK) == E_POPUP_TOGGLE) {
+ gtk_container_add (GTK_CONTAINER (menuitem), item->image);
}
if (item->activate)
diff --git a/e-util/e-popup.h b/e-util/e-popup.h
index a4928c035c..617239c8f0 100644
--- a/e-util/e-popup.h
+++ b/e-util/e-popup.h
@@ -50,7 +50,9 @@ typedef void (*EPopupItemsFunc)(EPopup *ep, GSList *items, void *data);
/**
* enum _e_popup_t - Popup item type enumeration.
* @E_POPUP_ITEM: A simple menu item.
- * @E_POPUP_TOGGLE: A toggle menu item.
+ * @E_POPUP_TOGGLE: A toggle menu item. If struct _EPopupItem::image is
+ * not NULL, then it points to GtkImage directly and there is a toggle
+ * with an image and caption shown in the popup menu.
* @E_POPUP_RADIO: A radio menu item. Note that the radio group is
* global for the entire (sub) menu. i.e. submenu's must be used to
* separate radio button menu items.
@@ -63,6 +65,8 @@ typedef void (*EPopupItemsFunc)(EPopup *ep, GSList *items, void *data);
* @E_POPUP_TYPE_MASK: Mask used to separate item type from option bits.
* @E_POPUP_ACTIVE: An option bit to signify that the radio button or
* toggle button is active.
+ * @E_POPUP_INCONSISTENT: An option to toggle only, if set, the toggle
+ * is shown in inconsistent state. This is used before E_POPUP_ACTIVE.
*/
enum _e_popup_t {
E_POPUP_ITEM = 0,
@@ -73,6 +77,7 @@ enum _e_popup_t {
E_POPUP_BAR,
E_POPUP_TYPE_MASK = 0xffff,
E_POPUP_ACTIVE = 0x10000,
+ E_POPUP_INCONSISTENT = 0x20000
};
/* FIXME: activate passes back no context data apart from that provided.