@@ -284,11 +284,13 @@ - (void)askInputWithPrompt: (NSString*)prompt handler:(void (^ __nullable)(NSStr
284284 alternateButton: @" Cancel"
285285 otherButton: nil
286286 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];
289291 [alert beginSheetModalForWindow: self .window completionHandler: ^(NSModalResponse returnCode) {
290292 if (returnCode == NSModalResponseOK ) {
291- handler ([input stringValue ]);
293+ handler ([inputField stringValue ]);
292294 }
293295 }];
294296}
@@ -302,7 +304,7 @@ - (void)showAlert:(NSString*)text {
302304}
303305
304306- (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) {
306308 if (inputStr.length ) {
307309 dispatch_async (dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_HIGH, 0 ), ^{
308310 NSMutableDictionary * ssOutbound = [ConfigImporter ssOutboundFromSSLink: inputStr];
@@ -321,7 +323,7 @@ - (void)presentImportResultOfVmessCount:(NSInteger)vmessCount otherCount:(NSInte
321323 dispatch_async (dispatch_get_main_queue (), ^{
322324 [self ->_profileTable reloadData ];
323325 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];
325327 self.popover .contentViewController = [[NSViewController alloc ] init ];
326328 self.popover .contentViewController .view = self.importResultView ;
327329 self.popover .behavior = NSPopoverBehaviorTransient;
@@ -331,7 +333,7 @@ - (void)presentImportResultOfVmessCount:(NSInteger)vmessCount otherCount:(NSInte
331333}
332334
333335- (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) {
335337 if ([inputStr length ] != 0 ) {
336338 ServerProfile* p = [ConfigImporter importFromVmessOfV2RayN: inputStr];
337339 dispatch_async (dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_HIGH, 0 ), ^{
0 commit comments