Skip to content

Commit

Permalink
VPNMenuItem: fix empty info dialog (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit authored Jan 19, 2024
1 parent d1c7926 commit fe62040
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 ();
vpn_info_dialog.response.connect (vpn_info_dialog.destroy);
});
Expand Down Expand Up @@ -140,7 +140,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 fe62040

Please sign in to comment.