~ubuntu-branches/ubuntu/maverick/gnome-system-tools/maverick-proposed

« back to all changes in this revision

Viewing changes to debian/patches/10_disable_interfaces.patch

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2010-08-23 17:04:08 UTC
  • Revision ID: james.westby@ubuntu.com-20100823170408-9pi3bj1orrf3r8u1
Tags: 2.30.2-1ubuntu4
* Fix LP: #570828 - gnome-network-admin on UbuntuStudio doesnt allow 
  to configure either wired networks or wireless. Expose the
  connections tab and locations combo box on derivatives that don't use
  Network Manager
  - update debian/patches/10_disable_interfaces.patch
* Fix LP: #529744 - When creating a new user, "Shortname" should 
  really be "Username" 
  - add debian/patches/12_users_string_change.patch
  - update debian/patches/series

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
--- a/interfaces/network.ui
2
2
+++ b/interfaces/network.ui
3
 
@@ -86,147 +86,10 @@
4
 
         <property name="border_width">6</property>
 
3
@@ -87,7 +87,7 @@
5
4
         <property name="spacing">12</property>
6
5
         <child>
7
 
-          <object class="GtkHBox" id="locations_box">
 
6
           <object class="GtkHBox" id="locations_box">
8
7
-            <property name="visible">True</property>
9
 
-            <property name="spacing">6</property>
10
 
-            <child>
11
 
-              <object class="GtkLabel" id="label2">
12
 
-                <property name="visible">True</property>
13
 
-                <property name="label" translatable="yes">Location:</property>
14
 
-              </object>
15
 
-              <packing>
16
 
-                <property name="expand">False</property>
17
 
-                <property name="fill">False</property>
18
 
-                <property name="position">0</property>
19
 
-              </packing>
20
 
-            </child>
21
 
-            <child>
22
 
-              <object class="GtkComboBox" id="locations_combo">
23
 
-                <property name="visible">True</property>
24
 
-              </object>
25
 
-              <packing>
26
 
-                <property name="position">1</property>
27
 
-              </packing>
28
 
-            </child>
29
 
-            <child>
30
 
-              <object class="GtkButton" id="add_location">
31
 
-                <property name="visible">True</property>
32
 
-                <property name="can_focus">True</property>
33
 
-                <property name="receives_default">False</property>
34
 
-                <property name="tooltip_text" translatable="yes">Save current network configuration as a location</property>
35
 
-                <accelerator key="A" signal="clicked" modifiers="GDK_MOD1_MASK"/>
36
 
-                <child>
37
 
-                  <object class="GtkImage" id="image9">
38
 
-                    <property name="visible">True</property>
39
 
-                    <property name="stock">gtk-save</property>
40
 
-                  </object>
41
 
-                </child>
42
 
-              </object>
43
 
-              <packing>
44
 
-                <property name="expand">False</property>
45
 
-                <property name="fill">False</property>
46
 
-                <property name="position">2</property>
47
 
-              </packing>
48
 
-            </child>
49
 
-            <child>
50
 
-              <object class="GtkButton" id="remove_location">
51
 
-                <property name="visible">True</property>
52
 
-                <property name="can_focus">True</property>
53
 
-                <property name="receives_default">False</property>
54
 
-                <property name="tooltip_text" translatable="yes">Delete current location</property>
55
 
-                <accelerator key="R" signal="clicked" modifiers="GDK_MOD1_MASK"/>
56
 
-                <child>
57
 
-                  <object class="GtkImage" id="image10">
58
 
-                    <property name="visible">True</property>
59
 
-                    <property name="stock">gtk-delete</property>
60
 
-                  </object>
61
 
-                </child>
62
 
-              </object>
63
 
-              <packing>
64
 
-                <property name="expand">False</property>
65
 
-                <property name="fill">False</property>
66
 
-                <property name="position">3</property>
67
 
-              </packing>
68
 
-            </child>
69
 
-          </object>
70
 
-          <packing>
71
 
-            <property name="expand">False</property>
72
 
-            <property name="fill">False</property>
73
 
-            <property name="position">0</property>
74
 
-          </packing>
75
 
-        </child>
76
 
-        <child>
77
 
           <object class="GtkNotebook" id="notebook1">
78
 
             <property name="visible">True</property>
 
8
+            <property name="visible">False</property>
 
9
             <property name="spacing">6</property>
 
10
             <child>
 
11
               <object class="GtkLabel" id="label2">
 
12
@@ -161,7 +161,7 @@
79
13
             <property name="can_focus">True</property>
80
14
             <child>
81
 
-              <object class="GtkHBox" id="hbox3">
82
 
-                <property name="visible">True</property>
83
 
-                <property name="border_width">12</property>
84
 
-                <property name="spacing">6</property>
85
 
-                <child>
86
 
-                  <object class="GtkScrolledWindow" id="scrolledwindow1">
87
 
-                    <property name="visible">True</property>
88
 
-                    <property name="can_focus">True</property>
89
 
-                    <property name="hscrollbar_policy">automatic</property>
90
 
-                    <property name="vscrollbar_policy">automatic</property>
91
 
-                    <property name="shadow_type">in</property>
92
 
-                    <child>
93
 
-                      <object class="GtkTreeView" id="interfaces_list">
94
 
-                        <property name="width_request">290</property>
95
 
-                        <property name="height_request">194</property>
96
 
-                        <property name="visible">True</property>
97
 
-                        <property name="can_focus">True</property>
98
 
-                        <property name="headers_visible">False</property>
99
 
-                        <property name="rules_hint">True</property>
100
 
-                        <property name="enable_search">False</property>
101
 
-                      </object>
102
 
-                    </child>
103
 
-                  </object>
104
 
-                  <packing>
105
 
-                    <property name="position">0</property>
106
 
-                  </packing>
107
 
-                </child>
108
 
-                <child>
109
 
-                  <object class="GtkVButtonBox" id="vbuttonbox1">
110
 
-                    <property name="visible">True</property>
111
 
-                    <property name="spacing">6</property>
112
 
-                    <property name="layout_style">start</property>
113
 
-                    <child>
114
 
-                      <object class="GtkButton" id="properties_button">
115
 
-                        <property name="label">gtk-properties</property>
116
 
-                        <property name="visible">True</property>
117
 
-                        <property name="sensitive">False</property>
118
 
-                        <property name="can_focus">True</property>
119
 
-                        <property name="can_default">True</property>
120
 
-                        <property name="receives_default">False</property>
121
 
-                        <property name="use_stock">True</property>
122
 
-                      </object>
123
 
-                      <packing>
124
 
-                        <property name="expand">False</property>
125
 
-                        <property name="fill">False</property>
126
 
-                        <property name="position">0</property>
127
 
-                      </packing>
128
 
-                    </child>
129
 
-                  </object>
130
 
-                  <packing>
131
 
-                    <property name="expand">False</property>
132
 
-                    <property name="fill">False</property>
133
 
-                    <property name="position">1</property>
134
 
-                  </packing>
135
 
-                </child>
136
 
-              </object>
137
 
-            </child>
138
 
-            <child type="tab">
139
 
-              <object class="GtkLabel" id="label3">
140
 
-                <property name="visible">True</property>
141
 
-                <property name="label" translatable="yes">Connections</property>
142
 
-              </object>
143
 
-              <packing>
144
 
-                <property name="tab_fill">False</property>
145
 
-              </packing>
146
 
-            </child>
147
 
-            <child>
148
 
               <object class="GtkFrame" id="frame3">
149
 
                 <property name="visible">True</property>
 
15
               <object class="GtkHBox" id="hbox3">
 
16
-                <property name="visible">True</property>
 
17
+                <property name="visible">False</property>
150
18
                 <property name="border_width">12</property>
151
 
--- a/configure.in
152
 
+++ b/configure.in
153
 
@@ -285,23 +285,6 @@
154
 
 dnl END: GIO
155
 
 dnl ==================================
156
 
 
157
 
-dnl ==================================
158
 
-dnl LIBIW DETECTION
159
 
-dnl ==================================
160
 
-
161
 
-GST_IW_LIBS=
162
 
-AC_CHECK_HEADER(iwlib.h, [
163
 
-  enable_libiw=yes
164
 
-  AC_DEFINE(HAVE_LIBIW_H, "", [whether libiw is available])
165
 
-  AC_HAVE_LIBRARY(iw, [GST_IW_LIBS="-liw"])
166
 
-])
167
 
-AM_CONDITIONAL(HAVE_LIBIW_H, test x$enable_libiw = xyes)
168
 
-AC_SUBST(GST_IW_LIBS)
169
 
-
170
 
-dnl ==================================
171
 
-dnl END: LIBIW DETECTION
172
 
-dnl ==================================
173
 
-
174
 
 dnl ===========================
175
 
 dnl NAUTILUS EXTENSION
176
 
 dnl ===========================
177
 
--- a/src/network/Makefile.am
178
 
+++ b/src/network/Makefile.am
179
 
@@ -15,23 +15,14 @@
180
 
 CLEANFILES = $(GST_TOOL_CLEANFILES)
181
 
 EXTRA_DIST = $(GST_TOOL_EXTRA_DIST)
182
 
 
183
 
-network_admin_LDADD = $(GST_TOOL_LIBS) $(GST_IW_LIBS) $(DBUS_LIBS) $(GIO_LIBS)
184
 
+network_admin_LDADD = $(GST_TOOL_LIBS) $(DBUS_LIBS) $(GIO_LIBS)
185
 
 network_admin_DEPENDENCIES = $(GST_TOOL_DEPENDENCIES)
186
 
 
187
 
-if HAVE_LIBIW_H
188
 
-essid_SOURCES = essid-list.c essid-list.h
189
 
-endif
190
 
-
191
 
 network_admin_SOURCES = \
192
 
        $(essid_SOURCES)                                \
193
 
-       nm-integration.c nm-integration.h       \
194
 
        address-list.c  address-list.h          \
195
 
-       network-locations.c network-locations.h \
196
 
        network-tool.c network-tool.h           \
197
 
-       locations-combo.c locations-combo.h     \
198
 
-       ifaces-list.c ifaces-list.h             \
199
 
        callbacks.c callbacks.h                 \
200
 
-       connection.c connection.h               \
201
 
        hosts.c hosts.h                         \
202
 
        main.c
203
 
 
204
 
--- a/src/network/callbacks.c
205
 
+++ b/src/network/callbacks.c
206
 
@@ -22,294 +22,11 @@
207
 
 
208
 
 #include "gst.h"
209
 
 #include "network-tool.h"
210
 
-#include "ifaces-list.h"
211
 
 #include "callbacks.h"
212
 
 #include "hosts.h"
213
 
-#include "nm-integration.h"
214
 
-#include "connection.h"
215
 
 
216
 
 extern GstTool *tool;
217
 
 
218
 
-void
219
 
-on_table_selection_changed (GtkTreeSelection *selection, gpointer data)
220
 
-{
221
 
-  GtkWidget    *properties;
222
 
-
223
 
-  properties = gst_dialog_get_widget (tool->main_dialog, "properties_button");
224
 
-  gtk_widget_set_sensitive (properties, gtk_tree_selection_get_selected_rows (selection, NULL) != 0);
225
 
-}
226
 
-
227
 
-void
228
 
-on_iface_properties_clicked (GtkWidget *widget, gpointer data)
229
 
