mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
Ref T455, use combobox in model dialogs as radio boxes are too wide
This commit is contained in:
@@ -147,6 +147,11 @@ namespace BlackGui
|
||||
ui->tvp_OwnAircraftModels->setSimulatorForLoading(simulator);
|
||||
}
|
||||
|
||||
void CDbOwnModelsComponent::setSimulatorSelectorMode(CSimulatorSelector::Mode mode)
|
||||
{
|
||||
ui->comp_SimulatorSelector->setMode(mode);
|
||||
}
|
||||
|
||||
void CDbOwnModelsComponent::onSimulatorSelectorChanged()
|
||||
{
|
||||
const CSimulatorInfo simulator(ui->comp_SimulatorSelector->getValue());
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#ifndef BLACKGUI_COMPONENTS_DBOWNMODELSCOMPONENT_H
|
||||
#define BLACKGUI_COMPONENTS_DBOWNMODELSCOMPONENT_H
|
||||
|
||||
#include "blackgui/components/simulatorselector.h"
|
||||
#include "blackgui/menus/menudelegate.h"
|
||||
#include "blackgui/overlaymessagesframe.h"
|
||||
#include "blackmisc/datacache.h"
|
||||
@@ -85,6 +86,9 @@ namespace BlackGui
|
||||
//! Change current simulator for own models
|
||||
void setSimulator(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
|
||||
//! \copydoc BlackGui::Components::CSimulatorSelector::setMode
|
||||
void setSimulatorSelectorMode(CSimulatorSelector::Mode mode);
|
||||
|
||||
//! Number of own models
|
||||
int getOwnModelsCount() const;
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<widget class="BlackGui::Components::CSimulatorSelector" name="comp_SimulatorSelector">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace BlackGui
|
||||
ui(new Ui::CDbOwnModelsDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->comp_OwnModels->setSimulatorSelectorMode(CSimulatorSelector::ComboBox);
|
||||
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
connect(ui->comp_OwnModels, &CDbOwnModelsComponent::successfullyLoadedModels, this, &CDbOwnModelsDialog::successfullyLoadedModels);
|
||||
}
|
||||
|
||||
@@ -403,6 +403,11 @@ namespace BlackGui
|
||||
this->updateViewToCurrentModels();
|
||||
}
|
||||
|
||||
void CDbOwnModelSetComponent::setSimulatorSelectorMode(CSimulatorSelector::Mode mode)
|
||||
{
|
||||
ui->comp_SimulatorSelector->setMode(mode);
|
||||
}
|
||||
|
||||
void CDbOwnModelSetComponent::triggerSetSimulatorDeferred(const CSimulatorInfo &simulator)
|
||||
{
|
||||
this->admitCache(simulator);
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#define BLACKGUI_COMPONENTS_CDBOWNMODELSETCOMPONENT_H
|
||||
|
||||
#include "blackgui/components/dbmappingcomponentaware.h"
|
||||
#include "blackgui/components/simulatorselector.h"
|
||||
#include "blackgui/menus/menudelegate.h"
|
||||
#include "blackmisc/simulation/data/modelcaches.h"
|
||||
#include "blackmisc/simulation/settings/modelsettings.h"
|
||||
@@ -101,6 +102,9 @@ namespace BlackGui
|
||||
//! Simulator
|
||||
void setSimulator(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
|
||||
//! \copydoc BlackGui::Components::CSimulatorSelector::setMode
|
||||
void setSimulatorSelectorMode(CSimulatorSelector::Mode mode);
|
||||
|
||||
//! Deferred init of simulator
|
||||
void triggerSetSimulatorDeferred(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<widget class="BlackGui::Components::CSimulatorSelector" name="comp_SimulatorSelector">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
@@ -184,17 +184,17 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>BlackGui::Views::CAircraftModelView</class>
|
||||
<extends>QTableView</extends>
|
||||
<header>blackgui/views/aircraftmodelview.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Components::CSimulatorSelector</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>blackgui/components/simulatorselector.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Views::CAircraftModelView</class>
|
||||
<extends>QTableView</extends>
|
||||
<header>blackgui/views/aircraftmodelview.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
@@ -21,6 +21,7 @@ namespace BlackGui
|
||||
ui(new Ui::CDbOwnModelSetDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->comp_OwnModelSet->setSimulatorSelectorMode(CSimulatorSelector::ComboBox);
|
||||
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user