Skip to content

Commit e7f16c8

Browse files
committed
Work on new settings dialog
1 parent 7a30f89 commit e7f16c8

File tree

5 files changed

+20
-17
lines changed

5 files changed

+20
-17
lines changed

GUI/Input/GamePad.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ class GamePad {
364364
if let hid = hidEvent {
365365

366366
// Notify the GUI
367-
if notify { myAppDelegate.hidEvent(event: hid.0, nr: hid.1, value: hid.2) }
367+
// if notify { myAppDelegate.hidEvent(event: hid.0, nr: hid.1, value: hid.2) }
368368
if let controller = myAppDelegate.settingsController, controller.isVisible {
369369
controller.devicesVC?.refreshDeviceEvent(event: hid.0, nr: hid.1, value: hid.2)
370370
}
@@ -400,7 +400,7 @@ class GamePad {
400400
controller.devicesVC?.refreshDeviceActions(actions: events)
401401
}
402402

403-
if notify { myAppDelegate.devicePulled(events: events) }
403+
// if notify { myAppDelegate.devicePulled(events: events) }
404404

405405
return events != []
406406
}

GUI/MyApplication.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public class MyAppDelegate: NSObject, NSApplicationDelegate {
103103

104104
// Preferences
105105
var pref: Preferences!
106-
var prefController: PreferencesController? // DEPRECATED
106+
// var prefController: PreferencesController? // DEPRECATED
107107
var settingsController: SettingsWindowController?
108108

109109
// Information provider for connected HID devices
@@ -170,7 +170,6 @@ extension MyAppDelegate {
170170
}
171171
}
172172

173-
174173
/*
175174
func windowDidBecomeMain(_ window: NSWindow) {
176175

@@ -193,16 +192,17 @@ extension MyAppDelegate {
193192

194193
// Callen when a HID device has been added
195194
func deviceAdded() {
196-
prefController?.refresh()
195+
// prefController?.refresh()
197196
settingsController?.refresh()
198197
}
199198

200199
// Callen when a HID device has been removed
201200
func deviceRemoved() {
202-
prefController?.refresh()
201+
// prefController?.refresh()
203202
settingsController?.refresh()
204203
}
205204

205+
/*
206206
// Callen when a HID event comes in
207207
func hidEvent(event: HIDEvent, nr: Int, value: Int) {
208208
prefController?.refreshDeviceEvent(event: event, nr: nr, value: value)
@@ -212,6 +212,7 @@ extension MyAppDelegate {
212212
func devicePulled(events: [GamePadAction]) {
213213
prefController?.refreshDeviceActions(actions: events)
214214
}
215+
*/
215216
}
216217

217218
@MainActor var myApp: MyApplication { return NSApp as! MyApplication }

GUI/MyControllerMenu.swift

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ extension MyController: NSMenuItemValidation {
123123
//
124124
// Action methods (App menu)
125125
//
126-
126+
127+
/*
127128
@IBAction func preferencesAction(_ sender: Any!) {
128129

129130
if myAppDelegate.prefController == nil {
@@ -133,6 +134,7 @@ extension MyController: NSMenuItemValidation {
133134
myAppDelegate.prefController!.showWindow(self)
134135
myAppDelegate.prefController!.refresh()
135136
}
137+
*/
136138

137139
@IBAction func settingsAction(_ sender: Any?) {
138140

@@ -143,14 +145,14 @@ extension MyController: NSMenuItemValidation {
143145

144146
myAppDelegate.settingsController =
145147
sb.instantiateController(withIdentifier: id) as? SettingsWindowController
148+
}
146149

147-
if let sc = myAppDelegate.settingsController {
150+
if let sc = myAppDelegate.settingsController {
148151

149-
sc.window?.level = .floating
150-
sc.showWindow(self)
151-
sc.window?.makeKeyAndOrderFront(nil)
152-
NSApp.activate(ignoringOtherApps: true)
153-
}
152+
sc.window?.level = .floating
153+
sc.showWindow(self)
154+
sc.window?.makeKeyAndOrderFront(nil)
155+
NSApp.activate(ignoringOtherApps: true)
154156
}
155157
}
156158

@@ -479,7 +481,7 @@ extension MyController: NSMenuItemValidation {
479481
}
480482

481483
refreshStatusBar()
482-
myAppDelegate.prefController?.refresh()
484+
// myAppDelegate.prefController?.refresh()
483485
}
484486

485487
//

GUI/MyToolbar.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class MyToolbar: NSToolbar {
148148

149149
switch sender.selectedSegment {
150150

151-
case 0: controller.preferencesAction(sender)
151+
case 0: controller.settingsAction(sender)
152152
case 1: controller.openConfiguratorAsSheet()
153153

154154
default:

vAmiga.xcodeproj/xcuserdata/hoff.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@
319319
filePath = "GUI/MyControllerMenu.swift"
320320
startingColumnNumber = "9223372036854775807"
321321
endingColumnNumber = "9223372036854775807"
322-
startingLineNumber = "600"
323-
endingLineNumber = "600"
322+
startingLineNumber = "602"
323+
endingLineNumber = "602"
324324
landmarkName = "insertRecentDiskAction(_:)"
325325
landmarkType = "7">
326326
</BreakpointContent>

0 commit comments

Comments
 (0)