[pan2] -roughly implemented custom shortcuts (file pan.shortcuts is auto-created the first time pan is exit



commit 7618ee65e5ccc98b568ac5cdee0595004af8e4f0
Author: Heinrich MÃller <henmull src gnome org>
Date:   Thu Jan 12 23:21:41 2012 +0100

    -roughly implemented custom shortcuts (file pan.shortcuts is auto-created the first time pan is exited)
    -build fixes for Mac OSX
    -removed queue from mytree, used setter option in pan.cc

 AUTHORS                       |    2 +-
 INSTALL                       |    9 +-
 Makefile.am                   |    4 +-
 README                        |    3 +-
 configure.in                  |   29 +-
 pan/data-impl/Makefile.am     |    3 +-
 pan/data-impl/data-impl.cc    |   50 +---
 pan/data-impl/data-impl.h     |   30 +-
 pan/data-impl/data-io.cc      |   16 +-
 pan/data-impl/data-io.h       |    4 +-
 pan/data-impl/headers.cc      |    6 +-
 pan/data-impl/hotkeys.cc      |  123 ++++++
 pan/data-impl/my-tree.cc      |    4 +-
 pan/data/data.h               |   15 +-
 pan/gui/actions.cc            |  875 ++++++++++++++++++++++-------------------
 pan/gui/actions.h             |    5 +-
 pan/gui/e-charset.c           |    1 -
 pan/gui/gui.cc                |   12 +-
 pan/gui/header-pane.cc        |    3 +-
 pan/gui/pan.cc                |    2 +
 pan/tasks/task-article.cc     |    1 -
 pan/usenet-utils/mime-utils.h |    5 -
 22 files changed, 691 insertions(+), 511 deletions(-)
---
diff --git a/AUTHORS b/AUTHORS
index bec650e..2a8870a 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -6,7 +6,7 @@ PAN AUTHOR
 
 CONTRIBUTORS
 
-    Heinrich MÃller   <eddie_v gmx de>
+    Heinrich MÃller    <eddie_v gmx de>
     Kenneth Haley      <haleykd users sf net>
     Petr Kovar         <pknbe volny cz>
     Calin Culianu      <calin ajvar org>
diff --git a/INSTALL b/INSTALL
index 7d1c323..a1e89e1 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,8 +1,8 @@
 Installation Instructions
 *************************
 
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation,
+Inc.
 
    Copying and distribution of this file, with or without modification,
 are permitted in any medium without royalty provided the copyright
@@ -226,6 +226,11 @@ order to use an ANSI C compiler:
 
 and if that doesn't work, install pre-built binaries of GCC for HP-UX.
 
+   HP-UX `make' updates targets which have the same time stamps as
+their prerequisites, which makes it generally unusable when shipped
+generated files such as `configure' are involved.  Use GNU `make'
+instead.
+
    On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
 parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
 a workaround.  If GNU CC is not installed, it is therefore recommended
diff --git a/Makefile.am b/Makefile.am
index ab90417..31e5d2c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,6 @@
-SUBDIRS = help po uulib pan
+SUBDIRS = po uulib pan
+SUBDIRS += $(HELP_SUBDIR)
+
 
 @INTLTOOL_DESKTOP_RULE@
 
diff --git a/README b/README
index 15088bc..0a7d905 100644
--- a/README
+++ b/README
@@ -77,7 +77,8 @@ THE SALES PITCH
         * Non-binary, incomplete multipart, and saved messages can be filtered
           out of the article list.
 
-    Pan is good for Uploading Content to Usenet
+    Pan is good for Uploading Content to Usenet.
+
         * Files can be attached to a Usenet article and are
           automatically yEnc-encrypted, threaded and referenced by Pan.
         * Articles can be encrypted and/or signed with a public/private PGP key,
diff --git a/configure.in b/configure.in
index eb6772c..47eb5d1 100644
--- a/configure.in
+++ b/configure.in
@@ -53,7 +53,7 @@ GMIME26_REQUIRED=2.5.5
 GTK_REQUIRED=2.16.0
 GTK3_REQUIRED=3.0.0
 GTKSPELL_REQUIRED=2.0.7
-ENCHANT_REQUIRED=1.0.6
+ENCHANT_REQUIRED=1.6.0
 GNUTLS_REQUIRED=2.12.10
 LIBNOTIFY_REQUIRED=0.4.1
 LIBGKR_REQUIRED=3.2.2
@@ -89,10 +89,23 @@ AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
 AM_GLIB_GNU_GETTEXT
 panlocaledir='${prefix}/${DATADIRNAME}/locale'
 
+AC_ARG_WITH(gnome-doc-help, AC_HELP_STRING([--with-gnome-doc-help], [Enable Docbook Help (gnome-doc-utils) in Pan]),[want_gnome_doc_help=$withval], [want_gnome_doc_help=yes])
+if test "x$want_gnome_doc_help" = "xyes" ; then
+  AC_DEFINE(HAVE_HELP,[1], [Docbook Help in Pan (with gnome-doc-utils)])
+  HELP_SUBDIR = help
+fi
+AC_SUBST([HELP_SUBDIR])
+
+AC_ARG_WITH(gmime-crypto, AC_HELP_STRING([--with-gmime-crypto], [Enable GMIME Crypto support (overrides auto-on if GMime 2.6 is found)]),
+    [want_gmime_crypto=$withval], [want_gmime_crypto=yes])
+
+if test "x$want_gmime_crypto" = "xyes" ; then
+  AC_DEFINE(HAVE_GMIME_CRYPTO,[1],[crypto support (pgp) with gmime 2.6])
+fi
+
 AM_PATH_GLIB_2_0($GLIB_REQUIRED,,exit 1,gobject gmodule gthread)
-PKG_CHECK_MODULES([GMIME], [ gmime-2.6    >= $GMIME26_REQUIRED ],
-[AC_DEFINE(HAVE_GMIME_CRYPTO,[1],[crypto support (pgp) with gmime 2.6])],
-[PKG_CHECK_MODULES( [GMIME], [gmime-2.4    >= $GMIME24_REQUIRED] )] )
+PKG_CHECK_MODULES([GMIME], [ gmime-2.6    >= $GMIME26_REQUIRED ],[],
+  [PKG_CHECK_MODULES( [GMIME], [gmime-2.4    >= $GMIME24_REQUIRED] )] )
 
 AC_ARG_WITH(dbus, AC_HELP_STRING([--with-dbus], [Enable DBUS support]), [want_dbus=$withval], [want_dbus=yes])
 if test "x$want_dbus" = "xyes" ; then
@@ -102,17 +115,19 @@ fi
 gtkspell_msg=no
 AC_ARG_WITH(gtkspell, AC_HELP_STRING([--with-gtkspell], [Enable GtkSpell support]), [want_gtkspell=$withval], [want_gtkspell=yes])
 if test "x$want_gtkspell" = "xyes" ; then
-	PKG_CHECK_MODULES([GTKSPELL], [gtkspell-2.0 >= $GTKSPELL_REQUIRED],
+	PKG_CHECK_MODULES([GTKSPELL], [gtkspell-2.0 >= $GTKSPELL_REQUIRED enchant >= $ENCHANT_REQUIRED],
 	                  [
 	                  gtkspell_msg=yes
 	                  AC_DEFINE(HAVE_GTKSPELL,[1],[Spellcheck Library])
-                    PKG_CHECK_MODULES([ENCHANT], [enchant >= $ENCHANT_REQUIRED])
-	                  ],
+                    ],
 	                  [
 	                  gtkspell_msg=no
 	                  AC_MSG_RESULT(no)
 	                  ])
 fi
+AC_SUBST(ENCHANT_CFLAGS)
+AC_SUBST(ENCHANT_LIBS)
+
 
 gtk_msg=no
 AC_ARG_WITH(gtk3, AC_HELP_STRING([--with-gtk3], [Enable GTK3 support]), [want_gtk3=$withval], [want_gtk3=no])
diff --git a/pan/data-impl/Makefile.am b/pan/data-impl/Makefile.am
index dea396c..9dbb6d7 100644
--- a/pan/data-impl/Makefile.am
+++ b/pan/data-impl/Makefile.am
@@ -15,7 +15,8 @@ libpandata_a_SOURCES = \
  server.cc \
  my-tree.cc \
  task-archive.cc \
- xover.cc
+ xover.cc \
+ hotkeys.cc
 
 noinst_HEADERS = \
  article-filter.h \
diff --git a/pan/data-impl/data-impl.cc b/pan/data-impl/data-impl.cc
index 217fd77..60e76b5 100644
--- a/pan/data-impl/data-impl.cc
+++ b/pan/data-impl/data-impl.cc
@@ -46,6 +46,7 @@ using namespace pan;
 
 namespace
 {
+
   std::string get_cache_path ()
   {
     char * pch (g_build_filename (file::get_pan_home().c_str(), "article-cache", NULL));
@@ -76,8 +77,7 @@ DataImpl :: DataImpl (bool unit_test, int cache_megs, DataIO * io):
   _descriptions_loaded (false),
   newsrc_autosave_id (0),
   newsrc_autosave_timeout (0)
-//  ,
-//  _blowfish_inited(false)
+
 {
   rebuild_backend ();
 }
@@ -124,6 +124,7 @@ DataImpl :: save_state ()
     debug ("data-impl dtor saving xov, newsrc...");
     save_group_xovers (*_data_io);
     save_newsrc_files (*_data_io);
+    save_hotkeys (*_data_io);
   }
 }
 
@@ -161,54 +162,11 @@ DataImpl :: password_decrypt (PasswordData* pw) const
     "server", pw->server.c_str(),
     NULL);
 
