Skip to content

Commit

Permalink
Fixed Pref Window view/remove button (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyvoxi authored Jul 4, 2024
1 parent 5b999de commit d3d801b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions HeliPort/Appearance/Preferences/PrefsSavedNetworksView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class PrefsSavedNetworksView: NSView {
return label
}()

private let modifyItemSegment: NSSegmentedControl = {
private lazy var modifyItemSegment: NSSegmentedControl = {
var removeImage: NSImage
var viewImage: NSImage
if #available(OSX 11.0, *) {
Expand All @@ -91,7 +91,7 @@ class PrefsSavedNetworksView: NSView {
}
let button = NSSegmentedControl(images: [removeImage, viewImage],
trackingMode: .momentary,
target: NSSegmentedControl.self,
target: self,
action: #selector(modifyItemClicked(_:)))
button.setEnabled(false, forSegment: .remove)
button.setEnabled(false, forSegment: .view)
Expand Down
7 changes: 3 additions & 4 deletions HeliPort/Appearance/StatusMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class StatusMenu: NSMenu, NSMenuDelegate {
private var statusUpdateTimer: Timer?

// One instance at a time
private var preferenceWindow: PrefsWindow?
private lazy var preferenceWindow = PrefsWindow()

private var status: itl_80211_state = ITL80211_S_INIT {
didSet {
Expand Down Expand Up @@ -444,9 +444,8 @@ final class StatusMenu: NSMenu, NSMenuDelegate {
let alert = Alert(text: .notImplemented)
alert.show()
case .openNetworkPrefs:
preferenceWindow?.close()
preferenceWindow = PrefsWindow()
preferenceWindow?.show()
preferenceWindow.close()
preferenceWindow.show()
case .checkUpdates:
heliPortUpdater.checkForUpdates(self)
case .launchLogin:
Expand Down

0 comments on commit d3d801b

Please sign in to comment.