8 #include "ui_dbcountrycomponent.h"
18 using namespace swift::misc::network;
23 CDbCountryComponent::CDbCountryComponent(QWidget *parent) : QFrame(parent), ui(new Ui::
CDbCountryComponent)
27 ui->tvp_Countries->setResizeMode(CViewBaseNonTemplate::ResizingOnce);
28 connect(ui->tvp_Countries, &CCountryView::requestNewBackendData,
this, &CDbCountryComponent::onReload);
31 ui->tvp_Countries->setFilterWidget(ui->filter_CountryComponent);
32 ui->tvp_Countries->allowDragDrop(
true,
false);
34 connect(
sApp->
getWebDataServices(), &CWebDataServices::dataRead,
this, &CDbCountryComponent::onCountriesRead,
35 Qt::QueuedConnection);
36 this->onCountriesRead(CEntityFlags::CountryEntity, CEntityFlags::ReadFinished,
42 void CDbCountryComponent::onCountriesRead(CEntityFlags::Entity entity,
CEntityFlags::ReadState readState,
int count,
49 if (entity.testFlag(CEntityFlags::CountryEntity) && CEntityFlags::isFinishedReadState(readState))
55 void CDbCountryComponent::onReload()
SWIFT_CORE_EXPORT swift::core::CApplication * sApp
Single instance of application object.
bool isShuttingDown() const
Is application shutting down?
CWebDataServices * getWebDataServices() const
Get the web data services.
swift::misc::CCountryList getCountries() const
Countries.
int getCountriesCount() const
Country count.
swift::misc::network::CEntityFlags::Entity triggerLoadingDirectlyFromDb(swift::misc::network::CEntityFlags::Entity whatToRead, const QDateTime &newerThan=QDateTime())
Trigger reload from DB, loads the DB data and bypasses the caches checks and info objects.
void setViewWithIndicator(swift::gui::views::CViewBaseNonTemplate *viewWithIndicator)
Set the corresponding view.
virtual ~CDbCountryComponent()
Destructor.
ReadState
State of operation.
SWIFT_GUI_EXPORT swift::gui::CGuiApplication * sGui
Single instance of GUI application object.
Backend services of the swift project, like dealing with the network or the simulators.
High level reusable GUI components.
Views, mainly QTableView.