-  std::string tmp;
-  if (pwd) tmp = pwd;
+  if (pwd) pw->pw = pwd;
   gnome_keyring_free_password(pwd);
-  pw->pw = tmp;
 
   return ret;
 }
 #endif
 
-//void
-//DataImpl :: blowfish_init ()
-//{
-//
-//  /TODO : Custom key with gtkwidget*
-//  if (!_blowfish_inited)
-//  {
-//    _blowfish_inited = true;
-//    char* key = (char*)"fjghdfjghdfkjg";
-//    _blowfish.Initialize(key, 14);
-//  }
-//}
-
-//void
-//DataImpl :: blowfish_encrypt (char* t, const StringView& s)
-//{
-//
-//  std::cerr<<"bf encrypt "<<s<<"\n";
-//
-//  size_t len (s.len);
-//  std::string str(s);
-//  int i(0);
-//  for (;i<len%8;++i) str += " ";
-//  _blowfish.Encode ((char*)str.c_str(),t,len+i);
-//
-//}
-
-//void
-//DataImpl :: blowfish_decrypt (char* t, size_t len)
-//{
-//
-//  std::cerr<<"bf decrypt "<<t<<" "<<len<<"\n";
-//
-//  std::string str((char*)t);
-//  int i(0);
-//  for (;i<len%8;++i) str += " ";
-//  char* buf = (char*)str.c_str();
-//  _blowfish.Decode (buf,buf,len+i);
-//  t = buf;
-//
-//}
 
diff --git a/pan/data-impl/data-impl.h b/pan/data-impl/data-impl.h
index 10f271c..d8afba7 100644
--- a/pan/data-impl/data-impl.h
+++ b/pan/data-impl/data-impl.h
@@ -53,6 +53,7 @@
 namespace pan
 {
   typedef std::vector<const Article*> articles_t;
+  typedef Data::PasswordData PasswordData;
 
   /**
    * File-based implementation of the `Data' backend interface.
@@ -68,8 +69,6 @@ namespace pan
     public ProfilesImpl
   {
 
-    typedef Data::PasswordData PasswordData;
-
     /**
     *** SERVERS
     **/
@@ -94,16 +93,6 @@ namespace pan
       ArticleCache _cache;
       CertStore _certstore;
 
-    private:
-//      CBlowFish _blowfish;
-//      bool _blowfish_inited;
-
-    public:
-//      void blowfish_init ();
-//      void blowfish_encrypt (char*, const StringView&);
-//      void blowfish_decrypt (char* t, size_t len);
-
-
     public:
 #ifdef HAVE_GKR
       GnomeKeyringResult password_encrypt (const PasswordData*);
@@ -295,11 +284,22 @@ namespace pan
       void load_group_permissions (const DataIO&);
       void save_group_permissions (DataIO&) const;
 
+      int  load_hotkeys (const DataIO&);
+      void save_hotkeys (DataIO&) const;
+      void create_hotkeys (const DataIO&);
+
       std::string get_newsrc_filename (const Quark& server) const;
       void load_newsrc (const Quark& server, LineReader*, alpha_groups_t&, alpha_groups_t&);
       void load_newsrc_files (const DataIO&);
       void save_newsrc_files (DataIO&) const;
 
+    public:
+
+      virtual int get_all_hotkeys()
+      {
+        return load_hotkeys(*_data_io);
+      }
+
     public: // mutators
 
       virtual void add_groups                 (const Quark       & server,
@@ -469,8 +469,7 @@ namespace pan
                   const Quark           & save_path,  // for auto-download
                   const Data::ShowType    show_type,
                   const FilterInfo      * filter_info=0,
-                  const RulesInfo       * rules=0,
-                        Queue           * queue=0);
+                  const RulesInfo       * rules=0);
           virtual ~MyTree ();
 
         public: // from ArticleTree
@@ -530,8 +529,7 @@ namespace pan
                                                 const Quark        & save_path,
                                                 const ShowType      show_type = SHOW_ARTICLES,
                                                 const FilterInfo   * criteria=0,
-                                                const RulesInfo    * rules=0,
-                                                      Queue        * queue=0) const;
+                                                const RulesInfo    * rules=0) const;
 
       virtual void group_clear_articles        (const Quark        & group);
 
diff --git a/pan/data-impl/data-io.cc b/pan/data-impl/data-io.cc
index 828ac2b..0b5c29c 100644
--- a/pan/data-impl/data-io.cc
+++ b/pan/data-impl/data-io.cc
@@ -117,9 +117,9 @@ DataIO :: get_server_filename () const
 }
 
 std::string
