87
111
object->priv->title = g_strdup (title);
115
net_object_get_client (NetObject *object)
117
g_return_val_if_fail (NET_IS_OBJECT (object), NULL);
118
return object->priv->client;
122
net_object_get_remote_settings (NetObject *object)
124
g_return_val_if_fail (NET_IS_OBJECT (object), NULL);
125
return object->priv->remote_settings;
129
net_object_get_cancellable (NetObject *object)
131
g_return_val_if_fail (NET_IS_OBJECT (object), NULL);
132
return object->priv->cancellable;
136
net_object_get_panel (NetObject *object)
138
g_return_val_if_fail (NET_IS_OBJECT (object), NULL);
139
return object->priv->panel;
143
net_object_add_to_notebook (NetObject *object,
144
GtkNotebook *notebook,
145
GtkSizeGroup *heading_size_group)
148
NetObjectClass *klass = NET_OBJECT_GET_CLASS (object);
149
if (klass->add_to_notebook != NULL) {
150
widget = klass->add_to_notebook (object,
153
g_object_set_data_full (G_OBJECT (widget),
155
g_strdup (object->priv->id),
159
g_debug ("no klass->add_to_notebook for %s", object->priv->id);
164
net_object_delete (NetObject *object)
166
NetObjectClass *klass = NET_OBJECT_GET_CLASS (object);
167
if (klass->delete != NULL)
168
klass->delete (object);
172
net_object_refresh (NetObject *object)
174
NetObjectClass *klass = NET_OBJECT_GET_CLASS (object);
175
if (klass->refresh != NULL)
176
klass->refresh (object);
180
net_object_edit (NetObject *object)
182
NetObjectClass *klass = NET_OBJECT_GET_CLASS (object);
183
if (klass->edit != NULL)
184
klass->edit (object);
188
* net_object_get_property:
191
net_object_get_property (GObject *object_,
196
NetObject *object = NET_OBJECT (object_);
197
NetObjectPrivate *priv = object->priv;
201
g_value_set_string (value, priv->id);
204
g_value_set_string (value, priv->title);
207
g_value_set_boolean (value, priv->removable);
210
g_value_set_object (value, priv->client);
212
case PROP_REMOTE_SETTINGS:
213
g_value_set_object (value, priv->remote_settings);
215
case PROP_CANCELLABLE:
216
g_value_set_object (value, priv->cancellable);
219
g_value_set_object (value, priv->panel);
222
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
228
* net_object_set_property:
231
net_object_set_property (GObject *object_,
236
NetObject *object = NET_OBJECT (object_);
237
NetObjectPrivate *priv = object->priv;
242
priv->id = g_strdup (g_value_get_string (value));
245
g_free (priv->title);
246
priv->title = g_strdup (g_value_get_string (value));
249
priv->removable = g_value_get_boolean (value);
252
priv->client = g_value_dup_object (value);
254
case PROP_REMOTE_SETTINGS:
255
priv->remote_settings = g_value_dup_object (value);
257
case PROP_CANCELLABLE:
258
priv->cancellable = g_value_dup_object (value);
261
priv->panel = g_value_dup_object (value);
264
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
91
270
net_object_finalize (GObject *object)
96
275
g_free (priv->id);
97
276
g_free (priv->title);
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);
103
289
net_object_class_init (NetObjectClass *klass)
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;
297
pspec = g_param_spec_string ("id", NULL, NULL,
300
g_object_class_install_property (object_class, PROP_ID, pspec);
302
pspec = g_param_spec_string ("title", NULL, NULL,
305
g_object_class_install_property (object_class, PROP_TITLE, pspec);
307
pspec = g_param_spec_boolean ("removable", NULL, NULL,
309
G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
310
g_object_class_install_property (object_class, PROP_REMOVABLE, pspec);
312
pspec = g_param_spec_object ("client", NULL, NULL,
314
G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
315
g_object_class_install_property (object_class, PROP_CLIENT, pspec);
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);
322
pspec = g_param_spec_object ("cancellable", NULL, NULL,
324
G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
325
g_object_class_install_property (object_class, PROP_CANCELLABLE, pspec);
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);
108
332
signals[SIGNAL_CHANGED] =
109
333
g_signal_new ("changed",