Fix updating of add-on aircraft in the launcher.
Kick off a re-scan when adding or removing paths.
This commit is contained in:
parent
72988a6bb7
commit
006ca7186b
4 changed files with 16 additions and 11 deletions
|
@ -124,11 +124,6 @@ void AddOnsPage::onAddSceneryPath()
|
||||||
m_ui->sceneryPathsList->addItem(path);
|
m_ui->sceneryPathsList->addItem(path);
|
||||||
saveSceneryPaths();
|
saveSceneryPaths();
|
||||||
}
|
}
|
||||||
|
|
||||||
// work around a Qt OS-X bug - this dialog is ending ordered
|
|
||||||
// behind the main settings dialog (consequence of modal-dialog
|
|
||||||
// showing a modla dialog showing a modial dialog)
|
|
||||||
window()->raise();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddOnsPage::onRemoveSceneryPath()
|
void AddOnsPage::onRemoveSceneryPath()
|
||||||
|
@ -175,11 +170,8 @@ void AddOnsPage::onAddAircraftPath()
|
||||||
}
|
}
|
||||||
|
|
||||||
saveAircraftPaths();
|
saveAircraftPaths();
|
||||||
|
emit aircraftPathsChanged();
|
||||||
}
|
}
|
||||||
// work around a Qt OS-X bug - this dialog is ending ordered
|
|
||||||
// behind the main settings dialog (consequence of modal-dialog
|
|
||||||
// showing a modla dialog showing a modial dialog)
|
|
||||||
window()->raise();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddOnsPage::onRemoveAircraftPath()
|
void AddOnsPage::onRemoveAircraftPath()
|
||||||
|
@ -187,6 +179,7 @@ void AddOnsPage::onRemoveAircraftPath()
|
||||||
if (m_ui->aircraftPathsList->currentItem()) {
|
if (m_ui->aircraftPathsList->currentItem()) {
|
||||||
delete m_ui->aircraftPathsList->currentItem();
|
delete m_ui->aircraftPathsList->currentItem();
|
||||||
saveAircraftPaths();
|
saveAircraftPaths();
|
||||||
|
emit aircraftPathsChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,8 @@ public:
|
||||||
signals:
|
signals:
|
||||||
void downloadDirChanged();
|
void downloadDirChanged();
|
||||||
void sceneryPathsChanged();
|
void sceneryPathsChanged();
|
||||||
|
void aircraftPathsChanged();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onAddSceneryPath();
|
void onAddSceneryPath();
|
||||||
void onRemoveSceneryPath();
|
void onRemoveSceneryPath();
|
||||||
|
|
|
@ -870,6 +870,8 @@ QtLauncher::QtLauncher() :
|
||||||
this, &QtLauncher::onDownloadDirChanged);
|
this, &QtLauncher::onDownloadDirChanged);
|
||||||
connect(addOnsPage, &AddOnsPage::sceneryPathsChanged,
|
connect(addOnsPage, &AddOnsPage::sceneryPathsChanged,
|
||||||
this, &QtLauncher::setSceneryPaths);
|
this, &QtLauncher::setSceneryPaths);
|
||||||
|
connect(addOnsPage, &AddOnsPage::aircraftPathsChanged,
|
||||||
|
this, &QtLauncher::onAircraftPathsChanged);
|
||||||
|
|
||||||
m_ui->tabWidget->addTab(addOnsPage, tr("Add-ons"));
|
m_ui->tabWidget->addTab(addOnsPage, tr("Add-ons"));
|
||||||
// after any kind of reset, try to restore selection and scroll
|
// after any kind of reset, try to restore selection and scroll
|
||||||
|
@ -1635,8 +1637,9 @@ void QtLauncher::onDownloadDirChanged()
|
||||||
|
|
||||||
globals->get_subsystem<FGHTTPClient>()->init();
|
globals->get_subsystem<FGHTTPClient>()->init();
|
||||||
|
|
||||||
QSettings settings;
|
|
||||||
// re-scan the aircraft list
|
// re-scan the aircraft list
|
||||||
|
QSettings settings;
|
||||||
|
|
||||||
m_aircraftModel->setPackageRoot(globals->packageRoot());
|
m_aircraftModel->setPackageRoot(globals->packageRoot());
|
||||||
m_aircraftModel->setPaths(settings.value("aircraft-paths").toStringList());
|
m_aircraftModel->setPaths(settings.value("aircraft-paths").toStringList());
|
||||||
m_aircraftModel->scanDirs();
|
m_aircraftModel->scanDirs();
|
||||||
|
@ -1647,6 +1650,13 @@ void QtLauncher::onDownloadDirChanged()
|
||||||
setSceneryPaths();
|
setSceneryPaths();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QtLauncher::onAircraftPathsChanged()
|
||||||
|
{
|
||||||
|
QSettings settings;
|
||||||
|
m_aircraftModel->setPaths(settings.value("aircraft-paths").toStringList());
|
||||||
|
m_aircraftModel->scanDirs();
|
||||||
|
}
|
||||||
|
|
||||||
bool QtLauncher::shouldShowOfficialCatalogMessage() const
|
bool QtLauncher::shouldShowOfficialCatalogMessage() const
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
|
@ -109,6 +109,7 @@ private slots:
|
||||||
|
|
||||||
void onPackagesNeedUpdate(bool yes);
|
void onPackagesNeedUpdate(bool yes);
|
||||||
|
|
||||||
|
void onAircraftPathsChanged();
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue