1
1
--- a/interfaces/network.ui
2
2
+++ b/interfaces/network.ui
4
<property name="border_width">6</property>
5
4
<property name="spacing">12</property>
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>
11
- <object class="GtkLabel" id="label2">
12
- <property name="visible">True</property>
13
- <property name="label" translatable="yes">Location:</property>
16
- <property name="expand">False</property>
17
- <property name="fill">False</property>
18
- <property name="position">0</property>
22
- <object class="GtkComboBox" id="locations_combo">
23
- <property name="visible">True</property>
26
- <property name="position">1</property>
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"/>
37
- <object class="GtkImage" id="image9">
38
- <property name="visible">True</property>
39
- <property name="stock">gtk-save</property>
44
- <property name="expand">False</property>
45
- <property name="fill">False</property>
46
- <property name="position">2</property>
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"/>
57
- <object class="GtkImage" id="image10">
58
- <property name="visible">True</property>
59
- <property name="stock">gtk-delete</property>
64
- <property name="expand">False</property>
65
- <property name="fill">False</property>
66
- <property name="position">3</property>
71
- <property name="expand">False</property>
72
- <property name="fill">False</property>
73
- <property name="position">0</property>
77
<object class="GtkNotebook" id="notebook1">
78
<property name="visible">True</property>
8
+ <property name="visible">False</property>
9
<property name="spacing">6</property>
11
<object class="GtkLabel" id="label2">
79
13
<property name="can_focus">True</property>
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>
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>
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>
105
- <property name="position">0</property>
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>
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>
124
- <property name="expand">False</property>
125
- <property name="fill">False</property>
126
- <property name="position">0</property>
131
- <property name="expand">False</property>
132
- <property name="fill">False</property>
133
- <property name="position">1</property>
139
- <object class="GtkLabel" id="label3">
140
- <property name="visible">True</property>
141
- <property name="label" translatable="yes">Connections</property>
144
- <property name="tab_fill">False</property>
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>
155
dnl ==================================
157
-dnl ==================================
159
-dnl ==================================
162
-AC_CHECK_HEADER(iwlib.h, [
164
- AC_DEFINE(HAVE_LIBIW_H, "", [whether libiw is available])
165
- AC_HAVE_LIBRARY(iw, [GST_IW_LIBS="-liw"])
167
-AM_CONDITIONAL(HAVE_LIBIW_H, test x$enable_libiw = xyes)
168
-AC_SUBST(GST_IW_LIBS)
170
-dnl ==================================
171
-dnl END: LIBIW DETECTION
172
-dnl ==================================
174
dnl ===========================
175
dnl NAUTILUS EXTENSION
176
dnl ===========================
177
--- a/src/network/Makefile.am
178
+++ b/src/network/Makefile.am
180
CLEANFILES = $(GST_TOOL_CLEANFILES)
181
EXTRA_DIST = $(GST_TOOL_EXTRA_DIST)
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)
188
-essid_SOURCES = essid-list.c essid-list.h
191
network_admin_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 \
204
--- a/src/network/callbacks.c
205
+++ b/src/network/callbacks.c
209
#include "network-tool.h"
210
-#include "ifaces-list.h"
211
#include "callbacks.h"
213
-#include "nm-integration.h"
214
-#include "connection.h"
216
extern GstTool *tool;
219
-on_table_selection_changed (GtkTreeSelection *selection, gpointer data)
221
- GtkWidget *properties;
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);
228
-on_iface_properties_clicked (GtkWidget *widget, gpointer data)
230
- GstConnectionDialog *dialog;
231
- GtkTreeSelection *selection;
232
- GtkTreeModel *model;
236
- selection = gtk_tree_view_get_selection (GST_NETWORK_TOOL (tool)->interfaces_list);
238
- if (gtk_tree_selection_get_selected (selection, &model, &iter))
240
- gtk_tree_model_get (model, &iter,
241
- COL_OBJECT, &iface,
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));
248
- gst_dialog_add_edit_dialog (tool->main_dialog, dialog->dialog);
249
- gtk_widget_show (dialog->dialog);
254
-on_iface_active_changed (GtkWidget *widget, gpointer data)
256
- GstConnectionDialog *dialog;
257
- GtkWidget *roaming_active;
260
- dialog = GST_NETWORK_TOOL (tool)->dialog;
261
- active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
263
- connection_dialog_set_sensitive (dialog, active);
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);
272
-on_iface_roaming_changed (GtkWidget *widget, gpointer data)
274
- GstConnectionDialog *dialog;
275
- GtkWidget *device_active;
278
- dialog = GST_NETWORK_TOOL (tool)->dialog;
279
- active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
281
- /* roaming changed and device active have just inverted logics */
282
- connection_dialog_set_sensitive (dialog, !active);
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);
291
-on_bootproto_changed (GtkWidget *widget, gpointer data)
293
- GstConnectionDialog *dialog;
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);
301
- gtk_widget_set_sensitive (dialog->address, enabled);
302
- gtk_widget_set_sensitive (dialog->netmask, enabled);
303
- gtk_widget_set_sensitive (dialog->gateway, enabled);
309
-on_ppp_type_changed (GtkWidget *widget, gpointer data)
311
- GstConnectionDialog *dialog;
314
- dialog = GST_NETWORK_TOOL (tool)->dialog;
315
- type = connection_combo_get_value (GTK_COMBO_BOX (dialog->ppp_type_combo));
317
- on_dialog_changed (widget, data);
322
- if (strcmp (type, "modem") == 0)
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);
331
- else if (strcmp (type, "isdn") == 0)
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);
338
- else if (strcmp (type, "pppoe") == 0)
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);
346
- else if (strcmp (type, "gprs") == 0)
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);
358
-cancel_connection_dialog (GstTool *tool)
360
- GstConnectionDialog *dialog;
362
- dialog = GST_NETWORK_TOOL (tool)->dialog;
363
- g_object_unref (dialog->iface);
364
- connection_dialog_hide (dialog);
366
- if (dialog->standalone)
371
-toggle_nm (gpointer data)
373
- GstNetworkTool *tool = GST_NETWORK_TOOL (data);
376
- state = nm_integration_get_state (tool);
378
- if (state == NM_STATE_DISCONNECTED ||
379
- state == NM_STATE_CONNECTING ||
380
- state == NM_STATE_CONNECTED)
383
- nm_integration_sleep (tool);
384
- nm_integration_wake (tool);
391
-on_configuration_changed (OobsObject *object,
395
- /* suckety suck, but NM seems not to realize
396
- * immediately that the interface status changed */
397
- g_timeout_add (2000, toggle_nm, data);
401
-accept_connection_dialog (GstTool *tool)
403
- GstConnectionDialog *dialog;
404
- GtkTreeSelection *selection;
407
- dialog = GST_NETWORK_TOOL (tool)->dialog;
408
- connection_dialog_hide (dialog);
410
- if (dialog->changed)
412
- connection_save (dialog);
413
- selection = gtk_tree_view_get_selection (GST_NETWORK_TOOL (tool)->interfaces_list);
415
- if (gtk_tree_selection_get_selected (selection, NULL, &iter))
417
- ifaces_model_modify_interface_at_iter (&iter);
418
- g_signal_emit_by_name (G_OBJECT (selection), "changed");
421
- gst_tool_commit_async (tool, OOBS_OBJECT (GST_NETWORK_TOOL (tool)->ifaces_config),
422
- _("Changing interface configuration"),
423
- on_configuration_changed, tool);
426
- g_object_unref (dialog->iface);
428
- if (dialog->standalone)
433
-on_connection_response (GtkWidget *widget,
437
- GstConnectionDialog *connection_dialog;
438
- GstDialog *dialog = GST_DIALOG (data);
439
- GstTool *tool = gst_dialog_get_tool (dialog);
441
- if (response == GTK_RESPONSE_OK)
442
- accept_connection_dialog (tool);
444
- cancel_connection_dialog (tool);
446
- connection_dialog = GST_NETWORK_TOOL (tool)->dialog;
447
- gst_dialog_remove_edit_dialog (tool->main_dialog, connection_dialog->dialog);
451
-on_detect_modem_clicked (GtkWidget *widget, gpointer data)
453
- GstNetworkTool *network_tool;
454
- GstConnectionDialog *dialog;
459
- network_tool = GST_NETWORK_TOOL (tool);
460
- dialog = network_tool->dialog;
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);
467
- cursor = gdk_cursor_new (GDK_WATCH);
468
- gdk_window_set_cursor (GTK_WIDGET (dialog->dialog)->window, cursor);
469
- gdk_cursor_unref (cursor);
471
- dev = connection_detect_modem ();
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);
480
- d = gtk_message_dialog_new (GTK_WINDOW (dialog->dialog),
484
- _("Could not autodetect modem device"),
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."),
490
- gtk_dialog_run (GTK_DIALOG (d));
491
- gtk_widget_destroy (d);
494
- gtk_entry_set_text (GTK_ENTRY (GTK_BIN (GTK_COMBO_BOX (dialog->serial_port))->child), dev);
500
do_popup_menu (GtkWidget *table, GstTablePopup *table_popup, GdkEventButton *event)
505
-on_dialog_changed (GtkWidget *widget, gpointer data)
507
- GstNetworkTool *network_tool = GST_NETWORK_TOOL (tool);
509
- network_tool->dialog->changed = TRUE;
510
- connection_check_fields (network_tool->dialog);
514
-on_ip_address_focus_out (GtkWidget *widget, GdkEventFocus *event, gpointer data)
516
- GstConnectionDialog *dialog = GST_NETWORK_TOOL (tool)->dialog;
518
- connection_check_netmask (dialog->address, dialog->netmask);
523
-on_iface_toggled (GtkCellRendererToggle *renderer,
528
- GtkTreeModel *model = GTK_TREE_MODEL (data);
530
- gboolean active, inconsistent;
533
- path = gtk_tree_path_new_from_string (path_str);
535
- if (gtk_tree_model_get_iter (model, &iter, path))
537
- gtk_tree_model_get (model, &iter,
538
- COL_ACTIVE, &active,
539
- COL_INCONSISTENT, &inconsistent,
540
- COL_OBJECT, &iface,
547
- oobs_iface_set_active (iface, active);
548
- oobs_iface_set_auto (iface, active);
549
- ifaces_model_modify_interface_at_iter (&iter);
551
- gst_tool_commit_async (tool, OOBS_OBJECT (GST_NETWORK_TOOL (tool)->ifaces_config),
552
- _("Changing interface configuration"),
553
- on_configuration_changed, tool);
556
- g_object_unref (iface);
559
- gtk_tree_path_free (path);
563
on_entry_changed (GtkWidget *widget, gpointer data)
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
572
-void on_table_selection_changed (GtkTreeSelection*, gpointer);
573
-void on_iface_properties_clicked (GtkWidget*, gpointer);
575
-void on_iface_active_changed (GtkWidget*, gpointer);
576
-void on_iface_roaming_changed (GtkWidget *widget, gpointer data);
578
-void on_bootproto_changed (GtkWidget*, gpointer);
579
-void on_detect_modem_clicked (GtkWidget*, gpointer);
580
-void on_connection_response (GtkWidget *widget,
585
gboolean on_table_button_press (GtkWidget*, GdkEventButton*, gpointer);
586
gboolean on_table_popup_menu (GtkWidget*, gpointer);
589
void on_host_aliases_dialog_changed (GtkWidget*, gpointer);
592
-void on_dialog_changed (GtkWidget*, gpointer);
594
-gboolean on_ip_address_focus_out (GtkWidget*, GdkEventFocus*, gpointer);
596
-void on_iface_toggled (GtkCellRendererToggle *renderer,
600
void on_entry_changed (GtkWidget *widget,
602
gboolean on_hostname_focus_out (GtkWidget *widget,
603
--- a/src/network/main.c
604
+++ b/src/network/main.c
608
#include "network-tool.h"
609
-#include "ifaces-list.h"
610
#include "callbacks.h"
614
static GstDialogSignal signals[] = {
615
- /* connections tab */
616
- { "properties_button", "clicked", G_CALLBACK (on_iface_properties_clicked) },
618
{ "domain", "focus-out-event", G_CALLBACK (on_domain_focus_out) },
619
{ "hostname", "changed", G_CALLBACK (on_entry_changed) },
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) },
661
static const gchar *policy_widgets [] = {
666
- "properties_button",
674
-init_standalone_dialog (GstTool *tool,
675
- IfaceSearchTerm search_term,
678
- GstNetworkTool *network_tool;
682
- network_tool = GST_NETWORK_TOOL (tool);
683
- gst_tool_update_gui (tool);
684
- iface = ifaces_model_search_iface (search_term, term);
688
- connection_dialog_prepare (network_tool->dialog, iface);
689
- network_tool->dialog->standalone = TRUE;
690
- g_object_unref (iface);
692
- gtk_widget_show (network_tool->dialog->dialog);
696
- d = gtk_message_dialog_new (GTK_WINDOW (tool->main_dialog),
698
- GTK_MESSAGE_WARNING,
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."),
706
- gtk_dialog_run (GTK_DIALOG (d));
707
- gtk_widget_destroy (d);
715
gst_filter_init (GTK_ENTRY (gst_dialog_get_widget (tool->main_dialog, "host_alias_address")), GST_FILTER_IP);
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);
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);
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);
731
main (int argc, gchar *argv[])
733
- gchar *interface = NULL;
734
- gchar *type = NULL;
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") },
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 ();
747
gst_dialog_require_authentication_for_widgets (tool->main_dialog, policy_widgets);
749
set_text_buffers_callback ();
753
- init_standalone_dialog (tool, SEARCH_DEV, interface);
755
- init_standalone_dialog (tool, SEARCH_TYPE, type);
757
- gtk_widget_show (GTK_WIDGET (tool->main_dialog));
758
+ gtk_widget_show (GTK_WIDGET (tool->main_dialog));
19
<property name="spacing">6</property>
762
21
--- a/src/network/network-tool.c
763
22
+++ b/src/network/network-tool.c
765
#include <glib/gi18n.h>
767
#include "network-tool.h"
768
-#include "ifaces-list.h"
769
-#include "connection.h"
770
#include "callbacks.h"
772
-#include "locations-combo.h"
774
static void gst_network_tool_class_init (GstNetworkToolClass *class);
775
static void gst_network_tool_init (GstNetworkTool *tool);
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);
783
tool->bus_connection = dbus_bus_get (DBUS_BUS_SYSTEM, NULL);
785
- g_signal_connect_swapped (tool->ifaces_config, "changed",
786
- G_CALLBACK (gst_tool_update_async), tool);
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);
798
(* G_OBJECT_CLASS (gst_network_tool_parent_class)->finalize) (object);
801
widget = gst_dialog_get_widget (GST_TOOL (tool)->main_dialog, "domain");
802
tool->domain = GTK_ENTRY (widget);
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));
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);
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");
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);
821
-add_interfaces (GtkTreeView *ifaces_list, OobsList *list)
828
- valid = oobs_list_get_iter_first (list, &iter);
829
- n_items = oobs_list_get_n_items (list);
833
- iface = oobs_list_get (list, &iter);
834
- ifaces_model_add_interface (OOBS_IFACE (iface), (n_items > 1));
836
- g_object_unref (iface);
837
- valid = oobs_list_iter_next (list, &iter);
842
-add_all_interfaces (GstNetworkTool *network_tool)
844
- OobsList *ifaces_list;
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);
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);
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);
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);
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);
863
set_entry_text (GtkWidget *entry, const gchar *text)
865
gtk_entry_set_text (GTK_ENTRY (entry), (text) ? text : "");
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);
871
- gtk_list_store_clear (GTK_LIST_STORE (network_tool->interfaces_model));
872
- add_all_interfaces (network_tool);
874
- connection_dialog_update (network_tool->dialog);
878
--- a/src/network/network-tool.h
879
+++ b/src/network/network-tool.h
882
#include <dbus/dbus.h>
883
#include "address-list.h"
884
-#include "locations-combo.h"
885
-#include "connection.h"
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))
893
OobsHostsConfig *hosts_config;
894
- OobsIfacesConfig *ifaces_config;
899
/* bus, used for NM integration */
900
DBusConnection *bus_connection;
902
- GtkTreeModel *interfaces_model;
903
- GtkTreeView *interfaces_list;
905
GtkTreeView *host_aliases_list;
906
- GstLocationsCombo *location;
911
- GstConnectionDialog *dialog;
912
GtkWidget *host_aliases_dialog;