DefaultProtocolFactory.hpp
1 #pragma once
2 #include <Device/Protocol/DeviceInterface.hpp>
3 #include <Device/Protocol/ProtocolFactoryInterface.hpp>
4 
5 #include <Explorer/Explorer/Widgets/AddressEditDialog.hpp>
6 
7 namespace Protocols
8 {
10 {
11 public:
12  using Device::ProtocolFactory::ProtocolFactory;
13 
14  Device::AddressDialog* makeEditAddressDialog(
15  const Device::AddressSettings& set, const Device::DeviceInterface& dev,
16  const score::DocumentContext& ctx, QWidget* parent) override
17  {
18  auto ptr = new Explorer::AddressEditDialog{set, parent};
19 
20  ptr->setCanRename(dev.capabilities().canRenameNode);
21  ptr->setCanEditProperties(dev.capabilities().canSetProperties);
22 
23  return ptr;
24  }
25  Device::AddressDialog* makeAddAddressDialog(
26  const Device::DeviceInterface& dev, const score::DocumentContext& ctx,
27  QWidget* parent) override
28  {
29  auto ptr = new Explorer::AddressEditDialog{parent};
30 
31  ptr->setCanRename(dev.capabilities().canRenameNode);
32  ptr->setCanEditProperties(dev.capabilities().canSetProperties);
33 
34  return ptr;
35  }
36 };
37 }
Definition: ProtocolSettingsWidget.hpp:41
Definition: DeviceInterface.hpp:66
Definition: ProtocolFactoryInterface.hpp:47
Definition: AddressEditDialog.hpp:21
Definition: DefaultProtocolFactory.hpp:10
Definition: AddressSettings.hpp:49
Definition: DocumentContext.hpp:18