~ubuntu-branches/ubuntu/saucy/gnome-control-center/saucy-proposed

« back to all changes in this revision

Viewing changes to panels/network/net-object.c

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher, Sebastien Bacher, Robert Ancell, Iain Lane, Edward Donovan, Rico Tzschichholz, Jeremy Bicha, David Henningsson
  • Date: 2012-11-21 19:32:45 UTC
  • mfrom: (1.1.63)
  • Revision ID: package-import@ubuntu.com-20121121193245-mj61nzz1z4fk3z25
Tags: 1:3.6.3-0ubuntu1
[ Sebastien Bacher ]
* New upstream version
* debian/control.in: recommends libcanberra-pulse (lp: #1004973)
* debian/patches/58_ubuntu_icon_views_redesign.patch:
  - drop most of the changes, keep the different grid size though
    to fit on screen with our extra icons
* debian/patches/91_dont_show_in_unity.patch:
  - dropped, show the upstream printer panel and the layout tab
* debian/patches/revert_git_keyboard_gsettings.patch,
  debian/patches/revert_git_stop_using_gconf.patch:
  - dropped the gconf->gsettings reverts

[ Robert Ancell ]
* New upstream release (LP: #1010317)
* debian/control:
  - Bump build-depends on libgnome-desktop-3-dev, libwacom-dev
  - Add build-depends on libclutter-1.0-dev, libclutter-gtk-1.0-dev,
    libpwquality-dev
  - Drop build-depends on libgnomekbd-dev
* debian/patches/60_ubuntu_nav_bar.patch:
  - Disabled for now, doesn't apply
* debian/patches/revert_ua_gsettings.patch:
  - We can use GSettings for universal access now
* debian/patches/00git_online_accounts_gtkgrid.patch:
* debian/patches/00git_online_accounts_layout.part:
* debian/patches/git_wacom_translations.patch:
  - Applied upstream

[ Iain Lane ]
* Add Build-Depends on libxkbfile-dev
* New upstream release.
* Refresh all patches to apply cleanly.

[ Edward Donovan ]
* debian/source_gnome-control-center.py: Fix for Python 3. (LP: #1013171)

[ Rico Tzschichholz ]
* debian/control.in:
  - Build-depend on gtk-doc-tools instead of docbook directly
  - Bump minimum glib-2.0, gnome-desktop3, gnome-settings-daemon
     and gsettings-desktop-schemas

[ Jeremy Bicha ]
* Dropped more patches applied in new version:
  - git_unmute_sound_event.patch
  - git_fix_big_editable_labels.patch
  - 96_sound_nua_panel.patch
* debian/patches/04_new_appearance_settings.patch:
  - Dropped, this is now packaged separately as gnome-control-center-unity
* debian/patches/10_keyboard_layout_on_unity.patch:
  - Don't change the keyboard panel name when not running Unity
* debian/patches/52_ubuntu_language_list_mods.patch:
  - Don't disable adding current language to the list. While this
    fix shows the current language twice, at least it avoids the
    "Ubuntu suddenly in Chinese" bug (LP: #1035219)
* debian/patches/53_use_ubuntu_help.patch:
  - Only show Ubuntu help when running Unity
* debian/patches/58_hide_gdm_notifications.patch:
  - Hide "Show notifications when locked" settings when running Unity
    since it's a GNOME Shell-specific feature
* debian/patches/63_normal_scrollbar_in_a11y.patch:
  - Drop, overlay-scrollbars should handle this instead
* debian/patches/91_dont_show_in_unity.patch:
  - Hide Printers & Region panels in Unity until we're ready to switch
    to them.
* debian/patches/fix-crash-on-user-panel.patch:
  - Dropped, GNOME says it's obsolete
* debian/rules:
  - Build with -z,defs again
  - Explicitly disable ibus support since ibus 1.4 isn't supported in
    this version
* debian/control.in:
  - Drop ubuntu-docs and gnome-user-guide from recommends to suggests
  - Don't recommend indicators; let's leave that to Unity

[ David Henningsson ]
* sound_nua_panel.patch: Rebase to gnome 3.6 

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
{
33
33
        gchar                           *id;
34
34
        gchar                           *title;
 
35
        gboolean                         removable;
 
36
        GCancellable                    *cancellable;
 
37
        NMClient                        *client;
 
38
        NMRemoteSettings                *remote_settings;
 
39
        CcNetworkPanel                  *panel;
 
40
};
 
41
 
 
42
enum {
 
43
        PROP_0,
 
44
        PROP_ID,
 
45
        PROP_TITLE,
 
46
        PROP_REMOVABLE,
 
47
        PROP_CLIENT,
 
48
        PROP_REMOTE_SETTINGS,
 
49
        PROP_CANCELLABLE,
 
50
        PROP_PANEL,
 
51
        PROP_LAST
35
52
};
36
53
 
37
54
enum {
73
90
        object->priv->id = g_strdup (id);
74
91
}
75
92
 
 
93
gboolean
 
94
net_object_get_removable (NetObject *object)
 
95
{
 
96
        g_return_val_if_fail (NET_IS_OBJECT (object), FALSE);
 
97
        return object->priv->removable;
 
98
}
 
99
 
76
100
const gchar *
77
101
net_object_get_title (NetObject *object)
78
102
{
87
111
        object->priv->title = g_strdup (title);
88
112
}
89
113
 
 
114
NMClient *
 
115
net_object_get_client (NetObject *object)
 
116
{
 
117
        g_return_val_if_fail (NET_IS_OBJECT (object), NULL);
 
118
        return object->priv->client;
 
119
}
 
120
 
 
121
NMRemoteSettings *
 
122
net_object_get_remote_settings (NetObject *object)
 
123
{
 
124
        g_return_val_if_fail (NET_IS_OBJECT (object), NULL);
 
125
        return object->priv->remote_settings;
 
126
}
 
127
 
 
128
GCancellable *
 
129
net_object_get_cancellable (NetObject *object)
 
130
{
 
131
        g_return_val_if_fail (NET_IS_OBJECT (object), NULL);
 
132
        return object->priv->cancellable;
 
133
}
 
134
 
 
135
CcNetworkPanel *
 
136
net_object_get_panel (NetObject *object)
 
137
{
 
138
        g_return_val_if_fail (NET_IS_OBJECT (object), NULL);
 
139
        return object->priv->panel;
 
140
}
 
141
 
 
142
GtkWidget *
 
143
net_object_add_to_notebook (NetObject *object,
 
144
                            GtkNotebook *notebook,
 
145
                            GtkSizeGroup *heading_size_group)
 
146
{
 
147
        GtkWidget *widget;
 
148
        NetObjectClass *klass = NET_OBJECT_GET_CLASS (object);
 
149
        if (klass->add_to_notebook != NULL) {
 
150
                widget = klass->add_to_notebook (object,
 
151
                                                 notebook,
 
152
                                                 heading_size_group);
 
153
                g_object_set_data_full (G_OBJECT (widget),
 
154
                                        "NetObject::id",
 
155
                                        g_strdup (object->priv->id),
 
156
                                        g_free);
 
157
                return widget;
 
158
        }
 
159
        g_debug ("no klass->add_to_notebook for %s", object->priv->id);
 
160
        return NULL;
 
161
}
 
162
 
 
163
void
 
164
net_object_delete (NetObject *object)
 
165
{
 
166
        NetObjectClass *klass = NET_OBJECT_GET_CLASS (object);
 
167
        if (klass->delete != NULL)
 
168
                klass->delete (object);
 
169
}
 
170
 
 
171
void
 
172
net_object_refresh (NetObject *object)
 
173
{
 
174
        NetObjectClass *klass = NET_OBJECT_GET_CLASS (object);
 
175
        if (klass->refresh != NULL)
 
176
                klass->refresh (object);
 
177
}
 
178
 
 
179
void
 
180
net_object_edit (NetObject *object)
 
181
{
 
182
        NetObjectClass *klass = NET_OBJECT_GET_CLASS (object);
 
183
        if (klass->edit != NULL)
 
184
                klass->edit (object);
 
185
}
 
186
 
 
187
/**
 
188
 * net_object_get_property:
 
189
 **/
 
190
static void
 
191
net_object_get_property (GObject *object_,
 
192
                         guint prop_id,
 
193
                         GValue *value,
 
194
                         GParamSpec *pspec)
 
195
{
 
196
        NetObject *object = NET_OBJECT (object_);
 
197
        NetObjectPrivate *priv = object->priv;
 
198
 
 
199
        switch (prop_id) {
 
200
        case PROP_ID:
 
201
                g_value_set_string (value, priv->id);
 
202
                break;
 
203
        case PROP_TITLE:
 
204
                g_value_set_string (value, priv->title);
 
205
                break;
 
206
        case PROP_REMOVABLE:
 
207
                g_value_set_boolean (value, priv->removable);
 
208
                break;
 
209
        case PROP_CLIENT:
 
210
                g_value_set_object (value, priv->client);
 
211
                break;
 
212
        case PROP_REMOTE_SETTINGS:
 
213
                g_value_set_object (value, priv->remote_settings);
 
214
                break;
 
215
        case PROP_CANCELLABLE:
 
216
                g_value_set_object (value, priv->cancellable);
 
217
                break;
 
218
        case PROP_PANEL:
 
219
                g_value_set_object (value, priv->panel);
 
220
                break;
 
221
        default:
 
222
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 
223
                break;
 
224
        }
 
225
}
 
226
 
 
227
/**
 
228
 * net_object_set_property:
 
229
 **/
 
230
static void
 
231
net_object_set_property (GObject *object_,
 
232
                         guint prop_id,
 
233
                         const GValue *value,
 
234
                         GParamSpec *pspec)
 
235
{
 
236
        NetObject *object = NET_OBJECT (object_);
 
237
        NetObjectPrivate *priv = object->priv;
 
238
 
 
239
        switch (prop_id) {
 
240
        case PROP_ID:
 
241
                g_free (priv->id);
 
242
                priv->id = g_strdup (g_value_get_string (value));
 
243
                break;
 
244
        case PROP_TITLE:
 
245
                g_free (priv->title);
 
246
                priv->title = g_strdup (g_value_get_string (value));
 
247
                break;
 
248
        case PROP_REMOVABLE:
 
249
                priv->removable = g_value_get_boolean (value);
 
250
                break;
 
251
        case PROP_CLIENT:
 
252
                priv->client = g_value_dup_object (value);
 
253
                break;
 
254
        case PROP_REMOTE_SETTINGS:
 
255
                priv->remote_settings = g_value_dup_object (value);
 
256
                break;
 
257
        case PROP_CANCELLABLE:
 
258
                priv->cancellable = g_value_dup_object (value);
 
259
                break;
 
260
        case PROP_PANEL:
 
261
                priv->panel = g_value_dup_object (value);
 
262
                break;
 
263
        default:
 
264
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 
265
                break;
 
266
        }
 
267
}
 
268
 
90
269
static void
91
270
net_object_finalize (GObject *object)
92
271
{
95
274
 
96
275
        g_free (priv->id);
97
276
        g_free (priv->title);
98
 
 
 
277
        if (priv->client != NULL)
 
278
                g_object_unref (priv->client);
 
279
        if (priv->remote_settings != NULL)
 
280
                g_object_unref (priv->remote_settings);
 
281
        if (priv->cancellable != NULL)
 
282
                g_object_unref (priv->cancellable);
 
283
        if (priv->panel != NULL)
 
284
                g_object_unref (priv->panel);
99
285
        G_OBJECT_CLASS (net_object_parent_class)->finalize (object);
100
286
}
101
287
 
102
288
static void
103
289
net_object_class_init (NetObjectClass *klass)
104
290
{
 
291
        GParamSpec *pspec;
105
292
        GObjectClass *object_class = G_OBJECT_CLASS (klass);
106
293
        object_class->finalize = net_object_finalize;
 
294
        object_class->get_property = net_object_get_property;
 
295
        object_class->set_property = net_object_set_property;
 
296
 
 
297
        pspec = g_param_spec_string ("id", NULL, NULL,
 
298
                                     NULL,
 
299
                                     G_PARAM_READWRITE);
 
300
        g_object_class_install_property (object_class, PROP_ID, pspec);
 
301
 
 
302
        pspec = g_param_spec_string ("title", NULL, NULL,
 
303
                                     NULL,
 
304
                                     G_PARAM_READWRITE);
 
305
        g_object_class_install_property (object_class, PROP_TITLE, pspec);
 
306
 
 
307
        pspec = g_param_spec_boolean ("removable", NULL, NULL,
 
308
                                      TRUE,
 
309
                                      G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
 
310
        g_object_class_install_property (object_class, PROP_REMOVABLE, pspec);
 
311
 
 
312
        pspec = g_param_spec_object ("client", NULL, NULL,
 
313
                                     NM_TYPE_CLIENT,
 
314
                                     G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
 
315
        g_object_class_install_property (object_class, PROP_CLIENT, pspec);
 
316
 
 
317
        pspec = g_param_spec_object ("remote-settings", NULL, NULL,
 
318
                                     NM_TYPE_REMOTE_SETTINGS,
 
319
                                     G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
 
320
        g_object_class_install_property (object_class, PROP_REMOTE_SETTINGS, pspec);
 
321
 
 
322
        pspec = g_param_spec_object ("cancellable", NULL, NULL,
 
323
                                     G_TYPE_CANCELLABLE,
 
324
                                     G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
 
325
        g_object_class_install_property (object_class, PROP_CANCELLABLE, pspec);
 
326
 
 
327
        pspec = g_param_spec_object ("panel", NULL, NULL,
 
328
                                     CC_TYPE_NETWORK_PANEL,
 
329
                                     G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
 
330
        g_object_class_install_property (object_class, PROP_PANEL, pspec);
107
331
 
108
332
        signals[SIGNAL_CHANGED] =
109
333
                g_signal_new ("changed",
127
351
        object->priv = NET_OBJECT_GET_PRIVATE (object);
128
352
}
129
353
 
130
 
NetObject *
131
 
net_object_new (void)
132
 
{
133
 
        NetObject *object;
134
 
        object = g_object_new (NET_TYPE_OBJECT, NULL);
135
 
        return NET_OBJECT (object);
136
 
}
137