using System; namespace zero { namespace netboot { public partial class ProgressWindow : Gtk.Window { public bool pulse; public string title; public ProgressWindow (string title) : base(Gtk.WindowType.Toplevel) { this.Build (); pulse=true; progressTitle.UseMarkup = true; progressTitle.LabelProp = title; GLib.Timeout.Add(100,new GLib.TimeoutHandler(move_pulse)); } public ProgressWindow (string title, bool pulse) : base(Gtk.WindowType.Toplevel) { this.Build (); this.pulse = pulse; progressTitle.UseMarkup = true; progressTitle.LabelProp = title; if (this.pulse) GLib.Timeout.Add(100,new GLib.TimeoutHandler(move_pulse)); else progressbar.Text = ""; } public bool move_pulse() { if(pulse) progressbar.Pulse(); progressbar.Text = ""; return true; } public void set_fraction(double percent, string text) { progressbar.Fraction = percent; progressbar.Text = text; } public void set_pulse() { progressbar.Pulse(); } public void set_text(string text) { progressbar.Text = text; } protected virtual void OnDeleteEvent (object o, Gtk.DeleteEventArgs args) { if (zero.netboot.Core.getCore().iso_options_running){ Console.WriteLine("Please wait..."); } } } } }