|
|
@ -3,9 +3,12 @@ |
|
|
|
import Cocoa |
|
|
|
import Cocoa |
|
|
|
|
|
|
|
|
|
|
|
struct PreferencesConstants { |
|
|
|
struct PreferencesConstants { |
|
|
|
static let noTimezoneSelectedErrorMessage = "Please select a timezone!" |
|
|
|
static let noTimezoneSelectedErrorMessage = NSLocalizedString("No Timezone Selected", |
|
|
|
static let maxTimezonesErrorMessage = "Maximum 100 timezones allowed!" |
|
|
|
comment: "Message shown when the user taps on Add without selecting a timezone") |
|
|
|
static let maxCharactersAllowed = "Only 50 characters allowed!" |
|
|
|
static let maxTimezonesErrorMessage = NSLocalizedString("Max Timezones Selected", |
|
|
|
|
|
|
|
comment: "Max Timezones Error Message") |
|
|
|
|
|
|
|
static let maxCharactersAllowed = NSLocalizedString("Max Search Characters Error Message", |
|
|
|
|
|
|
|
comment: "Max Character Count Allowed Error Message") |
|
|
|
static let noInternetConnectivityError = "You're offline, maybe?" |
|
|
|
static let noInternetConnectivityError = "You're offline, maybe?" |
|
|
|
static let tryAgainMessage = "Try again, maybe?" |
|
|
|
static let tryAgainMessage = "Try again, maybe?" |
|
|
|
static let offlineErrorMessage = "The Internet connection appears to be offline." |
|
|
|
static let offlineErrorMessage = "The Internet connection appears to be offline." |
|
|
@ -48,6 +51,7 @@ class PreferencesViewController: ParentViewController { |
|
|
|
@IBOutlet private var progressIndicator: NSProgressIndicator! |
|
|
|
@IBOutlet private var progressIndicator: NSProgressIndicator! |
|
|
|
@IBOutlet private var addButton: NSButton! |
|
|
|
@IBOutlet private var addButton: NSButton! |
|
|
|
@IBOutlet private var recorderControl: SRRecorderControl! |
|
|
|
@IBOutlet private var recorderControl: SRRecorderControl! |
|
|
|
|
|
|
|
@IBOutlet private var closeButton: NSButton! |
|
|
|
|
|
|
|
|
|
|
|
@IBOutlet private var timezoneSortButton: NSButton! |
|
|
|
@IBOutlet private var timezoneSortButton: NSButton! |
|
|
|
@IBOutlet private var timezoneNameSortButton: NSButton! |
|
|
|
@IBOutlet private var timezoneNameSortButton: NSButton! |
|
|
@ -122,11 +126,20 @@ class PreferencesViewController: ParentViewController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private func setupLocalizedText() { |
|
|
|
private func setupLocalizedText() { |
|
|
|
startAtLoginLabel.stringValue = NSLocalizedString("Start at Login", comment: "Start at Login") |
|
|
|
startAtLoginLabel.stringValue = NSLocalizedString("Start at Login", |
|
|
|
headerLabel.stringValue = NSLocalizedString("Selected Timezones", comment: "Start at Login") |
|
|
|
comment: "Start at Login") |
|
|
|
timezoneSortButton.title = NSLocalizedString("Sort by Time Difference", comment: "Start at Login") |
|
|
|
headerLabel.stringValue = NSLocalizedString("Selected Timezones", |
|
|
|
timezoneNameSortButton.title = NSLocalizedString("Sort by Name", comment: "Start at Login") |
|
|
|
comment: "Start at Login") |
|
|
|
labelSortButton.title = NSLocalizedString("Sort by Label", comment: "Start at Login") |
|
|
|
timezoneSortButton.title = NSLocalizedString("Sort by Time Difference", |
|
|
|
|
|
|
|
comment: "Start at Login") |
|
|
|
|
|
|
|
timezoneNameSortButton.title = NSLocalizedString("Sort by Name", |
|
|
|
|
|
|
|
comment: "Start at Login") |
|
|
|
|
|
|
|
labelSortButton.title = NSLocalizedString("Sort by Label", |
|
|
|
|
|
|
|
comment: "Start at Login") |
|
|
|
|
|
|
|
addButton.title = NSLocalizedString("Add Button Title", |
|
|
|
|
|
|
|
comment: "Button to add a location") |
|
|
|
|
|
|
|
closeButton.title = NSLocalizedString("Close Button Title", |
|
|
|
|
|
|
|
comment: "Button to close the panel") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@objc func refreshTimezoneTableView() { |
|
|
|
@objc func refreshTimezoneTableView() { |
|
|
@ -694,7 +707,8 @@ extension PreferencesViewController { |
|
|
|
|
|
|
|
|
|
|
|
private func setErrorPlaceholders() { |
|
|
|
private func setErrorPlaceholders() { |
|
|
|
placeholderLabel.placeholderString = "No timezone found! Try entering an exact name." |
|
|
|
placeholderLabel.placeholderString = "No timezone found! Try entering an exact name." |
|
|
|
searchField.placeholderString = "Enter a city, state or country name" |
|
|
|
searchField.placeholderString = NSLocalizedString("Search Field Placeholder", |
|
|
|
|
|
|
|
comment: "Search Field Placeholder") |
|
|
|
isActivityInProgress = false |
|
|
|
isActivityInProgress = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -705,7 +719,8 @@ extension PreferencesViewController { |
|
|
|
refreshMainTable() |
|
|
|
refreshMainTable() |
|
|
|
timezonePanel.close() |
|
|
|
timezonePanel.close() |
|
|
|
placeholderLabel.placeholderString = CLEmptyString |
|
|
|
placeholderLabel.placeholderString = CLEmptyString |
|
|
|
searchField.placeholderString = "Enter a city, state or country name" |
|
|
|
searchField.placeholderString = NSLocalizedString("Search Field Placeholder", |
|
|
|
|
|
|
|
comment: "Search Field Placeholder") |
|
|
|
availableTimezoneTableView.isHidden = false |
|
|
|
availableTimezoneTableView.isHidden = false |
|
|
|
isActivityInProgress = false |
|
|
|
isActivityInProgress = false |
|
|
|
} |
|
|
|
} |
|
|
@ -824,7 +839,8 @@ extension PreferencesViewController { |
|
|
|
refreshMainTable() |
|
|
|
refreshMainTable() |
|
|
|
|
|
|
|
|
|
|
|
timezonePanel.close() |
|
|
|
timezonePanel.close() |
|
|
|
searchField.placeholderString = "Enter a city, state or country name" |
|
|
|
searchField.placeholderString = NSLocalizedString("Search Field Placeholder", |
|
|
|
|
|
|
|
comment: "Search Field Placeholder") |
|
|
|
availableTimezoneTableView.isHidden = false |
|
|
|
availableTimezoneTableView.isHidden = false |
|
|
|
isActivityInProgress = false |
|
|
|
isActivityInProgress = false |
|
|
|
} |
|
|
|
} |
|
|
@ -844,7 +860,8 @@ extension PreferencesViewController { |
|
|
|
searchResultsDataSource.timezoneFilteredArray = [] |
|
|
|
searchResultsDataSource.timezoneFilteredArray = [] |
|
|
|
searchField.stringValue = CLEmptyString |
|
|
|
searchField.stringValue = CLEmptyString |
|
|
|
placeholderLabel.placeholderString = CLEmptyString |
|
|
|
placeholderLabel.placeholderString = CLEmptyString |
|
|
|
searchField.placeholderString = "Enter a city, state or country name" |
|
|
|
searchField.placeholderString = NSLocalizedString("Search Field Placeholder", |
|
|
|
|
|
|
|
comment: "Search Field Placeholder") |
|
|
|
|
|
|
|
|
|
|
|
reloadSearchResults() |
|
|
|
reloadSearchResults() |
|
|
|
|
|
|
|
|
|
|
|