diff --git a/AboutPage.xaml b/AboutPage.xaml new file mode 100644 index 0000000000000000000000000000000000000000..2f40828312b7443eb878a72515845f70ea8d98c2 --- /dev/null +++ b/AboutPage.xaml @@ -0,0 +1,212 @@ +<!-- ********************************************************************** +* Copyright (C) 2016 by Savoir-faire Linux * +* Author: Jäger Nicolas<nicolas.jager@savoirfairelinux.com> * +* Author: Traczyk Andreas<andreas.traczyk@savoirfairelinux.com> * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 3 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with this program. If not, see <http://www.gnu.org/licenses/> . * +*********************************************************************** --> +<Page x:Class="RingClientUWP.Views.AboutPage" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="using:RingClientUWP" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + NavigationCacheMode="Enabled" + mc:Ignorable="d"> + + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="auto"/> + </Grid.RowDefinitions> + <StackPanel Grid.Row="0" + Margin="24"> + <StackPanel Orientation="Horizontal" + HorizontalAlignment="Center"> + <Button x:Name="_aboutBasicButton_" + Content="About" + Margin="0,0,6,0" + BorderThickness="0" + FontSize="12" + Click="_aboutBasicButton__Click" + /> + <Button x:Name="_aboutCreditsButton_" + Content="Credits" + Margin="0,0,6,0" + BorderThickness="0" + FontSize="12" + Click="_aboutCreditsButton__Click" + /> + <Button x:Name="_aboutCloseButton_" + Content="Close" + Margin="0,0,6,0" + BorderThickness="0" + FontSize="12" + Click="_aboutCloseButton__Click" + /> + </StackPanel> + <Image x:Name="_welcomeImage_" + + Source="Assets\Wide310x150Logo.scale-200.png" + Width="310" + HorizontalAlignment="Center" + Margin="0 10 0 30" + Height="150"/> + <Grid x:Name="_aboutNavGrid_"> + <Grid.RowDefinitions> + <RowDefinition Height="0"/> + <RowDefinition Height="1*"/> + </Grid.RowDefinitions> + <ScrollViewer x:Name="_aboutScrollViewer_" + Grid.Row="1" + VerticalScrollBarVisibility="Hidden"> + <StackPanel MaxWidth="500" + Width="310"> + <TextBlock Text="Ring v2.0.0" + TextWrapping="Wrap" + TextAlignment="Justify" + Margin="0,0,0,24" + FontSize="12" + FontWeight="Bold" + HorizontalAlignment="Center"/> + <TextBlock Text="version:" + TextWrapping="Wrap" + TextAlignment="Justify" + FontSize="12" + HorizontalAlignment="Center"/> + <TextBlock Text="Release: Alpha - Gaston Miron" + TextWrapping="Wrap" + TextAlignment="Justify" + FontSize="12" + HorizontalAlignment="Center"/> + <TextBlock Text="The Microsoft Windows Runtime client for Ring." + TextWrapping="Wrap" + TextAlignment="Justify" + FontSize="12" + HorizontalAlignment="Center"/> + <TextBlock Text="Ring is a secured and distributed communication software." + TextWrapping="Wrap" + TextAlignment="Justify" + FontSize="12" + HorizontalAlignment="Center"/> + <HyperlinkButton Content="www.ring.cx" + FontSize="10" + NavigateUri="http://ring.cx" + HorizontalAlignment="Center"/> + <TextBlock Text="© 2015-2016 Savoir-faire Linux" + Margin="0,24,0,0" + TextWrapping="Wrap" + TextAlignment="Justify" + FontSize="10" + HorizontalAlignment="Center"/> + <TextBlock Text="This program comes with absolutely no warranty" + TextWrapping="Wrap" + TextAlignment="Justify" + FontSize="10" + HorizontalAlignment="Center"/> + <StackPanel Orientation="Horizontal" + HorizontalAlignment="Center"> + <TextBlock Text="See the " + Margin="0,0,4,0" + TextWrapping="Wrap" + TextAlignment="Justify" + FontSize="10"/> + <HyperlinkButton Content="GNU General Public License, version 3 or later" + FontSize="10" + NavigateUri="https://www.gnu.org/licenses/gpl-3.0.en.html"> + <HyperlinkButton.RenderTransform> + <TranslateTransform Y="-6"/> + </HyperlinkButton.RenderTransform> + </HyperlinkButton> + <TextBlock Text=" for details." + TextWrapping="Wrap" + TextAlignment="Justify" + FontSize="10"/> + </StackPanel> + </StackPanel> + </ScrollViewer> + <ScrollViewer x:Name="_creditsScrollViewer_" + Grid.Row="0" + VerticalScrollBarVisibility="Visible" + Height="auto" + MaxHeight="200" + Margin="24,0,24,24" + BorderBrush="Black" + BorderThickness="1"> + <StackPanel> + <TextBlock Text="Created by:" + Margin="0,0,0,0" + TextWrapping="Wrap" + TextAlignment="Center" + FontWeight="Bold" + FontSize="12" + HorizontalAlignment="Center"/> + <TextBlock Margin="0,0,0,0" + TextWrapping="Wrap" + TextAlignment="Center" + FontSize="12" + HorizontalAlignment="Center"> + <LineBreak/> Created by: + <LineBreak/> Adrien Béraud + <LineBreak/> Alexandr Sergheev + <LineBreak/> Alexandre Lision + <LineBreak/> Alexandre Viau + <LineBreak/> Aline Bonnet + <LineBreak/> Andreas Traczyk + <LineBreak/> Anthony Léonard + <LineBreak/> Cyrille Béraud + <LineBreak/> Dorina Mosku + <LineBreak/> Édric Milaret + <LineBreak/> Éloi Bail + <LineBreak/> Emmanuel Lepage-Vallée + <LineBreak/> Frédéric Guimont + <LineBreak/> Guillaume Roguez + <LineBreak/> Julien Grossholtz + <LineBreak/> Loïc Siret + <LineBreak/> Nicolas Jäger + <LineBreak/> Nicolas Reynaud + <LineBreak/> Olivier Gregoire + <LineBreak/> Olivier Soldano + <LineBreak/> Patrick Keroulas + <LineBreak/> Philippe Gorley + <LineBreak/> Romain Bertozzi + <LineBreak/> Seva Ivanov + <LineBreak/> Simon Désaulniers + <LineBreak/> Stepan Salenikovich + <LineBreak/> Simon Zeni + <LineBreak/> Thibault Wittemberg + </TextBlock> + <TextBlock Text="Artwork by:" + Margin="0,0,0,0" + TextWrapping="Wrap" + TextAlignment="Center" + FontWeight="Bold" + FontSize="12" + HorizontalAlignment="Center"/> + <TextBlock Margin="0,0,0,0" + TextWrapping="Wrap" + TextAlignment="Center" + FontSize="12" + HorizontalAlignment="Center"> + Marianne Forget + <LineBreak/> + <LineBreak/> Based on the SFLPhone project + </TextBlock> + </StackPanel> + </ScrollViewer> + </Grid> + </StackPanel> + </Grid> + + +</Page> diff --git a/AboutPage.xaml.cpp b/AboutPage.xaml.cpp new file mode 100644 index 0000000000000000000000000000000000000000..32854ab08800528a92bb30f56fc0b5ed520b0c41 --- /dev/null +++ b/AboutPage.xaml.cpp @@ -0,0 +1,53 @@ +/************************************************************************** +* Copyright (C) 2016 by Savoir-faire Linux * +* Author: J�ger Nicolas <nicolas.jager@savoirfairelinux.com> * +* Author: Traczyk Andreas <andreas.traczyk@savoirfairelinux.com> * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 3 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with this program. If not, see <http://www.gnu.org/licenses/>. * +**************************************************************************/ +#include "pch.h" + +#include "AboutPage.xaml.h" + +using namespace RingClientUWP; +using namespace RingClientUWP::Views; + +using namespace Windows::UI::ViewManagement; +using namespace Windows::UI::Core; +using namespace Windows::UI::Xaml::Controls; + +AboutPage::AboutPage() +{ + InitializeComponent(); +}; + +void RingClientUWP::Views::AboutPage::_aboutBasicButton__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) +{ + _aboutNavGrid_->SetRow(_aboutScrollViewer_, 1); + _aboutNavGrid_->SetRow(_creditsScrollViewer_, 0); +} + + +void RingClientUWP::Views::AboutPage::_aboutCreditsButton__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) +{ + _aboutNavGrid_->SetRow(_aboutScrollViewer_, 0); + _aboutNavGrid_->SetRow(_creditsScrollViewer_, 1); +} + + +void RingClientUWP::Views::AboutPage::_aboutCloseButton__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) +{ + auto rootFrame = dynamic_cast<Windows::UI::Xaml::Controls::Frame^>(Window::Current->Content); + rootFrame->Navigate(Windows::UI::Xaml::Interop::TypeName(MainPage::typeid), true); +} diff --git a/AboutPage.xaml.h b/AboutPage.xaml.h new file mode 100644 index 0000000000000000000000000000000000000000..b1e9198cf4efe86b46cf2314b47bc6fcc969132c --- /dev/null +++ b/AboutPage.xaml.h @@ -0,0 +1,37 @@ +/************************************************************************** +* Copyright (C) 2016 by Savoir-faire Linux * +* Author: J�ger Nicolas <nicolas.jager@savoirfairelinux.com> * +* Author: Traczyk Andreas <andreas.traczyk@savoirfairelinux.com> * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 3 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with this program. If not, see <http://www.gnu.org/licenses/>. * +**************************************************************************/ +#pragma once + +#include "AboutPage.g.h" + +namespace RingClientUWP +{ +namespace Views +{ +public ref class AboutPage sealed +{ +public: + AboutPage(); +private: + void _aboutBasicButton__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); + void _aboutCreditsButton__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); + void _aboutCloseButton__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); +}; +} +} \ No newline at end of file diff --git a/MainPage.xaml.cpp b/MainPage.xaml.cpp index db86d424538a0114d87be81206130737817d49a0..a91d19269ec8c59e94041a4976cadc67ae6677b0 100644 --- a/MainPage.xaml.cpp +++ b/MainPage.xaml.cpp @@ -25,6 +25,7 @@ #include "VideoPage.xaml.h" #include "PreviewPage.xaml.h" #include "WelcomePage.xaml.h" +#include "AboutPage.xaml.h" #include "MainPage.xaml.h" @@ -74,6 +75,7 @@ MainPage::MainPage() smartPanel->summonPreviewPage += ref new RingClientUWP::SummonPreviewPage(this, &RingClientUWP::MainPage::OnsummonPreviewPage); smartPanel->hidePreviewPage += ref new RingClientUWP::HidePreviewPage(this, &RingClientUWP::MainPage::OnhidePreviewPage); smartPanel->summonVideoPage += ref new RingClientUWP::SummonVideoPage(this, &RingClientUWP::MainPage::OnsummonVideoPage); + auto videoPage = dynamic_cast<VideoPage^>(_videoFrame_->Content); videoPage->pressHangUpCall += ref new RingClientUWP::PressHangUpCall(this, &RingClientUWP::MainPage::OnpressHangUpCall); auto messageTextFrame = dynamic_cast<MessageTextPage^>(_messageTextFrame_->Content); @@ -143,24 +145,11 @@ RingClientUWP::MainPage::showFrame(Windows::UI::Xaml::Controls::Frame^ frame) void RingClientUWP::MainPage::OnNavigatedTo(NavigationEventArgs ^ e) { - auto iter = BackgroundTaskRegistration::AllTasks->First(); - auto hascur = iter->HasCurrent; - while (hascur) - { - auto cur = iter->Current->Value; - cur->Unregister(true); - hascur = iter->MoveNext(); + bool fromAboutPage = (e->Parameter != nullptr) ? safe_cast<bool>(e->Parameter) : false; + if (!fromAboutPage) { + RingD::instance->init(); + showLoadingOverlay(true, false); } - BackgroundExecutionManager::RequestAccessAsync(); - BackgroundTaskBuilder^ builder = ref new BackgroundTaskBuilder(); - builder->Name = "CallRefusalBackgroundTask"; - //builder->TaskEntryPoint = "RingClientUWP.BackgroundActivity"; - builder->SetTrigger(ref new ToastNotificationActionTrigger()); - BackgroundTaskRegistration^ registration = builder->Register(); - - RingD::instance->init(); - - showLoadingOverlay(true, false); } void diff --git a/WelcomePage.xaml b/WelcomePage.xaml index b23282ef28d33b24e96910683a962503be8bcedb..ce280606a3b5bf3885b3e6650cd310b0e7836864 100644 --- a/WelcomePage.xaml +++ b/WelcomePage.xaml @@ -34,22 +34,30 @@ <RowDefinition Height="1*"/> </Grid.RowDefinitions> <StackPanel Grid.Row="1"> - <Image x:Name="_welcomeImage_" + <Image x:Name="_welcomeImage_" - Source="Assets\Wide310x150Logo.scale-200.png" - Width="310" - HorizontalAlignment="Center" - Margin="0 10 0 30" - Height="150"/> - <TextBlock Text="Ring is free software for universal communication wich respects the freedoms and privacy of its users." - Foreground="#707370" - MaxWidth="500" + Source="Assets\Wide310x150Logo.scale-200.png" Width="310" - TextWrapping="Wrap" - TextAlignment="Justify" - FontSize="12" - FontWeight="Bold" - HorizontalAlignment="Center"/> + HorizontalAlignment="Center" + Margin="0 10 0 30" + Height="150"/> + <TextBlock Text="Ring is free software for universal communication wich respects the freedoms and privacy of its users." + Foreground="#707370" + MaxWidth="500" + Width="310" + TextWrapping="Wrap" + TextAlignment="Justify" + FontSize="12" + FontWeight="Bold" + HorizontalAlignment="Center"/> + <Button x:Name="_aboutButton_" + Margin="0,48,0,0" + BorderThickness="0" + FontSize="12" + HorizontalAlignment="Center" + Content="About" + Click="_aboutButton__Click" + /> </StackPanel> </Grid> diff --git a/WelcomePage.xaml.cpp b/WelcomePage.xaml.cpp index 87c4b3bd88b78b0ba0201d30f5a4927e1e704071..1b7d42e2cb4fb2f814496dbb7caa6999f4b60b32 100644 --- a/WelcomePage.xaml.cpp +++ b/WelcomePage.xaml.cpp @@ -19,10 +19,15 @@ #include "pch.h" #include "WelcomePage.xaml.h" +#include "AboutPage.xaml.h" using namespace RingClientUWP; using namespace RingClientUWP::Views; +using namespace Windows::UI::ViewManagement; +using namespace Windows::UI::Core; +using namespace Windows::UI::Xaml::Controls; + WelcomePage::WelcomePage() { InitializeComponent(); @@ -45,4 +50,35 @@ void WelcomePage::OnResize(Platform::Object^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ e) { //PositionImage(); -} \ No newline at end of file +} + +void RingClientUWP::Views::WelcomePage::_aboutButton__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) +{ + // new window? + /*auto currentAV = ApplicationView::GetForCurrentView(); + auto newAV = CoreApplication::CreateNewView(); + newAV->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, + ref new DispatchedHandler([=]() + { + auto newWindow = Window::Current; + auto newAppView = ApplicationView::GetForCurrentView(); + newAppView->Title = "About"; + + auto frame = ref new Windows::UI::Xaml::Controls::Frame(); + frame->Navigate(Windows::UI::Xaml::Interop::TypeName(Views::AboutPage::typeid)); + newWindow->Content = frame; + newWindow->Activate(); + + ApplicationViewSwitcher::TryShowAsStandaloneAsync( + newAppView->Id, + ViewSizePreference::UseMinimum, + currentAV->Id, + ViewSizePreference::UseMinimum); + + RingD::instance->isInAbout = true; + newAppView->TryResizeView(Size(200, 200)); + }));*/ + + auto rootFrame = dynamic_cast<Windows::UI::Xaml::Controls::Frame^>(Window::Current->Content); + rootFrame->Navigate(Windows::UI::Xaml::Interop::TypeName(Views::AboutPage::typeid)); +} diff --git a/WelcomePage.xaml.h b/WelcomePage.xaml.h index 0e0c34f3a5164f37b5a1e718b25db4d78d769b24..7cf6e94357c456b23ab2931bc95a8cf02305fb70 100644 --- a/WelcomePage.xaml.h +++ b/WelcomePage.xaml.h @@ -22,6 +22,9 @@ namespace RingClientUWP { + +delegate void SummonAboutPage(); + namespace Views { public ref class WelcomePage sealed @@ -31,6 +34,10 @@ public: protected: void PositionImage(); void OnResize(Platform::Object^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ e); +private: + void _aboutButton__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); +internal: + event SummonAboutPage^ summonAboutPage; }; } } \ No newline at end of file diff --git a/ring-client-uwp.vcxproj b/ring-client-uwp.vcxproj index 0cfe56b88e86c4c99f5327663f9942d7bbd1103e..1acee4669068f8da381f402ef7922397faf59ba7 100644 --- a/ring-client-uwp.vcxproj +++ b/ring-client-uwp.vcxproj @@ -168,6 +168,9 @@ </Link> </ItemDefinitionGroup> <ItemGroup> + <ClInclude Include="AboutPage.xaml.h"> + <DependentUpon>AboutPage.xaml</DependentUpon> + </ClInclude> <ClInclude Include="Account.h" /> <ClInclude Include="AccountListItem.h" /> <ClInclude Include="AccountListItemsViewModel.h" /> @@ -231,6 +234,7 @@ <ApplicationDefinition Include="App.xaml"> <SubType>Designer</SubType> </ApplicationDefinition> + <Page Include="AboutPage.xaml" /> <Page Include="LoadingPage.xaml" /> <Page Include="MainPage.xaml"> <SubType>Designer</SubType> @@ -299,6 +303,9 @@ <Image Include="Assets\Wide310x150Logo.scale-200.png" /> </ItemGroup> <ItemGroup> + <ClCompile Include="AboutPage.xaml.cpp"> + <DependentUpon>AboutPage.xaml</DependentUpon> + </ClCompile> <ClCompile Include="Account.cpp" /> <ClCompile Include="AccountListItem.cpp" /> <ClCompile Include="AccountListItemsViewModel.cpp" /> diff --git a/ring-client-uwp.vcxproj.filters b/ring-client-uwp.vcxproj.filters index a40b465eb10f44281cdc6192b8586975c3d80fa2..09f2c29d33169beb59937bf2a4054411b4dbcdcd 100644 --- a/ring-client-uwp.vcxproj.filters +++ b/ring-client-uwp.vcxproj.filters @@ -277,6 +277,9 @@ <Page Include="PreviewPage.xaml"> <Filter>Views</Filter> </Page> + <Page Include="AboutPage.xaml"> + <Filter>Views</Filter> + </Page> </ItemGroup> <ItemGroup> <Filter Include="Assets">