-{
230
 
-  GstConnectionDialog *dialog;
231
 
-  GtkTreeSelection *selection;
232
 
-  GtkTreeModel *model;
233
 
-  GtkTreeIter iter;
234
 
-  OobsIface *iface;
235
 
-
236
 
-  selection = gtk_tree_view_get_selection (GST_NETWORK_TOOL (tool)->interfaces_list);
237
 
-
238
 
-  if (gtk_tree_selection_get_selected (selection, &model, &iter))
239
 
-    {
240
 
-      gtk_tree_model_get (model, &iter,
241
 
-                         COL_OBJECT, &iface,
242
 
-                         -1);
243
 
-
244
 
-      dialog = GST_NETWORK_TOOL (tool)->dialog;
245
 
-      connection_dialog_prepare (dialog, iface);
246
 
-      gtk_window_set_transient_for (GTK_WINDOW (dialog->dialog), GTK_WINDOW (tool->main_dialog));
247
 
-
248
 
-      gst_dialog_add_edit_dialog (tool->main_dialog, dialog->dialog);
249
 
-      gtk_widget_show (dialog->dialog);
250
 
-    }
251
 
-}
252
 
-
253
 
-void
254
 
-on_iface_active_changed (GtkWidget *widget, gpointer data)
255
 
-{
256
 
-  GstConnectionDialog *dialog;
257
 
-  GtkWidget *roaming_active;
258
 
-  gboolean active;
259
 
-
260
 
-  dialog = GST_NETWORK_TOOL (tool)->dialog;
261
 
-  active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
262
 
-
263
 
-  connection_dialog_set_sensitive (dialog, active);
264
 
-
265
 
-  roaming_active = gst_dialog_get_widget (tool->main_dialog, "connection_device_roaming");
266
 
-  g_signal_handlers_block_by_func (roaming_active, on_iface_roaming_changed, data);
267
 
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (roaming_active), !active);
268
 
-  g_signal_handlers_unblock_by_func (roaming_active, on_iface_roaming_changed, data);
269
 
-}
270
 
-
271
 
-void
272
 
-on_iface_roaming_changed (GtkWidget *widget, gpointer data)
273
 
-{
274
 
-  GstConnectionDialog *dialog;
275
 
-  GtkWidget *device_active;
276
 
-  gboolean active;
277
 
-
278
 
-  dialog = GST_NETWORK_TOOL (tool)->dialog;
279
 
-  active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
280
 
-
281
 
-  /* roaming changed and device active have just inverted logics */
282
 
-  connection_dialog_set_sensitive (dialog, !active);
283
 
-
284
 
-  device_active = gst_dialog_get_widget (tool->main_dialog, "connection_device_active");
285
 
-  g_signal_handlers_block_by_func (device_active, on_iface_active_changed, data);
286
 
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (device_active), !active);
287
 
-  g_signal_handlers_unblock_by_func (device_active, on_iface_active_changed, data);
288
 
-}
289
 
-
290
 
-void
291
 
-on_bootproto_changed (GtkWidget *widget, gpointer data)
292
 
-{
293
 
-  GstConnectionDialog *dialog;
294
 
-  gchar *method;
295
 
-  gboolean enabled;
296
 
-
297
 
-  dialog = GST_NETWORK_TOOL (tool)->dialog;
298
 
-  method = connection_combo_get_value (GTK_COMBO_BOX (dialog->bootproto_combo));
299
 
-  enabled = (method && strcmp (method, "static") == 0);
300
 
-
301
 
-  gtk_widget_set_sensitive (dialog->address, enabled);
302
 
-  gtk_widget_set_sensitive (dialog->netmask, enabled);
303
 
-  gtk_widget_set_sensitive (dialog->gateway, enabled);
304
 
-
305
 
-  g_free (method);
306
 
-}
307
 
-
308
 
-void
309
 
-on_ppp_type_changed (GtkWidget *widget, gpointer data)
310
 
-{
311
 
-  GstConnectionDialog *dialog;
312
 
-  gchar *type;
313
 
-
314
 
-  dialog = GST_NETWORK_TOOL (tool)->dialog;
315
 
-  type = connection_combo_get_value (GTK_COMBO_BOX (dialog->ppp_type_combo));
316
 
-
317
 
-  on_dialog_changed (widget, data);
318
 
-
319
 
-  if (!type)
320
 
-    return;
321
 
-
322
 
-  if (strcmp (type, "modem") == 0)
323
 
-    {
324
 
-      gtk_widget_show (dialog->modem_page);
325
 
-      gtk_widget_show (dialog->isp_frame);
326
 
-      gtk_widget_show (dialog->modem_settings_table);
327
 
-      gtk_widget_show (dialog->modem_isp_table);
328
 
-      gtk_widget_hide (dialog->pppoe_settings_table);
329
 
-      gtk_widget_hide (dialog->gprs_isp_table);
330
 
-    }
331
 
-  else if (strcmp (type, "isdn") == 0)
332
 
-    {
333
 
-      gtk_widget_show (dialog->isp_frame);
334
 
-      gtk_widget_show (dialog->modem_isp_table);
335
 
-      gtk_widget_hide (dialog->modem_page);
336
 
-      gtk_widget_hide (dialog->gprs_isp_table);
337
 
-    }
338
 
-  else if (strcmp (type, "pppoe") == 0)
339
 
-    {
340
 
-      gtk_widget_show (dialog->modem_page);
341
 
-      gtk_widget_show (dialog->pppoe_settings_table);
342
 
-      gtk_widget_show (dialog->modem_isp_table);
343
 
-      gtk_widget_hide (dialog->isp_frame);
344
 
-      gtk_widget_hide (dialog->modem_settings_table);
345
 
-    }
346
 
-  else if (strcmp (type, "gprs") == 0)
347
 
-    {
348
 
-      gtk_widget_show (dialog->modem_page);
349
 
-      gtk_widget_show (dialog->isp_frame);
350
 
-      gtk_widget_show (dialog->modem_settings_table);
351
 
-      gtk_widget_show (dialog->gprs_isp_table);
352
 
-      gtk_widget_hide (dialog->modem_isp_table);
353
 
-      gtk_widget_hide (dialog->pppoe_settings_table);
354
 
-    }
355
 
-}
356
 
-
357
 
-static void
358
 
-cancel_connection_dialog (GstTool *tool)
359
 
