Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultiInfoBar: use add_button #170

Merged
merged 1 commit into from
Feb 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions src/Widgets/MultiInfoBar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,20 @@
*/

public class Torrential.Widgets.MultiInfoBar : Gtk.InfoBar {

private Gtk.Label infobar_label = new Gtk.Label ("");
private Gee.ArrayQueue<string> infobar_errors = new Gee.ArrayQueue<string> ();
private Gtk.Button next_button;

construct {
var content = get_content_area ();
content.add (infobar_label);
get_content_area ().add (infobar_label);

var action = get_action_area () as Gtk.ButtonBox;
next_button = new Gtk.Button.with_label (_("Next Warning"));
next_button = (Gtk.Button) add_button (_("Next Warning"), 0);
next_button.clicked.connect (() => next_error ());
var close_button = new Gtk.Button.with_label (_("Close"));

var close_button = (Gtk.Button) add_button (_("Close"), Gtk.ResponseType.CLOSE);
close_button.clicked.connect (() => close_bar ());
action.add (next_button);
action.add (close_button);
action.show_all ();

show_all ();
}

public void add_errors (Gee.ArrayList<string> errors) {
Expand Down