Revision: 1567
http://geeqie.svn.sourceforge.net/geeqie/?rev=1567&view=rev
Author: nadvornik
Date: 2009-03-21 17:47:50 +0000 (Sat, 21 Mar 2009)
Log Message:
-----------
update translated pane titles
Modified Paths:
--------------
trunk/src/bar.c
trunk/src/bar.h
trunk/src/bar_comment.c
trunk/src/bar_exif.c
trunk/src/bar_histogram.c
trunk/src/bar_keywords.c
Modified: trunk/src/bar.c
===================================================================
--- trunk/src/bar.c 2009-03-20 22:48:01 UTC (rev 1566)
+++ trunk/src/bar.c 2009-03-21 17:47:50 UTC (rev 1567)
@@ -30,10 +30,25 @@
#include "histogram.h"
#include "rcfile.h"
-//#define BAR_SIZE_INCREMENT 48
-//#define BAR_ARROW_SIZE 7
+typedef struct _KnownPanes KnownPanes;
+struct _KnownPanes
+{
+ PaneType type;
+ gchar *id;
+ gchar *title;
+};
+static const KnownPanes known_panes[] = {
+/* default sidebar */
+ {PANE_HISTOGRAM, "histogram", N_("Histogram")},
+ {PANE_COMMENT, "title", N_("Title")},
+ {PANE_KEYWORDS, "keywords", N_("Keywords")},
+ {PANE_COMMENT, "comment", N_("Comment")},
+ {PANE_EXIF, "exif", N_("Exif")},
+ {PANE_UNDEF, NULL, NULL}
+};
+
typedef struct _BarData BarData;
struct _BarData
{
@@ -445,4 +460,23 @@
return widget;
}
+gboolean bar_pane_translate_title(PaneType type, const gchar *id, gchar
**title)
+{
+ const KnownPanes *pane = known_panes;
+
+ if (!title) return FALSE;
+ while (pane->id)
+ {
+ if (pane->type == type && strcmp(pane->id, id) == 0) break;
+ pane++;
+ }
+ if (!pane->id) return FALSE;
+
+ if (*title && **title && strcmp(pane->title, *title) != 0) return FALSE;
+
+ g_free(*title);
+ *title = g_strdup(_(pane->title));
+ return TRUE;
+}
+
/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
Modified: trunk/src/bar.h
===================================================================
--- trunk/src/bar.h 2009-03-20 22:48:01 UTC (rev 1566)
+++ trunk/src/bar.h 2009-03-21 17:47:50 UTC (rev 1567)
@@ -15,6 +15,7 @@
#define BAR_H
typedef enum {
+ PANE_UNDEF = 0,
PANE_COMMENT,
PANE_EXIF,
PANE_HISTOGRAM,
@@ -62,5 +63,6 @@
GtkWidget *bar_pane_expander_title(const gchar *title);
void bar_update_expander(GtkWidget *pane);
+gboolean bar_pane_translate_title(PaneType type, const gchar *id, gchar
**title);
#endif
/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
Modified: trunk/src/bar_comment.c
===================================================================
--- trunk/src/bar_comment.c 2009-03-20 22:48:01 UTC (rev 1566)
+++ trunk/src/bar_comment.c 2009-03-21 17:47:50 UTC (rev 1567)
@@ -263,7 +263,7 @@
GtkWidget *bar_pane_comment_new_from_config(const gchar **attribute_names,
const gchar **attribute_values)
{
- gchar *title = g_strdup(_("Comment"));
+ gchar *title = NULL;
gchar *key = g_strdup(COMMENT_KEY);
gboolean expanded = TRUE;
gint height = 50;
@@ -285,6 +285,7 @@
log_printf("unknown attribute %s = %s\n", option, value);
}
+ bar_pane_translate_title(PANE_COMMENT, id, &title);
ret = bar_pane_comment_new(id, title, key, expanded, height);
g_free(title);
g_free(key);
@@ -318,6 +319,7 @@
if (title)
{
+ bar_pane_translate_title(PANE_COMMENT, pcd->pane.id, &title);
gtk_label_set_text(GTK_LABEL(pcd->pane.title), title);
g_free(title);
}
Modified: trunk/src/bar_exif.c
===================================================================
--- trunk/src/bar_exif.c 2009-03-20 22:48:01 UTC (rev 1566)
+++ trunk/src/bar_exif.c 2009-03-21 17:47:50 UTC (rev 1567)
@@ -775,7 +775,7 @@
GtkWidget *bar_pane_exif_new_from_config(const gchar **attribute_names, const
gchar **attribute_values)
{
- gchar *title = g_strdup(_("Exif"));
+ gchar *title = NULL;
gchar *id = g_strdup("exif");
gboolean expanded = TRUE;
GtkWidget *ret;
@@ -792,6 +792,7 @@
log_printf("unknown attribute %s = %s\n", option, value);
}
+ bar_pane_translate_title(PANE_EXIF, id, &title);
ret = bar_pane_exif_new(id, title, expanded, FALSE);
g_free(title);
g_free(id);
@@ -822,6 +823,7 @@
if (title)
{
+ bar_pane_translate_title(PANE_EXIF, ped->pane.id, &title);
gtk_label_set_text(GTK_LABEL(ped->pane.title), title);
g_free(title);
}
Modified: trunk/src/bar_histogram.c
===================================================================
--- trunk/src/bar_histogram.c 2009-03-20 22:48:01 UTC (rev 1566)
+++ trunk/src/bar_histogram.c 2009-03-21 17:47:50 UTC (rev 1567)
@@ -379,7 +379,7 @@
GtkWidget *bar_pane_histogram_new_from_config(const gchar **attribute_names,
const gchar **attribute_values)
{
- gchar *title = g_strdup(_("NoName"));
+ gchar *title = NULL;
gchar *id = g_strdup("histogram");
gboolean expanded = TRUE;
gint height = 80;
@@ -401,6 +401,7 @@
log_printf("unknown attribute %s = %s\n", option, value);
}
+ bar_pane_translate_title(PANE_HISTOGRAM, id, &title);
ret = bar_pane_histogram_new(id, title, height, expanded,
histogram_channel, histogram_mode);
g_free(title);
g_free(id);
Modified: trunk/src/bar_keywords.c
===================================================================
--- trunk/src/bar_keywords.c 2009-03-20 22:48:01 UTC (rev 1566)
+++ trunk/src/bar_keywords.c 2009-03-21 17:47:50 UTC (rev 1567)
@@ -1350,7 +1350,7 @@
GtkWidget *bar_pane_keywords_new_from_config(const gchar **attribute_names,
const gchar **attribute_values)
{
gchar *id = g_strdup("keywords");
- gchar *title = g_strdup(_("Keywords"));
+ gchar *title = NULL;
gchar *key = g_strdup(COMMENT_KEY);
gboolean expanded = TRUE;
GtkWidget *ret;
@@ -1369,6 +1369,7 @@
log_printf("unknown attribute %s = %s\n", option, value);
}
+ bar_pane_translate_title(PANE_KEYWORDS, id, &title);
ret = bar_pane_keywords_new(id, title, key, expanded);
g_free(id);
g_free(title);
@@ -1401,6 +1402,7 @@
if (title)
{
+ bar_pane_translate_title(PANE_KEYWORDS, pkd->pane.id, &title);
gtk_label_set_text(GTK_LABEL(pkd->pane.title), title);
g_free(title);
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn