mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +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->tvp_StashAircraftModels, &CAircraftModelView::modelChanged, this, &CDbStashComponent::stashedModelsChanged);
|
||||
connect(this->ui->tvp_StashAircraftModels, &CAircraftModelView::modelDataChanged, this, &CDbStashComponent::ps_onRowCountChanged);
|
||||
connect(ui->pb_RemoveInvald, &QPushButton::pressed, this, &CDbStashComponent::ps_onRemoveInvalidPressed);
|
||||
|
||||
// copy over buttons
|
||||
connect(this->ui->pb_AircraftIcao, &QPushButton::pressed, this, &CDbStashComponent::ps_copyOverPartsToSelected);
|
||||
@@ -236,6 +237,15 @@ namespace BlackGui
|
||||
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()
|
||||
{
|
||||
if (this->ui->tvp_StashAircraftModels->isEmpty()) {return; }
|
||||
|
||||
@@ -77,6 +77,9 @@ namespace BlackGui
|
||||
//! Unstash given models by model string
|
||||
int unstashModels(QStringList modelStrings);
|
||||
|
||||
//! Unstash given models
|
||||
int unstashModels(const BlackMisc::Simulation::CAircraftModelList &models);
|
||||
|
||||
//! The embedded view
|
||||
BlackGui::Views::CAircraftModelView *view() const;
|
||||
|
||||
@@ -140,6 +143,9 @@ namespace BlackGui
|
||||
//! Validate pressed
|
||||
void ps_onValidatePressed();
|
||||
|
||||
//! Remove invalid (validates and removes invalid models)
|
||||
void ps_onRemoveInvalidPressed();
|
||||
|
||||
//! Publish pressed
|
||||
void ps_onPublishPressed();
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>616</width>
|
||||
<width>773</width>
|
||||
<height>221</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -90,6 +90,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
<widget class="QPushButton" name="pb_Publish">
|
||||
<property name="text">
|
||||
@@ -155,10 +165,16 @@
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>tvp_StashAircraftModels</tabstop>
|
||||
<tabstop>pb_Unstash</tabstop>
|
||||
<tabstop>pb_Validate</tabstop>
|
||||
<tabstop>pb_RemoveInvald</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>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace BlackGui
|
||||
{
|
||||
if (modelStrings.isEmpty()) { return 0; }
|
||||
CAircraftModelList copy(this->container());
|
||||
int delta = copy.removeModelsWithString(modelStrings, sensitivity);
|
||||
const int delta = copy.removeModelsWithString(modelStrings, sensitivity);
|
||||
if (delta > 0)
|
||||
{
|
||||
this->updateContainerMaybeAsync(copy);
|
||||
|
||||
Reference in New Issue
Block a user