diff --git a/moo/mooapp/glade/mooappabout.glade b/moo/mooapp/glade/mooappabout.glade index 0dd3cb6d..13302bfd 100644 --- a/moo/mooapp/glade/mooappabout.glade +++ b/moo/mooapp/glade/mooappabout.glade @@ -1,6 +1,6 @@ - - Credits + Dialog title|Credits GTK_WIN_POS_CENTER_ON_PARENT 360 260 @@ -19,7 +19,7 @@ True - + True True @@ -84,6 +84,39 @@ False + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + + + True + True + False + False + + + + + 2 + False + + + + + True + Translated by + + + tab + 2 + False + False + + 1 @@ -115,7 +148,7 @@ - License + Dialog title|License GTK_WIN_POS_CENTER_ON_PARENT 420 320 @@ -171,7 +204,7 @@ - System Info + Dialog title|System Info GTK_WIN_POS_CENTER_ON_PARENT 360 260 @@ -212,7 +245,7 @@ True True True - gtk-close + gtk-close True -6 @@ -227,7 +260,7 @@ - About + Dialog title|About False GTK_WIN_POS_CENTER_ON_PARENT True @@ -256,7 +289,7 @@ True True - <span size="xx-large"><b>The App</b></span> + <span size="xx-large"><b>The App</b></span> True True @@ -270,7 +303,7 @@ True True - The App is an app + The App is an app True @@ -283,7 +316,7 @@ True True - <small>© 2004-2006 The Author</small> + <small>© 2004-2006 The Author</small> True True @@ -296,11 +329,11 @@ True - 0.000000 + 0 True - <span foreground="#0000FF">http://somesite.org</span> + <span foreground="#0000FF">http://somesite.org</span> True @@ -328,8 +361,8 @@ True - 0.000000 - 0.000000 + 0 + 0 True @@ -347,7 +380,7 @@ True - C_redits + C_redits True @@ -367,7 +400,7 @@ True True True - _License + _License True @@ -379,7 +412,7 @@ True True True - gtk-close + gtk-close True diff --git a/moo/mooapp/mooappabout.c b/moo/mooapp/mooappabout.c index e223e7a6..70a20375 100644 --- a/moo/mooapp/mooappabout.c +++ b/moo/mooapp/mooappabout.c @@ -41,6 +41,41 @@ static gpointer system_info_dialog; #define MOO_TYPE_HTML GTK_TYPE_TEXT_VIEW #endif +static void +set_translator_credits (MooGladeXML *xml) +{ + GtkWidget *notebook, *page; + const char *credits, *credits_markup; + MooHtml *html; + + /* Translators: this goes into About box, under Translated by tab */ + credits = _("translator_credits"); + /* Translators: this goes into About box, under Translated by tab, + this must be valid html markup, e.g. + "Some Guy <someguy@domain.net>" */ + credits_markup = _("translator_credits_markup"); + + if (!strcmp (credits, "translator_credits")) + { + notebook = moo_glade_xml_get_widget (xml, "notebook"); + page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 2); + gtk_widget_hide (page); + return; + } + + html = moo_glade_xml_get_widget (xml, "translated_by"); + +#if defined(MOO_USE_XML) && !defined(__WIN32__) + if (strcmp (credits_markup, "translator_credits_markup") != 0) + _moo_html_load_memory (html, credits_markup, -1, NULL, NULL); + else +#endif + { + GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (html)); + gtk_text_buffer_insert_at_cursor (buffer, credits, -1); + } +} + static void show_credits (void) { @@ -63,6 +98,7 @@ show_credits (void) xml = moo_glade_xml_new_empty (GETTEXT_PACKAGE); moo_glade_xml_map_id (xml, "written_by", MOO_TYPE_HTML); + moo_glade_xml_map_id (xml, "translated_by", MOO_TYPE_HTML); moo_glade_xml_parse_memory (xml, MOO_APP_ABOUT_GLADE_UI, -1, "credits", NULL); credits_dialog = moo_glade_xml_get_widget (xml, "credits"); @@ -85,6 +121,8 @@ show_credits (void) } #endif + set_translator_credits (xml); + thanks = moo_glade_xml_get_widget (xml, "thanks"); buffer = gtk_text_view_get_buffer (thanks); gtk_text_buffer_insert_at_cursor (buffer, info->credits, -1); @@ -153,7 +191,7 @@ create_about_dialog (void) MooGladeXML *xml; GtkWidget *dialog, *logo, *button; const MooAppInfo *info; - char *markup, *title; + char *markup; GtkLabel *label; MooLinkLabel *url; @@ -166,9 +204,6 @@ create_about_dialog (void) dialog = moo_glade_xml_get_widget (xml, "dialog"); g_signal_connect (dialog, "key-press-event", G_CALLBACK (about_dialog_key_press), NULL); - title = g_strdup_printf ("About %s", info->full_name); - gtk_window_set_title (GTK_WINDOW (dialog), title); - g_object_add_weak_pointer (G_OBJECT (dialog), &about_dialog); g_signal_connect (dialog, "delete-event", G_CALLBACK (gtk_widget_hide_on_delete), NULL); @@ -215,7 +250,6 @@ create_about_dialog (void) button = moo_glade_xml_get_widget (xml, "close_button"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_hide), dialog); - g_free (title); g_object_unref (xml); return dialog;