mirror of
https://github.com/wavetermdev/waveterm
synced 2026-05-04 22:19:00 +00:00
This makes the following changes: - Connects various context menu items to the error overlay on failure - Connects read file errors to the error overlay on failure - Consolidates context menu items for open and reveal - Reduces duplication in context menu items - Removes an unnecessary File Stat RPC call for the parent directory --------- Co-authored-by: Evan Simkowitz <esimkowitz@users.noreply.github.com> Co-authored-by: sawka <mike@commandline.dev>
27 lines
723 B
TypeScript
27 lines
723 B
TypeScript
export const PlatformMacOS = "darwin";
|
|
export let PLATFORM: NodeJS.Platform = PlatformMacOS;
|
|
|
|
export function setPlatform(platform: NodeJS.Platform) {
|
|
PLATFORM = platform;
|
|
}
|
|
|
|
export function makeNativeLabel(isDirectory: boolean) {
|
|
let managerName: string;
|
|
if (!isDirectory) {
|
|
managerName = "Default Application";
|
|
} else if (PLATFORM === PlatformMacOS) {
|
|
managerName = "Finder";
|
|
} else if (PLATFORM == "win32") {
|
|
managerName = "Explorer";
|
|
} else {
|
|
managerName = "File Manager";
|
|
}
|
|
|
|
let fileAction: string;
|
|
if (isDirectory) {
|
|
fileAction = "Reveal";
|
|
} else {
|
|
fileAction = "Open File";
|
|
}
|
|
return `${fileAction} in ${managerName}`;
|
|
}
|