-{
360
 
-  GstConnectionDialog *dialog;
361
 
-
362
 
-  dialog = GST_NETWORK_TOOL (tool)->dialog;
363
 
-  g_object_unref (dialog->iface);
364
 
-  connection_dialog_hide (dialog);
365
 
-
366
 
-  if (dialog->standalone)
367
 
-    gtk_main_quit ();
368
 
-}
369
 
-
370
 
-static gboolean
371
 
-toggle_nm (gpointer data)
372
 
-{
373
 
-  GstNetworkTool *tool = GST_NETWORK_TOOL (data);
374
 
-  NMState state;
375
 
-
376
 
-  state = nm_integration_get_state (tool);
377
 
-
378
 
-  if (state == NM_STATE_DISCONNECTED ||
379
 
-      state == NM_STATE_CONNECTING ||
380
 
-      state == NM_STATE_CONNECTED)
381
 
-    {
382
 
-      /* "reboot" NM */
383
 
-      nm_integration_sleep (tool);
384
 
-      nm_integration_wake (tool);
385
 
-    }
386
 
-
387
 
-  return FALSE;
388
 
-}
389
 
-
390
 
-static void
391
 
-on_configuration_changed (OobsObject *object,
392
 
-                         OobsResult  result,
393
 
-                         gpointer    data)
394
 
-{
395
 
-  /* suckety suck, but NM seems not to realize
396
 
-   * immediately that the interface status changed */
397
 
-  g_timeout_add (2000, toggle_nm, data);
398
 
-}
399
 
-
400
 
-static void
401
 
-accept_connection_dialog (GstTool *tool)
402
 
-{
403
 
-  GstConnectionDialog *dialog;
404
 
-  GtkTreeSelection    *selection;
405
 
-  GtkTreeIter          iter;
406
 
-
407
 
-  dialog = GST_NETWORK_TOOL (tool)->dialog;
408
 
-  connection_dialog_hide (dialog);
409
 
-
410
 
-  if (dialog->changed)
411
 
-    {
412
 
-      connection_save (dialog);
413
 
-      selection = gtk_tree_view_get_selection (GST_NETWORK_TOOL (tool)->interfaces_list);
414
 
-
415
 
-      if (gtk_tree_selection_get_selected (selection, NULL, &iter))
416
 
-        {
417
 
-         ifaces_model_modify_interface_at_iter (&iter);
418
 
-         g_signal_emit_by_name (G_OBJECT (selection), "changed");
419
 
-       }
420
 
-
421
 
-      gst_tool_commit_async (tool, OOBS_OBJECT (GST_NETWORK_TOOL (tool)->ifaces_config),
422
 
-                            _("Changing interface configuration"),
423
 
-                            on_configuration_changed, tool);
424
 
-    }
425
 
-
426
 
-  g_object_unref (dialog->iface);
427
 
-
428
 
-  if (dialog->standalone)
429
 
-    gtk_main_quit ();
430
 
-}
431
 
-
432
 
-void
433
 
-on_connection_response (GtkWidget *widget,
434
 
-                       gint       response,
435
 
-                       gpointer   data)
436
 
-{
437
 
-  GstConnectionDialog *connection_dialog;
438
 
-  GstDialog *dialog = GST_DIALOG (data);
439
 
-  GstTool *tool = gst_dialog_get_tool (dialog);
440
 
-
441
 
-  if (response == GTK_RESPONSE_OK)
442
 
-    accept_connection_dialog (tool);
443
 
-  else
444
 
-    cancel_connection_dialog (tool);
445
 
-
446
 
-  connection_dialog = GST_NETWORK_TOOL (tool)->dialog;
447
 
-  gst_dialog_remove_edit_dialog (tool->main_dialog, connection_dialog->dialog);
448
 
-}
449
 
-
450
 
-void
451
 
-on_detect_modem_clicked (GtkWidget *widget, gpointer data)
452
 
-{
453
 
-  GstNetworkTool      *network_tool;
454
 
-  GstConnectionDialog *dialog;
455
 
-  GtkWidget           *d;
456
 
-  GdkCursor           *cursor;
457
 
-  gchar               *dev = NULL;
458
 
-
459
 
-  network_tool = GST_NETWORK_TOOL (tool);
460
 
-  dialog = network_tool->dialog;
461
 
-
462
 
-  /* give some feedback to let know the user that the tool is busy */
463
 
-  gtk_entry_set_text (GTK_ENTRY (GTK_BIN (GTK_COMBO_BOX (dialog->serial_port))->child), "");
464
 
-  gtk_widget_set_sensitive (dialog->serial_port, FALSE);
465
 
-  gtk_widget_set_sensitive (dialog->detect_modem, FALSE);
466
 
-
467
 
-  cursor = gdk_cursor_new (GDK_WATCH);
468
 
-  gdk_window_set_cursor (GTK_WIDGET (dialog->dialog)->window, cursor);
469
 
-  gdk_cursor_unref (cursor);
470
 
-
471
 
-  dev = connection_detect_modem ();
472
 
-
473
 
-  /* remove the user feedback */
474
 
-  gtk_widget_set_sensitive (dialog->detect_modem, TRUE);
475
 
-  gtk_widget_set_sensitive (dialog->serial_port, TRUE);
476
 
-  gdk_window_set_cursor (GTK_WIDGET (dialog->dialog)->window, NULL);
477
 
-
478
 
-  if (!dev || !*dev)
479
 
-    {
480
 
-      d = gtk_message_dialog_new (GTK_WINDOW (dialog->dialog),
481
 
-                                 GTK_DIALOG_MODAL,
482
 
-                                 GTK_MESSAGE_INFO,
483
 
-                                 GTK_BUTTONS_CLOSE,
484
 
-                                 _("Could not autodetect modem device"),
485
 
-                                 NULL);
486
 
-      gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (d),
487
 
-                                               _("Check that the device is not busy and "
488
 
-                                                 "that is correctly attached to the computer."),
489
 
-                                               NULL);
490
 
-      gtk_dialog_run (GTK_DIALOG (d));
491
 
-      gtk_widget_destroy (d);
492
 
-    }
493
 
