Configuration refactoring: changed SettingsForm and some other classes to use the new IniConfiguration

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@849 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2010-08-23 19:42:33 +00:00
parent 60f72cc0be
commit 5e9772c4e5
6 changed files with 107 additions and 136 deletions

View file

@ -25,6 +25,12 @@ using System.Drawing.Imaging;
using System.IO;
namespace Greenshot.Core {
public enum Destination {
Editor, FileDefault, FileWithDialog, Clipboard, Printer, EMail
}
public enum OutputFormat {
Bmp, Gif, Jepg, Png, Tiff
}
/// <summary>
/// Description of CoreConfiguration.
/// </summary>
@ -37,7 +43,7 @@ namespace Greenshot.Core {
[IniProperty("IsFirstLaunch", Description="Is this the first time launch?", DefaultValue="true")]
public bool IsFirstLaunch;
[IniProperty("Destinations", Description="Which destinations? Options are: Editor, FileDefault, FileWithDialog, Clipboard, Printer, EMail", DefaultValue="Editor")]
public List<String> OutputDestinations;
public List<Destination> OutputDestinations;
[IniProperty("CaptureMousepointer", Description="Should the mouse be captured?", DefaultValue="true")]
public bool CaptureMousepointer;
@ -48,7 +54,7 @@ namespace Greenshot.Core {
[IniProperty("CaptureCompleteWindow", Description="Try capturing the complete window.", DefaultValue="false")]
public bool CaptureCompleteWindow;
[IniProperty("CaptureWindowContent", Description="Try capturing only the content of the window (IE/Firefox).", DefaultValue="false")]
public bool? CaptureWindowContent;
public bool CaptureWindowContent;
[IniProperty("ShowFlashlight", Description="Show a flash after taking a capture.", DefaultValue="false")]
public bool ShowFlash = false;
@ -59,7 +65,7 @@ namespace Greenshot.Core {
[IniProperty("OutputFileFilenamePattern", Description="Filename pattern for screenshot.", DefaultValue="%title%_%YYYY%-%MM%-%DD%_%hh%-%mm%-%ss%")]
public string OutputFileFilenamePattern;
[IniProperty("OutputFileFormat", Description="Default file type for writing screenshots. (Bmp, Gif, Jepg, Png, Tiff)", DefaultValue="Png")]
public ImageFormat OutputFileFormat = ImageFormat.Png;
public OutputFormat OutputFileFormat = OutputFormat.Png;
[IniProperty("OutputFileCopyPathToClipboard", Description="When saving a screenshot, copy the path to the clipboard?", DefaultValue="true")]
public bool OutputFileCopyPathToClipboard;
@ -84,18 +90,5 @@ namespace Greenshot.Core {
public bool OutputPrintCenter;
[IniProperty("OutputPrintTimestamp", Description="Print timestamp on print?", DefaultValue="true")]
public bool OutputPrintTimestamp;
[IniProperty("EditorWindowSize", Description="Size of the editor.", DefaultValue="540, 380")]
public Size EditorWindowSize;
[IniProperty("EditorWindowLocation", Description="Location of the editor.", DefaultValue="100, 100")]
public Point EditorWindowLocation;
[IniProperty("EditorWindowState", Description="The window state of the editor. (Normal or Maximized)", DefaultValue="Normal")]
public String EditorWindowState;
public Color[] Editor_RecentColors = new Color[12];
public Font Editor_Font = null;
// Not storing, this doesn't make sense to store (or does it?)
public Rectangle EditorPreviousScreenbounds = Rectangle.Empty;
}
}

View file

@ -30,8 +30,8 @@ namespace Greenshot {
/// Description of JpegQualityDialog.
/// </summary>
public partial class JpegQualityDialog : Form {
AppConfig conf;
ILanguage lang;
private CoreConfiguration conf = IniConfig.GetIniSection<CoreConfiguration>();
private ILanguage lang;
public int Quality = 0;
public JpegQualityDialog() {
//
@ -39,10 +39,9 @@ namespace Greenshot {
//
InitializeComponent();
conf = AppConfig.GetInstance();
lang = Language.GetInstance();
this.trackBarJpegQuality.Value = conf.Output_File_JpegQuality;
this.textBoxJpegQuality.Text = conf.Output_File_JpegQuality.ToString();
this.trackBarJpegQuality.Value = conf.OutputFileJpegQuality;
this.textBoxJpegQuality.Text = conf.OutputFileJpegQuality.ToString();
UpdateUI();
}
@ -50,9 +49,9 @@ namespace Greenshot {
void Button_okClick(object sender, System.EventArgs e) {
Quality = this.trackBarJpegQuality.Value;
if(this.checkbox_dontaskagain.Checked) {
conf.Output_File_JpegQuality = Quality;
conf.Output_File_PromptJpegQuality = false;
conf.Store();
conf.OutputFileJpegQuality = Quality;
conf.OutputFilePromptJpegQuality = false;
IniConfig.Save();
}
}

View file

@ -30,30 +30,21 @@ namespace Greenshot.Forms {
/// Description of PrintOptionsDialog.
/// </summary>
public partial class PrintOptionsDialog : Form {
AppConfig conf;
ILanguage lang;
private CoreConfiguration conf = IniConfig.GetIniSection<CoreConfiguration>();
private ILanguage lang;
public bool AllowPrintCenter;
public bool AllowPrintEnlarge;
public bool AllowPrintRotate;
public bool AllowPrintShrink;
public bool PrintDateTime;
public PrintOptionsDialog()
{
public PrintOptionsDialog() {
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
conf = AppConfig.GetInstance();
lang = Language.GetInstance();
this.AllowPrintCenter = this.checkboxAllowCenter.Checked = (bool)conf.Output_Print_Center;
this.AllowPrintEnlarge = this.checkboxAllowEnlarge.Checked = (bool)conf.Output_Print_AllowEnlarge;
this.AllowPrintRotate = this.checkboxAllowRotate.Checked = (bool)conf.Output_Print_AllowRotate;
this.AllowPrintShrink = this.checkboxAllowShrink.Checked = (bool)conf.Output_Print_AllowShrink;
this.PrintDateTime = this.checkboxDateTime.Checked = (bool)conf.Output_Print_Timestamp;
this.checkboxAllowCenter.Checked = conf.OutputPrintCenter;
this.checkboxAllowEnlarge.Checked = conf.OutputPrintAllowEnlarge;
this.checkboxAllowRotate.Checked = conf.OutputPrintAllowRotate;
this.checkboxAllowShrink.Checked = conf.OutputPrintAllowShrink;
this.checkboxDateTime.Checked = conf.OutputPrintTimestamp;
this.checkbox_dontaskagain.Checked = false;
UpdateUI();
}
@ -69,23 +60,15 @@ namespace Greenshot.Forms {
}
void Button_okClick(object sender, EventArgs e)
{
this.AllowPrintCenter = this.checkboxAllowCenter.Checked;
this.AllowPrintEnlarge = this.checkboxAllowEnlarge.Checked;
this.AllowPrintRotate = this.checkboxAllowRotate.Checked;
this.AllowPrintShrink = this.checkboxAllowShrink.Checked;
this.PrintDateTime = this.checkboxDateTime.Checked;
void Button_okClick(object sender, EventArgs e) {
// update config
conf.Output_Print_Center = (bool?)this.AllowPrintCenter;
conf.Output_Print_AllowEnlarge = (bool?)this.AllowPrintEnlarge;
conf.Output_Print_AllowRotate = (bool?)this.AllowPrintRotate;
conf.Output_Print_AllowShrink = (bool?)this.AllowPrintShrink;
conf.Output_Print_Timestamp = (bool?)this.PrintDateTime;
conf.Output_Print_PromptOptions = !this.checkbox_dontaskagain.Checked;
conf.Store();
conf.OutputPrintCenter = this.checkboxAllowCenter.Checked;
conf.OutputPrintAllowEnlarge = this.checkboxAllowEnlarge.Checked;
conf.OutputPrintAllowRotate = this.checkboxAllowRotate.Checked;
conf.OutputPrintAllowShrink = this.checkboxAllowShrink.Checked;
conf.OutputPrintTimestamp = this.checkboxDateTime.Checked;
conf.OutputPrintPromptOptions = !this.checkbox_dontaskagain.Checked;
IniConfig.Save();
}
}
}

View file

@ -28,6 +28,7 @@ using System.Windows.Forms;
using Greenshot.Capturing;
using Greenshot.Configuration;
using Greenshot.Core;
using Greenshot.Helpers;
using Greenshot.Plugin;
@ -42,6 +43,7 @@ namespace Greenshot.Forms {
private FilterOption[] filterOptions;
private DirectoryInfo eagerlyCreatedDirectory;
private ICaptureDetails captureDetails = null;
private CoreConfiguration conf = IniConfig.GetIniSection<CoreConfiguration>();
public SaveImageFileDialog() {
init();
@ -55,7 +57,7 @@ namespace Greenshot.Forms {
private void init() {
saveFileDialog = new SaveFileDialog();
applyFilterOptions();
saveFileDialog.InitialDirectory = Path.GetDirectoryName(AppConfig.GetInstance().Output_FileAs_Fullpath);
saveFileDialog.InitialDirectory = Path.GetDirectoryName(conf.Output_FileAs_Fullpath);
// The following property fixes a problem that the directory where we save is locked (bug #2899790)
saveFileDialog.RestoreDirectory = true;
@ -66,7 +68,6 @@ namespace Greenshot.Forms {
private void applyFilterOptions() {
prepareFilterOptions();
AppConfig conf = AppConfig.GetInstance();
string fdf = "";
int preselect = 0;
for(int i=0; i<filterOptions.Length; i++){
@ -153,11 +154,9 @@ namespace Greenshot.Forms {
/// </summary>
/// <param name="sfd">a SaveFileDialog instance</param>
private void ApplySuggestedValues() {
AppConfig conf = AppConfig.GetInstance();
string rootDir = GetRootDirFromConfig();
// build the full path and set dialog properties
string filenameFromPattern = FilenameHelper.GetFilenameWithoutExtensionFromPattern(conf.Output_File_FilenamePattern, captureDetails);
string filenameFromPattern = FilenameHelper.GetFilenameWithoutExtensionFromPattern(conf.OutputFileFilenamePattern, captureDetails);
string fullpath = Path.Combine(rootDir, filenameFromPattern);
string dir = CreateDirectoryIfNotExists(fullpath);
@ -204,7 +203,7 @@ namespace Greenshot.Forms {
}
private string GetRootDirFromConfig() {
string rootDir = AppConfig.GetInstance().Output_File_Path;
string rootDir =conf.Output_File_Path;
// the idea was to let the user choose whether to suggest the dir
// configured in the settings dialog or just remember the latest path.
// however, we'd need an extra option for this, making the settings dialog

View file

@ -21,15 +21,16 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Globalization;
using System.IO;
using System.Threading;
using System.Windows.Forms;
using Greenshot.Configuration;
using Greenshot.Core;
using Greenshot.Helpers;
using Greenshot.Plugin;
using Greenshot.Core;
namespace Greenshot {
/// <summary>
@ -38,12 +39,11 @@ namespace Greenshot {
public partial class SettingsForm : Form {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(SettingsForm));
ILanguage lang;
AppConfig conf;
private CoreConfiguration conf = IniConfig.GetIniSection<CoreConfiguration>();
private ToolTip toolTip;
public SettingsForm() {
InitializeComponent();
conf = AppConfig.GetInstance();
lang = Language.GetInstance();
// Force loading of languages
lang.Load();
@ -169,35 +169,35 @@ namespace Greenshot {
private void DisplaySettings() {
combobox_language.SelectedValue = lang.CurrentLanguage;
checkbox_registerhotkeys.Checked = (bool)conf.General_RegisterHotkeys;
checkbox_registerhotkeys.Checked = conf.RegisterHotkeys;
textbox_storagelocation.Text = conf.Output_File_Path;
textbox_screenshotname.Text = conf.Output_File_FilenamePattern;
combobox_primaryimageformat.Text = conf.Output_File_Format.ToString();
checkbox_copypathtoclipboard.Checked = (bool)conf.Output_File_CopyPathToClipboard;
trackBarJpegQuality.Value = conf.Output_File_JpegQuality;
textBoxJpegQuality.Text = conf.Output_File_JpegQuality+"%";
checkbox_alwaysshowjpegqualitydialog.Checked = (bool)conf.Output_File_PromptJpegQuality;
checkbox_showflashlight.Checked = (bool)conf.Ui_Effects_Flashlight;
checkbox_playsound.Checked = (bool)conf.Ui_Effects_CameraSound;
textbox_screenshotname.Text = conf.OutputFileFilenamePattern;
combobox_primaryimageformat.Text = conf.OutputFileFormat.ToString();
checkbox_copypathtoclipboard.Checked = conf.OutputFileCopyPathToClipboard;
trackBarJpegQuality.Value = conf.OutputFileJpegQuality;
textBoxJpegQuality.Text = conf.OutputFileJpegQuality+"%";
checkbox_alwaysshowjpegqualitydialog.Checked = conf.OutputFilePromptJpegQuality;
checkbox_showflashlight.Checked = conf.ShowFlash;
checkbox_playsound.Checked = conf.PlayCameraSound;
checkbox_clipboard.Checked = (conf.Output_Destinations&ScreenshotDestinations.Clipboard) == ScreenshotDestinations.Clipboard;
checkbox_file.Checked = (conf.Output_Destinations&ScreenshotDestinations.FileDefault) == ScreenshotDestinations.FileDefault;
checkbox_fileas.Checked = (conf.Output_Destinations&ScreenshotDestinations.FileWithDialog) == ScreenshotDestinations.FileWithDialog;
checkbox_printer.Checked = (conf.Output_Destinations&ScreenshotDestinations.Printer) == ScreenshotDestinations.Printer;
checkbox_editor.Checked = (conf.Output_Destinations&ScreenshotDestinations.Editor) == ScreenshotDestinations.Editor;
checkbox_email.Checked = (conf.Output_Destinations&ScreenshotDestinations.EMail) == ScreenshotDestinations.EMail;
checkbox_clipboard.Checked = conf.OutputDestinations.Contains(Destination.Clipboard);
checkbox_file.Checked = conf.OutputDestinations.Contains(Destination.FileDefault);
checkbox_fileas.Checked = conf.OutputDestinations.Contains(Destination.FileWithDialog);
checkbox_printer.Checked = conf.OutputDestinations.Contains(Destination.Printer);
checkbox_editor.Checked = conf.OutputDestinations.Contains(Destination.Editor);
checkbox_email.Checked = conf.OutputDestinations.Contains(Destination.EMail);
checkboxAllowCenter.Checked = (bool)conf.Output_Print_Center;
checkboxAllowEnlarge.Checked = (bool)conf.Output_Print_AllowEnlarge;
checkboxAllowRotate.Checked = (bool)conf.Output_Print_AllowRotate;
checkboxAllowShrink.Checked = (bool)conf.Output_Print_AllowShrink;
checkboxTimestamp.Checked = (bool)conf.Output_Print_Timestamp;
checkbox_alwaysshowprintoptionsdialog.Checked = (bool)conf.Output_Print_PromptOptions;
checkbox_capture_mousepointer.Checked = (bool)conf.Capture_Mousepointer;
checkbox_capture_windows_interactive.Checked = (bool)conf.Capture_Windows_Interactive;
checkbox_capture_complete_windows.Checked = (bool)conf.Capture_Complete_Window;
checkbox_capture_window_content.Checked = (bool)conf.Capture_Window_Content;
numericUpDownWaitTime.Value = conf.Capture_Wait_Time;
checkboxAllowCenter.Checked = conf.OutputPrintCenter;
checkboxAllowEnlarge.Checked = conf.OutputPrintAllowEnlarge;
checkboxAllowRotate.Checked = conf.OutputPrintAllowRotate;
checkboxAllowShrink.Checked = conf.OutputPrintAllowShrink;
checkboxTimestamp.Checked = conf.OutputPrintTimestamp;
checkbox_alwaysshowprintoptionsdialog.Checked = conf.OutputPrintPromptOptions;
checkbox_capture_mousepointer.Checked = conf.CaptureMousepointer;
checkbox_capture_windows_interactive.Checked = conf.CaptureWindowsInteractive;
checkbox_capture_complete_windows.Checked = conf.CaptureCompleteWindow;
checkbox_capture_window_content.Checked = conf.CaptureWindowContent;
numericUpDownWaitTime.Value = conf.CaptureDelay;
// If the run for all is set we disable and set the checkbox
if (StartupHelper.checkRunAll()) {
@ -211,27 +211,30 @@ namespace Greenshot {
}
private void SaveSettings() {
conf.Ui_Language = combobox_language.SelectedValue.ToString();
conf.Language = combobox_language.SelectedValue.ToString();
// Make sure the current language is reflected in the Main-context menu
//MainForm.instance.UpdateUI(); // TODO
conf.General_RegisterHotkeys = (bool?)checkbox_registerhotkeys.Checked;
conf.RegisterHotkeys = checkbox_registerhotkeys.Checked;
conf.Output_File_Path = textbox_storagelocation.Text;
conf.Output_File_FilenamePattern = textbox_screenshotname.Text;
conf.Output_File_Format = combobox_primaryimageformat.Text;
conf.Output_File_CopyPathToClipboard = (bool?)checkbox_copypathtoclipboard.Checked;
conf.Output_File_JpegQuality = trackBarJpegQuality.Value;
conf.Output_File_PromptJpegQuality = (bool?)checkbox_alwaysshowjpegqualitydialog.Checked;
conf.Ui_Effects_Flashlight = (bool?)checkbox_showflashlight.Checked;
conf.Ui_Effects_CameraSound = (bool?)checkbox_playsound.Checked;
ScreenshotDestinations dest = 0;
if(checkbox_clipboard.Checked) dest |= ScreenshotDestinations.Clipboard;
if(checkbox_file.Checked) dest |= ScreenshotDestinations.FileDefault;
if(checkbox_fileas.Checked) dest |= ScreenshotDestinations.FileWithDialog;
if(checkbox_printer.Checked) dest |= ScreenshotDestinations.Printer;
if(checkbox_editor.Checked) dest |= ScreenshotDestinations.Editor;
if(checkbox_email.Checked) dest |= ScreenshotDestinations.EMail;
conf.OutputFileFilenamePattern = textbox_screenshotname.Text;
conf.OutputFileFormat = (OutputFormat)Enum.Parse(typeof(OutputFormat), combobox_primaryimageformat.Text);
conf.OutputFileCopyPathToClipboard = checkbox_copypathtoclipboard.Checked;
conf.OutputFileJpegQuality = trackBarJpegQuality.Value;
conf.OutputFilePromptJpegQuality = checkbox_alwaysshowjpegqualitydialog.Checked;
conf.ShowFlash = checkbox_showflashlight.Checked;
conf.PlayCameraSound = checkbox_playsound.Checked;
List<Destination> destinations = new List<Destination>();
if(checkbox_clipboard.Checked) destinations.Add(Destination.Clipboard);
if(checkbox_file.Checked) destinations.Add(Destination.FileDefault);
if(checkbox_fileas.Checked) destinations.Add(Destination.FileWithDialog);
if(checkbox_printer.Checked) destinations.Add(Destination.Printer);
if(checkbox_editor.Checked) destinations.Add(Destination.Editor);
if(checkbox_email.Checked) destinations.Add(Destination.EMail);
conf.OutputDestinations = destinations;
if (!MapiMailMessage.HasMAPI()) {
// Disable MAPI functionality as it's not available
checkbox_email.Enabled = false;
@ -241,21 +244,20 @@ namespace Greenshot {
checkbox_email.Enabled = true;
}
conf.Output_Destinations = dest;
conf.Output_Print_Center = (bool?)checkboxAllowCenter.Checked;
conf.Output_Print_AllowEnlarge = (bool?)checkboxAllowEnlarge.Checked;
conf.Output_Print_AllowRotate = (bool?)checkboxAllowRotate.Checked;
conf.Output_Print_AllowShrink = (bool?)checkboxAllowShrink.Checked;
conf.Output_Print_Timestamp = (bool?)checkboxTimestamp.Checked;
conf.Output_Print_PromptOptions = (bool?)checkbox_alwaysshowprintoptionsdialog.Checked;
conf.Capture_Mousepointer = (bool?)checkbox_capture_mousepointer.Checked;
conf.Capture_Windows_Interactive = (bool?)checkbox_capture_windows_interactive.Checked;
conf.Capture_Window_Content = (bool?)checkbox_capture_window_content.Checked;
conf.OutputPrintCenter = checkboxAllowCenter.Checked;
conf.OutputPrintAllowEnlarge = checkboxAllowEnlarge.Checked;
conf.OutputPrintAllowRotate = checkboxAllowRotate.Checked;
conf.OutputPrintAllowShrink = checkboxAllowShrink.Checked;
conf.OutputPrintTimestamp = checkboxTimestamp.Checked;
conf.OutputPrintPromptOptions = checkbox_alwaysshowprintoptionsdialog.Checked;
conf.CaptureMousepointer = checkbox_capture_mousepointer.Checked;
conf.CaptureWindowsInteractive = checkbox_capture_windows_interactive.Checked;
conf.CaptureWindowContent = checkbox_capture_window_content.Checked;
conf.Capture_Complete_Window = (bool?)checkbox_capture_complete_windows.Checked;
conf.Capture_Wait_Time = (int)numericUpDownWaitTime.Value;
conf.CaptureCompleteWindow = checkbox_capture_complete_windows.Checked;
conf.CaptureDelay = (int)numericUpDownWaitTime.Value;
conf.Store();
IniConfig.Save();
// Check if the Run for all is set
if(!StartupHelper.checkRunAll()) {

View file

@ -41,8 +41,7 @@ namespace Greenshot.Helpers {
private Image image;
private PrintDocument printDocument = new PrintDocument();
private PrintDialog printDialog = new PrintDialog();
private AppConfig conf = AppConfig.GetInstance();
private PrintOptionsDialog printOptionsDialog = null;
private CoreConfiguration conf = IniConfig.GetIniSection<CoreConfiguration>();
public PrintHelper(Image image, ICaptureDetails captureDetails) {
this.image = image;
@ -77,12 +76,10 @@ namespace Greenshot.Helpers {
if(image != null) image.Dispose();
if(printDocument != null) printDocument.Dispose();
if(printDialog != null) printDialog.Dispose();
if(printOptionsDialog != null) printOptionsDialog.Dispose();
}
image = null;
printDocument = null;
printDialog = null;
printOptionsDialog = null;
}
/// <summary>
@ -94,8 +91,8 @@ namespace Greenshot.Helpers {
PrinterSettings ret = null;
if (printDialog.ShowDialog() == DialogResult.OK) {
bool cancelled = false;
printOptionsDialog = new PrintOptionsDialog();
if (conf.Output_Print_PromptOptions == true) {
if (conf.OutputPrintPromptOptions == true) {
PrintOptionsDialog printOptionsDialog = new PrintOptionsDialog();
DialogResult result = printOptionsDialog.ShowDialog();
if(result != DialogResult.OK) {
cancelled = true;
@ -119,15 +116,13 @@ namespace Greenshot.Helpers {
}
void DrawImageForPrint(object sender, PrintPageEventArgs e) {
PrintOptionsDialog pod = printOptionsDialog;
ContentAlignment alignment = pod.AllowPrintCenter ? ContentAlignment.MiddleCenter : ContentAlignment.TopLeft;
ContentAlignment alignment = conf.OutputPrintCenter ? ContentAlignment.MiddleCenter : ContentAlignment.TopLeft;
RectangleF pageRect = e.PageSettings.PrintableArea;
GraphicsUnit gu = GraphicsUnit.Pixel;
RectangleF imageRect = image.GetBounds(ref gu);
// rotate the image if it fits the page better
if(pod.AllowPrintRotate) {
if(conf.OutputPrintAllowRotate) {
if((pageRect.Width > pageRect.Height && imageRect.Width < imageRect.Height) ||
(pageRect.Width < pageRect.Height && imageRect.Width > imageRect.Height)) {
image.RotateFlip(RotateFlipType.Rotate90FlipNone);
@ -137,10 +132,10 @@ namespace Greenshot.Helpers {
}
RectangleF printRect = new RectangleF(0,0,imageRect.Width, imageRect.Height);;
// scale the image to fit the page better
if(pod.AllowPrintEnlarge || pod.AllowPrintShrink) {
if(conf.OutputPrintAllowEnlarge || conf.OutputPrintAllowShrink) {
SizeF resizedRect = ScaleHelper.GetScaledSize(imageRect.Size,pageRect.Size,false);
if((pod.AllowPrintShrink && resizedRect.Width < printRect.Width) ||
pod.AllowPrintEnlarge && resizedRect.Width > printRect.Width) {
if((conf.OutputPrintAllowShrink && resizedRect.Width < printRect.Width) ||
conf.OutputPrintAllowEnlarge && resizedRect.Width > printRect.Width) {
printRect.Size = resizedRect;
}
@ -149,7 +144,7 @@ namespace Greenshot.Helpers {
// prepare timestamp
float dateStringWidth = 0;
float dateStringHeight = 0;
if (conf.Output_Print_Timestamp == true) {
if (conf.OutputPrintTimestamp == true) {
Font f = new Font(FontFamily.GenericSansSerif, 10, FontStyle.Regular);
string dateString = DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString();
dateStringWidth = e.Graphics.MeasureString(dateString, f).Width;