diff --git a/Limelight/FixedTintImageView.m b/Limelight/FixedTintImageView.m index ce7dda00..848f93d6 100644 --- a/Limelight/FixedTintImageView.m +++ b/Limelight/FixedTintImageView.m @@ -49,8 +49,10 @@ } - (void)setTintColor:(UIColor *)tintColor { - if(_fixedTintColor == nil && tintColor != nil) _fixedTintColor = tintColor; - if(tintColor != nil) [super setTintColor:tintColor]; + if(tintColor != nil){ + _fixedTintColor = tintColor; + [super setTintColor:tintColor]; + } } - (void)tintColorDidChange { diff --git a/Limelight/HostCardView.m b/Limelight/HostCardView.m index 0a8242a6..45f299d0 100644 --- a/Limelight/HostCardView.m +++ b/Limelight/HostCardView.m @@ -179,6 +179,7 @@ static const float REFRESH_CYCLE = 2.0f; self.translatesAutoresizingMaskIntoConstraints = NO; CGFloat appButtonWidth = 100*_sizeFactor; CGFloat launchButtonWidth = 120*_sizeFactor; + CGFloat cardWidth = _cardContentpadding*2 + appButtonWidth + 15*_sizeFactor + launchButtonWidth; /* NSLayoutConstraint *topAnchorConstraint; topAnchorConstraint = [self.topAnchor constraintEqualToAnchor:self.superview.topAnchor constant:500]; @@ -254,14 +255,17 @@ static const float REFRESH_CYCLE = 2.0f; lockIconView.hidden = true; // 设备名 - self.hostNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(_cardContentpadding+_iconBackgroundView.frame.size.width+20*_sizeFactor, _cardContentpadding+_iconBackgroundView.frame.size.height/10, 300*_sizeFactor, 30*_sizeFactor)]; + CGFloat hostNameLabelCoordX = _cardContentpadding+_iconBackgroundView.frame.size.width+16*_sizeFactor; + self.hostNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(hostNameLabelCoordX, _cardContentpadding+_iconBackgroundView.frame.size.height*0.02, cardWidth-hostNameLabelCoordX-_cardContentpadding, 30*_sizeFactor)]; self.hostNameLabel.numberOfLines = 1; + self.hostNameLabel.adjustsFontSizeToFitWidth = YES; + self.hostNameLabel.minimumScaleFactor = 0.8; // 最小字体缩放比例 self.hostNameLabel.lineBreakMode = NSLineBreakByTruncatingTail; self.hostIconView.translatesAutoresizingMaskIntoConstraints = NO; self.hostNameLabel.text = @"RazerBlade 16"; self.hostNameLabel.textColor = [UIColor whiteColor]; //theme - self.hostNameLabel.font = [UIFont boldSystemFontOfSize:20*_sizeFactor]; + self.hostNameLabel.font = [UIFont boldSystemFontOfSize:18*_sizeFactor]; [self addSubview:self.hostNameLabel]; @@ -280,8 +284,8 @@ static const float REFRESH_CYCLE = 2.0f; [self addSubview:self.statusIcon]; [NSLayoutConstraint activateConstraints:@[ [self.statusIcon.leadingAnchor constraintEqualToAnchor:self.hostNameLabel.leadingAnchor], - [self.statusIcon.topAnchor constraintEqualToAnchor:self.hostNameLabel.bottomAnchor constant:4*_sizeFactor], - [self.statusIcon.widthAnchor constraintEqualToConstant:19*_sizeFactor] + [self.statusIcon.topAnchor constraintEqualToAnchor:self.hostNameLabel.bottomAnchor constant:0*_sizeFactor], + [self.statusIcon.widthAnchor constraintEqualToConstant:16*_sizeFactor] ]]; @@ -289,7 +293,7 @@ static const float REFRESH_CYCLE = 2.0f; self.statusLabel = [[UILabel alloc] initWithFrame:CGRectMake(205, 68, 100, 24)]; self.statusLabel.translatesAutoresizingMaskIntoConstraints = NO; self.statusLabel.text = @"Online"; - self.statusLabel.font = [UIFont systemFontOfSize:16*_sizeFactor weight:UIFontWeightMedium]; + self.statusLabel.font = [UIFont systemFontOfSize:15*_sizeFactor weight:UIFontWeightMedium]; self.statusLabel.textColor = defaultGreen; // self.statusLabel.font = [UIFont systemFontOfSize:16*_sizeFactor]; [self addSubview:self.statusLabel]; diff --git a/Limelight/Localization/Localizable.xcstrings b/Limelight/Localization/Localizable.xcstrings index b8f4311c..22cff6f3 100644 --- a/Limelight/Localization/Localizable.xcstrings +++ b/Limelight/Localization/Localizable.xcstrings @@ -53,25 +53,25 @@ "en" : { "stringUnit" : { "state" : "translated", - "value" : "\n\nYour device's network connection is blocking Moonlight. Streaming may not work while connected to this network." + "value" : "\n\nYour device's session connection is being blocked. Streaming may not work while connected to this network." } }, "zh-Hans" : { "stringUnit" : { "state" : "translated", - "value" : "\n\n设备的网络连接似乎正在屏蔽Moonlight. 可能无法在此网络中串流." + "value" : "\n\n设备的远程会话连接被阻塞. 可能无法在此网络中串流." } }, "zh-Hant" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "\n\n设备的网络连接似乎正在屏蔽Moonlight. 可能无法在此网络中串流." } }, "zh-HK" : { "stringUnit" : { "state" : "translated", - "value" : "\n\n设备的网络连接似乎正在屏蔽Moonlight. 可能无法在此网络中串流." + "value" : "\n\n设备的网络连接似乎正在屏蔽远程会话. 可能无法在此网络中串流." } } } @@ -956,6 +956,29 @@ } } }, + "Enter IP address to add host manually" : { + "extractionState" : "manual", + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "输入主机端IP地址" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "输入主机端IP地址" + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "translated", + "value" : "输入主机端IP地址" + } + } + } + }, "Enter the command & alias label" : { "extractionState" : "manual", "localizations" : { @@ -1307,29 +1330,6 @@ } } }, - "If Moonlight doesn't find your local gaming PC automatically, enter the IP address of your PC" : { - "extractionState" : "manual", - "localizations" : { - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "输入主机端IP地址" - } - }, - "zh-Hant" : { - "stringUnit" : { - "state" : "translated", - "value" : "输入主机端IP地址" - } - }, - "zh-HK" : { - "stringUnit" : { - "state" : "translated", - "value" : "输入主机端IP地址" - } - } - } - }, "Indicator Offset: %.2f" : { "extractionState" : "manual", "localizations" : { @@ -1549,24 +1549,24 @@ "en" : { "stringUnit" : { "state" : "translated", - "value" : "The network test could not be performed because none of Moonlight's connection testing servers were reachable. Check your Internet connection or try again later." + "value" : "The network test could not be performed because none of the connection testing servers were reachable. Check your Internet connection or try again later." } }, "zh-Hans" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "无法执行网络测试. 请检查网络连接后重试." } }, "zh-Hant" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "无法执行网络测试. 请检查网络连接后重试." } }, "zh-HK" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "无法执行网络测试. 请检查网络连接后重试." } } @@ -1595,29 +1595,6 @@ } } }, - "Moonlight-iOS/tvOS only supports adding PCs on your local network" : { - "extractionState" : "manual", - "localizations" : { - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "Moonlight-iOS/tvOS仅支持添加局域网中的主机" - } - }, - "zh-Hant" : { - "stringUnit" : { - "state" : "translated", - "value" : "Moonlight-iOS/tvOS仅支持添加局域网中的主机" - } - }, - "zh-HK" : { - "stringUnit" : { - "state" : "translated", - "value" : "Moonlight-iOS/tvOS仅支持添加局域网中的主机" - } - } - } - }, "Mouse Pointer Velocity: %d%%" : { "extractionState" : "manual", "localizations" : { @@ -1670,25 +1647,25 @@ "en" : { "stringUnit" : { "state" : "translated", - "value" : "Your current network connection seems to be blocking Moonlight. Streaming may not work while connected to this network.\n\nThe following network ports were blocked:\n%s" + "value" : "Your current network connection seems to be blocking remote session. Streaming may not work while connected to this network.\n\nThe following network ports were blocked:\n%s" } }, "zh-Hans" : { "stringUnit" : { "state" : "translated", - "value" : "设备的网络连接似乎正在阻塞Moonlight. 可能无法在此网络中串流.\n\n以下网络端口被阻塞:\n%s" + "value" : "设备的网络连接似乎正在阻塞远程会话. 可能无法在此网络中串流.\n\n以下网络端口被阻塞:\n%s" } }, "zh-Hant" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "设备的网络连接似乎正在阻塞Moonlight. 可能无法在此网络中串流.\n\n以下网络端口被阻塞:\n%s" } }, "zh-HK" : { "stringUnit" : { "state" : "translated", - "value" : "设备的网络连接似乎正在阻塞Moonlight. 可能无法在此网络中串流.\n\n以下网络端口被阻塞:\n%s" + "value" : "设备的网络连接似乎正在阻塞远程会话. 可能无法在此网络中串流.\n\n以下网络端口被阻塞:\n%s" } } } @@ -1699,24 +1676,24 @@ "en" : { "stringUnit" : { "state" : "translated", - "value" : "This network does not appear to be blocking Moonlight. If you still have trouble connecting, check your PC's firewall settings.\n\nVisit the Moonlight Setup Guide on GitHub for additional setup help and troubleshooting steps." + "value" : "This network does not appear to be blocking remote session. If you still have trouble connecting, check your PC's firewall settings." } }, "zh-Hans" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "网络测试成功. 如果仍然无法连接远程主机, 请检查主机端防火墙设置." } }, "zh-Hant" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "网络测试成功. 如果仍然无法连接远程主机, 请检查主机端防火墙设置." } }, "zh-HK" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "网络测试成功. 如果仍然无法连接远程主机, 请检查主机端防火墙设置." } } diff --git a/Limelight/Network/DiscoveryManager.m b/Limelight/Network/DiscoveryManager.m index ea1c6062..14508b91 100644 --- a/Limelight/Network/DiscoveryManager.m +++ b/Limelight/Network/DiscoveryManager.m @@ -132,7 +132,7 @@ - (void) discoverHost:(NSString *)hostAddress withCallback:(void (^)(TemporaryHost *, NSString*))callback { BOOL prohibitedAddress = [DiscoveryManager isProhibitedAddress:hostAddress]; - NSString* prohibitedAddressMessage = [LocalizationHelper localizedStringForKey: @"Moonlight-iOS/tvOS only supports adding PCs on your local network"]; // this is actually deprecated since i cancel the IP limitation + NSString* prohibitedAddressMessage = [LocalizationHelper localizedStringForKey: @""]; // this is actually deprecated since i cancel the IP limitation ServerInfoResponse* serverInfoResponse = [self getServerInfoResponseForAddress:hostAddress]; TemporaryHost* host = nil; diff --git a/Limelight/ViewControllers/MainFrameViewController.m b/Limelight/ViewControllers/MainFrameViewController.m index 596d2a82..91283588 100644 --- a/Limelight/ViewControllers/MainFrameViewController.m +++ b/Limelight/ViewControllers/MainFrameViewController.m @@ -732,11 +732,27 @@ static NSMutableSet* hostList; - (void) addHostTapped { Log(LOG_D, @"Tapped add host"); - UIAlertController* alertController = [UIAlertController alertControllerWithTitle:[LocalizationHelper localizedStringForKey:@"Add Host Manually"] message:[LocalizationHelper localizedStringForKey:@"If Moonlight doesn't find your local gaming PC automatically, enter the IP address of your PC"] preferredStyle:UIAlertControllerStyleAlert]; - [alertController addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Cancel"] style:UIAlertActionStyleCancel handler:nil]]; - [alertController addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Ok"] style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){ - NSString* hostAddress = [((UITextField*)[[alertController textFields] objectAtIndex:0]).text trim]; - + UIAlertController* alertController = [UIAlertController alertControllerWithTitle:[LocalizationHelper localizedStringForKey:@"Add Host Manually"] + message:[LocalizationHelper localizedStringForKey:@"Enter IP address to add host manually"] + preferredStyle:UIAlertControllerStyleAlert]; + + [alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) { + textField.placeholder = @"192.168.0.100 or [2001:db8::1]"; + textField.keyboardType = UIKeyboardTypeASCIICapable; + textField.autocorrectionType = UITextAutocorrectionTypeNo; + textField.spellCheckingType = UITextSpellCheckingTypeNo; + }]; + + [alertController addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Cancel"] + style:UIAlertActionStyleCancel + handler:nil]]; + + [alertController addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Ok"] + style:UIAlertActionStyleDefault + handler:^(UIAlertAction* action) { + UITextField *textField = alertController.textFields.firstObject; + NSString *hostAddress = [textField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + [self showLoadingFrame:^{ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ [self->_discMan discoverHost:hostAddress withCallback:^(TemporaryHost* host, NSString* error){ @@ -769,7 +785,6 @@ static NSMutableSet* hostList; }); }]; }]]; - [alertController addTextFieldWithConfigurationHandler:nil]; [[self activeViewController] presentViewController:alertController animated:YES completion:nil]; } diff --git a/Limelight/ViewControllers/StreamFrameViewController.m b/Limelight/ViewControllers/StreamFrameViewController.m index 5c993b4c..b4f1aa8d 100644 --- a/Limelight/ViewControllers/StreamFrameViewController.m +++ b/Limelight/ViewControllers/StreamFrameViewController.m @@ -785,7 +785,7 @@ if (portTestResults != ML_TEST_RESULT_INCONCLUSIVE && portTestResults != 0) { title = [LocalizationHelper localizedStringForKey:@"Connection Error"]; - message = @"Your device's network connection is blocking Moonlight. Streaming may not work while connected to this network."; + message = @"Your device's session connection is being blocked. Streaming may not work while connected to this network."; } else { switch (errorCode) {