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:
Klaus Basan
2018-05-23 23:13:39 +02:00
parent fcd08e7918
commit 26dcc547e6
4 changed files with 28 additions and 10 deletions

View File

@@ -51,6 +51,7 @@ namespace BlackGui
ui->setupUi(this);
this->initOtherSwiftVersions();
this->setWidths();
m_hasOtherSwiftVersions = CDirectoryUtils::hasOtherSwiftDataDirectories();
ui->cb_ShowAll->setChecked(m_nameFilterDisables);
connect(ui->rb_Cache, &QRadioButton::toggled, [ = ](bool) { this->initCurrentDirectories(true); });
@@ -249,7 +250,12 @@ namespace BlackGui
// source
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;
if (!sourceModel)
@@ -353,6 +359,7 @@ namespace BlackGui
QStringList CCopyConfigurationComponent::getSelectedFiles() const
{
if (!m_hasOtherSwiftVersions) { return QStringList(); }
const QModelIndexList indexes = ui->tv_Source->selectionModel()->selectedIndexes();
if (indexes.isEmpty()) { return QStringList(); }
const QFileSystemModel *sourceModel = qobject_cast<QFileSystemModel *>(ui->tv_Source->model());

View File

@@ -126,6 +126,7 @@ namespace BlackGui
bool m_logCopiedFiles = true;
bool m_nameFilterDisables = false; //!< name filter disables or hides
bool m_withBootstrapFile = false;
bool m_hasOtherSwiftVersions = false;
// caches will be explicitly initialized in initCaches
BlackMisc::Simulation::Data::CModelCaches m_modelCaches { false, this };

View File

@@ -20,7 +20,7 @@
<item row="0" column="1">
<widget class="QLabel" name="lbl_Explaination">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:9pt; font-weight:600; color:#ff0000;&quot;&gt;WORK IN PROGRESS, not finished &lt;/span&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;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.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:9pt; font-weight:600; color:#ff0000;&quot;&gt;WORK IN PROGRESS (experimental) &lt;/span&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;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.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
@@ -56,7 +56,7 @@
<item row="0" column="0">
<widget class="QLabel" name="lbl_ModelDirectories">
<property name="text">
<string>Model directories:</string>
<string>Model dir.:</string>
</property>
</widget>
</item>
@@ -79,21 +79,21 @@
<item row="1" column="0">
<widget class="QPushButton" name="pb_ModelSet">
<property name="text">
<string>show set</string>
<string>set</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="pb_Models">
<property name="text">
<string> show models </string>
<string>models</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pb_ModelsTriggerReload">
<property name="text">
<string> trigger reload </string>
<string>reload</string>
</property>
</widget>
</item>