Skip to content

Commit 4d62382

Browse files
committed
Add InfoBar & ExceptionWindow
Sentry, HttpDownloadDialog whitespace and properties, Settings/Themes page UI adjustments.
1 parent e5dc118 commit 4d62382

16 files changed

Lines changed: 475 additions & 72 deletions

OpenNet/Core/ApplicationModel/PackageIdentityAdapter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ namespace OpenNet::Core::ApplicationModel
124124
return directory;
125125
}
126126

127-
std::wstring PackageIdentityAdapter::GetFamilyName()
127+
winrt::hstring PackageIdentityAdapter::GetFamilyName()
128128
{
129129
static std::once_flag flag;
130-
static std::wstring familyName;
130+
static winrt::hstring familyName;
131131

132132
std::call_once(flag, []()
133133
{
@@ -136,7 +136,7 @@ namespace OpenNet::Core::ApplicationModel
136136
try
137137
{
138138
auto package = winrt::Windows::ApplicationModel::Package::Current();
139-
familyName = std::wstring(package.Id().FamilyName());
139+
familyName = package.Id().FamilyName();
140140
}
141141
catch (...)
142142
{

OpenNet/Core/ApplicationModel/PackageIdentityAdapter.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ namespace OpenNet::Core::ApplicationModel
1717
int Minor;
1818
int Build;
1919

20-
std::wstring ToString() const
20+
std::string ToString() const
2121
{
22-
return std::to_wstring(Major) + L"." + std::to_wstring(Minor) + L"." + std::to_wstring(Build);
22+
return std::to_string(Major) + "." + std::to_string(Minor) + "." + std::to_string(Build);
2323
}
2424
};
2525

@@ -29,7 +29,7 @@ namespace OpenNet::Core::ApplicationModel
2929
static bool HasPackageIdentity();
3030
static Version GetAppVersion();
3131
static std::wstring GetAppDirectory();
32-
static std::wstring GetFamilyName();
32+
static winrt::hstring GetFamilyName();
3333
static std::wstring GetPublisherId();
3434

3535
private:

OpenNet/OpenNet.vcxproj

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@
295295
<DependentUpon>UI\Xaml\View\Dialog\HttpDownloadDialog.xaml</DependentUpon>
296296
<SubType>Code</SubType>
297297
</ClInclude>
298+
<ClInclude Include="UI\Xaml\View\InfoBarView.xaml.h">
299+
<DependentUpon>UI\Xaml\View\InfoBarView.xaml</DependentUpon>
300+
<SubType>Code</SubType>
301+
</ClInclude>
298302
<ClInclude Include="UI\Xaml\View\Pages\SettingsPages\AdvancedOptionItem.h" />
299303
<ClInclude Include="UI\Xaml\View\Pages\SettingsPages\BittorrentSettingsPage.xaml.h">
300304
<DependentUpon>UI\Xaml\View\Pages\SettingsPages\BittorrentSettingsPage.xaml</DependentUpon>
@@ -336,6 +340,10 @@
336340
<DependentUpon>UI\Xaml\View\Pages\TorrentCheckGeneralPage.xaml</DependentUpon>
337341
<SubType>Code</SubType>
338342
</ClInclude>
343+
<ClInclude Include="UI\Xaml\View\Windows\ExceptionWindow.xaml.h">
344+
<DependentUpon>UI\Xaml\View\Windows\ExceptionWindow.xaml</DependentUpon>
345+
<SubType>Code</SubType>
346+
</ClInclude>
339347
<ClInclude Include="UI\Xaml\View\Windows\TorrentCheckModalWindow.xaml.h">
340348
<DependentUpon>UI\Xaml\View\Windows\TorrentCheckModalWindow.xaml</DependentUpon>
341349
<SubType>Code</SubType>
@@ -526,6 +534,9 @@
526534
<Page Include="UI\Xaml\View\Dialog\HttpDownloadDialog.xaml">
527535
<SubType>Designer</SubType>
528536
</Page>
537+
<Page Include="UI\Xaml\View\InfoBarView.xaml">
538+
<SubType>Designer</SubType>
539+
</Page>
529540
<Page Include="UI\Xaml\View\Pages\SettingsPages\BittorrentSettingsPage.xaml">
530541
<SubType>Designer</SubType>
531542
</Page>
@@ -556,6 +567,9 @@
556567
<Page Include="UI\Xaml\View\Pages\TorrentCheckGeneralPage.xaml">
557568
<SubType>Designer</SubType>
558569
</Page>
570+
<Page Include="UI\Xaml\View\Windows\ExceptionWindow.xaml">
571+
<SubType>Designer</SubType>
572+
</Page>
559573
<Page Include="UI\Xaml\View\Windows\TorrentCheckModalWindow.xaml">
560574
<SubType>Designer</SubType>
561575
</Page>
@@ -726,6 +740,10 @@
726740
<DependentUpon>UI\Xaml\View\Dialog\HttpDownloadDialog.xaml</DependentUpon>
727741
<SubType>Code</SubType>
728742
</ClCompile>
743+
<ClCompile Include="UI\Xaml\View\InfoBarView.xaml.cpp">
744+
<DependentUpon>UI\Xaml\View\InfoBarView.xaml</DependentUpon>
745+
<SubType>Code</SubType>
746+
</ClCompile>
729747
<ClCompile Include="UI\Xaml\View\Pages\SettingsPages\AdvancedOptionItem.cpp" />
730748
<ClCompile Include="UI\Xaml\View\Pages\SettingsPages\BittorrentSettingsPage.xaml.cpp">
731749
<DependentUpon>UI\Xaml\View\Pages\SettingsPages\BittorrentSettingsPage.xaml</DependentUpon>
@@ -767,6 +785,10 @@
767785
<DependentUpon>UI\Xaml\View\Pages\TorrentCheckGeneralPage.xaml</DependentUpon>
768786
<SubType>Code</SubType>
769787
</ClCompile>
788+
<ClCompile Include="UI\Xaml\View\Windows\ExceptionWindow.xaml.cpp">
789+
<DependentUpon>UI\Xaml\View\Windows\ExceptionWindow.xaml</DependentUpon>
790+
<SubType>Code</SubType>
791+
</ClCompile>
770792
<ClCompile Include="UI\Xaml\View\Windows\TorrentCheckModalWindow.xaml.cpp">
771793
<DependentUpon>UI\Xaml\View\Windows\TorrentCheckModalWindow.xaml</DependentUpon>
772794
<SubType>Code</SubType>
@@ -986,6 +1008,10 @@
9861008
<DependentUpon>UI\Xaml\View\Dialog\HttpDownloadDialog.xaml</DependentUpon>
9871009
<SubType>Code</SubType>
9881010
</Midl>
1011+
<Midl Include="UI\Xaml\View\InfoBarView.idl">
1012+
<DependentUpon>UI\Xaml\View\InfoBarView.xaml</DependentUpon>
1013+
<SubType>Code</SubType>
1014+
</Midl>
9891015
<Midl Include="UI\Xaml\View\Pages\SettingsPages\AdvancedOptionItem.idl" />
9901016
<Midl Include="UI\Xaml\View\Pages\SettingsPages\BittorrentSettingsPage.idl">
9911017
<DependentUpon>UI\Xaml\View\Pages\SettingsPages\BittorrentSettingsPage.xaml</DependentUpon>
@@ -1027,6 +1053,10 @@
10271053
<DependentUpon>UI\Xaml\View\Pages\TorrentCheckGeneralPage.xaml</DependentUpon>
10281054
<SubType>Code</SubType>
10291055
</Midl>
1056+
<Midl Include="UI\Xaml\View\Windows\ExceptionWindow.idl">
1057+
<DependentUpon>UI\Xaml\View\Windows\ExceptionWindow.xaml</DependentUpon>
1058+
<SubType>Code</SubType>
1059+
</Midl>
10301060
<Midl Include="UI\Xaml\View\Windows\TorrentCheckModalWindow.idl">
10311061
<DependentUpon>UI\Xaml\View\Windows\TorrentCheckModalWindow.xaml</DependentUpon>
10321062
<SubType>Code</SubType>

OpenNet/OpenNet.vcxproj.filters

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@
120120
</Page>
121121
<Page Include="UI\Xaml\View\Pages\SettingsPages\ThemeSettingBackdropCustomizePage.xaml" />
122122
<Page Include="UI\Xaml\View\Pages\SettingsPages\FontCustomizePage.xaml" />
123+
<Page Include="UI\Xaml\View\Windows\ExceptionWindow.xaml" />
124+
<Page Include="UI\Xaml\View\InfoBarView.xaml" />
123125
</ItemGroup>
124126
<ItemGroup>
125127
<Midl Include="MainWindow.idl" />
Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8" ?>
1+
<?xml version="1.0" encoding="utf-8" ?>
22
<ContentDialog
33
x:Class="OpenNet.UI.Xaml.View.Dialog.HttpDownloadDialog"
44
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
@@ -9,10 +9,10 @@
99
x:Name="ViewDialogHttpDownloadDialog"
1010
x:Uid="ViewDialogHttpDownloadDialog"
1111
Title="New HTTP Download"
12+
CloseButtonText="Cancel"
1213
DefaultButton="Primary"
1314
PrimaryButtonClick="OnPrimaryButtonClick"
1415
PrimaryButtonText="Download"
15-
CloseButtonText="Cancel"
1616
Style="{StaticResource DefaultContentDialogStyle}"
1717
mc:Ignorable="d">
1818

@@ -22,7 +22,7 @@
2222
Padding="16"
2323
Spacing="12">
2424

25-
<!-- URL Input -->
25+
<!-- URL Input -->
2626
<TextBox
2727
x:Name="UrlBox"
2828
x:Uid="HttpDownloadDialogUrlBox"
@@ -32,61 +32,59 @@
3232
PlaceholderText="https://example.com/file.zip"
3333
ScrollViewer.VerticalScrollBarVisibility="Auto"
3434
TextChanged="UrlBox_TextChanged"
35-
TextWrapping="Wrap"/>
35+
TextWrapping="Wrap" />
3636

37-
<!-- Paste from clipboard -->
37+
<!-- Paste from clipboard -->
3838
<Button
3939
x:Name="PasteUrlButton"
4040
x:Uid="HttpDownloadDialogPasteButton"
4141
Click="PasteUrlButton_Click">
4242
<Button.Content>
43-
<StackPanel Orientation="Horizontal"
44-
Spacing="6">
45-
<FontIcon FontSize="14"
46-
Glyph="&#xE16F;"/>
47-
<TextBlock x:Uid="HttpDownloadDialogPasteButtonText"/>
43+
<StackPanel Orientation="Horizontal" Spacing="6">
44+
<FontIcon FontSize="14" Glyph="&#xE16F;" />
45+
<TextBlock x:Uid="HttpDownloadDialogPasteButtonText" />
4846
</StackPanel>
4947
</Button.Content>
5048
</Button>
5149

52-
<!-- Save Directory -->
50+
<!-- Save Directory -->
5351
<Grid>
5452
<Grid.ColumnDefinitions>
55-
<ColumnDefinition Width="*"/>
56-
<ColumnDefinition Width="Auto"/>
53+
<ColumnDefinition Width="*" />
54+
<ColumnDefinition Width="Auto" />
5755
</Grid.ColumnDefinitions>
5856
<TextBox
5957
x:Name="SaveDirBox"
6058
x:Uid="HttpDownloadDialogSaveDirBox"
6159
Grid.Column="0"
6260
Header="Save to"
6361
IsReadOnly="True"
64-
PlaceholderText="Default download directory"/>
62+
PlaceholderText="Default download directory" />
6563
<Button
6664
x:Name="BrowseDirButton"
6765
x:Uid="HttpDownloadDialogBrowseButton"
6866
Grid.Column="1"
6967
Margin="8,0,0,0"
7068
VerticalAlignment="Bottom"
7169
Click="BrowseDirButton_Click"
72-
Content="Browse..."/>
70+
Content="Browse..." />
7371
</Grid>
7472

75-
<!-- Custom Filename -->
73+
<!-- Custom Filename -->
7674
<TextBox
7775
x:Name="FileNameBox"
7876
x:Uid="HttpDownloadDialogFileNameBox"
7977
Header="File name (optional)"
80-
PlaceholderText="Leave empty to auto-detect"/>
78+
PlaceholderText="Leave empty to auto-detect" />
8179

82-
<!-- Validation Error -->
80+
<!-- Validation Error -->
8381
<InfoBar
8482
x:Name="UrlErrorInfoBar"
8583
x:Uid="HttpDownloadDialogUrlErrorInfoBar"
8684
Title="Invalid URL"
8785
IsClosable="False"
8886
IsOpen="False"
8987
Message="Please enter a valid HTTP, HTTPS, or FTP URL."
90-
Severity="Error"/>
88+
Severity="Error" />
9189
</StackPanel>
9290
</ContentDialog>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace OpenNet.UI.Xaml.View
2+
{
3+
[default_interface]
4+
runtimeclass InfoBarView : Microsoft.UI.Xaml.Controls.UserControl
5+
{
6+
InfoBarView();
7+
8+
}
9+
}

0 commit comments

Comments
 (0)