Drop ifdefs for old gtk+2
authorRalph Sennhauser <ralph.sennhauser@gmail.com>
Wed, 8 Nov 2017 19:12:28 +0000 (20:12 +0100)
committerAndrej Kacian <ticho@claws-mail.org>
Tue, 6 Feb 2018 19:27:53 +0000 (20:27 +0100)
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
23 files changed:
src/compose.c
src/editaddress.c
src/gtk/combobox.c
src/gtk/combobox.h
src/gtk/gtkcmclist.c
src/gtk/gtkshruler.c
src/gtk/gtkutils.c
src/gtk/gtkutils.h
src/gtk/inputdialog.c
src/gtk/quicksearch.c
src/message_search.c
src/mimeview.c
src/plugins/bogofilter/bogofilter_gtk.c
src/plugins/fancy/fancy_viewer.c
src/plugins/rssyl/rssyl_feed_props.c
src/plugins/vcalendar/vcal_meeting_gtk.c
src/prefs_display_header.c
src/prefs_filtering_action.c
src/prefs_matcher.c
src/prefs_other.c
src/prefs_toolbar.c
src/printing.c
src/summary_search.c

index ec66385..ae5cd90 100644 (file)
@@ -838,12 +838,6 @@ static void compose_create_tags(GtkTextView *text, Compose *compose)
 {
        GtkTextBuffer *buffer;
        GdkColor black = {(gulong)0, (gushort)0, (gushort)0, (gushort)0};
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       GdkColormap *cmap;
-       gboolean success[8];
-       int i;
-       GdkColor color[8];
-#endif
 
        buffer = gtk_text_view_get_buffer(text);
 
@@ -904,29 +898,6 @@ static void compose_create_tags(GtkTextView *text, Compose *compose)
                                         NULL);
        compose->no_wrap_tag = gtk_text_buffer_create_tag(buffer, "no_wrap", NULL);
        compose->no_join_tag = gtk_text_buffer_create_tag(buffer, "no_join", NULL);
-
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       color[0] = quote_color1;
-       color[1] = quote_color2;
-       color[2] = quote_color3;
-       color[3] = quote_bgcolor1;
-       color[4] = quote_bgcolor2;
-       color[5] = quote_bgcolor3;
-       color[6] = signature_color;
-       color[7] = uri_color;
-
-       cmap = gdk_drawable_get_colormap(gtk_widget_get_window(compose->window));
-       gdk_colormap_alloc_colors(cmap, color, 8, FALSE, TRUE, success);
-
-       for (i = 0; i < 8; i++) {
-               if (success[i] == FALSE) {
-                       g_warning("Compose: color allocation failed.");
-                       quote_color1 = quote_color2 = quote_color3 = 
-                               quote_bgcolor1 = quote_bgcolor2 = quote_bgcolor3 = 
-                               signature_color = uri_color = black;
-               }
-       }
-#endif
 }
 
 Compose *compose_new(PrefsAccount *account, const gchar *mailto,
@@ -958,20 +929,11 @@ static void compose_set_save_to(Compose *compose, const gchar *folderidentifier)
 {
        GtkEditable *entry;
        if (folderidentifier) {
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               combobox_unset_popdown_strings(GTK_COMBO_BOX(compose->savemsg_combo));
-#else
                combobox_unset_popdown_strings(GTK_COMBO_BOX_TEXT(compose->savemsg_combo));
-#endif
                prefs_common.compose_save_to_history = add_history(
                                prefs_common.compose_save_to_history, folderidentifier);
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               combobox_set_popdown_strings(GTK_COMBO_BOX(compose->savemsg_combo),
-                               prefs_common.compose_save_to_history);
-#else
                combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(compose->savemsg_combo),
                                prefs_common.compose_save_to_history);
-#endif
        }
 
        entry = GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(compose->savemsg_combo)));
@@ -989,20 +951,11 @@ static gchar *compose_get_save_to(Compose *compose)
        result = gtk_editable_get_chars(entry, 0, -1);
        
        if (result) {
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               combobox_unset_popdown_strings(GTK_COMBO_BOX(compose->savemsg_combo));
-#else
                combobox_unset_popdown_strings(GTK_COMBO_BOX_TEXT(compose->savemsg_combo));
-#endif
                prefs_common.compose_save_to_history = add_history(
                                prefs_common.compose_save_to_history, result);
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               combobox_set_popdown_strings(GTK_COMBO_BOX(compose->savemsg_combo),
-                               prefs_common.compose_save_to_history);
-#else
                combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(compose->savemsg_combo),
                                prefs_common.compose_save_to_history);
-#endif
        }
        return result;
 }
@@ -4963,9 +4916,7 @@ static void compose_select_account(Compose *compose, PrefsAccount *account,
 {
        gchar *from = NULL, *header = NULL;
        ComposeHeaderEntry *header_entry;
-#if GTK_CHECK_VERSION(2, 24, 0)
        GtkTreeIter iter;
-#endif
 
        cm_return_if_fail(account != NULL);
 
@@ -5007,13 +4958,9 @@ static void compose_select_account(Compose *compose, PrefsAccount *account,
        }
        
        header_entry = (ComposeHeaderEntry *) compose->header_list->data;
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       header = gtk_combo_box_get_active_text(GTK_COMBO_BOX(header_entry->combo));
-#else
        if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(header_entry->combo), &iter))
                gtk_tree_model_get(gtk_combo_box_get_model(GTK_COMBO_BOX(
                        header_entry->combo)), &iter, COMBOBOX_TEXT, &header, -1);
-#endif
        
        if (header && !strlen(gtk_entry_get_text(GTK_ENTRY(header_entry->entry)))) {
                if (account->protocol == A_NNTP) {
@@ -7125,9 +7072,6 @@ static void compose_create_header_entry(Compose *compose)
 
        /* Combo box model */
        model = gtk_list_store_new(3, G_TYPE_STRING, G_TYPE_INT, G_TYPE_BOOLEAN);
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       combo = gtk_combo_box_entry_new_with_model(GTK_TREE_MODEL(model), 0);
-#endif
        COMBOBOX_ADD(model, prefs_common_translated_header_name("To:"),
                        COMPOSE_TO);
        COMBOBOX_ADD(model, prefs_common_translated_header_name("Cc:"),
@@ -7143,13 +7087,11 @@ static void compose_create_header_entry(Compose *compose)
        compose_add_extra_header_entries(model);
 
        /* Combo box */
-#if GTK_CHECK_VERSION(2, 24, 0)
        combo = gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(model));
        GtkCellRenderer *cell = gtk_cell_renderer_text_new();
        gtk_cell_renderer_set_alignment(cell, 0.0, 0.5);
        gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), cell, TRUE);
        gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(combo), 0);
