Removed CSVSettings::SamplePage class files
parent
101c147217
commit
f4a2cf64c2
@ -1,159 +0,0 @@
|
|||||||
#include "samplepage.hpp"
|
|
||||||
|
|
||||||
#include <QList>
|
|
||||||
#include <QListView>
|
|
||||||
#include <QGroupBox>
|
|
||||||
#include <QRadioButton>
|
|
||||||
#include <QDockWidget>
|
|
||||||
#include <QVBoxLayout>
|
|
||||||
#include <QGridLayout>
|
|
||||||
#include <QStyle>
|
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
#include <QPlastiqueStyle>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "../../model/settings/usersettings.hpp"
|
|
||||||
#include "groupblock.hpp"
|
|
||||||
#include "toggleblock.hpp"
|
|
||||||
|
|
||||||
CSVSettings::SamplePage::SamplePage(QWidget *parent):
|
|
||||||
AbstractPage("Editor", parent)
|
|
||||||
{
|
|
||||||
// Hacks to get the stylesheet look properly
|
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
QPlastiqueStyle *style = new QPlastiqueStyle;
|
|
||||||
//profilesComboBox->setStyle(style);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
setupUi();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CSVSettings::SamplePage::setupUi()
|
|
||||||
{
|
|
||||||
GroupBlockDef *undoStack = new GroupBlockDef(QString("Undo Stack Size"));
|
|
||||||
GroupBlockDef *topLevelWindowCount = new GroupBlockDef(QString("Maximum Top-Level Window Count"));
|
|
||||||
GroupBlockDef *reuseSubwindow = new GroupBlockDef(QString("Reuse Subwindows"));
|
|
||||||
GroupBlockDef *customWindowSize = new GroupBlockDef(QString ("Custom Window Size"));
|
|
||||||
GroupBlockDef *definedWindowSize = new GroupBlockDef(QString ("Pre-Defined Window Size"));
|
|
||||||
GroupBlockDef *windowSizeToggle = new GroupBlockDef(QString ("Window Size"));
|
|
||||||
CustomBlockDef *windowSize = new CustomBlockDef(QString ("Window Size"));
|
|
||||||
|
|
||||||
////////////////////////////
|
|
||||||
//undo stack size property
|
|
||||||
///////////////////////////
|
|
||||||
|
|
||||||
SettingsItemDef *undoStackItem = new SettingsItemDef (undoStack->title, "32");
|
|
||||||
undoStack->settingItems << undoStackItem;
|
|
||||||
undoStackItem->minMax.left = "0";
|
|
||||||
undoStackItem->minMax.right = "64";
|
|
||||||
|
|
||||||
WidgetDef stackWidget (Widget_SpinBox);
|
|
||||||
stackWidget.minMax = &(undoStackItem->minMax);
|
|
||||||
stackWidget.widgetWidth = 50;
|
|
||||||
|
|
||||||
undoStackItem->widget = stackWidget;
|
|
||||||
|
|
||||||
//////////////////////////////////////
|
|
||||||
//number of top level windows property
|
|
||||||
/////////////////////////////////////
|
|
||||||
|
|
||||||
SettingsItemDef *topLevelItem = new SettingsItemDef (topLevelWindowCount->title, "100");
|
|
||||||
topLevelWindowCount->settingItems << topLevelItem;
|
|
||||||
topLevelItem->minMax.left = "1";
|
|
||||||
topLevelItem->minMax.right = "256";
|
|
||||||
|
|
||||||
WidgetDef topLvlWinWidget (Widget_SpinBox);
|
|
||||||
topLvlWinWidget.minMax = &(topLevelItem->minMax);
|
|
||||||
topLvlWinWidget.widgetWidth = 50;
|
|
||||||
|
|
||||||
topLevelItem->widget = topLvlWinWidget;
|
|
||||||
|
|
||||||
///////////////////////////
|
|
||||||
//reuse subwindows property
|
|
||||||
////////////////////////////
|
|
||||||
|
|
||||||
SettingsItemDef *reuseSubItem = new SettingsItemDef (reuseSubwindow->title, "Reuse Subwindows");
|
|
||||||
*(reuseSubItem->valueList) << "None" << "Top-Level" << "Document-Level";
|
|
||||||
|
|
||||||
WidgetDef reuseSubWidget (Widget_RadioButton);
|
|
||||||
reuseSubWidget.valueList = (reuseSubItem->valueList);
|
|
||||||
reuseSubWidget.widgetAlignment = Align_Left;
|
|
||||||
|
|
||||||
reuseSubwindow->settingItems << reuseSubItem;
|
|
||||||
reuseSubItem->widget = reuseSubWidget;
|
|
||||||
|
|
||||||
///////////////////////////////
|
|
||||||
//custom window size properties
|
|
||||||
///////////////////////////////
|
|
||||||
|
|
||||||
//custom width
|
|
||||||
SettingsItemDef *widthItem = new SettingsItemDef ("Window Width", "640");
|
|
||||||
widthItem->widget = WidgetDef (Widget_LineEdit);
|
|
||||||
widthItem->widget.widgetWidth = 45;
|
|
||||||
|
|
||||||
//custom height
|
|
||||||
SettingsItemDef *heightItem = new SettingsItemDef ("Window Height", "480");
|
|
||||||
heightItem->widget = WidgetDef (Widget_LineEdit);
|
|
||||||
heightItem->widget.widgetWidth = 45;
|
|
||||||
heightItem->widget.caption = "x";
|
|
||||||
|
|
||||||
customWindowSize->settingItems << widthItem << heightItem;
|
|
||||||
customWindowSize->widgetOrientation = Orient_Horizontal;
|
|
||||||
customWindowSize->isVisible = false;
|
|
||||||
|
|
||||||
|
|
||||||
//pre-defined
|
|
||||||
SettingsItemDef *widthByHeightItem = new SettingsItemDef ("Window Size", "640x480");
|
|
||||||
WidgetDef widthByHeightWidget = WidgetDef (Widget_ComboBox);
|
|
||||||
widthByHeightWidget.widgetWidth = 90;
|
|
||||||
*(widthByHeightItem->valueList) << "640x480" << "800x600" << "1024x768";
|
|
||||||
|
|
||||||
QStringList *widthProxy = new QStringList;
|
|
||||||
QStringList *heightProxy = new QStringList;
|
|
||||||
|
|
||||||
(*widthProxy) << "Window Width" << "640" << "800" << "1024";
|
|
||||||
(*heightProxy) << "Window Height" << "480" << "600" << "768";
|
|
||||||
|
|
||||||
*(widthByHeightItem->proxyList) << widthProxy << heightProxy;
|
|
||||||
|
|
||||||
widthByHeightItem->widget = widthByHeightWidget;
|
|
||||||
|
|
||||||
definedWindowSize->settingItems << widthByHeightItem;
|
|
||||||
definedWindowSize->isProxy = true;
|
|
||||||
definedWindowSize->isVisible = false;
|
|
||||||
|
|
||||||
// window size toggle
|
|
||||||
windowSizeToggle->captions << "Pre-Defined" << "Custom";
|
|
||||||
windowSizeToggle->widgetOrientation = Orient_Vertical;
|
|
||||||
windowSizeToggle->isVisible = false;
|
|
||||||
|
|
||||||
//define a widget for each group in the toggle
|
|
||||||
for (int i = 0; i < 2; i++)
|
|
||||||
windowSizeToggle->widgets << new WidgetDef (Widget_RadioButton);
|
|
||||||
|
|
||||||
windowSizeToggle->widgets.at(0)->isDefault = false;
|
|
||||||
|
|
||||||
windowSize->blockDefList << windowSizeToggle << definedWindowSize << customWindowSize;
|
|
||||||
windowSize->defaultValue = "Custom";
|
|
||||||
|
|
||||||
mAbstractBlocks << buildBlock<GroupBlock> (topLevelWindowCount)
|
|
||||||
<< buildBlock<GroupBlock> (reuseSubwindow)
|
|
||||||
<< buildBlock<ToggleBlock> (windowSize)
|
|
||||||
<< buildBlock<GroupBlock> (undoStack);
|
|
||||||
|
|
||||||
foreach (AbstractBlock *block, mAbstractBlocks)
|
|
||||||
{
|
|
||||||
connect (block, SIGNAL (signalUpdateSetting (const QString &, const QString &)),
|
|
||||||
this, SIGNAL (signalUpdateEditorSetting (const QString &, const QString &)) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CSVSettings::SamplePage::initializeWidgets (const CSMSettings::SettingMap &settings)
|
|
||||||
{
|
|
||||||
//iterate each item in each blocks in this section
|
|
||||||
//validate the corresponding setting against the defined valuelist if any.
|
|
||||||
for (AbstractBlockList::Iterator it_block = mAbstractBlocks.begin();
|
|
||||||
it_block != mAbstractBlocks.end(); ++it_block)
|
|
||||||
(*it_block)->updateSettings (settings);
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
#ifndef SAMPLEPAGE_H
|
|
||||||
#define SAMPLEPAGE_H
|
|
||||||
|
|
||||||
#include "abstractpage.hpp"
|
|
||||||
|
|
||||||
class QGroupBox;
|
|
||||||
|
|
||||||
namespace CSVSettings {
|
|
||||||
|
|
||||||
class UserSettings;
|
|
||||||
class AbstractBlock;
|
|
||||||
|
|
||||||
class SamplePage : public AbstractPage
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
explicit SamplePage(QWidget *parent = 0);
|
|
||||||
|
|
||||||
void setupUi();
|
|
||||||
void initializeWidgets (const CSMSettings::SettingMap &settings);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void signalUpdateEditorSetting (const QString &settingName, const QString &settingValue);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
#endif //SAMPLEPAGE_H
|
|
Loading…
Reference in New Issue