mirror of
https://github.com/munki/munki.git
synced 2026-04-28 16:29:29 -05:00
Update MSC.app to Swift 5 syntax (minor changes)
This commit is contained in:
@@ -324,6 +324,7 @@
|
||||
};
|
||||
C04F827A20BB319B00F9C57D = {
|
||||
CreatedOnToolsVersion = 9.2;
|
||||
LastSwiftMigration = 1150;
|
||||
ProvisioningStyle = Manual;
|
||||
SystemCapabilities = {
|
||||
com.apple.Sandbox = {
|
||||
@@ -708,7 +709,7 @@
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.googlecode.munki.ManagedSoftwareCenter;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_VERSION = 4.0;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -727,7 +728,7 @@
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.googlecode.munki.ManagedSoftwareCenter;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_VERSION = 4.0;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
||||
+1
-1
@@ -189,7 +189,7 @@ class MSCAlertController: NSObject {
|
||||
timers.append(timer3)
|
||||
// wait 10 seconds, then quit
|
||||
let timer4 = Timer.scheduledTimer(timeInterval: 10.0,
|
||||
target: NSApp,
|
||||
target: NSApp as Any,
|
||||
selector: #selector(NSApp.terminate),
|
||||
userInfo: self,
|
||||
repeats: false)
|
||||
|
||||
+1
-1
@@ -97,7 +97,7 @@ class MSCPasswordAlertController: NSObject {
|
||||
shakeAnimation.path = shakePath
|
||||
shakeAnimation.duration = durationOfShake
|
||||
|
||||
let frameOriginKey = NSAnimatablePropertyKey(rawValue: "frameOrigin")
|
||||
let frameOriginKey = "frameOrigin"
|
||||
the_window.animations = [frameOriginKey: shakeAnimation]
|
||||
the_window.animator().setFrameOrigin(frame.origin)
|
||||
}
|
||||
|
||||
+1
-1
@@ -760,7 +760,7 @@ class MainWindowController: NSWindowController, NSWindowDelegate, WKNavigationDe
|
||||
// Display the update count as a badge in the window toolbar
|
||||
// and as an icon badge in the Dock
|
||||
let updateCount = getUpdateCount()
|
||||
let btn_image = MSCBadgedTemplateImage.image(named: NSImage.Name(rawValue: "updatesTemplate.pdf"),
|
||||
let btn_image = MSCBadgedTemplateImage.image(named: "updatesTemplate.pdf",
|
||||
withCount: updateCount)
|
||||
updateButtonCell.image = btn_image
|
||||
if updateCount > 0 {
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ class MSCBadgedTemplateImage: NSImage {
|
||||
traits: .boldFontMask,
|
||||
weight: 0,
|
||||
size: badgeFontSize)
|
||||
let stringAttributes = [ NSAttributedStringKey.font: badgeFont as Any ]
|
||||
let stringAttributes = [ NSAttributedString.Key.font: badgeFont as Any ]
|
||||
let textSize = badgeString.size(withAttributes: stringAttributes)
|
||||
|
||||
// use textSize as the basis for the badge outline rect
|
||||
|
||||
Reference in New Issue
Block a user