Add using text Show in Finder on macOS in Editor

This commit is contained in:
Wojtek Figat
2023-10-02 13:08:15 +02:00
parent 5fe135e10b
commit dd66ee3521
6 changed files with 13 additions and 7 deletions

View File

@@ -139,7 +139,7 @@ namespace FlaxEditor.Content.Import
var menu = new ContextMenu();
menu.AddButton("Rename", OnRenameClicked);
menu.AddButton("Don't import", OnDontImportClicked);
menu.AddButton("Show in Explorer", OnShowInExplorerClicked);
menu.AddButton(Utilities.Constants.ShowInExplorer, OnShowInExplorerClicked);
menu.Tag = node;
menu.Show(node, location);
}

View File

@@ -14,5 +14,11 @@ namespace FlaxEditor.Utilities
public const string FacebookUrl = "https://facebook.com/FlaxEngine";
public const string YoutubeUrl = "https://youtube.com/c/FlaxEngine";
public const string TwitterUrl = "https://twitter.com/FlaxEngine";
#if PLATFORM_MAC
public const string ShowInExplorer = "Show in Finder";
#else
public const string ShowInExplorer = "Show in explorer";
#endif
}
}

View File

@@ -58,7 +58,7 @@ namespace FlaxEditor.Windows
if (item is ContentFolder contentFolder && contentFolder.Node is ProjectTreeNode)
{
cm.AddButton("Show in explorer", () => FileSystem.ShowFileExplorer(CurrentViewFolder.Path));
cm.AddButton(Utilities.Constants.ShowInExplorer, () => FileSystem.ShowFileExplorer(CurrentViewFolder.Path));
}
else if (isValidElement)
{
@@ -72,7 +72,7 @@ namespace FlaxEditor.Windows
Open(e);
});
cm.AddButton("Show in explorer", () => FileSystem.ShowFileExplorer(System.IO.Path.GetDirectoryName(item.Path)));
cm.AddButton(Utilities.Constants.ShowInExplorer, () => FileSystem.ShowFileExplorer(System.IO.Path.GetDirectoryName(item.Path)));
if (item.HasDefaultThumbnail == false)
{
@@ -135,7 +135,7 @@ namespace FlaxEditor.Windows
}
else
{
cm.AddButton("Show in explorer", () => FileSystem.ShowFileExplorer(CurrentViewFolder.Path));
cm.AddButton(Utilities.Constants.ShowInExplorer, () => FileSystem.ShowFileExplorer(CurrentViewFolder.Path));
b = cm.AddButton("Paste", _view.Paste);
b.Enabled = _view.CanPaste();

View File

@@ -195,7 +195,7 @@ namespace FlaxEditor.Windows
_contextMenu.AddButton("Clear log", Clear);
_contextMenu.AddButton("Copy selection", _output.Copy);
_contextMenu.AddButton("Select All", _output.SelectAll);
_contextMenu.AddButton("Show in explorer", () => FileSystem.ShowFileExplorer(Path.Combine(Globals.ProjectFolder, "Logs")));
_contextMenu.AddButton(Utilities.Constants.ShowInExplorer, () => FileSystem.ShowFileExplorer(Path.Combine(Globals.ProjectFolder, "Logs")));
_contextMenu.AddButton("Scroll to bottom", () => { _vScroll.TargetValue = _vScroll.Maximum; }).Icon = Editor.Icons.ArrowDown12;
// Setup editor options

View File

@@ -274,7 +274,7 @@ namespace FlaxEditor.Windows.Profiler
ContextMenuButton b;
b = cm.AddButton("Open", () => Editor.Instance.ContentEditing.Open(assetItem));
cm.AddButton("Show in content window", () => Editor.Instance.Windows.ContentWin.Select(assetItem));
cm.AddButton("Show in explorer", () => FileSystem.ShowFileExplorer(System.IO.Path.GetDirectoryName(assetItem.Path)));
cm.AddButton(Utilities.Constants.ShowInExplorer, () => FileSystem.ShowFileExplorer(System.IO.Path.GetDirectoryName(assetItem.Path)));
cm.AddButton("Select actors using this asset", () => Editor.Instance.SceneEditing.SelectActorsUsingAsset(assetItem.ID));
cm.AddButton("Show asset references graph", () => Editor.Instance.Windows.Open(new AssetReferencesGraphWindow(Editor.Instance, assetItem)));
cm.AddButton("Copy name", () => Clipboard.Text = assetItem.NamePath);

View File

@@ -157,7 +157,7 @@ namespace FlaxEditor.Windows.Search
var cm = new FlaxEditor.GUI.ContextMenu.ContextMenu { Tag = assetItem };
b = cm.AddButton("Open", () => Editor.Instance.ContentFinding.Open(Item));
cm.AddSeparator();
cm.AddButton("Show in explorer", () => FileSystem.ShowFileExplorer(System.IO.Path.GetDirectoryName(assetItem.Path)));
cm.AddButton(Utilities.Constants.ShowInExplorer, () => FileSystem.ShowFileExplorer(System.IO.Path.GetDirectoryName(assetItem.Path)));
cm.AddButton("Show in Content window", () => Editor.Instance.Windows.ContentWin.Select(assetItem, true));
b.Enabled = proxy != null && proxy.CanReimport(assetItem);
if (assetItem is BinaryAssetItem binaryAsset)