1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-08 04:20:07 +02:00
Files
app/phpmon/Domain/Core/AppDelegate+MenuOutlets.swift
2021-12-05 14:31:49 +01:00

41 lines
1.3 KiB
Swift

//
// AppDelegate+MenuOutlets.swift
// PHP Monitor
//
// Created by Nico Verbruggen on 05/12/2021.
// Copyright © 2021 Nico Verbruggen. All rights reserved.
//
import Foundation
/**
Any outlets connected to the app's main menu (not the menu that shows when the icon in
the menu bar is clicked, but the regular app's main menu) are configured here.
Default interactions like copy/paste, select all, close window etc. are wired up by
default in the storyboard and do not need to be manually added.
Extra functionality (like the menu item to reload the list of sites) does, however.
- Note: This menu is only displayed when the app is NOT running in accessory mode.
For more information about this, please see the ActivationPolicy-related extension.
*/
extension AppDelegate {
// MARK: - Menu Interactions
@IBAction func reloadSiteListPressed(_ sender: Any) {
let vc = App.shared.siteListWindowController?
.window?.contentViewController as? SiteListVC
if vc != nil {
// If the view exists, directly reload the list of sites
vc!.reloadSites()
} else {
// If the view does not exist, reload the cached data that was populated when the app initially launched.
Valet.shared.reloadSites()
}
}
}