From 483d4746dc5b8f00b2f16fbbc785549965387ed6 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sat, 29 Jun 2019 11:02:33 -0700 Subject: [PATCH] Add support for development tracks --- hecl-gui/DownloadManager.cpp | 7 +- hecl-gui/MainWindow.cpp | 18 + hecl-gui/MainWindow.hpp | 2 + hecl-gui/MainWindow.ui | 625 ++++++++++++++++++++--------------- 4 files changed, 382 insertions(+), 270 deletions(-) diff --git a/hecl-gui/DownloadManager.cpp b/hecl-gui/DownloadManager.cpp index 714ac38ea..3457639b1 100644 --- a/hecl-gui/DownloadManager.cpp +++ b/hecl-gui/DownloadManager.cpp @@ -51,8 +51,8 @@ void DownloadManager::fetchIndex() { return; resetError(); - - QString url = Domain + CurPlatformString + '/' + Index; + QString track = QSettings().value("update_track").toString(); + QString url = Domain + track + '/' + CurPlatformString + '/' + Index; m_indexInProgress = m_netManager.get(QNetworkRequest(url)); connect(m_indexInProgress, SIGNAL(finished()), this, SLOT(indexFinished())); connect(m_indexInProgress, SIGNAL(error(QNetworkReply::NetworkError)), this, @@ -67,7 +67,8 @@ void DownloadManager::fetchBinary(const QString& str, const QString& outPath) { resetError(); m_outPath = outPath; - QString url = Domain + CurPlatformString + '/' + str; + QString track = QSettings().value("update_track").toString(); + QString url = Domain + track + '/' + CurPlatformString + '/' + str; m_binaryInProgress = m_netManager.get(QNetworkRequest(url)); connect(m_binaryInProgress, SIGNAL(finished()), this, SLOT(binaryFinished())); connect(m_binaryInProgress, SIGNAL(error(QNetworkReply::NetworkError)), this, diff --git a/hecl-gui/MainWindow.cpp b/hecl-gui/MainWindow.cpp index 8611f9df7..2bcd49797 100644 --- a/hecl-gui/MainWindow.cpp +++ b/hecl-gui/MainWindow.cpp @@ -2,6 +2,8 @@ #include "ui_MainWindow.h" #include #include +#include +#include #include "EscapeSequenceParser.hpp" #include "FileDirDialog.hpp" #include "ExtractZip.hpp" @@ -51,6 +53,8 @@ static void KillProcessTree(QProcess& proc) { } #endif +const QStringList MainWindow::skUpdateTracks = QStringList() << "stable" << "dev"; + MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent) , m_fileMgr(_SYS_STR("urde")) @@ -62,6 +66,8 @@ MainWindow::MainWindow(QWidget* parent) , m_launchMenu(m_cvarCommons, this) { if (m_settings.value("urde_arguments").isNull()) m_settings.setValue("urde_arguments", QStringList() << "--no-shader-warmup"); + if (m_settings.value("update_track").isNull()) + m_settings.setValue("update_track", "stable"); m_ui->setupUi(this); m_ui->heclTabs->setCurrentIndex(0); @@ -83,6 +89,11 @@ MainWindow::MainWindow(QWidget* parent) pal.setColor(QPalette::Button, QColor(53, 53, 72)); m_updateURDEButton->setPalette(pal); connect(m_updateURDEButton, SIGNAL(clicked()), this, SLOT(onUpdateURDEPressed())); + qDebug() << "Stored track " << m_settings.value("update_track"); + int index = skUpdateTracks.indexOf(m_settings.value("update_track").toString()); + m_ui->devTrackWarning->setVisible(index == 1); + m_ui->updateTrackComboBox->setCurrentIndex(index); + connect(m_ui->updateTrackComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onUpdateTrackChanged(int))); m_dlManager.connectWidgets(m_ui->downloadProgressBar, m_ui->downloadErrorLabel, std::bind(&MainWindow::onIndexDownloaded, this, std::placeholders::_1), @@ -514,3 +525,10 @@ void MainWindow::insertContinueNote(const QString& text) { m_cursor.insertBlock(); m_ui->processOutput->ensureCursorVisible(); } +void MainWindow::onUpdateTrackChanged(int index) { + qDebug() << "Track changed from " << m_settings.value("update_track") << " to " << skUpdateTracks[index]; + m_settings.setValue("update_track", skUpdateTracks[index]); + m_dlManager.fetchIndex(); + m_ui->devTrackWarning->setVisible(index == 1); +} + diff --git a/hecl-gui/MainWindow.hpp b/hecl-gui/MainWindow.hpp index caadde4d5..120fb3e8b 100644 --- a/hecl-gui/MainWindow.hpp +++ b/hecl-gui/MainWindow.hpp @@ -19,6 +19,7 @@ class MainWindow; } class MainWindow : public QMainWindow { + static const QStringList skUpdateTracks; Q_OBJECT hecl::Runtime::FileStoreManager m_fileMgr; hecl::CVarManager m_cvarManager; @@ -52,6 +53,7 @@ private slots: void onReturnPressed(); void onDownloadPressed(); void onUpdateURDEPressed(); + void onUpdateTrackChanged(int index); private: bool checkDownloadedBinary(); diff --git a/hecl-gui/MainWindow.ui b/hecl-gui/MainWindow.ui index 3da76c1b2..a547e36d2 100644 --- a/hecl-gui/MainWindow.ui +++ b/hecl-gui/MainWindow.ui @@ -102,10 +102,110 @@ + + + + false + + + + 16777215 + 16777215 + + + + &Extract + + + + + + + false + + + + 16777215 + 16777215 + + + + &Package + + + + + + + Qt::Horizontal + + + + 167 + 20 + + + + + + + + + + + 0 + 0 + + + + Wor&king Directory: + + + pathEdit + + + + + + + + 0 + 0 + + + + + 1 + 0 + + + + + + + + + 0 + 0 + + + + + 32 + 16777215 + + + + ... + + + + + - 0 + 1 @@ -135,6 +235,15 @@ + + + + 255 + 255 + 255 + + + @@ -155,6 +264,15 @@ + + + + 255 + 255 + 255 + + + @@ -175,6 +293,15 @@ + + + + 255 + 255 + 255 + + + @@ -199,25 +326,84 @@ System Check + + + + false + + + 0 + + + + + + + + + + + + 255 + 47 + 0 + + + + + + + + + 255 + 47 + 0 + + + + + + + + + 164 + 166 + 168 + + + + + + + + + + + true + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + 12 - - - - Recommended URDE Binary: - - - - - - - fetching... - - - @@ -232,19 +418,50 @@ + + + + Recommended URDE Binary: + + + + + + + fetching... + + + + + + + Update Track: + + + + + + + + 0 + 0 + + + + + Stable + + + + + Development + + + + - - - - false - - - 0 - - - - + Qt::Vertical @@ -257,6 +474,78 @@ + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 500 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + + + + 68 + 68 + 68 + + + + + + + + QAbstractItemView::NoSelection + + + @@ -339,135 +628,10 @@ - - - - - 0 - 0 - - - - - 500 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - - - 68 - 68 - 68 - - - - - - - - QAbstractItemView::NoSelection - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - - - - - - 255 - 47 - 0 - - - - - - - - - 255 - 47 - 0 - - - - - - - - - 164 - 166 - 168 - - - - - - + + - + <html><head/><body><p><span style=" color:#ff0000;">Development Track selected!<br/>Development builds are considered unstable and may cause crashes. </span></p></body></html> true @@ -604,6 +768,15 @@ + + + + 208 + 208 + 208 + + + @@ -651,6 +824,15 @@ + + + + 208 + 208 + 208 + + + @@ -698,6 +880,15 @@ + + + + 208 + 208 + 208 + + + @@ -705,19 +896,19 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Sans'; font-size:10pt; font-weight:600;">About HECL Frontend</span></p> -<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Sans'; font-size:10pt;"><br />The hecl frontend UI is designed and built by </span><a href="https://axiodl.com"><span style=" font-family:'Noto Sans'; font-size:10pt; text-decoration: underline; color:#007af4;">Axiomatic Data Laboratories</span></a><span style=" font-family:'Noto Sans'; font-size:10pt;"> Copyright 2018<br /><br /></span><span style=" font-family:'Noto Sans'; font-size:10pt; font-weight:600;">Authors:</span><span style=" font-family:'Noto Sans'; font-size:10pt;"><br />Phillip &quot;Antidote&quot; Stephens<br />Jack &quot;jackoalan&quot; Andersen</span></p> -<p style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; font-size:10pt;">The MIT License</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Courier New'; font-size:10pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; font-size:10pt;">Copyright (c) 2015-2018 URDE Contributors</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; font-size:10pt;">Original Authors: Jack Andersen and Phillip &quot;Antidote&quot; Stephens</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Courier New'; font-size:10pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; font-size:10pt;">Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &quot;Software&quot;), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Courier New'; font-size:10pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; font-size:10pt;">The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Courier New'; font-size:10pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; font-size:10pt;">THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</span></p></body></html> +</style></head><body style=" font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;"> +<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">About HECL Frontend</span></p> +<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br />The hecl frontend UI is designed and built by <a href="https://axiodl.com"><span style=" text-decoration: underline; color:#007af4;">Axiomatic Data Laboratories</span></a> Copyright 2018<br /><br /><span style=" font-weight:600;">Authors:</span><br />Phillip &quot;Antidote&quot; Stephens<br />Jack &quot;jackoalan&quot; Andersen</p> +<p style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New';">The MIT License</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Courier New';"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New';">Copyright (c) 2015-2018 URDE Contributors</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New';">Original Authors: Jack Andersen and Phillip &quot;Antidote&quot; Stephens</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Courier New';"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New';">Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &quot;Software&quot;), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Courier New';"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New';">The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Courier New';"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New';">THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</span></p></body></html> true @@ -728,106 +919,6 @@ p, li { white-space: pre-wrap; } - - - - false - - - - 16777215 - 16777215 - - - - &Extract - - - - - - - false - - - - 16777215 - 16777215 - - - - &Package - - - - - - - Qt::Horizontal - - - - 167 - 20 - - - - - - - - - - - 0 - 0 - - - - Wor&king Directory: - - - pathEdit - - - - - - - - 0 - 0 - - - - - 1 - 0 - - - - - - - - - 0 - 0 - - - - - 32 - 16777215 - - - - ... - - - - -