-#endif
        gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0);
        g_signal_connect(G_OBJECT(gtk_bin_get_child(GTK_BIN(combo))), "grab_focus",
                         G_CALLBACK(compose_grab_focus_cb), compose);
@@ -7519,23 +7461,14 @@ static GtkWidget *compose_create_others(Compose *compose)
        g_signal_connect(G_OBJECT(savemsg_checkbtn), "toggled",
                         G_CALLBACK(compose_savemsg_checkbtn_cb), compose);
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       savemsg_combo = gtk_combo_box_entry_new_text();
-#else
        savemsg_combo = gtk_combo_box_text_new_with_entry();
-#endif
        compose->savemsg_checkbtn = savemsg_checkbtn;
        compose->savemsg_combo = savemsg_combo;
        gtk_widget_show(savemsg_combo);
 
        if (prefs_common.compose_save_to_history)
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               combobox_set_popdown_strings(GTK_COMBO_BOX(savemsg_combo),
-                               prefs_common.compose_save_to_history);
-#else
                combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(savemsg_combo),
                                prefs_common.compose_save_to_history);
-#endif
        gtk_table_attach(GTK_TABLE(table), savemsg_combo, 1, 2, rowcount, rowcount + 1, GTK_FILL|GTK_EXPAND, GTK_SHRINK, 0, 0);
        gtk_widget_set_sensitive(GTK_WIDGET(savemsg_combo), prefs_common.savemsg);
        g_signal_connect_after(G_OBJECT(savemsg_combo), "grab_focus",
@@ -9477,11 +9410,7 @@ static void compose_attach_property_create(gboolean *cancelled)
        gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, (0 + 1), 
                         GTK_FILL, 0, 0, 0); 
        gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       mimetype_entry = gtk_combo_box_entry_new_text(); 
-#else
        mimetype_entry = gtk_combo_box_text_new_with_entry();
-#endif
        gtk_table_attach(GTK_TABLE(table), mimetype_entry, 1, 2, 0, (0 + 1), 
                         GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
                         
@@ -9503,11 +9432,7 @@ static void compose_attach_property_create(gboolean *cancelled)
 
        for (mime_type_list = strlist; mime_type_list != NULL; 
                mime_type_list = mime_type_list->next) {
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               gtk_combo_box_append_text(GTK_COMBO_BOX(mimetype_entry), mime_type_list->data);
-#else
                gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(mimetype_entry), mime_type_list->data);
-#endif
                g_free(mime_type_list->data);
        }
        g_list_free(strlist);
index e1b5534..e6d9af2 100644 (file)
@@ -1322,11 +1322,7 @@ static void addressbook_edit_person_page_attrib( gint pageNum, gchar *pageLbl )
        gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
        gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       entry_name = gtk_combo_box_entry_new_text ();
-#else
        entry_name = gtk_combo_box_text_new_with_entry ();
-#endif
        gtk_table_attach(GTK_TABLE(table), entry_name, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
 
        /* Next row */
@@ -1342,11 +1338,7 @@ static void addressbook_edit_person_page_attrib( gint pageNum, gchar *pageLbl )
        gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0);
        gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       entry_name = gtk_combo_box_entry_new_text ();
-#else
        entry_name = gtk_combo_box_text_new_with_entry ();
-#endif
        gtk_table_attach(GTK_TABLE(table), entry_name, 1, 2, 0, 1, GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
 
        /* Next row */
@@ -1360,13 +1352,8 @@ static void addressbook_edit_person_page_attrib( gint pageNum, gchar *pageLbl )
 #endif
        gtk_combo_box_set_active(GTK_COMBO_BOX(entry_name), -1);
        if (prefs_common.addressbook_custom_attributes)
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               combobox_set_popdown_strings(GTK_COMBO_BOX(entry_name),
-                               prefs_common.addressbook_custom_attributes);
-#else
                combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(entry_name),
                                prefs_common.addressbook_custom_attributes);            
-#endif
        /* Button box */
        vboxb = gtk_vbox_new( FALSE, 4 );
        gtk_box_pack_start(GTK_BOX(hbox), vboxb, FALSE, FALSE, 2);
@@ -1758,19 +1745,10 @@ no_img:
 void addressbook_edit_reload_attr_list( void )
 {
        if (personeditdlg.entry_atname) {
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               combobox_unset_popdown_strings(GTK_COMBO_BOX(personeditdlg.entry_atname));
-#else          
                combobox_unset_popdown_strings(GTK_COMBO_BOX_TEXT(personeditdlg.entry_atname));
-#endif
                if (prefs_common.addressbook_custom_attributes)
-#if !GTK_CHECK_VERSION(2, 24, 0)
-                       combobox_set_popdown_strings(GTK_COMBO_BOX(personeditdlg.entry_atname),
-                                       prefs_common.addressbook_custom_attributes);
-#else          
                        combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(personeditdlg.entry_atname),
                                        prefs_common.addressbook_custom_attributes);
-#endif
        }
 }
 
index 11e0c65..4804960 100644 (file)
@@ -45,31 +45,16 @@ GtkWidget *combobox_text_new(const gboolean with_entry, const gchar *text, ...)
        if(text == NULL)
                return NULL;
        
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       if (with_entry)
-               combo = gtk_combo_box_entry_new_text();
-       else
-               combo = gtk_combo_box_new_text();
-#else
        if (with_entry)
                combo = gtk_combo_box_text_new_with_entry();
        else
                combo = gtk_combo_box_text_new();
-#endif
        gtk_widget_show(combo);
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       gtk_combo_box_append_text(GTK_COMBO_BOX(combo), text);
-#else
        gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), text);
-#endif
        va_start(args, text);
        while ((string = va_arg(args, gchar*)) != NULL)
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               gtk_combo_box_append_text(GTK_COMBO_BOX(combo), string);
-#else
                gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), string);
-#endif
        va_end(args);
                
        gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0);
@@ -138,19 +123,9 @@ void combobox_select_by_text(GtkComboBox *combobox, const gchar *data)
 {
        GtkTreeModel *model;
        ComboboxSelCtx *ctx = NULL;
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       GtkComboBoxClass *class;
-#endif
 
        cm_return_if_fail(combobox != NULL);
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       class = GTK_COMBO_BOX_GET_CLASS (combobox);
-
-       /* we can do that only with gtk_combo_box_new_text() combo boxes */
-       cm_return_if_fail(class->get_active_text != NULL);
-#else
        cm_return_if_fail(GTK_IS_COMBO_BOX (combobox));
-#endif
 
        model = gtk_combo_box_get_model(combobox);
 
@@ -180,51 +155,31 @@ gint combobox_get_active_data(GtkComboBox *combobox)
        return data;
 }
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-void combobox_unset_popdown_strings(GtkComboBox *combobox)
-#else
 void combobox_unset_popdown_strings(GtkComboBoxText *combobox)
