Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 38 additions & 34 deletions Gas Mask.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

237 changes: 0 additions & 237 deletions Preferences.xib

This file was deleted.

Binary file removed Resources/Images/Preferences/Editor.png
Binary file not shown.
Binary file removed Resources/Images/Preferences/Hotkeys.png
Binary file not shown.
Binary file removed Resources/Images/Preferences/Remote.png
Binary file not shown.
Binary file removed Resources/Images/Preferences/Update.png
Binary file not shown.
2 changes: 0 additions & 2 deletions Source/ApplicationController.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
***************************************************************************/

#import "HostsMainController.h"
#import "PreferenceController.h"

@class AboutBoxController;

Expand All @@ -30,7 +29,6 @@
int busyThreads;
BOOL shouldQuit;
BOOL editorWindowOpened;
PreferenceController *preferenceController;
AboutBoxController *aboutBoxController;
}

Expand Down
6 changes: 1 addition & 5 deletions Source/ApplicationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,8 @@ - (id)init

-(IBAction)openPreferencesWindow:(id)sender
{
if (!preferenceController) {
preferenceController = [[PreferenceController alloc] init];
}

[self showApplicationInDock];
[preferenceController showWindow:self];
[PreferencesPresenter showPreferences];
}

- (IBAction)displayAboutBox:(id)sender
Expand Down
42 changes: 0 additions & 42 deletions Source/PreferenceController.h

This file was deleted.

287 changes: 0 additions & 287 deletions Source/PreferenceController.m

This file was deleted.

4 changes: 4 additions & 0 deletions Source/Swift/GasMask-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
#import "Network.h"
#import "HostsMainController.h"
#import "RemoteHostsController.h"
#import "Hotkey.h"
#import "Preferences.h"
#import "Preferences+Remote.h"
#import "LoginItem.h"
19 changes: 19 additions & 0 deletions Source/Swift/LoginItemObserver.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Foundation

/// Thin ObservableObject wrapper around the existing ObjC `LoginItem` class.
///
/// Delegates all `SMAppService` logic to `LoginItem`, avoiding a parallel implementation.
final class LoginItemObserver: ObservableObject {
private let loginItem = LoginItem()

@Published var isEnabled: Bool {
didSet {
guard isEnabled != oldValue else { return }
loginItem.setEnabled(isEnabled)
}
}

init() {
self.isEnabled = loginItem.enabled()
}
}
Loading