Added basic version check stub

This commit is contained in:
Jordan Sherer 2019-03-31 13:39:10 -04:00
parent 7f187f4cf8
commit 82a0cdd0cf
2 changed files with 16 additions and 1 deletions

View File

@ -1116,7 +1116,6 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
//splashTimer.setSingleShot (true);
//splashTimer.start (20 * 1000);
// TODO: jsherer - need to remove this eventually...
QTimer::singleShot (0, this, SLOT (checkStartupWarnings ()));
if(!ui->cbMenus->isChecked()) {
@ -1639,8 +1638,23 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
if (!m_valid) throw std::runtime_error {"Fatal initialization exception"};
}
void MainWindow::checkVersion(){
auto m = new QNetworkAccessManager(this);
connect(m, &QNetworkAccessManager::finished, this, [this](QNetworkReply * reply){
if(reply->error()) return;
QString content = reply->readAll();
qDebug() << "version" << content;
});
QUrl url("http://files.js8call.com/version.txt");
QNetworkRequest r(url);
m->get(r);
}
void MainWindow::checkStartupWarnings ()
{
checkVersion();
ensureCallsignSet(false);
}

View File

@ -413,6 +413,7 @@ private slots:
void on_cbCQTx_toggled(bool b);
void splash_done ();
void on_measure_check_box_stateChanged (int);
void checkVersion();
void checkStartupWarnings ();
void clearCallsignSelected();
void refreshTextDisplay();