Skip to content

Commit 98107c6

Browse files
committed
🚸 菜单栏中的打开数据文件夹和打开当前文件夹的按钮可以直接调用任务管理器弹出文件夹窗口了
1 parent 9ab2966 commit 98107c6

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

app/src/locales/zh_CN.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,8 @@ appMenu:
505505
location:
506506
title: 位置
507507
items:
508-
openDataFolder: 打开数据文件夹
509-
openProjectFolder: 打开工程文件夹
508+
openDataFolder: 打开软件数据文件夹
509+
openProjectFolder: 打开当前文件所在文件夹
510510
export:
511511
title: 导出
512512
items:

app/src/pages/_app_menu.tsx

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { open as openFileDialog, save as saveFileDialog } from "@tauri-apps/plugin-dialog";
2+
import { open as openFilePath } from "@tauri-apps/plugin-shell";
23
import { useAtom } from "jotai";
34
import {
45
AppWindow,
@@ -24,7 +25,6 @@ import {
2425
Scaling,
2526
Search,
2627
Settings as SettingsIcon,
27-
SquareDashedKanbanIcon,
2828
SquareDashedMousePointer,
2929
TestTube2,
3030
Undo,
@@ -35,6 +35,7 @@ import {
3535
FilePlus2,
3636
FileDown,
3737
Rabbit,
38+
Group,
3839
} from "lucide-react";
3940
import React, { useEffect } from "react";
4041
import { useNavigate } from "react-router-dom";
@@ -412,25 +413,17 @@ export default function AppMenu({ className = "", open = false }: { className?:
412413
<Col
413414
icon={<FolderCog />}
414415
onClick={async () => {
415-
Dialog.show({
416-
title: "数据文件夹位置",
417-
type: "info",
418-
code: await dataDir(),
419-
content: "软件数据文件夹位置",
420-
});
416+
const path = (await dataDir()) + PathString.getSep() + "liren.project-graph";
417+
openFilePath(path);
421418
}}
422419
>
423420
{t("location.items.openDataFolder")}
424421
</Col>
425422
<Col
426423
icon={<FolderOpen />}
427424
onClick={() => {
428-
Dialog.show({
429-
title: "数据文件夹位置",
430-
type: "info",
431-
code: file,
432-
content: "软件数据文件夹位置",
433-
});
425+
const folderPath = PathString.dirPath(file);
426+
openFilePath(folderPath);
434427
}}
435428
>
436429
{t("location.items.openProjectFolder")}
@@ -452,7 +445,7 @@ export default function AppMenu({ className = "", open = false }: { className?:
452445
</Col>
453446
</Row>
454447
<Row icon={<View />} title={t("view.title")}>
455-
<Col icon={<SquareDashedKanbanIcon />} onClick={() => Camera.reset()}>
448+
<Col icon={<Group />} onClick={() => Camera.reset()}>
456449
{t("view.items.resetByAll")}
457450
</Col>
458451
<Col icon={<SquareDashedMousePointer />} onClick={() => Camera.resetBySelected()}>

0 commit comments

Comments
 (0)