Added icons to task right click menu

This commit is contained in:
Jaex 2014-07-17 09:58:17 +03:00
parent 7199300b7d
commit f5d4cda4d9
16 changed files with 235 additions and 140 deletions

View file

@ -104,7 +104,7 @@ private void InitializeComponent()
this.chRemaining = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chURL = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.pbPreview = new HelpersLib.MyPictureBox();
this.cmsUploadInfo = new System.Windows.Forms.ContextMenuStrip(this.components);
this.cmsTaskInfo = new System.Windows.Forms.ContextMenuStrip(this.components);
this.tsmiShowErrors = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiStopUpload = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiOpen = new System.Windows.Forms.ToolStripMenuItem();
@ -220,7 +220,7 @@ private void InitializeComponent()
this.scMain.Panel1.SuspendLayout();
this.scMain.Panel2.SuspendLayout();
this.scMain.SuspendLayout();
this.cmsUploadInfo.SuspendLayout();
this.cmsTaskInfo.SuspendLayout();
this.cmsTray.SuspendLayout();
this.SuspendLayout();
//
@ -529,7 +529,7 @@ private void InitializeComponent()
//
// tsmiImageEditor
//
this.tsmiImageEditor.Image = global::ShareX.Properties.Resources.Greenshot;
this.tsmiImageEditor.Image = global::ShareX.Properties.Resources.image_pencil;
this.tsmiImageEditor.Name = "tsmiImageEditor";
this.tsmiImageEditor.Size = new System.Drawing.Size(183, 22);
this.tsmiImageEditor.Text = "Image editor...";
@ -940,9 +940,9 @@ private void InitializeComponent()
this.pbPreview.Size = new System.Drawing.Size(323, 407);
this.pbPreview.TabIndex = 0;
//
// cmsUploadInfo
// cmsTaskInfo
//
this.cmsUploadInfo.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.cmsTaskInfo.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsmiShowErrors,
this.tsmiStopUpload,
this.tsmiOpen,
@ -957,21 +957,22 @@ private void InitializeComponent()
this.tssUploadInfo1,
this.tsmiHideMenu,
this.tsmiImagePreview});
this.cmsUploadInfo.Name = "cmsHistory";
this.cmsUploadInfo.ShowImageMargin = false;
this.cmsUploadInfo.Size = new System.Drawing.Size(129, 274);
this.cmsTaskInfo.Name = "cmsHistory";
this.cmsTaskInfo.Size = new System.Drawing.Size(154, 318);
//
// tsmiShowErrors
//
this.tsmiShowErrors.Image = global::ShareX.Properties.Resources.exclamation_button;
this.tsmiShowErrors.Name = "tsmiShowErrors";
this.tsmiShowErrors.Size = new System.Drawing.Size(128, 22);
this.tsmiShowErrors.Size = new System.Drawing.Size(153, 22);
this.tsmiShowErrors.Text = "Show errors";
this.tsmiShowErrors.Click += new System.EventHandler(this.tsmiShowErrors_Click);
//
// tsmiStopUpload
//
this.tsmiStopUpload.Image = global::ShareX.Properties.Resources.cross_button;
this.tsmiStopUpload.Name = "tsmiStopUpload";
this.tsmiStopUpload.Size = new System.Drawing.Size(128, 22);
this.tsmiStopUpload.Size = new System.Drawing.Size(153, 22);
this.tsmiStopUpload.Text = "Stop upload";
this.tsmiStopUpload.Click += new System.EventHandler(this.tsmiStopUpload_Click);
//
@ -986,8 +987,9 @@ private void InitializeComponent()
this.tsmiOpenFile,
this.tsmiOpenFolder,
this.tsmiOpenThumbnailFile});
this.tsmiOpen.Image = global::ShareX.Properties.Resources.folder_open_document;
this.tsmiOpen.Name = "tsmiOpen";
this.tsmiOpen.Size = new System.Drawing.Size(128, 22);
this.tsmiOpen.Size = new System.Drawing.Size(153, 22);
this.tsmiOpen.Text = "Open";
//
// tsmiOpenURL
@ -1071,8 +1073,9 @@ private void InitializeComponent()
this.tsmiCopyFileNameWithExtension,
this.tsmiCopyFolder,
this.tssCopy5});
this.tsmiCopy.Image = global::ShareX.Properties.Resources.document_copy;
this.tsmiCopy.Name = "tsmiCopy";
this.tsmiCopy.Size = new System.Drawing.Size(128, 22);
this.tsmiCopy.Size = new System.Drawing.Size(153, 22);
this.tsmiCopy.Text = "Copy";
//
// tsmiCopyURL
@ -1236,60 +1239,68 @@ private void InitializeComponent()
//
// tsmiUploadSelectedFile
//
this.tsmiUploadSelectedFile.Image = global::ShareX.Properties.Resources.arrow_090;
this.tsmiUploadSelectedFile.Name = "tsmiUploadSelectedFile";
this.tsmiUploadSelectedFile.Size = new System.Drawing.Size(128, 22);
this.tsmiUploadSelectedFile.Size = new System.Drawing.Size(153, 22);
this.tsmiUploadSelectedFile.Text = "Upload";
this.tsmiUploadSelectedFile.Click += new System.EventHandler(this.tsmiUploadSelectedFile_Click);
//
// tsmiEditSelectedFile
//
this.tsmiEditSelectedFile.Image = global::ShareX.Properties.Resources.image_pencil;
this.tsmiEditSelectedFile.Name = "tsmiEditSelectedFile";
this.tsmiEditSelectedFile.Size = new System.Drawing.Size(128, 22);
this.tsmiEditSelectedFile.Text = "Edit Image";
this.tsmiEditSelectedFile.Size = new System.Drawing.Size(153, 22);
this.tsmiEditSelectedFile.Text = "Edit image";
this.tsmiEditSelectedFile.Click += new System.EventHandler(this.tsmiEditSelectedFile_Click);
//
// tsmiShortenSelectedURL
//
this.tsmiShortenSelectedURL.Image = global::ShareX.Properties.Resources.edit_scale;
this.tsmiShortenSelectedURL.Name = "tsmiShortenSelectedURL";
this.tsmiShortenSelectedURL.Size = new System.Drawing.Size(128, 22);
this.tsmiShortenSelectedURL.Size = new System.Drawing.Size(153, 22);
this.tsmiShortenSelectedURL.Text = "Shorten URL";
//
// tsmiShareSelectedURL
//
this.tsmiShareSelectedURL.Image = global::ShareX.Properties.Resources.globe_share;
this.tsmiShareSelectedURL.Name = "tsmiShareSelectedURL";
this.tsmiShareSelectedURL.Size = new System.Drawing.Size(128, 22);
this.tsmiShareSelectedURL.Size = new System.Drawing.Size(153, 22);
this.tsmiShareSelectedURL.Text = "Share URL";
//
// tsmiShowQRCode
//
this.tsmiShowQRCode.Image = global::ShareX.Properties.Resources.barcode_2d;
this.tsmiShowQRCode.Name = "tsmiShowQRCode";
this.tsmiShowQRCode.Size = new System.Drawing.Size(128, 22);
this.tsmiShowQRCode.Size = new System.Drawing.Size(153, 22);
this.tsmiShowQRCode.Text = "Show QR code";
this.tsmiShowQRCode.Click += new System.EventHandler(this.tsmiShowQRCode_Click);
//
// tsmiShowResponse
//
this.tsmiShowResponse.Image = global::ShareX.Properties.Resources.application_browser;
this.tsmiShowResponse.Name = "tsmiShowResponse";
this.tsmiShowResponse.Size = new System.Drawing.Size(128, 22);
this.tsmiShowResponse.Size = new System.Drawing.Size(153, 22);
this.tsmiShowResponse.Text = "Show response";
this.tsmiShowResponse.Click += new System.EventHandler(this.tsmiShowResponse_Click);
//
// tsmiClearList
//
this.tsmiClearList.Image = global::ShareX.Properties.Resources.eraser;
this.tsmiClearList.Name = "tsmiClearList";
this.tsmiClearList.Size = new System.Drawing.Size(128, 22);
this.tsmiClearList.Size = new System.Drawing.Size(153, 22);
this.tsmiClearList.Text = "Clear list";
this.tsmiClearList.Click += new System.EventHandler(this.tsmiClearList_Click);
//
// tssUploadInfo1
//
this.tssUploadInfo1.Name = "tssUploadInfo1";
this.tssUploadInfo1.Size = new System.Drawing.Size(125, 6);
this.tssUploadInfo1.Size = new System.Drawing.Size(150, 6);
//
// tsmiHideMenu
//
this.tsmiHideMenu.Image = global::ShareX.Properties.Resources.layout_select_sidebar;
this.tsmiHideMenu.Name = "tsmiHideMenu";
this.tsmiHideMenu.Size = new System.Drawing.Size(128, 22);
this.tsmiHideMenu.Size = new System.Drawing.Size(153, 22);
this.tsmiHideMenu.Text = "Hide menu";
this.tsmiHideMenu.Click += new System.EventHandler(this.tsmiHideMenu_Click);
//
@ -1299,8 +1310,9 @@ private void InitializeComponent()
this.tsmiImagePreviewShow,
this.tsmiImagePreviewHide,
this.tsmiImagePreviewAutomatic});
this.tsmiImagePreview.Image = global::ShareX.Properties.Resources.layout_select_content;
this.tsmiImagePreview.Name = "tsmiImagePreview";
this.tsmiImagePreview.Size = new System.Drawing.Size(128, 22);
this.tsmiImagePreview.Size = new System.Drawing.Size(153, 22);
this.tsmiImagePreview.Text = "Image preview";
//
// tsmiImagePreviewShow
@ -1623,7 +1635,7 @@ private void InitializeComponent()
//
// tsmiTrayImageEditor
//
this.tsmiTrayImageEditor.Image = global::ShareX.Properties.Resources.Greenshot;
this.tsmiTrayImageEditor.Image = global::ShareX.Properties.Resources.image_pencil;
this.tsmiTrayImageEditor.Name = "tsmiTrayImageEditor";
this.tsmiTrayImageEditor.Size = new System.Drawing.Size(183, 22);
this.tsmiTrayImageEditor.Text = "Image editor...";
@ -1873,7 +1885,7 @@ private void InitializeComponent()
this.scMain.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.scMain)).EndInit();
this.scMain.ResumeLayout(false);
this.cmsUploadInfo.ResumeLayout(false);
this.cmsTaskInfo.ResumeLayout(false);
this.cmsTray.ResumeLayout(false);
this.ResumeLayout(false);
@ -1934,7 +1946,7 @@ private void InitializeComponent()
private System.Windows.Forms.ToolStripMenuItem tsmiTrayTextUploaders;
private System.Windows.Forms.ToolStripMenuItem tsmiTrayFileUploaders;
private System.Windows.Forms.ToolStripMenuItem tsmiTrayURLShorteners;
private System.Windows.Forms.ContextMenuStrip cmsUploadInfo;
private System.Windows.Forms.ContextMenuStrip cmsTaskInfo;
private System.Windows.Forms.ToolStripMenuItem tsmiOpen;
private System.Windows.Forms.ToolStripMenuItem tsmiOpenURL;
private System.Windows.Forms.ToolStripMenuItem tsmiOpenShortenedURL;