-#endif
 {
        GtkTreeModel *model;
        gint count, i;
 
        cm_return_if_fail(combobox != NULL);
-#if GTK_CHECK_VERSION(2, 24, 0)
        cm_return_if_fail(GTK_IS_COMBO_BOX_TEXT (combobox));
-#endif
 
        model = gtk_combo_box_get_model(GTK_COMBO_BOX(combobox));
        count = gtk_tree_model_iter_n_children(model, NULL);
        for (i = 0; i < count; i++)
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               gtk_combo_box_remove_text(combobox, 0);
-#else
                gtk_combo_box_text_remove(GTK_COMBO_BOX_TEXT(combobox), 0);
-#endif
 }
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-void combobox_set_popdown_strings(GtkComboBox *combobox,
-#else
 void combobox_set_popdown_strings(GtkComboBoxText *combobox,
-#endif
                                 GList       *list)
 {
        GList *cur;
 
        cm_return_if_fail(combobox != NULL);
-#if GTK_CHECK_VERSION(2, 24, 0)
        cm_return_if_fail(GTK_IS_COMBO_BOX_TEXT (combobox));
-#endif
 
        for (cur = list; cur != NULL; cur = g_list_next(cur))
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               gtk_combo_box_append_text(combobox, (const gchar*) cur->data);
-#else
                gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combobox),
                                                (const gchar*) cur->data);
-#endif
 }
 
 gboolean combobox_set_value_from_arrow_key(GtkComboBox *combobox,
@@ -257,14 +212,8 @@ gboolean combobox_set_value_from_arrow_key(GtkComboBox *combobox,
                /* if current text is in list, get prev or next one */
 
                if (keyval == GDK_KEY_Up) {
-#if !GTK_CHECK_VERSION(2, 24, 0)
-                       gchar *text = gtk_combo_box_get_active_text(combobox);
-                       if (!text)
-                               text = gtk_editable_get_chars(GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(combobox))),0,-1);
-#else
                        gchar *text = NULL;
                        gtk_tree_model_get(model, &iter, 0, &text, -1);
-#endif
                        valid = gtkut_tree_model_text_iter_prev(model, &iter, text);
                        g_free(text);
                } else
