~ubuntu-branches/ubuntu/edgy/gnome-system-tools/edgy

« back to all changes in this revision

Viewing changes to debian/patches/83_network-locations-apply-button.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2006-09-05 22:55:34 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20060905225534-l34y2zttygpdskhn
Tags: 2.15.3-0ubuntu1
* New upstream version:
  Common:
  - Code cleanups and improvements
  - Fix configuration reloading when the user has to select a platform 
  Users:
  - Add back user profiles 
  Time:
  - Add "synchronize now" button
  - Fix crasher when time-admin can't communicate with gnome-screensaver 
  Network:
  - Fix several potential crashers
  - Fix --configure and --configure-type parameters
  Shares:
  - Do not crash in --add-share 
  Services:
  - Add heaps of services descriptions
* debian/control.in:
  - updated the liboobs-1-dev requirement according to configure
* debian/gnome-system-tools.install:
  - updated profiles file to install
* debian/patches/03_install_packages.dpatch:
  - replaced by a set of new patches
* debian/patches/18_disable_uid.dpatch:
  - fixed
* debian/patches/20_fuse_as_default_group.dpatch:
  - updated
* debian/patches/98_automake.dpatch:
  - updated
* debian/profiles, debian/profiles.xml:
  - user profiles updated to the new format, 
    by Carlos Garnacho <carlosg@gnome.org>
* debian/watch:
  - updated
* Patches by Carlos Garnacho <carlosg@gnome.org>:
* debian/patches/80_gst-packages-common.dpatch,
  debian/patches/81_gst-packages-shares-admin.dpatch,
  debian/patches/82_gst-packages-time-admin.dpatch:
  - based on the previous patches by Vincent Untz, allow to install required
    packages from the corresponding tool (Ubuntu: #55988)
* debian/patches/83_network-locations-apply-button.dpatch:
  - make network-admin use an apply button instead of applying changes when
    selecting a profile

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 83_network-locations-apply-button.dpatch by Sebastien Bacher <seb128@ubuntu.com>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: No description.
 
6
 
 
7
@DPATCH@
 
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
 
11
@@ -124,6 +124,33 @@
 
12
              <property name="fill">False</property>
 
13
            </packing>
 
14
          </child>
 
15
+
 
16
+         <child>
 
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>
 
23
+
 
24
+             <child>
 
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>
 
33
+               </widget>
 
34
+             </child>
 
35
+           </widget>
 
36
+           <packing>
 
37
+             <property name="padding">0</property>
 
38
+             <property name="expand">False</property>
 
39
+             <property name="fill">False</property>
 
40
+           </packing>
 
41
+         </child>
 
42
        </widget>
 
43
        <packing>
 
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
 
48
@@ -34,6 +34,7 @@
 
49
   GtkWidget *combo;
 
50
   GtkWidget *add_button;
 
51
   GtkWidget *remove_button;
 
52
+  GtkWidget *apply_button;
 
53
 
 
54
   GtkWidget *add_dialog;
 
55
   GtkWidget *location_entry;
 
56
@@ -44,7 +45,8 @@
 
57
   PROP_TOOL,
 
58
   PROP_COMBO,
 
59
   PROP_ADD,
 
60
-  PROP_REMOVE
 
61
+  PROP_REMOVE,
 
62
+  PROP_APPLY
 
63
 };
 
64
 
 
65
 static void gst_locations_combo_class_init   (GstLocationsComboClass *class);
 
66
@@ -108,6 +110,13 @@
 
67
                                                        "Remove",
 
68
                                                        GTK_TYPE_BUTTON,
 
69
                                                        G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 
70
+  g_object_class_install_property (object_class,
 
71
+                                  PROP_APPLY,
 
72
+                                  g_param_spec_object ("apply",
 
73
+                                                       "Apply",
 
74
+                                                       "Apply",
 
75
+                                                       GTK_TYPE_BUTTON,
 
76
+                                                       G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 
77
   g_type_class_add_private (object_class,
 
78
                            sizeof (GstLocationsComboPrivate));
 
79
 }
 
80
@@ -140,6 +149,9 @@
 
81
   if (priv->remove_button)
 
82
     g_object_unref (priv->remove_button);
 
83
 
 
84
+  if (priv->apply_button)
 
85
+    g_object_unref (priv->apply_button);
 
86
+
 
87
   if (priv->model)
 
88
     g_object_unref (priv->model);
 
89
 }
 
