BUG-1908: Made Greenshot recheck & add the external commands like Ms-Paint and Paint.NET if they are not deleted manually and not yet available. Also cleaned up some code.

This commit is contained in:
Robin 2016-09-16 21:48:57 +02:00
commit 6efc7796b8
49 changed files with 322 additions and 294 deletions

View file

@ -110,7 +110,7 @@ namespace GreenshotPlugin.Controls {
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void timer_Tick(object sender, EventArgs e) {
private void timer_Tick(object sender, EventArgs e) {
try {
Animate();
} catch (Exception ex) {

View file

@ -92,8 +92,8 @@ namespace GreenshotPlugin.Controls {
_shouldClose = true;
Application.DoEvents();
}
void BackgroundFormFormClosing(object sender, FormClosingEventArgs e) {
private void BackgroundFormFormClosing(object sender, FormClosingEventArgs e) {
timer_checkforclose.Stop();
}
}

View file

@ -25,14 +25,14 @@ using GreenshotInterop.Interop;
namespace GreenshotPlugin.Controls {
public class ExtendedWebBrowser : WebBrowser {
protected class ExtendedWebBrowserSite : WebBrowserSite, IOleCommandTarget {
const int OLECMDID_SHOWSCRIPTERROR = 40;
const int OLECMDID_SHOWMESSAGE = 41;
private const int OLECMDID_SHOWSCRIPTERROR = 40;
private const int OLECMDID_SHOWMESSAGE = 41;
static readonly Guid CGID_DocHostCommandHandler = new Guid("F38BC242-B950-11D1-8918-00C04FC2C836");
private static readonly Guid CGID_DocHostCommandHandler = new Guid("F38BC242-B950-11D1-8918-00C04FC2C836");
const int S_OK = 0;
const int OLECMDERR_E_NOTSUPPORTED = (-2147221248);
const int OLECMDERR_E_UNKNOWNGROUP = (-2147221244);
private const int S_OK = 0;
private const int OLECMDERR_E_NOTSUPPORTED = (-2147221248);
private const int OLECMDERR_E_UNKNOWNGROUP = (-2147221244);
public ExtendedWebBrowserSite(WebBrowser wb) : base(wb) {
}

View file

@ -201,7 +201,7 @@ namespace GreenshotPlugin.Controls {
/// Fires when a key is pushed down. Here, we'll want to update the text in the box
/// to notify the user what combination is currently pressed.
/// </summary>
void HotkeyControl_KeyDown(object sender, KeyEventArgs e) {
private void HotkeyControl_KeyDown(object sender, KeyEventArgs e) {
// Clear the current hotkey
if (e.KeyCode == Keys.Back || e.KeyCode == Keys.Delete) {
ResetHotkey();
@ -217,7 +217,7 @@ namespace GreenshotPlugin.Controls {
/// Fires when all keys are released. If the current hotkey isn't valid, reset it.
/// Otherwise, do nothing and keep the text and hotkey as it was.
/// </summary>
void HotkeyControl_KeyUp(object sender, KeyEventArgs e) {
private void HotkeyControl_KeyUp(object sender, KeyEventArgs e) {
// Somehow the PrintScreen only comes as a keyup, therefore we handle it here.
if (e.KeyCode == Keys.PrintScreen) {
_modifiers = e.Modifiers;
@ -235,7 +235,7 @@ namespace GreenshotPlugin.Controls {
/// Prevents the letter/whatever entered to show up in the TextBox
/// Without this, a "A" key press would appear as "aControl, Alt + A"
/// </summary>
void HotkeyControl_KeyPress(object sender, KeyPressEventArgs e) {
private void HotkeyControl_KeyPress(object sender, KeyPressEventArgs e) {
e.Handled = true;
}

View file

@ -115,7 +115,7 @@ namespace GreenshotPlugin.Controls {
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void CancelButtonClick(object sender, EventArgs e) {
private void CancelButtonClick(object sender, EventArgs e) {
LOG.DebugFormat("Cancel clicked on {0}", _title);
cancelButton.Enabled = false;
_waitFor.Abort();

View file

@ -48,8 +48,8 @@ namespace GreenshotPlugin.Controls {
textBoxJpegQuality.Text = Settings.JPGQuality.ToString();
ToFront = true;
}
void Button_okClick(object sender, EventArgs e) {
private void Button_okClick(object sender, EventArgs e) {
Settings.JPGQuality = trackBarJpegQuality.Value;
Settings.ReduceColors = checkBox_reduceColors.Checked;
if (checkbox_dontaskagain.Checked) {
@ -59,8 +59,8 @@ namespace GreenshotPlugin.Controls {
IniConfig.Save();
}
}
void TrackBarJpegQualityScroll(object sender, EventArgs e) {
private void TrackBarJpegQualityScroll(object sender, EventArgs e) {
textBoxJpegQuality.Text = trackBarJpegQuality.Value.ToString();
}
}