Bug Summary

File:sensors-applet/sensor-config-dialog.c
Warning:line 79, column 5
Value stored to 'config_dialog' 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 sensor-config-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/sensors-applet -resource-dir /usr/lib/llvm-16/lib/clang/16 -D HAVE_CONFIG_H -I . -D CAFELOCALEDIR="/usr/local/share/locale/" -D G_LOG_DOMAIN="sensors-applet" -D PIXMAPS_DIR="/usr/local/share/pixmaps/cafe-sensors-applet/" -D DATADIR="/usr/local/share" -D LIBDIR="/usr/local/lib" -D UIDIR="/usr/local/share/cafe-sensors-applet/ui" -D SENSORS_APPLET_PLUGIN_DIR="/usr/local/lib/cafe-sensors-applet/plugins" -D SYSCONFDIR="/usr/local/etc" -D PREFIX="/usr/local" -I .. -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/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/libmount -I /usr/include/blkid -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/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/cairo -I /usr/include/libpng16 -I /usr/include/freetype2 -I /usr/include/pixman-1 -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 -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/sensors-applet -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-01-11-173236-82404-1 -x c sensor-config-dialog.c
1/*
2 * Copyright (C) 2005-2009 Alex Murray <murray.alex@gmail.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#ifdef HAVE_CONFIG_H1
20#include "config.h"
21#endif /* HAVE_CONFIG_H */
22
23#include <glib/gi18n.h>
24#include "sensor-config-dialog.h"
25#include "sensors-applet.h"
26
27#define SPINBUTTON_WIDTH_CHARS8 8
28#define VALUE_DECIMAL_PLACES3 3
29
30typedef struct {
31 SensorsApplet *sensors_applet;
32
33 CtkDialog *dialog;
34 /* icon widgets */
35 CtkLabel *icon_header, *icon_type_label;
36 CtkComboBox *icon_type_combo_box;
37 CtkAlignment *icon_type_combo_box_aligner;
38 CtkCellRenderer *icon_renderer;
39
40 /* Graph Color chooser */
41 CtkColorButton *graph_color_button;
42 CtkAlignment *graph_color_button_aligner;
43 CtkLabel *graph_color_label, *graph_header;
44
45 /* multiplier and offset widgets */
46 CtkLabel *scale_header, *multiplier_label, *offset_label;
47 CtkAlignment *multiplier_spinbutton_aligner, *offset_spinbutton_aligner;
48 CtkAdjustment *multiplier_adjust, *offset_adjust;
49 CtkSpinButton *multiplier_spinbutton, *offset_spinbutton;
50
51 CtkLabel *limits_header;
52 CtkLabel *low_value_label, *high_value_label;
53 CtkAlignment *low_value_spinbutton_aligner, *high_value_spinbutton_aligner;
54 CtkAdjustment *low_value_adjust, *high_value_adjust;
55 CtkSpinButton *low_value_spinbutton, *high_value_spinbutton;
56
57 /* alarm widgets */
58 CtkLabel *alarm_header;
59 CtkLabel *low_alarm_command_label, *high_alarm_command_label, *alarm_timeout_label;
60 CtkAlignment *alarm_timeout_spinbutton_aligner;
61 CtkAdjustment *alarm_timeout_adjust;
62 CtkSpinButton *alarm_timeout_spinbutton;
63 CtkGrid *grid;
64 CtkAlignment *alarm_enable_aligner;
65 CtkCheckButton *alarm_enable_checkbutton;
66 CtkEntry *low_alarm_command_entry, *high_alarm_command_entry;
67
68 CtkSizeGroup *size_group;
69} SensorConfigDialog;
70
71
72static void sensor_config_dialog_response(CtkDialog *dialog,
73 gint response,
74 gpointer data) {
75
76 SensorConfigDialog *config_dialog;
77 GError *error = NULL((void*)0);
78
79 config_dialog = (SensorConfigDialog *)data;
Value stored to 'config_dialog' is never read
80
81 switch (response) {
82 case CTK_RESPONSE_HELP:
83 g_debug("loading help in config dialog");
84 ctk_show_uri_on_window(NULL((void*)0),
85 "help:cafe-sensors-applet/sensors-applet-sensors#sensors-applet-sensor-config-dialog",
86 ctk_get_current_event_time(),
87 &error);
88
89 if (error) {
90 g_debug("Could not open help document: %s ",error->message);
91 g_error_free (error);
92 }
93 break;
94
95 default:
96 g_debug("destroying config dialog");
97 ctk_widget_destroy(CTK_WIDGET(dialog)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((dialog)), ((ctk_widget_get_type ()))))))
);
98 }
99}
100
101static void sensor_config_dialog_multiplier_changed(CtkSpinButton *spinbutton, SensorConfigDialog *config_dialog) {
102 CtkTreeModel *model;
103 CtkTreePath *path;
104 CtkTreeIter iter;
105 gdouble value;
106
107 value = ctk_spin_button_get_value(spinbutton);
108
109 ctk_tree_selection_get_selected(config_dialog->sensors_applet->selection,
110 &model,
111 &iter);
112
113 path = ctk_tree_model_get_path(CTK_TREE_MODEL(config_dialog->sensors_applet->sensors)((((CtkTreeModel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->sensors_applet->sensors)), ((ctk_tree_model_get_type
()))))))
, &iter);
114 ctk_tree_store_set(config_dialog->sensors_applet->sensors,
115 &iter,
116 MULTIPLIER_COLUMN, value,
117 -1);
118
119 sensors_applet_update_sensor(config_dialog->sensors_applet, path);
120 ctk_tree_path_free(path);
121}
122
123static void sensor_config_dialog_offset_changed(CtkSpinButton *spinbutton, SensorConfigDialog *config_dialog) {
124 CtkTreeModel *model;
125 CtkTreePath *path;
126 CtkTreeIter iter;
127 gdouble value;
128
129 value = ctk_spin_button_get_value(spinbutton);
130
131 ctk_tree_selection_get_selected(config_dialog->sensors_applet->selection,
132 &model,
133 &iter);
134 path = ctk_tree_model_get_path(CTK_TREE_MODEL(config_dialog->sensors_applet->sensors)((((CtkTreeModel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->sensors_applet->sensors)), ((ctk_tree_model_get_type
()))))))
, &iter);
135 ctk_tree_store_set(config_dialog->sensors_applet->sensors,
136 &iter,
137 OFFSET_COLUMN, value,
138 -1);
139
140 sensors_applet_update_sensor(config_dialog->sensors_applet, path);
141 ctk_tree_path_free(path);
142}
143
144static void sensor_config_dialog_low_value_changed(CtkSpinButton *spinbutton, SensorConfigDialog *config_dialog) {
145 CtkTreeModel *model;
146 CtkTreePath *path;
147 CtkTreeIter iter;
148 gdouble value;
149
150 value = ctk_spin_button_get_value(spinbutton);
151
152 ctk_tree_selection_get_selected(config_dialog->sensors_applet->selection,
153 &model,
154 &iter);
155 path = ctk_tree_model_get_path(CTK_TREE_MODEL(config_dialog->sensors_applet->sensors)((((CtkTreeModel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->sensors_applet->sensors)), ((ctk_tree_model_get_type
()))))))
, &iter);
156
157 ctk_tree_store_set(config_dialog->sensors_applet->sensors,
158 &iter,
159 LOW_VALUE_COLUMN, value,
160 -1);
161
162 sensors_applet_update_sensor(config_dialog->sensors_applet, path);
163 ctk_tree_path_free(path);
164}
165
166static void sensor_config_dialog_high_value_changed(CtkSpinButton *spinbutton, SensorConfigDialog *config_dialog) {
167 CtkTreeModel *model;
168 CtkTreePath *path;
169 CtkTreeIter iter;
170 gdouble value;
171
172 value = ctk_spin_button_get_value(spinbutton);
173
174 ctk_tree_selection_get_selected(config_dialog->sensors_applet->selection,
175 &model,
176 &iter);
177 path = ctk_tree_model_get_path(CTK_TREE_MODEL(config_dialog->sensors_applet->sensors)((((CtkTreeModel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->sensors_applet->sensors)), ((ctk_tree_model_get_type
()))))))
, &iter);
178
179 ctk_tree_store_set(config_dialog->sensors_applet->sensors,
180 &iter,
181 HIGH_VALUE_COLUMN, value,
182 -1);
183
184 sensors_applet_update_sensor(config_dialog->sensors_applet, path);
185 ctk_tree_path_free(path);
186}
187
188static void sensor_config_dialog_alarm_toggled(CtkToggleButton *button, SensorConfigDialog *config_dialog) {
189 CtkTreeModel *model;
190 CtkTreePath *path;
191 CtkTreeIter iter;
192
193 gboolean value;
194 value = ctk_toggle_button_get_active(button);
195
196 /* update state of alarm widgets */
197 ctk_widget_set_sensitive(CTK_WIDGET(config_dialog->alarm_timeout_label)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->alarm_timeout_label)), ((ctk_widget_get_type
()))))))
, value);
198 ctk_widget_set_sensitive(CTK_WIDGET(config_dialog->alarm_timeout_spinbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->alarm_timeout_spinbutton)), ((ctk_widget_get_type
()))))))
, value);
199 ctk_widget_set_sensitive(CTK_WIDGET(config_dialog->low_alarm_command_label)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->low_alarm_command_label)), ((ctk_widget_get_type
()))))))
, value);
200 ctk_widget_set_sensitive(CTK_WIDGET(config_dialog->low_alarm_command_entry)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->low_alarm_command_entry)), ((ctk_widget_get_type
()))))))
, value);
201 ctk_widget_set_sensitive(CTK_WIDGET(config_dialog->high_alarm_command_label)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->high_alarm_command_label)), ((ctk_widget_get_type
()))))))
, value);
202 ctk_widget_set_sensitive(CTK_WIDGET(config_dialog->high_alarm_command_entry)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->high_alarm_command_entry)), ((ctk_widget_get_type
()))))))
, value);
203
204 ctk_tree_selection_get_selected(config_dialog->sensors_applet->selection,
205 &model,
206 &iter);
207
208 path = ctk_tree_model_get_path(CTK_TREE_MODEL(config_dialog->sensors_applet->sensors)((((CtkTreeModel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->sensors_applet->sensors)), ((ctk_tree_model_get_type
()))))))
, &iter);
209
210 ctk_tree_store_set(config_dialog->sensors_applet->sensors,
211 &iter,
212 ALARM_ENABLE_COLUMN, value,
213 -1);
214
215 sensors_applet_update_sensor(config_dialog->sensors_applet, path);
216 ctk_tree_path_free(path);
217}
218
219static void sensor_config_dialog_alarm_timeout_changed(CtkSpinButton *spinbutton, SensorConfigDialog *config_dialog) {
220 CtkTreeModel *model;
221 CtkTreePath *path;
222 CtkTreeIter iter;
223 gint value;
224
225 value = ctk_spin_button_get_value_as_int(spinbutton);
226
227 ctk_tree_selection_get_selected(config_dialog->sensors_applet->selection,
228 &model,
229 &iter);
230 path = ctk_tree_model_get_path(CTK_TREE_MODEL(config_dialog->sensors_applet->sensors)((((CtkTreeModel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->sensors_applet->sensors)), ((ctk_tree_model_get_type
()))))))
, &iter);
231
232 sensors_applet_all_alarms_off(config_dialog->sensors_applet, path);
233 ctk_tree_store_set(config_dialog->sensors_applet->sensors,
234 &iter,
235 ALARM_TIMEOUT_COLUMN, value,
236 -1);
237
238 sensors_applet_update_sensor(config_dialog->sensors_applet, path);
239 ctk_tree_path_free(path);
240}
241
242static void sensor_config_dialog_alarm_command_edited(CtkEntry *command_entry, SensorConfigDialog *config_dialog, NotifType notif_type) {
243 CtkTreeModel *model;
244 CtkTreePath *path;
245 CtkTreeIter iter;
246
247 gchar *value;
248 g_object_get(command_entry, "text", &value, NULL((void*)0));
249
250 ctk_tree_selection_get_selected(config_dialog->sensors_applet->selection,
251 &model,
252 &iter);
253 path = ctk_tree_model_get_path(CTK_TREE_MODEL(config_dialog->sensors_applet->sensors)((((CtkTreeModel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->sensors_applet->sensors)), ((ctk_tree_model_get_type
()))))))
, &iter);
254
255 sensors_applet_alarm_off(config_dialog->sensors_applet, path, notif_type);
256
257 ctk_tree_store_set(config_dialog->sensors_applet->sensors,
258 &iter,
259 (notif_type == LOW_ALARM ? LOW_ALARM_COMMAND_COLUMN : HIGH_ALARM_COMMAND_COLUMN),
260 value,
261 -1);
262 g_free(value);
263 sensors_applet_update_sensor(config_dialog->sensors_applet, path);
264 ctk_tree_path_free(path);
265}
266
267static void sensor_config_dialog_low_alarm_command_edited(CtkEntry *command_entry, SensorConfigDialog *config_dialog) {
268 sensor_config_dialog_alarm_command_edited(command_entry,
269 config_dialog,
270 LOW_ALARM);
271}
272
273static void sensor_config_dialog_high_alarm_command_edited(CtkEntry *command_entry, SensorConfigDialog *config_dialog) {
274 sensor_config_dialog_alarm_command_edited(command_entry,
275 config_dialog,
276 HIGH_ALARM);
277}
278
279static void sensor_config_dialog_icon_type_changed(CtkComboBox *icon_type_combo_box,
280 SensorConfigDialog *config_dialog) {
281 CtkTreeModel *icons_model;
282 CtkTreeIter icons_iter;
283
284 CtkTreeModel *model;
285 CtkTreeIter iter;
286 CtkTreePath *path;
287
288 GdkPixbuf *new_icon;
289 IconType icon_type;
290
291 icons_model = ctk_combo_box_get_model(icon_type_combo_box);
292 if (ctk_combo_box_get_active_iter(icon_type_combo_box, &icons_iter)) {
293
294 ctk_tree_model_get(icons_model, &icons_iter,
295 0, &new_icon,
296 -1);
297
298 icon_type = ctk_combo_box_get_active(icon_type_combo_box);
299 ctk_tree_selection_get_selected(config_dialog->sensors_applet->selection,
300 &model,
301 &iter);
302
303 path = ctk_tree_model_get_path(model, &iter);
304 ctk_tree_store_set(config_dialog->sensors_applet->sensors,
305 &iter,
306 ICON_TYPE_COLUMN, icon_type,
307 ICON_PIXBUF_COLUMN, new_icon,
308 -1);
309 g_object_unref(new_icon);
310 sensors_applet_icon_changed(config_dialog->sensors_applet, path);
311 ctk_tree_path_free(path);
312 }
313}
314
315static void sensor_config_dialog_graph_color_set(CtkColorChooser *color_chooser,
316 SensorConfigDialog *config_dialog) {
317 CtkTreeModel *model;
318 CtkTreePath *path;
319 CtkTreeIter iter;
320 CtkWidget *content_area;
321 gchar *color_string;
322 CdkRGBA color;
323
324 ctk_color_chooser_get_rgba(color_chooser, &color);
325
326 color_string = g_strdup_printf ("#%02X%02X%02X", (int)(0.5 + CLAMP (color.red, 0., 1.)(((color.red) > (1.)) ? (1.) : (((color.red) < (0.)) ? (
0.) : (color.red)))
* 255.),
327 (int)(0.5 + CLAMP (color.green, 0., 1.)(((color.green) > (1.)) ? (1.) : (((color.green) < (0.)
) ? (0.) : (color.green)))
* 255.),
328 (int)(0.5 + CLAMP (color.blue, 0., 1.)(((color.blue) > (1.)) ? (1.) : (((color.blue) < (0.)) ?
(0.) : (color.blue)))
* 255.));
329
330 ctk_tree_selection_get_selected(config_dialog->sensors_applet->selection,
331 &model,
332 &iter);
333
334 ctk_tree_store_set(config_dialog->sensors_applet->sensors,
335 &iter,
336 GRAPH_COLOR_COLUMN, color_string,
337 -1);
338
339 g_free(color_string);
340
341 path = ctk_tree_model_get_path(CTK_TREE_MODEL(config_dialog->sensors_applet->sensors)((((CtkTreeModel*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->sensors_applet->sensors)), ((ctk_tree_model_get_type
()))))))
, &iter);
342 sensors_applet_update_sensor(config_dialog->sensors_applet, path);
343 ctk_tree_path_free(path);
344}
345
346void sensor_config_dialog_create(SensorsApplet *sensors_applet) {
347 CtkTreeModel *model;
348 CtkTreeIter iter;
349 CtkWidget *content_area;
350
351 SensorConfigDialog *config_dialog;
352
353 CtkListStore *icon_store;
354 IconType count;
355 GdkPixbuf *pixbuf;
356 CdkRGBA graph_color;
357 gchar *sensor_label;
358 gchar *header_text;
359
360 /* instance variables for data */
361 gdouble low_value, high_value, multiplier, offset;
362 gboolean alarm_enable;
363 gchar *low_alarm_command, *high_alarm_command;
364 gint alarm_timeout;
365 IconType icon_type;
366 gchar *graph_color_string;
367
368 config_dialog = g_new0(SensorConfigDialog, 1)((SensorConfigDialog *) g_malloc0_n ((1), sizeof (SensorConfigDialog
)))
;
369 config_dialog->sensors_applet = sensors_applet;
370
371 ctk_tree_selection_get_selected(sensors_applet->selection,
372 &model,
373 &iter);
374 /* get current values of alarm and its enable */
375 ctk_tree_model_get(model, &iter,
376 LOW_VALUE_COLUMN, &low_value,
377 HIGH_VALUE_COLUMN, &high_value,
378 ALARM_ENABLE_COLUMN, &alarm_enable,
379 LOW_ALARM_COMMAND_COLUMN, &low_alarm_command,
380 HIGH_ALARM_COMMAND_COLUMN, &high_alarm_command,
381 ALARM_TIMEOUT_COLUMN, &alarm_timeout,
382 MULTIPLIER_COLUMN, &multiplier,
383 OFFSET_COLUMN, &offset,
384 ICON_TYPE_COLUMN, &icon_type,
385 GRAPH_COLOR_COLUMN, &graph_color_string,
386 LABEL_COLUMN, &sensor_label,
387 -1);
388 header_text = g_strdup_printf("%s - %s", _("Sensor Properties")gettext ("Sensor Properties"), sensor_label);
389
390
391 config_dialog->dialog = CTK_DIALOG(ctk_dialog_new_with_buttons(header_text,((((CtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ctk_dialog_new_with_buttons(header_text, ((((CtkWindow*)
(void *) g_type_check_instance_cast ((GTypeInstance*) ((sensors_applet
->prefs_dialog->dialog)), ((ctk_window_get_type ())))))
), CTK_DIALOG_DESTROY_WITH_PARENT, "ctk-help", CTK_RESPONSE_HELP
, "ctk-close", CTK_RESPONSE_CLOSE, ((void*)0)))), ((ctk_dialog_get_type
()))))))
392 CTK_WINDOW(sensors_applet->prefs_dialog->dialog),((((CtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ctk_dialog_new_with_buttons(header_text, ((((CtkWindow*)
(void *) g_type_check_instance_cast ((GTypeInstance*) ((sensors_applet
->prefs_dialog->dialog)), ((ctk_window_get_type ())))))
), CTK_DIALOG_DESTROY_WITH_PARENT, "ctk-help", CTK_RESPONSE_HELP
, "ctk-close", CTK_RESPONSE_CLOSE, ((void*)0)))), ((ctk_dialog_get_type
()))))))
393 CTK_DIALOG_DESTROY_WITH_PARENT,((((CtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ctk_dialog_new_with_buttons(header_text, ((((CtkWindow*)
(void *) g_type_check_instance_cast ((GTypeInstance*) ((sensors_applet
->prefs_dialog->dialog)), ((ctk_window_get_type ())))))
), CTK_DIALOG_DESTROY_WITH_PARENT, "ctk-help", CTK_RESPONSE_HELP
, "ctk-close", CTK_RESPONSE_CLOSE, ((void*)0)))), ((ctk_dialog_get_type
()))))))
394 "ctk-help",((((CtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ctk_dialog_new_with_buttons(header_text, ((((CtkWindow*)
(void *) g_type_check_instance_cast ((GTypeInstance*) ((sensors_applet
->prefs_dialog->dialog)), ((ctk_window_get_type ())))))
), CTK_DIALOG_DESTROY_WITH_PARENT, "ctk-help", CTK_RESPONSE_HELP
, "ctk-close", CTK_RESPONSE_CLOSE, ((void*)0)))), ((ctk_dialog_get_type
()))))))
395 CTK_RESPONSE_HELP,((((CtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ctk_dialog_new_with_buttons(header_text, ((((CtkWindow*)
(void *) g_type_check_instance_cast ((GTypeInstance*) ((sensors_applet
->prefs_dialog->dialog)), ((ctk_window_get_type ())))))
), CTK_DIALOG_DESTROY_WITH_PARENT, "ctk-help", CTK_RESPONSE_HELP
, "ctk-close", CTK_RESPONSE_CLOSE, ((void*)0)))), ((ctk_dialog_get_type
()))))))
396 "ctk-close",((((CtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ctk_dialog_new_with_buttons(header_text, ((((CtkWindow*)
(void *) g_type_check_instance_cast ((GTypeInstance*) ((sensors_applet
->prefs_dialog->dialog)), ((ctk_window_get_type ())))))
), CTK_DIALOG_DESTROY_WITH_PARENT, "ctk-help", CTK_RESPONSE_HELP
, "ctk-close", CTK_RESPONSE_CLOSE, ((void*)0)))), ((ctk_dialog_get_type
()))))))
397 CTK_RESPONSE_CLOSE,((((CtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ctk_dialog_new_with_buttons(header_text, ((((CtkWindow*)
(void *) g_type_check_instance_cast ((GTypeInstance*) ((sensors_applet
->prefs_dialog->dialog)), ((ctk_window_get_type ())))))
), CTK_DIALOG_DESTROY_WITH_PARENT, "ctk-help", CTK_RESPONSE_HELP
, "ctk-close", CTK_RESPONSE_CLOSE, ((void*)0)))), ((ctk_dialog_get_type
()))))))
398 NULL))((((CtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ctk_dialog_new_with_buttons(header_text, ((((CtkWindow*)
(void *) g_type_check_instance_cast ((GTypeInstance*) ((sensors_applet
->prefs_dialog->dialog)), ((ctk_window_get_type ())))))
), CTK_DIALOG_DESTROY_WITH_PARENT, "ctk-help", CTK_RESPONSE_HELP
, "ctk-close", CTK_RESPONSE_CLOSE, ((void*)0)))), ((ctk_dialog_get_type
()))))))
;
399
400
401 ctk_window_set_icon_name(CTK_WINDOW(config_dialog->dialog)((((CtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->dialog)), ((ctk_window_get_type ()))))
))
, "sensors-applet");
402
403 g_free(header_text);
404 g_free(sensor_label);
405
406 g_object_set(config_dialog->dialog,
407 "border-width", 12,
408 NULL((void*)0));
409
410 g_signal_connect(config_dialog->dialog,g_signal_connect_data ((config_dialog->dialog), ("response"
), (((GCallback) (sensor_config_dialog_response))), (config_dialog
), ((void*)0), (GConnectFlags) 0)
411 "response",g_signal_connect_data ((config_dialog->dialog), ("response"
), (((GCallback) (sensor_config_dialog_response))), (config_dialog
), ((void*)0), (GConnectFlags) 0)
412 G_CALLBACK(sensor_config_dialog_response),g_signal_connect_data ((config_dialog->dialog), ("response"
), (((GCallback) (sensor_config_dialog_response))), (config_dialog
), ((void*)0), (GConnectFlags) 0)
413 config_dialog)g_signal_connect_data ((config_dialog->dialog), ("response"
), (((GCallback) (sensor_config_dialog_response))), (config_dialog
), ((void*)0), (GConnectFlags) 0)
;
414
415 /* graph stuff */
416 header_text = g_markup_printf_escaped("<b>%s</b>", _("Graph")gettext ("Graph"));
417 config_dialog->graph_header = g_object_new(CTK_TYPE_LABEL(ctk_label_get_type ()),
418 "use-markup", TRUE(!(0)),
419 "label", header_text,
420 "xalign", 0.0,
421 NULL((void*)0));
422 g_free(header_text);
423
424 cdk_rgba_parse(&graph_color, graph_color_string);
425 config_dialog->graph_color_button = CTK_COLOR_BUTTON(ctk_color_button_new_with_rgba(&graph_color))((((CtkColorButton*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ctk_color_button_new_with_rgba(&graph_color))), ((ctk_color_button_get_type
()))))))
;
426 ctk_widget_set_halign (CTK_WIDGET(config_dialog->graph_color_button)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->graph_color_button)), ((ctk_widget_get_type
()))))))
, CTK_ALIGN_START);
427 ctk_widget_set_valign (CTK_WIDGET(config_dialog->graph_color_button)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->graph_color_button)), ((ctk_widget_get_type
()))))))
, CTK_ALIGN_START);
428
429 ctk_color_button_set_title(config_dialog->graph_color_button, _("Graph Color")gettext ("Graph Color"));
430
431 config_dialog->graph_color_label = g_object_new(CTK_TYPE_LABEL(ctk_label_get_type ()),
432 "label", _("Graph _color")gettext ("Graph _color"),
433 "mnemonic-widget", config_dialog->graph_color_button,
434 "use-underline", TRUE(!(0)),
435 "xalign", 0.0,
436 NULL((void*)0));
437
438 g_signal_connect(config_dialog->graph_color_button, "color-set",g_signal_connect_data ((config_dialog->graph_color_button)
, ("color-set"), (((GCallback) (sensor_config_dialog_graph_color_set
))), (config_dialog), ((void*)0), (GConnectFlags) 0)
439 G_CALLBACK(sensor_config_dialog_graph_color_set),g_signal_connect_data ((config_dialog->graph_color_button)
, ("color-set"), (((GCallback) (sensor_config_dialog_graph_color_set
))), (config_dialog), ((void*)0), (GConnectFlags) 0)
440 config_dialog)g_signal_connect_data ((config_dialog->graph_color_button)
, ("color-set"), (((GCallback) (sensor_config_dialog_graph_color_set
))), (config_dialog), ((void*)0), (GConnectFlags) 0)
;
441
442 /* icon stuff */
443 header_text = g_markup_printf_escaped("<b>%s</b>", _("Icon")gettext ("Icon"));
444 config_dialog->icon_header = g_object_new(CTK_TYPE_LABEL(ctk_label_get_type ()),
445 "use-markup", TRUE(!(0)),
446 "label", header_text,
447 "xalign", 0.0,
448 NULL((void*)0));
449 g_free(header_text);
450
451 /* icon type */
452 icon_store = ctk_list_store_new(1, GDK_TYPE_PIXBUF(gdk_pixbuf_get_type ()));
453
454 /* populate list with icons */
455 for (count = CPU_ICON; count < NUM_ICONS; count++) {
456 pixbuf = sensors_applet_load_icon(count);
457 if (pixbuf) {
458 ctk_list_store_insert(icon_store, &iter, count);
459 ctk_list_store_set(icon_store, &iter, 0, pixbuf, -1);
460 /* let list hold icons */
461 g_object_unref(pixbuf);
462 }
463 }
464
465 config_dialog->icon_type_combo_box = CTK_COMBO_BOX(ctk_combo_box_new_with_model(CTK_TREE_MODEL(icon_store)))((((CtkComboBox*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((ctk_combo_box_new_with_model(((((CtkTreeModel*) (void *)
g_type_check_instance_cast ((GTypeInstance*) ((icon_store)),
((ctk_tree_model_get_type ()))))))))), ((ctk_combo_box_get_type
()))))))
;
466
467 ctk_widget_set_halign (CTK_WIDGET(config_dialog->icon_type_combo_box)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->icon_type_combo_box)), ((ctk_widget_get_type
()))))))
, CTK_ALIGN_START);
468 ctk_widget_set_valign (CTK_WIDGET(config_dialog->icon_type_combo_box)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->icon_type_combo_box)), ((ctk_widget_get_type
()))))))
, CTK_ALIGN_START);
469
470 config_dialog->icon_renderer = ctk_cell_renderer_pixbuf_new();
471 ctk_cell_layout_pack_start(CTK_CELL_LAYOUT(config_dialog->icon_type_combo_box)((((CtkCellLayout*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->icon_type_combo_box)), ((ctk_cell_layout_get_type
()))))))
,
472 CTK_CELL_RENDERER(config_dialog->icon_renderer)((((CtkCellRenderer*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->icon_renderer)), ((ctk_cell_renderer_get_type
()))))))
,
473 FALSE(0));
474
475 ctk_cell_layout_add_attribute(CTK_CELL_LAYOUT(config_dialog->icon_type_combo_box)((((CtkCellLayout*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->icon_type_combo_box)), ((ctk_cell_layout_get_type
()))))))
,
476 CTK_CELL_RENDERER(config_dialog->icon_renderer)((((CtkCellRenderer*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->icon_renderer)), ((ctk_cell_renderer_get_type
()))))))
,
477 "pixbuf", 0);
478
479 ctk_combo_box_set_active(config_dialog->icon_type_combo_box, icon_type);
480
481 g_signal_connect(config_dialog->icon_type_combo_box, "changed",g_signal_connect_data ((config_dialog->icon_type_combo_box
), ("changed"), (((GCallback) (sensor_config_dialog_icon_type_changed
))), (config_dialog), ((void*)0), (GConnectFlags) 0)
482 G_CALLBACK(sensor_config_dialog_icon_type_changed),g_signal_connect_data ((config_dialog->icon_type_combo_box
), ("changed"), (((GCallback) (sensor_config_dialog_icon_type_changed
))), (config_dialog), ((void*)0), (GConnectFlags) 0)
483 config_dialog)g_signal_connect_data ((config_dialog->icon_type_combo_box
), ("changed"), (((GCallback) (sensor_config_dialog_icon_type_changed
))), (config_dialog), ((void*)0), (GConnectFlags) 0)
;
484
485 config_dialog->icon_type_label = g_object_new(CTK_TYPE_LABEL(ctk_label_get_type ()),
486 "label", _("Sensor _icon")gettext ("Sensor _icon"),
487 "mnemonic-widget", config_dialog->icon_type_combo_box,
488 "use-underline", TRUE(!(0)),
489 "xalign", 0.0,
490 NULL((void*)0));
491
492 header_text = g_markup_printf_escaped("<b>%s</b>", _("Scaling Parameters")gettext ("Scaling Parameters"));
493 config_dialog->scale_header = g_object_new(CTK_TYPE_LABEL(ctk_label_get_type ()),
494 "use-markup", TRUE(!(0)),
495 "label", header_text,
496 "xalign", 0.0,
497 NULL((void*)0));
498 g_free(header_text);
499
500 /* do multiplier and offset widgets */
501 config_dialog->multiplier_adjust = g_object_new(CTK_TYPE_ADJUSTMENT(ctk_adjustment_get_type ()),
502 "value", 1.0,
503 "lower", 0.001,
504 "upper", 1000.0,
505 "step-increment", 0.1,
506 "page-increment", 1.0,
507 "page-size", 1.0,
508 NULL((void*)0));
509
510 config_dialog->multiplier_spinbutton = g_object_new(CTK_TYPE_SPIN_BUTTON(ctk_spin_button_get_type ()),
511 "adjustment", config_dialog->multiplier_adjust,
512 "digits", VALUE_DECIMAL_PLACES3,
513 "value", multiplier,
514 "width-chars", SPINBUTTON_WIDTH_CHARS8,
515 NULL((void*)0));
516
517 ctk_widget_set_halign (CTK_WIDGET(config_dialog->multiplier_spinbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->multiplier_spinbutton)), ((ctk_widget_get_type
()))))))
, CTK_ALIGN_START);
518 ctk_widget_set_valign (CTK_WIDGET(config_dialog->multiplier_spinbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->multiplier_spinbutton)), ((ctk_widget_get_type
()))))))
, CTK_ALIGN_START);
519
520 config_dialog->multiplier_label = g_object_new(CTK_TYPE_LABEL(ctk_label_get_type ()),
521 "label", _("Sensor value _multiplier")gettext ("Sensor value _multiplier"),
522 "mnemonic-widget", config_dialog->multiplier_spinbutton,
523 "use-underline", TRUE(!(0)),
524 "xalign", 0.0,
525 NULL((void*)0));
526
527 g_signal_connect(config_dialog->multiplier_spinbutton, "value-changed", G_CALLBACK(sensor_config_dialog_multiplier_changed), config_dialog)g_signal_connect_data ((config_dialog->multiplier_spinbutton
), ("value-changed"), (((GCallback) (sensor_config_dialog_multiplier_changed
))), (config_dialog), ((void*)0), (GConnectFlags) 0)
;
528
529 config_dialog->offset_adjust = g_object_new(CTK_TYPE_ADJUSTMENT(ctk_adjustment_get_type ()),
530 "value", 0.0,
531 "lower", -1000.000,
532 "upper", 1000.000,
533 "step-increment", 0.01,
534 "page-increment", 1.0,
535 "page-size", 1.0,
536 NULL((void*)0));
537
538 config_dialog->offset_spinbutton = g_object_new(CTK_TYPE_SPIN_BUTTON(ctk_spin_button_get_type ()),
539 "adjustment", config_dialog->offset_adjust,
540 "digits", VALUE_DECIMAL_PLACES3,
541 "value", (gdouble)offset,
542 "width-chars", SPINBUTTON_WIDTH_CHARS8,
543 NULL((void*)0));
544
545 ctk_widget_set_halign (CTK_WIDGET(config_dialog->offset_spinbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->offset_spinbutton)), ((ctk_widget_get_type
()))))))
, CTK_ALIGN_START);
546 ctk_widget_set_valign (CTK_WIDGET(config_dialog->offset_spinbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->offset_spinbutton)), ((ctk_widget_get_type
()))))))
, CTK_ALIGN_START);
547
548 config_dialog->offset_label = g_object_new(CTK_TYPE_LABEL(ctk_label_get_type ()),
549 "label", _("Sensor value _offset")gettext ("Sensor value _offset"),
550 "mnemonic-widget", config_dialog->offset_spinbutton,
551 "use-underline", TRUE(!(0)),
552 "xalign", 0.0,
553 NULL((void*)0));
554
555 g_signal_connect(config_dialog->offset_spinbutton, "value-changed", G_CALLBACK(sensor_config_dialog_offset_changed), config_dialog)g_signal_connect_data ((config_dialog->offset_spinbutton),
("value-changed"), (((GCallback) (sensor_config_dialog_offset_changed
))), (config_dialog), ((void*)0), (GConnectFlags) 0)
;
556
557 /* now do alarm widgets */
558 header_text = g_markup_printf_escaped("<b>%s</b>", _("Sensor Limits")gettext ("Sensor Limits"));
559 config_dialog->limits_header = g_object_new(CTK_TYPE_LABEL(ctk_label_get_type ()),
560 "use-markup", TRUE(!(0)),
561 "label", header_text,
562 "xalign", 0.0,
563 NULL((void*)0));
564 g_free(header_text);
565
566 config_dialog->low_value_adjust = g_object_new(CTK_TYPE_ADJUSTMENT(ctk_adjustment_get_type ()),
567 "value", 0.0,
568 "lower", -100000.0,
569 "upper", 100000.0,
570 "step-increment", 1.0,
571 "page-increment", 10.0,
572 "page-size", 100.0,
573 NULL((void*)0));
574
575 config_dialog->low_value_spinbutton = g_object_new(CTK_TYPE_SPIN_BUTTON(ctk_spin_button_get_type ()),
576 "adjustment", config_dialog->low_value_adjust,
577 "digits", VALUE_DECIMAL_PLACES3,
578 "value", low_value,
579 "width-chars", SPINBUTTON_WIDTH_CHARS8,
580 NULL((void*)0));
581
582 ctk_widget_set_halign (CTK_WIDGET(config_dialog->low_value_spinbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->low_value_spinbutton)), ((ctk_widget_get_type
()))))))
, CTK_ALIGN_START);
583 ctk_widget_set_valign (CTK_WIDGET(config_dialog->low_value_spinbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->low_value_spinbutton)), ((ctk_widget_get_type
()))))))
, CTK_ALIGN_START);
584
585 config_dialog->low_value_label = g_object_new(CTK_TYPE_LABEL(ctk_label_get_type ()),
586 "label", _("Sensor _low value")gettext ("Sensor _low value"),
587 "mnemonic-widget", config_dialog->low_value_spinbutton,
588 "use-underline", TRUE(!(0)),
589 "xalign", 0.0,
590 NULL((void*)0));
591
592 g_signal_connect(config_dialog->low_value_spinbutton, "value-changed", G_CALLBACK(sensor_config_dialog_low_value_changed), config_dialog)g_signal_connect_data ((config_dialog->low_value_spinbutton
), ("value-changed"), (((GCallback) (sensor_config_dialog_low_value_changed
))), (config_dialog), ((void*)0), (GConnectFlags) 0)
;
593
594 config_dialog->high_value_adjust = g_object_new(CTK_TYPE_ADJUSTMENT(ctk_adjustment_get_type ()),
595 "value", 0.0,
596 "lower", -100000.0,
597 "upper", 100000.0,
598 "step-increment", 1.0,
599 "page-increment", 10.0,
600 "page-size", 100.0,
601 NULL((void*)0));
602
603 config_dialog->high_value_spinbutton = g_object_new(CTK_TYPE_SPIN_BUTTON(ctk_spin_button_get_type ()),
604 "adjustment", config_dialog->high_value_adjust,
605 "digits", VALUE_DECIMAL_PLACES3,
606 "value", high_value,
607 "width-chars", SPINBUTTON_WIDTH_CHARS8,
608 NULL((void*)0));
609
610 ctk_widget_set_halign (CTK_WIDGET(config_dialog->high_value_spinbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->high_value_spinbutton)), ((ctk_widget_get_type
()))))))
, CTK_ALIGN_START);
611 ctk_widget_set_valign (CTK_WIDGET(config_dialog->high_value_spinbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->high_value_spinbutton)), ((ctk_widget_get_type
()))))))
, CTK_ALIGN_START);
612
613 config_dialog->high_value_label = g_object_new(CTK_TYPE_LABEL(ctk_label_get_type ()),
614 "label", _("Sensor _high value")gettext ("Sensor _high value"),
615 "mnemonic-widget", config_dialog->high_value_spinbutton,
616 "use-underline", TRUE(!(0)),
617 "xalign", 0.0,
618 NULL((void*)0));
619
620 g_signal_connect(config_dialog->high_value_spinbutton, "value-changed", G_CALLBACK(sensor_config_dialog_high_value_changed), config_dialog)g_signal_connect_data ((config_dialog->high_value_spinbutton
), ("value-changed"), (((GCallback) (sensor_config_dialog_high_value_changed
))), (config_dialog), ((void*)0), (GConnectFlags) 0)
;
621
622 header_text = g_markup_printf_escaped("<b>%s</b>", _("Alarm")gettext ("Alarm"));
623 config_dialog->alarm_header = g_object_new(CTK_TYPE_LABEL(ctk_label_get_type ()),
624 "use-markup", TRUE(!(0)),
625 "label", header_text,
626 "xalign", 0.0,
627 NULL((void*)0));
628 g_free(header_text);
629
630 config_dialog->alarm_timeout_adjust = g_object_new(CTK_TYPE_ADJUSTMENT(ctk_adjustment_get_type ()),
631 "value", 0.0,
632 "lower", 0.0,
633 "upper", 10000.0,
634 "step-increment", 1.0,
635 "page-increment", 10.0,
636 "page-size", 100.0,
637 NULL((void*)0));
638
639 config_dialog->alarm_timeout_spinbutton = g_object_new(CTK_TYPE_SPIN_BUTTON(ctk_spin_button_get_type ()),
640 "adjustment", config_dialog->alarm_timeout_adjust,
641 "digits", 0,
642 "value", (gdouble)alarm_timeout,
643 "width-chars", SPINBUTTON_WIDTH_CHARS8,
644 "sensitive", alarm_enable,
645 NULL((void*)0));
646
647 ctk_widget_set_halign (CTK_WIDGET(config_dialog->alarm_timeout_spinbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->alarm_timeout_spinbutton)), ((ctk_widget_get_type
()))))))
, CTK_ALIGN_START);
648 ctk_widget_set_valign (CTK_WIDGET(config_dialog->alarm_timeout_spinbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->alarm_timeout_spinbutton)), ((ctk_widget_get_type
()))))))
, CTK_ALIGN_START);
649
650 config_dialog->alarm_timeout_label = g_object_new(CTK_TYPE_LABEL(ctk_label_get_type ()),
651 "label", _("Alarm _repeat interval (secs)")gettext ("Alarm _repeat interval (secs)"),
652 "mnemonic-widget", config_dialog->alarm_timeout_spinbutton,
653 "use-underline", TRUE(!(0)),
654 "xalign", 0.0,
655 "sensitive", alarm_enable,
656 NULL((void*)0));
657
658 g_signal_connect(config_dialog->alarm_timeout_spinbutton, "value-changed", G_CALLBACK(sensor_config_dialog_alarm_timeout_changed), config_dialog)g_signal_connect_data ((config_dialog->alarm_timeout_spinbutton
), ("value-changed"), (((GCallback) (sensor_config_dialog_alarm_timeout_changed
))), (config_dialog), ((void*)0), (GConnectFlags) 0)
;
659
660 config_dialog->low_alarm_command_entry = g_object_new(CTK_TYPE_ENTRY(ctk_entry_get_type ()),
661 "text", low_alarm_command,
662 "width-chars", 25,
663 "sensitive", alarm_enable,
664 NULL((void*)0));
665
666 g_free(low_alarm_command);
667
668 config_dialog->low_alarm_command_label = g_object_new(CTK_TYPE_LABEL(ctk_label_get_type ()),
669 "use-underline", TRUE(!(0)),
670 "label", _("Lo_w alarm command")gettext ("Lo_w alarm command"),
671 "mnemonic-widget", config_dialog->low_alarm_command_entry,
672 "xalign", 0.0,
673 "sensitive", alarm_enable,
674 NULL((void*)0));
675
676 g_signal_connect(config_dialog->low_alarm_command_entry,g_signal_connect_data ((config_dialog->low_alarm_command_entry
), ("changed"), (((GCallback) (sensor_config_dialog_low_alarm_command_edited
))), (config_dialog), ((void*)0), (GConnectFlags) 0)
677 "changed",g_signal_connect_data ((config_dialog->low_alarm_command_entry
), ("changed"), (((GCallback) (sensor_config_dialog_low_alarm_command_edited
))), (config_dialog), ((void*)0), (GConnectFlags) 0)
678 G_CALLBACK(sensor_config_dialog_low_alarm_command_edited),g_signal_connect_data ((config_dialog->low_alarm_command_entry
), ("changed"), (((GCallback) (sensor_config_dialog_low_alarm_command_edited
))), (config_dialog), ((void*)0), (GConnectFlags) 0)
679 config_dialog)g_signal_connect_data ((config_dialog->low_alarm_command_entry
), ("changed"), (((GCallback) (sensor_config_dialog_low_alarm_command_edited
))), (config_dialog), ((void*)0), (GConnectFlags) 0)
;
680
681 config_dialog->high_alarm_command_entry = g_object_new(CTK_TYPE_ENTRY(ctk_entry_get_type ()),
682 "text", high_alarm_command,
683 "width-chars", 25,
684 "sensitive", alarm_enable,
685 NULL((void*)0));
686
687 g_free(high_alarm_command);
688
689 config_dialog->high_alarm_command_label = g_object_new(CTK_TYPE_LABEL(ctk_label_get_type ()),
690 "use-underline", TRUE(!(0)),
691 "label", _("Hi_gh alarm command")gettext ("Hi_gh alarm command"),
692 "mnemonic-widget", config_dialog->high_alarm_command_entry,
693 "xalign", 0.0,
694 "sensitive", alarm_enable,
695 NULL((void*)0));
696
697 g_signal_connect(config_dialog->high_alarm_command_entry,g_signal_connect_data ((config_dialog->high_alarm_command_entry
), ("changed"), (((GCallback) (sensor_config_dialog_high_alarm_command_edited
))), (config_dialog), ((void*)0), (GConnectFlags) 0)
698 "changed",g_signal_connect_data ((config_dialog->high_alarm_command_entry
), ("changed"), (((GCallback) (sensor_config_dialog_high_alarm_command_edited
))), (config_dialog), ((void*)0), (GConnectFlags) 0)
699 G_CALLBACK(sensor_config_dialog_high_alarm_command_edited),g_signal_connect_data ((config_dialog->high_alarm_command_entry
), ("changed"), (((GCallback) (sensor_config_dialog_high_alarm_command_edited
))), (config_dialog), ((void*)0), (GConnectFlags) 0)
700 config_dialog)g_signal_connect_data ((config_dialog->high_alarm_command_entry
), ("changed"), (((GCallback) (sensor_config_dialog_high_alarm_command_edited
))), (config_dialog), ((void*)0), (GConnectFlags) 0)
;
701
702 config_dialog->alarm_enable_checkbutton = g_object_new(CTK_TYPE_CHECK_BUTTON(ctk_check_button_get_type ()),
703 "use-underline", TRUE(!(0)),
704 "label", _("_Enable alarm")gettext ("_Enable alarm"),
705 "active", alarm_enable,
706 "xalign", 0.0,
707 NULL((void*)0));
708
709 ctk_widget_set_halign (CTK_WIDGET(config_dialog->alarm_enable_checkbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->alarm_enable_checkbutton)), ((ctk_widget_get_type
()))))))
, CTK_ALIGN_START);
710 ctk_widget_set_valign (CTK_WIDGET(config_dialog->alarm_enable_checkbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->alarm_enable_checkbutton)), ((ctk_widget_get_type
()))))))
, CTK_ALIGN_START);
711
712 g_signal_connect(config_dialog->alarm_enable_checkbutton, "toggled", G_CALLBACK(sensor_config_dialog_alarm_toggled), config_dialog)g_signal_connect_data ((config_dialog->alarm_enable_checkbutton
), ("toggled"), (((GCallback) (sensor_config_dialog_alarm_toggled
))), (config_dialog), ((void*)0), (GConnectFlags) 0)
;
713
714 config_dialog->size_group = ctk_size_group_new(CTK_SIZE_GROUP_HORIZONTAL);
715 ctk_size_group_add_widget(config_dialog->size_group, CTK_WIDGET(config_dialog->multiplier_spinbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->multiplier_spinbutton)), ((ctk_widget_get_type
()))))))
);
716 ctk_size_group_add_widget(config_dialog->size_group, CTK_WIDGET(config_dialog->offset_spinbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->offset_spinbutton)), ((ctk_widget_get_type
()))))))
);
717 ctk_size_group_add_widget(config_dialog->size_group, CTK_WIDGET(config_dialog->low_value_spinbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->low_value_spinbutton)), ((ctk_widget_get_type
()))))))
);
718 ctk_size_group_add_widget(config_dialog->size_group, CTK_WIDGET(config_dialog->high_value_spinbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->high_value_spinbutton)), ((ctk_widget_get_type
()))))))
);
719 ctk_size_group_add_widget(config_dialog->size_group, CTK_WIDGET(config_dialog->alarm_timeout_spinbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->alarm_timeout_spinbutton)), ((ctk_widget_get_type
()))))))
);
720 ctk_size_group_add_widget(config_dialog->size_group, CTK_WIDGET(config_dialog->icon_type_combo_box)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->icon_type_combo_box)), ((ctk_widget_get_type
()))))))
);
721 ctk_size_group_add_widget(config_dialog->size_group, CTK_WIDGET(config_dialog->graph_color_button)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->graph_color_button)), ((ctk_widget_get_type
()))))))
);
722 g_object_unref(config_dialog->size_group);
723
724 config_dialog->grid = g_object_new(CTK_TYPE_GRID(ctk_grid_get_type ()),
725 "column-spacing", 5,
726 "row-homogeneous", FALSE(0),
727 "column-homogeneous", FALSE(0),
728 "row-spacing", 6,
729 "column-spacing", 12,
730 NULL((void*)0));
731
732 ctk_grid_attach(config_dialog->grid,
733 CTK_WIDGET(config_dialog->scale_header)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->scale_header)), ((ctk_widget_get_type (
)))))))
,
734 0, 0, 2, 1);
735
736 ctk_grid_attach(config_dialog->grid,
737 CTK_WIDGET(config_dialog->multiplier_label)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->multiplier_label)), ((ctk_widget_get_type
()))))))
,
738 1, 1, 1, 1);
739
740 ctk_grid_attach(config_dialog->grid,
741 CTK_WIDGET(config_dialog->multiplier_spinbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->multiplier_spinbutton)), ((ctk_widget_get_type
()))))))
,
742 2, 1, 1, 1);
743
744 ctk_grid_attach(config_dialog->grid,
745 CTK_WIDGET(config_dialog->offset_label)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->offset_label)), ((ctk_widget_get_type (
)))))))
,
746 1, 2, 1, 1);
747
748 ctk_grid_attach(config_dialog->grid,
749 CTK_WIDGET(config_dialog->offset_spinbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->offset_spinbutton)), ((ctk_widget_get_type
()))))))
,
750 2, 2, 1, 1);
751
752 ctk_grid_attach(config_dialog->grid,
753 CTK_WIDGET(config_dialog->limits_header)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->limits_header)), ((ctk_widget_get_type
()))))))
,
754 0, 3, 2, 1);
755
756 /* now pack alarm widgets */
757 ctk_grid_attach(config_dialog->grid,
758 CTK_WIDGET(config_dialog->low_value_label)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->low_value_label)), ((ctk_widget_get_type
()))))))
,
759 1, 4, 1, 1);
760
761 ctk_grid_attach(config_dialog->grid,
762 CTK_WIDGET(config_dialog->low_value_spinbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->low_value_spinbutton)), ((ctk_widget_get_type
()))))))
,
763 2, 4, 1, 1);
764
765 ctk_grid_attach(config_dialog->grid,
766 CTK_WIDGET(config_dialog->high_value_label)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->high_value_label)), ((ctk_widget_get_type
()))))))
,
767 1, 5, 1, 1);
768
769 ctk_grid_attach(config_dialog->grid,
770 CTK_WIDGET(config_dialog->high_value_spinbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->high_value_spinbutton)), ((ctk_widget_get_type
()))))))
,
771 2, 5, 1, 1);
772
773 ctk_grid_attach(config_dialog->grid,
774 CTK_WIDGET(config_dialog->alarm_header)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->alarm_header)), ((ctk_widget_get_type (
)))))))
,
775 0, 6, 2, 1);
776
777 ctk_grid_attach(config_dialog->grid,
778 CTK_WIDGET(config_dialog->alarm_enable_checkbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->alarm_enable_checkbutton)), ((ctk_widget_get_type
()))))))
,
779 1, 7, 1, 1);
780
781 ctk_grid_attach(config_dialog->grid,
782 CTK_WIDGET(config_dialog->alarm_timeout_label)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->alarm_timeout_label)), ((ctk_widget_get_type
()))))))
,
783 1, 8, 1, 1);
784
785 ctk_grid_attach(config_dialog->grid,
786 CTK_WIDGET(config_dialog->alarm_timeout_spinbutton)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->alarm_timeout_spinbutton)), ((ctk_widget_get_type
()))))))
,
787 2, 8, 1, 1);
788
789 ctk_grid_attach(config_dialog->grid,
790 CTK_WIDGET(config_dialog->low_alarm_command_label)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->low_alarm_command_label)), ((ctk_widget_get_type
()))))))
,
791 1, 9, 1, 1);
792
793 ctk_grid_attach(config_dialog->grid,
794 CTK_WIDGET(config_dialog->low_alarm_command_entry)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->low_alarm_command_entry)), ((ctk_widget_get_type
()))))))
,
795 2, 9, 1, 1);
796
797 ctk_grid_attach(config_dialog->grid,
798 CTK_WIDGET(config_dialog->high_alarm_command_label)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->high_alarm_command_label)), ((ctk_widget_get_type
()))))))
,
799 1, 10, 1, 1);
800
801 ctk_grid_attach(config_dialog->grid,
802 CTK_WIDGET(config_dialog->high_alarm_command_entry)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->high_alarm_command_entry)), ((ctk_widget_get_type
()))))))
,
803 2, 10, 1, 1);
804
805 ctk_grid_attach(config_dialog->grid,
806 CTK_WIDGET(config_dialog->icon_header)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->icon_header)), ((ctk_widget_get_type (
)))))))
,
807 0, 11, 2, 1);
808
809 ctk_grid_attach(config_dialog->grid,
810 CTK_WIDGET(config_dialog->icon_type_label)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->icon_type_label)), ((ctk_widget_get_type
()))))))
,
811 1, 12, 1, 1);
812
813 ctk_grid_attach(config_dialog->grid,
814 CTK_WIDGET(config_dialog->icon_type_combo_box)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->icon_type_combo_box)), ((ctk_widget_get_type
()))))))
,
815 2, 12, 1, 1);
816
817 ctk_grid_attach(config_dialog->grid,
818 CTK_WIDGET(config_dialog->graph_header)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->graph_header)), ((ctk_widget_get_type (
)))))))
,
819 0, 13, 2, 1);
820
821 ctk_grid_attach(config_dialog->grid,
822 CTK_WIDGET(config_dialog->graph_color_label)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->graph_color_label)), ((ctk_widget_get_type
()))))))
,
823 1, 14, 1, 1);
824
825 ctk_grid_attach(config_dialog->grid,
826 CTK_WIDGET(config_dialog->graph_color_button)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->graph_color_button)), ((ctk_widget_get_type
()))))))
,
827 2, 14, 1, 1);
828
829 content_area = ctk_dialog_get_content_area (config_dialog->dialog);
830 ctk_box_pack_start(CTK_BOX(content_area)((((CtkBox*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((content_area)), ((ctk_box_get_type ()))))))
, CTK_WIDGET(config_dialog->grid)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->grid)), ((ctk_widget_get_type ()))))))
, FALSE(0), FALSE(0), 0);
831 ctk_widget_show_all(CTK_WIDGET(config_dialog->dialog)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance
*) ((config_dialog->dialog)), ((ctk_widget_get_type ()))))
))
);
832
833}