@ -228,7 +228,7 @@ class PreferencesViewController: ParentViewController {
[ placeholderLabel ] . forEach { $0 . isHidden = true }
messageLabel . stringValue = CLE mptyString
messageLabel . stringValue = UserDefaultKeys . e mptyString
timezoneTableView . registerForDraggedTypes ( [ . dragSession ] )
@ -238,7 +238,7 @@ class PreferencesViewController: ParentViewController {
setupColor ( )
startupCheckbox . integerValue = DataStore . shared ( ) . retrieve ( key : CLS tartAtLogin) as ? Int ? ? 0
startupCheckbox . integerValue = DataStore . shared ( ) . retrieve ( key : UserDefaultKeys . s tartAtLogin) as ? Int ? ? 0
searchField . bezelStyle = . roundedBezel
}
@ -249,7 +249,7 @@ class PreferencesViewController: ParentViewController {
startAtLoginLabel . textColor = Themer . shared ( ) . mainTextColor ( )
[ timezoneNameSortButton , labelSortButton , timezoneSortButton ] . forEach {
$0 ? . attributedTitle = NSAttributedString ( string : $0 ? . title ? ? CLE mptyString, attributes : [
$0 ? . attributedTitle = NSAttributedString ( string : $0 ? . title ? ? UserDefaultKeys . e mptyString, attributes : [
NSAttributedString . Key . foregroundColor : Themer . shared ( ) . mainTextColor ( ) ,
NSAttributedString . Key . font : NSFont ( name : " Avenir-Light " , size : 13 ) ! ,
] )
@ -360,10 +360,10 @@ extension PreferencesViewController: NSTableViewDataSource, NSTableViewDelegate
}
private func showAlertIfMoreThanOneTimezoneHasBeenAddedToTheMenubar ( ) {
let isUITestRunning = ProcessInfo . processInfo . arguments . contains ( CLUIT estingLaunchArgument)
let isUITestRunning = ProcessInfo . processInfo . arguments . contains ( UserDefaultKeys . t estingLaunchArgument)
// I f w e h a v e s e e n d i s p l a y e d t h e m e s s a g e b e f o r e , a b o r t !
let haveWeSeenThisMessageBefore = UserDefaults . standard . bool ( forKey : CLL ongStatusBarWarningMessage)
let haveWeSeenThisMessageBefore = UserDefaults . standard . bool ( forKey : UserDefaultKeys . l ongStatusBarWarningMessage)
if haveWeSeenThisMessageBefore , ! isUITestRunning {
return
@ -393,10 +393,10 @@ extension PreferencesViewController: NSTableViewDataSource, NSTableViewDelegate
if response . rawValue = = 1000 {
OperationQueue . main . addOperation {
UserDefaults . standard . set ( 0 , forKey : CLM enubarCompactMode)
UserDefaults . standard . set ( 0 , forKey : UserDefaultKeys . m enubarCompactMode)
if alert . suppressionButton ? . state = = NSControl . StateValue . on {
UserDefaults . standard . set ( true , forKey : CLL ongStatusBarWarningMessage)
UserDefaults . standard . set ( true , forKey : UserDefaultKeys . l ongStatusBarWarningMessage)
}
self . updateStatusBarAppearance ( )
@ -458,14 +458,14 @@ extension PreferencesViewController {
if searchResults . status = = ResultStatus . zeroResults {
Logger . info ( " Zero Results returned " )
self . findLocalSearchResultsForTimezones ( )
self . placeholderLabel . placeholderString = self . searchResultsDataSource . timezoneFilteredArray . isEmpty ? " No results! 😔 Try entering the exact name. " : CLE mptyString
self . placeholderLabel . placeholderString = self . searchResultsDataSource . timezoneFilteredArray . isEmpty ? " No results! 😔 Try entering the exact name. " : UserDefaultKeys . e mptyString
self . reloadSearchResults ( )
self . isActivityInProgress = false
return
} else if searchResults . status = = ResultStatus . requestDenied && searchResults . results . isEmpty {
Logger . info ( " Request denied! " )
self . findLocalSearchResultsForTimezones ( )
self . placeholderLabel . placeholderString = self . searchResultsDataSource . timezoneFilteredArray . isEmpty ? " Update Clocker to get a faster experience 😃 " : CLE mptyString
self . placeholderLabel . placeholderString = self . searchResultsDataSource . timezoneFilteredArray . isEmpty ? " Update Clocker to get a faster experience 😃 " : UserDefaultKeys . e mptyString
self . reloadSearchResults ( )
self . isActivityInProgress = false
return
@ -490,7 +490,7 @@ extension PreferencesViewController {
var searchString = searchField . stringValue
let words = searchString . components ( separatedBy : CharacterSet . whitespacesAndNewlines )
searchString = words . joined ( separator : CLE mptyString)
searchString = words . joined ( separator : UserDefaultKeys . e mptyString)
return " https://maps.googleapis.com/maps/api/geocode/json?address= \( searchString ) &key= \( geocodingKey ) &language= \( userPreferredLanguage ) "
}
@ -511,10 +511,10 @@ extension PreferencesViewController {
let totalPackage = [
" latitude " : latitude ,
" longitude " : longitude ,
CLT imezoneName: formattedAddress ,
CLC ustomLabel: formattedAddress ,
CLTimezoneID : CLE mptyString,
CLP laceIdentifier: $0 . placeId ,
UserDefaultKeys . t imezoneName: formattedAddress ,
UserDefaultKeys . c ustomLabel: formattedAddress ,
UserDefaultKeys . timezoneID : UserDefaultKeys . e mptyString,
UserDefaultKeys . p laceIdentifier: $0 . placeId ,
] as [ String : Any ]
finalResults . append ( TimezoneData ( with : totalPackage ) )
@ -523,7 +523,7 @@ extension PreferencesViewController {
}
private func prepareUIForPresentingResults ( ) {
placeholderLabel . placeholderString = CLE mptyString
placeholderLabel . placeholderString = UserDefaultKeys . e mptyString
isActivityInProgress = false
reloadSearchResults ( )
}
@ -541,7 +541,7 @@ extension PreferencesViewController {
}
isActivityInProgress = false
placeholderLabel . placeholderString = CLE mptyString
placeholderLabel . placeholderString = UserDefaultKeys . e mptyString
}
private func getTimezone ( for latitude : Double , and longitude : Double ) {
@ -600,13 +600,13 @@ extension PreferencesViewController {
}
let newTimeZone = [
CLT imezoneID: timezone . timeZoneId ,
CLT imezoneName: filteredAddress ,
CLP laceIdentifier: dataObject . placeID ! ,
UserDefaultKeys . t imezoneID: timezone . timeZoneId ,
UserDefaultKeys . t imezoneName: filteredAddress ,
UserDefaultKeys . p laceIdentifier: dataObject . placeID ! ,
" latitude " : dataObject . latitude ! ,
" longitude " : dataObject . longitude ! ,
" nextUpdate " : CLE mptyString,
CLC ustomLabel: filteredAddress ,
" nextUpdate " : UserDefaultKeys . e mptyString,
UserDefaultKeys . c ustomLabel: filteredAddress ,
] as [ String : Any ]
// M a r k i f t h e t i m e z o n e i s s a m e a s l o c a l t i m e z o n e
@ -658,7 +658,7 @@ extension PreferencesViewController {
refreshTimezoneTableView ( true )
refreshMainTable ( )
timezonePanel . close ( )
placeholderLabel . placeholderString = CLE mptyString
placeholderLabel . placeholderString = UserDefaultKeys . e mptyString
searchField . placeholderString = NSLocalizedString ( " Search Field Placeholder " ,
comment : " Search Field Placeholder " )
availableTimezoneTableView . isHidden = false
@ -723,7 +723,7 @@ extension PreferencesViewController {
}
if messageLabel . stringValue . isEmpty {
searchField . stringValue = CLE mptyString
searchField . stringValue = UserDefaultKeys . e mptyString
guard let latitude = dataObject . latitude , let longitude = dataObject . longitude else {
assertionFailure ( " Data was unexpectedly nil " )
@ -736,7 +736,7 @@ extension PreferencesViewController {
private func cleanupAfterInstallingTimezone ( ) {
let data = TimezoneData ( )
data . setLabel ( CLE mptyString)
data . setLabel ( UserDefaultKeys . e mptyString)
let currentSelection = searchResultsDataSource . retrieveSelectedTimezone ( availableTimezoneTableView . selectedRow )
@ -751,8 +751,8 @@ extension PreferencesViewController {
searchResultsDataSource . cleanupFilterArray ( )
searchResultsDataSource . timezoneFilteredArray = [ ]
placeholderLabel . placeholderString = CLE mptyString
searchField . stringValue = CLE mptyString
placeholderLabel . placeholderString = UserDefaultKeys . e mptyString
searchField . stringValue = UserDefaultKeys . e mptyString
reloadSearchResults ( )
refreshTimezoneTableView ( true )
@ -788,8 +788,8 @@ extension PreferencesViewController {
@IBAction func closePanel ( _ : NSButton ) {
searchResultsDataSource . cleanupFilterArray ( )
searchResultsDataSource . timezoneFilteredArray = [ ]
searchField . stringValue = CLE mptyString
placeholderLabel . placeholderString = CLE mptyString
searchField . stringValue = UserDefaultKeys . e mptyString
placeholderLabel . placeholderString = UserDefaultKeys . e mptyString
searchField . placeholderString = NSLocalizedString ( " Search Field Placeholder " ,
comment : " Search Field Placeholder " )