AddressEditDialog.hpp
1 #pragma once
2 #include <Device/Address/AddressSettings.hpp>
3 #include <Device/Protocol/ProtocolSettingsWidget.hpp>
4 
5 #include <score/widgets/WidgetWrapper.hpp>
6 
7 #include <score_plugin_deviceexplorer_export.h>
8 
9 #include <verdigris>
10 class QComboBox;
11 class QFormLayout;
12 class QLineEdit;
13 class QWidget;
14 
15 namespace Explorer
16 {
17 
18 class AddressSettingsWidget;
19 class SCORE_PLUGIN_DEVICEEXPLORER_EXPORT AddressEditDialog final
20  : public Device::AddressDialog
21 {
22  W_OBJECT(AddressEditDialog)
23 
24 public:
25  // Creation of an address
26  explicit AddressEditDialog(QWidget* parent);
27 
28  // Edition of an address
29  explicit AddressEditDialog(const Device::AddressSettings& addr, QWidget* parent);
31 
32  Device::AddressSettings getSettings() const override;
33  static Device::AddressSettings makeDefaultSettings();
34 
35  void setCanRename(bool);
36  void setCanEditProperties(bool);
37 
38 protected:
39  void setNodeSettings();
40  void setValueSettings();
41  void updateType(ossia::val_type valueType);
42 
43  Device::AddressSettings m_originalSettings;
44  QLineEdit* m_nameEdit{};
45  QComboBox* m_valueTypeCBox{};
46  WidgetWrapper<AddressSettingsWidget>* m_addressWidget{};
47  QFormLayout* m_layout{};
48  bool m_canEdit{true};
49 };
50 }
Definition: ProtocolSettingsWidget.hpp:41
Definition: AddressEditDialog.hpp:21
The WidgetWrapper class.
Definition: WidgetWrapper.hpp:16
Definition: AddressSettings.hpp:49