mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 10:45:37 +08:00
Misc. smaller fixes
* copy configuration dialog handles case if there is no other swift version * QPointer "guard" for lambda * first model set UI
This commit is contained in:
@@ -51,6 +51,7 @@ namespace BlackGui
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
this->initOtherSwiftVersions();
|
this->initOtherSwiftVersions();
|
||||||
this->setWidths();
|
this->setWidths();
|
||||||
|
m_hasOtherSwiftVersions = CDirectoryUtils::hasOtherSwiftDataDirectories();
|
||||||
|
|
||||||
ui->cb_ShowAll->setChecked(m_nameFilterDisables);
|
ui->cb_ShowAll->setChecked(m_nameFilterDisables);
|
||||||
connect(ui->rb_Cache, &QRadioButton::toggled, [ = ](bool) { this->initCurrentDirectories(true); });
|
connect(ui->rb_Cache, &QRadioButton::toggled, [ = ](bool) { this->initCurrentDirectories(true); });
|
||||||
@@ -249,7 +250,12 @@ namespace BlackGui
|
|||||||
|
|
||||||
// source
|
// source
|
||||||
const QString sourceDir = this->getOtherVersionsSelectedDirectory();
|
const QString sourceDir = this->getOtherVersionsSelectedDirectory();
|
||||||
if (!sourceModel || m_initializedSourceDir != sourceDir)
|
if (!m_hasOtherSwiftVersions)
|
||||||
|
{
|
||||||
|
// no ther versions
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (!sourceModel || m_initializedSourceDir != sourceDir)
|
||||||
{
|
{
|
||||||
m_initializedSourceDir = sourceDir;
|
m_initializedSourceDir = sourceDir;
|
||||||
if (!sourceModel)
|
if (!sourceModel)
|
||||||
@@ -353,6 +359,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
QStringList CCopyConfigurationComponent::getSelectedFiles() const
|
QStringList CCopyConfigurationComponent::getSelectedFiles() const
|
||||||
{
|
{
|
||||||
|
if (!m_hasOtherSwiftVersions) { return QStringList(); }
|
||||||
const QModelIndexList indexes = ui->tv_Source->selectionModel()->selectedIndexes();
|
const QModelIndexList indexes = ui->tv_Source->selectionModel()->selectedIndexes();
|
||||||
if (indexes.isEmpty()) { return QStringList(); }
|
if (indexes.isEmpty()) { return QStringList(); }
|
||||||
const QFileSystemModel *sourceModel = qobject_cast<QFileSystemModel *>(ui->tv_Source->model());
|
const QFileSystemModel *sourceModel = qobject_cast<QFileSystemModel *>(ui->tv_Source->model());
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ namespace BlackGui
|
|||||||
bool m_logCopiedFiles = true;
|
bool m_logCopiedFiles = true;
|
||||||
bool m_nameFilterDisables = false; //!< name filter disables or hides
|
bool m_nameFilterDisables = false; //!< name filter disables or hides
|
||||||
bool m_withBootstrapFile = false;
|
bool m_withBootstrapFile = false;
|
||||||
|
bool m_hasOtherSwiftVersions = false;
|
||||||
|
|
||||||
// caches will be explicitly initialized in initCaches
|
// caches will be explicitly initialized in initCaches
|
||||||
BlackMisc::Simulation::Data::CModelCaches m_modelCaches { false, this };
|
BlackMisc::Simulation::Data::CModelCaches m_modelCaches { false, this };
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QLabel" name="lbl_Explaination">
|
<widget class="QLabel" name="lbl_Explaination">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><html><head/><body><p><span style=" font-size:9pt; font-weight:600; color:#ff0000;">WORK IN PROGRESS, not finished </span><span style=" font-size:9pt;">The model set defines which aircraft you will use in the simulator. From all models you have installed on your disk you can select a subset actually being used.</span></p></body></html></string>
|
<string><html><head/><body><p><span style=" font-size:9pt; font-weight:600; color:#ff0000;">WORK IN PROGRESS (experimental) </span><span style=" font-size:9pt;">The model set defines which aircraft you will use in the simulator. From all models you have installed on your disk you can select a subset actually being used.</span></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::RichText</enum>
|
<enum>Qt::RichText</enum>
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="lbl_ModelDirectories">
|
<widget class="QLabel" name="lbl_ModelDirectories">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Model directories:</string>
|
<string>Model dir.:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -79,21 +79,21 @@
|
|||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QPushButton" name="pb_ModelSet">
|
<widget class="QPushButton" name="pb_ModelSet">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>show set</string>
|
<string>set</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QPushButton" name="pb_Models">
|
<widget class="QPushButton" name="pb_Models">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string> show models </string>
|
<string>models</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QPushButton" name="pb_ModelsTriggerReload">
|
<widget class="QPushButton" name="pb_ModelsTriggerReload">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string> trigger reload </string>
|
<string>reload</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -152,9 +152,11 @@ namespace BlackGui
|
|||||||
if (this->hasPendingConfirmation())
|
if (this->hasPendingConfirmation())
|
||||||
{
|
{
|
||||||
// defer message
|
// defer message
|
||||||
|
QPointer<COverlayMessages> myself(this);
|
||||||
m_pendingMessageCalls.push_back([ = ]()
|
m_pendingMessageCalls.push_back([ = ]()
|
||||||
{
|
{
|
||||||
this->showOverlayMessages(messages, timeOutMs);
|
if (!myself) { return; }
|
||||||
|
myself->showOverlayMessages(messages, timeOutMs);
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -185,9 +187,11 @@ namespace BlackGui
|
|||||||
if (this->hasPendingConfirmation())
|
if (this->hasPendingConfirmation())
|
||||||
{
|
{
|
||||||
// defer message
|
// defer message
|
||||||
|
QPointer<COverlayMessages> myself(this);
|
||||||
m_pendingMessageCalls.push_back([ = ]()
|
m_pendingMessageCalls.push_back([ = ]()
|
||||||
{
|
{
|
||||||
this->showOverlayMessage(message, timeOutMs);
|
if (!myself) { return; }
|
||||||
|
myself->showOverlayMessage(message, timeOutMs);
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -214,9 +218,11 @@ namespace BlackGui
|
|||||||
if (this->hasPendingConfirmation())
|
if (this->hasPendingConfirmation())
|
||||||
{
|
{
|
||||||
// defer message
|
// defer message
|
||||||
|
QPointer<COverlayMessages> myself(this);
|
||||||
m_pendingMessageCalls.push_back([ = ]()
|
m_pendingMessageCalls.push_back([ = ]()
|
||||||
{
|
{
|
||||||
this->showOverlayTextMessage(textMessage, timeOutMs);
|
if (!myself) { return; }
|
||||||
|
myself->showOverlayTextMessage(textMessage, timeOutMs);
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -242,9 +248,11 @@ namespace BlackGui
|
|||||||
if (this->hasPendingConfirmation())
|
if (this->hasPendingConfirmation())
|
||||||
{
|
{
|
||||||
// defer message
|
// defer message
|
||||||
|
QPointer<COverlayMessages> myself(this);
|
||||||
m_pendingMessageCalls.push_back([ = ]()
|
m_pendingMessageCalls.push_back([ = ]()
|
||||||
{
|
{
|
||||||
this->showOverlayImage(image, timeOutMs);
|
if (!myself) { return; }
|
||||||
|
myself->showOverlayImage(image, timeOutMs);
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -358,8 +366,10 @@ namespace BlackGui
|
|||||||
if (this->hasPendingConfirmation())
|
if (this->hasPendingConfirmation())
|
||||||
{
|
{
|
||||||
// defer message
|
// defer message
|
||||||
|
QPointer<COverlayMessages> myself(this);
|
||||||
m_pendingMessageCalls.push_back([ = ]()
|
m_pendingMessageCalls.push_back([ = ]()
|
||||||
{
|
{
|
||||||
|
if (!myself) { return; }
|
||||||
this->showOverlayMessagesWithConfirmation(messages, appendOldMessages, confirmationMessage, okLambda, defaultButton, timeOutMs);
|
this->showOverlayMessagesWithConfirmation(messages, appendOldMessages, confirmationMessage, okLambda, defaultButton, timeOutMs);
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user