A 3rd branch for RC compilation (#5441)

A 3rd branch for RC compilation
This commit is contained in:
Bertrand Songis
2017-11-30 11:51:22 +01:00
committed by GitHub
parent e74349e36c
commit 0faee13bc3
8 changed files with 120 additions and 88 deletions
+7 -12
View File
@@ -23,13 +23,10 @@
#include "mainwindow.h" #include "mainwindow.h"
#include "appdata.h" #include "appdata.h"
#include "helpers.h" #include "helpers.h"
#include "firmwareinterface.h" #if defined(JOYSTICKS)
#ifdef JOYSTICKS
#include "joystick.h" #include "joystick.h"
#include "joystickdialog.h" #include "joystickdialog.h"
#endif #endif
#include <QDesktopServices>
#include <QtGui>
AppPreferencesDialog::AppPreferencesDialog(QWidget * parent) : AppPreferencesDialog::AppPreferencesDialog(QWidget * parent) :
QDialog(parent), QDialog(parent),
@@ -63,10 +60,10 @@ AppPreferencesDialog::~AppPreferencesDialog()
void AppPreferencesDialog::writeValues() void AppPreferencesDialog::writeValues()
{ {
g.useCompanionNightlyBuilds(ui->useCompanionNightlyBuilds->isChecked());
g.autoCheckApp(ui->autoCheckCompanion->isChecked()); g.autoCheckApp(ui->autoCheckCompanion->isChecked());
g.useFirmwareNightlyBuilds(ui->useFirmwareNightlyBuilds->isChecked()); g.companionBranch(DownloadBranchType(ui->companionBranch->currentIndex()));
g.autoCheckFw(ui->autoCheckFirmware->isChecked()); g.autoCheckFw(ui->autoCheckFirmware->isChecked());
g.firmwareBranch(DownloadBranchType(ui->firmwareBranch->currentIndex()));
g.showSplash(ui->showSplash->isChecked()); g.showSplash(ui->showSplash->isChecked());
g.simuSW(ui->simuSW->isChecked()); g.simuSW(ui->simuSW->isChecked());
g.removeModelSlots(ui->opt_removeBlankSlots->isChecked()); g.removeModelSlots(ui->opt_removeBlankSlots->isChecked());
@@ -137,13 +134,11 @@ void AppPreferencesDialog::initSettings()
ui->snapshotPath->setDisabled(true); ui->snapshotPath->setDisabled(true);
ui->snapshotPathButton->setDisabled(true); ui->snapshotPathButton->setDisabled(true);
} }
#if defined(ALLOW_NIGHTLY_BUILDS) #if !defined(ALLOW_NIGHTLY_BUILDS)
ui->useCompanionNightlyBuilds->setChecked(g.useCompanionNightlyBuilds()); // TODO should we gray out nightly builds here?
ui->useFirmwareNightlyBuilds->setChecked(g.useFirmwareNightlyBuilds());
#else
ui->useCompanionNightlyBuilds->hide();
ui->useFirmwareNightlyBuilds->hide();
#endif #endif
ui->firmwareBranch->setCurrentIndex(g.firmwareBranch());
ui->companionBranch->setCurrentIndex(g.companionBranch());
ui->autoCheckCompanion->setChecked(g.autoCheckApp()); ui->autoCheckCompanion->setChecked(g.autoCheckApp());
ui->autoCheckFirmware->setChecked(g.autoCheckFw()); ui->autoCheckFirmware->setChecked(g.autoCheckFw());
ui->showSplash->setChecked(g.showSplash()); ui->showSplash->setChecked(g.showSplash());
+57 -45
View File
@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>703</width> <width>859</width>
<height>534</height> <height>673</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@@ -45,7 +45,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="profileTab"> <widget class="QWidget" name="profileTab">
<attribute name="title"> <attribute name="title">
@@ -72,16 +72,7 @@
<item row="6" column="0" colspan="4"> <item row="6" column="0" colspan="4">
<widget class="QWidget" name="widget_splashImage" native="true"> <widget class="QWidget" name="widget_splashImage" native="true">
<layout class="QGridLayout" name="gridLayout_5"> <layout class="QGridLayout" name="gridLayout_5">
<property name="leftMargin"> <property name="margin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing"> <property name="spacing">
@@ -733,24 +724,15 @@ Mode 4:
</sizepolicy> </sizepolicy>
</property> </property>
<layout class="QGridLayout" name="optionsLayout"> <layout class="QGridLayout" name="optionsLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="horizontalSpacing"> <property name="horizontalSpacing">
<number>5</number> <number>5</number>
</property> </property>
<property name="verticalSpacing"> <property name="verticalSpacing">
<number>4</number> <number>4</number>
</property> </property>
<property name="margin">
<number>0</number>
</property>
</layout> </layout>
</widget> </widget>
</item> </item>
@@ -768,26 +750,6 @@ Mode 4:
</property> </property>
<item row="7" column="1"> <item row="7" column="1">
<layout class="QGridLayout" name="gridLayout_6"> <layout class="QGridLayout" name="gridLayout_6">
<item row="1" column="1">
<widget class="QCheckBox" name="useCompanionNightlyBuilds">
<property name="text">
<string>Use Companion nightly builds</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="useFirmwareNightlyBuilds">
<property name="text">
<string>Use firmware nightly builds</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QCheckBox" name="autoCheckFirmware"> <widget class="QCheckBox" name="autoCheckFirmware">
<property name="text"> <property name="text">
@@ -808,6 +770,56 @@ Mode 4:
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1">
<widget class="QComboBox" name="firmwareBranch">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Use firmware releases (stable)</string>
</property>
</item>
<item>
<property name="text">
<string>Use firmware releases and release candidates (testing)</string>
</property>
</item>
<item>
<property name="text">
<string>Use firmware nightly builds (unstable)</string>
</property>
</item>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="companionBranch">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Use Companion releases (stable)</string>
</property>
</item>
<item>
<property name="text">
<string>Use Companion release and release candidates (testing)</string>
</property>
</item>
<item>
<property name="text">
<string>Use Companion nightly builds (unstable)</string>
</property>
</item>
</widget>
</item>
</layout> </layout>
</item> </item>
<item row="3" column="1"> <item row="3" column="1">
+8
View File
@@ -68,4 +68,12 @@
#define CPN_STR_SW_INDICATOR_NEUT QCoreApplication::translate("RawSwitch", "-") // Switch neutral (middle) position indicator. #define CPN_STR_SW_INDICATOR_NEUT QCoreApplication::translate("RawSwitch", "-") // Switch neutral (middle) position indicator.
#define CPN_STR_SW_INDICATOR_REV QCoreApplication::translate("RawSwitch", "!") // Switch reversed logic (NOT) indicator. #define CPN_STR_SW_INDICATOR_REV QCoreApplication::translate("RawSwitch", "!") // Switch reversed logic (NOT) indicator.
enum DownloadBranchType {
BRANCH_RELEASE_STABLE,
BRANCH_RC_TESTING,
BRANCH_NIGHTLY_UNSTABLE
};
Q_DECLARE_METATYPE(DownloadBranchType)
#endif // _CONSTANTS_H_ #endif // _CONSTANTS_H_
@@ -30,8 +30,11 @@
using namespace Board; using namespace Board;
#define OPENTX_FIRMWARE_DOWNLOADS "https://downloads-22.open-tx.org/firmware" const char * const OPENTX_FIRMWARE_DOWNLOAD_URL[] = {
#define OPENTX_NIGHT_FIRMWARE_DOWNLOADS "https://downloads-22.open-tx.org/nightlies/firmware" "https://downloads.open-tx.org/2.2/release/firmware",
"https://downloads.open-tx.org/2.2/rc/firmware",
"https://downloads.open-tx.org/2.2/nightlies/firmware"
};
#define FILE_TYP_GENERAL 1 #define FILE_TYP_GENERAL 1
#define FILE_TYP_MODEL 2 #define FILE_TYP_MODEL 2
@@ -1077,11 +1080,7 @@ unsigned long OpenTxEepromInterface::loadBackup(RadioData &radioData, const uint
QString OpenTxFirmware::getFirmwareBaseUrl() QString OpenTxFirmware::getFirmwareBaseUrl()
{ {
#if defined(ALLOW_NIGHTLY_BUILDS) return OPENTX_FIRMWARE_DOWNLOAD_URL[g.boundedFirmwareBranch()];
return (g.useFirmwareNightlyBuilds() ? OPENTX_NIGHT_FIRMWARE_DOWNLOADS : OPENTX_FIRMWARE_DOWNLOADS);
#else
return OPENTX_FIRMWARE_DOWNLOADS;
#endif
} }
QString OpenTxFirmware::getFirmwareUrl() QString OpenTxFirmware::getFirmwareUrl()
+10 -10
View File
@@ -21,16 +21,16 @@
#include "fwpreferencesdialog.h" #include "fwpreferencesdialog.h"
#include "ui_fwpreferencesdialog.h" #include "ui_fwpreferencesdialog.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "eeprominterface.h"
#include "helpers.h" #include "helpers.h"
#include "appdata.h" #include "appdata.h"
#include <QDesktopServices>
#include <QtGui>
#define OPENTX_SDCARD_DOWNLOADS "https://downloads.open-tx.org/2.2/sdcard/" const char * const OPENTX_SDCARD_DOWNLOAD_URL[] = {
#define OPENTX_NIGHT_SDCARD_DOWNLOADS "https://downloads.open-tx.org/2.2/nightlies/sdcard/" "https://downloads.open-tx.org/2.2/release/sdcard/",
"https://downloads.open-tx.org/2.2/rc/sdcard/",
"https://downloads.open-tx.org/2.2/nightlies/sdcard/"
};
FirmwarePreferencesDialog::FirmwarePreferencesDialog(QWidget *parent) : FirmwarePreferencesDialog::FirmwarePreferencesDialog(QWidget * parent) :
QDialog(parent), QDialog(parent),
ui(new Ui::FirmwarePreferencesDialog) ui(new Ui::FirmwarePreferencesDialog)
{ {
@@ -55,25 +55,25 @@ void FirmwarePreferencesDialog::initSettings()
void FirmwarePreferencesDialog::on_checkFWUpdates_clicked() void FirmwarePreferencesDialog::on_checkFWUpdates_clicked()
{ {
MainWindow * mw = (MainWindow *)this->parent(); MainWindow * mw = qobject_cast<MainWindow *>(this->parent());
mw->checkForFirmwareUpdate(); mw->checkForFirmwareUpdate();
initSettings(); initSettings();
} }
void FirmwarePreferencesDialog::on_fw_dnld_clicked() void FirmwarePreferencesDialog::on_fw_dnld_clicked()
{ {
MainWindow * mw = (MainWindow *)this->parent(); MainWindow * mw = qobject_cast<MainWindow *>(this->parent());
mw->dowloadLastFirmwareUpdate(); mw->dowloadLastFirmwareUpdate();
initSettings(); initSettings();
} }
void FirmwarePreferencesDialog::on_sd_dnld_clicked() void FirmwarePreferencesDialog::on_sd_dnld_clicked()
{ {
QString url = g.useFirmwareNightlyBuilds() ? OPENTX_NIGHT_SDCARD_DOWNLOADS : OPENTX_SDCARD_DOWNLOADS; QString url = OPENTX_SDCARD_DOWNLOAD_URL[g.boundedFirmwareBranch()];
QString fwType = g.profile[g.id()].fwType(); QString fwType = g.profile[g.id()].fwType();
QStringList list = fwType.split("-"); QStringList list = fwType.split("-");
QString firmware = QString("%1-%2").arg(list[0]).arg(list[1]); QString firmware = QString("%1-%2").arg(list[0]).arg(list[1]);
if (!g.useFirmwareNightlyBuilds()) { if (g.boundedFirmwareBranch() != BRANCH_NIGHTLY_UNSTABLE) {
url.append(QString("%1/").arg(firmware)); url.append(QString("%1/").arg(firmware));
} }
QDesktopServices::openUrl(url); QDesktopServices::openUrl(url);
+7 -8
View File
@@ -54,7 +54,6 @@
#include <QDesktopServices> #include <QDesktopServices>
#define OPENTX_DOWNLOADS_PAGE_URL "http://www.open-tx.org/downloads" #define OPENTX_DOWNLOADS_PAGE_URL "http://www.open-tx.org/downloads"
#define OPENTX_COMPANION_DOWNLOADS "https://downloads-22.open-tx.org/companion"
#define DONATE_STR "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QUZ48K4SEXDP2" #define DONATE_STR "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QUZ48K4SEXDP2"
#ifdef __APPLE__ #ifdef __APPLE__
@@ -69,12 +68,16 @@
#define COMPANION_INSTALL_QUESTION tr("Would you like to launch the installer?") #define COMPANION_INSTALL_QUESTION tr("Would you like to launch the installer?")
#else #else
#define COMPANION_STAMP "companion-linux.stamp" #define COMPANION_STAMP "companion-linux.stamp"
#define COMPANION_INSTALLER "" // no automatated updates for linux #define COMPANION_INSTALLER "" // no automated updates for linux
#define COMPANION_FILEMASK "*.*" #define COMPANION_FILEMASK "*.*"
#define COMPANION_INSTALL_QUESTION tr("Would you like to launch the installer?") #define COMPANION_INSTALL_QUESTION tr("Would you like to launch the installer?")
#endif #endif
#define OPENTX_NIGHT_COMPANION_DOWNLOADS "https://downloads-22.open-tx.org/nightlies/companion" const char * const OPENTX_COMPANION_DOWNLOAD_URL[] = {
"https://downloads.open-tx.org/2.2/release/companion",
"https://downloads.open-tx.org/2.2/rc/companion",
"https://downloads.open-tx.org/2.2/nightlies/companion"
};
MainWindow::MainWindow(): MainWindow::MainWindow():
downloadDialog_forWait(NULL), downloadDialog_forWait(NULL),
@@ -241,11 +244,7 @@ void MainWindow::dowloadLastFirmwareUpdate()
QString MainWindow::getCompanionUpdateBaseUrl() QString MainWindow::getCompanionUpdateBaseUrl()
{ {
#if defined(ALLOW_NIGHTLY_BUILDS) return OPENTX_COMPANION_DOWNLOAD_URL[g.boundedCompanionBranch()];
return g.useCompanionNightlyBuilds() ? OPENTX_NIGHT_COMPANION_DOWNLOADS : OPENTX_COMPANION_DOWNLOADS;
#else
return OPENTX_COMPANION_DOWNLOADS;
#endif
} }
void MainWindow::checkForUpdates() void MainWindow::checkForUpdates()
+4 -4
View File
@@ -588,15 +588,15 @@ void AppData::init()
getset( _libDir, "libraryPath" ,"" ); getset( _libDir, "libraryPath" ,"" );
getset( _snapshotDir, "snapshotpath" ,"" ); getset( _snapshotDir, "snapshotpath" ,"" );
getset( _updatesDir, "lastUpdatesDir" ,"" ); getset( _updatesDir, "lastUpdatesDir" ,"" );
appLogsDir_init();
// booleans getset( _firmwareBranch, "firmwareBranch", BRANCH_RELEASE_STABLE);
getset( _companionBranch, "companionBranch", BRANCH_RELEASE_STABLE);
appLogsDir_init();
enableBackup_init(); enableBackup_init();
backupOnFlash_init(); backupOnFlash_init();
outputDisplayDetails_init(); outputDisplayDetails_init();
checkHardwareCompatibility_init(); checkHardwareCompatibility_init();
useCompanionNightlyBuilds_init();
useFirmwareNightlyBuilds_init();
removeModelSlots_init(); removeModelSlots_init();
maximized_init(); maximized_init();
simuSW_init(); simuSW_init();
+21 -2
View File
@@ -25,12 +25,14 @@
#ifndef _APPDATA_H_ #ifndef _APPDATA_H_
#define _APPDATA_H_ #define _APPDATA_H_
#include <QByteArray> #include <QByteArray>
#include <QStringList> #include <QStringList>
#include <QString> #include <QString>
#include <QSettings> #include <QSettings>
#include <QStandardPaths> #include <QStandardPaths>
#include "constants.h"
#include "simulator.h" #include "simulator.h"
#define COMPANY "OpenTX" #define COMPANY "OpenTX"
@@ -244,8 +246,6 @@ class AppData: protected CompStoreObj
PROPERTY(bool, backupOnFlash, true) PROPERTY(bool, backupOnFlash, true)
PROPERTY(bool, outputDisplayDetails, false) PROPERTY(bool, outputDisplayDetails, false)
PROPERTY(bool, checkHardwareCompatibility, true) PROPERTY(bool, checkHardwareCompatibility, true)
PROPERTY(bool, useCompanionNightlyBuilds, false)
PROPERTY(bool, useFirmwareNightlyBuilds, false)
PROPERTY(bool, removeModelSlots, true) PROPERTY(bool, removeModelSlots, true)
PROPERTY(bool, maximized, false) PROPERTY(bool, maximized, false)
PROPERTY(bool, simuSW, false) PROPERTY(bool, simuSW, false)
@@ -253,6 +253,9 @@ class AppData: protected CompStoreObj
PROPERTY(bool, appDebugLog, false) PROPERTY(bool, appDebugLog, false)
PROPERTY(bool, fwTraceLog, false) PROPERTY(bool, fwTraceLog, false)
PROPERTY(unsigned, firmwareBranch, BRANCH_RELEASE_STABLE);
PROPERTY(unsigned, companionBranch, BRANCH_RELEASE_STABLE);
PROPERTY4(bool, jsSupport, js_support ,false) PROPERTY4(bool, jsSupport, js_support ,false)
PROPERTY4(bool, showSplash, show_splash ,true) PROPERTY4(bool, showSplash, show_splash ,true)
PROPERTY4(bool, snapToClpbrd, snapshot_to_clipboard ,false) PROPERTY4(bool, snapToClpbrd, snapshot_to_clipboard ,false)
@@ -423,6 +426,22 @@ class AppData: protected CompStoreObj
bool findPreviousVersionSettings(QString * version); bool findPreviousVersionSettings(QString * version);
bool importSettings(QString fromVersion); bool importSettings(QString fromVersion);
inline DownloadBranchType boundedFirmwareBranch() {
#if defined(ALLOW_NIGHTLY_BUILDS)
return qBound(BRANCH_RELEASE_STABLE, DownloadBranchType(firmwareBranch()), BRANCH_NIGHTLY_UNSTABLE);
#else
return qBound(BRANCH_RELEASE_STABLE, DownloadBranchType(firmwareBranch()), BRANCH_RC_TESTING);
#endif
}
inline DownloadBranchType boundedCompanionBranch() {
#if defined(ALLOW_NIGHTLY_BUILDS)
return qBound(BRANCH_RELEASE_STABLE, DownloadBranchType(companionBranch()), BRANCH_NIGHTLY_UNSTABLE);
#else
return qBound(BRANCH_RELEASE_STABLE, DownloadBranchType(companionBranch()), BRANCH_RC_TESTING);
#endif
}
protected: protected:
void convertSettings(QSettings & settings); void convertSettings(QSettings & settings);