Skip to content
Snippets Groups Projects
Commit 765e320f authored by Sébastien Blin's avatar Sébastien Blin
Browse files

settings: change UI for accounts with a managerUri

Linking and revoking device, or registering usernames is not
available for accounts with a managerUri.

Change-Id: I5e38869a657c653925fd35e0f93c01decc15f62d
parent ceaa495e
Branches
No related tags found
No related merge requests found
...@@ -66,6 +66,7 @@ struct _NewAccountSettingsViewPrivate ...@@ -66,6 +66,7 @@ struct _NewAccountSettingsViewPrivate
GtkWidget* stack_account; GtkWidget* stack_account;
GtkWidget* general_settings_box; GtkWidget* general_settings_box;
GtkWidget* box_account;
GtkWidget* sip_account_enabled; GtkWidget* sip_account_enabled;
GtkWidget* account_enabled; GtkWidget* account_enabled;
GtkWidget* sip_label_status; GtkWidget* sip_label_status;
...@@ -79,6 +80,7 @@ struct _NewAccountSettingsViewPrivate ...@@ -79,6 +80,7 @@ struct _NewAccountSettingsViewPrivate
GtkWidget* account_options_box; GtkWidget* account_options_box;
GtkWidget* type_box; GtkWidget* type_box;
GtkWidget* label_type_info; GtkWidget* label_type_info;
GtkWidget* username_row;
GtkWidget* username_box; GtkWidget* username_box;
GtkWidget* password_row; GtkWidget* password_row;
GtkWidget* label_change_password; GtkWidget* label_change_password;
...@@ -254,6 +256,7 @@ new_account_settings_view_class_init(NewAccountSettingsViewClass *klass) ...@@ -254,6 +256,7 @@ new_account_settings_view_class_init(NewAccountSettingsViewClass *klass)
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, stack_account); gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, stack_account);
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, general_settings_box); gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, general_settings_box);
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, box_account);
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, account_enabled); gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, account_enabled);
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, sip_account_enabled); gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, sip_account_enabled);
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, sip_label_status); gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, sip_label_status);
...@@ -266,6 +269,7 @@ new_account_settings_view_class_init(NewAccountSettingsViewClass *klass) ...@@ -266,6 +269,7 @@ new_account_settings_view_class_init(NewAccountSettingsViewClass *klass)
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, account_options_box); gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, account_options_box);
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, type_box); gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, type_box);
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, label_type_info); gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, label_type_info);
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, username_row);
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, username_box); gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, username_box);
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, password_row); gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, password_row);
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, label_change_password); gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), NewAccountSettingsView, label_change_password);
...@@ -2002,6 +2006,8 @@ new_account_settings_view_update(NewAccountSettingsView *view, gboolean reset_vi ...@@ -2002,6 +2006,8 @@ new_account_settings_view_update(NewAccountSettingsView *view, gboolean reset_vi
return; return;
} }
bool has_account_manager = !priv->currentProp_->managerUri.empty();
auto label_status = priv->label_status; auto label_status = priv->label_status;
if ((*priv->accountInfo_)->profileInfo.type != lrc::api::profile::Type::RING) { if ((*priv->accountInfo_)->profileInfo.type != lrc::api::profile::Type::RING) {
label_status = priv->sip_label_status; label_status = priv->sip_label_status;
...@@ -2111,6 +2117,13 @@ new_account_settings_view_update(NewAccountSettingsView *view, gboolean reset_vi ...@@ -2111,6 +2117,13 @@ new_account_settings_view_update(NewAccountSettingsView *view, gboolean reset_vi
max_width = std::max(max_width, label_password.size()); max_width = std::max(max_width, label_password.size());
if (label_id.size() != max_width) if (label_id.size() != max_width)
gtk_label_set_width_chars(GTK_LABEL(priv->label_id), max_width + 1); gtk_label_set_width_chars(GTK_LABEL(priv->label_id), max_width + 1);
gtk_button_set_label(GTK_BUTTON(priv->button_delete_account), has_account_manager? _("Remove account") : _("Delete account"));
if (has_account_manager) {
gtk_widget_hide(priv->button_export_account);
gtk_widget_hide(priv->password_row);
gtk_widget_hide(priv->button_add_device);
}
} else { } else {
gtk_switch_set_active(GTK_SWITCH(priv->sip_account_enabled), (*priv->accountInfo_)->enabled); gtk_switch_set_active(GTK_SWITCH(priv->sip_account_enabled), (*priv->accountInfo_)->enabled);
......
...@@ -315,7 +315,7 @@ ...@@ -315,7 +315,7 @@
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">8</property> <property name="spacing">8</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox" id="box_account">
<property name="visible">True</property> <property name="visible">True</property>
<property name="spacing">24</property> <property name="spacing">24</property>
<property name="orientation">horizontal</property> <property name="orientation">horizontal</property>
...@@ -480,7 +480,7 @@ ...@@ -480,7 +480,7 @@
</child> </child>
<child> <child>
<!-- Username --> <!-- Username -->
<object class="GtkListBoxRow"> <object class="GtkListBoxRow" id="username_row">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="halign">fill</property> <property name="halign">fill</property>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment