swift
fsdsetupform.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2013 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_EDITORS_FSDSETUPCOMPONENT_H
7 #define SWIFT_GUI_EDITORS_FSDSETUPCOMPONENT_H
8 
9 #include <QFrame>
10 #include <QScopedPointer>
11 
12 #include "gui/editors/form.h"
13 #include "misc/network/fsdsetup.h"
14 
15 namespace Ui
16 {
17  class CFsdSetupForm;
18 }
19 namespace swift::gui::editors
20 {
24  class CFsdSetupForm : public CForm
25  {
26  Q_OBJECT
27 
28  public:
30  explicit CFsdSetupForm(QWidget *parent = nullptr);
31 
33  virtual ~CFsdSetupForm() override;
34 
37 
40 
42  void setValue(const swift::misc::network::CFsdSetup &setup);
43 
45  void setAlwaysAllowOverride(bool allow);
46 
48  bool isFsdSetupEnabled() const;
49 
51  void setFsdSetupEnabled(bool enabled);
52 
54  void showEnableInfo(bool visible);
55 
57  void resetToDefaultValues();
58 
61  virtual void setReadOnly(bool readonly) override;
62  virtual swift::misc::CStatusMessageList validate(bool nested = false) const override;
64 
65  private:
67  void enabledToggled(bool enabled);
68 
70  void visibleEnableInfo(bool visible);
71 
72  QScopedPointer<Ui::CFsdSetupForm> ui;
73  bool m_visibleEnableInfo = true;
74  bool m_alwaysAllowOverride = false;
75  };
76 } // namespace swift::gui::editors
77 
78 #endif // SWIFT_GUI_EDITORS_FSDSETUPCOMPONENT_H
Form base class.
Definition: form.h:27
virtual swift::misc::CStatusMessageList validate(bool nested=false) const
Validate, empty list means OK.
void resetToDefaultValues()
Set default values.
void setAlwaysAllowOverride(bool allow)
Allow override even in read only mode.
void showEnableInfo(bool visible)
Show the enable info.
bool isFsdSetupEnabled() const
Enabled?
virtual ~CFsdSetupForm()
Constructor.
void setFsdSetupEnabled(bool enabled)
Set enabled / disabled.
virtual void setReadOnly(bool readonly)
Set editable.
swift::misc::network::CFsdSetup getValue() const
FSD setup from GUI.
CFsdSetupForm(QWidget *parent=nullptr)
Constructor.
const swift::misc::network::CFsdSetup & getDisabledValue() const
FSD setup when disabled.
void setValue(const swift::misc::network::CFsdSetup &setup)
Set to GUI.
Status messages, e.g. from Core -> GUI.
Value object for a FSD setup.
Definition: fsdsetup.h:24