Esempio n. 1
0
        public ImageHistoryForm(string historyPath, ImageHistorySettings settings, Action <string> uploadFile = null, Action <string> editImage = null)
        {
            InitializeComponent();
            tsMain.Renderer = new ToolStripRoundedEdgeRenderer();

            HistoryPath = historyPath;
            Settings    = settings;

            ilvImages.View          = (View)Settings.ViewMode;
            ilvImages.ThumbnailSize = Settings.ThumbnailSize;

            if (ShareXResources.ExperimentalDarkTheme)
            {
                ilvImages.BorderStyle              = BorderStyle.None;
                ilvImages.Colors.BackColor         = ShareXResources.DarkBackgroundVariantColor;
                ilvImages.Colors.BorderColor       = ShareXResources.DarkBorderColor;
                ilvImages.Colors.ForeColor         = ShareXResources.DarkTextColor;
                ilvImages.Colors.SelectedForeColor = ShareXResources.DarkTextColor;
            }

            him = new HistoryItemManager(uploadFile, editImage);
            him.GetHistoryItems       += him_GetHistoryItems;
            ilvImages.ContextMenuStrip = him.cmsHistory;

            defaultTitle = Text;

            if (Settings.RememberSearchText)
            {
                tstbSearch.Text = Settings.SearchText;
            }

            ShareXResources.ApplyTheme(this);

            Settings.WindowState.AutoHandleFormState(this);
        }
 public InspectWindowForm()
 {
     InitializeComponent();
     rtbInfo.AddContextMenu();
     ShareXResources.ApplyTheme(this);
     SelectHandle();
 }
        public EditorStartupForm(RegionCaptureOptions options)
        {
            Options = options;

            InitializeComponent();
            ShareXResources.ApplyTheme(this);
        }
Esempio n. 4
0
        public VideoConverterForm(string ffmpegFilePath, VideoConverterOptions options)
        {
            FFmpegFilePath = ffmpegFilePath;
            Options        = options;

            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            UpdateOptions();

            txtInputFilePath.Text  = Options.InputFilePath;
            txtOutputFolder.Text   = Options.OutputFolderPath;
            txtOutputFileName.Text = Options.OutputFileName;
            cbVideoCodec.Items.AddRange(Helpers.GetEnumDescriptions <ConverterVideoCodecs>());
            cbVideoCodec.SelectedIndex = (int)Options.VideoCodec;
            tbVideoQuality.SetValue(tbVideoQuality.Minimum + tbVideoQuality.Maximum - Options.VideoQuality);

            cbAutoOpenFolder.Checked = Options.AutoOpenFolder;

            cbUseCustomArguments.Checked = Options.UseCustomArguments;

            if (Options.UseCustomArguments)
            {
                txtArguments.Text = Options.CustomArguments;
            }

            formReady = true;
        }
Esempio n. 5
0
        public HistoryItemInfoForm(HistoryItem hi)
        {
            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            olvMain.SelectedObject = hi;
        }
Esempio n. 6
0
        public DirectoryIndexerForm(IndexerSettings settings)
        {
            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            Settings = settings;
            pgSettings.SelectedObject = Settings;
        }
Esempio n. 7
0
        public ResponseForm(string response)
        {
            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            Response       = response;
            txtSource.Text = Response;
        }
Esempio n. 8
0
        public UserPassBox(string title, string userName, string password)
        {
            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            Text             = title;
            txtUserName.Text = userName;
            txtPassword.Text = password;
        }
Esempio n. 9
0
        public HistorySettingsForm(HistorySettings settings)
        {
            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            Settings = settings;
            cbRememberSearchText.Checked  = Settings.RememberSearchText;
            cbRememberWindowState.Checked = Settings.RememberWindowState;
        }
        public ImageEffectPackagerForm(string json, string name, string imageEffectsFolderPath)
        {
            ImageEffectJson = json;
            ImageEffectName = name;
            ShareXImageEffectsFolderPath = imageEffectsFolderPath;

            InitializeComponent();
            ShareXResources.ApplyTheme(this);
        }
Esempio n. 11
0
        public HotkeySettingsForm(HotkeyManager hotkeyManager)
        {
            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            btnHotkeysDisabled.Visible = Program.Settings.DisableHotkeys;

            PrepareHotkeys(hotkeyManager);
        }
Esempio n. 12
0
        public WatermarkForm(WatermarkConfig watermarkConfig)
        {
            config = watermarkConfig;

            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            CodeMenu.Create <CodeMenuEntryFilename>(txtWatermarkText, CodeMenuEntryFilename.t, CodeMenuEntryFilename.pn);
        }
