diff --git a/NEWS b/NEWS index fa476ff62..01d8b630b 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ New features - [web] show all/only this calendar - [web] convert a message to an appointment or a task (#1722) + - [web] customizable base font size for HTML messages Enhancements - [web] added Junk handling feature from v2 diff --git a/SoObjects/SOGo/SOGoDefaults.plist b/SoObjects/SOGo/SOGoDefaults.plist index de3c5480d..fbb962ddb 100644 --- a/SoObjects/SOGo/SOGoDefaults.plist +++ b/SoObjects/SOGo/SOGoDefaults.plist @@ -72,6 +72,7 @@ SOGoTrashFolderName = "Trash"; SOGoJunkFolderName = "Junk"; SOGoMailComposeMessageType = "html"; + SOGoMailComposeFontSize = 0; SOGoMailDisplayRemoteInlineImages = "never"; SOGoMailAutoSave = "5"; diff --git a/SoObjects/SOGo/SOGoUserDefaults.h b/SoObjects/SOGo/SOGoUserDefaults.h index 69ebb8d15..078bc4ca4 100644 --- a/SoObjects/SOGo/SOGoUserDefaults.h +++ b/SoObjects/SOGo/SOGoUserDefaults.h @@ -132,6 +132,9 @@ extern NSString *SOGoWeekStartFirstFullWeek; - (void) setMailComposeMessageType: (NSString *) newValue; - (NSString *) mailComposeMessageType; +- (void) setMailComposeFontSize: (NSString *) newValue; +- (NSString *) mailComposeFontSize; + - (void) setMailDisplayRemoteInlineImages: (NSString *) newValue; - (NSString *) mailDisplayRemoteInlineImages; diff --git a/SoObjects/SOGo/SOGoUserDefaults.m b/SoObjects/SOGo/SOGoUserDefaults.m index ea0578f5f..7adfdc3f0 100644 --- a/SoObjects/SOGo/SOGoUserDefaults.m +++ b/SoObjects/SOGo/SOGoUserDefaults.m @@ -539,6 +539,16 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek"; return [self stringForKey: @"SOGoMailComposeMessageType"]; } +- (void) setMailComposeFontSize: (NSString *) newValue +{ + [self setObject: newValue forKey: @"SOGoMailComposeFontSize"]; +} + +- (NSString *) mailComposeFontSize +{ + return [self stringForKey: @"SOGoMailComposeFontSize"]; +} + - (void) setMailDisplayRemoteInlineImages: (NSString *) newValue { [self setObject: newValue forKey: @"SOGoMailDisplayRemoteInlineImages"]; diff --git a/UI/MailerUI/UIxMailEditor.m b/UI/MailerUI/UIxMailEditor.m index ec4260c44..28fba7853 100644 --- a/UI/MailerUI/UIxMailEditor.m +++ b/UI/MailerUI/UIxMailEditor.m @@ -629,9 +629,11 @@ static NSArray *infoKeys = nil; { NSDictionary *info; NSException *error; + NSString *fontSize, *content; NGMimeType *mimeType; WORequest *request; SOGoDraftObject *co; + SOGoUserDefaults *ud; error = nil; request = [context request]; @@ -649,7 +651,22 @@ static NSArray *infoKeys = nil; info = [self infoFromRequest]; [co setHeaders: info]; [co setIsHTML: isHTML]; - [co setText: (isHTML ? [NSString stringWithFormat: @"%@", text] : text)];; + if (isHTML) + { + // Set a base font size if mail is HTML and user has set a default font-size + ud = [[context activeUser] userDefaults]; + fontSize = [ud mailComposeFontSize]; + if ([fontSize intValue] > 0) + content = [NSString stringWithFormat: @"%@", + fontSize, text]; + else + content = [NSString stringWithFormat: @"%@", text]; + } + else + { + content = text; + } + [co setText: content]; error = [co storeInfo]; } diff --git a/UI/PreferencesUI/English.lproj/Localizable.strings b/UI/PreferencesUI/English.lproj/Localizable.strings index 69d577e20..c6a80de0b 100644 --- a/UI/PreferencesUI/English.lproj/Localizable.strings +++ b/UI/PreferencesUI/English.lproj/Localizable.strings @@ -142,6 +142,10 @@ "Compose messages in" = "Compose messages in"; "composemessagestype_html" = "HTML"; "composemessagestype_text" = "Plain text"; + +/* Base font size for messages composed in HTML */ +"Default font size" = "Default font size"; + "Display remote inline images" = "Display remote inline images"; "displayremoteinlineimages_never" = "Never"; "displayremoteinlineimages_always" = "Always"; diff --git a/UI/PreferencesUI/UIxJSONPreferences.m b/UI/PreferencesUI/UIxJSONPreferences.m index 67d405219..90fa62dea 100644 --- a/UI/PreferencesUI/UIxJSONPreferences.m +++ b/UI/PreferencesUI/UIxJSONPreferences.m @@ -174,6 +174,9 @@ static SoProduct *preferencesProduct = nil; if (![[defaults source] objectForKey: @"SOGoMailComposeMessageType"]) [[defaults source] setObject: [defaults mailComposeMessageType] forKey: @"SOGoMailComposeMessageType"]; + if (![[defaults source] objectForKey: @"SOGoMailComposeFontSize"]) + [[defaults source] setObject: [defaults mailComposeFontSize] forKey: @"SOGoMailComposeFontSize"]; + if (![[defaults source] objectForKey: @"SOGoMailDisplayRemoteInlineImages"]) [[defaults source] setObject: [defaults mailDisplayRemoteInlineImages] forKey: @"SOGoMailDisplayRemoteInlineImages"]; diff --git a/UI/PreferencesUI/UIxPreferences.m b/UI/PreferencesUI/UIxPreferences.m index d640fe4f2..d55b361f2 100644 --- a/UI/PreferencesUI/UIxPreferences.m +++ b/UI/PreferencesUI/UIxPreferences.m @@ -1172,6 +1172,27 @@ static NSArray *reminderValues = nil; : [self _defaultEmailAddresses]); } +// +// Used by templates +// +- (NSArray *) fontSizesList +{ + static NSArray *fontSizes = nil; + + if (!fontSizes) + { + fontSizes = [NSArray arrayWithObjects: @"8", @"9", @"10", @"11", @"12", @"13", @"14", @"16", @"18", + @"20", @"22", @"24", @"26", @"28", + @"36", + @"48", + @"72", + nil]; + [fontSizes retain]; + } + + return fontSizes; +} + // // Used by templates // diff --git a/UI/Templates/PreferencesUI/UIxPreferences.wox b/UI/Templates/PreferencesUI/UIxPreferences.wox index 886544db6..5c2fd3013 100644 --- a/UI/Templates/PreferencesUI/UIxPreferences.wox +++ b/UI/Templates/PreferencesUI/UIxPreferences.wox @@ -511,19 +511,18 @@ -