[Goodies-commits] r1973 - in xfce4-weather-plugin/trunk: . panel-plugin
Nick Schermer
nick at xfce.org
Wed Sep 6 10:58:24 CEST 2006
Author: nick
Date: 2006-09-06 08:58:22 +0000 (Wed, 06 Sep 2006)
New Revision: 1973
Modified:
xfce4-weather-plugin/trunk/ChangeLog
xfce4-weather-plugin/trunk/Makefile.am
xfce4-weather-plugin/trunk/autogen.sh
xfce4-weather-plugin/trunk/configure.in.in
xfce4-weather-plugin/trunk/panel-plugin/Makefile.am
xfce4-weather-plugin/trunk/panel-plugin/config_dialog.c
xfce4-weather-plugin/trunk/panel-plugin/config_dialog.h
xfce4-weather-plugin/trunk/panel-plugin/get_data.c
xfce4-weather-plugin/trunk/panel-plugin/get_data.h
xfce4-weather-plugin/trunk/panel-plugin/http_client.c
xfce4-weather-plugin/trunk/panel-plugin/http_client.h
xfce4-weather-plugin/trunk/panel-plugin/icon.c
xfce4-weather-plugin/trunk/panel-plugin/icon.h
xfce4-weather-plugin/trunk/panel-plugin/parsers.c
xfce4-weather-plugin/trunk/panel-plugin/parsers.h
xfce4-weather-plugin/trunk/panel-plugin/plugin.c
xfce4-weather-plugin/trunk/panel-plugin/plugin.h
xfce4-weather-plugin/trunk/panel-plugin/scrollbox.c
xfce4-weather-plugin/trunk/panel-plugin/scrollbox.h
xfce4-weather-plugin/trunk/panel-plugin/search_dialog.c
xfce4-weather-plugin/trunk/panel-plugin/search_dialog.h
xfce4-weather-plugin/trunk/panel-plugin/summary_window.c
xfce4-weather-plugin/trunk/panel-plugin/summary_window.h
xfce4-weather-plugin/trunk/panel-plugin/translate.c
xfce4-weather-plugin/trunk/panel-plugin/translate.h
Log:
* Addded $Id$'s using svn:keyword
* Trailing spaces are striped by Geany
Modified: xfce4-weather-plugin/trunk/ChangeLog
===================================================================
--- xfce4-weather-plugin/trunk/ChangeLog 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/ChangeLog 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,3 +1,8 @@
+2006-09-06 11:00 nick
+
+ * Addded $Id$'s using svn:keyword
+ * Trailing spaces are striped by Geany
+
2006-09-05 22:00 nick
* Fix typo in desktop file
Modified: xfce4-weather-plugin/trunk/Makefile.am
===================================================================
--- xfce4-weather-plugin/trunk/Makefile.am 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/Makefile.am 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,3 +1,5 @@
+# $Id$
+
SUBDIRS = \
panel-plugin \
po \
@@ -22,4 +24,4 @@
DISTCLEANFILES = \
intltool-extract \
intltool-merge \
- intltool-update
\ No newline at end of file
+ intltool-update
Property changes on: xfce4-weather-plugin/trunk/Makefile.am
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/autogen.sh
===================================================================
--- xfce4-weather-plugin/trunk/autogen.sh 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/autogen.sh 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $Id: autogen.sh 20256 2006-03-06 15:43:06Z benny $
+# $Id$
#
# Copyright (c) 2002-2006
# The Thunar development team. All rights reserved.
@@ -35,5 +35,3 @@
< "configure.in.in" > "configure.in"
exec xdt-autogen $@
-
-# vi:set ts=2 sw=2 et ai:
Property changes on: xfce4-weather-plugin/trunk/autogen.sh
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/configure.in.in
===================================================================
--- xfce4-weather-plugin/trunk/configure.in.in 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/configure.in.in 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,4 +1,4 @@
-dnl configure.ac
+dnl $Id$
dnl
dnl xfce4-weather-plugin - Show current weather conditions in your panel
dnl
Property changes on: xfce4-weather-plugin/trunk/configure.in.in
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/panel-plugin/Makefile.am
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/Makefile.am 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/panel-plugin/Makefile.am 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,3 +1,5 @@
+# $Id$
+
plugindir = $(libexecdir)/xfce4/panel-plugins
plugin_PROGRAMS = xfce4-weather-plugin
Property changes on: xfce4-weather-plugin/trunk/panel-plugin/Makefile.am
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/panel-plugin/config_dialog.c
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/config_dialog.c 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/panel-plugin/config_dialog.c 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,6 +1,6 @@
-/* vim: set expandtab ts=8 sw=4: */
-
-/* This program is free software; you can redistribute it and/or modify
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
@@ -32,7 +32,7 @@
#define OPTIONS_N 11
#define BORDER 8
-const static labeloption labeloptions[OPTIONS_N] = {
+const static labeloption labeloptions[OPTIONS_N] = {
{N_("Windchill (F)"), FLIK},
{N_("Temperature (T)"), TEMP},
{N_("Atmosphere pressure (P)"), BAR_R},
@@ -54,7 +54,7 @@
int opt)
{
GtkTreeIter iter;
-
+
gtk_list_store_append (mdl, &iter);
gtk_list_store_set (mdl, &iter,
0, _(labeloptions[opt].name),
@@ -67,7 +67,7 @@
gpointer data)
{
xfceweather_dialog *dialog = (xfceweather_dialog *) data;
- gint history = gtk_option_menu_get_history (GTK_OPTION_MENU (dialog->opt_xmloption));
+ gint history = gtk_option_menu_get_history (GTK_OPTION_MENU (dialog->opt_xmloption));
add_mdl_option (dialog->mdl_xmloption, history);
@@ -81,7 +81,7 @@
xfceweather_dialog *dialog = (xfceweather_dialog *)data;
GtkTreeIter iter;
GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (dialog->lst_xmloption));
-
+
if (gtk_tree_selection_get_selected (selection, NULL, &iter))
gtk_list_store_remove (GTK_LIST_STORE (dialog->mdl_xmloption), &iter);
@@ -110,14 +110,14 @@
!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)));
return FALSE;
-}
+}
static
GtkWidget *make_label (void)
{
guint i;
GtkWidget *widget, *menu;
-
+
menu = gtk_menu_new ();
widget = gtk_option_menu_new ();
@@ -128,7 +128,7 @@
gtk_menu_shell_append (GTK_MENU_SHELL (menu),
gtk_menu_item_new_with_label (_(opt.name)));
}
-
+
gtk_option_menu_set_menu (GTK_OPTION_MENU (widget), menu);
return widget;
@@ -143,18 +143,18 @@
gchar *text;
xfceweather_data *data = (xfceweather_data *) dialog->wd;
-
+
history = gtk_option_menu_get_history (GTK_OPTION_MENU (dialog->opt_unit));
if (history == 0)
data->unit = IMPERIAL;
- else
+ else
data->unit = METRIC;
if (data->location_code)
g_free (data->location_code);
- data->location_code = g_strdup (gtk_entry_get_text (GTK_ENTRY (dialog->txt_loc_code)));
+ data->location_code = g_strdup (gtk_entry_get_text (GTK_ENTRY (dialog->txt_loc_code)));
/* call labels_clear() here */
if (data->labels && data->labels->len > 0)
@@ -174,13 +174,13 @@
g_array_append_val (data->labels, option);
g_value_unset (&value);
}
-
+
if (data->proxy_host)
{
g_free (data->proxy_host);
- data->proxy_host = NULL;
+ data->proxy_host = NULL;
}
-
+
if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->chk_proxy_use)))
data->proxy_fromenv = FALSE;
else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->chk_proxy_fromenv)))
@@ -206,12 +206,12 @@
if (data->saved_proxy_host)
g_free (data->saved_proxy_host);
-
+
data->saved_proxy_host = g_strdup(text);
data->saved_proxy_port = data->proxy_port;
-
+
g_free (text);
- }
+ }
if (cb)
cb(data);
@@ -236,7 +236,7 @@
gpointer user_data)
{
xfceweather_dialog *dialog = (xfceweather_dialog *) user_data;
- search_dialog *sdialog = create_search_dialog(NULL,
+ search_dialog *sdialog = create_search_dialog(NULL,
dialog->wd->proxy_host, dialog->wd->proxy_port);
if (run_search_dialog(sdialog))
@@ -246,23 +246,23 @@
return FALSE;
}
-
+
xfceweather_dialog *
create_config_dialog (xfceweather_data *data,
GtkWidget *vbox)
{
xfceweather_dialog *dialog;
- GtkWidget *vbox2, *vbox3, *hbox, *hbox2, *label,
- *menu, *button_add,
+ GtkWidget *vbox2, *vbox3, *hbox, *hbox2, *label,
+ *menu, *button_add,
*button_del, *image, *button, *scroll;
GtkSizeGroup *sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
GtkSizeGroup *sg_buttons = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
GtkTreeViewColumn *column;
- GtkCellRenderer *renderer;
-
+ GtkCellRenderer *renderer;
+
dialog = panel_slice_new0 (xfceweather_dialog);
-
+
dialog->wd = (xfceweather_data *)data;
dialog->dialog = gtk_widget_get_toplevel (vbox);
@@ -270,7 +270,7 @@
gtk_misc_set_alignment (GTK_MISC(label), 0, 0.5);
menu = gtk_menu_new ();
dialog->opt_unit = gtk_option_menu_new ();
-
+
gtk_menu_shell_append ((GtkMenuShell *)(GTK_MENU(menu)),
(gtk_menu_item_new_with_label (_("Imperial"))));
gtk_menu_shell_append ((GtkMenuShell *)(GTK_MENU(menu)),
@@ -295,7 +295,7 @@
gtk_misc_set_alignment (GTK_MISC(label), 0, 0.5);
if (dialog->wd->location_code != NULL)
- gtk_entry_set_text (GTK_ENTRY(dialog->txt_loc_code),
+ gtk_entry_set_text (GTK_ENTRY(dialog->txt_loc_code),
dialog->wd->location_code);
gtk_size_group_add_widget (sg, label);
@@ -314,7 +314,7 @@
label = gtk_label_new (_("Proxy server:"));
dialog->txt_proxy_host = gtk_entry_new ();
dialog->chk_proxy_use = gtk_check_button_new_with_label (_("Use proxy server"));
- dialog->chk_proxy_fromenv =
+ dialog->chk_proxy_fromenv =
gtk_check_button_new_with_label (_("Auto-detect from environment"));
dialog->txt_proxy_port = gtk_spin_button_new_with_range (0, 65536, 1);
@@ -330,8 +330,8 @@
gtk_box_pack_start (GTK_BOX (hbox), dialog->txt_proxy_host, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), dialog->txt_proxy_port, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox3), hbox, FALSE, FALSE, 0);
-
+
hbox2 = gtk_hbox_new (FALSE, BORDER);
gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox2), vbox3, TRUE, TRUE, 0);
@@ -352,24 +352,24 @@
if (dialog->wd->saved_proxy_host != NULL)
{
- gtk_entry_set_text (GTK_ENTRY (dialog->txt_proxy_host),
- dialog->wd->saved_proxy_host);
+ gtk_entry_set_text (GTK_ENTRY (dialog->txt_proxy_host),
+ dialog->wd->saved_proxy_host);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->txt_proxy_port),
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->txt_proxy_port),
dialog->wd->saved_proxy_port);
}
if (dialog->wd->proxy_host || dialog->wd->proxy_fromenv)
- {
+ {
gtk_toggle_button_set_active (
GTK_TOGGLE_BUTTON (dialog->chk_proxy_use), TRUE);
-
+
if (dialog->wd->proxy_fromenv)
gtk_toggle_button_set_active (
GTK_TOGGLE_BUTTON (dialog->chk_proxy_fromenv), TRUE);
}
else
- {
+ {
gtk_toggle_button_set_active (
GTK_TOGGLE_BUTTON (dialog->chk_proxy_use), TRUE);
gtk_toggle_button_set_active (
@@ -378,8 +378,8 @@
/* labels */
-
- dialog->opt_xmloption = make_label ();
+
+ dialog->opt_xmloption = make_label ();
dialog->mdl_xmloption = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT);
dialog->lst_xmloption = gtk_tree_view_new_with_model (GTK_TREE_MODEL(dialog->mdl_xmloption));
@@ -403,7 +403,7 @@
GTK_POLICY_AUTOMATIC);
gtk_container_add(GTK_CONTAINER(scroll), dialog->lst_xmloption);
gtk_box_pack_start (GTK_BOX (hbox), scroll, TRUE, TRUE, 0);
-
+
vbox2 = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox2), button_del, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), vbox2, FALSE, FALSE, 0);
@@ -411,13 +411,13 @@
gtk_widget_set_size_request (dialog->lst_xmloption, -1, 120);
- if (data->labels->len > 0)
+ if (data->labels->len > 0)
{
datas opt;
guint i;
gint n;
-
- for (i = 0; i < data->labels->len; i++)
+
+ for (i = 0; i < data->labels->len; i++)
{
opt = g_array_index (data->labels, datas, i);
@@ -427,15 +427,15 @@
}
g_signal_connect (button_add, "clicked", G_CALLBACK (cb_addoption), dialog);
- g_signal_connect (button_del, "clicked", G_CALLBACK (cb_deloption), dialog);
-
+ g_signal_connect (button_del, "clicked", G_CALLBACK (cb_deloption), dialog);
+
gtk_widget_show_all (vbox);
return dialog;
}
void
-set_callback_config_dialog (xfceweather_dialog *dialog,
+set_callback_config_dialog (xfceweather_dialog *dialog,
cb_function cb_new)
{
cb = cb_new;
Property changes on: xfce4-weather-plugin/trunk/panel-plugin/config_dialog.c
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/panel-plugin/config_dialog.h
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/config_dialog.h 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/panel-plugin/config_dialog.h 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,6 +1,6 @@
-/* vim: set expandtab ts=8 sw=4: */
-
-/* This program is free software; you can redistribute it and/or modify
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
Property changes on: xfce4-weather-plugin/trunk/panel-plugin/config_dialog.h
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/panel-plugin/get_data.c
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/get_data.c 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/panel-plugin/get_data.c 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,6 +1,6 @@
-/* vim: set expandtab ts=8 sw=4: */
-
-/* This program is free software; you can redistribute it and/or modify
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
@@ -40,7 +40,7 @@
{
static gint p = 0;
gchar *s;
-
+
if (!str)
{
DBG ("copy_buffer: received NULL pointer");
@@ -92,8 +92,8 @@
return CHK_NULL(str);
}
-
+
static gchar *
get_data_bar (xml_bar *data,
datas_bar type)
@@ -148,9 +148,9 @@
static gchar *
get_data_cc (xml_cc *data,
datas type)
-{
+{
gchar *str = NULL;
-
+
if (!data)
{
DBG ("get_data_cc: xml-cc not present");
@@ -184,9 +184,9 @@
static gchar *
get_data_loc (xml_loc *data,
datas_loc type)
-{
+{
gchar *str = NULL;
-
+
if (!data)
{
DBG ("get_data_loc: xml-loc not present");
@@ -202,8 +202,8 @@
return CHK_NULL(str);
}
-
+
const gchar *
get_data (xml_weather *data,
datas type)
@@ -213,9 +213,9 @@
if (!data)
str = EMPTY_STRING;
- else
+ else
{
-
+
switch (type & 0xFF00)
{
case DATAS_CC: str = get_data_cc(data->cc, type); break;
@@ -277,17 +277,17 @@
break;
case DPART:
str = get_data_part(data->part[0], type);
- break;
+ break;
}
}
if (!str)
str = "-";
-
+
p = copy_buffer(str);
DBG ("value: %s", p);
-
+
return p;
}
@@ -296,10 +296,10 @@
datas type)
{
gchar *str;
-
+
switch (type & 0x00F0)
{
- case 0x0020:
+ case 0x0020:
str = (unit == METRIC ? "\302\260C" : "\302\260F");
break;
case 0x0030:
@@ -308,7 +308,7 @@
case 0x0040:
str = (unit == METRIC ? _("km/h") : _("mph"));
break;
- case 0x0050:
+ case 0x0050:
str = (unit == METRIC ? _("hPa") : _("in"));
break;
case 0x0060:
Property changes on: xfce4-weather-plugin/trunk/panel-plugin/get_data.c
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/panel-plugin/get_data.h
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/get_data.h 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/panel-plugin/get_data.h 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,6 +1,6 @@
-/* vim: set expandtab ts=8 sw=4: */
-
-/* This program is free software; you can redistribute it and/or modify
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
@@ -47,17 +47,17 @@
TRANS = 0x0103,
UV_INDEX = 0x0105,
UV_TRANS = 0x0106,
- WIND_DIRECTION = 0x0107,
+ WIND_DIRECTION = 0x0107,
BAR_D = 0x0108,
WIND_TRANS = 0x0109,
WICON = 0x0110,
-
- FLIK = 0x0120,
+
+ FLIK = 0x0120,
TEMP = 0x0121,
DEWP = 0x0122,
-
+
HMID = 0x0130,
-
+
WIND_SPEED = 0x0140,
WIND_GUST = 0x0141,
Property changes on: xfce4-weather-plugin/trunk/panel-plugin/get_data.h
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/panel-plugin/http_client.c
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/http_client.c 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/panel-plugin/http_client.c 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,6 +1,6 @@
-/* vim: set expandtab ts=8 sw=4: */
-
-/* This program is free software; you can redistribute it and/or modify
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
@@ -35,10 +35,10 @@
#include "http_client.h"
-struct request_data
+struct request_data
{
int fd;
-
+
FILE *save_fp;
gchar *save_filename;
gchar **save_buffer;
@@ -65,19 +65,19 @@
struct sockaddr_in dest_host;
struct hostent *host_address;
gint fd;
-
+
if ((host_address = gethostbyname(hostname)) == NULL)
return -1;
if ((fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1)
return -1;
-
+
dest_host.sin_family = AF_INET;
dest_host.sin_port = htons(port);
dest_host.sin_addr = *((struct in_addr *)host_address->h_addr);
memset(&(dest_host.sin_zero), '\0', 8);
fcntl(fd, F_SETFL, O_NONBLOCK);
-
+
if ((connect(fd, (struct sockaddr *)&dest_host, sizeof(struct sockaddr)) == -1)
&& errno != EINPROGRESS)
{
@@ -86,9 +86,9 @@
}
else
return fd;
-
+
}
-
+
static void
request_free (struct request_data *request)
{
@@ -114,12 +114,12 @@
DBG ("Request Save");
if (request->save_filename)
- if (!request->save_fp &&
+ if (!request->save_fp &&
(request->save_fp = fopen(request->save_filename, "w"))
== NULL)
return;
else
- fwrite(buffer, sizeof(char), strlen(buffer),
+ fwrite(buffer, sizeof(char), strlen(buffer),
request->save_fp);
else
{
@@ -133,8 +133,8 @@
else
*request->save_buffer = g_strdup(buffer);
}
-}
-
+}
+
static gboolean
keep_sending (gpointer data)
{
@@ -146,16 +146,16 @@
DBG ("keep_sending(): empty request data");
return FALSE;
}
-
- if ((n = send(request->fd, request->request_buffer + request->offset,
- request->size - request->offset,
+
+ if ((n = send(request->fd, request->request_buffer + request->offset,
+ request->size - request->offset,
0)) != -1)
{
request->offset += n;
DBG ("now at offset: %d", request->offset);
DBG ("now at byte: %d", n);
-
+
if (request->offset == request->size)
{
DBG ("keep_sending(): ok data sent");
@@ -167,16 +167,16 @@
{
#if DEBUG
perror("keep_sending()");
-#endif
-
+#endif
+
DBG ("file desc: %d", request->fd);
-
+
request_free(request);
return FALSE;
}
return TRUE;
-}
+}
static gboolean
keep_receiving (gpointer data)
@@ -186,26 +186,26 @@
gint n;
gchar *p;
gchar *str = NULL;
-
+
if (!request)
{
DBG ("keep_receiving(): empty request data ");
return FALSE;
}
- if ((n = recv(request->fd, recvbuffer, sizeof(recvbuffer) -
+ if ((n = recv(request->fd, recvbuffer, sizeof(recvbuffer) -
sizeof(char), 0)) > 0)
{
recvbuffer[n] = '\0';
DBG ("keep_receiving(): bytes recv: %d", n);
-
+
if (!request->has_header)
{
if (request->last_chars != '\0')
- str = g_strconcat(request->last_chars,
+ str = g_strconcat(request->last_chars,
recvbuffer, NULL);
-
+
if ((p = strstr(str, "\r\n\r\n")))
{
request_save(request, p + 4);
@@ -215,8 +215,8 @@
else
{
DBG ("keep_receiving(): no header yet\n\n%s\n..\n",
- recvbuffer);
- memcpy(request->last_chars, recvbuffer + (n - 4),
+ recvbuffer);
+ memcpy(request->last_chars, recvbuffer + (n - 4),
sizeof(char) * 3);
}
@@ -245,14 +245,14 @@
return TRUE;
}
-
-
+
+
static gboolean
http_get (gchar *url,
gchar *hostname,
gboolean savefile,
- gchar **fname_buff,
+ gchar **fname_buff,
gchar *proxy_host,
gint proxy_port,
CB_TYPE callback,
@@ -267,7 +267,7 @@
#endif
return FALSE;
}
-
+
request->has_header = FALSE;
request->cb_function = callback;
request->cb_data = data;
@@ -289,7 +289,7 @@
request_free(request);
return FALSE;
}
-
+
if (proxy_host)
request->request_buffer = g_strdup_printf(
"GET http://%s%s HTTP/1.0\r\n\r\n",
@@ -316,36 +316,36 @@
request->save_buffer = fname_buff;
DBG ("http_get(): adding idle function");
-
+
(void)g_idle_add ((GSourceFunc)keep_sending, (gpointer)request);
DBG ("http_get(): request added");
return TRUE;
-}
+}
gboolean
http_get_file (gchar *url,
gchar *hostname,
- gchar *filename,
+ gchar *filename,
gchar *proxy_host,
gint proxy_port,
CB_TYPE callback,
gpointer data)
{
- return http_get (url, hostname, TRUE, &filename, proxy_host, proxy_port,
+ return http_get (url, hostname, TRUE, &filename, proxy_host, proxy_port,
callback, data);
}
gboolean
http_get_buffer (gchar *url,
gchar *hostname,
- gchar *proxy_host,
+ gchar *proxy_host,
gint proxy_port,
gchar **buffer,
CB_TYPE callback,
gpointer data)
-{
- return http_get (url, hostname, FALSE, buffer, proxy_host, proxy_port,
+{
+ return http_get (url, hostname, FALSE, buffer, proxy_host, proxy_port,
callback, data);
}
Property changes on: xfce4-weather-plugin/trunk/panel-plugin/http_client.c
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/panel-plugin/http_client.h
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/http_client.h 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/panel-plugin/http_client.h 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,6 +1,6 @@
-/* vim: set expandtab ts=8 sw=4: */
-
-/* This program is free software; you can redistribute it and/or modify
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
@@ -23,12 +23,12 @@
typedef void(*CB_TYPE)(gboolean, gpointer);
gboolean
-http_get_file (gchar *url, gchar *hostname,
- gchar *filename, gchar *proxy_host, gint proxy_port,
+http_get_file (gchar *url, gchar *hostname,
+ gchar *filename, gchar *proxy_host, gint proxy_port,
CB_TYPE callback, gpointer data);
-
+
gboolean
-http_get_buffer (gchar *url, gchar *hostname,
+http_get_buffer (gchar *url, gchar *hostname,
gchar *proxy_host, gint proxy_port, gchar **buffer,
CB_TYPE callback, gpointer data);
Property changes on: xfce4-weather-plugin/trunk/panel-plugin/http_client.h
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/panel-plugin/icon.c
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/icon.c 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/panel-plugin/icon.c 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,6 +1,6 @@
-/* vim: set expandtab ts=8 sw=4: */
-
-/* This program is free software; you can redistribute it and/or modify
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
@@ -33,22 +33,22 @@
GdkPixbuf *image = NULL;
gchar *filename;
gint width, height;
-
+
gtk_icon_size_lookup (size, &width, &height);
-
+
filename = g_strdup_printf ("%s%s%s%s%s.png",
THEMESDIR, G_DIR_SEPARATOR_S,
DEFAULT_W_THEME, G_DIR_SEPARATOR_S,
number);
-
+
image = gdk_pixbuf_new_from_file_at_scale (filename,
width, height,
TRUE, NULL);
-
+
g_free (filename);
if (!image)
g_warning ("Weather Plugin: No image found");
-
+
return image;
}
Property changes on: xfce4-weather-plugin/trunk/panel-plugin/icon.c
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/panel-plugin/icon.h
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/icon.h 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/panel-plugin/icon.h 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,6 +1,6 @@
-/* vim: set expandtab ts=8 sw=4: */
-
-/* This program is free software; you can redistribute it and/or modify
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
Property changes on: xfce4-weather-plugin/trunk/panel-plugin/icon.h
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/panel-plugin/parsers.c
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/parsers.c 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/panel-plugin/parsers.c 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,6 +1,6 @@
-/* vim: set expandtab ts=8 sw=4: */
-
-/* This program is free software; you can redistribute it and/or modify
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
@@ -54,7 +54,7 @@
{
if (i >= XML_WEATHER_DAYF_N)
break;
-
+
ret->dayf[i] = parse_dayf(child_node);
i++;
@@ -70,7 +70,7 @@
parse_loc (xmlNode *cur_node)
{
xml_loc *ret;
-
+
if ((ret = panel_slice_new0 (xml_loc)) == NULL)
return NULL;
@@ -95,7 +95,7 @@
parse_uv (xmlNode *cur_node)
{
xml_uv *ret;
-
+
if ((ret = panel_slice_new0 (xml_uv)) == NULL)
return NULL;
@@ -117,7 +117,7 @@
parse_bar (xmlNode *cur_node)
{
xml_bar *ret;
-
+
if ((ret = panel_slice_new0 (xml_bar)) == NULL)
return NULL;
@@ -125,7 +125,7 @@
{
if (cur_node->type != XML_ELEMENT_NODE)
continue;
-
+
if (NODE_IS_TYPE (cur_node, "r"))
ret->r = DATA(cur_node);
else if (NODE_IS_TYPE (cur_node, "d"))
@@ -139,10 +139,10 @@
parse_wind (xmlNode *cur_node)
{
xml_wind *ret;
-
+
if ((ret = panel_slice_new0 (xml_wind)) == NULL)
return NULL;
-
+
for (cur_node = cur_node->children; cur_node; cur_node = cur_node->next)
{
if (cur_node->type != XML_ELEMENT_NODE)
@@ -165,10 +165,10 @@
parse_cc (xmlNode *cur_node)
{
xml_cc *ret;
-
+
if ((ret = panel_slice_new0 (xml_cc)) == NULL)
return NULL;
-
+
for (cur_node = cur_node->children; cur_node; cur_node = cur_node->next)
{
if (cur_node->type != XML_ELEMENT_NODE)
@@ -207,10 +207,10 @@
parse_part (xmlNode *cur_node)
{
xml_part *ret;
-
+
if ((ret = panel_slice_new0 (xml_part)) == NULL)
return NULL;
-
+
for (cur_node = cur_node->children; cur_node; cur_node = cur_node->next)
{
if (cur_node->type != XML_ELEMENT_NODE)
@@ -236,7 +236,7 @@
xml_dayf *
parse_dayf (xmlNode *cur_node)
{
- xml_dayf *ret;
+ xml_dayf *ret;
gchar *value;
if ((ret = panel_slice_new0 (xml_dayf)) == NULL)
@@ -252,7 +252,7 @@
if (NODE_IS_TYPE (cur_node, "hi"))
{
- ret->hi = DATA(cur_node);
+ ret->hi = DATA(cur_node);
g_assert(ret->hi != NULL);
}
else if (NODE_IS_TYPE (cur_node, "low"))
@@ -262,12 +262,12 @@
else if (NODE_IS_TYPE (cur_node, "part"))
{
value = (gchar *) xmlGetProp (cur_node, (const xmlChar *) "p");
-
+
if (xmlStrEqual ((const xmlChar *)value, (const xmlChar *)"d"))
ret->part[0] = parse_part(cur_node);
else if (xmlStrEqual ((const xmlChar *)value, (const xmlChar *)"n"))
ret->part[1] = parse_part(cur_node);
-
+
g_free(value);
}
}
@@ -283,7 +283,7 @@
{
CHK_FREE (data->i);
CHK_FREE (data->t);
-
+
panel_slice_free (xml_uv, data);
}
@@ -294,7 +294,7 @@
CHK_FREE (data->gust);
CHK_FREE (data->d);
CHK_FREE (data->t);
-
+
panel_slice_free (xml_wind, data);
}
@@ -303,7 +303,7 @@
{
CHK_FREE (data->r);
CHK_FREE (data->d);
-
+
panel_slice_free (xml_bar, data);
}
@@ -328,7 +328,7 @@
if (data->bar)
xml_bar_free(data->bar);
-
+
panel_slice_free (xml_cc, data);
}
@@ -338,7 +338,7 @@
CHK_FREE (data->dnam);
CHK_FREE (data->sunr);
CHK_FREE (data->suns);
-
+
panel_slice_free (xml_loc, data);
}
@@ -355,7 +355,7 @@
if (data->wind)
xml_wind_free(data->wind);
-
+
panel_slice_free (xml_part, data);
}
@@ -375,7 +375,7 @@
if (data->part[1])
xml_part_free(data->part[1]);
-
+
panel_slice_free (xml_dayf, data);
}
Property changes on: xfce4-weather-plugin/trunk/panel-plugin/parsers.c
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/panel-plugin/parsers.h
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/parsers.h 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/panel-plugin/parsers.h 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,6 +1,6 @@
-/* vim: set expandtab ts=8 sw=4: */
-
-/* This program is free software; you can redistribute it and/or modify
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
@@ -37,7 +37,7 @@
}
xml_loc;
-typedef struct
+typedef struct
{
gchar *i;
gchar *t;
@@ -68,10 +68,10 @@
gchar *t;
gchar *icon;
gchar *tmp;
-
+
gchar *hmid;
gchar *vis;
-
+
xml_uv *uv;
xml_wind *wind;
xml_bar *bar;
@@ -91,7 +91,7 @@
}
xml_part;
-typedef struct
+typedef struct
{
gchar *day;
gchar *date;
Property changes on: xfce4-weather-plugin/trunk/panel-plugin/parsers.h
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/panel-plugin/plugin.c
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/plugin.c 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/panel-plugin/plugin.c 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,6 +1,6 @@
-/* vim: set expandtab ts=8 sw=4: */
-
-/* This program is free software; you can redistribute it and/or modify
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
@@ -53,7 +53,7 @@
tmp = strstr (env_proxy, "://");
if (!tmp || strlen (tmp) < 3)
- return FALSE;
+ return FALSE;
env_proxy = tmp + 3;
@@ -114,7 +114,7 @@
txtsize = "medium";
else if (size > 30)
txtsize = "small";
- else if (size > 24)
+ else if (size > 24)
txtsize = "x-small";
else
txtsize = "xx-small";
@@ -138,8 +138,8 @@
break;
}
-
+
if (value != NULL)
{
str = g_strdup_printf ("<span size=\"%s\">%s: %s</span>",
@@ -152,7 +152,7 @@
str = g_strdup_printf ("<span size=\"%s\">%s: %s %s</span>",
txtsize, lbl, rawvalue, get_unit (unit, opt));
}
-
+
return str;
}
@@ -160,12 +160,12 @@
get_filename (const xfceweather_data *data)
{
- gchar *filename =
- g_strdup_printf ("xfce4/weather-plugin/weather_%s_%c.xml",
+ gchar *filename =
+ g_strdup_printf ("xfce4/weather-plugin/weather_%s_%c.xml",
data->location_code, data->unit == METRIC ? 'm' : 'i');
- gchar *fullfilename =
- xfce_resource_save_location (XFCE_RESOURCE_CACHE, filename,
+ gchar *fullfilename =
+ xfce_resource_save_location (XFCE_RESOURCE_CACHE, filename,
TRUE);
g_free (filename);
@@ -185,7 +185,7 @@
data->weatherdata = NULL;
}
- gtk_tooltips_set_tip (data->tooltips, data->tooltipbox,
+ gtk_tooltips_set_tip (data->tooltips, data->tooltipbox,
_("Cannot update weather data"), NULL);
return;
@@ -203,23 +203,23 @@
gchar *str;
opt = g_array_index(data->labels, datas, i);
-
+
str = make_label (data->weatherdata, opt, data->unit,
data->size);
- gtk_scrollbox_set_label (GTK_SCROLLBOX(data->scrollbox), -1,
+ gtk_scrollbox_set_label (GTK_SCROLLBOX(data->scrollbox), -1,
str);
-
+
g_free (str);
}
gtk_scrollbox_enablecb(GTK_SCROLLBOX(data->scrollbox), TRUE);
-
+
icon = get_icon (get_data(data->weatherdata, WICON), data->iconsize);
gtk_image_set_from_pixbuf (GTK_IMAGE(data->iconimage), icon);
g_object_unref (G_OBJECT (icon));
-
- gtk_tooltips_set_tip (data->tooltips, data->tooltipbox,
+
+ gtk_tooltips_set_tip (data->tooltips, data->tooltipbox,
translate_desc(get_data(data->weatherdata, TRANS)), NULL);
}
@@ -237,7 +237,7 @@
if (!fullfilename)
return;
-
+
doc = xmlParseFile (fullfilename);
g_free (fullfilename);
@@ -245,20 +245,20 @@
return;
cur_node = xmlDocGetRootElement (doc);
-
+
if (cur_node)
weather = parse_weather (cur_node);
-
+
xmlFreeDoc (doc);
gtk_scrollbox_clear (GTK_SCROLLBOX(data->scrollbox));
if (weather)
{
-
+
if (data->weatherdata)
xml_weather_free (data->weatherdata);
-
+
data->weatherdata = weather;
set_icon_current (data);
}
@@ -275,7 +275,7 @@
gboolean force)
{
- struct stat attrs;
+ struct stat attrs;
gchar *fullfilename;
gchar *url;
@@ -288,19 +288,19 @@
{
DBG ("can't get savedir?");
return -1;
- }
+ }
- if (force || (stat (fullfilename, &attrs) == -1) ||
+ if (force || (stat (fullfilename, &attrs) == -1) ||
((time (NULL) - attrs.st_mtime) > (UPDATE_TIME)))
{
url = g_strdup_printf ("/weather/local/%s?cc=*&dayf=%d&unit=%c",
data->location_code, XML_WEATHER_DAYF_N,
data->unit == METRIC ? 'm' : 'i');
- gboolean status = http_get_file (url, "xoap.weather.com", fullfilename,
+ gboolean status = http_get_file (url, "xoap.weather.com", fullfilename,
data->proxy_host, data->proxy_port, cb_update,
(gpointer) data);
-
+
g_free (url);
g_free (fullfilename);
@@ -332,13 +332,13 @@
static GArray *
labels_clear (GArray *array)
-{
+{
if (!array || array->len > 0)
{
if (array)
g_array_free (array, TRUE);
-
+
array = g_array_new (FALSE, TRUE, sizeof (datas));
}
@@ -356,23 +356,23 @@
gchar *file;
XfceRc *rc;
gint val;
-
+
if (!(file = xfce_panel_plugin_lookup_rc_file (plugin)))
return;
-
+
rc = xfce_rc_simple_open (file, TRUE);
g_free (file);
-
+
if (!rc)
return;
-
+
value = xfce_rc_read_entry (rc, "loc_code", NULL);
- if (value)
+ if (value)
{
if (data->location_code)
g_free (data->location_code);
-
+
data->location_code = g_strdup (value);
}
@@ -403,10 +403,10 @@
data->saved_proxy_port = xfce_rc_read_int_entry (rc, "proxy_port", 0);
data->proxy_fromenv = xfce_rc_read_bool_entry (rc, "proxy_fromenv", FALSE);
-
+
if (data->proxy_fromenv)
{
- check_envproxy (&data->proxy_host, &data->proxy_port);
+ check_envproxy (&data->proxy_host, &data->proxy_port);
}
else
{
@@ -414,8 +414,8 @@
data->proxy_port = data->saved_proxy_port;
}
- data->labels = labels_clear (data->labels);
-
+ data->labels = labels_clear (data->labels);
+
for (i = 0; i < 100 /* arbitrary */; ++i)
{
g_snprintf (label, 10, "label%d", i);
@@ -432,7 +432,7 @@
}
static void
-xfceweather_write_config (XfcePanelPlugin *plugin,
+xfceweather_write_config (XfcePanelPlugin *plugin,
xfceweather_data *data)
{
@@ -440,18 +440,18 @@
guint i;
XfceRc *rc;
gchar *file;
-
+
if (!(file = xfce_panel_plugin_save_location (plugin, TRUE)))
return;
-
+
/* get rid of old values */
unlink (file);
-
+
rc = xfce_rc_simple_open (file, FALSE);
g_free (file);
-
+
if (!rc)
- return;
+ return;
xfce_rc_write_bool_entry (rc, "celcius", (data->unit == METRIC));
@@ -459,7 +459,7 @@
xfce_rc_write_entry (rc, "loc_code", data->location_code);
xfce_rc_write_bool_entry (rc, "proxy_fromenv", data->proxy_fromenv);
-
+
if (data->proxy_host)
{
xfce_rc_write_entry (rc, "proxy_host", data->proxy_host);
@@ -467,7 +467,7 @@
xfce_rc_write_int_entry (rc, "proxy_port", data->proxy_port);
}
- for (i = 0; i < data->labels->len; i++)
+ for (i = 0; i < data->labels->len; i++)
{
g_snprintf (label, 10, "label%d", i);
@@ -482,11 +482,11 @@
{
DBG ("update_cb(): callback called");
-
+
update_plugin (data, FALSE);
DBG ("update_cb(): request added, returning");
-
+
return TRUE;
}
@@ -531,10 +531,10 @@
if (event->button == 1)
{
-
+
if (data->summary_window != NULL)
{
-
+
gtk_window_present (GTK_WINDOW(data->summary_window));
}
else
@@ -543,7 +543,7 @@
data->unit);
g_signal_connect (data->summary_window, "destroy",
G_CALLBACK (close_summary), (gpointer)data);
-
+
gtk_widget_show_all (data->summary_window);
}
}
@@ -564,18 +564,18 @@
static void
xfceweather_dialog_response (GtkWidget *dlg,
- gint response,
+ gint response,
xfceweather_dialog *dialog)
{
xfceweather_data *data = (xfceweather_data *) dialog->wd;
-
+
apply_options (dialog);
-
+
gtk_widget_destroy (dlg);
gtk_list_store_clear (dialog->mdl_xmloption);
panel_slice_free (xfceweather_dialog, dialog);
-
+
xfce_panel_plugin_unblock_menu (data->plugin);
xfceweather_write_config (data->plugin, data);
}
@@ -604,7 +604,7 @@
gtk_widget_show (vbox);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), vbox,
TRUE, TRUE, 0);
-
+
dialog = create_config_dialog (data, vbox);
g_signal_connect (dlg, "response", G_CALLBACK (xfceweather_dialog_response),
@@ -614,8 +614,8 @@
gtk_widget_show (dlg);
}
-
+
static xfceweather_data *
xfceweather_create_control (XfcePanelPlugin *plugin)
{
@@ -635,35 +635,35 @@
gtk_object_sink (GTK_OBJECT (data->tooltips));
data->scrollbox = gtk_scrollbox_new ();
-
+
icon = get_icon ("25", GTK_ICON_SIZE_SMALL);
data->iconimage = gtk_image_new_from_pixbuf (icon);
gtk_misc_set_alignment (GTK_MISC(data->iconimage), 0.5, 1);
g_object_unref (G_OBJECT (icon));
data->labels = g_array_new (FALSE, TRUE, sizeof (datas));
-
+
vbox = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX(vbox), data->iconimage, TRUE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX(vbox), data->scrollbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX(vbox), data->scrollbox, TRUE, TRUE, 0);
data->tooltipbox = gtk_event_box_new ();
gtk_container_add (GTK_CONTAINER(data->tooltipbox), vbox);
gtk_widget_show_all (data->tooltipbox);
-
+
xfce_panel_plugin_add_action_widget (plugin, data->tooltipbox);
- g_signal_connect (data->tooltipbox, "button-press-event",
+ g_signal_connect (data->tooltipbox, "button-press-event",
G_CALLBACK (cb_click), (gpointer)data);
-
+
/* add refresh button to right click menu, for people who missed the middle mouse click feature */
refresh = gtk_image_menu_item_new_from_stock ("gtk-refresh", NULL);
gtk_widget_show (refresh);
-
- g_signal_connect (refresh, "activate",
+
+ g_signal_connect (refresh, "activate",
G_CALLBACK (mi_click), (gpointer) data);
-
+
xfce_panel_plugin_menu_insert_item (plugin, GTK_MENU_ITEM (refresh));
/* assign to tempval because g_array_append_val () is using & operator */
@@ -673,14 +673,14 @@
g_array_append_val (data->labels, lbl);
lbl = WIND_SPEED;
g_array_append_val (data->labels, lbl);
-
- /* FIXME Without this the first label looks odd, because
+
+ /* FIXME Without this the first label looks odd, because
* the gc isn't created yet */
gtk_scrollbox_set_label (GTK_SCROLLBOX(data->scrollbox), -1, "1");
gtk_scrollbox_clear (GTK_SCROLLBOX(data->scrollbox));
- data->updatetimeout =
- gtk_timeout_add (UPDATE_TIME * 1000, (GSourceFunc)update_cb, data);
+ data->updatetimeout =
+ gtk_timeout_add (UPDATE_TIME * 1000, (GSourceFunc)update_cb, data);
return data;
}
@@ -698,18 +698,18 @@
g_source_remove (data->updatetimeout);
data->updatetimeout = 0;
}
-
+
free_get_data_buffer ();
xmlCleanupParser ();
-
+
/* Free Tooltip */
gtk_tooltips_set_tip (data->tooltips, data->tooltipbox, NULL, NULL);
g_object_unref (G_OBJECT (data->tooltips));
-
+
/* Free chars */
g_free (data->location_code);
g_free (data->proxy_host);
-
+
/* Free Array */
g_array_free (data->labels, TRUE);
@@ -718,7 +718,7 @@
static gboolean
xfceweather_set_size (XfcePanelPlugin *panel,
- int size,
+ int size,
xfceweather_data *data)
{
@@ -735,7 +735,7 @@
data->iconsize = GTK_ICON_SIZE_DND;
gtk_scrollbox_clear (GTK_SCROLLBOX(data->scrollbox));
-
+
if (data->weatherdata)
set_icon_current (data);
else
@@ -752,27 +752,27 @@
xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
data = xfceweather_create_control (plugin);
-
+
xfceweather_read_config (plugin, data);
- xfceweather_set_size (plugin, xfce_panel_plugin_get_size (plugin),
+ xfceweather_set_size (plugin, xfce_panel_plugin_get_size (plugin),
data);
-
+
gtk_container_add (GTK_CONTAINER (plugin), data->tooltipbox);
-
- g_signal_connect (plugin, "free-data", G_CALLBACK (xfceweather_free),
+
+ g_signal_connect (plugin, "free-data", G_CALLBACK (xfceweather_free),
data);
-
- g_signal_connect (plugin, "save",
+
+ g_signal_connect (plugin, "save",
G_CALLBACK (xfceweather_write_config), data);
-
- g_signal_connect (plugin, "size-changed",
+
+ g_signal_connect (plugin, "size-changed",
G_CALLBACK (xfceweather_set_size), data);
xfce_panel_plugin_menu_show_configure (plugin);
- g_signal_connect (plugin, "configure-plugin",
+ g_signal_connect (plugin, "configure-plugin",
G_CALLBACK (xfceweather_create_options), data);
-
+
update_plugin (data, TRUE);
}
Property changes on: xfce4-weather-plugin/trunk/panel-plugin/plugin.c
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/panel-plugin/plugin.h
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/plugin.h 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/panel-plugin/plugin.h 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,6 +1,6 @@
-/* vim: set expandtab ts=8 sw=4: */
-
-/* This program is free software; you can redistribute it and/or modify
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
@@ -14,7 +14,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
+
#ifndef PLUGIN_H
#define PLUGIN_H
@@ -40,9 +40,9 @@
gint size;
gint updatetimeout;
-
+
gchar *location_code;
-
+
units unit;
xml_weather *weatherdata;
@@ -51,7 +51,7 @@
gint proxy_port;
gboolean proxy_fromenv;
- /* used for storing the configured
+ /* used for storing the configured
* but not active proxy setttings */
gchar *saved_proxy_host;
gint saved_proxy_port;
Property changes on: xfce4-weather-plugin/trunk/panel-plugin/plugin.h
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/panel-plugin/scrollbox.c
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/scrollbox.c 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/panel-plugin/scrollbox.c 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,6 +1,6 @@
-/* vim: set expandtab ts=8 sw=4: */
-
-/* This program is free software; you can redistribute it and/or modify
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
@@ -30,7 +30,7 @@
#define LABEL_SPEED 25
typedef struct _Label Label;
-
+
struct _Label {
gchar *msg;
GdkPixmap *pixmap;
@@ -61,26 +61,26 @@
g_object_unref (G_OBJECT (lbl->pixmap));
if (lbl->msg)
g_free (lbl->msg);
-
+
panel_slice_free (Label, lbl);
}
static gboolean
draw_up (GtkScrollbox *self)
{
- GdkRectangle update_rect = {0,0, GTK_WIDGET(self)->allocation.width,
+ GdkRectangle update_rect = {0,0, GTK_WIDGET(self)->allocation.width,
GTK_WIDGET(self)->allocation.height};
-
- if (self->draw_offset == 0)
+
+ if (self->draw_offset == 0)
{
self->draw_timeout = g_timeout_add(LABEL_REFRESH,
(GSourceFunc)start_draw_down, self);
-
+
return FALSE;
}
else
- self->draw_offset++;
-
+ self->draw_offset++;
+
gtk_widget_draw(GTK_WIDGET(self), &update_rect);
return TRUE;
@@ -89,10 +89,10 @@
static gboolean
draw_down (GtkScrollbox *self)
{
- GdkRectangle update_rect = {0, 0, GTK_WIDGET(self)->allocation.width,
+ GdkRectangle update_rect = {0, 0, GTK_WIDGET(self)->allocation.width,
GTK_WIDGET(self)->allocation.height};
- if (self->draw_offset == self->draw_maxoffset)
+ if (self->draw_offset == self->draw_maxoffset)
{
self->draw_timeout = 0;
start_draw_up(self);
@@ -101,14 +101,14 @@
}
else
self->draw_offset--;
-
+
gtk_widget_draw(GTK_WIDGET(self), &update_rect);
return TRUE;
}
static void
-start_draw_up (GtkScrollbox *self)
+start_draw_up (GtkScrollbox *self)
{
gint width, height;
Label *lbl;
@@ -116,7 +116,7 @@
if (self->labels->len == 0)
return;
-
+
if (i >= self->labels->len)
i = 0;
@@ -137,21 +137,21 @@
}
}
- if (self->labels->len == 1)
+ if (self->labels->len == 1)
{
GdkRectangle update_rect = {0, 0, GTK_WIDGET(self)->allocation.width,
GTK_WIDGET(self)->allocation.height};
self->pixmap = lbl->pixmap;
self->draw_offset = 0;
-
+
gtk_widget_draw(GTK_WIDGET(self), &update_rect);
return;
}
-
+
gdk_drawable_get_size(GDK_DRAWABLE(self->pixmap), &width, &height);
self->draw_middle = self->draw_maxmiddle - width / 2;
-
+
self->draw_timeout = g_timeout_add(LABEL_SPEED, (GSourceFunc)draw_up, self);
i++;
@@ -193,10 +193,10 @@
PangoLayout *pl;
gint width, height, middle;
GdkPixmap *pixmap;
- GtkRequisition widgsize = {0, };
+ GtkRequisition widgsize = {0, };
GtkWidget *widget = (GtkWidget *)self;
-
+
/* If we can't draw yet, don't do anything to avoid screwing things */
if (!GDK_IS_GC(widget->style->bg_gc[0]))
return NULL;
@@ -210,7 +210,7 @@
pixmap = gdk_pixmap_new(GDK_DRAWABLE(rootwin), width, height, -1);
- gdk_draw_rectangle(GDK_DRAWABLE(pixmap),
+ gdk_draw_rectangle(GDK_DRAWABLE(pixmap),
widget->style->bg_gc[0],
TRUE, 0, 0, width, height);
@@ -248,15 +248,15 @@
gboolean append = TRUE;
GdkPixmap *newpixmap;
Label *newlbl;
-
+
if (n != -1)
append = FALSE;
-
+
if (!append)
{
Label *lbl = (Label *)g_ptr_array_index(self->labels, n);
- if (lbl)
+ if (lbl)
free_label(lbl);
newlbl = lbl;
@@ -286,18 +286,18 @@
case GTK_SCROLLBOX_ENABLECB:
{
gboolean realvalue = g_value_get_boolean(value);
-
+
if (!realvalue && self->draw_timeout)
stop_callback(self);
- else if (realvalue && !self->draw_timeout)
+ else if (realvalue && !self->draw_timeout)
start_callback(self);
-
+
break;
}
default:
/* We don't have any other property... */
g_assert (FALSE);
-
+
break;
}
}
@@ -321,19 +321,19 @@
g_source_remove(self->draw_timeout);
self->draw_timeout = 0;
}
-
+
if (self->labels->len > 0)
{
for (i = 0; i < self->labels->len; i++)
{
- Label *lbl = (Label*)g_ptr_array_index(self->labels, i);
+ Label *lbl = (Label*)g_ptr_array_index(self->labels, i);
g_object_unref (G_OBJECT (lbl->pixmap));
g_free(lbl->msg);
}
g_ptr_array_free(self->labels, TRUE);
}
-
+
G_OBJECT_CLASS (parent_class)->finalize (gobject);
}
@@ -343,9 +343,9 @@
{
GtkScrollbox *self = GTK_SCROLLBOX(widget);
guint i;
-
+
if (self->labels->len < 1)
- return;
+ return;
stop_callback(self);
@@ -372,8 +372,8 @@
start_callback(self);
}
-
+
static void
gtk_scrollbox_instance_init (GTypeInstance *instance,
gpointer g_class)
@@ -391,7 +391,7 @@
static gboolean
gtk_scrollbox_expose (GtkWidget *widget,
- GdkEventExpose *event)
+ GdkEventExpose *event)
{
GtkScrollbox *self = (GtkScrollbox *)widget;
@@ -419,26 +419,26 @@
}
GtkWidget *
-gtk_scrollbox_new (void)
+gtk_scrollbox_new (void)
{
return GTK_WIDGET(g_object_new (GTK_TYPE_SCROLLBOX, NULL));
}
-
+
static void
gtk_scrollbox_class_init (gpointer g_class,
gpointer g_class_data)
{
-
+
GObjectClass *gobject_class = G_OBJECT_CLASS(g_class);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(g_class);
-
+
parent_class = g_type_class_peek_parent (g_class);
-
+
GParamSpec *scrollbox_param_spec;
gobject_class->set_property = gtk_scrollbox_set_property;
gobject_class->get_property = gtk_scrollbox_get_property;
-
+
scrollbox_param_spec = g_param_spec_boolean("enablecb",
"Enable callback",
"Enable or disable the callback",
@@ -459,7 +459,7 @@
static GType type = 0;
if (type == 0) {
-
+
static const GTypeInfo info = {
sizeof (GtkScrollboxClass),
NULL, /* base_init */
@@ -486,13 +486,13 @@
stop_callback(self);
while(self->labels->len > 0)
- {
+ {
Label *lbl = (Label *) g_ptr_array_index(self->labels, 0);
free_label(lbl);
g_ptr_array_remove_index (self->labels, 0);
}
-
+
self->pixmap = NULL;
gtk_widget_set_size_request(GTK_WIDGET(self), 0, 0);
self->draw_middle = 0;
Property changes on: xfce4-weather-plugin/trunk/panel-plugin/scrollbox.c
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/panel-plugin/scrollbox.h
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/scrollbox.h 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/panel-plugin/scrollbox.h 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,6 +1,6 @@
-/* vim: set expandtab ts=8 sw=4: */
-
-/* This program is free software; you can redistribute it and/or modify
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
@@ -36,7 +36,7 @@
GtkDrawingArea parent;
GPtrArray *labels;
-
+
gint draw_offset;
gint draw_maxoffset;
gint draw_middle;
Property changes on: xfce4-weather-plugin/trunk/panel-plugin/scrollbox.h
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/panel-plugin/search_dialog.c
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/search_dialog.c 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/panel-plugin/search_dialog.c 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,6 +1,6 @@
-/* vim: set expandtab ts=8 sw=4: */
-
-/* This program is free software; you can redistribute it and/or modify
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
@@ -48,7 +48,7 @@
gchar *realstr, c = '\0';
while((c = *str++))
- {
+ {
if (g_ascii_isspace(c))
g_string_append(retstr, "%20");
else if (g_ascii_isalnum(c) == FALSE)
@@ -64,8 +64,8 @@
g_string_free(retstr, FALSE);
-
+
return realstr;
}
@@ -76,23 +76,23 @@
search_dialog *dialog = (search_dialog *) user_data;
xmlDoc *doc;
xmlNode *cur_node;
-
+
if (!result || dialog->recv_buffer == NULL)
- return;
+ return;
doc = xmlParseMemory(dialog->recv_buffer, strlen(dialog->recv_buffer));
g_free(dialog->recv_buffer);
dialog->recv_buffer = NULL;
- if (!doc)
+ if (!doc)
return;
cur_node = xmlDocGetRootElement(doc);
if (cur_node)
{
- for (cur_node = cur_node->children;
- cur_node;
+ for (cur_node = cur_node->children;
+ cur_node;
cur_node = cur_node->next)
{
if (NODE_IS_TYPE(cur_node, "loc"))
@@ -106,7 +106,7 @@
city = DATA(cur_node);
if (!city)
- {
+ {
g_free(id);
continue;
}
@@ -144,9 +144,9 @@
url = g_strdup_printf("/search/search?where=%s", sane_str);
g_free(sane_str);
-
+
result = http_get_buffer(url, "xoap.weather.com", dialog->proxy_host, dialog->proxy_port,
- &dialog->recv_buffer, cb_searchdone, (gpointer)dialog);
+ &dialog->recv_buffer, cb_searchdone, (gpointer)dialog);
g_free(url);
return result;
@@ -167,7 +167,7 @@
dialog->proxy_host = proxy_host;
dialog->proxy_port = proxy_port;
-
+
if (!dialog)
return NULL;
@@ -177,38 +177,38 @@
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
NULL);
-
+
vbox = gtk_vbox_new(FALSE, BORDER);
gtk_window_set_icon_name (GTK_WINDOW (dialog->dialog), GTK_STOCK_FIND);
label = gtk_label_new(_("Enter a city name or zip code:"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
-
+
dialog->search_entry = gtk_entry_new();
button = gtk_button_new_from_stock(GTK_STOCK_FIND);
hbox = gtk_hbox_new(FALSE, BORDER);
gtk_box_pack_start(GTK_BOX(hbox), dialog->search_entry, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-
+
/* list */
dialog->result_mdl = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING);
dialog->result_list = gtk_tree_view_new_with_model(GTK_TREE_MODEL(dialog->result_mdl));
- column = gtk_tree_view_column_new_with_attributes(_("Results"), renderer,
+ column = gtk_tree_view_column_new_with_attributes(_("Results"), renderer,
"text", 0, NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(dialog->result_list), column);
scroll = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll),
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_container_add(GTK_CONTAINER(scroll), dialog->result_list);
frame = gtk_frame_new(NULL);
gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
gtk_container_add(GTK_CONTAINER(frame), scroll);
-
+
gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog->dialog)->vbox), vbox, TRUE, TRUE, 0);
@@ -220,7 +220,7 @@
return dialog;
}
-
+
gboolean
run_search_dialog (search_dialog *dialog)
{
@@ -228,13 +228,13 @@
if (gtk_dialog_run(GTK_DIALOG(dialog->dialog)) == GTK_RESPONSE_ACCEPT)
{
GtkTreeIter iter;
- GtkTreeSelection *selection =
+ GtkTreeSelection *selection =
gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->result_list));
-
+
if (gtk_tree_selection_get_selected(selection, NULL, &iter))
{
GValue value = {0, };
-
+
gtk_tree_model_get_value(GTK_TREE_MODEL(dialog->result_mdl),
&iter, 1, &value);
dialog->result = g_strdup(g_value_get_string(&value));
@@ -252,6 +252,6 @@
{
g_free(dialog->result);
gtk_widget_destroy(dialog->dialog);
-
+
panel_slice_free (search_dialog, dialog);
}
Property changes on: xfce4-weather-plugin/trunk/panel-plugin/search_dialog.c
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/panel-plugin/search_dialog.h
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/search_dialog.h 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/panel-plugin/search_dialog.h 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,6 +1,6 @@
-/* vim: set expandtab ts=8 sw=4: */
-
-/* This program is free software; you can redistribute it and/or modify
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
@@ -14,7 +14,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
+
#include <glib.h>
#include <gmodule.h>
#include <gtk/gtk.h>
Property changes on: xfce4-weather-plugin/trunk/panel-plugin/search_dialog.h
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/panel-plugin/summary_window.c
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/summary_window.c 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/panel-plugin/summary_window.c 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,16 +1,16 @@
-/* vim: set expandtab ts=8 sw=4: */
-
-/* This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public as published by
- * the Free Software Foundation; either version 2 of the , or
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public for more details.
+ * GNU Library General Public License for more details.
*
- * You should have received a copy of the GNU General Public
+ * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
@@ -47,7 +47,7 @@
units unit)
{
GtkTextBuffer *buffer;
- GtkTextIter iter;
+ GtkTextIter iter;
GtkTextTag *btag;
gchar *value, *date, *wind, *sun_val, *vis;
GtkWidget *view, *frame, *scrolled;
@@ -58,7 +58,7 @@
scrolled = gtk_scrolled_window_new(NULL, NULL);
gtk_container_add(GTK_CONTAINER(scrolled), view);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled),
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_container_set_border_width(GTK_CONTAINER(frame), BORDER);
@@ -71,7 +71,7 @@
0);
btag = gtk_text_buffer_create_tag(buffer, NULL, "weight", PANGO_WEIGHT_BOLD, NULL);
-
+
value = g_strdup_printf(_("Weather report for: %s.\n\n"), get_data(data, DNAM));
APPEND_BTEXT (value);
g_free(value);
@@ -83,17 +83,17 @@
if (date)
g_free(date);
-
+
g_free(value);
APPEND_BTEXT (_("\nTemperature\n"));
APPEND_TEXT_ITEM (_("Temperature"), TEMP);
APPEND_TEXT_ITEM (_("Windchill"), FLIK);
-
+
/* special case for TRANS because of translate_desc */
value = g_strdup_printf("\t%s: %s\n",
_("Description"), translate_desc(get_data(data, TRANS)));
- APPEND_TEXT_ITEM_REAL(value);
+ APPEND_TEXT_ITEM_REAL(value);
g_free(value);
APPEND_TEXT_ITEM (_("Dew point"), DEWP);
@@ -112,7 +112,7 @@
g_free(wind);
APPEND_TEXT_ITEM_REAL(value);
g_free(value);
-
+
wind = translate_wind_speed(get_data(data, WIND_GUST), unit);
value = g_strdup_printf("\t%s: %s\n", _("Gusts"), wind);
APPEND_TEXT_ITEM_REAL(value);
@@ -123,7 +123,7 @@
APPEND_TEXT_ITEM (_("Index"), UV_INDEX);
value = g_strdup_printf("\t%s: %s\n",
_("Risk"), translate_risk(get_data(data, UV_TRANS)));
- APPEND_TEXT_ITEM_REAL(value);
+ APPEND_TEXT_ITEM_REAL(value);
g_free(value);
APPEND_BTEXT (_("\nAtmospheric pressure\n"));
@@ -132,7 +132,7 @@
value = g_strdup_printf("\t%s: %s\n",
_("State"), translate_bard(get_data(data, BAR_D)));
APPEND_TEXT_ITEM_REAL(value);
- g_free(value);
+ g_free(value);
APPEND_BTEXT (_("\nSun\n"));
@@ -159,7 +159,7 @@
APPEND_TEXT_ITEM_REAL(value);
g_free(vis);
g_free(value);
-
+
return frame;
}
@@ -176,12 +176,12 @@
item_vbox = gtk_vbox_new(FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(item_vbox), 6);
-
+
label = gtk_label_new(NULL);
gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5);
-
+
day = translate_day(get_data_f(weatherdata, WDAY));
-
+
str = g_strdup_printf("<b>%s</b>", day ? day : get_data_f(weatherdata, WDAY));
if (day)
g_free(day);
@@ -190,13 +190,13 @@
gtk_box_pack_start(GTK_BOX(item_vbox), label, FALSE, FALSE, 0);
icon_hbox = gtk_hbox_new(FALSE, 0);
-
+
icon = get_icon(get_data_f(weatherdata, ICON_D), GTK_ICON_SIZE_DIALOG);
icon_d = gtk_image_new_from_pixbuf(icon);
g_object_unref (G_OBJECT (icon));
box_d = gtk_event_box_new();
gtk_container_add(GTK_CONTAINER(box_d), icon_d);
-
+
icon = get_icon(get_data_f(weatherdata, ICON_N), GTK_ICON_SIZE_DIALOG);
icon_n = gtk_image_new_from_pixbuf(icon);
g_object_unref (G_OBJECT (icon));
@@ -205,7 +205,7 @@
if (G_UNLIKELY (!tooltips))
tooltips = gtk_tooltips_new ();
-
+
str = g_strdup_printf(_("Day: %s"), translate_desc(get_data_f(weatherdata, TRANS_D)));
gtk_tooltips_set_tip(tooltips, box_d, str, NULL);
g_free(str);
@@ -221,7 +221,7 @@
gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5);
gtk_label_set_markup(GTK_LABEL(label), _("<b>Precipitation</b>"));
gtk_box_pack_start(GTK_BOX(item_vbox), label, FALSE, FALSE, 0);
-
+
temp_hbox = gtk_hbox_new(FALSE, 0);
label = gtk_label_new(NULL);
gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5);
@@ -238,7 +238,7 @@
gtk_box_pack_start(GTK_BOX(item_vbox), temp_hbox, FALSE, FALSE, 0);
- label = gtk_label_new(NULL);
+ label = gtk_label_new(NULL);
gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5);
gtk_label_set_markup(GTK_LABEL(label), _("<b>Temperature</b>"));
gtk_box_pack_start(GTK_BOX(item_vbox), label, FALSE, FALSE, 0);
@@ -247,21 +247,21 @@
temp_hbox = gtk_hbox_new(FALSE, 0);
label = gtk_label_new(NULL);
gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5);
- str = g_strdup_printf("<span foreground=\"red\">%s</span> %s",
+ str = g_strdup_printf("<span foreground=\"red\">%s</span> %s",
get_data_f(weatherdata, TEMP_MAX), get_unit(unit, TEMP));
gtk_label_set_markup(GTK_LABEL(label), str);
g_free(str);
gtk_box_pack_start(GTK_BOX(temp_hbox), label, TRUE, TRUE, 0);
label = gtk_label_new(NULL);
gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5);
- str = g_strdup_printf("<span foreground=\"blue\">%s</span> %s",
+ str = g_strdup_printf("<span foreground=\"blue\">%s</span> %s",
get_data_f(weatherdata, TEMP_MIN), get_unit(unit, TEMP));
gtk_label_set_markup(GTK_LABEL(label), str);
g_free(str);
gtk_box_pack_start(GTK_BOX(temp_hbox), label, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(item_vbox), temp_hbox, FALSE, FALSE, 0);
-
+
label = gtk_label_new(NULL);
gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5);
gtk_label_set_markup(GTK_LABEL(label), _("<b>Wind</b>"));
@@ -270,17 +270,17 @@
temp_hbox = gtk_hbox_new(FALSE, 0);
label = gtk_label_new(NULL);
gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5);
-
+
wind = translate_wind_direction(get_data_f(weatherdata, W_DIRECTION_D));
gtk_label_set_markup(GTK_LABEL(label), wind ? wind : get_data_f(weatherdata, W_DIRECTION_D));
if (wind)
g_free(wind);
-
+
gtk_box_pack_start(GTK_BOX(temp_hbox), label, TRUE, TRUE, 0);
- label = gtk_label_new(NULL);
+ label = gtk_label_new(NULL);
gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5);
-
+
wind = translate_wind_direction(get_data_f(weatherdata, W_DIRECTION_N));
gtk_label_set_markup(GTK_LABEL(label), wind ? wind : get_data_f(weatherdata, W_DIRECTION_N));
if (wind)
@@ -289,7 +289,7 @@
gtk_box_pack_start(GTK_BOX(item_vbox), temp_hbox, FALSE, FALSE, 0);
/* speed */
-
+
temp_hbox = gtk_hbox_new(FALSE, 2);
label = gtk_label_new(NULL);
gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5);
@@ -309,7 +309,7 @@
gtk_box_pack_start(GTK_BOX(item_vbox), temp_hbox, FALSE, FALSE, 0);
DBG ("Done");
-
+
return item_vbox;
}
@@ -331,17 +331,17 @@
DBG ("%s", data->dayf[i]->day);
- gtk_box_pack_start(GTK_BOX(widg),
+ gtk_box_pack_start(GTK_BOX(widg),
make_forecast(data->dayf[i], unit), FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(widg),
gtk_vseparator_new(), TRUE, TRUE, 0);
}
if (data->dayf[i])
- gtk_box_pack_start(GTK_BOX(widg),
+ gtk_box_pack_start(GTK_BOX(widg),
make_forecast(data->dayf[i], unit), FALSE, FALSE, 0);
}
-
+
return widg;
}
@@ -358,7 +358,7 @@
GTK_DIALOG_NO_SEPARATOR,
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
NULL);
-
+
title = g_strdup_printf(_("Weather report for: %s"), get_data(data, DNAM));
xfce_titled_dialog_set_subtitle (XFCE_TITLED_DIALOG (window),
@@ -366,21 +366,21 @@
g_free (title);
vbox = gtk_vbox_new(FALSE, 0);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox), vbox, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox), vbox, TRUE, TRUE, 0);
icon = get_icon (get_data(data, WICON), GTK_ICON_SIZE_DIALOG);
-
+
if (!icon)
icon = get_icon ("25", GTK_ICON_SIZE_DIALOG);
-
+
gtk_window_set_icon (GTK_WINDOW (window), icon);
g_object_unref (G_OBJECT (icon));
notebook = gtk_notebook_new();
gtk_container_set_border_width(GTK_CONTAINER(notebook), BORDER);
- gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
+ gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
create_summary_tab(data, unit), gtk_label_new(_("Summary")));
- gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
+ gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
create_forecast_tab(data, unit), gtk_label_new(_("Forecast")));
gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);
Property changes on: xfce4-weather-plugin/trunk/panel-plugin/summary_window.c
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/panel-plugin/summary_window.h
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/summary_window.h 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/panel-plugin/summary_window.h 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,6 +1,6 @@
-/* vim: set expandtab ts=8 sw=4: */
-
-/* This program is free software; you can redistribute it and/or modify
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
Property changes on: xfce4-weather-plugin/trunk/panel-plugin/summary_window.h
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/panel-plugin/translate.c
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/translate.c 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/panel-plugin/translate.c 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,16 +1,16 @@
-/* vim: set expandtab ts=8 sw=4: */
-
-/* This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public as published by
- * the Free Software Foundation; either version 2 of the , or
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public for more details.
+ * GNU Library General Public License for more details.
*
- * You should have received a copy of the GNU General Public
+ * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
@@ -126,43 +126,43 @@
};
static const gchar *bard_strings[] = {
- N_("rising"),
- N_("steady"),
- N_("falling"),
+ N_("rising"),
+ N_("steady"),
+ N_("falling"),
NULL
};
static const gchar *risk_strings[] = {
- N_("Low"),
- N_("Moderate"),
- N_("High"),
- N_("Very High"),
- N_("Extreme"),
+ N_("Low"),
+ N_("Moderate"),
+ N_("High"),
+ N_("Very High"),
+ N_("Extreme"),
NULL
};
static const gchar *wdirs[] = {
- N_("S"),
- N_("SSW"),
- N_("SW"),
- N_("WSW"),
- N_("W"),
- N_("WNW"),
- N_("NW"),
- N_("NNW"),
+ N_("S"),
+ N_("SSW"),
+ N_("SW"),
+ N_("WSW"),
+ N_("W"),
+ N_("WNW"),
+ N_("NW"),
+ N_("NNW"),
N_("N"),
N_("NNE"),
N_("NE"),
N_("ENE"),
- N_("E"),
- N_("ESE"),
- N_("SE"),
- N_("SSE"),
+ N_("E"),
+ N_("ESE"),
+ N_("SE"),
+ N_("SSE"),
NULL
};
static const gchar *
-translate_str(const gchar **loc_strings,
+translate_str(const gchar **loc_strings,
const gchar *str)
{
gint loc_string_len, str_len;
@@ -182,11 +182,11 @@
if (str_len != loc_string_len)
continue;
-
+
if (str[0] != loc_strings[i][0])
continue;
- if (!g_ascii_strncasecmp(loc_strings[i], str, str_len))
+ if (!g_ascii_strncasecmp(loc_strings[i], str, str_len))
return _(loc_strings[i]);
}
@@ -213,8 +213,8 @@
/* used by translate_lsup and translate_time */
static void
-_fill_time(struct tm *time,
- const gchar *hour,
+_fill_time(struct tm *time,
+ const gchar *hour,
const gchar *minute,
const gchar *am)
{
@@ -222,7 +222,7 @@
if (am[0] == 'P' && time->tm_hour != 12) /* PM or AM */
time->tm_hour += 12;
-
+
time->tm_min = atoi(minute);
time->tm_sec = 0;
time->tm_isdst = -1;
@@ -237,20 +237,20 @@
gchar *hdate;
struct tm time;
gint size = 0, i = 0;
-
-
- gchar **lsup_split;
-
+
+
+ gchar **lsup_split;
+
if (lsup == NULL || strlen(lsup) == 0)
return NULL;
-
+
/* 10/17/04 5:55 PM Local Time */
if ((lsup_split = g_strsplit_set(lsup, " /:", 8)) == NULL)
return NULL;
- while(lsup_split[i++])
+ while(lsup_split[i++])
size++;
-
+
if (size != 8)
{
g_strfreev(lsup_split);
@@ -264,13 +264,13 @@
_fill_time(&time, lsup_split[3], lsup_split[4], lsup_split[5]);
g_strfreev(lsup_split);
-
+
if (mktime(&time) != -1)
{
hdate = g_malloc(HDATE_N);
strftime(hdate, HDATE_N, _("%x at %X Local Time"), &time);
-
+
return hdate;
}
else
@@ -287,10 +287,10 @@
"su", "mo", "tu", "we", "th", "fr", "sa", NULL
};
gchar *day_loc;
-
+
if (day == NULL || strlen(day) < 2)
return NULL;
-
+
for (i = 0; days[i] != NULL; i++)
if (!g_ascii_strncasecmp(day, days[i], 2))
wday = i;
@@ -300,7 +300,7 @@
else
{
struct tm time;
-
+
time.tm_wday = wday;
day_loc = g_malloc(DAY_LOC_N);
@@ -324,7 +324,7 @@
if (strchr(wdir, '/')) /* N/A */
return NULL;
-
+
/*
* If the direction code can be translated, then translated the
* whole code so that it can be correctly translated in CJK (and
@@ -349,9 +349,9 @@
g_free(wdir_loc);
wdir_loc = tmp;
}
-
+
}
-
+
return wdir_loc;
}
@@ -368,7 +368,7 @@
wspeed_loc = g_strdup(_("N/A"));
else
wspeed_loc = g_strdup_printf("%s %s", wspeed, get_unit(unit, WIND_SPEED));
-
+
return wspeed_loc;
}
@@ -413,6 +413,6 @@
vis_loc = g_strdup(_("Unlimited"));
else
vis_loc = g_strdup_printf("%s %s", vis, get_unit(unit, VIS));
-
+
return vis_loc;
}
Property changes on: xfce4-weather-plugin/trunk/panel-plugin/translate.c
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: xfce4-weather-plugin/trunk/panel-plugin/translate.h
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/translate.h 2006-09-06 08:21:54 UTC (rev 1972)
+++ xfce4-weather-plugin/trunk/panel-plugin/translate.h 2006-09-06 08:58:22 UTC (rev 1973)
@@ -1,6 +1,6 @@
-/* vim: set expandtab ts=8 sw=4: */
-
-/* This program is free software; you can redistribute it and/or modify
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
Property changes on: xfce4-weather-plugin/trunk/panel-plugin/translate.h
___________________________________________________________________
Name: svn:keywords
+ Id
More information about the Goodies-commits
mailing list