public void ShowProgressbar(string option) { if (option == "creating") { progressbarVersion.Show(); progressbarSubRate.Show(); } else if (option == "updating") { progressbarVersion.Show(); progressbarRate.Show(); progressbarSubRate.Show(); } }
public DiskProgressPane() : base() { this.ShadowType = ShadowType.None; pane = new MessagePane (); pane.HeaderIconStock = Stock.DialogInfo; pane.HeaderMarkup = Catalog.GetString ("<b>Creating Hard Disks</b>"); pane.Append (Catalog.GetString ("Creating the hard disk(s) may take several minutes, depending on their size."), false); progressBar = new ProgressBar (); pane.Append (progressBar, AttachOptions.Expand | AttachOptions.Fill, 0, false); progressBar.Show (); Add (pane); pane.Show (); }
public ProgressPanel (string message, string button, StartWorkDelegate StartWork, FinishWorkDelegate FinishWork) { Gtk.Label l = new Gtk.Label (message); l.UseMarkup = true; l.Show (); PackStart (l); pb = new ProgressBar (); pb.Show (); PackEnd (pb, false, false, 3); Button b = new Button (button); b.Show (); b.Clicked += new EventHandler (OnStartWorking); PackEnd (b, false, false, 3); this.StartWork = StartWork; this.FinishWork = FinishWork; }
private void onInstallClicked(object sender, EventArgs a) { string tmpfile = "/tmp/newgang.deb"; UpdateProgressBar.Show(); try { new CFileDownloader(config).DownloadFile(config.NewestVersionDownloadLocation, tmpfile, UpdateProgressBar); if (File.Exists(tmpfile)) { CUtility.ExecuteSu(config, "gdebi-gtk " + tmpfile); } removeClickHandler(onInstallClicked); setHeaderLabelText(Catalog.GetString("All operations are done, do you like to restart GANG?")); UpdateStatusLabel.Text = Catalog.GetString("Restart app?"); UpdateStatusImage.Stock = Gtk.Stock.DialogQuestion; addClickHandler(onRestartClicked); } catch { } }
// TODO: Possible to make Tomboy not crash if quit while dialog is up? public SyncDialog () : base (string.Empty, null, Gtk.DialogFlags.DestroyWithParent) { progressBarTimeoutId = 0; SetSizeRequest (400, -1); HasSeparator = false; // Outer box. Surrounds all of our content. VBox outerVBox = new VBox (false, 12); outerVBox.BorderWidth = 6; outerVBox.Show (); VBox.PackStart (outerVBox, true, true, 0); // Top image and label HBox hbox = new HBox (false, 12); hbox.Show (); outerVBox.PackStart (hbox, false, false, 0); image = new Image (GuiUtils.GetIcon ("tomboy", 48)); image.Xalign = 0; image.Yalign = 0; image.Show (); hbox.PackStart (image, false, false, 0); // Label header and message VBox vbox = new VBox (false, 6); vbox.Show (); hbox.PackStart (vbox, true, true, 0); headerLabel = new Label (); headerLabel.UseMarkup = true; headerLabel.Xalign = 0; headerLabel.UseUnderline = false; headerLabel.LineWrap = true; headerLabel.Show (); vbox.PackStart (headerLabel, false, false, 0); messageLabel = new Label (); messageLabel.Xalign = 0; messageLabel.UseUnderline = false; messageLabel.LineWrap = true; messageLabel.SetSizeRequest (250, -1); messageLabel.Show (); vbox.PackStart (messageLabel, false, false, 0); progressBar = new Gtk.ProgressBar (); progressBar.Orientation = Gtk.ProgressBarOrientation.LeftToRight; progressBar.BarStyle = ProgressBarStyle.Continuous; progressBar.ActivityBlocks = 30; progressBar.Show (); outerVBox.PackStart (progressBar, false, false, 0); progressLabel = new Label (); progressLabel.UseMarkup = true; progressLabel.Xalign = 0; progressLabel.UseUnderline = false; progressLabel.LineWrap = true; progressLabel.Wrap = true; progressLabel.Show (); outerVBox.PackStart (progressLabel, false, false, 0); // Expander containing TreeView expander = new Gtk.Expander (Catalog.GetString ("Details")); expander.Spacing = 6; expander.Activated += OnExpanderActivated; expander.Show (); outerVBox.PackStart (expander, true, true, 0); // Contents of expander Gtk.VBox expandVBox = new Gtk.VBox (); expandVBox.Show (); expander.Add (expandVBox); // Scrolled window around TreeView Gtk.ScrolledWindow scrolledWindow = new Gtk.ScrolledWindow (); scrolledWindow.ShadowType = Gtk.ShadowType.In; scrolledWindow.SetSizeRequest (-1, 200); scrolledWindow.Show (); expandVBox.PackStart (scrolledWindow, true, true, 0); // Create model for TreeView model = new Gtk.TreeStore (typeof (string), typeof (string)); // Create TreeView, attach model Gtk.TreeView treeView = new Gtk.TreeView (); treeView.Model = model; treeView.RowActivated += OnRowActivated; treeView.Show (); scrolledWindow.Add (treeView); // Set up TreeViewColumns Gtk.TreeViewColumn column = new Gtk.TreeViewColumn ( Catalog.GetString ("Note Title"), new Gtk.CellRendererText (), "text", 0); column.SortColumnId = 0; column.Resizable = true; treeView.AppendColumn (column); column = new Gtk.TreeViewColumn ( Catalog.GetString ("Status"), new Gtk.CellRendererText (), "text", 1); column.SortColumnId = 1; column.Resizable = true; treeView.AppendColumn (column); // Button to close dialog. closeButton = (Gtk.Button) AddButton (Gtk.Stock.Close, Gtk.ResponseType.Close); closeButton.Sensitive = false; }
private void BuildWidget() { ThreadAssist.AssertInMainThread (); ColumnSpacing = 5; RowSpacing = 2; icon = new Image (); title_label = new Label (); title_label.Xalign = 0.0f; title_label.Ellipsize = Pango.EllipsizeMode.End; status_label = new Label (); status_label.Xalign = 0.0f; status_label.Ellipsize = Pango.EllipsizeMode.End; progress_bar = new ProgressBar (); progress_bar.SetSizeRequest (0, -1); progress_bar.Text = " "; progress_bar.Show (); cancel_button = new Button (new Image (Stock.Stop, IconSize.Menu)); cancel_button.Relief = ReliefStyle.None; cancel_button.ShowAll (); cancel_button.Clicked += OnCancelClicked; Attach (title_label, 0, 3, 0, 1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0); Attach (status_label, 0, 3, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0); Attach (icon, 0, 1, 2, 3, AttachOptions.Shrink | AttachOptions.Fill, AttachOptions.Shrink | AttachOptions.Fill, 0, 0); Attach (progress_bar, 1, 2, 2, 3, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 0, 0); Attach (cancel_button, 2, 3, 2, 3, AttachOptions.Shrink | AttachOptions.Fill, AttachOptions.Shrink | AttachOptions.Fill, 0, 0); }
private void OnImport(object obj, EventArgs args) { Title = "Importing..."; add_button.Sensitive = false; pb = new ProgressBar(); table.Attach(pb, 1, 2, 1, 2); pb.Show(); Thread thread = new Thread(ImportThread); thread.Start(); }
public string Remux(Window parent) { Button cancellButton; /* Create the dialog */ dialog = new Dialog(Catalog.GetString("Remuxing file..."), parent, DialogFlags.Modal); dialog.AllowGrow = false; dialog.AllowShrink = false; dialog.Deletable = false; /* Add a progress bar */ pb = new ProgressBar(); pb.Show(); dialog.VBox.Add(pb); /* Add a button to cancell the task */ cancellButton = new Button("gtk-cancel"); cancellButton.Clicked += OnStop; cancellButton.Show(); dialog.VBox.Add(cancellButton); /* Start the remux task in a separate thread */ remuxThread = new System.Threading.Thread(new ThreadStart(RemuxTask)); remuxThread.Start(); /* Add a timeout to refresh the progress bar */ pb.Pulse(); timeout = GLib.Timeout.Add (1000, new GLib.TimeoutHandler (Update)); /* Wait until the thread call Destroy on the dialog */ dialog.Run(); return cancelled ? null : newFilepath; }
public void SyncStateChanged(SyncState state) { // This event handler will be called by the synchronization thread // so we have to use the delegate here to manipulate the GUI. Gtk.Application.Invoke(delegate { // FIXME: Change these strings to be user-friendly switch (state) { case SyncState.AcquiringLock: ProgressText = Catalog.GetString("Acquiring sync lock..."); break; case SyncState.CommittingChanges: ProgressText = Catalog.GetString("Committing changes..."); break; case SyncState.Connecting: Title = Catalog.GetString("Synchronizing Notes"); HeaderText = Catalog.GetString("Synchronizing your notes..."); MessageText = Catalog.GetString("This may take a while, kick back and enjoy!"); model.Clear(); ProgressText = Catalog.GetString("Connecting to the server..."); progressBar.Fraction = 0; progressBar.Show(); progressLabel.Show(); break; case SyncState.DeleteServerNotes: ProgressText = Catalog.GetString("Deleting notes off of the server..."); progressBar.Pulse(); break; case SyncState.Downloading: ProgressText = Catalog.GetString("Downloading new/updated notes..."); progressBar.Pulse(); break; case SyncState.Idle: GLib.Source.Remove(progressBarTimeoutId); progressBarTimeoutId = 0; progressBar.Fraction = 0; progressBar.Hide(); progressLabel.Hide(); closeButton.Sensitive = true; break; case SyncState.Locked: Title = Catalog.GetString("Server Locked"); HeaderText = Catalog.GetString("Server is locked"); MessageText = Catalog.GetString("One of your other computers is currently synchronizing. Please wait 2 minutes and try again."); ProgressText = string.Empty; break; case SyncState.PrepareDownload: ProgressText = Catalog.GetString("Preparing to download updates from server..."); break; case SyncState.PrepareUpload: ProgressText = Catalog.GetString("Preparing to upload updates to server..."); break; case SyncState.Uploading: ProgressText = Catalog.GetString("Uploading notes to server..."); break; case SyncState.Failed: Title = Catalog.GetString("Synchronization Failed"); HeaderText = Catalog.GetString("Failed to synchronize"); MessageText = Catalog.GetString("Could not synchronize notes. Check the details below and try again."); ProgressText = string.Empty; break; case SyncState.Succeeded: int count = 0; count += model.IterNChildren(); Title = Catalog.GetString("Synchronization Complete"); HeaderText = Catalog.GetString("Synchronization is complete"); string numNotesUpdated = string.Format(Catalog.GetPluralString("{0} note updated.", "{0} notes updated.", count), count); MessageText = numNotesUpdated + " " + Catalog.GetString("Your notes are now up to date."); ProgressText = string.Empty; break; case SyncState.UserCancelled: Title = Catalog.GetString("Synchronization Canceled"); HeaderText = Catalog.GetString("Synchronization was canceled"); MessageText = Catalog.GetString("You canceled the synchronization. You may close the window now."); ProgressText = string.Empty; break; case SyncState.NoConfiguredSyncService: Title = Catalog.GetString("Synchronization Not Configured"); HeaderText = Catalog.GetString("Synchronization is not configured"); MessageText = Catalog.GetString("Please configure synchronization in the preferences dialog."); ProgressText = string.Empty; break; case SyncState.SyncServerCreationFailed: Title = Catalog.GetString("Synchronization Service Error"); HeaderText = Catalog.GetString("Service error"); MessageText = Catalog.GetString("Error connecting to the synchronization service. Please try again."); ProgressText = string.Empty; break; } }); }
// TODO: Possible to make Tomboy not crash if quit while dialog is up? public SyncDialog() : base(string.Empty, null, Gtk.DialogFlags.DestroyWithParent) { progressBarTimeoutId = 0; SetSizeRequest(400, -1); HasSeparator = false; // Outer box. Surrounds all of our content. VBox outerVBox = new VBox(false, 12); outerVBox.BorderWidth = 6; outerVBox.Show(); VBox.PackStart(outerVBox, true, true, 0); // Top image and label HBox hbox = new HBox(false, 12); hbox.Show(); outerVBox.PackStart(hbox, false, false, 0); image = new Image(GuiUtils.GetIcon("tomboy", 48)); image.Xalign = 0; image.Yalign = 0; image.Show(); hbox.PackStart(image, false, false, 0); // Label header and message VBox vbox = new VBox(false, 6); vbox.Show(); hbox.PackStart(vbox, true, true, 0); headerLabel = new Label(); headerLabel.UseMarkup = true; headerLabel.Xalign = 0; headerLabel.UseUnderline = false; headerLabel.LineWrap = true; headerLabel.Show(); vbox.PackStart(headerLabel, false, false, 0); messageLabel = new Label(); messageLabel.Xalign = 0; messageLabel.UseUnderline = false; messageLabel.LineWrap = true; messageLabel.SetSizeRequest(250, -1); messageLabel.Show(); vbox.PackStart(messageLabel, false, false, 0); progressBar = new Gtk.ProgressBar(); progressBar.Orientation = Gtk.ProgressBarOrientation.LeftToRight; progressBar.BarStyle = ProgressBarStyle.Continuous; progressBar.ActivityBlocks = 30; progressBar.Show(); outerVBox.PackStart(progressBar, false, false, 0); progressLabel = new Label(); progressLabel.UseMarkup = true; progressLabel.Xalign = 0; progressLabel.UseUnderline = false; progressLabel.LineWrap = true; progressLabel.Wrap = true; progressLabel.Show(); outerVBox.PackStart(progressLabel, false, false, 0); // Expander containing TreeView expander = new Gtk.Expander(Catalog.GetString("Details")); expander.Spacing = 6; expander.Activated += OnExpanderActivated; expander.Show(); outerVBox.PackStart(expander, true, true, 0); // Contents of expander Gtk.VBox expandVBox = new Gtk.VBox(); expandVBox.Show(); expander.Add(expandVBox); // Scrolled window around TreeView Gtk.ScrolledWindow scrolledWindow = new Gtk.ScrolledWindow(); scrolledWindow.ShadowType = Gtk.ShadowType.In; scrolledWindow.SetSizeRequest(-1, 200); scrolledWindow.Show(); expandVBox.PackStart(scrolledWindow, true, true, 0); // Create model for TreeView model = new Gtk.TreeStore(typeof(string), typeof(string)); // Create TreeView, attach model Gtk.TreeView treeView = new Gtk.TreeView(); treeView.Model = model; treeView.RowActivated += OnRowActivated; treeView.Show(); scrolledWindow.Add(treeView); // Set up TreeViewColumns Gtk.TreeViewColumn column = new Gtk.TreeViewColumn( Catalog.GetString("Note Title"), new Gtk.CellRendererText(), "text", 0); column.SortColumnId = 0; column.Resizable = true; treeView.AppendColumn(column); column = new Gtk.TreeViewColumn( Catalog.GetString("Status"), new Gtk.CellRendererText(), "text", 1); column.SortColumnId = 1; column.Resizable = true; treeView.AppendColumn(column); // Button to close dialog. closeButton = (Gtk.Button)AddButton(Gtk.Stock.Close, Gtk.ResponseType.Close); closeButton.Sensitive = false; }