index 0218ece..dbd9893 100644 (file)
@@ -61,16 +61,10 @@ void combobox_select_by_text        (GtkComboBox            *combobox,
 
 gint combobox_get_active_data  (GtkComboBox            *combobox);
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-void combobox_unset_popdown_strings(GtkComboBox                *combobox);
-void combobox_set_popdown_strings(GtkComboBox          *combobox,
-                                GList       *list);
-#else
 /* these two functions require a GtkComboBoxText, so let the compiler warn */
 void combobox_unset_popdown_strings(GtkComboBoxText    *combobox);
 void combobox_set_popdown_strings(GtkComboBoxText      *combobox,
                                 GList       *list);
-#endif
 
 gboolean combobox_set_value_from_arrow_key(GtkComboBox *combobox,
                                 guint keyval);
index 853f5ce..cfaa417 100644 (file)
@@ -4693,13 +4693,8 @@ gtk_cmclist_realize (GtkWidget *widget)
   gdk_window_set_background (clist->clist_window,
                             &style->base[GTK_STATE_NORMAL]);
   gdk_window_show (clist->clist_window);
-#if GTK_CHECK_VERSION(2,24,0)
   clist->clist_window_width = gdk_window_get_width(clist->clist_window);
   clist->clist_window_height = gdk_window_get_height(clist->clist_window);
-#else
-  gdk_drawable_get_size (clist->clist_window, &clist->clist_window_width,
-                      &clist->clist_window_height);
-#endif
 
   /* create resize windows */
   attributes.wclass = GDK_INPUT_ONLY;
@@ -6069,12 +6064,8 @@ draw_rows (GtkCMCList     *clist,
   if (!area) {
     int w, h, y;
     cairo_t *cr;
-#if GTK_CHECK_VERSION(2,24,0)
     w = gdk_window_get_width(clist->clist_window);
     h = gdk_window_get_height(clist->clist_window);
-#else
-    gdk_drawable_get_size(clist->clist_window, &w, &h);
-#endif
     cr = gdk_cairo_create(clist->clist_window);
     y = ROW_TOP_YPIXEL (clist, i);
     gdk_cairo_set_source_color(cr, &gtk_widget_get_style(GTK_WIDGET(clist))->base[GTK_STATE_NORMAL]);
index 9060106..b56f870 100644 (file)
@@ -1022,31 +1022,6 @@ out:
   cairo_destroy (cr);
 }
 
-static cairo_surface_t *
-cm_gdk_window_create_similar_surface (GdkWindow *     window,
-                                   cairo_content_t content,
-                                   int             width,
-                                   int             height)
-{
-#if !GTK_CHECK_VERSION(2, 22, 0)
-  cairo_surface_t *window_surface, *surface;
-
-  g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
-
-  window_surface = GDK_DRAWABLE_GET_CLASS(window)->ref_cairo_surface(window);
-
-  surface = cairo_surface_create_similar (window_surface,
-                                          content,
-                                          width, height);
-
-  cairo_surface_destroy (window_surface);
-
-  return surface;
-#else
-  return gdk_window_create_similar_surface(window, content, width, height);
-#endif
-}
-
 static void
 gtk_shruler_make_pixmap (GtkSHRuler *ruler)
 {
@@ -1060,7 +1035,7 @@ gtk_shruler_make_pixmap (GtkSHRuler *ruler)
     cairo_surface_destroy (priv->backing_store);
 
   priv->backing_store =
-    cm_gdk_window_create_similar_surface (gtk_widget_get_window (widget),
+    gdk_window_create_similar_surface (gtk_widget_get_window (widget),
                                        CAIRO_CONTENT_COLOR,
                                        allocation.width,
                                        allocation.height);
index 04cccf7..3d82902 100644 (file)
@@ -1702,74 +1702,32 @@ claws_input_add    (gint              source,
 
 void gtkut_widget_set_mapped(GtkWidget *widget, gboolean mapped)
 {
-#if GTK_CHECK_VERSION(2,20,0)
        gtk_widget_set_mapped(widget, mapped);
-#else
-       if (mapped)
-               GTK_WIDGET_SET_FLAGS(widget, GTK_MAPPED);
-       else
-               GTK_WIDGET_UNSET_FLAGS(widget, GTK_MAPPED);
-#endif
 }
 
 void gtkut_widget_set_realized(GtkWidget *widget, gboolean realized)
 {
-#if GTK_CHECK_VERSION(2,20,0)
        gtk_widget_set_realized(widget, realized);
-#else
-       if (realized)
-               GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED);
-       else
-               GTK_WIDGET_UNSET_FLAGS(widget, GTK_REALIZED);
-#endif
 }
 
 void gtkut_widget_set_can_default(GtkWidget *widget, gboolean can_default)
 {
-#if GTK_CHECK_VERSION(2,20,0)
        gtk_widget_set_can_default(widget, can_default);
-#else
-       if (can_default)
-               GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_DEFAULT);
-       else
-               GTK_WIDGET_UNSET_FLAGS(widget, GTK_CAN_DEFAULT);
-#endif
 }
 
 void gtkut_widget_set_receives_default(GtkWidget *widget, gboolean receives_default)
 {
-#if GTK_CHECK_VERSION(2,20,0)
        gtk_widget_set_receives_default(widget, receives_default);
-#else
-       if (receives_default)
-               GTK_WIDGET_SET_FLAGS(widget, GTK_RECEIVES_DEFAULT);
-       else
-               GTK_WIDGET_UNSET_FLAGS(widget, GTK_RECEIVES_DEFAULT);
-#endif
 }
 
 void gtkut_widget_set_can_focus(GtkWidget *widget, gboolean can_focus)
 {
-#if GTK_CHECK_VERSION(2,20,0)
        gtk_widget_set_can_focus(widget, can_focus);
-#else
-       if (can_focus)
-               GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_FOCUS);
-       else
-               GTK_WIDGET_UNSET_FLAGS(widget, GTK_CAN_FOCUS);
-#endif
 }
 
 void gtkut_widget_set_has_window(GtkWidget *widget, gboolean has_window)
 {
-#if GTK_CHECK_VERSION(2,20,0)
        gtk_widget_set_has_window(widget, has_window);
-#else
-       if (has_window) /* Inverted logic there */
-               GTK_WIDGET_UNSET_FLAGS(widget, GTK_NO_WINDOW);
-       else
-               GTK_WIDGET_SET_FLAGS(widget, GTK_NO_WINDOW);
-#endif
 }
 
 /**
index 57680c4..71a27cb 100644 (file)
@@ -259,39 +259,5 @@ gboolean auto_configure_service_sync(const gchar *service, const gchar *domain,
 #define gtk_vpaned_new() g_object_new (GTK_TYPE_PANED, \
     "orientation", GTK_ORIENTATION_VERTICAL, NULL)
 #endif
-#if !GTK_CHECK_VERSION(2,22,0)
-#define gdk_drag_context_get_selected_action(x) ((x)->action)
-#define gdk_drag_context_get_actions(x) ((x)->actions)
-#define gtk_text_view_get_vadjustment(x) ((x)->vadjustment)
-#define gdk_drag_context_get_suggested_action(x) ((x)->suggested_action)
-#define gtk_button_get_event_window(x) ((x)->event_window)
-#endif
-#if !GTK_CHECK_VERSION(2,20,0)
-#define gtk_widget_get_requisition(x,r) (*(r) = (x)->requisition)
-#define gtk_statusbar_get_message_area(x) ((x)->label)
-#define gtk_widget_get_realized(x) (GTK_WIDGET_REALIZED(x))
-#define gtk_widget_get_mapped(x) (GTK_WIDGET_MAPPED(x))
-#endif
-#if !GTK_CHECK_VERSION(2,18,0)
-#define gtk_widget_get_allocation(x,a) (*(a) = (x)->allocation)
-#define gtk_widget_set_allocation(x,a) ((x)->allocation = *(a))
-#define gtk_widget_has_focus(x) (GTK_WIDGET_HAS_FOCUS(x))
-#define gtk_widget_get_can_focus(x) (GTK_WIDGET_CAN_FOCUS(x))
-#define gtk_widget_has_grab(x) (GTK_WIDGET_HAS_GRAB(x))
-#define gtk_widget_get_visible(x) (GTK_WIDGET_VISIBLE(x))
-#define gtk_widget_get_realized(x) (GTK_WIDGET_REALIZED(x))
-#define gtk_widget_is_sensitive(x) (GTK_WIDGET_IS_SENSITIVE(x))
-#define gtk_widget_get_sensitive(x) (GTK_WIDGET_SENSITIVE(x))
-#define gtk_widget_is_drawable(x) (GTK_WIDGET_DRAWABLE(x))
-#define gtk_widget_get_state(x) (GTK_WIDGET_STATE(x))
-#define gtk_widget_get_mapped(x) (GTK_WIDGET_MAPPED(x))
-#define gtk_widget_get_has_window(x) (!(GTK_WIDGET_NO_WINDOW(x)))
-#define gtk_widget_get_app_paintable(x) (GTK_WIDGET_APP_PAINTABLE(x))
-#define gtk_widget_set_window(x,w) {                   \
-       if ((x)->window != w) {                         \
-               (x)->window = w;                        \
-               g_object_notify (G_OBJECT(x), "window");\
-       }                                               \
-}
-#endif
+
 #endif /* __GTKUTILS_H__ */
index c131c0a..6953e60 100644 (file)
@@ -185,13 +185,8 @@ gchar *input_dialog_combo_remember(const gchar *title, const gchar *message,
        gtk_widget_show(icon_q);
        gtk_widget_hide(icon_p);
        is_pass = FALSE;
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       combobox_unset_popdown_strings(GTK_COMBO_BOX(combo));
-       combobox_set_popdown_strings(GTK_COMBO_BOX(combo), list);
-#else
        combobox_unset_popdown_strings(GTK_COMBO_BOX_TEXT(combo));
        combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(combo), list);
-#endif
        return input_dialog_open(title, message, NULL, default_string, FALSE, remember);
 }
 
@@ -360,11 +355,7 @@ static void input_dialog_create(gboolean is_password)
        g_signal_connect(G_OBJECT(entry), "activate",
                         G_CALLBACK(entry_activated), NULL);
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       combo = gtk_combo_box_entry_new_text();
-#else
        combo = gtk_combo_box_text_new_with_entry();
-#endif
        gtk_box_pack_start(GTK_BOX(vbox), combo, FALSE, FALSE, 0);
        g_signal_connect(G_OBJECT(gtk_bin_get_child(GTK_BIN((combo)))), "activate",
                         G_CALLBACK(combo_activated), NULL);
index 724bbc3..3242aa7 100644 (file)
@@ -242,15 +242,6 @@ static void quicksearch_set_popdown_strings(QuickSearch *quicksearch)
 {
        GtkWidget *search_string_entry = quicksearch->search_string_entry;
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       combobox_unset_popdown_strings(GTK_COMBO_BOX(search_string_entry));
-       if (prefs_common.summary_quicksearch_type == ADVANCED_SEARCH_EXTENDED)
-               combobox_set_popdown_strings(GTK_COMBO_BOX(search_string_entry),
-                       quicksearch->extended_search_strings);  
-       else
-               combobox_set_popdown_strings(GTK_COMBO_BOX(search_string_entry),
-                       quicksearch->normal_search_strings);
-#else
        combobox_unset_popdown_strings(GTK_COMBO_BOX_TEXT(search_string_entry));        
        if (prefs_common.summary_quicksearch_type == ADVANCED_SEARCH_EXTENDED)
                combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(search_string_entry),
@@ -258,7 +249,6 @@ static void quicksearch_set_popdown_strings(QuickSearch *quicksearch)
        else
                combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(search_string_entry),
                        quicksearch->normal_search_strings);
-#endif
 }
 
 static void update_extended_buttons (QuickSearch *quicksearch)
