void HandleStateChanged(object sender, StateChangedEventArgs args) { // Update toolbar updateToolBar (); Download manager = (Download) sender; if (args.NewState == Monsoon.State.Stopped) PeerListStore.Clear (); this.updateView (); if (!Preferences.EnableNotifications) return; if (args.NewState != Monsoon.State.Seeding) return; if (args.OldState != Monsoon.State.Downloading) return; try { Notifications.Notification notify = new Notifications.Notification (_("Download Complete"), manager.Torrent.Name, Stock.GoDown); if (Preferences.EnableTray) notify.Show (); notify.Urgency = Notifications.Urgency.Low; notify.Timeout = 5000; notify.Show (); notify.AddAction("reveal-item", "Show", delegate { System.Diagnostics.Process.Start("\"file://" + manager.SavePath + "\""); }); } catch (Exception ex) { logger.Error ("Could not display notification"); logger.Error (ex.ToString()); } }
void HandleStateChanged(object sender, StateChangedEventArgs e) { HandleChange(); }
void HandleStateChanged(object sender, StateChangedEventArgs e) { UpdateAll(); }
void HandleStateChanged(object sender, StateChangedEventArgs e) { HandleChange (); }
void HandleStateChanged(object sender, StateChangedEventArgs e) { UpdateAll (); }
void HandleStateChanged(object sender, StateChangedEventArgs args) { Download manager = (Download) sender; if (args.OldState == State.Downloading) { logger.Debug("Removing " + manager.Torrent.Name + " from download label"); Downloading.RemoveTorrent(manager); } else if (args.OldState == State.Seeding) { logger.Debug("Removing " + manager.Torrent.Name + " from upload label"); Seeding.RemoveTorrent(manager); } if (args.NewState == State.Downloading) { logger.Debug("Adding " + manager.Torrent.Name + " to download label"); Downloading.AddTorrent(manager); } else if (args.NewState == State.Seeding) { logger.Debug("Adding " + manager.Torrent.Name + " to upload label"); Seeding.AddTorrent(manager); } }