File indexing completed on 2024-04-28 05:46:31
0001 /* 0002 SPDX-FileCopyrightText: 2010 Volker Lanz <vl@fidra.de> 0003 SPDX-FileCopyrightText: 2014-2017 Andrius Štikonas <andrius@stikonas.eu> 0004 0005 SPDX-License-Identifier: GPL-3.0-or-later 0006 */ 0007 0008 #if !defined(DEVICEPROPSDIALOG_H) 0009 0010 #define DEVICEPROPSDIALOG_H 0011 0012 #include <QDialog> 0013 0014 class Device; 0015 class DevicePropsWidget; 0016 0017 class QDialogButtonBox; 0018 class QPushButton; 0019 class QVBoxLayout; 0020 class QWidget; 0021 class QString; 0022 0023 /** Show Device properties. 0024 0025 Dialog that shows a Device's properties. 0026 0027 @author Volker Lanz <vl@fidra.de> 0028 */ 0029 class DevicePropsDialog : public QDialog 0030 { 0031 Q_DISABLE_COPY(DevicePropsDialog) 0032 0033 public: 0034 DevicePropsDialog(QWidget* parent, Device& d); 0035 ~DevicePropsDialog(); 0036 0037 public: 0038 bool cylinderBasedAlignment() const; 0039 bool sectorBasedAlignment() const; 0040 0041 protected: 0042 void setupDialog(); 0043 void setupConnections(); 0044 0045 Device& device() { 0046 return m_Device; 0047 } 0048 const Device& device() const { 0049 return m_Device; 0050 } 0051 0052 DevicePropsWidget& dialogWidget() { 0053 Q_ASSERT(m_DialogWidget); 0054 return *m_DialogWidget; 0055 } 0056 const DevicePropsWidget& dialogWidget() const { 0057 Q_ASSERT(m_DialogWidget); 0058 return *m_DialogWidget; 0059 } 0060 0061 void setDirty(bool); 0062 void onButtonSmartMore(bool); 0063 0064 private: 0065 Device& m_Device; 0066 DevicePropsWidget* m_DialogWidget; 0067 0068 QDialogButtonBox* dialogButtonBox; 0069 QPushButton* okButton; 0070 QPushButton* cancelButton; 0071 QVBoxLayout *mainLayout; 0072 }; 0073 0074 #endif