swift
distributorpreferencescomponent.h
Go to the documentation of this file.
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 #ifndef SWIFT_GUI_COMPONENTS_DISTRIBUTORPREFERENCESCOMPONENT_H
7 #define SWIFT_GUI_COMPONENTS_DISTRIBUTORPREFERENCESCOMPONENT_H
8 
9 #include <QObject>
10 #include <QScopedPointer>
11 
13 #include "misc/settingscache.h"
16 
17 namespace Ui
18 {
19  class CDistributorPreferencesComponent;
20 }
21 namespace swift::gui
22 {
23  class COverlayMessagesFrame;
24 
25  namespace components
26  {
31  {
32  Q_OBJECT
33 
34  public:
36  explicit CDistributorPreferencesComponent(QWidget *parent = nullptr);
37 
40 
41  private:
43  void onPreferencesChanged();
44 
46  void loadAllDistributors();
47 
49  void loadDistributorsForSimulator();
50 
52  void loadDistributorsFromSet();
53 
55  void save();
56 
58  void onSimulatorChanged(const swift::misc::simulation::CSimulatorInfo &simulator);
59 
60  // Init
61  void triggerDeferredSimulatorChange();
62 
63  private:
64  QScopedPointer<Ui::CDistributorPreferencesComponent> ui;
66  m_distributorPreferences { this, &CDistributorPreferencesComponent::onPreferencesChanged };
67 
69  void updateContainerMaybeAsync(const swift::misc::simulation::CDistributorList &models,
70  bool sortByOrder = true);
71  };
72  } // namespace components
73 } // namespace swift::gui
74 
75 #endif // SWIFT_GUI_COMPONENTS_DISTRIBUTORPREFERENCESCOMPONENT_H
Using this class provides a QFrame with the overlay functionality already integrated.
Set and order distributors (to be used for model set)
Value object encapsulating a list of distributors.
Simple hardcoded info about the corresponding simulator.
Definition: simulatorinfo.h:41
GUI related classes.