mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-09 12:42:11 +00:00
101c147217
preference 1. Included updated status icons, added base.png 2. Added doxygen comments CSV / CSM Settings classes 3. Implemented Glorf's code for window size preference 4. Minor changes code that searches maps in CSV / CSM Settings classes 5. Removed CSVSettings::SamplePage class 6. Other minor code maintenance / improvements
71 lines
1.7 KiB
C++
71 lines
1.7 KiB
C++
#ifndef ABSTRACTPAGE_HPP
|
|
#define ABSTRACTPAGE_HPP
|
|
|
|
#include <QWidget>
|
|
#include <QList>
|
|
#include <QLayout>
|
|
|
|
#include "abstractblock.hpp"
|
|
|
|
class SettingMap;
|
|
class SettingList;
|
|
|
|
namespace CSVSettings {
|
|
|
|
typedef QList<AbstractBlock *> AbstractBlockList;
|
|
|
|
/// Abstract base class for all setting pages in the dialog
|
|
|
|
/// \todo Scripted implementation of settings should eliminate the need
|
|
/// \todo derive page classes.
|
|
/// \todo AbstractPage should be replaced with a general page construction class.
|
|
class AbstractPage: public QWidget
|
|
{
|
|
|
|
protected:
|
|
|
|
AbstractBlockList mAbstractBlocks;
|
|
|
|
public:
|
|
|
|
AbstractPage(QWidget *parent = 0);
|
|
AbstractPage (const QString &pageName, QWidget* parent = 0);
|
|
|
|
~AbstractPage();
|
|
|
|
virtual void setupUi() = 0;
|
|
|
|
/// triggers widgiet initialization at the page level. All widgets updated to
|
|
/// current setting values
|
|
virtual void initializeWidgets (const CSMSettings::SettingMap &settings) = 0;
|
|
|
|
/// retrieve the list of settings local to the page.
|
|
CSMSettings::SettingList *getSettings();
|
|
|
|
void setObjectName();
|
|
|
|
protected:
|
|
|
|
/// Create a block for the page.
|
|
/// Block is constructed using passed definition struct
|
|
/// Page level-layout is created and assigned
|
|
template <typename S, typename T>
|
|
AbstractBlock *buildBlock (T *def)
|
|
{
|
|
S *block = new S (this);
|
|
int ret = block->build (def);
|
|
|
|
if (ret < 0)
|
|
return 0;
|
|
|
|
QGroupBox *box = block->getGroupBox();
|
|
QWidget::layout()->addWidget (box);
|
|
|
|
return block;
|
|
}
|
|
|
|
};
|
|
}
|
|
|
|
#endif // ABSTRACTPAGE_HPP
|