From 48f776daf0d3877250cd52333b78a3b7ef1429d6 Mon Sep 17 00:00:00 2001 From: Alexander Yuzhin Date: Mon, 26 Jun 2017 17:50:14 +0300 Subject: [PATCH 1/2] [macOS] Prepare update 4.3.1 --- macos/ONLYOFFICE.xcodeproj/project.pbxproj | 3 +- macos/ONLYOFFICE/AppDelegate.mm | 22 ++++++++------- .../Code/Controllers/ASCTitleBarController.m | 6 ++-- .../Resources/ONLYOFFICE/Info.plist | 28 +++++++++++++++++-- 4 files changed, 42 insertions(+), 17 deletions(-) diff --git a/macos/ONLYOFFICE.xcodeproj/project.pbxproj b/macos/ONLYOFFICE.xcodeproj/project.pbxproj index 0b8ed6a82..0b8900007 100644 --- a/macos/ONLYOFFICE.xcodeproj/project.pbxproj +++ b/macos/ONLYOFFICE.xcodeproj/project.pbxproj @@ -1694,9 +1694,10 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "Developer ID Application"; + CODE_SIGN_IDENTITY = "Mac Developer"; "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer: Alexander Yuzhin (48KSML6N7L)"; COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = 6YRY82J794; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/../../core/build/cef/mac", diff --git a/macos/ONLYOFFICE/AppDelegate.mm b/macos/ONLYOFFICE/AppDelegate.mm index b396b0f86..858561590 100644 --- a/macos/ONLYOFFICE/AppDelegate.mm +++ b/macos/ONLYOFFICE/AppDelegate.mm @@ -96,16 +96,18 @@ } - (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames { - for (NSString * filePath in filenames) { - [[NSNotificationCenter defaultCenter] postNotificationName:CEFEventNameCreateTab - object:nil - userInfo:@{ - @"action" : @(ASCTabActionOpenLocalFile), - @"path" : filePath, - @"active" : @(YES), - @"external": @(YES) - }]; - } + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ + for (NSString * filePath in filenames) { + [[NSNotificationCenter defaultCenter] postNotificationName:CEFEventNameCreateTab + object:nil + userInfo:@{ + @"action" : @(ASCTabActionOpenLocalFile), + @"path" : filePath, + @"active" : @(YES), + @"external": @(YES) + }]; + } + }); } - (void)applicationWillTerminate:(NSNotification *)aNotification { diff --git a/macos/ONLYOFFICE/Code/Controllers/ASCTitleBarController.m b/macos/ONLYOFFICE/Code/Controllers/ASCTitleBarController.m index a2f66eabe..916f57731 100644 --- a/macos/ONLYOFFICE/Code/Controllers/ASCTitleBarController.m +++ b/macos/ONLYOFFICE/Code/Controllers/ASCTitleBarController.m @@ -113,7 +113,7 @@ static float kASCWindowMinTitleWidth = 320; [self.titleLabel setStringValue:productName]; - kASCWindowDefaultTrafficButtonsLeftMargin = NSWidth(self.closeButton.frame) - 2; // OSX 10.11 magic + kASCWindowDefaultTrafficButtonsLeftMargin = NSWidth(self.closeButton.frame) - 2.0; // OSX 10.11 magic [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidResize:) @@ -183,8 +183,8 @@ static float kASCWindowMinTitleWidth = 320; void (^layoutStandartButtons)(NSArray *, BOOL) = ^ (NSArray *buttons, BOOL hidden) { [buttons enumerateObjectsUsingBlock:^(NSButton *button, NSUInteger idx, BOOL *stop) { NSRect frame = button.frame; - frame.origin.x = kASCWindowDefaultTrafficButtonsLeftMargin + idx * (NSWidth(frame) + 6); - frame.origin.y = (NSHeight(button.superview.frame) - NSHeight(button.frame)) / 2; + frame.origin.x = kASCWindowDefaultTrafficButtonsLeftMargin + idx * (NSWidth(frame) + 6.0); + frame.origin.y = (int)((NSHeight(button.superview.frame) - NSHeight(button.frame)) / 2.0); [button setFrame:frame]; [button setHidden:hidden]; diff --git a/macos/ONLYOFFICE/Resources/ONLYOFFICE/Info.plist b/macos/ONLYOFFICE/Resources/ONLYOFFICE/Info.plist index f6d11ab54..1e676adcb 100644 --- a/macos/ONLYOFFICE/Resources/ONLYOFFICE/Info.plist +++ b/macos/ONLYOFFICE/Resources/ONLYOFFICE/Info.plist @@ -8,7 +8,9 @@ CFBundleTypeExtensions - + + docx + CFBundleTypeIconFile file-docx CFBundleTypeName @@ -21,6 +23,10 @@ + CFBundleTypeExtensions + + rtf + CFBundleTypeIconFile file-rtf CFBundleTypeName @@ -33,6 +39,10 @@ + CFBundleTypeExtensions + + txt + CFBundleTypeIconFile file-txt CFBundleTypeName @@ -45,6 +55,10 @@ + CFBundleTypeExtensions + + pdf + CFBundleTypeIconFile file-pdf CFBundleTypeName @@ -57,6 +71,10 @@ + CFBundleTypeExtensions + + xlsx + CFBundleTypeIconFile file-xlsx CFBundleTypeName @@ -69,6 +87,10 @@ + CFBundleTypeExtensions + + pptx + CFBundleTypeIconFile file-pptx CFBundleTypeName @@ -238,11 +260,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 4.3 + 4.3.1 CFBundleSignature ???? CFBundleVersion - 153 + 161 LSApplicationCategoryType public.app-category.productivity LSMinimumSystemVersion From 322c6f97da4b1b3e2bca9c428927a01b84188c28 Mon Sep 17 00:00:00 2001 From: Oleg Korshul Date: Tue, 27 Jun 2017 17:20:00 +0300 Subject: [PATCH 2/2] linux compile --- win-linux/src/utils.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/win-linux/src/utils.cpp b/win-linux/src/utils.cpp index 58abc5e46..9ba462a53 100644 --- a/win-linux/src/utils.cpp +++ b/win-linux/src/utils.cpp @@ -261,6 +261,9 @@ QString Utils::encodeJson(const QString& s) unsigned Utils::getScreenDpiRatio(int scrnum) { +#ifdef __linux + double _k = _k = QApplication::primaryScreen()->logicalDotsPerInch() / 96.f; +#else UINT _dpi_x = 0, _dpi_y = 0; double _k; @@ -270,6 +273,7 @@ unsigned Utils::getScreenDpiRatio(int scrnum) } else { _k = QApplication::primaryScreen()->logicalDotsPerInch() / 96.f; } +#endif return !(_k < 1.5) ? 2 : 1; } @@ -295,7 +299,7 @@ unsigned Utils::getScreenDpiRatioByHWND(int hwnd) QByteArray Utils::getAppStylesheets(int scale) { - auto read_styles = [](QString& dir) { + auto read_styles = [](const QString& dir) { QByteArray _css; QFile file; QFileInfoList files = QDir(dir).entryInfoList(QStringList("*.qss"), QDir::Files);