[pan2] Since we're requiring glib 2.14 and gtk 1.12, we can remove a lot of GLIB_CHECK_VERSION and GTK_CHEC



commit fb1c0c58cd76c8db0a67eae0b8ea899f00618a85
Author: Charles Kerr <charles rebelbase com>
Date:   Mon Sep 28 16:48:15 2009 -0500

    Since we're requiring glib 2.14 and gtk 1.12, we can remove a lot of GLIB_CHECK_VERSION and GTK_CHECK_VERSION calls

 pan/general/file-util.cc      |   68 -----------------------------------------
 pan/general/file-util.h       |    8 +----
 pan/gui/actions.cc            |   11 ------
 pan/gui/body-pane.cc          |   12 +------
 pan/gui/group-pane.cc         |    4 --
 pan/gui/group-prefs-dialog.cc |   13 --------
 pan/gui/gui.cc                |   58 +++-------------------------------
 pan/gui/header-pane.cc        |    8 -----
 pan/gui/hig.cc                |    7 ----
 pan/gui/pad.h                 |    4 --
 pan/gui/pan-tree.h            |    4 --
 pan/gui/post-ui.cc            |   23 +------------
 pan/gui/prefs-ui.cc           |   13 --------
 pan/gui/profiles-dialog.cc    |   10 ++----
 pan/gui/progress-view.cc      |    2 -
 pan/gui/score-add-ui.cc       |    4 --
 pan/gui/score-view-ui.cc      |    8 +---
 pan/gui/server-ui.cc          |   20 +++++-------
 pan/gui/task-pane.cc          |    8 ++---
 19 files changed, 27 insertions(+), 258 deletions(-)
---
diff --git a/pan/general/file-util.cc b/pan/general/file-util.cc
index 0e0b28a..4945d83 100644
--- a/pan/general/file-util.cc
+++ b/pan/general/file-util.cc
@@ -75,37 +75,6 @@ file :: pan_strerror (int error_number)
   return pch && *pch ? pch : "";
 }
 
-#if !GLIB_CHECK_VERSION(2,8,0)
-static int
-pan_mkdir (const char * path, gulong mode)
-{
-  int retval = 0;
-
-  pan_return_val_if_fail (is_nonempty_string(path), retval);
-
-  if (strlen(path)==2 && isalpha((guchar)path[0]) && path[1]==':')
-  {
-    /* smells like a windows pathname.. skipping */
-  }
-  else
-  {
-    errno = 0;
-#if GLIB_CHECK_VERSION(2,6,0)
-    retval = g_mkdir (path, mode);
-#elif defined(G_OS_WIN32)
-    retval = mkdir (path);
-#else
-    retval = mkdir (path, mode);
-#endif
-    if (errno == EEXIST)
-      retval = 0;
-  }
-	
-  return retval;
-}
-#endif
-
-
 bool
 file :: ensure_dir_exists (const StringView& dirname_sv)
 {
@@ -116,44 +85,7 @@ file :: ensure_dir_exists (const StringView& dirname_sv)
 
   const std::string dirname (dirname_sv.to_string());
   if (!g_file_test (dirname.c_str(), G_FILE_TEST_IS_DIR))
-  {
-#if GLIB_CHECK_VERSION(2,8,0)
     retval = !g_mkdir_with_parents (dirname.c_str(), 0755);
-#else
-    const char * in = dirname.c_str();
-    char * buf = g_new (char, dirname.size()+1);
-    char * out = buf;
-
-    *out++ = *in++;
-    for (;;)
-    {
-      if (*in=='\0' || *in==G_DIR_SEPARATOR)
-      {
-        *out = '\0';
-
-        if (!g_file_test (buf, G_FILE_TEST_IS_DIR))
-        {
-          Log :: add_info_va (_("Creating directory \"%s\""), buf);
-          if (pan_mkdir (buf, 0755))
-          {
-            Log::add_err_va (_("Couldn't create directory \"%s\": %s"), buf, pan_strerror (errno));
-            retval = FALSE;
-            break;
-          }
-        }
-      }
-
-      *out = *in;
-      if (!*in)
-        break;
-
-      ++out;
-      ++in;
-    }
-
-    g_free (buf);
-#endif
-  }
 
   return retval;
 }
diff --git a/pan/general/file-util.h b/pan/general/file-util.h
index 4506993..a81f751 100644
--- a/pan/general/file-util.h
+++ b/pan/general/file-util.h
@@ -26,15 +26,10 @@ extern "C" {
   #include <stddef.h>
   #include <stdio.h>
   #include <glib/gtypes.h>
+  #include <glib/gstdio.h>
 }
 #include <pan/general/string-view.h>
 
-#include <glibconfig.h> // get the version number
-#include <glib/gutils.h> // get GLIB_CHECK_VERSION
-#if GLIB_CHECK_VERSION(2,6,0)
-extern "C" {
-  #include <glib/gstdio.h>
-}
 #define g_freopen freopen
 #define g_fopen fopen
 #define g_rmdir rmdir
