Kaydet (Commit) 84e5181c authored tarafından Enrico Tröger's avatar Enrico Tröger

Rework credits page to fix some display issues.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1762 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 7ecd0703
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
* scintilla/LexHTML.cxx, scintilla/Makefile.am: * scintilla/LexHTML.cxx, scintilla/Makefile.am:
Backport of LexHTML from Scintilla CVS to fix #1759166. Backport of LexHTML from Scintilla CVS to fix #1759166.
Disable debug build of Scintilla and use -Os. Disable debug build of Scintilla and use -Os.
* src/about.c: Rework credits page to fix some display issues.
2007-07-28 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> 2007-07-28 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
......
...@@ -55,7 +55,7 @@ M.Baldinelli <m(dot)baldinelli(at)agora(dot)it> - it ...@@ -55,7 +55,7 @@ M.Baldinelli <m(dot)baldinelli(at)agora(dot)it> - it
Dario Santomarco <dariello(at)yahoo(dot)it> - it Dario Santomarco <dariello(at)yahoo(dot)it> - it
Kurt De Bree <kdebree(at)telenet(dot)be> - nl Kurt De Bree <kdebree(at)telenet(dot)be> - nl
Jacek Wolszczak <shutdownrunner(at)o2(dot)pl> - pl_PL Jacek Wolszczak <shutdownrunner(at)o2(dot)pl> - pl_PL
Jarosław Foksa" <jfoksa(at)gmail(dot)com> - pl_PL Jarosław Foksa <jfoksa(at)gmail(dot)com> - pl_PL
Alexandre Moreira <alexandream(at)gmail(dot)com> - pt_BR Alexandre Moreira <alexandream(at)gmail(dot)com> - pt_BR
Adrovane Marques Kade <adrovane(at)gmail(dot)com> - pt_BR Adrovane Marques Kade <adrovane(at)gmail(dot)com> - pt_BR
brahmann_ <brahmann(at)lifec0re(dot)org(dot)ru> - ru_RU brahmann_ <brahmann(at)lifec0re(dot)org(dot)ru> - ru_RU
......
...@@ -40,44 +40,47 @@ static GtkWidget *gb_window = NULL; ...@@ -40,44 +40,47 @@ static GtkWidget *gb_window = NULL;
#define CODENAME "<span weight=\"bold\">\"" GEANY_CODENAME "\"</span>" #define CODENAME "<span weight=\"bold\">\"" GEANY_CODENAME "\"</span>"
#define BUILDDATE "<span size=\"smaller\">%s</span>" #define BUILDDATE "<span size=\"smaller\">%s</span>"
#define COPYRIGHT "Copyright (c) 2005-2007\nEnrico Tröger\nNick Treleaven\nFrank Lanitz\nAll rights reserved." #define COPYRIGHT "Copyright (c) 2005-2007\nEnrico Tröger\nNick Treleaven\nFrank Lanitz\nAll rights reserved."
#define CREDITS \
"<span size=\"larger\" weight=\"bold\">%s</span>\n\t\ const gchar *translators[][2] = {
\ { "be_BY", "Yura Semashko &lt;yurand2@gmail.com&gt;" },
Enrico Tröger - %s\n\t\ { "bg", "Dilyan Rusev &lt;dilyanrusev@gmail.com&gt;" },
&lt;enrico.troeger@uvena.de&gt;\n\n\t\ { "ca_ES", "Toni Garcia-Navarro &lt;topi@elpiset.net&gt;" },
Nick Treleaven - %s\n\t\ { "cs_CZ", "Petr Messner &lt;messa@messa.cz&gt;" },
&lt;nick.treleaven@btinternet.com&gt;\n\n\t\ { "de_DE", "Enrico Tröger &lt;enrico.troeger@uvena.de&gt;\nFrank Lanitz &lt;frank@frank.uvena.de&gt;" },
Frank Lanitz - %s\n\t\ { "es", "Damián Viano &lt;debian@damianv.com.ar&gt;\nNacho Cabanes &lt;ncabanes@gmail.com&gt;" },
&lt;frank@frank.uvena.de&gt;\n\n\t\ { "fi_FI", "Harri Koskinen &lt;harri@fastmonkey.org&gt;" },
\n<span size=\"larger\" weight=\"bold\">%s</span>\n\t\ { "fr", "Jean-Philippe Moal &lt;skateinmars@skateinmars.net&gt;" },
\ { "hu", "Gabor Kmetyko &lt;kg_kilo@freemail.hu&gt;" },
be_BY\t Yura Semashko &lt;yurand2@gmail.com&gt;\n\n\t\ { "it", "Max Baldinelli &lt;m.baldinelli@agora.it&gt;,\nDario Santomarco &lt;dariello@yahoo.it&gt;" },
bg\t Dilyan Rusev &lt;dilyanrusev@gmail.com&gt;\n\n\t\ { "nl", "Kurt De Bree &lt;kdebree@telenet.be&gt;" },
ca_ES\t Toni Garcia-Navarro &lt;topi@elpiset.net&gt;\n\n\t\ { "pl_PL", "Jarosław Foksa &lt;jfoksa@gmail.com&gt;" },
cs_CZ\t Petr Messner &lt;messa@messa.cz&gt;\n\n\t\ { "pt_BR", "Alexandra Moreire &lt;alexandream@gmail.com&gt;\nAdrovane Marques Kade &lt;adrovane@gmail.com&gt;" },
de_DE\t Enrico Tröger &lt;enrico.troeger@uvena.de&gt;\n\t\ { "ru_RU", "brahmann_ &lt;brahmann@mthr.net.ru&gt;" },
\t Frank Lanitz &lt;frank@frank.uvena.de&gt;\n\n\t\ { "vi_VN", "Clytie Siddall &lt;clytie@riverland.net.au&gt;" },
es\t Damián Viano &lt;debian@damianv.com.ar&gt;\n\t\ { "zh_CN", "Dormouse Young &lt;dormouse.young@gmail.com&gt;" },
\t Nacho Cabanes &lt;ncabanes@gmail.com&gt;\n\n\t\ { "zh_TW", "KoViCH &lt;kovich.ian@gmail.com&gt;" }
fi_FI\t Harri Koskinen &lt;harri@fastmonkey.org&gt;\n\n\t\ };
fr\t Jean-Philippe Moal &lt;skateinmars@skateinmars.net&gt;\n\n\t\ static const gint translators_len = sizeof(translators) / sizeof(translators[0]);
hu\t Gabor Kmetyko &lt;kg_kilo@freemail.hu&gt;\n\n\t\
it\t Max Baldinelli &lt;m.baldinelli@agora.it&gt;\n\t\ const gchar *prev_translators[][2] = {
\t Dario Santomarco &lt;dariello@yahoo.it&gt;\n\n\t\ { "pl_PL", "Jacek Wolszczak &lt;shutdownrunnter@02.pl&gt;" },
nl\t Kurt De Bree &lt;kdebree@telenet.be&gt;\n\n\t\ };
pl_PL\t Jacek Wolszczak &lt;shutdownrunnter@02.pl&gt;\n\n\t\ static const gint prev_translators_len = sizeof(prev_translators) / sizeof(prev_translators[0]);
pt_BR\t Alexandra Moreire &lt;alexandream@gmail.com&gt;\n\t\
\t Adrovane Marques Kade &lt;adrovane@gmail.com&gt;\n\n\t\
ru_RU\t brahmann_ &lt;brahmann@mthr.net.ru&gt;\n\n\t\
vi_VN\t Clytie Siddall &lt;clytie@riverland.net.au&gt;\n\n\t\
zh_CN\t Dormouse Young &lt;dormouse.young@gmail.com&gt;\n\n\t\
zh_TW\t KoViCH &lt;kovich.ian@gmail.com&gt;\n\n\t"
static void header_eventbox_style_set(GtkWidget *widget); static void header_eventbox_style_set(GtkWidget *widget);
static void header_label_style_set(GtkWidget *widget); static void header_label_style_set(GtkWidget *widget);
static void homepage_clicked(GtkButton *button, gpointer data); static void homepage_clicked(GtkButton *button, gpointer data);
#define ROW(text, row, col, x_align, y_padding) \
label = gtk_label_new((text)); \
gtk_table_attach(GTK_TABLE(table), label, (col), (col) + 1, (row), (row) + 1, \
(GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, (y_padding)); \
gtk_label_set_use_markup(GTK_LABEL(label), TRUE); \
gtk_misc_set_alignment(GTK_MISC(label), (x_align), 0);
static GtkWidget *create_dialog(void) static GtkWidget *create_dialog(void)
{ {
GtkWidget *dialog; GtkWidget *dialog;
...@@ -89,11 +92,11 @@ static GtkWidget *create_dialog(void) ...@@ -89,11 +92,11 @@ static GtkWidget *create_dialog(void)
GtkWidget *url_button; GtkWidget *url_button;
GtkWidget *cop_label; GtkWidget *cop_label;
GtkWidget *label; GtkWidget *label;
GtkWidget *credits_label;
GtkWidget *license_textview; GtkWidget *license_textview;
GtkWidget *notebook; GtkWidget *notebook;
GtkWidget *box; GtkWidget *box;
GtkWidget *credits_scrollwin; GtkWidget *credits_scrollwin;
GtkWidget *table;
GtkWidget *license_scrollwin; GtkWidget *license_scrollwin;
GtkWidget *info_box; GtkWidget *info_box;
GtkWidget *button; GtkWidget *button;
...@@ -104,7 +107,7 @@ static GtkWidget *create_dialog(void) ...@@ -104,7 +107,7 @@ static GtkWidget *create_dialog(void)
gchar *license_text = NULL; gchar *license_text = NULL;
gchar buffer[512]; gchar buffer[512];
gchar buffer2[128]; gchar buffer2[128];
gchar *credits; gint i, row = 0;
dialog = gtk_dialog_new(); dialog = gtk_dialog_new();
...@@ -222,18 +225,87 @@ static GtkWidget *create_dialog(void) ...@@ -222,18 +225,87 @@ static GtkWidget *create_dialog(void)
// create "Credits" tab // create "Credits" tab
credits_scrollwin = gtk_scrolled_window_new(NULL, NULL); credits_scrollwin = gtk_scrolled_window_new(NULL, NULL);
gtk_container_set_border_width(GTK_CONTAINER(credits_scrollwin), 6); gtk_container_set_border_width(GTK_CONTAINER(credits_scrollwin), 6);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(credits_scrollwin), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(credits_scrollwin),
credits_label = gtk_label_new(NULL); GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_label_set_selectable(GTK_LABEL(credits_label), TRUE);
gtk_label_set_use_markup(GTK_LABEL(credits_label), TRUE); table = gtk_table_new(14 + translators_len + prev_translators_len, 3, FALSE);
credits = g_strdup_printf(CREDITS, _("Developers"), _("maintainer"), _("developer"), gtk_table_set_col_spacings(GTK_TABLE(table), 10);
_("translation maintainer"), _("Translators"));
credits = utils_str_replace(credits, "<language>", _("language")); row = 0;
gtk_label_set_markup(GTK_LABEL(credits_label), credits); g_snprintf(buffer, sizeof(buffer),
gtk_misc_set_alignment(GTK_MISC(credits_label), 0.0, 0.0); "<span size=\"larger\" weight=\"bold\">%s</span>", _("Developers"));
gtk_widget_show(credits_label); label = gtk_label_new(buffer);
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(credits_scrollwin), credits_label); gtk_table_attach(GTK_TABLE(table), label, 0, 2, row, row + 1,
gtk_viewport_set_shadow_type(GTK_VIEWPORT(gtk_widget_get_parent(credits_label)), GTK_SHADOW_NONE); (GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 5);
gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
row++;
g_snprintf(buffer, sizeof(buffer), "Enrico Tröger - %s", _("maintainer"));
ROW(buffer, row, 1, 0, 0);
row++;
ROW("&lt;enrico.troeger@uvena.de&gt;", row, 1, 0, 0);
row++;
ROW("", row, 0, 0, 0);
row++;
g_snprintf(buffer, sizeof(buffer), "Nick Treleaven - %s", _("developer"));
ROW(buffer, row, 1, 0, 0);
row++;
ROW("&lt;nick.treleaven@btinternet.com&gt;", row, 1, 0, 0);
row++;
ROW("", row, 0, 0, 0);
row++;
g_snprintf(buffer, sizeof(buffer), "Frank Lanitz - %s", _("translation maintainer"));
ROW(buffer, 7, 1, 0, 0);
row++;
ROW("&lt;frank@frank.uvena.de&gt;", row, 1, 0, 0);
row++;
ROW("", row, 0, 0, 0);
row++;
g_snprintf(buffer, sizeof(buffer),
"<span size=\"larger\" weight=\"bold\">%s</span>", _("Translators"));
label = gtk_label_new(buffer);
gtk_table_attach(GTK_TABLE(table), label, 0, 2, row, row + 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 5);
gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
row++;
for (i = 0; i < translators_len; i++)
{
ROW(translators[i][0], row, 0, 1, 4);
ROW(translators[i][1], row, 1, 0, 4);
row++;
}
ROW("", row, 0, 0, 0);
row++;
g_snprintf(buffer, sizeof(buffer),
"<span size=\"larger\" weight=\"bold\">%s</span>", _("Previous Translators"));
label = gtk_label_new(buffer);
gtk_table_attach(GTK_TABLE(table), label, 0, 2, row, row + 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 5);
gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
row++;
for (i = 0; i < prev_translators_len; i++)
{
ROW(prev_translators[i][0], row, 0, 1, 4);
ROW(prev_translators[i][1], row, 1, 0, 4);
row++;
}
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(credits_scrollwin), table);
gtk_viewport_set_shadow_type(GTK_VIEWPORT(gtk_widget_get_parent(table)), GTK_SHADOW_NONE);
gtk_widget_show_all(table);
label = gtk_label_new(_("Credits")); label = gtk_label_new(_("Credits"));
gtk_widget_show(label); gtk_widget_show(label);
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), credits_scrollwin, label); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), credits_scrollwin, label);
...@@ -241,7 +313,8 @@ static GtkWidget *create_dialog(void) ...@@ -241,7 +313,8 @@ static GtkWidget *create_dialog(void)
// create "License" tab // create "License" tab
license_scrollwin = gtk_scrolled_window_new(NULL, NULL); license_scrollwin = gtk_scrolled_window_new(NULL, NULL);
gtk_container_set_border_width(GTK_CONTAINER(license_scrollwin), 6); gtk_container_set_border_width(GTK_CONTAINER(license_scrollwin), 6);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(license_scrollwin), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(license_scrollwin),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
license_textview = gtk_text_view_new(); license_textview = gtk_text_view_new();
gtk_text_view_set_editable(GTK_TEXT_VIEW(license_textview), FALSE); gtk_text_view_set_editable(GTK_TEXT_VIEW(license_textview), FALSE);
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(license_textview), FALSE); gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(license_textview), FALSE);
...@@ -255,12 +328,12 @@ static GtkWidget *create_dialog(void) ...@@ -255,12 +328,12 @@ static GtkWidget *create_dialog(void)
g_file_get_contents(buffer, &license_text, NULL, NULL); g_file_get_contents(buffer, &license_text, NULL, NULL);
if (license_text == NULL) if (license_text == NULL)
{ {
license_text = g_strdup("License text could not be found, please google for GPLv2"); license_text = g_strdup(
_("License text could not be found, please search the web for GPLv2"));
} }
tb = gtk_text_view_get_buffer(GTK_TEXT_VIEW(license_textview)); tb = gtk_text_view_get_buffer(GTK_TEXT_VIEW(license_textview));
gtk_text_buffer_set_text(tb, license_text, strlen(license_text)); gtk_text_buffer_set_text(tb, license_text, strlen(license_text));
g_free(credits);
g_free(license_text); g_free(license_text);
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), license_scrollwin, label); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), license_scrollwin, label);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment