From 9be7483f4d18296774d7fcf12b913d287762abe0 Mon Sep 17 00:00:00 2001 From: David Alarcon Date: Thu, 26 Nov 2020 18:10:45 +0100 Subject: [PATCH] MOS-8 Rename menuitems properties. --- .../pEpNotifications/AppDelegate.swift | 16 ++++++++-------- .../pEpNotifications/Base.lproj/Main.storyboard | 11 +++++------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Submodules/pEpNotifications/pEpNotifications/AppDelegate.swift b/Submodules/pEpNotifications/pEpNotifications/AppDelegate.swift index 918619b..2680748 100644 --- a/Submodules/pEpNotifications/pEpNotifications/AppDelegate.swift +++ b/Submodules/pEpNotifications/pEpNotifications/AppDelegate.swift @@ -27,9 +27,9 @@ class AppDelegate: NSObject { @IBOutlet weak var pEpMenu: NSMenu! @IBOutlet weak var statusText: NSMenuItem! - @IBOutlet weak var _updateNow: NSMenuItem! - @IBOutlet weak var _scheduleUpdates: NSMenuItem! - @IBOutlet weak var _alwaysShowThisMenu: NSMenuItem! + @IBOutlet weak var updateNowMenuItem: NSMenuItem! + @IBOutlet weak var scheduleUpdatesMenuItem: NSMenuItem! + @IBOutlet weak var alwaysShowThisMenuMenuItem: NSMenuItem! // MARK: - Properties @@ -93,10 +93,10 @@ extension AppDelegate { let appDefaults = ["ScheduleUpdates": true, "AlwaysShowThisMenu": false] UserDefaults.standard.register(defaults: appDefaults) if UserDefaults.standard.bool(forKey: "AlwaysShowThisMenu") { - _alwaysShowThisMenu.state = NSControl.StateValue.on + alwaysShowThisMenuMenuItem.state = NSControl.StateValue.on installMenuExtra() } else { - _alwaysShowThisMenu.state = NSControl.StateValue.off + alwaysShowThisMenuMenuItem.state = NSControl.StateValue.off } } @@ -115,11 +115,11 @@ extension AppDelegate { service?.subscribeForUpdate(clientListener.endpoint) if UserDefaults.standard.bool(forKey: "ScheduleUpdates") { service?.scheduleUpdates() - _scheduleUpdates.state = NSControl.StateValue.on + scheduleUpdatesMenuItem.state = NSControl.StateValue.on } else { service?.stopUpdates() - _scheduleUpdates.state = NSControl.StateValue.off + scheduleUpdatesMenuItem.state = NSControl.StateValue.off } } @@ -157,7 +157,7 @@ extension AppDelegate { statusBarItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.squareLength) statusBarItem?.button?.title = "p≡p" statusBarItem?.menu = NSApp.menu?.item(at: 0)?.submenu - _updateNow.action = #selector(updateNow) + updateNowMenuItem.action = #selector(updateNow) } private func uninstallMenuExtra() { diff --git a/Submodules/pEpNotifications/pEpNotifications/Base.lproj/Main.storyboard b/Submodules/pEpNotifications/pEpNotifications/Base.lproj/Main.storyboard index 3cf387e..878fcb6 100644 --- a/Submodules/pEpNotifications/pEpNotifications/Base.lproj/Main.storyboard +++ b/Submodules/pEpNotifications/pEpNotifications/Base.lproj/Main.storyboard @@ -1,8 +1,7 @@ - + - - + @@ -54,11 +53,11 @@ - - - + + +