Skip to content

Commit

Permalink
MultiinfoBar: set self revealed (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit authored Feb 2, 2023
1 parent 07302c8 commit 9d63c5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
11 changes: 4 additions & 7 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ public class Torrential.MainWindow : Gtk.ApplicationWindow {
});
application.add_action (show_window);

infobar = new Widgets.MultiInfoBar ();
infobar.set_message_type (Gtk.MessageType.WARNING);
infobar.no_show_all = true;
infobar.visible = false;
infobar = new Widgets.MultiInfoBar () {
revealed = false,
message_type = Gtk.MessageType.WARNING
};

list_box = new Widgets.TorrentListBox (torrent_manager.get_torrents ());
list_box.torrent_removed.connect ((torrent) => torrent_manager.remove_torrent (torrent));
Expand Down Expand Up @@ -472,7 +472,6 @@ public class Torrential.MainWindow : Gtk.ApplicationWindow {
}
if (errors.size > 0) {
infobar.add_errors (errors);
infobar.show ();
}
}

Expand All @@ -491,11 +490,9 @@ public class Torrential.MainWindow : Gtk.ApplicationWindow {
}
} else if (result == Transmission.ParseResult.ERR) {
infobar.add_error (_("Failed to add magnet link as it doesn\u2019t appear to be valid."));
infobar.show ();
send_magnet_error_notification ();
} else {
infobar.add_error (_("Didn\u2019t add magnet link. An identical torrent has already been added."));
infobar.show ();
send_magnet_error_notification ();
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/Widgets/MultiInfoBar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class Torrential.Widgets.MultiInfoBar : Gtk.InfoBar {
}

private void close_bar () {
hide ();
revealed = false;
infobar_errors.clear ();
}

Expand All @@ -69,6 +69,7 @@ public class Torrential.Widgets.MultiInfoBar : Gtk.InfoBar {
next_button.hide ();
}
infobar_label.show ();
revealed = true;
}
}
}

0 comments on commit 9d63c5d

Please sign in to comment.