-  else
494
 
-    gtk_entry_set_text (GTK_ENTRY (GTK_BIN (GTK_COMBO_BOX (dialog->serial_port))->child), dev);
495
 
-
496
 
-  g_free (dev);
497
 
-}
498
 
 
499
 
 static void
500
 
 do_popup_menu (GtkWidget *table, GstTablePopup *table_popup, GdkEventButton *event)
501
 
@@ -437,64 +154,6 @@
502
 
 }
503
 
 
504
 
 void
505
 
-on_dialog_changed (GtkWidget *widget, gpointer data)
506
 
-{
507
 
-  GstNetworkTool *network_tool = GST_NETWORK_TOOL (tool);
508
 
-
509
 
-  network_tool->dialog->changed = TRUE;
510
 
-  connection_check_fields (network_tool->dialog);
511
 
-}
512
 
-
513
 
-gboolean
514
 
-on_ip_address_focus_out (GtkWidget *widget, GdkEventFocus *event, gpointer data)
515
 
-{
516
 
-  GstConnectionDialog *dialog = GST_NETWORK_TOOL (tool)->dialog;
517
 
-
518
 
-  connection_check_netmask (dialog->address, dialog->netmask);
519
 
-  return FALSE;
520
 
-}
521
 
-
522
 
-void
523
 
-on_iface_toggled (GtkCellRendererToggle *renderer,
524
 
-                 gchar                 *path_str,
525
 
-                 gpointer               data)
526
 
-{
527
 
-  GtkTreePath *path;
528
 
-  GtkTreeModel *model = GTK_TREE_MODEL (data);
529
 
-  GtkTreeIter iter;
530
 
-  gboolean active, inconsistent;
531
 
-  OobsIface *iface;
532
 
-
533
 
-  path = gtk_tree_path_new_from_string (path_str);
534
 
-
535
 
-  if (gtk_tree_model_get_iter (model, &iter, path))
536
 
-    {
537
 
-      gtk_tree_model_get (model, &iter,
538
 
-                         COL_ACTIVE, &active,
539
 
-                         COL_INCONSISTENT, &inconsistent,
540
 
-                         COL_OBJECT, &iface,
541
 
-                         -1);
542
 
-
543
 
-      if (!inconsistent)
544
 
-       {
545
 
-         active ^= 1;
546
 
-
547
 
-         oobs_iface_set_active (iface, active);
548
 
-         oobs_iface_set_auto (iface, active);
549
 
-         ifaces_model_modify_interface_at_iter (&iter);
550
 
-
551
 
-         gst_tool_commit_async (tool, OOBS_OBJECT (GST_NETWORK_TOOL (tool)->ifaces_config),
552
 
-                                _("Changing interface configuration"),
553
 
-                                on_configuration_changed, tool);
554
 
-       }
555
 
-
556
 
-      g_object_unref (iface);
557
 
-    }
558
 
-
559
 
-  gtk_tree_path_free (path);
560
 
-}
561
 
-
562
 
-void
563
 
 on_entry_changed (GtkWidget *widget, gpointer data)
564
 
 {
565
 
   g_object_set_data (G_OBJECT (widget), "content-changed", GINT_TO_POINTER (TRUE));
566
 
--- a/src/network/callbacks.h
567
 
+++ b/src/network/callbacks.h
568
 
@@ -30,19 +30,6 @@
569
 
   GtkWidget *popup;
570
 
 };
571
 
 
572
 
-void  on_table_selection_changed   (GtkTreeSelection*, gpointer);
573
 
-void  on_iface_properties_clicked  (GtkWidget*, gpointer);
574
 
-
575
 
-void  on_iface_active_changed      (GtkWidget*, gpointer);
576
 
-void  on_iface_roaming_changed     (GtkWidget *widget, gpointer data);
577
 
-
578
 
-void  on_bootproto_changed         (GtkWidget*, gpointer);
579
 
-void  on_detect_modem_clicked      (GtkWidget*, gpointer);
580
 
-void  on_connection_response       (GtkWidget *widget,
581
 
-                                   gint       response,
582
 
-                                   gpointer   data);
583
 
-
584
 
-
585
 
 gboolean on_table_button_press (GtkWidget*, GdkEventButton*, gpointer);
586
 
 gboolean on_table_popup_menu   (GtkWidget*, gpointer);
587
 
 
588
 
@@ -52,14 +39,6 @@
589
 
 void  on_host_aliases_dialog_changed     (GtkWidget*, gpointer);
590
 
 
591
 
 
592
 
-void  on_dialog_changed (GtkWidget*, gpointer);
593
 
-
594
 
-gboolean on_ip_address_focus_out (GtkWidget*, GdkEventFocus*, gpointer);
595
 
-
596
 
-void  on_iface_toggled  (GtkCellRendererToggle *renderer,
597
 
-                        gchar                 *path_str,
598
 
-                        gpointer               data);
599
 
-
600
 
 void     on_entry_changed      (GtkWidget     *widget,
601
 
                                gpointer       data);
