Skip to content

Commit b9a364b

Browse files
authored
Added item status to the status bar (#1026)
1 parent a1bfea3 commit b9a364b

19 files changed

+958
-822
lines changed

Files/App.xaml.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static IShellPage CurrentInstance
5555
public static ObservableCollection<WSLDistroItem> linuxDistroItems = new ObservableCollection<WSLDistroItem>();
5656
public static SettingsViewModel AppSettings { get; set; }
5757
public static InteractionViewModel InteractionViewModel { get; set; }
58-
public static SelectedItemPropertiesViewModel SelectedItemPropertiesViewModel { get; set; }
58+
public static SelectedItemsPropertiesViewModel SelectedItemsPropertiesViewModel { get; set; }
5959

6060
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
6161

@@ -82,7 +82,7 @@ public App()
8282

8383
AppSettings = new SettingsViewModel();
8484
InteractionViewModel = new InteractionViewModel();
85-
SelectedItemPropertiesViewModel = new SelectedItemPropertiesViewModel();
85+
SelectedItemsPropertiesViewModel = new SelectedItemsPropertiesViewModel();
8686
}
8787

8888
private void OnLeavingBackground(object sender, LeavingBackgroundEventArgs e)

Files/BaseLayout.cs

+17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Files.Filesystem;
22
using Files.Interacts;
3+
using Files.View_Models;
34
using Files.Views.Pages;
45
using System;
56
using System.Collections.Generic;
@@ -8,6 +9,7 @@
89
using System.Linq;
910
using System.Runtime.CompilerServices;
1011
using Windows.ApplicationModel.DataTransfer;
12+
using Windows.ApplicationModel.Resources;
1113
using Windows.Storage;
1214
using Windows.System;
1315
using Windows.UI.Core;
@@ -47,6 +49,8 @@ internal set
4749
}
4850
}
4951

52+
public SelectedItemsPropertiesViewModel SelectedItemsPropertiesViewModel => App.SelectedItemsPropertiesViewModel;
53+
5054
private List<ListedItem> _SelectedItems = new List<ListedItem>();
5155

5256
public List<ListedItem> SelectedItems
@@ -64,11 +68,24 @@ internal set
6468
{
6569
IsItemSelected = false;
6670
SelectedItem = null;
71+
SelectedItemsPropertiesViewModel.IsItemSelected = false;
6772
}
6873
else
6974
{
7075
IsItemSelected = true;
7176
SelectedItem = _SelectedItems.First();
77+
SelectedItemsPropertiesViewModel.IsItemSelected = true;
78+
79+
if (SelectedItems.Count == 1)
80+
{
81+
SelectedItemsPropertiesViewModel.SelectedItemsCount = SelectedItems.Count.ToString() + " " + ResourceController.GetTranslation("ItemSelected/Text");
82+
SelectedItemsPropertiesViewModel.ItemsSize = SelectedItem.FileSize;
83+
}
84+
else
85+
{
86+
SelectedItemsPropertiesViewModel.SelectedItemsCount = SelectedItems.Count.ToString() + " " + ResourceController.GetTranslation("ItemsSelected/Text");
87+
SelectedItemsPropertiesViewModel.ItemsSize = ""; // We need to loop through the items to get the size
88+
}
7289
}
7390
NotifyPropertyChanged("SelectedItems");
7491
SetDragModeForItems();

Files/Files.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@
217217
<DependentUpon>GenericFileBrowser.xaml</DependentUpon>
218218
</Compile>
219219
<Compile Include="View Models\InteractionViewModel.cs" />
220-
<Compile Include="View Models\SelectedItemPropertiesViewModel.cs" />
220+
<Compile Include="View Models\SelectedItemsPropertiesViewModel.cs" />
221221
<Compile Include="Views\InstanceTabsView.xaml.cs">
222222
<DependentUpon>InstanceTabsView.xaml</DependentUpon>
223223
</Compile>

Files/MultilingualResources/Files.de-DE.xlf

+8
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,14 @@
801801
<source>New tab (Ctrl + T)</source>
802802
<target state="new">New tab (Ctrl + T)</target>
803803
</trans-unit>
804+
<trans-unit id="ItemSelected.Text" translate="yes" xml:space="preserve">
805+
<source>item selected</source>
806+
<target state="new">item selected</target>
807+
</trans-unit>
808+
<trans-unit id="ItemsSelected.Text" translate="yes" xml:space="preserve">
809+
<source>items selected</source>
810+
<target state="new">items selected</target>
811+
</trans-unit>
804812
</group>
805813
</body>
806814
</file>

Files/MultilingualResources/Files.es-ES.xlf

+8
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,14 @@
794794
<source>New tab (Ctrl + T)</source>
795795
<target state="translated">Nueva pestaña (Ctrl + T)</target>
796796
</trans-unit>
797+
<trans-unit id="ItemSelected.Text" translate="yes" xml:space="preserve">
798+
<source>item selected</source>
799+
<target state="new">item selected</target>
800+
</trans-unit>
801+
<trans-unit id="ItemsSelected.Text" translate="yes" xml:space="preserve">
802+
<source>items selected</source>
803+
<target state="new">items selected</target>
804+
</trans-unit>
797805
</group>
798806
</body>
799807
</file>

Files/MultilingualResources/Files.fr-FR.xlf

+8
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,14 @@
797797
<source>New tab (Ctrl + T)</source>
798798
<target state="new">New tab (Ctrl + T)</target>
799799
</trans-unit>
800+
<trans-unit id="ItemSelected.Text" translate="yes" xml:space="preserve">
801+
<source>item selected</source>
802+
<target state="new">item selected</target>
803+
</trans-unit>
804+
<trans-unit id="ItemsSelected.Text" translate="yes" xml:space="preserve">
805+
<source>items selected</source>
806+
<target state="new">items selected</target>
807+
</trans-unit>
800808
</group>
801809
</body>
802810
</file>

