Added LinkedIn support, Backup method for email sharing if there is no account info, If Share URL job then don't show notifications

This commit is contained in:
Jaex 2014-07-13 09:33:52 +03:00
parent cd5f8d28e7
commit 3d2b4a269f
13 changed files with 706 additions and 692 deletions

File diff suppressed because it is too large Load diff

View file

@ -514,7 +514,7 @@ private void UpdateUploaderMenuNames()
tsmiURLShorteners.Text = tsmiTrayURLShorteners.Text = "URL shortener: " + Program.DefaultTaskSettings.URLShortenerDestination.GetDescription(); tsmiURLShorteners.Text = tsmiTrayURLShorteners.Text = "URL shortener: " + Program.DefaultTaskSettings.URLShortenerDestination.GetDescription();
tsmiURLSharingServices.Text = tsmiTrayURLSharingServices.Text = "Share URL via: " + Program.DefaultTaskSettings.SocialNetworkingServiceDestination.GetDescription(); tsmiURLSharingServices.Text = tsmiTrayURLSharingServices.Text = "URL sharing service: " + Program.DefaultTaskSettings.SocialNetworkingServiceDestination.GetDescription();
} }
private void AutoCheckUpdate() private void AutoCheckUpdate()

View file

@ -391,42 +391,42 @@ private void InitializeComponent()
this.tsmiURLShorteners, this.tsmiURLShorteners,
this.tsmiURLSharingServices}); this.tsmiURLSharingServices});
this.cmsDestinations.Name = "cmsDestinations"; this.cmsDestinations.Name = "cmsDestinations";
this.cmsDestinations.Size = new System.Drawing.Size(163, 114); this.cmsDestinations.Size = new System.Drawing.Size(182, 114);
// //
// tsmiImageUploaders // tsmiImageUploaders
// //
this.tsmiImageUploaders.Image = global::ShareX.Properties.Resources.image; this.tsmiImageUploaders.Image = global::ShareX.Properties.Resources.image;
this.tsmiImageUploaders.Name = "tsmiImageUploaders"; this.tsmiImageUploaders.Name = "tsmiImageUploaders";
this.tsmiImageUploaders.Size = new System.Drawing.Size(162, 22); this.tsmiImageUploaders.Size = new System.Drawing.Size(181, 22);
this.tsmiImageUploaders.Text = "Image uploaders"; this.tsmiImageUploaders.Text = "Image uploaders";
// //
// tsmiTextUploaders // tsmiTextUploaders
// //
this.tsmiTextUploaders.Image = global::ShareX.Properties.Resources.notebook; this.tsmiTextUploaders.Image = global::ShareX.Properties.Resources.notebook;
this.tsmiTextUploaders.Name = "tsmiTextUploaders"; this.tsmiTextUploaders.Name = "tsmiTextUploaders";
this.tsmiTextUploaders.Size = new System.Drawing.Size(162, 22); this.tsmiTextUploaders.Size = new System.Drawing.Size(181, 22);
this.tsmiTextUploaders.Text = "Text uploaders"; this.tsmiTextUploaders.Text = "Text uploaders";
// //
// tsmiFileUploaders // tsmiFileUploaders
// //
this.tsmiFileUploaders.Image = global::ShareX.Properties.Resources.application_block; this.tsmiFileUploaders.Image = global::ShareX.Properties.Resources.application_block;
this.tsmiFileUploaders.Name = "tsmiFileUploaders"; this.tsmiFileUploaders.Name = "tsmiFileUploaders";
this.tsmiFileUploaders.Size = new System.Drawing.Size(162, 22); this.tsmiFileUploaders.Size = new System.Drawing.Size(181, 22);
this.tsmiFileUploaders.Text = "File uploaders"; this.tsmiFileUploaders.Text = "File uploaders";
// //
// tsmiURLShorteners // tsmiURLShorteners
// //
this.tsmiURLShorteners.Image = global::ShareX.Properties.Resources.edit_scale; this.tsmiURLShorteners.Image = global::ShareX.Properties.Resources.edit_scale;
this.tsmiURLShorteners.Name = "tsmiURLShorteners"; this.tsmiURLShorteners.Name = "tsmiURLShorteners";
this.tsmiURLShorteners.Size = new System.Drawing.Size(162, 22); this.tsmiURLShorteners.Size = new System.Drawing.Size(181, 22);
this.tsmiURLShorteners.Text = "URL shorteners"; this.tsmiURLShorteners.Text = "URL shorteners";
// //
// tsmiURLSharingServices // tsmiURLSharingServices
// //
this.tsmiURLSharingServices.Image = global::ShareX.Properties.Resources.share; this.tsmiURLSharingServices.Image = global::ShareX.Properties.Resources.globe_share;
this.tsmiURLSharingServices.Name = "tsmiURLSharingServices"; this.tsmiURLSharingServices.Name = "tsmiURLSharingServices";
this.tsmiURLSharingServices.Size = new System.Drawing.Size(162, 22); this.tsmiURLSharingServices.Size = new System.Drawing.Size(181, 22);
this.tsmiURLSharingServices.Text = "Share URL via"; this.tsmiURLSharingServices.Text = "URL sharing services";
// //
// btnTask // btnTask
// //