602
 
 gboolean on_hostname_focus_out (GtkWidget     *widget,
603
 
--- a/src/network/main.c
604
 
+++ b/src/network/main.c
605
 
@@ -27,14 +27,11 @@
606
 
 
607
 
 #include "gst.h"
608
 
 #include "network-tool.h"
609
 
-#include "ifaces-list.h"
610
 
 #include "callbacks.h"
611
 
 
612
 
 GstTool *tool;
613
 
 
614
 
 static GstDialogSignal signals[] = {
615
 
-  /* connections tab */
616
 
-  { "properties_button",            "clicked", G_CALLBACK (on_iface_properties_clicked) },
617
 
   /* general tab */
618
 
   { "domain",                       "focus-out-event", G_CALLBACK (on_domain_focus_out) },
619
 
   { "hostname",                     "changed", G_CALLBACK (on_entry_changed) },
620
 
@@ -45,37 +42,6 @@
621
 
   { "host_aliases_delete",          "clicked", G_CALLBACK (on_host_aliases_delete_clicked) },
622
 
   /* host aliases dialog */
623
 
   { "host_alias_address",           "changed", G_CALLBACK (on_host_aliases_dialog_changed) },
624
 
-  /* connection dialog */
625
 
-  { "connection_config_dialog",     "response", G_CALLBACK (on_connection_response) },
626
 
-  { "connection_config_dialog",     "delete-event", G_CALLBACK (gtk_true) },
627
 
-  { "connection_device_active",     "clicked", G_CALLBACK (on_iface_active_changed) },
628
 
-  { "connection_device_roaming",    "clicked", G_CALLBACK (on_iface_roaming_changed) },
629
 
-  { "connection_bootproto",         "changed", G_CALLBACK (on_bootproto_changed) },
630
 
-  { "connection_detect_modem",      "clicked", G_CALLBACK (on_detect_modem_clicked) },
631
 
-  /* dialog changing detection */
632
 
-  { "connection_address",           "focus-out-event", G_CALLBACK (on_ip_address_focus_out) },
633
 
-  { "connection_ppp_type",          "changed", G_CALLBACK (on_ppp_type_changed) },
634
 
-  { "connection_device_active",     "toggled", G_CALLBACK (on_dialog_changed) },
635
 
-  { "connection_essid",             "changed", G_CALLBACK (on_dialog_changed) },
636
 
-  { "connection_wep_key_type",      "changed", G_CALLBACK (on_dialog_changed) },
637
 
-  { "connection_wep_key",           "changed", G_CALLBACK (on_dialog_changed) },
638
 
-  { "connection_bootproto",         "changed", G_CALLBACK (on_dialog_changed) },
639
 
-  { "connection_address",           "changed", G_CALLBACK (on_dialog_changed) },
640
 
-  { "connection_netmask",           "changed", G_CALLBACK (on_dialog_changed) },
641
 
-  { "connection_gateway",           "changed", G_CALLBACK (on_dialog_changed) },
642
 
-  { "connection_local_address",     "changed", G_CALLBACK (on_dialog_changed) },
643
 
-  { "connection_remote_address",    "changed", G_CALLBACK (on_dialog_changed) },
644
 
-  { "connection_serial_port",       "changed", G_CALLBACK (on_dialog_changed) },
645
 
-  { "connection_dial_type",         "changed", G_CALLBACK (on_dialog_changed) },
646
 
-  { "connection_volume",            "changed", G_CALLBACK (on_dialog_changed) },
647
 
-  { "connection_phone_number",      "changed", G_CALLBACK (on_dialog_changed) },
648
 
-  { "connection_dial_prefix",       "changed", G_CALLBACK (on_dialog_changed) },
649
 
-  { "connection_login",             "changed", G_CALLBACK (on_dialog_changed) },
650
 
-  { "connection_password",          "changed", G_CALLBACK (on_dialog_changed) },
651
 
-  { "connection_default_gw",        "toggled", G_CALLBACK (on_dialog_changed) },
652
 
-  { "connection_persist",           "toggled", G_CALLBACK (on_dialog_changed) },
653
 
-  { "connection_apn",               "changed", G_CALLBACK (on_dialog_changed) },
654
 
-  { "connection_pppoe_ethernet",    "changed", G_CALLBACK (on_dialog_changed) },
655
 
   { NULL }
656
 
 };
657
 
 
658
 
@@ -85,11 +51,6 @@
659
 
 };
660
 
 
661
 
 static const gchar *policy_widgets [] = {
662
 
-       "locations_combo",
663
 
-       "add_location",
664
 
-       "remove_location",
665
 
-       "interfaces_list",
666
 
-       "properties_button",
667
 
        "hostname",
668
 
        "domain",
669
 
        "dns_list",
670
 
@@ -106,58 +67,9 @@
671
 
 };
672
 
 
673
 
 static void
674
 
-init_standalone_dialog (GstTool         *tool,
675
 
-                       IfaceSearchTerm  search_term,
676
 
-                       const gchar     *term)
677
 
-{
678
 
-  GstNetworkTool *network_tool;
679
 
-  OobsIface      *iface;
680
 
-  GtkWidget      *d;
681
 
-
682
 
-  network_tool = GST_NETWORK_TOOL (tool);
683
 
-  gst_tool_update_gui (tool);
684
 
-  iface = ifaces_model_search_iface (search_term, term);
685
 
-
686
 
-  if (iface)
687
 
-    {
688
 
-      connection_dialog_prepare (network_tool->dialog, iface);
689
 
-      network_tool->dialog->standalone = TRUE;
690
 
-      g_object_unref (iface);
691
 
-
692
 
-      gtk_widget_show (network_tool->dialog->dialog);
693
 
-    }
694
 
-  else
695
 
-    {
696
 
-      d = gtk_message_dialog_new (GTK_WINDOW (tool->main_dialog),
697
 
-                                  GTK_DIALOG_MODAL,
698
 
-                                  GTK_MESSAGE_WARNING,
699
 
-                                  GTK_BUTTONS_CLOSE,
700
 
-                                  _("The interface does not exist"));
701
 
-      gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (d),
702
 
-                                                _("Check that it is correctly typed "
703
 
-                                                  "and that it is correctly supported "
704
 
-                                                  "by your system."),
705
 
-                                                NULL);
706
 
-      gtk_dialog_run (GTK_DIALOG (d));
707
 
-      gtk_widget_destroy (d);
708
 
-      exit (-1);
709
 
-    }
710
 
-}
711
 
-
712
 
-static void
713
 
 init_filters (void)
