If recording not started already then record hotkey or tray icon can be used to start it (Useful if region form start button not visible while doing fullscreen recording)

This commit is contained in:
Jaex 2014-11-13 21:59:34 +02:00
parent 9f1a798f53
commit 8333bacd21
7 changed files with 44 additions and 18 deletions

View file

@ -31,8 +31,8 @@ public static class Links
public const string URL_PROJECT = "https://github.com/ShareX/ShareX";
public const string URL_ISSUES = URL_PROJECT + "/issues";
public const string URL_CALLBACK = URL_WEBSITE + "/callback/";
public const string URL_VERSION_HISTORY = "https://raw.githubusercontent.com/ShareX/ShareX/master/VersionHistory.txt";
public const string URL_DONATE = "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CXW5QE77SKKEJ";
public const string URL_VERSION_HISTORY = URL_PROJECT + "/wiki/Changelog";
public const string URL_DONATE = "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PCNWK2G6ZYJ2E";
public const string URL_BERK = "https://github.com/Jaex";
public const string URL_BERK_STEAM = "http://steamcommunity.com/id/ww";
public const string URL_MIKE = "https://github.com/McoreD";

View file

@ -64,11 +64,27 @@ private ScreenRecordForm()
TrayIcon.MouseClick += TrayIcon_MouseClick;
}
public void StartStopRecording()
{
if (regionForm != null && !regionForm.IsDisposed)
{
regionForm.StartStop();
}
}
private void StopRecording()
{
if (IsRecording && screenRecorder != null)
{
screenRecorder.StopRecording();
}
}
private void TrayIcon_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
StopRecording();
StartStopRecording();
}
}
@ -183,7 +199,9 @@ public void StartRecording(TaskSettings taskSettings)
if (regionForm != null && regionForm.RecordResetEvent != null)
{
if (taskSettings.CaptureSettings.ScreenRecordAutoStart || captureRectangle.Height == CaptureHelpers.GetScreenBounds().Height)
TrayIcon.Text = "ShareX - " + Resources.ScreenRecordForm_StartRecording_Click_tray_icon_to_start_recording_;
if (taskSettings.CaptureSettings.ScreenRecordAutoStart)
{
int delay = (int)(taskSettings.CaptureSettings.ScreenRecordStartDelay * 1000);
@ -237,6 +255,7 @@ public void StartRecording(TaskSettings taskSettings)
}
this.InvokeSafe(() => regionForm.Close());
regionForm = null;
}
}
@ -322,13 +341,5 @@ private void DownloaderForm_InstallRequested(string filePath)
MessageBox.Show(Resources.ScreenRecordForm_DownloaderForm_InstallRequested_Download_of_FFmpeg_failed_, "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
public void StopRecording()
{
if (IsRecording && screenRecorder != null)
{
screenRecorder.StopRecording();
}
}
}
}

View file

@ -144,7 +144,7 @@ private void timerRefresh_Tick(object sender, EventArgs e)
UpdateTimer();
}
private void Stop()
public void StartStop()
{
if (IsRecording)
{
@ -160,7 +160,7 @@ private void btnStop_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
Stop();
StartStop();
}
}
@ -169,7 +169,7 @@ private void btnAbort_MouseClick(object sender, MouseEventArgs e)
if (e.Button == MouseButtons.Left)
{
AbortRequested = true;
Stop();
StartStop();
}
}
}

View file

@ -1199,6 +1199,15 @@ public class Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Click tray icon to start recording..
/// </summary>
public static string ScreenRecordForm_StartRecording_Click_tray_icon_to_start_recording_ {
get {
return ResourceManager.GetString("ScreenRecordForm_StartRecording_Click_tray_icon_to_start_recording_", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Click tray icon to stop recording..
/// </summary>
@ -1617,8 +1626,8 @@ public class Resources {
}
/// <summary>
/// Looks up a localized string similar to Are you sure you want to upload screenshot?
///You can press &apos;No&apos; for cancel current upload and disable auto uploading screenshots..
/// Looks up a localized string similar to Are you sure you want to upload this screenshot?
///Press &apos;No&apos; to cancel the current upload and disable screenshot auto uploading..
/// </summary>
public static string UploadTask_DoUploadJob_First_time_upload_warning_text {
get {

View file

@ -646,4 +646,7 @@ here</value>
<value>Can't access to "{0}" file.
Please run ShareX as administrator to change personal folder path.</value>
</data>
<data name="ScreenRecordForm_StartRecording_Click_tray_icon_to_start_recording_" xml:space="preserve">
<value>Click tray icon to start recording.</value>
</data>
</root>

View file

@ -387,4 +387,7 @@ Lütfen başka bir kısayol seçin veya çakışan uygulamayı kapatın ve Share
<data name="UploadManager_UploadURL_URL_to_download_from_and_upload" xml:space="preserve">
<value>Adresden dosya indir ve yükle</value>
</data>
<data name="ScreenRecordForm_StartRecording_Click_tray_icon_to_start_recording_" xml:space="preserve">
<value>Kaydı başlatmak için simge ikonuna tıklayın.</value>
</data>
</root>

View file

@ -470,7 +470,7 @@ public static void DoScreenRecording(TaskSettings taskSettings = null)
if (form.IsRecording)
{
form.StopRecording();
form.StartStopRecording();
}
else
{