Esempio n. 13
0
        public HistoryForm(string historyPath, HistorySettings settings, Action <string> uploadFile = null, Action <string> editImage = null)
        {
            HistoryPath = historyPath;
            Settings    = settings;

            InitializeComponent();
            tsHistory.Renderer = new ToolStripRoundedEdgeRenderer();

            defaultTitle = Text;

            string[] typeNames        = Enum.GetNames(typeof(EDataType));
            string[] typeTranslations = Helpers.GetLocalizedEnumDescriptions <EDataType>();
            typeNamesLocaleLookup = typeNames.Zip(typeTranslations, (key, val) => new { key, val }).ToDictionary(e => e.key, e => e.val);

            UpdateTitle();

            // Mark the Date column as having a date; used for sorting
            chDateTime.Tag = new DateTime();

            ImageList il = new ImageList();

            il.ColorDepth = ColorDepth.Depth32Bit;
            il.Images.Add(Resources.image);
            il.Images.Add(Resources.notebook);
            il.Images.Add(Resources.application_block);
            il.Images.Add(Resources.globe);
            lvHistory.SmallImageList = il;

            him = new HistoryItemManager(uploadFile, editImage, true);
            him.GetHistoryItems       += him_GetHistoryItems;
            lvHistory.ContextMenuStrip = him.cmsHistory;

            pbThumbnail.Reset();
            lvHistory.FillLastColumn();
            scHistoryItemInfo.SplitterWidth   = 7; // Because of bug must be assigned here again
            scHistoryItemInfo.Panel2Collapsed = true;

            tstbSearch.TextBox.HandleCreated += (sender, e) => tstbSearch.TextBox.SetWatermark(Resources.HistoryForm_Search_Watermark, true);

            if (Settings.RememberSearchText)
            {
                tstbSearch.Text = Settings.SearchText;
            }

            ShareXResources.ApplyTheme(this);

            if (Settings.RememberWindowState)
            {
                Settings.WindowState.ApplyFormState(this);

                if (Settings.SplitterDistance > 0)
                {
                    scMain.SplitterDistance = Settings.SplitterDistance;
                }
            }
        }
Esempio n. 14
0
        public OCRForm(Bitmap bmp, OCROptions options)
        {
            bmpSource = (Bitmap)bmp.Clone();
            Options   = options;

            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            OCRLanguage[] languages = OCRHelper.AvailableLanguages;

            if (languages.Length > 0)
            {
                cbLanguages.Items.AddRange(languages);

                if (Options.Language == null)
                {
                    cbLanguages.SelectedIndex = 0;
                    Options.Language          = languages[0].LanguageTag;
                }
                else
                {
                    int index = Array.FindIndex(languages, x => x.LanguageTag.Equals(Options.Language, StringComparison.OrdinalIgnoreCase));

                    if (index >= 0)
                    {
                        cbLanguages.SelectedIndex = index;
                    }
                    else
                    {
                        cbLanguages.SelectedIndex = 0;
                        Options.Language          = languages[0].LanguageTag;
                    }
                }
            }
            else
            {
                cbLanguages.Enabled = false;
            }

            nudScaleFactor.SetValue((decimal)Options.ScaleFactor);

            if (Options.ServiceLinks != null && Options.ServiceLinks.Count > 0)
            {
                cbServices.Items.AddRange(Options.ServiceLinks.ToArray());
                cbServices.SelectedIndex = Options.SelectedServiceLink;
            }
            else
            {
                cbServices.Enabled = false;
            }

            txtResult.SupportSelectAll();
            UpdateControls();

            loaded = true;
        }
Esempio n. 15
0
        public QRCodeForm(string text = null)
        {
            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            if (!string.IsNullOrEmpty(text))
            {
                txtQRCode.Text = text;
            }
        }
Esempio n. 16
0
        public HistorySettingsForm(HistorySettings settings)
        {
            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            Settings = settings;
            nudMaximumItemLimit.SetValue(Settings.MaxItemCount);
            cbRememberSearchText.Checked  = Settings.RememberSearchText;
            cbRememberWindowState.Checked = Settings.RememberWindowState;
        }
        public BorderlessWindowSettingsForm(BorderlessWindowSettings settings)
        {
            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            Settings = settings;
            cbRememberWindowTitle.Checked = Settings.RememberWindowTitle;
            cbAutoCloseWindow.Checked     = Settings.AutoCloseWindow;
            cbExcludeTaskbarArea.Checked  = Settings.ExcludeTaskbarArea;
        }
