private void InitializeControls()
        {
            InitializeComponent();

            foreach (SupportedLanguage language in Helpers.GetEnums <SupportedLanguage>())
            {
                ToolStripMenuItem tsmi = new ToolStripMenuItem(language.GetLocalizedDescription());
                tsmi.Image        = LanguageHelper.GetLanguageIcon(language);
                tsmi.ImageScaling = ToolStripItemImageScaling.None;
                SupportedLanguage lang = language;
                tsmi.Click += (sender, e) => ChangeLanguage(lang);
                cmsLanguages.Items.Add(tsmi);
            }

            cbTrayLeftDoubleClickAction.Items.AddRange(Helpers.GetLocalizedEnumDescriptions <HotkeyType>());
            cbTrayLeftClickAction.Items.AddRange(Helpers.GetLocalizedEnumDescriptions <HotkeyType>());
            cbTrayMiddleClickAction.Items.AddRange(Helpers.GetLocalizedEnumDescriptions <HotkeyType>());

            CodeMenu.Create <CodeMenuEntryFilename>(txtSaveImageSubFolderPattern, CodeMenuEntryFilename.t, CodeMenuEntryFilename.pn, CodeMenuEntryFilename.i, CodeMenuEntryFilename.width, CodeMenuEntryFilename.height, CodeMenuEntryFilename.n);

            cbProxyMethod.Items.AddRange(Helpers.GetLocalizedEnumDescriptions <ProxyMethod>());

            UpdateControls();
        }
