1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 83_network-locations-apply-button.dpatch by Sebastien Bacher <seb128@ubuntu.com>
4
## All lines beginning with `## DP:' are a description of the patch.
8
diff -urNad gnome-system-tools-2.15.3~/interfaces/network.glade.in gnome-system-tools-2.15.3/interfaces/network.glade.in
9
--- gnome-system-tools-2.15.3~/interfaces/network.glade.in 2006-09-06 14:45:15.000000000 +0200
10
+++ gnome-system-tools-2.15.3/interfaces/network.glade.in 2006-09-06 14:45:15.000000000 +0200
12
<property name="fill">False</property>
17
+ <widget class="GtkButton" id="apply_location">
18
+ <property name="visible">True</property>
19
+ <property name="tooltip" translatable="yes">Apply location as the current configuration</property>
20
+ <property name="can_focus">True</property>
21
+ <property name="relief">GTK_RELIEF_NORMAL</property>
22
+ <property name="focus_on_click">True</property>
25
+ <widget class="GtkImage" id="image9">
26
+ <property name="visible">True</property>
27
+ <property name="icon_size">4</property>
28
+ <property name="icon_name">gtk-apply</property>
29
+ <property name="xalign">0.5</property>
30
+ <property name="yalign">0.5</property>
31
+ <property name="xpad">0</property>
32
+ <property name="ypad">0</property>
37
+ <property name="padding">0</property>
38
+ <property name="expand">False</property>
39
+ <property name="fill">False</property>
44
<property name="padding">0</property>
45
diff -urNad gnome-system-tools-2.15.3~/src/network/locations-combo.c gnome-system-tools-2.15.3/src/network/locations-combo.c
46
--- gnome-system-tools-2.15.3~/src/network/locations-combo.c 2006-08-29 18:01:38.000000000 +0200
47
+++ gnome-system-tools-2.15.3/src/network/locations-combo.c 2006-09-06 14:45:15.000000000 +0200
50
GtkWidget *add_button;
51
GtkWidget *remove_button;
52
+ GtkWidget *apply_button;
54
GtkWidget *add_dialog;
55
GtkWidget *location_entry;
65
static void gst_locations_combo_class_init (GstLocationsComboClass *class);
69
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
70
+ g_object_class_install_property (object_class,
72
+ g_param_spec_object ("apply",
76
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
77
g_type_class_add_private (object_class,
78
sizeof (GstLocationsComboPrivate));
81
if (priv->remove_button)
82
g_object_unref (priv->remove_button);
84
+ if (priv->apply_button)
85
+ g_object_unref (priv->apply_button);
88
g_object_unref (priv->model);
92
priv->remove_button = GTK_WIDGET (g_value_dup_object (value));
95
+ priv->apply_button = GTK_WIDGET (g_value_dup_object (value));
102
g_value_set_object (value, priv->remove_button);
105
+ g_value_set_object (value, priv->apply_button);
111
gtk_tree_model_get (model, &iter, 0, &str, -1);
112
gst_network_locations_set_location (locations, str);
113
gst_tool_update_gui (priv->tool);
115
- oobs_object_commit (locations->hosts_config);
116
- gst_tool_commit_async (priv->tool, locations->ifaces_config,
117
- _("Changing network location"));
120
+ gtk_widget_set_sensitive (priv->apply_button, TRUE);
128
+on_apply_button_clicked (GtkWidget *widget, gpointer data)
130
+ GstNetworkLocations *locations;
131
+ GstLocationsComboPrivate *priv;
133
+ priv = GST_LOCATIONS_COMBO (data)->_priv;
134
+ locations = GST_NETWORK_LOCATIONS (data);
136
+ oobs_object_commit (locations->hosts_config);
137
+ gst_tool_commit_async (priv->tool, locations->ifaces_config,
138
+ _("Changing network location"));
140
+ gtk_widget_set_sensitive (widget, FALSE);
144
fill_model (GstLocationsCombo *combo,
148
G_CALLBACK (on_add_button_clicked), object);
149
g_signal_connect (G_OBJECT (priv->remove_button), "clicked",
150
G_CALLBACK (on_remove_button_clicked), object);
151
+ g_signal_connect (G_OBJECT (priv->apply_button), "clicked",
152
+ G_CALLBACK (on_apply_button_clicked), object);
154
+ /* set the apply button initially unsensitive */
155
+ gtk_widget_set_sensitive (priv->apply_button, FALSE);
159
@@ -461,12 +498,14 @@
160
gst_locations_combo_new (GstTool *tool,
167
return g_object_new (GST_TYPE_LOCATIONS_COMBO,
175
diff -urNad gnome-system-tools-2.15.3~/src/network/locations-combo.h gnome-system-tools-2.15.3/src/network/locations-combo.h
176
--- gnome-system-tools-2.15.3~/src/network/locations-combo.h 2006-07-05 18:03:40.000000000 +0200
177
+++ gnome-system-tools-2.15.3/src/network/locations-combo.h 2006-09-06 14:45:15.000000000 +0200
179
GstLocationsCombo* gst_locations_combo_new (GstTool *tool,
182
- GtkWidget *remove);
188
diff -urNad gnome-system-tools-2.15.3~/src/network/network-tool.c gnome-system-tools-2.15.3/src/network/network-tool.c
189
--- gnome-system-tools-2.15.3~/src/network/network-tool.c 2006-09-06 14:45:15.000000000 +0200
190
+++ gnome-system-tools-2.15.3/src/network/network-tool.c 2006-09-06 14:46:36.000000000 +0200
192
GstNetworkTool *tool;
195
- GtkWidget *widget, *add_button, *delete_button;
196
+ GtkWidget *widget, *add_button, *delete_button, *apply_button;;
198
object = (* G_OBJECT_CLASS (gst_network_tool_parent_class)->constructor) (type,
199
n_construct_properties,
201
widget = gst_dialog_get_widget (GST_TOOL (tool)->main_dialog, "locations_combo");
202
add_button = gst_dialog_get_widget (GST_TOOL (tool)->main_dialog, "add_location");
203
delete_button = gst_dialog_get_widget (GST_TOOL (tool)->main_dialog, "remove_location");
204
- tool->location = gst_locations_combo_new (GST_TOOL (tool), widget, add_button, delete_button);
205
+ apply_button = gst_dialog_get_widget (GST_TOOL (tool)->main_dialog, "apply_location");
206
+ tool->location = gst_locations_combo_new (GST_TOOL (tool), widget, add_button, delete_button, apply_button);
208
widget = gst_dialog_get_widget (GST_TOOL (tool)->main_dialog, "enable_avahi");
209
avahi_stat = avahi_status();