Skip to content

Commit cd52249

Browse files
authored
Added a copy location button to the right click context menu (#1906)
1 parent e948a58 commit cd52249

24 files changed

+169
-33
lines changed

Files/BaseLayout.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,11 @@ public void RightClickItemContextMenu_Opening(object sender, object e)
410410
&& SelectedItem.FileExtension.Equals(".msi", StringComparison.OrdinalIgnoreCase);
411411
SetShellContextmenu(shiftPressed, showOpenMenu);
412412

413+
if (!AppSettings.ShowCopyLocationOption)
414+
{
415+
UnloadMenuFlyoutItemByName("CopyLocationItem");
416+
}
417+
413418
if (!DataTransferManager.IsSupported())
414419
{
415420
UnloadMenuFlyoutItemByName("ShareItem");

Files/Interacts/Interaction.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,6 +1174,18 @@ public async void CopyItem_ClickAsync(object sender, RoutedEventArgs e)
11741174
}
11751175
}
11761176

1177+
public void CopyLocation_ClickAsync(object sender, RoutedEventArgs e)
1178+
{
1179+
if (App.CurrentInstance.ContentPage != null)
1180+
{
1181+
Clipboard.Clear();
1182+
DataPackage data = new DataPackage();
1183+
data.SetText(CurrentInstance.ContentPage.SelectedItem.ItemPath);
1184+
Clipboard.SetContent(data);
1185+
Clipboard.Flush();
1186+
}
1187+
}
1188+
11771189
private enum ImpossibleActionResponseTypes
11781190
{
11791191
Skip,

Files/MultilingualResources/Files.de-DE.xlf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,9 @@
340340
<target state="translated">Neues Fenster</target>
341341
</trans-unit>
342342
<trans-unit id="NavigationToolbarCopyPath.Text" translate="yes" xml:space="preserve">
343-
<source>Copy Path</source>
344-
<target state="translated">Pfad kopieren</target>
343+
<source>Copy location</source>
344+
<target state="needs-review-translation">Pfad kopieren</target>
345+
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
345346
</trans-unit>
346347
<trans-unit id="NavigationToolbarPaste.Text" translate="yes" xml:space="preserve">
347348
<source>Paste</source>
@@ -1208,6 +1209,10 @@
12081209
<source>Set as</source>
12091210
<target state="translated">Festlegen als</target>
12101211
</trans-unit>
1212+
<trans-unit id="BaseLayoutItemContextFlyoutCopyLocation.Text" translate="yes" xml:space="preserve">
1213+
<source>Copy location</source>
1214+
<target state="new">Copy location</target>
1215+
</trans-unit>
12111216
</group>
12121217
</body>
12131218
</file>

Files/MultilingualResources/Files.es-ES.xlf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,9 @@
340340
<target state="translated">Nueva Ventana</target>
341341
</trans-unit>
342342
<trans-unit id="NavigationToolbarCopyPath.Text" translate="yes" xml:space="preserve">
343-
<source>Copy Path</source>
344-
<target state="translated">Copiar Ubicación</target>
343+
<source>Copy location</source>
344+
<target state="needs-review-translation">Copiar Ubicación</target>
345+
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
345346
</trans-unit>
346347
<trans-unit id="NavigationToolbarPaste.Text" translate="yes" xml:space="preserve">
347348
<source>Paste</source>
@@ -1195,6 +1196,10 @@
11951196
<source>Set as</source>
11961197
<target state="new">Set as</target>
11971198
</trans-unit>
1199+
<trans-unit id="BaseLayoutItemContextFlyoutCopyLocation.Text" translate="yes" xml:space="preserve">
1200+
<source>Copy location</source>
1201+
<target state="new">Copy location</target>
1202+
</trans-unit>
11981203
</group>
11991204
</body>
12001205
</file>

Files/MultilingualResources/Files.fr-FR.xlf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,9 @@
342342
<target state="needs-review-translation" state-qualifier="tm-suggestion">Nouvelle fenêtre</target>
343343
</trans-unit>
344344
<trans-unit id="NavigationToolbarCopyPath.Text" translate="yes" xml:space="preserve">
345-
<source>Copy Path</source>
345+
<source>Copy location</source>
346346
<target state="needs-review-translation" state-qualifier="tm-suggestion">Copier le chemin d’accès</target>
347+
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
347348
</trans-unit>
348349
<trans-unit id="NavigationToolbarPaste.Text" translate="yes" xml:space="preserve">
349350
<source>Paste</source>
@@ -1197,6 +1198,10 @@
11971198
<source>Set as</source>
11981199
<target state="new">Set as</target>
11991200
</trans-unit>
1201+
<trans-unit id="BaseLayoutItemContextFlyoutCopyLocation.Text" translate="yes" xml:space="preserve">
1202+
<source>Copy location</source>
1203+
<target state="new">Copy location</target>
1204+
</trans-unit>
12001205
</group>
12011206
</body>
12021207
</file>

Files/MultilingualResources/Files.he-IL.xlf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@
5151
<target state="translated" state-qualifier="tm-suggestion">מסמך טקסט</target>
5252
</trans-unit>
5353
<trans-unit id="NavigationToolbarCopyPath.Text" translate="yes" xml:space="preserve">
54-
<source>Copy Path</source>
55-
<target state="translated" state-qualifier="tm-suggestion">העתק נתיב</target>
54+
<source>Copy location</source>
55+
<target state="needs-review-translation" state-qualifier="tm-suggestion">העתק נתיב</target>
56+
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
5657
</trans-unit>
5758
<trans-unit id="NavigationToolbarPaste.Text" translate="yes" xml:space="preserve">
5859
<source>Paste</source>
@@ -1193,6 +1194,10 @@
11931194
<source>Set as</source>
11941195
<target state="new">Set as</target>
11951196
</trans-unit>
1197+
<trans-unit id="BaseLayoutItemContextFlyoutCopyLocation.Text" translate="yes" xml:space="preserve">
1198+
<source>Copy location</source>
1199+
<target state="new">Copy location</target>
1200+
</trans-unit>
11961201
</group>
11971202
</body>
11981203
</file>

Files/MultilingualResources/Files.hi-IN.xlf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@
5151
<target state="translated">लिखित दस्तावेज़</target>
5252
</trans-unit>
5353
<trans-unit id="NavigationToolbarCopyPath.Text" translate="yes" xml:space="preserve">
54-
<source>Copy Path</source>
55-
<target state="translated">मार्ग प्रतिलिपि</target>
54+
<source>Copy location</source>
55+
<target state="needs-review-translation">मार्ग प्रतिलिपि</target>
56+
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
5657
</trans-unit>
5758
<trans-unit id="NavigationToolbarPaste.Text" translate="yes" xml:space="preserve">
5859
<source>Paste</source>
@@ -1203,6 +1204,10 @@
12031204
<source>Set as</source>
12041205
<target state="new">Set as</target>
12051206
</trans-unit>
1207+
<trans-unit id="BaseLayoutItemContextFlyoutCopyLocation.Text" translate="yes" xml:space="preserve">
1208+
<source>Copy location</source>
1209+
<target state="new">Copy location</target>
1210+
</trans-unit>
12061211
</group>
12071212
</body>
12081213
</file>

Files/MultilingualResources/Files.it-IT.xlf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@
4343
<target state="translated">Documento di testo</target>
4444
</trans-unit>
4545
<trans-unit id="NavigationToolbarCopyPath.Text" translate="yes" xml:space="preserve">
46-
<source>Copy Path</source>
47-
<target state="translated">Copia percorso</target>
46+
<source>Copy location</source>
47+
<target state="needs-review-translation">Copia percorso</target>
48+
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
4849
</trans-unit>
4950
<trans-unit id="NavigationToolbarPaste.Text" translate="yes" xml:space="preserve">
5051
<source>Paste</source>
@@ -1203,6 +1204,10 @@
12031204
<source>Set as</source>
12041205
<target state="new">Set as</target>
12051206
</trans-unit>
1207+
<trans-unit id="BaseLayoutItemContextFlyoutCopyLocation.Text" translate="yes" xml:space="preserve">
1208+
<source>Copy location</source>
1209+
<target state="new">Copy location</target>
1210+
</trans-unit>
12061211
</group>
12071212
</body>
12081213
</file>

Files/MultilingualResources/Files.ja-JP.xlf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@
5151
<target state="translated">テキスト文書</target>
5252
</trans-unit>
5353
<trans-unit id="NavigationToolbarCopyPath.Text" translate="yes" xml:space="preserve">
54-
<source>Copy Path</source>
55-
<target state="translated">パスをコピー</target>
54+
<source>Copy location</source>
55+
<target state="needs-review-translation">パスをコピー</target>
56+
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
5657
</trans-unit>
5758
<trans-unit id="NavigationToolbarPaste.Text" translate="yes" xml:space="preserve">
5859
<source>Paste</source>
@@ -1203,6 +1204,10 @@
12031204
<source>Set as</source>
12041205
<target state="new">Set as</target>
12051206
</trans-unit>
1207+
<trans-unit id="BaseLayoutItemContextFlyoutCopyLocation.Text" translate="yes" xml:space="preserve">
1208+
<source>Copy location</source>
1209+
<target state="new">Copy location</target>
1210+
</trans-unit>
12061211
</group>
12071212
</body>
12081213
</file>

Files/MultilingualResources/Files.nl-NL.xlf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,9 @@
340340
<target state="translated" state-qualifier="tm-suggestion">Nieuw venster</target>
341341
</trans-unit>
342342
<trans-unit id="NavigationToolbarCopyPath.Text" translate="yes" xml:space="preserve">
343-
<source>Copy Path</source>
344-
<target state="translated" state-qualifier="tm-suggestion">Pad kopiëren</target>
343+
<source>Copy location</source>
344+
<target state="needs-review-translation" state-qualifier="tm-suggestion">Pad kopiëren</target>
345+
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
345346
</trans-unit>
346347
<trans-unit id="NavigationToolbarPaste.Text" translate="yes" xml:space="preserve">
347348
<source>Paste</source>
@@ -1203,6 +1204,10 @@
12031204
<source>Set as</source>
12041205
<target state="new">Set as</target>
12051206
</trans-unit>
1207+
<trans-unit id="BaseLayoutItemContextFlyoutCopyLocation.Text" translate="yes" xml:space="preserve">
1208+
<source>Copy location</source>
1209+
<target state="new">Copy location</target>
1210+
</trans-unit>
12061211
</group>
12071212
</body>
12081213
</file>

0 commit comments

Comments
 (0)