Skip to content

Commit

Permalink
Preparing Import Dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Oct 20, 2023
1 parent 80c1d74 commit 4da2d6c
Show file tree
Hide file tree
Showing 15 changed files with 105 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Portal/Sucrose.Portal/Views/Controls/ThemeImport.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<Style BasedOn="{StaticResource {x:Type ui:ContentDialog}}" TargetType="{x:Type local:ThemeImport}" />
</ui:ContentDialog.Resources>

<StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Center" Orientation="Vertical" MinWidth="400">
<StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Center" Orientation="Vertical" MinHeight="250" MinWidth="400">
<TextBlock x:Name="ThemeImportInfo" Text="{DynamicResource Portal.ThemeImport.Info}" TextWrapping="WrapWithOverflow" FontSize="14" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
</StackPanel>
</ui:ContentDialog>
15 changes: 14 additions & 1 deletion src/Portal/Sucrose.Portal/Views/Pages/LibraryPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
using SSDECT = Sucrose.Shared.Dependency.Enum.CompatibilityType;
using SSZEZ = Sucrose.Shared.Zip.Extension.Zip;
using SSZHA = Sucrose.Shared.Zip.Helper.Archive;
using SPVCTI = Sucrose.Portal.Views.Controls.ThemeImport;
using Sucrose.Shared.Space.Helper;
using Sucrose.Shared.Theme.Helper;

namespace Sucrose.Portal.Views.Pages
{
Expand Down Expand Up @@ -158,6 +161,7 @@ private async void GridLibrary_Drop(object sender, DragEventArgs e)
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
bool State = false;
List<SSDECT> Types = new();
List<string> Messages = new();
string[] Files = (string[])e.Data.GetData(DataFormats.FileDrop);

Expand Down Expand Up @@ -190,6 +194,7 @@ private async void GridLibrary_Drop(object sender, DragEventArgs e)
}
else
{
Types.Add(Result);
Messages.Add($"{Path.GetFileNameWithoutExtension(Record)} adlı tema kütüphaneye eklenemedi. Nedeni: {Result}");
}
}
Expand All @@ -206,7 +211,15 @@ private async void GridLibrary_Drop(object sender, DragEventArgs e)

Messages.ForEach(Message => SB.AppendLine(Message));

System.Windows.MessageBox.Show(SB.ToString());
SPVCTI ThemeImport = new()
{
Types = Types,
Info = SB.ToString()
};

await ThemeImport.ShowAsync();

ThemeImport.Dispose();
}

if (State)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<ResourceDictionary Source="LibraryCard/Portal.LibraryCard.DE.xaml" />
<ResourceDictionary Source="ThemeDelete/Portal.ThemeDelete.DE.xaml" />
<ResourceDictionary Source="ThemeReview/Portal.ThemeReview.DE.xaml" />
<ResourceDictionary Source="ThemeImport/Portal.ThemeImport.DE.xaml" />
<ResourceDictionary Source="ExpanderCard/Portal.ExpanderCard.DE.xaml" />
<ResourceDictionary Source="DisplayPreferences/Portal.DisplayPreferences.DE.xaml" />
</ResourceDictionary.MergedDictionaries>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<ResourceDictionary Source="LibraryCard/Portal.LibraryCard.EN.xaml" />
<ResourceDictionary Source="ThemeDelete/Portal.ThemeDelete.EN.xaml" />
<ResourceDictionary Source="ThemeReview/Portal.ThemeReview.EN.xaml" />
<ResourceDictionary Source="ThemeImport/Portal.ThemeImport.EN.xaml" />
<ResourceDictionary Source="ExpanderCard/Portal.ExpanderCard.EN.xaml" />
<ResourceDictionary Source="DisplayPreferences/Portal.DisplayPreferences.EN.xaml" />
</ResourceDictionary.MergedDictionaries>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<ResourceDictionary Source="LibraryCard/Portal.LibraryCard.ES.xaml" />
<ResourceDictionary Source="ThemeDelete/Portal.ThemeDelete.ES.xaml" />
<ResourceDictionary Source="ThemeReview/Portal.ThemeReview.ES.xaml" />
<ResourceDictionary Source="ThemeImport/Portal.ThemeImport.ES.xaml" />
<ResourceDictionary Source="ExpanderCard/Portal.ExpanderCard.ES.xaml" />
<ResourceDictionary Source="DisplayPreferences/Portal.DisplayPreferences.ES.xaml" />
</ResourceDictionary.MergedDictionaries>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<ResourceDictionary Source="LibraryCard/Portal.LibraryCard.FR.xaml" />
<ResourceDictionary Source="ThemeDelete/Portal.ThemeDelete.FR.xaml" />
<ResourceDictionary Source="ThemeReview/Portal.ThemeReview.FR.xaml" />
<ResourceDictionary Source="ThemeImport/Portal.ThemeImport.FR.xaml" />
<ResourceDictionary Source="ExpanderCard/Portal.ExpanderCard.FR.xaml" />
<ResourceDictionary Source="DisplayPreferences/Portal.DisplayPreferences.FR.xaml" />
</ResourceDictionary.MergedDictionaries>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<ResourceDictionary Source="LibraryCard/Portal.LibraryCard.PL.xaml" />
<ResourceDictionary Source="ThemeDelete/Portal.ThemeDelete.PL.xaml" />
<ResourceDictionary Source="ThemeReview/Portal.ThemeReview.PL.xaml" />
<ResourceDictionary Source="ThemeImport/Portal.ThemeImport.PL.xaml" />
<ResourceDictionary Source="ExpanderCard/Portal.ExpanderCard.PL.xaml" />
<ResourceDictionary Source="DisplayPreferences/Portal.DisplayPreferences.PL.xaml" />
</ResourceDictionary.MergedDictionaries>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<ResourceDictionary Source="LibraryCard/Portal.LibraryCard.TR.xaml" />
<ResourceDictionary Source="ThemeDelete/Portal.ThemeDelete.TR.xaml" />
<ResourceDictionary Source="ThemeReview/Portal.ThemeReview.TR.xaml" />
<ResourceDictionary Source="ThemeImport/Portal.ThemeImport.TR.xaml" />
<ResourceDictionary Source="ExpanderCard/Portal.ExpanderCard.TR.xaml" />
<ResourceDictionary Source="DisplayPreferences/Portal.DisplayPreferences.TR.xaml" />
</ResourceDictionary.MergedDictionaries>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<ResourceDictionary
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<system:String x:Key="Portal.ThemeImport.Title">Tema İçeri Aktarma</system:String>
<system:String x:Key="Portal.ThemeImport.Close">Kapat</system:String>

<system:String x:Key="Portal.ThemeImport.TestTitle">Test</system:String>
</ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<ResourceDictionary
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<system:String x:Key="Portal.ThemeImport.Title">Tema İçeri Aktarma</system:String>
<system:String x:Key="Portal.ThemeImport.Close">Kapat</system:String>

<system:String x:Key="Portal.ThemeImport.TestTitle">Test</system:String>
</ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<ResourceDictionary
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<system:String x:Key="Portal.ThemeImport.Title">Tema İçeri Aktarma</system:String>
<system:String x:Key="Portal.ThemeImport.Close">Kapat</system:String>

<system:String x:Key="Portal.ThemeImport.TestTitle">Test</system:String>
</ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<ResourceDictionary
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<system:String x:Key="Portal.ThemeImport.Title">Tema İçeri Aktarma</system:String>
<system:String x:Key="Portal.ThemeImport.Close">Kapat</system:String>

<system:String x:Key="Portal.ThemeImport.TestTitle">Test</system:String>
</ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<ResourceDictionary
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<system:String x:Key="Portal.ThemeImport.Title">Tema İçeri Aktarma</system:String>
<system:String x:Key="Portal.ThemeImport.Close">Kapat</system:String>

<system:String x:Key="Portal.ThemeImport.TestTitle">Test</system:String>
</ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<ResourceDictionary
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>
<system:String x:Key="Portal.ThemeImport.Title">Tema İçeri Aktarma</system:String>
<system:String x:Key="Portal.ThemeImport.Close">Kapat</system:String>

<system:String x:Key="Portal.ThemeImport.Info">Bilgi</system:String>
</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,30 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Locales\Portal\Controls\ThemeImport\Portal.ThemeImport.PL.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Locales\Portal\Controls\ThemeImport\Portal.ThemeImport.FR.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Locales\Portal\Controls\ThemeImport\Portal.ThemeImport.DE.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Locales\Portal\Controls\ThemeImport\Portal.ThemeImport.ES.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Locales\Portal\Controls\ThemeImport\Portal.ThemeImport.EN.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Locales\Portal\Controls\ThemeImport\Portal.ThemeImport.TR.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Locales\Portal\Controls\ThemeShare\Portal.ThemeShare.DE.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down

0 comments on commit 4da2d6c

Please sign in to comment.