Skip to content

Commit

Permalink
finally the popup works again
Browse files Browse the repository at this point in the history
  • Loading branch information
Consti10 committed Apr 23, 2024
1 parent a2c18fd commit 5954749
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,25 @@ PopupBigGeneric{
const card_sub_type=m_is_air ? _wifi_card_air.card_sub_type : _wifi_card_gnd0.card_sub_type
if(card_sub_type==_wifi_card_air.mWIFI_CARD_SUB_TYPE_RTL8812AU_ASUS){
// rtl8812 ASUS
m_user_selected_card_manufacturer=2;
m_user_selected_card_manufacturer=1;
m_card_type_provided_by_openhd=true;
}else if(card_sub_type==_wifi_card_air.mWIFI_CARD_SUB_TYPE_RTL8812AU_X20){
console.log("rtl8812au x20");
// rtl8812 x20
m_user_selected_card_manufacturer=3;
m_user_selected_card_manufacturer=2;
m_card_type_provided_by_openhd=true;
}else{
// we don't know the card type .. user has to set it
m_user_selected_card_manufacturer=-1;
m_card_type_provided_by_openhd=false;
}
// The user has to enter the card type every time - otherwise, we have issues with air and ground
if(m_user_selected_card_manufacturer>=0){
comboBoxCardSelectManufacturer.currentIndex=m_user_selected_card_manufacturer;
if(m_user_selected_card_manufacturer>=1){
comboBoxCardSelectManufacturer.currentIndex=m_user_selected_card_manufacturer-1;
}else{
comboBoxCardSelectManufacturer.currentIndex=0;
}
update_ui_txpower_for_chip_type_manufacturer();
combo_box_txpower_disarmed.currentIndex=0;
combo_box_txpower_armed.currentIndex=0;
visible=true;
enabled=true;
}
Expand All @@ -90,6 +88,10 @@ PopupBigGeneric{
id: model_manufacturer_unknown_chipset
ListElement {title: "Unknown chipset"; value: -1}
}
ListModel{
id: model_error
ListElement {title: "ERROR"; value: -1}
}

ListModel{
id: model_rtl8812au_manufacturers
Expand Down Expand Up @@ -186,7 +188,8 @@ PopupBigGeneric{
var chip_type=get_chipset_type();
var manufacturer=m_user_selected_card_manufacturer;
if(manufacturer<0){
return model_manufacturer_unknown_chipset;
console.log("Unknown manufacturer");
return model_error;
}
var ret;
if(chip_type==0){
Expand Down Expand Up @@ -276,7 +279,9 @@ PopupBigGeneric{
textRole: "title"
onActivated: {
var manufacturer = comboBoxCardSelectManufacturer.model.get(comboBoxCardSelectManufacturer.currentIndex).value;
console.log("Set: "+manufacturer);
m_user_selected_card_manufacturer = manufacturer;
update_ui_txpower_for_chip_type_manufacturer();
}
font.pixelSize: 14
// If the card type is provided by openhd, no need to let the user select
Expand Down

0 comments on commit 5954749

Please sign in to comment.