[NetworkManager-fortisslvpn/lr/gtk4: 2/5] editor: move the labels to a size group
- From: Lubomir Rintel <lkundrak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [NetworkManager-fortisslvpn/lr/gtk4: 2/5] editor: move the labels to a size group
- Date: Tue, 12 Oct 2021 08:30:02 +0000 (UTC)
commit a1df876a7d7b7cae229f7ce61c1b643de883367e
Author: Lubomir Rintel <lkundrak v3 sk>
Date: Mon Oct 11 13:28:15 2021 +0200
editor: move the labels to a size group
...and do that in the GtkBuilder file.
properties/nm-fortisslvpn-dialog.ui | 7 +++++++
properties/nm-fortisslvpn-editor.c | 13 ++-----------
2 files changed, 9 insertions(+), 11 deletions(-)
---
diff --git a/properties/nm-fortisslvpn-dialog.ui b/properties/nm-fortisslvpn-dialog.ui
index 68dda47..88a24ae 100644
--- a/properties/nm-fortisslvpn-dialog.ui
+++ b/properties/nm-fortisslvpn-dialog.ui
@@ -453,6 +453,13 @@ config: the first parameter of fortisslvpn</property>
<placeholder/>
</child>
</object>
+ <object class="GtkSizeGroup" id="group">
+ <widgets>
+ <widget name="label2"/>
+ <widget name="label26"/>
+ <widget name="label23"/>
+ </widgets>
+ </object>
<object class="GtkListStore" id="model1">
<columns>
<!-- column-name gchararray -->
diff --git a/properties/nm-fortisslvpn-editor.c b/properties/nm-fortisslvpn-editor.c
index 0a5d951..6d87d87 100644
--- a/properties/nm-fortisslvpn-editor.c
+++ b/properties/nm-fortisslvpn-editor.c
@@ -36,7 +36,6 @@
typedef struct {
GtkBuilder *builder;
GtkWidget *widget;
- GtkSizeGroup *group;
GtkWindowGroup *window_group;
gboolean window_added;
gboolean new_connection;
@@ -74,7 +73,6 @@ setup_password_widget (FortisslvpnEditor *self,
widget = (GtkWidget *) gtk_builder_get_object (priv->builder, entry_name);
g_assert (widget);
- gtk_size_group_add_widget (priv->group, widget);
if (s_vpn) {
value = nm_setting_vpn_get_secret (s_vpn, secret_name);
@@ -209,16 +207,16 @@ init_editor_plugin (FortisslvpnEditor *self, NMConnection *connection, GError **
FortisslvpnEditorPrivate *priv = FORTISSLVPN_EDITOR_GET_PRIVATE (self);
NMSettingVpn *s_vpn;
GtkWidget *widget;
+ GtkSizeGroup *group;
const char *value;
s_vpn = (NMSettingVpn *) nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN);
- priv->group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+ group = GTK_SIZE_GROUP (gtk_builder_get_object (priv->builder, "group"));
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "gateway_entry"));
g_return_val_if_fail (widget, FALSE);
- gtk_size_group_add_widget (priv->group, widget);
if (s_vpn) {
value = nm_setting_vpn_get_data_item (s_vpn, NM_FORTISSLVPN_KEY_GATEWAY);
if (value && strlen (value))
@@ -229,7 +227,6 @@ init_editor_plugin (FortisslvpnEditor *self, NMConnection *connection, GError **
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "user_entry"));
g_return_val_if_fail (widget, FALSE);
- gtk_size_group_add_widget (priv->group, widget);
if (s_vpn) {
value = nm_setting_vpn_get_data_item (s_vpn, NM_FORTISSLVPN_KEY_USER);
if (value && strlen (value))
@@ -291,7 +288,6 @@ init_editor_plugin (FortisslvpnEditor *self, NMConnection *connection, GError **
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "ca_chooser"));
g_return_val_if_fail (widget, FALSE);
- gtk_size_group_add_widget (priv->group, widget);
if (s_vpn) {
value = nm_setting_vpn_get_data_item (s_vpn, NM_FORTISSLVPN_KEY_CA);
if (value && strlen (value))
@@ -302,7 +298,6 @@ init_editor_plugin (FortisslvpnEditor *self, NMConnection *connection, GError **
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "cert_chooser"));
g_return_val_if_fail (widget, FALSE);
- gtk_size_group_add_widget (priv->group, widget);
if (s_vpn) {
value = nm_setting_vpn_get_data_item (s_vpn, NM_FORTISSLVPN_KEY_CERT);
if (value && strlen (value))
@@ -313,7 +308,6 @@ init_editor_plugin (FortisslvpnEditor *self, NMConnection *connection, GError **
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "key_chooser"));
g_return_val_if_fail (widget, FALSE);
- gtk_size_group_add_widget (priv->group, widget);
if (s_vpn) {
value = nm_setting_vpn_get_data_item (s_vpn, NM_FORTISSLVPN_KEY_KEY);
if (value && strlen (value))
@@ -521,9 +515,6 @@ dispose (GObject *object)
plugin);
}
- if (priv->group)
- g_object_unref (priv->group);
-
if (priv->window_group)
g_object_unref (priv->window_group);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]