~haowenl/vorg-windows

7583a3de9efcbd936135ad2e39e94294e4a097be — Haowen Liu 11 months ago dcf7692
Add regenerate thumbnails button
M libvorg => libvorg +1 -1
@@ 1,1 1,1 @@
Subproject commit b2dced63b67d236068e73bc3a9584b04b6588262
Subproject commit 053ddccf53ac9c64d6ba113da03ad4ecbac688fa

M vorg-windows/App.xaml.cpp => vorg-windows/App.xaml.cpp +5 -0
@@ 302,6 302,11 @@ hstring App::ValidateRepoData(int maxLines) const
    }
}

void App::RegenerateAllThumbnails() const
{
    mRepo->regenerateAllThumbnails();
}

hstring App::GetVorgError() const
{
    if (mRepo == nullptr)

M vorg-windows/App.xaml.h => vorg-windows/App.xaml.h +1 -0
@@ 37,6 37,7 @@ struct App : AppT<App>
        const hstring &actor) const;
    Windows::Foundation::Collections::IVector<Windows::Foundation::IInspectable> CompleteTags(const hstring &tag) const;
    hstring ValidateRepoData(int maxLines) const;
    void RegenerateAllThumbnails() const;

    // Error handling
    hstring GetVorgError() const;

M vorg-windows/BrowseGalleryPage.xaml => vorg-windows/BrowseGalleryPage.xaml +14 -0
@@ 30,11 30,24 @@
            Margin="0,0,0,22"
            VerticalAlignment="Top"
            Background="Transparent">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <TextBlock
                Grid.Column="0"
                VerticalAlignment="Center"
                FontSize="22"
                Style="{StaticResource TitleTextBlockStyle}"
                Text="Browse Repository" />
            <Button
                x:Name="FilterButton"
                Grid.Column="1"
                HorizontalAlignment="Right"
                Click="FilterButton_Click"
                Content="&#xe71c;"
                FontFamily="Segoe Fluent Icons"
                IsTabStop="False" />
        </Grid>

        <GridView


@@ 43,4 56,5 @@
            ItemsSource="{x:Bind GalleryData, Mode=OneWay}"
            SelectionMode="Single" />
    </StackPanel>

</Page>

M vorg-windows/BrowseGalleryPage.xaml.cpp => vorg-windows/BrowseGalleryPage.xaml.cpp +5 -0
@@ 47,3 47,8 @@ void BrowseGalleryPage::Thumbnail_DoubleTapped(Windows::Foundation::IInspectable
    mShowVideoDetailEvent(*this, videoData.Hash());
}
} // namespace winrt::vorg_windows::implementation

void winrt::vorg_windows::implementation::BrowseGalleryPage::FilterButton_Click(
    winrt::Windows::Foundation::IInspectable const &sender, winrt::Microsoft::UI::Xaml::RoutedEventArgs const &e)
{
}

M vorg-windows/BrowseGalleryPage.xaml.h => vorg-windows/BrowseGalleryPage.xaml.h +4 -0
@@ 28,6 28,10 @@ struct BrowseGalleryPage : BrowseGalleryPageT<BrowseGalleryPage>

    // Events
    event<Windows::Foundation::TypedEventHandler<vorg_windows::BrowseGalleryPage, hstring>> mShowVideoDetailEvent;

  public:
    void FilterButton_Click(winrt::Windows::Foundation::IInspectable const &sender,
                            winrt::Microsoft::UI::Xaml::RoutedEventArgs const &e);
};
} // namespace winrt::vorg_windows::implementation


M vorg-windows/ManagePage.xaml => vorg-windows/ManagePage.xaml +3 -1
@@ 14,7 14,9 @@
    <StackPanel
        HorizontalAlignment="Center"
        VerticalAlignment="Center"
        Orientation="Horizontal">
        Orientation="Horizontal"
        Spacing="16">
        <Button x:Name="ValidateButton" Click="ValidateButton_Click">Validate repo data</Button>
        <Button x:Name="ThumbnailButton" Click="ThumbnailButton_Click">Regenerate thumbmnails</Button>
    </StackPanel>
</Page>

M vorg-windows/ManagePage.xaml.cpp => vorg-windows/ManagePage.xaml.cpp +8 -4
@@ 11,9 11,6 @@
using namespace winrt;
using namespace Microsoft::UI::Xaml;

// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.

namespace winrt::vorg_windows::implementation
{
ManagePage::ManagePage()


@@ 25,7 22,8 @@ ManagePage::ManagePage()
        Application::Current().as<default_interface<vorg_windows::implementation::App>>()));
}

void ManagePage::ValidateButton_Click(IInspectable const &, RoutedEventArgs const &)
void ManagePage::ValidateButton_Click(const Windows::Foundation::IInspectable &,
                                      const Microsoft::UI::Xaml::RoutedEventArgs &)
{
    hstring msg = mApp->ValidateRepoData(10);
    if (msg.empty())


@@ 37,4 35,10 @@ void ManagePage::ValidateButton_Click(IInspectable const &, RoutedEventArgs cons
        mApp->ShowErrorDialog(L"Repository is corrupted", msg);
    }
}

void ManagePage::ThumbnailButton_Click(const Windows::Foundation::IInspectable &sender,
                                       const Microsoft::UI::Xaml::RoutedEventArgs &e)
{
    mApp->RegenerateAllThumbnails();
}
} // namespace winrt::vorg_windows::implementation

M vorg-windows/ManagePage.xaml.h => vorg-windows/ManagePage.xaml.h +5 -2
@@ 13,8 13,11 @@ struct ManagePage : ManagePageT<ManagePage>
{
    ManagePage();

    void ValidateButton_Click(Windows::Foundation::IInspectable const &sender,
                              Microsoft::UI::Xaml::RoutedEventArgs const &args);
    void ValidateButton_Click(const Windows::Foundation::IInspectable &sender,
                              const Microsoft::UI::Xaml::RoutedEventArgs &args);

    void ThumbnailButton_Click(const Windows::Foundation::IInspectable &sender,
                               const Microsoft::UI::Xaml::RoutedEventArgs &e);

  private:
    // App ptr