-DataIO :: get_lock_filename ()
+DataIO :: get_hotkey_filename () const
 {
-  return get_pan_home_file ("pan.lock");
+  return get_pan_home_file ("pan.hotkeys");
 }
 
 /****
@@ -170,6 +170,12 @@ DataIO :: read_group_headers (const Quark& group) const
 }
 
 LineReader*
+DataIO :: read_hotkeys () const
+{
+  return new FileLineReader (get_hotkey_filename());
+}
+
+LineReader*
 DataIO :: read_file (const StringView& filename) const
 {
   return new FileLineReader (filename);
@@ -251,6 +257,12 @@ DataIO :: write_group_permissions ()
 }
 
 std::ostream*
+DataIO :: write_hotkeys ()
+{
+  return write_file (get_hotkey_filename ());
+}
+
+std::ostream*
 DataIO :: write_group_headers (const Quark& group)
 {
   return write_file (get_group_headers_filename (group));
diff --git a/pan/data-impl/data-io.h b/pan/data-impl/data-io.h
index 0efe6e8..60f1380 100644
--- a/pan/data-impl/data-io.h
+++ b/pan/data-impl/data-io.h
@@ -42,7 +42,7 @@ namespace pan
     virtual std::string get_scorefile_name () const;
     virtual std::string get_posting_name () const;
     virtual std::string get_server_filename () const;
-    static std::string get_lock_filename () ;
+    virtual std::string get_hotkey_filename () const;
 
     virtual void clear_group_headers (const Quark& group);
 
@@ -51,6 +51,7 @@ namespace pan
     virtual LineReader* read_group_headers (const Quark& group) const;
     virtual LineReader* read_group_descriptions () const;
     virtual LineReader* read_group_permissions () const;
+    virtual LineReader* read_hotkeys () const;
 
     virtual std::ostream* write_tasks ();
     virtual std::ostream* write_server_properties ();
@@ -58,6 +59,7 @@ namespace pan
     virtual std::ostream* write_group_descriptions ();
     virtual std::ostream* write_group_permissions ();
     virtual std::ostream* write_group_headers (const Quark& group);
+    virtual std::ostream* write_hotkeys ();
     virtual void write_done (std::ostream*);
 
     virtual LineReader* read_file (const StringView& filename) const;
diff --git a/pan/data-impl/headers.cc b/pan/data-impl/headers.cc
index b974263..fee1ba2 100644
--- a/pan/data-impl/headers.cc
+++ b/pan/data-impl/headers.cc
@@ -869,6 +869,7 @@ DataImpl :: save_headers (DataIO& data_io, const Quark& group) const
 *******/
 namespace
 {
+  /* autosave newsrc files */
   gboolean nrc_as_cb(gpointer ptr)
   {
     DataImpl *data = static_cast<DataImpl*>(ptr);
@@ -1225,9 +1226,8 @@ DataImpl :: group_get_articles (const Quark       & group,
                                 const Quark       & save_path,
                                 const ShowType      show_type,
                                 const FilterInfo  * filter,
-                                const RulesInfo   * rules,
-                                      Queue       * queue) const
+                                const RulesInfo   * rules) const
 {
   // cast const away for group_ref()... consider _groups mutable
-  return new MyTree (*const_cast<DataImpl*>(this), group, save_path, show_type, filter, rules,queue);
+  return new MyTree (*const_cast<DataImpl*>(this), group, save_path, show_type, filter, rules);
 }
diff --git a/pan/data-impl/hotkeys.cc b/pan/data-impl/hotkeys.cc
new file mode 100644
index 0000000..31cc994
--- /dev/null
+++ b/pan/data-impl/hotkeys.cc
@@ -0,0 +1,123 @@
+/* -*- 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
+ */
+
+#include <config.h>
+extern "C" {
+  #include <glib/gi18n.h>
+}
+
+#include <pan/general/file-util.h>
+#include <pan/general/macros.h>
+#include <pan/general/log.h>
+
+#include "data-io.h"
+#include "data-impl.h"
+
+using namespace pan;
+
+int
+DataImpl :: load_hotkeys(const DataIO& io)
+{
+  LineReader * in (io.read_hotkeys());
+
+  StringView line, tok;
+  StringView tokens[2]; // tokens[0] is the action string, tokens[1] is the hotkey string
+  int i(0);
+  int num_keys(0), num_togglekeys(0);
+  bool togglekeys(false);
+
+  while (in && !in->fail() && in->getline(line))
+  {
+    if (line.len && *line.str=='#')
+    {
+      if (line.strstr("toggle")) togglekeys=true;
+      continue;
+    }
+
+    tokens[0].clear();
+    tokens[1].clear();
+
+    while (line.pop_token(tok))
+    {
+      tokens[i++] = tok;
+      if (i>1) break;
+    }
+    i = 0;
+
+    if (!togglekeys)
+    {
+      _hotkeys[tokens[0]] = tokens[1];
+      ++num_keys;
+    }
+    else
+    {
+      _toggle_hotkeys[tokens[0]] = tokens[1];
+      ++num_togglekeys;
+    }
+  }
+
+  const int cnt (num_keys+num_togglekeys);
+
+  if (cnt > 0) Log::add_info_va ("Imported %d shortcuts from file.",cnt);
+
+  delete in;
+
+  return cnt;
+}
+
+void
+DataImpl :: save_hotkeys (DataIO& io) const
+{
+
+  if (_unit_test)
+    return;
+
+  if (_hotkeys.empty() && _toggle_hotkeys.empty()) return;
+
+  std::ostream& out (*io.write_hotkeys ());
+
+  out << "# Hotkeys file. Hotkeys are separated with spaces.\n"
+      << "# Each hotkey occupies one line.\n"
+      << "# Please don't edit this file, Pan handles that!\n"
+      << "# If you want to edit it anyway for testing, please \n"
+      << "# leave the comment lines intact!!\n"
+      << "# \n"
+      << "# normal hotkeys\n"
+      << "# \n";
+
+  foreach_const (hotkeys_t, _hotkeys, it) {
+    out << it->first;
+    out.put (' ');
+    out << it->second;
+    out.put ('\n');
+  }
+
+  out<<"#\n# toggle hotkeys\n#\n";
+
+  foreach_const (hotkeys_t, _toggle_hotkeys, it) {
+    out << it->first;
+    out.put (' ');
+    out << it->second;
+    out.put ('\n');
+  }
+
+  io.write_done (&out);
+
+}
+
diff --git a/pan/data-impl/my-tree.cc b/pan/data-impl/my-tree.cc
index 03d6b1f..89f707a 100644
--- a/pan/data-impl/my-tree.cc
+++ b/pan/data-impl/my-tree.cc
@@ -148,14 +148,12 @@ DataImpl :: MyTree :: MyTree (DataImpl              & data_impl,
                               const Quark           & save_path,
                               const Data::ShowType    show_type,
                               const FilterInfo      * filter,
-                              const RulesInfo       * rules,
-                                    Queue           * queue):
+                              const RulesInfo       * rules):
   _group (group),
   _data (data_impl),
   _save_path(save_path)
 {
 
-  _data.set_queue(queue);
   _data.ref_group (_group);
   _data._trees.insert (this);
 
diff --git a/pan/data/data.h b/pan/data/data.h
index 49e31c8..4c9bcf8 100644
--- a/pan/data/data.h
+++ b/pan/data/data.h
@@ -43,6 +43,8 @@
 
 namespace pan
 {
+  typedef std::map<Quark,Quark> hotkeys_t;
+
   class FilterInfo;
   class RulesInfo;
   class Queue;
@@ -174,6 +176,9 @@ namespace pan
   {
 
     public:
+      hotkeys_t _hotkeys, _toggle_hotkeys;
+
+    public:
       struct PasswordData
       {
         Quark server;
@@ -559,8 +564,7 @@ namespace pan
                                                 const Quark       & save_path,  // for auto-download
                                                 const ShowType      show_type = SHOW_ARTICLES,
                                                 const FilterInfo  * criteria = 0,
-                                                const RulesInfo   * rules    = 0,
-                                                      Queue       * queue = 0) const=0;
+                                                const RulesInfo   * rules    = 0) const=0;
 
        virtual void group_clear_articles (const Quark& group) = 0;
 
@@ -593,6 +597,13 @@ namespace pan
       void set_queue (Queue* q) { _queue = q; }
       Queue* get_queue () { return _queue; }
 
+      const hotkeys_t& get_hotkeys() const { return _hotkeys; }
+      const hotkeys_t& get_toggle_hotkeys() const { return _toggle_hotkeys; }
+      hotkeys_t& get_hotkeys() { return _hotkeys; }
+      hotkeys_t& get_toggle_hotkeys() { return _toggle_hotkeys; }
+      ///TODO move these upper two to dataimpl and make virtual
+      virtual int get_all_hotkeys () = 0;
+
     private:
       Queue * _queue;
 
diff --git a/pan/gui/actions.cc b/pan/gui/actions.cc
index 6a1ee8f..351f164 100644
--- a/pan/gui/actions.cc
+++ b/pan/gui/actions.cc
@@ -23,6 +23,7 @@ extern "C" {
   #include "gtk-compat.h"
 }
 #include <pan/general/debug.h>
+#include <pan/data-impl/data-impl.h>
 #include <pan/tasks/task-xover.h>
 #include <pan/icons/pan-pixbufs.h>
 #include "actions.h"
@@ -33,6 +34,7 @@ using pan::PanUI;
 
 namespace
 {
+
   PanUI * pan_ui (0);
   Prefs * prefs (0);
 
@@ -261,415 +263,413 @@ namespace
   void do_match_only_my_articles (GtkToggleAction * a) { pan_ui->do_match_only_my_articles (gtk_toggle_action_get_active(a)); }
   void do_match_only_unread_articles (GtkToggleAction * a) { pan_ui->do_match_only_unread_articles (gtk_toggle_action_get_active(a)); }
 
-  GtkActionEntry entries[] =
-  {
-
-    { "file-menu", NULL, N_("_File"), NULL, NULL, NULL },
-    { "edit-menu", NULL, N_("_Edit"), NULL, NULL, NULL },
-    { "view-layout-menu", NULL, N_("_Layout"), NULL, NULL, NULL },
-    { "view-group-pane-menu", NULL, N_("_Group Pane"), NULL, NULL, NULL },
-    { "view-header-pane-menu", NULL, N_("_Header Pane"), NULL, NULL, NULL },
-    { "view-body-pane-menu", NULL, N_("_Body Pane"), NULL, NULL, NULL },
-    { "view-menu", NULL, N_("_View"), NULL, NULL, NULL },
-    { "filter-menu", NULL, N_("Filte_r"), NULL, NULL, NULL },
-    { "go-menu", NULL, N_("_Go"), NULL, NULL, NULL },
-    { "actions-menu", NULL, N_("_Actions"), NULL, NULL, NULL },
-    { "article-actions-menu", NULL, N_("_Articles"), NULL, NULL, NULL },
-    { "group-actions-menu", NULL, N_("G_roups"), NULL, NULL, NULL },
-    { "posting-actions-menu", NULL, N_("_Post"), NULL, NULL, NULL },
-    { "post-menu", NULL, N_("_Post"), NULL, NULL, NULL },
-    { "help-menu", NULL, N_("_Help"), NULL, NULL, NULL },
-
-    { "read-selected-group", "ICON_READ_MORE",
-      N_("_Read Group"), NULL,
-      N_("Read Group"),
-      G_CALLBACK(do_read_selected_group) },
-
-    { "mark-groups-read", GTK_STOCK_CLEAR,
-      N_("_Mark Selected Groups Read"), "<control><shift>M",
-      N_("Mark Selected Groups Read"),
-      G_CALLBACK(do_mark_selected_groups_read) },
-
-    { "delete-groups-articles", GTK_STOCK_DELETE,
-      N_("_Delete Selected Groups' Articles"), "<control><shift>Delete",
-      N_("Delete Selected Groups' Articles"),
-      G_CALLBACK(do_clear_selected_groups) },
-
-    { "get-new-headers-in-selected-groups", "ICON_GET_SELECTED",
-      N_("Get New _Headers in Selected Groups"), "A",
-      N_("Get New Headers in Selected Groups"),
-      G_CALLBACK(do_xover_selected_groups) },
-
-    { "get-new-headers-in-subscribed-groups", "ICON_GET_SUBSCRIBED",
-      N_("Get New _Headers in Subscribed Groups"), "<shift>A",
-      N_("Get New Headers in Subscribed Groups"),
-      G_CALLBACK(do_xover_subscribed_groups) },
-
-    { "update-stats-in-selected-groups", "ICON_GET_SUBSCRIBED",
-      N_("Get New _Headers in Subscribed Groups"), "<shift>A",
-      N_("Get New Headers in Subscribed Groups"),
-      G_CALLBACK(do_xover_subscribed_groups) },
-
-    { "download-headers", "ICON_GET_DIALOG",
-      N_("Get _Headers..."), "",
-      N_("Get Headers..."),
-      G_CALLBACK(do_download_headers) },
-
-    { "refresh-group-list", NULL,
-      N_("Refresh Group List"), "",
-      N_("Refresh Group List"),
-      G_CALLBACK(do_refresh_groups) },
-
-    { "subscribe", NULL,
-      N_("_Subscribe"), NULL,
-      N_("Subscribe"),
-      G_CALLBACK(do_subscribe_selected_groups) },
-
-    { "unsubscribe", NULL,
-      N_("_Unsubscribe"), NULL,
-      N_("Unsubscribe"),
-      G_CALLBACK(do_unsubscribe_selected_groups) },
-
-    { "save-articles", GTK_STOCK_SAVE,
-      N_("_Save Articles..."), "<shift>S",
-      N_("Save Articles..."),
-      G_CALLBACK(do_save_articles) },
-
-    { "save-articles-from-nzb", GTK_STOCK_SAVE,
-      N_("Save Articles from Selected _NZB..."), "<control><shift>S",
-      N_("Save Articles from Selected NZB"),
-      G_CALLBACK(do_save_articles_from_nzb) },
-
-    { "save-articles-to-nzb", GTK_STOCK_SAVE,
-      N_("Save Articles to an NZB _File..."), "<control><shift>F",
-      N_("Save Articles to an NZB File"),
-      G_CALLBACK(do_save_articles_to_nzb) },
-
-    { "print", GTK_STOCK_PRINT,
-      NULL, "<control>P",
-      NULL,
-      G_CALLBACK(do_print) },
-
-    { "import-tasks", GTK_STOCK_OPEN,
-      N_("_Import NZB Files..."), NULL,
-      NULL,
-      G_CALLBACK(do_import_tasks) },
-
-    { "cancel-last-task", GTK_STOCK_CANCEL,
-      N_("_Cancel Last Task"), "<control>Delete",
-      NULL,
-      G_CALLBACK(do_cancel_latest_task) },
-
-    { "show-task-window", NULL,
-      N_("_Task Manager"), NULL,
-      NULL,
-      G_CALLBACK(do_show_task_window) },
-
-    { "show-log-dialog", GTK_STOCK_DIALOG_INFO,
-      N_("_Event Log"), NULL,
-      NULL,
-      G_CALLBACK(do_show_log_window) },
-
-    { "quit", NULL,
-      N_("_Quit"), "<control>Q",
-      NULL,
-      G_CALLBACK(do_quit) },
-
-    { "select-all-articles", NULL,
-      N_("Select _All Articles"), "<control>D",
-      NULL,
-      G_CALLBACK(do_select_all_articles) },
-
-    { "unselect-all-articles", NULL,
-      N_("_Deselect All Articles"), "<shift><control>D",
-      NULL,
-      G_CALLBACK(do_unselect_all_articles) },
-
-    { "add-subthreads-to-selection", NULL,
-      N_("Add Su_bthreads to Selection"), "D",
-      NULL,
-      G_CALLBACK(do_add_subthreads_to_selection) },
-
-    { "add-threads-to-selection", NULL,
-      N_("Add _Threads to Selection"), "<shift>D",
-      NULL,
-      G_CALLBACK(do_add_threads_to_selection) },
-
-    { "add-similar-articles-to-selection", NULL,
-      N_("Add _Similar Articles to Selection"), "<control>S",
-      NULL,
-      G_CALLBACK(do_add_similar_to_selection) },
-
-    { "select-article-body", NULL,
-      N_("Select Article _Body"), NULL,
-      NULL,
-      G_CALLBACK(do_select_article_body) },
-
-    { "show-preferences-dialog", GTK_STOCK_PREFERENCES,
-      N_("Edit _Preferences"), NULL,
-      NULL,
-      G_CALLBACK(do_show_preferences_dialog) },
-
-    { "show-group-preferences-dialog", GTK_STOCK_PREFERENCES,
-      N_("Edit Selected _Group's Preferences"), NULL,
-      NULL,
-      G_CALLBACK(do_show_group_preferences_dialog) },
-
-    { "show-profiles-dialog", GTK_STOCK_EDIT,
-      N_("Edit P_osting Profiles"), NULL,
-      NULL,
-      G_CALLBACK(do_show_profiles_dialog) },
-
-    { "show-servers-dialog", GTK_STOCK_NETWORK,
-      N_("Edit _News Servers"), NULL,
-      NULL,
-      G_CALLBACK(do_show_servers_dialog) },
-
-    { "jump-to-group-tab", GTK_STOCK_JUMP_TO,
-      N_("Jump to _Group Tab"), "1",
-      NULL,
-      G_CALLBACK(do_jump_to_group_tab) },
-
-    { "jump-to-header-tab", GTK_STOCK_JUMP_TO,
-      N_("Jump to _Header Tab"), "2",
-      NULL,
-      G_CALLBACK(do_jump_to_header_tab) },
-
-    { "jump-to-body-tab", GTK_STOCK_JUMP_TO,
-      N_("Jump to _Body Tab"), "3",
-      NULL,
-      G_CALLBACK(do_jump_to_body_tab) },
-
-    { "rot13-selected-text", NULL,
-      N_("_Rot13 Selected Text"), "<control><shift>R",
-      NULL,
-      G_CALLBACK(do_rot13_selected_text) },
-
-    { "clear-header-pane", NULL,
-      N_("Clear _Header Pane"), NULL,
-      NULL,
-      G_CALLBACK(do_clear_header_pane) },
-
-    { "clear-body-pane", NULL,
-      N_("Clear _Body Pane"), NULL,
-      NULL,
-      G_CALLBACK(do_clear_body_pane) },
-
-    { "download-selected-article", "ICON_DISK",
-      N_("Cache Article"), NULL,
-      NULL,
-      G_CALLBACK(do_download_selected_article) },
-
-    { "read-selected-article", "ICON_READ_MORE",
-      N_("Read Article"), NULL,
-      NULL,
-      G_CALLBACK(do_read_selected_article) },
-
-    { "show-selected-article-info", NULL,
-      N_("Show Article Information"), NULL,
-      NULL,
-      G_CALLBACK(do_show_selected_article_info) },
-
-    { "read-more", "ICON_READ_MORE",
-      N_("Read _More"), "space",
-      N_("Read More"),
-      G_CALLBACK(do_read_more) },
-
-    { "read-less", "ICON_READ_LESS",
-      N_("Read _Back"), "BackSpace",
-      N_("Read Back"),
-      G_CALLBACK(do_read_less) },
-
-    { "read-next-unread-group", "ICON_READ_UNREAD_GROUP",
-      N_("Next _Unread Group"), "G",
-      NULL,
-      G_CALLBACK(do_read_next_unread_group) },
-
-    { "read-next-group", "ICON_READ_GROUP",
-      N_("Next _Group"), "<shift>G",
-      NULL,
-      G_CALLBACK(do_read_next_group) },
-
-    { "read-next-unread-article", "ICON_READ_UNREAD_ARTICLE",
-      N_("Next _Unread Article"), "N",
-      N_("Next Unread Article"),
-      G_CALLBACK(do_read_next_unread_article) },
-
-    { "read-next-article", NULL,
-      N_("Next _Article"), "<control>N",
-      N_("Next Article"),
-      G_CALLBACK(do_read_next_article) },
-
-    { "read-next-watched-article", NULL,
-      N_("Next _Watched Article"), "<control><shift>N",
-      NULL,
-      G_CALLBACK(do_read_next_watched_article) },
-
-    { "read-next-unread-thread", "ICON_READ_UNREAD_THREAD",
-      N_("Next Unread _Thread"), "T",
-      N_("Next Unread Thread"),
-      G_CALLBACK(do_read_next_unread_thread) },
-
-    { "read-next-thread", NULL,
-      N_("Next Threa_d"), "<control>T",
-      NULL,
-      G_CALLBACK(do_read_next_thread) },
-
-    { "read-previous-article", NULL,
-      N_("Pre_vious Article"), "V",
-      NULL,
-      G_CALLBACK(do_read_previous_article) },
-
-    { "read-previous-thread", NULL,
-      N_("Previous _Thread"), "<control>V",
-      NULL,
-
-      G_CALLBACK(do_read_previous_thread) },
-    { "read-parent-article", NULL,
-      N_("_Parent Article"), "U",
-      NULL,
-      G_CALLBACK(do_read_parent_article) },
-
-    { "plonk", NULL,
-      N_("Ignore _Author"), NULL,
-      NULL,
-      G_CALLBACK(do_plonk) },
-    { "watch-thread", NULL,
-      N_("_Watch Thread"), NULL,
-      NULL,
-      G_CALLBACK(do_watch) },
-
-    { "ignore-thread", NULL,
-      N_("_Ignore Thread"), NULL,
-      NULL,
-      G_CALLBACK(do_ignore) },
-
-    { "flag-thread", "ICON_FLAGGED",
-      N_("_Toggle Flag On/Off for Thread"), "X",
-      N_("_Toggle Flag On/Off for Thread"),
-      G_CALLBACK(do_flag) },
-
-    { "unflag-thread", NULL,
-      N_("_Turn Flag Off for Thread"), "<shift>X",
-      N_("_Turn Flag Off for Thread"),
-      G_CALLBACK(do_flag_off) },
-
-    { "select-all-flagged", NULL,
-      N_("_Select All Flagged Threads"), "<control>X",
-      N_("_Select All Flagged Threads"),
-      G_CALLBACK(do_mark_all_flagged) },
-
-    { "next-flagged", NULL,
-      N_("_Go to Next Flagged Thread"), "plus",
-      N_("_Go to Next Flagged Thread"),
-      G_CALLBACK(do_next_flag) },
-
-    { "last-flagged", NULL,
-      N_("_Go to Last Flagged Thread"), "minus",
-      N_("_Go to Last Flagged Thread"),
-      G_CALLBACK(do_last_flag) },
-
-    { "invert-selection", NULL,
-      N_("_Invert Selection"), "<control>I",
-      N_("_Invert Selection"),
-      G_CALLBACK(do_invert_selection) },
-
-    { "view-article-score", "ICON_SCORE",
-      N_("Edit Article's Watch/Ignore/Score..."), "<control><shift>C",
-      NULL,
-      G_CALLBACK(do_show_score_dialog) },
-
-    { "add-article-score", "ICON_SCORE",
-      N_("Add a _Scoring Rule..."), "S",
-      NULL,
-      G_CALLBACK(do_show_new_score_dialog) },
-
-    { "cancel-article", NULL,
-      N_("Cance_l Article..."), NULL,
-      NULL,
-      G_CALLBACK(do_cancel_article) },
-
-    { "supersede-article", NULL,
-      N_("_Supersede Article..."), NULL,
-      NULL,
-      G_CALLBACK(do_supersede_article) },
-
-    { "delete-article", GTK_STOCK_DELETE,
-      N_("_Delete Article"), "Delete",
-      NULL,
-      G_CALLBACK(do_delete_article) },
-
-    { "clear-article-cache", NULL,
-      N_("Clear Article Cache"), NULL,
-      NULL,
-      G_CALLBACK(do_clear_article_cache) },
-
-    { "mark-article-read", "ICON_ARTICLE_READ",
-      N_("_Mark Article as Read"), "M",
-      NULL,
-      G_CALLBACK(do_mark_article_read) },
-
-    { "mark-article-unread", "ICON_ARTICLE_UNREAD",
-      N_("Mark Article as _Unread"), "<control>M",
-      NULL,
-      G_CALLBACK(do_mark_article_unread) },
-
-    ///TODO create icons for the next two actions
-    { "mark-thread-read", "ICON_ARTICLE_READ",
-      N_("_Mark Thread as Read"), "<Shift>T",
-      NULL,
-      G_CALLBACK(do_mark_thread_read) },
-
-    { "mark-thread-unread", "ICON_ARTICLE_UNREAD",
-      N_("Mark Thread as _Unread"), "<control><Shift>T",
-      NULL,
-      G_CALLBACK(do_mark_thread_unread) },
-
-    { "post", "ICON_COMPOSE_POST",
-      N_("_Post to Newsgroup"), "P",
-      N_("Post to Newsgroup"),
-      G_CALLBACK(do_post) },
-
-    { "followup-to", "ICON_COMPOSE_FOLLOWUP",
-      N_("_Followup to Newsgroup"), "F",
-      N_("Followup to Newsgroup"),
-      G_CALLBACK(do_followup_to) },
-
-    { "reply-to", NULL,
-      N_("_Reply to Author in Mail"), "R",
-      NULL,
-      G_CALLBACK(do_reply_to) },
-
-    { "pan-manual", NULL,
-      N_("_Contents"), "F1", 
-      NULL,
-      G_CALLBACK(do_pan_manual) },
-
-    { "pan-web-page", NULL,
-      N_("_Pan Home Page"), NULL,
-      NULL,
-      G_CALLBACK(do_pan_web) },
-
-    { "bug-report", NULL,
-      N_("Give _Feedback or Report a Bug..."), NULL,
-      NULL,
-      G_CALLBACK(do_bug_report) },
-
-    { "tip-jar", NULL,
-      N_("_Tip Jar..."), NULL,
-      NULL,
-      G_CALLBACK(do_tip_jar) },
-
-    { "about-pan", GTK_STOCK_ABOUT,
-      N_("_About"), NULL,
-      NULL,
-      G_CALLBACK(do_about_pan) },
-
-    { "show-sec-dialog", GTK_STOCK_DIALOG_AUTHENTICATION,
-      N_("Edit _SSL Certificates"), NULL,
-      NULL,
-      G_CALLBACK(do_show_sec_dialog) },
-  };
+    GtkActionEntry entries[] =
+    {
+      { "file-menu", NULL, N_("_File"), NULL, NULL, NULL },
+      { "edit-menu", NULL, N_("_Edit"), NULL, NULL, NULL },
+      { "view-layout-menu", NULL, N_("_Layout"), NULL, NULL, NULL },
+      { "view-group-pane-menu", NULL, N_("_Group Pane"), NULL, NULL, NULL },
+      { "view-header-pane-menu", NULL, N_("_Header Pane"), NULL, NULL, NULL },
+      { "view-body-pane-menu", NULL, N_("_Body Pane"), NULL, NULL, NULL },
+      { "view-menu", NULL, N_("_View"), NULL, NULL, NULL },
+      { "filter-menu", NULL, N_("Filte_r"), NULL, NULL, NULL },
+      { "go-menu", NULL, N_("_Go"), NULL, NULL, NULL },
+      { "actions-menu", NULL, N_("_Actions"), NULL, NULL, NULL },
+      { "article-actions-menu", NULL, N_("_Articles"), NULL, NULL, NULL },
+      { "group-actions-menu", NULL, N_("G_roups"), NULL, NULL, NULL },
+      { "posting-actions-menu", NULL, N_("_Post"), NULL, NULL, NULL },
+      { "post-menu", NULL, N_("_Post"), NULL, NULL, NULL },
+      { "help-menu", NULL, N_("_Help"), NULL, NULL, NULL },
+
+      { "read-selected-group", "ICON_READ_MORE",
+        N_("_Read Group"), NULL,
+        N_("Read Group"),
+        G_CALLBACK(do_read_selected_group) },
+
+      { "mark-groups-read", GTK_STOCK_CLEAR,
+        N_("_Mark Selected Groups Read"), "<control><shift>M",
+        N_("Mark Selected Groups Read"),
+        G_CALLBACK(do_mark_selected_groups_read) },
+
+      { "delete-groups-articles", GTK_STOCK_DELETE,
+        N_("_Delete Selected Groups' Articles"), "<control><shift>Delete",
+        N_("Delete Selected Groups' Articles"),
+        G_CALLBACK(do_clear_selected_groups) },
+
+      { "get-new-headers-in-selected-groups", "ICON_GET_SELECTED",
+        N_("Get New _Headers in Selected Groups"), "A",
+        N_("Get New Headers in Selected Groups"),
+        G_CALLBACK(do_xover_selected_groups) },
+
+      { "get-new-headers-in-subscribed-groups", "ICON_GET_SUBSCRIBED",
+        N_("Get New _Headers in Subscribed Groups"), "<shift>A",
+        N_("Get New Headers in Subscribed Groups"),
+        G_CALLBACK(do_xover_subscribed_groups) },
+
+      { "update-stats-in-selected-groups", "ICON_GET_SUBSCRIBED",
+        N_("Get New _Headers in Subscribed Groups"), "<shift>A",
+        N_("Get New Headers in Subscribed Groups"),
+        G_CALLBACK(do_xover_subscribed_groups) },
+
+      { "download-headers", "ICON_GET_DIALOG",
+        N_("Get _Headers..."), "",
+        N_("Get Headers..."),
+        G_CALLBACK(do_download_headers) },
+
+      { "refresh-group-list", NULL,
+        N_("Refresh Group List"), "",
+        N_("Refresh Group List"),
+        G_CALLBACK(do_refresh_groups) },
+
+      { "subscribe", NULL,
+        N_("_Subscribe"), NULL,
+        N_("Subscribe"),
+        G_CALLBACK(do_subscribe_selected_groups) },
+
+      { "unsubscribe", NULL,
+        N_("_Unsubscribe"), NULL,
+        N_("Unsubscribe"),
+        G_CALLBACK(do_unsubscribe_selected_groups) },
+
+      { "save-articles", GTK_STOCK_SAVE,
+        N_("_Save Articles..."), "<shift>S",
+        N_("Save Articles..."),
+        G_CALLBACK(do_save_articles) },
+
+      { "save-articles-from-nzb", GTK_STOCK_SAVE,
+        N_("Save Articles from Selected _NZB..."), "<control><shift>S",
+        N_("Save Articles from Selected NZB"),
+        G_CALLBACK(do_save_articles_from_nzb) },
+
+      { "save-articles-to-nzb", GTK_STOCK_SAVE,
+        N_("Save Articles to an NZB _File..."), "<control><shift>F",
+        N_("Save Articles to an NZB File"),
+        G_CALLBACK(do_save_articles_to_nzb) },
+
+      { "print", GTK_STOCK_PRINT,
+        NULL, "<control>P",
+        NULL,
+        G_CALLBACK(do_print) },
+
+      { "import-tasks", GTK_STOCK_OPEN,
+        N_("_Import NZB Files..."), NULL,
+        NULL,
+        G_CALLBACK(do_import_tasks) },
+
+      { "cancel-last-task", GTK_STOCK_CANCEL,
+        N_("_Cancel Last Task"), "<control>Delete",
+        NULL,
+        G_CALLBACK(do_cancel_latest_task) },
+
+      { "show-task-window", NULL,
+        N_("_Task Manager"), NULL,
+        NULL,
+        G_CALLBACK(do_show_task_window) },
+
+      { "show-log-dialog", GTK_STOCK_DIALOG_INFO,
+        N_("_Event Log"), NULL,
+        NULL,
+        G_CALLBACK(do_show_log_window) },
+
+      { "quit", NULL,
+        N_("_Quit"), "<control>Q",
+        NULL,
+        G_CALLBACK(do_quit) },
+
+      { "select-all-articles", NULL,
+        N_("Select _All Articles"), "<control>D",
+        NULL,
+        G_CALLBACK(do_select_all_articles) },
+
+      { "unselect-all-articles", NULL,
+        N_("_Deselect All Articles"), "<shift><control>D",
+        NULL,
+        G_CALLBACK(do_unselect_all_articles) },
+
+      { "add-subthreads-to-selection", NULL,
+        N_("Add Su_bthreads to Selection"), "D",
+        NULL,
+        G_CALLBACK(do_add_subthreads_to_selection) },
+
+      { "add-threads-to-selection", NULL,
+        N_("Add _Threads to Selection"), "<shift>D",
+        NULL,
+        G_CALLBACK(do_add_threads_to_selection) },
+
+      { "add-similar-articles-to-selection", NULL,
+        N_("Add _Similar Articles to Selection"), "<control>S",
+        NULL,
+        G_CALLBACK(do_add_similar_to_selection) },
+
+      { "select-article-body", NULL,
+        N_("Select Article _Body"), NULL,
+        NULL,
+        G_CALLBACK(do_select_article_body) },
+
+      { "show-preferences-dialog", GTK_STOCK_PREFERENCES,
+        N_("Edit _Preferences"), NULL,
+        NULL,
+        G_CALLBACK(do_show_preferences_dialog) },
+
+      { "show-group-preferences-dialog", GTK_STOCK_PREFERENCES,
+        N_("Edit Selected _Group's Preferences"), NULL,
+        NULL,
+        G_CALLBACK(do_show_group_preferences_dialog) },
+
+      { "show-profiles-dialog", GTK_STOCK_EDIT,
+        N_("Edit P_osting Profiles"), NULL,
+        NULL,
+        G_CALLBACK(do_show_profiles_dialog) },
+
+      { "show-servers-dialog", GTK_STOCK_NETWORK,
+        N_("Edit _News Servers"), NULL,
+        NULL,
+        G_CALLBACK(do_show_servers_dialog) },
+
+      { "jump-to-group-tab", GTK_STOCK_JUMP_TO,
+        N_("Jump to _Group Tab"), "1",
+        NULL,
+        G_CALLBACK(do_jump_to_group_tab) },
+
+      { "jump-to-header-tab", GTK_STOCK_JUMP_TO,
+        N_("Jump to _Header Tab"), "2",
+        NULL,
+        G_CALLBACK(do_jump_to_header_tab) },
+
+      { "jump-to-body-tab", GTK_STOCK_JUMP_TO,
+        N_("Jump to _Body Tab"), "3",
+        NULL,
+        G_CALLBACK(do_jump_to_body_tab) },
+
+      { "rot13-selected-text", NULL,
+        N_("_Rot13 Selected Text"), "<control><shift>R",
+        NULL,
+        G_CALLBACK(do_rot13_selected_text) },
+
+      { "clear-header-pane", NULL,
+        N_("Clear _Header Pane"), NULL,
+        NULL,
+        G_CALLBACK(do_clear_header_pane) },
+
+      { "clear-body-pane", NULL,
+        N_("Clear _Body Pane"), NULL,
+        NULL,
+        G_CALLBACK(do_clear_body_pane) },
+
+      { "download-selected-article", "ICON_DISK",
+        N_("Cache Article"), NULL,
+        NULL,
+        G_CALLBACK(do_download_selected_article) },
+
+      { "read-selected-article", "ICON_READ_MORE",
+        N_("Read Article"), NULL,
+        NULL,
+        G_CALLBACK(do_read_selected_article) },
+
+      { "show-selected-article-info", NULL,
+        N_("Show Article Information"), NULL,
+        NULL,
+        G_CALLBACK(do_show_selected_article_info) },
+
+      { "read-more", "ICON_READ_MORE",
+        N_("Read _More"), "space",
+        N_("Read More"),
+        G_CALLBACK(do_read_more) },
+
+      { "read-less", "ICON_READ_LESS",
+        N_("Read _Back"), "BackSpace",
+        N_("Read Back"),
+        G_CALLBACK(do_read_less) },
+
+      { "read-next-unread-group", "ICON_READ_UNREAD_GROUP",
+        N_("Next _Unread Group"), "G",
+        NULL,
+        G_CALLBACK(do_read_next_unread_group) },
+
+      { "read-next-group", "ICON_READ_GROUP",
+        N_("Next _Group"), "<shift>G",
+        NULL,
+        G_CALLBACK(do_read_next_group) },
+
+      { "read-next-unread-article", "ICON_READ_UNREAD_ARTICLE",
+        N_("Next _Unread Article"), "N",
+        N_("Next Unread Article"),
+        G_CALLBACK(do_read_next_unread_article) },
+
+      { "read-next-article", NULL,
+        N_("Next _Article"), "<control>N",
+        N_("Next Article"),
+        G_CALLBACK(do_read_next_article) },
+
+      { "read-next-watched-article", NULL,
+        N_("Next _Watched Article"), "<control><shift>N",
+        NULL,
+        G_CALLBACK(do_read_next_watched_article) },
+
+      { "read-next-unread-thread", "ICON_READ_UNREAD_THREAD",
+        N_("Next Unread _Thread"), "T",
+        N_("Next Unread Thread"),
+        G_CALLBACK(do_read_next_unread_thread) },
+
+      { "read-next-thread", NULL,
+        N_("Next Threa_d"), "<control>T",
+        NULL,
+        G_CALLBACK(do_read_next_thread) },
+
+      { "read-previous-article", NULL,
+        N_("Pre_vious Article"), "V",
+        NULL,
+        G_CALLBACK(do_read_previous_article) },
+
+      { "read-previous-thread", NULL,
+        N_("Previous _Thread"), "<control>V",
+        NULL,
+
+        G_CALLBACK(do_read_previous_thread) },
+      { "read-parent-article", NULL,
+        N_("_Parent Article"), "U",
+        NULL,
+        G_CALLBACK(do_read_parent_article) },
+
+      { "plonk", NULL,
+        N_("Ignore _Author"), NULL,
+        NULL,
+        G_CALLBACK(do_plonk) },
+      { "watch-thread", NULL,
+        N_("_Watch Thread"), NULL,
+        NULL,
+        G_CALLBACK(do_watch) },
+
+      { "ignore-thread", NULL,
+        N_("_Ignore Thread"), NULL,
+        NULL,
+        G_CALLBACK(do_ignore) },
+
+      { "flag-thread", "ICON_FLAGGED",
+        N_("_Toggle Flag On/Off for Thread"), "X",
+        N_("_Toggle Flag On/Off for Thread"),
+        G_CALLBACK(do_flag) },
+
+      { "unflag-thread", NULL,
+        N_("_Turn Flag Off for Thread"), "<shift>X",
+        N_("_Turn Flag Off for Thread"),
+        G_CALLBACK(do_flag_off) },
+
+      { "select-all-flagged", NULL,
+        N_("_Select All Flagged Threads"), "<control>X",
+        N_("_Select All Flagged Threads"),
+        G_CALLBACK(do_mark_all_flagged) },
+
+      { "next-flagged", NULL,
+        N_("_Go to Next Flagged Thread"), "plus",
+        N_("_Go to Next Flagged Thread"),
+        G_CALLBACK(do_next_flag) },
+
+      { "last-flagged", NULL,
+        N_("_Go to Last Flagged Thread"), "minus",
+        N_("_Go to Last Flagged Thread"),
+        G_CALLBACK(do_last_flag) },
+
+      { "invert-selection", NULL,
+        N_("_Invert Selection"), "<control>I",
+        N_("_Invert Selection"),
+        G_CALLBACK(do_invert_selection) },
+
+      { "view-article-score", "ICON_SCORE",
+        N_("Edit Article's Watch/Ignore/Score..."), "<control><shift>C",
+        NULL,
+        G_CALLBACK(do_show_score_dialog) },
+
+      { "add-article-score", "ICON_SCORE",
+        N_("Add a _Scoring Rule..."), "S",
+        NULL,
+        G_CALLBACK(do_show_new_score_dialog) },
+
+      { "cancel-article", NULL,
+        N_("Cance_l Article..."), NULL,
+        NULL,
+        G_CALLBACK(do_cancel_article) },
+
+      { "supersede-article", NULL,
+        N_("_Supersede Article..."), NULL,
+        NULL,
+        G_CALLBACK(do_supersede_article) },
+
+      { "delete-article", GTK_STOCK_DELETE,
+        N_("_Delete Article"), "Delete",
+        NULL,
+        G_CALLBACK(do_delete_article) },
+
+      { "clear-article-cache", NULL,
+        N_("Clear Article Cache"), NULL,
+        NULL,
+        G_CALLBACK(do_clear_article_cache) },
+
+      { "mark-article-read", "ICON_ARTICLE_READ",
+        N_("_Mark Article as Read"), "M",
+        NULL,
+        G_CALLBACK(do_mark_article_read) },
+
+      { "mark-article-unread", "ICON_ARTICLE_UNREAD",
+        N_("Mark Article as _Unread"), "<control>M",
+        NULL,
+        G_CALLBACK(do_mark_article_unread) },
+
+      ///TODO create icons for the next two actions
+      { "mark-thread-read", "ICON_ARTICLE_READ",
+        N_("_Mark Thread as Read"), "<Shift>T",
+        NULL,
+        G_CALLBACK(do_mark_thread_read) },
+
+      { "mark-thread-unread", "ICON_ARTICLE_UNREAD",
+        N_("Mark Thread as _Unread"), "<control><Shift>T",
+        NULL,
+        G_CALLBACK(do_mark_thread_unread) },
+
+      { "post", "ICON_COMPOSE_POST",
+        N_("_Post to Newsgroup"), "P",
+        N_("Post to Newsgroup"),
+        G_CALLBACK(do_post) },
+
+      { "followup-to", "ICON_COMPOSE_FOLLOWUP",
+        N_("_Followup to Newsgroup"), "F",
+        N_("Followup to Newsgroup"),
+        G_CALLBACK(do_followup_to) },
+
+      { "reply-to", NULL,
+        N_("_Reply to Author in Mail"), "R",
+        NULL,
+        G_CALLBACK(do_reply_to) },
+
+      { "pan-manual", NULL,
+        N_("_Contents"), "F1",
+        NULL,
+        G_CALLBACK(do_pan_manual) },
+
+      { "pan-web-page", NULL,
+        N_("_Pan Home Page"), NULL,
+        NULL,
+        G_CALLBACK(do_pan_web) },
+
+      { "bug-report", NULL,
+        N_("Give _Feedback or Report a Bug..."), NULL,
+        NULL,
+        G_CALLBACK(do_bug_report) },
+
+      { "tip-jar", NULL,
+        N_("_Tip Jar..."), NULL,
+        NULL,
+        G_CALLBACK(do_tip_jar) },
+
+      { "about-pan", GTK_STOCK_ABOUT,
+        N_("_About"), NULL,
+        NULL,
+        G_CALLBACK(do_about_pan) },
+
+      { "show-sec-dialog", GTK_STOCK_DIALOG_AUTHENTICATION,
+        N_("Edit _SSL Certificates"), NULL,
+        NULL,
+        G_CALLBACK(do_show_sec_dialog) } };
 
   void prefs_toggle_callback_impl (GtkToggleAction * action)
   {
@@ -765,13 +765,68 @@ namespace
 }
 
 void
-pan :: add_actions (PanUI * ui, GtkUIManager * ui_manager, Prefs * p)
+pan :: add_hotkeys_to_actions (hotkeys_t& hk, hotkeys_t& t_hk)
+{
+  for (GtkToggleActionEntry *it(toggle_entries), *end(it+n_toggle_entries); it!=end; ++it)
+  {
+    GtkActionEntry* e (reinterpret_cast<GtkActionEntry*>(it));
+    if (t_hk.count(e->name) > 0)
+    {
+      e->accelerator = t_hk[e->name];
+//      std::cerr<<"setting hotkey for action '"<<e->name<<"' to '"<<t_hk[e->name]<<"', count "<<t_hk.count(e->name)<<"\n";
+    }
+  }
+
+  for (GtkActionEntry *it(entries), *end(it+n_entries); it!=end; ++it)
+  {
+    GtkActionEntry* e(it);
+
+    if (hk.count(e->name) > 0)
+    {
+      e->accelerator = hk[e->name];
+//      std::cerr<<"setting hotkey for action '"<<e->name<<"' to '"<<hk[e->name]<<"', count "<<hk.count(e->name)<<"\n";
+    }
+  }
+}
+
+void
+pan :: add_new_hotkeys_from_ui (hotkeys_t& hk, hotkeys_t& t_hk)
+{
+  for (GtkActionEntry *it(entries), *end(it+n_entries); it!=end; ++it)
+  {
+    GtkActionEntry* e(it);
+//    std::cerr<<"setting hotkey for action '"<<e->name<<"' to '"<<(e->accelerator ? e->accelerator : "NULL")<<"\n";
+    hk[e->name] = (e->accelerator ? e->accelerator : "");
+  }
+
+  for (GtkToggleActionEntry *it(toggle_entries), *end(it+n_toggle_entries); it!=end; ++it)
+  {
+    GtkActionEntry* e (reinterpret_cast<GtkActionEntry*>(it));
+//    std::cerr<<"setting hotkey for action '"<<e->name<<"' to '"<<(e->accelerator ? e->accelerator : "NULL")<<"\n";
+    t_hk[e->name] = (e->accelerator ? e->accelerator : "");
+  }
+
+  std::cerr<<"sizes "<<hk.size()<<" "<<t_hk.size()<<"\n";
+
+}
+
+void
+pan :: add_actions (PanUI * ui, GtkUIManager * ui_manager, Prefs * p, Data* data)
 {
   pan_ui = ui;
   prefs = p;
 
   register_my_builtin_icons ();
 
+  int ret = data->get_all_hotkeys ();
+  if (ret > 0)
+    add_hotkeys_to_actions(data->get_hotkeys(), data->get_toggle_hotkeys());
+  else
+  {
+    // create initial shortcuts file for the user
+    add_new_hotkeys_from_ui (data->get_hotkeys(), data->get_toggle_hotkeys());
+  }
+
   for (GtkToggleActionEntry *it(toggle_entries), *end(it+n_toggle_entries); it!=end; ++it)
   {
     ensure_tooltip (reinterpret_cast<GtkActionEntry*>(it));
diff --git a/pan/gui/actions.h b/pan/gui/actions.h
index a31a3cb..461c028 100644
--- a/pan/gui/actions.h
+++ b/pan/gui/actions.h
@@ -22,10 +22,13 @@
 #include "gtk-compat.h"
 #include <pan/gui/pan-ui.h>
 #include <pan/gui/prefs.h>
+#include <pan/data/data.h>
 
 namespace pan
 {
-  void add_actions (PanUI*, GtkUIManager*, Prefs*);
+  void add_actions (PanUI*, GtkUIManager*, Prefs*, Data*);
+  void add_hotkeys_to_actions (hotkeys_t& hk, hotkeys_t& t_hk);
+  void add_new_hotkeys_from_ui (hotkeys_t& hk, hotkeys_t& t_hk);
 }
 
 #endif /* __PAN_H__ */
diff --git a/pan/gui/e-charset.c b/pan/gui/e-charset.c
index ab90e47..cf85b18 100644
--- a/pan/gui/e-charset.c
+++ b/pan/gui/e-charset.c
@@ -26,7 +26,6 @@
 #include "e-charset.h"
 
 #include <string.h>
-#include <iconv.h>
 
 #include <glib/gi18n-lib.h>
 
diff --git a/pan/gui/gui.cc b/pan/gui/gui.cc
index cd4f1eb..c07eae8 100644
--- a/pan/gui/gui.cc
+++ b/pan/gui/gui.cc
@@ -27,8 +27,6 @@ extern "C" {
   #include <sys/stat.h> // for chmod
   #include <glib/gi18n.h>
   #include <dirent.h>
-  #include <iconv.h>
-
 }
 #include <pan/general/debug.h>
 #include <pan/general/e-util.h>
@@ -207,7 +205,7 @@ GUI :: GUI (Data& data, Queue& queue, Prefs& prefs, GroupPrefs& group_prefs):
     gtk_ui_manager_add_ui_from_string (_ui_manager, fallback_ui_file, -1, NULL);
   g_free (filename);
   g_signal_connect (_ui_manager, "add_widget", G_CALLBACK (add_widget), this);
-  add_actions (this, _ui_manager, &prefs);
+  add_actions (this, _ui_manager, &prefs, &data);
   g_signal_connect (_root, "parent-set", G_CALLBACK(parent_set_cb), _ui_manager);
   gtk_box_pack_start (GTK_BOX(_root), _menu_vbox, FALSE, FALSE, 0);
   gtk_widget_show (_menu_vbox);
@@ -1158,7 +1156,8 @@ void
 GUI :: do_flag ()
 {
   std::vector<const Article*> v(_header_pane->get_full_selection_v());
-  g_return_if_fail(!v.empty());
+  if (v.empty()) return;
+
   foreach (std::vector<const Article*>,v,it)
   {
     Article* a((Article*)*it);
@@ -1172,7 +1171,8 @@ void
 GUI :: do_flag_off ()
 {
   std::vector<const Article*> v(_header_pane->get_full_selection_v());
-  g_return_if_fail(!v.empty());
+  if (v.empty()) return;
+
   foreach (std::vector<const Article*>,v,it)
   {
     Article* a((Article*)*it);
@@ -1549,6 +1549,7 @@ void GUI :: do_reply_to ()
 }
 void GUI :: do_pan_manual ()
 {
+#ifdef HAVE_HELP
   GError * error (NULL);
   gtk_show_uri (NULL, "ghelp:pan", gtk_get_current_event_time (), &error);
     if (error) {
@@ -1560,6 +1561,7 @@ void GUI :: do_pan_manual ()
       g_signal_connect_swapped (w, "response", G_CALLBACK (gtk_widget_destroy), w);
       gtk_widget_show_all (w);
   }
+#endif
 }
 void GUI :: do_pan_web ()
 {
diff --git a/pan/gui/header-pane.cc b/pan/gui/header-pane.cc
index 7e18832..14e4a6e 100644
--- a/pan/gui/header-pane.cc
+++ b/pan/gui/header-pane.cc
@@ -22,7 +22,6 @@ extern "C" {
   #include <glib/gi18n.h>
   #include "gtk-compat.h"
   #include "gtk-compat.h"
-  #include <iconv.h>
 }
 #include <cctype>
 #include <cmath>
@@ -595,7 +594,7 @@ HeaderPane :: set_group (const Quark& new_group)
 
     if (!_group.empty())
     {
-      _atree = _data.group_get_articles (new_group, path, _show_type, &_filter,&_rules,&_queue);
+      _atree = _data.group_get_articles (new_group, path, _show_type, &_filter,&_rules);
       _atree->add_listener (this);
 
       rebuild ();
diff --git a/pan/gui/pan.cc b/pan/gui/pan.cc
index 2ddfcf5..4a5a391 100644
--- a/pan/gui/pan.cc
+++ b/pan/gui/pan.cc
@@ -927,6 +927,8 @@ main (int argc, char *argv[])
     SocketCreator socket_creator(data, certstore);
     Queue queue (data, data, &socket_creator, certstore, worker_pool, false, 32768);
 
+    data.set_queue(&queue);
+
 #ifdef HAVE_DBUS
     Pan pan(data, queue, cache, encode_cache, prefs, group_prefs);
   #ifndef DEBUG_PARALLEL
diff --git a/pan/tasks/task-article.cc b/pan/tasks/task-article.cc
index dca050f..71e883d 100644
--- a/pan/tasks/task-article.cc
+++ b/pan/tasks/task-article.cc
@@ -27,7 +27,6 @@
 extern "C"
 {
   #include <glib/gi18n.h>
-  #include <iconv.h>
 }
 #include <pan/general/debug.h>
 #include <pan/general/file-util.h>
diff --git a/pan/usenet-utils/mime-utils.h b/pan/usenet-utils/mime-utils.h
index e05fc02..7ac8e15 100644
--- a/pan/usenet-utils/mime-utils.h
+++ b/pan/usenet-utils/mime-utils.h
@@ -59,11 +59,6 @@
 #define NEEDS_DECODING(encoding) ((encoding == GMIME_CONTENT_ENCODING_BASE64) ||   \
                                  (encoding == GMIME_CONTENT_ENCODING_QUOTEDPRINTABLE))
 
-extern "C"
-{
-  #include <iconv.h>
-}
-
 namespace pan
 {
 



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