minor fixes

This commit is contained in:
TrueZhuanjia committed 2025-06-01 11:18:09 +08:00
1 parent 049034e5a9
commit fda5c8610c
6 files changed
+74 -76

No files matched your search

+4 -2
View File
@@ -49,8 +49,10 @@
} }
- (void)setTintColor:(UIColor *)tintColor { - (void)setTintColor:(UIColor *)tintColor {
if(_fixedTintColor == nil && tintColor != nil) _fixedTintColor = tintColor; if(tintColor != nil){
if(tintColor != nil) [super setTintColor:tintColor]; _fixedTintColor = tintColor;
[super setTintColor:tintColor];
}
} }
- (void)tintColorDidChange { - (void)tintColorDidChange {
+9 -5
View File
@@ -179,6 +179,7 @@ static const float REFRESH_CYCLE = 2.0f;
self.translatesAutoresizingMaskIntoConstraints = NO; self.translatesAutoresizingMaskIntoConstraints = NO;
CGFloat appButtonWidth = 100*_sizeFactor; CGFloat appButtonWidth = 100*_sizeFactor;
CGFloat launchButtonWidth = 120*_sizeFactor; CGFloat launchButtonWidth = 120*_sizeFactor;
CGFloat cardWidth = _cardContentpadding*2 + appButtonWidth + 15*_sizeFactor + launchButtonWidth;
/* /*
NSLayoutConstraint *topAnchorConstraint; NSLayoutConstraint *topAnchorConstraint;
topAnchorConstraint = [self.topAnchor constraintEqualToAnchor:self.superview.topAnchor constant:500]; topAnchorConstraint = [self.topAnchor constraintEqualToAnchor:self.superview.topAnchor constant:500];
@@ -254,14 +255,17 @@ static const float REFRESH_CYCLE = 2.0f;
lockIconView.hidden = true; 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.numberOfLines = 1;
self.hostNameLabel.adjustsFontSizeToFitWidth = YES;
self.hostNameLabel.minimumScaleFactor = 0.8; // 最小字体缩放比例
self.hostNameLabel.lineBreakMode = NSLineBreakByTruncatingTail; self.hostNameLabel.lineBreakMode = NSLineBreakByTruncatingTail;
self.hostIconView.translatesAutoresizingMaskIntoConstraints = NO; self.hostIconView.translatesAutoresizingMaskIntoConstraints = NO;
self.hostNameLabel.text = @"RazerBlade 16"; self.hostNameLabel.text = @"RazerBlade 16";
self.hostNameLabel.textColor = [UIColor whiteColor]; //theme self.hostNameLabel.textColor = [UIColor whiteColor]; //theme
self.hostNameLabel.font = [UIFont boldSystemFontOfSize:20*_sizeFactor]; self.hostNameLabel.font = [UIFont boldSystemFontOfSize:18*_sizeFactor];
[self addSubview:self.hostNameLabel]; [self addSubview:self.hostNameLabel];
@@ -280,8 +284,8 @@ static const float REFRESH_CYCLE = 2.0f;
[self addSubview:self.statusIcon]; [self addSubview:self.statusIcon];
[NSLayoutConstraint activateConstraints:@[ [NSLayoutConstraint activateConstraints:@[
[self.statusIcon.leadingAnchor constraintEqualToAnchor:self.hostNameLabel.leadingAnchor], [self.statusIcon.leadingAnchor constraintEqualToAnchor:self.hostNameLabel.leadingAnchor],
[self.statusIcon.topAnchor constraintEqualToAnchor:self.hostNameLabel.bottomAnchor constant:4*_sizeFactor], [self.statusIcon.topAnchor constraintEqualToAnchor:self.hostNameLabel.bottomAnchor constant:0*_sizeFactor],
[self.statusIcon.widthAnchor constraintEqualToConstant:19*_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 = [[UILabel alloc] initWithFrame:CGRectMake(205, 68, 100, 24)];
self.statusLabel.translatesAutoresizingMaskIntoConstraints = NO; self.statusLabel.translatesAutoresizingMaskIntoConstraints = NO;
self.statusLabel.text = @"Online"; 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.textColor = defaultGreen;
// self.statusLabel.font = [UIFont systemFontOfSize:16*_sizeFactor]; // self.statusLabel.font = [UIFont systemFontOfSize:16*_sizeFactor];
[self addSubview:self.statusLabel]; [self addSubview:self.statusLabel];
+39 -62
View File
@@ -53,25 +53,25 @@
"en" : { "en" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "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" : { "zh-Hans" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
"value" : "\n\n设备的网络连接似乎正在屏蔽Moonlight. 可能无法在此网络中串流." "value" : "\n\n设备的远程会话连接被阻塞. 可能无法在此网络中串流."
} }
}, },
"zh-Hant" : { "zh-Hant" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "needs_review",
"value" : "\n\n设备的网络连接似乎正在屏蔽Moonlight. 可能无法在此网络中串流." "value" : "\n\n设备的网络连接似乎正在屏蔽Moonlight. 可能无法在此网络中串流."
} }
}, },
"zh-HK" : { "zh-HK" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "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" : { "Enter the command & alias label" : {
"extractionState" : "manual", "extractionState" : "manual",
"localizations" : { "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" : { "Indicator Offset: %.2f" : {
"extractionState" : "manual", "extractionState" : "manual",
"localizations" : { "localizations" : {
@@ -1549,24 +1549,24 @@
"en" : { "en" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "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" : { "zh-Hans" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "needs_review",
"value" : "无法执行网络测试. 请检查网络连接后重试." "value" : "无法执行网络测试. 请检查网络连接后重试."
} }
}, },
"zh-Hant" : { "zh-Hant" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "needs_review",
"value" : "无法执行网络测试. 请检查网络连接后重试." "value" : "无法执行网络测试. 请检查网络连接后重试."
} }
}, },
"zh-HK" : { "zh-HK" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "needs_review",
"value" : "无法执行网络测试. 请检查网络连接后重试." "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%%" : { "Mouse Pointer Velocity: %d%%" : {
"extractionState" : "manual", "extractionState" : "manual",
"localizations" : { "localizations" : {
@@ -1670,25 +1647,25 @@
"en" : { "en" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "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" : { "zh-Hans" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
"value" : "设备的网络连接似乎正在阻塞Moonlight. 可能无法在此网络中串流.\n\n以下网络端口被阻塞:\n%s" "value" : "设备的网络连接似乎正在阻塞远程会话. 可能无法在此网络中串流.\n\n以下网络端口被阻塞:\n%s"
} }
}, },
"zh-Hant" : { "zh-Hant" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "needs_review",
"value" : "设备的网络连接似乎正在阻塞Moonlight. 可能无法在此网络中串流.\n\n以下网络端口被阻塞:\n%s" "value" : "设备的网络连接似乎正在阻塞Moonlight. 可能无法在此网络中串流.\n\n以下网络端口被阻塞:\n%s"
} }
}, },
"zh-HK" : { "zh-HK" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
"value" : "设备的网络连接似乎正在阻塞Moonlight. 可能无法在此网络中串流.\n\n以下网络端口被阻塞:\n%s" "value" : "设备的网络连接似乎正在阻塞远程会话. 可能无法在此网络中串流.\n\n以下网络端口被阻塞:\n%s"
} }
} }
} }
@@ -1699,24 +1676,24 @@
"en" : { "en" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "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" : { "zh-Hans" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "needs_review",
"value" : "网络测试成功. 如果仍然无法连接远程主机, 请检查主机端防火墙设置." "value" : "网络测试成功. 如果仍然无法连接远程主机, 请检查主机端防火墙设置."
} }
}, },
"zh-Hant" : { "zh-Hant" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "needs_review",
"value" : "网络测试成功. 如果仍然无法连接远程主机, 请检查主机端防火墙设置." "value" : "网络测试成功. 如果仍然无法连接远程主机, 请检查主机端防火墙设置."
} }
}, },
"zh-HK" : { "zh-HK" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "needs_review",
"value" : "网络测试成功. 如果仍然无法连接远程主机, 请检查主机端防火墙设置." "value" : "网络测试成功. 如果仍然无法连接远程主机, 请检查主机端防火墙设置."
} }
} }
+1 -1
View File
@@ -132,7 +132,7 @@
- (void) discoverHost:(NSString *)hostAddress withCallback:(void (^)(TemporaryHost *, NSString*))callback { - (void) discoverHost:(NSString *)hostAddress withCallback:(void (^)(TemporaryHost *, NSString*))callback {
BOOL prohibitedAddress = [DiscoveryManager isProhibitedAddress:hostAddress]; 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]; ServerInfoResponse* serverInfoResponse = [self getServerInfoResponseForAddress:hostAddress];
TemporaryHost* host = nil; TemporaryHost* host = nil;
@@ -732,10 +732,26 @@ static NSMutableSet* hostList;
- (void) addHostTapped { - (void) addHostTapped {
Log(LOG_D, @"Tapped add host"); 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]; UIAlertController* alertController = [UIAlertController alertControllerWithTitle:[LocalizationHelper localizedStringForKey:@"Add Host Manually"]
[alertController addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Cancel"] style:UIAlertActionStyleCancel handler:nil]]; message:[LocalizationHelper localizedStringForKey:@"Enter IP address to add host manually"]
[alertController addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Ok"] style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){ preferredStyle:UIAlertControllerStyleAlert];
NSString* hostAddress = [((UITextField*)[[alertController textFields] objectAtIndex:0]).text trim];
[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:^{ [self showLoadingFrame:^{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
@@ -769,7 +785,6 @@ static NSMutableSet* hostList;
}); });
}]; }];
}]]; }]];
[alertController addTextFieldWithConfigurationHandler:nil];
[[self activeViewController] presentViewController:alertController animated:YES completion:nil]; [[self activeViewController] presentViewController:alertController animated:YES completion:nil];
} }
@@ -785,7 +785,7 @@
if (portTestResults != ML_TEST_RESULT_INCONCLUSIVE && portTestResults != 0) { if (portTestResults != ML_TEST_RESULT_INCONCLUSIVE && portTestResults != 0) {
title = [LocalizationHelper localizedStringForKey:@"Connection Error"]; 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 { else {
switch (errorCode) { switch (errorCode) {