@@ -44,7 +39,6 @@ extern "C" {
 #define g_stat stat
 #define g_rename rename
 #define g_open open
-#endif
 
 namespace pan
 {
diff --git a/pan/gui/actions.cc b/pan/gui/actions.cc
index 7fb68b3..b65f1e2 100644
--- a/pan/gui/actions.cc
+++ b/pan/gui/actions.cc
@@ -29,10 +29,6 @@ extern "C" {
 #include "pad.h"
 #include "gui.h"
 
-#if !GTK_CHECK_VERSION(2,6,0)
-#define GTK_STOCK_EDIT GTK_STOCK_OPEN
-#endif
-
 using pan::PanUI;
 
 namespace
@@ -596,17 +592,10 @@ namespace
       NULL,
       G_CALLBACK(do_tip_jar) },
 
-#if GTK_CHECK_VERSION(2,6,0)
     { "about-pan", GTK_STOCK_ABOUT,
       N_("_About"), NULL, 
       NULL,
       G_CALLBACK(do_about_pan) }
-#else
-    { "about-pan", NULL,
-      N_("_About"), NULL, 
-      NULL,
-      G_CALLBACK(do_about_pan) }
-#endif
   };
 
   void prefs_toggle_callback_impl (GtkToggleAction * action)
diff --git a/pan/gui/body-pane.cc b/pan/gui/body-pane.cc
index 7501eb0..fec86c7 100644
--- a/pan/gui/body-pane.cc
+++ b/pan/gui/body-pane.cc
@@ -1063,10 +1063,8 @@ BodyPane :: set_text_from_message (GMimeMessage * message)
   s.resize (s.size()-1); // remove trailing linefeed
   gtk_label_set_markup (GTK_LABEL(_headers), s.c_str());
 
-#if GTK_CHECK_VERSION(2,6,0)
   // ellipsize mode is useless w/o this in expander...
   gtk_label_set_width_chars (GTK_LABEL(_headers), (int)w);
-#endif
 
   // set the x-face...
   GdkPixbuf * pixbuf (0);
@@ -1085,10 +1083,8 @@ BodyPane :: set_text_from_message (GMimeMessage * message)
   s += _(" at ");
   add_bold_header_value (s, message, "Date", fallback_charset);
   gtk_label_set_markup (GTK_LABEL(_terse), s.c_str());
-#if GTK_CHECK_VERSION(2,6,0)
   // ellipsize mode is useless w/o this in expander...
   gtk_label_set_width_chars (GTK_LABEL(_terse), (int)s.size());
-#endif
 
   // clear the text buffer...
   GtkTextIter start, end;
@@ -1359,23 +1355,19 @@ BodyPane :: BodyPane (Data& data, ArticleCache& cache, Prefs& prefs):
   gtk_box_pack_start (GTK_BOX(vbox), w, false, false, 0);
 
   _terse = gtk_label_new ("Expander");
-  g_object_ref_sink_pan (G_OBJECT(_terse));
+  g_object_ref_sink (G_OBJECT(_terse));
   gtk_misc_set_alignment (GTK_MISC(_terse), 0.0f, 0.5f);
   gtk_label_set_use_markup (GTK_LABEL(_terse), true);
   gtk_label_set_selectable (GTK_LABEL(_terse), true);
-#if GTK_CHECK_VERSION(2,6,0)
   gtk_label_set_ellipsize (GTK_LABEL(_terse), PANGO_ELLIPSIZE_MIDDLE);
-#endif
   gtk_widget_show (_terse);
 
   GtkWidget * hbox = _verbose = gtk_hbox_new (false, 0);
-  g_object_ref_sink_pan (G_OBJECT(_verbose));
+  g_object_ref_sink (G_OBJECT(_verbose));
   w = _headers = gtk_label_new ("Headers");
   gtk_label_set_selectable (GTK_LABEL(_headers), TRUE);
   gtk_misc_set_alignment (GTK_MISC(w), 0.0f, 0.5f);
-#if GTK_CHECK_VERSION(2,6,0)
   gtk_label_set_ellipsize (GTK_LABEL(w), PANGO_ELLIPSIZE_MIDDLE);
-#endif
   gtk_label_set_use_markup (GTK_LABEL(w), true);
   gtk_box_pack_start (GTK_BOX(hbox), w, true, true, PAD_SMALL);
   w = _xface = gtk_image_new ();
diff --git a/pan/gui/group-pane.cc b/pan/gui/group-pane.cc
index 82c0582..c10aba3 100644
--- a/pan/gui/group-pane.cc
+++ b/pan/gui/group-pane.cc
@@ -845,12 +845,8 @@ GroupPane :: GroupPane (ActionManager& action_manager, Data& data, Prefs& prefs)
   g_object_unref (G_OBJECT(_tree_store)); // will die with the view
   gtk_tree_view_set_enable_search (GTK_TREE_VIEW(_tree_view), false);
   gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(_tree_view), false);
