@ -50,16 +50,20 @@ class PermissionsViewController: ParentViewController {
}
}
private func setupLocalizedText ( ) {
private func setupLocalizedText ( ) {
headerLabel . stringValue = " Permissions "
headerLabel . stringValue = NSLocalizedString ( " Permissions " , comment : " Permissions Tab Titles " )
reminderHeaderLabel . stringValue = " Reminders Access "
reminderHeaderLabel . stringValue = NSLocalizedString ( " Reminders Access " ,
reminderDetailLabel . stringValue = " Set reminders in the timezone of the location of your choice. Your reminders are stored in the default Reminders app. "
comment : " Reminders Permission Title " )
reminderDetailLabel . stringValue = NSLocalizedString ( " Reminders Detail " ,
comment : " Reminders Detail Text " )
calendarHeaderLabel . stringValue = " Calendar Access "
calendarHeaderLabel . stringValue = NSLocalizedString ( " Calendar Access " ,
calendarDetailLabel . stringValue = " Upcoming events from your personal and shared calendars can be shown in the menubar and the panel. "
comment : " Calendar Permission Title " )
calendarDetailLabel . stringValue = NSLocalizedString ( " Calendar Detail " ,
privacyLabel . stringValue = " You can change this later in the Privacy section of the System Preferences. "
comment : " Calendar Detail Text " )
privacyLabel . stringValue = NSLocalizedString ( " Privacy Text " ,
comment : " Text explaining options can be changed in the future through System Preferences " )
[ calendarHeaderLabel , calendarDetailLabel , privacyLabel , reminderDetailLabel , reminderHeaderLabel , headerLabel ] . forEach { $0 ? . textColor = Themer . shared ( ) . mainTextColor ( )
[ calendarHeaderLabel , calendarDetailLabel , privacyLabel , reminderDetailLabel , reminderHeaderLabel , headerLabel ] . forEach { $0 ? . textColor = Themer . shared ( ) . mainTextColor ( )
}
}
}
}
@ -77,21 +81,27 @@ class PermissionsViewController: ParentViewController {
} */
} */
if EventCenter . sharedCenter ( ) . calendarAccessGranted ( ) {
if EventCenter . sharedCenter ( ) . calendarAccessGranted ( ) {
calendarButton . title = " Granted "
calendarButton . title = NSLocalizedString ( " Granted Button Text " ,
comment : " Granted Button Text " )
} else if EventCenter . sharedCenter ( ) . calendarAccessDenied ( ) {
} else if EventCenter . sharedCenter ( ) . calendarAccessDenied ( ) {
calendarButton . title = " Denied "
calendarButton . title = NSLocalizedString ( " Denied Button Text " ,
comment : " Denied Button Text " )
} else if EventCenter . sharedCenter ( ) . calendarAccessNotDetermined ( ) {
} else if EventCenter . sharedCenter ( ) . calendarAccessNotDetermined ( ) {
calendarButton . title = " Grant "
calendarButton . title = NSLocalizedString ( " Grant Button Text " ,
comment : " Grant Button Text " )
} else {
} else {
calendarButton . title = " Unexpected "
calendarButton . title = " Unexpected "
}
}
if EventCenter . sharedCenter ( ) . reminderAccessGranted ( ) {
if EventCenter . sharedCenter ( ) . reminderAccessGranted ( ) {
remindersButton . title = " Granted "
remindersButton . title = NSLocalizedString ( " Granted Button Text " ,
comment : " Granted Button Text " )
} else if EventCenter . sharedCenter ( ) . reminderAccessDenied ( ) {
} else if EventCenter . sharedCenter ( ) . reminderAccessDenied ( ) {
remindersButton . title = " Denied "
remindersButton . title = NSLocalizedString ( " Denied Button Text " ,
comment : " Denied Button Text " )
} else if EventCenter . sharedCenter ( ) . reminderAccessNotDetermined ( ) {
} else if EventCenter . sharedCenter ( ) . reminderAccessNotDetermined ( ) {
remindersButton . title = " Grant "
remindersButton . title = NSLocalizedString ( " Grant Button Text " ,
comment : " Grant Button Text " )
} else {
} else {
remindersButton . title = " Unexpected "
remindersButton . title = " Unexpected "
}
}
@ -131,19 +141,23 @@ class PermissionsViewController: ParentViewController {
self . view . window ? . orderBack ( nil )
self . view . window ? . orderBack ( nil )
NSApp . activate ( ignoringOtherApps : true )
NSApp . activate ( ignoringOtherApps : true )
self . calendarButton . title = " Granted "
self . calendarButton . title = NSLocalizedString ( " Granted Button Text " ,
comment : " Granted Button Text " )
// U s e d t o u p d a t e C a l e n d a r V i e w C o n t r o l l e r ' s v i e w
// U s e d t o u p d a t e C a l e n d a r V i e w C o n t r o l l e r ' s v i e w
NotificationCenter . default . post ( name : . calendarAccessGranted , object : nil )
NotificationCenter . default . post ( name : . calendarAccessGranted , object : nil )
}
}
} else {
} else {
Logger . log ( object : [ " Reminder Access Not Granted " : " YES " ] , for : " Reminder Access Not Granted " )
Logger . log ( object : [ " Reminder Access Not Granted " : " YES " ] ,
for : " Reminder Access Not Granted " )
}
}
} )
} )
} else if eventCenter . calendarAccessGranted ( ) {
} else if eventCenter . calendarAccessGranted ( ) {
calendarButton . title = " Granted "
calendarButton . title = NSLocalizedString ( " Granted Button Text " ,
comment : " Granted Button Text " )
} else {
} else {
calendarButton . title = " Denied "
calendarButton . title = NSLocalizedString ( " Denied Button Text " ,
comment : " Denied Button Text " )
}
}
}
}
@ -164,16 +178,19 @@ class PermissionsViewController: ParentViewController {
self . view . window ? . orderBack ( nil )
self . view . window ? . orderBack ( nil )
NSApp . activate ( ignoringOtherApps : true )
NSApp . activate ( ignoringOtherApps : true )
self . remindersButton . title = " Granted "
self . remindersButton . title = NSLocalizedString ( " Granted Button Text " ,
comment : " Granted Button Text " )
}
}
} else {
} else {
Logger . log ( object : [ " Reminder Access Not Granted " : " YES " ] , for : " Reminder Access Not Granted " )
Logger . log ( object : [ " Reminder Access Not Granted " : " YES " ] , for : " Reminder Access Not Granted " )
}
}
} )
} )
} else if eventCenter . reminderAccessGranted ( ) {
} else if eventCenter . reminderAccessGranted ( ) {
remindersButton . title = " Granted "
remindersButton . title = NSLocalizedString ( " Granted Button Text " ,
comment : " Granted Button Text " )
} else {
} else {
remindersButton . title = " Denied "
remindersButton . title = NSLocalizedString ( " Denied Button Text " ,
comment : " Denied Button Text " )
}
}
}
}
}
}