diff --git a/installer/mac/SymphonySettingsPlugin.bundle/Contents/Info.plist b/installer/mac/SymphonySettingsPlugin.bundle/Contents/Info.plist index 8e2ff5de..cfd7f285 100644 --- a/installer/mac/SymphonySettingsPlugin.bundle/Contents/Info.plist +++ b/installer/mac/SymphonySettingsPlugin.bundle/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 16F73 + 17A405 CFBundleDevelopmentRegion en CFBundleExecutable @@ -27,17 +27,17 @@ DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - 8E3004b + 9A1004 DTPlatformVersion GM DTSDKBuild - 16E185 + 17A360 DTSDKName - macosx10.12 + macosx10.13 DTXcode - 0833 + 0901 DTXcodeBuild - 8E3004b + 9A1004 InstallerSectionTitle Pod Settings NSHumanReadableCopyright diff --git a/installer/mac/SymphonySettingsPlugin.bundle/Contents/MacOS/SymphonySettingsPlugin b/installer/mac/SymphonySettingsPlugin.bundle/Contents/MacOS/SymphonySettingsPlugin index 74ea7b0f..985b3ae5 100755 Binary files a/installer/mac/SymphonySettingsPlugin.bundle/Contents/MacOS/SymphonySettingsPlugin and b/installer/mac/SymphonySettingsPlugin.bundle/Contents/MacOS/SymphonySettingsPlugin differ diff --git a/installer/mac/SymphonySettingsPlugin.bundle/Contents/Resources/Base.lproj/MyInstallerPane.nib b/installer/mac/SymphonySettingsPlugin.bundle/Contents/Resources/Base.lproj/MyInstallerPane.nib index 8cf8a269..101e6104 100644 Binary files a/installer/mac/SymphonySettingsPlugin.bundle/Contents/Resources/Base.lproj/MyInstallerPane.nib and b/installer/mac/SymphonySettingsPlugin.bundle/Contents/Resources/Base.lproj/MyInstallerPane.nib differ diff --git a/installer/mac/SymphonySettingsPlugin.bundle/Contents/_CodeSignature/CodeResources b/installer/mac/SymphonySettingsPlugin.bundle/Contents/_CodeSignature/CodeResources index ba1cea80..14bffccb 100644 --- a/installer/mac/SymphonySettingsPlugin.bundle/Contents/_CodeSignature/CodeResources +++ b/installer/mac/SymphonySettingsPlugin.bundle/Contents/_CodeSignature/CodeResources @@ -6,7 +6,7 @@ Resources/Base.lproj/MyInstallerPane.nib - 5MlJroM8UDQ/u/OkMCiK9J3aK/o= + TF/AqkGdS25ttnHMS1l76ES81/w= Resources/InstallerSections.plist @@ -37,11 +37,11 @@ hash - 5MlJroM8UDQ/u/OkMCiK9J3aK/o= + TF/AqkGdS25ttnHMS1l76ES81/w= hash2 - KL0ObYrvW43xgEFaDXdRTINfN6qOdiK1EqrvpTusCao= + gxXMI4SoTYE7jYkP5QJ7i804TUXR4x8LGSh99n9qers= Resources/InstallerSections.plist diff --git a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/project.pbxproj b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/project.pbxproj index ff898633..715569dd 100644 --- a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/project.pbxproj +++ b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/project.pbxproj @@ -92,7 +92,7 @@ 3A10EBC71ED4336D0083702F /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0830; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = Symphony; TargetAttributes = { 3A10EBCE1ED4336D0083702F = { @@ -183,7 +183,9 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; @@ -191,7 +193,11 @@ CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -231,7 +237,9 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; @@ -239,7 +247,11 @@ CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; diff --git a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/xcuserdata/vishwas.xcuserdatad/xcschemes/SymphonySettingsPlugin.xcscheme b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/xcuserdata/vishwas.xcuserdatad/xcschemes/SymphonySettingsPlugin.xcscheme index 560399f6..3529329e 100644 --- a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/xcuserdata/vishwas.xcuserdatad/xcschemes/SymphonySettingsPlugin.xcscheme +++ b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin.xcodeproj/xcuserdata/vishwas.xcuserdatad/xcschemes/SymphonySettingsPlugin.xcscheme @@ -1,6 +1,6 @@ @@ -36,6 +37,7 @@ buildConfiguration = "Release" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/Base.lproj/MyInstallerPane.xib b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/Base.lproj/MyInstallerPane.xib index 1bd2a139..dda34595 100644 --- a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/Base.lproj/MyInstallerPane.xib +++ b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/Base.lproj/MyInstallerPane.xib @@ -1,14 +1,15 @@ - + - + + @@ -20,6 +21,7 @@ + @@ -27,7 +29,7 @@ - + @@ -36,8 +38,8 @@ - - + + @@ -45,8 +47,8 @@ - - + + @@ -55,7 +57,7 @@ - - + + - + - - + + @@ -89,13 +91,22 @@ + + + + + + + + + diff --git a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/MyInstallerPane.h b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/MyInstallerPane.h index ef72d5d0..16de5579 100644 --- a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/MyInstallerPane.h +++ b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/MyInstallerPane.h @@ -7,11 +7,12 @@ #import -@interface MyInstallerPane : InstallerPane +@interface MyInstallerPane : InstallerPane @property (weak) IBOutlet NSButton *minimizeOnCloseCheckBox; @property (weak) IBOutlet NSButton *autoLaunchCheckBox; @property (weak) IBOutlet NSTextField *podUrlTextBox; @property (weak) IBOutlet NSButton *alwaysOnTopCheckBox; +@property (weak) IBOutlet NSTextField *podUrlAlertTextBox; @end diff --git a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/MyInstallerPane.m b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/MyInstallerPane.m index d7dc6086..4666d7c2 100644 --- a/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/MyInstallerPane.m +++ b/installer/mac/SymphonySettingsPlugin/SymphonySettingsPlugin/MyInstallerPane.m @@ -14,21 +14,40 @@ return [[NSBundle bundleForClass:[self class]] localizedStringForKey:@"PaneTitle" value:nil table:nil]; } -- (void)willExitPane:(InstallerSectionDirection)dir { - - // Set the default protocol to https - NSString *protocol = @"https://"; +- (void)willEnterPane:(InstallerSectionDirection)dir { + // By default, set the value of the error message textbox to an empty string + [_podUrlAlertTextBox setTitleWithMnemonic:@""]; +} + +- (BOOL)shouldExitPane:(InstallerSectionDirection)dir { NSString *podUrl = [_podUrlTextBox stringValue]; - // If the pod url is empty, by default, set it to my.symphony.com - if ([podUrl length] == 0) { - podUrl = @"my.symphony.com"; + // Check if the url contains a protocol, if not, prepend https to it + NSString *prefix = @"https://"; + if (![podUrl hasPrefix:prefix]) { + podUrl = [prefix stringByAppendingString:podUrl]; + [_podUrlTextBox setStringValue:podUrl]; } - // Create the final url - NSString *finalUrl = [protocol stringByAppendingString: podUrl]; + // Now, validate the url against a url regex + NSString *regex = @"^((?:http:\/\/)|(?:https:\/\/))(www.)?((?:[a-zA-Z0-9]+\.[a-z]{3})|(?:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(?::\d+)?))([\/a-zA-Z0-9\.]*)$"; + NSPredicate *podUrlTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex]; + if ([podUrlTest evaluateWithObject:podUrl]) { + return YES; + } + // In case of an invalid url, display the message under the pod url text box + // and don't go to the next screen, hence return NO + [_podUrlAlertTextBox setTitleWithMnemonic:@"Please enter a valid Pod url."]; + return NO; + +} + +- (void)willExitPane:(InstallerSectionDirection)dir { + + NSString *podUrl = [_podUrlTextBox stringValue]; + // By default, set autoLaunchOnStart to true NSString *autoLaunchOnStart = @"true"; @@ -52,7 +71,7 @@ } // Create an array with the selected options - NSArray *symSettings = [[NSArray alloc] initWithObjects:finalUrl, minimizeOnClose, autoLaunchOnStart, alwaysOnTop, nil]; + NSArray *symSettings = [[NSArray alloc] initWithObjects:podUrl, minimizeOnClose, autoLaunchOnStart, alwaysOnTop, nil]; // Create a string from the array with new-line as the separator NSString *symSettingsString = [symSettings componentsJoinedByString:@"\n"]; diff --git a/installer/mac/symphony-mac-packager.pkgproj b/installer/mac/symphony-mac-packager.pkgproj index 4132ea4d..dd617eda 100644 --- a/installer/mac/symphony-mac-packager.pkgproj +++ b/installer/mac/symphony-mac-packager.pkgproj @@ -432,6 +432,12 @@ PAYLOAD_TYPE 0 + SHOW_INVISIBLE + + SPLIT_FORKS + + TREAT_MISSING_FILES_AS_WARNING + VERSION 4 @@ -453,15 +459,27 @@ 1 CONCLUSION_ACTION 0 + FOLLOW_SYMBOLIC_LINKS + IDENTIFIER com.symphony.symphony-desktop + LOCATION + 0 NAME Symphony OVERWRITE_PERMISSIONS + PAYLOAD_SIZE + -1 + RELOCATABLE + + USE_HFS+_COMPRESSION + VERSION 2.0.0 + TYPE + 0 UUID 91776F5A-09FA-4631-A17C-BE8B5C83AF81 @@ -499,7 +517,7 @@ 3 CUSTOM - 1 + SCALING 1 @@ -537,8 +555,6 @@ - INSTALLATION TYPE - 0 MODE 1 @@ -631,8 +647,6 @@ LICENSE - KEYWORDS - LOCALIZATIONS MODE @@ -665,10 +679,6 @@ LIST - POSTINSTALL_PATH - - PREINSTALL_PATH - RESOURCES ROOT_VOLUME_ONLY @@ -676,8 +686,6 @@ PROJECT_SETTINGS - ADVANCED_OPTIONS - BUILD_FORMAT 0 BUILD_PATH @@ -857,6 +865,10 @@ NAME Symphony + PAYLOAD_ONLY + + TREAT_MISSING_PRESENTATION_DOCUMENTS_AS_WARNING + SHARED_GLOBAL_DATA diff --git a/installer/win/Symphony-x64.aip b/installer/win/Symphony-x64.aip index 88f7bc46..291bcc4b 100644 --- a/installer/win/Symphony-x64.aip +++ b/installer/win/Symphony-x64.aip @@ -10,18 +10,23 @@ + + + + + - + @@ -63,6 +68,7 @@ + @@ -129,8 +135,8 @@ - - + + @@ -350,7 +356,6 @@ - @@ -366,6 +371,7 @@ + @@ -416,7 +422,30 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -429,6 +458,16 @@ + + + + + + + + + + @@ -450,20 +489,24 @@ - + - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -492,16 +535,21 @@ - + + + + + + @@ -552,6 +600,7 @@ + diff --git a/js/aboutApp/index.js b/js/aboutApp/index.js index 3181bb92..117f86a6 100644 --- a/js/aboutApp/index.js +++ b/js/aboutApp/index.js @@ -6,6 +6,7 @@ const path = require('path'); const fs = require('fs'); const log = require('../log.js'); const logLevels = require('../enums/logLevels.js'); +const buildNumber = require('../../package.json').buildNumber; let aboutWindow; @@ -78,6 +79,10 @@ function openAboutWindow(windowName) { aboutWindow.show(); }); + aboutWindow.webContents.on('did-finish-load', () => { + aboutWindow.webContents.send('buildNumber', buildNumber || '0'); + }); + aboutWindow.on('close', () => { destroyWindow(); }); diff --git a/js/aboutApp/renderer.js b/js/aboutApp/renderer.js index 808c4337..dcb35981 100644 --- a/js/aboutApp/renderer.js +++ b/js/aboutApp/renderer.js @@ -1,5 +1,5 @@ 'use strict'; -const { remote } = require('electron'); +const { remote, ipcRenderer } = require('electron'); renderDom(); @@ -9,13 +9,19 @@ renderDom(); function renderDom() { document.addEventListener('DOMContentLoaded', function () { const applicationName = remote.app.getName() || 'Symphony'; - const version = remote.app.getVersion(); let appName = document.getElementById('app-name'); - let versionText = document.getElementById('version'); let copyright = document.getElementById('copyright'); appName.innerHTML = applicationName; - versionText.innerHTML = version ? `Version ${version} (${version})` : null; copyright.innerHTML = `Copyright © ${new Date().getFullYear()} ${applicationName}` }); } + +ipcRenderer.on('buildNumber', (event, buildNumber) => { + let versionText = document.getElementById('version'); + const version = remote.app.getVersion(); + + if (versionText) { + versionText.innerHTML = version ? `Version ${version} (${version}.${buildNumber})` : 'N/A'; + } +}); \ No newline at end of file diff --git a/js/config.js b/js/config.js index ba92566f..36a75e8d 100644 --- a/js/config.js +++ b/js/config.js @@ -6,6 +6,8 @@ const path = require('path'); const fs = require('fs'); const AppDirectory = require('appdirectory'); const omit = require('lodash.omit'); +const pick = require('lodash.pick'); +const difference = require('lodash.difference'); const isDevEnv = require('./utils/misc.js').isDevEnv; const isMac = require('./utils/misc.js').isMac; @@ -314,6 +316,64 @@ function updateUserConfigMac() { }); } +/** + * Method that tries to grab multiple config field from user config + * if field doesn't exist tries reading from global config + * + * @param {Array} fieldNames - array of config filed names + * @returns {Promise} - object all the config data from user and global config + */ +function getMultipleConfigField(fieldNames) { + return new Promise((resolve, reject) => { + let userConfigData; + + if (!fieldNames && fieldNames.length < 0) { + reject('cannot read config file, invalid fields'); + return; + } + + // reads user config data + readUserConfig().then((config) => { + userConfigData = pick(config, fieldNames); + let userConfigKeys = userConfigData ? Object.keys(userConfigData) : undefined; + + /** + * Condition to validate data from user config, + * if all the required fields are not present + * this tries to fetch the remaining fields from global config + */ + if (!userConfigKeys || userConfigKeys.length < fieldNames.length) { + + // remainingConfig - config field that are not present in the user config + let remainingConfig = difference(fieldNames, userConfigKeys); + + if (remainingConfig && Object.keys(remainingConfig).length > 0) { + readGlobalConfig().then((globalConfigData) => { + // assigns the remaining fields from global config to the user config + userConfigData = Object.assign(userConfigData, pick(globalConfigData, remainingConfig)); + resolve(userConfigData); + }).catch((err) => { + reject(err); + }); + } + + } else { + resolve(userConfigData); + } + }).catch(() => { + // This reads global config if there was any + // error while reading user config + readGlobalConfig().then((config) => { + userConfigData = pick(config, fieldNames); + resolve(userConfigData); + }).catch((err) => { + reject(err); + }); + }); + }); +} + + /** * Clears the cached config */ @@ -331,6 +391,7 @@ module.exports = { updateConfigField, updateUserConfigWin, updateUserConfigMac, + getMultipleConfigField, // items below here are only exported for testing, do NOT use! saveUserConfig, diff --git a/js/main.js b/js/main.js index 80963a16..752ac5c4 100644 --- a/js/main.js +++ b/js/main.js @@ -11,6 +11,7 @@ const urlParser = require('url'); // Local Dependencies const {getConfigField, updateUserConfigWin, updateUserConfigMac} = require('./config.js'); +const {setCheckboxValues} = require('./menus/menuTemplate.js'); const { isMac, isDevEnv } = require('./utils/misc.js'); const protocolHandler = require('./protocolHandler'); const getCmdLineArg = require('./utils/getCmdLineArg.js'); @@ -92,7 +93,7 @@ if (isMac) { * initialization and is ready to create browser windows. * Some APIs can only be used after this event occurs. */ -app.on('ready', setupThenOpenMainWindow); +app.on('ready', readConfigThenOpenMainWindow); /** * Is triggered when all the windows are closed @@ -127,6 +128,20 @@ app.on('open-url', function(event, url) { handleProtocolAction(url); }); +/** + * Reads the config fields that are required for the menu items + * then opens the main window + * + * This is a workaround for the issue where the menu template was returned + * even before the config data was populated + * https://perzoinc.atlassian.net/browse/ELECTRON-154 + */ +function readConfigThenOpenMainWindow() { + setCheckboxValues() + .then(setupThenOpenMainWindow) + .catch(setupThenOpenMainWindow) +} + /** * Sets up the app (to handle various things like config changes, protocol handling etc.) * and opens the main window diff --git a/js/menus/menuTemplate.js b/js/menus/menuTemplate.js index ab822603..1010426a 100644 --- a/js/menus/menuTemplate.js +++ b/js/menus/menuTemplate.js @@ -1,7 +1,7 @@ 'use strict'; const electron = require('electron'); -const { getConfigField, updateConfigField } = require('../config.js'); +const { updateConfigField, getMultipleConfigField } = require('../config.js'); const AutoLaunch = require('auto-launch'); const isMac = require('../utils/misc.js').isMac; const log = require('../log.js'); @@ -13,8 +13,6 @@ let minimizeOnClose = false; let launchOnStartup = false; let isAlwaysOnTop = false; -setCheckboxValues(); - let symphonyAutoLauncher; if (isMac) { @@ -266,39 +264,42 @@ function getTemplate(app) { * based on configuration */ function setCheckboxValues() { - getConfigField('minimizeOnClose').then(function(mClose) { - minimizeOnClose = mClose; - }).catch(function(err) { - let title = 'Error loading configuration'; - log.send(logLevels.ERROR, 'MenuTemplate: error getting config field minimizeOnClose, error: ' + err); - electron.dialog.showErrorBox(title, title + ': ' + err); + return new Promise((resolve) => { + /** + * Method that reads multiple config fields + */ + getMultipleConfigField(['minimizeOnClose', 'launchOnStartup', 'alwaysOnTop', 'notificationSettings']) + .then(function (configData) { + for (let key in configData) { + if (configData.hasOwnProperty(key)) { // eslint-disable-line no-prototype-builtins + switch (key) { + case 'minimizeOnClose': + minimizeOnClose = configData[key]; + break; + case 'launchOnStartup': + launchOnStartup = configData[key]; + break; + case 'alwaysOnTop': + isAlwaysOnTop = configData[key]; + eventEmitter.emit('isAlwaysOnTop', configData[key]); + break; + case 'notificationSettings': + eventEmitter.emit('notificationSettings', configData[key]); + break; + default: + break; + } + } + } + return resolve(); + }) + .catch((err) => { + let title = 'Error loading configuration'; + log.send(logLevels.ERROR, 'MenuTemplate: error reading configuration fields, error: ' + err); + electron.dialog.showErrorBox(title, title + ': ' + err); + return resolve(); + }); }); - - getConfigField('launchOnStartup').then(function(lStartup) { - launchOnStartup = lStartup; - }).catch(function(err) { - let title = 'Error loading configuration'; - log.send(logLevels.ERROR, 'MenuTemplate: error getting config field launchOnStartup, error: ' + err); - electron.dialog.showErrorBox(title, title + ': ' + err); - }); - - getConfigField('alwaysOnTop').then(function(mAlwaysOnTop) { - isAlwaysOnTop = mAlwaysOnTop; - eventEmitter.emit('isAlwaysOnTop', isAlwaysOnTop); - }).catch(function(err) { - let title = 'Error loading configuration'; - log.send(logLevels.ERROR, 'MenuTemplate: error getting config field alwaysOnTop, error: ' + err); - electron.dialog.showErrorBox(title, title + ': ' + err); - }); - - getConfigField('notificationSettings').then(function(notfObject) { - eventEmitter.emit('notificationSettings', notfObject); - }).catch(function(err) { - let title = 'Error loading configuration'; - log.send(logLevels.ERROR, 'MenuTemplate: error getting config field notificationSettings, error: ' + err); - electron.dialog.showErrorBox(title, title + ': ' + err); - }); - } function getMinimizeOnClose() { @@ -307,5 +308,6 @@ function getMinimizeOnClose() { module.exports = { getTemplate: getTemplate, - getMinimizeOnClose: getMinimizeOnClose + getMinimizeOnClose: getMinimizeOnClose, + setCheckboxValues: setCheckboxValues }; \ No newline at end of file diff --git a/js/windowMgr.js b/js/windowMgr.js index 9e7cd6a8..6999ef01 100644 --- a/js/windowMgr.js +++ b/js/windowMgr.js @@ -40,7 +40,11 @@ let sandboxed = false; const preloadMainScript = path.join(__dirname, 'preload/_preloadMain.js'); const MIN_WIDTH = 300; -const MIN_HEIGHT = 600; +const MIN_HEIGHT = 300; + +// Default window size for pop-out windows +const DEFAULT_WIDTH = 300; +const DEFAULT_HEIGHT = 600; /** * Adds a window key @@ -293,8 +297,8 @@ function doCreateMainWindow(initialUrl, initialBounds) { let x = 0; let y = 0; - let width = newWinOptions.width || MIN_WIDTH; - let height = newWinOptions.height || MIN_HEIGHT; + let width = newWinOptions.width || DEFAULT_WIDTH; + let height = newWinOptions.height || DEFAULT_HEIGHT; // try getting x and y position from query parameters let query = newWinParsedUrl && querystring.parse(newWinParsedUrl.query); @@ -323,8 +327,8 @@ function doCreateMainWindow(initialUrl, initialBounds) { /* eslint-disable no-param-reassign */ newWinOptions.x = x; newWinOptions.y = y; - newWinOptions.width = Math.max(width, MIN_WIDTH); - newWinOptions.height = Math.max(height, MIN_HEIGHT); + newWinOptions.width = Math.max(width, DEFAULT_WIDTH); + newWinOptions.height = Math.max(height, DEFAULT_HEIGHT); newWinOptions.minWidth = MIN_WIDTH; newWinOptions.minHeight = MIN_HEIGHT; newWinOptions.alwaysOnTop = alwaysOnTop; diff --git a/package.json b/package.json index 42cd9b1b..dd32d22b 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "Symphony", "productName": "Symphony", "version": "2.0.0", + "buildNumber": "", "description": "Symphony desktop app (Foundation ODP)", "author": "Symphony", "main": "js/main.js", @@ -104,6 +105,8 @@ "filesize": "^3.5.10", "keymirror": "0.1.1", "lodash.omit": "^4.5.0", + "lodash.pick": "^4.4.0", + "lodash.difference": "^4.5.0", "winreg": "^1.2.3" }, "optionalDependencies": {