protected override void CopyItems(Result[] r) { int t = base.TotalItems; base.CopyItems(r); r[t] = new MBString(Program); }
protected override void CopyItems (Result[] r) { int t = base.TotalItems; base.CopyItems (r); r[t] = new MBString (ForcedArgs); r[t + 1] = environment; r[t + 2] = new ArchKindResult (Architecture); }
protected override void CopyItems(Result[] r) { int t = base.TotalItems; base.CopyItems(r); r[t] = new MBString(ForcedArgs); r[t + 1] = environment; r[t + 2] = new ArchKindResult(Architecture); }
void OnStringTimeout(Entry entry) { BuildServices services = (BuildServices)entry.Data[services_key]; MBString val = (MBString)entry.Data[result_key]; val.Value = entry.Text; Console.WriteLine("Fixing {0} = {1}", services.FullName, val); services.FixValue(val); timeouts.Remove(entry); }
void DoConfigString(string prompt, MBString res) { Console.WriteLine("{0} (default: {1})", prompt, res.Value); string response = Console.ReadLine(); if (response == "") { Console.WriteLine("(Didn't understand; going with the default.)"); } else { res.Value = response; } }
Widget MakeStringItem(BuildServices services, string prompt, MBString res) { HBox box = new HBox(); box.Show(); Label label = new Label(prompt); label.Show(); label.Xalign = 1.0F; Entry entry = new Entry(res.Value); entry.Show(); entry.Data[result_key] = res; entry.Data[services_key] = services; entry.Changed += new EventHandler(OnStringChanged); box.PackStart(label, true, true, 2); box.PackStart(entry, false, true, 2); return(box); }
bool LoadConfigItem(WrenchProject proj, BuildServices bs) { string prompt, group; string target = bs.FullName; Result res = bs.GetValue().Result; if (res == null) { return(true); } Result tag; if (bs.GetTag("prompt", out tag)) { return(true); } MBString rstr = tag as MBString; if (rstr == null) { // FIXME Console.Error.WriteLine("Configurable option " + target + " does not have a string \'prompt\' tag."); prompt = target; } else { // TODO: i18n prompt = rstr.Value; } if (bs.GetTag("config_group", out tag)) { return(true); } rstr = tag as MBString; if (rstr == null) { group = DefaultGroupName; } else { // TODO: i18n group = rstr.Value; } Widget widget = null; if (res is MBBool) { widget = MakeBoolItem(bs, prompt, (MBBool)res); } else if (res is MBString) { widget = MakeStringItem(bs, prompt, (MBString)res); } else { // FIXME Console.Error.WriteLine("Don't know how to configure the option {0}.", target); return(true); } AddGuiItem(group, widget); return(false); }
protected override void CopyItems (Result[] r) { int t = base.TotalItems; base.CopyItems (r); r[t] = new MBString (Program); }
public void SetString (string key, string val) { if (val == null) store[key] = null; else store[key] = new MBString (val); }
Widget MakeStringItem (BuildServices services, string prompt, MBString res) { HBox box = new HBox (); box.Show (); Label label = new Label (prompt); label.Show (); label.Xalign = 1.0F; Entry entry = new Entry (res.Value); entry.Show (); entry.Data[result_key] = res; entry.Data[services_key] = services; entry.Changed += new EventHandler (OnStringChanged); box.PackStart (label, true, true, 2); box.PackStart (entry, false, true, 2); return box; }
void DoConfigString (string prompt, MBString res) { Console.WriteLine ("{0} (default: {1})", prompt, res.Value); string response = Console.ReadLine (); if (response == "") Console.WriteLine ("(Didn't understand; going with the default.)"); else res.Value = response; }