Skip to content

Commit

Permalink
Merge branch 'master' into danirabbit/vpninfo-edit
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremypw authored Jan 19, 2024
2 parents 4661591 + fe62040 commit 8b32add
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/Widgets/VPN/VPNMenuItem.vala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public class Network.VPNMenuItem : Gtk.ListBoxRow {
private Gtk.Image vpn_state;
private Gtk.Label state_label;
private Gtk.Label vpn_label;
private Widgets.VPNInfoDialog vpn_info_dialog;

public VPNMenuItem (NM.RemoteConnection _connection) {
Object (
Expand Down Expand Up @@ -61,10 +60,6 @@ public class Network.VPNMenuItem : Gtk.ListBoxRow {
xalign = 0
};

vpn_info_dialog = new Widgets.VPNInfoDialog (connection) {
modal = true
};

var vpn_info_button = new Gtk.Button () {
image = new Gtk.Image.from_icon_name ("view-more-horizontal-symbolic", Gtk.IconSize.MENU),
margin_end = 3,
Expand Down Expand Up @@ -99,7 +94,12 @@ public class Network.VPNMenuItem : Gtk.ListBoxRow {
connect_button.clicked.connect (() => activate ());

vpn_info_button.clicked.connect (() => {
vpn_info_dialog.transient_for = (Gtk.Window) get_toplevel ();
var vpn_info_dialog = new Widgets.VPNInfoDialog (connection) {
modal = true,
secondary_text = Utils.state_to_string (state),
transient_for = (Gtk.Window) get_toplevel ()
};

vpn_info_dialog.present ();
});
}
Expand Down Expand Up @@ -139,7 +139,6 @@ public class Network.VPNMenuItem : Gtk.ListBoxRow {
}

state_label.label = GLib.Markup.printf_escaped ("<span font_size='small'>%s</span>", Utils.state_to_string (state));
vpn_info_dialog.secondary_text = Utils.state_to_string (state);
}

}

0 comments on commit 8b32add

Please sign in to comment.