View file

@ -83,6 +83,7 @@ private void InitControls()
((ToolStripDropDownMenu)tsddbWorkflows.DropDown).ShowImageMargin = ((ToolStripDropDownMenu)tsmiTrayWorkflows.DropDown).ShowImageMargin =
((ToolStripDropDownMenu)tsmiMonitor.DropDown).ShowImageMargin = ((ToolStripDropDownMenu)tsmiTrayMonitor.DropDown).ShowImageMargin =
((ToolStripDropDownMenu)tsmiOpen.DropDown).ShowImageMargin = ((ToolStripDropDownMenu)tsmiCopy.DropDown).ShowImageMargin =
((ToolStripDropDownMenu)tsmiShortenSelectedURL.DropDown).ShowImageMargin = ((ToolStripDropDownMenu)tsmiShareSelectedURL.DropDown).ShowImageMargin = false;
AddMultiEnumItems<AfterCaptureTasks>(x => Program.DefaultTaskSettings.AfterCaptureJob = Program.DefaultTaskSettings.AfterCaptureJob.Swap(x),
@ -293,10 +294,10 @@ private void EnableDisableToolStripMenuItems<T>(params ToolStripDropDownItem[] p
private void UpdateControls()
{
cmsUploadInfo.SuspendLayout();
cmsTaskInfo.SuspendLayout();
tsmiStopUpload.Visible = tsmiOpen.Visible = tsmiCopy.Visible = tsmiShowErrors.Visible = tsmiShowResponse.Visible = tsmiShowQRCode.Visible = tsmiEditSelectedFile.Visible =
tsmiUploadSelectedFile.Visible = tsmiShortenSelectedURL.Visible = tsmiShareSelectedURL.Visible = tsmiClearList.Visible = tssUploadInfo1.Visible = false;
tsmiStopUpload.Visible = tsmiOpen.Visible = tsmiCopy.Visible = tsmiShowErrors.Visible = tsmiShowResponse.Visible = tsmiShowQRCode.Visible = tsmiUploadSelectedFile.Visible =
tsmiEditSelectedFile.Visible = tsmiShortenSelectedURL.Visible = tsmiShareSelectedURL.Visible = tsmiClearList.Visible = tssUploadInfo1.Visible = false;
pbPreview.Reset();
uim.RefreshSelectedItems();
@ -362,9 +363,6 @@ private void UpdateControls()
tsmiCopyFileNameWithExtension.Enabled = uim.SelectedItems.Any(x => x.IsFilePathValid);
tsmiCopyFolder.Enabled = uim.SelectedItems.Any(x => x.IsFilePathValid);
// Edit
tsmiEditSelectedFile.Visible = uim.SelectedItem.IsImageFile;
CleanCustomClipboardFormats();
if (Program.Settings.ClipboardContentFormats != null && Program.Settings.ClipboardContentFormats.Count > 0)
@ -381,6 +379,7 @@ private void UpdateControls()
}
tsmiUploadSelectedFile.Visible = uim.SelectedItem.IsFileExist;
tsmiEditSelectedFile.Visible = uim.SelectedItem.IsImageFile;
tsmiShortenSelectedURL.Visible = uim.SelectedItem.IsURLExist;
tsmiShareSelectedURL.Visible = uim.SelectedItem.IsURLExist;
tsmiShowQRCode.Visible = uim.SelectedItem.IsURLExist;
@ -402,7 +401,7 @@ private void UpdateControls()
tsmiClearList.Visible = tssUploadInfo1.Visible = lvUploads.Items.Count > 0;
cmsUploadInfo.ResumeLayout();
cmsTaskInfo.ResumeLayout();
Refresh();
}
@ -922,7 +921,7 @@ private void lblDragAndDropTip_MouseUp(object sender, MouseEventArgs e)
if (e.Button == MouseButtons.Right)
{
UpdateControls();
cmsUploadInfo.Show(lblDragAndDropTip, e.X + 1, e.Y + 1);
cmsTaskInfo.Show(lblDragAndDropTip, e.X + 1, e.Y + 1);
}
}
@ -936,7 +935,7 @@ private void lvUploads_MouseUp(object sender, MouseEventArgs e)
if (e.Button == MouseButtons.Right)
{
UpdateControls();
cmsUploadInfo.Show(lvUploads, e.X + 1, e.Y + 1);
cmsTaskInfo.Show(lvUploads, e.X + 1, e.Y + 1);
}
}
@ -1027,6 +1026,11 @@ private void tsmiTrayExit_Click(object sender, EventArgs e)
#region UploadInfoMenu events
private void tsmiShowErrors_Click(object sender, EventArgs e)
{
uim.ShowErrors();
}
private void tsmiStopUpload_Click(object sender, EventArgs e)
{
if (lvUploads.SelectedItems.Count > 0)
@ -1168,21 +1172,6 @@ private void tsmiCopyFolder_Click(object sender, EventArgs e)
uim.CopyFolder();
}
private void tsmiShowErrors_Click(object sender, EventArgs e)
{
uim.ShowErrors();
}
private void tsmiShowResponse_Click(object sender, EventArgs e)
{
uim.ShowResponse();
}
private void tsmiShowQRCode_Click(object sender, EventArgs e)
{
uim.ShowQRCode();
}
private void tsmiUploadSelectedFile_Click(object sender, EventArgs e)
{
uim.Upload();
@ -1193,6 +1182,16 @@ private void tsmiEditSelectedFile_Click(object sender, EventArgs e)
uim.EditImage();
}
private void tsmiShowQRCode_Click(object sender, EventArgs e)
{
uim.ShowQRCode();
}
private void tsmiShowResponse_Click(object sender, EventArgs e)
{
uim.ShowResponse();
}
private void tsmiClearList_Click(object sender, EventArgs e)
{
RemoveAllItems();
@ -1471,23 +1470,7 @@ private void AfterCapture(Image img, CaptureType captureType, TaskSettings taskS
if (taskSettings.GeneralSettings.ShowAfterCaptureTasksForm)
{
using (AfterCaptureForm afterCaptureForm = new AfterCaptureForm(img, taskSettings))
{
afterCaptureForm.ShowDialog();
switch (afterCaptureForm.Result)
{
case AfterCaptureFormResult.Continue:
taskSettings.AfterCaptureJob = afterCaptureForm.AfterCaptureTasks;
break;
case AfterCaptureFormResult.Copy:
taskSettings.AfterCaptureJob = AfterCaptureTasks.CopyImageToClipboard;
break;
case AfterCaptureFormResult.Cancel:
if (img != null) img.Dispose();
return;
}
}
TaskHelpers.ShowAfterCaptureForm(img, taskSettings);
}
UploadManager.RunImageTask(img, taskSettings);

View file

@ -120,7 +120,7 @@
<metadata name="tsMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="cmsUploadInfo.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<metadata name="cmsTaskInfo.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>286, 17</value>
</metadata>
<metadata name="niTray.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">

View file

@ -102,34 +102,34 @@ private void ActiveWindowRegion(TaskSettings taskSettings)
}
}
public void StartRecording(TaskSettings TaskSettings)
public void StartRecording(TaskSettings taskSettings)
{
if (TaskSettings.CaptureSettings.RunScreencastCLI)
if (taskSettings.CaptureSettings.RunScreencastCLI)
{
if (!Program.Settings.VideoEncoders.IsValidIndex(TaskSettings.CaptureSettings.VideoEncoderSelected))
if (!Program.Settings.VideoEncoders.IsValidIndex(taskSettings.CaptureSettings.VideoEncoderSelected))
{
MessageBox.Show("There is no valid CLI video encoder selected.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
else if (!Program.Settings.VideoEncoders[TaskSettings.CaptureSettings.VideoEncoderSelected].IsValid())
else if (!Program.Settings.VideoEncoders[taskSettings.CaptureSettings.VideoEncoderSelected].IsValid())
{
MessageBox.Show("CLI video encoder file does not exist: " + Program.Settings.VideoEncoders[TaskSettings.CaptureSettings.VideoEncoderSelected].Path,
MessageBox.Show("CLI video encoder file does not exist: " + Program.Settings.VideoEncoders[taskSettings.CaptureSettings.VideoEncoderSelected].Path,
Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
}
if (TaskSettings.CaptureSettings.ScreenRecordOutput == ScreenRecordOutput.FFmpeg && !File.Exists(TaskSettings.CaptureSettings.FFmpegOptions.CLIPath))
if (taskSettings.CaptureSettings.ScreenRecordOutput == ScreenRecordOutput.FFmpeg && !File.Exists(taskSettings.CaptureSettings.FFmpegOptions.CLIPath))
{
string ffmpegText = string.IsNullOrEmpty(TaskSettings.CaptureSettings.FFmpegOptions.CLIPath) ? "ffmpeg.exe" : TaskSettings.CaptureSettings.FFmpegOptions.CLIPath;
string ffmpegText = string.IsNullOrEmpty(taskSettings.CaptureSettings.FFmpegOptions.CLIPath) ? "ffmpeg.exe" : taskSettings.CaptureSettings.FFmpegOptions.CLIPath;
if (MessageBox.Show(ffmpegText + " does not exist." + Environment.NewLine + Environment.NewLine + "Would you like to automatically download it?",
Application.ProductName + " - Missing ffmpeg.exe", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
{
if (FFmpegHelper.DownloadFFmpeg(false, DownloaderForm_InstallRequested) == DialogResult.OK)
{
Program.DefaultTaskSettings.CaptureSettings.FFmpegOptions.CLIPath = TaskSettings.TaskSettingsReference.CaptureSettings.FFmpegOptions.CLIPath =
TaskSettings.CaptureSettings.FFmpegOptions.CLIPath = Path.Combine(Program.ToolsFolder, "ffmpeg.exe");
Program.DefaultTaskSettings.CaptureSettings.FFmpegOptions.CLIPath = taskSettings.TaskSettingsReference.CaptureSettings.FFmpegOptions.CLIPath =
taskSettings.CaptureSettings.FFmpegOptions.CLIPath = Path.Combine(Program.ToolsFolder, "ffmpeg.exe");
}
}
else
@ -138,9 +138,9 @@ public void StartRecording(TaskSettings TaskSettings)
}
}
if (TaskSettings.AdvancedSettings.ScreenRecorderUseActiveWindow)
if (taskSettings.AdvancedSettings.ScreenRecorderUseActiveWindow)
{
ActiveWindowRegion(TaskSettings);
ActiveWindowRegion(taskSettings);
}
else
{
@ -153,7 +153,7 @@ public void StartRecording(TaskSettings TaskSettings)
}
IsRecording = true;
Screenshot.CaptureCursor = TaskSettings.CaptureSettings.ShowCursor;
Screenshot.CaptureCursor = taskSettings.CaptureSettings.ShowCursor;
TrayIcon.Text = "ShareX - Waiting...";
TrayIcon.Icon = Resources.control_record_yellow.ToIcon();
@ -161,26 +161,26 @@ public void StartRecording(TaskSettings TaskSettings)
string path = "";
float duration = TaskSettings.CaptureSettings.ScreenRecordFixedDuration ? TaskSettings.CaptureSettings.ScreenRecordDuration : 0;
float duration = taskSettings.CaptureSettings.ScreenRecordFixedDuration ? taskSettings.CaptureSettings.ScreenRecordDuration : 0;
regionForm = ScreenRegionForm.Show(captureRectangle, StopRecording, duration);
TaskEx.Run(() =>
{
try
{
if (TaskSettings.CaptureSettings.ScreenRecordAutoDisableAero)
if (taskSettings.CaptureSettings.ScreenRecordAutoDisableAero)
{
dwmManager = new DWMManager();
dwmManager.AutoDisable();
}
if (TaskSettings.CaptureSettings.ScreenRecordOutput == ScreenRecordOutput.AVI)
if (taskSettings.CaptureSettings.ScreenRecordOutput == ScreenRecordOutput.AVI)
{
path = Path.Combine(TaskSettings.CaptureFolder, TaskHelpers.GetFilename(TaskSettings, "avi"));
path = Path.Combine(taskSettings.CaptureFolder, TaskHelpers.GetFilename(taskSettings, "avi"));
}
else if (TaskSettings.CaptureSettings.ScreenRecordOutput == ScreenRecordOutput.FFmpeg)
else if (taskSettings.CaptureSettings.ScreenRecordOutput == ScreenRecordOutput.FFmpeg)
{
path = Path.Combine(TaskSettings.CaptureFolder, TaskHelpers.GetFilename(TaskSettings, TaskSettings.CaptureSettings.FFmpegOptions.Extension));
path = Path.Combine(taskSettings.CaptureFolder, TaskHelpers.GetFilename(taskSettings, taskSettings.CaptureSettings.FFmpegOptions.Extension));
}
else
{
@ -189,19 +189,19 @@ public void StartRecording(TaskSettings TaskSettings)
ScreencastOptions options = new ScreencastOptions()
{
FFmpeg = TaskSettings.CaptureSettings.FFmpegOptions,
AVI = TaskSettings.CaptureSettings.AVIOptions,
ScreenRecordFPS = TaskSettings.CaptureSettings.ScreenRecordFPS,
GIFFPS = TaskSettings.CaptureSettings.GIFFPS,
FFmpeg = taskSettings.CaptureSettings.FFmpegOptions,
AVI = taskSettings.CaptureSettings.AVIOptions,
ScreenRecordFPS = taskSettings.CaptureSettings.ScreenRecordFPS,
GIFFPS = taskSettings.CaptureSettings.GIFFPS,
Duration = duration,
OutputPath = path,
CaptureArea = captureRectangle,
DrawCursor = TaskSettings.CaptureSettings.ShowCursor
DrawCursor = taskSettings.CaptureSettings.ShowCursor
};
screenRecorder = new ScreenRecorder(options, captureRectangle, TaskSettings.CaptureSettings.ScreenRecordOutput);
screenRecorder = new ScreenRecorder(options, captureRectangle, taskSettings.CaptureSettings.ScreenRecordOutput);
int delay = (int)(TaskSettings.CaptureSettings.ScreenRecordStartDelay * 1000);
int delay = (int)(taskSettings.CaptureSettings.ScreenRecordStartDelay * 1000);
if (delay > 0)
{
@ -241,24 +241,24 @@ public void StartRecording(TaskSettings TaskSettings)
string sourceFilePath = path;
if (TaskSettings.CaptureSettings.ScreenRecordOutput == ScreenRecordOutput.GIF)
if (taskSettings.CaptureSettings.ScreenRecordOutput == ScreenRecordOutput.GIF)
{
if (TaskSettings.CaptureSettings.RunScreencastCLI)
if (taskSettings.CaptureSettings.RunScreencastCLI)
{
sourceFilePath = Path.ChangeExtension(Program.ScreenRecorderCacheFilePath, "gif");
}
else
{
sourceFilePath = path = Path.Combine(TaskSettings.CaptureFolder, TaskHelpers.GetFilename(TaskSettings, "gif"));
sourceFilePath = path = Path.Combine(taskSettings.CaptureFolder, TaskHelpers.GetFilename(taskSettings, "gif"));
}
screenRecorder.SaveAsGIF(sourceFilePath, TaskSettings.ImageSettings.ImageGIFQuality);
screenRecorder.SaveAsGIF(sourceFilePath, taskSettings.ImageSettings.ImageGIFQuality);
}
if (TaskSettings.CaptureSettings.RunScreencastCLI)
if (taskSettings.CaptureSettings.RunScreencastCLI)
{
VideoEncoder encoder = Program.Settings.VideoEncoders[TaskSettings.CaptureSettings.VideoEncoderSelected];
path = Path.Combine(TaskSettings.CaptureFolder, TaskHelpers.GetFilename(TaskSettings, encoder.OutputExtension));
VideoEncoder encoder = Program.Settings.VideoEncoders[taskSettings.CaptureSettings.VideoEncoderSelected];
path = Path.Combine(taskSettings.CaptureFolder, TaskHelpers.GetFilename(taskSettings, encoder.OutputExtension));
screenRecorder.EncodeUsingCommandLine(encoder, sourceFilePath, path);
}
}
@ -267,7 +267,7 @@ public void StartRecording(TaskSettings TaskSettings)
{
if (screenRecorder != null)
{
if (TaskSettings.CaptureSettings.RunScreencastCLI && !string.IsNullOrEmpty(screenRecorder.CachePath) && File.Exists(screenRecorder.CachePath))
if (taskSettings.CaptureSettings.RunScreencastCLI && !string.IsNullOrEmpty(screenRecorder.CachePath) && File.Exists(screenRecorder.CachePath))
{
File.Delete(screenRecorder.CachePath);
}
@ -288,7 +288,7 @@ public void StartRecording(TaskSettings TaskSettings)
if (!string.IsNullOrEmpty(path) && File.Exists(path))
{
UploadTask task = UploadTask.CreateFileJobTask(path, TaskSettings);
UploadTask task = UploadTask.CreateFileJobTask(path, taskSettings);
TaskManager.Start(task);
}
});

View file

@ -319,6 +319,16 @@ public class Resources {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap document_copy {
get {
object obj = ResourceManager.GetObject("document_copy", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -359,6 +369,26 @@ public class Resources {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap eraser {
get {
object obj = ResourceManager.GetObject("eraser", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap exclamation_button {
get {
object obj = ResourceManager.GetObject("exclamation-button", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -369,6 +399,16 @@ public class Resources {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap folder_open_document {
get {
object obj = ResourceManager.GetObject("folder-open-document", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -459,16 +499,6 @@ public class Resources {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Greenshot {
get {
object obj = ResourceManager.GetObject("Greenshot", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -499,6 +529,16 @@ public class Resources {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap image_pencil {
get {
object obj = ResourceManager.GetObject("image_pencil", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -619,6 +659,26 @@ public class Resources {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap layout_select_content {
get {
object obj = ResourceManager.GetObject("layout-select-content", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap layout_select_sidebar {
get {
object obj = ResourceManager.GetObject("layout-select-sidebar", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View file

@ -121,6 +121,9 @@
<data name="Test" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Test.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="google_plus" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\google_plus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="layer" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\layer.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -151,6 +154,9 @@
<data name="Ellipse" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Ellipse.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="exclamation-button" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\exclamation-button.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="cross_button" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\cross-button.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -172,6 +178,12 @@
<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>
</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="application_blue" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\application-blue.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<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>
</data>
@ -193,15 +205,12 @@
<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>
</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 name="layout-select-sidebar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\layout-select-sidebar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<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>
</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">
<value>..\Resources\Polygon.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -235,12 +244,12 @@
<data name="keyboard" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\keyboard.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Greenshot" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Greenshot.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Triangle" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Triangle.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="document_copy" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\document-copy.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ruler_triangle" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ruler-triangle.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -271,6 +280,9 @@
<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>
</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">
<value>..\Resources\Rectangle.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -280,8 +292,8 @@
<data name="Diamond" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\diamond.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="application_blue" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\application-blue.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="image_pencil" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\image--pencil.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="gear" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\gear.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -316,6 +328,9 @@
<data name="clock" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\clock.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="globe_share" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\globe-share.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="barcode_2d" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\barcode-2d.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -325,8 +340,8 @@
<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>
</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 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="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>
@ -337,16 +352,19 @@
<data name="layer_shape_polygon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\layer-shape-polygon.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="folder-open-document" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\folder-open-document.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="eraser" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\eraser.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<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>
</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 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="globe_share" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\globe-share.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="google_plus" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\google_plus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="layout-select-content" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\layout-select-content.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

BIN
ShareX/Resources/eraser.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

View file

@ -443,7 +443,6 @@
<None Include="Resources\ruler-triangle.png" />
<None Include="Resources\Test.png" />
<None Include="Resources\application-network.png" />
<None Include="Resources\Greenshot.png" />
<None Include="..\LICENSE.txt">
<Link>LICENSE.txt</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@ -476,6 +475,13 @@
<None Include="Resources\layer--pencil.png" />
<None Include="Resources\globe-share.png" />
<None Include="Resources\google_plus.png" />
<None Include="Resources\document-copy.png" />
<None Include="Resources\image--pencil.png" />
<None Include="Resources\exclamation-button.png" />
<None Include="Resources\folder-open-document.png" />
<None Include="Resources\eraser.png" />
<None Include="Resources\layout-select-sidebar.png" />
<None Include="Resources\layout-select-content.png" />
<Content Include="ShareX_Icon.ico" />
<None Include="Resources\globe--pencil.png" />
<None Include="Resources\camcorder--pencil.png" />

View file

@ -503,18 +503,13 @@ public static void OpenIndexFolder()
UploadManager.IndexFolder();
}
public static void OpenImageEditor()
public static void OpenImageEditor(string filePath = null)
{
string filePath = ImageHelpers.OpenImageFileDialog();
if (!string.IsNullOrEmpty(filePath))
if (string.IsNullOrEmpty(filePath))
{
TaskHelpers.AnnotateImage(filePath);
filePath = ImageHelpers.OpenImageFileDialog();
}
}
public static void OpenImageEditor(string filePath)
{
if (!string.IsNullOrEmpty(filePath))
{
TaskHelpers.AnnotateImage(filePath);
@ -591,5 +586,26 @@ public static void OpenFTPClient()
new FTPClientForm(account).Show();
}
}
public static void ShowAfterCaptureForm(Image img, TaskSettings taskSettings)
{
using (AfterCaptureForm afterCaptureForm = new AfterCaptureForm(img, taskSettings))
{
afterCaptureForm.ShowDialog();
switch (afterCaptureForm.Result)
{
case AfterCaptureFormResult.Continue:
taskSettings.AfterCaptureJob = afterCaptureForm.AfterCaptureTasks;
break;
case AfterCaptureFormResult.Copy:
taskSettings.AfterCaptureJob = AfterCaptureTasks.CopyImageToClipboard;
break;
case AfterCaptureFormResult.Cancel:
if (img != null) img.Dispose();
return;
}
}
}
}
}