714
 
 {
715
 
   gst_filter_init (GTK_ENTRY (gst_dialog_get_widget (tool->main_dialog, "host_alias_address")), GST_FILTER_IP);
716
 
-
717
 
-  gst_filter_init (GTK_ENTRY (gst_dialog_get_widget (tool->main_dialog, "connection_address")), GST_FILTER_IPV4);
718
 
-  gst_filter_init (GTK_ENTRY (gst_dialog_get_widget (tool->main_dialog, "connection_netmask")), GST_FILTER_IPV4);
719
 
-  gst_filter_init (GTK_ENTRY (gst_dialog_get_widget (tool->main_dialog, "connection_gateway")), GST_FILTER_IPV4);
720
 
-
721
 
-  gst_filter_init (GTK_ENTRY (gst_dialog_get_widget (tool->main_dialog, "connection_local_address")), GST_FILTER_IPV4);
722
 
-  gst_filter_init (GTK_ENTRY (gst_dialog_get_widget (tool->main_dialog, "connection_remote_address")), GST_FILTER_IPV4);
723
 
-
724
 
-  gst_filter_init (GTK_ENTRY (gst_dialog_get_widget (tool->main_dialog, "connection_phone_number")), GST_FILTER_PHONE);
725
 
-  gst_filter_init (GTK_ENTRY (gst_dialog_get_widget (tool->main_dialog, "connection_dial_prefix")), GST_FILTER_PHONE);
726
 
 }
727
 
 
728
 
 static void
729
 
@@ -176,17 +88,8 @@
730
 
 int
731
 
 main (int argc, gchar *argv[])
732
 
 {
733
 
-  gchar *interface = NULL;
734
 
-  gchar *type = NULL;
735
 
-
736
 
-  GOptionEntry entries[] = {
737
 
-    { "configure",      'c', 0, G_OPTION_ARG_STRING, &interface, N_("Configure a network interface"), N_("INTERFACE") },
738
 
-    { "configure-type", 't', 0, G_OPTION_ARG_STRING, &type,      N_("Configure the first network interface with a specific type"), N_("TYPE") },
739
 
-    { NULL }
740
 
-  };
741
 
-
742
 
   g_thread_init (NULL);
743
 
-  gst_init_tool ("network-admin", argc, argv, entries);
744
 
+  gst_init_tool ("network-admin", argc, argv, NULL);
745
 
   tool = gst_network_tool_new ();
746
 
 
747
 
   gst_dialog_require_authentication_for_widgets (tool->main_dialog, policy_widgets);
748
 
@@ -195,12 +98,7 @@
749
 
   set_text_buffers_callback ();
750
 
   init_filters ();
751
 
 
752
 
-  if (interface)
753
 
-    init_standalone_dialog (tool, SEARCH_DEV, interface);
754
 
-  else if (type)
755
 
-    init_standalone_dialog (tool, SEARCH_TYPE, type);
756
 
-  else
757
 
-    gtk_widget_show (GTK_WIDGET (tool->main_dialog));
758
 
+  gtk_widget_show (GTK_WIDGET (tool->main_dialog));
759
 
 
760
 
   gtk_main ();
761
 
   return 0;
 
19
                 <property name="spacing">6</property>
 
20
                 <child>
762
21
--- a/src/network/network-tool.c
763
22
+++ b/src/network/network-tool.c
764
 
@@ -22,11 +22,8 @@
765
 
 #include <glib/gi18n.h>
766
 
 #include "gst.h"
767
 
 #include "network-tool.h"
768
 
-#include "ifaces-list.h"
769
 
-#include "connection.h"
770
 
 #include "callbacks.h"
771
 
 #include "hosts.h"
772
 
-#include "locations-combo.h"
773
 
 
774
 
 static void gst_network_tool_class_init (GstNetworkToolClass *class);
775
 
 static void gst_network_tool_init       (GstNetworkTool      *tool);
776
 
@@ -57,13 +54,8 @@
777
 
 {
778
 
   tool->hosts_config = OOBS_HOSTS_CONFIG (oobs_hosts_config_get ());
779
 
   gst_tool_add_configuration_object (GST_TOOL (tool), OOBS_OBJECT (tool->hosts_config), TRUE);
780
 
-  tool->ifaces_config = OOBS_IFACES_CONFIG (oobs_ifaces_config_get ());
781
 
-  gst_tool_add_configuration_object (GST_TOOL (tool), OOBS_OBJECT (tool->ifaces_config), TRUE);
782
 
 
783
 
   tool->bus_connection = dbus_bus_get (DBUS_BUS_SYSTEM, NULL);
784
 
-
785
 
-  g_signal_connect_swapped (tool->ifaces_config, "changed",
786
 
-                           G_CALLBACK (gst_tool_update_async), tool);
787
 
 }
788
 
 
789
 
 static void
790
 
@@ -77,9 +69,6 @@
791
 
 
792
 
   g_object_unref (tool->dns);
793
 
   g_object_unref (tool->search);
794
 
-  g_object_unref (tool->interfaces_model);
795
 
-  g_object_unref (tool->location);
796
 
-  g_free (tool->dialog);
797
 
 
798
 
   (* G_OBJECT_CLASS (gst_network_tool_parent_class)->finalize) (object);
799
 
 }
800
 
@@ -140,16 +129,8 @@
801
 
   widget = gst_dialog_get_widget (GST_TOOL (tool)->main_dialog, "domain");
802
 
   tool->domain = GTK_ENTRY (widget);
803
 
 
804
 
-  tool->interfaces_model = ifaces_model_create ();
805
 
-  tool->interfaces_list = ifaces_list_create (GST_TOOL (tool));
806
 
   tool->host_aliases_list = host_aliases_list_create (GST_TOOL (tool));
807
 
 
808
 
-  widget = gst_dialog_get_widget (GST_TOOL (tool)->main_dialog, "locations_combo");
809
 
-  add_button = gst_dialog_get_widget (GST_TOOL (tool)->main_dialog, "add_location");
810
 
-  delete_button = gst_dialog_get_widget (GST_TOOL (tool)->main_dialog, "remove_location");
811
 
