private bool OnApproved() { if (string.IsNullOrEmpty(TxtQueueName.Text)) { GtkHelper.ShowMessageBox(this, TextResource.GetText("MSG_QUEUE_NAME_MISSING")); return(false); } var list2 = new List <string>(this.listStore.IterNChildren()); var list = GtkHelper.GetListStoreValues <EntryWrapper>(this.listStore, 5); foreach (var entry in list) { if (entry.Selected) { list2.Add(entry.Entry.Id); } } if (modifyingQueue == null) { okAction.Invoke(new DownloadQueue(Guid.NewGuid().ToString(), TxtQueueName.Text) { DownloadIds = list2 }, true); } else { modifyingQueue.DownloadIds.AddRange(list2); okAction.Invoke(modifyingQueue, false); } return(true); }
private void BtnMoveTo_Clicked(object?sender, EventArgs e) { if (this.filesListStore.IterNChildren() > 0 && this.queueListStore.IterNChildren() > 1 && LbQueues.Selection.CountSelectedRows() > 0) { var qsd = QueueSelectionDialog.CreateFromGladeFile(this, this.group); var queueNames = new List <string>(); var queueIds = new List <string>(); var selectedItem = GtkHelper.GetSelectedValue <DownloadQueue>(LbQueues, 1); var index = 0; foreach (DownloadQueue item in GtkHelper.GetListStoreValues <DownloadQueue>(queueListStore, 1)) { if (item != selectedItem) { queueNames.Add(item.Name); queueIds.Add(item.ID); } index++; } var downloadIds = new string[this.lvFiles.Selection.CountSelectedRows()]; index = 0; foreach (InProgressDownloadItem lvi in GtkHelper.GetSelectedValues <InProgressDownloadItem>(lvFiles, 3)) { downloadIds[index++] = lvi.Id; } qsd.SetData(queueNames, queueIds, downloadIds); qsd.QueueSelected += Qsd_QueueSelected; qsd.Run(); qsd.Destroy(); qsd.Dispose(); } }
private void Qsd_QueueSelected(object?sender, QueueSelectionEventArgs e) { var qid = e.SelectedQueueId; var queue = GtkHelper.GetListStoreValues <DownloadQueue>(queueListStore, 1).Find(x => x.ID == qid);// GtkHelper.GetValueAt<DownloadQueue>(LbQueues, e.SelectedQueueIndex, 1); var downloadIds = e.DownloadIds; var selectedQueue = GtkHelper.GetSelectedValue <DownloadQueue>(LbQueues, 1); foreach (var id in downloadIds) { selectedQueue.DownloadIds.Remove(id); queue.DownloadIds.Add(id); } LoadQueueDetails(selectedQueue); }
private void UpdateGeneralSettingsConfig() { Config.Instance.ShowProgressWindow = ChkShowPrg.Active; Config.Instance.ShowDownloadCompleteWindow = ChkShowComplete.Active; Config.Instance.StartDownloadAutomatically = ChkStartAuto.Active; Config.Instance.FileConflictResolution = ChkOverwrite.Active ? FileConflictResolution.Overwrite : FileConflictResolution.AutoRename; Config.Instance.TempDir = TxtTempFolder.Text; Config.Instance.MaxParallelDownloads = GtkHelper.GetSelectedComboBoxValue <int>(CmbMaxParallalDownloads); Config.Instance.Categories = GtkHelper.GetListStoreValues <Category>(categoryStore, 3); Config.Instance.FolderSelectionMode = ChkAutoCat.Active ? FolderSelectionMode.Auto : FolderSelectionMode.Manual; Config.Instance.DefaultDownloadFolder = TxtDownloadFolder.Text; Config.Instance.AllowSystemDarkTheme = ChkDarkTheme.Active; Config.Instance.DoubleClickOpenFile = CmbDblClickAction.Active == 1; }
private void UpdatePasswordManagerConfig() { Config.Instance.UserCredentials = GtkHelper.GetListStoreValues <PasswordEntry>(passwordStore, 2); }
private void SaveQueues() { QueuesModified?.Invoke(this, new QueueListEventArgs( GtkHelper.GetListStoreValues <DownloadQueue>(this.queueListStore, 1))); }