Commit bee4271f authored by atraczyk's avatar atraczyk Committed by Andreas Traczyk

ui/ux: add about page

Change-Id: I8a46ee316e6682b0e860e51e76972dd65430dea8
Tuleap: #790
parent 8c4ce963
This diff is collapsed.
/**************************************************************************
* Copyright (C) 2016 by Savoir-faire Linux *
* Author: Jger 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);
}
/**************************************************************************
* Copyright (C) 2016 by Savoir-faire Linux *
* Author: Jger 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
......@@ -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
......
......@@ -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>
......
......@@ -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));
}
......@@ -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
......@@ -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" />
......
......@@ -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">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment