feat: desktop_multi_window: ^0.3.0

This commit is contained in:
xkeyC
2025-11-15 22:06:56 +08:00
parent d82cfb41aa
commit 3f660c7d5e
16 changed files with 389 additions and 178 deletions

View File

@@ -43,7 +43,7 @@ final class InputMethodDialogUIModelProvider
}
String _$inputMethodDialogUIModelHash() =>
r'39b7fc1446c09514b837c0f181488d34a4391751';
r'f216c1a5b6d68b3924af7b351314c618dcac80b5';
abstract class _$InputMethodDialogUIModel
extends $Notifier<InputMethodDialogUIState> {
@@ -115,7 +115,7 @@ final class OnnxTranslationProvider
}
}
String _$onnxTranslationHash() => r'05b7b063a1013eed1ee4daae5212b3b6c555cd82';
String _$onnxTranslationHash() => r'4f3dc0e361dca2d6b00f557496bdf006cc6c235c';
final class OnnxTranslationFamily extends $Family
with

View File

@@ -175,7 +175,8 @@ class ToolsUIModel extends _$ToolsUIModel {
"remove_nvme_settings",
S.current.tools_action_remove_nvme_registry_patch,
S.current.tools_action_info_nvme_patch_issue(
nvmePatchStatus ? S.current.localization_info_installed : S.current.tools_action_info_not_installed),
nvmePatchStatus ? S.current.localization_info_installed : S.current.tools_action_info_not_installed,
),
const Icon(FluentIcons.hard_drive, size: 24),
onTap: nvmePatchStatus
? () async {
@@ -207,7 +208,7 @@ class ToolsUIModel extends _$ToolsUIModel {
state = state.copyWith(working: false);
loadToolsCard(context, skipPathScan: true);
},
)
),
];
}
@@ -265,8 +266,11 @@ class ToolsUIModel extends _$ToolsUIModel {
if (listData == null) {
return;
}
scInstallPaths = await SCLoggerHelper.getGameInstallPath(listData,
checkExists: checkActive, withVersion: AppConf.gameChannels);
scInstallPaths = await SCLoggerHelper.getGameInstallPath(
listData,
checkExists: checkActive,
withVersion: AppConf.gameChannels,
);
if (scInstallPaths.isNotEmpty) {
scInstalledPath = scInstallPaths.first;
}
@@ -336,11 +340,12 @@ class ToolsUIModel extends _$ToolsUIModel {
Future<String> getSystemInfo() async {
return S.current.tools_action_info_system_info_content(
await SystemHelper.getSystemName(),
await SystemHelper.getCpuName(),
await SystemHelper.getSystemMemorySizeGB(),
await SystemHelper.getGpuInfo(),
await SystemHelper.getDiskInfo());
await SystemHelper.getSystemName(),
await SystemHelper.getCpuName(),
await SystemHelper.getSystemMemorySizeGB(),
await SystemHelper.getGpuInfo(),
await SystemHelper.getDiskInfo(),
);
}
/// 管理员模式运行 RSI 启动器
@@ -364,9 +369,7 @@ class ToolsUIModel extends _$ToolsUIModel {
builder: (context) => ContentDialog(
title: Text(S.current.tools_action_info_system_info_title),
content: Text(systemInfo),
constraints: BoxConstraints(
maxWidth: MediaQuery.of(context).size.width * .65,
),
constraints: BoxConstraints(maxWidth: MediaQuery.of(context).size.width * .65),
actions: [
FilledButton(
child: Padding(
@@ -403,8 +406,11 @@ class ToolsUIModel extends _$ToolsUIModel {
if ((await SystemHelper.getPID("\"RSI Launcher\"")).isNotEmpty) {
if (!context.mounted) return;
showToast(context, S.current.tools_action_info_rsi_launcher_running_warning,
constraints: BoxConstraints(maxWidth: MediaQuery.of(context).size.width * .35));
showToast(
context,
S.current.tools_action_info_rsi_launcher_running_warning,
constraints: BoxConstraints(maxWidth: MediaQuery.of(context).size.width * .35),
);
return;
}
@@ -436,8 +442,11 @@ class ToolsUIModel extends _$ToolsUIModel {
return;
}
final userSelect =
await FilePicker.platform.saveFile(initialDirectory: savePath, fileName: fileName, lockParentWindow: true);
final userSelect = await FilePicker.platform.saveFile(
initialDirectory: savePath,
fileName: fileName,
lockParentWindow: true,
);
if (userSelect == null) {
state = state.copyWith(working: false);
return;
@@ -546,16 +555,18 @@ class ToolsUIModel extends _$ToolsUIModel {
static Future<void> rsiEnhance(BuildContext context, {bool showNotGameInstallMsg = false}) async {
if ((await SystemHelper.getPID("\"RSI Launcher\"")).isNotEmpty) {
if (!context.mounted) return;
showToast(context, S.current.tools_action_info_rsi_launcher_running_warning,
constraints: BoxConstraints(maxWidth: MediaQuery.of(context).size.width * .35));
showToast(
context,
S.current.tools_action_info_rsi_launcher_running_warning,
constraints: BoxConstraints(maxWidth: MediaQuery.of(context).size.width * .35),
);
return;
}
if (!context.mounted) return;
showDialog(
context: context,
builder: (BuildContext context) => RsiLauncherEnhanceDialogUI(
showNotGameInstallMsg: showNotGameInstallMsg,
));
context: context,
builder: (BuildContext context) => RsiLauncherEnhanceDialogUI(showNotGameInstallMsg: showNotGameInstallMsg),
);
}
Future<void> _showLogAnalyze(BuildContext context) async {
@@ -564,6 +575,10 @@ class ToolsUIModel extends _$ToolsUIModel {
return;
}
if (!context.mounted) return;
await MultiWindowManager.launchSubWindow("log_analyze", S.current.log_analyzer_window_title, appGlobalState);
await MultiWindowManager.launchSubWindow(
WindowTypes.logAnalyze,
S.current.log_analyzer_window_title,
appGlobalState,
);
}
}

View File

@@ -41,7 +41,7 @@ final class ToolsUIModelProvider
}
}
String _$toolsUIModelHash() => r'885596b0df27191f2c69c571b0a1f60d9c6e31de';
String _$toolsUIModelHash() => r'78732ff16e87cc9f92174bda43d0fafadba51146';
abstract class _$ToolsUIModel extends $Notifier<ToolsUIState> {
ToolsUIState build();