Skip to content

Commit

Permalink
Merge pull request #704 from OpenHD/consti-dev
Browse files Browse the repository at this point in the history
Revert incorrect changes and properly implement fix 'do not show -release on a release'
  • Loading branch information
Consti10 authored May 22, 2024
2 parents 630cb35 + 5f67222 commit 49aee6c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
27 changes: 14 additions & 13 deletions app/telemetry/models/aohdsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,20 @@ static MonitorModeLinkBitfield parse_monitor_link_bitfield(uint8_t bitfield){
return ret;
}

static std::string ohd_version_as_string(uint8_t major,uint8_t minor,uint8_t patch,uint8_t release_type){
std::stringstream ss;
ss<<(int)major<<"."<<(int)minor<<"."<<(int)patch<<"-evo";
if(release_type==0){
ss<<"-release";
}else if(release_type==1){
ss<<"-beta";
}else if(release_type==2){
ss<<"-alpha";
}else{
ss<<"-unknown";
}
return ss.str();
static std::string ohd_version_as_string(uint8_t major, uint8_t minor,
uint8_t patch, uint8_t release_type) {
std::stringstream ss;
ss << (int)major << "." << (int)minor << "." << (int)patch << "-evo";
if (release_type == 0) {
// This is a 'proper' release
} else if (release_type == 1) {
ss << "-beta"; // testers only
} else if (release_type == 2) {
ss << "-alpha"; // internal only
} else {
ss << "-unknown";
}
return ss.str();
}

AOHDSystem::AOHDSystem(const bool is_air,QObject *parent)
Expand Down
2 changes: 1 addition & 1 deletion app/util/qopenhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class QOpenHD : public QObject
// Tries to mimic android toast as much as possible
//
Q_INVOKABLE void show_toast(QString message,bool long_toast=false);
L_RO_PROP(QString,version_string,set_version_string,"2.5.4-evo");
L_RO_PROP(QString,version_string,set_version_string,"2.6.0-evo");
//
// Shows a message popup to the user that needs to be clicked away - use sparingly
//
Expand Down
8 changes: 4 additions & 4 deletions qml/ui/configpopup/status/StatusCardBodyOpenHD.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ Column {

property var m_model: m_is_ground ? _ohdSystemGround : _ohdSystemAir

property string m_version: m_model.openhd_version.substring(0, 5)
property string m_version: m_model.openhd_version
property string m_last_ping: m_model.last_ping_result_openhd
property bool m_is_alive: m_model.is_alive
property string m_qopenhd_version: _qopenhd.version_string.substring(0, 5)
property string m_qopenhd_version: _qopenhd.version_string

//fucking hell qt
property int m_font_pixel_size: 13
Expand Down Expand Up @@ -80,13 +80,13 @@ Column {
if(_ohdSystemGround.openhd_version=="N/A"){
return false;
}
return _ohdSystemGround.openhd_version.substring(0, 5) != m_qopenhd_version.substring(0, 5);
return _ohdSystemGround.openhd_version != m_qopenhd_version;
}else{
// Show if ground and air reported version is valid and there is a mismatch
if(_ohdSystemGround.openhd_version=="N/A" || _ohdSystemAir.openhd_version=="N/A"){
return false;
}
return _ohdSystemGround.openhd_version.substring(0, 5) != _ohdSystemAir.openhd_version.substring(0, 5)
return _ohdSystemGround.openhd_version != _ohdSystemAir.openhd_version
}
}
m_error_text: {
Expand Down

0 comments on commit 49aee6c

Please sign in to comment.