@@ -284,11 +284,13 @@ - (void)askInputWithPrompt: (NSString*)prompt handler:(void (^ __nullable)(NSStr
284
284
alternateButton: @" Cancel"
285
285
otherButton: nil
286
286
informativeTextWithFormat: @" " ];
287
- NSTextField *input = [[NSTextField alloc ] initWithFrame: NSMakeRect (0 , 0 , 400 , 24 )];
288
- [alert setAccessoryView: input];
287
+ NSTextField *inputField = [[NSTextField alloc ] initWithFrame: NSMakeRect (0 , 0 , 400 , 24 )];
288
+ inputField.usesSingleLineMode = true ;
289
+ inputField.lineBreakMode = NSLineBreakByTruncatingHead;
290
+ [alert setAccessoryView: inputField];
289
291
[alert beginSheetModalForWindow: self .window completionHandler: ^(NSModalResponse returnCode) {
290
292
if (returnCode == NSModalResponseOK ) {
291
- handler ([input stringValue ]);
293
+ handler ([inputField stringValue ]);
292
294
}
293
295
}];
294
296
}
@@ -302,7 +304,7 @@ - (void)showAlert:(NSString*)text {
302
304
}
303
305
304
306
- (IBAction )importFromStandardLink : (id )sender {
305
- [self askInputWithPrompt: @" Please input the server info with standard and official format " handler: ^(NSString *inputStr) {
307
+ [self askInputWithPrompt: @" Support standard ss:// link. Use \" Import from other miscellaneous links... \" to import other links(may cause failure). " handler: ^(NSString *inputStr) {
306
308
if (inputStr.length ) {
307
309
dispatch_async (dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_HIGH, 0 ), ^{
308
310
NSMutableDictionary * ssOutbound = [ConfigImporter ssOutboundFromSSLink: inputStr];
@@ -321,7 +323,7 @@ - (void)presentImportResultOfVmessCount:(NSInteger)vmessCount otherCount:(NSInte
321
323
dispatch_async (dispatch_get_main_queue (), ^{
322
324
[self ->_profileTable reloadData ];
323
325
self.popover = [[NSPopover alloc ] init ];
324
- self.importMessageField .stringValue = [NSString stringWithFormat: @" imported %lu vmess and %lu other protocol outbounds, %lu routing sets." , vmessCount, otherCount, ruleSetCount];
326
+ self.importMessageField .stringValue = [NSString stringWithFormat: @" Imported %lu vmess and %lu other protocol outbounds, %lu routing rule sets." , vmessCount, otherCount, ruleSetCount];
325
327
self.popover .contentViewController = [[NSViewController alloc ] init ];
326
328
self.popover .contentViewController .view = self.importResultView ;
327
329
self.popover .behavior = NSPopoverBehaviorTransient;
@@ -331,7 +333,7 @@ - (void)presentImportResultOfVmessCount:(NSInteger)vmessCount otherCount:(NSInte
331
333
}
332
334
333
335
- (IBAction )importFromMiscLinks : (id )sender {
334
- [self askInputWithPrompt: @" Please input the link " handler: ^(NSString *inputStr) {
336
+ [self askInputWithPrompt: @" V2RayX will try importing vmess:// and http(s):// links from v2rayN . " handler: ^(NSString *inputStr) {
335
337
if ([inputStr length ] != 0 ) {
336
338
ServerProfile* p = [ConfigImporter importFromVmessOfV2RayN: inputStr];
337
339
dispatch_async (dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_HIGH, 0 ), ^{
0 commit comments