This repository was archived by the owner on Jan 12, 2024. It is now read-only.
File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,12 @@ - (instancetype)initWithWindowNibName:(NSNibName)windowNibName parentController:
31
31
return self;
32
32
}
33
33
34
+ - (void )removeObservers {
35
+ [self removeObserver: self forKeyPath: @" selectedOutbound" ];
36
+ [self removeObserver: self forKeyPath: @" selectedRuleSet" ];
37
+ [self removeObserver: self forKeyPath: @" selectedRule" ];
38
+ }
39
+
34
40
- (void )windowDidLoad {
35
41
[super windowDidLoad ];
36
42
@@ -67,7 +73,7 @@ - (void)windowDidLoad {
67
73
forKeyPath: @" selectedRule"
68
74
options: NSKeyValueObservingOptionNew
69
75
context: nil ];
70
- // [self addObserver:self forKeyPath:@"ruleSetNameField.stringValue" options:NSKeyValueObservingOptionNew context:nil];
76
+
71
77
[[NSNotificationCenter defaultCenter ] addObserver: self
72
78
selector: @selector (textFieldDidChange: )
73
79
name: NSControlTextDidChangeNotification
@@ -122,11 +128,12 @@ - (IBAction)ok:(id)sender {
122
128
}
123
129
[self textDidEndEditing:
124
130
[[NSNotification alloc ] initWithName: NSTextDidEndEditingNotification object: _domainIpTextView userInfo: nil ]];
125
-
131
+ [ self removeObservers ];
126
132
[self .window.sheetParent endSheet: self .window returnCode: NSModalResponseOK ];
127
133
}
128
134
129
135
- (IBAction )cancel : (id )sender {
136
+ [self removeObservers ];
130
137
[self .window.sheetParent endSheet: self .window returnCode: NSModalResponseCancel ];
131
138
}
132
139
Original file line number Diff line number Diff line change 517
517
<font key =" font" metaFont =" system" />
518
518
</buttonCell >
519
519
<connections >
520
- <action selector =" showAdvancedWindow:" target =" -2" id =" 15k-Xq-IZU " />
520
+ <action selector =" showAdvancedWindow:" target =" -2" id =" 1El-Bd-DKf " />
521
521
</connections >
522
522
</button >
523
523
<button toolTip =" Restart V2Ray and connected to the selected server above" verticalHuggingPriority =" 750" fixedFrame =" YES" translatesAutoresizingMaskIntoConstraints =" NO" id =" fnz-Bw-lGu" >
You can’t perform that action at this time.
0 commit comments