atraczyk | 61b2842 | 2016-08-24 09:25:59 -0400 | [diff] [blame] | 1 | /**************************************************************************
|
| 2 | * Copyright (C) 2016 by Savoir-faire Linux *
|
| 3 | * Author: Jäger Nicolas <nicolas.jager@savoirfairelinux.com> *
|
| 4 | * Author: Traczyk Andreas <traczyk.andreas@savoirfairelinux.com> *
|
| 5 | * *
|
| 6 | * This program is free software; you can redistribute it and/or modify *
|
| 7 | * it under the terms of the GNU General Public License as published by *
|
| 8 | * the Free Software Foundation; either version 3 of the License, or *
|
| 9 | * (at your option) any later version. *
|
| 10 | * *
|
| 11 | * This program is distributed in the hope that it will be useful, *
|
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
| 14 | * GNU General Public License for more details. *
|
| 15 | * *
|
| 16 | * You should have received a copy of the GNU General Public License *
|
| 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
| 18 | **************************************************************************/
|
| 19 | #include "pch.h"
|
| 20 |
|
| 21 | #include "LoadingPage.xaml.h"
|
| 22 |
|
| 23 | #include "MainPage.xaml.h"
|
| 24 | #include "Wizard.xaml.h"
|
| 25 |
|
| 26 | using namespace RingClientUWP;
|
| 27 | using namespace RingClientUWP::Views;
|
| 28 | using namespace RingClientUWP::ViewModel;
|
| 29 |
|
| 30 | using namespace Platform;
|
| 31 | using namespace Windows::ApplicationModel::Core;
|
| 32 | using namespace Windows::Foundation;
|
| 33 | using namespace Windows::Foundation::Collections;
|
| 34 | using namespace Windows::UI::ViewManagement;
|
| 35 | using namespace Windows::UI::Xaml;
|
| 36 | using namespace Windows::UI::Xaml::Controls;
|
| 37 | using namespace Windows::UI::Xaml::Controls::Primitives;
|
| 38 | using namespace Windows::UI::Core;
|
| 39 | using namespace Windows::UI::Xaml::Data;
|
| 40 | using namespace Windows::UI::Xaml::Input;
|
| 41 | using namespace Windows::UI::Xaml::Interop;
|
| 42 | using namespace Windows::UI::Xaml::Navigation;
|
| 43 | using namespace Windows::ApplicationModel::Activation;
|
| 44 | using namespace Windows::Graphics::Display;
|
| 45 | using namespace Windows::System;
|
| 46 |
|
| 47 | LoadingPage::LoadingPage()
|
| 48 | {
|
| 49 | InitializeComponent();
|
| 50 |
|
| 51 | Utils::fileExists(ApplicationData::Current->LocalFolder, ".config\\dring.yml")
|
Nicolas Jager | b059a66 | 2016-08-30 13:17:30 -0400 | [diff] [blame] | 52 | .then([this](bool config_exists)
|
atraczyk | 61b2842 | 2016-08-24 09:25:59 -0400 | [diff] [blame] | 53 | {
|
| 54 | if (config_exists) {
|
Nicolas Jager | e4eb513 | 2016-10-04 14:25:15 -0400 | [diff] [blame] | 55 | this->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([this] () {
|
atraczyk | 61b2842 | 2016-08-24 09:25:59 -0400 | [diff] [blame] | 56 | this->Frame->Navigate(Windows::UI::Xaml::Interop::TypeName(MainPage::typeid));
|
| 57 | }));
|
| 58 | }
|
| 59 | else {
|
Nicolas Jager | e4eb513 | 2016-10-04 14:25:15 -0400 | [diff] [blame] | 60 | this->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([this] () {
|
atraczyk | 61b2842 | 2016-08-24 09:25:59 -0400 | [diff] [blame] | 61 | this->Frame->Navigate(Windows::UI::Xaml::Interop::TypeName(Wizard::typeid));
|
| 62 | }));
|
| 63 | }
|
| 64 | });
|
| 65 | }
|