[pan2] fixed translation for hotkeys, auto-translated now



commit 0efefbff8d117bb4baf1d31f3b2b4c2450c73050
Author: Heinrich MÃller <henmull src gnome org>
Date:   Wed Feb 22 20:31:23 2012 +0100

    fixed translation for hotkeys, auto-translated now

 pan/data-impl/data-impl.cc |   20 ++++++++++----------
 pan/data-impl/data-impl.h  |    4 ++--
 pan/data-impl/server.cc    |    4 ++--
 pan/data/data.h            |    4 ++--
 pan/gui/actions.cc         |   11 +++++++++--
 pan/gui/pan.cc             |    4 ++++
 pan/gui/prefs-ui.cc        |   12 ------------
 7 files changed, 29 insertions(+), 30 deletions(-)
---
diff --git a/pan/data-impl/data-impl.cc b/pan/data-impl/data-impl.cc
index cb94038..bdd251f 100644
--- a/pan/data-impl/data-impl.cc
+++ b/pan/data-impl/data-impl.cc
@@ -129,18 +129,18 @@ DataImpl :: save_state ()
 
 #ifdef HAVE_GKR
 GnomeKeyringResult
-DataImpl :: password_encrypt (const PasswordData* pw)
+DataImpl :: password_encrypt (const PasswordData& pw)
 {
-  g_return_val_if_fail (pw, GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON);
+//  g_return_val_if_fail (pw, GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON);
 
   return (
     gnome_keyring_store_password_sync (
       GNOME_KEYRING_NETWORK_PASSWORD,
       GNOME_KEYRING_DEFAULT,
       _("Pan newsreader server passwords"),
-      pw->pw.str,
-      "user", pw->user.str,
-      "server", pw->server.c_str(),
+      pw.pw.str,
+      "user", pw.user.str,
+      "server", pw.server.c_str(),
       NULL)
     );
 
@@ -148,24 +148,24 @@ DataImpl :: password_encrypt (const PasswordData* pw)
 
 // TODO use gnome_keyring_memory_new etc
 GnomeKeyringResult
-DataImpl :: password_decrypt (PasswordData* pw) const
+DataImpl :: password_decrypt (PasswordData& pw) const
 {
 
   gchar* pwd = NULL;
-  g_return_val_if_fail (pw, GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON);
+//  g_return_val_if_fail (pw, GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON);
 
   GnomeKeyringResult ret =
     gnome_keyring_find_password_sync (
     GNOME_KEYRING_NETWORK_PASSWORD,
     &pwd,
-    "user", pw->user.str,
-    "server", pw->server.c_str(),
+    "user", pw.user.str,
+    "server", pw.server.c_str(),
     NULL);
 
   std::string tmp;
   if (pwd) tmp = pwd;
   gnome_keyring_free_password(pwd);
-  pw->pw = tmp;
+  pw.pw = tmp;
 
   return ret;
 }
diff --git a/pan/data-impl/data-impl.h b/pan/data-impl/data-impl.h
index 0d86f83..459eed4 100644
--- a/pan/data-impl/data-impl.h
+++ b/pan/data-impl/data-impl.h
@@ -95,8 +95,8 @@ namespace pan
 
     public:
 #ifdef HAVE_GKR
-      GnomeKeyringResult password_encrypt (const PasswordData*);
-      GnomeKeyringResult password_decrypt (PasswordData*) const;
+      GnomeKeyringResult password_encrypt (const PasswordData&);
+      GnomeKeyringResult password_decrypt (PasswordData&) const;
 #endif
     private:
 
diff --git a/pan/data-impl/server.cc b/pan/data-impl/server.cc
index 1082202..6cacf45 100644
--- a/pan/data-impl/server.cc
+++ b/pan/data-impl/server.cc
@@ -134,7 +134,7 @@ DataImpl :: set_server_auth (const Quark       & server,
   pw.server = s->host;
   pw.user = username;
   pw.pw = password;
-  password_encrypt(&pw);
+  password_encrypt(pw);
 #endif
 
 }
@@ -227,7 +227,7 @@ DataImpl :: get_server_auth (const Quark   & server,
     PasswordData pw;
     pw.server = s->host;
     pw.user = s->username;
-    GnomeKeyringResult res (password_decrypt(&pw));
+    GnomeKeyringResult res (password_decrypt(pw));
     switch (res)
     {
       case GNOME_KEYRING_RESULT_NO_MATCH:
diff --git a/pan/data/data.h b/pan/data/data.h
index 0190d7c..64015f8 100644
--- a/pan/data/data.h
+++ b/pan/data/data.h
@@ -223,8 +223,8 @@ namespace pan
 
     public:
 #ifdef HAVE_GKR
-      virtual GnomeKeyringResult password_encrypt (const PasswordData*) = 0;
-      virtual GnomeKeyringResult password_decrypt (PasswordData*) const = 0;
+      virtual GnomeKeyringResult password_encrypt (const PasswordData&) = 0;
+      virtual GnomeKeyringResult password_decrypt (PasswordData&) const = 0;
 #endif
       /** Gets a quark to the provided hostname */
       virtual bool find_server_by_hn (const Quark& server, Quark& setme) const = 0;
diff --git a/pan/gui/actions.cc b/pan/gui/actions.cc
index 54bba50..36954b2 100644
--- a/pan/gui/actions.cc
+++ b/pan/gui/actions.cc
@@ -775,22 +775,31 @@ void
 pan :: add_actions (PanUI * ui, GtkUIManager * ui_manager, Prefs * p, Data* data)
 {
 
+  GtkActionGroup * action_group = _group = gtk_action_group_new ("Actions");
+  gtk_action_group_set_translation_domain (action_group, NULL);
+
   for (int i=0;i<n_entries;++i)
   {
     if (!entries[i].label) continue;
     action_trans[entries[i].name] = (entries[i].label ? entries[i].label : "");
+    const gchar* translation = gtk_action_group_translate_string (action_group, action_trans[entries[i].name].c_str());
+    action_trans[entries[i].name] = translation ? translation : "";
   }
 
   for (int i=0;i<n_toggle_entries;++i)
   {
     if (!toggle_entries[i].label) continue;
     action_trans[toggle_entries[i].name] = (toggle_entries[i].label ? toggle_entries[i].label : "");
+    const gchar* translation = gtk_action_group_translate_string (action_group, action_trans[toggle_entries[i].name].c_str());
+    action_trans[toggle_entries[i].name] = translation ? translation : "";
   }
 
   for (int i=0;i<G_N_ELEMENTS(match_toggle_entries);++i)
   {
     if (!match_toggle_entries[i].label) continue;
     action_trans[match_toggle_entries[i].name] = (match_toggle_entries[i].label ? match_toggle_entries[i].label : "");
+    const gchar* translation = gtk_action_group_translate_string (action_group, action_trans[match_toggle_entries[i].name].c_str());
+    action_trans[match_toggle_entries[i].name] = translation ? translation : "";
   }
 
   pan_ui = ui;
@@ -821,8 +830,6 @@ pan :: add_actions (PanUI * ui, GtkUIManager * ui_manager, Prefs * p, Data* data
   for (GtkActionEntry *it(entries), *end(it+n_entries); it!=end; ++it)
     ensure_tooltip (it);
 
-  GtkActionGroup * action_group = _group = gtk_action_group_new ("Actions");
-  gtk_action_group_set_translation_domain (action_group, NULL);
   gtk_action_group_add_actions (action_group, entries, n_entries, NULL);
   gtk_action_group_add_toggle_actions (action_group, toggle_entries, n_toggle_entries, NULL);
   gtk_action_group_add_radio_actions (action_group,
diff --git a/pan/gui/pan.cc b/pan/gui/pan.cc
index 339ed69..afa668c 100644
--- a/pan/gui/pan.cc
+++ b/pan/gui/pan.cc
@@ -16,6 +16,10 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
+
+
+// TODO :: fix usage of gkr!!
+
 #include <memory>
 #include <fstream>
 #include <config.h>
diff --git a/pan/gui/prefs-ui.cc b/pan/gui/prefs-ui.cc
index 5f21e52..2aabd3a 100644
--- a/pan/gui/prefs-ui.cc
+++ b/pan/gui/prefs-ui.cc
@@ -441,7 +441,6 @@ namespace pan
       data->value = stripped;
 
       w = new_hotkey_entry(keyval, it->first.c_str(), data);
-
       std::string label = action_trans[stripped];
       l = gtk_label_new(label.c_str());
       HIG :: workarea_add_row (t, &row, w, l);
@@ -915,17 +914,6 @@ PrefsDialog :: PrefsDialog (Prefs& prefs, GtkWindow* parent):
   g_signal_connect_swapped (dialog, "destroy", G_CALLBACK(delete_prefs_dialog), this);
 
   GtkWidget * notebook = gtk_notebook_new ();
-
-// remove this for now, it's not needed
-//
-//if (prefs.get_flag("show-only-icons-in-preftabs", false))
-//{
-//#if !GTK_CHECK_VERSION(2,24,0)
-//  gtk_notebook_set_homogeneous_tabs (GTK_NOTEBOOK(notebook), true);
-//#else
-//  g_object_set (notebook, "homogeneous", true, NULL);
-//#endif
-//}
   gtk_notebook_set_scrollable (GTK_NOTEBOOK(notebook), true);
 
   // Behavior



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