Beispiel #2
0
        public TaskSettingsForm(TaskSettings hotkeySetting, bool isDefault = false)
        {
            InitializeComponent();
            Icon         = ShareXResources.Icon;
            TaskSettings = hotkeySetting;
            IsDefault    = isDefault;

            if (IsDefault)
            {
                tcTaskSettings.TabPages.Remove(tpTask);
                chkUseDefaultGeneralSettings.Visible    = chkUseDefaultImageSettings.Visible = chkUseDefaultCaptureSettings.Visible = chkUseDefaultActions.Visible =
                    chkUseDefaultUploadSettings.Visible = chkUseDefaultIndexerSettings.Visible = chkUseDefaultAdvancedSettings.Visible = false;
            }
            else
            {
                tbDescription.Text = TaskSettings.Description ?? string.Empty;
                cbUseDefaultAfterCaptureSettings.Checked = TaskSettings.UseDefaultAfterCaptureJob;
                cbUseDefaultAfterUploadSettings.Checked  = TaskSettings.UseDefaultAfterUploadJob;
                cbUseDefaultDestinationSettings.Checked  = TaskSettings.UseDefaultDestinations;
                chkUseDefaultGeneralSettings.Checked     = TaskSettings.UseDefaultGeneralSettings;
                chkUseDefaultImageSettings.Checked       = TaskSettings.UseDefaultImageSettings;
                chkUseDefaultCaptureSettings.Checked     = TaskSettings.UseDefaultCaptureSettings;
                chkUseDefaultActions.Checked             = TaskSettings.UseDefaultActions;
                chkUseDefaultUploadSettings.Checked      = TaskSettings.UseDefaultUploadSettings;
                chkUseDefaultIndexerSettings.Checked     = TaskSettings.UseDefaultIndexerSettings;
                chkUseDefaultAdvancedSettings.Checked    = TaskSettings.UseDefaultAdvancedSettings;
            }

            UpdateWindowTitle();

            AddEnumItemsContextMenu <HotkeyType>(x =>
            {
                TaskSettings.Job = x;
                UpdateWindowTitle();
            }, cmsTask);
            AddMultiEnumItemsContextMenu <AfterCaptureTasks>(x => TaskSettings.AfterCaptureJob = TaskSettings.AfterCaptureJob.Swap(x), cmsAfterCapture);
            AddMultiEnumItemsContextMenu <AfterUploadTasks>(x => TaskSettings.AfterUploadJob   = TaskSettings.AfterUploadJob.Swap(x), cmsAfterUpload);
            // Destinations -> Image uploader
            AddEnumItems <ImageDestination>(x =>
            {
                TaskSettings.ImageDestination = x;
                // if click on "folder" with file destinations then set ImageFileDestination and check it
                if (x == ImageDestination.FileUploader)
                {
                    SetEnumChecked(TaskSettings.ImageFileDestination, tsmiImageFileUploaders);
                }
                else // if click not on "folder" with destinations then uncheck file destinations
                {
                    MainForm.Uncheck(tsmiImageFileUploaders);
                }
            }, tsmiImageUploaders);
            tsmiImageFileUploaders = (ToolStripDropDownItem)tsmiImageUploaders.DropDownItems[tsmiImageUploaders.DropDownItems.Count - 1];
            AddEnumItems <FileDestination>(x =>
            {
                TaskSettings.ImageFileDestination = x;
                tsmiImageFileUploaders.PerformClick();
            }, tsmiImageFileUploaders);
            // Destinations -> Text uploader
            AddEnumItems <TextDestination>(x =>
            {
                TaskSettings.TextDestination = x;
                // if click on "folder" with file destinations then set TextFileDestination and check it
                if (x == TextDestination.FileUploader)
                {
                    SetEnumChecked(TaskSettings.TextFileDestination, tsmiTextFileUploaders);
                }
                else // if click not on "folder" with destinations then uncheck file destinations
                {
                    MainForm.Uncheck(tsmiTextFileUploaders);
                }
            }, tsmiTextUploaders);
            tsmiTextFileUploaders = (ToolStripDropDownItem)tsmiTextUploaders.DropDownItems[tsmiTextUploaders.DropDownItems.Count - 1];
            AddEnumItems <FileDestination>(x =>
            {
                TaskSettings.TextFileDestination = x;
                tsmiTextFileUploaders.PerformClick();
            }, tsmiTextFileUploaders);
            // Destinations -> File uploader
            AddEnumItems <FileDestination>(x => TaskSettings.FileDestination                 = x, tsmiFileUploaders);
            AddEnumItems <UrlShortenerType>(x => TaskSettings.URLShortenerDestination        = x, tsmiURLShorteners);
            AddEnumItems <URLSharingServices>(x => TaskSettings.URLSharingServiceDestination = x, tsmiURLSharingServices);

            SetEnumCheckedContextMenu(TaskSettings.Job, cmsTask);
            SetMultiEnumCheckedContextMenu(TaskSettings.AfterCaptureJob, cmsAfterCapture);
            SetMultiEnumCheckedContextMenu(TaskSettings.AfterUploadJob, cmsAfterUpload);
            SetEnumChecked(TaskSettings.ImageDestination, tsmiImageUploaders);
            MainForm.SetImageFileDestinationChecked(TaskSettings.ImageDestination, TaskSettings.ImageFileDestination, tsmiImageFileUploaders);
            SetEnumChecked(TaskSettings.TextDestination, tsmiTextUploaders);
            MainForm.SetTextFileDestinationChecked(TaskSettings.TextDestination, TaskSettings.TextFileDestination, tsmiTextFileUploaders);
            SetEnumChecked(TaskSettings.FileDestination, tsmiFileUploaders);
            SetEnumChecked(TaskSettings.URLShortenerDestination, tsmiURLShorteners);
            SetEnumChecked(TaskSettings.URLSharingServiceDestination, tsmiURLSharingServices);

            if (Program.UploadersConfig != null)
            {
                // FTP
                if (Program.UploadersConfig.FTPAccountList.Count > 0)
                {
                    chkOverrideFTP.Checked = TaskSettings.OverrideFTP;
                    cboFTPaccounts.Items.Clear();
                    cboFTPaccounts.Items.AddRange(Program.UploadersConfig.FTPAccountList.ToArray());
                    cboFTPaccounts.SelectedIndex = TaskSettings.FTPIndex.BetweenOrDefault(0, Program.UploadersConfig.FTPAccountList.Count - 1);
                }

                // Custom uploader
                if (Program.UploadersConfig.CustomUploadersList.Count > 0)
                {
                    chkOverrideCustomUploader.Checked = TaskSettings.OverrideCustomUploader;
                    cbOverrideCustomUploader.Items.Clear();
                    cbOverrideCustomUploader.Items.AddRange(Program.UploadersConfig.CustomUploadersList.ToArray());
                    cbOverrideCustomUploader.SelectedIndex = TaskSettings.CustomUploaderIndex.BetweenOrDefault(0, Program.UploadersConfig.CustomUploadersList.Count - 1);
                }
            }

            UpdateDestinationStates();
            UpdateUploaderMenuNames();

            // General
            cbPlaySoundAfterCapture.Checked     = TaskSettings.GeneralSettings.PlaySoundAfterCapture;
            cbShowAfterCaptureTasksForm.Checked = TaskSettings.GeneralSettings.ShowAfterCaptureTasksForm;
            chkShowBeforeUploadForm.Checked     = TaskSettings.GeneralSettings.ShowBeforeUploadForm;
            cbPlaySoundAfterUpload.Checked      = TaskSettings.GeneralSettings.PlaySoundAfterUpload;
            chkShowAfterUploadForm.Checked      = TaskSettings.GeneralSettings.ShowAfterUploadForm;
            cboPopUpNotification.Items.Clear();
            cboPopUpNotification.Items.AddRange(Helpers.GetLocalizedEnumDescriptions <PopUpNotificationType>());
            cboPopUpNotification.SelectedIndex = (int)TaskSettings.GeneralSettings.PopUpNotification;
            cbHistorySave.Checked = TaskSettings.GeneralSettings.SaveHistory;

            // Image - General
            cbImageFormat.Items.AddRange(Enum.GetNames(typeof(EImageFormat)));
            cbImageFormat.SelectedIndex = (int)TaskSettings.ImageSettings.ImageFormat;
            nudImageJPEGQuality.Value   = TaskSettings.ImageSettings.ImageJPEGQuality;
            cbImageGIFQuality.Items.AddRange(Helpers.GetLocalizedEnumDescriptions <GIFQuality>());
            cbImageGIFQuality.SelectedIndex = (int)TaskSettings.ImageSettings.ImageGIFQuality;
            nudUseImageFormat2After.Value   = TaskSettings.ImageSettings.ImageSizeLimit;
            cbImageFormat2.Items.AddRange(Enum.GetNames(typeof(EImageFormat)));
            cbImageFormat2.SelectedIndex = (int)TaskSettings.ImageSettings.ImageFormat2;
            cbImageFileExist.Items.Clear();
            cbImageFileExist.Items.AddRange(Helpers.GetLocalizedEnumDescriptions <FileExistAction>());
            cbImageFileExist.SelectedIndex = (int)TaskSettings.ImageSettings.FileExistAction;

            // Image - Effects
            chkShowImageEffectsWindowAfterCapture.Checked = TaskSettings.ImageSettings.ShowImageEffectsWindowAfterCapture;
            cbImageEffectOnlyRegionCapture.Checked        = TaskSettings.ImageSettings.ImageEffectOnlyRegionCapture;

            // Image - Thumbnail
            nudThumbnailWidth.Value      = TaskSettings.ImageSettings.ThumbnailWidth;
            nudThumbnailHeight.Value     = TaskSettings.ImageSettings.ThumbnailHeight;
            txtThumbnailName.Text        = TaskSettings.ImageSettings.ThumbnailName;
            lblThumbnailNamePreview.Text = "ImageName" + TaskSettings.ImageSettings.ThumbnailName + ".jpg";
            cbThumbnailIfSmaller.Checked = TaskSettings.ImageSettings.ThumbnailCheckSize;

            // Capture
            cbShowCursor.Checked             = TaskSettings.CaptureSettings.ShowCursor;
            cbCaptureTransparent.Checked     = TaskSettings.CaptureSettings.CaptureTransparent;
            cbCaptureShadow.Enabled          = TaskSettings.CaptureSettings.CaptureTransparent;
            cbCaptureShadow.Checked          = TaskSettings.CaptureSettings.CaptureShadow;
            nudCaptureShadowOffset.Value     = TaskSettings.CaptureSettings.CaptureShadowOffset;
            cbCaptureClientArea.Checked      = TaskSettings.CaptureSettings.CaptureClientArea;
            cbScreenshotDelay.Checked        = TaskSettings.CaptureSettings.IsDelayScreenshot;
            nudScreenshotDelay.Value         = TaskSettings.CaptureSettings.DelayScreenshot;
            cbCaptureAutoHideTaskbar.Checked = TaskSettings.CaptureSettings.CaptureAutoHideTaskbar;

            // Capture / Region capture
            if (TaskSettings.CaptureSettings.SurfaceOptions == null)
            {
                TaskSettings.CaptureSettings.SurfaceOptions = new SurfaceOptions();
            }
            pgRegionCapture.SelectedObject = TaskSettings.CaptureSettings.SurfaceOptions;

            // Capture / Rectangle annotate
            if (TaskSettings.CaptureSettings.RectangleAnnotateOptions == null)
            {
                TaskSettings.CaptureSettings.RectangleAnnotateOptions = new RectangleAnnotateOptions();
            }
            pgRectangleAnnotate.SelectedObject = TaskSettings.CaptureSettings.RectangleAnnotateOptions;

            // Capture / Screen recorder
            nudScreenRecordFPS.Value = TaskSettings.CaptureSettings.ScreenRecordFPS.Between((int)nudScreenRecordFPS.Minimum, (int)nudScreenRecordFPS.Maximum);
            nudGIFFPS.Value          = TaskSettings.CaptureSettings.GIFFPS.Between((int)nudGIFFPS.Minimum, (int)nudGIFFPS.Maximum);
            cbScreenRecorderFixedDuration.Checked = nudScreenRecorderDuration.Enabled = TaskSettings.CaptureSettings.ScreenRecordFixedDuration;
            nudScreenRecorderDuration.Value       = (decimal)TaskSettings.CaptureSettings.ScreenRecordDuration;
            chkScreenRecordAutoStart.Checked      = nudScreenRecorderStartDelay.Enabled = TaskSettings.CaptureSettings.ScreenRecordAutoStart;
            nudScreenRecorderStartDelay.Value     = (decimal)TaskSettings.CaptureSettings.ScreenRecordStartDelay;
            chkRunScreencastCLI.Checked           = cboEncoder.Enabled = btnEncoderConfig.Enabled = TaskSettings.CaptureSettings.RunScreencastCLI;
            UpdateVideoEncoders();

            // Actions
            TaskHelpers.AddDefaultExternalPrograms(TaskSettings);
            TaskSettings.ExternalPrograms.ForEach(AddFileAction);

            // Watch folders
            cbWatchFolderEnabled.Checked = TaskSettings.WatchFolderEnabled;

            if (TaskSettings.WatchFolderList == null)
            {
                TaskSettings.WatchFolderList = new List <WatchFolderSettings>();
            }
            else
            {
                foreach (WatchFolderSettings watchFolder in TaskSettings.WatchFolderList)
                {
                    AddWatchFolder(watchFolder);
                }
            }

            // Upload / Name pattern
            txtNameFormatPattern.Text             = TaskSettings.UploadSettings.NameFormatPattern;
            txtNameFormatPatternActiveWindow.Text = TaskSettings.UploadSettings.NameFormatPatternActiveWindow;
            CodeMenu.Create <ReplCodeMenuEntry>(txtNameFormatPattern, ReplCodeMenuEntry.n, ReplCodeMenuEntry.t, ReplCodeMenuEntry.pn);
            CodeMenu.Create <ReplCodeMenuEntry>(txtNameFormatPatternActiveWindow, ReplCodeMenuEntry.n);
            cbFileUploadUseNamePattern.Checked = TaskSettings.UploadSettings.FileUploadUseNamePattern;

            // Upload / Clipboard upload
            chkClipboardUploadURLContents.Checked    = TaskSettings.UploadSettings.ClipboardUploadURLContents;
            cbClipboardUploadShortenURL.Checked      = TaskSettings.UploadSettings.ClipboardUploadShortenURL;
            cbClipboardUploadShareURL.Checked        = TaskSettings.UploadSettings.ClipboardUploadShareURL;
            cbClipboardUploadAutoIndexFolder.Checked = TaskSettings.UploadSettings.ClipboardUploadAutoIndexFolder;

            // Indexer
            pgIndexerConfig.SelectedObject = TaskSettings.IndexerSettings;

            // Advanced
            pgTaskSettings.SelectedObject = TaskSettings.AdvancedSettings;

            tttvMain.MainTabControl = tcTaskSettings;

            UpdateDefaultSettingVisibility();

            loaded = true;
        }
        private void LoadSettings()
        {
            Icon = ShareXResources.Icon;

            // General
            cbLanguage.Items.AddRange(Helpers.GetLocalizedEnumDescriptions <SupportedLanguage>());
            cbLanguage.SelectedIndex           = (int)Program.Settings.Language;
            cbShowTray.Checked                 = Program.Settings.ShowTray;
            cbSilentRun.Enabled                = Program.Settings.ShowTray;
            cbSilentRun.Checked                = Program.Settings.SilentRun;
            cbStartWithWindows.Checked         = ShortcutHelpers.CheckShortcut(Environment.SpecialFolder.Startup); //RegistryHelper.CheckStartWithWindows();
            cbSendToMenu.Checked               = ShortcutHelpers.CheckShortcut(Environment.SpecialFolder.SendTo);
            cbShellContextMenu.Checked         = RegistryHelpers.CheckShellContextMenu();
            cbTrayIconProgressEnabled.Checked  = Program.Settings.TrayIconProgressEnabled;
            cbTaskbarProgressEnabled.Enabled   = TaskbarManager.IsPlatformSupported;
            cbTaskbarProgressEnabled.Checked   = Program.Settings.TaskbarProgressEnabled;
            cbRememberMainFormPosition.Checked = Program.Settings.RememberMainFormPosition;
            cbRememberMainFormSize.Checked     = Program.Settings.RememberMainFormSize;

            // Paths
            txtPersonalFolderPath.Text = Program.ReadPersonalPathConfig();
            UpdatePersonalFolderPathPreview();
            cbUseCustomScreenshotsPath.Checked = Program.Settings.UseCustomScreenshotsPath;
            txtCustomScreenshotsPath.Text      = Program.Settings.CustomScreenshotsPath;
            txtSaveImageSubFolderPattern.Text  = Program.Settings.SaveImageSubFolderPattern;
            CodeMenu.Create <ReplCodeMenuEntry>(txtSaveImageSubFolderPattern, ReplCodeMenuEntry.t, ReplCodeMenuEntry.pn, ReplCodeMenuEntry.i,
                                                ReplCodeMenuEntry.width, ReplCodeMenuEntry.height, ReplCodeMenuEntry.n);

            // Proxy
            cbProxyMethod.Items.AddRange(Helpers.GetLocalizedEnumDescriptions <ProxyMethod>());
            cbProxyMethod.SelectedIndex = (int)Program.Settings.ProxySettings.ProxyMethod;
            txtProxyUsername.Text       = Program.Settings.ProxySettings.Username;
            txtProxyPassword.Text       = Program.Settings.ProxySettings.Password;
            txtProxyHost.Text           = Program.Settings.ProxySettings.Host ?? string.Empty;
            nudProxyPort.Value          = Program.Settings.ProxySettings.Port;
            UpdateProxyControls();

            // Upload
            nudUploadLimit.Value = Program.Settings.UploadLimit;

            for (int i = 0; i < MaxBufferSizePower; i++)
            {
                string size = ((long)(Math.Pow(2, i) * 1024)).ToSizeString(Program.Settings.BinaryUnits, 0);
                cbBufferSize.Items.Add(size);
            }

            cbBufferSize.SelectedIndex = Program.Settings.BufferSizePower.Between(0, MaxBufferSizePower);

            foreach (ClipboardFormat cf in Program.Settings.ClipboardContentFormats)
            {
                AddClipboardFormat(cf);
            }

            nudRetryUpload.Value             = Program.Settings.MaxUploadFailRetry;
            chkUseSecondaryUploaders.Checked = Program.Settings.UseSecondaryUploaders;
            tlpBackupDestinations.Enabled    = Program.Settings.UseSecondaryUploaders;

            Program.Settings.SecondaryImageUploaders.AddRange(Helpers.GetEnums <ImageDestination>().Where(n => Program.Settings.SecondaryImageUploaders.All(e => e != n)));
            Program.Settings.SecondaryTextUploaders.AddRange(Helpers.GetEnums <TextDestination>().Where(n => Program.Settings.SecondaryTextUploaders.All(e => e != n)));
            Program.Settings.SecondaryFileUploaders.AddRange(Helpers.GetEnums <FileDestination>().Where(n => Program.Settings.SecondaryFileUploaders.All(e => e != n)));

            Program.Settings.SecondaryImageUploaders.Where(n => Helpers.GetEnums <ImageDestination>().All(e => e != n)).ForEach(x => Program.Settings.SecondaryImageUploaders.Remove(x));
            Program.Settings.SecondaryTextUploaders.Where(n => Helpers.GetEnums <TextDestination>().All(e => e != n)).ForEach(x => Program.Settings.SecondaryTextUploaders.Remove(x));
            Program.Settings.SecondaryFileUploaders.Where(n => Helpers.GetEnums <FileDestination>().All(e => e != n)).ForEach(x => Program.Settings.SecondaryFileUploaders.Remove(x));

            Program.Settings.SecondaryImageUploaders.ForEach <ImageDestination>(x => lvSecondaryImageUploaders.Items.Add(new ListViewItem(x.GetLocalizedDescription())
            {
                Tag = x
            }));
            Program.Settings.SecondaryTextUploaders.ForEach <TextDestination>(x => lvSecondaryTextUploaders.Items.Add(new ListViewItem(x.GetLocalizedDescription())
            {
                Tag = x
            }));
            Program.Settings.SecondaryFileUploaders.ForEach <FileDestination>(x => lvSecondaryFileUploaders.Items.Add(new ListViewItem(x.GetLocalizedDescription())
            {
                Tag = x
            }));

            // Print
            cbDontShowPrintSettingDialog.Checked = Program.Settings.DontShowPrintSettingsDialog;
            cbPrintDontShowWindowsDialog.Checked = !Program.Settings.PrintSettings.ShowPrintDialog;

            // Advanced
            pgSettings.SelectedObject = Program.Settings;
        }
