public IndexingStatusWindow() : base("IndexingStatusWindow") { indexingSpinner = new Hyena.Widgets.AnimatedImage(); indexingSpinner.SetSizeRequest(16, 16); indexingSpinner.Pixbuf = Gui.LoadIcon(22, "process-working"); indexingSpinner.FrameHeight = 22; indexingSpinner.FrameWidth = 22; indexingSpinner.Load(); indexingSpinnerAlignment.Add(indexingSpinner); hashingSpinner = new Hyena.Widgets.AnimatedImage(); hashingSpinner.SetSizeRequest(16, 16); hashingSpinner.Pixbuf = Gui.LoadIcon(22, "process-working"); hashingSpinner.FrameHeight = 22; hashingSpinner.FrameWidth = 22; hashingSpinner.Load(); hashingSpinnerAlignment.Add(hashingSpinner); Core.ShareBuilder.StartedIndexing += delegate { Application.Invoke(delegate { indexingFileLabel.Text = "(Starting...)"; indexingSpinner.Show(); }); }; Core.ShareBuilder.IndexingFile += delegate(object sender, FilenameEventArgs args) { Application.Invoke(delegate { indexingFileLabel.Text = args.Filename; indexingSpinner.Show(); }); }; Core.ShareBuilder.FinishedIndexing += delegate { Application.Invoke(delegate { indexingFileLabel.Text = "(Idle)"; indexingSpinner.Hide(); }); }; Core.ShareBuilder.StoppedIndexing += delegate { Application.Invoke(delegate { indexingFileLabel.Text = "(Idle - last run aborted)"; indexingSpinner.Hide(); }); }; Core.ShareHasher.StartedHashingFile += delegate { UpdateShareHasherStatus(); }; Core.ShareHasher.FinishedHashingFile += delegate { UpdateShareHasherStatus(); }; Core.ShareHasher.QueueChanged += delegate { UpdateShareHasherStatus(); }; }
void UpdateTaskStatusIcon() { if (Runtime.Core.ShareBuilder.Going || Runtime.Core.ShareHasher.Going) { if (Runtime.Core.ShareHasher.Going) { taskStatusIcon.TooltipMarkup = $"<b>Updating Shared Files</b>\nFiles To Hash: {Common.Utils.FormatNumber(Runtime.Core.ShareHasher.FilesRemaining)}"; } else { taskStatusIcon.TooltipMarkup = "<b>Updating Shared Files</b>"; } taskStatusIcon.Show(); } else { taskStatusIcon.Hide(); } }
void UpdateTaskStatusIcon() { if (Core.ShareBuilder.Going || Core.ShareHasher.Going) { if (Core.ShareHasher.Going) { taskStatusIcon.TooltipMarkup = String.Format("<b>Updating Shared Files</b>\nFiles To Hash: {0}", Common.FormatNumber(Core.ShareHasher.FilesRemaining)); } else { taskStatusIcon.TooltipMarkup = "<b>Updating Shared Files</b>"; } taskStatusIcon.Show(); } else { taskStatusIcon.Hide(); } }
void UpdateShareHasherStatus() { Application.Invoke(delegate { if (Core.ShareHasher.FilesRemaining == 0 && Core.ShareHasher.CurrentFileCount == 0) { hashingFileLabel.Text = "(Idle)"; hashingCountLabel.Text = ""; hashingSpinner.Hide(); } else if (Core.ShareHasher.FilesRemaining > 0 && Core.ShareHasher.CurrentFileCount == 0) { hashingFileLabel.Text = "(Starting...)"; hashingCountLabel.Text = FileFind.Common.FormatNumber(Core.ShareHasher.FilesRemaining); hashingSpinner.Show(); } else { hashingFileLabel.Text = Core.ShareHasher.CurrentFiles.Join("\n"); hashingCountLabel.Text = FileFind.Common.FormatNumber(Core.ShareHasher.FilesRemaining); hashingSpinner.Show(); } }); }