mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
refs #475, allow to load DB data from disk.
* Will allow to load data if DB is not accessible / available * Also allows to save, so a special set can be saved for testing/forensic. * fixed status bar, as received data no longer means DB is alive
This commit is contained in:
committed by
Mathew Sutcliffe
parent
326a465b54
commit
aa653e0d85
@@ -7,11 +7,12 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "ui_datainfoareacomponent.h"
|
||||
#include "blackgui/components/logcomponent.h"
|
||||
#include "blackgui/components/datainfoareacomponent.h"
|
||||
#include "blackcore/webdataservices.h"
|
||||
#include "ui_datainfoareacomponent.h"
|
||||
#include "blackmisc/icons.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackGui;
|
||||
@@ -73,6 +74,37 @@ namespace BlackGui
|
||||
this->ui->comp_DbLiveries->setProvider(provider);
|
||||
this->ui->comp_DbModels->setProvider(provider);
|
||||
this->ui->comp_Countries->setProvider(provider);
|
||||
CWebDataServicesAware::setProvider(provider);
|
||||
}
|
||||
|
||||
bool CDataInfoAreaComponent::writeDbDataToResourceDir() const
|
||||
{
|
||||
bool s = hasProvider() &&
|
||||
this->writeDbDataToDisk(CProject::getSwiftStaticDbFilesDir());
|
||||
if (s)
|
||||
{
|
||||
CLogMessage(this).info("Written DB data");
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).error("Cannot write DB data");
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
bool CDataInfoAreaComponent::readDbDataFromResourceDir()
|
||||
{
|
||||
bool s = hasProvider() &&
|
||||
this->readDbDataFromDisk(CProject::getSwiftStaticDbFilesDir());
|
||||
if (s)
|
||||
{
|
||||
CLogMessage(this).info("Read DB data");
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).error("Failed to load DB data");
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
QSize CDataInfoAreaComponent::getPreferredSizeWhenFloating(int areaIndex) const
|
||||
|
||||
Reference in New Issue
Block a user