[gnome-control-center] user-accounts: Move realm model into .ui file
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] user-accounts: Move realm model into .ui file
- Date: Fri, 9 Nov 2018 20:45:47 +0000 (UTC)
commit 1691cd74fc14bcf683629b07e8f12fe094b5edb8
Author: Robert Ancell <robert ancell canonical com>
Date: Wed Nov 7 14:10:42 2018 +1300
user-accounts: Move realm model into .ui file
panels/user-accounts/cc-add-user-dialog.c | 7 ++-----
panels/user-accounts/cc-add-user-dialog.ui | 9 +++++++++
2 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/panels/user-accounts/cc-add-user-dialog.c b/panels/user-accounts/cc-add-user-dialog.c
index 0521853fc..99107d180 100644
--- a/panels/user-accounts/cc-add-user-dialog.c
+++ b/panels/user-accounts/cc-add-user-dialog.c
@@ -72,6 +72,7 @@ struct _CcAddUserDialog {
GtkLabel *enterprise_hint;
GtkEntry *enterprise_login;
GtkEntry *enterprise_password;
+ GtkListStore *enterprise_realms;
GtkLabel *local_hint;
GtkEntry *local_name;
GtkRadioButton *local_password_radio;
@@ -97,7 +98,6 @@ struct _CcAddUserDialog {
gint local_password_timeout_id;
guint realmd_watch;
- GtkListStore *enterprise_realms;
UmRealmManager *realm_manager;
UmRealmObject *selected_realm;
gboolean enterprise_check_credentials;
@@ -1336,13 +1336,10 @@ enterprise_init (CcAddUserDialog *self)
{
GNetworkMonitor *monitor;
- self->enterprise_realms = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_OBJECT);
self->enterprise_check_credentials = FALSE;
g_signal_connect (self->enterprise_domain, "changed", G_CALLBACK (on_domain_changed), self);
g_signal_connect_after (self->enterprise_domain, "focus-out-event", G_CALLBACK
(on_enterprise_domain_focus_out), self);
- gtk_combo_box_set_model (GTK_COMBO_BOX (self->enterprise_domain),
- GTK_TREE_MODEL (self->enterprise_realms));
enterprise_check_domain (self);
g_signal_connect (self->enterprise_login, "changed", G_CALLBACK (on_entry_changed), self);
@@ -1550,7 +1547,6 @@ cc_add_user_dialog_finalize (GObject *obj)
if (self->cancellable)
g_object_unref (self->cancellable);
g_clear_object (&self->permission);
- g_object_unref (self->enterprise_realms);
G_OBJECT_CLASS (cc_add_user_dialog_parent_class)->finalize (obj);
}
@@ -1578,6 +1574,7 @@ cc_add_user_dialog_class_init (CcAddUserDialogClass *klass)
gtk_widget_class_bind_template_child (widget_class, CcAddUserDialog, enterprise_hint);
gtk_widget_class_bind_template_child (widget_class, CcAddUserDialog, enterprise_login);
gtk_widget_class_bind_template_child (widget_class, CcAddUserDialog, enterprise_password);
+ gtk_widget_class_bind_template_child (widget_class, CcAddUserDialog, enterprise_realms);
gtk_widget_class_bind_template_child (widget_class, CcAddUserDialog, local_hint);
gtk_widget_class_bind_template_child (widget_class, CcAddUserDialog, local_name);
gtk_widget_class_bind_template_child (widget_class, CcAddUserDialog, local_password_radio);
diff --git a/panels/user-accounts/cc-add-user-dialog.ui b/panels/user-accounts/cc-add-user-dialog.ui
index 847989300..0ae4d07dc 100644
--- a/panels/user-accounts/cc-add-user-dialog.ui
+++ b/panels/user-accounts/cc-add-user-dialog.ui
@@ -571,6 +571,7 @@
<property name="hexpand">True</property>
<property name="has_entry">True</property>
<property name="entry_text_column">0</property>
+ <property name="model">enterprise_realms</property>
<child internal-child="entry">
<object class="GtkEntry" id="enterprise_domain_entry">
<property name="can_focus">True</property>
@@ -827,4 +828,12 @@
<widget name="button2"/>
</widgets>
</object>
+ <object class="GtkListStore" id="enterprise_realms">
+ <columns>
+ <!-- column-name title -->
+ <column type="gchararray"/>
+ <!-- column-name realm -->
+ <column type="GObject"/>
+ </columns>
+ </object>
</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]