From 418f8991277a404d44ed4815e7cd70901156c5b5 Mon Sep 17 00:00:00 2001 From: Jaex Date: Mon, 20 Jun 2016 09:44:21 +0300 Subject: [PATCH] Added puush mode --- .../Forms/PuushLoginForm.Designer.cs | 48 +-- ShareX.UploadersLib/Forms/PuushLoginForm.cs | 19 +- .../Properties/Resources.Designer.cs | 10 + ShareX.UploadersLib/Properties/Resources.resx | 303 +++++++++--------- ShareX.UploadersLib/Resources/puush-256.png | Bin 0 -> 5845 bytes .../ShareX.UploadersLib.csproj | 3 + ShareX/Forms/MainForm.cs | 32 +- ShareX/Program.cs | 14 +- 8 files changed, 245 insertions(+), 184 deletions(-) create mode 100644 ShareX.UploadersLib/Resources/puush-256.png diff --git a/ShareX.UploadersLib/Forms/PuushLoginForm.Designer.cs b/ShareX.UploadersLib/Forms/PuushLoginForm.Designer.cs index d5e8091ad..e28d59d43 100644 --- a/ShareX.UploadersLib/Forms/PuushLoginForm.Designer.cs +++ b/ShareX.UploadersLib/Forms/PuushLoginForm.Designer.cs @@ -1,4 +1,4 @@ -namespace ShareX.UploadersLib.Forms +namespace ShareX.UploadersLib { partial class PuushLoginForm { @@ -34,14 +34,15 @@ private void InitializeComponent() this.txtPassword = new System.Windows.Forms.TextBox(); this.btnLogin = new System.Windows.Forms.Button(); this.llForgottenPassword = new System.Windows.Forms.LinkLabel(); - this.llCreateAccount = new System.Windows.Forms.LinkLabel(); + this.pbPuush = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.pbPuush)).BeginInit(); this.SuspendLayout(); // // lblPassword // this.lblPassword.AutoSize = true; this.lblPassword.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblPassword.Location = new System.Drawing.Point(13, 96); + this.lblPassword.Location = new System.Drawing.Point(13, 152); this.lblPassword.Name = "lblPassword"; this.lblPassword.Size = new System.Drawing.Size(71, 16); this.lblPassword.TabIndex = 1; @@ -51,7 +52,7 @@ private void InitializeComponent() // this.lblEmail.AutoSize = true; this.lblEmail.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblEmail.Location = new System.Drawing.Point(13, 40); + this.lblEmail.Location = new System.Drawing.Point(13, 96); this.lblEmail.Name = "lblEmail"; this.lblEmail.Size = new System.Drawing.Size(45, 16); this.lblEmail.TabIndex = 3; @@ -59,25 +60,25 @@ private void InitializeComponent() // // txtEmail // - this.txtEmail.Location = new System.Drawing.Point(16, 64); + this.txtEmail.Location = new System.Drawing.Point(16, 120); this.txtEmail.Name = "txtEmail"; - this.txtEmail.Size = new System.Drawing.Size(224, 20); + this.txtEmail.Size = new System.Drawing.Size(232, 20); this.txtEmail.TabIndex = 4; // // txtPassword // - this.txtPassword.Location = new System.Drawing.Point(16, 120); + this.txtPassword.Location = new System.Drawing.Point(16, 176); this.txtPassword.Name = "txtPassword"; - this.txtPassword.Size = new System.Drawing.Size(224, 20); + this.txtPassword.Size = new System.Drawing.Size(232, 20); this.txtPassword.TabIndex = 5; this.txtPassword.UseSystemPasswordChar = true; // // btnLogin // this.btnLogin.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnLogin.Location = new System.Drawing.Point(16, 176); + this.btnLogin.Location = new System.Drawing.Point(16, 232); this.btnLogin.Name = "btnLogin"; - this.btnLogin.Size = new System.Drawing.Size(224, 32); + this.btnLogin.Size = new System.Drawing.Size(232, 32); this.btnLogin.TabIndex = 6; this.btnLogin.Text = "Login"; this.btnLogin.UseVisualStyleBackColor = true; @@ -86,7 +87,7 @@ private void InitializeComponent() // llForgottenPassword // this.llForgottenPassword.AutoSize = true; - this.llForgottenPassword.Location = new System.Drawing.Point(13, 152); + this.llForgottenPassword.Location = new System.Drawing.Point(13, 208); this.llForgottenPassword.Name = "llForgottenPassword"; this.llForgottenPassword.Size = new System.Drawing.Size(106, 13); this.llForgottenPassword.TabIndex = 7; @@ -94,33 +95,34 @@ private void InitializeComponent() this.llForgottenPassword.Text = "Forgotten password?"; this.llForgottenPassword.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llForgottenPassword_LinkClicked); // - // llCreateAccount + // pbPuush // - this.llCreateAccount.AutoSize = true; - this.llCreateAccount.Location = new System.Drawing.Point(13, 16); - this.llCreateAccount.Name = "llCreateAccount"; - this.llCreateAccount.Size = new System.Drawing.Size(104, 13); - this.llCreateAccount.TabIndex = 8; - this.llCreateAccount.TabStop = true; - this.llCreateAccount.Text = "Create an account..."; - this.llCreateAccount.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llCreateAccount_LinkClicked); + this.pbPuush.Image = global::ShareX.UploadersLib.Properties.Resources.puush_256; + this.pbPuush.Location = new System.Drawing.Point(0, 0); + this.pbPuush.Name = "pbPuush"; + this.pbPuush.Size = new System.Drawing.Size(264, 88); + this.pbPuush.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; + this.pbPuush.TabIndex = 8; + this.pbPuush.TabStop = false; // // PuushLoginForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.Window; - this.ClientSize = new System.Drawing.Size(256, 224); - this.Controls.Add(this.llCreateAccount); + this.ClientSize = new System.Drawing.Size(264, 279); + this.Controls.Add(this.pbPuush); this.Controls.Add(this.llForgottenPassword); this.Controls.Add(this.btnLogin); this.Controls.Add(this.txtPassword); this.Controls.Add(this.txtEmail); this.Controls.Add(this.lblEmail); this.Controls.Add(this.lblPassword); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Name = "PuushLoginForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "puush login"; + ((System.ComponentModel.ISupportInitialize)(this.pbPuush)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -134,6 +136,6 @@ private void InitializeComponent() private System.Windows.Forms.TextBox txtPassword; private System.Windows.Forms.Button btnLogin; private System.Windows.Forms.LinkLabel llForgottenPassword; - private System.Windows.Forms.LinkLabel llCreateAccount; + private System.Windows.Forms.PictureBox pbPuush; } } \ No newline at end of file diff --git a/ShareX.UploadersLib/Forms/PuushLoginForm.cs b/ShareX.UploadersLib/Forms/PuushLoginForm.cs index af65a7fb3..277e1db23 100644 --- a/ShareX.UploadersLib/Forms/PuushLoginForm.cs +++ b/ShareX.UploadersLib/Forms/PuushLoginForm.cs @@ -30,7 +30,7 @@ You should have received a copy of the GNU General Public License using System.Drawing; using System.Windows.Forms; -namespace ShareX.UploadersLib.Forms +namespace ShareX.UploadersLib { public partial class PuushLoginForm : Form { @@ -42,7 +42,7 @@ public PuushLoginForm() Icon = Resources.puush; } - private bool CheckValidation() + private bool ValidationCheck() { bool result = true; @@ -51,21 +51,24 @@ private bool CheckValidation() txtEmail.BackColor = Color.FromArgb(255, 200, 200); result = false; } + else + { + txtEmail.BackColor = SystemColors.Window; + } if (string.IsNullOrEmpty(txtPassword.Text)) { txtPassword.BackColor = Color.FromArgb(255, 200, 200); result = false; } + else + { + txtPassword.BackColor = SystemColors.Window; + } return result; } - private void llCreateAccount_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - URLHelpers.OpenURL(Puush.PuushRegisterURL); - } - private void llForgottenPassword_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { URLHelpers.OpenURL(Puush.PuushResetPasswordURL); @@ -73,7 +76,7 @@ private void llForgottenPassword_LinkClicked(object sender, LinkLabelLinkClicked private void btnLogin_Click(object sender, EventArgs e) { - if (CheckValidation()) + if (ValidationCheck()) { APIKey = new Puush().Login(txtEmail.Text, txtPassword.Text); diff --git a/ShareX.UploadersLib/Properties/Resources.Designer.cs b/ShareX.UploadersLib/Properties/Resources.Designer.cs index 1e1314373..1d1a51e14 100644 --- a/ShareX.UploadersLib/Properties/Resources.Designer.cs +++ b/ShareX.UploadersLib/Properties/Resources.Designer.cs @@ -875,6 +875,16 @@ internal static System.Drawing.Icon puush { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap puush_256 { + get { + object obj = ResourceManager.GetObject("puush-256", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/ShareX.UploadersLib/Properties/Resources.resx b/ShareX.UploadersLib/Properties/Resources.resx index 9572c26ea..35287504d 100644 --- a/ShareX.UploadersLib/Properties/Resources.resx +++ b/ShareX.UploadersLib/Properties/Resources.resx @@ -117,40 +117,37 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Name: - ..\Resources\page_white_c.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\page_white_paint.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + New account - - ..\Favicons\Upaste.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\page_white_picture.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\page_white.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Click refresh button - Status: Logged in. + + ..\favicons\streamable.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\page_white_php.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\page_white_gear.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - FTP client only supports FTP or FTPS. + + Selected folder: ..\Favicons\OneTimeSecret.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\globe-network.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Are you sure you want to delete "{0}" from your Dropbox? @@ -160,20 +157,20 @@ ..\Resources\package.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\page_white_csharp.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Directory name to create - Login failed. + + ..\Favicons\GitHub.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Path not exist: + ..\Favicons\Picasa.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Browse for a key file... + + Parent album path e.g. ..\Favicons\Pastebin.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -184,12 +181,14 @@ ..\Favicons\Hostr.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Favicons\Sul.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\page_white_visualstudio.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Connected! -Created folders: + + ..\Resources\page_white_acrobat.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Download path: @@ -200,26 +199,29 @@ Created folders: ..\Resources\server-network.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Error + + + ..\Favicons\AdFly.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Favicons\MediaFire.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\page_white_vector.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\page_white_acrobat.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Favicons\jira.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Name: + + + Connected! + ..\Favicons\Up1.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\page_white_film.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Favicons\Flickr.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Status: Login failed. ..\Favicons\Gett.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -227,20 +229,29 @@ Created folders: ..\Favicons\Google.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\favicons\someimage.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\folder_star.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Favicons\Bitly.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Favicons\Hastebin.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\folder_gray.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Selected folder: + + ..\Favicons\Lambda.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Favicons\Imgur.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Favicons\Flickr.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Favicons\Upaste.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Not configured @@ -248,26 +259,33 @@ Created folders: {0} successfully created. - - ..\Favicons\Pomf.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Favicons\AmazonS3.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Parent album path e.g. + + Login successful but getting account info failed. - - ..\Favicons\GitHub.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Directory name to create - - Connected! + + Connected! +Created folders: + + + ..\Favicons\Twitter.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\folder_photos.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\folder-network.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Browse for a certificate file... - - ..\Resources\page_white_code.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\page_white_paint.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Favicons\Yourls.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -275,20 +293,17 @@ Created folders: ..\Favicons\Mega.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\page_white_sound.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\page_white_code.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Querying folders... - - Login successful but getting account info failed. - Status: Not logged in. - - Login successful. + + ..\Resources\page_white_vector.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Favicons\Photobucket.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -299,12 +314,12 @@ Created folders: SendSpace registration + + ..\Resources\page_white_ruby.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\folder_user.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - New account - Invalid authentication @@ -314,17 +329,20 @@ Created folders: Issue not found - - Tweet error + + Login successful. Authentication required. + + ..\Resources\page_white_gear.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Favicons\Minus.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Path not exist: + + Browse for a key file... ..\Favicons\ImageShack.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -332,14 +350,14 @@ Created folders: ..\Favicons\Box.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\page_white_cplusplus.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\favicons\vgyme.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Unable to find valid FTP account. - - Configured + + Directory name to create Email: @@ -350,8 +368,8 @@ Created folders: ..\Favicons\Dropbox.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Favicons\Bitly.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\page_white_csharp.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\page_white_actionscript.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -365,14 +383,14 @@ Created folders: ..\Favicons\Seafile.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Favicons\Sul.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Favicons\Polr.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Not logged in. + + ..\Resources\page_white_cplusplus.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\globe-network.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Favicons\TinyPic.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Connecting to {0} @@ -380,75 +398,48 @@ Created folders: Refresh authorization is not supported. - - Directory name to create + + ..\Favicons\Pushbullet.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - User ID: + + ..\Favicons\Pomf.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Invalid device name - - - Status: Login failed. - - - Upload path: - - - Box refresh folders list failed - - - Error - - - Delete file? - - - Root folder - - - Logged in as {0}. - - - Response parse failed. - - - ..\Favicons\TinyPic.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\page_white_text.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Favicons\Lambda.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\page_white_sound.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Favicons\Lithiio.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Favicons\Pushbullet.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + FTP client only supports FTP or FTPS. - - ..\Favicons\GoogleDrive.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Not logged in. - - ..\Favicons\Twitter.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\page_white_text.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Favicons\Polr.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\question-button.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\page_white_powerpoint.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\page_white_film.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\page_white_dvd.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Favicons\AdFly.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Configured + + + User ID: ..\Resources\folder_public.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Favicons\puush.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\page_white_flash.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -461,40 +452,52 @@ Created folders: ..\Favicons\Chevereto.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Favicons\AmazonS3.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Tweet error - - ..\Resources\page_white_picture.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Invalid device name + + + Logged in as {0}. + + + Response parse failed. + + + ..\Favicons\GoogleDrive.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Box refresh folders list failed + + + Click refresh button + + + Delete file? ..\Favicons\OneDrive.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\page_white_ruby.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Root folder + + + ..\Resources\page_white_powerpoint.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Upload path: ..\Resources\page_white_cup.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\folder-network.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Favicons\Imgur.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\mail.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\question-button.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\favicons\streamable.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\favicons\vgyme.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\favicons\someimage.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Favicons\puush.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\puush-256.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/ShareX.UploadersLib/Resources/puush-256.png b/ShareX.UploadersLib/Resources/puush-256.png new file mode 100644 index 0000000000000000000000000000000000000000..eca86275b30e47c207937a635ef0db121c46345b GIT binary patch literal 5845 zcmbVQc{r5c+n*V-WyvmCCM7#F_MI_IC`*=-#0)f$4KhMS@$N~TW*i4KK ztpEVvQ5SHT33T*+{$c`q^f`$)vcp?r-S7ky4h?|0Vx7@o6JL}&+6s+w4ZiUntqlOs zd3f5`;qA;WYPw*33YJ4^QKpIJEUma~qeN-Yy!hVtTq@?I6t~0ADm71rGA{!T4(i>4^P-t9jJ_J**%G z{zC-stt0lQQ+8&SU^o_s2CK-c%DF(HP_UYYJXA$pNl`@>tO$XsC_pq6pb$9-R1*r( zRD^*4dc=;b;auG`tqc)=**f~u5%a*~{WKL62n2#WK}jBqb60?BXlN)v6crQ|<&Gre z{DU!gRFE9T|IFVAhG>5moTne&6N>@=MnpMd1MoUxN1px}g0G*M*+0M-|G$VjqD&zO z<);9ZhbZ{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V4AJ6+(OA4J2Im06M(@i$U!xzlW`iozL=;hITwUcb^A8w46y zCQX72gPaXO)m;S#zfz0x)57}+T->Z-KL^?!M>UI1^BC-4t>9Pvtv*!zr?i2HyF7jRNE?#|kbfe8YX*YXKWe(rIeGxD+IS1mx_I6>LmdMfH)%N52J zy+5{_Oo;*z)o7DzRawGml>L-ljACjAJXLjH3_AWXM0S3!9atrB%{o^!3@M z*UNyz#x~Ncr`2F${6C?H^Yk&%b1L-Jz|0N z6g49T06@S^-Kh< zwEaSRBcy>7pkIrMN6FlpKs*FL|KW~aWDFx5?W=BV`&<|FqK_p4Qa>Nwa%$vH)1JR> zbHK7c=6O(yiW6-~X4Wt2FJZuLqgc&n&uxjXlJ~CrJZ#z9@AbDvqTx z6$$ca2Y*&pcT{^2o3*s4DqoWKM2IfZd85G?N7!iby}QY$(IgJY7F#!e+dO>-WrE67z0g5zBBkgD=0>5~D2 z;*p7y-E;!>oPdq`eFNM_$GG4g>McFNSt@W18*jc4D2R`x%I0?@OdsS}@ni~@msT_D ziZ(3QG7(gx+0OtBDoUrNs25>l2RA*7N6SkhJ!}N)wusl;S-X8{b+XgY=4 lN9jW%|FhMr{Cp0e1FV1y?5~(LTK>LhHZd|cd}e@*_#e>OsLucZ literal 0 HcmV?d00001 diff --git a/ShareX.UploadersLib/ShareX.UploadersLib.csproj b/ShareX.UploadersLib/ShareX.UploadersLib.csproj index be2500045..fcd1c03d1 100644 --- a/ShareX.UploadersLib/ShareX.UploadersLib.csproj +++ b/ShareX.UploadersLib/ShareX.UploadersLib.csproj @@ -947,6 +947,9 @@ + + + diff --git a/ShareX/Forms/MainForm.cs b/ShareX/Forms/MainForm.cs index f7b74de63..296167e5d 100644 --- a/ShareX/Forms/MainForm.cs +++ b/ShareX/Forms/MainForm.cs @@ -56,6 +56,8 @@ public MainForm() private void MainForm_HandleCreated(object sender, EventArgs e) { + RunPuushTasks(); + UpdateControls(); DebugHelper.WriteLine("Startup time: {0} ms", Program.StartTimer.ElapsedMilliseconds); @@ -896,6 +898,34 @@ public void UpdateToggleHotkeyButton() } } + private void RunPuushTasks() + { + if (Program.IsPuushMode && Program.Settings.IsFirstTimeRun) + { + using (PuushLoginForm puushLoginForm = new PuushLoginForm()) + { + if (puushLoginForm.ShowDialog() == DialogResult.OK) + { + Program.DefaultTaskSettings.ImageDestination = ImageDestination.FileUploader; + Program.DefaultTaskSettings.ImageFileDestination = FileDestination.Puush; + Program.DefaultTaskSettings.TextDestination = TextDestination.FileUploader; + Program.DefaultTaskSettings.TextFileDestination = FileDestination.Puush; + Program.DefaultTaskSettings.FileDestination = FileDestination.Puush; + + if (Program.UploadersConfig == null) + { + Program.UploaderSettingsResetEvent.WaitOne(5000); + } + + if (Program.UploadersConfig != null) + { + Program.UploadersConfig.PuushAPIKey = puushLoginForm.APIKey; + } + } + } + } + } + #region Form events protected override void SetVisibleCore(bool value) @@ -1737,7 +1767,7 @@ private void InitHotkeys() Program.HotkeyManager.HotkeyTrigger += HandleHotkeys; } - Program.HotkeyManager.UpdateHotkeys(Program.HotkeysConfig.Hotkeys, !Program.NoHotkeys); + Program.HotkeyManager.UpdateHotkeys(Program.HotkeysConfig.Hotkeys, !Program.IsNoHotkeyMode); DebugHelper.WriteLine("HotkeyManager started"); diff --git a/ShareX/Program.cs b/ShareX/Program.cs index 490126371..43d48bf17 100644 --- a/ShareX/Program.cs +++ b/ShareX/Program.cs @@ -83,7 +83,8 @@ public static string TitleLong public static bool IsSilentRun { get; private set; } public static bool IsSandbox { get; private set; } public static bool IsFirstTimeConfig { get; private set; } - public static bool NoHotkeys { get; private set; } + public static bool IsNoHotkeyMode { get; private set; } + public static bool IsPuushMode { get; private set; } public static ApplicationConfig Settings { get; private set; } public static TaskSettings DefaultTaskSettings { get; private set; } @@ -285,6 +286,8 @@ private static void Main(string[] args) IsMultiInstance = CLI.IsCommandExist("multi", "m"); + CheckPuushMode(); + using (ApplicationInstanceManager instanceManager = new ApplicationInstanceManager(!IsMultiInstance, args, SingleInstanceCallback)) { Run(); @@ -307,7 +310,7 @@ private static void Run() IsFirstTimeConfig = CLI.IsCommandExist("SteamConfig"); #endif - NoHotkeys = CLI.IsCommandExist("NoHotkeys"); + IsNoHotkeyMode = CLI.IsCommandExist("NoHotkeys"); DebugHelper.WriteLine(TitleLong); DebugHelper.WriteLine("Operating system: " + Environment.OSVersion.VersionString); @@ -635,5 +638,12 @@ private static bool CheckUninstall() return false; } + + private static bool CheckPuushMode() + { + string puushPath = Helpers.GetAbsolutePath("puush"); + IsPuushMode = File.Exists(puushPath); + return IsPuushMode; + } } } \ No newline at end of file