void RunInstall (Gtk.Alignment commandBox, Update update) { installing = true; ProgressBarMonitor monitorBar = new ProgressBarMonitor (); monitorBar.ShowErrorsDialog = true; monitorBar.Show (); commandBox.Child.Destroy (); commandBox.Add (monitorBar); IAsyncOperation oper = update.InstallAction (monitorBar.CreateProgressMonitor ()); oper.Completed += delegate { DispatchService.GuiDispatch (delegate { monitorBar.Hide (); Gtk.Label result = new Gtk.Label (); if (oper.Success) result.Text = GettextCatalog.GetString ("Completed"); else result.Text = GettextCatalog.GetString ("Failed"); commandBox.Child.Destroy (); commandBox.Add (result); result.Show (); installing = false; if (installQueue.Count > 0) installQueue.Dequeue ()(); }); }; }
void RunInstall (HBox labelBox, Update update) { installing = true; ProgressBarMonitor monitorBar = new ProgressBarMonitor (); monitorBar.ShowErrorsDialog = true; monitorBar.Show (); labelBox.PackStart (monitorBar, false, false, 0); IAsyncOperation oper = update.InstallAction (monitorBar.CreateProgressMonitor ()); oper.Completed += delegate { DispatchService.GuiDispatch (delegate { monitorBar.Hide (); Gtk.Label result = new Gtk.Label (); if (oper.Success) result.Text = GettextCatalog.GetString ("Completed"); else result.Text = GettextCatalog.GetString ("Failed"); labelBox.PackStart (result, false, false, 0); result.Show (); installing = false; if (installQueue.Count > 0) installQueue.Dequeue ()(); }); }; }
void Install (Gtk.Alignment commandBox, Button installButton, Update update) { if (update.InstallAction == null) { DesktopService.ShowUrl (update.Url); return; } installButton.Hide (); if (installing) { Gtk.Label lab = new Gtk.Label (GettextCatalog.GetString ("Waiting")); commandBox.Child.Destroy (); commandBox.Add (lab); lab.Show (); installQueue.Enqueue (delegate { lab.Hide (); RunInstall (commandBox, update); }); return; } RunInstall (commandBox, update); }
void Install (HBox labelBox, Button installButton, Update update) { if (update.InstallAction == null) { DesktopService.ShowUrl (update.Url); return; } installButton.Hide (); if (installing) { Gtk.Label lab = new Gtk.Label (GettextCatalog.GetString ("Waiting")); labelBox.PackStart (lab, false, false, 0); lab.Show (); installQueue.Enqueue (delegate { lab.Hide (); RunInstall (labelBox, update); }); return; } RunInstall (labelBox, update); }