90
@@ -169,6 +181,9 @@
 
91
     case PROP_REMOVE:
 
92
       priv->remove_button = GTK_WIDGET (g_value_dup_object (value));
 
93
       break;
 
94
+    case PROP_APPLY:
 
95
+      priv->apply_button = GTK_WIDGET (g_value_dup_object (value));
 
96
+      break;
 
97
     }
 
98
 }
 
99
 
 
100
@@ -197,6 +212,9 @@
 
101
     case PROP_REMOVE:
 
102
       g_value_set_object (value, priv->remove_button);
 
103
       break;
 
104
+    case PROP_APPLY:
 
105
+      g_value_set_object (value, priv->apply_button);
 
106
+      break;
 
107
     }
 
108
 }
 
109
 
 
110
@@ -218,11 +236,9 @@
 
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);
 
114
-
 
115
-      oobs_object_commit (locations->hosts_config);
 
116
-      gst_tool_commit_async (priv->tool, locations->ifaces_config,
 
117
-                            _("Changing network location"));
 
118
       g_free (str);
 
119
+
 
120
+      gtk_widget_set_sensitive (priv->apply_button, TRUE);
 
121
     }
 
122
 }
 
123
 
 
124
@@ -390,6 +406,22 @@
 
125
 }
 
126
 
 
127
 static void
 
128
+on_apply_button_clicked (GtkWidget *widget, gpointer data)
 
129
+{
 
130
+  GstNetworkLocations *locations;
 
131
+  GstLocationsComboPrivate *priv;
 
132
+
 
133
+  priv = GST_LOCATIONS_COMBO (data)->_priv;
 
134
+  locations = GST_NETWORK_LOCATIONS (data);
 
135
+
 
136
+  oobs_object_commit (locations->hosts_config);
 
137
+  gst_tool_commit_async (priv->tool, locations->ifaces_config,
 
138
+                        _("Changing network location"));
 
139
+
 
140
+  gtk_widget_set_sensitive (widget, FALSE);
 
141
+}
 
142
+
 
143
+static void
 
144
 fill_model (GstLocationsCombo *combo,
 
145
            GtkTreeModel      *model)
 
146
 {
 
147
@@ -440,6 +472,11 @@
 
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);
 
153
+
 
154
+  /* set the apply button initially unsensitive */
 
155
+  gtk_widget_set_sensitive (priv->apply_button, FALSE);
 
156
 
 
157
   return object;
 
158
 }
 
159
@@ -461,12 +498,14 @@
 
160
 gst_locations_combo_new (GstTool   *tool,
 
161
                         GtkWidget *combo,
 
162
                         GtkWidget *add,
 
163
-                        GtkWidget *remove)
 
164
+                        GtkWidget *remove,
 
165
+                        GtkWidget *apply)
 
166
 {
 
167
   return g_object_new (GST_TYPE_LOCATIONS_COMBO,
 
168
                       "tool", tool,
 
169
                       "combo", combo,
 
170
                       "add", add,
 
171
                       "remove", remove,
 
172
+                      "apply", apply,
 
173
                       NULL);
 
174
 }
 
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
 
178
@@ -53,7 +53,8 @@
 
179
 GstLocationsCombo*     gst_locations_combo_new             (GstTool   *tool,
 
180
                                                            GtkWidget *combo,
 
181
                                                            GtkWidget *add,
 
182
-                                                           GtkWidget *remove);
 
183
+                                                           GtkWidget *remove,
 
184
+                                                           GtkWidget *apply);
 
185
 
 
186
 
 
187
 G_END_DECLS
 
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
 
191
@@ -164,7 +164,7 @@
 
192
   GstNetworkTool *tool;
 
193
   gboolean avahi_stat;
 
194
 
 
195
-  GtkWidget *widget, *add_button, *delete_button;
 
196
+  GtkWidget *widget, *add_button, *delete_button, *apply_button;;
 
197
 
 
198
   object = (* G_OBJECT_CLASS (gst_network_tool_parent_class)->constructor) (type,
 
199
                                                                            n_construct_properties,
 
200
@@ -206,7 +206,8 @@
 
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);
 
207
   
 
208
   widget = gst_dialog_get_widget (GST_TOOL (tool)->main_dialog, "enable_avahi");
 
209
   avahi_stat = avahi_status();