View file

@ -430,7 +430,7 @@ private void UpdateUploaderMenuNames()
tsmiURLShorteners.Text = "URL shortener: " + TaskSettings.URLShortenerDestination.GetDescription(); tsmiURLShorteners.Text = "URL shortener: " + TaskSettings.URLShortenerDestination.GetDescription();
tsmiURLSharingServices.Text = "Share URL via: " + TaskSettings.SocialNetworkingServiceDestination.GetDescription(); tsmiURLSharingServices.Text = "URL sharing service: " + TaskSettings.SocialNetworkingServiceDestination.GetDescription();
} }
private void tbDescription_TextChanged(object sender, EventArgs e) private void tbDescription_TextChanged(object sender, EventArgs e)

View file

@ -439,6 +439,16 @@ public static System.Drawing.Bitmap globe_pencil {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap globe_share {
get {
object obj = ResourceManager.GetObject("globe_share", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
@ -709,16 +719,6 @@ public static System.Drawing.Bitmap ruler_triangle {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap share {
get {
object obj = ResourceManager.GetObject("share", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>

View file

@ -172,9 +172,6 @@
<data name="wrench_screwdriver" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="wrench_screwdriver" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\wrench-screwdriver.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\wrench-screwdriver.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="navigation_090_button" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\navigation-090-button.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="layers_ungroup" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="layers_ungroup" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\layers-ungroup.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\layers-ungroup.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
@ -196,9 +193,15 @@
<data name="image_export" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="image_export" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\image-export.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\image-export.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="au" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\au.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="application_network" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="application_network" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\application-network.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\resources\application-network.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="application_task" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\application-task.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Polygon" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="Polygon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Polygon.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\Polygon.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
@ -268,9 +271,6 @@
<data name="upload_cloud" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="upload_cloud" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\upload-cloud.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\upload-cloud.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="heart" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\heart.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Rectangle" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="Rectangle" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Rectangle.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\Rectangle.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
@ -325,8 +325,8 @@
<data name="pencil" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="pencil" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\pencil.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\pencil.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="au" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="navigation_090_button" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\au.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\navigation-090-button.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="layer_pencil" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="layer_pencil" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\layer--pencil.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\layer--pencil.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -340,10 +340,10 @@
<data name="traffic_cone" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="traffic_cone" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\traffic-cone.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\traffic-cone.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="application_task" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="heart" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\application-task.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\heart.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="share" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="globe_share" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\share.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\globe-share.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
</root> </root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 662 B

View file

@ -474,7 +474,7 @@
<None Include="Resources\heart.png" /> <None Include="Resources\heart.png" />
<None Include="Resources\crown.png" /> <None Include="Resources\crown.png" />
<None Include="Resources\layer--pencil.png" /> <None Include="Resources\layer--pencil.png" />
<None Include="Resources\share.png" /> <None Include="Resources\globe-share.png" />
<Content Include="ShareX_Icon.ico" /> <Content Include="ShareX_Icon.ico" />
<None Include="Resources\globe--pencil.png" /> <None Include="Resources\globe--pencil.png" />
<None Include="Resources\camcorder--pencil.png" /> <None Include="Resources\camcorder--pencil.png" />

View file

@ -296,7 +296,7 @@ private static void task_UploadCompleted(UploadTask task)
HistoryManager.AddHistoryItemAsync(Program.HistoryFilePath, info.GetHistoryItem()); HistoryManager.AddHistoryItemAsync(Program.HistoryFilePath, info.GetHistoryItem());
} }
if (!info.TaskSettings.AdvancedSettings.DisableNotifications) if (!info.TaskSettings.AdvancedSettings.DisableNotifications && info.Job != TaskJob.ShareURL)
{ {
if (task.Info.TaskSettings.GeneralSettings.PlaySoundAfterUpload) if (task.Info.TaskSettings.GeneralSettings.PlaySoundAfterUpload)
{ {

View file

@ -1000,6 +1000,8 @@ public void ShareURL(string url)
switch (Info.TaskSettings.SocialNetworkingServiceDestination) switch (Info.TaskSettings.SocialNetworkingServiceDestination)
{ {
case URLSharingServices.Email: case URLSharingServices.Email:
if (Program.UploadersConfig.IsValid(URLSharingServices.Email))
{
using (EmailForm emailForm = new EmailForm(Program.UploadersConfig.EmailRememberLastTo ? Program.UploadersConfig.EmailLastTo : string.Empty, using (EmailForm emailForm = new EmailForm(Program.UploadersConfig.EmailRememberLastTo ? Program.UploadersConfig.EmailLastTo : string.Empty,
Program.UploadersConfig.EmailDefaultSubject, url)) Program.UploadersConfig.EmailDefaultSubject, url))
{ {
@ -1021,13 +1023,18 @@ public void ShareURL(string url)
email.Send(emailForm.ToEmail, emailForm.Subject, emailForm.Body); email.Send(emailForm.ToEmail, emailForm.Subject, emailForm.Body);
} }
} }
}
else
{
URLHelpers.OpenURL("mailto:?body=" + encodedUrl);
}
break; break;
case URLSharingServices.Twitter: case URLSharingServices.Twitter:
OAuthInfo twitterOAuth = Program.UploadersConfig.TwitterOAuthInfoList.ReturnIfValidIndex(Program.UploadersConfig.TwitterSelectedAccount); if (Program.UploadersConfig.IsValid(URLSharingServices.Twitter))
if (twitterOAuth != null && OAuthInfo.CheckOAuth(twitterOAuth))
{ {
using (TwitterTweetForm twitter = new TwitterTweetForm(twitterOAuth, " " + url)) OAuthInfo twitterOAuth = Program.UploadersConfig.TwitterOAuthInfoList[Program.UploadersConfig.TwitterSelectedAccount];
using (TwitterTweetForm twitter = new TwitterTweetForm(twitterOAuth, url))
{ {
twitter.ShowDialog(); twitter.ShowDialog();
} }
@ -1052,11 +1059,14 @@ public void ShareURL(string url)
case URLSharingServices.Tumblr: case URLSharingServices.Tumblr:
URLHelpers.OpenURL("https://www.tumblr.com/share?v=3&u=" + encodedUrl); URLHelpers.OpenURL("https://www.tumblr.com/share?v=3&u=" + encodedUrl);
break; break;
case URLSharingServices.LinkedIn:
URLHelpers.OpenURL("https://www.linkedin.com/shareArticle?url=" + encodedUrl);
break;
case URLSharingServices.VK: case URLSharingServices.VK:
URLHelpers.OpenURL("http://vk.com/share.php?url=" + encodedUrl); URLHelpers.OpenURL("http://vk.com/share.php?url=" + encodedUrl);
break; break;
case URLSharingServices.Delicious: case URLSharingServices.Delicious:
URLHelpers.OpenURL("https://delicious.com/save?v=5&noui&jump=close&url=" + encodedUrl); URLHelpers.OpenURL("https://delicious.com/save?v=5&url=" + encodedUrl);
break; break;
} }
} }

View file

@ -156,6 +156,8 @@ public enum URLSharingServices
Pinterest, Pinterest,
[Description("Tumblr")] [Description("Tumblr")]
Tumblr, Tumblr,
[Description("LinkedIn")]
LinkedIn,
[Description("VK")] [Description("VK")]
VK, VK,
[Description("Delicious")] [Description("Delicious")]

View file

@ -281,10 +281,12 @@ public bool IsValid<T>(int index)
return IsValid((UrlShortenerType)destination); return IsValid((UrlShortenerType)destination);
} }
/*
if (destination is URLSharingServices) if (destination is URLSharingServices)
{ {
return IsValid((URLSharingServices)destination); return IsValid((URLSharingServices)destination);
} }
*/
return true; return true;
} }