private PasswordDialog(Builder builder, Window parent, WindowGroup group) : base(builder.GetRawOwnedObject("dialog")) { builder.Autoconnect(this); Modal = true; SetPosition(WindowPosition.CenterAlways); TransientFor = parent; this.group = group; this.group.AddWindow(this); GtkHelper.AttachSafeDispose(this); Label1.Text = TextResource.GetText("DESC_HOST"); Label2.Text = TextResource.GetText("DESC_USER"); Label3.Text = TextResource.GetText("DESC_PASS"); BtnOk.Clicked += BtnOk_Clicked; BtnCancel.Clicked += BtnCancel_Clicked; BtnOk.Label = TextResource.GetText("MSG_OK"); BtnCancel.Label = TextResource.GetText("ND_CANCEL"); Title = TextResource.GetText("DESC_PASS"); SetDefaultSize(400, 300); }
public AdvancedDownloadDialog(Builder builder, Window parent, WindowGroup group) : base(builder.GetRawOwnedObject("dialog"))// base(TextResource.GetText("DESC_ADV_TITLE"), parent, DialogFlags.Modal) { SetDefaultSize(550, 450); builder.Autoconnect(this); Title = TextResource.GetText("DESC_ADV_TITLE"); Modal = true; SetPosition(WindowPosition.CenterAlways); TransientFor = parent; this.group = group; this.group.AddWindow(this); GtkHelper.PopulateComboBox(CmbProxyType !, TextResource.GetText("NET_SYSTEM_PROXY"), TextResource.GetText("ND_NO_PROXY"), TextResource.GetText("ND_MANUAL_PROXY")); GtkHelper.ConfigurePasswordField(TxtPassword); GtkHelper.ConfigurePasswordField(TxtProxyPassword); TxtSpeedLimit !.Text = "0"; CmbProxyType !.Changed += CmbProxyType_Changed; btnOk.Clicked += BtnOK_Click; btnCancel.Clicked += BtnCancel_Click; LoadTexts(); GtkHelper.AttachSafeDispose(this); }
private QueueSelectionDialog(Builder builder, Window parent, WindowGroup group) : base(builder.GetRawOwnedObject("dialog")) { builder.Autoconnect(this); Modal = true; SetPosition(WindowPosition.CenterAlways); TransientFor = parent; this.group = group; this.group.AddWindow(this); GtkHelper.AttachSafeDispose(this); Title = TextResource.GetText("Q_MOVE_TO"); SetDefaultSize(400, 300); LoadTexts(); listStore = new ListStore(typeof(string)); LbQueues.Model = listStore; var queueNameRendererText = new CellRendererText(); var queueNameColumn = new TreeViewColumn("", queueNameRendererText, "text", 0) { Resizable = false, Reorderable = false, Sizing = TreeViewColumnSizing.Autosize, Expand = true }; LbQueues.HeadersVisible = false; LbQueues.AppendColumn(queueNameColumn); BtnCancel.Clicked += BtnCancel_Clicked; BtnOK.Clicked += BtnOK_Clicked; }
private CategoryEditDialog(Builder builder, Window parent, WindowGroup group) : base(builder.GetRawOwnedObject("dialog")) { builder.Autoconnect(this); Modal = true; SetPosition(WindowPosition.CenterAlways); TransientFor = parent; this.group = group; this.group.AddWindow(this); GtkHelper.AttachSafeDispose(this); Label1.Text = TextResource.GetText("SORT_NAME"); Label2.Text = TextResource.GetText("SETTINGS_CAT_TYPES"); Label3.Text = TextResource.GetText("SETTINGS_CAT_FOLDER"); BtnOk.Clicked += BtnOk_Clicked; BtnCancel.Clicked += BtnCancel_Clicked; Browse.Clicked += Browse_Clicked; BtnOk.Label = TextResource.GetText("MSG_OK"); BtnCancel.Label = TextResource.GetText("ND_CANCEL"); Title = TextResource.GetText("MSG_CATEGORY"); SetDefaultSize(400, 200); }
private PropertiesDialog(Builder builder, Window parent, WindowGroup group) : base(builder.GetRawOwnedObject("dialog")) { builder.Autoconnect(this); Modal = true; SetPosition(WindowPosition.CenterAlways); TransientFor = parent; group.AddWindow(this); GtkHelper.AttachSafeDispose(this); Title = TextResource.GetText("MENU_PROPERTIES"); SetDefaultSize(400, 200); LoadTexts(); }
private LanguageDialog(Builder builder, Window parent, WindowGroup group) : base(builder.GetRawOwnedObject("dialog")) { builder.Autoconnect(this); Modal = true; SetPosition(WindowPosition.CenterAlways); TransientFor = parent; this.group = group; this.group.AddWindow(this); GtkHelper.AttachSafeDispose(this); Label1.Text = TextResource.GetText("MSG_LANG1"); Label2.Text = TextResource.GetText("MSG_LANG2"); BtnOk.Clicked += BtnOk_Clicked; BtnCancel.Clicked += BtnCancel_Clicked; BtnOk.Label = TextResource.GetText("MSG_OK"); BtnCancel.Label = TextResource.GetText("ND_CANCEL"); Title = TextResource.GetText("MENU_LANG"); SetDefaultSize(400, 200); var indexFile = IoPath.Combine(AppDomain.CurrentDomain.BaseDirectory, @"Lang\index.txt"); var items = new List <string>(); var n = 0; var c = 0; if (File.Exists(indexFile)) { var lines = File.ReadAllLines(indexFile); foreach (var line in lines) { var index = line.IndexOf("="); if (index > 0) { var name = line.Substring(0, index); items.Add(name); if (name == Config.Instance.Language) { c = n; } n++; } } if (items.Count > 0) { GtkHelper.PopulateComboBoxGeneric <string>(CmbLanguage, items.ToArray()); CmbLanguage.Active = c; } } }
private UpdaterWindow(Builder builder) : base(builder.GetRawOwnedObject("window")) { builder.Autoconnect(this); Title = TextResource.GetText("OPT_UPDATE_FFMPEG"); SetPosition(WindowPosition.CenterAlways); BtnCancel.Label = TextResource.GetText("ND_CANCEL"); TxtHeading.Text = TextResource.GetText("STAT_DOWNLOADING"); SetDefaultSize(500, 200); GtkHelper.AttachSafeDispose(this); Realized += UpdaterWindow_Realized; BtnCancel.Clicked += BtnCancel_Clicked; DeleteEvent += UpdaterWindow_DeleteEvent; BtnCancel.Clicked += BtnCancel_Clicked; }
private LinkRefreshWindow(Builder builder) : base(builder.GetRawOwnedObject("window")) { builder.Autoconnect(this); SetDefaultSize(400, 200); SetPosition(WindowPosition.CenterAlways); this.group = new WindowGroup(); this.group.AddWindow(this); GtkHelper.AttachSafeDispose(this); BtnStop.Label = TextResource.GetText("BTN_STOP_PROCESSING"); LblText.Text = TextResource.GetText("REF_WAITING_FOR_LINK"); Title = TextResource.GetText("MENU_REFRESH_LINK"); DeleteEvent += LinkRefreshWindow_DeleteEvent; BtnStop.Clicked += BtnStop_Clicked; }
public SpeedLimiterWindow(Builder builder) : base(builder.GetRawOwnedObject("window")) { SetDefaultSize(400, 250); builder.Autoconnect(this); Title = TextResource.GetText("DESC_ADV_TITLE"); Modal = true; SetPosition(WindowPosition.CenterAlways); TxtSpeedLimit !.Text = "0"; #pragma warning disable CS8602 // Dereference of a possibly null reference. btnOk.Clicked += BtnOK_Click; btnCancel.Clicked += BtnCancel_Click; #pragma warning restore CS8602 // Dereference of a possibly null reference. LoadTexts(); GtkHelper.AttachSafeDispose(this); }
private AboutDialog(Builder builder, Window parent, WindowGroup group) : base(builder.GetRawOwnedObject("dialog")) { builder.Autoconnect(this); Modal = true; SetPosition(WindowPosition.CenterAlways); TransientFor = parent; this.group = group; this.group.AddWindow(this); GtkHelper.AttachSafeDispose(this); AppLogo.Pixbuf = GtkHelper.LoadSvg("xdm-logo", 128); TxtAppVersion.Text = "Xtreme Download Manager 8.0.1 BETA"; TxtAppVersion.StyleContext.AddClass("medium-font"); TxtCopyright.Text = "© 2013 Subhra Das Gupta"; TxtWebsite.Label = "www.xtremedownloadmanager.com"; TxtWebsite.Uri = Links.HomePageUrl; Title = TextResource.GetText("MENU_ABOUT"); SetDefaultSize(500, 450); }
private DeleteConfirmDialog(Builder builder, Window parent, WindowGroup group) : base(builder.GetRawOwnedObject("dialog")) { builder.Autoconnect(this); Modal = true; SetPosition(WindowPosition.CenterAlways); TransientFor = parent; this.group = group; this.group.AddWindow(this); GtkHelper.AttachSafeDispose(this); BtnDelete.Clicked += BtnDelete_Clicked; BtnCancel.Clicked += BtnCancel_Clicked; BtnDelete.Label = TextResource.GetText("DESC_DEL"); BtnCancel.Label = TextResource.GetText("ND_CANCEL"); ChkDiskDel.Label = TextResource.GetText("LBL_DELETE_FILE"); TxtLabel.Text = TextResource.GetText("DEL_SEL_TEXT"); Title = TextResource.GetText("MENU_DELETE_DWN"); SetDefaultSize(400, 200); }
private NewDownloadWindow(Builder builder) : base(builder.GetRawOwnedObject("window")) { builder.Autoconnect(this); SetDefaultSize(500, 300); KeepAbove = true; Title = TextResource.GetText("ND_TITLE"); SetPosition(WindowPosition.CenterAlways); ImgFileIcon !.Pixbuf = GtkHelper.LoadSvg("file-download-line", 48); windowGroup = new WindowGroup(); windowGroup.AddWindow(this); dropdownItems = new ListStore(typeof(string)); //TxtUrl = (Entry)builder.GetObject("txtUrl"); //TxtFile = (Entry)builder.GetObject("txtFile"); //CmbLocation = (ComboBox)builder.GetObject("cmdFolder"); //lblFileSize = (Label)builder.GetObject("lblFileSize"); //lblIgnoreLabel = (LinkButton)builder.GetObject("lblIgnoreLabel"); //btnDownloadLater = (Button)builder.GetObject("btnDownloadLater"); //btnDownloadNow = (Button)builder.GetObject("btnDownloadNow"); //btnMore = (Button)builder.GetObject("btnMore"); //lblAddress = (Label)builder.GetObject("lblAddress"); //lblFile = (Label)builder.GetObject("lblFile"); //lblSaveIn = (Label)builder.GetObject("lblSaveIn"); lblAddress.Text = TextResource.GetText("ND_ADDRESS"); lblFile.Text = TextResource.GetText("ND_FILE"); lblSaveIn.Text = TextResource.GetText("LBL_SAVE_IN"); btnDownloadNow.Label = TextResource.GetText("ND_DOWNLOAD_NOW"); btnDownloadLater.Label = TextResource.GetText("ND_DOWNLOAD_LATER"); btnMore.Label = TextResource.GetText("ND_MORE"); lblIgnoreLabel.Label = TextResource.GetText("ND_IGNORE_URL"); CmbLocation.Changed += CmbLocation_Changed; this.Destroyed += Window_Closed; TxtUrl.Changed += TxtUrl_TextChanged; btnDownloadNow.Clicked += btnDownload_Click; btnDownloadLater.Clicked += btnDownloadLater_Click; btnMore.Clicked += btnAdvanced_Click; lblIgnoreLabel.Clicked += TextBlock_MouseDown; dropdownItems = GtkHelper.PopulateComboBox(CmbLocation); CmbLocation.Hexpand = true; //If there's available space, we use it //CellRendererText renderer = (CmbLocation.Cells[0] as CellRendererText); //Get the ComboBoxText only renderer //renderer.WrapWidth = 10; //Always show at least 20 chars //renderer.Ellipsize = Pango.EllipsizeMode.End; //CmbLocation.Model = dropdownItems; //var cmbRenderer = new CellRendererText(); //CmbLocation.PackStart(cmbRenderer, true); //CmbLocation.AddAttribute(cmbRenderer, "text", 0); PrepareMenu(); this.ShowAll(); GtkHelper.AttachSafeDispose(this); }
private SettingsDialog(Builder builder, Window parent, WindowGroup group) : base(builder.GetRawOwnedObject("dialog")) { builder.Autoconnect(this); Modal = true; SetDefaultSize(640, 480); SetPosition(WindowPosition.CenterAlways); TransientFor = parent; this.group = group; this.group.AddWindow(this); GtkHelper.AttachSafeDispose(this); LoadTexts(); Title = TextResource.GetText("TITLE_SETTINGS"); GtkHelper.PopulateComboBoxGeneric <int>(CmbMinVidSize, new int[] { 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768 }); GtkHelper.PopulateComboBoxGeneric <int>(CmbMaxParallalDownloads, Enumerable.Range(1, 50).ToArray()); GtkHelper.PopulateComboBox(CmbDblClickAction, TextResource.GetText("CTX_OPEN_FOLDER"), TextResource.GetText("MSG_OPEN_FILE")); CreateCategoryListView(); GtkHelper.PopulateComboBoxGeneric <int>(CmbTimeOut, Enumerable.Range(1, 300).ToArray()); GtkHelper.PopulateComboBoxGeneric <int>(CmbMaxSegments, Enumerable.Range(1, 64).ToArray()); GtkHelper.PopulateComboBoxGeneric <int>(CmbMaxRetry, Enumerable.Range(1, 100).ToArray()); GtkHelper.PopulateComboBox(CmbProxyType, TextResource.GetText("NET_SYSTEM_PROXY"), TextResource.GetText("ND_NO_PROXY"), TextResource.GetText("ND_MANUAL_PROXY")); CreatePasswordManagerListView(); VideoWikiLink.Clicked += VideoWikiLink_Clicked; BtnChrome.Clicked += BtnChrome_Clicked; BtnFirefox.Clicked += BtnFirefox_Clicked; BtnEdge.Clicked += BtnEdge_Clicked; BtnOpera.Clicked += BtnOpera_Clicked; BtnCopy1.Clicked += BtnCopy1_Clicked; BtnCopy2.Clicked += BtnCopy2_Clicked; BtnDefault1.Clicked += BtnDefault1_Clicked; BtnDefault2.Clicked += BtnDefault2_Clicked; BtnDefault3.Clicked += BtnDefault3_Clicked; BtnCopy1.Image = new Image(GtkHelper.LoadSvg("file-copy-line")); BtnCopy2.Image = new Image(GtkHelper.LoadSvg("file-copy-line")); BtnOK.Clicked += BtnOK_Clicked; BtnCancel.Clicked += BtnCancel_Clicked; BtnTempFolderBrowse.Clicked += BtnTempFolderBrowse_Clicked; BtnDownloadFolderBrowse.Clicked += BtnDownloadFolderBrowse_Clicked; CatAdd.Clicked += CatAdd_Clicked; CatEdit.Clicked += CatEdit_Clicked; CatDel.Clicked += CatDel_Clicked; CatDef.Clicked += CatDef_Clicked; CmbProxyType.Changed += CmbProxyType_Changed; AddPass.Clicked += AddPass_Clicked; DelPass.Clicked += DelPass_Clicked; EditPass.Clicked += EditPass_Clicked; BtnBrowse.Clicked += BtnBrowse_Clicked; BtnUserAgentReset.Clicked += BtnUserAgentReset_Clicked; }
private NewQueueDialog(Builder builder, Window parent, WindowGroup group, Action <DownloadQueue, bool> okAction, DownloadQueue?modifyingQueue) : base(builder.GetRawOwnedObject("dialog")) { builder.Autoconnect(this); Modal = true; SetPosition(WindowPosition.CenterAlways); TransientFor = parent; this.group = group; this.group.AddWindow(this); GtkHelper.AttachSafeDispose(this); LoadTexts(); Title = TextResource.GetText("LBL_QUEUE_OPT1"); SetDefaultSize(640, 480); BtnCancel.Clicked += BtnCancel_Clicked; BtnOK.Clicked += BtnOK_Clicked; this.listStore = new ListStore( typeof(bool), typeof(string), typeof(string), typeof(string), typeof(string), typeof(InProgressEntryWrapper)); this.lvDownloads.Model = this.listStore; var fileNameColumn = new TreeViewColumn { Resizable = true, Reorderable = false, Title = TextResource.GetText("SORT_NAME"), Sizing = TreeViewColumnSizing.Fixed, FixedWidth = 200 }; var checkboxRenderer = new CellRendererToggle { }; checkboxRenderer.Toggled += CheckboxRenderer_Toggled; fileNameColumn.PackStart(checkboxRenderer, false); fileNameColumn.SetAttributes(checkboxRenderer, "active", 0); var fileNameRendererText = new CellRendererText(); fileNameColumn.PackStart(fileNameRendererText, false); fileNameColumn.SetAttributes(fileNameRendererText, "text", 1); this.lvDownloads.AppendColumn(fileNameColumn); var dateColumn = new TreeViewColumn { Resizable = true, Reorderable = false, Title = TextResource.GetText("SORT_DATE"), Sizing = TreeViewColumnSizing.Fixed, FixedWidth = 150 }; var dateRendererText = new CellRendererText(); dateColumn.PackStart(dateRendererText, false); dateColumn.SetAttributes(dateRendererText, "text", 2); this.lvDownloads.AppendColumn(dateColumn); var sizeColumn = new TreeViewColumn { Resizable = true, Reorderable = false, Title = TextResource.GetText("SORT_SIZE"), Sizing = TreeViewColumnSizing.Fixed, FixedWidth = 150 }; var sizeRendererText = new CellRendererText(); sizeColumn.PackStart(sizeRendererText, false); sizeColumn.SetAttributes(sizeRendererText, "text", 3); this.lvDownloads.AppendColumn(sizeColumn); var statusColumn = new TreeViewColumn { Resizable = true, Reorderable = false, Title = TextResource.GetText("SORT_STATUS"), Sizing = TreeViewColumnSizing.Fixed, FixedWidth = 150 }; var statusRendererText = new CellRendererText(); statusColumn.PackStart(statusRendererText, false); statusColumn.SetAttributes(statusRendererText, "text", 4); this.lvDownloads.AppendColumn(statusColumn); this.okAction = okAction; if (modifyingQueue == null) { this.TxtQueueName.Text = "New queue #" + QueueManager.QueueAutoNumber; QueueManager.QueueAutoNumber++; } else { this.TxtQueueName.Text = modifyingQueue.Name; this.modifyingQueue = modifyingQueue; } var set = new HashSet <string>(); foreach (var queue in QueueManager.Queues) { foreach (var id in queue.DownloadIds) { set.Add(id); } } foreach (var ent in ApplicationContext.Application.GetAllInProgressDownloads().Select(x => new EntryWrapper { Entry = x })) { if (!set.Contains(ent.Entry.Id)) { listStore.AppendValues(false, ent.Entry.Name, ent.Entry.DateAdded.ToShortDateString() + " " + ent.Entry.DateAdded.ToShortTimeString(), FormattingHelper.FormatSize(ent.Entry.Size), ent.Entry.Status.ToString(), ent); } } ChkSelectAll.Toggled += ChkSelectAll_Toggled; }
private QueueSchedulerDialog(Builder builder, Window parent, WindowGroup group) : base(builder.GetRawOwnedObject("dialog")) { builder.Autoconnect(this); Modal = true; SetPosition(WindowPosition.CenterAlways); TransientFor = parent; this.group = group; this.group.AddWindow(this); GtkHelper.AttachSafeDispose(this); Title = TextResource.GetText("DESC_Q_TITLE"); SetDefaultSize(700, 500); LoadTexts(); queueListStore = new ListStore(typeof(string), typeof(DownloadQueue)); LbQueues.Model = queueListStore; var queueNameRendererText = new CellRendererText(); var queueNameColumn = new TreeViewColumn("", queueNameRendererText, "text", 0) { Resizable = false, Reorderable = false, Sizing = TreeViewColumnSizing.Autosize, Expand = true }; LbQueues.HeadersVisible = false; LbQueues.AppendColumn(queueNameColumn); queueScroll.SetSizeRequest(150, 100); filesListStore = new ListStore(typeof(string), typeof(string), typeof(string), typeof(InProgressDownloadItem)); lvFiles.Model = filesListStore; var k = 0; foreach (var key in new string[] { "ND_FILE", "SORT_SIZE", "SORT_STATUS" }) { var cellRendererText = new CellRendererText(); var treeViewColumn = new TreeViewColumn(TextResource.GetText(key), cellRendererText, "text", k++) { Resizable = true, Reorderable = false, Sizing = TreeViewColumnSizing.Fixed, FixedWidth = 150 }; lvFiles.AppendColumn(treeViewColumn); } this.SchedulerPanel = new SchedulerPanelControl( chkEveryday, new CheckButton[] { chkSun, chkMon, chkTue, chkWed, chkThu, chkFri, chkSat }, new TimePickerControl(CmbHour1, CmbMinute1, CmbAmPm1, LblQueueStart), new TimePickerControl(CmbHour2, CmbMinute2, CmbAmPm2, LblQueueStop) ); this.SchedulerPanel.Schedule = defaultSchedule; this.SchedulerPanel.ValueChanged += (_, _) => { DownloadSchedule?schedule = null; if (ChkEnableScheduler.Active) { schedule = this.SchedulerPanel.Schedule; } if (GtkHelper.GetSelectedValue <DownloadQueue>(LbQueues, 1) is DownloadQueue queue) { queue.Schedule = schedule; } }; this.LbQueues.Selection.Changed += (_, _) => { var selected = GtkHelper.GetSelectedValue <DownloadQueue>(LbQueues, 1); if (selected != null) { UpdateControls(selected); } }; this.lvFiles.Selection.Changed += (_, _) => ListSelectionChanged(); this.ChkEnableScheduler.Toggled += (_, _) => { SchedulerPanel.Enabled = this.ChkEnableScheduler.Active; if (GtkHelper.GetSelectedValue <DownloadQueue>(LbQueues, 1) is DownloadQueue queue) { queue.Schedule = this.ChkEnableScheduler.Active ? this.SchedulerPanel.Schedule : null; } }; Hidden += QueueSchedulerDialog_Hidden; BtnNew.Clicked += BtnNew_Clicked; BtnStart.Clicked += BtnStart_Clicked; BtnStop.Clicked += BtnStop_Clicked; BtnDel.Clicked += BtnDel_Clicked; BtnCancel.Clicked += BtnCancel_Clicked; BtnAdd.Clicked += BtnAdd_Clicked; BtnRemove.Clicked += BtnRemove_Clicked; BtnUp.Clicked += BtnUp_Clicked; BtnDown.Clicked += BtnDown_Clicked; BtnMoveTo.Clicked += BtnMoveTo_Clicked; BtnSave.Clicked += BtnSave_Clicked; lvFiles.Selection.Mode = SelectionMode.Multiple; SchedulerPanel.Enabled = false; }