mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 21:13:23 -07:00
Default disabling Outlook export to meeting items, the bitmaps are changed to BMP by Outlook. Also removed some old obsolete code.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1668 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
184e70f7b1
commit
7669f78de6
4 changed files with 20 additions and 54 deletions
|
@ -74,7 +74,9 @@ namespace Greenshot.Destinations {
|
|||
exePath = GetExePath("OUTLOOK.EXE");
|
||||
if (exePath != null && File.Exists(exePath)) {
|
||||
applicationIcon = GetExeIcon(exePath, 0);
|
||||
meetingIcon = GetExeIcon(exePath, 2);
|
||||
if (conf.OutlookAllowExportInMeetings) {
|
||||
meetingIcon = GetExeIcon(exePath, 2);
|
||||
}
|
||||
} else {
|
||||
exePath = null;
|
||||
}
|
||||
|
@ -148,6 +150,10 @@ namespace Greenshot.Destinations {
|
|||
get {
|
||||
if (isOutlookUsed && outlookInspectorCaption != null) {
|
||||
if (OlObjectClass.olAppointment.Equals(outlookInspectorType)) {
|
||||
// Make sure we loaded the icon, maybe the configuration has been changed!
|
||||
if (meetingIcon == null) {
|
||||
meetingIcon = GetExeIcon(exePath, 2);
|
||||
}
|
||||
return meetingIcon;
|
||||
} else {
|
||||
return mailIcon;
|
||||
|
|
|
@ -111,28 +111,6 @@ namespace Greenshot {
|
|||
return returnValue;
|
||||
}
|
||||
|
||||
private void SetEmailFormat(EmailFormat selectedEmailFormat) {
|
||||
// TODO: Fix!!
|
||||
// Setup the email settings
|
||||
EmailFormat [] availableValues;
|
||||
if (EmailConfigHelper.HasMAPI()) {
|
||||
//checkbox_email.Enabled = true;
|
||||
//combobox_emailformat.Visible = true;
|
||||
if (EmailConfigHelper.HasOutlook()) {
|
||||
availableValues = new EmailFormat[]{EmailFormat.MAPI, EmailFormat.OUTLOOK_TXT, EmailFormat.OUTLOOK_HTML};
|
||||
} else {
|
||||
// Force MAPI in configuration if no Outlook
|
||||
coreConfiguration.OutputEMailFormat = EmailFormat.MAPI;
|
||||
availableValues = new EmailFormat[]{EmailFormat.MAPI};
|
||||
}
|
||||
//PopulateComboBox<EmailFormat>(combobox_emailformat, availableValues, selectedEmailFormat);
|
||||
} else {
|
||||
//checkbox_email.Enabled = false;
|
||||
//checkbox_email.Checked = false;
|
||||
//combobox_emailformat.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void SetWindowCaptureMode(WindowCaptureMode selectedWindowCaptureMode) {
|
||||
WindowCaptureMode[] availableModes;
|
||||
if (!DWM.isDWMEnabled()) {
|
||||
|
@ -286,7 +264,6 @@ namespace Greenshot {
|
|||
textbox_screenshotname.Text = coreConfiguration.OutputFileFilenamePattern;
|
||||
combobox_primaryimageformat.SelectedItem = coreConfiguration.OutputFileFormat;
|
||||
|
||||
SetEmailFormat(coreConfiguration.OutputEMailFormat);
|
||||
SetWindowCaptureMode(coreConfiguration.WindowCaptureMode);
|
||||
|
||||
checkbox_copypathtoclipboard.Checked = coreConfiguration.OutputFileCopyPathToClipboard;
|
||||
|
@ -351,10 +328,6 @@ namespace Greenshot {
|
|||
coreConfiguration.OutputFileFormat = OutputFormat.png;
|
||||
}
|
||||
|
||||
// TODO: Fix
|
||||
//coreConfiguration.OutputEMailFormat = GetSelected<EmailFormat>(combobox_emailformat);
|
||||
coreConfiguration.OutputEMailFormat = EmailFormat.OUTLOOK_HTML;
|
||||
|
||||
coreConfiguration.OutputFileCopyPathToClipboard = checkbox_copypathtoclipboard.Checked;
|
||||
coreConfiguration.OutputFileJpegQuality = trackBarJpegQuality.Value;
|
||||
coreConfiguration.OutputFilePromptJpegQuality = checkbox_alwaysshowjpegqualitydialog.Checked;
|
||||
|
|
|
@ -151,7 +151,7 @@ namespace Greenshot.Helpers.OfficeInterop {
|
|||
if (!currentItem.Sent) {
|
||||
return true;
|
||||
}
|
||||
} else if (outlookVersion.Major >=12 && OlObjectClass.olAppointment.Equals(currentItemClass)) {
|
||||
} else if (outlookVersion.Major >= 12 && conf.OutlookAllowExportInMeetings && OlObjectClass.olAppointment.Equals(currentItemClass)) {
|
||||
if (string.IsNullOrEmpty(currentItem.Organizer) || (currentUser == null && currentUser.Equals(currentItem.Organizer))) {
|
||||
return true;
|
||||
} else {
|
||||
|
@ -331,8 +331,8 @@ namespace Greenshot.Helpers.OfficeInterop {
|
|||
} catch (Exception e) {
|
||||
LOG.Error("Problem reading signature!", e);
|
||||
}
|
||||
switch(conf.OutputEMailFormat) {
|
||||
case EmailFormat.OUTLOOK_TXT:
|
||||
switch(conf.OutlookEmailFormat) {
|
||||
case EmailFormat.Text:
|
||||
newMail.Attachments.Add(tmpFile, OlAttachmentType.olByValue, 1, attachmentName);
|
||||
newMail.BodyFormat = OlBodyFormat.olFormatPlain;
|
||||
if (bodyString == null) {
|
||||
|
@ -340,7 +340,7 @@ namespace Greenshot.Helpers.OfficeInterop {
|
|||
}
|
||||
newMail.Body = bodyString;
|
||||
break;
|
||||
case EmailFormat.OUTLOOK_HTML:
|
||||
case EmailFormat.HTML:
|
||||
default:
|
||||
// Create the attachment
|
||||
Attachment attachment = newMail.Attachments.Add(tmpFile, OlAttachmentType.olByValue, 0, attachmentName);
|
||||
|
@ -446,11 +446,11 @@ namespace Greenshot.Helpers.OfficeInterop {
|
|||
}
|
||||
LOG.DebugFormat("Found email signature: {0}", signatureName);
|
||||
string extension;
|
||||
switch(conf.OutputEMailFormat) {
|
||||
case EmailFormat.OUTLOOK_TXT:
|
||||
switch(conf.OutlookEmailFormat) {
|
||||
case EmailFormat.Text:
|
||||
extension = ".txt";
|
||||
break;
|
||||
case EmailFormat.OUTLOOK_HTML:
|
||||
case EmailFormat.HTML:
|
||||
default:
|
||||
extension = ".htm";
|
||||
break;
|
||||
|
|
|
@ -38,11 +38,7 @@ namespace GreenshotPlugin.Core {
|
|||
Screen, GDI, Aero, AeroTransparent, Auto
|
||||
}
|
||||
public enum EmailFormat {
|
||||
MAPI, OUTLOOK_TXT, OUTLOOK_HTML
|
||||
}
|
||||
public enum EmailExport {
|
||||
AlwaysNew,
|
||||
TryOpenElseNew
|
||||
Text, HTML
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -98,11 +94,11 @@ namespace GreenshotPlugin.Core {
|
|||
public OutputFormat OutputFileFormat = OutputFormat.png;
|
||||
[IniProperty("OutputFileReduceColors", Description="If set to true, than the colors of the output file are reduced to 256 (8-bit) colors", DefaultValue="false")]
|
||||
public bool OutputFileReduceColors;
|
||||
|
||||
[IniProperty("OutputEMailFormat", Description="Default type for emails. (txt, html)")]
|
||||
public EmailFormat OutputEMailFormat;
|
||||
[IniProperty("OutputOutlookMethod", Description="How to export to outlook (AlwaysNew= always open a new one, TryOpenElseNew=look for open email else create a new)", DefaultValue="AlwaysNew")]
|
||||
public EmailExport OutputOutlookMethod;
|
||||
|
||||
[IniProperty("OutlookEmailFormat", Description = "Default type for emails. (Text, HTML)", DefaultValue="HTML")]
|
||||
public EmailFormat OutlookEmailFormat;
|
||||
[IniProperty("OutlookAllowExportInMeetings", Description = "Allow export in meeting items", DefaultValue="False")]
|
||||
public bool OutlookAllowExportInMeetings;
|
||||
|
||||
[IniProperty("OutputFileCopyPathToClipboard", Description="When saving a screenshot, copy the path to the clipboard?", DefaultValue="true")]
|
||||
public bool OutputFileCopyPathToClipboard;
|
||||
|
@ -259,11 +255,6 @@ namespace GreenshotPlugin.Core {
|
|||
return Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
|
||||
case "DWMBackgroundColor":
|
||||
return Color.White;
|
||||
case "OutputEMailFormat":
|
||||
if (EmailConfigHelper.HasOutlook()) {
|
||||
return EmailFormat.OUTLOOK_HTML;
|
||||
}
|
||||
return EmailFormat.MAPI;
|
||||
case "ActiveTitleFixes":
|
||||
List<string> activeDefaults = new List<string>();
|
||||
activeDefaults.Add("Firefox");
|
||||
|
@ -319,10 +310,6 @@ namespace GreenshotPlugin.Core {
|
|||
if (OutputDestinations.Count == 0) {
|
||||
OutputDestinations.Add("Editor");
|
||||
}
|
||||
// Check for Outlook, if it's not installed force email format to MAPI
|
||||
if (OutputEMailFormat != EmailFormat.MAPI && !EmailConfigHelper.HasOutlook()) {
|
||||
OutputEMailFormat = EmailFormat.MAPI;
|
||||
}
|
||||
// Prevent both settings at once, bug #3435056
|
||||
if (OutputDestinations.Contains("Clipboard") && OutputFileCopyPathToClipboard) {
|
||||
OutputFileCopyPathToClipboard = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue