예제 #1
0
        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());
            }
        }
예제 #2
0
 void HandleStateChanged(object sender, StateChangedEventArgs e)
 {
     HandleChange();
 }
예제 #3
0
 void HandleStateChanged(object sender, StateChangedEventArgs e)
 {
     UpdateAll();
 }
예제 #4
0
 void HandleStateChanged(object sender, StateChangedEventArgs e)
 {
     HandleChange ();
 }
예제 #5
0
 void HandleStateChanged(object sender, StateChangedEventArgs e)
 {
     UpdateAll ();
 }
예제 #6
0
        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);
            }
        }