Skip to content

Commit 957019c

Browse files
committed
feat: UI improvements
1 parent 26fae20 commit 957019c

6 files changed

Lines changed: 29 additions & 8 deletions

File tree

flatpak/org.nickvision.application.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
{
5050
"type": "git",
5151
"url": "https://github.com/libcpr/cpr",
52-
"commit": "b14cd346bf3657ac046ebde136bd9300ce885c5e"
52+
"commit": "a0ff651296a620ed5fabf7d12cf4905fefc7ce86"
5353
}
5454
]
5555
},

libapplication/src/controllers/mainwindowcontroller.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,8 @@ namespace Nickvision::Application::Shared::Controllers
180180
m_appUpdateProgressChanged.invoke({ static_cast<double>(static_cast<long double>(downloadNow) / static_cast<long double>(downloadTotal)) });
181181
return true;
182182
} }) };
183-
if(res)
184-
{
185-
m_appUpdateProgressChanged.invoke({ 1.0 });
186-
}
187-
else
183+
m_appUpdateProgressChanged.invoke({ 1.0 });
184+
if(!res)
188185
{
189186
AppNotification::send({ _("Unable to download and install update"), NotificationSeverity::Error });
190187
}

org.nickvision.application.winui/Views/MainWindow.xaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,14 @@
173173
</Grid>
174174
</Grid>
175175

176-
<Grid x:Name="PageUpdateCenter" Margin="24,24,24,24" RowSpacing="24">
176+
<Grid x:Name="PageUpdateCenter" Margin="24,24,24,6" RowSpacing="24">
177177
<Grid.RowDefinitions>
178178
<RowDefinition Height="Auto"/>
179179
<RowDefinition Height="Auto"/>
180180
<RowDefinition Height="Auto"/>
181181
<RowDefinition Height="Auto"/>
182182
<RowDefinition Height="*"/>
183+
<RowDefinition Height="Auto"/>
183184
</Grid.RowDefinitions>
184185

185186
<TextBlock x:Name="LblUpdateCenter" Grid.Row="0" FontSize="26" Style="{ThemeResource NavigationViewItemHeaderTextStyle}"/>
@@ -267,6 +268,14 @@
267268

268269
<TextBlock x:Name="LblUpdatesChangelog" Margin="0,6,0,0" TextWrapping="WrapWholeWords"/>
269270
</StackPanel>
271+
272+
<CommandBar Grid.Row="5" DefaultLabelPosition="Right">
273+
<AppBarButton x:Name="BtnCopyDebugInformation" Click="CopyDebugInformation">
274+
<AppBarButton.Icon>
275+
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE8C8;"/>
276+
</AppBarButton.Icon>
277+
</AppBarButton>
278+
</CommandBar>
270279
</Grid>
271280

272281
<Frame x:Name="PageCustom"/>

org.nickvision.application.winui/Views/MainWindow.xaml.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ using namespace winrt::Microsoft::UI::Xaml;
1818
using namespace winrt::Microsoft::UI::Xaml::Controls;
1919
using namespace winrt::Microsoft::UI::Xaml::Controls::Primitives;
2020
using namespace winrt::Microsoft::UI::Xaml::Input;
21+
using namespace winrt::Windows::ApplicationModel::DataTransfer;
2122
using namespace winrt::Windows::Graphics;
2223
using namespace winrt::Windows::Storage;
2324
using namespace winrt::Windows::Storage::Pickers;
@@ -260,6 +261,14 @@ namespace winrt::Nickvision::Application::WinUI::Views::implementation
260261
co_await Launcher::LaunchUriAsync(Windows::Foundation::Uri{ winrt::to_hstring(m_controller->getAppInfo().getSupportUrl()) });
261262
}
262263

264+
void MainWindow::CopyDebugInformation(const IInspectable& sender, const RoutedEventArgs& args)
265+
{
266+
DataPackage dataPackage;
267+
dataPackage.SetText(winrt::to_hstring(m_controller->getDebugInformation()));
268+
Clipboard::SetContent(dataPackage);
269+
AppNotification::send({ _("Debug information copied to clipboard"), NotificationSeverity::Success });
270+
}
271+
263272
void MainWindow::DownloadUpdate(const IInspectable& sender, const Microsoft::UI::Xaml::RoutedEventArgs& args)
264273
{
265274
m_controller->startWindowsUpdate();

org.nickvision.application.winui/Views/MainWindow.xaml.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ namespace winrt::Nickvision::Application::WinUI::Views::implementation
106106
* @param args Microsoft::UI::Xaml::RoutedEventArgs
107107
*/
108108
Windows::Foundation::IAsyncAction Discussions(const IInspectable& sender, const Microsoft::UI::Xaml::RoutedEventArgs& args);
109+
/**
110+
* @brief Copies the debug information to the clipboard.
111+
* @param sender IInspectable
112+
* @param args Microsoft::UI::Xaml::RoutedEventArgs
113+
*/
114+
void CopyDebugInformation(const IInspectable& sender, const Microsoft::UI::Xaml::RoutedEventArgs& args);
109115
/**
110116
* @brief Downloads an application update.
111117
* @param sender IInspectable

snap/snapcraft.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ parts:
2626

2727
cpr:
2828
source: https://github.com/libcpr/cpr.git
29-
source-commit: 'b14cd346bf3657ac046ebde136bd9300ce885c5e'
29+
source-commit: 'a0ff651296a620ed5fabf7d12cf4905fefc7ce86'
3030
source-depth: 1
3131
plugin: cmake
3232
cmake-parameters:

0 commit comments

Comments
 (0)