[Xfce4-commits] <xfce4-weather-plugin:master> Give credits to Wikipedia.
Harald Judt
noreply at xfce.org
Sun Jan 27 19:48:01 CET 2013
Updating branch refs/heads/master
to 72279eb348810180290e9b303cbec1fcc7c7c8e6 (commit)
from dd9e84c6b076808a38dd9154d54c513327f7f835 (commit)
commit 72279eb348810180290e9b303cbec1fcc7c7c8e6
Author: Harald Judt <h.judt at gmx.at>
Date: Sun Jan 27 19:46:18 2013 +0100
Give credits to Wikipedia.
panel-plugin/weather-summary.c | 31 +++++++++++++++++++------------
1 files changed, 19 insertions(+), 12 deletions(-)
diff --git a/panel-plugin/weather-summary.c b/panel-plugin/weather-summary.c
index 564fca6..052e104 100644
--- a/panel-plugin/weather-summary.c
+++ b/panel-plugin/weather-summary.c
@@ -83,7 +83,8 @@ lnk_clicked(GtkTextTag *tag,
&iter, text, -1, lnk_tag, NULL); \
gtk_text_buffer_insert(GTK_TEXT_BUFFER(buffer), \
&iter, "\n", -1); \
- g_object_set_data_full(G_OBJECT(lnk_tag), "url", g_strdup(url), g_free); \
+ g_object_set_data_full(G_OBJECT(lnk_tag), "url", \
+ g_strdup(url), g_free); \
g_signal_connect(G_OBJECT(lnk_tag), "event", \
G_CALLBACK(lnk_clicked), NULL);
@@ -304,7 +305,7 @@ create_summary_tab(plugin_data *data)
{
GtkTextBuffer *buffer;
GtkTextIter iter;
- GtkTextTag *btag, *ltag0, *ltag1;
+ GtkTextTag *btag, *ltag0, *ltag1, *ltag2;
GtkWidget *view, *frame, *scrolled, *icon;
GtkAdjustment *adj;
GdkColor lnk_color;
@@ -341,12 +342,6 @@ create_summary_tab(plugin_data *data)
btag = gtk_text_buffer_create_tag(buffer, NULL, "weight",
PANGO_WEIGHT_BOLD, NULL);
- gdk_color_parse("#0000ff", &lnk_color);
- ltag0 = gtk_text_buffer_create_tag(buffer, "lnk0",
- "foreground-gdk", &lnk_color, NULL);
- ltag1 = gtk_text_buffer_create_tag(buffer, "lnk1",
- "foreground-gdk", &lnk_color, NULL);
-
conditions = get_current_conditions(data->weatherdata);
APPEND_BTEXT(_("Coordinates\n"));
APPEND_TEXT_ITEM(_("Altitude"), ALTITUDE);
@@ -510,10 +505,22 @@ create_summary_tab(plugin_data *data)
APPEND_TEXT_ITEM(_("High clouds"), CLOUDS_HIGH);
APPEND_TEXT_ITEM(_("Cloudiness"), CLOUDINESS);
- APPEND_BTEXT(_("\nData from The Norwegian Meteorological Institute\n"));
- value = g_strdup("http://met.no");
- g_object_set_data_full(G_OBJECT(ltag0), "url", value, g_free);
- APPEND_LINK_ITEM("\t", _("Thanks to met.no"), "http://met.no/", ltag1);
+ /* credits */
+ gdk_color_parse("#0000ff", &lnk_color);
+ ltag0 = gtk_text_buffer_create_tag(buffer, "lnk0",
+ "foreground-gdk", &lnk_color, NULL);
+ ltag1 = gtk_text_buffer_create_tag(buffer, "lnk1",
+ "foreground-gdk", &lnk_color, NULL);
+ ltag2 = gtk_text_buffer_create_tag(buffer, "lnk2",
+ "foreground-gdk", &lnk_color, NULL);
+ APPEND_BTEXT(_("\nCredits\n"));
+ APPEND_LINK_ITEM(_("\tEncyclopedic information partly taken from\n\t\t"),
+ _("Wikipedia"), "http://wikipedia.org", ltag2);
+ APPEND_LINK_ITEM(_("\n\tWeather and astronomical data from\n\t\t"),
+ _("The Norwegian Meteorological Institute"),
+ "http://met.no/", ltag1);
+ g_object_set_data_full(G_OBJECT(ltag0), "url", /* url for image */
+ g_strdup("http://met.no"), g_free);
g_signal_connect(G_OBJECT(view), "motion-notify-event",
G_CALLBACK(view_motion_notify), sum);
More information about the Xfce4-commits
mailing list