fixed #781: Drag drop window hotkey will use hotkey task settings

This commit is contained in:
Jaex 2015-07-15 15:02:27 +03:00
parent 64897a45b4
commit f7dc1e544a
5 changed files with 17 additions and 5 deletions

View file

@ -75,6 +75,10 @@
<Reference Include="crypto">
<HintPath>..\packages\Portable.BouncyCastle.1.7.0.2\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10\crypto.dll</HintPath>
</Reference>
<Reference Include="MegaApiClient, Version=1.1.1.44, Culture=neutral, PublicKeyToken=0480d311efbeb4e2, processorArchitecture=MSIL">
<HintPath>..\packages\MegaApiClient.1.1.1\lib\net40\MegaApiClient.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net40\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>

View file

@ -36,13 +36,15 @@ public class DropForm : LayeredForm
{
private static DropForm instance;
public static DropForm GetInstance(int size, int offset, ContentAlignment alignment, int opacity, int hoverOpacity)
public static DropForm GetInstance(int size, int offset, ContentAlignment alignment, int opacity, int hoverOpacity, TaskSettings taskSettings = null)
{
if (instance == null || instance.IsDisposed)
{
instance = new DropForm(size, offset, alignment, opacity, hoverOpacity);
}
instance.taskSettings = taskSettings;
return instance;
}
@ -54,6 +56,7 @@ public static DropForm GetInstance(int size, int offset, ContentAlignment alignm
private Bitmap backgroundImage;
private bool isHovered;
private TaskSettings taskSettings;
private DropForm(int size, int offset, ContentAlignment alignment, int opacity, int hoverOpacity)
{
@ -140,7 +143,7 @@ private void DropForm_DragEnter(object sender, DragEventArgs e)
private void DropForm_DragDrop(object sender, DragEventArgs e)
{
UploadManager.DragDropUpload(e.Data);
UploadManager.DragDropUpload(e.Data, taskSettings);
if (isHovered)
{

View file

@ -1526,7 +1526,7 @@ private void ExecuteJob(TaskSettings taskSettings, HotkeyType job)
UploadManager.UploadURL(safeTaskSettings);
break;
case HotkeyType.DragDropUpload:
TaskHelpers.OpenDropWindow();
TaskHelpers.OpenDropWindow(safeTaskSettings);
break;
case HotkeyType.StopUploads:
TaskManager.StopAllTasks();

View file

@ -66,6 +66,10 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="MegaApiClient, Version=1.1.1.44, Culture=neutral, PublicKeyToken=0480d311efbeb4e2, processorArchitecture=MSIL">
<HintPath>..\packages\MegaApiClient.1.1.1\lib\net40\MegaApiClient.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net40\Newtonsoft.Json.dll</HintPath>

View file

@ -473,9 +473,10 @@ public static string CheckFilePath(string folder, string filename, TaskSettings
return filepath;
}
public static void OpenDropWindow()
public static void OpenDropWindow(TaskSettings taskSettings = null)
{
DropForm.GetInstance(Program.Settings.DropSize, Program.Settings.DropOffset, Program.Settings.DropAlignment, Program.Settings.DropOpacity, Program.Settings.DropHoverOpacity).ShowActivate();
DropForm.GetInstance(Program.Settings.DropSize, Program.Settings.DropOffset, Program.Settings.DropAlignment, Program.Settings.DropOpacity,
Program.Settings.DropHoverOpacity, taskSettings).ShowActivate();
}
public static void StartScreenRecording(ScreenRecordOutput outputType, ScreenRecordStartMethod startMethod, TaskSettings taskSettings = null)