コード例 #1
0
        private void event_btnMTRemUpl_Activated(object sender, EventArgs e)
        {
            if (_uploadQueue == null)
            {
                return;
            }

            addQueueLog(DateTime.Now, "[QUEUE] Removing uploaded items from queue...");

            Queue tempQueue = new Queue();

            foreach (Queue.QueueDetail qd in _uploadQueue.queueList)
            {
                if (qd.uploadDone != true)
                {
                    Queue.QueueDetail qa = qd;
                    tempQueue.queueList.Add(qa);
                }
            }

            _uploadQueue = tempQueue;

            var tv = lstQueue.DocumentView as NSTableView;
            var ds = tv.DataSource as QueueDataSource;

            ds.queueList = _uploadQueue.queueList;

            tv.ReloadData();

            saveQueue();
        }
コード例 #2
0
        private void event_btnMTEnqueue_Activated(object sender, EventArgs e)
        {
            string procName = "event_btnMTEnqueue_Activated";

            try
            {
                addLog(DateTime.Now, string.Format("[QUEUE] Adding [{0}] to upload queue...", txtMTTitle.StringValue));

                if (_uploadQueue == null)
                {
                    _uploadQueue = new Queue();
                }

                Queue.QueueDetail queueItem = new Queue.QueueDetail();
                queueItem.torrentFile = txtReleaseTorrentFile.StringValue;
                queueItem.appDescrip  = txtMTFinalDescrip.Value;
                queueItem.appImage    = txtMTImageUrl.StringValue;
                queueItem.appTags     = txtMTTags.StringValue;
                queueItem.appTitle    = txtMTTitle.StringValue;
                queueItem.appType     = cmbMTAppType.TitleOfSelectedItem;
                queueItem.appVer      = cmbMTOsxVersion.TitleOfSelectedItem;

                queueItem.uploadDone = false;
                queueItem.dateAdded  = DateTime.Now;

                _uploadQueue.queueList.Add(queueItem);

                var tv = lstQueue.DocumentView as NSTableView;
                var ds = tv.DataSource as QueueDataSource;
                ds.queueList = _uploadQueue.queueList;

                tv.ReloadData();

                txtReleaseTorrentFile.StringValue = string.Empty;
                txtReleaseName.StringValue        = string.Empty;
                txtReleaseGroup.StringValue       = string.Empty;
                txtReleaseRegType.StringValue     = string.Empty;
                txtReleaseVersion.StringValue     = string.Empty;
                txtReleaseMulti.StringValue       = string.Empty;

                txtMTTitle.StringValue    = string.Empty;
                txtMTTags.StringValue     = string.Empty;
                txtMTImageUrl.StringValue = string.Empty;
                txtMTDescrip.Value        = string.Empty;
                txtMTNfoFile.StringValue  = string.Empty;
                txtMTFinalDescrip.Value   = string.Empty;

                saveQueue();

                addLog(DateTime.Now, "[QUEUE] Done.");
            } catch (Exception ex) {
                Console.WriteLine(string.Format("ERROR: [{0}]: {1}", procName, ex.Message));
            }
        }