Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit 6546d9c

Browse files
committed
show check label
1 parent 2e5e23a commit 6546d9c

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

V2RayX/ConfigWindowController.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464

6565
//cus config file fields
6666
@property (weak) IBOutlet NSTableView *cusProfileTable;
67+
@property (weak) IBOutlet NSTextField *checkLabel;
6768

6869

6970
@property (nonatomic) ServerProfile* selectedProfile;

V2RayX/ConfigWindowController.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,14 @@ - (IBAction)showCusConfigWindow:(NSButton *)sender {
193193
[[self window] beginSheet:_cusConfigWindow completionHandler:^(NSModalResponse returnCode) {
194194
}];
195195
}
196+
196197
- (IBAction)cFinish:(NSButton *)sender {
198+
[_checkLabel setHidden:NO];
197199
NSString* v2rayBinPath = [NSString stringWithFormat:@"%@/v2ray", [[NSBundle mainBundle] resourcePath]];
198200
for (NSString* filePath in cusProfiles) {
199201
int returnCode = runCommandLine(v2rayBinPath, @[@"-test", @"-config", filePath]);
200202
if (returnCode != 0) {
203+
[_checkLabel setHidden:YES];
201204
NSAlert *alert = [[NSAlert alloc] init];
202205
[alert setMessageText:[NSString stringWithFormat:@"%@ is not a valid v2ray config file", filePath]];
203206
[alert beginSheetModalForWindow:_cusConfigWindow completionHandler:^(NSModalResponse returnCode) {

V2RayX/customizedConfigWindow.xib

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14109" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14113" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
33
<dependencies>
44
<deployment identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14109"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14113"/>
66
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
77
</dependencies>
88
<objects>
99
<customObject id="-2" userLabel="File's Owner" customClass="ConfigWindowController">
1010
<connections>
11+
<outlet property="checkLabel" destination="nN6-wl-YxO" id="Dng-7Y-GIH"/>
1112
<outlet property="cusConfigWindow" destination="QvC-M9-y7g" id="53I-Z9-UYQ"/>
1213
<outlet property="cusProfileTable" destination="sAX-Hf-7on" id="1ck-Gd-1yv"/>
1314
</connections>
@@ -102,6 +103,15 @@ Gw
102103
<action selector="cFinish:" target="-2" id="43r-OI-cfs"/>
103104
</connections>
104105
</button>
106+
<textField hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="nN6-wl-YxO">
107+
<rect key="frame" x="18" y="20" width="71" height="17"/>
108+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
109+
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="checking..." id="R7w-O4-j5u">
110+
<font key="font" metaFont="system"/>
111+
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
112+
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
113+
</textFieldCell>
114+
</textField>
105115
</subviews>
106116
</view>
107117
<point key="canvasLocation" x="139" y="170.5"/>

0 commit comments

Comments
 (0)