diff --git a/CloverApp/Clover/Extensions.swift b/CloverApp/Clover/Extensions.swift index 62430bb2d1..06aec65db2 100644 --- a/CloverApp/Clover/Extensions.swift +++ b/CloverApp/Clover/Extensions.swift @@ -33,7 +33,9 @@ extension String { /// - returns: A quoted string for nvram var nvramString: String { - return "'\(self)'" + get { + return "'\(self)'" + } } @@ -44,7 +46,9 @@ extension String { /// - returns: only digits contained from the given string var keepNumericsOnly: String { - return self.components(separatedBy: CharacterSet(charactersIn: "0123456789").inverted).joined(separator: "") + get { + return self.components(separatedBy: CharacterSet(charactersIn: "0123456789").inverted).joined(separator: "") + } } //: ### Base64 encoding a string @@ -84,19 +88,27 @@ extension String { } var lastPath: String { - return (self as NSString).lastPathComponent + get { + return (self as NSString).lastPathComponent + } } var fileExtension: String { - return (self as NSString).pathExtension + get { + return (self as NSString).pathExtension + } } var deletingLastPath: String { - return (self as NSString).deletingLastPathComponent + get { + return (self as NSString).deletingLastPathComponent + } } var deletingFileExtension: String { - return (self as NSString).deletingPathExtension + get { + return (self as NSString).deletingPathExtension + } } var componentsPath: [String] { @@ -209,38 +221,48 @@ extension String { extension NSNumber { var hexString: String { - if (self.intValue > 0xFFFF) { - return String(format: "0x%08llx", self.intValue) - } else { - return String(format: "0x%04llx", self.intValue) + get { + if (self.intValue > 0xFFFF) { + return String(format: "0x%08llx", self.intValue) + } else { + return String(format: "0x%04llx", self.intValue) + } } } } extension Int { var data: Data { - var num = self - return Data(bytes: &num, count: MemoryLayout.size) + get { + var num = self + return Data(bytes: &num, count: MemoryLayout.size) + } } } extension UInt8 { var data: Data { - var num = self - return Data(bytes: &num, count: MemoryLayout.size) + get { + var num = self + return Data(bytes: &num, count: MemoryLayout.size) + } } } extension UInt16 { var data: Data { - var num = self - return Data(bytes: &num, count: MemoryLayout.size) + get { + var num = self + return Data(bytes: &num, count: MemoryLayout.size) + } } } extension UInt32 { var data: Data { - var num = self - return Data(bytes: &num, count: MemoryLayout.size) + get { + var num = self + return Data(bytes: &num, count: MemoryLayout.size) + } } } @@ -255,12 +277,14 @@ extension Data { } var sha1: String { - var h = [UInt8](repeating: 0, count: Int(CC_SHA1_DIGEST_LENGTH)) - - self.withUnsafeBytes { - _ = CC_SHA1($0.baseAddress, CC_LONG(self.count), &h) + get { + var h = [UInt8](repeating: 0, count: Int(CC_SHA1_DIGEST_LENGTH)) + + self.withUnsafeBytes { + _ = CC_SHA1($0.baseAddress, CC_LONG(self.count), &h) + } + return Data(h).hexadecimal() } - return Data(h).hexadecimal() } func castToCPointer() -> T { @@ -318,7 +342,6 @@ extension URL { /// Set extended attribute. func setExtendedAttribute(data: Data, forName name: String) throws { - try self.withUnsafeFileSystemRepresentation { fileSystemPath in let result = data.withUnsafeBytes { setxattr(fileSystemPath, name, $0.baseAddress, data.count, 0, 0) @@ -395,7 +418,11 @@ extension io_object_t { } extension NSBitmapImageRep { - var png: Data? { representation(using: .png, properties: [:]) } + var png: Data? { + get { + representation(using: .png, properties: [:]) + } + } } extension NSView { diff --git a/CloverApp/Clover/ThemeManager/ThemeManagerVC.swift b/CloverApp/Clover/ThemeManager/ThemeManagerVC.swift index 81e3a728d8..7460d59166 100644 --- a/CloverApp/Clover/ThemeManager/ThemeManagerVC.swift +++ b/CloverApp/Clover/ThemeManager/ThemeManagerVC.swift @@ -67,7 +67,7 @@ NSComboBoxDataSource { } self.loaded = true - + self.view.window?.title = self.view.window!.title.locale let settingVC = AppSD.settingsWC?.contentViewController as? SettingsViewController settingVC?.themeUserCBox.isEnabled = false @@ -341,6 +341,7 @@ NSComboBoxDataSource { } func showIndexing() { + self.webView.drawsBackground = true // https://www.w3schools.com/howto/howto_css_loader.asp self.webView.mainFrame.loadHTMLString(""" @@ -578,6 +579,7 @@ NSComboBoxDataSource { } func tableViewSelectionDidChange(_ notification: Notification) { + self.webView.drawsBackground = false if self.isBusy { NSSound.beep() return diff --git a/buildme b/buildme index e1b1648662..d5fd8022d8 100755 --- a/buildme +++ b/buildme @@ -351,7 +351,11 @@ do break ;; "quit") - osascript -e 'tell application "Terminal" to close first window' & exit + if [[ "$SYSNAME" == Darwin ]]; then + osascript -e 'tell application "Terminal" to close first window' & exit + else + exit 0 + fi ;; *) echo "invalid option $REPLY"