[pan2] * gtk3 compiler cleanup * cleanups in various files * https://bugzilla.gnome.org/show_bug.cgi?id=651
- From: Heinrich MÃller <henmull src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pan2] * gtk3 compiler cleanup * cleanups in various files * https://bugzilla.gnome.org/show_bug.cgi?id=651
- Date: Sun, 15 Jul 2012 22:15:49 +0000 (UTC)
commit 56d4463b90a3274a7a614dcb2e31422664b602d2
Author: Heinrich MÃller <henmull src gnome org>
Date: Sat Jul 14 16:25:14 2012 +0200
* gtk3 compiler cleanup
* cleanups in various files
* https://bugzilla.gnome.org/show_bug.cgi?id=651306
pan.cbp | 5 ++
pan/data-impl/add-server.cc | 1 -
pan/general/Makefile.am | 3 +-
pan/general/singleton-template.h | 37 +++++++++++++++++
pan/gui/Makefile.am | 3 +-
pan/gui/body-pane.cc | 26 +++++++++---
pan/gui/e-charset-dialog.c | 4 +-
pan/gui/e-cte-dialog.c | 4 +-
pan/gui/group-pane.cc | 31 ++++++++------
pan/gui/group-prefs-dialog.cc | 14 +++---
pan/gui/gtk-compat.h | 79 +++++++++++++++++++++++++++++++++----
pan/gui/gui.cc | 16 +++----
pan/gui/pan-colors.h | 44 ++++++++++++++++++++
pan/gui/pan-file-entry.cc | 2 +-
pan/gui/pan.cc | 2 +-
pan/gui/post-ui.cc | 24 ++++++-----
pan/gui/prefs-file.cc | 2 +-
pan/gui/prefs-ui.cc | 79 ++++++++++++++++++++-----------------
pan/gui/prefs.cc | 62 ++++++++++++++++++++++++-----
pan/gui/prefs.h | 6 +-
pan/gui/profiles-dialog.cc | 11 +++--
pan/gui/save-attach-ui.cc | 6 +-
pan/gui/save-ui.cc | 6 +-
pan/gui/score-add-ui.cc | 8 ++--
pan/gui/score-view-ui.cc | 6 +-
pan/gui/server-ui.cc | 8 ++--
pan/gui/tango-colors.h | 2 -
pan/gui/task-pane.cc | 20 +++++-----
pan/usenet-utils/text-massager.cc | 8 ++--
pan/usenet-utils/text-massager.h | 2 +-
30 files changed, 369 insertions(+), 152 deletions(-)
---
diff --git a/pan.cbp b/pan.cbp
index e9dc378..704b4b4 100644
--- a/pan.cbp
+++ b/pan.cbp
@@ -109,6 +109,7 @@
<Unit filename="pan/data/xref-test.cc" />
<Unit filename="pan/data/xref.cc" />
<Unit filename="pan/data/xref.h" />
+ <Unit filename="pan/general/compression.h" />
<Unit filename="pan/general/debug.cc" />
<Unit filename="pan/general/debug.h" />
<Unit filename="pan/general/defgroup.h" />
@@ -136,6 +137,7 @@
<Unit filename="pan/general/quark-test.cc" />
<Unit filename="pan/general/quark.cc" />
<Unit filename="pan/general/quark.h" />
+ <Unit filename="pan/general/singleton-template.h" />
<Unit filename="pan/general/sorted-vector.h" />
<Unit filename="pan/general/string-view-test.cc" />
<Unit filename="pan/general/string-view.cc" />
@@ -199,6 +201,7 @@
<Unit filename="pan/gui/log-ui.cc" />
<Unit filename="pan/gui/log-ui.h" />
<Unit filename="pan/gui/pad.h" />
+ <Unit filename="pan/gui/pan-colors.h" />
<Unit filename="pan/gui/pan-file-entry.cc" />
<Unit filename="pan/gui/pan-file-entry.h" />
<Unit filename="pan/gui/pan-pixbufs.c">
@@ -300,6 +303,8 @@
<Unit filename="pan/tasks/task.h" />
<Unit filename="pan/tasks/upload-queue.cc" />
<Unit filename="pan/tasks/upload-queue.h" />
+ <Unit filename="pan/tasks/xzver-decoder.cc" />
+ <Unit filename="pan/tasks/xzver-decoder.h" />
<Unit filename="pan/usenet-utils/MersenneTwister.h" />
<Unit filename="pan/usenet-utils/blowfish.cc" />
<Unit filename="pan/usenet-utils/blowfish.h" />
diff --git a/pan/data-impl/add-server.cc b/pan/data-impl/add-server.cc
index 92d8797..5b6caee 100644
--- a/pan/data-impl/add-server.cc
+++ b/pan/data-impl/add-server.cc
@@ -62,7 +62,6 @@ int main (int argc, char *argv[])
// TaskArchive null_task_archive;
// WorkerPool pool;
// CertStore cs;
-// // FIXME : adapt!
// SocketCreator _socket_creator(cs);
// Queue queue (data, null_task_archive, &_socket_creator, cs, pool, true, 10);
// queue.add_task (new TaskGroups (data, servername));
diff --git a/pan/general/Makefile.am b/pan/general/Makefile.am
index 9251e7d..8fe2db7 100644
--- a/pan/general/Makefile.am
+++ b/pan/general/Makefile.am
@@ -36,7 +36,8 @@ noinst_HEADERS = \
time-elapsed.h \
utf8-utils.h \
worker-pool.h \
- typedefs.h
+ typedefs.h \
+ singleton-template.h
#noinst_PROGRAMS = \
# progress-test \
diff --git a/pan/general/singleton-template.h b/pan/general/singleton-template.h
new file mode 100644
index 0000000..022d5ce
--- /dev/null
+++ b/pan/general/singleton-template.h
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * Pan - A Newsreader for Gtk+
+ * Copyright (C) 2002-2006 Charles Kerr <charles rebelbase com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+
+template <class T_DERIVED>
+class PanSingleton
+{
+ public:
+ static T_DERIVED& get()
+ {
+ static T_DERIVED oInstance ;
+ return oInstance ;
+ }
+
+ protected:
+ PanSingleton(){}
+
+ private:
+ PanSingleton( const PanSingleton& ) ;
+ PanSingleton& operator=( const PanSingleton& ) {return *this;}
+} ;
diff --git a/pan/gui/Makefile.am b/pan/gui/Makefile.am
index 39cac93..67c0090 100644
--- a/pan/gui/Makefile.am
+++ b/pan/gui/Makefile.am
@@ -83,7 +83,8 @@ noinst_HEADERS = \
taskpane.ui.h \
url.h \
wait.h \
- xface.h
+ xface.h \
+ pan-colors.h
EXTRA_DIST = \
panrc.rc
diff --git a/pan/gui/body-pane.cc b/pan/gui/body-pane.cc
index f1b8493..0ba27e1 100644
--- a/pan/gui/body-pane.cc
+++ b/pan/gui/body-pane.cc
@@ -196,7 +196,7 @@ namespace
void free_cursors (void)
{
for (int i=0; i<CURSOR_QTY; ++i)
- gdk_cursor_unref (cursors[i]);
+ cursor_unref (cursors[i]);
}
void ensure_cursors_created (GtkWidget * w)
@@ -321,7 +321,7 @@ namespace
{
int x, y;
if (event->is_hint)
- gdk_window_get_pointer (event->window, &x, &y, NULL);
+ gdk_window_get_device_position (event->window, event->device, &x, &y, NULL);
else {
x = (int) event->x;
y = (int) event->y;
@@ -454,6 +454,7 @@ BodyPane :: mouse_button_pressed (GtkWidget *w, GdkEventButton *event)
const bool fullsize (toggle_fullsize_flag (buf));
GtkAllocation aloc;
gtk_widget_get_allocation(w, &aloc);
+// std::cerr<<"457 alloc "<<aloc.x<<" "<<aloc.y<<" "<<aloc.width<<" "<<aloc.height<<"\n";
resize_picture_at_iter (buf, &iter, fullsize, &aloc, pix_tag);
gtk_text_iter_set_offset (&iter, offset);
set_cursor_from_iter (event->window, w, &iter);
@@ -475,6 +476,7 @@ BodyPane :: mouse_button_pressed (GtkWidget *w, GdkEventButton *event)
***/
namespace
{
+
GtkTextTag* get_or_create_tag (GtkTextTagTable * table, const char * key)
{
g_assert (table);
@@ -492,9 +494,14 @@ namespace
void
set_text_buffer_tags (GtkTextBuffer * buffer, const Prefs& p)
{
+ const PanColors& colors (PanColors::get());
+ const std::string& bg (colors.def_bg);
+
GtkTextTagTable * table = gtk_text_buffer_get_tag_table (buffer);
+
get_or_create_tag (table, "pixbuf");
get_or_create_tag (table, "quote_0");
+
g_object_set (get_or_create_tag(table,"bold"),
"weight", PANGO_WEIGHT_BOLD,
NULL);
@@ -507,18 +514,23 @@ namespace
g_object_set (get_or_create_tag (table, "url"),
"underline", PANGO_UNDERLINE_SINGLE,
"foreground", p.get_color_str ("body-pane-color-url", TANGO_SKY_BLUE_DARK).c_str(),
+ "background", p.get_color_str ("body-pane-color-url-bg", bg).c_str(),
NULL);
g_object_set (get_or_create_tag (table, "quote_1"),
"foreground", p.get_color_str ("body-pane-color-quote-1", TANGO_CHAMELEON_DARK).c_str(),
+ "background", p.get_color_str ("body-pane-color-quote-1-bg", bg).c_str(),
NULL);
g_object_set (get_or_create_tag (table, "quote_2"),
"foreground", p.get_color_str ("body-pane-color-quote-2", TANGO_ORANGE_DARK).c_str(),
+ "background", p.get_color_str ("body-pane-color-quote-2-bg", bg).c_str(),
NULL);
g_object_set (get_or_create_tag (table, "quote_3"),
"foreground", p.get_color_str ("body-pane-color-quote-3", TANGO_PLUM_DARK).c_str(),
+ "background", p.get_color_str ("body-pane-color-quote-3-bg", bg).c_str(),
NULL);
g_object_set (get_or_create_tag (table, "signature"),
"foreground", p.get_color_str ("body-pane-color-signature", TANGO_SKY_BLUE_LIGHT).c_str(),
+ "background", p.get_color_str ("body-pane-color-signature-bg", bg).c_str(),
NULL);
}
}
@@ -1434,7 +1446,7 @@ BodyPane :: text_size_allocated_idle ()
if (gtk_text_iter_begins_tag (&iter, tag))
{
gtk_widget_get_allocation(_text, &aloc);
- // BUG : resize
+// std::cerr<<"1449 alloc "<<aloc.x<<" "<<aloc.y<<" "<<aloc.width<<" "<<aloc.height<<"\n";
resize_picture_at_iter (buf, &iter, fullsize, &aloc, tag);
}
if (!gtk_text_iter_forward_char (&iter))
@@ -1555,7 +1567,7 @@ BodyPane :: new_attachment (const char* filename)
{
if (!filename) return 0;
- GtkWidget* w = gtk_hbox_new(false, 0);
+ GtkWidget* w = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
GtkWidget* attachment = gtk_label_new(filename);
GtkWidget * image = gtk_image_new_from_stock(GTK_STOCK_FILE, GTK_ICON_SIZE_MENU);
@@ -1598,7 +1610,7 @@ BodyPane :: add_attachment_to_toolbar (const char* fn)
if (!fn) return;
GtkWidget* w = new_attachment(fn);
- gtk_widget_set_size_request(w, -1, 32);
+// gtk_widget_set_size_request(w, -1, 32);
++_attachments;
#if !GTK_CHECK_VERSION(3,0,0)
@@ -1692,7 +1704,7 @@ BodyPane :: BodyPane (Data& data, ArticleCache& cache, Prefs& prefs, GroupPrefs
gtk_menu_shell_append (GTK_MENU_SHELL(_menu),l);
gtk_widget_show_all(_menu);
- GtkWidget * vbox = gtk_vbox_new (false, PAD);
+ GtkWidget * vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, PAD);
gtk_container_set_resize_mode (GTK_CONTAINER(vbox), GTK_RESIZE_QUEUE);
// about this expander... getting the ellipsis to work is a strange process.
@@ -1717,7 +1729,7 @@ BodyPane :: BodyPane (Data& data, ArticleCache& cache, Prefs& prefs, GroupPrefs
gtk_widget_show (_terse);
g_signal_connect (_terse, "button-press-event", G_CALLBACK(verbose_clicked_cb), this);
- hbox = _verbose = gtk_hbox_new (false, 0);
+ hbox = _verbose = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
g_object_ref_sink (G_OBJECT(_verbose));
w = _headers = gtk_label_new ("Headers");
gtk_label_set_selectable (GTK_LABEL(_headers), TRUE);
diff --git a/pan/gui/e-charset-dialog.c b/pan/gui/e-charset-dialog.c
index 4d4fcb5..3488d62 100644
--- a/pan/gui/e-charset-dialog.c
+++ b/pan/gui/e-charset-dialog.c
@@ -53,7 +53,7 @@ e_charset_dialog (const char *title, const char *prompt,
//gtk_dialog_set_has_separator (dialog, FALSE);
gtk_dialog_set_default_response (dialog, GTK_RESPONSE_OK);
- vbox = gtk_vbox_new (FALSE, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area(dialog)), vbox, FALSE, FALSE, 0);
gtk_widget_show (vbox);
@@ -64,7 +64,7 @@ e_charset_dialog (const char *title, const char *prompt,
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
- hbox = gtk_hbox_new (FALSE, 12);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
diff --git a/pan/gui/e-cte-dialog.c b/pan/gui/e-cte-dialog.c
index e039d3a..db3e694 100644
--- a/pan/gui/e-cte-dialog.c
+++ b/pan/gui/e-cte-dialog.c
@@ -50,7 +50,7 @@ e_cte_dialog (const char *title, const char *prompt, GMimeContentEncoding now, G
//gtk_dialog_set_has_separator (dialog, FALSE);
gtk_dialog_set_default_response (dialog, GTK_RESPONSE_OK);
- vbox = gtk_vbox_new (FALSE, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area(dialog)), vbox, FALSE, FALSE, 0);
gtk_widget_show (vbox);
@@ -61,7 +61,7 @@ e_cte_dialog (const char *title, const char *prompt, GMimeContentEncoding now, G
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
- hbox = gtk_hbox_new (FALSE, 12);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
diff --git a/pan/gui/group-pane.cc b/pan/gui/group-pane.cc
index bbb563f..e6f8a6c 100644
--- a/pan/gui/group-pane.cc
+++ b/pan/gui/group-pane.cc
@@ -686,6 +686,8 @@ namespace
{
bool shorten;
+ std::string def_fg, def_bg;
+
void
render_group_name (GtkTreeViewColumn * ,
GtkCellRenderer * renderer,
@@ -693,7 +695,8 @@ namespace
GtkTreeIter * iter,
gpointer gp)
{
- GroupPane* pane (static_cast<GroupPane*>(gp));
+
+ GroupPane* pane (static_cast<GroupPane*>(gp));
PanTreeStore * tree (PAN_TREE_STORE(model));
MyRow * row (dynamic_cast<MyRow*>(tree->get_row (iter)));
const unsigned long& unread (row->unread);
@@ -709,25 +712,22 @@ namespace
group_name += buf;
}
-
-
-
std::string fg_col(pane->get_group_prefs().get_group_color_str(name));
if (fg_col.empty())
- fg_col = pane->get_prefs().get_color_str_wo_fallback("group-pane-fg-color");
-
- if (fg_col.empty())
{
- GdkColor def_fg;
- GtkStyle *style = gtk_rc_get_style(pane->root());
- if(!gtk_style_lookup_color(style, "text_color", &def_fg))
- gdk_color_parse("black", &def_fg);
- fg_col = GroupPrefs::color_to_string(def_fg);
+ fg_col = pane->get_prefs().get_color_str_wo_fallback("group-pane-color-fg");
+ if (fg_col.empty())
+ fg_col = def_fg;
}
+ std::string bg_col (pane->get_prefs().get_color_str_wo_fallback("group-pane-color-bg"));
+ if (bg_col.empty())
+ bg_col = def_bg;
+
g_object_set (renderer, "text", group_name.c_str(),
"weight", (!is_g || unread ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL),
- "foreground", fg_col.c_str(),
+ "foreground", fg_col.empty() ? NULL : fg_col.c_str(),
+ "background", bg_col.empty() ? NULL : bg_col.c_str(),
NULL);
}
}
@@ -937,6 +937,11 @@ GroupPane :: GroupPane (ActionManager& action_manager, Data& data, Prefs& prefs,
_action_manager (action_manager),
_dirty_groups_idle_tag (0)
{
+
+ const PanColors& colors (PanColors::get());
+ def_bg = colors.def_bg;
+ def_fg = colors.def_fg;
+
shorten = prefs.get_flag ("shorten-group-names", false);
sub_title_quark = new Quark (_("Subscribed Groups"));
other_title_quark = new Quark (_("Other Groups"));
diff --git a/pan/gui/group-prefs-dialog.cc b/pan/gui/group-prefs-dialog.cc
index 41fdc98..3b98f53 100644
--- a/pan/gui/group-prefs-dialog.cc
+++ b/pan/gui/group-prefs-dialog.cc
@@ -36,6 +36,7 @@ extern "C" {
#include "pad.h"
#include "pan-file-entry.h"
#include "gtk-compat.h"
+#include "pan-colors.h"
#include <iostream>
@@ -243,14 +244,13 @@ namespace
}
- GtkWidget* new_color_button (const Quark& group, GroupPrefs& prefs, GroupPrefsDialog* dialog, GtkWidget* w)
+ GtkWidget* new_color_button (const Quark& group, Prefs& prefs, GroupPrefs& gprefs, GroupPrefsDialog* dialog, GtkWidget* w)
{
- GdkColor color;
- GtkStyle *style = gtk_rc_get_style(w);
- if(!gtk_style_lookup_color(style, "text_color", &color))
- gdk_color_parse("black", &color);
- const GdkColor& val (prefs.get_group_color (group, GroupPrefs::color_to_string(color)));
+ const PanColors& colors (PanColors::get());
+ const std::string& bg (colors.def_bg);
+
+ const GdkColor& val (gprefs.get_group_color (group, bg));
GtkWidget * b = gtk_color_button_new_with_color (&val);
g_signal_connect (b, "color-set", G_CALLBACK(color_set_cb), dialog);
return b;
@@ -313,7 +313,7 @@ GroupPrefsDialog :: GroupPrefsDialog (Data & data,
w = _spellchecker_language = create_spellcheck_combo_box ( groups[0], group_prefs);
HIG :: workarea_add_row (t, &row, _("Spellchecker _language:"), w);
#endif
- w = _group_color = new_color_button (groups[0], _group_prefs, this, dialog);
+ w = _group_color = new_color_button (groups[0], _prefs, _group_prefs, this, dialog);
HIG :: workarea_add_row(t, &row, _("Group color:"), w);
gtk_box_pack_start ( GTK_BOX( gtk_dialog_get_content_area( GTK_DIALOG( dialog))), t, true, true, 0);
diff --git a/pan/gui/gtk-compat.h b/pan/gui/gtk-compat.h
index 72bf8ba..074ba47 100644
--- a/pan/gui/gtk-compat.h
+++ b/pan/gui/gtk-compat.h
@@ -22,6 +22,64 @@
namespace
{
#endif
+
+#if !GTK_CHECK_VERSION(3, 0, 0)
+ static inline GtkWidget* gtk_box_new (GtkOrientation orientation, int space)
+ {
+ GtkWidget* ret;
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ ret = gtk_hbox_new (FALSE, space);
+ else
+ ret = gtk_vbox_new (FALSE, space);
+ return ret;
+ }
+#endif
+
+#if !GTK_CHECK_VERSION(3, 0, 0)
+static inline GdkWindow * gdk_window_get_device_position (GdkWindow *window,
+ GdkDevice *device,
+ gint *x,
+ gint *y,
+ GdkModifierType *mask)
+{
+ return gdk_window_get_pointer (window, x, y, mask);
+}
+#endif
+
+#if !GTK_CHECK_VERSION(3, 0, 0)
+ static inline GtkWidget* gtk_paned_new(GtkOrientation orientation)
+ {
+ GtkWidget* ret;
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ ret = gtk_hpaned_new();
+ else
+ ret = gtk_vpaned_new();
+ return ret;
+ }
+#endif
+
+#if !GTK_CHECK_VERSION(3, 0, 0)
+ static inline GtkWidget* gtk_separator_new(GtkOrientation orientation)
+ {
+ GtkWidget* ret;
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ ret = gtk_hseparator_new();
+ else
+ ret = gtk_vseparator_new();
+ return ret;
+ }
+#endif
+
+ static inline void window_get_pointer (GdkEventMotion* event, int* x, int* y, GdkModifierType* t)
+ {
+#if !GTK_CHECK_VERSION(3, 0, 0)
+ gdk_window_get_pointer (event->window, x, y, t);
+#else
+ gdk_window_get_device_position (event->window, event->device, x, y, t);
+#endif
+ }
+
+
#if !GTK_CHECK_VERSION(2,18,0)
static inline void gtk_widget_get_allocation( GtkWidget *w, GtkAllocation *a)
{
@@ -111,35 +169,40 @@ namespace
#if !GTK_CHECK_VERSION(3,0,0)
typedef GtkStyle GtkStyleContext;
+
static inline GtkStyleContext* gtk_widget_get_style_context(GtkWidget *w)
{
return gtk_widget_get_style(w);
}
+
static inline GtkIconSet* gtk_style_context_lookup_icon_set(GtkStyleContext *s,
const char *id)
{
-
return gtk_style_lookup_icon_set(s,id);
}
+
static inline void gtk_widget_override_font(GtkWidget *w, PangoFontDescription *f)
{
gtk_widget_modify_font(w,f);
}
#endif
-#if GTK_CHECK_VERSION(3,0,0)
+#if GTK_CHECK_VERSION(3,0,0)
// include this for conversion of old key names to new
-#include <gdk/gdkkeysyms-compat.h>
+ #include <gdk/gdkkeysyms-compat.h>
-#define GTK_OBJECT(w) w
+ #define GTK_OBJECT(w) w
typedef GtkWidget GtkObject;
-#ifdef GTK_DISABLE_DEPRECATED
- static inline void gdk_cursor_unref(GdkCursor *p)
+#endif
+
+ static inline void cursor_unref(GdkCursor *p)
{
+#if GTK_CHECK_VERSION(3,0,0)
g_object_unref(p);
- }
-#endif
+#else
+ gdk_cursor_unref(p);
#endif
+ }
#ifdef __cplusplus
}
diff --git a/pan/gui/gui.cc b/pan/gui/gui.cc
index ffc508a..fd94efc 100644
--- a/pan/gui/gui.cc
+++ b/pan/gui/gui.cc
@@ -214,8 +214,8 @@ GUI :: GUI (Data& data, Queue& queue, Prefs& prefs, GroupPrefs& group_prefs):
_group_prefs (group_prefs),
_cache (data.get_cache()),
_encode_cache (data.get_encode_cache()),
- _root (gtk_vbox_new (FALSE, 0)),
- _menu_vbox (gtk_vbox_new (FALSE, 0)),
+ _root (gtk_box_new (GTK_ORIENTATION_VERTICAL, 0)),
+ _menu_vbox (gtk_box_new (GTK_ORIENTATION_VERTICAL, 0)),
_group_pane (0),
_header_pane (0),
_body_pane (0),
@@ -281,7 +281,7 @@ GUI :: GUI (Data& data, Queue& queue, Prefs& prefs, GroupPrefs& group_prefs):
gtk_box_pack_start (GTK_BOX(_root), w, false, false, 0);
gtk_widget_show (w);
- GtkWidget * status_bar (gtk_hbox_new (FALSE, 0));
+ GtkWidget * status_bar (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
// connection status
w = _connection_size_label = gtk_label_new (NULL);
@@ -466,9 +466,7 @@ GUI :: watch_cursor_on ()
{
GdkCursor * cursor = gdk_cursor_new (GDK_WATCH);
gdk_window_set_cursor ( gtk_widget_get_window(_root), cursor);
- gdk_cursor_unref (cursor);
-// while (gtk_events_pending ())
-// gtk_main_iteration ();
+ cursor_unref (cursor);
}
void
@@ -1695,16 +1693,16 @@ namespace
if (orient == VERTICAL) {
if (uglyhack_idx==0)
{
- w = vpane = gtk_vpaned_new ();
+ w = vpane = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
}
else if (uglyhack_idx==2)
{
- w = sep_vpane = gtk_vpaned_new ();
+ w = sep_vpane = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
}
gtk_widget_set_size_request (w1, -1, 50);
gtk_widget_set_size_request (w2, -1, 50);
} else {
- w = hpane = gtk_hpaned_new ();
+ w = hpane = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL);
gtk_widget_set_size_request (w1, 50, -1);
gtk_widget_set_size_request (w2, 50, -1);
}
diff --git a/pan/gui/pan-colors.h b/pan/gui/pan-colors.h
new file mode 100644
index 0000000..64536b0
--- /dev/null
+++ b/pan/gui/pan-colors.h
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * Pan - A Newsreader for Gtk+
+ * Copyright (C) 2002-2006 Charles Kerr <charles rebelbase com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _PanColors_h_
+#define _PanColors_h_
+
+#include <config.h>
+#include "gtk-compat.h"
+#include <pan/general/singleton-template.h>
+
+class PanColors : public PanSingleton< PanColors >
+{
+ public:
+ std::string def_fg;
+ std::string def_bg;
+ GdkColor def_fg_col;
+ GdkColor def_bg_col;
+
+ PanColors(std::string& fg, std::string& bg, GdkColor& fg_col, GdkColor& bg_col) :
+ def_fg (fg), def_bg(bg), def_fg_col(fg_col), def_bg_col(bg_col) // {}
+ {
+ if (!def_fg.empty()) std::cerr<<def_fg<<" "<<def_bg<<"\n";
+ }
+ PanColors() {}
+ virtual ~PanColors() {}
+};
+
+#endif
diff --git a/pan/gui/pan-file-entry.cc b/pan/gui/pan-file-entry.cc
index 9e9405d..3b04056 100644
--- a/pan/gui/pan-file-entry.cc
+++ b/pan/gui/pan-file-entry.cc
@@ -69,7 +69,7 @@ GtkWidget*
pan :: file_entry_new (const char * title, int chooser_action)
{
// create the widgetry
- GtkWidget * hbox = gtk_hbox_new (false, PAD);
+ GtkWidget * hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD);
GtkWidget * e = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX(hbox), e, true, true, 0);
GtkWidget * b = gtk_button_new_from_stock (GTK_STOCK_OPEN);
diff --git a/pan/gui/pan.cc b/pan/gui/pan.cc
index 2991745..e957882 100644
--- a/pan/gui/pan.cc
+++ b/pan/gui/pan.cc
@@ -890,7 +890,7 @@ main (int argc, char *argv[])
{
// load the preferences...
char * filename = g_build_filename (file::get_pan_home().c_str(), "preferences.xml", NULL);
- PrefsFile prefs (filename);
+ PrefsFile prefs (filename); // dummy is used to get fg/bg colors from UI
g_free (filename);
filename = g_build_filename (file::get_pan_home().c_str(), "group-preferences.xml", NULL);
GroupPrefs group_prefs (filename);
diff --git a/pan/gui/post-ui.cc b/pan/gui/post-ui.cc
index b768d2b..1809c44 100644
--- a/pan/gui/post-ui.cc
+++ b/pan/gui/post-ui.cc
@@ -812,7 +812,7 @@ namespace
GtkWidget * button = gtk_button_new ();
GtkWidget * label = gtk_label_new_with_mnemonic (_("Go _Online"));
GtkWidget * image = gtk_image_new_from_stock (GTK_STOCK_NETWORK, GTK_ICON_SIZE_BUTTON);
- GtkWidget * hbox = gtk_hbox_new (false, 2);
+ GtkWidget * hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
GtkWidget * align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_box_pack_start (GTK_BOX (hbox), image, false, false, 0);
gtk_box_pack_end (GTK_BOX (hbox), label, false, false, 0);
@@ -2418,7 +2418,7 @@ PostUI :: create_main_tab ()
set_spellcheck_enabled (_prefs.get_flag ("spellcheck-enabled", DEFAULT_SPELLCHECK_FLAG));
_body_changed_id = g_signal_connect (_body_buf, "changed", G_CALLBACK(body_changed_cb), this);
- GtkWidget * v = gtk_vbox_new (false, PAD);
+ GtkWidget * v = gtk_box_new (GTK_ORIENTATION_VERTICAL, PAD);
gtk_container_set_border_width (GTK_CONTAINER(v), PAD);
gtk_box_pack_start (GTK_BOX(v), t, false, false, 0);
pan_box_pack_start_defaults (GTK_BOX(v), w);
@@ -2494,22 +2494,22 @@ PostUI :: create_filequeue_tab ()
GtkWidget *w ;
GtkListStore *list_store;
GtkCellRenderer *renderer;
- GtkWidget * vbox = gtk_vbox_new (false, 0);
- GtkWidget * buttons = gtk_hbox_new (false, PAD_SMALL);
+ GtkWidget * vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ GtkWidget * buttons = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD_SMALL);
// add button row
add_button (buttons, GTK_STOCK_GO_UP, G_CALLBACK(up_clicked_cb), this);
add_button (buttons, GTK_STOCK_GOTO_TOP, G_CALLBACK(top_clicked_cb), this);
- gtk_box_pack_start (GTK_BOX(buttons), gtk_vseparator_new(), 0, 0, 0);
+ gtk_box_pack_start (GTK_BOX(buttons), gtk_separator_new(GTK_ORIENTATION_VERTICAL), 0, 0, 0);
add_button (buttons, GTK_STOCK_GO_DOWN, G_CALLBACK(down_clicked_cb), this);
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);
+ gtk_box_pack_start (GTK_BOX(buttons), gtk_separator_new(GTK_ORIENTATION_VERTICAL), 0, 0, 0);
w = add_button (buttons, GTK_STOCK_DELETE, G_CALLBACK(delete_clicked_cb), this);
gtk_widget_set_tooltip_text( w, _("Delete from Queue"));
pan_box_pack_start_defaults (GTK_BOX(buttons), gtk_event_box_new());
gtk_box_pack_start (GTK_BOX(vbox), buttons, false, false, 0);
- gtk_box_pack_start (GTK_BOX(vbox), gtk_hseparator_new(), false, false, 0);
+ gtk_box_pack_start (GTK_BOX(vbox), gtk_separator_new(GTK_ORIENTATION_HORIZONTAL), false, false, 0);
//add filestore
list_store = gtk_list_store_new (4, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_STRING);
@@ -2555,7 +2555,7 @@ GtkWidget*
PostUI:: create_filequeue_status_bar ()
{
GtkWidget * w;
- GtkWidget * status_bar (gtk_hbox_new (FALSE, 0));
+ GtkWidget * status_bar (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
// connection status
w = _filequeue_label = gtk_label_new (NULL);
@@ -2877,12 +2877,14 @@ PostUI :: select_parts ()
gtk_window_set_role (GTK_WINDOW(w), "pan-parts-window");
gtk_window_set_title (GTK_WINDOW(w), _("Select Parts"));
int x,y;
+
// FIXME (sometimes....) BUG: Native Windows wider or taller than 65535 pixels are not supported
x = _prefs.get_int("post-ui-width", 450);
y = _prefs.get_int("post-ui-height", 450);
+
gtk_window_set_default_size (GTK_WINDOW(w), x, y);
// populate the window
- GtkWidget * vbox = gtk_vbox_new (false, PAD_SMALL);
+ GtkWidget * vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, PAD_SMALL);
gtk_container_add (GTK_CONTAINER(w), vbox);
GtkWidget * notebook = gtk_notebook_new ();
@@ -3053,8 +3055,8 @@ PostUI :: PostUI (GtkWindow * parent,
}
// populate the window
- GtkWidget * vbox = gtk_vbox_new (false, PAD_SMALL);
- GtkWidget * menu_vbox = gtk_vbox_new (false, PAD_SMALL);
+ GtkWidget * vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, PAD_SMALL);
+ GtkWidget * menu_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, PAD_SMALL);
gtk_box_pack_start (GTK_BOX(vbox), menu_vbox, false, false, 0);
add_actions (menu_vbox);
gtk_window_add_accel_group (GTK_WINDOW(_root), gtk_ui_manager_get_accel_group (_uim));
diff --git a/pan/gui/prefs-file.cc b/pan/gui/prefs-file.cc
index 2013182..1124137 100644
--- a/pan/gui/prefs-file.cc
+++ b/pan/gui/prefs-file.cc
@@ -51,7 +51,7 @@ PrefsFile :: ~PrefsFile ()
save ();
}
-void
+void
PrefsFile :: save () const
{
std::string s;
diff --git a/pan/gui/prefs-ui.cc b/pan/gui/prefs-ui.cc
index 323bf3b..62df562 100644
--- a/pan/gui/prefs-ui.cc
+++ b/pan/gui/prefs-ui.cc
@@ -411,7 +411,7 @@ namespace pan
const bool icons = "icons" == what;
const bool both = "both" == what;
- GtkWidget* hbox = gtk_hbox_new(false, 2);
+ GtkWidget* hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
GdkPixbuf * pixbuf = gdk_pixbuf_new_from_inline (-1, line, false, 0);
GtkWidget * image = gtk_image_new_from_pixbuf (pixbuf);
g_object_unref (pixbuf);
@@ -615,7 +615,7 @@ namespace pan
// tie them together...
g_signal_connect (c, "changed", G_CALLBACK(maybe_make_widget_visible), e);
- GtkWidget * h = gtk_hbox_new (false, PAD);
+ GtkWidget * h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD);
gtk_box_pack_start (GTK_BOX(h), c, true, true, 0);
gtk_box_pack_start (GTK_BOX(h), e, true, true, 0);
@@ -886,9 +886,9 @@ namespace
GtkWidget * f = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME(f), GTK_SHADOW_IN);
gtk_container_add (GTK_CONTAINER(f), view);
- GtkWidget * hbox = gtk_hbox_new (false, PAD);
+ GtkWidget * hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD);
gtk_box_pack_start (GTK_BOX(hbox), f, true, true, 0);
- GtkWidget * vbox = gtk_vbox_new (false, PAD);
+ GtkWidget * vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, PAD);
GtkWidget * up = gtk_button_new_from_stock (GTK_STOCK_GO_UP);
gtk_box_pack_start (GTK_BOX(vbox), up, false, false, 0);
GtkWidget * down = gtk_button_new_from_stock (GTK_STOCK_GO_DOWN);
@@ -1048,7 +1048,7 @@ PrefsDialog :: PrefsDialog (Prefs& prefs, GtkWindow* parent):
HIG :: workarea_add_section_title (t, &row, _("Pane Layout"));
std::string cur = _prefs.get_string ("pane-layout", "stacked-right");
HIG :: workarea_add_section_spacer (t, row, 1);
- h = gtk_hbox_new (false, PAD);
+ h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD);
w = new_layout_radio (0, icon_layout_1, "stacked-top", cur, prefs);
gtk_box_pack_start (GTK_BOX(h), w, false, false, 0);
w = new_layout_radio (w, icon_layout_2, "stacked-bottom", cur, prefs);
@@ -1105,7 +1105,7 @@ PrefsDialog :: PrefsDialog (Prefs& prefs, GtkWindow* parent):
i=0;
w = score_handler_new (prefs, "rules-delete-value", "never", b);
- h = gtk_hbox_new (false, PAD);
+ h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD);
gtk_box_pack_start (GTK_BOX(h), w, false, false, 0);
gtk_box_pack_start (GTK_BOX(h), action_combo[i++], false, false, 0);
HIG :: workarea_add_row (t, &row, _("_Delete articles scoring at: "), h);
@@ -1114,13 +1114,13 @@ PrefsDialog :: PrefsDialog (Prefs& prefs, GtkWindow* parent):
HIG :: workarea_add_row (t, &row, _("Mark articles as _read scoring at: "), w);
w = score_handler_new (prefs, "rules-autocache-value", "never", b);
- h = gtk_hbox_new (false, PAD);
+ h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD);
gtk_box_pack_start (GTK_BOX(h), w, false, false, 0);
gtk_box_pack_start (GTK_BOX(h), action_combo[i++], false, false, 0);
HIG :: workarea_add_row (t, &row, _("_Cache articles scoring at: "), h);
w = score_handler_new (prefs, "rules-auto-dl-value", "never", b);
- h = gtk_hbox_new (false, PAD);
+ h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD);
gtk_box_pack_start (GTK_BOX(h), w, false, false, 0);
gtk_box_pack_start (GTK_BOX(h), action_combo[i++], false, false, 0);
HIG :: workarea_add_row (t, &row, _("Download _attachments of articles scoring at: "), h);
@@ -1155,73 +1155,80 @@ PrefsDialog :: PrefsDialog (Prefs& prefs, GtkWindow* parent):
gtk_notebook_append_page (GTK_NOTEBOOK(notebook), t, new_label_with_icon(_("_Fonts"), _("Fonts"), icon_prefs_fonts, prefs));
// Colors
- GdkColor def_color, def_color_bg;
- GtkStyle *style = gtk_rc_get_style(dialog);
-
- if(!style || !gtk_style_lookup_color(style, "text_color", &def_color))
- gdk_color_parse("black", &def_color);
- if(!style || !gtk_style_lookup_color(style, "bg_color", &def_color_bg))
- gdk_color_parse("white", &def_color_bg);
-
- std::string def_color_str (GroupPrefs::color_to_string(def_color));
- std::string def_color_bg_str (GroupPrefs::color_to_string(def_color_bg));
+ const PanColors& colors (PanColors::get());
+ const char* def_color_str (colors.def_bg.c_str());
+ const char* def_color_fg_str (colors.def_fg.c_str());
row = 0;
t = HIG :: workarea_create ();
HIG :: workarea_add_section_title (t, &row, _("Header Pane"));
HIG :: workarea_add_section_spacer(t, row, 6);
- h = gtk_hbox_new (false, PAD);
+ h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD);
pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Text:")));
- pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("score-color-watched-fg", def_color_str.c_str(), prefs));
+ pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("score-color-watched-fg", def_color_str, prefs));
pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Background:")));
pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("score-color-watched-bg", TANGO_CHAMELEON_LIGHT, prefs));
HIG :: workarea_add_row (t, &row, _("Scores of 9999 or more:"), h);
- h = gtk_hbox_new (false, PAD);
+ h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD);
pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Text:")));
- pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("score-color-high-fg", def_color_str.c_str(), prefs));
+ pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("score-color-high-fg", def_color_str, prefs));
pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Background:")));
pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("score-color-high-bg", TANGO_BUTTER_LIGHT, prefs));
HIG :: workarea_add_row (t, &row, _("Scores from 5000 to 9998:"), h);
- h = gtk_hbox_new (false, PAD);
+ h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD);
pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Text:")));
- pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("score-color-medium-fg", def_color_str.c_str(), prefs));
+ pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("score-color-medium-fg", def_color_str, prefs));
pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Background:")));
pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("score-color-medium-bg", TANGO_SKY_BLUE_LIGHT, prefs));
HIG :: workarea_add_row (t, &row, _("Scores from 1 to 4999:"), h);
- h = gtk_hbox_new (false, PAD);
+ h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD);
pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Text:")));
pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("score-color-low-fg", TANGO_ALUMINUM_2, prefs));
pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Background:")));
- pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("score-color-low-bg", def_color_str.c_str(), prefs));
+ pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("score-color-low-bg", def_color_str, prefs));
HIG :: workarea_add_row (t, &row, _("Scores from -9998 to -1:"), h);
- h = gtk_hbox_new (false, PAD);
+ h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD);
pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Text:")));
pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("score-color-ignored-fg", TANGO_ALUMINUM_4, prefs));
pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Background:")));
- pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("score-color-ignored-bg", def_color_str.c_str(), prefs));
+ pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("score-color-ignored-bg", def_color_str, prefs));
HIG :: workarea_add_row (t, &row, _("Scores of -9999 or less:"), h);
- h = gtk_hbox_new (false, PAD);
+ h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD);
pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Text:")));
pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("color-read-fg", TANGO_ORANGE, prefs));
pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Background:")));
- pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("color-read-bg", def_color_bg_str.c_str(), prefs));
+ pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("color-read-bg", def_color_str, prefs));
HIG :: workarea_add_row (t, &row, _("Collapsed thread with unread articles:"), h);
HIG :: workarea_add_section_divider (t, &row);
HIG :: workarea_add_section_title (t, &row, _("Body Pane"));
HIG :: workarea_add_section_spacer (t, row, 3);
- h = gtk_hbox_new (false, PAD_SMALL);
+ h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD_SMALL);
pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("body-pane-color-quote-1", TANGO_CHAMELEON_DARK, prefs));
pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("body-pane-color-quote-2", TANGO_ORANGE_DARK, prefs));
pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("body-pane-color-quote-3", TANGO_PLUM_DARK, prefs));
+ pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Background:")));
+ pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("body-pane-color-quote-bg", def_color_str, prefs));
HIG :: workarea_add_row (t, &row, _("Quoted text:"), h);
- HIG :: workarea_add_row (t, &row, _("URL:"), new_color_button ("body-pane-color-url", TANGO_SKY_BLUE_DARK, prefs));
- HIG :: workarea_add_row (t, &row, _("Signature:"), new_color_button ("body-pane-color-signature", TANGO_SKY_BLUE_LIGHT, prefs));
+ h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD_SMALL);
+ pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("body-pane-color-url", TANGO_SKY_BLUE_DARK, prefs));
+ pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Background:")));
+ pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("body-pane-color-url-bg", def_color_str, prefs)); //
+ HIG :: workarea_add_row (t, &row, _("URL:"), h);
+ h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD_SMALL);
+ pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("body-pane-color-signature", TANGO_SKY_BLUE_LIGHT, prefs));
+ pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Background:")));
+ pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("body-pane-color-signature-bg", def_color_str, prefs)); //
+ HIG :: workarea_add_row (t, &row, _("Signature:"), h);
HIG :: workarea_finish (t, &row);
HIG :: workarea_add_section_divider (t, &row);
- HIG :: workarea_add_section_title (t, &row, _("Body Pane"));
- HIG :: workarea_add_section_spacer (t, row, 3);
- HIG :: workarea_add_row (t, &row, _("Group Color Foreground:"), new_color_button ("group-pane-fg-color", TANGO_BLACK, prefs));
+ HIG :: workarea_add_section_title (t, &row, _("Group Pane"));
+ HIG :: workarea_add_section_spacer (t, row, 1);
+ h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD_SMALL);
+ pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("group-pane-color-fg", def_color_fg_str, prefs));
+ pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Background:")));
+ pan_box_pack_start_defaults (GTK_BOX(h), new_color_button ("group-pane-color-bg", def_color_str, prefs)); //
+ HIG :: workarea_add_row (t, &row, _("Group Color:"), h);
HIG :: workarea_finish (t, &row);
gtk_notebook_append_page (GTK_NOTEBOOK(notebook), t, new_label_with_icon(_("_Colors"), _("Colors"), icon_prefs_colors, prefs));
diff --git a/pan/gui/prefs.cc b/pan/gui/prefs.cc
index 76eb5bf..87b2518 100644
--- a/pan/gui/prefs.cc
+++ b/pan/gui/prefs.cc
@@ -31,9 +31,59 @@ extern "C" {
#include <pan/general/log.h>
#include <pan/general/macros.h>
#include "prefs.h"
+#include "group-prefs.h"
using namespace pan;
+Prefs :: Prefs() :
+ _rules_changed(false)
+{
+
+ GtkWidget* root = gtk_entry_new();
+
+ GdkColor def_fg, def_bg;
+ std::string fg_col, bg_col;
+
+#if GTK_CHECK_VERSION(3,0,0)
+ GdkRGBA fg_color, bg_color;
+ GtkStyleContext* ctx = gtk_widget_get_style_context(root);
+ if(!ctx || !gtk_style_context_lookup_color(ctx, "color", &fg_color))
+ gdk_color_parse("black", &def_fg);
+ else
+ {
+ def_fg.red = fg_color.red;
+ def_fg.green = fg_color.red;
+ def_fg.blue = fg_color.blue;
+ }
+ if(!ctx || !gtk_style_context_lookup_color(ctx, "background-color", &bg_color))
+ gdk_color_parse("white", &def_bg);
+ else
+ {
+ def_bg.red = bg_color.red;
+ def_bg.green = bg_color.red;
+ def_bg.blue = bg_color.blue;
+ }
+#else
+ GtkStyle *style = gtk_rc_get_style(root);
+ if(!style || !gtk_style_lookup_color(style, "text_color", &def_fg))
+ gdk_color_parse("black", &def_fg);
+ if(!style || !gtk_style_lookup_color(style, "bg_color", &def_bg))
+ gdk_color_parse("white", &def_bg);
+
+#endif
+
+ fg_col = GroupPrefs::color_to_string(def_fg);
+ bg_col = GroupPrefs::color_to_string(def_bg);
+
+ gtk_widget_destroy (root);
+
+}
+
+Prefs :: ~Prefs()
+{
+// delete _pan_colors; // TODO make pancolors a singleton?
+}
+
// called for open tags <foo bar='baz'>
void
Prefs :: start_element (GMarkupParseContext *,
@@ -98,16 +148,6 @@ Prefs :: start_element (GMarkupParseContext *,
if (name && *name && value && *value)
prefs.set_color (name, value);
}
-
-// if (s == "hotkey") {
-// const char * name (0);
-// const char * value (0);
-// for (const char **k(attribute_names), **v(attribute_vals); *k; ++k, ++v)
-// if (!strcmp (*k,"name")) name = *v;
-// else if (!strcmp(*k,"value")) value = *v;
-// if (name && *name && value && *value)
-// prefs.set_hotkey (name, value);
-// }
}
void
@@ -380,3 +420,5 @@ Prefs :: get_color_str_wo_fallback (const StringView& key) const
const GdkColor& col(_colors[key]);
return color_to_string (col);
}
+
+
diff --git a/pan/gui/prefs.h b/pan/gui/prefs.h
index 7be4f35..26e178b 100644
--- a/pan/gui/prefs.h
+++ b/pan/gui/prefs.h
@@ -26,6 +26,7 @@
#include <string>
#include <vector>
#include <pan/general/string-view.h>
+#include <pan/gui/pan-colors.h>
#include "gtk-compat.h"
namespace pan
@@ -109,9 +110,9 @@ namespace pan
bool get_geometry (const StringView&, int&, int&, int&, int&) const;
public:
- Prefs () { _rules_changed = false; }
+ Prefs ();
+ virtual ~Prefs () ;
virtual void save () const {}
- virtual ~Prefs () {}
public:
void to_string (int indent, std::string& setme) const;
@@ -137,7 +138,6 @@ namespace pan
typedef std::map<std::string,int> ints_t;
mutable ints_t _ints;
-
public:
colors_t& get_colors() { return _colors; }
const colors_t& get_colors() const { return _colors; }
diff --git a/pan/gui/profiles-dialog.cc b/pan/gui/profiles-dialog.cc
index 3ceb9ea..d41db0a 100644
--- a/pan/gui/profiles-dialog.cc
+++ b/pan/gui/profiles-dialog.cc
@@ -192,7 +192,7 @@ ProfileDialog :: ProfileDialog (const Data & data,
#endif
w = gtk_combo_box_new_with_model (GTK_TREE_MODEL(store));
- hbox = gtk_hbox_new(FALSE, 3);
+ hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 3);
l = gtk_label_new(_("Signature Type: "));
gtk_misc_set_alignment (GTK_MISC(l), 0.0f, 0.5f);
gtk_box_pack_start(GTK_BOX(hbox), l, false, false, 0);
@@ -214,7 +214,10 @@ ProfileDialog :: ProfileDialog (const Data & data,
#endif
gtk_combo_box_set_active (GTK_COMBO_BOX(w), active);
- GtkWidget* vbox = gtk_vbox_new(TRUE, 3);
+ GtkWidget* vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 3);
+#if !GTK_CHECK_VERSION(3, 0, 0)
+ gtk_box_set_homogeneous (GTK_BOX(vbox), TRUE);
+#endif
gtk_box_pack_start(GTK_BOX(vbox), _signature_file_combo, false, false, 0);
gtk_box_pack_start(GTK_BOX(vbox), _signature_file, false, false, 0);
HIG :: workarea_add_row (t, &row, "",vbox);
@@ -530,7 +533,7 @@ ProfilesDialog :: ProfilesDialog (const Data& data, Profiles &profiles, GtkWindo
//g_signal_connect (GTK_OBJECT(_root), "response", G_CALLBACK(response_cb), this);
// workarea
- GtkWidget * hbox = gtk_hbox_new (false, PAD);
+ GtkWidget * hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD);
gtk_container_set_border_width (GTK_CONTAINER(hbox), PAD_BIG);
gtk_box_pack_start (GTK_BOX( gtk_dialog_get_content_area( GTK_DIALOG(_root))), hbox, true, true, 0);
@@ -555,7 +558,7 @@ ProfilesDialog :: ProfilesDialog (const Data& data, Profiles &profiles, GtkWindo
gtk_widget_set_size_request (w, 300, 300);
// button box
- GtkWidget * bbox = gtk_vbox_new (FALSE, PAD_SMALL);
+ GtkWidget * bbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, PAD_SMALL);
gtk_box_pack_start (GTK_BOX (hbox), bbox, false, false, 0);
// add button
diff --git a/pan/gui/save-attach-ui.cc b/pan/gui/save-attach-ui.cc
index 1483e79..f03a267 100644
--- a/pan/gui/save-attach-ui.cc
+++ b/pan/gui/save-attach-ui.cc
@@ -105,7 +105,7 @@ SaveAttachmentsDialog :: response_cb (GtkDialog * dialog,
if ((path.find("%s") != path.npos) || (path.find("%S") != path.npos))
subject_in_path = true;
- std::string sep( self->_prefs.get_string("save-subj-seperator", "-") );
+ std::string sep( self->_prefs.get_string("save-subj-separator", "-") );
const bool always (self->_prefs.get_flag("mark-downloaded-articles-read", false));
@@ -231,7 +231,7 @@ SaveAttachmentsDialog :: SaveAttachmentsDialog
GtkWidget * dialog = gtk_dialog_new_with_buttons (_("Pan: Save Attachments"),
parent_window,
GTK_DIALOG_DESTROY_WITH_PARENT,
- NULL);
+ NULL, NULL);
gtk_dialog_add_button (GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
GtkWidget * focus = gtk_dialog_add_button (GTK_DIALOG(dialog), GTK_STOCK_SAVE, GTK_RESPONSE_OK);
gtk_window_set_role (GTK_WINDOW(dialog), "pan-save-attachments-dialog");
@@ -251,7 +251,7 @@ SaveAttachmentsDialog :: SaveAttachmentsDialog
if (path_mode==PATH_GROUP && !have_group_default)
path_mode = PATH_ENTRY;
- h = gtk_hbox_new (FALSE, 0);
+ h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
if (have_group_default) {
w = _save_custom_path_radio = gtk_radio_button_new_with_mnemonic (NULL, _("_Location:"));
gtk_box_pack_start (GTK_BOX(h), w, false, false, 0);
diff --git a/pan/gui/save-ui.cc b/pan/gui/save-ui.cc
index 7352153..64ead52 100644
--- a/pan/gui/save-ui.cc
+++ b/pan/gui/save-ui.cc
@@ -113,7 +113,7 @@ SaveDialog :: response_cb (GtkDialog * dialog,
else if (s == "save-attachments-and-text") save_mode = TaskArticle::DECODE | TaskArticle::RAW;
else save_mode = TaskArticle::DECODE;
- std::string sep( self->_prefs.get_string("save-subj-seperator", "-") );
+ std::string sep( self->_prefs.get_string("save-subj-separator", "-") );
const bool always (self->_prefs.get_flag("mark-downloaded-articles-read", false));
@@ -246,7 +246,7 @@ SaveDialog :: SaveDialog (Prefs & prefs,
GtkWidget * dialog = gtk_dialog_new_with_buttons (_("Pan: Save Articles"),
parent_window,
GTK_DIALOG_DESTROY_WITH_PARENT,
- NULL);
+ NULL, NULL);
gtk_dialog_add_button (GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
GtkWidget * focus = gtk_dialog_add_button (GTK_DIALOG(dialog), GTK_STOCK_SAVE, GTK_RESPONSE_OK);
gtk_window_set_role (GTK_WINDOW(dialog), "pan-save-articles-dialog");
@@ -266,7 +266,7 @@ SaveDialog :: SaveDialog (Prefs & prefs,
if (path_mode==PATH_GROUP && !have_group_default)
path_mode = PATH_ENTRY;
- h = gtk_hbox_new (FALSE, 0);
+ h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
if (have_group_default) {
w = _save_custom_path_radio = gtk_radio_button_new_with_mnemonic (NULL, _("_Location:"));
gtk_box_pack_start (GTK_BOX(h), w, false, false, 0);
diff --git a/pan/gui/score-add-ui.cc b/pan/gui/score-add-ui.cc
index 52f98f7..3787666 100644
--- a/pan/gui/score-add-ui.cc
+++ b/pan/gui/score-add-ui.cc
@@ -314,7 +314,7 @@ namespace
GtkWidget *& setme_spin,
const Article * article)
{
- GtkWidget * h = gtk_hbox_new (false, PAD);
+ GtkWidget * h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD);
g_object_set_data (G_OBJECT(h), "article", gpointer(article));
GtkTreeModel * model = field_tree_model_new ();
@@ -555,7 +555,7 @@ namespace
GtkWidget * image = gtk_image_new_from_stock (GTK_STOCK_ADD, GTK_ICON_SIZE_BUTTON);
GtkWidget * image2 = gtk_image_new_from_stock (GTK_STOCK_REFRESH, GTK_ICON_SIZE_BUTTON);
- GtkWidget * hbox = gtk_hbox_new (FALSE, 2);
+ GtkWidget * hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
GtkWidget * align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
@@ -625,7 +625,7 @@ ScoreAddDialog :: ScoreAddDialog (Data & data,
HIG::workarea_add_section_spacer (t, row, 4);
// section
- GtkWidget * h = gtk_hbox_new (false, PAD);
+ GtkWidget * h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD);
GtkTreeModel * model = text_tree_model_new (false);
w = _section_menu = value_combo_new (model);
g_object_unref (G_OBJECT(model));
@@ -643,7 +643,7 @@ ScoreAddDialog :: ScoreAddDialog (Data & data,
gtk_widget_show (w);
// score
- h = gtk_hbox_new (false, PAD_SMALL);
+ h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD_SMALL);
model = score_tree_model_new ();
w = _score_menu = value_combo_new (model);
g_object_unref (model);
diff --git a/pan/gui/score-view-ui.cc b/pan/gui/score-view-ui.cc
index f351932..75b9490 100644
--- a/pan/gui/score-view-ui.cc
+++ b/pan/gui/score-view-ui.cc
@@ -58,7 +58,7 @@ namespace
GtkWidget * image = gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_BUTTON);
GtkWidget * image2 = gtk_image_new_from_stock (GTK_STOCK_REFRESH, GTK_ICON_SIZE_BUTTON);
- GtkWidget * hbox = gtk_hbox_new (FALSE, 2);
+ GtkWidget * hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
GtkWidget * align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
@@ -192,7 +192,7 @@ ScoreView :: ScoreView (Data& data, GtkWindow* parent,
g_object_set_data_full (G_OBJECT(w), "score_view", this, delete_score_view);
// workarea
- GtkWidget * hbox = gtk_hbox_new (FALSE, PAD);
+ GtkWidget * hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD);
gtk_container_set_border_width (GTK_CONTAINER(hbox), 12);
gtk_box_pack_start (GTK_BOX( gtk_dialog_get_content_area( GTK_DIALOG(w))), hbox, TRUE, TRUE, 0);
gtk_widget_show (hbox);
@@ -231,7 +231,7 @@ ScoreView :: ScoreView (Data& data, GtkWindow* parent,
gtk_widget_show (w);
// button box
- GtkWidget * bbox = gtk_vbox_new (FALSE, PAD_SMALL);
+ GtkWidget * bbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, PAD_SMALL);
gtk_box_pack_start (GTK_BOX (hbox), bbox, FALSE, FALSE, 0);
gtk_widget_show (bbox);
diff --git a/pan/gui/server-ui.cc b/pan/gui/server-ui.cc
index 4c32098..eaa00d9 100644
--- a/pan/gui/server-ui.cc
+++ b/pan/gui/server-ui.cc
@@ -846,7 +846,7 @@ pan :: server_list_dialog_new (Data& data, Queue& queue, Prefs& prefs, GtkWindow
g_object_set_data_full (G_OBJECT(w), "dialog", d, delete_server_list_dialog);
// workarea
- GtkWidget * hbox = gtk_hbox_new (FALSE, PAD);
+ GtkWidget * hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD);
gtk_container_set_border_width (GTK_CONTAINER(hbox), 12);
gtk_box_pack_start (GTK_BOX( gtk_dialog_get_content_area( GTK_DIALOG(w))), hbox, TRUE, TRUE, 0);
@@ -875,7 +875,7 @@ pan :: server_list_dialog_new (Data& data, Queue& queue, Prefs& prefs, GtkWindow
gtk_widget_set_size_request (w, 300, 300);
// button box
- GtkWidget * bbox = gtk_vbox_new (FALSE, PAD_SMALL);
+ GtkWidget * bbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, PAD_SMALL);
gtk_box_pack_start (GTK_BOX (hbox), bbox, FALSE, FALSE, 0);
// add button
@@ -939,7 +939,7 @@ pan :: sec_dialog_new (Data& data, Queue& queue, Prefs& prefs, GtkWindow* parent
g_object_set_data_full (G_OBJECT(w), "dialog", d, delete_sec_dialog);
// workarea
- GtkWidget * hbox = gtk_hbox_new (FALSE, PAD);
+ GtkWidget * hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD);
gtk_container_set_border_width (GTK_CONTAINER(hbox), 12);
gtk_box_pack_start (GTK_BOX( gtk_dialog_get_content_area( GTK_DIALOG(w))), hbox, TRUE, TRUE, 0);
@@ -973,7 +973,7 @@ pan :: sec_dialog_new (Data& data, Queue& queue, Prefs& prefs, GtkWindow* parent
gtk_widget_set_size_request (w, 300, 300);
// button box
- GtkWidget * bbox = gtk_vbox_new (FALSE, PAD_SMALL);
+ GtkWidget * bbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, PAD_SMALL);
gtk_box_pack_start (GTK_BOX (hbox), bbox, FALSE, FALSE, 0);
// add button
diff --git a/pan/gui/tango-colors.h b/pan/gui/tango-colors.h
index 3389634..c2cb646 100644
--- a/pan/gui/tango-colors.h
+++ b/pan/gui/tango-colors.h
@@ -38,6 +38,4 @@
#define TANGO_ALUMINUM_5 "#555753"
#define TANGO_ALUMINUM_6 "#2e3436"
-#define TANGO_BLACK "#000000"
-
#endif
diff --git a/pan/gui/task-pane.cc b/pan/gui/task-pane.cc
index 71f257b..4f3c8b3 100644
--- a/pan/gui/task-pane.cc
+++ b/pan/gui/task-pane.cc
@@ -972,45 +972,45 @@ TaskPane :: TaskPane (Queue& queue, Prefs& prefs): _queue(queue), _prefs(prefs)
GtkWidget * w;
- GtkWidget * vbox = gtk_vbox_new (false, 0);
+ GtkWidget * vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
- GtkWidget * buttons = gtk_hbox_new (false, PAD_SMALL);
+ GtkWidget * buttons = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD_SMALL);
w = _online_toggle = gtk_check_button_new ();
_online_toggle_handler = g_signal_connect (w, "clicked", G_CALLBACK(online_toggled_cb), &queue);
GtkWidget * i = _online_image = gtk_image_new ();
GtkWidget * l = gtk_label_new_with_mnemonic (_("_Online"));
- GtkWidget * v = gtk_hbox_new (false, PAD);
+ GtkWidget * v = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD);
gtk_label_set_mnemonic_widget (GTK_LABEL(l), w);
on_queue_online_changed (queue, queue.is_online());
gtk_box_pack_start (GTK_BOX(v), i, 0, 0, 0);
gtk_box_pack_start (GTK_BOX(v), l, 0, 0, 0);
gtk_container_add (GTK_CONTAINER(w), v);
gtk_box_pack_start (GTK_BOX(buttons), w, false, false, 0);
- gtk_box_pack_start (GTK_BOX(buttons), gtk_vseparator_new(), 0, 0, 0);
+ gtk_box_pack_start (GTK_BOX(buttons), gtk_separator_new(GTK_ORIENTATION_VERTICAL), 0, 0, 0);
add_button (buttons, GTK_STOCK_GO_UP, G_CALLBACK(up_clicked_cb), this);
add_button (buttons, GTK_STOCK_GOTO_TOP, G_CALLBACK(top_clicked_cb), this);
- gtk_box_pack_start (GTK_BOX(buttons), gtk_vseparator_new(), 0, 0, 0);
+ gtk_box_pack_start (GTK_BOX(buttons), gtk_separator_new(GTK_ORIENTATION_VERTICAL), 0, 0, 0);
add_button (buttons, GTK_STOCK_GO_DOWN, G_CALLBACK(down_clicked_cb), this);
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);
+ gtk_box_pack_start (GTK_BOX(buttons), gtk_separator_new(GTK_ORIENTATION_VERTICAL), 0, 0, 0);
w = add_button (buttons, GTK_STOCK_REDO, G_CALLBACK(restart_clicked_cb), this);
gtk_widget_set_tooltip_text( w, _("Restart Tasks"));
w = add_button (buttons, GTK_STOCK_STOP, G_CALLBACK(stop_clicked_cb), this);
gtk_widget_set_tooltip_text( w, _("Stop Tasks"));
w = add_button (buttons, GTK_STOCK_DELETE, G_CALLBACK(delete_clicked_cb), this);
gtk_widget_set_tooltip_text( w, _("Delete Tasks"));
- gtk_box_pack_start (GTK_BOX(buttons), gtk_vseparator_new(), 0, 0, 0);
+ gtk_box_pack_start (GTK_BOX(buttons), gtk_separator_new(GTK_ORIENTATION_VERTICAL), 0, 0, 0);
w = add_button (buttons, GTK_STOCK_CLOSE, 0, 0);
g_signal_connect_swapped (w, "clicked", G_CALLBACK(gtk_widget_destroy), _root);
pan_box_pack_start_defaults (GTK_BOX(buttons), gtk_event_box_new()); // eat horizontal space
gtk_box_pack_start (GTK_BOX(vbox), buttons, false, false, 0);
- gtk_box_pack_start (GTK_BOX(vbox), gtk_hseparator_new(), false, false, 0);
+ gtk_box_pack_start (GTK_BOX(vbox), gtk_separator_new(GTK_ORIENTATION_HORIZONTAL), false, false, 0);
// statusbar
- GtkWidget * hbox = gtk_hbox_new (false, PAD);
+ GtkWidget * hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD);
w = _status_label = gtk_label_new (0);
gtk_box_pack_start (GTK_BOX(hbox), w, false, false, PAD_SMALL);
@@ -1038,7 +1038,7 @@ TaskPane :: TaskPane (Queue& queue, Prefs& prefs): _queue(queue), _prefs(prefs)
gtk_window_add_accel_group (GTK_WINDOW(_root), gtk_ui_manager_get_accel_group (_uim));
// search filter
- gtk_box_pack_start (GTK_BOX(hbox), gtk_vseparator_new(), 0, 0, 0);
+ gtk_box_pack_start (GTK_BOX(hbox), gtk_separator_new(GTK_ORIENTATION_VERTICAL), 0, 0, 0);
gtk_box_pack_start (GTK_BOX(hbox), create_filter_entry(), false, false, PAD);
GtkTreeModel* initial_model= gtk_tree_view_get_model(GTK_TREE_VIEW( _view ));
GtkTreeModel* filter_model = gtk_tree_model_filter_new( initial_model, NULL );
diff --git a/pan/usenet-utils/text-massager.cc b/pan/usenet-utils/text-massager.cc
index 06d9448..68137e2 100644
--- a/pan/usenet-utils/text-massager.cc
+++ b/pan/usenet-utils/text-massager.cc
@@ -450,7 +450,7 @@ TextMassager :: rot13_inplace (char * text)
}
std::string
-pan :: subject_to_path (const char * subjectline, bool full_subj, const std::string &seperator)
+pan :: subject_to_path (const char * subjectline, bool full_subj, const std::string &separator)
{
gchar *str1, *str2;
const char *sep;
@@ -459,12 +459,12 @@ pan :: subject_to_path (const char * subjectline, bool full_subj, const std::str
GRegexCompileFlags cf0((GRegexCompileFlags)0);
GRegexMatchFlags mf0((GRegexMatchFlags)0);
- if (seperator.length() != 1)
+ if (separator.length() != 1)
sep = "-";
- else switch (seperator[0]) {
+ else switch (separator[0]) {
case ' ':
case '-':
- case '_': sep = seperator.c_str(); break;
+ case '_': sep = separator.c_str(); break;
default : sep = "-"; break;
}
diff --git a/pan/usenet-utils/text-massager.h b/pan/usenet-utils/text-massager.h
index 5c431bd..c978744 100644
--- a/pan/usenet-utils/text-massager.h
+++ b/pan/usenet-utils/text-massager.h
@@ -62,7 +62,7 @@ namespace pan
*
* @ingroup usenet_utils
*/
- std::string subject_to_path (const char * subjectline, bool full_subj, const std::string &seperator);
+ std::string subject_to_path (const char * subjectline, bool full_subj, const std::string &separator);
std::string expand_download_dir_subject (const char * dir, const char * subjectline, const std::string &sep);
std::string expand_download_dir (const char * dir, const StringView& group);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]