]>
Commit | Line | Data |
---|---|---|
1be1f5b8 MB |
1 | diff -urN gnome-applets-2.18.0/configure.in gnome-applets-2.18.0.new/configure.in |
2 | --- gnome-applets-2.18.0/configure.in 2007-03-12 13:57:09.000000000 +0100 | |
3 | +++ gnome-applets-2.18.0.new/configure.in 2007-06-10 12:30:15.000000000 +0200 | |
4 | @@ -35,6 +35,7 @@ | |
5 | GNOME_PYTHON_REQUIRED=2.10 | |
6 | GNOME_ICON_THEME_REQUIRED=2.15.91 | |
7 | LIBXML_REQUIRED=2.5.0 | |
8 | +LIBOOBS_REQUIRED=0.5.0 | |
9 | dnl *************************************************************************** | |
10 | ||
11 | AM_MAINTAINER_MODE | |
12 | @@ -509,25 +510,20 @@ | |
13 | dnl *** modemlights applet check *** | |
14 | dnl *************************************************************************** | |
15 | ||
16 | -SU_TOOL= | |
17 | -P_MODEMLIGHTS= | |
18 | -HAVE_LIBUTIL= | |
19 | - | |
20 | -AC_PATH_PROG(SU_TOOL, su) | |
21 | -AC_CHECK_LIB(util, forkpty, HAVE_LIBUTIL=true, HAVE_LIBUTIL=false) | |
22 | -AM_PATH_SYSTEM_TOOLS_BACKENDS($SYSTEM_TOOLS_BACKENDS_REQUIRED, P_MODEMLIGHTS=modemlights) | |
23 | - | |
24 | -if test "x$HAVE_LIBUTIL" = "xtrue" -a "x$P_MODEMLIGHTS" = "xmodemlights" -a "x$HAVE_GNOME_SETTINGS_DAEMON" = "xyes"; then | |
25 | - MODEMLIGHTS_LIBS=" -lutil" | |
26 | - AC_SUBST(MODEMLIGHTS_LIBS) | |
27 | - AC_DEFINE_UNQUOTED(STB_SCRIPTS_DIR, "$STB_SCRIPTS_DIR", [System tools backends]) | |
28 | - AC_DEFINE_UNQUOTED(SU_PATH, "${SU_TOOL}", [su executable path]) | |
29 | +MODEMLIGHTS_LIBS= | |
30 | +MODEMLIGHTS_CFLAGS= | |
31 | + | |
32 | +PKG_CHECK_MODULES(MODEMLIGHTS, liboobs-1 >= $LIBOOBS_REQUIRED, | |
33 | + HAVE_LIBOOBS=yes, HAVE_LIBOOBS=no) | |
34 | +if test "x$HAVE_LIBOOBS" = "xyes" -a "x$HAVE_GNOME_SETTINGS_DAEMON" = "xyes"; then | |
35 | BUILD_MODEM_LIGHTS=yes | |
36 | else | |
37 | AC_MSG_WARN([*** modemlights applet will not be built ***]) | |
38 | BUILD_MODEM_LIGHTS=no | |
39 | fi | |
40 | ||
41 | +AC_SUBST(MODEMLIGHTS_LIBS) | |
42 | +AC_SUBST(MODEMLIGHTS_CFLAGS) | |
43 | AM_CONDITIONAL(APPLET_MODEMLIGHTS, test "x$BUILD_MODEM_LIGHTS" = "xyes") | |
44 | ||
45 | dnl *************************************************************************** | |
46 | diff -urN gnome-applets-2.18.0/modemlights/Makefile.am gnome-applets-2.18.0.new/modemlights/Makefile.am | |
47 | --- gnome-applets-2.18.0/modemlights/Makefile.am 2006-12-31 03:16:08.000000000 +0100 | |
48 | +++ gnome-applets-2.18.0.new/modemlights/Makefile.am 2007-06-10 12:31:26.000000000 +0200 | |
49 | @@ -2,6 +2,7 @@ | |
50 | ||
51 | INCLUDES = -I. -I$(srcdir) \ | |
52 | $(GNOME_APPLETS_CFLAGS) \ | |
53 | + $(MODEMLIGHTS_CFLAGS) \ | |
54 | $(LIBGLADE_CFLAGS) | |
55 | ||
56 | libexec_PROGRAMS = modem_applet | |
57 | diff -urN gnome-applets-2.18.0/modemlights/modem-applet.c gnome-applets-2.18.0.new/modemlights/modem-applet.c | |
58 | --- gnome-applets-2.18.0/modemlights/modem-applet.c 2006-12-31 03:16:08.000000000 +0100 | |
59 | +++ gnome-applets-2.18.0.new/modemlights/modem-applet.c 2007-06-10 13:32:32.000000000 +0200 | |
60 | @@ -23,31 +23,14 @@ | |
61 | #endif | |
62 | ||
63 | #include <panel-applet.h> | |
64 | -#include <fcntl.h> | |
65 | -#ifdef HAVE_PTY_H | |
66 | -#include <pty.h> | |
67 | -#endif | |
68 | -#include <sys/poll.h> | |
69 | -#include <sys/types.h> | |
70 | -#include <sys/wait.h> | |
71 | -#include <libxml/tree.h> | |
72 | +#include <oobs/oobs.h> | |
73 | #include <glade/glade.h> | |
74 | ||
75 | -#ifdef __FreeBSD__ | |
76 | -#include <sys/ioctl.h> | |
77 | -#include <termios.h> | |
78 | -#include <libutil.h> | |
79 | -#endif | |
80 | - | |
81 | #include "modem-applet.h" | |
82 | ||
83 | #define MODEM_APPLET_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TYPE_MODEM_APPLET, ModemAppletPrivate)) | |
84 | #define NETWORK_TOOL "network-admin" | |
85 | -#define END_OF_REQUEST "<!-- GST: end of request -->\n" | |
86 | -#define BUF_SIZE 1024 | |
87 | ||
88 | -typedef void (*DirectiveCallback) (ModemApplet*, xmlDoc*); | |
89 | -typedef struct _BackendDirective BackendDirective; | |
90 | typedef struct _ModemAppletPrivate ModemAppletPrivate; | |
91 | ||
92 | struct _ModemAppletPrivate | |
93 | @@ -59,47 +42,19 @@ | |
94 | GtkWidget *image; | |
95 | GtkTooltips *tooltips; | |
96 | ||
97 | - /* auth dialog */ | |
98 | - GtkWidget *auth_dialog; | |
99 | - GtkWidget *auth_dialog_label; | |
100 | - GtkWidget *auth_dialog_entry; | |
101 | - | |
102 | /* report window */ | |
103 | GtkWidget *report_window; | |
104 | GtkWidget *report_window_image; | |
105 | GtkWidget *report_window_progress; | |
106 | ||
107 | - guint directives_id; | |
108 | - guint progress_id; | |
109 | - guint tooltip_id; | |
110 | - guint info_id; | |
111 | - guint timeout_id; | |
112 | - | |
113 | - /* for communicating with the backend */ | |
114 | - gint config_id; | |
115 | - gint pid; | |
116 | - int read_fd; | |
117 | - int write_fd; | |
118 | - FILE *read_stream; | |
119 | - FILE *write_stream; | |
120 | - GSList *directives; | |
121 | - gboolean directive_running; | |
122 | - | |
123 | - /* interface data */ | |
124 | - gboolean configured; /* is configured? */ | |
125 | - gboolean enabled; /* is enabled? */ | |
126 | - gboolean is_isdn; /* is an isdn device? */ | |
127 | - gchar *dev; /* device name */ | |
128 | - gchar *lock_file; /* lock file */ | |
129 | - | |
130 | - gboolean has_root; | |
131 | -}; | |
132 | + /* configuration */ | |
133 | + OobsSession *session; | |
134 | + OobsObject *config; | |
135 | + OobsIface *iface; | |
136 | + gchar *lock_file; | |
137 | ||
138 | -struct _BackendDirective | |
139 | -{ | |
140 | - DirectiveCallback callback; | |
141 | - GSList *directive; | |
142 | - gboolean show_report; | |
143 | + guint pulse_id; | |
144 | + guint tooltip_id; | |
145 | }; | |
146 | ||
147 | static void modem_applet_class_init (ModemAppletClass *class); | |
148 | @@ -139,8 +94,6 @@ | |
149 | gboolean backend_alive, | |
150 | gboolean already_waiting); | |
151 | ||
152 | -static gpointer parent_class; | |
153 | - | |
154 | static const BonoboUIVerb menu_verbs[] = { | |
155 | BONOBO_UI_UNSAFE_VERB ("Activate", on_modem_applet_activate), | |
156 | BONOBO_UI_UNSAFE_VERB ("Deactivate", on_modem_applet_deactivate), | |
157 | @@ -150,32 +103,7 @@ | |
158 | BONOBO_UI_VERB_END | |
159 | }; | |
160 | ||
161 | -static GType | |
162 | -modem_applet_get_type (void) | |
163 | -{ | |
164 | - static GType type = 0; | |
165 | - | |
166 | - if (!type) | |
167 | - { | |
168 | - static const GTypeInfo info = | |
169 | - { | |
170 | - sizeof (ModemAppletClass), | |
171 | - NULL, /* base_init */ | |
172 | - NULL, /* base_finalize */ | |
173 | - (GClassInitFunc) modem_applet_class_init, | |
174 | - NULL, /* class_finalize */ | |
175 | - NULL, /* class_data */ | |
176 | - sizeof (ModemApplet), | |
177 | - 0, /* n_preallocs */ | |
178 | - (GInstanceInitFunc) modem_applet_init, | |
179 | - }; | |
180 | - | |
181 | - type = g_type_register_static (PANEL_TYPE_APPLET, "ModemApplet", | |
182 | - &info, 0); | |
183 | - } | |
184 | - | |
185 | - return type; | |
186 | -} | |
187 | +G_DEFINE_TYPE (ModemApplet, modem_applet, PANEL_TYPE_APPLET); | |
188 | ||
189 | static void | |
190 | modem_applet_class_init (ModemAppletClass *class) | |
191 | @@ -185,8 +113,7 @@ | |
192 | ||
193 | object_class = G_OBJECT_CLASS (class); | |
194 | applet_class = PANEL_APPLET_CLASS (class); | |
195 | - parent_class = g_type_class_peek_parent (class); | |
196 | - | |
197 | + | |
198 | object_class->finalize = modem_applet_finalize; | |
199 | applet_class->change_size = modem_applet_change_size; | |
200 | applet_class->change_background = modem_applet_change_background; | |
201 | @@ -194,6 +121,57 @@ | |
202 | g_type_class_add_private (object_class, sizeof (ModemAppletPrivate)); | |
203 | } | |
204 | ||
205 | +static OobsIface* | |
206 | +get_modem_iface (OobsIfacesConfig *config) | |
207 | +{ | |
208 | + OobsList *list; | |
209 | + OobsListIter iter; | |
210 | + gboolean valid; | |
211 | + | |
212 | + /* First try the modem ifaces */ | |
213 | + list = oobs_ifaces_config_get_ifaces (config, OOBS_IFACE_TYPE_MODEM); | |
214 | + valid = oobs_list_get_iter_first (list, &iter); | |
215 | + | |
216 | + if (valid) | |
217 | + return (OobsIface *) oobs_list_get (list, &iter); | |
218 | + | |
219 | + /* no modem? try the isdn ifaces */ | |
220 | + list = oobs_ifaces_config_get_ifaces (config, OOBS_IFACE_TYPE_ISDN); | |
221 | + valid = oobs_list_get_iter_first (list, &iter); | |
222 | + | |
223 | + if (valid) | |
224 | + return (OobsIface *) oobs_list_get (list, &iter); | |
225 | + | |
226 | + return NULL; | |
227 | +} | |
228 | + | |
229 | +static gchar* | |
230 | +get_lock_file (OobsIface *iface) | |
231 | +{ | |
232 | + gchar *lock_file; | |
233 | + | |
234 | + if (!iface) | |
235 | + return NULL; | |
236 | + | |
237 | + if (OOBS_IS_IFACE_MODEM (iface)) | |
238 | + { | |
239 | + const gchar *serial_port, *str; | |
240 | + | |
241 | + serial_port = oobs_iface_modem_get_serial_port (OOBS_IFACE_MODEM (iface)); | |
242 | + | |
243 | + if (serial_port) | |
244 | + { | |
245 | + str = strchr (serial_port, '/'); | |
246 | + lock_file = g_strdup_printf ("/var/lock/LCK..%s", str + 1); | |
247 | + } | |
248 | + } | |
249 | + else if (OOBS_IS_IFACE_ISDN (iface)) | |
250 | + lock_file = g_strdup ("/var/lock/LCK..capi_0"); | |
251 | + | |
252 | + return lock_file; | |
253 | +} | |
254 | + | |
255 | + | |
256 | static void | |
257 | modem_applet_init (ModemApplet *applet) | |
258 | { | |
259 | @@ -208,9 +186,10 @@ | |
260 | priv->image = gtk_image_new (); | |
261 | priv->tooltips = gtk_tooltips_new (); | |
262 | ||
263 | - priv->auth_dialog = glade_xml_get_widget (priv->xml, "auth_dialog"); | |
264 | - priv->auth_dialog_label = glade_xml_get_widget (priv->xml, "auth_dialog_label"); | |
265 | - priv->auth_dialog_entry = glade_xml_get_widget (priv->xml, "auth_dialog_entry"); | |
266 | + priv->session = oobs_session_get (); | |
267 | + priv->config = oobs_ifaces_config_get (priv->session); | |
268 | + priv->iface = get_modem_iface (OOBS_IFACES_CONFIG (priv->config)); | |
269 | + priv->lock_file = get_lock_file (priv->iface); | |
270 | ||
271 | priv->report_window = glade_xml_get_widget (priv->xml, "report_window"); | |
272 | priv->report_window_image = glade_xml_get_widget (priv->xml, "report_window_image"); | |
273 | @@ -223,19 +202,7 @@ | |
274 | gtk_image_set_from_pixbuf (GTK_IMAGE (priv->report_window_image), pixbuf); | |
275 | gdk_pixbuf_unref (pixbuf); | |
276 | ||
277 | - priv->configured = FALSE; | |
278 | - priv->enabled = FALSE; | |
279 | - priv->dev = NULL; | |
280 | - priv->lock_file = NULL; | |
281 | - | |
282 | - priv->has_root = FALSE; | |
283 | - | |
284 | - priv->directives = NULL; | |
285 | - priv->directives_id = g_timeout_add (250, (GSourceFunc) dispatch_directives, applet); | |
286 | - priv->directive_running = FALSE; | |
287 | priv->tooltip_id = g_timeout_add (1000, (GSourceFunc) update_tooltip, applet); | |
288 | - | |
289 | - launch_backend (applet, FALSE); | |
290 | gtk_container_add (GTK_CONTAINER (applet), priv->image); | |
291 | } | |
292 | ||
293 | @@ -246,18 +213,25 @@ | |
294 | ||
295 | if (priv) | |
296 | { | |
297 | - shutdown_backend (MODEM_APPLET (object), TRUE, TRUE); | |
298 | - | |
299 | - gtk_widget_destroy (priv->auth_dialog); | |
300 | - gtk_widget_destroy (priv->report_window); | |
301 | + g_object_unref (priv->xml); | |
302 | g_object_unref (priv->icon); | |
303 | + gtk_widget_destroy (priv->image); | |
304 | + | |
305 | + if (priv->pulse_id) | |
306 | + { | |
307 | + g_source_remove (priv->pulse_id); | |
308 | + priv->pulse_id = 0; | |
309 | + } | |
310 | ||
311 | - g_free (priv->dev); | |
312 | - g_free (priv->lock_file); | |
313 | + if (priv->tooltip_id) | |
314 | + { | |
315 | + g_source_remove (priv->tooltip_id); | |
316 | + priv->tooltip_id = 0; | |
317 | + } | |
318 | } | |
319 | ||
320 | - if (G_OBJECT_CLASS (parent_class)->finalize) | |
321 | - (* G_OBJECT_CLASS (parent_class)->finalize) (object); | |
322 | + if (G_OBJECT_CLASS (modem_applet_parent_class)->finalize) | |
323 | + (* G_OBJECT_CLASS (modem_applet_parent_class)->finalize) (object); | |
324 | } | |
325 | ||
326 | static void | |
327 | @@ -312,401 +286,26 @@ | |
328 | } | |
329 | } | |
330 | ||
331 | -static gboolean | |
332 | -pulse_progressbar (GtkWidget *progressbar) | |
333 | -{ | |
334 | - gtk_progress_bar_pulse (GTK_PROGRESS_BAR (progressbar)); | |
335 | - return TRUE; | |
336 | -} | |
337 | - | |
338 | -/* XML manipulation functions */ | |
339 | -static xmlNodePtr | |
340 | -get_root_node (xmlDoc *doc) | |
341 | -{ | |
342 | - return xmlDocGetRootElement (doc); | |
343 | -} | |
344 | - | |
345 | -static xmlNodePtr | |
346 | -find_first_element (xmlNodePtr node, const gchar *name) | |
347 | -{ | |
348 | - xmlNodePtr n; | |
349 | - | |
350 | - g_return_val_if_fail (node != NULL, NULL); | |
351 | - g_return_val_if_fail (name != NULL, NULL); | |
352 | - | |
353 | - for (n = node->children; n; n = n->next) | |
354 | - if (n->name && (strcmp (name, (char *) n->name) == 0)) | |
355 | - break; | |
356 | - | |
357 | - return n; | |
358 | -} | |
359 | - | |
360 | -static xmlNodePtr | |
361 | -find_next_element (xmlNodePtr node, const gchar *name) | |
362 | -{ | |
363 | - xmlNodePtr n; | |
364 | - | |
365 | - g_return_val_if_fail (node != NULL, NULL); | |
366 | - g_return_val_if_fail (name != NULL, NULL); | |
367 | - | |
368 | - for (n = node->next; n; n = n->next) | |
369 | - if (n->name && (strcmp (name, (char *) n->name) == 0)) | |
370 | - break; | |
371 | - | |
372 | - return n; | |
373 | -} | |
374 | - | |
375 | -static guchar * | |
376 | -element_get_attribute (xmlNodePtr node, const gchar *attribute) | |
377 | -{ | |
378 | - xmlAttrPtr a; | |
379 | - | |
380 | - g_return_val_if_fail (node != NULL, NULL); | |
381 | - a = node->properties; | |
382 | - | |
383 | - while (a) | |
384 | - { | |
385 | - if (a->name && (strcmp ((char *) a->name, attribute) == 0)) | |
386 | - return xmlNodeGetContent (a->children); | |
387 | - | |
388 | - a = a->next; | |
389 | - } | |
390 | - | |
391 | - return NULL; | |
392 | -} | |
393 | - | |
394 | -static guchar * | |
395 | -element_get_child_content (xmlNodePtr node, const gchar *tag) | |
396 | -{ | |
397 | - xmlNodePtr child, n; | |
398 | - | |
399 | - child = find_first_element (node, tag); | |
400 | - if (!child) | |
401 | - return NULL; | |
402 | - | |
403 | - for (n = child->children; n; n = n->next) | |
404 | - if (n->type == XML_TEXT_NODE) | |
405 | - return xmlNodeGetContent (n); | |
406 | - | |
407 | - return NULL; | |
408 | -} | |
409 | - | |
410 | -static xmlNodePtr | |
411 | -find_dialup_interface_node (xmlNodePtr root) | |
412 | -{ | |
413 | - xmlNodePtr node; | |
414 | - gchar *type; | |
415 | - | |
416 | - node = find_first_element (root, "interface"); | |
417 | - | |
418 | - while (node) | |
419 | - { | |
420 | - type = (char *) element_get_attribute (node, "type"); | |
421 | - | |
422 | - if (type && (strcmp (type, "modem") == 0 || strcmp (type, "isdn") == 0)) | |
423 | - { | |
424 | - g_free (type); | |
425 | - return node; | |
426 | - } | |
427 | - | |
428 | - g_free (type); | |
429 | - node = find_next_element (node, "interface"); | |
430 | - } | |
431 | - | |
432 | - return NULL; | |
433 | -} | |
434 | - | |
435 | -/* backend communication functions */ | |
436 | -static gchar * | |
437 | -compose_directive_string (GSList *directive) | |
438 | -{ | |
439 | - GString *dir; | |
440 | - gchar *arg, *s, *str; | |
441 | - GSList *elem; | |
442 | - | |
443 | - elem = directive; | |
444 | - dir = g_string_new (""); | |
445 | - | |
446 | - while (elem) | |
447 | - { | |
448 | - arg = elem->data; | |
449 | - | |
450 | - for (s = arg; *s; s++) | |
451 | - { | |
452 | - /* escape needed chars */ | |
453 | - if ((*s == '\\') || | |
454 | - ((*s == ':') && (* (s + 1) == ':'))) | |
455 | - g_string_append_c (dir, '\\'); | |
456 | - | |
457 | - g_string_append_c (dir, *s); | |
458 | - } | |
459 | - | |
460 | - g_string_append (dir, "::"); | |
461 | - elem = elem->next; | |
462 | - } | |
463 | - | |
464 | - g_string_append_c (dir, '\n'); | |
465 | - | |
466 | - str = dir->str; | |
467 | - g_string_free (dir, FALSE); | |
468 | - | |
469 | - return str; | |
470 | -} | |
471 | - | |
472 | -static void | |
473 | -poll_backend (ModemAppletPrivate *priv) | |
474 | -{ | |
475 | - struct pollfd fd; | |
476 | - | |
477 | - fd.fd = priv->read_fd; | |
478 | - fd.events = POLLIN || POLLPRI; | |
479 | - | |
480 | - while (poll (&fd, 1, 100) <= 0) | |
481 | - { | |
482 | - while (gtk_events_pending ()) | |
483 | - gtk_main_iteration (); | |
484 | - } | |
485 | -} | |
486 | - | |
487 | -static xmlDoc* | |
488 | -read_xml (ModemApplet *applet, gboolean show_report) | |
489 | -{ | |
490 | - ModemAppletPrivate *priv = MODEM_APPLET_GET_PRIVATE (applet); | |
491 | - gchar buffer[BUF_SIZE], *s; | |
492 | - GString *str; | |
493 | - xmlDoc *doc = NULL; | |
494 | - gboolean backend_alive; | |
495 | - | |
496 | - str = g_string_new (""); | |
497 | - backend_alive = (waitpid (priv->pid, NULL, WNOHANG) == 0); | |
498 | - | |
499 | - /* if show_report, create pulse timeout and show window */ | |
500 | - if (show_report) | |
501 | - { | |
502 | - priv->progress_id = gtk_timeout_add (200, (GSourceFunc) pulse_progressbar, priv->report_window_progress); | |
503 | - gtk_window_set_screen (GTK_WINDOW (priv->report_window), gtk_widget_get_screen (GTK_WIDGET (applet))); | |
504 | - gtk_widget_show (priv->report_window); | |
505 | - } | |
506 | - | |
507 | - while (backend_alive && !g_strrstr (str->str, END_OF_REQUEST)) | |
508 | - { | |
509 | - poll_backend (priv); | |
510 | - fgets (buffer, BUF_SIZE, priv->read_stream); | |
511 | - g_string_append (str, buffer); | |
512 | - | |
513 | - while (gtk_events_pending ()) | |
514 | - gtk_main_iteration (); | |
515 | - | |
516 | - backend_alive = (waitpid (priv->pid, NULL, WNOHANG) == 0); | |
517 | - } | |
518 | - | |
519 | - /* if show_report, hide window and so */ | |
520 | - if (show_report) | |
521 | - { | |
522 | - g_source_remove (priv->progress_id); | |
523 | - priv->progress_id = 0; | |
524 | - gtk_widget_hide (priv->report_window); | |
525 | - } | |
526 | - | |
527 | - s = str->str; | |
528 | - | |
529 | - while (*s && (*s != '<')) | |
530 | - s++; | |
531 | - | |
532 | - if (strcmp (s, END_OF_REQUEST) != 0) | |
533 | - doc = xmlParseDoc ((xmlChar *) s); | |
534 | - | |
535 | - g_string_free (str, TRUE); | |
536 | - | |
537 | - return doc; | |
538 | -} | |
539 | - | |
540 | -static void | |
541 | -queue_directive (ModemApplet *applet, | |
542 | - DirectiveCallback callback, | |
543 | - gboolean show_report, | |
544 | - const gchar *dir, | |
545 | - ...) | |
546 | -{ | |
547 | - ModemAppletPrivate *priv = MODEM_APPLET_GET_PRIVATE (applet); | |
548 | - BackendDirective *directive; | |
549 | - GSList *list = NULL; | |
550 | - va_list ap; | |
551 | - gchar *arg; | |
552 | - | |
553 | - list = g_slist_prepend (list, g_strdup (dir)); | |
554 | - va_start (ap, dir); | |
555 | - | |
556 | - while ((arg = va_arg (ap, gchar *)) != NULL) | |
557 | - list = g_slist_prepend (list, g_strdup (arg)); | |
558 | - | |
559 | - va_end (ap); | |
560 | - list = g_slist_reverse (list); | |
561 | - | |
562 | - directive = g_new0 (BackendDirective, 1); | |
563 | - directive->callback = callback; | |
564 | - directive->directive = list; | |
565 | - directive->show_report = show_report; | |
566 | - | |
567 | - priv->directives = g_slist_append (priv->directives, directive); | |
568 | -} | |
569 | - | |
570 | -static gboolean | |
571 | -dispatch_directives (ModemApplet *applet) | |
572 | -{ | |
573 | - ModemAppletPrivate *priv = MODEM_APPLET_GET_PRIVATE (applet); | |
574 | - BackendDirective *directive; | |
575 | - xmlDoc *doc; | |
576 | - gchar *dir; | |
577 | - GSList *elem; | |
578 | - | |
579 | - if (priv->directive_running) | |
580 | - return TRUE; | |
581 | - | |
582 | - priv->directive_running = TRUE; | |
583 | - elem = priv->directives; | |
584 | - | |
585 | - while (elem) | |
586 | - { | |
587 | - directive = elem->data; | |
588 | - | |
589 | - dir = compose_directive_string (directive->directive); | |
590 | - fputs (dir, priv->write_stream); | |
591 | - g_free (dir); | |
592 | - | |
593 | - doc = read_xml (applet, directive->show_report); | |
594 | - | |
595 | - if (directive->callback) | |
596 | - directive->callback (applet, doc); | |
597 | - | |
598 | - if (doc) | |
599 | - xmlFreeDoc (doc); | |
600 | - | |
601 | - g_slist_foreach (directive->directive, (GFunc) g_free, NULL); | |
602 | - g_slist_free (directive->directive); | |
603 | - | |
604 | - elem = elem->next; | |
605 | - } | |
606 | - | |
607 | - g_slist_foreach (priv->directives, (GFunc) g_free, NULL); | |
608 | - g_slist_free (priv->directives); | |
609 | - priv->directives = NULL; | |
610 | - priv->directive_running = FALSE; | |
611 | - | |
612 | - return TRUE; | |
613 | -} | |
614 | - | |
615 | -static void | |
616 | -shutdown_backend (ModemApplet *applet, gboolean backend_alive, gboolean already_waiting) | |
617 | -{ | |
618 | - ModemAppletPrivate *priv = MODEM_APPLET_GET_PRIVATE (applet); | |
619 | - | |
620 | - if (priv->info_id) | |
621 | - { | |
622 | - g_source_remove (priv->info_id); | |
623 | - priv->info_id = 0; | |
624 | - } | |
625 | - | |
626 | - if (priv->timeout_id) | |
627 | - { | |
628 | - g_source_remove (priv->timeout_id); | |
629 | - priv->timeout_id = 0; | |
630 | - } | |
631 | - | |
632 | - if (priv->tooltip_id) | |
633 | - { | |
634 | - g_source_remove (priv->tooltip_id); | |
635 | - priv->tooltip_id = 0; | |
636 | - } | |
637 | - | |
638 | - if (backend_alive) | |
639 | - kill (priv->pid, 9); | |
640 | - | |
641 | - if (!already_waiting) | |
642 | - { | |
643 | - /* don't leave zombies */ | |
644 | - while (waitpid (priv->pid, NULL, WNOHANG) <= 0) | |
645 | - { | |
646 | - usleep (2000); | |
647 | - | |
648 | - while (gtk_events_pending ()) | |
649 | - gtk_main_iteration (); | |
650 | - } | |
651 | - } | |
652 | - | |
653 | - /* close remaining streams and fds */ | |
654 | - fclose (priv->read_stream); | |
655 | - fclose (priv->write_stream); | |
656 | - close (priv->read_fd); | |
657 | - close (priv->write_fd); | |
658 | -} | |
659 | - | |
660 | -/* functions for extracting the interface information from the XML */ | |
661 | static void | |
662 | update_popup_buttons (ModemApplet *applet) | |
663 | { | |
664 | BonoboUIComponent *component; | |
665 | ModemAppletPrivate *priv = MODEM_APPLET_GET_PRIVATE (applet); | |
666 | + gboolean enabled; | |
667 | ||
668 | component = panel_applet_get_popup_component (PANEL_APPLET (applet)); | |
669 | + enabled = (priv->iface && oobs_iface_get_active (priv->iface)); | |
670 | ||
671 | bonobo_ui_component_set_prop (component, | |
672 | "/commands/Activate", | |
673 | - "sensitive", (priv->configured && !priv->enabled) ? "1" : "0", | |
674 | + "sensitive", (enabled) ? "1" : "0", | |
675 | NULL); | |
676 | bonobo_ui_component_set_prop (component, | |
677 | "/commands/Deactivate", | |
678 | - "sensitive", (priv->configured && priv->enabled) ? "1" : "0", | |
679 | + "sensitive", (enabled) ? "1" : "0", | |
680 | NULL); | |
681 | } | |
682 | ||
683 | -static void | |
684 | -get_interface_data (ModemApplet *applet, xmlNodePtr iface) | |
685 | -{ | |
686 | - ModemAppletPrivate *priv = MODEM_APPLET_GET_PRIVATE (applet); | |
687 | - xmlNodePtr configuration; | |
688 | - gchar *text, *device; | |
689 | - | |
690 | - g_return_if_fail (iface != NULL); | |
691 | - | |
692 | - text = (char *) element_get_child_content (iface, "enabled"); | |
693 | - priv->enabled = (*text == '1'); | |
694 | - g_free (text); | |
695 | - | |
696 | - g_free (priv->dev); | |
697 | - priv->dev = (char *) element_get_child_content (iface, "dev"); | |
698 | - | |
699 | - g_free (priv->lock_file); | |
700 | - configuration = find_first_element (iface, "configuration"); | |
701 | - | |
702 | - if (configuration) | |
703 | - { | |
704 | - priv->configured = TRUE; | |
705 | - text = (char *) element_get_child_content (configuration, "serial_port"); | |
706 | - | |
707 | - if (text) | |
708 | - { | |
709 | - /* Modem device */ | |
710 | - device = strrchr (text, '/'); | |
711 | - priv->lock_file = g_strdup_printf ("/var/lock/LCK..%s", device + 1); | |
712 | - g_free (text); | |
713 | - | |
714 | - priv->is_isdn = FALSE; | |
715 | - } | |
716 | - else | |
717 | - { | |
718 | - /* isdn device */ | |
719 | - priv->lock_file = g_strdup ("/var/lock/LCK..capi_0"); | |
720 | - priv->is_isdn = TRUE; | |
721 | - } | |
722 | - } | |
723 | - else | |
724 | - { | |
725 | - priv->lock_file = NULL; | |
726 | - priv->configured = FALSE; | |
727 | - } | |
728 | -} | |
729 | - | |
730 | static gint | |
731 | get_connection_time (const gchar *lock_file) | |
732 | { | |
733 | @@ -725,30 +324,30 @@ | |
734 | gchar *text; | |
735 | gint t, t1, t2; | |
736 | ||
737 | - if (priv->enabled) | |
738 | + if (!priv->lock_file) | |
739 | + text = g_strdup (_("Could not get connection time")); | |
740 | + else | |
741 | { | |
742 | - if (!priv->lock_file) | |
743 | - text = g_strdup (_("Connection active, but could not get connection time")); | |
744 | + t = get_connection_time (priv->lock_file); | |
745 | + | |
746 | + if (t == 0) | |
747 | + text = g_strdup (_("Not connected")); | |
748 | else | |
749 | { | |
750 | - t = get_connection_time (priv->lock_file); | |
751 | - | |
752 | - if (t < (60 * 60 * 24)) | |
753 | - { | |
754 | - t1 = t / 3600; /* hours */ | |
755 | - t2 = (t - (t1 * 3600)) / 60; /* minutes */ | |
756 | - } | |
757 | - else | |
758 | - { | |
759 | - t1 = t / (3600 * 24); /* days */ | |
760 | - t2 = (t - (t1 * 3600 * 24)) / 3600; /* hours */ | |
761 | - } | |
762 | - | |
763 | + if (t < (60 * 60 * 24)) | |
764 | + { | |
765 | + t1 = t / 3600; /* hours */ | |
766 | + t2 = (t - (t1 * 3600)) / 60; /* minutes */ | |
767 | + } | |
768 | + else | |
769 | + { | |
770 | + t1 = t / (3600 * 24); /* days */ | |
771 | + t2 = (t - (t1 * 3600 * 24)) / 3600; /* hours */ | |
772 | + } | |
773 | + | |
774 | text = g_strdup_printf (_("Time connected: %.1d:%.2d"), t1, t2); | |
775 | } | |
776 | } | |
777 | - else | |
778 | - text = g_strdup (_("Not connected")); | |
779 | ||
780 | gtk_tooltips_set_tip(priv->tooltips, GTK_WIDGET (applet), text, NULL); | |
781 | g_free(text); | |
782 | @@ -756,165 +355,8 @@ | |
783 | return TRUE; | |
784 | } | |
785 | ||
786 | -static void | |
787 | -rerun_backend_callback (ModemApplet *applet, xmlDoc *doc) | |
788 | -{ | |
789 | - ModemAppletPrivate *priv = MODEM_APPLET_GET_PRIVATE (applet); | |
790 | - gchar *text, *password; | |
791 | - gint response; | |
792 | - gboolean enable; | |
793 | - | |
794 | - shutdown_backend (applet, FALSE, FALSE); | |
795 | - launch_backend (applet, TRUE); | |
796 | - | |
797 | - enable = !priv->enabled; | |
798 | - | |
799 | - text = (enable) ? | |
800 | - _("To connect to your Internet service provider, you need administrator privileges") : | |
801 | - _("To disconnect from your Internet service provider, you need administrator privileges"); | |
802 | - | |
803 | - gtk_label_set_text (GTK_LABEL (priv->auth_dialog_label), text); | |
804 | - gtk_window_set_screen (GTK_WINDOW (priv->auth_dialog), | |
805 | - gtk_widget_get_screen (GTK_WIDGET (applet))); | |
806 | - | |
807 | - gtk_widget_grab_focus (priv->auth_dialog_entry); | |
808 | - response = gtk_dialog_run (GTK_DIALOG (priv->auth_dialog)); | |
809 | - gtk_widget_hide (priv->auth_dialog); | |
810 | - password = (gchar *) gtk_entry_get_text (GTK_ENTRY (priv->auth_dialog_entry)); | |
811 | - | |
812 | - if (response == GTK_RESPONSE_OK) | |
813 | - { | |
814 | - | |
815 | - password = (gchar *) gtk_entry_get_text (GTK_ENTRY (priv->auth_dialog_entry)); | |
816 | - fputs (password, priv->write_stream); | |
817 | - fputs ("\n", priv->write_stream); | |
818 | - | |
819 | - while (fflush (priv->write_stream) != 0); | |
820 | - | |
821 | - queue_directive (applet, NULL, enable, | |
822 | - "enable_iface", priv->dev, (enable) ? "1" : "0", NULL); | |
823 | - } | |
824 | - else | |
825 | - { | |
826 | - shutdown_backend (applet, TRUE, FALSE); | |
827 | - launch_backend (applet, FALSE); | |
828 | - } | |
829 | - | |
830 | - /* stab the root password */ | |
831 | - memset (password, ' ', sizeof (password)); | |
832 | - gtk_entry_set_text (GTK_ENTRY (priv->auth_dialog_entry), ""); | |
833 | -} | |
834 | - | |
835 | -static void | |
836 | -update_info_callback (ModemApplet *applet, xmlDoc *doc) | |
837 | -{ | |
838 | - xmlNodePtr iface; | |
839 | - | |
840 | - if (!doc) | |
841 | - return; | |
842 | - | |
843 | - iface = find_dialup_interface_node (get_root_node (doc)); | |
844 | - if (!iface) | |
845 | - return; | |
846 | - | |
847 | - get_interface_data (applet, iface); | |
848 | - update_popup_buttons (applet); | |
849 | -} | |
850 | - | |
851 | static gboolean | |
852 | -update_info (ModemApplet *applet) | |
853 | -{ | |
854 | - queue_directive (applet, update_info_callback, | |
855 | - FALSE, "get", NULL); | |
856 | - return TRUE; | |
857 | -} | |
858 | - | |
859 | -static gboolean | |
860 | -check_backend (ModemApplet *applet) | |
861 | -{ | |
862 | - ModemAppletPrivate *priv = MODEM_APPLET_GET_PRIVATE (applet); | |
863 | - gint status, pid = -1; | |
864 | - GtkWidget *dialog; | |
865 | - | |
866 | - pid = waitpid (priv->pid, &status, WNOHANG); | |
867 | - | |
868 | - if (pid != 0) | |
869 | - { | |
870 | - if (errno == ECHILD || ((WIFEXITED (status)) && (WEXITSTATUS (status)) && (WEXITSTATUS(status) < 255))) | |
871 | - { | |
872 | - dialog = gtk_message_dialog_new (NULL, | |
873 | - GTK_DIALOG_MODAL, | |
874 | - GTK_MESSAGE_WARNING, | |
875 | - GTK_BUTTONS_CLOSE, | |
876 | - _("The entered password is invalid")); | |
877 | - gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), | |
878 | - _("Check that you have typed it correctly and that " | |
879 | - "you haven't activated the \"caps lock\" key")); | |
880 | - gtk_dialog_run (GTK_DIALOG (dialog)); | |
881 | - gtk_widget_destroy (dialog); | |
882 | - } | |
883 | - | |
884 | - priv->timeout_id = 0; | |
885 | - shutdown_backend (applet, FALSE, TRUE); | |
886 | - launch_backend (applet, FALSE); | |
887 | - | |
888 | - return FALSE; | |
889 | - } | |
890 | - | |
891 | - return TRUE; | |
892 | -} | |
893 | - | |
894 | -static void | |
895 | -launch_backend (ModemApplet *applet, gboolean root_auth) | |
896 | -{ | |
897 | - ModemAppletPrivate *priv = MODEM_APPLET_GET_PRIVATE (applet); | |
898 | - gchar *non_auth_args[] = { STB_SCRIPTS_DIR "/network-conf", NULL }; | |
899 | - gchar *auth_args[] = { SU_PATH, "-c", STB_SCRIPTS_DIR "/network-conf", NULL }; | |
900 | - gchar **args; | |
901 | - int p[2]; | |
902 | - | |
903 | - pipe (p); | |
904 | - priv->pid = forkpty (&priv->write_fd, NULL, NULL, NULL); | |
905 | - args = (root_auth) ? auth_args : non_auth_args; | |
906 | - | |
907 | - if (priv->pid < 0) | |
908 | - g_warning ("Could not spawn GST backend"); | |
909 | - else | |
910 | - { | |
911 | - if (priv->pid == 0) | |
912 | - { | |
913 | - /* child process */ | |
914 | - unsetenv("LC_ALL"); | |
915 | - unsetenv("LC_MESSAGES"); | |
916 | - unsetenv("LANG"); | |
917 | - unsetenv("LANGUAGE"); | |
918 | - | |
919 | - dup2 (p[1], 1); | |
920 | - dup2 (p[1], 2); | |
921 | - close (p[0]); | |
922 | - | |
923 | - execv (args[0], args); | |
924 | - exit (255); | |
925 | - } | |
926 | - else | |
927 | - { | |
928 | - close (p[1]); | |
929 | - | |
930 | - priv->read_fd = p[0]; | |
931 | - priv->timeout_id = g_timeout_add (1000, (GSourceFunc) check_backend, applet); | |
932 | - priv->info_id = g_timeout_add (2500, (GSourceFunc) update_info, applet); | |
933 | - priv->read_stream = fdopen (priv->read_fd, "r"); | |
934 | - priv->write_stream = fdopen (priv->write_fd, "w"); | |
935 | - priv->has_root = root_auth; | |
936 | - | |
937 | - setvbuf (priv->read_stream, NULL, _IONBF, 0); | |
938 | - fcntl (priv->read_fd, F_SETFL, 0); | |
939 | - } | |
940 | - } | |
941 | -} | |
942 | - | |
943 | -static gboolean | |
944 | -launch_config_tool (GdkScreen *screen, gboolean is_isdn) | |
945 | +launch_config_tool (GdkScreen *screen, OobsIface *iface) | |
946 | { | |
947 | gchar *argv[4], *application; | |
948 | gboolean ret; | |
949 | @@ -925,8 +367,8 @@ | |
950 | return FALSE; | |
951 | ||
952 | argv[0] = application; | |
953 | - argv[1] = "--configure-type"; | |
954 | - argv[2] = (is_isdn) ? "isdn" : "modem"; | |
955 | + argv[1] = "--configure"; | |
956 | + argv[2] = (gchar*) oobs_iface_get_device_name (iface); | |
957 | argv[3] = NULL; | |
958 | ||
959 | ret = gdk_spawn_on_screen (screen, NULL, argv, NULL, 0, | |
960 | @@ -935,52 +377,48 @@ | |
961 | return ret; | |
962 | } | |
963 | ||
964 | -static void | |
965 | -toggle_interface_non_root (ModemApplet *applet, gboolean enable) | |
966 | +static gboolean | |
967 | +pulse_progressbar (GtkProgressBar *progressbar) | |
968 | { | |
969 | - queue_directive (applet, rerun_backend_callback, | |
970 | - FALSE, "end", NULL); | |
971 | + gtk_progress_bar_pulse (progressbar); | |
972 | + return TRUE; | |
973 | } | |
974 | ||
975 | static void | |
976 | -toggle_interface_root (ModemApplet *applet, gboolean enable) | |
977 | +show_report_window (ModemApplet *applet) | |
978 | { | |
979 | - ModemAppletPrivate *priv = MODEM_APPLET_GET_PRIVATE (applet); | |
980 | - GtkWidget *dialog; | |
981 | - gchar *text; | |
982 | + ModemAppletPrivate *priv; | |
983 | ||
984 | - text = (enable) ? | |
985 | - _("Do you want to connect?") : | |
986 | - _("Do you want to disconnect?"); | |
987 | - | |
988 | - dialog = gtk_message_dialog_new (NULL, | |
989 | - GTK_DIALOG_MODAL, | |
990 | - GTK_MESSAGE_QUESTION, | |
991 | - GTK_BUTTONS_NONE, | |
992 | - text); | |
993 | - gtk_dialog_add_buttons (GTK_DIALOG (dialog), | |
994 | - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, | |
995 | - (enable) ? _("C_onnect") : _("_Disconnect"), | |
996 | - GTK_RESPONSE_OK, NULL); | |
997 | - gtk_window_set_screen (GTK_WINDOW (dialog), | |
998 | - gtk_widget_get_screen (GTK_WIDGET (applet))); | |
999 | - | |
1000 | - if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) | |
1001 | - queue_directive (applet, NULL, enable, | |
1002 | - "enable_iface", priv->dev, (enable) ? "1" : "0", NULL); | |
1003 | + priv = MODEM_APPLET_GET_PRIVATE (applet); | |
1004 | + gtk_widget_show (priv->report_window); | |
1005 | + priv->pulse_id = g_timeout_add (300, (GSourceFunc) pulse_progressbar, priv->report_window_progress); | |
1006 | +} | |
1007 | + | |
1008 | +static void | |
1009 | +hide_report_window (ModemApplet *applet) | |
1010 | +{ | |
1011 | + ModemAppletPrivate *priv; | |
1012 | ||
1013 | - gtk_widget_destroy (dialog); | |
1014 | + priv = MODEM_APPLET_GET_PRIVATE (applet); | |
1015 | + gtk_widget_hide (priv->report_window); | |
1016 | + | |
1017 | + if (priv->pulse_id != 0) | |
1018 | + { | |
1019 | + g_source_remove (priv->pulse_id); | |
1020 | + priv->pulse_id = 0; | |
1021 | + } | |
1022 | } | |
1023 | ||
1024 | static void | |
1025 | -toggle_interface (ModemApplet *applet, gboolean enable) | |
1026 | +on_config_committed (OobsObject *object, | |
1027 | + OobsResult result, | |
1028 | + gpointer data) | |
1029 | { | |
1030 | - ModemAppletPrivate *priv = MODEM_APPLET_GET_PRIVATE (applet); | |
1031 | + ModemApplet *applet = MODEM_APPLET (data); | |
1032 | ||
1033 | - if (priv->has_root) | |
1034 | - toggle_interface_root (applet, enable); | |
1035 | - else | |
1036 | - toggle_interface_non_root (applet, enable); | |
1037 | + hide_report_window (applet); | |
1038 | + gtk_widget_set_sensitive (GTK_WIDGET (applet), FALSE); | |
1039 | + update_popup_buttons (applet); | |
1040 | } | |
1041 | ||
1042 | static void | |
1043 | @@ -988,7 +426,14 @@ | |
1044 | ModemApplet *applet, | |
1045 | const gchar *verb) | |
1046 | { | |
1047 | - toggle_interface (applet, TRUE); | |
1048 | + ModemAppletPrivate *priv; | |
1049 | + | |
1050 | + gtk_widget_set_sensitive (GTK_WIDGET (applet), FALSE); | |
1051 | + show_report_window (applet); | |
1052 | + | |
1053 | + priv = MODEM_APPLET_GET_PRIVATE (applet); | |
1054 | + oobs_iface_set_active (priv->iface, TRUE); | |
1055 | + oobs_object_commit_async (priv->config, on_config_committed, applet); | |
1056 | } | |
1057 | ||
1058 | static void | |
1059 | @@ -996,7 +441,12 @@ | |
1060 | ModemApplet *applet, | |
1061 | const gchar *verb) | |
1062 | { | |
1063 | - toggle_interface (applet, FALSE); | |
1064 | + ModemAppletPrivate *priv; | |
1065 | + | |
1066 | + priv = MODEM_APPLET_GET_PRIVATE (applet); | |
1067 | + oobs_iface_set_active (priv->iface, FALSE); | |
1068 | + gtk_widget_set_sensitive (GTK_WIDGET (applet), FALSE); | |
1069 | + oobs_object_commit_async (priv->config, on_config_committed, applet); | |
1070 | } | |
1071 | ||
1072 | static void | |
1073 | @@ -1010,7 +460,7 @@ | |
1074 | ||
1075 | screen = gtk_widget_get_screen (GTK_WIDGET (applet)); | |
1076 | ||
1077 | - if (!launch_config_tool (screen, priv->is_isdn)) | |
1078 | + if (!launch_config_tool (screen, priv->iface)) | |
1079 | { | |
1080 | dialog = gtk_message_dialog_new (NULL, | |
1081 | GTK_DIALOG_DESTROY_WITH_PARENT, | |
1082 | diff -urN gnome-applets-2.18.0/modemlights/modemlights.glade gnome-applets-2.18.0.new/modemlights/modemlights.glade | |
1083 | --- gnome-applets-2.18.0/modemlights/modemlights.glade 2006-12-31 03:16:08.000000000 +0100 | |
1084 | +++ gnome-applets-2.18.0.new/modemlights/modemlights.glade 2007-06-10 13:08:15.000000000 +0200 | |
1085 | @@ -2,222 +2,6 @@ | |
1086 | <!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> | |
1087 | ||
1088 | <glade-interface> | |
1089 | -<requires lib="gnome"/> | |
1090 | - | |
1091 | -<widget class="GtkDialog" id="auth_dialog"> | |
1092 | - <property name="title" translatable="yes">Enter password</property> | |
1093 | - <property name="type">GTK_WINDOW_TOPLEVEL</property> | |
1094 | - <property name="window_position">GTK_WIN_POS_CENTER</property> | |
1095 | - <property name="modal">True</property> | |
1096 | - <property name="resizable">False</property> | |
1097 | - <property name="destroy_with_parent">False</property> | |
1098 | - <property name="decorated">True</property> | |
1099 | - <property name="skip_taskbar_hint">False</property> | |
1100 | - <property name="skip_pager_hint">False</property> | |
1101 | - <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> | |
1102 | - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> | |
1103 | - <property name="has_separator">False</property> | |
1104 | - | |
1105 | - <child internal-child="vbox"> | |
1106 | - <widget class="GtkVBox" id="dialog-vbox1"> | |
1107 | - <property name="visible">True</property> | |
1108 | - <property name="homogeneous">False</property> | |
1109 | - <property name="spacing">0</property> | |
1110 | - | |
1111 | - <child internal-child="action_area"> | |
1112 | - <widget class="GtkHButtonBox" id="dialog-action_area1"> | |
1113 | - <property name="visible">True</property> | |
1114 | - <property name="layout_style">GTK_BUTTONBOX_END</property> | |
1115 | - | |
1116 | - <child> | |
1117 | - <widget class="GtkButton" id="cancelbutton1"> | |
1118 | - <property name="visible">True</property> | |
1119 | - <property name="can_default">True</property> | |
1120 | - <property name="can_focus">True</property> | |
1121 | - <property name="label">gtk-cancel</property> | |
1122 | - <property name="use_stock">True</property> | |
1123 | - <property name="relief">GTK_RELIEF_NORMAL</property> | |
1124 | - <property name="focus_on_click">True</property> | |
1125 | - <property name="response_id">-6</property> | |
1126 | - </widget> | |
1127 | - </child> | |
1128 | - | |
1129 | - <child> | |
1130 | - <widget class="GtkButton" id="okbutton1"> | |
1131 | - <property name="visible">True</property> | |
1132 | - <property name="can_default">True</property> | |
1133 | - <property name="has_default">True</property> | |
1134 | - <property name="can_focus">True</property> | |
1135 | - <property name="label">gtk-ok</property> | |
1136 | - <property name="use_stock">True</property> | |
1137 | - <property name="relief">GTK_RELIEF_NORMAL</property> | |
1138 | - <property name="focus_on_click">True</property> | |
1139 | - <property name="response_id">-5</property> | |
1140 | - </widget> | |
1141 | - </child> | |
1142 | - </widget> | |
1143 | - <packing> | |
1144 | - <property name="padding">0</property> | |
1145 | - <property name="expand">False</property> | |
1146 | - <property name="fill">True</property> | |
1147 | - <property name="pack_type">GTK_PACK_END</property> | |
1148 | - </packing> | |
1149 | - </child> | |
1150 | - | |
1151 | - <child> | |
1152 | - <widget class="GtkHBox" id="hbox1"> | |
1153 | - <property name="border_width">7</property> | |
1154 | - <property name="visible">True</property> | |
1155 | - <property name="homogeneous">False</property> | |
1156 | - <property name="spacing">12</property> | |
1157 | - | |
1158 | - <child> | |
1159 | - <widget class="GtkImage" id="image1"> | |
1160 | - <property name="visible">True</property> | |
1161 | - <property name="stock">gnome-stock-authentication</property> | |
1162 | - <property name="icon_size">6</property> | |
1163 | - <property name="xalign">0</property> | |
1164 | - <property name="yalign">0</property> | |
1165 | - <property name="xpad">0</property> | |
1166 | - <property name="ypad">0</property> | |
1167 | - </widget> | |
1168 | - <packing> | |
1169 | - <property name="padding">0</property> | |
1170 | - <property name="expand">False</property> | |
1171 | - <property name="fill">False</property> | |
1172 | - </packing> | |
1173 | - </child> | |
1174 | - | |
1175 | - <child> | |
1176 | - <widget class="GtkVBox" id="vbox1"> | |
1177 | - <property name="visible">True</property> | |
1178 | - <property name="homogeneous">False</property> | |
1179 | - <property name="spacing">6</property> | |
1180 | - | |
1181 | - <child> | |
1182 | - <widget class="GtkLabel" id="label1"> | |
1183 | - <property name="visible">True</property> | |
1184 | - <property name="label" translatable="yes"><span weight="bold" size="larger">Root password required</span></property> | |
1185 | - <property name="use_underline">False</property> | |
1186 | - <property name="use_markup">True</property> | |
1187 | - <property name="justify">GTK_JUSTIFY_LEFT</property> | |
1188 | - <property name="wrap">False</property> | |
1189 | - <property name="selectable">False</property> | |
1190 | - <property name="xalign">0</property> | |
1191 | - <property name="yalign">0.5</property> | |
1192 | - <property name="xpad">0</property> | |
1193 | - <property name="ypad">0</property> | |
1194 | - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> | |
1195 | - <property name="width_chars">-1</property> | |
1196 | - <property name="single_line_mode">False</property> | |
1197 | - <property name="angle">0</property> | |
1198 | - </widget> | |
1199 | - <packing> | |
1200 | - <property name="padding">0</property> | |
1201 | - <property name="expand">False</property> | |
1202 | - <property name="fill">False</property> | |
1203 | - </packing> | |
1204 | - </child> | |
1205 | - | |
1206 | - <child> | |
1207 | - <widget class="GtkLabel" id="auth_dialog_label"> | |
1208 | - <property name="visible">True</property> | |
1209 | - <property name="can_focus">True</property> | |
1210 | - <property name="label" translatable="yes"></property> | |
1211 | - <property name="use_underline">False</property> | |
1212 | - <property name="use_markup">False</property> | |
1213 | - <property name="justify">GTK_JUSTIFY_LEFT</property> | |
1214 | - <property name="wrap">True</property> | |
1215 | - <property name="selectable">True</property> | |
1216 | - <property name="xalign">0</property> | |
1217 | - <property name="yalign">0.5</property> | |
1218 | - <property name="xpad">0</property> | |
1219 | - <property name="ypad">0</property> | |
1220 | - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> | |
1221 | - <property name="width_chars">-1</property> | |
1222 | - <property name="single_line_mode">False</property> | |
1223 | - <property name="angle">0</property> | |
1224 | - </widget> | |
1225 | - <packing> | |
1226 | - <property name="padding">0</property> | |
1227 | - <property name="expand">False</property> | |
1228 | - <property name="fill">False</property> | |
1229 | - </packing> | |
1230 | - </child> | |
1231 | - | |
1232 | - <child> | |
1233 | - <widget class="GtkHBox" id="hbox2"> | |
1234 | - <property name="visible">True</property> | |
1235 | - <property name="homogeneous">False</property> | |
1236 | - <property name="spacing">12</property> | |
1237 | - | |
1238 | - <child> | |
1239 | - <widget class="GtkLabel" id="label3"> | |
1240 | - <property name="visible">True</property> | |
1241 | - <property name="label" translatable="yes">Password:</property> | |
1242 | - <property name="use_underline">False</property> | |
1243 | - <property name="use_markup">False</property> | |
1244 | - <property name="justify">GTK_JUSTIFY_LEFT</property> | |
1245 | - <property name="wrap">False</property> | |
1246 | - <property name="selectable">False</property> | |
1247 | - <property name="xalign">0.5</property> | |
1248 | - <property name="yalign">0.5</property> | |
1249 | - <property name="xpad">0</property> | |
1250 | - <property name="ypad">0</property> | |
1251 | - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> | |
1252 | - <property name="width_chars">-1</property> | |
1253 | - <property name="single_line_mode">False</property> | |
1254 | - <property name="angle">0</property> | |
1255 | - </widget> | |
1256 | - <packing> | |
1257 | - <property name="padding">0</property> | |
1258 | - <property name="expand">False</property> | |
1259 | - <property name="fill">False</property> | |
1260 | - </packing> | |
1261 | - </child> | |
1262 | - | |
1263 | - <child> | |
1264 | - <widget class="GtkEntry" id="auth_dialog_entry"> | |
1265 | - <property name="visible">True</property> | |
1266 | - <property name="can_focus">True</property> | |
1267 | - <property name="editable">True</property> | |
1268 | - <property name="visibility">False</property> | |
1269 | - <property name="max_length">0</property> | |
1270 | - <property name="text" translatable="yes"></property> | |
1271 | - <property name="has_frame">True</property> | |
1272 | - <property name="invisible_char">*</property> | |
1273 | - <property name="activates_default">True</property> | |
1274 | - </widget> | |
1275 | - <packing> | |
1276 | - <property name="padding">0</property> | |
1277 | - <property name="expand">True</property> | |
1278 | - <property name="fill">True</property> | |
1279 | - </packing> | |
1280 | - </child> | |
1281 | - </widget> | |
1282 | - <packing> | |
1283 | - <property name="padding">0</property> | |
1284 | - <property name="expand">False</property> | |
1285 | - <property name="fill">False</property> | |
1286 | - </packing> | |
1287 | - </child> | |
1288 | - </widget> | |
1289 | - <packing> | |
1290 | - <property name="padding">0</property> | |
1291 | - <property name="expand">True</property> | |
1292 | - <property name="fill">True</property> | |
1293 | - </packing> | |
1294 | - </child> | |
1295 | - </widget> | |
1296 | - <packing> | |
1297 | - <property name="padding">0</property> | |
1298 | - <property name="expand">False</property> | |
1299 | - <property name="fill">False</property> | |
1300 | - </packing> | |
1301 | - </child> | |
1302 | - </widget> | |
1303 | - </child> | |
1304 | -</widget> | |
1305 | ||
1306 | <widget class="GtkWindow" id="report_window"> | |
1307 | <property name="title" translatable="yes"></property> | |
1308 | @@ -231,6 +15,8 @@ | |
1309 | <property name="skip_pager_hint">False</property> | |
1310 | <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> | |
1311 | <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> | |
1312 | + <property name="focus_on_map">True</property> | |
1313 | + <property name="urgency_hint">False</property> | |
1314 | ||
1315 | <child> | |
1316 | <widget class="GtkHBox" id="hbox3"> |