-  tool->location = gst_locations_combo_new (GST_TOOL (tool), widget, add_button, delete_button);
812
 
-
813
 
-  tool->dialog = connection_dialog_init (GST_TOOL (tool));
 
23
@@ -152,6 +152,11 @@ gst_network_tool_constructor (GType
 
24
   tool->dialog = connection_dialog_init (GST_TOOL (tool));
814
25
   tool->host_aliases_dialog = gst_dialog_get_widget (GST_TOOL (tool)->main_dialog, "host_aliases_edit_dialog");
815
26
 
 
27
+  if (!g_file_test ("/usr/sbin/NetworkManager", G_FILE_TEST_IS_EXECUTABLE)) {
 
28
+    gtk_widget_set_visible (gst_dialog_get_widget (GST_TOOL (tool)->main_dialog, "hbox3"), TRUE);
 
29
+    gtk_widget_set_visible (gst_dialog_get_widget (GST_TOOL (tool)->main_dialog, "locations_box"), TRUE);
 
30
+  }
 
31
+
816
32
   return object;
817
 
@@ -189,48 +170,6 @@
818
 
 }
819
 
 
820
 
 static void
821
 
-add_interfaces (GtkTreeView *ifaces_list, OobsList *list)
822
 
-{
823
 
-  OobsListIter iter;
824
 
-  GObject *iface;
825
 
-  gboolean valid;
826
 
-  gint n_items;
827
 
-
828
 
-  valid = oobs_list_get_iter_first (list, &iter);
829
 
-  n_items = oobs_list_get_n_items (list);
830
 
-
831
 
-  while (valid)
832
 
-    {
833
 
-      iface = oobs_list_get (list, &iter);
834
 
-      ifaces_model_add_interface (OOBS_IFACE (iface), (n_items > 1));
835
 
-
836
 
-      g_object_unref (iface);
837
 
-      valid = oobs_list_iter_next (list, &iter);
838
 
-    }
839
 
-}
840
 
-
841
 
-static void
842
 
-add_all_interfaces (GstNetworkTool *network_tool)
843
 
-{
844
 
-  OobsList *ifaces_list;
845
 
-
846
 
-  ifaces_list = oobs_ifaces_config_get_ifaces (network_tool->ifaces_config, OOBS_IFACE_TYPE_ETHERNET);
847
 
-  add_interfaces (network_tool->interfaces_list, ifaces_list);
848
 
-
849
 
-  ifaces_list = oobs_ifaces_config_get_ifaces (network_tool->ifaces_config, OOBS_IFACE_TYPE_WIRELESS);
850
 
-  add_interfaces (network_tool->interfaces_list, ifaces_list);
851
 
-
852
 
-  ifaces_list = oobs_ifaces_config_get_ifaces (network_tool->ifaces_config, OOBS_IFACE_TYPE_IRLAN);
853
 
-  add_interfaces (network_tool->interfaces_list, ifaces_list);
854
 
-
855
 
-  ifaces_list = oobs_ifaces_config_get_ifaces (network_tool->ifaces_config, OOBS_IFACE_TYPE_PLIP);
856
 
-  add_interfaces (network_tool->interfaces_list, ifaces_list);
857
 
-
858
 
-  ifaces_list = oobs_ifaces_config_get_ifaces (network_tool->ifaces_config, OOBS_IFACE_TYPE_PPP);
859
 
-  add_interfaces (network_tool->interfaces_list, ifaces_list);
860
 
-}
861
 
-
862
 
-static void
863
 
 set_entry_text (GtkWidget *entry, const gchar *text)
864
 
 {
865
 
   gtk_entry_set_text (GTK_ENTRY (entry), (text) ? text : "");
866
 
@@ -265,11 +204,6 @@
867
 
   set_entry_text (GTK_WIDGET (network_tool->domain),
868
 
                  oobs_hosts_config_get_domainname (network_tool->hosts_config));
869
 
   g_signal_handlers_unblock_by_func (network_tool->domain, on_entry_changed, tool->main_dialog);
870
 
-
871
 
-  gtk_list_store_clear (GTK_LIST_STORE (network_tool->interfaces_model));
872
 
-  add_all_interfaces (network_tool);
873
 
-
874
 
-  connection_dialog_update (network_tool->dialog);
875
 
 }
876
 
 
877
 
 GstTool*
878
 
--- a/src/network/network-tool.h
879
 
+++ b/src/network/network-tool.h
880
 
@@ -26,8 +26,7 @@
881
 
 #include <gtk/gtk.h>
882
 
 #include <dbus/dbus.h>
883
 
 #include "address-list.h"
884
 
-#include "locations-combo.h"
885
 
-#include "connection.h"
886
 
+#include "gst.h"
887
 
 
888
 
 #define GST_TYPE_NETWORK_TOOL           (gst_network_tool_get_type ())
889
 
 #define GST_NETWORK_TOOL(obj)           (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_NETWORK_TOOL, GstNetworkTool))
890
 
@@ -45,7 +44,6 @@
891
 
 
892
 
   /* config */
893
 
   OobsHostsConfig *hosts_config;
894
 
-  OobsIfacesConfig *ifaces_config;
895
 
 
896
 
   /* gui */
897
 
   GstAddressList *dns;
898
 
@@ -54,16 +52,11 @@
899
 
   /* bus, used for NM integration */
900
 
   DBusConnection *bus_connection;
901
 
 
902
 
-  GtkTreeModel *interfaces_model;
903
 
-  GtkTreeView  *interfaces_list;
904
 
-
905
 
   GtkTreeView *host_aliases_list;
906
 
-  GstLocationsCombo *location;
907
 
 
908
 
   GtkEntry *hostname;
909
 
   GtkEntry *domain;
910
 
 
911
 
-  GstConnectionDialog *dialog;
912
 
   GtkWidget *host_aliases_dialog;
913
 
 };
 
33
 }
914
34