commit 6ed0269820e0d91fe1bb616e54a9185df2e4a443
parent 88a94bbfd8e9a5d9a4e931a0256478ae70c810ad
Author: Colin Leroy <colin@colino.net>
Date: Sun, 10 Apr 2011 15:43:42 +0000
2011-04-10 [colin] 3.7.9cvs8
* src/compose.c
* src/prefs_filtering_action.c
* src/gtk/combobox.c
* src/gtk/gtkshruler.c
* src/gtk/gtkshruler.h
More undeprecation. GTKSHRuler is #if'ed out. We can
still decide to maintain the old GtkRuler widget in-tree
if the lack of ruler in Compose window is too
annoying.
Diffstat:
8 files changed, 52 insertions(+), 16 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,15 @@
+2011-04-10 [colin] 3.7.9cvs8
+
+ * src/compose.c
+ * src/prefs_filtering_action.c
+ * src/gtk/combobox.c
+ * src/gtk/gtkshruler.c
+ * src/gtk/gtkshruler.h
+ More undeprecation. GTKSHRuler is #if'ed out. We can
+ still decide to maintain the old GtkRuler widget in-tree
+ if the lack of ruler in Compose window is too
+ annoying.
+
2011-04-10 [colin] 3.7.9cvs7
* src/addr_compl.c
diff --git a/PATCHSETS b/PATCHSETS
@@ -4159,3 +4159,4 @@
( cvs diff -u -r 1.94.2.214 -r 1.94.2.215 src/messageview.c; ) > 3.7.9cvs5.patchset
( cvs diff -u -r 1.94.2.215 -r 1.94.2.216 src/messageview.c; ) > 3.7.9cvs6.patchset
( cvs diff -u -r 1.27.2.51 -r 1.27.2.52 src/addr_compl.c; cvs diff -u -r 1.60.2.141 -r 1.60.2.142 src/addressbook.c; cvs diff -u -r 1.382.2.572 -r 1.382.2.573 src/compose.c; cvs diff -u -r 1.1.2.12 -r 1.1.2.13 src/editaddress_other_attributes_ldap.c; cvs diff -u -r 1.3.12.36 -r 1.3.12.37 src/message_search.c; cvs diff -u -r 1.16.2.40 -r 1.16.2.41 src/prefs_display_header.c; cvs diff -u -r 1.1.4.66 -r 1.1.4.67 src/prefs_filtering_action.c; cvs diff -u -r 1.1.2.39 -r 1.1.2.40 src/prefs_other.c; cvs diff -u -r 1.30.2.64 -r 1.30.2.65 src/prefs_toolbar.c; cvs diff -u -r 1.15.2.62 -r 1.15.2.63 src/summary_search.c; cvs diff -u -r 1.2.2.31 -r 1.2.2.32 src/gtk/colorlabel.c; cvs diff -u -r 1.1.2.19 -r 1.1.2.20 src/gtk/combobox.c; cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/gtk/gtkcmoptionmenu.c; cvs diff -u -r 1.4.2.53 -r 1.4.2.54 src/gtk/gtkutils.h; ) > 3.7.9cvs7.patchset
+( cvs diff -u -r 1.382.2.573 -r 1.382.2.574 src/compose.c; cvs diff -u -r 1.1.4.67 -r 1.1.4.68 src/prefs_filtering_action.c; cvs diff -u -r 1.1.2.20 -r 1.1.2.21 src/gtk/combobox.c; cvs diff -u -r 1.1.4.14 -r 1.1.4.15 src/gtk/gtkshruler.c; cvs diff -u -r 1.1.4.7 -r 1.1.4.8 src/gtk/gtkshruler.h; ) > 3.7.9cvs8.patchset
diff --git a/configure.ac b/configure.ac
@@ -12,7 +12,7 @@ MINOR_VERSION=7
MICRO_VERSION=9
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=7
+EXTRA_VERSION=8
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
diff --git a/src/compose.c b/src/compose.c
@@ -350,10 +350,13 @@ static void compose_add_field_list ( Compose *compose,
GList *listAddress );
/* callback functions */
-
+#if !GTK_CHECK_VERSION(2,24,0)
static gboolean compose_edit_size_alloc (GtkEditable *widget,
GtkAllocation *allocation,
- GtkSHRuler *shruler);
+ GtkSHRuler *shruler);
+static void compose_toggle_ruler_cb (GtkToggleAction *action,
+ gpointer data);
+#endif
static void account_activated (GtkComboBox *optmenu,
gpointer data);
static void attach_selected (GtkTreeView *tree_view,
@@ -437,8 +440,6 @@ static void compose_toggle_autowrap_cb (GtkToggleAction *action,
static void compose_toggle_autoindent_cb(GtkToggleAction *action,
gpointer data);
-static void compose_toggle_ruler_cb (GtkToggleAction *action,
- gpointer data);
static void compose_toggle_sign_cb (GtkToggleAction *action,
gpointer data);
static void compose_toggle_encrypt_cb (GtkToggleAction *action,
@@ -668,7 +669,9 @@ static GtkToggleActionEntry compose_toggle_entries[] =
{"Options/Encrypt", NULL, N_("_Encrypt"), NULL, NULL, G_CALLBACK(compose_toggle_encrypt_cb) }, /* Toggle */
{"Options/RequestRetRcpt", NULL, N_("_Request Return Receipt"), NULL, NULL, G_CALLBACK(compose_toggle_return_receipt_cb) }, /* TOGGLE */
{"Options/RemoveReferences", NULL, N_("Remo_ve references"), NULL, NULL, G_CALLBACK(compose_toggle_remove_refs_cb) }, /* TOGGLE */
+#if !GTK_CHECK_VERSION(2,24,0)
{"Tools/ShowRuler", NULL, N_("Show _ruler"), NULL, NULL, G_CALLBACK(compose_toggle_ruler_cb) }, /* Toggle */
+#endif
};
static GtkRadioActionEntry compose_radio_rm_entries[] =
@@ -7051,8 +7054,10 @@ static Compose *compose_create(PrefsAccount *account,
GtkWidget *paned;
GtkWidget *edit_vbox;
+#if !GTK_CHECK_VERSION(2,24,0)
GtkWidget *ruler_hbox;
GtkWidget *ruler;
+#endif
GtkWidget *scrolledwin;
GtkWidget *text;
GtkTextBuffer *buffer;
@@ -7410,6 +7415,7 @@ static Compose *compose_create(PrefsAccount *account,
gtk_box_pack_start(GTK_BOX(edit_vbox), subject_hbox, FALSE, FALSE, 0);
+#if !GTK_CHECK_VERSION(2,24,0)
/* ruler */
ruler_hbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(edit_vbox), ruler_hbox, FALSE, FALSE, 0);
@@ -7418,7 +7424,7 @@ static Compose *compose_create(PrefsAccount *account,
gtk_ruler_set_range(GTK_RULER(ruler), 0.0, 100.0, 1.0, 100.0);
gtk_box_pack_start(GTK_BOX(ruler_hbox), ruler, TRUE, TRUE,
BORDER_WIDTH);
-
+#endif
/* text widget */
scrolledwin = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin),
@@ -7442,9 +7448,11 @@ static Compose *compose_create(PrefsAccount *account,
gtk_container_add(GTK_CONTAINER(scrolledwin), text);
+#if !GTK_CHECK_VERSION(2,24,0)
g_signal_connect_after(G_OBJECT(text), "size_allocate",
G_CALLBACK(compose_edit_size_alloc),
ruler);
+#endif
g_signal_connect(G_OBJECT(buffer), "changed",
G_CALLBACK(compose_changed_cb), compose);
g_signal_connect(G_OBJECT(text), "grab_focus",
@@ -7538,8 +7546,10 @@ static Compose *compose_create(PrefsAccount *account,
compose->notebook = notebook;
compose->edit_vbox = edit_vbox;
+#if !GTK_CHECK_VERSION(2,24,0)
compose->ruler_hbox = ruler_hbox;
compose->ruler = ruler;
+#endif
compose->scrolledwin = scrolledwin;
compose->text = text;
@@ -7658,11 +7668,12 @@ static Compose *compose_create(PrefsAccount *account,
compose_list = g_list_append(compose_list, compose);
+#if !GTK_CHECK_VERSION(2,24,0)
if (!prefs_common.show_ruler)
gtk_widget_hide(ruler_hbox);
-
+
cm_toggle_menu_set_active_full(compose->ui_manager, "Menu/Tools/ShowRuler", prefs_common.show_ruler);
-
+#endif
/* Priority */
compose->priority = PRIORITY_NORMAL;
compose_update_priority_menu_item(compose);
@@ -9105,6 +9116,7 @@ static void compose_undo_state_changed(UndoMain *undostruct, gint undo_state,
* includes "non-client" (windows-izm) in calculation, so this calculation
* may not be accurate.
*/
+#if !GTK_CHECK_VERSION(2,24,0)
static gboolean compose_edit_size_alloc(GtkEditable *widget,
GtkAllocation *allocation,
GtkSHRuler *shruler)
@@ -9126,7 +9138,7 @@ static gboolean compose_edit_size_alloc(GtkEditable *widget,
return TRUE;
}
-
+#endif
typedef struct {
gchar *header;
gchar *entry;
@@ -10540,6 +10552,7 @@ static void activate_privacy_system(Compose *compose, PrefsAccount *account, gbo
compose_update_privacy_system_menu_item(compose, warn);
}
+#if !GTK_CHECK_VERSION(2,24,0)
static void compose_toggle_ruler_cb(GtkToggleAction *action, gpointer data)
{
Compose *compose = (Compose *)data;
@@ -10553,7 +10566,7 @@ static void compose_toggle_ruler_cb(GtkToggleAction *action, gpointer data)
prefs_common.show_ruler = FALSE;
}
}
-
+#endif
static void compose_attach_drag_received_cb (GtkWidget *widget,
GdkDragContext *context,
gint x,
diff --git a/src/gtk/combobox.c b/src/gtk/combobox.c
@@ -44,10 +44,13 @@ GtkWidget *combobox_text_new(const gboolean with_entry, const gchar *text, ...)
if(text == NULL)
return NULL;
- if (with_entry)
- combo = gtk_combo_box_entry_new_text();
- else
- combo = gtk_combo_box_new_text();
+ if (with_entry) {
+ GtkListStore *store = gtk_list_store_new (1, G_TYPE_STRING);
+ combo = gtk_combo_box_entry_new_with_model (
+ GTK_TREE_MODEL(store), 0);
+ g_object_unref (store);
+ } else
+ combo = gtk_combo_box_text_new();
gtk_widget_show(combo);
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), text);
diff --git a/src/gtk/gtkshruler.c b/src/gtk/gtkshruler.c
@@ -30,6 +30,9 @@
#include <stdio.h>
#include <string.h>
#include <gtk/gtk.h>
+
+#if !GTK_CHECK_VERSION(2,24,0)
+
#include "gtkshruler.h"
#include "utils.h"
#include "gtkutils.h"
@@ -179,3 +182,4 @@ gtk_shruler_draw_ticks(GtkRuler *ruler)
cairo_destroy(cr);
}
+#endif
diff --git a/src/gtk/gtkshruler.h b/src/gtk/gtkshruler.h
@@ -22,6 +22,8 @@
#include <gdk/gdk.h>
#include <gtk/gtk.h>
+#if !GTK_CHECK_VERSION(2,24,0)
+
#ifdef __cplusplus
extern "C" {
@@ -55,4 +57,5 @@ GtkWidget* gtk_shruler_new (void);
#endif /* __cplusplus */
+#endif /* GTK 2.24.0 */
#endif /* __GTK_SHRULER_H__ */
diff --git a/src/prefs_filtering_action.c b/src/prefs_filtering_action.c
@@ -512,7 +512,7 @@ static void prefs_filtering_action_create(void)
prefs_filtering_action_check_widget_width(color_optmenu);
gtk_box_pack_start(GTK_BOX(hbox1), color_optmenu, FALSE, FALSE, 0);
- tags_combo = gtk_combo_box_new_text ();
+ tags_combo = gtk_combo_box_text_new ();
gtk_size_group_add_widget(size_action, tags_combo);
for (tmp = tags = tags_get_list() ; tmp != NULL;
@@ -1268,7 +1268,7 @@ static void prefs_filtering_action_enable_widget(GtkWidget* widget, const gboole
if(enable == TRUE)
{
- if(GTK_IS_COMBO_BOX(widget) || GTK_IS_COMBO_BOX_ENTRY(widget))
+ if(GTK_IS_COMBO_BOX(widget))
gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 0);
else if(GTK_IS_SPIN_BUTTON(widget))
gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget), 0);