1
0
mirror of https://github.com/greenshot/greenshot.git synced 2025-03-12 05:25:25 -07:00

FEATURE-757: Store the last region in the greenshot.ini so it's available after a restart.

This commit is contained in:
RKrom 2014-11-03 14:25:14 +01:00
parent 634a4cf262
commit fc7faecaa5
5 changed files with 14 additions and 40 deletions
Greenshot
Configuration
Greenshot.csproj
Helpers
releases/additional_files
GreenshotPlugin/Core

@ -1,34 +0,0 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System.Drawing;
namespace Greenshot.Configuration {
/// <summary>
/// Greenshot's runtime configuration
/// abstract, all properties are public and static
/// </summary>
public abstract class RuntimeConfig {
public static string[] SupportedLanguages = {"en-US","de-DE","nl-NL"};
public static string BugTrackerUrl = "https://sourceforge.net/tracker/?func=postadd&group_id=191585&atid=937972&summary=%SUMMARY%&details=%DETAILS%";
public static Rectangle LastCapturedRegion = Rectangle.Empty;
}
}

@ -32,7 +32,6 @@
<Compile Include="AssemblyInfo.cs" />
<Compile Include="Configuration\EditorConfiguration.cs" />
<Compile Include="Configuration\LanguageKeys.cs" />
<Compile Include="Configuration\RuntimeConfig.cs" />
<Compile Include="Controls\BindableToolStripComboBox.cs">
<SubType>Component</SubType>
</Compile>

@ -403,8 +403,8 @@ namespace Greenshot.Helpers {
}
break;
case CaptureMode.LastRegion:
if (!RuntimeConfig.LastCapturedRegion.IsEmpty) {
_capture = WindowCapture.CaptureRectangle(_capture, RuntimeConfig.LastCapturedRegion);
if (!conf.LastCapturedRegion.IsEmpty) {
_capture = WindowCapture.CaptureRectangle(_capture, conf.LastCapturedRegion);
// TODO: Reactive / check if the elements code is activated
//if (windowDetailsThread != null) {
// windowDetailsThread.Join();
@ -412,7 +412,7 @@ namespace Greenshot.Helpers {
// Set capture title, fixing bug #3569703
foreach (WindowDetails window in WindowDetails.GetVisibleWindows()) {
Point estimatedLocation = new Point(RuntimeConfig.LastCapturedRegion.X + (RuntimeConfig.LastCapturedRegion.Width / 2), RuntimeConfig.LastCapturedRegion.Y + (RuntimeConfig.LastCapturedRegion.Height / 2));
Point estimatedLocation = new Point(conf.LastCapturedRegion.X + (conf.LastCapturedRegion.Width / 2), conf.LastCapturedRegion.Y + (conf.LastCapturedRegion.Height / 2));
if (window.Contains(estimatedLocation)) {
_selectedCaptureWindow = window;
_capture.CaptureDetails.Title = _selectedCaptureWindow.Text;
@ -718,7 +718,7 @@ namespace Greenshot.Helpers {
return false;
}
// Fix for Bug #3430560
RuntimeConfig.LastCapturedRegion = _selectedCaptureWindow.WindowRectangle;
conf.LastCapturedRegion = _selectedCaptureWindow.WindowRectangle;
bool returnValue = CaptureWindow(_selectedCaptureWindow, _capture, conf.WindowCaptureMode) != null;
return returnValue;
}
@ -970,7 +970,7 @@ namespace Greenshot.Helpers {
// Important here is that the location needs to be offsetted back to screen coordinates!
Rectangle tmpRectangle = _captureRect;
tmpRectangle.Offset(_capture.ScreenBounds.Location.X, _capture.ScreenBounds.Location.Y);
RuntimeConfig.LastCapturedRegion = tmpRectangle;
conf.LastCapturedRegion = tmpRectangle;
HandleCapture();
}
}

@ -10,9 +10,11 @@ CHANGE LOG:
Features:
* Due to BUG-1667 we had to remove the horizontal text alignment, this afflicts the textbox and the speech bubble.
* Added the possibility to select the region to capture by using the keyboard, use the cursor keys to move the cursor (ctrl-key speeds up the movement) and the enter key to mark the start and ending.
* FEATURE-757: Greenshot will now store the last used region in the greenshot.ini, which makes it also available after a restart.
Changes:
* JIRA: With JIRA 6.x using the SOAP (Webservice) API the access has gotten really slow, we improved the performance slightly by loading some information parallel. (In Greenshot 2.x we will move to another API.)
* Editor: Due to the amount of high DPI screens, we are testing the possibility to change the icon size. Look for the ButtonIconSize in the editor section of the greenshot.ini. Disadvantage: As the icons are bitmaps, enlarging them does look ugly.
Bugs Resolved:
* BUG-1667: removed horizontal alignment of textbox in input mode, as it caused problems with textbox focus and could not be implemented consistently anyway (no vertical alignment possible)

@ -253,6 +253,9 @@ namespace GreenshotPlugin.Core {
[IniProperty("ProcessEXIFOrientation", Description = "When reading images from files or clipboard, use the EXIF information to correct the orientation", DefaultValue = "True")]
public bool ProcessEXIFOrientation;
[IniProperty("LastCapturedRegion", Description = "The last used region, for reuse in the capture last region")]
public Rectangle LastCapturedRegion;
// Specifies what THIS build is
public BuildStates BuildState = BuildStates.RELEASE_CANDIDATE;
@ -429,6 +432,10 @@ namespace GreenshotPlugin.Core {
if (OutputFileReduceColorsTo > 256) {
OutputFileReduceColorsTo = 256;
}
if (ContextMenuIconSize == Size.Empty) {
ContextMenuIconSize = new Size(16,16);
}
}
}
}