From 43d1413338d9a51b69088f05cff32ff7ccaa3c66 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 29 Mar 2010 11:22:23 -0400 Subject: Bug 614049 - Attachment bar causes drawing issues in RTL locales --- widgets/misc/e-attachment-paned.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'widgets') diff --git a/widgets/misc/e-attachment-paned.c b/widgets/misc/e-attachment-paned.c index 519d4070c8..8b4c2bfb96 100644 --- a/widgets/misc/e-attachment-paned.c +++ b/widgets/misc/e-attachment-paned.c @@ -619,10 +619,15 @@ attachment_paned_init (EAttachmentPaned *paned) /* Request the width to be as large as possible, and let the * GtkExpander allocate what space there is. This effectively - * packs the widget to expand. */ + * packs the widget to expand. + * + * XXX This hack causes nasty side-effects in RTL locales, + * so check the reading direction before applying it. + * See GNOME bug #614049 for details + screenshot. */ widget = gtk_hbox_new (FALSE, 6); gtk_size_group_add_widget (size_group, widget); - gtk_widget_set_size_request (widget, G_MAXINT, -1); + if (gtk_widget_get_direction (widget) != GTK_TEXT_DIR_RTL) + gtk_widget_set_size_request (widget, G_MAXINT, -1); gtk_expander_set_label_widget (GTK_EXPANDER (container), widget); gtk_widget_show (widget); -- cgit v1.2.3 From cc7240b28e554ec88bbba7f67c52699b7588c59b Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 1 Apr 2010 14:14:56 +0200 Subject: Bug #488979 - Disable Edit for card views in contacts --- widgets/menus/gal-define-views-dialog.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'widgets') diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c index 34c20be18a..3a32dc64f6 100644 --- a/widgets/menus/gal-define-views-dialog.c +++ b/widgets/menus/gal-define-views-dialog.c @@ -188,13 +188,18 @@ gdvd_cursor_changed_callback (GtkWidget *widget, GalDefineViewsDialog *dialog) if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection (dialog->treeview), &dialog->model, &iter)) { + GalViewClass *gvclass = NULL; + gtk_tree_model_get (dialog->model, &iter, COL_GALVIEW_DATA, &item, -1); button = e_builder_get_widget (dialog->builder, "button-delete"); gtk_widget_set_sensitive (GTK_WIDGET (button), !item->built_in); + if (item->view) + gvclass = GAL_VIEW_GET_CLASS (item->view); + button = e_builder_get_widget (dialog->builder, "button-modify"); - gtk_widget_set_sensitive (GTK_WIDGET (button), !item->built_in); + gtk_widget_set_sensitive (GTK_WIDGET (button), !item->built_in && gvclass && gvclass->edit != NULL); } } -- cgit v1.2.3 From 260032a9ff49e78d4081b40e5f7102d2928fc572 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 20 Mar 2010 00:32:47 +0000 Subject: Add extensions to configure calender widgets. Make ECalendarItem, ECalendarView, ECalModel, EDateEdit, EMeetingStore, and EMeetingTimeSelector extensible and register extensions to automatically bind every instance to the appropriate EShellSettings. Conflicts: calendar/gui/gnome-cal.c modules/calendar/e-cal-shell-content.c --- widgets/misc/e-calendar-item.c | 7 ++++++- widgets/misc/e-calendar-item.h | 24 ++++++++++++++++++------ widgets/misc/e-dateedit.c | 39 +++++++++------------------------------ 3 files changed, 33 insertions(+), 37 deletions(-) (limited to 'widgets') diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c index def7019c21..4d7506e05d 100644 --- a/widgets/misc/e-calendar-item.c +++ b/widgets/misc/e-calendar-item.c @@ -35,6 +35,7 @@ #include #include #include +#include static const gint e_calendar_item_days_in_month[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 @@ -228,7 +229,9 @@ enum { static guint e_calendar_item_signals[LAST_SIGNAL] = { 0 }; -G_DEFINE_TYPE (ECalendarItem, e_calendar_item, GNOME_TYPE_CANVAS_ITEM) +G_DEFINE_TYPE_WITH_CODE ( + ECalendarItem, e_calendar_item, GNOME_TYPE_CANVAS_ITEM, + G_IMPLEMENT_INTERFACE (E_TYPE_EXTENSIBLE, NULL)) static void e_calendar_item_class_init (ECalendarItemClass *class) @@ -844,6 +847,8 @@ e_calendar_item_realize (GnomeCanvasItem *item) calitem = E_CALENDAR_ITEM (item); e_calendar_item_style_set (GTK_WIDGET(item->canvas), calitem); + + e_extensible_load_extensions (E_EXTENSIBLE (calitem)); } static void diff --git a/widgets/misc/e-calendar-item.h b/widgets/misc/e-calendar-item.h index 6a3b74fccb..4aab58ea2e 100644 --- a/widgets/misc/e-calendar-item.h +++ b/widgets/misc/e-calendar-item.h @@ -109,12 +109,24 @@ typedef void (*ECalendarItemStyleCallback) (ECalendarItem *calitem, typedef struct tm (*ECalendarItemGetTimeCallback) (ECalendarItem *calitem, gpointer data); -#define E_CALENDAR_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - e_calendar_item_get_type (), ECalendarItem)) -#define E_CALENDAR_ITEM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k),\ - e_calendar_item_get_type ())) -#define E_IS_CALENDAR_ITEM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), \ - e_calendar_item_get_type ())) +/* Standard GObject macros */ +#define E_TYPE_CALENDAR_ITEM \ + (e_calendar_item_get_type ()) +#define E_CALENDAR_ITEM(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_CALENDAR_ITEM, ECalendarItem)) +#define E_CALENDAR_ITEM_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_CALENDAR_ITEM, ECalendarItemClass)) +#define E_IS_CALENDAR_ITEM(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_CALENDAR_ITEM)) +#define E_IS_CALENDAR_ITEM_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_CALENDAR_ITEM)) +#define E_CALENDAR_ITEM_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_CALENDAR_ITEM, ECalendarItemClass)) struct _ECalendarItem { diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index db63ffaaf8..03c8f2fd47 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -41,6 +41,7 @@ #include #include #include +#include #include "e-calendar.h" #define E_DATE_EDIT_GET_PRIVATE(obj) \ @@ -205,9 +206,12 @@ static gboolean e_date_edit_set_time_internal (EDateEdit *dedit, gint hour, gint minute); -static gpointer parent_class; static gint signals[LAST_SIGNAL]; +G_DEFINE_TYPE_WITH_CODE ( + EDateEdit, e_date_edit, GTK_TYPE_HBOX, + G_IMPLEMENT_INTERFACE (E_TYPE_EXTENSIBLE, NULL)) + static void date_edit_set_property (GObject *object, guint property_id, @@ -334,16 +338,15 @@ date_edit_dispose (GObject *object) } /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (e_date_edit_parent_class)->dispose (object); } static void -date_edit_class_init (EDateEditClass *class) +e_date_edit_class_init (EDateEditClass *class) { GObjectClass *object_class; GtkWidgetClass *widget_class; - parent_class = g_type_class_peek_parent (class); g_type_class_add_private (class, sizeof (EDateEditPrivate)); object_class = G_OBJECT_CLASS (class); @@ -448,7 +451,7 @@ date_edit_class_init (EDateEditClass *class) } static void -date_edit_init (EDateEdit *dedit) +e_date_edit_init (EDateEdit *dedit) { dedit->priv = E_DATE_EDIT_GET_PRIVATE (dedit); @@ -476,32 +479,8 @@ date_edit_init (EDateEdit *dedit) /* Set it to the current time. */ e_date_edit_set_time (dedit, 0); -} - -GType -e_date_edit_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) { - static const GTypeInfo type_info = { - sizeof (EDateEditClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) date_edit_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (EDateEdit), - 0, /* n_preallocs */ - (GInstanceInitFunc) date_edit_init, - NULL /* value_table */ - }; - - type = g_type_register_static ( - GTK_TYPE_HBOX, "EDateEdit", &type_info, 0); - } - return type; + e_extensible_load_extensions (E_EXTENSIBLE (dedit)); } /** -- cgit v1.2.3 From fe177f5a12127203f0b77c32ec0ae17d7394f6b2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 22 Mar 2010 16:03:46 +0000 Subject: Add an extension to configure EWebView. Make EWebView extensible and register an extension to automatically bind every EWebView instance to the appropriate EShellSettings. Conflicts: widgets/misc/e-web-view.c --- widgets/misc/e-web-view.c | 209 ++++++++++++++++++++++++++++++++++++---------- widgets/misc/e-web-view.h | 9 ++ 2 files changed, 176 insertions(+), 42 deletions(-) (limited to 'widgets') diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c index ce41c32d4c..c65f9cf666 100644 --- a/widgets/misc/e-web-view.c +++ b/widgets/misc/e-web-view.c @@ -28,9 +28,10 @@ #include #include -#include "e-util/e-util.h" -#include "e-util/e-binding.h" -#include "e-util/e-plugin-ui.h" +#include +#include +#include +#include #include "e-popup-action.h" #include "e-selectable.h" @@ -75,6 +76,9 @@ enum { PROP_DISABLE_PRINTING, PROP_DISABLE_SAVE_TO_DISK, PROP_EDITABLE, + PROP_INLINE_SPELLING, + PROP_MAGIC_LINKS, + PROP_MAGIC_SMILEYS, PROP_OPEN_PROXY, PROP_PASTE_TARGET_LIST, PROP_PRINT_PROXY, @@ -118,6 +122,14 @@ static const gchar *ui = " " ""; +/* Forward Declarations */ +static void e_web_view_selectable_init (ESelectableInterface *interface); + +G_DEFINE_TYPE_WITH_CODE ( + EWebView, e_web_view, GTK_TYPE_HTML, + G_IMPLEMENT_INTERFACE (E_TYPE_EXTENSIBLE, NULL) + G_IMPLEMENT_INTERFACE (E_TYPE_SELECTABLE, e_web_view_selectable_init)) + static EWebViewRequest * web_view_request_new (EWebView *web_view, const gchar *uri, @@ -503,6 +515,24 @@ web_view_set_property (GObject *object, g_value_get_boolean (value)); return; + case PROP_INLINE_SPELLING: + e_web_view_set_inline_spelling ( + E_WEB_VIEW (object), + g_value_get_boolean (value)); + return; + + case PROP_MAGIC_LINKS: + e_web_view_set_magic_links ( + E_WEB_VIEW (object), + g_value_get_boolean (value)); + return; + + case PROP_MAGIC_SMILEYS: + e_web_view_set_magic_smileys ( + E_WEB_VIEW (object), + g_value_get_boolean (value)); + return; + case PROP_OPEN_PROXY: e_web_view_set_open_proxy ( E_WEB_VIEW (object), @@ -574,6 +604,24 @@ web_view_get_property (GObject *object, E_WEB_VIEW (object))); return; + case PROP_INLINE_SPELLING: + g_value_set_boolean ( + value, e_web_view_get_inline_spelling ( + E_WEB_VIEW (object))); + return; + + case PROP_MAGIC_LINKS: + g_value_set_boolean ( + value, e_web_view_get_magic_links ( + E_WEB_VIEW (object))); + return; + + case PROP_MAGIC_SMILEYS: + g_value_set_boolean ( + value, e_web_view_get_magic_smileys ( + E_WEB_VIEW (object))); + return; + case PROP_OPEN_PROXY: g_value_set_object ( value, e_web_view_get_open_proxy ( @@ -1004,7 +1052,7 @@ web_view_selectable_select_all (ESelectable *selectable) } static void -web_view_class_init (EWebViewClass *class) +e_web_view_class_init (EWebViewClass *class) { GObjectClass *object_class; GtkWidgetClass *widget_class; @@ -1071,7 +1119,8 @@ web_view_class_init (EWebViewClass *class) "Disable Printing", NULL, FALSE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT)); g_object_class_install_property ( object_class, @@ -1081,7 +1130,8 @@ web_view_class_init (EWebViewClass *class) "Disable Save-to-Disk", NULL, FALSE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT)); g_object_class_install_property ( object_class, @@ -1093,6 +1143,36 @@ web_view_class_init (EWebViewClass *class) FALSE, G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_INLINE_SPELLING, + g_param_spec_boolean ( + "inline-spelling", + "Inline Spelling", + NULL, + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_MAGIC_LINKS, + g_param_spec_boolean ( + "magic-links", + "Magic Links", + NULL, + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_MAGIC_SMILEYS, + g_param_spec_boolean ( + "magic-smileys", + "Magic Smileys", + NULL, + FALSE, + G_PARAM_READWRITE)); + g_object_class_install_property ( object_class, PROP_OPEN_PROXY, @@ -1207,7 +1287,7 @@ web_view_class_init (EWebViewClass *class) } static void -web_view_selectable_init (ESelectableInterface *interface) +e_web_view_selectable_init (ESelectableInterface *interface) { interface->update_actions = web_view_selectable_update_actions; interface->cut_clipboard = web_view_selectable_cut_clipboard; @@ -1217,7 +1297,7 @@ web_view_selectable_init (ESelectableInterface *interface) } static void -web_view_init (EWebView *web_view) +e_web_view_init (EWebView *web_view) { GtkUIManager *ui_manager; GtkActionGroup *action_group; @@ -1333,41 +1413,8 @@ web_view_init (EWebView *web_view) id = "org.gnome.evolution.webview"; e_plugin_ui_register_manager (ui_manager, id, web_view); e_plugin_ui_enable_manager (ui_manager, id); -} - -GType -e_web_view_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) { - static const GTypeInfo type_info = { - sizeof (EWebViewClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) web_view_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (EWebView), - 0, /* n_preallocs */ - (GInstanceInitFunc) web_view_init, - NULL /* value_table */ - }; - - static const GInterfaceInfo selectable_info = { - (GInterfaceInitFunc) web_view_selectable_init, - (GInterfaceFinalizeFunc) NULL, - NULL /* interface_data */ - }; - - type = g_type_register_static ( - GTK_TYPE_HTML, "EWebView", &type_info, 0); - - g_type_add_interface_static ( - type, E_TYPE_SELECTABLE, &selectable_info); - } - return type; + e_extensible_load_extensions (E_EXTENSIBLE (web_view)); } GtkWidget * @@ -1520,6 +1567,84 @@ e_web_view_set_editable (EWebView *web_view, g_object_notify (G_OBJECT (web_view), "editable"); } +gboolean +e_web_view_get_inline_spelling (EWebView *web_view) +{ + /* XXX This is just here to maintain symmetry + * with e_web_view_set_inline_spelling(). */ + + g_return_val_if_fail (E_IS_WEB_VIEW (web_view), FALSE); + + return gtk_html_get_inline_spelling (GTK_HTML (web_view)); +} + +void +e_web_view_set_inline_spelling (EWebView *web_view, + gboolean inline_spelling) +{ + /* XXX GtkHTML does not utilize GObject properties as well + * as it could. This just wraps gtk_html_set_inline_spelling() + * so we get a "notify::inline-spelling" signal. */ + + g_return_if_fail (E_IS_WEB_VIEW (web_view)); + + gtk_html_set_inline_spelling (GTK_HTML (web_view), inline_spelling); + + g_object_notify (G_OBJECT (web_view), "inline-spelling"); +} + +gboolean +e_web_view_get_magic_links (EWebView *web_view) +{ + /* XXX This is just here to maintain symmetry + * with e_web_view_set_magic_links(). */ + + g_return_val_if_fail (E_IS_WEB_VIEW (web_view), FALSE); + + return gtk_html_get_magic_links (GTK_HTML (web_view)); +} + +void +e_web_view_set_magic_links (EWebView *web_view, + gboolean magic_links) +{ + /* XXX GtkHTML does not utilize GObject properties as well + * as it could. This just wraps gtk_html_set_magic_links() + * so we can get a "notify::magic-links" signal. */ + + g_return_if_fail (E_IS_WEB_VIEW (web_view)); + + gtk_html_set_magic_links (GTK_HTML (web_view), magic_links); + + g_object_notify (G_OBJECT (web_view), "magic-links"); +} + +gboolean +e_web_view_get_magic_smileys (EWebView *web_view) +{ + /* XXX This is just here to maintain symmetry + * with e_web_view_set_magic_smileys(). */ + + g_return_val_if_fail (E_IS_WEB_VIEW (web_view), FALSE); + + return gtk_html_get_magic_smileys (GTK_HTML (web_view)); +} + +void +e_web_view_set_magic_smileys (EWebView *web_view, + gboolean magic_smileys) +{ + /* XXX GtkHTML does not utilize GObject properties as well + * as it could. This just wraps gtk_html_set_magic_smileys() + * so we can get a "notify::magic-smileys" signal. */ + + g_return_if_fail (E_IS_WEB_VIEW (web_view)); + + gtk_html_set_magic_smileys (GTK_HTML (web_view), magic_smileys); + + g_object_notify (G_OBJECT (web_view), "magic-smileys"); +} + const gchar * e_web_view_get_selected_uri (EWebView *web_view) { diff --git a/widgets/misc/e-web-view.h b/widgets/misc/e-web-view.h index 788eadb1b7..0fea6eb3cf 100644 --- a/widgets/misc/e-web-view.h +++ b/widgets/misc/e-web-view.h @@ -106,6 +106,15 @@ void e_web_view_set_disable_save_to_disk gboolean e_web_view_get_editable (EWebView *web_view); void e_web_view_set_editable (EWebView *web_view, gboolean editable); +gboolean e_web_view_get_inline_spelling (EWebView *web_view); +void e_web_view_set_inline_spelling (EWebView *web_view, + gboolean inline_spelling); +gboolean e_web_view_get_magic_links (EWebView *web_view); +void e_web_view_set_magic_links (EWebView *web_view, + gboolean magic_links); +gboolean e_web_view_get_magic_smileys (EWebView *web_view); +void e_web_view_set_magic_smileys (EWebView *web_view, + gboolean magic_smileys); const gchar * e_web_view_get_selected_uri (EWebView *web_view); void e_web_view_set_selected_uri (EWebView *web_view, const gchar *selected_uri); -- cgit v1.2.3 From 8f42c1dd8fd57e6cb1275e3322e10005466e9d15 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 26 Mar 2010 11:05:06 -0400 Subject: Minor EMailReader cleanup. Add a load_string() method to EWebView. Have EMailDisplay override load_string() and check that the formatter is not busy before loading the string. Have EMailReader call e_web_view_load_string() directly on the EMailDisplay instance, and eliminate update_webview_content(). --- widgets/misc/e-web-view.c | 21 +++++++++++++++++---- widgets/misc/e-web-view.h | 2 ++ 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'widgets') diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c index c65f9cf666..d245437e84 100644 --- a/widgets/misc/e-web-view.c +++ b/widgets/misc/e-web-view.c @@ -856,6 +856,16 @@ web_view_extract_uri (EWebView *web_view, return uri; } +static void +web_view_load_string (EWebView *web_view, + const gchar *string) +{ + if (string != NULL && *string != '\0') + gtk_html_load_from_string (GTK_HTML (web_view), string, -1); + else + e_web_view_clear (web_view); +} + static void web_view_copy_clipboard (EWebView *web_view) { @@ -1078,6 +1088,7 @@ e_web_view_class_init (EWebViewClass *class) html_class->iframe_created = web_view_iframe_created; class->extract_uri = web_view_extract_uri; + class->load_string = web_view_load_string; class->copy_clipboard = web_view_copy_clipboard; class->cut_clipboard = web_view_cut_clipboard; class->paste_clipboard = web_view_paste_clipboard; @@ -1435,12 +1446,14 @@ void e_web_view_load_string (EWebView *web_view, const gchar *string) { + EWebViewClass *class; + g_return_if_fail (E_IS_WEB_VIEW (web_view)); - if (string != NULL && *string != '\0') - gtk_html_load_from_string (GTK_HTML (web_view), string, -1); - else - e_web_view_clear (web_view); + class = E_WEB_VIEW_GET_CLASS (web_view); + g_return_if_fail (class->load_string != NULL); + + class->load_string (web_view, string); } gboolean diff --git a/widgets/misc/e-web-view.h b/widgets/misc/e-web-view.h index 0fea6eb3cf..7d8eb4c8d0 100644 --- a/widgets/misc/e-web-view.h +++ b/widgets/misc/e-web-view.h @@ -69,6 +69,8 @@ struct _EWebViewClass { gchar * (*extract_uri) (EWebView *web_view, GdkEventButton *event, GtkHTML *frame); + void (*load_string) (EWebView *web_view, + const gchar *load_string); /* Signals */ void (*copy_clipboard) (EWebView *web_view); -- cgit v1.2.3 From 1d6ecf87aa0e54f07dcf462459dd26c4056b9fe2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 28 Mar 2010 18:54:27 -0400 Subject: Fix mismatched quotes. --- widgets/table/e-cell-text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'widgets') diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index f9d3441d6f..f0509e4590 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -1421,7 +1421,7 @@ ect_print_height (ECellView *ecell_view, GtkPrintContext *context, * should be 16 + 4. * Height of some special font is much higher than others, * such as Arabic. So leave some more margin for cell. -` */ + */ return 16 + 8; } -- cgit v1.2.3 From 3dfd9aa7c4b24f8971382dcc5278714956066ff8 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Sun, 21 Mar 2010 00:12:01 +0100 Subject: [win32] Be consistent in disabling the lockdown options. --- widgets/misc/e-web-view.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'widgets') diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c index ce41c32d4c..e9fc71d7ca 100644 --- a/widgets/misc/e-web-view.c +++ b/widgets/misc/e-web-view.c @@ -1063,6 +1063,7 @@ web_view_class_init (EWebViewClass *class) PROP_COPY_TARGET_LIST, "copy-target-list"); +#ifndef G_OS_WIN32 g_object_class_install_property ( object_class, PROP_DISABLE_PRINTING, @@ -1082,6 +1083,7 @@ web_view_class_init (EWebViewClass *class) NULL, FALSE, G_PARAM_READWRITE)); +#endif g_object_class_install_property ( object_class, -- cgit v1.2.3 From 77e786d361d00239b8214393e1c12c8fd3929205 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 21 Apr 2010 14:41:50 +0100 Subject: fix disappearing e-table headers by realising the (horrible) pet widget we are going to steal the gc from, so it actually has it. --- widgets/table/e-table-header-utils.c | 1 + 1 file changed, 1 insertion(+) (limited to 'widgets') diff --git a/widgets/table/e-table-header-utils.c b/widgets/table/e-table-header-utils.c index f2a3c1a826..78ff576820 100644 --- a/widgets/table/e-table-header-utils.c +++ b/widgets/table/e-table-header-utils.c @@ -352,6 +352,7 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, g_label = GTK_BIN(button)->child; g_object_add_weak_pointer (G_OBJECT (g_label), &g_label); gtk_widget_ensure_style (g_label); + gtk_widget_realize (g_label); } gc = GTK_WIDGET (g_label)->style->fg_gc[state]; -- cgit v1.2.3 From 394eeb4c34a944f1f046efb6e596531630240a56 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 21 Apr 2010 14:41:50 +0100 Subject: fix disappearing e-table headers by realising the (horrible) pet widget we are going to steal the gc from, so it actually has it. --- widgets/table/e-table-header-utils.c | 1 + 1 file changed, 1 insertion(+) (limited to 'widgets') diff --git a/widgets/table/e-table-header-utils.c b/widgets/table/e-table-header-utils.c index f2a3c1a826..78ff576820 100644 --- a/widgets/table/e-table-header-utils.c +++ b/widgets/table/e-table-header-utils.c @@ -352,6 +352,7 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, g_label = GTK_BIN(button)->child; g_object_add_weak_pointer (G_OBJECT (g_label), &g_label); gtk_widget_ensure_style (g_label); + gtk_widget_realize (g_label); } gc = GTK_WIDGET (g_label)->style->fg_gc[state]; -- cgit v1.2.3 From 562240f36fe145498fbb8f8df0471a820e90736a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fridrich=20=C5=A0trba?= Date: Fri, 23 Apr 2010 13:23:32 +0200 Subject: Remove 3 leftover references to non-existing libraries --- widgets/text/Makefile.am | 4 ---- 1 file changed, 4 deletions(-) (limited to 'widgets') diff --git a/widgets/text/Makefile.am b/widgets/text/Makefile.am index 4c5314182f..1feb5f153e 100644 --- a/widgets/text/Makefile.am +++ b/widgets/text/Makefile.am @@ -1,7 +1,3 @@ -if OS_WIN32 -WIN32_BOOTSTRAP_LIBS = $(top_builddir)/win32/libemiscwidgets.la -endif - privsolib_LTLIBRARIES = libetext.la libetext_la_CPPFLAGS = \ -- cgit v1.2.3 From b64434a8699fbeea77a9108b313f29828adab321 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 27 Apr 2010 19:06:57 +0200 Subject: Bug #604430 - Calendar view not remembered --- widgets/menus/gal-view-instance.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'widgets') diff --git a/widgets/menus/gal-view-instance.c b/widgets/menus/gal-view-instance.c index fef74aab16..0d182608c5 100644 --- a/widgets/menus/gal-view-instance.c +++ b/widgets/menus/gal-view-instance.c @@ -394,8 +394,9 @@ gal_view_instance_set_current_view_id (GalViewInstance *instance, const gchar *v connect_view (instance, gal_view_clone (view)); } - save_current_view (instance); - gal_view_instance_changed(instance); + if (instance->loaded) + save_current_view (instance); + gal_view_instance_changed (instance); } GalView * -- cgit v1.2.3 From 8c06d8e67016b4f42148ac8539efecb9db082199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fridrich=20=C5=A0trba?= Date: Fri, 23 Apr 2010 13:23:32 +0200 Subject: Remove 3 leftover references to non-existing libraries --- widgets/text/Makefile.am | 4 ---- 1 file changed, 4 deletions(-) (limited to 'widgets') diff --git a/widgets/text/Makefile.am b/widgets/text/Makefile.am index 4c5314182f..1feb5f153e 100644 --- a/widgets/text/Makefile.am +++ b/widgets/text/Makefile.am @@ -1,7 +1,3 @@ -if OS_WIN32 -WIN32_BOOTSTRAP_LIBS = $(top_builddir)/win32/libemiscwidgets.la -endif - privsolib_LTLIBRARIES = libetext.la libetext_la_CPPFLAGS = \ -- cgit v1.2.3 From dbbeab8bd0417702a182764386f727d27194774b Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 27 Apr 2010 19:06:57 +0200 Subject: Bug #604430 - Calendar view not remembered --- widgets/menus/gal-view-instance.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'widgets') diff --git a/widgets/menus/gal-view-instance.c b/widgets/menus/gal-view-instance.c index fef74aab16..0d182608c5 100644 --- a/widgets/menus/gal-view-instance.c +++ b/widgets/menus/gal-view-instance.c @@ -394,8 +394,9 @@ gal_view_instance_set_current_view_id (GalViewInstance *instance, const gchar *v connect_view (instance, gal_view_clone (view)); } - save_current_view (instance); - gal_view_instance_changed(instance); + if (instance->loaded) + save_current_view (instance); + gal_view_instance_changed (instance); } GalView * -- cgit v1.2.3 From cab50ae5116499b9ec40c8a0311c10c62f54f073 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Fri, 30 Apr 2010 10:51:54 +0530 Subject: Add filter_page option for pref window so that we can show only required preferences for calendar. Bit of a hack, but proves very useful. --- widgets/misc/e-preferences-window.c | 89 ++++++++++++++++++++++++++++++++++--- widgets/misc/e-preferences-window.h | 2 + 2 files changed, 86 insertions(+), 5 deletions(-) (limited to 'widgets') diff --git a/widgets/misc/e-preferences-window.c b/widgets/misc/e-preferences-window.c index f40dee180b..8fa4fcf85f 100644 --- a/widgets/misc/e-preferences-window.c +++ b/widgets/misc/e-preferences-window.c @@ -33,11 +33,17 @@ struct _EPreferencesWindowPrivate { GtkWidget *icon_view; + GtkWidget *scroll; GtkWidget *notebook; GHashTable *index; + + GtkListStore *store; + GtkTreeModelFilter *filter; + const char *filter_view; }; enum { + COLUMN_ID, /* G_TYPE_STRING */ COLUMN_TEXT, /* G_TYPE_STRING */ COLUMN_PIXBUF, /* GDK_TYPE_PIXBUF */ COLUMN_PAGE, /* G_TYPE_INT */ @@ -102,7 +108,7 @@ preferences_window_selection_changed_cb (EPreferencesWindow *window) if (list == NULL) return; - model = gtk_icon_view_get_model (icon_view); + model = window->priv->store; gtk_tree_model_get_iter (model, &iter, list->data); gtk_tree_model_get (model, &iter, COLUMN_PAGE, &page, -1); @@ -190,6 +196,40 @@ preferences_window_class_init (EPreferencesWindowClass *class) widget_class->show = preferences_window_show; } +static gboolean +filter_view (GtkTreeModel *model, + GtkTreeIter *iter, + gpointer data) +{ + EPreferencesWindow *window = (EPreferencesWindow *)data; + gchar *str; + gboolean visible = FALSE; + + if (!window->priv->filter_view) + return TRUE; + + gtk_tree_model_get (model, iter, COLUMN_ID, &str, -1); + if (strncmp(window->priv->filter_view, "mail", 4) == 0) { + /* Show everything except calendar */ + if (str && (strncmp (str, "cal", 3) == 0)) + visible = FALSE; + else + visible = TRUE; + } else if (strncmp(window->priv->filter_view, "cal", 3) == 0) { + /* Show only calendar and nothing else */ + if (str && (strncmp (str, "cal", 3) != 0)) + visible = FALSE; + else + visible = TRUE; + + } else /* In any other case, show everything */ + visible = TRUE; + + g_free (str); + + return visible; +} + static void preferences_window_init (EPreferencesWindow *window) { @@ -209,11 +249,16 @@ preferences_window_init (EPreferencesWindow *window) window->priv = E_PREFERENCES_WINDOW_GET_PRIVATE (window); window->priv->index = index; + window->priv->filter_view = NULL; store = gtk_list_store_new ( - 4, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_INT, G_TYPE_INT); + 5, G_TYPE_STRING, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_INT, G_TYPE_INT); gtk_tree_sortable_set_sort_column_id ( GTK_TREE_SORTABLE (store), COLUMN_SORT, GTK_SORT_ASCENDING); + window->priv->store = store; + + window->priv->filter = (GtkTreeModelFilter *)gtk_tree_model_filter_new ((GtkTreeModel *)store, NULL); + gtk_tree_model_filter_set_visible_func (window->priv->filter, filter_view, window, NULL); title = _("Evolution Preferences"); gtk_window_set_title (GTK_WINDOW (window), title); @@ -243,11 +288,12 @@ preferences_window_init (EPreferencesWindow *window) gtk_scrolled_window_set_shadow_type ( GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN); gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, TRUE, 0); + window->priv->scroll = widget; gtk_widget_show (widget); - + container = widget; - widget = gtk_icon_view_new_with_model (GTK_TREE_MODEL (store)); + widget = gtk_icon_view_new_with_model (GTK_TREE_MODEL (window->priv->filter)); gtk_icon_view_set_columns (GTK_ICON_VIEW (widget), 1); gtk_icon_view_set_text_column (GTK_ICON_VIEW (widget), COLUMN_TEXT); gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (widget), COLUMN_PIXBUF); @@ -359,13 +405,14 @@ e_preferences_window_add_page (EPreferencesWindow *window, notebook = GTK_NOTEBOOK (window->priv->notebook); page = gtk_notebook_get_n_pages (notebook); - model = gtk_icon_view_get_model (icon_view); + model = window->priv->store; pixbuf = preferences_window_load_pixbuf (icon_name); gtk_list_store_append (GTK_LIST_STORE (model), &iter); gtk_list_store_set ( GTK_LIST_STORE (model), &iter, + COLUMN_ID, page_name, COLUMN_TEXT, caption, COLUMN_PIXBUF, pixbuf, COLUMN_PAGE, page, COLUMN_SORT, sort_order, -1); @@ -405,3 +452,35 @@ e_preferences_window_show_page (EPreferencesWindow *window, gtk_icon_view_scroll_to_path (icon_view, path, FALSE, 0.0, 0.0); gtk_tree_path_free (path); } + +void +e_preferences_window_filter_page (EPreferencesWindow *window, + const gchar *page_name) +{ + GtkTreeRowReference *reference; + GtkIconView *icon_view; + GtkTreePath *path; + + g_return_if_fail (E_IS_PREFERENCES_WINDOW (window)); + g_return_if_fail (page_name != NULL); + + icon_view = GTK_ICON_VIEW (window->priv->icon_view); + reference = g_hash_table_lookup (window->priv->index, page_name); + g_return_if_fail (reference != NULL); + + path = gtk_tree_row_reference_get_path (reference); + gtk_icon_view_select_path (icon_view, path); + gtk_icon_view_scroll_to_path (icon_view, path, FALSE, 0.0, 0.0); + gtk_tree_path_free (path); + + window->priv->filter_view = page_name; + gtk_tree_model_filter_refilter (window->priv->filter); + + /* XXX: We need a better solution to hide the icon view when + * there is just one entry */ + if (strncmp(page_name, "cal", 3) == 0) { + gtk_widget_hide (window->priv->scroll); + } else + gtk_widget_show (window->priv->scroll); +} + diff --git a/widgets/misc/e-preferences-window.h b/widgets/misc/e-preferences-window.h index 4944a89e58..97f0da85e2 100644 --- a/widgets/misc/e-preferences-window.h +++ b/widgets/misc/e-preferences-window.h @@ -68,6 +68,8 @@ void e_preferences_window_add_page (EPreferencesWindow *window, gint sort_order); void e_preferences_window_show_page (EPreferencesWindow *window, const gchar *page_name); +void e_preferences_window_filter_page (EPreferencesWindow *window, + const gchar *page_name); G_END_DECLS -- cgit v1.2.3 From 44f23495b48bcfd22b86cab8f6c8f77ba4f91166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 30 Apr 2010 14:54:45 +0200 Subject: Bug #614346 - Use cached table row height rather than recalculate --- widgets/table/e-table-item.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'widgets') diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index 22a0848d7f..1bc3a08dc5 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -749,14 +749,14 @@ eti_get_height (ETableItem *eti) return 0; if (eti->uniform_row_height) { - gint row_height = eti_row_height(eti, -1); + gint row_height = ETI_ROW_HEIGHT(eti, -1); return ((row_height + height_extra) * rows + height_extra); } else { gint height; gint row; if (eti->length_threshold != -1) { if (rows > eti->length_threshold) { - gint row_height = eti_row_height(eti, 0); + gint row_height = ETI_ROW_HEIGHT(eti, 0); if (eti->height_cache) { height = 0; for (row = 0; row < rows; row++) { @@ -768,7 +768,7 @@ eti_get_height (ETableItem *eti) height += eti->height_cache[row] + height_extra; } } else - height = (eti_row_height (eti, 0) + height_extra) * rows; + height = (ETI_ROW_HEIGHT (eti, 0) + height_extra) * rows; /* * 1 pixel at the top @@ -779,7 +779,7 @@ eti_get_height (ETableItem *eti) height = height_extra; for (row = 0; row < rows; row++) - height += eti_row_height (eti, row) + height_extra; + height += ETI_ROW_HEIGHT (eti, row) + height_extra; return height; } @@ -817,12 +817,12 @@ e_table_item_row_diff (ETableItem *eti, gint start_row, gint end_row) end_row = eti->rows; if (eti->uniform_row_height) { - return ((end_row - start_row) * (eti_row_height(eti, -1) + height_extra)); + return ((end_row - start_row) * (ETI_ROW_HEIGHT(eti, -1) + height_extra)); } else { gint row, total; total = 0; for (row = start_row; row < end_row; row++) - total += eti_row_height (eti, row) + height_extra; + total += ETI_ROW_HEIGHT (eti, row) + height_extra; return total; } @@ -1788,11 +1788,11 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint wid * Compute row span. */ if (eti->uniform_row_height) { - first_row = (y - floor (eti_base.y) - height_extra) / (eti_row_height (eti, -1) + height_extra); - last_row = (y + height - floor (eti_base.y) ) / (eti_row_height (eti, -1) + height_extra) + 1; + first_row = (y - floor (eti_base.y) - height_extra) / (ETI_ROW_HEIGHT (eti, -1) + height_extra); + last_row = (y + height - floor (eti_base.y) ) / (ETI_ROW_HEIGHT (eti, -1) + height_extra) + 1; if (first_row > last_row) goto exit; - y_offset = floor (eti_base.y) - y + height_extra + first_row * (eti_row_height (eti, -1) + height_extra); + y_offset = floor (eti_base.y) - y + height_extra + first_row * (ETI_ROW_HEIGHT (eti, -1) + height_extra); if (first_row < 0) first_row = 0; if (last_row > eti->rows) @@ -2077,8 +2077,8 @@ find_cell (ETableItem *eti, gdouble x, gdouble y, gint *view_col_res, gint *view if (eti->uniform_row_height) { if (y < height_extra) return FALSE; - row = (y - height_extra) / (eti_row_height (eti, -1) + height_extra); - y1 = row * (eti_row_height (eti, -1) + height_extra) + height_extra; + row = (y - height_extra) / (ETI_ROW_HEIGHT (eti, -1) + height_extra); + y1 = row * (ETI_ROW_HEIGHT (eti, -1) + height_extra) + height_extra; if (row >= eti->rows) return FALSE; } else { -- cgit v1.2.3 From e496f94b0433b22e1ecdf35328bcaf16b4abb6a4 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Tue, 4 May 2010 13:14:01 -0500 Subject: Add function to count the displayed accounts in an EAccountComboBox We will need this to see how many accounts are shown in the From header in the mail composer. Signed-off-by: Federico Mena Quintero --- widgets/misc/e-account-combo-box.c | 22 ++++++++++++++++++++++ widgets/misc/e-account-combo-box.h | 2 ++ 2 files changed, 24 insertions(+) (limited to 'widgets') diff --git a/widgets/misc/e-account-combo-box.c b/widgets/misc/e-account-combo-box.c index 0ded393e72..786478a5e3 100644 --- a/widgets/misc/e-account-combo-box.c +++ b/widgets/misc/e-account-combo-box.c @@ -41,6 +41,7 @@ enum { struct _EAccountComboBoxPrivate { EAccountList *account_list; GHashTable *index; + int num_displayed_accounts; }; static gpointer parent_class; @@ -150,6 +151,8 @@ account_combo_box_refresh_cb (EAccountList *account_list, GList *list = NULL; GList *iter; + combo_box->priv->num_displayed_accounts = 0; + store = gtk_list_store_new (2, G_TYPE_STRING, E_TYPE_ACCOUNT); model = GTK_TREE_MODEL (store); index = combo_box->priv->index; @@ -182,6 +185,7 @@ account_combo_box_refresh_cb (EAccountList *account_list, gchar *string; account = iter->data; + combo_box->priv->num_displayed_accounts++; /* Show the account name for duplicate email addresses. */ if (account_combo_box_has_dupes (list, account->id->address)) @@ -514,3 +518,21 @@ e_account_combo_box_set_active_name (EAccountComboBox *combo_box, return e_account_combo_box_set_active (combo_box, account); } + +/** + * e_account_combo_box_count_displayed_accounts: + * @combo_box: an #EAccountComboBox + * + * Counts the number of accounts that are displayed in the @combo_box. This may not + * be the actual number of accounts that are configured, as some of those accounts + * may be disabled by the user. + * + * Return value: number of active and valid accounts as shown in the @combo_box. + */ +int +e_account_combo_box_count_displayed_accounts (EAccountComboBox *combo_box) +{ + g_return_val_if_fail (E_IS_ACCOUNT_COMBO_BOX (combo_box), -1); + + return combo_box->priv->num_displayed_accounts; +} diff --git a/widgets/misc/e-account-combo-box.h b/widgets/misc/e-account-combo-box.h index 12d4be6c72..60078690e9 100644 --- a/widgets/misc/e-account-combo-box.h +++ b/widgets/misc/e-account-combo-box.h @@ -78,6 +78,8 @@ gboolean e_account_combo_box_set_active_name (EAccountComboBox *combo_box, const gchar *account_name); +int e_account_combo_box_count_displayed_accounts (EAccountComboBox *combo_box); + G_END_DECLS #endif /* E_ACCOUNT_COMBO_BOX_H */ -- cgit v1.2.3 From c90cc00e44fc4774307615d87a963b4d91314543 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 11 May 2010 13:13:10 -0500 Subject: Bug 616640 - Don't display attachment size if it's unknown --- widgets/misc/e-attachment-tree-view.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'widgets') diff --git a/widgets/misc/e-attachment-tree-view.c b/widgets/misc/e-attachment-tree-view.c index 42876e4bfb..5729a68069 100644 --- a/widgets/misc/e-attachment-tree-view.c +++ b/widgets/misc/e-attachment-tree-view.c @@ -100,15 +100,18 @@ attachment_tree_view_render_size (GtkTreeViewColumn *column, GtkTreeModel *model, GtkTreeIter *iter) { - gchar *display_size; + gchar *display_size = NULL; gint column_id; guint64 size; column_id = E_ATTACHMENT_STORE_COLUMN_SIZE; gtk_tree_model_get (model, iter, column_id, &size, -1); - display_size = g_format_size_for_display ((goffset) size); + if (size > 0) + display_size = g_format_size_for_display ((goffset) size); + g_object_set (renderer, "text", display_size, NULL); + g_free (display_size); } -- cgit v1.2.3 From 0a39131fdfb5ef87525d668751651a2c9d075ebf Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 11 May 2010 22:59:57 -0500 Subject: Bug 615291 - Preview pane's attachment bar accepts drop --- widgets/misc/e-attachment-view.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'widgets') diff --git a/widgets/misc/e-attachment-view.c b/widgets/misc/e-attachment-view.c index 9725604865..5a5db57e07 100644 --- a/widgets/misc/e-attachment-view.c +++ b/widgets/misc/e-attachment-view.c @@ -826,7 +826,6 @@ e_attachment_view_init (EAttachmentView *view) attachment_view_init_handlers (view); e_attachment_view_drag_source_set (view); - e_attachment_view_drag_dest_set (view); /* Connect built-in drag and drop handlers. */ @@ -927,6 +926,11 @@ e_attachment_view_set_editable (EAttachmentView *view, priv = e_attachment_view_get_private (view); priv->editable = editable; + if (editable) + e_attachment_view_drag_dest_set (view); + else + e_attachment_view_drag_dest_unset (view); + g_object_notify (G_OBJECT (view), "editable"); } @@ -1315,6 +1319,11 @@ e_attachment_view_drag_begin (EAttachmentView *view, { g_return_if_fail (E_IS_ATTACHMENT_VIEW (view)); g_return_if_fail (GDK_IS_DRAG_CONTEXT (context)); + + /* Prevent the user from dragging and dropping to + * the same attachment view, which would duplicate + * the attachment. */ + e_attachment_view_drag_dest_unset (view); } void @@ -1323,6 +1332,10 @@ e_attachment_view_drag_end (EAttachmentView *view, { g_return_if_fail (E_IS_ATTACHMENT_VIEW (view)); g_return_if_fail (GDK_IS_DRAG_CONTEXT (context)); + + /* Restore the previous drag destination state. */ + if (e_attachment_view_get_editable (view)) + e_attachment_view_drag_dest_set (view); } static void @@ -1465,10 +1478,6 @@ e_attachment_view_drag_drop (EAttachmentView *view, g_return_val_if_fail (E_IS_ATTACHMENT_VIEW (view), FALSE); g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), FALSE); - /* Disallow drops if we're not editable. */ - if (!e_attachment_view_get_editable (view)) - return FALSE; - return TRUE; } -- cgit v1.2.3 From be538a4cff38c7b58468e7b2c7fa05f9dc8cb476 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 19 May 2010 22:01:49 -0400 Subject: Improve attachment bar selection behavior. Some improvements made while investigating bug #608855. This does not solve the bug however, and in fact I now believe the bug is actually a GTK+ issue after reproducing the bug in gtk-demo. These improvements restore multiple selections via Ctrl+Click and Shift+Click, and also reduces the frequency that we synchronize the selection between Icon View and Tree View. --- widgets/misc/e-attachment-paned.c | 62 +++++++++++++-------------------------- widgets/misc/e-attachment-view.c | 38 ++++++++++++------------ 2 files changed, 38 insertions(+), 62 deletions(-) (limited to 'widgets') diff --git a/widgets/misc/e-attachment-paned.c b/widgets/misc/e-attachment-paned.c index 8b4c2bfb96..d47fe9c8c7 100644 --- a/widgets/misc/e-attachment-paned.c +++ b/widgets/misc/e-attachment-paned.c @@ -91,36 +91,6 @@ attachment_paned_notify_cb (EAttachmentPaned *paned, gtk_label_set_text_with_mnemonic (label, text); } -static void -attachment_paned_sync_icon_view (EAttachmentPaned *paned) -{ - EAttachmentView *source; - EAttachmentView *target; - - source = E_ATTACHMENT_VIEW (paned->priv->tree_view); - target = E_ATTACHMENT_VIEW (paned->priv->icon_view); - - /* Only sync if the tree view is active. This prevents the - * two views from endlessly trying to sync with each other. */ - if (e_attachment_paned_get_active_view (paned) == 1) - e_attachment_view_sync_selection (source, target); -} - -static void -attachment_paned_sync_tree_view (EAttachmentPaned *paned) -{ - EAttachmentView *source; - EAttachmentView *target; - - source = E_ATTACHMENT_VIEW (paned->priv->icon_view); - target = E_ATTACHMENT_VIEW (paned->priv->tree_view); - - /* Only sync if the icon view is active. This prevents the - * two views from endlessly trying to sync with each other. */ - if (e_attachment_paned_get_active_view (paned) == 0) - e_attachment_view_sync_selection (source, target); -} - static void attachment_paned_update_status (EAttachmentPaned *paned) { @@ -509,7 +479,6 @@ static void attachment_paned_init (EAttachmentPaned *paned) { EAttachmentView *view; - GtkTreeSelection *selection; GtkSizeGroup *size_group; GtkWidget *container; GtkWidget *widget; @@ -662,17 +631,6 @@ attachment_paned_init (EAttachmentPaned *paned) paned->priv->status_label = g_object_ref (widget); gtk_widget_hide (widget); - selection = gtk_tree_view_get_selection ( - GTK_TREE_VIEW (paned->priv->tree_view)); - - g_signal_connect_swapped ( - selection, "changed", - G_CALLBACK (attachment_paned_sync_icon_view), paned); - - g_signal_connect_swapped ( - paned->priv->icon_view, "selection-changed", - G_CALLBACK (attachment_paned_sync_tree_view), paned); - g_signal_connect_swapped ( paned->priv->expander, "notify::expanded", G_CALLBACK (attachment_paned_notify_cb), paned); @@ -750,11 +708,31 @@ void e_attachment_paned_set_active_view (EAttachmentPaned *paned, gint active_view) { + EAttachmentView *source; + EAttachmentView *target; + g_return_if_fail (E_IS_ATTACHMENT_PANED (paned)); g_return_if_fail (active_view >= 0 && active_view < NUM_VIEWS); + if (active_view == paned->priv->active_view) + return; + paned->priv->active_view = active_view; + /* Synchronize the item selection of the view we're + * switching TO with the view we're switching FROM. */ + if (active_view == 0) { + /* from tree view to icon view */ + source = E_ATTACHMENT_VIEW (paned->priv->tree_view); + target = E_ATTACHMENT_VIEW (paned->priv->icon_view); + } else { + /* from icon view to tree view */ + source = E_ATTACHMENT_VIEW (paned->priv->icon_view); + target = E_ATTACHMENT_VIEW (paned->priv->tree_view); + } + + e_attachment_view_sync_selection (source, target); + g_object_notify (G_OBJECT (paned), "active-view"); } diff --git a/widgets/misc/e-attachment-view.c b/widgets/misc/e-attachment-view.c index 5a5db57e07..ab98417830 100644 --- a/widgets/misc/e-attachment-view.c +++ b/widgets/misc/e-attachment-view.c @@ -1076,29 +1076,13 @@ e_attachment_view_button_press_event (EAttachmentView *view, { GtkTreePath *path; gboolean editable; - gboolean item_clicked; + gboolean handled = FALSE; g_return_val_if_fail (E_IS_ATTACHMENT_VIEW (view), FALSE); g_return_val_if_fail (event != NULL, FALSE); editable = e_attachment_view_get_editable (view); - - /* If the user clicked on a selected item, retain the current - * selection. If the user clicked on an unselected item, select - * the clicked item only. If the user did not click on an item, - * clear the current selection. */ path = e_attachment_view_get_path_at_pos (view, event->x, event->y); - if (path != NULL) { - if (!e_attachment_view_path_is_selected (view, path)) { - e_attachment_view_unselect_all (view); - e_attachment_view_select_path (view, path); - } - gtk_tree_path_free (path); - item_clicked = TRUE; - } else { - e_attachment_view_unselect_all (view); - item_clicked = FALSE; - } /* Cancel drag and drop if there are no selected items, * or if any of the selected items are loading or saving. */ @@ -1119,17 +1103,31 @@ e_attachment_view_button_press_event (EAttachmentView *view, } if (event->button == 3 && event->type == GDK_BUTTON_PRESS) { + /* If the user clicked on a selected item, retain the + * current selection. If the user clicked on an unselected + * item, select the clicked item only. If the user did not + * click on an item, clear the current selection. */ + if (path == NULL) + e_attachment_view_unselect_all (view); + else if (!e_attachment_view_path_is_selected (view, path)) { + e_attachment_view_unselect_all (view); + e_attachment_view_select_path (view, path); + } + /* Non-editable attachment views should only show a * popup menu when right-clicking on an attachment, * but editable views can show the menu any time. */ - if (item_clicked || editable) { + if (path != NULL || editable) { e_attachment_view_show_popup_menu ( view, event, NULL, NULL); - return TRUE; + handled = TRUE; } } - return FALSE; + if (path != NULL) + gtk_tree_path_free (path); + + return handled; } gboolean -- cgit v1.2.3 From 44c5781fc3a8e684b3e1973114577113a571cdd2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 20 May 2010 17:02:47 -0400 Subject: Bug 608855 - Can't drag and drop multiple attachments Based on EggTreeMultiDragSource in libegg. --- widgets/misc/e-attachment-icon-view.c | 15 ++++ widgets/misc/e-attachment-tree-view.c | 15 ++++ widgets/misc/e-attachment-view.c | 160 +++++++++++++++++++++++++++++----- widgets/misc/e-attachment-view.h | 9 ++ 4 files changed, 175 insertions(+), 24 deletions(-) (limited to 'widgets') diff --git a/widgets/misc/e-attachment-icon-view.c b/widgets/misc/e-attachment-icon-view.c index edfecb57d8..57301213dd 100644 --- a/widgets/misc/e-attachment-icon-view.c +++ b/widgets/misc/e-attachment-icon-view.c @@ -129,6 +129,20 @@ attachment_icon_view_button_release_event (GtkWidget *widget, button_release_event (widget, event); } +static gboolean +attachment_icon_view_motion_notify_event (GtkWidget *widget, + GdkEventMotion *event) +{ + EAttachmentView *view = E_ATTACHMENT_VIEW (widget); + + if (e_attachment_view_motion_notify_event (view, event)) + return TRUE; + + /* Chain up to parent's motion_notify_event() method. */ + return GTK_WIDGET_CLASS (parent_class)-> + motion_notify_event (widget, event); +} + static gboolean attachment_icon_view_key_press_event (GtkWidget *widget, GdkEventKey *event) @@ -408,6 +422,7 @@ attachment_icon_view_class_init (EAttachmentIconViewClass *class) widget_class = GTK_WIDGET_CLASS (class); widget_class->button_press_event = attachment_icon_view_button_press_event; widget_class->button_release_event = attachment_icon_view_button_release_event; + widget_class->motion_notify_event = attachment_icon_view_motion_notify_event; widget_class->key_press_event = attachment_icon_view_key_press_event; widget_class->drag_begin = attachment_icon_view_drag_begin; widget_class->drag_end = attachment_icon_view_drag_end; diff --git a/widgets/misc/e-attachment-tree-view.c b/widgets/misc/e-attachment-tree-view.c index 5729a68069..09602ca186 100644 --- a/widgets/misc/e-attachment-tree-view.c +++ b/widgets/misc/e-attachment-tree-view.c @@ -143,6 +143,20 @@ attachment_tree_view_button_release_event (GtkWidget *widget, button_release_event (widget, event); } +static gboolean +attachment_tree_view_motion_notify_event (GtkWidget *widget, + GdkEventMotion *event) +{ + EAttachmentView *view = E_ATTACHMENT_VIEW (widget); + + if (e_attachment_view_motion_notify_event (view, event)) + return TRUE; + + /* Chain up to parent's motion_notify_event() method. */ + return GTK_WIDGET_CLASS (parent_class)-> + motion_notify_event (widget, event); +} + static gboolean attachment_tree_view_key_press_event (GtkWidget *widget, GdkEventKey *event) @@ -440,6 +454,7 @@ attachment_tree_view_class_init (EAttachmentTreeViewClass *class) widget_class = GTK_WIDGET_CLASS (class); widget_class->button_press_event = attachment_tree_view_button_press_event; widget_class->button_release_event = attachment_tree_view_button_release_event; + widget_class->motion_notify_event = attachment_tree_view_motion_notify_event; widget_class->key_press_event = attachment_tree_view_key_press_event; widget_class->drag_begin = attachment_tree_view_drag_begin; widget_class->drag_end = attachment_tree_view_drag_end; diff --git a/widgets/misc/e-attachment-view.c b/widgets/misc/e-attachment-view.c index ab98417830..2ff6fb4dab 100644 --- a/widgets/misc/e-attachment-view.c +++ b/widgets/misc/e-attachment-view.c @@ -875,6 +875,12 @@ e_attachment_view_finalize (EAttachmentView *view) priv = e_attachment_view_get_private (view); g_ptr_array_free (priv->handlers, TRUE); + + g_list_foreach (priv->event_list, (GFunc) gdk_event_free, NULL); + g_list_free (priv->event_list); + + g_list_foreach (priv->selected, (GFunc) g_object_unref, NULL); + g_list_free (priv->selected); } EAttachmentViewPrivate * @@ -1074,30 +1080,55 @@ gboolean e_attachment_view_button_press_event (EAttachmentView *view, GdkEventButton *event) { + EAttachmentViewPrivate *priv; GtkTreePath *path; gboolean editable; gboolean handled = FALSE; + gboolean path_is_selected = FALSE; g_return_val_if_fail (E_IS_ATTACHMENT_VIEW (view), FALSE); g_return_val_if_fail (event != NULL, FALSE); + priv = e_attachment_view_get_private (view); + + if (g_list_find (priv->event_list, event) != NULL) + return FALSE; + + if (priv->event_list != NULL) { + /* Save the event to be propagated in order. */ + priv->event_list = g_list_append ( + priv->event_list, + gdk_event_copy ((GdkEvent *) event)); + return TRUE; + } + editable = e_attachment_view_get_editable (view); path = e_attachment_view_get_path_at_pos (view, event->x, event->y); + path_is_selected = e_attachment_view_path_is_selected (view, path); - /* Cancel drag and drop if there are no selected items, - * or if any of the selected items are loading or saving. */ if (event->button == 1 && event->type == GDK_BUTTON_PRESS) { GList *selected, *iter; gboolean busy = FALSE; selected = e_attachment_view_get_selected_attachments (view); + for (iter = selected; iter != NULL; iter = iter->next) { EAttachment *attachment = iter->data; busy |= e_attachment_get_loading (attachment); busy |= e_attachment_get_saving (attachment); } - if (selected == NULL || busy) - e_attachment_view_drag_source_unset (view); + + /* Prepare for dragging if the clicked item is selected + * and none of the selected items are loading or saving. */ + if (path_is_selected && !busy) { + priv->start_x = event->x; + priv->start_y = event->y; + priv->event_list = g_list_append ( + priv->event_list, + gdk_event_copy ((GdkEvent *) event)); + handled = TRUE; + } + g_list_foreach (selected, (GFunc) g_object_unref, NULL); g_list_free (selected); } @@ -1109,7 +1140,7 @@ e_attachment_view_button_press_event (EAttachmentView *view, * click on an item, clear the current selection. */ if (path == NULL) e_attachment_view_unselect_all (view); - else if (!e_attachment_view_path_is_selected (view, path)) { + else if (!path_is_selected) { e_attachment_view_unselect_all (view); e_attachment_view_select_path (view, path); } @@ -1134,17 +1165,63 @@ gboolean e_attachment_view_button_release_event (EAttachmentView *view, GdkEventButton *event) { + EAttachmentViewPrivate *priv; + GtkWidget *widget = GTK_WIDGET (view); + GList *iter; + g_return_val_if_fail (E_IS_ATTACHMENT_VIEW (view), FALSE); g_return_val_if_fail (event != NULL, FALSE); - /* Restore the attachment view as a drag source, in case - * we had to cancel during a button press event. */ - if (event->button == 1) - e_attachment_view_drag_source_set (view); + priv = e_attachment_view_get_private (view); + + for (iter = priv->event_list; iter != NULL; iter = iter->next) { + GdkEvent *event = iter->data; + + gtk_propagate_event (widget, event); + gdk_event_free (event); + } + + g_list_free (priv->event_list); + priv->event_list = NULL; return FALSE; } +gboolean +e_attachment_view_motion_notify_event (EAttachmentView *view, + GdkEventMotion *event) +{ + EAttachmentViewPrivate *priv; + GtkWidget *widget = GTK_WIDGET (view); + GdkDragContext *context; + GtkTargetList *targets; + + g_return_val_if_fail (E_IS_ATTACHMENT_VIEW (view), FALSE); + g_return_val_if_fail (event != NULL, FALSE); + + priv = e_attachment_view_get_private (view); + + if (priv->event_list == NULL) + return FALSE; + + if (!gtk_drag_check_threshold ( + widget, priv->start_x, priv->start_y, event->x, event->y)) + return TRUE; + + g_list_foreach (priv->event_list, (GFunc) gdk_event_free, NULL); + g_list_free (priv->event_list); + priv->event_list = NULL; + + targets = gtk_drag_source_get_target_list (widget); + + context = gtk_drag_begin ( + widget, targets, GDK_ACTION_COPY, 1, (GdkEvent *) event); + + gtk_drag_set_icon_default (context); + + return TRUE; +} + gboolean e_attachment_view_key_press_event (EAttachmentView *view, GdkEventKey *event) @@ -1199,7 +1276,10 @@ e_attachment_view_path_is_selected (EAttachmentView *view, EAttachmentViewIface *iface; g_return_val_if_fail (E_IS_ATTACHMENT_VIEW (view), FALSE); - g_return_val_if_fail (path != NULL, FALSE); + + /* Handle NULL paths gracefully. */ + if (path == NULL) + return FALSE; iface = E_ATTACHMENT_VIEW_GET_IFACE (view); g_return_val_if_fail (iface->path_is_selected != NULL, FALSE); @@ -1285,18 +1365,23 @@ e_attachment_view_sync_selection (EAttachmentView *view, void e_attachment_view_drag_source_set (EAttachmentView *view) { + EAttachmentViewIface *iface; GtkTargetEntry *targets; GtkTargetList *list; gint n_targets; g_return_if_fail (E_IS_ATTACHMENT_VIEW (view)); + iface = E_ATTACHMENT_VIEW_GET_IFACE (view); + if (iface->drag_source_set == NULL) + return; + list = gtk_target_list_new (NULL, 0); gtk_target_list_add_uri_targets (list, 0); targets = gtk_target_table_new_from_list (list, &n_targets); - gtk_drag_source_set ( - GTK_WIDGET (view), GDK_BUTTON1_MASK, + iface->drag_source_set ( + view, GDK_BUTTON1_MASK, targets, n_targets, GDK_ACTION_COPY); gtk_target_table_free (targets, n_targets); @@ -1306,34 +1391,55 @@ e_attachment_view_drag_source_set (EAttachmentView *view) void e_attachment_view_drag_source_unset (EAttachmentView *view) { + EAttachmentViewIface *iface; + g_return_if_fail (E_IS_ATTACHMENT_VIEW (view)); - gtk_drag_source_unset (GTK_WIDGET (view)); + iface = E_ATTACHMENT_VIEW_GET_IFACE (view); + if (iface->drag_source_unset == NULL) + return; + + iface->drag_source_unset (view); } void e_attachment_view_drag_begin (EAttachmentView *view, GdkDragContext *context) { + EAttachmentViewPrivate *priv; + g_return_if_fail (E_IS_ATTACHMENT_VIEW (view)); g_return_if_fail (GDK_IS_DRAG_CONTEXT (context)); + priv = e_attachment_view_get_private (view); + /* Prevent the user from dragging and dropping to * the same attachment view, which would duplicate * the attachment. */ e_attachment_view_drag_dest_unset (view); + + g_warn_if_fail (priv->selected == NULL); + priv->selected = e_attachment_view_get_selected_attachments (view); } void e_attachment_view_drag_end (EAttachmentView *view, GdkDragContext *context) { + EAttachmentViewPrivate *priv; + g_return_if_fail (E_IS_ATTACHMENT_VIEW (view)); g_return_if_fail (GDK_IS_DRAG_CONTEXT (context)); + priv = e_attachment_view_get_private (view); + /* Restore the previous drag destination state. */ if (e_attachment_view_get_editable (view)) e_attachment_view_drag_dest_set (view); + + g_list_foreach (priv->selected, (GFunc) g_object_unref, NULL); + g_list_free (priv->selected); + priv->selected = NULL; } static void @@ -1361,8 +1467,8 @@ e_attachment_view_drag_data_get (EAttachmentView *view, guint info, guint time) { + EAttachmentViewPrivate *priv; EAttachmentStore *store; - GList *selected; struct { gchar **uris; @@ -1376,19 +1482,16 @@ e_attachment_view_drag_data_get (EAttachmentView *view, status.uris = NULL; status.done = FALSE; + priv = e_attachment_view_get_private (view); store = e_attachment_view_get_store (view); - selected = e_attachment_view_get_selected_attachments (view); - if (selected == NULL) + if (priv->selected == NULL) return; e_attachment_store_get_uris_async ( - store, selected, (GAsyncReadyCallback) + store, priv->selected, (GAsyncReadyCallback) attachment_view_got_uris_cb, &status); - g_list_foreach (selected, (GFunc) g_object_unref, NULL); - g_list_free (selected); - /* We can't return until we have results, so crank * the main loop until the callback gets triggered. */ while (!status.done) @@ -1405,19 +1508,22 @@ void e_attachment_view_drag_dest_set (EAttachmentView *view) { EAttachmentViewPrivate *priv; + EAttachmentViewIface *iface; GtkTargetEntry *targets; gint n_targets; g_return_if_fail (E_IS_ATTACHMENT_VIEW (view)); + iface = E_ATTACHMENT_VIEW_GET_IFACE (view); + if (iface->drag_dest_set == NULL) + return; + priv = e_attachment_view_get_private (view); targets = gtk_target_table_new_from_list ( priv->target_list, &n_targets); - gtk_drag_dest_set ( - GTK_WIDGET (view), GTK_DEST_DEFAULT_ALL, - targets, n_targets, priv->drag_actions); + iface->drag_dest_set (view, targets, n_targets, priv->drag_actions); gtk_target_table_free (targets, n_targets); } @@ -1425,9 +1531,15 @@ e_attachment_view_drag_dest_set (EAttachmentView *view) void e_attachment_view_drag_dest_unset (EAttachmentView *view) { + EAttachmentViewIface *iface; + g_return_if_fail (E_IS_ATTACHMENT_VIEW (view)); - gtk_drag_dest_unset (GTK_WIDGET (view)); + iface = E_ATTACHMENT_VIEW_GET_IFACE (view); + if (iface->drag_dest_unset == NULL) + return; + + iface->drag_dest_unset (view); } gboolean diff --git a/widgets/misc/e-attachment-view.h b/widgets/misc/e-attachment-view.h index 89d2d28664..071de0705a 100644 --- a/widgets/misc/e-attachment-view.h +++ b/widgets/misc/e-attachment-view.h @@ -103,6 +103,12 @@ struct _EAttachmentViewPrivate { GtkUIManager *ui_manager; guint merge_id; + /* Multi-DnD State */ + GList *event_list; + GList *selected; + gint start_x; + gint start_y; + guint editable : 1; }; @@ -139,6 +145,9 @@ gboolean e_attachment_view_button_press_event gboolean e_attachment_view_button_release_event (EAttachmentView *view, GdkEventButton *event); +gboolean e_attachment_view_motion_notify_event + (EAttachmentView *view, + GdkEventMotion *event); gboolean e_attachment_view_key_press_event (EAttachmentView *view, GdkEventKey *event); -- cgit v1.2.3 From 3e1b34841d3a699f77848f5de019f18ccb2d1ca1 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 25 May 2010 09:41:48 -0400 Subject: Fix compiler warnings. --- widgets/misc/e-preferences-window.c | 4 ++-- widgets/misc/e-preferences-window.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'widgets') diff --git a/widgets/misc/e-preferences-window.c b/widgets/misc/e-preferences-window.c index 8fa4fcf85f..d6ee321f5d 100644 --- a/widgets/misc/e-preferences-window.c +++ b/widgets/misc/e-preferences-window.c @@ -108,7 +108,7 @@ preferences_window_selection_changed_cb (EPreferencesWindow *window) if (list == NULL) return; - model = window->priv->store; + model = GTK_TREE_MODEL (window->priv->store); gtk_tree_model_get_iter (model, &iter, list->data); gtk_tree_model_get (model, &iter, COLUMN_PAGE, &page, -1); @@ -405,7 +405,7 @@ e_preferences_window_add_page (EPreferencesWindow *window, notebook = GTK_NOTEBOOK (window->priv->notebook); page = gtk_notebook_get_n_pages (notebook); - model = window->priv->store; + model = GTK_TREE_MODEL (window->priv->store); pixbuf = preferences_window_load_pixbuf (icon_name); gtk_list_store_append (GTK_LIST_STORE (model), &iter); diff --git a/widgets/misc/e-preferences-window.h b/widgets/misc/e-preferences-window.h index 97f0da85e2..00b51b85e1 100644 --- a/widgets/misc/e-preferences-window.h +++ b/widgets/misc/e-preferences-window.h @@ -68,8 +68,8 @@ void e_preferences_window_add_page (EPreferencesWindow *window, gint sort_order); void e_preferences_window_show_page (EPreferencesWindow *window, const gchar *page_name); -void e_preferences_window_filter_page (EPreferencesWindow *window, - const gchar *page_name); +void e_preferences_window_filter_page(EPreferencesWindow *window, + const gchar *page_name); G_END_DECLS -- cgit v1.2.3 From 96538878911586a9e9ca26b81e1916c04e538980 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 25 May 2010 10:15:32 -0400 Subject: Coding style and whitespace cleanup. --- widgets/misc/e-account-combo-box.c | 4 ++-- widgets/misc/e-account-combo-box.h | 2 +- widgets/misc/e-calendar.h | 2 +- widgets/misc/e-preferences-window.c | 23 +++++++++++++---------- 4 files changed, 17 insertions(+), 14 deletions(-) (limited to 'widgets') diff --git a/widgets/misc/e-account-combo-box.c b/widgets/misc/e-account-combo-box.c index 786478a5e3..288ac408fb 100644 --- a/widgets/misc/e-account-combo-box.c +++ b/widgets/misc/e-account-combo-box.c @@ -41,7 +41,7 @@ enum { struct _EAccountComboBoxPrivate { EAccountList *account_list; GHashTable *index; - int num_displayed_accounts; + gint num_displayed_accounts; }; static gpointer parent_class; @@ -529,7 +529,7 @@ e_account_combo_box_set_active_name (EAccountComboBox *combo_box, * * Return value: number of active and valid accounts as shown in the @combo_box. */ -int +gint e_account_combo_box_count_displayed_accounts (EAccountComboBox *combo_box) { g_return_val_if_fail (E_IS_ACCOUNT_COMBO_BOX (combo_box), -1); diff --git a/widgets/misc/e-account-combo-box.h b/widgets/misc/e-account-combo-box.h index 60078690e9..c3fe4aa0f8 100644 --- a/widgets/misc/e-account-combo-box.h +++ b/widgets/misc/e-account-combo-box.h @@ -78,7 +78,7 @@ gboolean e_account_combo_box_set_active_name (EAccountComboBox *combo_box, const gchar *account_name); -int e_account_combo_box_count_displayed_accounts (EAccountComboBox *combo_box); +gint e_account_combo_box_count_displayed_accounts (EAccountComboBox *combo_box); G_END_DECLS diff --git a/widgets/misc/e-calendar.h b/widgets/misc/e-calendar.h index 83eb8df4ea..a3d979c07e 100644 --- a/widgets/misc/e-calendar.h +++ b/widgets/misc/e-calendar.h @@ -91,7 +91,7 @@ void e_calendar_set_minimum_size (ECalendar *cal, gint rows, gint cols); void e_calendar_set_maximum_size (ECalendar *cal, - gint rows, + gint rows, gint cols); void e_calendar_get_border_size (ECalendar *cal, gint *top, diff --git a/widgets/misc/e-preferences-window.c b/widgets/misc/e-preferences-window.c index d6ee321f5d..9390f047ca 100644 --- a/widgets/misc/e-preferences-window.c +++ b/widgets/misc/e-preferences-window.c @@ -39,7 +39,7 @@ struct _EPreferencesWindowPrivate { GtkListStore *store; GtkTreeModelFilter *filter; - const char *filter_view; + const gchar *filter_view; }; enum { @@ -213,19 +213,19 @@ filter_view (GtkTreeModel *model, /* Show everything except calendar */ if (str && (strncmp (str, "cal", 3) == 0)) visible = FALSE; - else + else visible = TRUE; } else if (strncmp(window->priv->filter_view, "cal", 3) == 0) { /* Show only calendar and nothing else */ if (str && (strncmp (str, "cal", 3) != 0)) visible = FALSE; - else + else visible = TRUE; } else /* In any other case, show everything */ visible = TRUE; - - g_free (str); + + g_free (str); return visible; } @@ -252,13 +252,16 @@ preferences_window_init (EPreferencesWindow *window) window->priv->filter_view = NULL; store = gtk_list_store_new ( - 5, G_TYPE_STRING, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_INT, G_TYPE_INT); + 5, G_TYPE_STRING, G_TYPE_STRING, + GDK_TYPE_PIXBUF, G_TYPE_INT, G_TYPE_INT); gtk_tree_sortable_set_sort_column_id ( GTK_TREE_SORTABLE (store), COLUMN_SORT, GTK_SORT_ASCENDING); window->priv->store = store; - window->priv->filter = (GtkTreeModelFilter *)gtk_tree_model_filter_new ((GtkTreeModel *)store, NULL); - gtk_tree_model_filter_set_visible_func (window->priv->filter, filter_view, window, NULL); + window->priv->filter = (GtkTreeModelFilter *) + gtk_tree_model_filter_new (GTK_TREE_MODEL (store), NULL); + gtk_tree_model_filter_set_visible_func ( + window->priv->filter, filter_view, window, NULL); title = _("Evolution Preferences"); gtk_window_set_title (GTK_WINDOW (window), title); @@ -290,7 +293,7 @@ preferences_window_init (EPreferencesWindow *window) gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, TRUE, 0); window->priv->scroll = widget; gtk_widget_show (widget); - + container = widget; widget = gtk_icon_view_new_with_model (GTK_TREE_MODEL (window->priv->filter)); @@ -476,7 +479,7 @@ e_preferences_window_filter_page (EPreferencesWindow *window, window->priv->filter_view = page_name; gtk_tree_model_filter_refilter (window->priv->filter); - /* XXX: We need a better solution to hide the icon view when + /* XXX: We need a better solution to hide the icon view when * there is just one entry */ if (strncmp(page_name, "cal", 3) == 0) { gtk_widget_hide (window->priv->scroll); -- cgit v1.2.3