swift
initialdataloadcomponent.cpp
1 // SPDX-FileCopyrightText: Copyright (C) 2017 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #include "ui_initialdataloadcomponent.h"
7 
9 {
11  : QFrame(parent), ui(new Ui::CInitialDataLoadComponent)
12  {
13  ui->setupUi(this);
14  ui->comp_DataUpdates->showVisibleLoadAllButtons(true, false, true);
15  }
16 
18 
19  void CInitialDataLoadComponent::loadAllFromShared() { ui->comp_DataUpdates->loadAllFromShared(); }
20 
21  void CInitialDataLoadComponent::loadAllFromDb() { ui->comp_DataUpdates->loadAllFromDb(); }
22 
23  bool CInitialDataLoadComponent::isLoadInProgress() const { return ui->comp_DataUpdates->isLoadInProgress(); }
24 
26  {
27  Q_ASSERT_X(m_config, Q_FUNC_INFO, "Missing config");
28  QTimer::singleShot(500, m_config, [=] { m_config->loadAllFromShared(); });
29  }
30 
32  {
33  Q_ASSERT_X(m_config, Q_FUNC_INFO, "Missing config");
34  return !m_config->isLoadInProgress();
35  }
36 } // namespace swift::gui::components
CInitialDataLoadComponent(QWidget *parent=nullptr)
Constructor.
High level reusable GUI components.
Definition: aboutdialog.cpp:13
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