Skip to content

Commit

Permalink
reduced time options in scope
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Munoz committed Aug 21, 2022
1 parent ce60368 commit 73ac996
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/TimeOptions.vala
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,22 @@ namespace TimeOptions {
}

public class ComboBox : Gtk.ComboBox {
private Gtk.ListStore data;
private TimeOptions.Value[] options = {
new TimeOptions.Value ("30 Minutes", minutes_to_milis (30)),
new TimeOptions.Value ("1 Hour", minutes_to_milis (60)),
new TimeOptions.Value ("2 Hours", minutes_to_milis (120)),
new TimeOptions.Value ("4 Hours", minutes_to_milis (240)),
new TimeOptions.Value ("5 Hours", minutes_to_milis (300)),
};
private Gtk.ListStore data;

public ComboBox () {
Gtk.TreeIter iterator;
Gtk.CellRendererText renderer = new Gtk.CellRendererText ();

this.data = new Gtk.ListStore (2, typeof (string), typeof (int));

TimeOptions.Value[] options = {
new TimeOptions.Value ("30 Minutes", minutes_to_milis (30)),
new TimeOptions.Value ("1 Hour", minutes_to_milis (60)),
new TimeOptions.Value ("2 Hours", minutes_to_milis (120)),
new TimeOptions.Value ("4 Hours", minutes_to_milis (240)),
new TimeOptions.Value ("5 Hours", minutes_to_milis (300)),
};

foreach (TimeOptions.Value item in options) {
data.append (out iterator);
data.set (iterator, 0, item.label, 1, item.timeout, -1);
Expand Down

0 comments on commit 73ac996

Please sign in to comment.