[280] | 1 | /* rgiconlegend.cc |
---|
| 2 | * |
---|
| 3 | * Copyright (c) 2004 Michael Vogt <mvo@debian.org> |
---|
| 4 | * |
---|
| 5 | * Author: Michael Vogt <mvo@debian.org> |
---|
| 6 | * |
---|
| 7 | * This program is free software; you can redistribute it and/or |
---|
| 8 | * modify it under the terms of the GNU General Public License as |
---|
| 9 | * published by the Free Software Foundation; either version 2 of the |
---|
| 10 | * License, or (at your option) any later version. |
---|
| 11 | * |
---|
| 12 | * This program is distributed in the hope that it will be useful, |
---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 15 | * GNU General Public License for more details. |
---|
| 16 | * |
---|
| 17 | * You should have received a copy of the GNU General Public License |
---|
| 18 | * along with this program; if not, write to the Free Software |
---|
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
---|
| 20 | * USA |
---|
| 21 | */ |
---|
| 22 | |
---|
| 23 | #include <cassert> |
---|
| 24 | #include "config.h" |
---|
| 25 | #include "rgiconlegend.h" |
---|
| 26 | #include "rgmisc.h" |
---|
| 27 | |
---|
| 28 | #include "i18n.h" |
---|
| 29 | |
---|
| 30 | static void closeWindow(GtkWidget *self, void *data) |
---|
| 31 | { |
---|
| 32 | RGIconLegendPanel *me = (RGIconLegendPanel *) data; |
---|
| 33 | |
---|
| 34 | me->hide(); |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | RGIconLegendPanel::RGIconLegendPanel(RGWindow *parent) |
---|
| 39 | : RGGladeWindow(parent, "iconlegend") |
---|
| 40 | { |
---|
| 41 | setTitle(_("Icon Legend")); |
---|
| 42 | glade_xml_signal_connect_data(_gladeXML, |
---|
| 43 | "on_button_close_clicked", |
---|
| 44 | G_CALLBACK(closeWindow), this); |
---|
| 45 | GtkWidget *vbox = glade_xml_get_widget(_gladeXML, "vbox_main"); |
---|
| 46 | assert(vbox); |
---|
| 47 | |
---|
| 48 | GtkWidget *hbox, *label, *pix; |
---|
| 49 | |
---|
| 50 | for (int i = 0; i < RGPackageStatus::N_STATUS_COUNT; i++) { |
---|
| 51 | hbox = gtk_hbox_new(FALSE, 12); |
---|
| 52 | |
---|
| 53 | pix = gtk_image_new_from_pixbuf(RGPackageStatus::pkgStatus.getPixbuf(i)); |
---|
| 54 | gtk_box_pack_start(GTK_BOX(hbox), pix, FALSE, FALSE, 0); |
---|
| 55 | |
---|
| 56 | label = gtk_label_new(RGPackageStatus::pkgStatus.getLongStatusString(i)); |
---|
| 57 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
---|
| 58 | |
---|
| 59 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
---|
| 60 | } |
---|
| 61 | |
---|
| 62 | |
---|
| 63 | // package support status |
---|
| 64 | hbox = gtk_hbox_new(FALSE, 12); |
---|
| 65 | gchar *filename = "../pixmaps/package-supported.png"; |
---|
| 66 | if (!FileExists(filename)) { |
---|
| 67 | filename = SYNAPTIC_PIXMAPDIR "package-supported.png"; |
---|
| 68 | } |
---|
| 69 | pix = gtk_image_new_from_pixbuf(gdk_pixbuf_new_from_file(filename, NULL)); |
---|
| 70 | gtk_box_pack_start(GTK_BOX(hbox), pix, FALSE, FALSE, 0); |
---|
| 71 | label = gtk_label_new(_config->Find("Synaptic::supported-text", |
---|
| 72 | _("Package is supported")).c_str()); |
---|
| 73 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
---|
| 74 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
---|
| 75 | |
---|
| 76 | gtk_widget_show_all(vbox); |
---|
| 77 | skipTaskbar(true); |
---|
| 78 | show(); |
---|
| 79 | } |
---|