mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 04:25:42 +08:00
refs #735, remove invalid objects from stash
* button "remove invalid objects" * tab order fixed
This commit is contained in:
committed by
Mathew Sutcliffe
parent
9c2a2de4c5
commit
61ac328d10
@@ -65,6 +65,7 @@ namespace BlackGui
|
|||||||
connect(this->ui->pb_Publish, &QPushButton::pressed, this, &CDbStashComponent::ps_onPublishPressed);
|
connect(this->ui->pb_Publish, &QPushButton::pressed, this, &CDbStashComponent::ps_onPublishPressed);
|
||||||
connect(this->ui->tvp_StashAircraftModels, &CAircraftModelView::modelChanged, this, &CDbStashComponent::stashedModelsChanged);
|
connect(this->ui->tvp_StashAircraftModels, &CAircraftModelView::modelChanged, this, &CDbStashComponent::stashedModelsChanged);
|
||||||
connect(this->ui->tvp_StashAircraftModels, &CAircraftModelView::modelDataChanged, this, &CDbStashComponent::ps_onRowCountChanged);
|
connect(this->ui->tvp_StashAircraftModels, &CAircraftModelView::modelDataChanged, this, &CDbStashComponent::ps_onRowCountChanged);
|
||||||
|
connect(ui->pb_RemoveInvald, &QPushButton::pressed, this, &CDbStashComponent::ps_onRemoveInvalidPressed);
|
||||||
|
|
||||||
// copy over buttons
|
// copy over buttons
|
||||||
connect(this->ui->pb_AircraftIcao, &QPushButton::pressed, this, &CDbStashComponent::ps_copyOverPartsToSelected);
|
connect(this->ui->pb_AircraftIcao, &QPushButton::pressed, this, &CDbStashComponent::ps_copyOverPartsToSelected);
|
||||||
@@ -236,6 +237,15 @@ namespace BlackGui
|
|||||||
this->validateAndDisplay(validModels, invalidModels, true);
|
this->validateAndDisplay(validModels, invalidModels, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CDbStashComponent::ps_onRemoveInvalidPressed()
|
||||||
|
{
|
||||||
|
if (ui->tvp_StashAircraftModels->isEmpty()) {return; }
|
||||||
|
CAircraftModelList validModels;
|
||||||
|
CAircraftModelList invalidModels;
|
||||||
|
this->validate(validModels, invalidModels);
|
||||||
|
this->unstashModels(invalidModels);
|
||||||
|
}
|
||||||
|
|
||||||
void CDbStashComponent::ps_onPublishPressed()
|
void CDbStashComponent::ps_onPublishPressed()
|
||||||
{
|
{
|
||||||
if (this->ui->tvp_StashAircraftModels->isEmpty()) {return; }
|
if (this->ui->tvp_StashAircraftModels->isEmpty()) {return; }
|
||||||
|
|||||||
@@ -77,6 +77,9 @@ namespace BlackGui
|
|||||||
//! Unstash given models by model string
|
//! Unstash given models by model string
|
||||||
int unstashModels(QStringList modelStrings);
|
int unstashModels(QStringList modelStrings);
|
||||||
|
|
||||||
|
//! Unstash given models
|
||||||
|
int unstashModels(const BlackMisc::Simulation::CAircraftModelList &models);
|
||||||
|
|
||||||
//! The embedded view
|
//! The embedded view
|
||||||
BlackGui::Views::CAircraftModelView *view() const;
|
BlackGui::Views::CAircraftModelView *view() const;
|
||||||
|
|
||||||
@@ -140,6 +143,9 @@ namespace BlackGui
|
|||||||
//! Validate pressed
|
//! Validate pressed
|
||||||
void ps_onValidatePressed();
|
void ps_onValidatePressed();
|
||||||
|
|
||||||
|
//! Remove invalid (validates and removes invalid models)
|
||||||
|
void ps_onRemoveInvalidPressed();
|
||||||
|
|
||||||
//! Publish pressed
|
//! Publish pressed
|
||||||
void ps_onPublishPressed();
|
void ps_onPublishPressed();
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>616</width>
|
<width>773</width>
|
||||||
<height>221</height>
|
<height>221</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@@ -90,6 +90,16 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pb_RemoveInvald">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Remove invalid models</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Rem. invalid</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pb_Publish">
|
<widget class="QPushButton" name="pb_Publish">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -155,10 +165,16 @@
|
|||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
|
<tabstop>tvp_StashAircraftModels</tabstop>
|
||||||
<tabstop>pb_Unstash</tabstop>
|
<tabstop>pb_Unstash</tabstop>
|
||||||
<tabstop>pb_Validate</tabstop>
|
<tabstop>pb_Validate</tabstop>
|
||||||
|
<tabstop>pb_RemoveInvald</tabstop>
|
||||||
<tabstop>pb_Publish</tabstop>
|
<tabstop>pb_Publish</tabstop>
|
||||||
<tabstop>tvp_StashAircraftModels</tabstop>
|
<tabstop>cb_SelectedOnly</tabstop>
|
||||||
|
<tabstop>pb_Distributor</tabstop>
|
||||||
|
<tabstop>pb_AircraftIcao</tabstop>
|
||||||
|
<tabstop>pb_Livery</tabstop>
|
||||||
|
<tabstop>pb_AirlineIcao</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
if (modelStrings.isEmpty()) { return 0; }
|
if (modelStrings.isEmpty()) { return 0; }
|
||||||
CAircraftModelList copy(this->container());
|
CAircraftModelList copy(this->container());
|
||||||
int delta = copy.removeModelsWithString(modelStrings, sensitivity);
|
const int delta = copy.removeModelsWithString(modelStrings, sensitivity);
|
||||||
if (delta > 0)
|
if (delta > 0)
|
||||||
{
|
{
|
||||||
this->updateContainerMaybeAsync(copy);
|
this->updateContainerMaybeAsync(copy);
|
||||||
|
|||||||
Reference in New Issue
Block a user