132 lines
4.0 KiB
C++
132 lines
4.0 KiB
C++
#ifndef RM_SETTINGS_WINDOW_BASE_H
|
|
#define RM_SETTINGS_WINDOW_BASE_H
|
|
|
|
#if (USE_DEVICE_SETTINGS && !USE_DEVICE_SETTINGS_JSON)
|
|
|
|
#include "../ui/rm_popup.h"
|
|
#include <QGroupBox>
|
|
#include <QRadioButton>
|
|
|
|
class RMRadioButtons;
|
|
class RMGroupComboBox;
|
|
class RMGroupRadioButtons;
|
|
class RMComboBox;
|
|
class QJsonObject;
|
|
class QScrollArea;
|
|
|
|
#if (DETECT_SETTING_USB_EJECT)
|
|
class rm_usb;
|
|
#endif
|
|
|
|
extern const QStringList gOnOff;
|
|
|
|
class RMSettingsWindowBase : public RMPopup
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
//static bool loaded;
|
|
static QString lastSettingDisk;
|
|
explicit RMSettingsWindowBase(QWidget *parent = 0);
|
|
~RMSettingsWindowBase();
|
|
virtual void afterSave() = NULL;
|
|
virtual bool validateData() = NULL;
|
|
|
|
protected:
|
|
|
|
#if (DETECT_SETTING_USB_EJECT)
|
|
rm_usb* _usb;
|
|
#endif // @DETECT_SETTING_USB_EJECT
|
|
|
|
#if (SETTINGS_WINDOW_SCROLL)
|
|
QScrollArea* _contentScrollArea;
|
|
QWidget* _contentScrollWidget;
|
|
QHBoxLayout* _contentScrollLayout;
|
|
#endif // SCROLL
|
|
|
|
QHBoxLayout* layout;
|
|
|
|
// ON,OFF 기능만 하는 라디오 버튼 생성
|
|
#if (USE_JSON_SETTINGS)
|
|
RMGroupRadioButtons* _MGR_ONOFF(QWidget* parent,
|
|
QJsonObject* object,
|
|
QLayout* layout);
|
|
|
|
RMGroupRadioButtons* _MGR(QWidget *parent,
|
|
QLayout* layout,
|
|
QJsonObject* object);
|
|
|
|
RMGroupComboBox* _MGC(QWidget *parent,
|
|
QLayout* layout,
|
|
QJsonObject* object);
|
|
|
|
#else // USE_JSON_SETTINGS
|
|
RMGroupRadioButtons* _MGR_ONOFF(QWidget* parent,
|
|
QString title,
|
|
QLayout* layout,
|
|
int type
|
|
);
|
|
RMRadioButtons* _MR_ONOFF(QWidget* parent,
|
|
QString title,
|
|
QLayout* layout,
|
|
int type,
|
|
QLabel** titleLabel = NULL);
|
|
RMGroupRadioButtons* _MGR(QWidget *parent,
|
|
QString title,
|
|
QLayout* layout,
|
|
QStringList items,
|
|
int type,
|
|
QList<int> indexMap = QList<int>());
|
|
|
|
RMGroupRadioButtons* _MGRR(QWidget *parent,
|
|
QString title,
|
|
QLayout* layout,
|
|
QStringList items,
|
|
int type,
|
|
QList<int> indexMap = QList<int>());
|
|
|
|
RMRadioButtons* _MR(QWidget *parent,
|
|
QString title,
|
|
QLayout* layout,
|
|
QStringList items,
|
|
int type,
|
|
QList<int> indexMap = QList<int>(),
|
|
QLabel** titleLabel = NULL);
|
|
void _MGT(QWidget *parent,QString title,QLayout* layout, QString text,QLabel** titleLabel = NULL);
|
|
RMComboBox* _MC(QWidget *parent,
|
|
QString title,
|
|
QLayout* layout,
|
|
QStringList items,
|
|
int type,
|
|
QList<int> indexMap = QList<int>(),
|
|
QLabel** titleLabel = NULL);
|
|
RMGroupComboBox* _MGC(QWidget *parent,
|
|
QString title,
|
|
QLayout* layout,
|
|
QStringList items,
|
|
int type,
|
|
QList<int> indexMap = QList<int>());
|
|
|
|
#endif // USE_JSON_SETTINGS
|
|
|
|
|
|
|
|
|
|
protected slots:
|
|
void onDefault();
|
|
void onSave();
|
|
void onCancel();
|
|
void onSaveAnAccept();
|
|
|
|
// DETECT_USB_CHANGE 사용시에는 직접 처리하여 필요없음???
|
|
#if (DETECT_SETTING_USB_EJECT && !DETECT_USB_CHANGE)
|
|
void onUSBChange(bool inserted, QString& drive);
|
|
#elif (DETECT_USB_CHANGE)
|
|
void onUsbRemoved();
|
|
#endif
|
|
|
|
};
|
|
#endif // #if (USE_DEVICE_SETTINGS)
|
|
#endif // RM_SETTINGS_WINDOW_BASE_H
|