Esempio n. 18
0
        public AfterUploadForm(TaskInfo info)
        {
            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            Info = info;

            if (Info.TaskSettings.AdvancedSettings.AutoCloseAfterUploadForm)
            {
                tmrClose.Start();
            }

            bool isFileExist = !string.IsNullOrEmpty(info.FilePath) && File.Exists(info.FilePath);

            if (info.DataType == EDataType.Image)
            {
                if (isFileExist)
                {
                    pbPreview.LoadImageFromFileAsync(info.FilePath);
                }
                else
                {
                    pbPreview.LoadImageFromURLAsync(info.Result.URL);
                }
            }

            Text = "ShareX - " + (isFileExist ? info.FilePath : info.FileName);

            lvClipboardFormats.Groups.Add(lvgForums);
            lvClipboardFormats.Groups.Add(lvgHtml);
            lvClipboardFormats.Groups.Add(lvgWiki);
            lvClipboardFormats.Groups.Add(lvgLocal);
            lvClipboardFormats.Groups.Add(lvgCustom);

            foreach (LinkFormatEnum type in Helpers.GetEnums <LinkFormatEnum>())
            {
                if (!FileHelpers.IsImageFile(Info.Result.URL) &&
                    (type == LinkFormatEnum.HTMLImage || type == LinkFormatEnum.HTMLLinkedImage ||
                     type == LinkFormatEnum.ForumImage || type == LinkFormatEnum.ForumLinkedImage ||
                     type == LinkFormatEnum.WikiImage || type == LinkFormatEnum.WikiLinkedImage))
                {
                    continue;
                }

                AddFormat(type.GetLocalizedDescription(), GetUrlByType(type));
            }

            if (FileHelpers.IsImageFile(Info.Result.URL))
            {
                foreach (ClipboardFormat cf in Program.Settings.ClipboardContentFormats)
                {
                    AddFormat(cf.Description, parser.Parse(Info, cf.Format), lvgCustom);
                }
            }
        }
Esempio n. 19
0
        public ImageCombinerForm(ImageCombinerOptions options)
        {
            Options = options;

            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            cbOrientation.Items.AddRange(Enum.GetNames(typeof(Orientation)));
            cbOrientation.SelectedIndex = (int)Options.Orientation;
            nudSpace.SetValue(Options.Space);
        }
Esempio n. 20
0
        public WatchFolderForm(WatchFolderSettings watchFolder)
        {
            WatchFolder = watchFolder;

            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            txtFolderPath.Text = watchFolder.FolderPath ?? "";
            txtFilter.Text     = watchFolder.Filter ?? "";
            cbIncludeSubdirectories.Checked = watchFolder.IncludeSubdirectories;
        }
Esempio n. 21
0
        private ResponseForm(UploadResult result)
        {
            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            rtbResult.AddContextMenu();
            rtbResponseInfo.AddContextMenu();
            rtbResponseText.AddContextMenu();

            UpdateResult(result);
        }
Esempio n. 22
0
        public VideoThumbnailerForm(string ffmpegPath, VideoThumbnailOptions options)
        {
            FFmpegPath = ffmpegPath;
            Options    = options;

            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            txtMediaPath.Text        = Options.LastVideoPath ?? "";
            pgOptions.SelectedObject = Options;
        }
Esempio n. 23
0
        public OCRSpaceForm(OCROptions ocrOptions)
        {
            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            this.ocrOptions = ocrOptions;
            cbLanguages.Items.AddRange(Helpers.GetEnumDescriptions <OCRSpaceLanguages>());
            cbLanguages.SelectedIndex = (int)ocrOptions.DefaultLanguage;
            Language = ocrOptions.DefaultLanguage;
            txtResult.SupportSelectAll();
        }
Esempio n. 24
0
        public ClipboardUploadForm(bool showCheckBox = false)
        {
            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            if (ShareXResources.UseCustomTheme)
            {
                lblQuestion.BackColor = ShareXResources.Theme.BorderColor;
            }

            cbDontShowThisWindow.Visible = showCheckBox;
        }
Esempio n. 25
0
        public FirstTimeUploadForm()
        {
            InitializeComponent();
            ShareXResources.ApplyTheme(this);
            lblHeader.BackColor = Color.DarkRed;
            lblHeader.ForeColor = Color.WhiteSmoke;

            btnYes.Enabled = false;
            textYes        = btnYes.Text;
            UpdateCountdown();
            tCountdown.Start();
        }
Esempio n. 26
0
        public ImageHistorySettingsForm(ImageHistorySettings settings)
        {
            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            Settings = settings;
            nudThumbnailSize.SetValue(Settings.ThumbnailSize.Width);
            nudMaximumImageLimit.SetValue(Settings.MaxItemCount);
            cbFilterMissingFiles.Checked  = Settings.FilterMissingFiles;
            cbRememberSearchText.Checked  = Settings.RememberSearchText;
            cbRememberWindowState.Checked = Settings.RememberWindowState;
        }