Beispiel #4
0
 public WatermarkForm(WatermarkConfig watermarkConfig)
 {
     InitializeComponent();
     config = watermarkConfig;
     CodeMenu.Create <ReplCodeMenuEntry>(txtWatermarkText, ReplCodeMenuEntry.t, ReplCodeMenuEntry.pn);
 }
Beispiel #5
0
        private void LoadSettings()
        {
            // General

            foreach (SupportedLanguage language in Helpers.GetEnums <SupportedLanguage>())
            {
                ToolStripMenuItem tsmi = new ToolStripMenuItem(language.GetLocalizedDescription());
                tsmi.Image        = GetLanguageIcon(language);
                tsmi.ImageScaling = ToolStripItemImageScaling.None;
                SupportedLanguage lang = language;
                tsmi.Click += (sender, e) => ChangeLanguage(lang);
                cmsLanguages.Items.Add(tsmi);
            }

            ChangeLanguage(Program.Settings.Language);

            cbShowTray.Checked  = Program.Settings.ShowTray;
            cbSilentRun.Enabled = Program.Settings.ShowTray;
            cbSilentRun.Checked = Program.Settings.SilentRun;
            cbTrayIconProgressEnabled.Checked  = Program.Settings.TrayIconProgressEnabled;
            cbTaskbarProgressEnabled.Enabled   = TaskbarManager.IsPlatformSupported;
            cbTaskbarProgressEnabled.Checked   = Program.Settings.TaskbarProgressEnabled;
            cbRememberMainFormPosition.Checked = Program.Settings.RememberMainFormPosition;
            cbRememberMainFormSize.Checked     = Program.Settings.RememberMainFormSize;

            // Integration
            cbStartWithWindows.Checked = IntegrationHelpers.CheckStartupShortcut();
            cbShellContextMenu.Checked = IntegrationHelpers.CheckShellContextMenuButton();
            cbSendToMenu.Checked       = IntegrationHelpers.CheckSendToMenuButton();

#if STEAM
            cbSteamShowInApp.Checked = IntegrationHelpers.CheckSteamShowInApp();
#else
            gbSteam.Visible = false;
#endif

            // Paths
            txtPersonalFolderPath.Text = Program.ReadPersonalPathConfig();
            UpdatePersonalFolderPathPreview();
            cbUseCustomScreenshotsPath.Checked = Program.Settings.UseCustomScreenshotsPath;
            txtCustomScreenshotsPath.Text      = Program.Settings.CustomScreenshotsPath;
            txtSaveImageSubFolderPattern.Text  = Program.Settings.SaveImageSubFolderPattern;
            CodeMenu.Create <ReplCodeMenuEntry>(txtSaveImageSubFolderPattern, ReplCodeMenuEntry.t, ReplCodeMenuEntry.pn, ReplCodeMenuEntry.i,
                                                ReplCodeMenuEntry.width, ReplCodeMenuEntry.height, ReplCodeMenuEntry.n);

            // Proxy
            cbProxyMethod.Items.AddRange(Helpers.GetLocalizedEnumDescriptions <ProxyMethod>());
            cbProxyMethod.SelectedIndex = (int)Program.Settings.ProxySettings.ProxyMethod;
            txtProxyUsername.Text       = Program.Settings.ProxySettings.Username;
            txtProxyPassword.Text       = Program.Settings.ProxySettings.Password;
            txtProxyHost.Text           = Program.Settings.ProxySettings.Host ?? string.Empty;
            nudProxyPort.Value          = Program.Settings.ProxySettings.Port;
            UpdateProxyControls();

            // Upload
            nudUploadLimit.Value = Program.Settings.UploadLimit;

            for (int i = 0; i < MaxBufferSizePower; i++)
            {
                string size = ((long)(Math.Pow(2, i) * 1024)).ToSizeString(Program.Settings.BinaryUnits, 0);
                cbBufferSize.Items.Add(size);
            }

            cbBufferSize.SelectedIndex = Program.Settings.BufferSizePower.Between(0, MaxBufferSizePower);

            foreach (ClipboardFormat cf in Program.Settings.ClipboardContentFormats)
            {
                AddClipboardFormat(cf);
            }

            nudRetryUpload.Value             = Program.Settings.MaxUploadFailRetry;
            chkUseSecondaryUploaders.Checked = Program.Settings.UseSecondaryUploaders;
            tlpBackupDestinations.Enabled    = Program.Settings.UseSecondaryUploaders;

            Program.Settings.SecondaryImageUploaders.AddRange(Helpers.GetEnums <ImageDestination>().Where(n => Program.Settings.SecondaryImageUploaders.All(e => e != n)));
            Program.Settings.SecondaryTextUploaders.AddRange(Helpers.GetEnums <TextDestination>().Where(n => Program.Settings.SecondaryTextUploaders.All(e => e != n)));
            Program.Settings.SecondaryFileUploaders.AddRange(Helpers.GetEnums <FileDestination>().Where(n => Program.Settings.SecondaryFileUploaders.All(e => e != n)));

            Program.Settings.SecondaryImageUploaders.Where(n => Helpers.GetEnums <ImageDestination>().All(e => e != n)).ForEach(x => Program.Settings.SecondaryImageUploaders.Remove(x));
            Program.Settings.SecondaryTextUploaders.Where(n => Helpers.GetEnums <TextDestination>().All(e => e != n)).ForEach(x => Program.Settings.SecondaryTextUploaders.Remove(x));
            Program.Settings.SecondaryFileUploaders.Where(n => Helpers.GetEnums <FileDestination>().All(e => e != n)).ForEach(x => Program.Settings.SecondaryFileUploaders.Remove(x));

            Program.Settings.SecondaryImageUploaders.ForEach <ImageDestination>(x => lvSecondaryImageUploaders.Items.Add(new ListViewItem(x.GetLocalizedDescription())
            {
                Tag = x
            }));
            Program.Settings.SecondaryTextUploaders.ForEach <TextDestination>(x => lvSecondaryTextUploaders.Items.Add(new ListViewItem(x.GetLocalizedDescription())
            {
                Tag = x
            }));
            Program.Settings.SecondaryFileUploaders.ForEach <FileDestination>(x => lvSecondaryFileUploaders.Items.Add(new ListViewItem(x.GetLocalizedDescription())
            {
                Tag = x
            }));

            // Print
            cbDontShowPrintSettingDialog.Checked = Program.Settings.DontShowPrintSettingsDialog;
            cbPrintDontShowWindowsDialog.Checked = !Program.Settings.PrintSettings.ShowPrintDialog;

            // Advanced
            pgSettings.SelectedObject = Program.Settings;

            tttvMain.MainTabControl = tcSettings;
        }