1 | /* rgaboutpanel.cc |
---|
2 | * |
---|
3 | * Copyright (c) 2000, 2001 Conectiva S/A |
---|
4 | * 2002 Michael Vogt <mvo@debian.org> |
---|
5 | * |
---|
6 | * Author: Alfredo K. Kojima <kojima@conectiva.com.br> |
---|
7 | * Michael Vogt <mvo@debian.org> |
---|
8 | * |
---|
9 | * This program is free software; you can redistribute it and/or |
---|
10 | * modify it under the terms of the GNU General Public License as |
---|
11 | * published by the Free Software Foundation; either version 2 of the |
---|
12 | * License, or (at your option) any later version. |
---|
13 | * |
---|
14 | * This program is distributed in the hope that it will be useful, |
---|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 | * GNU General Public License for more details. |
---|
18 | * |
---|
19 | * You should have received a copy of the GNU General Public License |
---|
20 | * along with this program; if not, write to the Free Software |
---|
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
---|
22 | * USA |
---|
23 | */ |
---|
24 | |
---|
25 | #include <cassert> |
---|
26 | #include "config.h" |
---|
27 | #include "rgaboutpanel.h" |
---|
28 | #include "i18n.h" |
---|
29 | |
---|
30 | static void closeWindow(GtkWidget *self, void *data) |
---|
31 | { |
---|
32 | RGAboutPanel *me = (RGAboutPanel *) data; |
---|
33 | |
---|
34 | me->hide(); |
---|
35 | } |
---|
36 | |
---|
37 | RGCreditsPanel::RGCreditsPanel(RGWindow *parent): |
---|
38 | RGGladeWindow(parent, "about", "credits") |
---|
39 | { |
---|
40 | glade_xml_signal_connect_data(_gladeXML, |
---|
41 | "on_closebutton_clicked", |
---|
42 | G_CALLBACK(closeWindow), this); |
---|
43 | |
---|
44 | skipTaskbar(true); |
---|
45 | |
---|
46 | // hide translators credits if it is not found in the po file |
---|
47 | GtkWidget *credits; |
---|
48 | credits = glade_xml_get_widget(_gladeXML,"label_translator_credits"); |
---|
49 | assert(credits); |
---|
50 | const char* s = gtk_label_get_text(GTK_LABEL(credits)); |
---|
51 | if(strcmp(s, "translators-credits") == 0) |
---|
52 | gtk_widget_hide(credits); |
---|
53 | }; |
---|
54 | |
---|
55 | |
---|
56 | void RGAboutPanel::creditsClicked(GtkWidget *self, void *data) |
---|
57 | { |
---|
58 | RGAboutPanel *me = (RGAboutPanel *) data; |
---|
59 | |
---|
60 | if (me->credits == NULL) { |
---|
61 | me->credits = new RGCreditsPanel::RGCreditsPanel(me); |
---|
62 | } |
---|
63 | me->credits->setTitle(_("Credits")); |
---|
64 | |
---|
65 | me->credits->show(); |
---|
66 | } |
---|
67 | |
---|
68 | |
---|
69 | RGAboutPanel::RGAboutPanel(RGWindow *parent) |
---|
70 | : RGGladeWindow(parent, "about"), credits(NULL) |
---|
71 | { |
---|
72 | glade_xml_signal_connect_data(_gladeXML, |
---|
73 | "on_okbutton_clicked", |
---|
74 | G_CALLBACK(closeWindow), this); |
---|
75 | glade_xml_signal_connect_data(_gladeXML, |
---|
76 | "on_button_credits_clicked", |
---|
77 | G_CALLBACK(creditsClicked), this); |
---|
78 | |
---|
79 | skipTaskbar(true); |
---|
80 | |
---|
81 | setTitle(_("About Synaptic")); |
---|
82 | GtkWidget *w = glade_xml_get_widget(_gladeXML, "label_version"); |
---|
83 | assert(w); |
---|
84 | gchar *s = |
---|
85 | g_strdup_printf("<span size=\"xx-large\" weight=\"bold\">%s</span>", |
---|
86 | PACKAGE " " VERSION); |
---|
87 | gtk_label_set_markup(GTK_LABEL(w), s); |
---|
88 | |
---|
89 | g_free(s); |
---|
90 | } |
---|