-#if GTK_CHECK_VERSION(2,8,0)
   gtk_tree_view_set_fixed_height_mode (GTK_TREE_VIEW(_tree_view), true);
-#endif
-#if GTK_CHECK_VERSION(2,10,0)
   gtk_tree_view_set_rubber_banding (GTK_TREE_VIEW(_tree_view), true);
-#endif
   expand_iterators (iters, GTK_TREE_MODEL(_tree_store), GTK_TREE_VIEW(_tree_view));
 
   GtkTreeSelection * selection (gtk_tree_view_get_selection (GTK_TREE_VIEW(_tree_view)));
diff --git a/pan/gui/group-prefs-dialog.cc b/pan/gui/group-prefs-dialog.cc
index 731f1cd..444beca 100644
--- a/pan/gui/group-prefs-dialog.cc
+++ b/pan/gui/group-prefs-dialog.cc
@@ -39,19 +39,6 @@ namespace
   {
     delete static_cast<GroupPrefsDialog*>(castme);
   }
-
-#if !GTK_CHECK_VERSION(2,6,0)
-  char* gtk_combo_box_get_active_text (GtkComboBox * combo_box)
-  {
-    char * text (0);
-    GtkTreeIter  iter;
-    if (gtk_combo_box_get_active_iter (combo_box, &iter)) {
-      GtkTreeModel * model = gtk_combo_box_get_model (combo_box);
-      gtk_tree_model_get (model, &iter, 0, &text, -1);
-    }
-    return text;
-  }
-#endif
 }
 
 void
