public QPodcastAutoManageOptions(Callback DoneCallback) : base() { doneCallback = DoneCallback; lblHeading = new QLabel("Podcast Automanagement Options", Styles.FontBold); this.Controls.Add(lblHeading); lblCheckFreq = new QLabel("Check for new Episodes"); this.Controls.Add(lblCheckFreq); cboRefreshSchedule = new QComboBox(false); cboRefreshSchedule.Items.AddRange(new string[] { "Every 15 Minutes", "Every Half Hour", "Every Hour", "Every Time QuuxPlayer Starts", "Manual Only" }); cboRefreshSchedule.AutoSetWidth(); cboRefreshSchedule.SelectedIndex = (int)Setting.PodcastDownloadSchedule; this.Controls.Add(cboRefreshSchedule); lblDownloadDisposition = new QLabel("When new episodes are found"); this.Controls.Add(lblDownloadDisposition); cboDownloadDisposition = new QComboBox(false); cboDownloadDisposition.Items.AddRange(new string[] { "Download All New Episodes", "Download Latest Episode", "Don't Download" }); cboDownloadDisposition.AutoSetWidth(); cboDownloadDisposition.SelectedIndex = (int)Setting.PodcastDownloadDisposition; this.Controls.Add(cboDownloadDisposition); System.Diagnostics.Debug.Assert(cboRefreshSchedule.Items.Count == (int)PodcastDownloadSchedule.Count); System.Diagnostics.Debug.Assert(cboDownloadDisposition.Items.Count == (int)PodcastDownloadDisposition.Count); /* * spnMaxConcurrentDownloads = new QSpin(false, false, "Maximum Simultaneous Downloads:", String.Empty, 1, 10, 1, 1, this.BackColor); * this.Controls.Add(spnMaxConcurrentDownloads); */ btnOK = new QButton(Localization.OK, false, false); AddButton(btnOK, ok); btnCancel = new QButton(Localization.CANCEL, false, false); AddButton(btnCancel, cancel); //btnOK.Width = btnCancel.Width = (Math.Max(btnOK.Width, btnCancel.Width)); int tabIndex = 0; lblCheckFreq.TabIndex = tabIndex++; cboRefreshSchedule.TabIndex = tabIndex++; lblDownloadDisposition.TabIndex = tabIndex++; cboDownloadDisposition.TabIndex = tabIndex++; btnOK.TabIndex = tabIndex++; btnCancel.TabIndex = tabIndex++; setWrapAroundTabControl(tabIndex, cboRefreshSchedule, null); arrangeControls(); //this.Height = spnMaxConcurrentDownloads.Bottom + MARGIN; this.Height = cboDownloadDisposition.Bottom + MARGIN; }
public frmOptions() : base(Localization.Get(UI_Key.Options_Title, Application.ProductName), ButtonCreateType.OKAndCancel) { this.SPACING = 4; tabs = new Dictionary <QButton, List <Control> >(); InitializeComponent(); QButton button = new QButton("Primary Options", true, false); List <Control> controls = new List <Control>(); tabs.Add(button, controls); button.Value = true; button.ButtonPressed += clickTab; topMargin = PADDING + button.Height + SPACING + SPACING; lblSound = new QLabel(Localization.Get(UI_Key.Options_Label_Sound), Styles.FontBold); controls.Add(lblSound); chkAutoClippingControl = new QCheckBox(Localization.Get(UI_Key.Options_Auto_Clipping_Control), this.BackColor); controls.Add(chkAutoClippingControl); lblSoundDevice = new QLabel("Specify a sound output device:"); controls.Add(lblSoundDevice); cboSoundDevice = new QComboBox(false); cboSoundDevice.Items.AddRange(OutputDX.GetDeviceNames()); cboSoundDevice.SelectedIndexChanged += new EventHandler(cboSoundDevice_SelectedIndexChanged); asioDevices = OutputASIO.GetDeviceNames().ToArray(); cboSoundDevice.Items.AddRange(asioDevices); chkVolumeControlsWindowsVolume = new QCheckBox(Localization.Get(UI_Key.Options_Volume_Controls_Windows_Volume, Application.ProductName), this.BackColor); if (!Lib.IsVistaOrLater) { controls.Add(chkVolumeControlsWindowsVolume); } else { chkVolumeControlsWindowsVolume.Visible = false; } if (cboSoundDevice.Items.Count > 0) { cboSoundDevice.SelectedIndex = 0; cboSoundDevice.AutoSetWidth(); } controls.Add(cboSoundDevice); lblDisplay = new QLabel(Localization.Get(UI_Key.Options_Label_Display), Styles.FontBold); controls.Add(lblDisplay); chkIncludeTagCloud = new QCheckBox(Localization.Get(UI_Key.Options_Include_Tag_Cloud), this.BackColor); controls.Add(chkIncludeTagCloud); chkDisableScreensavers = new QCheckBox(Localization.Get(UI_Key.Options_Disable_Screensaver), this.BackColor); controls.Add(chkDisableScreensavers); chkDisableScreensaversOnlyWhenPlaying = new QCheckBox("Only When Playing", this.BackColor); controls.Add(chkDisableScreensaversOnlyWhenPlaying); chkShowGridOnSpectrum = new QCheckBox(Localization.Get(UI_Key.Options_Spectrum_Show_Grid), this.BackColor); controls.Add(chkShowGridOnSpectrum); button = new QButton("Secondary Options", true, false); button.Value = false; button.ButtonPressed += clickTab; controls = new List <Control>(); tabs.Add(button, controls); lblInternet = new QLabel(Localization.Get(UI_Key.Options_Label_Internet), Styles.FontBold); controls.Add(lblInternet); chkAutoCheckUpdates = new QCheckBox(Localization.Get(UI_Key.Options_Auto_Check_Updates), this.BackColor); controls.Add(chkAutoCheckUpdates); chkDownloadCoverArt = new QCheckBox(Localization.Get(UI_Key.Options_Download_Cover_Art), this.BackColor); controls.Add(chkDownloadCoverArt); lblArtSave = new QLabel(Localization.Get(UI_Key.Options_Save_Art_Caption)); lblArtSave.Enabled = false; controls.Add(lblArtSave); cboArtSave = new QComboBox(false); cboArtSave.Items.Add(Localization.Get(UI_Key.Options_Save_Art_Folder_JPG)); cboArtSave.Items.Add(Localization.Get(UI_Key.Options_Save_Art_Artist_Album)); cboArtSave.Items.Add(Localization.Get(UI_Key.Options_Save_Art_None)); cboArtSave.AutoSetWidth(); cboArtSave.Enabled = false; controls.Add(cboArtSave); lblMisc = new QLabel(Localization.Get(UI_Key.Options_Label_Other), Styles.FontBold); controls.Add(lblMisc); chkUseGlobalHotkeys = new QCheckBox(Localization.Get(UI_Key.Options_Use_Global_Hotkeys), this.BackColor); controls.Add(chkUseGlobalHotkeys); spnShortTracks = new QSpin(true, true, Localization.Get(UI_Key.Options_Dont_Load_Shorter_Than), Localization.Get(UI_Key.Options_Dont_Load_Seconds), 1, 60, 10, 5, this.BackColor); spnShortTracks.OffEquivalent = 0; controls.Add(spnShortTracks); chkDownloadCoverArt.CheckedChanged += (s, e) => { lblArtSave.Enabled = chkDownloadCoverArt.Checked; cboArtSave.Enabled = chkDownloadCoverArt.Checked; }; chkStopClearsNowPlaying = new QCheckBox("Stop clears Now Playing", this.BackColor); controls.Add(chkStopClearsNowPlaying); chkSaveNowPlayingOnExit = new QCheckBox("Save Now Playing on exit", this.BackColor); controls.Add(chkSaveNowPlayingOnExit); bool isFirst = true; int tabIndex = 0; foreach (KeyValuePair <QButton, List <Control> > kvp in tabs) { this.Controls.Add(kvp.Key); kvp.Key.TabIndex = tabIndex++; foreach (Control c in kvp.Value) { c.Visible = isFirst; this.Controls.Add(c); } isFirst = false; } cboSoundDevice.TabIndex = tabIndex++; if (!Lib.IsVistaOrLater) { chkVolumeControlsWindowsVolume.TabIndex = tabIndex++; } chkAutoClippingControl.TabIndex = tabIndex++; chkIncludeTagCloud.TabIndex = tabIndex++; chkDisableScreensavers.TabIndex = tabIndex++; chkDisableScreensaversOnlyWhenPlaying.TabIndex = tabIndex++; chkShowGridOnSpectrum.TabIndex = tabIndex++; chkAutoCheckUpdates.TabIndex = tabIndex++; chkDownloadCoverArt.TabIndex = tabIndex++; cboArtSave.TabIndex = tabIndex++; chkUseGlobalHotkeys.TabIndex = tabIndex++; chkStopClearsNowPlaying.TabIndex = tabIndex++; chkSaveNowPlayingOnExit.TabIndex = tabIndex++; spnShortTracks.TabIndex = tabIndex++; btnOK.TabIndex = tabIndex++; btnCancel.TabIndex = tabIndex++; arrangeLayout(); }
public Organizer(Callback DoneCallback) : base() { TrackWriter.Stop(); done = DoneCallback; invalidPath = Localization.Get(UI_Key.Organize_Invalid_Path); sample = Localization.Get(UI_Key.Organize_Sample); tokenMyMusic = Localization.Get(UI_Key.Organize_Token_My_Music); tokenMyDocuments = Localization.Get(UI_Key.Organize_Token_My_Documents); tokenDesktop = Localization.Get(UI_Key.Organize_Token_Desktop); font = Styles.FontSmaller; boldFont = new Font(font, FontStyle.Bold); btnOK = new QButton(Localization.OK, false, true); btnCancel = new QButton(Localization.CANCEL, false, true); btnHelp = new QButton(Localization.Get(UI_Key.Organize_Help), false, true); AddButton(btnHelp, help); lblTitle = new QLabel(Localization.Get(UI_Key.Organize_Title), font); this.Controls.Add(lblTitle); lblTitle.Location = new System.Drawing.Point(MARGIN, MARGIN); lblDirectory = new QLabel(Localization.Get(UI_Key.Organize_Top_Folder), font); lblDirectory.ShowAccellerator(); this.Controls.Add(lblDirectory); txtDirectory = new QTextBox(); txtDirectory.Font = font; this.Controls.Add(txtDirectory); if (Setting.TopLevelDirectory.Length == 0) { Setting.TopLevelDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic); } oldRoot = Setting.TopLevelDirectory; txtDirectory.Text = simplify(oldRoot); btnBrowse = new QButton(Localization.Get(UI_Key.Organize_Browse), false, false); btnBrowse.ShowAccellerator(Keys.B); AddButton(btnBrowse, browse); lblSubdirectory = new QLabel(Localization.Get(UI_Key.Organize_Folder_Structure), font); lblSubdirectory.ShowAccellerator(); this.Controls.Add(lblSubdirectory); cboSubdirectory = new QComboBox(false); cboSubdirectory.Font = font; cboSubdirectory.Items.AddRange(TrackWriter.GetDirFormats().ToArray()); string sub = TrackWriter.GetDirFormat(Setting.DefaultDirectoryFormat); if (cboSubdirectory.Items.Contains(sub)) { cboSubdirectory.SelectedIndex = cboSubdirectory.FindStringExact(sub); } else { cboSubdirectory.SelectedIndex = 0; } this.Controls.Add(cboSubdirectory); cboSubdirectory.AutoSetWidth(); lblRename = new QLabel(Localization.Get(UI_Key.Organize_Rename), font); lblRename.ShowAccellerator(); this.Controls.Add(lblRename); cboRename = new QComboBox(false); cboRename.Font = font; string[] renames = TrackWriter.GetRenames().ToArray(); renames[0] = Localization.Get(UI_Key.Organize_Dont_Change); cboRename.Items.AddRange(renames); string ren = TrackWriter.GetRenameFormat(Setting.DefaultRenameFormat); if (cboRename.Items.Contains(ren)) { cboRename.SelectedIndex = cboRename.FindStringExact(ren); } else { cboRename.SelectedIndex = 0; } this.Controls.Add(cboRename); cboRename.AutoSetWidth(); chkKeepOrganized = new QCheckBox(Localization.Get(UI_Key.Organize_Keep_Organized), this.BackColor); chkKeepOrganized.ShowAccellerator(); chkKeepOrganized.Font = font; chkKeepOrganized.Checked = Setting.KeepOrganized; this.Controls.Add(chkKeepOrganized); chkMoveIntoTopFolder = new QCheckBox(Localization.Get(UI_Key.Organize_Move_Into_Top_Folder), this.BackColor); chkMoveIntoTopFolder.Font = font; chkMoveIntoTopFolder.Checked = Setting.MoveNewFilesIntoMain; this.Controls.Add(chkMoveIntoTopFolder); btnOK.Text = Localization.Get(UI_Key.Organize_Organize); btnCancel.Text = Localization.Get(UI_Key.Organize_Dont_Organize); btnOK.ShowAccellerator(Keys.O); btnCancel.ShowAccellerator(Keys.D); AddButton(btnOK, ok); AddButton(btnCancel, cancel); sampleTrack = new Track(-1, Localization.Get(UI_Key.Organize_Sample_Track_Path), Track.FileType.MP3, Localization.Get(UI_Key.Organize_Sample_Track_Title), Localization.Get(UI_Key.Organize_Sample_Track_Album), Localization.Get(UI_Key.Organize_Sample_Track_Artist), String.Empty, String.Empty, Localization.Get(UI_Key.Organize_Sample_Track_Grouping), Localization.Get(UI_Key.Organize_Sample_Track_Genre), (6 * 60 + 24) * 1000, 5, 0, 1973, 0, 5, 320000, 0, false, DateTime.Today, DateTime.Today, DateTime.Today, String.Empty, 2, 44100, ChangeType.None, null, float.MinValue, float.MinValue); resize(); this.Height = chkKeepOrganized.Bottom + MARGIN; cboSubdirectory.SelectedIndexChanged += (s, e) => { updateSample(); }; cboRename.SelectedIndexChanged += (s, e) => { updateSample(); }; txtDirectory.TextChanged += (s, e) => { updateSample(); }; updateSample(); int tabIndex = 0; lblDirectory.TabIndex = tabIndex++; txtDirectory.TabIndex = tabIndex++; btnBrowse.TabIndex = tabIndex++; lblSubdirectory.TabIndex = tabIndex++; cboSubdirectory.TabIndex = tabIndex++; lblRename.TabIndex = tabIndex++; cboRename.TabIndex = tabIndex++; chkKeepOrganized.TabIndex = tabIndex++; chkMoveIntoTopFolder.TabIndex = tabIndex++; btnHelp.TabIndex = tabIndex++; btnCancel.TabIndex = tabIndex++; btnOK.TabIndex = tabIndex++; setWrapAroundTabControl(tabIndex, txtDirectory, null); initialized = true; }