swift
dbloadoverviewcomponent.cpp
1 // SPDX-FileCopyrightText: Copyright (C) 2016 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #include <QMessageBox>
7 #include <QPointer>
8 
9 #include "ui_dbloadoverviewcomponent.h"
10 
11 #include "core/db/infodatareader.h"
12 #include "core/webdataservices.h"
13 #include "gui/guiapplication.h"
14 #include "gui/guiutility.h"
15 #include "misc/htmlutils.h"
17 
18 using namespace swift::gui;
19 using namespace swift::core;
20 using namespace swift::misc;
21 using namespace swift::misc::network;
22 
23 namespace swift::gui::components
24 {
25  CDbLoadOverviewComponent::CDbLoadOverviewComponent(QWidget *parent)
26  : QFrame(parent), CLoadIndicatorEnabled(this), ui(new Ui::CDbLoadOverviewComponent)
27  {
28  Q_ASSERT_X(sGui, Q_FUNC_INFO, "missing sGui");
29  ui->setupUi(this);
30 
32  // althought admit happens in background, this component might trigger cache reads not needed (though it is not
33  // very likely)
34  this->admitCaches();
35 
36  ui->lbl_DatabaseUrl->setTextFormat(Qt::RichText);
37  ui->lbl_DatabaseUrl->setTextInteractionFlags(Qt::TextBrowserInteraction);
38  ui->lbl_DatabaseUrl->setOpenExternalLinks(true);
39  ui->lbl_SharedUrls->setTextFormat(Qt::RichText);
40  ui->lbl_SharedUrls->setTextInteractionFlags(Qt::TextBrowserInteraction);
41  ui->lbl_SharedUrls->setOpenExternalLinks(true);
42 
43  connect(ui->tb_DbReloadAircraft, &QToolButton::pressed, this, &CDbLoadOverviewComponent::refreshDbPressed);
44  connect(ui->tb_DbReloadAirlines, &QToolButton::pressed, this, &CDbLoadOverviewComponent::refreshDbPressed);
45  connect(ui->tb_DbReloadAirports, &QToolButton::pressed, this, &CDbLoadOverviewComponent::refreshDbPressed);
46  connect(ui->tb_DbReloadCountries, &QToolButton::pressed, this, &CDbLoadOverviewComponent::refreshDbPressed);
47  connect(ui->tb_DbReloadLiveries, &QToolButton::pressed, this, &CDbLoadOverviewComponent::refreshDbPressed);
48  connect(ui->tb_DbReloadModels, &QToolButton::pressed, this, &CDbLoadOverviewComponent::refreshDbPressed);
49  connect(ui->tb_DbReloadDistributors, &QToolButton::pressed, this, &CDbLoadOverviewComponent::refreshDbPressed);
50  connect(ui->tb_DbReloadCategories, &QToolButton::pressed, this, &CDbLoadOverviewComponent::refreshDbPressed);
51 
52  connect(ui->tb_SharedReloadAircraft, &QToolButton::pressed, this,
53  &CDbLoadOverviewComponent::refreshSharedPressed);
54  connect(ui->tb_SharedReloadAirlines, &QToolButton::pressed, this,
55  &CDbLoadOverviewComponent::refreshSharedPressed);
56  connect(ui->tb_SharedReloadAirports, &QToolButton::pressed, this,
57  &CDbLoadOverviewComponent::refreshSharedPressed);
58  connect(ui->tb_SharedReloadCountries, &QToolButton::pressed, this,
59  &CDbLoadOverviewComponent::refreshSharedPressed);
60  connect(ui->tb_SharedReloadLiveries, &QToolButton::pressed, this,
61  &CDbLoadOverviewComponent::refreshSharedPressed);
62  connect(ui->tb_SharedReloadModels, &QToolButton::pressed, this,
63  &CDbLoadOverviewComponent::refreshSharedPressed);
64  connect(ui->tb_SharedReloadDistributors, &QToolButton::pressed, this,
65  &CDbLoadOverviewComponent::refreshSharedPressed);
66  connect(ui->tb_SharedReloadCategories, &QToolButton::pressed, this,
67  &CDbLoadOverviewComponent::refreshSharedPressed);
68 
69  connect(ui->pb_LoadAllFromDB, &QPushButton::pressed, this, &CDbLoadOverviewComponent::loadAllFromDb);
70  connect(ui->pb_LoadAllFromShared, &QPushButton::pressed, this, &CDbLoadOverviewComponent::loadAllFromShared);
71  connect(ui->pb_LoadAllFromResources, &QPushButton::pressed, this,
73 
74  if (sGui->hasWebDataServices())
75  {
76  connect(sGui->getWebDataServices(), &CWebDataServices::dataRead, this,
77  &CDbLoadOverviewComponent::dataLoaded);
78  QPointer<CDbLoadOverviewComponent> myself(this);
79  QTimer::singleShot(10 * 1000, this, [=] {
80  if (!myself || !sGui || sGui->isShuttingDown()) { return; }
81  this->loadInfoObjects();
82  this->adjustTextWidth();
83  });
84  }
85  }
86 
88 
89  void CDbLoadOverviewComponent::display() { m_dsTriggerGuiUpdate.inputSignal(); }
90 
92  {
93  ui->lbl_DbRefresh->setVisible(visible);
94  ui->tb_DbReloadAircraft->setVisible(visible);
95  ui->tb_DbReloadAirlines->setVisible(visible);
96  ui->tb_DbReloadAirports->setVisible(visible);
97  ui->tb_DbReloadCountries->setVisible(visible);
98  ui->tb_DbReloadLiveries->setVisible(visible);
99  ui->tb_DbReloadModels->setVisible(visible);
100  ui->tb_DbReloadDistributors->setVisible(visible);
101  ui->tb_DbReloadCategories->setVisible(visible);
102  }
103 
105  {
106  ui->lbl_SharedRefresh->setVisible(visible);
107  ui->tb_SharedReloadAircraft->setVisible(visible);
108  ui->tb_SharedReloadAirlines->setVisible(visible);
109  ui->tb_SharedReloadAirports->setVisible(visible);
110  ui->tb_SharedReloadCountries->setVisible(visible);
111  ui->tb_SharedReloadLiveries->setVisible(visible);
112  ui->tb_SharedReloadModels->setVisible(visible);
113  ui->tb_SharedReloadDistributors->setVisible(visible);
114  ui->tb_SharedReloadCategories->setVisible(visible);
115  }
116 
117  void CDbLoadOverviewComponent::resizeEvent(QResizeEvent *event)
118  {
119  if (this->isShowingLoadIndicator())
120  {
121  // re-center
122  this->centerLoadIndicator();
123  this->adjustTextWidth();
124  }
125  QFrame::resizeEvent(event);
126  }
127 
128  void CDbLoadOverviewComponent::showVisibleLoadAllButtons(bool shared, bool db, bool disk)
129  {
130  const bool widget = shared || db;
131  ui->wi_LoadAllButtons->setVisible(widget);
132  ui->pb_LoadAllFromDB->setVisible(db);
133  ui->pb_LoadAllFromShared->setVisible(shared);
134  ui->pb_LoadAllFromResources->setVisible(disk);
135  }
136 
138  {
139  this->triggerLoadingFromDb(CEntityFlags::AllDbEntitiesNoInfoObjects);
140  }
141 
143  {
144  this->triggerLoadingFromSharedFiles(CEntityFlags::AllDbEntitiesNoInfoObjects);
145  }
146 
148  {
149  if (m_loadInProgress) { return; }
150  if (!sGui || sGui->isShuttingDown() || !sGui->getWebDataServices()) { return; }
151  const QMessageBox::StandardButton reply = QMessageBox::warning(
152  this, "Load DB data",
153  "You should only load DB from disk resources if loading from network does not work. Really load?",
154  QMessageBox::Yes | QMessageBox::No);
155  if (reply != QMessageBox::Yes) { return; }
157  }
158 
159  void CDbLoadOverviewComponent::setGuiValues()
160  {
161  if (!sGui) { return; }
162  if (!sGui->hasWebDataServices()) { return; }
163 
164  ui->le_AircraftIcaoCacheCount->setText(cacheCountForEntity(CEntityFlags::AircraftIcaoEntity));
165  ui->le_AirlinesIcaoCacheCount->setText(cacheCountForEntity(CEntityFlags::AirlineIcaoEntity));
166  ui->le_AirportsCacheCount->setText(cacheCountForEntity(CEntityFlags::AirportEntity));
167  ui->le_LiveriesCacheCount->setText(cacheCountForEntity(CEntityFlags::LiveryEntity));
168  ui->le_ModelsCacheCount->setText(cacheCountForEntity(CEntityFlags::ModelEntity));
169  ui->le_CountriesCacheCount->setText(cacheCountForEntity(CEntityFlags::CountryEntity));
170  ui->le_DistributorsCacheCount->setText(cacheCountForEntity(CEntityFlags::DistributorEntity));
171  ui->le_CategoriesCacheCount->setText(cacheCountForEntity(CEntityFlags::AircraftCategoryEntity));
172 
173  ui->le_AircraftIcaoDbCount->setText(dbCountForEntity(CEntityFlags::AircraftIcaoEntity));
174  ui->le_AirlinesIcaoDbCount->setText(dbCountForEntity(CEntityFlags::AirlineIcaoEntity));
175  ui->le_AirportsDbCount->setText(dbCountForEntity(CEntityFlags::AirportEntity));
176  ui->le_LiveriesDbCount->setText(dbCountForEntity(CEntityFlags::LiveryEntity));
177  ui->le_ModelsDbCount->setText(dbCountForEntity(CEntityFlags::ModelEntity));
178  ui->le_CountriesDbCount->setText(dbCountForEntity(CEntityFlags::CountryEntity));
179  ui->le_DistributorsDbCount->setText(dbCountForEntity(CEntityFlags::DistributorEntity));
180  ui->le_CategoriesDbCount->setText(dbCountForEntity(CEntityFlags::AircraftCategoryEntity));
181 
182  ui->le_AircraftIcaoSharedCount->setText(sharedCountForEntity(CEntityFlags::AircraftIcaoEntity));
183  ui->le_AirlinesIcaoSharedCount->setText(sharedCountForEntity(CEntityFlags::AirlineIcaoEntity));
184  ui->le_AirportsSharedCount->setText(sharedCountForEntity(CEntityFlags::AirportEntity));
185  ui->le_LiveriesSharedCount->setText(sharedCountForEntity(CEntityFlags::LiveryEntity));
186  ui->le_ModelsSharedCount->setText(sharedCountForEntity(CEntityFlags::ModelEntity));
187  ui->le_CountriesSharedCount->setText(sharedCountForEntity(CEntityFlags::CountryEntity));
188  ui->le_DistributorsSharedCount->setText(sharedCountForEntity(CEntityFlags::DistributorEntity));
189  ui->le_CategoriesSharedCount->setText(sharedCountForEntity(CEntityFlags::AircraftCategoryEntity));
190 
191  ui->le_AircraftIcaoCacheTs->setText(cacheTimestampForEntity(CEntityFlags::AircraftIcaoEntity));
192  ui->le_AirlinesIcaoCacheTs->setText(cacheTimestampForEntity(CEntityFlags::AirlineIcaoEntity));
193  ui->le_AirportsCacheTs->setText(cacheTimestampForEntity(CEntityFlags::AirportEntity));
194  ui->le_LiveriesCacheTs->setText(cacheTimestampForEntity(CEntityFlags::LiveryEntity));
195  ui->le_ModelsCacheTs->setText(cacheTimestampForEntity(CEntityFlags::ModelEntity));
196  ui->le_CountriesCacheTs->setText(cacheTimestampForEntity(CEntityFlags::CountryEntity));
197  ui->le_DistributorsCacheTs->setText(cacheTimestampForEntity(CEntityFlags::DistributorEntity));
198  ui->le_CategoriesCacheTs->setText(cacheTimestampForEntity(CEntityFlags::AircraftCategoryEntity));
199 
200  ui->le_AircraftIcaoDbTs->setText(dbTimestampForEntity(CEntityFlags::AircraftIcaoEntity));
201  ui->le_AirlinesIcaoDbTs->setText(dbTimestampForEntity(CEntityFlags::AirlineIcaoEntity));
202  ui->le_AirportsDbTs->setText(dbTimestampForEntity(CEntityFlags::AirportEntity));
203  ui->le_LiveriesDbTs->setText(dbTimestampForEntity(CEntityFlags::LiveryEntity));
204  ui->le_ModelsDbTs->setText(dbTimestampForEntity(CEntityFlags::ModelEntity));
205  ui->le_CountriesDbTs->setText(dbTimestampForEntity(CEntityFlags::CountryEntity));
206  ui->le_DistributorsDbTs->setText(dbTimestampForEntity(CEntityFlags::DistributorEntity));
207  ui->le_CategoriesDbTs->setText(dbTimestampForEntity(CEntityFlags::AircraftCategoryEntity));
208 
209  ui->le_AircraftIcaoSharedFileTs->setText(sharedFileTimestampForEntity(CEntityFlags::AircraftIcaoEntity));
210  ui->le_AirlinesIcaoSharedFileTs->setText(sharedFileTimestampForEntity(CEntityFlags::AirlineIcaoEntity));
211  ui->le_AirportsSharedFileTs->setText(sharedFileTimestampForEntity(CEntityFlags::AirportEntity));
212  ui->le_LiveriesSharedFileTs->setText(sharedFileTimestampForEntity(CEntityFlags::LiveryEntity));
213  ui->le_ModelsSharedFileTs->setText(sharedFileTimestampForEntity(CEntityFlags::ModelEntity));
214  ui->le_CountriesSharedFileTs->setText(sharedFileTimestampForEntity(CEntityFlags::CountryEntity));
215  ui->le_DistributorsSharedFileTs->setText(sharedFileTimestampForEntity(CEntityFlags::DistributorEntity));
216  ui->le_CategoriesSharedFileTs->setText(sharedFileTimestampForEntity(CEntityFlags::AircraftCategoryEntity));
217 
218  // DB URL
219  const QString dbUrlHtml("<a href=\"%2\">%3</a>");
220  const QString url = sGui->getGlobalSetup().getDbHomePageUrl().getFullUrl();
221  ui->lbl_DatabaseUrl->setText(dbUrlHtml.arg(url, url));
222  ui->lbl_DatabaseUrl->setToolTip(url);
223 
224  // Shared URLs
225  this->setSharedUrlValues();
226 
227  // Indicator
228  this->hideLoading();
229  }
230 
231  void CDbLoadOverviewComponent::setSharedUrlValues()
232  {
233  if (m_sharedValueCheckInProgress) { return; }
234  if ((QDateTime::currentMSecsSinceEpoch() - m_sharedLastCheck) < 5000) { return; } // do not check too often
235 
236  m_sharedValueCheckInProgress = true; // avoid processEvent (canConnect) calling this again before done
237 
238  const CUrl sharedUrl(sGui->getGlobalSetup().getSwiftSharedUrl());
239  const QString valueHtml("<img src=\"%1\">&nbsp;%2");
240  const QString urlLinkHtml("<a href=\"%1\">%2</a>");
241 
242  QStringList values;
243 
244  if (!sGui || sGui->isShuttingDown())
245  {
246  // shutdown during connect test
247  m_sharedValueCheckInProgress = false;
248  return;
249  }
250  const bool canConnect = CNetworkUtils::canConnect(sharedUrl);
251  values.push_back(valueHtml.arg(canConnect ? m_imgOk : m_imgFailed,
252  urlLinkHtml.arg(sharedUrl.getFullUrl(), sharedUrl.getHost())));
253 
254  const QString sharedUrlTable = toHtmTable(values, 2);
255  ui->lbl_SharedUrls->setText(sharedUrlTable);
256  ui->lbl_SharedUrls->setMinimumHeight(28);
257  const QString currentlyUsedSharedUrl = sGui->getGlobalSetup().getSwiftSharedUrl().toQString();
258  ui->lbl_SharedUrls->setToolTip(currentlyUsedSharedUrl.isEmpty() ? "No shared URL" :
259  "currently used: " + currentlyUsedSharedUrl);
260 
261  m_sharedLastCheck = QDateTime::currentMSecsSinceEpoch();
262  m_sharedValueCheckInProgress = false;
263  }
264 
265  bool CDbLoadOverviewComponent::isInitialized() const { return !ui->le_AircraftIcaoCacheCount->text().isEmpty(); }
266 
267  QString CDbLoadOverviewComponent::formattedTimestamp(const QDateTime &dateTime)
268  {
269  if (!dateTime.isValid()) { return "-"; }
270  return dateTime.toUTC().toString("yy-MM-dd hh:mm:ss");
271  }
272 
273  QString CDbLoadOverviewComponent::cacheTimestampForEntity(CEntityFlags::Entity entity)
274  {
275  const QDateTime ts = sGui->getWebDataServices()->getCacheTimestamp(entity);
276  return formattedTimestamp(ts);
277  }
278 
279  QString CDbLoadOverviewComponent::dbTimestampForEntity(CEntityFlags::Entity entity)
280  {
281  const QDateTime ts = sGui->getWebDataServices()->getLatestDbEntityTimestamp(entity);
282  return formattedTimestamp(ts);
283  }
284 
285  QString CDbLoadOverviewComponent::cacheCountForEntity(CEntityFlags::Entity entity)
286  {
287  const int c = sGui->getWebDataServices()->getCacheCount(entity);
288  return c < 0 ? "-" : QString::number(c);
289  }
290 
291  QString CDbLoadOverviewComponent::sharedFileTimestampForEntity(CEntityFlags::Entity entity)
292  {
293  const QDateTime ts = sGui->getWebDataServices()->getLatestSharedInfoObjectTimestamp(entity);
294  return formattedTimestamp(ts);
295  }
296 
297  QString CDbLoadOverviewComponent::sharedCountForEntity(CEntityFlags::Entity entity)
298  {
299  const int c = sGui->getWebDataServices()->getSharedInfoObjectCount(entity);
300  return c < 0 ? "-" : QString::number(c);
301  }
302 
303  QString CDbLoadOverviewComponent::dbCountForEntity(CEntityFlags::Entity entity)
304  {
305  const int c = sGui->getWebDataServices()->getDbInfoObjectCount(entity);
306  return c < 0 ? "-" : QString::number(c);
307  }
308 
309  void CDbLoadOverviewComponent::admitCaches()
310  {
311  // remark admit only triggers, it does not wait like synchronize
312  if (!sGui->hasWebDataServices()) { return; }
313  sGui->getWebDataServices()->admitDbCaches(CEntityFlags::AllDbEntities);
314  }
315 
316  void CDbLoadOverviewComponent::refreshDbPressed()
317  {
318  if (m_loadInProgress) { return; }
319  const QObject *sender = QObject::sender();
320  const CEntityFlags::Entity entity = CEntityFlags::singleEntityByName(sender->objectName());
321  this->triggerLoadingFromDb(entity);
322  }
323 
324  void CDbLoadOverviewComponent::triggerLoadingFromDb(CEntityFlags::Entity entities)
325  {
326  Q_ASSERT_X(sGui, Q_FUNC_INFO, "Missing sGui");
327  if (m_loadInProgress) { return; }
328 
329  // DB entities
330  const CEntityFlags::Entity triggeredEntities =
332  if (triggeredEntities == CEntityFlags::NoEntity) { return; }
333  m_loadInProgress = true;
334  this->showLoading();
335 
336  // shared files ts and DB info objects
339  }
340 
341  void CDbLoadOverviewComponent::refreshSharedPressed()
342  {
343  if (m_loadInProgress) { return; }
344  const QObject *sender = QObject::sender();
345  const CEntityFlags::Entity entity = CEntityFlags::singleEntityByName(sender->objectName());
346  this->triggerLoadingFromSharedFiles(entity);
347  }
348 
349  void CDbLoadOverviewComponent::triggerLoadingFromSharedFiles(CEntityFlags::Entity entities)
350  {
351  if (m_loadInProgress) { return; }
352 
353  // DB entities
354  const CEntityFlags::Entity triggeredEntities =
356  if (triggeredEntities == CEntityFlags::NoEntity) { return; }
357  m_loadInProgress = true;
358  this->showLoading();
359 
360  // shared files ts
362  }
363 
364  void CDbLoadOverviewComponent::dataLoaded(CEntityFlags::Entity entities, CEntityFlags::ReadState state, int number,
365  const QUrl &url)
366  {
367  Q_UNUSED(number)
368  Q_UNUSED(url)
369 
370  if (!CEntityFlags::isFinishedReadState(state)) return;
371  if (!entities.testFlag(CEntityFlags::SharedInfoObjectEntity) &&
372  !entities.testFlag(CEntityFlags::DbInfoObjectEntity) && !CEntityFlags::anySwiftDbEntity(entities))
373  {
374  return;
375  }
376  m_loadInProgress = false;
377  m_dsTriggerGuiUpdate.inputSignal();
378  }
379 
380  void CDbLoadOverviewComponent::loadInfoObjects()
381  {
382  if (m_loadInProgress) { return; }
383  if (!sGui || !sGui->hasWebDataServices()) { return; }
384  if (sGui->isShuttingDown()) { return; }
385  bool direct = false;
386 
389  {
390  direct = true;
391  }
393 
396  {
397  direct = true;
398  }
400 
401  if (direct) { m_dsTriggerGuiUpdate.inputSignal(); }
402  }
403 
404  void CDbLoadOverviewComponent::adjustTextWidth()
405  {
406  const QSize s = this->size();
407  const QSizeF sizeFont = CGuiUtility::fontMetricsLazyDog43Chars();
408  const int thresholdW = qRound(sizeFont.width() * 2.0);
409  if (s.width() > thresholdW)
410  {
411  ui->lbl_DbCount->setText("DB count");
412  ui->lbl_CacheCount->setText("Cache count");
413  ui->lbl_SharedCount->setText("Shared count");
414  }
415  else
416  {
417  ui->lbl_DbCount->setText("DB#");
418  ui->lbl_CacheCount->setText("C#");
419  ui->lbl_SharedCount->setText("S#");
420  }
421  }
422 } // namespace swift::gui::components
data::CGlobalSetup getGlobalSetup() const
Global setup.
bool hasWebDataServices() const
Web data services available?
bool isShuttingDown() const
Is application shutting down?
CWebDataServices * getWebDataServices() const
Get the web data services.
int getSharedInfoObjectCount(swift::misc::network::CEntityFlags::Entity entity) const
Count for entity from shared entity objects.
swift::core::db::CInfoDataReader * getDbInfoDataReader() const
DB info data reader.
QDateTime getLatestDbEntityTimestamp(swift::misc::network::CEntityFlags::Entity entity) const
Corresponding DB timestamp if applicable.
swift::misc::network::CEntityFlags::Entity triggerLoadingDirectlyFromSharedFiles(swift::misc::network::CEntityFlags::Entity whatToRead, bool checkCacheTsUpfront)
Trigger reload from shared files, loads the data and bypasses caches.
QDateTime getCacheTimestamp(swift::misc::network::CEntityFlags::Entity entity) const
Corresponding cache timestamp if applicable.
QDateTime getLatestSharedInfoObjectTimestamp(swift::misc::network::CEntityFlags::Entity entity) const
Shared info object timestamp.
swift::misc::CStatusMessageList initDbCachesFromLocalResourceFiles(bool inBackground)
Init caches from local DB files.
swift::core::db::CInfoDataReader * getSharedInfoDataReader() const
Shared info data reader.
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 triggerReadOfSharedInfoObjects()
Trigger read of shared info objects.
int getCacheCount(swift::misc::network::CEntityFlags::Entity entity) const
Cache count for entity.
int getDbInfoObjectCount(swift::misc::network::CEntityFlags::Entity entity) const
Count for entity from DB entity objects.
void triggerReadOfDbInfoObjects()
Trigger read of DB info objects.
void admitDbCaches(swift::misc::network::CEntityFlags::Entity entities)
Admit all DB caches specified.
const swift::misc::network::CUrl & getSwiftSharedUrl() const
Shared URL.
Definition: globalsetup.cpp:41
swift::misc::network::CUrl getDbHomePageUrl() const
Home page url.
Definition: globalsetup.cpp:42
int getInfoObjectCount() const
Get info list size (either shared or from DB)
static QSizeF fontMetricsLazyDog43Chars(bool withRatio=false)
43 characters width/height "the quick brown ..."
Definition: guiutility.cpp:755
Enable widget class for load indicator.
void centerLoadIndicator()
Center load indicator.
bool m_loadInProgress
flag indicating loading
void showLoading(std::chrono::milliseconds timeout=std::chrono::milliseconds(0), bool processEvents=true)
Show load indicator.
void hideLoading()
Hide load indicator.
bool isShowingLoadIndicator() const
Showing load indicator?
void showVisibleLoadAllButtons(bool shared, bool db, bool disk)
Show load all buttons.
void showVisibleSharedRefreshButtons(bool visible)
Visible shared refresh buttons.
void loadAllFromResourceFiles()
Load all from disk (as of installation)
void showVisibleDbRefreshButtons(bool visible)
Visible DB refresh buttons.
void inputSignal()
Received input signal, or manually trigger.
QString toQString(bool i18n=false) const
Cast as QString.
Definition: mixinstring.h:76
Value object encapsulating information of a location, kind of simplified CValueObject compliant versi...
Definition: url.h:27
QString getFullUrl(bool withQuery=true) const
Qualified name.
Definition: url.cpp:84
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.
Definition: actionbind.cpp:7
High level reusable GUI components.
Definition: aboutdialog.cpp:13
GUI related classes.
Free functions in swift::misc.
QString toHtmTable(const QStringList &values, int columns)
Values as HTML table.
Definition: htmlutils.cpp:11
auto singleShot(int msec, QObject *target, F &&task)
Starts a single-shot timer which will call a task in the thread of the given object when it times out...
Definition: threadutils.h:30