From 482d2bb6fc8ac690ec4a2032618274ea0109bda3 Mon Sep 17 00:00:00 2001 From: Jaex Date: Sun, 22 Apr 2018 12:10:23 +0300 Subject: [PATCH] Shared folder UI improvements --- .../Controls/AccountsControl.Designer.cs | 113 --- .../Controls/AccountsControl.cs | 85 -- .../Controls/AccountsControl.de.resx | 131 --- .../Controls/AccountsControl.es.resx | 132 --- .../Controls/AccountsControl.fr.resx | 132 --- .../Controls/AccountsControl.hu.resx | 132 --- .../Controls/AccountsControl.id-ID.resx | 132 --- .../Controls/AccountsControl.it-IT.resx | 132 --- .../Controls/AccountsControl.ko-KR.resx | 132 --- .../Controls/AccountsControl.nl-NL.resx | 132 --- .../Controls/AccountsControl.pt-BR.resx | 132 --- .../Controls/AccountsControl.resx | 333 -------- .../Controls/AccountsControl.ru.resx | 132 --- .../Controls/AccountsControl.tr.resx | 132 --- .../Controls/AccountsControl.uk.resx | 129 --- .../Controls/AccountsControl.vi-VN.resx | 132 --- .../Controls/AccountsControl.zh-CN.resx | 131 --- .../Controls/AccountsControl.zh-TW.resx | 131 --- .../Forms/UploadersConfigForm.Designer.cs | 83 +- .../Forms/UploadersConfigForm.cs | 128 ++- .../Forms/UploadersConfigForm.resx | 758 ++++++++++-------- .../Forms/UploadersConfigFormHelper.cs | 71 ++ .../ShareX.UploadersLib.csproj | 54 -- 23 files changed, 616 insertions(+), 2983 deletions(-) delete mode 100644 ShareX.UploadersLib/Controls/AccountsControl.Designer.cs delete mode 100644 ShareX.UploadersLib/Controls/AccountsControl.cs delete mode 100644 ShareX.UploadersLib/Controls/AccountsControl.de.resx delete mode 100644 ShareX.UploadersLib/Controls/AccountsControl.es.resx delete mode 100644 ShareX.UploadersLib/Controls/AccountsControl.fr.resx delete mode 100644 ShareX.UploadersLib/Controls/AccountsControl.hu.resx delete mode 100644 ShareX.UploadersLib/Controls/AccountsControl.id-ID.resx delete mode 100644 ShareX.UploadersLib/Controls/AccountsControl.it-IT.resx delete mode 100644 ShareX.UploadersLib/Controls/AccountsControl.ko-KR.resx delete mode 100644 ShareX.UploadersLib/Controls/AccountsControl.nl-NL.resx delete mode 100644 ShareX.UploadersLib/Controls/AccountsControl.pt-BR.resx delete mode 100644 ShareX.UploadersLib/Controls/AccountsControl.resx delete mode 100644 ShareX.UploadersLib/Controls/AccountsControl.ru.resx delete mode 100644 ShareX.UploadersLib/Controls/AccountsControl.tr.resx delete mode 100644 ShareX.UploadersLib/Controls/AccountsControl.uk.resx delete mode 100644 ShareX.UploadersLib/Controls/AccountsControl.vi-VN.resx delete mode 100644 ShareX.UploadersLib/Controls/AccountsControl.zh-CN.resx delete mode 100644 ShareX.UploadersLib/Controls/AccountsControl.zh-TW.resx diff --git a/ShareX.UploadersLib/Controls/AccountsControl.Designer.cs b/ShareX.UploadersLib/Controls/AccountsControl.Designer.cs deleted file mode 100644 index 099071028..000000000 --- a/ShareX.UploadersLib/Controls/AccountsControl.Designer.cs +++ /dev/null @@ -1,113 +0,0 @@ -namespace ShareX.UploadersLib -{ - public partial class AccountsControl - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AccountsControl)); - this.pgSettings = new System.Windows.Forms.PropertyGrid(); - this.lbAccounts = new System.Windows.Forms.ListBox(); - this.btnAdd = new System.Windows.Forms.Button(); - this.btnTest = new System.Windows.Forms.Button(); - this.btnRemove = new System.Windows.Forms.Button(); - this.AccountsLayout = new System.Windows.Forms.TableLayoutPanel(); - this.btnDuplicate = new System.Windows.Forms.Button(); - this.AccountsLayout.SuspendLayout(); - this.SuspendLayout(); - // - // pgSettings - // - resources.ApplyResources(this.pgSettings, "pgSettings"); - this.pgSettings.Name = "pgSettings"; - this.pgSettings.PropertySort = System.Windows.Forms.PropertySort.NoSort; - this.pgSettings.ToolbarVisible = false; - this.pgSettings.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.pgSettings_PropertyValueChanged); - // - // lbAccounts - // - resources.ApplyResources(this.lbAccounts, "lbAccounts"); - this.lbAccounts.FormattingEnabled = true; - this.lbAccounts.Name = "lbAccounts"; - this.lbAccounts.SelectedIndexChanged += new System.EventHandler(this.lbAccounts_SelectedIndexChanged); - // - // btnAdd - // - resources.ApplyResources(this.btnAdd, "btnAdd"); - this.btnAdd.Name = "btnAdd"; - this.btnAdd.UseVisualStyleBackColor = true; - // - // btnTest - // - resources.ApplyResources(this.btnTest, "btnTest"); - this.btnTest.Name = "btnTest"; - this.btnTest.UseVisualStyleBackColor = true; - // - // btnRemove - // - resources.ApplyResources(this.btnRemove, "btnRemove"); - this.btnRemove.Name = "btnRemove"; - this.btnRemove.UseVisualStyleBackColor = true; - // - // AccountsLayout - // - resources.ApplyResources(this.AccountsLayout, "AccountsLayout"); - this.AccountsLayout.Controls.Add(this.pgSettings, 1, 0); - this.AccountsLayout.Controls.Add(this.lbAccounts, -1, 0); - this.AccountsLayout.Name = "AccountsLayout"; - // - // btnDuplicate - // - resources.ApplyResources(this.btnDuplicate, "btnDuplicate"); - this.btnDuplicate.Name = "btnDuplicate"; - this.btnDuplicate.UseVisualStyleBackColor = true; - // - // AccountsControl - // - resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.btnDuplicate); - this.Controls.Add(this.AccountsLayout); - this.Controls.Add(this.btnAdd); - this.Controls.Add(this.btnTest); - this.Controls.Add(this.btnRemove); - this.Name = "AccountsControl"; - this.AccountsLayout.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion Component Designer generated code - - public System.Windows.Forms.Button btnAdd; - public System.Windows.Forms.Button btnTest; - public System.Windows.Forms.Button btnRemove; - private System.Windows.Forms.TableLayoutPanel AccountsLayout; - public System.Windows.Forms.PropertyGrid pgSettings; - public System.Windows.Forms.ListBox lbAccounts; - public System.Windows.Forms.Button btnDuplicate; - } -} \ No newline at end of file diff --git a/ShareX.UploadersLib/Controls/AccountsControl.cs b/ShareX.UploadersLib/Controls/AccountsControl.cs deleted file mode 100644 index 5879b76b8..000000000 --- a/ShareX.UploadersLib/Controls/AccountsControl.cs +++ /dev/null @@ -1,85 +0,0 @@ -#region License Information (GPL v3) - -/* - ShareX - A program that allows you to take screenshots and share any file type - Copyright (c) 2007-2018 ShareX Team - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Optionally you can also view the license at . -*/ - -#endregion License Information (GPL v3) - -using ShareX.HelpersLib; -using System; -using System.Windows.Forms; - -namespace ShareX.UploadersLib -{ - public partial class AccountsControl : UserControl - { - public AccountsControl() - { - InitializeComponent(); - } - - public void AddItem(object item) - { - lbAccounts.Items.Add(item); - lbAccounts.SelectedIndex = lbAccounts.Items.Count - 1; - } - - public bool RemoveItem(int selected) - { - if (selected.IsBetween(0, lbAccounts.Items.Count - 1)) - { - lbAccounts.Items.RemoveAt(selected); - - if (lbAccounts.Items.Count > 0) - { - lbAccounts.SelectedIndex = selected == lbAccounts.Items.Count ? lbAccounts.Items.Count - 1 : selected; - pgSettings.SelectedObject = lbAccounts.Items[lbAccounts.SelectedIndex]; - } - else - { - pgSettings.SelectedObject = null; - } - - return true; - } - - return false; - } - - private void pgSettings_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) - { - if (lbAccounts.SelectedIndex > -1) - { - lbAccounts.Items[lbAccounts.SelectedIndex] = pgSettings.SelectedObject; - } - } - - private void lbAccounts_SelectedIndexChanged(object sender, EventArgs e) - { - btnRemove.Enabled = btnDuplicate.Enabled = btnTest.Enabled = lbAccounts.SelectedIndex > -1; - - if (lbAccounts.SelectedIndex > -1) - { - pgSettings.SelectedObject = lbAccounts.Items[lbAccounts.SelectedIndex]; - } - } - } -} \ No newline at end of file diff --git a/ShareX.UploadersLib/Controls/AccountsControl.de.resx b/ShareX.UploadersLib/Controls/AccountsControl.de.resx deleted file mode 100644 index dbfac872e..000000000 --- a/ShareX.UploadersLib/Controls/AccountsControl.de.resx +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Hinzufügen - - - Duplizieren - - - Entfernen - - - Test - - \ No newline at end of file diff --git a/ShareX.UploadersLib/Controls/AccountsControl.es.resx b/ShareX.UploadersLib/Controls/AccountsControl.es.resx deleted file mode 100644 index a16633c18..000000000 --- a/ShareX.UploadersLib/Controls/AccountsControl.es.resx +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Añadir - - - Duplicar - - - Probar - - - Quitar - - \ No newline at end of file diff --git a/ShareX.UploadersLib/Controls/AccountsControl.fr.resx b/ShareX.UploadersLib/Controls/AccountsControl.fr.resx deleted file mode 100644 index ab437a809..000000000 --- a/ShareX.UploadersLib/Controls/AccountsControl.fr.resx +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Ajouter - - - Dupliquer - - - Supprimer - - - Tester - - \ No newline at end of file diff --git a/ShareX.UploadersLib/Controls/AccountsControl.hu.resx b/ShareX.UploadersLib/Controls/AccountsControl.hu.resx deleted file mode 100644 index 75044bde1..000000000 --- a/ShareX.UploadersLib/Controls/AccountsControl.hu.resx +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Hozzáadás - - - Duplikálás - - - Eltávolítás - - - Teszt - - \ No newline at end of file diff --git a/ShareX.UploadersLib/Controls/AccountsControl.id-ID.resx b/ShareX.UploadersLib/Controls/AccountsControl.id-ID.resx deleted file mode 100644 index 2309180fc..000000000 --- a/ShareX.UploadersLib/Controls/AccountsControl.id-ID.resx +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Buang - - - Duplikat - - - Uji - - - Tambah - - \ No newline at end of file diff --git a/ShareX.UploadersLib/Controls/AccountsControl.it-IT.resx b/ShareX.UploadersLib/Controls/AccountsControl.it-IT.resx deleted file mode 100644 index 4a8164274..000000000 --- a/ShareX.UploadersLib/Controls/AccountsControl.it-IT.resx +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Aggiungi - - - Duplica - - - Rimuovi - - - Prova - - \ No newline at end of file diff --git a/ShareX.UploadersLib/Controls/AccountsControl.ko-KR.resx b/ShareX.UploadersLib/Controls/AccountsControl.ko-KR.resx deleted file mode 100644 index 7cdee58a4..000000000 --- a/ShareX.UploadersLib/Controls/AccountsControl.ko-KR.resx +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 추가 - - - 복제 - - - 삭제 - - - 테스트 - - \ No newline at end of file diff --git a/ShareX.UploadersLib/Controls/AccountsControl.nl-NL.resx b/ShareX.UploadersLib/Controls/AccountsControl.nl-NL.resx deleted file mode 100644 index e0eb37bf4..000000000 --- a/ShareX.UploadersLib/Controls/AccountsControl.nl-NL.resx +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Toevoegen - - - Dupliceren - - - Verwijderen - - - Testen - - \ No newline at end of file diff --git a/ShareX.UploadersLib/Controls/AccountsControl.pt-BR.resx b/ShareX.UploadersLib/Controls/AccountsControl.pt-BR.resx deleted file mode 100644 index cb3c597b0..000000000 --- a/ShareX.UploadersLib/Controls/AccountsControl.pt-BR.resx +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Adicionar - - - Duplicar - - - Remover - - - Testar - - \ No newline at end of file diff --git a/ShareX.UploadersLib/Controls/AccountsControl.resx b/ShareX.UploadersLib/Controls/AccountsControl.resx deleted file mode 100644 index 6fd7dc1f6..000000000 --- a/ShareX.UploadersLib/Controls/AccountsControl.resx +++ /dev/null @@ -1,333 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - Fill - - - - 200, 0 - - - 3, 0, 0, 0 - - - 544, 352 - - - - 1 - - - pgSettings - - - System.Windows.Forms.PropertyGrid, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - AccountsLayout - - - 0 - - - Fill - - - False - - - 0, 0 - - - 0, 0, 0, 0 - - - 197, 352 - - - 0 - - - lbAccounts - - - System.Windows.Forms.ListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - AccountsLayout - - - 1 - - - NoControl - - - 8, 8 - - - 80, 24 - - - 0 - - - Add - - - btnAdd - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - - - NoControl - - - 272, 8 - - - 80, 24 - - - 3 - - - Test - - - btnTest - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - NoControl - - - 96, 8 - - - 80, 24 - - - 1 - - - Remove - - - btnRemove - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 4 - - - Top, Bottom, Left, Right - - - 2 - - - 8, 40 - - - 1 - - - 744, 352 - - - 4 - - - AccountsLayout - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="pgSettings" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbAccounts" Row="0" RowSpan="1" Column="-1" ColumnSpan="1" /></Controls><Columns Styles="Percent,26,54987,Percent,73,45013" /><Rows Styles="Percent,100" /></TableLayoutSettings> - - - 184, 8 - - - 80, 24 - - - 2 - - - Duplicate - - - btnDuplicate - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - True - - - 6, 13 - - - 760, 400 - - - AccountsControl - - - System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/ShareX.UploadersLib/Controls/AccountsControl.ru.resx b/ShareX.UploadersLib/Controls/AccountsControl.ru.resx deleted file mode 100644 index 012a26424..000000000 --- a/ShareX.UploadersLib/Controls/AccountsControl.ru.resx +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Добавить - - - Копия - - - Удалить - - - Тест - - \ No newline at end of file diff --git a/ShareX.UploadersLib/Controls/AccountsControl.tr.resx b/ShareX.UploadersLib/Controls/AccountsControl.tr.resx deleted file mode 100644 index 846701882..000000000 --- a/ShareX.UploadersLib/Controls/AccountsControl.tr.resx +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Ekle - - - Çoğalt - - - Kaldır - - - Test - - \ No newline at end of file diff --git a/ShareX.UploadersLib/Controls/AccountsControl.uk.resx b/ShareX.UploadersLib/Controls/AccountsControl.uk.resx deleted file mode 100644 index af61087e2..000000000 --- a/ShareX.UploadersLib/Controls/AccountsControl.uk.resx +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Додати - - - Перевірка - - - Вилучити - - diff --git a/ShareX.UploadersLib/Controls/AccountsControl.vi-VN.resx b/ShareX.UploadersLib/Controls/AccountsControl.vi-VN.resx deleted file mode 100644 index 019878aff..000000000 --- a/ShareX.UploadersLib/Controls/AccountsControl.vi-VN.resx +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Thêm - - - Nhân bản - - - Xóa - - - Thử nghiệm - - \ No newline at end of file diff --git a/ShareX.UploadersLib/Controls/AccountsControl.zh-CN.resx b/ShareX.UploadersLib/Controls/AccountsControl.zh-CN.resx deleted file mode 100644 index 3803c3b65..000000000 --- a/ShareX.UploadersLib/Controls/AccountsControl.zh-CN.resx +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 复制 - - - 添加 - - - 删除 - - - 测试 - - \ No newline at end of file diff --git a/ShareX.UploadersLib/Controls/AccountsControl.zh-TW.resx b/ShareX.UploadersLib/Controls/AccountsControl.zh-TW.resx deleted file mode 100644 index 8e1486063..000000000 --- a/ShareX.UploadersLib/Controls/AccountsControl.zh-TW.resx +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 複製 - - - 新增 - - - 刪除 - - - 測試 - - \ No newline at end of file diff --git a/ShareX.UploadersLib/Forms/UploadersConfigForm.Designer.cs b/ShareX.UploadersLib/Forms/UploadersConfigForm.Designer.cs index 8fd0f71f2..eae9422f7 100644 --- a/ShareX.UploadersLib/Forms/UploadersConfigForm.Designer.cs +++ b/ShareX.UploadersLib/Forms/UploadersConfigForm.Designer.cs @@ -488,17 +488,21 @@ private void InitializeComponent() this.txtPlikLogin = new System.Windows.Forms.TextBox(); this.tpYouTube = new System.Windows.Forms.TabPage(); this.cbYouTubeUseShortenedLink = new System.Windows.Forms.CheckBox(); - this.oauth2YouTube = new ShareX.UploadersLib.OAuthControl(); this.cbYouTubePrivacyType = new System.Windows.Forms.ComboBox(); this.lblYouTubePrivacyType = new System.Windows.Forms.Label(); + this.oauth2YouTube = new ShareX.UploadersLib.OAuthControl(); this.tpSharedFolder = new System.Windows.Forms.TabPage(); + this.lbSharedFolderAccounts = new System.Windows.Forms.ListBox(); + this.pgSharedFolderAccount = new System.Windows.Forms.PropertyGrid(); + this.btnSharedFolderDuplicate = new System.Windows.Forms.Button(); + this.btnSharedFolderRemove = new System.Windows.Forms.Button(); + this.btnSharedFolderAdd = new System.Windows.Forms.Button(); this.lblSharedFolderFiles = new System.Windows.Forms.Label(); this.lblSharedFolderText = new System.Windows.Forms.Label(); this.cboSharedFolderFiles = new System.Windows.Forms.ComboBox(); this.lblSharedFolderImages = new System.Windows.Forms.Label(); this.cboSharedFolderText = new System.Windows.Forms.ComboBox(); this.cboSharedFolderImages = new System.Windows.Forms.ComboBox(); - this.ucLocalhostAccounts = new ShareX.UploadersLib.AccountsControl(); this.tpEmail = new System.Windows.Forms.TabPage(); this.txtEmailAutomaticSendTo = new System.Windows.Forms.TextBox(); this.cbEmailAutomaticSend = new System.Windows.Forms.CheckBox(); @@ -4110,9 +4114,9 @@ private void InitializeComponent() // tpYouTube // this.tpYouTube.Controls.Add(this.cbYouTubeUseShortenedLink); - this.tpYouTube.Controls.Add(this.oauth2YouTube); this.tpYouTube.Controls.Add(this.cbYouTubePrivacyType); this.tpYouTube.Controls.Add(this.lblYouTubePrivacyType); + this.tpYouTube.Controls.Add(this.oauth2YouTube); resources.ApplyResources(this.tpYouTube, "tpYouTube"); this.tpYouTube.Name = "tpYouTube"; this.tpYouTube.UseVisualStyleBackColor = true; @@ -4124,15 +4128,6 @@ private void InitializeComponent() this.cbYouTubeUseShortenedLink.UseVisualStyleBackColor = true; this.cbYouTubeUseShortenedLink.CheckedChanged += new System.EventHandler(this.cbYouTubeUseShortenedLink_CheckedChanged); // - // oauth2YouTube - // - resources.ApplyResources(this.oauth2YouTube, "oauth2YouTube"); - this.oauth2YouTube.Name = "oauth2YouTube"; - this.oauth2YouTube.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2YouTube_OpenButtonClicked); - this.oauth2YouTube.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2YouTube_CompleteButtonClicked); - this.oauth2YouTube.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2YouTube_ClearButtonClicked); - this.oauth2YouTube.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2YouTube_RefreshButtonClicked); - // // cbYouTubePrivacyType // this.cbYouTubePrivacyType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; @@ -4146,19 +4141,68 @@ private void InitializeComponent() resources.ApplyResources(this.lblYouTubePrivacyType, "lblYouTubePrivacyType"); this.lblYouTubePrivacyType.Name = "lblYouTubePrivacyType"; // + // oauth2YouTube + // + resources.ApplyResources(this.oauth2YouTube, "oauth2YouTube"); + this.oauth2YouTube.Name = "oauth2YouTube"; + this.oauth2YouTube.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauth2YouTube_OpenButtonClicked); + this.oauth2YouTube.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauth2YouTube_CompleteButtonClicked); + this.oauth2YouTube.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauth2YouTube_ClearButtonClicked); + this.oauth2YouTube.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauth2YouTube_RefreshButtonClicked); + // // tpSharedFolder // this.tpSharedFolder.BackColor = System.Drawing.SystemColors.Window; + this.tpSharedFolder.Controls.Add(this.lbSharedFolderAccounts); + this.tpSharedFolder.Controls.Add(this.pgSharedFolderAccount); + this.tpSharedFolder.Controls.Add(this.btnSharedFolderDuplicate); + this.tpSharedFolder.Controls.Add(this.btnSharedFolderRemove); + this.tpSharedFolder.Controls.Add(this.btnSharedFolderAdd); this.tpSharedFolder.Controls.Add(this.lblSharedFolderFiles); this.tpSharedFolder.Controls.Add(this.lblSharedFolderText); this.tpSharedFolder.Controls.Add(this.cboSharedFolderFiles); this.tpSharedFolder.Controls.Add(this.lblSharedFolderImages); this.tpSharedFolder.Controls.Add(this.cboSharedFolderText); this.tpSharedFolder.Controls.Add(this.cboSharedFolderImages); - this.tpSharedFolder.Controls.Add(this.ucLocalhostAccounts); resources.ApplyResources(this.tpSharedFolder, "tpSharedFolder"); this.tpSharedFolder.Name = "tpSharedFolder"; // + // lbSharedFolderAccounts + // + this.lbSharedFolderAccounts.FormattingEnabled = true; + resources.ApplyResources(this.lbSharedFolderAccounts, "lbSharedFolderAccounts"); + this.lbSharedFolderAccounts.Name = "lbSharedFolderAccounts"; + this.lbSharedFolderAccounts.SelectedIndexChanged += new System.EventHandler(this.lbSharedFolderAccounts_SelectedIndexChanged); + // + // pgSharedFolderAccount + // + resources.ApplyResources(this.pgSharedFolderAccount, "pgSharedFolderAccount"); + this.pgSharedFolderAccount.Name = "pgSharedFolderAccount"; + this.pgSharedFolderAccount.PropertySort = System.Windows.Forms.PropertySort.NoSort; + this.pgSharedFolderAccount.ToolbarVisible = false; + this.pgSharedFolderAccount.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.pgSharedFolderAccount_PropertyValueChanged); + // + // btnSharedFolderDuplicate + // + resources.ApplyResources(this.btnSharedFolderDuplicate, "btnSharedFolderDuplicate"); + this.btnSharedFolderDuplicate.Name = "btnSharedFolderDuplicate"; + this.btnSharedFolderDuplicate.UseVisualStyleBackColor = true; + this.btnSharedFolderDuplicate.Click += new System.EventHandler(this.btnSharedFolderDuplicate_Click); + // + // btnSharedFolderRemove + // + resources.ApplyResources(this.btnSharedFolderRemove, "btnSharedFolderRemove"); + this.btnSharedFolderRemove.Name = "btnSharedFolderRemove"; + this.btnSharedFolderRemove.UseVisualStyleBackColor = true; + this.btnSharedFolderRemove.Click += new System.EventHandler(this.btnSharedFolderRemove_Click); + // + // btnSharedFolderAdd + // + resources.ApplyResources(this.btnSharedFolderAdd, "btnSharedFolderAdd"); + this.btnSharedFolderAdd.Name = "btnSharedFolderAdd"; + this.btnSharedFolderAdd.UseVisualStyleBackColor = true; + this.btnSharedFolderAdd.Click += new System.EventHandler(this.btnSharedFolderAdd_Click); + // // lblSharedFolderFiles // resources.ApplyResources(this.lblSharedFolderFiles, "lblSharedFolderFiles"); @@ -4198,11 +4242,6 @@ private void InitializeComponent() this.cboSharedFolderImages.Name = "cboSharedFolderImages"; this.cboSharedFolderImages.SelectedIndexChanged += new System.EventHandler(this.cboSharedFolderImages_SelectedIndexChanged); // - // ucLocalhostAccounts - // - resources.ApplyResources(this.ucLocalhostAccounts, "ucLocalhostAccounts"); - this.ucLocalhostAccounts.Name = "ucLocalhostAccounts"; - // // tpEmail // this.tpEmail.BackColor = System.Drawing.SystemColors.Window; @@ -5265,6 +5304,8 @@ private void InitializeComponent() this.Controls.Add(this.lblWidthHint); this.Controls.Add(this.tcUploaders); this.Controls.Add(this.ttlvMain); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; this.Name = "UploadersConfigForm"; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.Shown += new System.EventHandler(this.UploadersConfigForm_Shown); @@ -5597,7 +5638,6 @@ private void InitializeComponent() private System.Windows.Forms.NumericUpDown nudEmailSmtpPort; private System.Windows.Forms.Label lblEmailSmtpPort; private System.Windows.Forms.TextBox txtEmailDefaultSubject; - private AccountsControl ucLocalhostAccounts; private System.Windows.Forms.Label lblSharedFolderFiles; private System.Windows.Forms.Label lblSharedFolderText; private System.Windows.Forms.Label lblSharedFolderImages; @@ -6052,5 +6092,10 @@ private void InitializeComponent() private System.Windows.Forms.Label lblGoogleCloudStorageDomain; private System.Windows.Forms.TextBox txtGoogleCloudStorageObjectPrefix; private System.Windows.Forms.Label lblGoogleCloudStorageObjectPrefix; + private System.Windows.Forms.Button btnSharedFolderDuplicate; + private System.Windows.Forms.Button btnSharedFolderRemove; + private System.Windows.Forms.Button btnSharedFolderAdd; + private System.Windows.Forms.PropertyGrid pgSharedFolderAccount; + private System.Windows.Forms.ListBox lbSharedFolderAccounts; } } diff --git a/ShareX.UploadersLib/Forms/UploadersConfigForm.cs b/ShareX.UploadersLib/Forms/UploadersConfigForm.cs index 313074516..c8dd5a990 100644 --- a/ShareX.UploadersLib/Forms/UploadersConfigForm.cs +++ b/ShareX.UploadersLib/Forms/UploadersConfigForm.cs @@ -112,13 +112,6 @@ private void InitializeControls() cbFTPSEncryption.Items.AddRange(Enum.GetNames(typeof(FTPSEncryption))); eiFTP.ObjectType = typeof(FTPAccount); - // Localhost - ucLocalhostAccounts.btnAdd.Click += LocalhostAccountAddButton_Click; - ucLocalhostAccounts.btnRemove.Click += LocalhostAccountRemoveButton_Click; - ucLocalhostAccounts.btnDuplicate.Click += LocalhostAccountDuplicateButton_Click; - ucLocalhostAccounts.btnTest.Visible = false; - ucLocalhostAccounts.pgSettings.PropertyValueChanged += SettingsGrid_LocalhostPropertyValueChanged; - // Custom uploader txtCustomUploaderLog.AddContextMenu(); eiCustomUploaders.ObjectType = typeof(CustomUploaderItem); @@ -484,25 +477,16 @@ public void LoadSettings() #endregion SendSpace - #region Localhost + #region Shared folder - if (Config.LocalhostAccountList == null || Config.LocalhostAccountList.Count == 0) + if (Config.LocalhostAccountList == null) { - LocalhostAccountsSetup(new List()); - } - else - { - LocalhostAccountsSetup(Config.LocalhostAccountList); - if (ucLocalhostAccounts.lbAccounts.Items.Count > 0) - { - ucLocalhostAccounts.lbAccounts.SelectedIndex = 0; - cboSharedFolderImages.SelectedIndex = Config.LocalhostSelectedImages.Between(0, ucLocalhostAccounts.lbAccounts.Items.Count - 1); - cboSharedFolderText.SelectedIndex = Config.LocalhostSelectedText.Between(0, ucLocalhostAccounts.lbAccounts.Items.Count - 1); - cboSharedFolderFiles.SelectedIndex = Config.LocalhostSelectedFiles.Between(0, ucLocalhostAccounts.lbAccounts.Items.Count - 1); - } + Config.LocalhostAccountList = new List(); } - #endregion Localhost + SharedFolderUpdateControls(); + + #endregion Shared folder #region Jira @@ -2376,67 +2360,6 @@ private void btnPushbulletGetDeviceList_Click(object sender, EventArgs e) #region Shared folder - private void LocalhostAccountsSetup(IEnumerable accs) - { - if (accs != null) - { - int sel = ucLocalhostAccounts.lbAccounts.SelectedIndex; - - ucLocalhostAccounts.lbAccounts.Items.Clear(); - Config.LocalhostAccountList = new List(); - Config.LocalhostAccountList.AddRange(accs); - - cboSharedFolderFiles.Items.Clear(); - cboSharedFolderImages.Items.Clear(); - cboSharedFolderText.Items.Clear(); - - foreach (LocalhostAccount acc in Config.LocalhostAccountList) - { - ucLocalhostAccounts.lbAccounts.Items.Add(acc); - cboSharedFolderFiles.Items.Add(acc); - cboSharedFolderImages.Items.Add(acc); - cboSharedFolderText.Items.Add(acc); - } - - if (ucLocalhostAccounts.lbAccounts.Items.Count > 0) - { - ucLocalhostAccounts.lbAccounts.SelectedIndex = sel.Between(0, ucLocalhostAccounts.lbAccounts.Items.Count - 1); - cboSharedFolderFiles.SelectedIndex = Config.LocalhostSelectedFiles.Between(0, ucLocalhostAccounts.lbAccounts.Items.Count - 1); - cboSharedFolderImages.SelectedIndex = Config.LocalhostSelectedImages.Between(0, ucLocalhostAccounts.lbAccounts.Items.Count - 1); - cboSharedFolderText.SelectedIndex = Config.LocalhostSelectedText.Between(0, ucLocalhostAccounts.lbAccounts.Items.Count - 1); - } - } - } - - private void LocalhostAccountAddButton_Click(object sender, EventArgs e) - { - LocalhostAccount acc = new LocalhostAccount(); - Config.LocalhostAccountList.Add(acc); - ucLocalhostAccounts.AddItem(acc); - } - - private void LocalhostAccountRemoveButton_Click(object sender, EventArgs e) - { - int sel = ucLocalhostAccounts.lbAccounts.SelectedIndex; - if (ucLocalhostAccounts.RemoveItem(sel)) - { - Config.LocalhostAccountList.RemoveAt(sel); - } - } - - private void LocalhostAccountDuplicateButton_Click(object sender, EventArgs e) - { - LocalhostAccount src = (LocalhostAccount)ucLocalhostAccounts.lbAccounts.Items[ucLocalhostAccounts.lbAccounts.SelectedIndex]; - LocalhostAccount clone = src.Clone(); - Config.LocalhostAccountList.Add(clone); - ucLocalhostAccounts.AddItem(clone); - } - - private void SettingsGrid_LocalhostPropertyValueChanged(object s, PropertyValueChangedEventArgs e) - { - LocalhostAccountsSetup(Config.LocalhostAccountList); - } - private void cboSharedFolderImages_SelectedIndexChanged(object sender, EventArgs e) { Config.LocalhostSelectedImages = cboSharedFolderImages.SelectedIndex; @@ -2452,6 +2375,45 @@ private void cboSharedFolderFiles_SelectedIndexChanged(object sender, EventArgs Config.LocalhostSelectedFiles = cboSharedFolderFiles.SelectedIndex; } + private void btnSharedFolderAdd_Click(object sender, EventArgs e) + { + LocalhostAccount acc = new LocalhostAccount(); + SharedFolderAddItem(acc); + } + + private void btnSharedFolderRemove_Click(object sender, EventArgs e) + { + int index = lbSharedFolderAccounts.SelectedIndex; + SharedFolderRemoveItem(index); + } + + private void btnSharedFolderDuplicate_Click(object sender, EventArgs e) + { + LocalhostAccount account = (LocalhostAccount)lbSharedFolderAccounts.Items[lbSharedFolderAccounts.SelectedIndex]; + LocalhostAccount clone = account.Clone(); + SharedFolderAddItem(clone); + } + + private void lbSharedFolderAccounts_SelectedIndexChanged(object sender, EventArgs e) + { + SharedFolderUpdateEnabledStates(); + + if (lbSharedFolderAccounts.SelectedIndex > -1) + { + pgSharedFolderAccount.SelectedObject = lbSharedFolderAccounts.Items[lbSharedFolderAccounts.SelectedIndex]; + } + } + + private void pgSharedFolderAccount_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) + { + SharedFolderUpdateControls(); + + if (lbSharedFolderAccounts.SelectedIndex > -1) + { + lbSharedFolderAccounts.Items[lbSharedFolderAccounts.SelectedIndex] = pgSharedFolderAccount.SelectedObject; + } + } + #endregion Shared folder #region MediaFire diff --git a/ShareX.UploadersLib/Forms/UploadersConfigForm.resx b/ShareX.UploadersLib/Forms/UploadersConfigForm.resx index 4d6490d34..316e16622 100644 --- a/ShareX.UploadersLib/Forms/UploadersConfigForm.resx +++ b/ShareX.UploadersLib/Forms/UploadersConfigForm.resx @@ -537,7 +537,7 @@ For example, if your bucket is called bucket.example.com then URL will be http:/ True - 336, 48 + 496, 48 7 @@ -987,7 +987,7 @@ For example, if your bucket is called bucket.example.com then URL will be http:/ 3, 3, 3, 3 - 178, 42 + 972, 537 5 @@ -4026,7 +4026,7 @@ store.book[0].title 16, 248 - 272, 20 + 320, 20 2 @@ -4209,7 +4209,7 @@ store.book[0].title 3, 3, 3, 3 - 178, 42 + 972, 537 2 @@ -4530,7 +4530,7 @@ store.book[0].title 3, 3, 3, 3 - 178, 42 + 972, 537 3 @@ -4710,7 +4710,7 @@ store.book[0].title 4, 22 - 178, 42 + 972, 537 5 @@ -4857,7 +4857,7 @@ store.book[0].title 4, 22 - 178, 42 + 972, 537 6 @@ -5106,7 +5106,7 @@ store.book[0].title 3, 3, 3, 3 - 178, 42 + 972, 537 7 @@ -5129,6 +5129,9 @@ store.book[0].title True + + NoControl + 16, 85 @@ -5156,6 +5159,9 @@ store.book[0].title True + + NoControl + 62, 61 @@ -5205,7 +5211,7 @@ store.book[0].title 16, 32 - 106, 20 + 232, 20 1 @@ -5225,6 +5231,9 @@ store.book[0].title True + + NoControl + 13, 16 @@ -5493,13 +5502,13 @@ store.book[0].title 5 - 4, 40 + 4, 202 3, 3, 3, 3 - 972, 519 + 178, 0 0 @@ -6192,13 +6201,13 @@ store.book[0].title 20 - 4, 40 + 4, 202 3, 3, 3, 3 - 972, 519 + 178, 0 13 @@ -6218,15 +6227,6 @@ store.book[0].title 6 - - 16, 367 - - - 320, 20 - - - 6 - txtGoogleCloudStorageObjectPrefix @@ -6239,21 +6239,6 @@ store.book[0].title 0 - - True - - - 13, 351 - - - 32, 13 - - - 5 - - - Path: - lblGoogleCloudStorageObjectPrefix @@ -6266,21 +6251,6 @@ store.book[0].title 1 - - True - - - 13, 303 - - - 82, 13 - - - 4 - - - Custom domain: - lblGoogleCloudStorageDomain @@ -6293,15 +6263,6 @@ store.book[0].title 2 - - 16, 319 - - - 320, 20 - - - 3 - txtGoogleCloudStorageDomain @@ -6314,21 +6275,6 @@ store.book[0].title 3 - - True - - - 13, 255 - - - 73, 13 - - - 2 - - - Bucket name: - lblGoogleCloudStorageBucket @@ -6341,15 +6287,6 @@ store.book[0].title 4 - - 16, 271 - - - 320, 20 - - - 1 - txtGoogleCloudStorageBucket @@ -6362,15 +6299,6 @@ store.book[0].title 5 - - 16, 16 - - - 326, 238 - - - 0 - oauth2GoogleCloudStorage @@ -6384,13 +6312,13 @@ store.book[0].title 6 - 4, 40 + 4, 202 3, 3, 3, 3 - 972, 519 + 178, 0 32 @@ -8348,18 +8276,6 @@ store.book[0].title 0 - - oauth2YouTube - - - ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null - - - tpYouTube - - - 1 - cbYouTubePrivacyType @@ -8370,7 +8286,7 @@ store.book[0].title tpYouTube - 2 + 1 lblYouTubePrivacyType @@ -8382,13 +8298,25 @@ store.book[0].title tpYouTube + 2 + + + oauth2YouTube + + + ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null + + + tpYouTube + + 3 - 4, 202 + 4, 40 - 178, 0 + 972, 519 31 @@ -8408,6 +8336,141 @@ store.book[0].title 25 + + False + + + 16, 80 + + + 168, 480 + + + 11 + + + lbSharedFolderAccounts + + + System.Windows.Forms.ListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpSharedFolder + + + 0 + + + 192, 80 + + + 600, 480 + + + 10 + + + pgSharedFolderAccount + + + System.Windows.Forms.PropertyGrid, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpSharedFolder + + + 1 + + + 192, 48 + + + 80, 24 + + + 9 + + + Duplicate + + + btnSharedFolderDuplicate + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpSharedFolder + + + 2 + + + 104, 48 + + + 80, 24 + + + 8 + + + Remove + + + btnSharedFolderRemove + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpSharedFolder + + + 3 + + + 16, 48 + + + 80, 24 + + + 7 + + + Add + + + btnSharedFolderAdd + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpSharedFolder + + + 4 + + + True + + + NoControl + + + 544, 16 + + + 26, 13 + + + 4 + + + File: + lblSharedFolderFiles @@ -8418,7 +8481,25 @@ store.book[0].title tpSharedFolder - 0 + 5 + + + True + + + NoControl + + + 280, 16 + + + 31, 13 + + + 2 + + + Text: lblSharedFolderText @@ -8430,7 +8511,16 @@ store.book[0].title tpSharedFolder - 1 + 6 + + + 608, 12 + + + 184, 21 + + + 5 cboSharedFolderFiles @@ -8442,7 +8532,25 @@ store.book[0].title tpSharedFolder - 2 + 7 + + + True + + + NoControl + + + 16, 16 + + + 39, 13 + + + 0 + + + Image: lblSharedFolderImages @@ -8454,6 +8562,15 @@ store.book[0].title tpSharedFolder + 8 + + + 344, 12 + + + 184, 21 + + 3 @@ -8466,7 +8583,16 @@ store.book[0].title tpSharedFolder - 4 + 9 + + + 80, 12 + + + 184, 21 + + + 1 cboSharedFolderImages @@ -8478,28 +8604,16 @@ store.book[0].title tpSharedFolder - 5 - - - ucLocalhostAccounts - - - ShareX.UploadersLib.AccountsControl, ShareX.UploadersLib, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null - - - tpSharedFolder - - - 6 + 10 - 4, 202 + 4, 40 3, 3, 3, 3 - 178, 0 + 972, 519 9 @@ -12628,6 +12742,180 @@ store.book[0].title 20 + + 16, 367 + + + 320, 20 + + + 6 + + + txtGoogleCloudStorageObjectPrefix + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpGoogleCloudStorage + + + 0 + + + True + + + NoControl + + + 13, 351 + + + 32, 13 + + + 5 + + + Path: + + + lblGoogleCloudStorageObjectPrefix + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpGoogleCloudStorage + + + 1 + + + True + + + NoControl + + + 13, 303 + + + 82, 13 + + + 4 + + + Custom domain: + + + lblGoogleCloudStorageDomain + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpGoogleCloudStorage + + + 2 + + + 16, 319 + + + 320, 20 + + + 3 + + + txtGoogleCloudStorageDomain + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpGoogleCloudStorage + + + 3 + + + True + + + NoControl + + + 13, 255 + + + 73, 13 + + + 2 + + + Bucket name: + + + lblGoogleCloudStorageBucket + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpGoogleCloudStorage + + + 4 + + + 16, 271 + + + 320, 20 + + + 1 + + + txtGoogleCloudStorageBucket + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpGoogleCloudStorage + + + 5 + + + 16, 16 + + + 326, 238 + + + 0 + + + oauth2GoogleCloudStorage + + + ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null + + + tpGoogleCloudStorage + + + 6 + blob.core.windows.net @@ -17177,6 +17465,9 @@ Using an encrypted library disables sharing. True + + NoControl + 16, 304 @@ -17201,27 +17492,6 @@ Using an encrypted library disables sharing. 0 - - 16, 16 - - - 326, 232 - - - 0 - - - oauth2YouTube - - - ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null - - - tpYouTube - - - 1 - 16, 272 @@ -17241,11 +17511,14 @@ Using an encrypted library disables sharing. tpYouTube - 2 + 1 True + + NoControl + 13, 256 @@ -17268,188 +17541,29 @@ Using an encrypted library disables sharing. tpYouTube - 3 - - - True - - - NoControl - - - 544, 16 - - - 26, 13 - - - 4 - - - File: - - - lblSharedFolderFiles - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tpSharedFolder - - - 0 - - - True - - - NoControl - - - 280, 16 - - - 31, 13 - - 2 - - Text: - - - lblSharedFolderText - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tpSharedFolder - - - 1 - - - 608, 12 - - - 184, 21 - - - 5 - - - cboSharedFolderFiles - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tpSharedFolder - - - 2 - - - True - - - NoControl - - + 16, 16 - - 39, 13 + + 326, 232 - + 0 - - Image: + + oauth2YouTube - - lblSharedFolderImages + + ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + tpYouTube - - tpSharedFolder - - + 3 - - 344, 12 - - - 184, 21 - - - 3 - - - cboSharedFolderText - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tpSharedFolder - - - 4 - - - 80, 12 - - - 184, 21 - - - 1 - - - cboSharedFolderImages - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tpSharedFolder - - - 5 - - - Top, Bottom, Left - - - 8, 40 - - - 4, 4, 4, 4 - - - 792, 5662 - - - 6 - - - ucLocalhostAccounts - - - ShareX.UploadersLib.AccountsControl, ShareX.UploadersLib, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null - - - tpSharedFolder - - - 6 - 16, 408 diff --git a/ShareX.UploadersLib/Forms/UploadersConfigFormHelper.cs b/ShareX.UploadersLib/Forms/UploadersConfigFormHelper.cs index 0300c1b9a..1e6ab2a02 100644 --- a/ShareX.UploadersLib/Forms/UploadersConfigFormHelper.cs +++ b/ShareX.UploadersLib/Forms/UploadersConfigFormHelper.cs @@ -2106,5 +2106,76 @@ public bool OAuth2Refresh(IOAuth2 uploader, OAuthControl oauth2) } #endregion Generic OAuth2 + + #region Shared folder + + private void SharedFolderUpdateControls() + { + int selected = lbSharedFolderAccounts.SelectedIndex; + + lbSharedFolderAccounts.Items.Clear(); + cboSharedFolderImages.Items.Clear(); + cboSharedFolderText.Items.Clear(); + cboSharedFolderFiles.Items.Clear(); + + if (Config.LocalhostAccountList.Count > 0) + { + foreach (LocalhostAccount account in Config.LocalhostAccountList) + { + lbSharedFolderAccounts.Items.Add(account); + cboSharedFolderImages.Items.Add(account); + cboSharedFolderText.Items.Add(account); + cboSharedFolderFiles.Items.Add(account); + } + + lbSharedFolderAccounts.SelectedIndex = selected.Between(0, Config.LocalhostAccountList.Count - 1); + cboSharedFolderImages.SelectedIndex = Config.LocalhostSelectedImages.Between(0, Config.LocalhostAccountList.Count - 1); + cboSharedFolderText.SelectedIndex = Config.LocalhostSelectedText.Between(0, Config.LocalhostAccountList.Count - 1); + cboSharedFolderFiles.SelectedIndex = Config.LocalhostSelectedFiles.Between(0, Config.LocalhostAccountList.Count - 1); + } + + SharedFolderUpdateEnabledStates(); + } + + private void SharedFolderUpdateEnabledStates() + { + cboSharedFolderImages.Enabled = cboSharedFolderText.Enabled = cboSharedFolderFiles.Enabled = Config.LocalhostAccountList.Count > 0; + btnSharedFolderRemove.Enabled = btnSharedFolderDuplicate.Enabled = lbSharedFolderAccounts.SelectedIndex > -1; + } + + private void SharedFolderAddItem(LocalhostAccount account) + { + Config.LocalhostAccountList.Add(account); + lbSharedFolderAccounts.Items.Add(account); + lbSharedFolderAccounts.SelectedIndex = lbSharedFolderAccounts.Items.Count - 1; + SharedFolderUpdateControls(); + } + + private bool SharedFolderRemoveItem(int index) + { + if (index.IsBetween(0, lbSharedFolderAccounts.Items.Count - 1)) + { + Config.LocalhostAccountList.RemoveAt(index); + lbSharedFolderAccounts.Items.RemoveAt(index); + + if (lbSharedFolderAccounts.Items.Count > 0) + { + lbSharedFolderAccounts.SelectedIndex = index == lbSharedFolderAccounts.Items.Count ? lbSharedFolderAccounts.Items.Count - 1 : index; + pgSharedFolderAccount.SelectedObject = lbSharedFolderAccounts.Items[lbSharedFolderAccounts.SelectedIndex]; + } + else + { + pgSharedFolderAccount.SelectedObject = null; + } + + SharedFolderUpdateControls(); + + return true; + } + + return false; + } + + #endregion Shared folder } } \ No newline at end of file diff --git a/ShareX.UploadersLib/ShareX.UploadersLib.csproj b/ShareX.UploadersLib/ShareX.UploadersLib.csproj index bc268279a..fc2da8673 100644 --- a/ShareX.UploadersLib/ShareX.UploadersLib.csproj +++ b/ShareX.UploadersLib/ShareX.UploadersLib.csproj @@ -287,12 +287,6 @@ UserPassBox.cs - - UserControl - - - AccountsControl.cs - @@ -374,51 +368,6 @@ - - AccountsControl.cs - - - AccountsControl.cs - - - AccountsControl.cs - - - AccountsControl.cs - - - AccountsControl.cs - - - AccountsControl.cs - - - AccountsControl.cs - - - AccountsControl.cs - - - AccountsControl.cs - - - AccountsControl.cs - - - AccountsControl.cs - - - AccountsControl.cs - - - AccountsControl.cs - - - AccountsControl.cs - - - AccountsControl.cs - AccountTypeControl.cs @@ -898,9 +847,6 @@ UserPassBox.cs Designer - - AccountsControl.cs - TwitterTweetForm.cs Designer