Files/MultilingualResources/Files.it-IT.xlf

+8
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,14 @@
801801
<source>New tab (Ctrl + T)</source>
802802
<target state="new">New tab (Ctrl + T)</target>
803803
</trans-unit>
804+
<trans-unit id="ItemSelected.Text" translate="yes" xml:space="preserve">
805+
<source>item selected</source>
806+
<target state="new">item selected</target>
807+
</trans-unit>
808+
<trans-unit id="ItemsSelected.Text" translate="yes" xml:space="preserve">
809+
<source>items selected</source>
810+
<target state="new">items selected</target>
811+
</trans-unit>
804812
</group>
805813
</body>
806814
</file>

Files/MultilingualResources/Files.ja-JP.xlf

+8
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,14 @@
794794
<source>New tab (Ctrl + T)</source>
795795
<target state="translated">新しいタブ (Ctrl + T)</target>
796796
</trans-unit>
797+
<trans-unit id="ItemSelected.Text" translate="yes" xml:space="preserve">
798+
<source>item selected</source>
799+
<target state="new">item selected</target>
800+
</trans-unit>
801+
<trans-unit id="ItemsSelected.Text" translate="yes" xml:space="preserve">
802+
<source>items selected</source>
803+
<target state="new">items selected</target>
804+
</trans-unit>
797805
</group>
798806
</body>
799807
</file>

Files/MultilingualResources/Files.nl-NL.xlf

+8
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,14 @@
797797
<source>New tab (Ctrl + T)</source>
798798
<target state="new">New tab (Ctrl + T)</target>
799799
</trans-unit>
800+
<trans-unit id="ItemSelected.Text" translate="yes" xml:space="preserve">
801+
<source>item selected</source>
802+
<target state="new">item selected</target>
803+
</trans-unit>
804+
<trans-unit id="ItemsSelected.Text" translate="yes" xml:space="preserve">
805+
<source>items selected</source>
806+
<target state="new">items selected</target>
807+
</trans-unit>
800808
</group>
801809
</body>
802810
</file>

Files/MultilingualResources/Files.pl-PL.xlf

+8
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,14 @@
797797
<source>New tab (Ctrl + T)</source>
798798
<target state="new">New tab (Ctrl + T)</target>
799799
</trans-unit>
800+
<trans-unit id="ItemSelected.Text" translate="yes" xml:space="preserve">
801+
<source>item selected</source>
802+
<target state="new">item selected</target>
803+
</trans-unit>
804+
<trans-unit id="ItemsSelected.Text" translate="yes" xml:space="preserve">
805+
<source>items selected</source>
806+
<target state="new">items selected</target>
807+
</trans-unit>
800808
</group>
801809
</body>
802810
</file>

Files/MultilingualResources/Files.ru-RU.xlf

+8
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,14 @@
799799
<source>New tab (Ctrl + T)</source>
800800
<target state="new">New tab (Ctrl + T)</target>
801801
</trans-unit>
802+
<trans-unit id="ItemSelected.Text" translate="yes" xml:space="preserve">
803+
<source>item selected</source>
804+
<target state="new">item selected</target>
805+
</trans-unit>
806+
<trans-unit id="ItemsSelected.Text" translate="yes" xml:space="preserve">
807+
<source>items selected</source>
808+
<target state="new">items selected</target>
809+
</trans-unit>
802810
</group>
803811
</body>
804812
</file>

Files/MultilingualResources/Files.ta.xlf

+8
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,14 @@
800800
<source>New tab (Ctrl + T)</source>
801801
<target state="new">New tab (Ctrl + T)</target>
802802
</trans-unit>
803+
<trans-unit id="ItemSelected.Text" translate="yes" xml:space="preserve">
804+
<source>item selected</source>
805+
<target state="new">item selected</target>
806+
</trans-unit>
807+
<trans-unit id="ItemsSelected.Text" translate="yes" xml:space="preserve">
808+
<source>items selected</source>
809+
<target state="new">items selected</target>
810+
</trans-unit>
803811
</group>
804812
</body>
805813
</file>

Files/MultilingualResources/Files.tr-TR.xlf

+8
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,14 @@
797797
<source>New tab (Ctrl + T)</source>
798798
<target state="new">New tab (Ctrl + T)</target>
799799
</trans-unit>
800+
<trans-unit id="ItemSelected.Text" translate="yes" xml:space="preserve">
801+
<source>item selected</source>
802+
<target state="new">item selected</target>
803+
</trans-unit>
804+
<trans-unit id="ItemsSelected.Text" translate="yes" xml:space="preserve">
805+
<source>items selected</source>
806+
<target state="new">items selected</target>
807+
</trans-unit>
800808
</group>
801809
</body>
802810
</file>

Files/MultilingualResources/Files.uk-UA.xlf

+8
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,14 @@
799799
<source>New tab (Ctrl + T)</source>
800800
<target state="new">New tab (Ctrl + T)</target>
801801
</trans-unit>
802+
<trans-unit id="ItemSelected.Text" translate="yes" xml:space="preserve">
803+
<source>item selected</source>
804+
<target state="new">item selected</target>
805+
</trans-unit>
806+
<trans-unit id="ItemsSelected.Text" translate="yes" xml:space="preserve">
807+
<source>items selected</source>
808+
<target state="new">items selected</target>
809+
</trans-unit>
802810
</group>
803811
</body>
804812
</file>

0 commit comments

Comments
 (0)