From 73ac996f135c69b5609e607948435c4f97c0587e Mon Sep 17 00:00:00 2001 From: Jose Munoz Date: Sat, 20 Aug 2022 18:12:26 -0700 Subject: [PATCH] reduced time options in scope --- src/TimeOptions.vala | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/TimeOptions.vala b/src/TimeOptions.vala index 0d0ccd6..0506147 100644 --- a/src/TimeOptions.vala +++ b/src/TimeOptions.vala @@ -18,14 +18,7 @@ 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; @@ -33,6 +26,14 @@ namespace TimeOptions { 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);