2018-11-10 15:33:52 +00:00
|
|
|
// Kosmos Updater
|
2019-02-19 14:02:19 +00:00
|
|
|
// Copyright (C) 2019 Steven Mattera
|
2018-09-30 16:21:58 +00:00
|
|
|
//
|
|
|
|
// 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 2
|
|
|
|
// 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, write to the Free Software
|
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2019-07-02 19:47:02 +00:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "../ModalView.hpp"
|
2018-10-13 03:14:27 +00:00
|
|
|
#include "../models/NetRequest.hpp"
|
2018-11-09 21:58:37 +00:00
|
|
|
#include "../models/ThreadObj.hpp"
|
2018-10-23 02:18:28 +00:00
|
|
|
#include "../models/Zip.hpp"
|
2019-07-02 19:47:02 +00:00
|
|
|
#include "../Scene.hpp"
|
|
|
|
#include "../views/AlertView.hpp"
|
|
|
|
#include "../views/FooterView.hpp"
|
2018-09-30 16:21:58 +00:00
|
|
|
#include "../views/HeaderView.hpp"
|
2018-10-13 03:14:27 +00:00
|
|
|
#include "../views/StatusView.hpp"
|
2019-07-02 19:47:02 +00:00
|
|
|
#include "../views/UpdateView.hpp"
|
2018-09-30 16:21:58 +00:00
|
|
|
|
2019-07-02 19:47:02 +00:00
|
|
|
class PackageDownloadScene : public ku::Scene {
|
2018-09-30 16:21:58 +00:00
|
|
|
public:
|
|
|
|
PackageDownloadScene();
|
|
|
|
~PackageDownloadScene();
|
|
|
|
|
2019-02-19 14:02:19 +00:00
|
|
|
void handleButton(u32 buttons, double dTime);
|
2018-09-30 16:21:58 +00:00
|
|
|
void render(SDL_Rect rect, double dTime);
|
|
|
|
|
|
|
|
private:
|
2019-07-02 19:47:02 +00:00
|
|
|
ku::models::ThreadObj * _packageDelete;
|
|
|
|
ku::models::NetRequest * _packageRequest;
|
|
|
|
ku::models::Zip * _packageExtract;
|
|
|
|
ku::models::ThreadObj * _packageDisableGC;
|
|
|
|
std::string _versionNumber;
|
2018-11-09 21:58:37 +00:00
|
|
|
int _numberOfFiles;
|
2018-10-13 03:14:27 +00:00
|
|
|
|
2019-07-02 19:47:02 +00:00
|
|
|
ku::views::HeaderView * _headerView;
|
|
|
|
ku::views::UpdateView * _updateView;
|
|
|
|
ku::views::StatusView * _statusView;
|
|
|
|
ku::views::FooterView * _footerView;
|
2018-10-13 03:14:27 +00:00
|
|
|
|
2019-07-02 19:47:02 +00:00
|
|
|
ku::views::AlertView * _restartAlertView;
|
2018-11-10 18:49:43 +00:00
|
|
|
|
2018-11-09 21:58:37 +00:00
|
|
|
void _updatePackageDelete();
|
2018-10-13 03:14:27 +00:00
|
|
|
void _updatePackageRequest();
|
2018-10-16 23:06:35 +00:00
|
|
|
void _updatePackageExtract();
|
2018-11-09 23:54:13 +00:00
|
|
|
void _updatePackageDisableGC();
|
2019-07-02 19:47:02 +00:00
|
|
|
void _showStatus(std::string text, std::string subtext, bool wasSuccessful);
|
|
|
|
void _onAlertViewDismiss(ku::ModalView * view, bool success);
|
|
|
|
std::string _getVersionNumber(std::string version);
|
2018-09-30 16:21:58 +00:00
|
|
|
};
|