Bug Summary

File:cafeweather/cafeweather-dialog.c
Warning:line 66, column 2
Value stored to 'settings' is never read

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name cafeweather-dialog.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/cafeweather -resource-dir /usr/lib/llvm-16/lib/clang/16 -D HAVE_CONFIG_H -I . -I .. -I . -I .. -D CAFEWEATHER_MENU_UI_DIR="/usr/share/cafe/ui" -I /usr/include/cafe-panel-4.0/libcafe-panel-applet -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/ctk-3.0 -I /usr/include/pango-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/fribidi -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/x86_64-linux-gnu -I /usr/include/webp -I /usr/include/gio-unix-2.0 -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/dbus-1.0 -I /usr/lib/x86_64-linux-gnu/dbus-1.0/include -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/libpng16 -I /usr/include/x86_64-linux-gnu -I /usr/include/webp -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/libpng16 -I /usr/include/x86_64-linux-gnu -I /usr/include/webp -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/ctk-3.0 -I /usr/include/pango-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/fribidi -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gio-unix-2.0 -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/at-spi-2.0 -I /usr/include/dbus-1.0 -I /usr/lib/x86_64-linux-gnu/dbus-1.0/include -I /usr/include/libxml2 -I /usr/include/libsoup-3.0 -I /usr/include/sysprof-6 -I /usr/include/dbus-1.0 -I /usr/lib/x86_64-linux-gnu/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -internal-isystem /usr/lib/llvm-16/lib/clang/16/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/13/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir=/rootdir/cafeweather -ferror-limit 19 -fgnuc-version=4.2.1 -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2024-04-16-115944-85828-1 -x c cafeweather-dialog.c
1/* $Id$ */
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 * Main status dialog
10 *
11 */
12
13#ifdef HAVE_CONFIG_H1
14# include <config.h>
15#endif
16
17#include <stdio.h>
18#include <stdlib.h>
19#include <assert.h>
20
21#include <gio/gio.h>
22
23#define CAFEWEATHER_I_KNOW_THIS_IS_UNSTABLE
24
25#include "cafeweather.h"
26#include "cafeweather-applet.h"
27#include "cafeweather-pref.h"
28#include "cafeweather-dialog.h"
29
30struct _CafeWeatherDialogPrivate {
31 CtkWidget* cond_location;
32 CtkWidget* cond_update;
33 CtkWidget* cond_cond;
34 CtkWidget* cond_sky;
35 CtkWidget* cond_temp;
36 CtkWidget* cond_dew;
37 CtkWidget* cond_humidity;
38 CtkWidget* cond_wind;
39 CtkWidget* cond_pressure;
40 CtkWidget* cond_vis;
41 CtkWidget* cond_apparent;
42 CtkWidget* cond_sunrise;
43 CtkWidget* cond_sunset;
44 CtkWidget* cond_image;
45 CtkWidget* forecast_text;
46 CtkWidget* radar_image;
47
48 CafeWeatherApplet* applet;
49};
50
51enum {
52 PROP_0,
53 PROP_CAFEWEATHER_APPLET,
54};
55
56G_DEFINE_TYPE_WITH_PRIVATE (CafeWeatherDialog, cafeweather_dialog, CTK_TYPE_DIALOG)static void cafeweather_dialog_init (CafeWeatherDialog *self)
; static void cafeweather_dialog_class_init (CafeWeatherDialogClass
*klass); static GType cafeweather_dialog_get_type_once (void
); static gpointer cafeweather_dialog_parent_class = ((void*)
0); static gint CafeWeatherDialog_private_offset; static void
cafeweather_dialog_class_intern_init (gpointer klass) { cafeweather_dialog_parent_class
= g_type_class_peek_parent (klass); if (CafeWeatherDialog_private_offset
!= 0) g_type_class_adjust_private_offset (klass, &CafeWeatherDialog_private_offset
); cafeweather_dialog_class_init ((CafeWeatherDialogClass*) klass
); } __attribute__ ((__unused__)) static inline gpointer cafeweather_dialog_get_instance_private
(CafeWeatherDialog *self) { return (((gpointer) ((guint8*) (
self) + (glong) (CafeWeatherDialog_private_offset)))); } GType
cafeweather_dialog_get_type (void) { static gsize static_g_define_type_id
= 0; if ((__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id
) == sizeof (gpointer), "Expression evaluates to false"); (void
) (0 ? (gpointer) *(&static_g_define_type_id) : ((void*)0
)); (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id
) == sizeof (gpointer), "Expression evaluates to false"); __typeof__
(*(&static_g_define_type_id)) gapg_temp_newval; __typeof__
((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id
); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5)
; gapg_temp_newval; })) && g_once_init_enter (&static_g_define_type_id
)); }))) { GType g_define_type_id = cafeweather_dialog_get_type_once
(); (__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id
) == sizeof (gpointer), "Expression evaluates to false"); 0 ?
(void) (*(&static_g_define_type_id) = (g_define_type_id)
) : (void) 0; g_once_init_leave ((&static_g_define_type_id
), (gsize) (g_define_type_id)); })); } return static_g_define_type_id
; } __attribute__ ((__noinline__)) static GType cafeweather_dialog_get_type_once
(void) { GType g_define_type_id = g_type_register_static_simple
((ctk_dialog_get_type ()), g_intern_static_string ("CafeWeatherDialog"
), sizeof (CafeWeatherDialogClass), (GClassInitFunc)(void (*)
(void)) cafeweather_dialog_class_intern_init, sizeof (CafeWeatherDialog
), (GInstanceInitFunc)(void (*)(void)) cafeweather_dialog_init
, (GTypeFlags) 0); { {{ CafeWeatherDialog_private_offset = g_type_add_instance_private
(g_define_type_id, sizeof (CafeWeatherDialogPrivate)); };} }
return g_define_type_id; }
;
57
58#define MONOSPACE_FONT_SCHEMA"org.cafe.interface" "org.cafe.interface"
59#define MONOSPACE_FONT_KEY"monospace-font-name" "monospace-font-name"
60
61static void cafeweather_dialog_save_geometry(CafeWeatherDialog* dialog)
62{
63 GSettings* settings;
64 int w, h;
65
66 settings = dialog->priv->applet->settings;
Value stored to 'settings' is never read
67
68 ctk_window_get_size(CTK_WINDOW(dialog)((((CtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((dialog)), ((ctk_window_get_type ()))))))
, &w, &h);
69
70#if 0
71 /* FIXME those keys are not in org.cafe.weather! */
72 g_settings_set_int (settings, "dialog-width", w);
73 g_settings_set_int (settings, "dialog-height", h);
74#endif
75}
76
77static void cafeweather_dialog_load_geometry(CafeWeatherDialog* dialog)
78{
79 GSettings* settings;
80 int w, h;
81
82 settings = dialog->priv->applet->settings;
83
84#if 0
85 /* FIXME those keys are not in org.cafe.weather! */
86 w = g_settings_get_int (settings, "dialog-width");
87 h = g_settings_get_int (settings, "dialog-height");
88
89 if (w > 0 && h > 0)
90 {
91 ctk_window_resize(CTK_WINDOW(dialog)((((CtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((dialog)), ((ctk_window_get_type ()))))))
, w, h);
92 }
93#endif
94}
95
96static void response_cb(CafeWeatherDialog* dialog, gint id, gpointer data)
97{
98 if (id == CTK_RESPONSE_OK) {
99 cafeweather_update (dialog->priv->applet);
100
101 cafeweather_dialog_update (dialog);
102 } else {
103 ctk_widget_destroy (CTK_WIDGET(dialog)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((dialog)), ((ctk_widget_get_type ()))))))
);
104 }
105}
106
107static void link_cb(CtkButton* button, gpointer data)
108{
109 ctk_show_uri_on_window (NULL((void*)0),
110 "http://www.weather.com/",
111 ctk_get_current_event_time (),
112 NULL((void*)0));
113}
114
115static gchar* replace_multiple_new_lines(gchar* s)
116{
117 gchar *prev_s = s;
118 gint count = 0;
119 gint i;
120
121 if (s == NULL((void*)0)) {
122 return s;
123 }
124
125 for (;*s != '\0';s++) {
126
127 count = 0;
128
129 if (*s == '\n') {
130 s++;
131 while (*s == '\n' || *s == ' ') {
132 count++;
133 s++;
134 }
135 }
136 for (i = count; i > 1; i--) {
137 *(s - i) = ' ';
138 }
139 }
140 return prev_s;
141}
142
143static void cafeweather_dialog_create(CafeWeatherDialog* dialog)
144{
145 CafeWeatherDialogPrivate *priv;
146 CafeWeatherApplet *gw_applet;
147
148 CtkWidget *weather_vbox;
149 CtkWidget *weather_notebook;
150 CtkWidget *cond_hbox;
151 CtkWidget *cond_grid;
152 CtkWidget *cond_location_lbl;
153 CtkWidget *cond_update_lbl;
154 CtkWidget *cond_temp_lbl;
155 CtkWidget *cond_cond_lbl;
156 CtkWidget *cond_sky_lbl;
157 CtkWidget *cond_wind_lbl;
158 CtkWidget *cond_humidity_lbl;
159 CtkWidget *cond_pressure_lbl;
160 CtkWidget *cond_vis_lbl;
161 CtkWidget *cond_dew_lbl;
162 CtkWidget *cond_apparent_lbl;
163 CtkWidget *cond_sunrise_lbl;
164 CtkWidget *cond_sunset_lbl;
165 CtkWidget *cond_vbox;
166 CtkWidget *current_note_lbl;
167 CtkWidget *forecast_note_lbl;
168 CtkWidget *radar_note_lbl;
169 CtkWidget *radar_vbox;
170 CtkWidget *radar_link_btn;
171 CtkWidget *radar_link_box;
172 CtkWidget *forecast_hbox;
173 CtkWidget *ebox;
174 CtkWidget *scrolled_window;
175 CtkWidget *imagescroll_window;
176
177 priv = dialog->priv;
178 gw_applet = priv->applet;
179
180 g_object_set (dialog, "destroy-with-parent", TRUE(!(0)), NULL((void*)0));
181 ctk_window_set_title (CTK_WINDOW (dialog)((((CtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((dialog)), ((ctk_window_get_type ()))))))
, _("Details")gettext ("Details"));
182 ctk_dialog_add_buttons (CTK_DIALOG (dialog)((((CtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((dialog)), ((ctk_dialog_get_type ()))))))
,
183 _("_Update")gettext ("_Update"), CTK_RESPONSE_OK,
184 "ctk-close", CTK_RESPONSE_CLOSE,
185 NULL((void*)0));
186 ctk_dialog_set_default_response (CTK_DIALOG (dialog)((((CtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((dialog)), ((ctk_dialog_get_type ()))))))
, CTK_RESPONSE_CLOSE);
187 ctk_container_set_border_width (CTK_CONTAINER (dialog)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((dialog)), ((ctk_container_get_type ()))))))
, 5);
188 ctk_box_set_spacing (CTK_BOX (ctk_dialog_get_content_area (CTK_DIALOG (dialog)))((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ctk_dialog_get_content_area (((((CtkDialog*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((dialog)), ((ctk_dialog_get_type ()))))))
))), ((ctk_box_get_type ()))))))
, 2);
189 ctk_container_set_border_width (CTK_CONTAINER (dialog)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((dialog)), ((ctk_container_get_type ()))))))
, 5);
190
191 if (gw_applet->cafeweather_pref.radar_enabled)
192 ctk_window_set_default_size (CTK_WINDOW (dialog)((((CtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((dialog)), ((ctk_window_get_type ()))))))
, 570,440);
193 else
194 ctk_window_set_default_size (CTK_WINDOW (dialog)((((CtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((dialog)), ((ctk_window_get_type ()))))))
, 590, 340);
195
196 ctk_window_set_screen (CTK_WINDOW (dialog)((((CtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((dialog)), ((ctk_window_get_type ()))))))
,
197 ctk_widget_get_screen (CTK_WIDGET (gw_applet->applet)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((gw_applet->applet)), ((ctk_widget_get_type ()))))))
));
198 cafeweather_dialog_load_geometry (dialog);
199
200 /* Must come after load geometry, otherwise it will get reset. */
201 ctk_window_set_resizable (CTK_WINDOW (dialog)((((CtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((dialog)), ((ctk_window_get_type ()))))))
, TRUE(!(0)));
202
203 weather_vbox = ctk_dialog_get_content_area (CTK_DIALOG (dialog)((((CtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((dialog)), ((ctk_dialog_get_type ()))))))
);
204 ctk_widget_show (weather_vbox);
205
206 weather_notebook = ctk_notebook_new ();
207 ctk_container_set_border_width (CTK_CONTAINER (weather_notebook)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((weather_notebook)), ((ctk_container_get_type ()))))))
, 5);
208 ctk_widget_show (weather_notebook);
209 ctk_box_pack_start (CTK_BOX (weather_vbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((weather_vbox)), ((ctk_box_get_type ()))))))
, weather_notebook, TRUE(!(0)), TRUE(!(0)), 0);
210
211 cond_hbox = ctk_box_new (CTK_ORIENTATION_HORIZONTAL, 2);
212 ctk_widget_show (cond_hbox);
213 ctk_container_add (CTK_CONTAINER (weather_notebook)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((weather_notebook)), ((ctk_container_get_type ()))))))
, cond_hbox);
214 ctk_container_set_border_width (CTK_CONTAINER (cond_hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_hbox)), ((ctk_container_get_type ()))))))
, 4);
215
216 cond_grid = ctk_grid_new ();
217 ctk_widget_show (cond_grid);
218 ctk_box_pack_start (CTK_BOX (cond_hbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_hbox)), ((ctk_box_get_type ()))))))
, cond_grid, TRUE(!(0)), TRUE(!(0)), 0);
219 ctk_container_set_border_width (CTK_CONTAINER (cond_grid)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_container_get_type ()))))))
, 12);
220 ctk_grid_set_row_spacing (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, 6);
221 ctk_grid_set_column_spacing (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, 12);
222
223 cond_location_lbl = ctk_label_new (_("City:")gettext ("City:"));
224 ctk_widget_show (cond_location_lbl);
225 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, cond_location_lbl, 0, 0, 1, 1);
226 ctk_label_set_justify (CTK_LABEL (cond_location_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_location_lbl)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
227 ctk_label_set_xalign (CTK_LABEL (cond_location_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_location_lbl)), ((ctk_label_get_type ()))))))
, 0.0);
228
229 cond_update_lbl = ctk_label_new (_("Last update:")gettext ("Last update:"));
230 ctk_widget_show (cond_update_lbl);
231 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, cond_update_lbl, 0, 1, 1, 1);
232 ctk_label_set_justify (CTK_LABEL (cond_update_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_update_lbl)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
233 ctk_label_set_xalign (CTK_LABEL (cond_update_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_update_lbl)), ((ctk_label_get_type ()))))))
, 0.0);
234
235 cond_cond_lbl = ctk_label_new (_("Conditions:")gettext ("Conditions:"));
236 ctk_widget_show (cond_cond_lbl);
237 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, cond_cond_lbl, 0, 2, 1, 1);
238 ctk_label_set_justify (CTK_LABEL (cond_cond_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_cond_lbl)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
239 ctk_label_set_xalign (CTK_LABEL (cond_cond_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_cond_lbl)), ((ctk_label_get_type ()))))))
, 0.0);
240
241 cond_sky_lbl = ctk_label_new (_("Sky:")gettext ("Sky:"));
242 ctk_widget_show (cond_sky_lbl);
243 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, cond_sky_lbl, 0, 3, 1, 1);
244 ctk_label_set_justify (CTK_LABEL (cond_sky_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_sky_lbl)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
245 ctk_label_set_xalign (CTK_LABEL (cond_sky_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_sky_lbl)), ((ctk_label_get_type ()))))))
, 0.0);
246
247 cond_temp_lbl = ctk_label_new (_("Temperature:")gettext ("Temperature:"));
248 ctk_widget_show (cond_temp_lbl);
249 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, cond_temp_lbl, 0, 4, 1, 1);
250 ctk_label_set_justify (CTK_LABEL (cond_temp_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_temp_lbl)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
251 ctk_label_set_xalign (CTK_LABEL (cond_temp_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_temp_lbl)), ((ctk_label_get_type ()))))))
, 0.0);
252
253 cond_apparent_lbl = ctk_label_new (_("Feels like:")gettext ("Feels like:"));
254 ctk_widget_show (cond_apparent_lbl);
255 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, cond_apparent_lbl, 0, 5, 1, 1);
256 ctk_label_set_justify (CTK_LABEL (cond_apparent_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_apparent_lbl)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
257 ctk_label_set_xalign (CTK_LABEL (cond_apparent_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_apparent_lbl)), ((ctk_label_get_type ()))))))
, 0.0);
258
259 cond_dew_lbl = ctk_label_new (_("Dew point:")gettext ("Dew point:"));
260 ctk_widget_show (cond_dew_lbl);
261 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, cond_dew_lbl, 0, 6, 1, 1);
262 ctk_label_set_justify (CTK_LABEL (cond_dew_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_dew_lbl)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
263 ctk_label_set_xalign (CTK_LABEL (cond_dew_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_dew_lbl)), ((ctk_label_get_type ()))))))
, 0.0);
264
265 cond_humidity_lbl = ctk_label_new (_("Relative humidity:")gettext ("Relative humidity:"));
266 ctk_widget_show (cond_humidity_lbl);
267 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, cond_humidity_lbl, 0, 7, 1, 1);
268 ctk_label_set_justify (CTK_LABEL (cond_humidity_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_humidity_lbl)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
269 ctk_label_set_xalign (CTK_LABEL (cond_humidity_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_humidity_lbl)), ((ctk_label_get_type ()))))))
, 0.0);
270
271 cond_wind_lbl = ctk_label_new (_("Wind:")gettext ("Wind:"));
272 ctk_widget_show (cond_wind_lbl);
273 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, cond_wind_lbl, 0, 8, 1, 1);
274 ctk_label_set_justify (CTK_LABEL (cond_wind_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_wind_lbl)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
275 ctk_label_set_xalign (CTK_LABEL (cond_wind_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_wind_lbl)), ((ctk_label_get_type ()))))))
, 0.0);
276
277 cond_pressure_lbl = ctk_label_new (_("Pressure:")gettext ("Pressure:"));
278 ctk_widget_show (cond_pressure_lbl);
279 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, cond_pressure_lbl, 0, 9, 1, 1);
280 ctk_label_set_justify (CTK_LABEL (cond_pressure_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_pressure_lbl)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
281 ctk_label_set_xalign (CTK_LABEL (cond_pressure_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_pressure_lbl)), ((ctk_label_get_type ()))))))
, 0.0);
282
283 cond_vis_lbl = ctk_label_new (_("Visibility:")gettext ("Visibility:"));
284 ctk_widget_show (cond_vis_lbl);
285 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, cond_vis_lbl, 0, 10, 1, 1);
286 ctk_label_set_justify (CTK_LABEL (cond_vis_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_vis_lbl)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
287 ctk_label_set_xalign (CTK_LABEL (cond_vis_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_vis_lbl)), ((ctk_label_get_type ()))))))
, 0.0);
288
289 cond_sunrise_lbl = ctk_label_new (_("Sunrise:")gettext ("Sunrise:"));
290 ctk_widget_show (cond_sunrise_lbl);
291 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, cond_sunrise_lbl, 0, 11, 1, 1);
292 ctk_label_set_justify (CTK_LABEL (cond_sunrise_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_sunrise_lbl)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
293 ctk_label_set_xalign (CTK_LABEL (cond_sunrise_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_sunrise_lbl)), ((ctk_label_get_type ()))))))
, 0.0);
294
295 cond_sunset_lbl = ctk_label_new (_("Sunset:")gettext ("Sunset:"));
296 ctk_widget_show (cond_sunset_lbl);
297 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, cond_sunset_lbl, 0, 12, 1, 1);
298 ctk_label_set_justify (CTK_LABEL (cond_sunset_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_sunset_lbl)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
299 ctk_label_set_xalign (CTK_LABEL (cond_sunset_lbl)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_sunset_lbl)), ((ctk_label_get_type ()))))))
, 0.0);
300
301 priv->cond_location = ctk_label_new ("");
302 ctk_widget_show (priv->cond_location);
303 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, priv->cond_location, 1, 0, 1, 1);
304 ctk_label_set_selectable (CTK_LABEL (priv->cond_location)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_location)), ((ctk_label_get_type ()))))))
, TRUE(!(0)));
305 ctk_label_set_justify (CTK_LABEL (priv->cond_location)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_location)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
306 ctk_label_set_xalign (CTK_LABEL (priv->cond_location)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_location)), ((ctk_label_get_type ()))))))
, 0.0);
307
308 priv->cond_update = ctk_label_new ("");
309 ctk_widget_show (priv->cond_update);
310 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, priv->cond_update, 1, 1, 1, 1);
311 ctk_label_set_selectable (CTK_LABEL (priv->cond_update)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_update)), ((ctk_label_get_type ()))))))
, TRUE(!(0)));
312 ctk_label_set_justify (CTK_LABEL (priv->cond_update)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_update)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
313 ctk_label_set_xalign (CTK_LABEL (priv->cond_update)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_update)), ((ctk_label_get_type ()))))))
, 0.0);
314
315 priv->cond_cond = ctk_label_new ("");
316 ctk_widget_show (priv->cond_cond);
317 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, priv->cond_cond, 1, 2, 1, 1);
318 ctk_label_set_selectable (CTK_LABEL (priv->cond_cond)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_cond)), ((ctk_label_get_type ()))))))
, TRUE(!(0)));
319 ctk_label_set_justify (CTK_LABEL (priv->cond_cond)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_cond)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
320 ctk_label_set_xalign (CTK_LABEL (priv->cond_cond)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_cond)), ((ctk_label_get_type ()))))))
, 0.0);
321
322 priv->cond_sky = ctk_label_new ("");
323 ctk_widget_show (priv->cond_sky);
324 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, priv->cond_sky, 1, 3, 1, 1);
325 ctk_label_set_selectable (CTK_LABEL (priv->cond_sky)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_sky)), ((ctk_label_get_type ()))))))
, TRUE(!(0)));
326 ctk_label_set_justify (CTK_LABEL (priv->cond_sky)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_sky)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
327 ctk_label_set_xalign (CTK_LABEL (priv->cond_sky)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_sky)), ((ctk_label_get_type ()))))))
, 0.0);
328
329 priv->cond_temp = ctk_label_new ("");
330 ctk_widget_show (priv->cond_temp);
331 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, priv->cond_temp, 1, 4, 1, 1);
332 ctk_label_set_selectable (CTK_LABEL (priv->cond_temp)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_temp)), ((ctk_label_get_type ()))))))
, TRUE(!(0)));
333 ctk_label_set_justify (CTK_LABEL (priv->cond_temp)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_temp)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
334 ctk_label_set_xalign (CTK_LABEL (priv->cond_temp)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_temp)), ((ctk_label_get_type ()))))))
, 0.0);
335
336 priv->cond_apparent = ctk_label_new ("");
337 ctk_widget_show (priv->cond_apparent);
338 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, priv->cond_apparent, 1, 5, 1, 1);
339 ctk_label_set_selectable (CTK_LABEL (priv->cond_apparent)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_apparent)), ((ctk_label_get_type ()))))))
, TRUE(!(0)));
340 ctk_label_set_justify (CTK_LABEL (priv->cond_apparent)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_apparent)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
341 ctk_label_set_xalign (CTK_LABEL (priv->cond_apparent)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_apparent)), ((ctk_label_get_type ()))))))
, 0.0);
342
343 priv->cond_dew = ctk_label_new ("");
344 ctk_widget_show (priv->cond_dew);
345 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, priv->cond_dew, 1, 6, 1, 1);
346 ctk_label_set_selectable (CTK_LABEL (priv->cond_dew)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_dew)), ((ctk_label_get_type ()))))))
, TRUE(!(0)));
347 ctk_label_set_justify (CTK_LABEL (priv->cond_dew)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_dew)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
348 ctk_label_set_xalign (CTK_LABEL (priv->cond_dew)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_dew)), ((ctk_label_get_type ()))))))
, 0.0);
349
350 priv->cond_humidity = ctk_label_new ("");
351 ctk_widget_show (priv->cond_humidity);
352 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, priv->cond_humidity, 1, 7, 1, 1);
353 ctk_label_set_selectable (CTK_LABEL (priv->cond_humidity)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_humidity)), ((ctk_label_get_type ()))))))
, TRUE(!(0)));
354 ctk_label_set_justify (CTK_LABEL (priv->cond_humidity)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_humidity)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
355 ctk_label_set_xalign (CTK_LABEL (priv->cond_humidity)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_humidity)), ((ctk_label_get_type ()))))))
, 0.0);
356
357 priv->cond_wind = ctk_label_new ("");
358 ctk_widget_show (priv->cond_wind);
359 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, priv->cond_wind, 1, 8, 1, 1);
360 ctk_label_set_selectable (CTK_LABEL (priv->cond_wind)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_wind)), ((ctk_label_get_type ()))))))
, TRUE(!(0)));
361 ctk_label_set_justify (CTK_LABEL (priv->cond_wind)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_wind)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
362 ctk_label_set_xalign (CTK_LABEL (priv->cond_wind)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_wind)), ((ctk_label_get_type ()))))))
, 0.0);
363
364 priv->cond_pressure = ctk_label_new ("");
365 ctk_widget_show (priv->cond_pressure);
366 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, priv->cond_pressure, 1, 9, 1, 1);
367 ctk_label_set_selectable (CTK_LABEL (priv->cond_pressure)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_pressure)), ((ctk_label_get_type ()))))))
, TRUE(!(0)));
368 ctk_label_set_justify (CTK_LABEL (priv->cond_pressure)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_pressure)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
369 ctk_label_set_xalign (CTK_LABEL (priv->cond_pressure)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_pressure)), ((ctk_label_get_type ()))))))
, 0.0);
370
371 priv->cond_vis = ctk_label_new ("");
372 ctk_widget_show (priv->cond_vis);
373 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, priv->cond_vis, 1, 10, 1, 1);
374 ctk_label_set_selectable (CTK_LABEL (priv->cond_vis)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_vis)), ((ctk_label_get_type ()))))))
, TRUE(!(0)));
375 ctk_label_set_justify (CTK_LABEL (priv->cond_vis)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_vis)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
376 ctk_label_set_xalign (CTK_LABEL (priv->cond_vis)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_vis)), ((ctk_label_get_type ()))))))
, 0.0);
377
378 priv->cond_sunrise = ctk_label_new ("");
379 ctk_widget_show (priv->cond_sunrise);
380 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, priv->cond_sunrise, 1, 11, 1, 1);
381 ctk_label_set_selectable (CTK_LABEL (priv->cond_sunrise)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_sunrise)), ((ctk_label_get_type ()))))))
, TRUE(!(0)));
382 ctk_label_set_justify (CTK_LABEL (priv->cond_sunrise)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_sunrise)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
383 ctk_label_set_xalign (CTK_LABEL (priv->cond_sunrise)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_sunrise)), ((ctk_label_get_type ()))))))
, 0.0);
384
385 priv->cond_sunset = ctk_label_new ("");
386 ctk_widget_show (priv->cond_sunset);
387 ctk_grid_attach (CTK_GRID (cond_grid)((((CtkGrid*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_grid)), ((ctk_grid_get_type ()))))))
, priv->cond_sunset, 1, 12, 1, 1);
388 ctk_label_set_selectable (CTK_LABEL (priv->cond_sunset)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_sunset)), ((ctk_label_get_type ()))))))
, TRUE(!(0)));
389 ctk_label_set_justify (CTK_LABEL (priv->cond_sunset)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_sunset)), ((ctk_label_get_type ()))))))
, CTK_JUSTIFY_LEFT);
390 ctk_label_set_xalign (CTK_LABEL (priv->cond_sunset)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_sunset)), ((ctk_label_get_type ()))))))
, 0.0);
391
392 cond_vbox = ctk_box_new (CTK_ORIENTATION_VERTICAL, 2);
393 ctk_widget_set_valign (cond_vbox, CTK_ALIGN_START);
394 ctk_widget_set_vexpand (cond_vbox, TRUE(!(0)));
395 ctk_widget_show (cond_vbox);
396 ctk_box_pack_end (CTK_BOX (cond_hbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_hbox)), ((ctk_box_get_type ()))))))
, cond_vbox, FALSE(0), FALSE(0), 0);
397 ctk_container_set_border_width (CTK_CONTAINER (cond_vbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_vbox)), ((ctk_container_get_type ()))))))
, 2);
398
399 priv->cond_image = ctk_image_new_from_icon_name ("stock-unknown", CTK_ICON_SIZE_BUTTON);
400 ctk_widget_show (priv->cond_image);
401 ctk_container_add (CTK_CONTAINER (cond_vbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((cond_vbox)), ((ctk_container_get_type ()))))))
, priv->cond_image);
402
403 current_note_lbl = ctk_label_new (_("Current Conditions")gettext ("Current Conditions"));
404 ctk_widget_show (current_note_lbl);
405 ctk_notebook_set_tab_label (CTK_NOTEBOOK (weather_notebook)((((CtkNotebook*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((weather_notebook)), ((ctk_notebook_get_type ()))))))
, ctk_notebook_get_nth_page (CTK_NOTEBOOK (weather_notebook)((((CtkNotebook*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((weather_notebook)), ((ctk_notebook_get_type ()))))))
, 0), current_note_lbl);
406
407 if (gw_applet->cafeweather_pref.location->zone_valid) {
408
409 forecast_hbox = ctk_box_new (CTK_ORIENTATION_HORIZONTAL, 0);
410 ctk_container_set_border_width (CTK_CONTAINER (forecast_hbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((forecast_hbox)), ((ctk_container_get_type ()))))))
, 12);
411 ctk_widget_show (forecast_hbox);
412
413 scrolled_window = ctk_scrolled_window_new (NULL((void*)0), NULL((void*)0));
414 ctk_scrolled_window_set_policy (CTK_SCROLLED_WINDOW (scrolled_window)((((CtkScrolledWindow*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((scrolled_window)), ((ctk_scrolled_window_get_type
()))))))
,
415 CTK_POLICY_AUTOMATIC, CTK_POLICY_AUTOMATIC);
416 ctk_scrolled_window_set_shadow_type (CTK_SCROLLED_WINDOW (scrolled_window)((((CtkScrolledWindow*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((scrolled_window)), ((ctk_scrolled_window_get_type
()))))))
,
417 CTK_SHADOW_ETCHED_IN);
418
419 priv->forecast_text = ctk_text_view_new ();
420 set_access_namedesc (priv->forecast_text, _("Forecast Report")gettext ("Forecast Report"), _("See the ForeCast Details")gettext ("See the ForeCast Details"));
421 ctk_container_add (CTK_CONTAINER (scrolled_window)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((scrolled_window)), ((ctk_container_get_type ()))))))
, priv->forecast_text);
422 ctk_text_view_set_editable (CTK_TEXT_VIEW (priv->forecast_text)((((CtkTextView*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->forecast_text)), ((ctk_text_view_get_type ())))
)))
, FALSE(0));
423 ctk_text_view_set_left_margin (CTK_TEXT_VIEW (priv->forecast_text)((((CtkTextView*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->forecast_text)), ((ctk_text_view_get_type ())))
)))
, 6);
424 ctk_widget_show (priv->forecast_text);
425 ctk_widget_show (scrolled_window);
426 ctk_box_pack_start (CTK_BOX (forecast_hbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((forecast_hbox)), ((ctk_box_get_type ()))))))
, scrolled_window, TRUE(!(0)), TRUE(!(0)), 0);
427
428 ctk_container_add (CTK_CONTAINER (weather_notebook)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((weather_notebook)), ((ctk_container_get_type ()))))))
, forecast_hbox);
429
430 forecast_note_lbl = ctk_label_new (_("Forecast")gettext ("Forecast"));
431 ctk_widget_show (forecast_note_lbl);
432 ctk_notebook_set_tab_label (CTK_NOTEBOOK (weather_notebook)((((CtkNotebook*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((weather_notebook)), ((ctk_notebook_get_type ()))))))
, ctk_notebook_get_nth_page (CTK_NOTEBOOK (weather_notebook)((((CtkNotebook*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((weather_notebook)), ((ctk_notebook_get_type ()))))))
, 1), forecast_note_lbl);
433
434 }
435
436 if (gw_applet->cafeweather_pref.radar_enabled) {
437
438 radar_note_lbl = ctk_label_new_with_mnemonic (_("Radar Map")gettext ("Radar Map"));
439 ctk_widget_show (radar_note_lbl);
440
441 radar_vbox = ctk_box_new (CTK_ORIENTATION_VERTICAL, 6);
442 ctk_widget_show (radar_vbox);
443 ctk_notebook_append_page (CTK_NOTEBOOK (weather_notebook)((((CtkNotebook*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((weather_notebook)), ((ctk_notebook_get_type ()))))))
, radar_vbox, radar_note_lbl);
444 ctk_container_set_border_width (CTK_CONTAINER (radar_vbox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((radar_vbox)), ((ctk_container_get_type ()))))))
, 6);
445
446 priv->radar_image = ctk_image_new ();
447
448 imagescroll_window = ctk_scrolled_window_new (NULL((void*)0), NULL((void*)0));
449 ctk_scrolled_window_set_policy (CTK_SCROLLED_WINDOW (imagescroll_window)((((CtkScrolledWindow*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((imagescroll_window)), ((ctk_scrolled_window_get_type
()))))))
,
450 CTK_POLICY_AUTOMATIC,
451 CTK_POLICY_AUTOMATIC);
452 ctk_scrolled_window_set_shadow_type (CTK_SCROLLED_WINDOW (imagescroll_window)((((CtkScrolledWindow*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((imagescroll_window)), ((ctk_scrolled_window_get_type
()))))))
,
453 CTK_SHADOW_ETCHED_IN);
454
455 ebox = ctk_event_box_new ();
456 ctk_widget_show (ebox);
457
458 ctk_container_add (CTK_CONTAINER (imagescroll_window)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((imagescroll_window)), ((ctk_container_get_type ()))))))
,ebox);
459 ctk_box_pack_start (CTK_BOX (radar_vbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((radar_vbox)), ((ctk_box_get_type ()))))))
, imagescroll_window, TRUE(!(0)), TRUE(!(0)), 0);
460 ctk_widget_show (priv->radar_image);
461 ctk_widget_show (imagescroll_window);
462
463 ctk_container_add (CTK_CONTAINER (ebox)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ebox)), ((ctk_container_get_type ()))))))
, priv->radar_image);
464
465 radar_link_box = ctk_box_new (CTK_ORIENTATION_VERTICAL, 0);
466 ctk_widget_set_halign (radar_link_box, CTK_ALIGN_CENTER);
467 ctk_widget_set_hexpand (radar_link_box, TRUE(!(0)));
468 ctk_widget_show (radar_link_box);
469 ctk_box_pack_start (CTK_BOX (radar_vbox)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((radar_vbox)), ((ctk_box_get_type ()))))))
, radar_link_box, FALSE(0), FALSE(0), 0);
470
471 radar_link_btn = ctk_button_new_with_mnemonic (_("_Visit Weather.com")gettext ("_Visit Weather.com"));
472 set_access_namedesc (radar_link_btn, _("Visit Weather.com")gettext ("Visit Weather.com"), _("Click to Enter Weather.com")gettext ("Click to Enter Weather.com"));
473 ctk_widget_set_size_request (radar_link_btn, 450, -2);
474 ctk_widget_show (radar_link_btn);
475 if (!g_settings_get_boolean (gw_applet->settings, "use-custom-radar-url"))
476 ctk_container_add (CTK_CONTAINER (radar_link_box)((((CtkContainer*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((radar_link_box)), ((ctk_container_get_type ()))))))
, radar_link_btn);
477
478 g_signal_connect (G_OBJECT (radar_link_btn), "clicked",g_signal_connect_data ((((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((radar_link_btn)), (((GType) ((20) <<
(2))))))))), ("clicked"), (((GCallback) (link_cb))), (((void
*)0)), ((void*)0), (GConnectFlags) 0)
479 G_CALLBACK (link_cb), NULL)g_signal_connect_data ((((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((radar_link_btn)), (((GType) ((20) <<
(2))))))))), ("clicked"), (((GCallback) (link_cb))), (((void
*)0)), ((void*)0), (GConnectFlags) 0)
;
480
481 }
482
483 g_signal_connect (G_OBJECT (dialog), "response", G_CALLBACK (response_cb), NULL)g_signal_connect_data ((((((GObject*) (void *) g_type_check_instance_cast
((GTypeInstance*) ((dialog)), (((GType) ((20) << (2)))
)))))), ("response"), (((GCallback) (response_cb))), (((void*
)0)), ((void*)0), (GConnectFlags) 0)
;
484
485}
486
487static PangoFontDescription* get_system_monospace_font(void)
488{
489 PangoFontDescription *desc = NULL((void*)0);
490 GSettings *settings;
491 char *name;
492
493 settings = g_settings_new (MONOSPACE_FONT_SCHEMA"org.cafe.interface");
494 name = g_settings_get_string (settings, MONOSPACE_FONT_KEY"monospace-font-name");
495
496 if (name) {
497 desc = pango_font_description_from_string (name);
498 g_free (name);
499 }
500
501 g_object_unref (settings);
502
503 return desc;
504}
505
506static void
507override_widget_font (CtkWidget *widget,
508 PangoFontDescription *font)
509{
510 static gboolean provider_added = FALSE(0);
511 static CtkCssProvider *provider;
512 gchar *css;
513 gchar *family;
514 gchar *weight;
515 const gchar *style;
516 gchar *size;
517
518 family = g_strdup_printf ("font-family: %s;", pango_font_description_get_family (font));
519
520 weight = g_strdup_printf ("font-weight: %d;", pango_font_description_get_weight (font));
521
522 if (pango_font_description_get_style (font) == PANGO_STYLE_NORMAL)
523 style = "font-style: normal;";
524 else if (pango_font_description_get_style (font) == PANGO_STYLE_ITALIC)
525 style = "font-style: italic;";
526 else
527 style = "font-style: oblique;";
528
529 size = g_strdup_printf ("font-size: %d%s;",
530 pango_font_description_get_size (font) / PANGO_SCALE1024,
531 pango_font_description_get_size_is_absolute (font) ? "px" : "pt");
532 if (!provider_added)
533 provider = ctk_css_provider_new ();
534
535 ctk_widget_set_name(CTK_WIDGET(widget)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((widget)), ((ctk_widget_get_type ()))))))
, "CafeWeatherAppletTextView");
536 css = g_strdup_printf ("#CafeWeatherAppletTextView { %s %s %s %s }", family, weight, style, size);
537 ctk_css_provider_load_from_data (provider, css, -1, NULL((void*)0));
538
539 if (!provider_added) {
540 ctk_style_context_add_provider_for_screen (ctk_widget_get_screen (widget),
541 CTK_STYLE_PROVIDER (provider)((((CtkStyleProvider*) (void *) g_type_check_instance_cast ((
GTypeInstance*) ((provider)), ((ctk_style_provider_get_type (
)))))))
,
542 CTK_STYLE_PROVIDER_PRIORITY_APPLICATION600);
543 provider_added = TRUE(!(0));
544 }
545
546 g_free (css);
547 g_free (family);
548 g_free (weight);
549 g_free (size);
550}
551
552void cafeweather_dialog_update(CafeWeatherDialog* dialog)
553{
554 CafeWeatherDialogPrivate *priv;
555 CafeWeatherApplet *gw_applet;
556 gchar *forecast;
557 CtkTextBuffer *buffer;
558 PangoFontDescription *font_desc;
559 const gchar *icon_name;
560
561 priv = dialog->priv;
562 gw_applet = priv->applet;
563
564 /* Check for parallel network update in progress */
565 if(gw_applet->cafeweather_info == NULL((void*)0))
566 return;
567
568 /* Update icon */
569 icon_name = weather_info_get_icon_name (gw_applet->cafeweather_info);
570 ctk_image_set_from_icon_name (CTK_IMAGE (priv->cond_image)((((CtkImage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_image)), ((ctk_image_get_type ()))))))
,
571 icon_name, CTK_ICON_SIZE_DIALOG);
572
573 /* Update current condition fields and forecast */
574 ctk_label_set_text(CTK_LABEL(priv->cond_location)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_location)), ((ctk_label_get_type ()))))))
, weather_info_get_location_name(gw_applet->cafeweather_info));
575 ctk_label_set_text(CTK_LABEL(priv->cond_update)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_update)), ((ctk_label_get_type ()))))))
, weather_info_get_update(gw_applet->cafeweather_info));
576 ctk_label_set_text(CTK_LABEL(priv->cond_cond)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_cond)), ((ctk_label_get_type ()))))))
, weather_info_get_conditions(gw_applet->cafeweather_info));
577 ctk_label_set_text(CTK_LABEL(priv->cond_sky)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_sky)), ((ctk_label_get_type ()))))))
, weather_info_get_sky(gw_applet->cafeweather_info));
578 ctk_label_set_text(CTK_LABEL(priv->cond_temp)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_temp)), ((ctk_label_get_type ()))))))
, weather_info_get_temp(gw_applet->cafeweather_info));
579 ctk_label_set_text(CTK_LABEL(priv->cond_apparent)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_apparent)), ((ctk_label_get_type ()))))))
, weather_info_get_apparent(gw_applet->cafeweather_info));
580 ctk_label_set_text(CTK_LABEL(priv->cond_dew)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_dew)), ((ctk_label_get_type ()))))))
, weather_info_get_dew(gw_applet->cafeweather_info));
581 ctk_label_set_text(CTK_LABEL(priv->cond_humidity)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_humidity)), ((ctk_label_get_type ()))))))
, weather_info_get_humidity(gw_applet->cafeweather_info));
582 ctk_label_set_text(CTK_LABEL(priv->cond_wind)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_wind)), ((ctk_label_get_type ()))))))
, weather_info_get_wind(gw_applet->cafeweather_info));
583 ctk_label_set_text(CTK_LABEL(priv->cond_pressure)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_pressure)), ((ctk_label_get_type ()))))))
, weather_info_get_pressure(gw_applet->cafeweather_info));
584 ctk_label_set_text(CTK_LABEL(priv->cond_vis)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_vis)), ((ctk_label_get_type ()))))))
, weather_info_get_visibility(gw_applet->cafeweather_info));
585 ctk_label_set_text(CTK_LABEL(priv->cond_sunrise)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_sunrise)), ((ctk_label_get_type ()))))))
, weather_info_get_sunrise(gw_applet->cafeweather_info));
586 ctk_label_set_text(CTK_LABEL(priv->cond_sunset)((((CtkLabel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->cond_sunset)), ((ctk_label_get_type ()))))))
, weather_info_get_sunset(gw_applet->cafeweather_info));
587
588 /* Update forecast */
589 if (gw_applet->cafeweather_pref.location->zone_valid) {
590 font_desc = get_system_monospace_font ();
591 if (font_desc) {
592 override_widget_font (priv->forecast_text, font_desc);
593 pango_font_description_free (font_desc);
594 }
595
596 buffer = ctk_text_view_get_buffer (CTK_TEXT_VIEW (priv->forecast_text)((((CtkTextView*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->forecast_text)), ((ctk_text_view_get_type ())))
)))
);
597 forecast = g_strdup(weather_info_get_forecast(gw_applet->cafeweather_info))g_strdup_inline (weather_info_get_forecast(gw_applet->cafeweather_info
))
;
598 if (forecast) {
599 forecast = g_strstrip(replace_multiple_new_lines(forecast))g_strchomp (g_strchug (replace_multiple_new_lines(forecast)));
600 ctk_text_buffer_set_text(buffer, forecast, -1);
601 g_free(forecast);
602 } else {
603 ctk_text_buffer_set_text(buffer, _("Forecast not currently available for this location.")gettext ("Forecast not currently available for this location."
)
, -1);
604 }
605 }
606
607 /* Update radar map */
608 if (gw_applet->cafeweather_pref.radar_enabled) {
609 GdkPixbufAnimation *radar;
610
611 radar = weather_info_get_radar (gw_applet->cafeweather_info);
612 if (radar) {
613 ctk_image_set_from_animation (CTK_IMAGE (priv->radar_image)((((CtkImage*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((priv->radar_image)), ((ctk_image_get_type ()))))))
, radar);
614 }
615 }
616}
617
618static void cafeweather_dialog_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
619{
620 CafeWeatherDialog *dialog = CAFEWEATHER_DIALOG (object)((((CafeWeatherDialog*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((object)), ((cafeweather_dialog_get_type ()
))))))
;
621
622 switch (prop_id) {
623 case PROP_CAFEWEATHER_APPLET:
624 dialog->priv->applet = g_value_get_pointer (value);
625 break;
626 }
627}
628
629static void cafeweather_dialog_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec)
630{
631 CafeWeatherDialog *dialog = CAFEWEATHER_DIALOG (object)((((CafeWeatherDialog*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((object)), ((cafeweather_dialog_get_type ()
))))))
;
632
633 switch (prop_id) {
634 case PROP_CAFEWEATHER_APPLET:
635 g_value_set_pointer (value, dialog->priv->applet);
636 break;
637 }
638}
639
640static void cafeweather_dialog_init(CafeWeatherDialog* self)
641{
642 self->priv = cafeweather_dialog_get_instance_private (self);
643}
644
645static GObject* cafeweather_dialog_constructor(GType type, guint n_construct_params, GObjectConstructParam* construct_params)
646{
647 GObject *object;
648 CafeWeatherDialog *self;
649
650 object = G_OBJECT_CLASS (cafeweather_dialog_parent_class)((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass
*) ((cafeweather_dialog_parent_class)), (((GType) ((20) <<
(2))))))))
->
651 constructor (type, n_construct_params, construct_params);
652 self = CAFEWEATHER_DIALOG (object)((((CafeWeatherDialog*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((object)), ((cafeweather_dialog_get_type ()
))))))
;
653
654 cafeweather_dialog_create (self);
655 cafeweather_dialog_update (self);
656
657 return object;
658}
659
660CtkWidget* cafeweather_dialog_new(CafeWeatherApplet* applet)
661{
662 return g_object_new(CAFEWEATHER_TYPE_DIALOG(cafeweather_dialog_get_type ()),
663 "cafeweather-applet", applet,
664 NULL((void*)0));
665}
666
667static void cafeweather_dialog_unrealize(CtkWidget* widget)
668{
669 CafeWeatherDialog* self = CAFEWEATHER_DIALOG(widget)((((CafeWeatherDialog*) (void *) g_type_check_instance_cast (
(GTypeInstance*) ((widget)), ((cafeweather_dialog_get_type ()
))))))
;
670
671 cafeweather_dialog_save_geometry(self);
672
673 CTK_WIDGET_CLASS(cafeweather_dialog_parent_class)((((CtkWidgetClass*) (void *) g_type_check_class_cast ((GTypeClass
*) ((cafeweather_dialog_parent_class)), ((ctk_widget_get_type
()))))))
->unrealize(widget);
674}
675
676static void cafeweather_dialog_class_init(CafeWeatherDialogClass* klass)
677{
678 GObjectClass *object_class = G_OBJECT_CLASS (klass)((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass
*) ((klass)), (((GType) ((20) << (2))))))))
;
679 CtkWidgetClass *widget_class = CTK_WIDGET_CLASS (klass)((((CtkWidgetClass*) (void *) g_type_check_class_cast ((GTypeClass
*) ((klass)), ((ctk_widget_get_type ()))))))
;
680
681 cafeweather_dialog_parent_class = g_type_class_peek_parent (klass);
682
683 object_class->set_property = cafeweather_dialog_set_property;
684 object_class->get_property = cafeweather_dialog_get_property;
685 object_class->constructor = cafeweather_dialog_constructor;
686 widget_class->unrealize = cafeweather_dialog_unrealize;
687
688 /* This becomes an OBJECT property when CafeWeatherApplet is redone */
689 g_object_class_install_property(object_class, PROP_CAFEWEATHER_APPLET, g_param_spec_pointer ("cafeweather-applet", "CafeWeather Applet", "The CafeWeather Applet", G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
690}