mirror of
https://mirror.ghproxy.com/https://github.com/StarCitizenToolBox/app.git
synced 2024-12-23 05:23:44 +08:00
log按钮搬家
This commit is contained in:
parent
f640574190
commit
eafd249847
@ -12,6 +12,31 @@ class GameDoctorUI extends BaseUI<GameDoctorUIModel> {
|
|||||||
children: [
|
children: [
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
for (final item in const {
|
||||||
|
"rsi_log": "RSI启动器log",
|
||||||
|
"game_log": "游戏运行log",
|
||||||
|
}.entries)
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 6, right: 6),
|
||||||
|
child: Button(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(4),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
const Icon(FluentIcons.folder_open),
|
||||||
|
const SizedBox(width: 6),
|
||||||
|
Text(item.value),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onPressed: () => model.onTapButton(item.key)),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
if (model.isChecking)
|
if (model.isChecking)
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Center(
|
child: Center(
|
||||||
|
@ -239,4 +239,26 @@ class GameDoctorUIModel extends BaseUIModel {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onTapButton(String key) async {
|
||||||
|
switch (key) {
|
||||||
|
case "rsi_log":
|
||||||
|
final path = await SCLoggerHelper.getLogFilePath();
|
||||||
|
if (path == null) return;
|
||||||
|
openDir(path);
|
||||||
|
return;
|
||||||
|
case "game_log":
|
||||||
|
if (scInstalledPath == "not_install") {
|
||||||
|
showToast(context!, "请在首页选择游戏安装目录。");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
openDir("$scInstalledPath\\Game.log");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
openDir(path) async {
|
||||||
|
await Process.run(
|
||||||
|
SystemHelper.powershellPath, ["explorer.exe", "/select,\"$path\""]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,14 +73,6 @@ class ToolsUIModel extends BaseUIModel {
|
|||||||
const Icon(FluentIcons.admin, size: 28),
|
const Icon(FluentIcons.admin, size: 28),
|
||||||
onTap: _adminRSILauncher,
|
onTap: _adminRSILauncher,
|
||||||
),
|
),
|
||||||
if (scInstalledPath != "")
|
|
||||||
_ToolsItemData(
|
|
||||||
"game_log_select",
|
|
||||||
"游戏 Game.log 查看",
|
|
||||||
"打开 Game.log 所在文件夹",
|
|
||||||
const Icon(FontAwesomeIcons.bookBible, size: 28),
|
|
||||||
onTap: _selectGameLog,
|
|
||||||
),
|
|
||||||
];
|
];
|
||||||
isItemLoading = true;
|
isItemLoading = true;
|
||||||
items.add(await _addShaderCard());
|
items.add(await _addShaderCard());
|
||||||
@ -109,13 +101,6 @@ class ToolsUIModel extends BaseUIModel {
|
|||||||
1024;
|
1024;
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
return [
|
return [
|
||||||
_ToolsItemData(
|
|
||||||
"rsilauncher_log_select",
|
|
||||||
"RSI Launcher Log 查看",
|
|
||||||
"打开 RSI启动器 Log文件 所在文件夹",
|
|
||||||
const Icon(FontAwesomeIcons.bookBible, size: 28),
|
|
||||||
onTap: _selectLog,
|
|
||||||
),
|
|
||||||
_ToolsItemData(
|
_ToolsItemData(
|
||||||
"rsilauncher_log_fix",
|
"rsilauncher_log_fix",
|
||||||
"RSI Launcher Log 修复",
|
"RSI Launcher Log 修复",
|
||||||
@ -309,16 +294,6 @@ class ToolsUIModel extends BaseUIModel {
|
|||||||
working = false;
|
working = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _selectGameLog() async {
|
|
||||||
openDir("$scInstalledPath\\Game.log");
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _selectLog() async {
|
|
||||||
final path = await SCLoggerHelper.getLogFilePath();
|
|
||||||
if (path == null) return;
|
|
||||||
openDir(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
openDir(path) async {
|
openDir(path) async {
|
||||||
await Process.run(
|
await Process.run(
|
||||||
SystemHelper.powershellPath, ["explorer.exe", "/select,\"$path\""]);
|
SystemHelper.powershellPath, ["explorer.exe", "/select,\"$path\""]);
|
||||||
|
Loading…
Reference in New Issue
Block a user