source: trunk/third/gnome-applets/gweather/gweather-about.c @ 20910

Revision 20910, 2.9 KB checked in by ghudson, 20 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r20909, which included commits to RCS files with non-trunk default branches.
Line 
1/* $Id: gweather-about.c,v 1.1.1.3 2004-10-04 03:04:22 ghudson Exp $ */
2
3/*
4 *  Papadimitriou Spiros <spapadim+@cs.cmu.edu>
5 *
6 *  This code released under the GNU GPL.
7 *  Read the file COPYING for more information.
8 *
9 *  About box
10 *
11 */
12
13#ifdef HAVE_CONFIG_H
14#  include <config.h>
15#endif
16
17#include <stdio.h>
18#include <stdlib.h>
19#include <assert.h>
20
21#include <gnome.h>
22
23#include "gweather.h"
24#include "gweather-about.h"
25
26
27void gweather_about_run (GWeatherApplet *gw_applet)
28{
29    GtkIconInfo *icon_info;
30    GdkPixbuf   *pixbuf = NULL;
31    GError      *error = NULL;
32   
33    static const gchar *authors[] = {
34        "Kevin Vandersloot <kfv101@psu.edu>",
35        "Spiros Papadimitriou <spapadim+@cs.cmu.edu>",
36        "Todd Kulesza <fflewddur@dropline.net>",
37        NULL
38    };
39
40    const gchar *documenters[] = {
41        "Dan Mueth <d-mueth@uchicago.edu>",
42        "Spiros Papadimitriou <spapadim+@cs.cmu.edu>",
43        "Sun GNOME Documentation Team <gdocteam@sun.com>",
44        NULL
45    };
46
47    const gchar *translator_credits = _("translator_credits");
48
49   
50    if (gw_applet->about_dialog) {
51        gtk_window_set_screen (GTK_WINDOW (gw_applet->about_dialog),
52                               gtk_widget_get_screen (GTK_WIDGET (gw_applet->applet)));
53
54        gtk_window_present (GTK_WINDOW (gw_applet->about_dialog));
55        return;
56    }
57   
58    icon_info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (), "stock_weather-storm", 48, 0);
59    if (icon_info) {
60        pixbuf = gtk_icon_info_load_icon (icon_info, &error);
61
62        if (error) {
63            g_warning (G_STRLOC ": cannot open %s: %s", gtk_icon_info_get_filename (icon_info), error->message);
64            g_error_free (error);
65        }
66    }
67   
68    gw_applet->about_dialog = gnome_about_new (_("Weather Report"), VERSION,
69                                    _("Copyright (c)1999 by S. Papadimitriou"),
70                                    _("Released under the GNU General Public License.\n\n"
71                                        "An applet for monitoring local weather conditions."),
72                                    authors,
73                                    documenters,
74                                    strcmp (translator_credits, "translator_credits") != 0 ? translator_credits : NULL,
75                                    pixbuf);
76    if (pixbuf)
77        gdk_pixbuf_unref (pixbuf);
78
79    gtk_window_set_screen (GTK_WINDOW (gw_applet->about_dialog),
80                           gtk_widget_get_screen (GTK_WIDGET (gw_applet->applet)));                           
81    gtk_window_set_wmclass (GTK_WINDOW (gw_applet->about_dialog), "weather report", "Weather Report"); 
82    gnome_window_icon_set_from_file (GTK_WINDOW (gw_applet->about_dialog), gtk_icon_info_get_filename (icon_info));     
83   
84    gtk_signal_connect (GTK_OBJECT (gw_applet->about_dialog), "destroy",
85                        GTK_SIGNAL_FUNC(gtk_widget_destroyed), &gw_applet->about_dialog );
86    gtk_widget_show (gw_applet->about_dialog);
87   
88    if (icon_info)
89        gtk_icon_info_free (icon_info);
90   
91    return;
92}
Note: See TracBrowser for help on using the repository browser.