Merge pull request #4795 from dignow/refact/win_cliprd_wait_timeout

Refact/win cliprd wait timeout
This commit is contained in:
RustDesk
2023-06-29 22:50:45 +08:00
committed by GitHub
46 changed files with 223 additions and 37 deletions

View File

@@ -998,6 +998,26 @@ Widget msgboxIcon(String type) {
// title should be null
Widget msgboxContent(String type, String title, String text) {
String translateText(String text) {
if (text.indexOf('Failed') == 0 && text.indexOf(': ') > 0) {
List<String> words = text.split(': ');
for (var i = 0; i < words.length; ++i) {
words[i] = translate(words[i]);
}
text = words.join(': ');
} else {
List<String> words = text.split(' ');
if (words.length > 1 && words[0].endsWith('_tip')) {
words[0] = translate(words[0]);
final rest = text.substring(words[0].length + 1);
text = '${words[0]} ${translate(rest)}';
} else {
text = translate(text);
}
}
return text;
}
return Row(
children: [
msgboxIcon(type),
@@ -1009,7 +1029,7 @@ Widget msgboxContent(String type, String title, String text) {
translate(title),
style: TextStyle(fontSize: 21),
).marginOnly(bottom: 10),
Text(translate(text), style: const TextStyle(fontSize: 15)),
Text(translateText(text), style: const TextStyle(fontSize: 15)),
],
),
),