Esempio n. 27
0
        public CustomUploaderSettingsForm(UploadersConfig config)
        {
            Config = config;

            InitializeComponent();

            /*
             * CodeMenuItem[] inputCodeMenuItems = new CodeMenuItem[]
             * {
             *  new CodeMenuItem("$input$", "Text/URL input"),
             *  new CodeMenuItem("$filename$", "File name"),
             *  new CodeMenuItem("$random:input1|input2$", "Random selection from list"),
             *  new CodeMenuItem("$select:input1|input2$", "Lets user to select one input from list"),
             *  new CodeMenuItem("$prompt:title|default_value$", "Lets user to input text"),
             *  new CodeMenuItem("$base64:input$", "Base64 encode input")
             * };
             */

            CodeMenuItem[] outputCodeMenuItems = new CodeMenuItem[]
            {
                new CodeMenuItem("$response$", "Response text"),
                new CodeMenuItem("$responseurl$", "Response/Redirection URL"),
                new CodeMenuItem("$header:header_name$", "Response header"),
                new CodeMenuItem("$json:path$", "Parse response using JSON"),
                new CodeMenuItem("$xml:path$", "Parse response using XML"),
                new CodeMenuItem("$regex:index|group$", "Parse response using Regex"),
                new CodeMenuItem("$filename$", "File name used when uploading"),
                new CodeMenuItem("$random:input1|input2$", "Random selection from list"),
                new CodeMenuItem("$select:input1|input2$", "Lets user to select one input from list"),
                new CodeMenuItem("$prompt:title|default_value$", "Lets user to input text"),
                new CodeMenuItem("$base64:input$", "Base64 encode input")
            };

            new CodeMenu(rtbResultURL, outputCodeMenuItems);
            new CodeMenu(rtbResultThumbnailURL, outputCodeMenuItems);
            new CodeMenu(rtbResultDeletionURL, outputCodeMenuItems);
            new CodeMenu(rtbResultErrorMessage, outputCodeMenuItems);

            rtbRequestURL.AddContextMenu();
            rtbData.AddContextMenu();
            rtbResultURL.AddContextMenu();
            rtbResultThumbnailURL.AddContextMenu();
            rtbResultDeletionURL.AddContextMenu();
            rtbResultErrorMessage.AddContextMenu();
            eiCustomUploaders.ObjectType = typeof(CustomUploaderItem);
            CustomUploaderAddDestinationTypes();
            cbRequestMethod.Items.AddRange(Enum.GetNames(typeof(HttpMethod)));
            cbBody.Items.AddRange(Helpers.GetEnumDescriptions <CustomUploaderBody>());

            ShareXResources.ApplyTheme(this);

            CustomUploaderLoadTab();
        }
        public FileExistForm(string filepath)
        {
            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            Filepath            = filepath;
            filename            = Path.GetFileNameWithoutExtension(Filepath);
            txtNewName.Text     = filename;
            btnOverwrite.Text  += Path.GetFileName(Filepath);
            uniqueFilepath      = Helpers.GetUniqueFilePath(Filepath);
            btnUniqueName.Text += Path.GetFileName(uniqueFilepath);
        }
Esempio n. 29
0
        public QuickTaskMenuEditorForm()
        {
            InitializeComponent();
            ShareXResources.ApplyTheme(this);

            if (Program.Settings.QuickTaskPresets == null)
            {
                Program.Settings.QuickTaskPresets = new List <QuickTaskInfo>();
            }

            UpdateItems();
        }
Esempio n. 30
0
        public ParserSelectForm(string[] texts)
        {
            InitializeComponent();

            Texts        = texts;
            SelectedText = Texts[0];

            SuspendLayout();

            int maxButtonWidth = 0;
            int rowSize        = 10;

            for (int i = 0; i < Texts.Length; i++)
            {
                string text = Texts[i];

                if (!string.IsNullOrEmpty(text))
                {
                    Button button = new Button()
                    {
                        AutoSize = true,
                        Margin   = new Padding(i < rowSize ? 5 : 0, i % rowSize == 0 ? 5 : 0, 5, 5),
                        Padding  = new Padding(5),
                        Font     = new Font(Font.FontFamily, 12),
                        Text     = text,
                        UseVisualStyleBackColor = true
                    };

                    button.Click += (sender, e) =>
                    {
                        SelectedText = text;
                        Close();
                    };

                    flpMain.Controls.Add(button);
                    if ((i + 1) % rowSize == 0)
                    {
                        flpMain.SetFlowBreak(button, true);
                    }
                    maxButtonWidth = Math.Max(button.Width, maxButtonWidth);
                }
            }

            foreach (Control control in flpMain.Controls)
            {
                control.Width = maxButtonWidth;
            }

            ResumeLayout();

            ShareXResources.ApplyTheme(this);
        }