You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ovdCBoxConfigurationDialog.h 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #pragma once
  2. #include "ovd_base.h"
  3. #include <string>
  4. #include "dynamic_settings/ovdCAbstractSettingView.h"
  5. #include "dynamic_settings/ovdCSettingViewFactory.h"
  6. namespace OpenViBE {
  7. namespace Designer {
  8. class CBoxConfigurationDialog final : public IObserver
  9. {
  10. public:
  11. CBoxConfigurationDialog(const Kernel::IKernelContext& ctx, Kernel::IBox& box, const char* guiFilename,
  12. const char* guiSettingsFilename, const bool isScenarioRunning = false);
  13. ~CBoxConfigurationDialog() override;
  14. bool run();
  15. void update(CObservable& o, void* data) override;
  16. void saveConfig() const;
  17. void loadConfig() const;
  18. void onOverrideBrowse() const;
  19. void storeState();
  20. void restoreState();
  21. CIdentifier getBoxID() const { return m_box.getIdentifier(); }
  22. GtkWidget* getWidget() const { return m_settingDialog; }
  23. protected:
  24. void generateSettingsTable();
  25. bool addSettingsToView(const size_t settingIdx, const size_t tableIdx);
  26. void updateSize() const;
  27. void settingChange(const size_t index);
  28. void addSetting(const size_t index);
  29. void removeSetting(const size_t index, bool shift = true);
  30. int getTableIndex(const size_t index);
  31. const Kernel::IKernelContext& m_kernelCtx;
  32. Kernel::IBox& m_box;
  33. CString m_guiFilename;
  34. CString m_guiSettingsFilename;
  35. Setting::CSettingViewFactory m_settingFactory;
  36. std::vector<Setting::CAbstractSettingView*> m_settingViews;
  37. GtkTable* m_settingsTable = nullptr;
  38. GtkViewport* m_viewPort = nullptr;
  39. GtkScrolledWindow* m_scrolledWindow = nullptr;
  40. GtkEntry* m_overrideEntry = nullptr;
  41. GtkWidget* m_overrideEntryContainer = nullptr;
  42. GtkWidget* m_settingDialog = nullptr;
  43. GtkCheckButton* m_fileOverrideCheck = nullptr;
  44. bool m_isScenarioRunning = false;
  45. std::vector<CString> m_settingsMemory;
  46. };
  47. } // namespace Designer
  48. } // namespace OpenViBE