diff --git a/pan/gui/gui.cc b/pan/gui/gui.cc
index 6ec5114..ec39739 100644
--- a/pan/gui/gui.cc
+++ b/pan/gui/gui.cc
@@ -64,30 +64,6 @@ extern "C" {
 namespace pan
 {
   void
-  g_object_ref_sink_pan (GObject * o)
-  {
-#if GLIB_CHECK_VERSION(2,10,0)
-    g_object_ref_sink (o);
-#else
-    g_object_ref (o);
-    gtk_object_sink (GTK_OBJECT(o));
-#endif
-  }
-
-  void
-  pan_widget_set_tooltip_text( GtkWidget * w, const char * tip )
-  {
-#if GTK_CHECK_VERSION( 2,12,0 )
-    gtk_widget_set_tooltip_text( w, tip );
-#else
-    static GtkTooltips * tips = NULL;
-    if( tips == NULL )
-        tips = gtk_tooltips_new( );
-    gtk_tooltips_set_tip( tips, w, tip, NULL );
-#endif
-  }
-
-  void
   pan_box_pack_start_defaults (GtkBox * box, GtkWidget * child)
   {
     gtk_box_pack_start( box, child, TRUE, TRUE, 0 );
@@ -271,7 +247,7 @@ GUI :: GUI (Data& data, Queue& queue, ArticleCache& cache, Prefs& prefs, GroupPr
   w = _queue_size_label = gtk_label_new (NULL);
   gtk_misc_set_padding (GTK_MISC(w), PAD, 0);
   w = _queue_size_button = gtk_button_new();
-  pan_widget_set_tooltip_text (w, _("Open the Task Manager"));
+  gtk_widget_set_tooltip_text (w, _("Open the Task Manager"));
   gtk_button_set_relief (GTK_BUTTON(w), GTK_RELIEF_NONE);
   g_signal_connect (GTK_OBJECT(w), "clicked", G_CALLBACK(show_task_window_cb), this);
   gtk_container_add (GTK_CONTAINER(w), _queue_size_label);
@@ -293,7 +269,7 @@ GUI :: GUI (Data& data, Queue& queue, ArticleCache& cache, Prefs& prefs, GroupPr
 
   // status 
   w = _event_log_button = gtk_button_new ();
-  pan_widget_set_tooltip_text (w, _("Open the Event Log"));
+  gtk_widget_set_tooltip_text (w, _("Open the Event Log"));
   gtk_button_set_relief (GTK_BUTTON(w), GTK_RELIEF_NONE);
   gtk_box_pack_start (GTK_BOX(status_bar), w, false, false, 0);
   gtk_container_add (GTK_CONTAINER(w), _info_image);
@@ -309,8 +285,8 @@ GUI :: GUI (Data& data, Queue& queue, ArticleCache& cache, Prefs& prefs, GroupPr
   _queue.add_listener (this);
   Log::get().add_listener (this);
 
-  g_object_ref_sink_pan (G_OBJECT(_info_image));
-  g_object_ref_sink_pan (G_OBJECT(_error_image));
+  g_object_ref_sink (G_OBJECT(_info_image));
+  g_object_ref_sink (G_OBJECT(_error_image));
   g_object_ref (_group_pane->root());
   g_object_ref (_header_pane->root());
   g_object_ref (_body_pane->root());
@@ -1256,15 +1232,10 @@ void GUI :: do_tip_jar ()
 }
 void GUI :: do_about_pan ()
 {
-#if GTK_CHECK_VERSION(2,6,0)
   const gchar * authors [] = { "Charles Kerr <charles rebelbase com>", "Calin Culianu <calin ajvar org> - Threaded Decoding", 0 };
   GdkPixbuf * logo = gdk_pixbuf_new_from_inline(-1, icon_pan_about_logo, 0, 0);
   GtkAboutDialog * w (GTK_ABOUT_DIALOG (gtk_about_dialog_new ()));
-#if GTK_CHECK_VERSION(2,12,0)
   gtk_about_dialog_set_program_name (w, _("Pan"));
-#else
-  gtk_about_dialog_set_name (w, _("Pan"));
-#endif
   gtk_about_dialog_set_version (w, PACKAGE_VERSION);
   gtk_about_dialog_set_comments (w, VERSION_TITLE);
   gtk_about_dialog_set_copyright (w, _("Copyright © 2002-2007 Charles Kerr"));
@@ -1276,23 +1247,6 @@ void GUI :: do_about_pan ()
   g_signal_connect (G_OBJECT (w), "response", G_CALLBACK (gtk_widget_destroy), NULL);
   gtk_widget_show_all (GTK_WIDGET(w));
   g_object_unref (logo);
-#else
-  GtkWidget * dialog = gtk_dialog_new_with_buttons (PACKAGE_STRING,
-                                                    GTK_WINDOW (get_window (_root)),
-                                                    GtkDialogFlags (GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT),
-                                                    GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
-                                                    NULL);
-  GdkPixbuf * logo = gdk_pixbuf_new_from_inline(-1, icon_pan_about_logo, 0, 0);
-  GtkBox * box = GTK_BOX(GTK_DIALOG(dialog)->vbox);
-  gtk_box_pack_start (box, gtk_image_new_from_pixbuf (logo), false, false, PAD);
-  gtk_box_pack_start (box, gtk_label_new("Pan " PACKAGE_VERSION), false, false, PAD);
-  gtk_box_pack_start (box, gtk_label_new(VERSION_TITLE), false, false, 0);
-  gtk_box_pack_start (box, gtk_label_new(_("Copyright © 2002-2007 Charles Kerr")), false, false, 0);
-  gtk_box_pack_start (box, gtk_label_new("http://pan.rebelbase.com/";), false, false, PAD);
-  gtk_widget_show_all (dialog);
-  g_signal_connect_swapped (dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog);
-  g_object_unref (logo);
-#endif
 }
 
 void GUI :: do_work_online (bool b)
@@ -1726,7 +1680,7 @@ GUI :: refresh_connection_label ()
   }
 
   gtk_label_set_text (GTK_LABEL(_connection_size_label), str);
-  pan_widget_set_tooltip_text (_connection_size_eventbox, tip);
+  gtk_widget_set_tooltip_text (_connection_size_eventbox, tip);
 }
 
 namespace
@@ -1781,7 +1735,7 @@ GUI :: set_queue_size_label (unsigned int running,
 
   // update the gui
   gtk_label_set_text (GTK_LABEL(_queue_size_label), str);
-  pan_widget_set_tooltip_text (_queue_size_button, tip);
+  gtk_widget_set_tooltip_text (_queue_size_button, tip);
 }
 
 void
diff --git a/pan/gui/header-pane.cc b/pan/gui/header-pane.cc
index 489cb0f..961a8b4 100644
--- a/pan/gui/header-pane.cc
+++ b/pan/gui/header-pane.cc
@@ -647,7 +647,6 @@ HeaderPane :: on_tree_change (const Data::ArticleTree::Diffs& diffs)
   // if the old selection survived,
   // is it visible on the screen?
   bool selection_was_visible (true);
-#if GTK_CHECK_VERSION(2,8,0)
   if (!new_selection.empty()) {
     GtkTreeView *view (GTK_TREE_VIEW(_tree_view));
     Row * row (get_row (*new_selection.begin()));
@@ -659,7 +658,6 @@ HeaderPane :: on_tree_change (const Data::ArticleTree::Diffs& diffs)
     gtk_tree_path_free (b);
     gtk_tree_path_free (p);
   }
-#endif
 
   // if none of the current selection survived,
   // we need to select something to replace the
@@ -1289,9 +1287,7 @@ namespace
 
   void ellipsize_if_supported (GObject * o)
   {
-#if GTK_CHECK_VERSION(2,6,0)
     g_object_set (o, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
-#endif
   }
 }
 
@@ -1598,12 +1594,8 @@ HeaderPane :: HeaderPane (ActionManager       & action_manager,
   // build the view...
   GtkWidget * w = _tree_view = gtk_tree_view_new ();
   gtk_tree_view_set_enable_search (GTK_TREE_VIEW(w), false);
-#if GTK_CHECK_VERSION(2,8,0)
   gtk_tree_view_set_fixed_height_mode (GTK_TREE_VIEW(w), true);
-#endif
-#if GTK_CHECK_VERSION(2,10,0)
   gtk_tree_view_set_rubber_banding (GTK_TREE_VIEW(w), true);
-#endif
 
   GtkTreeSelection * sel = gtk_tree_view_get_selection (GTK_TREE_VIEW(w));
   gtk_tree_selection_set_mode (sel, GTK_SELECTION_MULTIPLE);
diff --git a/pan/gui/hig.cc b/pan/gui/hig.cc
index 4c34272..918adac 100644
--- a/pan/gui/hig.cc
+++ b/pan/gui/hig.cc
@@ -190,13 +190,6 @@ HIG :: message_dialog_set_text (GtkMessageDialog * dialog,
                                 const char * primary,
                                 const char * secondary)
 {
-#if GTK_CHECK_VERSION(2,6,0)
   gtk_message_dialog_set_markup (dialog, primary);
   gtk_message_dialog_format_secondary_text (dialog, "%s", secondary);
-#else
-  char * pch = g_strdup_printf ("<b>%s</b>\n \n%s", primary, secondary);
-  gtk_message_dialog_set_markup (dialog, pch);
-  g_free (pch);
-#endif
 }
-
diff --git a/pan/gui/pad.h b/pan/gui/pad.h
index 6d8726d..73d89c4 100644
--- a/pan/gui/pad.h
+++ b/pan/gui/pad.h
@@ -3,10 +3,6 @@
 
 namespace pan
 {
-  extern void g_object_ref_sink_pan (GObject*);
-
-  extern void pan_widget_set_tooltip_text (GtkWidget * w, const char * tip);
-
   extern void pan_box_pack_start_defaults (GtkBox * box, GtkWidget * child);
 };
 
diff --git a/pan/gui/pan-tree.h b/pan/gui/pan-tree.h
index ed2c0c9..7bafb96 100644
--- a/pan/gui/pan-tree.h
+++ b/pan/gui/pan-tree.h
@@ -24,10 +24,6 @@
 #include <vector>
 #include <gtk/gtk.h>
 
-#if !GTK_CHECK_VERSION(2,6,0)
-#define GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID (-2)
-#endif
-
 #define PAN_TREE_STORE_TYPE (PanTreeStore::get_type())
 #define PAN_TREE_STORE(obj) \
     (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAN_TREE_STORE_TYPE, PanTreeStore))
diff --git a/pan/gui/post-ui.cc b/pan/gui/post-ui.cc
index fa88215..4fe1b05 100644
--- a/pan/gui/post-ui.cc
+++ b/pan/gui/post-ui.cc
@@ -53,10 +53,6 @@ extern "C" {
 #define DEFAULT_SPELLCHECK_FLAG false
 #endif
 
-#if !GTK_CHECK_VERSION(2,6,0)
-#define GTK_STOCK_EDIT GTK_STOCK_OPEN
-#endif
-
 using namespace pan;
 
 #define USER_AGENT_PREFS_KEY "add-user-agent-header-when-posting"
@@ -459,21 +455,6 @@ namespace
   }
 }
 
-namespace
-{
-#if !GTK_CHECK_VERSION(2,6,0)
-  char* gtk_combo_box_get_active_text (GtkComboBox * combo_box) {
-    char * text (0);
-    GtkTreeIter  iter;
-    if (gtk_combo_box_get_active_iter (combo_box, &iter)) {
-      GtkTreeModel * model = gtk_combo_box_get_model (combo_box);
-      gtk_tree_model_get (model, &iter, 0, &text, -1);
-    }
-    return text;
-  }
-#endif
-}
-
 void
 PostUI :: send_now ()
 {
@@ -1770,7 +1751,7 @@ PostUI :: create_extras_tab ()
   w = _followupto_entry = gtk_entry_new ();
   gtk_label_set_mnemonic_widget (GTK_LABEL(l), w);
   /* i18n: "poster" is a key used by many newsreaders.  probably safest to keep this key in english. */
-pan_widget_set_tooltip_text (w, _("The newsgroups where replies to your message should go.  This is only needed if it differs from the \"Newsgroups\" header.\n\nTo direct all replies to your email address, use \"Followup-To: poster\""));
+gtk_widget_set_tooltip_text (w, _("The newsgroups where replies to your message should go.  This is only needed if it differs from the \"Newsgroups\" header.\n\nTo direct all replies to your email address, use \"Followup-To: poster\""));
   gtk_table_attach (GTK_TABLE(t), w, 1, 2, row, row+1, fe, fill, 0, 0);
 
   //  Reply-To
@@ -1784,7 +1765,7 @@ pan_widget_set_tooltip_text (w, _("The newsgroups where replies to your message
 
   w = _replyto_entry = gtk_entry_new ();
   gtk_label_set_mnemonic_widget (GTK_LABEL(l), w);
-pan_widget_set_tooltip_text (w, _("The email account where mail replies to your posted message should go.  This is only needed if it differs from the \"From\" header."));
+gtk_widget_set_tooltip_text (w, _("The email account where mail replies to your posted message should go.  This is only needed if it differs from the \"From\" header."));
   gtk_table_attach (GTK_TABLE(t), w, 1, 2, row, row+1, fe, fill, 0, 0);
 
   //  Extra Headers
diff --git a/pan/gui/prefs-ui.cc b/pan/gui/prefs-ui.cc
index 62fac28..0467273 100644
--- a/pan/gui/prefs-ui.cc
+++ b/pan/gui/prefs-ui.cc
@@ -41,19 +41,6 @@ namespace
     delete static_cast<PrefsDialog*>(castme);
   }
 
-#if !GTK_CHECK_VERSION(2,6,0)
-  char* gtk_combo_box_get_active_text (GtkComboBox * combo_box)
-  {
-    char * text (0);
-    GtkTreeIter  iter;
-    if (gtk_combo_box_get_active_iter (combo_box, &iter)) {
-      GtkTreeModel * model = gtk_combo_box_get_model (combo_box);
-      gtk_tree_model_get (model, &iter, 0, &text, -1);
-    }
-    return text;
-  }
-#endif
-
   void response_cb (GtkDialog * dialog, int, gpointer)
   {
     gtk_widget_destroy (GTK_WIDGET(dialog));
diff --git a/pan/gui/profiles-dialog.cc b/pan/gui/profiles-dialog.cc
index 8f613b3..08df307 100644
--- a/pan/gui/profiles-dialog.cc
+++ b/pan/gui/profiles-dialog.cc
@@ -163,12 +163,12 @@ ProfileDialog :: ProfileDialog (const Data         & data,
 
     w = _msgid_fqdn_entry = gtk_entry_new ();
     set_entry (w, profile.fqdn);
-    pan_widget_set_tooltip_text (w, _("When posting to Usenet, your article's Message-ID contains a domain name.  You can set a custom domain name here, or leave it blank to let Pan use the domain name from your email address."));
+    gtk_widget_set_tooltip_text (w, _("When posting to Usenet, your article's Message-ID contains a domain name.  You can set a custom domain name here, or leave it blank to let Pan use the domain name from your email address."));
     HIG :: workarea_add_row (t, &row, _("Message-ID _Domain Name:"), w, NULL);
 
     w = _attribution_entry = gtk_entry_new ();
     set_entry (w, profile.attribution);
-    pan_widget_set_tooltip_text (w, _("%i for Message-ID\n%a for Author and Address\n%n for Author name\n%d for Date"));
+    gtk_widget_set_tooltip_text (w, _("%i for Message-ID\n%a for Author and Address\n%n for Author name\n%d for Date"));
     HIG :: workarea_add_row (t, &row, _("_Attribution:"), w, NULL);
 
 
@@ -192,7 +192,7 @@ ProfileDialog :: ProfileDialog (const Data         & data,
       s += it->first + ": " + it->second + "\n";
     gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW(w)), s.c_str(), s.size());
     GtkWidget * eventbox = gtk_event_box_new ();
-    pan_widget_set_tooltip_text (eventbox, _("Extra headers to be included in your posts, such as\nReply-To: \"Your Name\" <yourname somewhere com>\nOrganization: Your Organization"));
+    gtk_widget_set_tooltip_text (eventbox, _("Extra headers to be included in your posts, such as\nReply-To: \"Your Name\" <yourname somewhere com>\nOrganization: Your Organization"));
     GtkWidget * scrolled_window = gtk_scrolled_window_new (NULL, NULL);
     gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(scrolled_window),
                                          GTK_SHADOW_IN);
@@ -479,11 +479,7 @@ ProfilesDialog :: ProfilesDialog (const Data& data, Profiles &profiles, GtkWindo
   g_signal_connect (GTK_OBJECT(w), "clicked", G_CALLBACK(on_add_button), this);
 
   // edit button
-#if GTK_CHECK_VERSION(2,6,0)
   w = gtk_button_new_from_stock (GTK_STOCK_EDIT);
-#else
-  w = gtk_button_new_from_stock (GTK_STOCK_OPEN);
-#endif
   _edit_button = w;
   gtk_box_pack_start (GTK_BOX (bbox), w, false, false, 0);
   g_signal_connect (GTK_OBJECT(w), "clicked", G_CALLBACK(on_edit_button), this);
diff --git a/pan/gui/progress-view.cc b/pan/gui/progress-view.cc
index 6d439eb..9478e77 100644
--- a/pan/gui/progress-view.cc
+++ b/pan/gui/progress-view.cc
@@ -33,9 +33,7 @@ ProgressView :: ProgressView ():
   _progressbar (gtk_progress_bar_new ()),
   _progress (0)
 {
-#if GTK_CHECK_VERSION(2,6,0)
   gtk_progress_bar_set_ellipsize (GTK_PROGRESS_BAR(_progressbar), PANGO_ELLIPSIZE_MIDDLE);
-#endif
   gtk_container_add (GTK_CONTAINER(_root), _progressbar);
   gtk_widget_show (_progressbar);
 }
diff --git a/pan/gui/score-add-ui.cc b/pan/gui/score-add-ui.cc
index 0479149..35b89d2 100644
--- a/pan/gui/score-add-ui.cc
+++ b/pan/gui/score-add-ui.cc
@@ -32,10 +32,6 @@ extern "C" {
 
 using namespace pan;
 
-#if !GTK_CHECK_VERSION(2,6,0)
-#define GTK_STOCK_EDIT GTK_STOCK_OPEN
-#endif
-
 /**
 *** Key - Value paired comboboxes
 **/
diff --git a/pan/gui/score-view-ui.cc b/pan/gui/score-view-ui.cc
index 0b48e08..edec714 100644
--- a/pan/gui/score-view-ui.cc
+++ b/pan/gui/score-view-ui.cc
@@ -27,10 +27,6 @@ extern "C" {
 #include "score-add-ui.h"
 #include "score-view-ui.h"
 
-#if !GTK_CHECK_VERSION(2,6,0)
-#define GTK_STOCK_EDIT GTK_STOCK_OPEN
-#endif
-
 using namespace pan;
 
 namespace
@@ -241,14 +237,14 @@ ScoreView :: ScoreView (Data& data, GtkWindow* parent,
   // add button
   w = gtk_button_new_from_stock (GTK_STOCK_ADD);
   gtk_box_pack_start (GTK_BOX (bbox), w, FALSE, FALSE, 0);
-  pan_widget_set_tooltip_text (w, _("Add a New Scoring Rule"));
+  gtk_widget_set_tooltip_text (w, _("Add a New Scoring Rule"));
   gtk_widget_show (w);
   g_signal_connect (w, "clicked", G_CALLBACK(this->add_clicked_cb), this);
 
   // remove button
   w = gtk_button_new_from_stock (GTK_STOCK_REMOVE);
   gtk_box_pack_start (GTK_BOX (bbox), w, FALSE, FALSE, 0);
-  pan_widget_set_tooltip_text (w, _("Remove the Selected Scoring Rule"));
+  gtk_widget_set_tooltip_text (w, _("Remove the Selected Scoring Rule"));
   gtk_widget_show (w);
   g_signal_connect (w, "clicked", G_CALLBACK(this->remove_clicked_cb), this);
 
diff --git a/pan/gui/server-ui.cc b/pan/gui/server-ui.cc
index 6a981c8..fa6dba8 100644
--- a/pan/gui/server-ui.cc
+++ b/pan/gui/server-ui.cc
@@ -223,12 +223,12 @@ pan :: server_edit_dialog_new (Data& data, Queue& queue, GtkWindow * window, con
     HIG::workarea_add_section_spacer (t, row, 2);
 
     GtkWidget * w = d->address_entry = gtk_entry_new ();
-    pan_widget_set_tooltip_text( w, _("The news server's actual address, e.g. \"news.mynewsserver.com\""));
+    gtk_widget_set_tooltip_text( w, _("The news server's actual address, e.g. \"news.mynewsserver.com\""));
     HIG::workarea_add_row (t, &row, _("_Address:"), w, NULL);
 
     GtkAdjustment * a = GTK_ADJUSTMENT (gtk_adjustment_new (1.0, 1.0, ULONG_MAX, 1.0, 1.0, 0.0));
     w = d->port_spin = gtk_spin_button_new (GTK_ADJUSTMENT(a), 1.0, 0u);
-    pan_widget_set_tooltip_text( w, _("The news server's port number.  Typically 119."));
+    gtk_widget_set_tooltip_text( w, _("The news server's port number.  Typically 119."));
     HIG::workarea_add_row (t, &row, _("Por_t:"), w, NULL);
 
   HIG::workarea_add_section_divider (t, &row);
@@ -237,12 +237,12 @@ pan :: server_edit_dialog_new (Data& data, Queue& queue, GtkWindow * window, con
 
     w = d->auth_username_entry = gtk_entry_new ();
     HIG::workarea_add_row (t, &row, _("_Username:"), w, NULL);
-    pan_widget_set_tooltip_text( w, _("The username to give the server when asked.  If your server doesn't require authentication, you can leave this blank."));
+    gtk_widget_set_tooltip_text( w, _("The username to give the server when asked.  If your server doesn't require authentication, you can leave this blank."));
 
     w = d->auth_password_entry = gtk_entry_new ();
     gtk_entry_set_visibility (GTK_ENTRY(w), FALSE);
     HIG::workarea_add_row (t, &row, _("_Password:"), w, NULL);
-    pan_widget_set_tooltip_text( w, _("The password to give the server when asked.  If your server doesn't require authentication, you can leave this blank."));
+    gtk_widget_set_tooltip_text( w, _("The password to give the server when asked.  If your server doesn't require authentication, you can leave this blank."));
 
   HIG::workarea_add_section_divider (t, &row);
   HIG::workarea_add_section_title (t, &row, _("Settings"));
@@ -295,7 +295,7 @@ pan :: server_edit_dialog_new (Data& data, Queue& queue, GtkWindow * window, con
     GtkWidget * e = gtk_event_box_new ();
     gtk_container_add (GTK_CONTAINER(e), l);
     gtk_misc_set_alignment (GTK_MISC(l), 0.0f, 0.5f);
-    pan_widget_set_tooltip_text( e, _("Fallback servers are used for articles that can't be found on the primaries.  One common approach is to use free servers as primaries and subscription servers as fallbacks."));
+    gtk_widget_set_tooltip_text( e, _("Fallback servers are used for articles that can't be found on the primaries.  One common approach is to use free servers as primaries and subscription servers as fallbacks."));
     HIG::workarea_add_row (t, &row, e, w);
 
   d->server = server;
@@ -536,24 +536,20 @@ pan :: server_list_dialog_new (Data& data, Queue& queue, GtkWindow* parent)
   // add button
   w = gtk_button_new_from_stock (GTK_STOCK_ADD);
   gtk_box_pack_start (GTK_BOX (bbox), w, FALSE, FALSE, 0);
-  pan_widget_set_tooltip_text(w, _("Add a Server"));
+  gtk_widget_set_tooltip_text(w, _("Add a Server"));
   g_signal_connect (w, "clicked", G_CALLBACK(add_button_clicked_cb), d->dialog);
 
   // edit button
-#if GTK_CHECK_VERSION(2,6,0)
   w = gtk_button_new_from_stock (GTK_STOCK_EDIT);
-#else
-  w = gtk_button_new_from_stock (GTK_STOCK_OPEN);
-#endif
   gtk_box_pack_start (GTK_BOX (bbox), w, FALSE, FALSE, 0);
-  pan_widget_set_tooltip_text(w, _("Edit a Server's Settings"));
+  gtk_widget_set_tooltip_text(w, _("Edit a Server's Settings"));
   g_signal_connect (w, "clicked", G_CALLBACK(edit_button_clicked_cb), d->dialog);
   d->edit_button = w;
 
   // remove button
   w = gtk_button_new_from_stock (GTK_STOCK_REMOVE);
   gtk_box_pack_start (GTK_BOX (bbox), w, FALSE, FALSE, 0);
-  pan_widget_set_tooltip_text(w, _("Remove a Server"));
+  gtk_widget_set_tooltip_text(w, _("Remove a Server"));
   g_signal_connect (w, "clicked", G_CALLBACK(remove_button_clicked_cb), d);
   d->remove_button = w;
 
diff --git a/pan/gui/task-pane.cc b/pan/gui/task-pane.cc
index f5ba2ea..15066e5 100644
--- a/pan/gui/task-pane.cc
+++ b/pan/gui/task-pane.cc
@@ -192,11 +192,9 @@ void TaskPane :: on_queue_online_changed (Queue&, bool online)
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(_online_toggle), online);
   g_signal_handler_unblock (_online_toggle, _online_toggle_handler);
 
-#if GTK_CHECK_VERSION(2,6,0)
   gtk_image_set_from_stock (GTK_IMAGE(_online_image),
                             online ? GTK_STOCK_CONNECT : GTK_STOCK_DISCONNECT,
                             GTK_ICON_SIZE_BUTTON);
-#endif
 }
 
 void
@@ -448,11 +446,11 @@ TaskPane :: TaskPane (Queue& queue, Prefs& prefs): _queue(queue)
     add_button (buttons, GTK_STOCK_GOTO_BOTTOM, G_CALLBACK(bottom_clicked_cb), this);
     gtk_box_pack_start (GTK_BOX(buttons), gtk_vseparator_new(), 0, 0, 0);
     w = add_button (buttons, GTK_STOCK_REDO, G_CALLBACK(restart_clicked_cb), this);
-    pan_widget_set_tooltip_text( w, _("Restart Tasks"));
+    gtk_widget_set_tooltip_text( w, _("Restart Tasks"));
     w = add_button (buttons, GTK_STOCK_STOP, G_CALLBACK(stop_clicked_cb), this);
-    pan_widget_set_tooltip_text( w, _("Stop Tasks"));
+    gtk_widget_set_tooltip_text( w, _("Stop Tasks"));
     w = add_button (buttons, GTK_STOCK_DELETE, G_CALLBACK(delete_clicked_cb), this);
-    pan_widget_set_tooltip_text( w, _("Delete Tasks"));
+    gtk_widget_set_tooltip_text( w, _("Delete Tasks"));
     gtk_box_pack_start (GTK_BOX(buttons), gtk_vseparator_new(), 0, 0, 0);
     w = add_button (buttons, GTK_STOCK_CLOSE, 0, 0);
     g_signal_connect_swapped (w, "clicked", G_CALLBACK(gtk_widget_destroy), _root);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]