@@ -763,11 +753,7 @@ QuickSearch *quicksearch_new()
 
        gtk_widget_show(search_type);
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       search_string_entry = gtk_combo_box_entry_new_text ();
-#else
        search_string_entry = gtk_combo_box_text_new_with_entry ();
-#endif
        gtk_combo_box_set_active(GTK_COMBO_BOX(search_string_entry), -1);
 
        vbox = gtk_vbox_new(TRUE, 0);
index 33965bd..963346c 100644 (file)
@@ -181,20 +181,11 @@ static void message_search_create(void)
        gtk_widget_show (body_label);
        gtk_box_pack_start (GTK_BOX (hbox1), body_label, FALSE, FALSE, 0);
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       body_entry = gtk_combo_box_entry_new_text ();
-#else
        body_entry = gtk_combo_box_text_new_with_entry ();
-#endif
        gtk_combo_box_set_active(GTK_COMBO_BOX(body_entry), -1);
        if (prefs_common.message_search_history)
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               combobox_set_popdown_strings(GTK_COMBO_BOX(body_entry),
-                               prefs_common.message_search_history);
-#else
                combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(body_entry),
                                prefs_common.message_search_history);
-#endif
        gtk_widget_show (body_entry);
        gtk_box_pack_start (GTK_BOX (hbox1), body_entry, TRUE, TRUE, 0);
        g_signal_connect(G_OBJECT(body_entry), "changed",
@@ -278,31 +269,18 @@ static void message_search_execute(gboolean backward)
        gboolean all_searched = FALSE;
        gchar *body_str;
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       body_str = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.body_entry));
-#else
        body_str = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(search_window.body_entry));
-#endif
        if (!body_str)
                body_str = gtk_editable_get_chars(
                                GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(search_window.body_entry))),0,-1);
        if (!body_str || *body_str == '\0') return;
 
        /* add to history */
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       combobox_unset_popdown_strings(GTK_COMBO_BOX(search_window.body_entry));
-#else
        combobox_unset_popdown_strings(GTK_COMBO_BOX_TEXT(search_window.body_entry));
-#endif
        prefs_common.message_search_history = add_history(
                        prefs_common.message_search_history, body_str);
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       combobox_set_popdown_strings(GTK_COMBO_BOX(search_window.body_entry),
-                       prefs_common.message_search_history);
-#else
        combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(search_window.body_entry),
                        prefs_common.message_search_history);
-#endif
 
        case_sens = gtk_toggle_button_get_active
                (GTK_TOGGLE_BUTTON(search_window.case_checkbtn));
index 3ffdd18..6f50792 100644 (file)
@@ -299,9 +299,7 @@ MimeView *mimeview_create(MainWindow *mainwin)
        column = gtk_tree_view_get_column(GTK_TREE_VIEW(ctree), cols-1);
                                                           
        renderer = gtk_cell_renderer_text_new();
-#if(GTK_CHECK_VERSION(2,18,0))
        gtk_cell_renderer_set_alignment(renderer, 1, 0.5);
-#endif
        cols = gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(ctree),
                                        -1, titles[COL_SIZE], renderer,
                                        "text", COL_SIZE, NULL);
index fdae7f1..78b4b1a 100644 (file)
@@ -186,31 +186,15 @@ static void bogofilter_create_widget_func(PrefsPage * _page,
        gtk_widget_show(hbox_save_spam);
        gtk_box_pack_start (GTK_BOX (vbox2), hbox_save_spam, TRUE, TRUE, 0);
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       spam_handle_combobox = gtk_combo_box_new_text();
-#else
        spam_handle_combobox = gtk_combo_box_text_new();
-#endif
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       gtk_combo_box_append_text(GTK_COMBO_BOX(spam_handle_combobox),
-#else
        gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(spam_handle_combobox),
-#endif
                        _("Delete spam"));
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       gtk_combo_box_append_text(GTK_COMBO_BOX(spam_handle_combobox),
-#else
        gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(spam_handle_combobox),
-#endif
                        _("Save spam in..."));
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       gtk_combo_box_append_text(GTK_COMBO_BOX(spam_handle_combobox),
-#else
        gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(spam_handle_combobox),
-#endif
                        _("Only mark as spam"));
 
        gtk_widget_show(spam_handle_combobox);
index ca0da60..08c0044 100644 (file)
@@ -321,10 +321,8 @@ static void fancy_print(MimeViewer *_viewer)
        /* Config for printing */
        gtk_print_operation_set_print_settings(op, printing_get_settings());
        gtk_print_operation_set_default_page_setup(op, printing_get_page_setup());
-#if GTK_CHECK_VERSION(2,18,0)
         /* enable Page Size and Orientation in the print dialog */
        gtk_print_operation_set_embed_page_setup(op, TRUE);
-#endif
 
        /* Start printing process */
        res = webkit_web_frame_print_full(webkit_web_view_get_main_frame(viewer->view),
index a425433..14e80f4 100644 (file)
@@ -252,19 +252,10 @@ void rssyl_gtk_prop(RFolderItem *ritem)
        gtk_entry_set_text(GTK_ENTRY(feedprop->url), ritem->url);
 
        /* URL auth type combo */
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       feedprop->auth_type = gtk_combo_box_new_text();
-       gtk_combo_box_append_text(GTK_COMBO_BOX(feedprop->auth_type),
-#else
        feedprop->auth_type = gtk_combo_box_text_new();
        gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(feedprop->auth_type),
-#endif
                        _("No authentication"));
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       gtk_combo_box_append_text(GTK_COMBO_BOX(feedprop->auth_type),
-#else
        gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(feedprop->auth_type),
-#endif
                        _("HTTP Basic authentication"));
        gtk_combo_box_set_active(GTK_COMBO_BOX(feedprop->auth_type),
                        ritem->auth->type);
@@ -327,25 +318,12 @@ void rssyl_gtk_prop(RFolderItem *ritem)
                        1, 0);
 
        /* Silent update - combobox */
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       feedprop->silent_update = gtk_combo_box_new_text();
-       gtk_combo_box_append_text(GTK_COMBO_BOX(feedprop->silent_update),
-#else
        feedprop->silent_update = gtk_combo_box_text_new();
        gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(feedprop->silent_update),
-#endif
                        _("Always mark it as new"));
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       gtk_combo_box_append_text(GTK_COMBO_BOX(feedprop->silent_update),
-#else
        gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(feedprop->silent_update),
-#endif
                        _("Only mark it as new if its text has changed"));
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       gtk_combo_box_append_text(GTK_COMBO_BOX(feedprop->silent_update),
-#else
        gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(feedprop->silent_update),
-#endif
                        _("Never mark it as new"));
        gtk_combo_box_set_active(GTK_COMBO_BOX(feedprop->silent_update),
                        ritem->silent_update);
index 6f58e7d..898f5e9 100644 (file)
@@ -1410,29 +1410,13 @@ static VCalMeeting *vcal_meeting_create_real(VCalEvent *event, gboolean visible)
 
        times = get_predefined_times();
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       meet->start_time = gtk_combo_box_entry_new_text();
-#else
        meet->start_time = gtk_combo_box_text_new_with_entry();
-#endif
        gtk_combo_box_set_active(GTK_COMBO_BOX(meet->start_time), -1);
-#if !GTK_CHECK_VERSION(2, 24, 0)       
-       combobox_set_popdown_strings(GTK_COMBO_BOX(meet->start_time), times);
-#else  
        combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(meet->start_time), times);
-#endif
        
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       meet->end_time = gtk_combo_box_entry_new_text();
-#else
        meet->end_time = gtk_combo_box_text_new_with_entry();
-#endif
        gtk_combo_box_set_active(GTK_COMBO_BOX(meet->end_time), -1);
-#if !GTK_CHECK_VERSION(2, 24, 0)       
-       combobox_set_popdown_strings(GTK_COMBO_BOX(meet->end_time), times);
-#else  
        combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(meet->end_time), times);
-#endif
 
        list_free_strings(times);
        g_list_free(times);
index 385f32c..ab1ec19 100644 (file)
@@ -277,17 +277,9 @@ static void prefs_display_header_create(void)
        gtk_widget_show (hdr_label);
        gtk_box_pack_start (GTK_BOX (hbox1), hdr_label, FALSE, FALSE, 0);
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       hdr_combo = gtk_combo_box_entry_new_text();
-#else
        hdr_combo = gtk_combo_box_text_new_with_entry();
-#endif
        for(i=0; i < 9 ; i++)
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               gtk_combo_box_append_text(GTK_COMBO_BOX (hdr_combo),
-#else
                gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (hdr_combo),
-#endif
                        (*defaults[i] == '-') ? defaults[i]+1 : defaults[i]);
        gtk_combo_box_set_active(GTK_COMBO_BOX(hdr_combo), 0);
        gtk_widget_show (hdr_combo);
@@ -589,11 +581,7 @@ static void prefs_display_header_list_view_set_row(gboolean hidden)
        gchar *entry_text;
        GtkTreeModel *model;
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       entry_text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(dispheader.hdr_combo));
-#else
        entry_text = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(dispheader.hdr_combo));
-#endif
        if (!entry_text)
                entry_text = gtk_editable_get_chars(
                                GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(dispheader.hdr_combo))),0,-1);
index 587a418..6f8e98c 100644 (file)
@@ -488,22 +488,14 @@ static void prefs_filtering_action_create(void)
        gtk_table_attach(GTK_TABLE(table), hbox1, 1, 2, 1, 2, 
                         GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0);
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       account_combo = gtk_combo_box_new_text ();
-#else
        account_combo = gtk_combo_box_text_new ();
-#endif
        gtk_size_group_add_widget(size_action, account_combo);
 
        for (accounts = account_get_list() ; accounts != NULL;
             accounts = accounts->next) {
                PrefsAccount *ac = (PrefsAccount *)accounts->data;
                gchar *name = g_strdup(ac->account_name);
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               gtk_combo_box_append_text(GTK_COMBO_BOX(account_combo), (gpointer) name);
-#else
                gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(account_combo), (gpointer) name);
-#endif
                g_free(name);
        }
 
@@ -541,22 +533,14 @@ static void prefs_filtering_action_create(void)
        gtk_box_pack_start(GTK_BOX(hbox1), color_optmenu, FALSE, FALSE, 0);
 #endif
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       tags_combo = gtk_combo_box_new_text ();
-#else
        tags_combo = gtk_combo_box_text_new ();
-#endif
        gtk_size_group_add_widget(size_action, tags_combo);
 
        for (tmp = tags = tags_get_list() ; tmp != NULL;
             tmp = tmp->next) {
                gchar *name = g_strdup(tags_get_tag(GPOINTER_TO_INT(tmp->data)));
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               gtk_combo_box_append_text(GTK_COMBO_BOX(tags_combo), (gpointer) name);
-#else
                gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(tags_combo), (gpointer) name);
-#endif
                g_free(name);
        }
        g_slist_free(tags);
@@ -987,11 +971,7 @@ static FilteringAction * prefs_filtering_action_dialog_to_action(gboolean alert)
                break;
        case ACTION_SET_TAG:
        case ACTION_UNSET_TAG:
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               destination = gtk_combo_box_get_active_text(GTK_COMBO_BOX(filtering_action.tags_combo));
-#else
                destination = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(filtering_action.tags_combo));
-#endif
                if (!destination || *destination == '\0') {
                        if (alert)
                                 alertpanel_error(_("Tag name is empty."));
@@ -1327,11 +1307,7 @@ static void prefs_filtering_action_enable_widget(GtkWidget* widget, const gboole
 
        if(enable == TRUE)
        {
-#if !GTK_CHECK_VERSION(2,24,0)
-               if(GTK_IS_COMBO_BOX(widget) || GTK_IS_COMBO_BOX_ENTRY(widget))
-#else
                if(GTK_IS_COMBO_BOX(widget))
-#endif
                        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);
index 602ba77..7cdc193 100644 (file)
@@ -650,15 +650,11 @@ static void prefs_matcher_create(void)
        gtk_box_pack_start(GTK_BOX(upper_hbox), criteria_label2, FALSE, FALSE, 0);
 
        /* headers combo box entry */
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       headers_combo = gtk_combo_box_entry_new_with_model(matcher.model_headers, 0);
-#else
        headers_combo = gtk_combo_box_new_with_model_and_entry(matcher.model_headers);
        GtkCellRenderer *cell = gtk_cell_renderer_text_new();
        gtk_cell_renderer_set_alignment(cell, 0.0, 0.5);
        gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(headers_combo), cell, TRUE);
        gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(headers_combo), 0);
