예제 #1
0
        void Update(TreeIter row)
        {
            Download d = (Download)Torrents.GetValue(row, 0);

            Torrents.SetValues(row,
                               d,
                               d.Torrent.Name,
                               GetStatusString(d),
                               (int)(d.Progress * 100.0),
                               d.Seeds.ToString(),
                               d.Leechs + " (" + d.Available + ")",
                               ByteConverter.ConvertSpeed(d.DownloadSpeed),
                               ByteConverter.ConvertSize(d.UploadSpeed),
                               ((float)d.TotalUploaded / d.TotalDownloaded).ToString(),
                               ByteConverter.ConvertSize(d.Torrent.Size),
                               GetEtaString(d),
                               GetStatusColour(d),
                               d.Priority.ToString()
                               );
        }
예제 #2
0
        void RemoveDownload(Download download)
        {
            TreeIter iter;

            if (Torrents.GetIterFirst(out iter))
            {
                do
                {
                    if (download != Torrents.GetValue(iter, 0))
                    {
                        continue;
                    }

                    download.PriorityChanged -= HandlePriorityChanged;
                    download.StateChanged    -= HandleStateChanged;
                    Torrents.Remove(ref iter);
                    Selection.UnselectAll();
                    break;
                } while (Torrents.IterNext(ref iter));
            }
        }