gnome-commander r2295 - branches/gcmd-1-3/src
- From: epiotr svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-commander r2295 - branches/gcmd-1-3/src
- Date: Tue, 18 Nov 2008 23:23:27 +0000 (UTC)
Author: epiotr
Date: Tue Nov 18 23:23:27 2008
New Revision: 2295
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=2295&view=rev
Log:
advrename: set translation func for menu buttons
Modified:
branches/gcmd-1-3/src/gnome-cmd-advrename-dialog.cc
Modified: branches/gcmd-1-3/src/gnome-cmd-advrename-dialog.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-advrename-dialog.cc (original)
+++ branches/gcmd-1-3/src/gnome-cmd-advrename-dialog.cc Tue Nov 18 23:23:27 2008
@@ -85,6 +85,8 @@
Private();
~Private();
+ static gchar *translate_menu (const gchar *path, gpointer data);
+
GtkWidget *create_placeholder_menu(int menu_type);
GtkWidget *create_button_with_menu(gchar *label_text, int menu_type);
void insert_tag(const gchar *text);
@@ -127,39 +129,41 @@
GtkItemFactoryEntry GnomeCmdAdvrenameDialog::Private::dir_items[] =
- {{_("/Grandparent"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 0},
- {_("/Parent"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 1}};
+ {{N_("/Grandparent"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 0},
+ {N_("/Parent"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 1}};
GtkItemFactoryEntry GnomeCmdAdvrenameDialog::Private::name_items[] =
- {{_("/File name"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 2},
- {_("/File name without extension"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 3},
- {_("/File extension"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 4}};
+ {{N_("/File name"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 2},
+ {N_("/File name without extension"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 3},
+ {N_("/File extension"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 4}};
GtkItemFactoryEntry GnomeCmdAdvrenameDialog::Private::counter_items[] =
- {{_("/Counter"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 5},
- {_("/Counter (width)"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 6},
- {_("/Hexadecimal random number (width)"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 7}};
+ {{N_("/Counter"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 5},
+ {N_("/Counter (width)"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 6},
+ {N_("/Hexadecimal random number (width)"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 7}};
GtkItemFactoryEntry GnomeCmdAdvrenameDialog::Private::date_items[] =
- {{_("/Date/<locale>"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 8},
- {_("/Date/yyyy-mm-dd"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 9},
- {_("/Date/yy-mm-dd"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 10},
- {_("/Date/yy.mm.dd"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 11},
- {_("/Date/yymmdd"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 12},
- {_("/Date/dd.mm.yy"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 13},
- {_("/Date/mm-dd-yy"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 14},
- {_("/Date/yyyy"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 15},
- {_("/Date/yy"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 16},
- {_("/Date/mm"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 17},
- {_("/Date/mmm"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 18},
- {_("/Date/dd"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 19},
- {_("/Time/<locale>"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 20},
- {_("/Time/HH.MM.SS"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 21},
- {_("/Time/HH-MM-SS"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 22},
- {_("/Time/HHMMSS"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 23},
- {_("/Time/HH"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 24},
- {_("/Time/MM"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 25},
- {_("/Time/SS"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 26}};
+ {{N_("/Date"), NULL, NULL, 0, "<Branch>"},
+ {N_("/Date/<locale>"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 8},
+ {N_("/Date/yyyy-mm-dd"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 9},
+ {N_("/Date/yy-mm-dd"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 10},
+ {N_("/Date/yy.mm.dd"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 11},
+ {N_("/Date/yymmdd"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 12},
+ {N_("/Date/dd.mm.yy"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 13},
+ {N_("/Date/mm-dd-yy"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 14},
+ {N_("/Date/yyyy"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 15},
+ {N_("/Date/yy"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 16},
+ {N_("/Date/mm"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 17},
+ {N_("/Date/mmm"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 18},
+ {N_("/Date/dd"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 19},
+ {N_("/Time"), NULL, NULL, 0, "<Branch>"},
+ {N_("/Time/<locale>"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 20},
+ {N_("/Time/HH.MM.SS"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 21},
+ {N_("/Time/HH-MM-SS"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 22},
+ {N_("/Time/HHMMSS"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 23},
+ {N_("/Time/HH"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 24},
+ {N_("/Time/MM"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 25},
+ {N_("/Time/SS"), NULL, (GtkItemFactoryCallback) GnomeCmdAdvrenameDialog::Private::insert_text_tag, 26}};
GtkItemFactoryEntry *GnomeCmdAdvrenameDialog::Private::items[] = {dir_items, name_items, counter_items, date_items};
@@ -370,6 +374,12 @@
}
+gchar *GnomeCmdAdvrenameDialog::Private::translate_menu (const gchar *path, gpointer data)
+{
+ return _(path);
+}
+
+
inline GtkWidget *GnomeCmdAdvrenameDialog::Private::create_placeholder_menu(int menu_type)
{
static guint items_size[] = {G_N_ELEMENTS(dir_items),
@@ -385,6 +395,7 @@
{
GtkItemFactory *ifac = gtk_item_factory_new (GTK_TYPE_MENU, "<main>", NULL);
+ gtk_item_factory_set_translate_func (ifac, translate_menu, NULL, NULL);
gtk_item_factory_create_items (ifac, items_size[menu_type], items[menu_type], this);
return gtk_item_factory_get_widget (ifac, "<main>");
@@ -1118,7 +1129,7 @@
dialog->priv->regex_remove_button = button = gtk_button_new_from_stock (GTK_STOCK_REMOVE);
gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 0);
- dialog->priv->regex_remove_all_button = button = gtk_button_new_with_mnemonic ("Remove A_ll");
+ dialog->priv->regex_remove_all_button = button = gtk_button_new_with_mnemonic (_("Remove A_ll"));
gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 0);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]