-#endif
        gtk_widget_set_size_request(headers_combo, 100, -1);
        gtk_box_pack_start(GTK_BOX(upper_hbox), headers_combo, TRUE, TRUE, 0);
        header_entry = gtk_bin_get_child(GTK_BIN((headers_combo)));
index 1ea901a..56ef885 100644 (file)
@@ -409,11 +409,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                {"<Actions>/Menu/Edit/Advanced/DelForwWord",            "<alt>D"}, /* - */
        };
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(keybind.combo));
-#else
        text = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(keybind.combo));
-#endif
 
        if (!strcmp(text, _("Default"))) {
                menurc = default_menurc;
index e8ce780..4586cf3 100644 (file)
@@ -378,11 +378,7 @@ static void prefs_toolbar_set_displayed(ToolbarPage *prefs_toolbar)
 
 static void add_item_to_plugin_combo(gpointer key, gpointer data, gpointer combo_box)
 {
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       gtk_combo_box_append_text(GTK_COMBO_BOX(combo_box), (const gchar*)key);
-#else
        gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo_box), (const gchar*)key);
-#endif
 }
 
 static void prefs_toolbar_populate(ToolbarPage *prefs_toolbar)
@@ -392,13 +388,8 @@ static void prefs_toolbar_populate(ToolbarPage *prefs_toolbar)
        GHashTable **hash;
 
        prefs_toolbar->combo_action_list = toolbar_get_action_items(prefs_toolbar->source);
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       combobox_set_popdown_strings(GTK_COMBO_BOX(prefs_toolbar->item_func_combo),
-                                    prefs_toolbar->combo_action_list);
-#else
        combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(prefs_toolbar->item_func_combo),
                                     prefs_toolbar->combo_action_list);
-#endif
 
        /* get currently defined sylpheed actions */
        if (prefs_common.actions_list != NULL) {
@@ -406,13 +397,8 @@ static void prefs_toolbar_populate(ToolbarPage *prefs_toolbar)
                        act = (gchar *)cur->data;
                        get_action_name(act, &act_name);
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-                       gtk_combo_box_append_text(
-                               GTK_COMBO_BOX(prefs_toolbar->item_action_combo),
-#else
                        gtk_combo_box_text_append_text(
                                GTK_COMBO_BOX_TEXT(prefs_toolbar->item_action_combo),
-#endif
                                act_name);
 
                        g_free(act_name);
@@ -534,11 +520,7 @@ static void prefs_toolbar_register(GtkButton *button, ToolbarPage *prefs_toolbar
                }
 
                if (item_type == ITEM_FUNCTION) {
-#if !GTK_CHECK_VERSION(2, 24, 0)
-                       event = gtk_combo_box_get_active_text(GTK_COMBO_BOX(
-#else
                        event = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(
-#endif
                                                prefs_toolbar->item_func_combo));
 
                        if (is_duplicate(prefs_toolbar, event)) {
@@ -624,11 +606,7 @@ static void prefs_toolbar_substitute(GtkButton *button, ToolbarPage *prefs_toolb
                                                  -1);
 
                if (item_type == ITEM_FUNCTION) {
-#if !GTK_CHECK_VERSION(2, 24, 0)
-                       icon_event = gtk_combo_box_get_active_text(GTK_COMBO_BOX(
-#else
                        icon_event = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(
-#endif
                                                prefs_toolbar->item_func_combo));
 
                        if (is_duplicate(prefs_toolbar, icon_event)
@@ -822,11 +800,7 @@ static void item_type_changed(GtkComboBox *item_type_combo,
 static void action_selection_changed(GtkComboBox *action_combo,
                                ToolbarPage *prefs_toolbar)
 {
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       gchar *text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(
-#else
        gchar *text = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(
-#endif
                           prefs_toolbar->item_action_combo));
 
        if(text != NULL) { /* action */
@@ -838,11 +812,7 @@ static void action_selection_changed(GtkComboBox *action_combo,
 static void plugin_selection_changed(GtkComboBox *action_combo,
                 ToolbarPage *prefs_toolbar)
 {
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       gchar *text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(prefs_toolbar->item_plugin_combo));
-#else
        gchar *text = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(prefs_toolbar->item_plugin_combo));
-#endif
 
        if (text != NULL) { /* action */
                gtk_entry_set_text(GTK_ENTRY(prefs_toolbar->item_text_entry), text);
@@ -853,11 +823,7 @@ static void plugin_selection_changed(GtkComboBox *action_combo,
 static void func_selection_changed(GtkComboBox *action_combo,
                                ToolbarPage *prefs_toolbar)
 {
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       gchar *text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(
-#else
        gchar *text = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(
-#endif
                           prefs_toolbar->item_func_combo));
 
        if(text != NULL) { /* action */
@@ -968,33 +934,21 @@ static void prefs_toolbar_create(ToolbarPage *prefs_toolbar)
                          (GtkAttachOptions) (GTK_FILL),
                          (GtkAttachOptions) (0), 0, 0);
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       item_action_combo = gtk_combo_box_new_text();
-#else
        item_action_combo = gtk_combo_box_text_new();
-#endif
        gtk_widget_set_size_request(item_action_combo, 200, -1);
        gtk_table_attach (GTK_TABLE (table), item_action_combo, 1, 3, 1, 2,
                          (GtkAttachOptions) (GTK_FILL),
                          (GtkAttachOptions) (0), 0, 0);
 
        /* available internal functions */
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       item_func_combo = gtk_combo_box_new_text();
-#else
        item_func_combo = gtk_combo_box_text_new();
-#endif
        gtk_widget_set_size_request(item_func_combo, 200, -1);
        gtk_table_attach (GTK_TABLE (table), item_func_combo, 1, 3, 1, 2,
                          (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                          (GtkAttachOptions) (0), 0, 0);
 
        /* plugin-registered items */
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       item_plugin_combo = gtk_combo_box_new_text();
-#else
        item_plugin_combo = gtk_combo_box_text_new();
-#endif
        gtk_widget_set_size_request(item_plugin_combo, 200, -1);
        gtk_table_attach(GTK_TABLE(table), item_plugin_combo, 1, 3, 1, 2,
                         (GtkAttachOptions) (GTK_FILL),
index 27030b4..3ea1ab4 100644 (file)
@@ -279,10 +279,8 @@ void printing_print_full(GtkWindow *parent, PrintRenderer *renderer, gpointer re
        /* Config for printing */
        gtk_print_operation_set_print_settings(op, settings);
        gtk_print_operation_set_default_page_setup(op, page_setup);
-#if GTK_CHECK_VERSION(2,18,0)
         /* enable Page Size and Orientation in the print dialog */
        gtk_print_operation_set_embed_page_setup(op, TRUE);
-#endif
        /* signals */
        g_signal_connect(op, "begin_print", G_CALLBACK(renderer->cb_begin_print), print_data);
        g_signal_connect(op, "draw_page", G_CALLBACK(renderer->cb_draw_page), print_data);
index ce7b727..40f7d6a 100644 (file)
@@ -165,27 +165,15 @@ static gchar* add_history_get(GtkWidget *from, GList **history)
 {
        gchar *result;
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       result = gtk_combo_box_get_active_text(GTK_COMBO_BOX(from));
-#else
        result = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(from));
-#endif
        if (!result)
                result = gtk_editable_get_chars(GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(from))), 0, -1);
 
        if (result && result[0] != '\0') {
                /* add to history */
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               combobox_unset_popdown_strings(GTK_COMBO_BOX(from));
-#else
                combobox_unset_popdown_strings(GTK_COMBO_BOX_TEXT(from));
-#endif
                *history = add_history(*history, result);
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               combobox_set_popdown_strings(GTK_COMBO_BOX(from), *history);
-#else
                combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(from), *history);
-#endif
 
                return result;
        } else {
@@ -341,20 +329,11 @@ static void summary_search_create(void)
        gtk_table_set_row_spacings (GTK_TABLE (table1), 8);
        gtk_table_set_col_spacings (GTK_TABLE (table1), 8);
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       from_entry = gtk_combo_box_entry_new_text ();
-#else
        from_entry = gtk_combo_box_text_new_with_entry ();
-#endif
        gtk_combo_box_set_active(GTK_COMBO_BOX(from_entry), -1);
        if (prefs_common.summary_search_from_history)
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               combobox_set_popdown_strings(GTK_COMBO_BOX(from_entry),
-                               prefs_common.summary_search_from_history);
-#else
                combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(from_entry),
                                prefs_common.summary_search_from_history);
-#endif
        gtk_widget_show (from_entry);
        gtk_table_attach (GTK_TABLE (table1), from_entry, 1, 3, 0, 1,
                          GTK_EXPAND|GTK_FILL, 0, 0, 0);
@@ -365,20 +344,11 @@ static void summary_search_create(void)
        g_signal_connect(G_OBJECT(gtk_bin_get_child(GTK_BIN((from_entry)))),
                         "focus_out_event", G_CALLBACK(from_entry_focus_evt_out), NULL);
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       to_entry = gtk_combo_box_entry_new_text ();
-#else
        to_entry = gtk_combo_box_text_new_with_entry ();
-#endif
        gtk_combo_box_set_active(GTK_COMBO_BOX(to_entry), -1);
        if (prefs_common.summary_search_to_history)
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               combobox_set_popdown_strings(GTK_COMBO_BOX(to_entry),
-                               prefs_common.summary_search_to_history);
-#else
                combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(to_entry),
                                prefs_common.summary_search_to_history);
-#endif
        gtk_widget_show (to_entry);
        gtk_table_attach (GTK_TABLE (table1), to_entry, 1, 3, 1, 2,
                          GTK_EXPAND|GTK_FILL, 0, 0, 0);
@@ -389,20 +359,11 @@ static void summary_search_create(void)
        g_signal_connect(G_OBJECT(gtk_bin_get_child(GTK_BIN((to_entry)))),
                         "focus_out_event", G_CALLBACK(to_entry_focus_evt_out), NULL);
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       subject_entry = gtk_combo_box_entry_new_text ();
-#else
        subject_entry = gtk_combo_box_text_new_with_entry ();
-#endif
        gtk_combo_box_set_active(GTK_COMBO_BOX(subject_entry), -1);
        if (prefs_common.summary_search_subject_history)
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               combobox_set_popdown_strings(GTK_COMBO_BOX(subject_entry),
-                               prefs_common.summary_search_subject_history);
-#else
                combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(subject_entry),
                                prefs_common.summary_search_subject_history);
-#endif
        gtk_widget_show (subject_entry);
        gtk_table_attach (GTK_TABLE (table1), subject_entry, 1, 3, 2, 3,
                          GTK_EXPAND|GTK_FILL, 0, 0, 0);
@@ -413,20 +374,11 @@ static void summary_search_create(void)
        g_signal_connect(G_OBJECT(gtk_bin_get_child(GTK_BIN((subject_entry)))),
                         "focus_out_event", G_CALLBACK(subject_entry_focus_evt_out), NULL);
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       body_entry = gtk_combo_box_entry_new_text ();
-#else
        body_entry = gtk_combo_box_text_new_with_entry ();
-#endif
        gtk_combo_box_set_active(GTK_COMBO_BOX(body_entry), -1);
        if (prefs_common.summary_search_body_history)
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               combobox_set_popdown_strings(GTK_COMBO_BOX(body_entry),
-                               prefs_common.summary_search_body_history);
-#else
                combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(body_entry),
                                prefs_common.summary_search_body_history);
-#endif
        gtk_widget_show (body_entry);
        gtk_table_attach (GTK_TABLE (table1), body_entry, 1, 3, 3, 4,
                          GTK_EXPAND|GTK_FILL, 0, 0, 0);
@@ -437,20 +389,11 @@ static void summary_search_create(void)
        g_signal_connect(G_OBJECT(gtk_bin_get_child(GTK_BIN((body_entry)))),
                         "focus_out_event", G_CALLBACK(body_entry_focus_evt_out), NULL);
 
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       adv_condition_entry = gtk_combo_box_entry_new_text ();
-#else
        adv_condition_entry = gtk_combo_box_text_new_with_entry ();
-#endif
        gtk_combo_box_set_active(GTK_COMBO_BOX(adv_condition_entry), -1);
        if (prefs_common.summary_search_adv_condition_history)
-#if !GTK_CHECK_VERSION(2, 24, 0)
-               combobox_set_popdown_strings(GTK_COMBO_BOX(adv_condition_entry),
-                               prefs_common.summary_search_adv_condition_history);
-#else
                combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(adv_condition_entry),
                                prefs_common.summary_search_adv_condition_history);
-#endif
        gtk_widget_show (adv_condition_entry);
        gtk_table_attach (GTK_TABLE (table1), adv_condition_entry, 1, 2, 4, 5,
                          GTK_EXPAND|GTK_FILL, 0, 0, 0);
@@ -965,11 +908,7 @@ static void adv_condition_btn_clicked(GtkButton *button, gpointer data)
 
        /* re-use the current search value if it's a condition expression,
           otherwise ignore it silently */
-#if !GTK_CHECK_VERSION(2, 24, 0)
-       cond_str = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.adv_condition_entry));
-#else
        cond_str = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(search_window.adv_condition_entry));
-#endif
        if (cond_str && *cond_str != '\0') {
                matchers = matcher_parser_get_cond((gchar*)cond_str, NULL);
        }