Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Updated for 1.0.3

Jeremy Bullock29a430ce118a
diff --cc toonz/sources/tnztools/tooloptions.cpp
index 34eede0b8,c9463bb3d..b7a6dea85
--- a/toonz/sources/tnztools/tooloptions.cpp
+++ b/toonz/sources/tnztools/tooloptions.cpp
@@@ -1758,170 -1814,147 +1814,155 @@@ void EraserToolOptionsBox::onColorModeC
// RulerToolOptionsBox
//
//=============================================================================
- class ToolOptionsBarSeparator : public QWidget
- {
+ class ToolOptionsBarSeparator : public QWidget {
public:
- ToolOptionsBarSeparator(QWidget *parent)
- : QWidget(parent)
- {
- setFixedSize(2, 26);
- }
-
- void paintEvent(QPaintEvent *)
- {
- QPainter p(this);
- p.setPen(QColor(64, 64, 64));
- p.drawLine(0, 0, 0, 25);
- p.setPen(Qt::white);
- p.drawLine(1, 0, 1, 25);
- }
+ ToolOptionsBarSeparator(QWidget *parent) : QWidget(parent) {
+ setFixedSize(2, 26);
+ }
+
+ void paintEvent(QPaintEvent *) {
+ QPainter p(this);
+ p.setPen(QColor(64, 64, 64));
+ p.drawLine(0, 0, 0, 25);
+ p.setPen(Qt::white);
+ p.drawLine(1, 0, 1, 25);
+ }
};
- RulerToolOptionsBox::RulerToolOptionsBox(QWidget *parent,
- TTool *tool)
- : ToolOptionsBox(parent), m_tool(tool)
- {
- setFrameStyle(QFrame::StyledPanel);
- setFixedHeight(26);
-
- m_Xfld = new MeasuredValueField(this);
- m_Yfld = new MeasuredValueField(this);
- m_Wfld = new MeasuredValueField(this);
- m_Hfld = new MeasuredValueField(this);
- m_Afld = new MeasuredValueField(this);
- m_Lfld = new MeasuredValueField(this);
-
- m_XpixelFld = new QLabel(this);
- m_YpixelFld = new QLabel(this);
- m_WpixelFld = new QLabel(this);
- m_HpixelFld = new QLabel(this);
-
- m_Afld->setMeasure("angle");
-
- if (Preferences::instance()->getUnits() == "pixel")
- {
+ RulerToolOptionsBox::RulerToolOptionsBox(QWidget *parent, TTool *tool)
+ : ToolOptionsBox(parent), m_tool(tool) {
+ setFrameStyle(QFrame::StyledPanel);
+ setFixedHeight(26);
+
+ m_Xfld = new MeasuredValueField(this);
+ m_Yfld = new MeasuredValueField(this);
+ m_Wfld = new MeasuredValueField(this);
+ m_Hfld = new MeasuredValueField(this);
+ m_Afld = new MeasuredValueField(this);
+ m_Lfld = new MeasuredValueField(this);
+
+ m_XpixelFld = new QLabel(this);
+ m_YpixelFld = new QLabel(this);
+ m_WpixelFld = new QLabel(this);
+ m_HpixelFld = new QLabel(this);
+
+ m_Afld->setMeasure("angle");
++
++ if (Preferences::instance()->getUnits() == "pixel") {
+ m_Xfld->setMeasure("length.x");
+ m_Yfld->setMeasure("length.y");
+ m_Wfld->setMeasure("length.x");
+ m_Hfld->setMeasure("length.y");
+ m_Lfld->setMeasure("length.x");
+ }
- m_Xfld->setObjectName("RulerToolOptionValues");
- m_Yfld->setObjectName("RulerToolOptionValues");
- m_Wfld->setObjectName("RulerToolOptionValues");
- m_Hfld->setObjectName("RulerToolOptionValues");
- m_Afld->setObjectName("RulerToolOptionValues");
- m_Lfld->setObjectName("RulerToolOptionValues");
- setStyleSheet("#RulerToolOptionValues {border:0px; background: rgb(196,196,196);}");
-
- m_Xfld->setMaximumWidth(70);
- m_Yfld->setMaximumWidth(70);
- m_Wfld->setMaximumWidth(70);
- m_Hfld->setMaximumWidth(70);
- m_Afld->setMaximumWidth(70);
- m_Lfld->setMaximumWidth(70);
-
- m_Xfld->setReadOnly(true);
- m_Yfld->setReadOnly(true);
- m_Wfld->setReadOnly(true);
- m_Hfld->setReadOnly(true);
- m_Afld->setReadOnly(true);
- m_Lfld->setReadOnly(true);
-
- // layout
- QHBoxLayout *lay = new QHBoxLayout();
- lay->setMargin(0);
- lay->setSpacing(3);
- {
- lay->addWidget(new QLabel("X:", this), 0);
- lay->addWidget(m_Xfld, 0);
- lay->addWidget(m_XpixelFld, 0);
-
- lay->addSpacing(3);
-
- lay->addWidget(new QLabel("Y:", this), 0);
- lay->addWidget(m_Yfld, 0);
- lay->addWidget(m_YpixelFld, 0);
-
- lay->addSpacing(3);
- lay->addWidget(new ToolOptionsBarSeparator(this), 0);
- lay->addSpacing(3);
-
- lay->addWidget(new QLabel("W:", this), 0);
- lay->addWidget(m_Wfld, 0);
- lay->addWidget(m_WpixelFld, 0);
-
- lay->addSpacing(3);
-
- lay->addWidget(new QLabel("H:", this), 0);
- lay->addWidget(m_Hfld, 0);
- lay->addWidget(m_HpixelFld, 0);
-
- lay->addSpacing(3);
- lay->addWidget(new ToolOptionsBarSeparator(this), 0);
- lay->addSpacing(3);
-
- lay->addWidget(new QLabel("A:", this), 0);
- lay->addWidget(m_Afld, 0);
-
- lay->addSpacing(3);
-
- lay->addWidget(new QLabel("L:", this), 0);
- lay->addWidget(m_Lfld, 0);
- }
- m_layout->addLayout(lay, 0);
- m_layout->addStretch(1);
- }
-
- void RulerToolOptionsBox::updateValues(bool isRasterLevelEditing,
- double X,
- double Y,
- double W,
- double H,
- double A,
- double L,
- int Xpix,
- int Ypix,
- int Wpix,
- int Hpix)
- {
- m_Xfld->setValue(X);
- m_Yfld->setValue(Y);
- m_Wfld->setValue(W);
- m_Hfld->setValue(H);
- m_Afld->setValue(A);
- m_Lfld->setValue(L);
-
- m_XpixelFld->setVisible(isRasterLevelEditing);
- m_YpixelFld->setVisible(isRasterLevelEditing);
- m_WpixelFld->setVisible(isRasterLevelEditing);
- m_HpixelFld->setVisible(isRasterLevelEditing);
-
- if (isRasterLevelEditing) {
- m_XpixelFld->setText(QString("(%1)").arg(Xpix));
- m_YpixelFld->setText(QString("(%1)").arg(Ypix));
- m_WpixelFld->setText(QString("(%1)").arg(Wpix));
- m_HpixelFld->setText(QString("(%1)").arg(Hpix));
- }
- repaint();
- }
-
- void RulerToolOptionsBox::resetValues()
- {
- m_Xfld->setValue(0);
- m_Yfld->setValue(0);
- m_Wfld->setValue(0);
- m_Hfld->setValue(0);
- m_Afld->setValue(0);
- m_Lfld->setValue(0);
-
- m_XpixelFld->setVisible(false);
- m_YpixelFld->setVisible(false);
- m_WpixelFld->setVisible(false);
- m_HpixelFld->setVisible(false);
-
- update();
+ m_Xfld->setObjectName("RulerToolOptionValues");
+ m_Yfld->setObjectName("RulerToolOptionValues");
+ m_Wfld->setObjectName("RulerToolOptionValues");
+ m_Hfld->setObjectName("RulerToolOptionValues");
+ m_Afld->setObjectName("RulerToolOptionValues");
+ m_Lfld->setObjectName("RulerToolOptionValues");
+ setStyleSheet(
+ "#RulerToolOptionValues {border:0px; background: rgb(196,196,196);}");
+
+ m_Xfld->setMaximumWidth(70);
+ m_Yfld->setMaximumWidth(70);
+ m_Wfld->setMaximumWidth(70);
+ m_Hfld->setMaximumWidth(70);
+ m_Afld->setMaximumWidth(70);
+ m_Lfld->setMaximumWidth(70);
+
+ m_Xfld->setReadOnly(true);
+ m_Yfld->setReadOnly(true);
+ m_Wfld->setReadOnly(true);
+ m_Hfld->setReadOnly(true);
+ m_Afld->setReadOnly(true);
+ m_Lfld->setReadOnly(true);
+
+ // layout
+ QHBoxLayout *lay = new QHBoxLayout();
+ lay->setMargin(0);
+ lay->setSpacing(3);
+ {
+ lay->addWidget(new QLabel("X:", this), 0);
+ lay->addWidget(m_Xfld, 0);
+ lay->addWidget(m_XpixelFld, 0);
+
+ lay->addSpacing(3);
+
+ lay->addWidget(new QLabel("Y:", this), 0);
+ lay->addWidget(m_Yfld, 0);
+ lay->addWidget(m_YpixelFld, 0);
+
+ lay->addSpacing(3);
+ lay->addWidget(new ToolOptionsBarSeparator(this), 0);
+ lay->addSpacing(3);
+
+ lay->addWidget(new QLabel("W:", this), 0);
+ lay->addWidget(m_Wfld, 0);
+ lay->addWidget(m_WpixelFld, 0);
+
+ lay->addSpacing(3);
+
+ lay->addWidget(new QLabel("H:", this), 0);
+ lay->addWidget(m_Hfld, 0);
+ lay->addWidget(m_HpixelFld, 0);
+
+ lay->addSpacing(3);
+ lay->addWidget(new ToolOptionsBarSeparator(this), 0);
+ lay->addSpacing(3);
+
+ lay->addWidget(new QLabel("A:", this), 0);
+ lay->addWidget(m_Afld, 0);
+
+ lay->addSpacing(3);
+
+ lay->addWidget(new QLabel("L:", this), 0);
+ lay->addWidget(m_Lfld, 0);
+ }
+ m_layout->addLayout(lay, 0);
+ m_layout->addStretch(1);
+ }
+
+ void RulerToolOptionsBox::updateValues(bool isRasterLevelEditing, double X,
+ double Y, double W, double H, double A,
+ double L, int Xpix, int Ypix, int Wpix,
+ int Hpix) {
+ m_Xfld->setValue(X);
+ m_Yfld->setValue(Y);
+ m_Wfld->setValue(W);
+ m_Hfld->setValue(H);
+ m_Afld->setValue(A);
+ m_Lfld->setValue(L);
+
+ m_XpixelFld->setVisible(isRasterLevelEditing);
+ m_YpixelFld->setVisible(isRasterLevelEditing);
+ m_WpixelFld->setVisible(isRasterLevelEditing);
+ m_HpixelFld->setVisible(isRasterLevelEditing);
+
+ if (isRasterLevelEditing) {
+ m_XpixelFld->setText(QString("(%1)").arg(Xpix));
+ m_YpixelFld->setText(QString("(%1)").arg(Ypix));
+ m_WpixelFld->setText(QString("(%1)").arg(Wpix));
+ m_HpixelFld->setText(QString("(%1)").arg(Hpix));
+ }
+ repaint();
+ }
+
+ void RulerToolOptionsBox::resetValues() {
+ m_Xfld->setValue(0);
+ m_Yfld->setValue(0);
+ m_Wfld->setValue(0);
+ m_Hfld->setValue(0);
+ m_Afld->setValue(0);
+ m_Lfld->setValue(0);
+
+ m_XpixelFld->setVisible(false);
+ m_YpixelFld->setVisible(false);
+ m_WpixelFld->setVisible(false);
+ m_HpixelFld->setVisible(false);
+
+ update();
}
//=============================================================================
diff --cc toonz/sources/toonz/levelcreatepopup.cpp
index d6249ea52,834eb4a19..d08bd9c60
--- a/toonz/sources/toonz/levelcreatepopup.cpp
+++ b/toonz/sources/toonz/levelcreatepopup.cpp
@@@ -173,126 -161,126 +161,132 @@@ public
//-----------------------------------------------------------------------------
LevelCreatePopup::LevelCreatePopup()
- : Dialog(TApp::instance()->getMainWindow(), true, true, "LevelCreate")
- {
- setWindowTitle(tr("New Level"));
-
- m_nameFld = new LineEdit(this);
- m_fromFld = new DVGui::IntLineEdit(this);
- m_toFld = new DVGui::IntLineEdit(this);
- m_stepFld = new DVGui::IntLineEdit(this);
- m_incFld = new DVGui::IntLineEdit(this);
- m_levelTypeOm = new QComboBox();
-
- m_pathFld = new FileField(0);
- m_widthLabel = new QLabel(tr("Width:"));
- m_widthFld = new DVGui::MeasuredDoubleLineEdit(0);
- m_heightLabel = new QLabel(tr("Height:"));
- m_heightFld = new DVGui::MeasuredDoubleLineEdit(0);
- m_dpiLabel = new QLabel(tr("DPI:"));
- m_dpiFld = new DoubleLineEdit(0, 66.76);
-
- QPushButton *okBtn = new QPushButton(tr("OK"), this);
- QPushButton *cancelBtn = new QPushButton(tr("Cancel"), this);
- QPushButton *applyBtn = new QPushButton(tr("Apply"), this);
-
- //Exclude all character which cannot fit in a filepath (Win).
- //Dots are also prohibited since they are internally managed by Toonz.
- QRegExp rx("[^\\\\/:?*.\"<>|]+");
- m_nameFld->setValidator(new QRegExpValidator(rx, this));
-
- m_levelTypeOm->addItem(VectorLevel);
- m_levelTypeOm->addItem(ToonzLevel);
- m_levelTypeOm->addItem(RasterLevel);
- m_levelTypeOm->addItem(ScanLevel);
-
- if (Preferences::instance()->getUnits() == "pixel")
- {
+ : Dialog(TApp::instance()->getMainWindow(), true, true, "LevelCreate") {
+ setWindowTitle(tr("New Level"));
+
+ m_nameFld = new LineEdit(this);
+ m_fromFld = new DVGui::IntLineEdit(this);
+ m_toFld = new DVGui::IntLineEdit(this);
+ m_stepFld = new DVGui::IntLineEdit(this);
+ m_incFld = new DVGui::IntLineEdit(this);
+ m_levelTypeOm = new QComboBox();
+
+ m_pathFld = new FileField(0);
+ m_widthLabel = new QLabel(tr("Width:"));
+ m_widthFld = new DVGui::MeasuredDoubleLineEdit(0);
+ m_heightLabel = new QLabel(tr("Height:"));
+ m_heightFld = new DVGui::MeasuredDoubleLineEdit(0);
+ m_dpiLabel = new QLabel(tr("DPI:"));
+ m_dpiFld = new DoubleLineEdit(0, 66.76);
+
+ QPushButton *okBtn = new QPushButton(tr("OK"), this);
+ QPushButton *cancelBtn = new QPushButton(tr("Cancel"), this);
+ QPushButton *applyBtn = new QPushButton(tr("Apply"), this);
+
+ // Exclude all character which cannot fit in a filepath (Win).
+ // Dots are also prohibited since they are internally managed by Toonz.
+ QRegExp rx("[^\\\\/:?*.\"<>|]+");
+ m_nameFld->setValidator(new QRegExpValidator(rx, this));
+
+ m_levelTypeOm->addItem(VectorLevel);
+ m_levelTypeOm->addItem(ToonzLevel);
+ m_levelTypeOm->addItem(RasterLevel);
+ m_levelTypeOm->addItem(ScanLevel);
+
- m_widthFld->setMeasure("level.lx");
- m_heightFld->setMeasure("level.ly");
++ if (Preferences::instance()->getUnits() == "pixel") {
+ m_widthFld->setMeasure("camera.lx");
+ m_heightFld->setMeasure("camera.ly");
- }
- else
- {
++ } else {
+ m_widthFld->setMeasure("level.lx");
+ m_heightFld->setMeasure("level.ly");
+ }
- m_widthFld->setRange(0.1, (std::numeric_limits<double>::max)());
- m_heightFld->setRange(0.1, (std::numeric_limits<double>::max)());
- m_dpiFld->setRange(0.1, (std::numeric_limits<double>::max)());
-
- okBtn->setDefault(true);
-
- //--- layout
- m_topLayout->setMargin(0);
- m_topLayout->setSpacing(0);
- {
- QGridLayout *guiLay = new QGridLayout();
- guiLay->setMargin(10);
- guiLay->setVerticalSpacing(10);
- guiLay->setHorizontalSpacing(5);
- {
- //Name
- guiLay->addWidget(new QLabel(tr("Name:")), 0, 0, Qt::AlignRight | Qt::AlignVCenter);
- guiLay->addWidget(m_nameFld, 0, 1, 1, 4);
-
- //From-To
- guiLay->addWidget(new QLabel(tr("From:")), 1, 0, Qt::AlignRight | Qt::AlignVCenter);
- guiLay->addWidget(m_fromFld, 1, 1);
- guiLay->addWidget(new QLabel(tr("To:")), 1, 2, Qt::AlignRight | Qt::AlignVCenter);
- guiLay->addWidget(m_toFld, 1, 3);
-
- //Step-Inc
- guiLay->addWidget(new QLabel(tr("Step:")), 2, 0, Qt::AlignRight | Qt::AlignVCenter);
- guiLay->addWidget(m_stepFld, 2, 1);
- guiLay->addWidget(new QLabel(tr("Increment:")), 2, 2, Qt::AlignRight | Qt::AlignVCenter);
- guiLay->addWidget(m_incFld, 2, 3);
-
- //Type
- guiLay->addWidget(new QLabel(tr("Type:")), 3, 0, Qt::AlignRight | Qt::AlignVCenter);
- guiLay->addWidget(m_levelTypeOm, 3, 1, 1, 3);
-
- //Save In
- guiLay->addWidget(new QLabel(tr("Save In:")), 4, 0, Qt::AlignRight | Qt::AlignVCenter);
- guiLay->addWidget(m_pathFld, 4, 1, 1, 4);
-
- //Width - Height
- guiLay->addWidget(m_widthLabel, 5, 0, Qt::AlignRight | Qt::AlignVCenter);
- guiLay->addWidget(m_widthFld, 5, 1);
- guiLay->addWidget(m_heightLabel, 5, 2, Qt::AlignRight | Qt::AlignVCenter);
- guiLay->addWidget(m_heightFld, 5, 3);
-
- //DPI
- guiLay->addWidget(m_dpiLabel, 6, 0, Qt::AlignRight | Qt::AlignVCenter);
- guiLay->addWidget(m_dpiFld, 6, 1, 1, 3);
- }
- guiLay->setColumnStretch(0, 0);
- guiLay->setColumnStretch(1, 0);
- guiLay->setColumnStretch(2, 0);
- guiLay->setColumnStretch(3, 0);
- guiLay->setColumnStretch(4, 1);
-
- m_topLayout->addLayout(guiLay, 1);
- }
-
- m_buttonLayout->setMargin(0);
- m_buttonLayout->setSpacing(30);
- {
- m_buttonLayout->addStretch(1);
- m_buttonLayout->addWidget(okBtn, 0);
- m_buttonLayout->addWidget(applyBtn, 0);
- m_buttonLayout->addWidget(cancelBtn, 0);
- m_buttonLayout->addStretch(1);
- }
-
- //---- signal-slot connections
- bool ret = true;
- ret = ret && connect(m_levelTypeOm, SIGNAL(currentIndexChanged(const QString &)),
- SLOT(onLevelTypeChanged(const QString &)));
- ret = ret && connect(okBtn, SIGNAL(clicked()), this, SLOT(onOkBtn()));
- ret = ret && connect(cancelBtn, SIGNAL(clicked()), this, SLOT(reject()));
- ret = ret && connect(applyBtn, SIGNAL(clicked()), this, SLOT(onApplyButton()));
-
- setSizeWidgetEnable(false);
++
+ m_widthFld->setRange(0.1, (std::numeric_limits<double>::max)());
+ m_heightFld->setRange(0.1, (std::numeric_limits<double>::max)());
+ m_dpiFld->setRange(0.1, (std::numeric_limits<double>::max)());
+
+ okBtn->setDefault(true);
+
+ //--- layout
+ m_topLayout->setMargin(0);
+ m_topLayout->setSpacing(0);
+ {
+ QGridLayout *guiLay = new QGridLayout();
+ guiLay->setMargin(10);
+ guiLay->setVerticalSpacing(10);
+ guiLay->setHorizontalSpacing(5);
+ {
+ // Name
+ guiLay->addWidget(new QLabel(tr("Name:")), 0, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ guiLay->addWidget(m_nameFld, 0, 1, 1, 4);
+
+ // From-To
+ guiLay->addWidget(new QLabel(tr("From:")), 1, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ guiLay->addWidget(m_fromFld, 1, 1);
+ guiLay->addWidget(new QLabel(tr("To:")), 1, 2,
+ Qt::AlignRight | Qt::AlignVCenter);
+ guiLay->addWidget(m_toFld, 1, 3);
+
+ // Step-Inc
+ guiLay->addWidget(new QLabel(tr("Step:")), 2, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ guiLay->addWidget(m_stepFld, 2, 1);
+ guiLay->addWidget(new QLabel(tr("Increment:")), 2, 2,
+ Qt::AlignRight | Qt::AlignVCenter);
+ guiLay->addWidget(m_incFld, 2, 3);
+
+ // Type
+ guiLay->addWidget(new QLabel(tr("Type:")), 3, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ guiLay->addWidget(m_levelTypeOm, 3, 1, 1, 3);
+
+ // Save In
+ guiLay->addWidget(new QLabel(tr("Save In:")), 4, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ guiLay->addWidget(m_pathFld, 4, 1, 1, 4);
+
+ // Width - Height
+ guiLay->addWidget(m_widthLabel, 5, 0, Qt::AlignRight | Qt::AlignVCenter);
+ guiLay->addWidget(m_widthFld, 5, 1);
+ guiLay->addWidget(m_heightLabel, 5, 2, Qt::AlignRight | Qt::AlignVCenter);
+ guiLay->addWidget(m_heightFld, 5, 3);
+
+ // DPI
+ guiLay->addWidget(m_dpiLabel, 6, 0, Qt::AlignRight | Qt::AlignVCenter);
+ guiLay->addWidget(m_dpiFld, 6, 1, 1, 3);
+ }
+ guiLay->setColumnStretch(0, 0);
+ guiLay->setColumnStretch(1, 0);
+ guiLay->setColumnStretch(2, 0);
+ guiLay->setColumnStretch(3, 0);
+ guiLay->setColumnStretch(4, 1);
+
+ m_topLayout->addLayout(guiLay, 1);
+ }
+
+ m_buttonLayout->setMargin(0);
+ m_buttonLayout->setSpacing(30);
+ {
+ m_buttonLayout->addStretch(1);
+ m_buttonLayout->addWidget(okBtn, 0);
+ m_buttonLayout->addWidget(applyBtn, 0);
+ m_buttonLayout->addWidget(cancelBtn, 0);
+ m_buttonLayout->addStretch(1);
+ }
+
+ //---- signal-slot connections
+ bool ret = true;
+ ret = ret &&
+ connect(m_levelTypeOm, SIGNAL(currentIndexChanged(const QString &)),
+ SLOT(onLevelTypeChanged(const QString &)));
+ ret = ret && connect(okBtn, SIGNAL(clicked()), this, SLOT(onOkBtn()));
+ ret = ret && connect(cancelBtn, SIGNAL(clicked()), this, SLOT(reject()));
+ ret =
+ ret && connect(applyBtn, SIGNAL(clicked()), this, SLOT(onApplyButton()));
+
+ setSizeWidgetEnable(false);
}
//-----------------------------------------------------------------------------
diff --cc toonz/sources/toonz/levelsettingspopup.cpp
index 603e4ec3f,70f85be91..8a2c6bd41
--- a/toonz/sources/toonz/levelsettingspopup.cpp
+++ b/toonz/sources/toonz/levelsettingspopup.cpp
@@@ -105,173 -104,184 +104,189 @@@ TPointD getCurrentCameraDpi()
//-----------------------------------------------------------------------------
LevelSettingsPopup::LevelSettingsPopup()
- : Dialog(TApp::instance()->getMainWindow(), false, false, "LevelSettings"), m_whiteTransp(0), m_scanPathLabel(0), m_scanPathFld(0)
- {
- setWindowTitle(tr("Level Settings"));
-
- m_nameFld = new LineEdit();
- m_pathFld = new FileField(); //Path
- m_scanPathLabel = new QLabel(tr("Scan Path:"));
- m_scanPathFld = new FileField(); //ScanPath
- m_typeLabel = new QLabel(); //Level Type
- //Type
- m_dpiTypeOm = new QComboBox();
- //DPI
- m_dpiLabel = new QLabel(tr("DPI:"));
- m_dpiFld = new DoubleLineEdit();
- m_squarePixCB = new CheckBox(tr("Forced Squared Pixel"));
-
- m_widthLabel = new QLabel(tr("Width:"));
- m_widthFld = new MeasuredDoubleLineEdit();
- m_heightLabel = new QLabel(tr("Height:"));
- m_heightFld = new MeasuredDoubleLineEdit();
- //Use Camera Dpi
- m_useCameraDpiBtn = new QPushButton(tr("Use Camera DPI"));
-
- m_cameraDpiLabel = new QLabel(tr(""));
- m_imageDpiLabel = new QLabel(tr(""));
- m_imageResLabel = new QLabel(tr(""));
-
- //subsampling
- m_subsamplingLabel = new QLabel(tr("Subsampling:"));
- m_subsamplingFld = new DVGui::IntLineEdit(this,1,1);
-
- m_doPremultiply = new CheckBox(tr("Premultiply"), this);
-
- m_whiteTransp = new CheckBox(tr("White As Transparent"), this);
-
- m_doAntialias = new CheckBox(tr("Add Antialiasing"), this);
- m_antialiasSoftness = new DVGui::IntLineEdit(0, 10, 0, 100);
-
- //----
-
- m_pathFld->setFileMode(QFileDialog::AnyFile);
- m_scanPathFld->setFileMode(QFileDialog::AnyFile);
-
- QStringList type;
- type << ImageDpi << CustomDpi;
- m_dpiTypeOm->addItems(type);
-
- m_squarePixCB->setChecked(true);
-
- /*--- Levelサイズの単位はCameraUnitにする --*/
- m_widthFld->setMeasure("camera.lx");
- m_heightFld->setMeasure("camera.ly");
-
- if (Preferences::instance()->getCameraUnits() == "pixel")
- {
+ : Dialog(TApp::instance()->getMainWindow(), false, false, "LevelSettings")
+ , m_whiteTransp(0)
+ , m_scanPathLabel(0)
+ , m_scanPathFld(0) {
+ setWindowTitle(tr("Level Settings"));
+
+ m_nameFld = new LineEdit();
+ m_pathFld = new FileField(); // Path
+ m_scanPathLabel = new QLabel(tr("Scan Path:"));
+ m_scanPathFld = new FileField(); // ScanPath
+ m_typeLabel = new QLabel(); // Level Type
+ // Type
+ m_dpiTypeOm = new QComboBox();
+ // DPI
+ m_dpiLabel = new QLabel(tr("DPI:"));
+ m_dpiFld = new DoubleLineEdit();
+ m_squarePixCB = new CheckBox(tr("Forced Squared Pixel"));
+
+ m_widthLabel = new QLabel(tr("Width:"));
+ m_widthFld = new MeasuredDoubleLineEdit();
+ m_heightLabel = new QLabel(tr("Height:"));
+ m_heightFld = new MeasuredDoubleLineEdit();
+ // Use Camera Dpi
+ m_useCameraDpiBtn = new QPushButton(tr("Use Camera DPI"));
+
+ m_cameraDpiLabel = new QLabel(tr(""));
+ m_imageDpiLabel = new QLabel(tr(""));
+ m_imageResLabel = new QLabel(tr(""));
+
+ // subsampling
+ m_subsamplingLabel = new QLabel(tr("Subsampling:"));
+ m_subsamplingFld = new DVGui::IntLineEdit(this, 1, 1);
+
+ m_doPremultiply = new CheckBox(tr("Premultiply"), this);
+
+ m_whiteTransp = new CheckBox(tr("White As Transparent"), this);
+
+ m_doAntialias = new CheckBox(tr("Add Antialiasing"), this);
+ m_antialiasSoftness = new DVGui::IntLineEdit(0, 10, 0, 100);
+
+ //----
+
+ m_pathFld->setFileMode(QFileDialog::AnyFile);
+ m_scanPathFld->setFileMode(QFileDialog::AnyFile);
+
+ QStringList type;
+ type << ImageDpi << CustomDpi;
+ m_dpiTypeOm->addItems(type);
+
+ m_squarePixCB->setChecked(true);
+
+ /*--- Levelサイズの単位はCameraUnitにする --*/
+ m_widthFld->setMeasure("camera.lx");
+ m_heightFld->setMeasure("camera.ly");
++
++ if (Preferences::instance()->getCameraUnits() == "pixel") {
+ m_widthFld->setDecimals(0);
+ m_heightFld->setDecimals(0);
+ }
- m_doPremultiply->setChecked(false);
-
- m_doAntialias->setChecked(false);
- m_antialiasSoftness->setEnabled(false);
-
- m_whiteTransp->setChecked(false);
-
- //----layout
-
- m_topLayout->setMargin(5);
- m_topLayout->setSpacing(5);
- {
- //--Name&Path
- QGroupBox *nameBox = new QGroupBox(tr("Name && Path"), this);
- QGridLayout *nameLayout = new QGridLayout();
- nameLayout->setMargin(5);
- nameLayout->setSpacing(5);
- {
- nameLayout->addWidget(new QLabel(tr("Name:"), this), 0, 0, Qt::AlignRight | Qt::AlignVCenter);
- nameLayout->addWidget(m_nameFld, 0, 1);
- nameLayout->addWidget(new QLabel(tr("Path:"), this), 1, 0, Qt::AlignRight | Qt::AlignVCenter);
- nameLayout->addWidget(m_pathFld, 1, 1);
- nameLayout->addWidget(m_scanPathLabel, 2, 0, Qt::AlignRight | Qt::AlignVCenter);
- nameLayout->addWidget(m_scanPathFld, 2, 1);
- nameLayout->addWidget(m_typeLabel, 3, 1);
- }
- nameLayout->setColumnStretch(0, 0);
- nameLayout->setColumnStretch(1, 1);
- nameBox->setLayout(nameLayout);
-
- m_topLayout->addWidget(nameBox);
-
- //----DPI & Resolution
- QGroupBox *dpiBox = new QGroupBox(tr("DPI && Resolution"), this);
- QGridLayout *dpiLayout = new QGridLayout();
- dpiLayout->setMargin(5);
- dpiLayout->setSpacing(5);
- {
- dpiLayout->addWidget(m_dpiTypeOm, 0, 1, 1, 3);
- dpiLayout->addWidget(m_dpiLabel, 1, 0, Qt::AlignRight | Qt::AlignVCenter);
- dpiLayout->addWidget(m_dpiFld, 1, 1);
- dpiLayout->addWidget(m_squarePixCB, 1, 2, 1, 2, Qt::AlignRight | Qt::AlignVCenter);
- dpiLayout->addWidget(m_widthLabel, 2, 0, Qt::AlignRight | Qt::AlignVCenter);
- dpiLayout->addWidget(m_widthFld, 2, 1);
- dpiLayout->addWidget(m_heightLabel, 2, 2, Qt::AlignRight | Qt::AlignVCenter);
- dpiLayout->addWidget(m_heightFld, 2, 3);
- dpiLayout->addWidget(m_useCameraDpiBtn, 3, 1, 1, 3);
- dpiLayout->addWidget(new QLabel(tr("Camera DPI:"), this), 4, 0, Qt::AlignRight | Qt::AlignVCenter);
- dpiLayout->addWidget(m_cameraDpiLabel, 4, 1, 1, 3);
- dpiLayout->addWidget(new QLabel(tr("Image DPI:"), this), 5, 0, Qt::AlignRight | Qt::AlignVCenter);
- dpiLayout->addWidget(m_imageDpiLabel, 5, 1, 1, 3);
- dpiLayout->addWidget(new QLabel(tr("Resolution:"), this), 6, 0, Qt::AlignRight | Qt::AlignVCenter);
- dpiLayout->addWidget(m_imageResLabel, 6, 1, 1, 3);
- }
- dpiLayout->setColumnStretch(0, 0);
- dpiLayout->setColumnStretch(1, 1);
- dpiLayout->setColumnStretch(2, 0);
- dpiLayout->setColumnStretch(3, 1);
- dpiBox->setLayout(dpiLayout);
-
- m_topLayout->addWidget(dpiBox);
-
- m_topLayout->addWidget(m_doPremultiply);
-
- m_topLayout->addWidget(m_whiteTransp);
-
- m_topLayout->addWidget(m_doAntialias);
-
- //---subsampling
- QGridLayout *bottomLay = new QGridLayout();
- bottomLay->setMargin(3);
- bottomLay->setSpacing(3);
- {
- bottomLay->addWidget(new QLabel(tr("Antialias Softness:"), this), 0, 0);
- bottomLay->addWidget(m_antialiasSoftness, 0, 1);
-
- bottomLay->addWidget(m_subsamplingLabel, 1, 0);
- bottomLay->addWidget(m_subsamplingFld, 1, 1);
- }
- bottomLay->setColumnStretch(0, 0);
- bottomLay->setColumnStretch(1, 0);
- bottomLay->setColumnStretch(2, 1);
- m_topLayout->addLayout(bottomLay);
-
- m_topLayout->addStretch();
- }
-
- //----signal/slot connections
- connect(m_nameFld, SIGNAL(editingFinished()), SLOT(onNameChanged()));
- connect(m_pathFld, SIGNAL(pathChanged()), SLOT(onPathChanged()));
- connect(m_dpiTypeOm, SIGNAL(currentIndexChanged(const QString &)),
- SLOT(onDpiTypeChanged(const QString &)));
- connect(m_dpiFld, SIGNAL(editingFinished()), SLOT(onDpiFieldChanged()));
- connect(m_squarePixCB, SIGNAL(stateChanged(int)), SLOT(onSquarePixelChanged(int)));
- connect(m_widthFld, SIGNAL(editingFinished()), SLOT(onWidthFieldChanged()));
- connect(m_heightFld, SIGNAL(editingFinished()), SLOT(onHeightFieldChanged()));
- connect(m_useCameraDpiBtn, SIGNAL(clicked()), SLOT(useCameraDpi()));
- connect(m_subsamplingFld, SIGNAL(editingFinished()), SLOT(onSubsamplingChanged()));
-
- /*--- ScanPathの入力に対応 ---*/
- connect(m_scanPathFld, SIGNAL(pathChanged()), SLOT(onScanPathChanged()));
- connect(m_doPremultiply, SIGNAL(stateChanged(int)), SLOT(onDoPremultiplyChanged(int)));
- connect(m_doAntialias, SIGNAL(stateChanged(int)), SLOT(onDoAntialiasChanged(int)));
- connect(m_antialiasSoftness, SIGNAL(editingFinished()), SLOT(onAntialiasSoftnessChanged()));
-
- connect(m_whiteTransp, SIGNAL(stateChanged(int)), SLOT(onWhiteTranspChanged(int)));
-
- updateLevelSettings();
+ m_doPremultiply->setChecked(false);
+
+ m_doAntialias->setChecked(false);
+ m_antialiasSoftness->setEnabled(false);
+
+ m_whiteTransp->setChecked(false);
+
+ //----layout
+
+ m_topLayout->setMargin(5);
+ m_topLayout->setSpacing(5);
+ {
+ //--Name&Path
+ QGroupBox *nameBox = new QGroupBox(tr("Name && Path"), this);
+ QGridLayout *nameLayout = new QGridLayout();
+ nameLayout->setMargin(5);
+ nameLayout->setSpacing(5);
+ {
+ nameLayout->addWidget(new QLabel(tr("Name:"), this), 0, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ nameLayout->addWidget(m_nameFld, 0, 1);
+ nameLayout->addWidget(new QLabel(tr("Path:"), this), 1, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ nameLayout->addWidget(m_pathFld, 1, 1);
+ nameLayout->addWidget(m_scanPathLabel, 2, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ nameLayout->addWidget(m_scanPathFld, 2, 1);
+ nameLayout->addWidget(m_typeLabel, 3, 1);
+ }
+ nameLayout->setColumnStretch(0, 0);
+ nameLayout->setColumnStretch(1, 1);
+ nameBox->setLayout(nameLayout);
+
+ m_topLayout->addWidget(nameBox);
+
+ //----DPI & Resolution
+ QGroupBox *dpiBox = new QGroupBox(tr("DPI && Resolution"), this);
+ QGridLayout *dpiLayout = new QGridLayout();
+ dpiLayout->setMargin(5);
+ dpiLayout->setSpacing(5);
+ {
+ dpiLayout->addWidget(m_dpiTypeOm, 0, 1, 1, 3);
+ dpiLayout->addWidget(m_dpiLabel, 1, 0, Qt::AlignRight | Qt::AlignVCenter);
+ dpiLayout->addWidget(m_dpiFld, 1, 1);
+ dpiLayout->addWidget(m_squarePixCB, 1, 2, 1, 2,
+ Qt::AlignRight | Qt::AlignVCenter);
+ dpiLayout->addWidget(m_widthLabel, 2, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ dpiLayout->addWidget(m_widthFld, 2, 1);
+ dpiLayout->addWidget(m_heightLabel, 2, 2,
+ Qt::AlignRight | Qt::AlignVCenter);
+ dpiLayout->addWidget(m_heightFld, 2, 3);
+ dpiLayout->addWidget(m_useCameraDpiBtn, 3, 1, 1, 3);
+ dpiLayout->addWidget(new QLabel(tr("Camera DPI:"), this), 4, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ dpiLayout->addWidget(m_cameraDpiLabel, 4, 1, 1, 3);
+ dpiLayout->addWidget(new QLabel(tr("Image DPI:"), this), 5, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ dpiLayout->addWidget(m_imageDpiLabel, 5, 1, 1, 3);
+ dpiLayout->addWidget(new QLabel(tr("Resolution:"), this), 6, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ dpiLayout->addWidget(m_imageResLabel, 6, 1, 1, 3);
+ }
+ dpiLayout->setColumnStretch(0, 0);
+ dpiLayout->setColumnStretch(1, 1);
+ dpiLayout->setColumnStretch(2, 0);
+ dpiLayout->setColumnStretch(3, 1);
+ dpiBox->setLayout(dpiLayout);
+
+ m_topLayout->addWidget(dpiBox);
+
+ m_topLayout->addWidget(m_doPremultiply);
+
+ m_topLayout->addWidget(m_whiteTransp);
+
+ m_topLayout->addWidget(m_doAntialias);
+
+ //---subsampling
+ QGridLayout *bottomLay = new QGridLayout();
+ bottomLay->setMargin(3);
+ bottomLay->setSpacing(3);
+ {
+ bottomLay->addWidget(new QLabel(tr("Antialias Softness:"), this), 0, 0);
+ bottomLay->addWidget(m_antialiasSoftness, 0, 1);
+
+ bottomLay->addWidget(m_subsamplingLabel, 1, 0);
+ bottomLay->addWidget(m_subsamplingFld, 1, 1);
+ }
+ bottomLay->setColumnStretch(0, 0);
+ bottomLay->setColumnStretch(1, 0);
+ bottomLay->setColumnStretch(2, 1);
+ m_topLayout->addLayout(bottomLay);
+
+ m_topLayout->addStretch();
+ }
+
+ //----signal/slot connections
+ connect(m_nameFld, SIGNAL(editingFinished()), SLOT(onNameChanged()));
+ connect(m_pathFld, SIGNAL(pathChanged()), SLOT(onPathChanged()));
+ connect(m_dpiTypeOm, SIGNAL(currentIndexChanged(const QString &)),
+ SLOT(onDpiTypeChanged(const QString &)));
+ connect(m_dpiFld, SIGNAL(editingFinished()), SLOT(onDpiFieldChanged()));
+ connect(m_squarePixCB, SIGNAL(stateChanged(int)),
+ SLOT(onSquarePixelChanged(int)));
+ connect(m_widthFld, SIGNAL(editingFinished()), SLOT(onWidthFieldChanged()));
+ connect(m_heightFld, SIGNAL(editingFinished()), SLOT(onHeightFieldChanged()));
+ connect(m_useCameraDpiBtn, SIGNAL(clicked()), SLOT(useCameraDpi()));
+ connect(m_subsamplingFld, SIGNAL(editingFinished()),
+ SLOT(onSubsamplingChanged()));
+
+ /*--- ScanPathの入力に対応 ---*/
+ connect(m_scanPathFld, SIGNAL(pathChanged()), SLOT(onScanPathChanged()));
+ connect(m_doPremultiply, SIGNAL(stateChanged(int)),
+ SLOT(onDoPremultiplyChanged(int)));
+ connect(m_doAntialias, SIGNAL(stateChanged(int)),
+ SLOT(onDoAntialiasChanged(int)));
+ connect(m_antialiasSoftness, SIGNAL(editingFinished()),
+ SLOT(onAntialiasSoftnessChanged()));
+
+ connect(m_whiteTransp, SIGNAL(stateChanged(int)),
+ SLOT(onWhiteTranspChanged(int)));
+
+ updateLevelSettings();
}
//-----------------------------------------------------------------------------
diff --cc toonz/sources/toonz/preferencespopup.cpp
index fd2c4c313,77137805e..b0e77a7a2
--- a/toonz/sources/toonz/preferencespopup.cpp
+++ b/toonz/sources/toonz/preferencespopup.cpp
@@@ -837,873 -777,1062 +777,1071 @@@ void PreferencesPopup::onRegionAntialia
//**********************************************************************************
PreferencesPopup::PreferencesPopup()
- : QDialog(TApp::instance()->getMainWindow()), m_formatProperties(), m_inksOnly(0), m_blanksCount(0), m_blankColor(0)
- {
- setWindowTitle(tr("Preferences"));
- setObjectName("PreferencesPopup");
-
- m_pref = Preferences::instance();
-
- //Category List
- QListWidget *categoryList = new QListWidget(this);
-
- QStackedWidget *stackedWidget = new QStackedWidget(this);
-
- //---General ------------------------------
- categoryList->addItem(tr("General"));
-
- CheckBox *useDefaultViewerCB = new CheckBox(tr("Use Default Viewer for Movie Formats"), this);
- CheckBox *minimizeRasterMemoryCB = new CheckBox(tr("Minimize Raster Memory Fragmentation *"), this);
- CheckBox *autoSaveCB = new CheckBox(tr("Save Automatically Every Minutes"));
- m_minuteFld = new DVGui::IntLineEdit(this, 15, 1, 60);
- CheckBox *replaceAfterSaveLevelAsCB = new CheckBox(tr("Replace Toonz Level after SaveLevelAs command"), this);
-
- m_cellsDragBehaviour = new QComboBox();
- m_undoMemorySize = new DVGui::IntLineEdit(this, m_pref->getUndoMemorySize(), 0, 2000);
- m_levelsBackup = new CheckBox(tr("Backup Animation Levels when Saving"));
- m_chunkSizeFld = new DVGui::IntLineEdit(this, m_pref->getDefaultTaskChunkSize(), 1, 2000);
- CheckBox *sceneNumberingCB = new CheckBox(tr("Show Info in Rendered Frames"));
-
- QLabel *note_general = new QLabel(tr("* Changes will take effect the next time you run Toonz"));
- note_general->setStyleSheet("font-size: 10px; font: italic;");
-
- //--- Interface ------------------------------
- categoryList->addItem(tr("Interface"));
-
- QComboBox *languageType = 0;
- QStringList languageList;
- int currentIndex = 0;
- for (int i = 0; i < m_pref->getLanguageCount(); i++) {
- QString string = m_pref->getLanguage(i);
- if (string == m_pref->getCurrentLanguage())
- currentIndex = i;
- languageList.push_back(string);
- }
-
- if (languageList.size() > 1) {
- languageType = new QComboBox(this);
- languageType->addItems(languageList);
- languageType->setCurrentIndex(currentIndex);
- }
- QComboBox *styleSheetType = new QComboBox(this);
- QComboBox *unitOm = new QComboBox(this);
- QComboBox *cameraUnitOm = new QComboBox(this);
- //Choose between standard and Studio Ghibli rooms
- QComboBox *roomChoice = new QComboBox(this);
-
-
- m_iconSizeLx = new DVGui::IntLineEdit(this, 80, 10, 400);
- m_iconSizeLy = new DVGui::IntLineEdit(this, 60, 10, 400);
- m_viewShrink = new DVGui::IntLineEdit(this, 1, 1, 20);
- m_viewStep = new DVGui::IntLineEdit(this, 1, 1, 20);
-
- CheckBox *moveCurrentFrameCB = new CheckBox(tr("Move Current Frame by Clicking on Xsheet / Numerical Columns Cell Area"), this);
- //Viewer BG color
- m_viewerBgColorFld = new ColorField(this, false, m_pref->getViewerBgColor());
- //Preview BG color
- m_previewBgColorFld = new ColorField(this, false, m_pref->getPreviewBgColor());
- //bg chessboard colors
- TPixel32 col1, col2;
- m_pref->getChessboardColors(col1, col2);
- m_chessboardColor1Fld = new ColorField(this, false, col1);
- m_chessboardColor2Fld = new ColorField(this, false, col2);
- CheckBox *openFlipbookAfterCB = new CheckBox(tr("Open Flipbook after Rendering"), this);
- CheckBox *actualPixelOnSceneModeCB = new CheckBox(tr("Enable Actual Pixel View on Scene Editing Mode"), this);
- CheckBox *levelNameOnEachMarkerCB = new CheckBox(tr("Display Level Name on Each Marker"), this);
- CheckBox *showRasterImageDarkenBlendedInViewerCB = new CheckBox(tr("Show Raster Images Darken Blended in Camstand View"), this);
- CheckBox *showShowFrameNumberWithLettersCB = new CheckBox(tr("Show \"ABC\" Appendix to the Frame Number in Xsheet Cell"), this);
- QComboBox *viewerZoomCenterComboBox = new QComboBox(this);
-
- QLabel *note_interface = new QLabel(tr("* Changes will take effect the next time you run Toonz"));
- note_interface->setStyleSheet("font-size: 10px; font: italic;");
-
- //--- Visualization ------------------------------
- categoryList->addItem(tr("Visualization"));
- CheckBox *show0ThickLinesCB = new CheckBox(tr("Show Lines with Thickness 0"), this);
- CheckBox *regionAntialiasCB = new CheckBox(tr("Antialiased region boundaries"), this);
-
- //--- Loading ------------------------------
- categoryList->addItem(tr("Loading"));
-
- CheckBox *exposeLoadedLevelsCB = new CheckBox(tr("Expose Loaded Levels in Xsheet"), this);
- CheckBox *createSubfolderCB = new CheckBox(tr("Create Sub-folder when Importing Sub-xsheet"), this);
- //Column Icon
- m_columnIconOm = new QComboBox(this);
- QComboBox *initialLoadTlvCachingBehaviorComboBox = new QComboBox(this);
- CheckBox *removeSceneNumberFromLoadedLevelNameCB = new CheckBox(tr("Automatically Remove Scene Number from Loaded Level Name"), this);
-
- m_levelFormatNames = new QComboBox;
- m_addLevelFormat = new QPushButton("+");
- m_removeLevelFormat = new QPushButton("-");
- m_editLevelFormat = new QPushButton(tr("Edit"));
-
- QComboBox *paletteTypeForRasterColorModelComboBox = new QComboBox(this);
-
- //--- Drawing ------------------------------
- categoryList->addItem(tr("Drawing"));
-
- m_defScanLevelType = new QComboBox(this);
- m_defLevelType = new QComboBox(this);
- m_defLevelWidth = new MeasuredDoubleLineEdit(0);
- m_defLevelHeight = new MeasuredDoubleLineEdit(0);
- m_defLevelDpi = new DoubleLineEdit(0, 66.76);
- m_autocreationType = new QComboBox(this);
-
- CheckBox *keepOriginalCleanedUpCB = new CheckBox(tr("Keep Original Cleaned Up Drawings As Backup"), this);
- CheckBox *multiLayerStylePickerCB = new CheckBox(tr("Multi Layer Style Picker : Switch Levels by Picking"), this);
- CheckBox *useSaveboxToLimitFillingOpCB = new CheckBox(tr("Use the TLV Savebox to Limit Filling Operations"), this);
- CheckBox *minimizeSaveboxAfterEditingCB = new CheckBox(tr("Minimize Savebox after Editing"), this);
-
- //--- Xsheet ------------------------------
- categoryList->addItem(tr("Xsheet"));
-
- CheckBox *xsheetAutopanDuringPlaybackCB = new CheckBox(tr("Xsheet Autopan during Playback"), this);
- m_xsheetStep = new DVGui::IntLineEdit(this, Preferences::instance()->getXsheetStep(), 0);
- m_cellsDragBehaviour = new QComboBox();
- CheckBox *ignoreAlphaonColumn1CB = new CheckBox(tr("Ignore Alpha Channel on Levels in Column 1"), this);
- CheckBox *showKeyframesOnCellAreaCB = new CheckBox(tr("Show Keyframes on Cell Area"), this);
-
- //--- Animation ------------------------------
- categoryList->addItem(tr("Animation"));
-
- m_keyframeType = new QComboBox(this);
- m_animationStepField = new DVGui::IntLineEdit(this, 1, 1, 500);
-
- //--- Preview ------------------------------
- categoryList->addItem(tr("Preview"));
-
- m_blanksCount = new DVGui::IntLineEdit(this, 0, 0, 1000);
- m_blankColor = new ColorField(this, false, TPixel::Black);
- CheckBox *rewindAfterPlaybackCB = new CheckBox(tr("Rewind after Playback"), this);
- CheckBox *displayInNewFlipBookCB = new CheckBox(tr("Display in a New Flipbook Window"), this);
- CheckBox *fitToFlipbookCB = new CheckBox(tr("Fit to Flipbook"), this);
-
- //--- Onion Skin ------------------------------
- categoryList->addItem(tr("Onion Skin"));
-
- TPixel32 frontColor, backColor;
- bool onlyInks;
- m_pref->getOnionData(frontColor, backColor, onlyInks);
- m_onionSkinVisibility = new CheckBox(tr("Onion Skin ON"));
- m_frontOnionColor = new ColorField(this, false, frontColor);
- m_backOnionColor = new ColorField(this, false, backColor);
- m_inksOnly = new DVGui::CheckBox(tr("Display Lines Only "));
- m_inksOnly->setChecked(onlyInks);
-
- int thickness = m_pref->getOnionPaperThickness();
- m_onionPaperThickness = new DVGui::IntLineEdit(this, thickness, 0, 100);
-
- //--- Transparency Check ------------------------------
- categoryList->addItem(tr("Transparency Check"));
-
- TPixel32 bgColor, inkColor, paintColor;
- m_pref->getTranspCheckData(bgColor, inkColor, paintColor);
- m_transpCheckInkColor = new ColorField(this, false, inkColor);
- m_transpCheckBgColor = new ColorField(this, false, bgColor);
- m_transpCheckPaintColor = new ColorField(this, false, paintColor);
-
- //--- Version Control ------------------------------
- categoryList->addItem(tr("Version Control"));
- m_enableVersionControl = new DVGui::CheckBox(tr("Enable Version Control*"));
- CheckBox *autoRefreshFolderContentsCB = new CheckBox(tr("Automatically Refresh Folder Contents"), this);
-
- QLabel *note_version = new QLabel(tr("* Changes will take effect the next time you run Toonz"));
- note_version->setStyleSheet("font-size: 10px; font: italic;");
-
- /*--- set default parameters ---*/
- categoryList->setFixedWidth(160);
- categoryList->setCurrentRow(0);
- categoryList->setAlternatingRowColors(true);
- //--- General ------------------------------
- useDefaultViewerCB->setChecked(m_pref->isDefaultViewerEnabled());
- minimizeRasterMemoryCB->setChecked(m_pref->isRasterOptimizedMemory());
- autoSaveCB->setChecked(m_pref->isAutosaveEnabled());
- m_minuteFld->setValue(m_pref->getAutosavePeriod());
- m_minuteFld->setEnabled(m_pref->isAutosaveEnabled());
- replaceAfterSaveLevelAsCB->setChecked(m_pref->isReplaceAfterSaveLevelAsEnabled());
-
- QStringList dragCellsBehaviourList;
- dragCellsBehaviourList << tr("Cells Only") << tr("Cells and Column Data");
- m_cellsDragBehaviour->addItems(dragCellsBehaviourList);
- m_cellsDragBehaviour->setCurrentIndex(m_pref->getDragCellsBehaviour());
- m_levelsBackup->setChecked(m_pref->isLevelsBackupEnabled());
- sceneNumberingCB->setChecked(m_pref->isSceneNumberingEnabled());
-
- //--- Interface ------------------------------
- QStringList styleSheetList;
- for (int i = 0; i < m_pref->getStyleSheetCount(); i++) {
- QString string = m_pref->getStyleSheet(i);
- if (string == m_pref->getCurrentStyleSheet())
- currentIndex = i;
- TFilePath path(string.toStdWString());
- styleSheetList.push_back(QString::fromStdWString(path.getWideName()));
- }
- styleSheetType->addItems(styleSheetList);
- styleSheetType->setCurrentIndex(currentIndex);
-
- QStringList type;
- type << tr("cm") << tr("mm") << tr("inch") << tr("field") << tr("pixel");
- unitOm->addItems(type);
- int idx = std::find(::units, ::units + ::unitsCount, m_pref->getUnits()) - ::units;
- unitOm->setCurrentIndex((idx < ::unitsCount) ? idx : ::inchIdx);
- cameraUnitOm->addItems(type);
-
- idx = std::find(::units, ::units + ::unitsCount, m_pref->getCameraUnits()) - ::units;
- cameraUnitOm->setCurrentIndex((idx < ::unitsCount) ? idx : ::inchIdx);
-
- QStringList roomList;
- int currentRoomIndex = 0;
- for (int i = 0; i < m_pref->getRoomChoiceCount(); i++) {
- QString string = m_pref->getRoomChoice(i);
- if (string == m_pref->getCurrentRoomChoice())
- currentRoomIndex = i;
- roomList.push_back(string);
- }
-
- if (roomList.size() > 1) {
- roomChoice->addItems(roomList);
- roomChoice->setCurrentIndex(currentRoomIndex);
- }
-
- m_iconSizeLx->setValue(m_pref->getIconSize().lx);
- m_iconSizeLy->setValue(m_pref->getIconSize().ly);
- int shrink, step;
- m_pref->getViewValues(shrink, step);
- m_viewShrink->setValue(shrink);
- m_viewStep->setValue(step);
- moveCurrentFrameCB->setChecked(m_pref->isMoveCurrentEnabled());
- openFlipbookAfterCB->setChecked(m_pref->isGeneratedMovieViewEnabled());
- actualPixelOnSceneModeCB->setChecked(m_pref->isActualPixelViewOnSceneEditingModeEnabled());
- levelNameOnEachMarkerCB->setChecked(m_pref->isLevelNameOnEachMarkerEnabled());
- showRasterImageDarkenBlendedInViewerCB->setChecked(m_pref->isShowRasterImagesDarkenBlendedInViewerEnabled());
- showShowFrameNumberWithLettersCB->setChecked(m_pref->isShowFrameNumberWithLettersEnabled());
- QStringList zoomCenters;
- zoomCenters << tr("Mouse Cursor")
- << tr("Viewer Center");
- viewerZoomCenterComboBox->addItems(zoomCenters);
- viewerZoomCenterComboBox->setCurrentIndex(m_pref->getViewerZoomCenter());
-
- //--- Visualization ------------------------------
- show0ThickLinesCB->setChecked(m_pref->getShow0ThickLines());
- regionAntialiasCB->setChecked(m_pref->getRegionAntialias());
-
- //--- Loading ------------------------------
- exposeLoadedLevelsCB->setChecked(m_pref->isAutoExposeEnabled());
- QStringList behaviors;
- behaviors << tr("On Demand") << tr("All Icons") << tr("All Icons & Images");
- initialLoadTlvCachingBehaviorComboBox->addItems(behaviors);
- initialLoadTlvCachingBehaviorComboBox->setCurrentIndex(m_pref->getInitialLoadTlvCachingBehavior());
- QStringList formats;
- formats << tr("At Once") << tr("On Demand");
- m_columnIconOm->addItems(formats);
- if (m_pref->getColumnIconLoadingPolicy() == Preferences::LoadAtOnce)
- m_columnIconOm->setCurrentIndex(m_columnIconOm->findText(tr("At Once")));
- else
- m_columnIconOm->setCurrentIndex(m_columnIconOm->findText(tr("On Demand")));
- removeSceneNumberFromLoadedLevelNameCB->setChecked(m_pref->isRemoveSceneNumberFromLoadedLevelNameEnabled());
- createSubfolderCB->setChecked(m_pref->isSubsceneFolderEnabled());
-
- m_addLevelFormat->setFixedSize(20, 20);
- m_removeLevelFormat->setFixedSize(20, 20);
-
- rebuildFormatsList();
-
- QStringList paletteTypes;
- paletteTypes << tr("Pick Every Colors as Different Styles") << tr("Integrate Similar Colors as One Style");
- paletteTypeForRasterColorModelComboBox->addItems(paletteTypes);
- paletteTypeForRasterColorModelComboBox->setCurrentIndex(m_pref->getPaletteTypeOnLoadRasterImageAsColorModel());
-
- //--- Drawing ------------------------------
- keepOriginalCleanedUpCB->setChecked(m_pref->isSaveUnpaintedInCleanupEnable());
- multiLayerStylePickerCB->setChecked(m_pref->isMultiLayerStylePickerEnabled());
- minimizeSaveboxAfterEditingCB->setChecked(m_pref->isMinimizeSaveboxAfterEditing());
- useSaveboxToLimitFillingOpCB->setChecked(m_pref->getFillOnlySavebox());
-
- QStringList scanLevelTypes;
- scanLevelTypes << "tif"
- << "png";
- m_defScanLevelType->addItems(scanLevelTypes);
- m_defScanLevelType->setCurrentIndex(m_defScanLevelType->findText(m_pref->getScanLevelType()));
- QStringList levelTypes;
- m_defLevelType->addItem(("Toonz Vector Level"), PLI_XSHLEVEL);
- m_defLevelType->addItem(("Toonz Raster Level"), TZP_XSHLEVEL);
- m_defLevelType->addItem(("Raster Level"), OVL_XSHLEVEL);
- m_defLevelType->setCurrentIndex(0);
-
- for (int i = 0; i < m_defLevelType->count(); i++) {
- if (m_defLevelType->itemData(i).toInt() == m_pref->getDefLevelType()) {
- m_defLevelType->setCurrentIndex(i);
- onDefLevelTypeChanged(i);
- break;
- }
- }
-
-
- if (Preferences::instance()->getUnits() == "pixel")
- {
+ : QDialog(TApp::instance()->getMainWindow())
+ , m_formatProperties()
+ , m_inksOnly(0)
+ , m_blanksCount(0)
+ , m_blankColor(0) {
+ setWindowTitle(tr("Preferences"));
+ setObjectName("PreferencesPopup");
+
+ m_pref = Preferences::instance();
+
+ // Category List
+ QListWidget *categoryList = new QListWidget(this);
+
+ QStackedWidget *stackedWidget = new QStackedWidget(this);
+
+ //---General ------------------------------
+ categoryList->addItem(tr("General"));
+
+ CheckBox *useDefaultViewerCB =
+ new CheckBox(tr("Use Default Viewer for Movie Formats"), this);
+ CheckBox *minimizeRasterMemoryCB =
+ new CheckBox(tr("Minimize Raster Memory Fragmentation *"), this);
+ CheckBox *autoSaveCB = new CheckBox(tr("Save Automatically Every Minutes"));
+ m_minuteFld = new DVGui::IntLineEdit(this, 15, 1, 60);
+ CheckBox *replaceAfterSaveLevelAsCB =
+ new CheckBox(tr("Replace Toonz Level after SaveLevelAs command"), this);
+
+ m_cellsDragBehaviour = new QComboBox();
+ m_undoMemorySize =
+ new DVGui::IntLineEdit(this, m_pref->getUndoMemorySize(), 0, 2000);
+ m_levelsBackup = new CheckBox(tr("Backup Animation Levels when Saving"));
+ m_chunkSizeFld =
+ new DVGui::IntLineEdit(this, m_pref->getDefaultTaskChunkSize(), 1, 2000);
+ CheckBox *sceneNumberingCB = new CheckBox(tr("Show Info in Rendered Frames"));
+
+ QLabel *note_general =
+ new QLabel(tr("* Changes will take effect the next time you run Toonz"));
+ note_general->setStyleSheet("font-size: 10px; font: italic;");
+
+ //--- Interface ------------------------------
+ categoryList->addItem(tr("Interface"));
+
+ QComboBox *languageType = 0;
+ QStringList languageList;
+ int currentIndex = 0;
+ for (int i = 0; i < m_pref->getLanguageCount(); i++) {
+ QString string = m_pref->getLanguage(i);
+ if (string == m_pref->getCurrentLanguage()) currentIndex = i;
+ languageList.push_back(string);
+ }
+
+ if (languageList.size() > 1) {
+ languageType = new QComboBox(this);
+ languageType->addItems(languageList);
+ languageType->setCurrentIndex(currentIndex);
+ }
+ QComboBox *styleSheetType = new QComboBox(this);
+ QComboBox *unitOm = new QComboBox(this);
+ QComboBox *cameraUnitOm = new QComboBox(this);
+ // Choose between standard and Studio Ghibli rooms
+ QComboBox *roomChoice = new QComboBox(this);
+
+ m_iconSizeLx = new DVGui::IntLineEdit(this, 80, 10, 400);
+ m_iconSizeLy = new DVGui::IntLineEdit(this, 60, 10, 400);
+ m_viewShrink = new DVGui::IntLineEdit(this, 1, 1, 20);
+ m_viewStep = new DVGui::IntLineEdit(this, 1, 1, 20);
+
+ CheckBox *moveCurrentFrameCB =
+ new CheckBox(tr("Move Current Frame by Clicking on Xsheet / Numerical "
+ "Columns Cell Area"),
+ this);
+ // Viewer BG color
+ m_viewerBgColorFld = new ColorField(this, false, m_pref->getViewerBgColor());
+ // Preview BG color
+ m_previewBgColorFld =
+ new ColorField(this, false, m_pref->getPreviewBgColor());
+ // bg chessboard colors
+ TPixel32 col1, col2;
+ m_pref->getChessboardColors(col1, col2);
+ m_chessboardColor1Fld = new ColorField(this, false, col1);
+ m_chessboardColor2Fld = new ColorField(this, false, col2);
+ CheckBox *openFlipbookAfterCB =
+ new CheckBox(tr("Open Flipbook after Rendering"), this);
+ CheckBox *actualPixelOnSceneModeCB =
+ new CheckBox(tr("Enable Actual Pixel View on Scene Editing Mode"), this);
+ CheckBox *levelNameOnEachMarkerCB =
+ new CheckBox(tr("Display Level Name on Each Marker"), this);
+ CheckBox *showRasterImageDarkenBlendedInViewerCB = new CheckBox(
+ tr("Show Raster Images Darken Blended in Camstand View"), this);
+ CheckBox *showShowFrameNumberWithLettersCB = new CheckBox(
+ tr("Show \"ABC\" Appendix to the Frame Number in Xsheet Cell"), this);
+ QComboBox *viewerZoomCenterComboBox = new QComboBox(this);
+
+ QLabel *note_interface =
+ new QLabel(tr("* Changes will take effect the next time you run Toonz"));
+ note_interface->setStyleSheet("font-size: 10px; font: italic;");
+
+ //--- Visualization ------------------------------
+ categoryList->addItem(tr("Visualization"));
+ CheckBox *show0ThickLinesCB =
+ new CheckBox(tr("Show Lines with Thickness 0"), this);
+ CheckBox *regionAntialiasCB =
+ new CheckBox(tr("Antialiased region boundaries"), this);
+
+ //--- Loading ------------------------------
+ categoryList->addItem(tr("Loading"));
+
+ CheckBox *exposeLoadedLevelsCB =
+ new CheckBox(tr("Expose Loaded Levels in Xsheet"), this);
+ CheckBox *createSubfolderCB =
+ new CheckBox(tr("Create Sub-folder when Importing Sub-xsheet"), this);
+ // Column Icon
+ m_columnIconOm = new QComboBox(this);
+ QComboBox *initialLoadTlvCachingBehaviorComboBox = new QComboBox(this);
+ CheckBox *removeSceneNumberFromLoadedLevelNameCB = new CheckBox(
+ tr("Automatically Remove Scene Number from Loaded Level Name"), this);
+
+ m_levelFormatNames = new QComboBox;
+ m_addLevelFormat = new QPushButton("+");
+ m_removeLevelFormat = new QPushButton("-");
+ m_editLevelFormat = new QPushButton(tr("Edit"));
+
+ QComboBox *paletteTypeForRasterColorModelComboBox = new QComboBox(this);
+
+ //--- Drawing ------------------------------
+ categoryList->addItem(tr("Drawing"));
+
+ m_defScanLevelType = new QComboBox(this);
+ m_defLevelType = new QComboBox(this);
+ m_defLevelWidth = new MeasuredDoubleLineEdit(0);
+ m_defLevelHeight = new MeasuredDoubleLineEdit(0);
+ m_defLevelDpi = new DoubleLineEdit(0, 66.76);
+ m_autocreationType = new QComboBox(this);
+
+ CheckBox *keepOriginalCleanedUpCB =
+ new CheckBox(tr("Keep Original Cleaned Up Drawings As Backup"), this);
+ CheckBox *multiLayerStylePickerCB = new CheckBox(
+ tr("Multi Layer Style Picker : Switch Levels by Picking"), this);
+ CheckBox *useSaveboxToLimitFillingOpCB =
+ new CheckBox(tr("Use the TLV Savebox to Limit Filling Operations"), this);
+ CheckBox *minimizeSaveboxAfterEditingCB =
+ new CheckBox(tr("Minimize Savebox after Editing"), this);
+
+ //--- Xsheet ------------------------------
+ categoryList->addItem(tr("Xsheet"));
+
+ CheckBox *xsheetAutopanDuringPlaybackCB =
+ new CheckBox(tr("Xsheet Autopan during Playback"), this);
+ m_xsheetStep =
+ new DVGui::IntLineEdit(this, Preferences::instance()->getXsheetStep(), 0);
+ m_cellsDragBehaviour = new QComboBox();
+ CheckBox *ignoreAlphaonColumn1CB =
+ new CheckBox(tr("Ignore Alpha Channel on Levels in Column 1"), this);
+ CheckBox *showKeyframesOnCellAreaCB =
+ new CheckBox(tr("Show Keyframes on Cell Area"), this);
+
+ //--- Animation ------------------------------
+ categoryList->addItem(tr("Animation"));
+
+ m_keyframeType = new QComboBox(this);
+ m_animationStepField = new DVGui::IntLineEdit(this, 1, 1, 500);
+
+ //--- Preview ------------------------------
+ categoryList->addItem(tr("Preview"));
+
+ m_blanksCount = new DVGui::IntLineEdit(this, 0, 0, 1000);
+ m_blankColor = new ColorField(this, false, TPixel::Black);
+ CheckBox *rewindAfterPlaybackCB =
+ new CheckBox(tr("Rewind after Playback"), this);
+ CheckBox *displayInNewFlipBookCB =
+ new CheckBox(tr("Display in a New Flipbook Window"), this);
+ CheckBox *fitToFlipbookCB = new CheckBox(tr("Fit to Flipbook"), this);
+
+ //--- Onion Skin ------------------------------
+ categoryList->addItem(tr("Onion Skin"));
+
+ TPixel32 frontColor, backColor;
+ bool onlyInks;
+ m_pref->getOnionData(frontColor, backColor, onlyInks);
+ m_onionSkinVisibility = new CheckBox(tr("Onion Skin ON"));
+ m_frontOnionColor = new ColorField(this, false, frontColor);
+ m_backOnionColor = new ColorField(this, false, backColor);
+ m_inksOnly = new DVGui::CheckBox(tr("Display Lines Only "));
+ m_inksOnly->setChecked(onlyInks);
+
+ int thickness = m_pref->getOnionPaperThickness();
+ m_onionPaperThickness = new DVGui::IntLineEdit(this, thickness, 0, 100);
+
+ //--- Transparency Check ------------------------------
+ categoryList->addItem(tr("Transparency Check"));
+
+ TPixel32 bgColor, inkColor, paintColor;
+ m_pref->getTranspCheckData(bgColor, inkColor, paintColor);
+ m_transpCheckInkColor = new ColorField(this, false, inkColor);
+ m_transpCheckBgColor = new ColorField(this, false, bgColor);
+ m_transpCheckPaintColor = new ColorField(this, false, paintColor);
+
+ //--- Version Control ------------------------------
+ categoryList->addItem(tr("Version Control"));
+ m_enableVersionControl = new DVGui::CheckBox(tr("Enable Version Control*"));
+ CheckBox *autoRefreshFolderContentsCB =
+ new CheckBox(tr("Automatically Refresh Folder Contents"), this);
+
+ QLabel *note_version =
+ new QLabel(tr("* Changes will take effect the next time you run Toonz"));
+ note_version->setStyleSheet("font-size: 10px; font: italic;");
+
+ /*--- set default parameters ---*/
+ categoryList->setFixedWidth(160);
+ categoryList->setCurrentRow(0);
+ categoryList->setAlternatingRowColors(true);
+ //--- General ------------------------------
+ useDefaultViewerCB->setChecked(m_pref->isDefaultViewerEnabled());
+ minimizeRasterMemoryCB->setChecked(m_pref->isRasterOptimizedMemory());
+ autoSaveCB->setChecked(m_pref->isAutosaveEnabled());
+ m_minuteFld->setValue(m_pref->getAutosavePeriod());
+ m_minuteFld->setEnabled(m_pref->isAutosaveEnabled());
+ replaceAfterSaveLevelAsCB->setChecked(
+ m_pref->isReplaceAfterSaveLevelAsEnabled());
+
+ QStringList dragCellsBehaviourList;
+ dragCellsBehaviourList << tr("Cells Only") << tr("Cells and Column Data");
+ m_cellsDragBehaviour->addItems(dragCellsBehaviourList);
+ m_cellsDragBehaviour->setCurrentIndex(m_pref->getDragCellsBehaviour());
+ m_levelsBackup->setChecked(m_pref->isLevelsBackupEnabled());
+ sceneNumberingCB->setChecked(m_pref->isSceneNumberingEnabled());
+
+ //--- Interface ------------------------------
+ QStringList styleSheetList;
+ for (int i = 0; i < m_pref->getStyleSheetCount(); i++) {
+ QString string = m_pref->getStyleSheet(i);
+ if (string == m_pref->getCurrentStyleSheet()) currentIndex = i;
+ TFilePath path(string.toStdWString());
+ styleSheetList.push_back(QString::fromStdWString(path.getWideName()));
+ }
+ styleSheetType->addItems(styleSheetList);
+ styleSheetType->setCurrentIndex(currentIndex);
+
+ QStringList type;
- type << tr("cm") << tr("mm") << tr("inch") << tr("field");
++ type << tr("cm") << tr("mm") << tr("inch") << tr("field") << tr("pixel");
+ unitOm->addItems(type);
+ int idx =
+ std::find(::units, ::units + ::unitsCount, m_pref->getUnits()) - ::units;
+ unitOm->setCurrentIndex((idx < ::unitsCount) ? idx : ::inchIdx);
+ cameraUnitOm->addItems(type);
+
+ idx = std::find(::units, ::units + ::unitsCount, m_pref->getCameraUnits()) -
+ ::units;
+ cameraUnitOm->setCurrentIndex((idx < ::unitsCount) ? idx : ::inchIdx);
+
+ QStringList roomList;
+ int currentRoomIndex = 0;
+ for (int i = 0; i < m_pref->getRoomChoiceCount(); i++) {
+ QString string = m_pref->getRoomChoice(i);
+ if (string == m_pref->getCurrentRoomChoice()) currentRoomIndex = i;
+ roomList.push_back(string);
+ }
+
+ if (roomList.size() > 1) {
+ roomChoice->addItems(roomList);
+ roomChoice->setCurrentIndex(currentRoomIndex);
+ }
+
+ m_iconSizeLx->setValue(m_pref->getIconSize().lx);
+ m_iconSizeLy->setValue(m_pref->getIconSize().ly);
+ int shrink, step;
+ m_pref->getViewValues(shrink, step);
+ m_viewShrink->setValue(shrink);
+ m_viewStep->setValue(step);
+ moveCurrentFrameCB->setChecked(m_pref->isMoveCurrentEnabled());
+ openFlipbookAfterCB->setChecked(m_pref->isGeneratedMovieViewEnabled());
+ actualPixelOnSceneModeCB->setChecked(
+ m_pref->isActualPixelViewOnSceneEditingModeEnabled());
+ levelNameOnEachMarkerCB->setChecked(m_pref->isLevelNameOnEachMarkerEnabled());
+ showRasterImageDarkenBlendedInViewerCB->setChecked(
+ m_pref->isShowRasterImagesDarkenBlendedInViewerEnabled());
+ showShowFrameNumberWithLettersCB->setChecked(
+ m_pref->isShowFrameNumberWithLettersEnabled());
+ QStringList zoomCenters;
+ zoomCenters << tr("Mouse Cursor") << tr("Viewer Center");
+ viewerZoomCenterComboBox->addItems(zoomCenters);
+ viewerZoomCenterComboBox->setCurrentIndex(m_pref->getViewerZoomCenter());
+
+ //--- Visualization ------------------------------
+ show0ThickLinesCB->setChecked(m_pref->getShow0ThickLines());
+ regionAntialiasCB->setChecked(m_pref->getRegionAntialias());
+
+ //--- Loading ------------------------------
+ exposeLoadedLevelsCB->setChecked(m_pref->isAutoExposeEnabled());
+ QStringList behaviors;
+ behaviors << tr("On Demand") << tr("All Icons") << tr("All Icons & Images");
+ initialLoadTlvCachingBehaviorComboBox->addItems(behaviors);
+ initialLoadTlvCachingBehaviorComboBox->setCurrentIndex(
+ m_pref->getInitialLoadTlvCachingBehavior());
+ QStringList formats;
+ formats << tr("At Once") << tr("On Demand");
+ m_columnIconOm->addItems(formats);
+ if (m_pref->getColumnIconLoadingPolicy() == Preferences::LoadAtOnce)
+ m_columnIconOm->setCurrentIndex(m_columnIconOm->findText(tr("At Once")));
+ else
+ m_columnIconOm->setCurrentIndex(m_columnIconOm->findText(tr("On Demand")));
+ removeSceneNumberFromLoadedLevelNameCB->setChecked(
+ m_pref->isRemoveSceneNumberFromLoadedLevelNameEnabled());
+ createSubfolderCB->setChecked(m_pref->isSubsceneFolderEnabled());
+
+ m_addLevelFormat->setFixedSize(20, 20);
+ m_removeLevelFormat->setFixedSize(20, 20);
+
+ rebuildFormatsList();
+
+ QStringList paletteTypes;
+ paletteTypes << tr("Pick Every Colors as Different Styles")
+ << tr("Integrate Similar Colors as One Style");
+ paletteTypeForRasterColorModelComboBox->addItems(paletteTypes);
+ paletteTypeForRasterColorModelComboBox->setCurrentIndex(
+ m_pref->getPaletteTypeOnLoadRasterImageAsColorModel());
+
+ //--- Drawing ------------------------------
+ keepOriginalCleanedUpCB->setChecked(m_pref->isSaveUnpaintedInCleanupEnable());
+ multiLayerStylePickerCB->setChecked(m_pref->isMultiLayerStylePickerEnabled());
+ minimizeSaveboxAfterEditingCB->setChecked(
+ m_pref->isMinimizeSaveboxAfterEditing());
+ useSaveboxToLimitFillingOpCB->setChecked(m_pref->getFillOnlySavebox());
+
+ QStringList scanLevelTypes;
+ scanLevelTypes << "tif"
+ << "png";
+ m_defScanLevelType->addItems(scanLevelTypes);
+ m_defScanLevelType->setCurrentIndex(
+ m_defScanLevelType->findText(m_pref->getScanLevelType()));
+ QStringList levelTypes;
+ m_defLevelType->addItem(("Toonz Vector Level"), PLI_XSHLEVEL);
+ m_defLevelType->addItem(("Toonz Raster Level"), TZP_XSHLEVEL);
+ m_defLevelType->addItem(("Raster Level"), OVL_XSHLEVEL);
+ m_defLevelType->setCurrentIndex(0);
+
+ for (int i = 0; i < m_defLevelType->count(); i++) {
+ if (m_defLevelType->itemData(i).toInt() == m_pref->getDefLevelType()) {
+ m_defLevelType->setCurrentIndex(i);
+ onDefLevelTypeChanged(i);
+ break;
+ }
+ }
+
- m_defLevelWidth->setRange(0.1, (std::numeric_limits<double>::max)());
- m_defLevelWidth->setMeasure("level.lx");
- m_defLevelWidth->setValue(m_pref->getDefLevelWidth());
- m_defLevelHeight->setRange(0.1, (std::numeric_limits<double>::max)());
- m_defLevelHeight->setMeasure("level.ly");
- m_defLevelHeight->setValue(m_pref->getDefLevelHeight());
++ if (Preferences::instance()->getUnits() == "pixel") {
+ m_defLevelWidth->setRange(0.1, (std::numeric_limits<double>::max)());
+ m_defLevelWidth->setMeasure("camera.lx");
+ m_defLevelWidth->setValue(m_pref->getDefLevelWidth());
+ m_defLevelHeight->setRange(0.1, (std::numeric_limits<double>::max)());
+ m_defLevelHeight->setMeasure("camera.ly");
+ m_defLevelHeight->setValue(m_pref->getDefLevelHeight());
- }
- else
- {
++ } else {
+ m_defLevelWidth->setRange(0.1, (std::numeric_limits<double>::max)());
+ m_defLevelWidth->setMeasure("level.lx");
+ m_defLevelWidth->setValue(m_pref->getDefLevelWidth());
+ m_defLevelHeight->setRange(0.1, (std::numeric_limits<double>::max)());
+ m_defLevelHeight->setMeasure("level.ly");
+ m_defLevelHeight->setValue(m_pref->getDefLevelHeight());
+ }
- m_defLevelDpi->setRange(0.1, (std::numeric_limits<double>::max)());
- m_defLevelDpi->setValue(m_pref->getDefLevelDpi());
- QStringList autocreationTypes;
- autocreationTypes << tr("Disabled")
- << tr("Enabled")
- << tr("Use Xsheet as Animation Sheet");
- m_autocreationType->addItems(autocreationTypes);
- int autocreationType = m_pref->getAutocreationType();
- m_autocreationType->setCurrentIndex(autocreationType);
-
- //--- Xsheet ------------------------------
- xsheetAutopanDuringPlaybackCB->setChecked(m_pref->isXsheetAutopanEnabled());
- m_cellsDragBehaviour->addItem(tr("Cells Only"));
- m_cellsDragBehaviour->addItem(tr("Cells and Column Data"));
- m_cellsDragBehaviour->setCurrentIndex(m_pref->getDragCellsBehaviour());
- ignoreAlphaonColumn1CB->setChecked(m_pref->isIgnoreAlphaonColumn1Enabled());
- showKeyframesOnCellAreaCB->setChecked(m_pref->isShowKeyframesOnXsheetCellAreaEnabled());
-
- //--- Animation ------------------------------
- QStringList list;
- list << tr("Linear") << tr("Speed In / Speed Out") << tr("Ease In / Ease Out") << tr("Ease In / Ease Out %");
- m_keyframeType->addItems(list);
- int keyframeType = m_pref->getKeyframeType();
- m_keyframeType->setCurrentIndex(keyframeType - 2);
- m_animationStepField->setValue(m_pref->getAnimationStep());
-
- //--- Preview ------------------------------
- int blanksCount;
- TPixel32 blankColor;
- m_pref->getBlankValues(blanksCount, blankColor);
- m_blanksCount->setValue(blanksCount);
- m_blankColor->setColor(blankColor);
-
- rewindAfterPlaybackCB->setChecked(m_pref->rewindAfterPlaybackEnabled());
- displayInNewFlipBookCB->setChecked(m_pref->previewAlwaysOpenNewFlipEnabled());
- fitToFlipbookCB->setChecked(m_pref->fitToFlipbookEnabled());
-
- //--- Onion Skin ------------------------------
- m_onionSkinVisibility->setChecked(m_pref->isOnionSkinEnabled());
- m_frontOnionColor->setEnabled(m_pref->isOnionSkinEnabled());
- m_backOnionColor->setEnabled(m_pref->isOnionSkinEnabled());
- m_inksOnly->setEnabled(m_pref->isOnionSkinEnabled());
-
- //--- Version Control ------------------------------
- m_enableVersionControl->setChecked(m_pref->isSVNEnabled());
- autoRefreshFolderContentsCB->setChecked(m_pref->isAutomaticSVNFolderRefreshEnabled());
-
- /*--- layout ---*/
-
- QHBoxLayout *mainLayout = new QHBoxLayout();
- mainLayout->setMargin(0);
- mainLayout->setSpacing(0);
- {
- //Category
- QVBoxLayout *categoryLayout = new QVBoxLayout();
- categoryLayout->setMargin(5);
- categoryLayout->setSpacing(10);
- {
- categoryLayout->addWidget(new QLabel(tr("Category"), this), 0, Qt::AlignLeft | Qt::AlignVCenter);
- categoryLayout->addWidget(categoryList, 1);
- }
- mainLayout->addLayout(categoryLayout, 0);
-
- //--- General --------------------------
- QWidget *generalBox = new QWidget(this);
- QVBoxLayout *generalFrameLay = new QVBoxLayout();
- generalFrameLay->setMargin(15);
- generalFrameLay->setSpacing(10);
- {
- generalFrameLay->addWidget(useDefaultViewerCB, 0, Qt::AlignLeft | Qt::AlignVCenter);
- generalFrameLay->addWidget(minimizeRasterMemoryCB, 0, Qt::AlignLeft | Qt::AlignVCenter);
- QHBoxLayout *saveAutoLay = new QHBoxLayout();
- saveAutoLay->setMargin(0);
- saveAutoLay->setSpacing(15);
- {
- saveAutoLay->addWidget(autoSaveCB, 0);
- saveAutoLay->addWidget(m_minuteFld, 0);
- saveAutoLay->addStretch(1);
- }
- generalFrameLay->addLayout(saveAutoLay, 0);
-
- //Unit, CameraUnit
- QGridLayout *unitLay = new QGridLayout();
- unitLay->setMargin(0);
- unitLay->setHorizontalSpacing(5);
- unitLay->setVerticalSpacing(10);
- {
- unitLay->addWidget(new QLabel(tr("Undo Memory Size (MB)"), this), 0, 0, Qt::AlignRight | Qt::AlignVCenter);
- unitLay->addWidget(m_undoMemorySize, 0, 1);
-
- unitLay->addWidget(new QLabel(tr("Render Task Chunk Size:"), this), 1, 0, Qt::AlignRight | Qt::AlignVCenter);
- unitLay->addWidget(m_chunkSizeFld, 1, 1);
- }
- unitLay->setColumnStretch(0, 0);
- unitLay->setColumnStretch(1, 0);
- unitLay->setColumnStretch(2, 1);
-
- generalFrameLay->addLayout(unitLay, 0);
-
- generalFrameLay->addWidget(replaceAfterSaveLevelAsCB, 0, Qt::AlignLeft | Qt::AlignVCenter);
- generalFrameLay->addWidget(m_levelsBackup, 0, Qt::AlignLeft | Qt::AlignVCenter);
- generalFrameLay->addWidget(sceneNumberingCB, 0, Qt::AlignLeft | Qt::AlignVCenter);
- generalFrameLay->addStretch(1);
-
- generalFrameLay->addWidget(note_general, 0);
- }
- generalBox->setLayout(generalFrameLay);
- stackedWidget->addWidget(generalBox);
-
- //--- Interface --------------------------
- QWidget *userInterfaceBox = new QWidget(this);
- QVBoxLayout *userInterfaceFrameLay = new QVBoxLayout();
- userInterfaceFrameLay->setMargin(15);
- userInterfaceFrameLay->setSpacing(10);
- {
- QGridLayout *styleLay = new QGridLayout();
- styleLay->setMargin(0);
- styleLay->setHorizontalSpacing(5);
- styleLay->setVerticalSpacing(10);
- {
- styleLay->addWidget(new QLabel(tr("Style:")), 0, 0, Qt::AlignRight | Qt::AlignVCenter);
- styleLay->addWidget(styleSheetType, 0, 1);
-
- styleLay->addWidget(new QLabel(tr("Unit:"), this), 1, 0, Qt::AlignRight | Qt::AlignVCenter);
- styleLay->addWidget(unitOm, 1, 1);
-
- styleLay->addWidget(new QLabel(tr("Camera Unit:"), this), 2, 0, Qt::AlignRight | Qt::AlignVCenter);
- styleLay->addWidget(cameraUnitOm, 2, 1);
-
- styleLay->addWidget(new QLabel(tr("Rooms *:"), this), 3, 0, Qt::AlignRight | Qt::AlignVCenter);
- styleLay->addWidget(roomChoice, 3, 1);
- }
- styleLay->setColumnStretch(0, 0);
- styleLay->setColumnStretch(1, 0);
- styleLay->setColumnStretch(2, 1);
- userInterfaceFrameLay->addLayout(styleLay, 0);
-
- userInterfaceFrameLay->addWidget(openFlipbookAfterCB, 0, Qt::AlignLeft | Qt::AlignVCenter);
- userInterfaceFrameLay->addWidget(moveCurrentFrameCB, 0, Qt::AlignLeft | Qt::AlignVCenter);
- userInterfaceFrameLay->addWidget(actualPixelOnSceneModeCB, 0, Qt::AlignLeft | Qt::AlignVCenter);
- userInterfaceFrameLay->addWidget(levelNameOnEachMarkerCB, 0, Qt::AlignLeft | Qt::AlignVCenter);
- userInterfaceFrameLay->addWidget(showRasterImageDarkenBlendedInViewerCB, 0, Qt::AlignLeft | Qt::AlignVCenter);
- userInterfaceFrameLay->addWidget(showShowFrameNumberWithLettersCB, 0, Qt::AlignLeft | Qt::AlignVCenter);
-
- QGridLayout *bgColorsLay = new QGridLayout();
- bgColorsLay->setMargin(0);
- bgColorsLay->setHorizontalSpacing(5);
- bgColorsLay->setVerticalSpacing(10);
- {
- bgColorsLay->addWidget(new QLabel(tr("Icon Size *"), this), 0, 0, Qt::AlignRight | Qt::AlignVCenter);
- bgColorsLay->addWidget(m_iconSizeLx, 0, 1);
- bgColorsLay->addWidget(new QLabel(tr("X"), this), 0, 2, Qt::AlignCenter);
- bgColorsLay->addWidget(m_iconSizeLy, 0, 3);
-
- bgColorsLay->addWidget(new QLabel(tr("Viewer Shrink"), this), 1, 0, Qt::AlignRight | Qt::AlignVCenter);
- bgColorsLay->addWidget(m_viewShrink, 1, 1);
- bgColorsLay->addWidget(new QLabel(tr("Step"), this), 1, 3, Qt::AlignRight | Qt::AlignVCenter);
- bgColorsLay->addWidget(m_viewStep, 1, 4);
-
- bgColorsLay->addWidget(new QLabel(tr("Viewer BG Color"), this), 2, 0, Qt::AlignRight | Qt::AlignVCenter);
- bgColorsLay->addWidget(m_viewerBgColorFld, 2, 1, 1, 5);
-
- bgColorsLay->addWidget(new QLabel(tr("Preview BG Color"), this), 3, 0, Qt::AlignRight | Qt::AlignVCenter);
- bgColorsLay->addWidget(m_previewBgColorFld, 3, 1, 1, 5);
-
- bgColorsLay->addWidget(new QLabel(tr("ChessBoard Color 1"), this), 4, 0, Qt::AlignRight | Qt::AlignVCenter);
- bgColorsLay->addWidget(m_chessboardColor1Fld, 4, 1, 1, 5);
-
- bgColorsLay->addWidget(new QLabel(tr("Chessboard Color 2"), this), 5, 0, Qt::AlignRight | Qt::AlignVCenter);
- bgColorsLay->addWidget(m_chessboardColor2Fld, 5, 1, 1, 5);
-
- bgColorsLay->addWidget(new QLabel(tr("Viewer Zoom Center"), this), 6, 0, Qt::AlignRight | Qt::AlignVCenter);
- bgColorsLay->addWidget(viewerZoomCenterComboBox, 6, 1, 1, 4);
-
- if (languageType) {
- bgColorsLay->addWidget(new QLabel(tr("Language *:")), 7, 0, Qt::AlignRight | Qt::AlignVCenter);
- bgColorsLay->addWidget(languageType, 7, 1, 1, 4);
- }
- }
- bgColorsLay->setColumnStretch(0, 0);
- bgColorsLay->setColumnStretch(1, 0);
- bgColorsLay->setColumnStretch(2, 0);
- bgColorsLay->setColumnStretch(3, 0);
- bgColorsLay->setColumnStretch(4, 0);
- bgColorsLay->setColumnStretch(5, 1);
- userInterfaceFrameLay->addLayout(bgColorsLay, 0);
-
- userInterfaceFrameLay->addStretch(1);
-
- userInterfaceFrameLay->addWidget(note_interface, 0);
- }
- userInterfaceBox->setLayout(userInterfaceFrameLay);
- stackedWidget->addWidget(userInterfaceBox);
-
- //--- Visualization ---------------------
- QWidget *visualizatonBox = new QWidget(this);
- QVBoxLayout *visualizatonFrameLay = new QVBoxLayout();
- visualizatonFrameLay->setMargin(15);
- visualizatonFrameLay->setSpacing(10);
- {
- visualizatonFrameLay->addWidget(show0ThickLinesCB, 0);
- visualizatonFrameLay->addWidget(regionAntialiasCB, 0);
- visualizatonFrameLay->addStretch(1);
- }
- visualizatonBox->setLayout(visualizatonFrameLay);
- stackedWidget->addWidget(visualizatonBox);
-
- //--- Loading --------------------------
- QWidget *loadingBox = new QWidget(this);
- QVBoxLayout *loadingFrameLay = new QVBoxLayout();
- loadingFrameLay->setMargin(15);
- loadingFrameLay->setSpacing(10);
- {
- loadingFrameLay->addWidget(exposeLoadedLevelsCB, 0, Qt::AlignLeft | Qt::AlignVCenter);
- loadingFrameLay->addWidget(createSubfolderCB, 0, Qt::AlignLeft | Qt::AlignVCenter);
- loadingFrameLay->addWidget(removeSceneNumberFromLoadedLevelNameCB, 0, Qt::AlignLeft | Qt::AlignVCenter);
-
- QGridLayout *cacheLay = new QGridLayout();
- cacheLay->setMargin(0);
- cacheLay->setHorizontalSpacing(5);
- cacheLay->setVerticalSpacing(10);
- {
- cacheLay->addWidget(new QLabel(tr("Default TLV Caching Behavior")), 0, 0, Qt::AlignRight | Qt::AlignVCenter);
- cacheLay->addWidget(initialLoadTlvCachingBehaviorComboBox, 0, 1);
-
- cacheLay->addWidget(new QLabel(tr("Column Icon"), this), 1, 0, Qt::AlignRight | Qt::AlignVCenter);
- cacheLay->addWidget(m_columnIconOm, 1, 1);
-
- cacheLay->addWidget(new QLabel(tr("Level Settings by File Format:")), 2, 0, Qt::AlignRight | Qt::AlignVCenter);
- cacheLay->addWidget(m_levelFormatNames, 2, 1);
- cacheLay->addWidget(m_addLevelFormat, 2, 2);
- cacheLay->addWidget(m_removeLevelFormat, 2, 3);
- cacheLay->addWidget(m_editLevelFormat, 2, 4);
-
- cacheLay->addWidget(new QLabel(tr("Palette Type on Loading Raster Image as Color Model")), 3, 0, Qt::AlignRight | Qt::AlignVCenter);
- cacheLay->addWidget(paletteTypeForRasterColorModelComboBox, 3, 1, 1, 5);
- }
- cacheLay->setColumnStretch(0, 0);
- cacheLay->setColumnStretch(1, 0);
- cacheLay->setColumnStretch(2, 0);
- cacheLay->setColumnStretch(3, 0);
- cacheLay->setColumnStretch(4, 0);
- cacheLay->setColumnStretch(5, 1);
- loadingFrameLay->addLayout(cacheLay, 0);
-
- loadingFrameLay->addStretch(1);
- }
- loadingBox->setLayout(loadingFrameLay);
- stackedWidget->addWidget(loadingBox);
-
- //--- Drawing --------------------------
- QWidget *drawingBox = new QWidget(this);
- QVBoxLayout *drawingFrameLay = new QVBoxLayout();
- drawingFrameLay->setMargin(15);
- drawingFrameLay->setSpacing(10);
- {
- QGridLayout *drawingTopLay = new QGridLayout();
- drawingTopLay->setVerticalSpacing(10);
- drawingTopLay->setHorizontalSpacing(15);
- drawingTopLay->setMargin(0);
- {
- drawingTopLay->addWidget(new QLabel(tr("Scan File Format:")), 0, 0, Qt::AlignRight);
- drawingTopLay->addWidget(m_defScanLevelType, 0, 1, 1, 3);
-
- drawingTopLay->addWidget(new QLabel(tr("Default Level Type:")), 1, 0, Qt::AlignRight);
- drawingTopLay->addWidget(m_defLevelType, 1, 1, 1, 3);
-
- drawingTopLay->addWidget(new QLabel(tr("Width:")), 2, 0, Qt::AlignRight);
- drawingTopLay->addWidget(m_defLevelWidth, 2, 1);
- drawingTopLay->addWidget(new QLabel(tr(" Height:")), 2, 2, Qt::AlignRight);
- drawingTopLay->addWidget(m_defLevelHeight, 2, 3);
-
- drawingTopLay->addWidget(new QLabel(tr("DPI:")), 3, 0, Qt::AlignRight);
- drawingTopLay->addWidget(m_defLevelDpi, 3, 1);
-
- drawingTopLay->addWidget(new QLabel(tr("Autocreation:")), 4, 0, Qt::AlignRight);
- drawingTopLay->addWidget(m_autocreationType, 4, 1, 1, 3);
- }
- drawingFrameLay->addLayout(drawingTopLay, 0);
-
- drawingFrameLay->addWidget(keepOriginalCleanedUpCB, 0, Qt::AlignLeft | Qt::AlignVCenter);
- drawingFrameLay->addWidget(minimizeSaveboxAfterEditingCB, 0, Qt::AlignLeft | Qt::AlignVCenter); //6.4
- drawingFrameLay->addWidget(useSaveboxToLimitFillingOpCB, 0, Qt::AlignLeft | Qt::AlignVCenter);
- drawingFrameLay->addWidget(multiLayerStylePickerCB, 0, Qt::AlignLeft | Qt::AlignVCenter);
- drawingFrameLay->addStretch(1);
- }
- drawingBox->setLayout(drawingFrameLay);
- stackedWidget->addWidget(drawingBox);
-
- //--- Xsheet --------------------------
- QWidget *xsheetBox = new QWidget(this);
- QGridLayout *xsheetFrameLay = new QGridLayout();
- xsheetFrameLay->setMargin(15);
- xsheetFrameLay->setHorizontalSpacing(15);
- xsheetFrameLay->setVerticalSpacing(10);
- {
- xsheetFrameLay->addWidget(new QLabel(tr("Next/Previous Step Frames:")), 0, 0, Qt::AlignRight | Qt::AlignVCenter);
- xsheetFrameLay->addWidget(m_xsheetStep, 0, 1);
-
- xsheetFrameLay->addWidget(xsheetAutopanDuringPlaybackCB, 1, 0, 1, 2);
-
- xsheetFrameLay->addWidget(new QLabel(tr("Cell-dragging Behaviour:")), 2, 0, Qt::AlignRight | Qt::AlignVCenter);
- xsheetFrameLay->addWidget(m_cellsDragBehaviour, 2, 1);
-
- xsheetFrameLay->addWidget(ignoreAlphaonColumn1CB, 3, 0, 1, 2);
- xsheetFrameLay->addWidget(showKeyframesOnCellAreaCB, 4, 0, 1, 2);
- }
- xsheetFrameLay->setColumnStretch(0, 0);
- xsheetFrameLay->setColumnStretch(1, 0);
- xsheetFrameLay->setColumnStretch(2, 1);
- xsheetFrameLay->setRowStretch(5, 1);
- xsheetBox->setLayout(xsheetFrameLay);
- stackedWidget->addWidget(xsheetBox);
-
- //--- Animation --------------------------
- QWidget *animationBox = new QWidget(this);
- QGridLayout *animationFrameLay = new QGridLayout();
- animationFrameLay->setMargin(15);
- animationFrameLay->setHorizontalSpacing(15);
- animationFrameLay->setVerticalSpacing(10);
- {
- animationFrameLay->addWidget(new QLabel(tr("Default Interpolation:")), 0, 0, Qt::AlignRight | Qt::AlignVCenter);
- animationFrameLay->addWidget(m_keyframeType, 0, 1);
-
- animationFrameLay->addWidget(new QLabel(tr("Animation Step:")), 1, 0, Qt::AlignRight | Qt::AlignVCenter);
- animationFrameLay->addWidget(m_animationStepField, 1, 1);
- }
- animationFrameLay->setColumnStretch(0, 0);
- animationFrameLay->setColumnStretch(1, 0);
- animationFrameLay->setColumnStretch(2, 1);
- animationFrameLay->setRowStretch(0, 0);
- animationFrameLay->setRowStretch(1, 0);
- animationFrameLay->setRowStretch(2, 1);
- animationBox->setLayout(animationFrameLay);
- stackedWidget->addWidget(animationBox);
-
- //--- Preview --------------------------
- QWidget *previewBox = new QWidget(this);
- QGridLayout *previewLayout = new QGridLayout();
- previewLayout->setMargin(15);
- previewLayout->setHorizontalSpacing(15);
- previewLayout->setVerticalSpacing(10);
- {
- previewLayout->addWidget(new QLabel(tr("Blank Frames:")), 0, 0, Qt::AlignRight | Qt::AlignVCenter);
- previewLayout->addWidget(m_blanksCount, 0, 1);
-
- previewLayout->addWidget(new QLabel(tr("Blank Frames Color:")), 1, 0, Qt::AlignRight | Qt::AlignVCenter);
- previewLayout->addWidget(m_blankColor, 1, 1, 1, 2);
-
- previewLayout->addWidget(rewindAfterPlaybackCB, 2, 0, 1, 3, Qt::AlignLeft | Qt::AlignVCenter);
- previewLayout->addWidget(displayInNewFlipBookCB, 3, 0, 1, 3, Qt::AlignLeft | Qt::AlignVCenter);
- previewLayout->addWidget(fitToFlipbookCB, 4, 0, 1, 3, Qt::AlignLeft | Qt::AlignVCenter);
- }
- previewLayout->setColumnStretch(0, 0);
- previewLayout->setColumnStretch(1, 0);
- previewLayout->setColumnStretch(2, 1);
- previewLayout->setRowStretch(0, 0);
- previewLayout->setRowStretch(1, 0);
- previewLayout->setRowStretch(2, 0);
- previewLayout->setRowStretch(3, 0);
- previewLayout->setRowStretch(4, 0);
- previewLayout->setRowStretch(5, 1);
- previewBox->setLayout(previewLayout);
- stackedWidget->addWidget(previewBox);
-
- //--- Onion Skin --------------------------
- QWidget *onionBox = new QWidget(this);
- QVBoxLayout *onionLay = new QVBoxLayout();
- onionLay->setMargin(15);
- onionLay->setSpacing(10);
- {
- onionLay->addWidget(m_onionSkinVisibility, 0, Qt::AlignLeft | Qt::AlignVCenter);
- QGridLayout *onionColorLay = new QGridLayout();
- {
- onionColorLay->addWidget(new QLabel(tr("Paper Thickness:")), 0, 0, Qt::AlignRight | Qt::AlignVCenter);
- onionColorLay->addWidget(m_onionPaperThickness, 0, 1);
-
- onionColorLay->addWidget(new QLabel(tr("Previous Frames Correction:")), 1, 0, Qt::AlignRight | Qt::AlignVCenter);
- onionColorLay->addWidget(m_backOnionColor, 1, 1);
-
- onionColorLay->addWidget(new QLabel(tr("Following Frames Correction:")), 2, 0, Qt::AlignRight | Qt::AlignVCenter);
- onionColorLay->addWidget(m_frontOnionColor, 2, 1);
- }
- onionColorLay->setColumnStretch(0, 0);
- onionColorLay->setColumnStretch(1, 0);
- onionColorLay->setColumnStretch(2, 1);
- onionLay->addLayout(onionColorLay, 0);
-
- onionLay->addWidget(m_inksOnly, 0, Qt::AlignLeft | Qt::AlignVCenter);
-
- onionLay->addStretch(1);
- }
- onionBox->setLayout(onionLay);
- stackedWidget->addWidget(onionBox);
-
- //--- Transparency Check --------------------------
- QWidget *tcBox = new QWidget(this);
- QGridLayout *tcLay = new QGridLayout();
- tcLay->setMargin(15);
- tcLay->setHorizontalSpacing(10);
- tcLay->setVerticalSpacing(10);
- {
- tcLay->addWidget(new QLabel(tr("Ink Color on White Bg:")), 0, 0, Qt::AlignRight);
- tcLay->addWidget(m_transpCheckInkColor, 0, 1);
-
- tcLay->addWidget(new QLabel(tr("Ink Color on Black Bg:")), 1, 0, Qt::AlignRight);
- tcLay->addWidget(m_transpCheckBgColor, 1, 1);
-
- tcLay->addWidget(new QLabel(tr("Paint Color:")), 2, 0, Qt::AlignRight);
- tcLay->addWidget(m_transpCheckPaintColor, 2, 1);
- }
- tcLay->setColumnStretch(0, 0);
- tcLay->setColumnStretch(1, 0);
- tcLay->setColumnStretch(2, 1);
- tcLay->setRowStretch(0, 0);
- tcLay->setRowStretch(1, 0);
- tcLay->setRowStretch(2, 0);
- tcLay->setRowStretch(3, 1);
- tcBox->setLayout(tcLay);
- stackedWidget->addWidget(tcBox);
-
- //--- Version Control --------------------------
- QWidget *versionControlBox = new QWidget(this);
- QVBoxLayout *vcLay = new QVBoxLayout();
- vcLay->setMargin(15);
- vcLay->setSpacing(10);
- {
- vcLay->addWidget(m_enableVersionControl, 0, Qt::AlignLeft | Qt::AlignVCenter);
- vcLay->addWidget(autoRefreshFolderContentsCB, 0, Qt::AlignLeft | Qt::AlignVCenter);
-
- vcLay->addStretch(1);
-
- vcLay->addWidget(note_version, 0);
- }
- versionControlBox->setLayout(vcLay);
- stackedWidget->addWidget(versionControlBox);
-
- mainLayout->addWidget(stackedWidget, 1);
- }
- setLayout(mainLayout);
-
- /*---- signal-slot connections -----*/
-
- bool ret = true;
- ret = ret && connect(categoryList, SIGNAL(currentRowChanged(int)), stackedWidget, SLOT(setCurrentIndex(int)));
-
- //--- General ----------------------
- ret = ret && connect(useDefaultViewerCB, SIGNAL(stateChanged(int)), this, SLOT(onDefaultViewerChanged(int)));
- ret = ret && connect(minimizeRasterMemoryCB, SIGNAL(stateChanged(int)), this, SLOT(onRasterOptimizedMemoryChanged(int)));
- ret = ret && connect(autoSaveCB, SIGNAL(stateChanged(int)), SLOT(onAutoSaveChanged(int)));
- ret = ret && connect(m_minuteFld, SIGNAL(editingFinished()), SLOT(onMinuteChanged()));
- ret = ret && connect(m_cellsDragBehaviour, SIGNAL(currentIndexChanged(int)), SLOT(onDragCellsBehaviourChanged(int)));
- ret = ret && connect(m_undoMemorySize, SIGNAL(editingFinished()), SLOT(onUndoMemorySizeChanged()));
- ret = ret && connect(m_levelsBackup, SIGNAL(stateChanged(int)), SLOT(onLevelsBackupChanged(int)));
- ret = ret && connect(sceneNumberingCB, SIGNAL(stateChanged(int)), SLOT(onSceneNumberingChanged(int)));
- ret = ret && connect(m_chunkSizeFld, SIGNAL(editingFinished()), this, SLOT(onChunkSizeChanged()));
-
- //--- Interface ----------------------
- ret = ret && connect(styleSheetType, SIGNAL(currentIndexChanged(int)), SLOT(onStyleSheetTypeChanged(int)));
- ret = ret && connect(unitOm, SIGNAL(currentIndexChanged(int)), SLOT(onUnitChanged(int)));
- ret = ret && connect(cameraUnitOm, SIGNAL(currentIndexChanged(int)), SLOT(onCameraUnitChanged(int)));
- ret = ret && connect(roomChoice, SIGNAL(currentIndexChanged(int)), SLOT(onRoomChoiceChanged(int)));
- ret = ret && connect(openFlipbookAfterCB, SIGNAL(stateChanged(int)), this, SLOT(onViewGeneratedMovieChanged(int)));
- ret = ret && connect(m_iconSizeLx, SIGNAL(editingFinished()), SLOT(onIconSizeChanged()));
- ret = ret && connect(m_iconSizeLy, SIGNAL(editingFinished()), SLOT(onIconSizeChanged()));
- ret = ret && connect(m_viewShrink, SIGNAL(editingFinished()), SLOT(onViewValuesChanged()));
- ret = ret && connect(m_viewStep, SIGNAL(editingFinished()), SLOT(onViewValuesChanged()));
- if (languageList.size() > 1)
- ret = ret && connect(languageType, SIGNAL(currentIndexChanged(int)), SLOT(onLanguageTypeChanged(int)));
- ret = ret && connect(moveCurrentFrameCB, SIGNAL(stateChanged(int)), this, SLOT(onMoveCurrentFrameChanged(int)));
- ret = ret && connect(viewerZoomCenterComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onViewerZoomCenterChanged(int)));
- ret = ret && connect(replaceAfterSaveLevelAsCB, SIGNAL(stateChanged(int)), this, SLOT(onReplaceAfterSaveLevelAsChanged(int)));
- ret = ret && connect(showRasterImageDarkenBlendedInViewerCB, SIGNAL(stateChanged(int)), this, SLOT(onShowRasterImageDarkenBlendedInViewerChanged(int)));
- ret = ret && connect(showShowFrameNumberWithLettersCB, SIGNAL(stateChanged(int)), this, SLOT(onShowFrameNumberWithLettersChanged(int)));
- //Viewer BG color
- ret = ret && connect(m_viewerBgColorFld, SIGNAL(colorChanged(const TPixel32 &, bool)), this, SLOT(setViewerBgColor(const TPixel32 &, bool)));
- //Preview BG color
- ret = ret && connect(m_previewBgColorFld, SIGNAL(colorChanged(const TPixel32 &, bool)), this, SLOT(setPreviewBgColor(const TPixel32 &, bool)));
- //bg chessboard colors
- ret = ret && connect(m_chessboardColor1Fld, SIGNAL(colorChanged(const TPixel32 &, bool)), this, SLOT(setChessboardColor1(const TPixel32 &, bool)));
- ret = ret && connect(m_chessboardColor2Fld, SIGNAL(colorChanged(const TPixel32 &, bool)), this, SLOT(setChessboardColor2(const TPixel32 &, bool)));
- //Column Icon
- ret = ret && connect(m_columnIconOm, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(onColumnIconChange(const QString &)));
- ret = ret && connect(actualPixelOnSceneModeCB, SIGNAL(stateChanged(int)), SLOT(onActualPixelOnSceneModeChanged(int)));
- ret = ret && connect(levelNameOnEachMarkerCB, SIGNAL(stateChanged(int)), SLOT(onLevelNameOnEachMarkerChanged(int)));
-
- //--- Visualization ---------------------
- ret = ret && connect(show0ThickLinesCB, SIGNAL(stateChanged(int)), this, SLOT(onShow0ThickLinesChanged(int)));
- ret = ret && connect(regionAntialiasCB, SIGNAL(stateChanged(int)), this, SLOT(onRegionAntialiasChanged(int)));
-
- //--- Loading ----------------------
- ret = ret && connect(exposeLoadedLevelsCB, SIGNAL(stateChanged(int)), this, SLOT(onAutoExposeChanged(int)));
- ret = ret && connect(initialLoadTlvCachingBehaviorComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onInitialLoadTlvCachingBehaviorChanged(int)));
- ret = ret && connect(createSubfolderCB, SIGNAL(stateChanged(int)), this, SLOT(onSubsceneFolderChanged(int)));
- ret = ret && connect(removeSceneNumberFromLoadedLevelNameCB, SIGNAL(stateChanged(int)), this, SLOT(onRemoveSceneNumberFromLoadedLevelNameChanged(int)));
- ret = ret && connect(m_addLevelFormat, SIGNAL(clicked()), SLOT(onAddLevelFormat()));
- ret = ret && connect(m_removeLevelFormat, SIGNAL(clicked()), SLOT(onRemoveLevelFormat()));
- ret = ret && connect(m_editLevelFormat, SIGNAL(clicked()), SLOT(onEditLevelFormat()));
- ret = ret && connect(paletteTypeForRasterColorModelComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onPaletteTypeForRasterColorModelChanged(int)));
-
- //--- Drawing ----------------------
- ret = ret && connect(keepOriginalCleanedUpCB, SIGNAL(stateChanged(int)), this, SLOT(onSaveUnpaintedInCleanupChanged(int)));
- ret = ret && connect(multiLayerStylePickerCB, SIGNAL(stateChanged(int)), this, SLOT(onMultiLayerStylePickerChanged(int)));
- ret = ret && connect(useSaveboxToLimitFillingOpCB, SIGNAL(stateChanged(int)), this, SLOT(onGetFillOnlySavebox(int)));
- ret = ret && connect(m_defScanLevelType, SIGNAL(currentIndexChanged(const QString &)), SLOT(onScanLevelTypeChanged(const QString &)));
- ret = ret && connect(minimizeSaveboxAfterEditingCB, SIGNAL(stateChanged(int)), this, SLOT(onMinimizeSaveboxAfterEditing(int)));
- ret = ret && connect(m_defLevelType, SIGNAL(currentIndexChanged(int)), SLOT(onDefLevelTypeChanged(int)));
- ret = ret && connect(m_autocreationType, SIGNAL(currentIndexChanged(int)), SLOT(onAutocreationTypeChanged(int)));
- ret = ret && connect(m_defLevelWidth, SIGNAL(valueChanged()), SLOT(onDefLevelParameterChanged()));
- ret = ret && connect(m_defLevelHeight, SIGNAL(valueChanged()), SLOT(onDefLevelParameterChanged()));
- ret = ret && connect(m_defLevelDpi, SIGNAL(valueChanged()), SLOT(onDefLevelParameterChanged()));
-
- //--- Xsheet ----------------------
- ret = ret && connect(xsheetAutopanDuringPlaybackCB, SIGNAL(stateChanged(int)), this, SLOT(onXsheetAutopanChanged(int)));
- ret = ret && connect(ignoreAlphaonColumn1CB, SIGNAL(stateChanged(int)), this, SLOT(onIgnoreAlphaonColumn1Changed(int)));
- ret = ret && connect(m_xsheetStep, SIGNAL(editingFinished()), SLOT(onXsheetStepChanged()));
- ret = ret && connect(m_cellsDragBehaviour, SIGNAL(currentIndexChanged(int)), SLOT(onDragCellsBehaviourChanged(int)));
- ret = ret && connect(showKeyframesOnCellAreaCB, SIGNAL(stateChanged(int)), this, SLOT(onShowKeyframesOnCellAreaChanged(int)));
-
- //--- Animation ----------------------
- ret = ret && connect(m_keyframeType, SIGNAL(currentIndexChanged(int)), SLOT(onKeyframeTypeChanged(int)));
- ret = ret && connect(m_animationStepField, SIGNAL(editingFinished()), SLOT(onAnimationStepChanged()));
-
- //--- Preview ----------------------
- ret = ret && connect(m_blanksCount, SIGNAL(editingFinished()), SLOT(onBlankCountChanged()));
- ret = ret && connect(m_blankColor, SIGNAL(colorChanged(const TPixel32 &, bool)), SLOT(onBlankColorChanged(const TPixel32 &, bool)));
- ret = ret && connect(rewindAfterPlaybackCB, SIGNAL(stateChanged(int)), this, SLOT(onRewindAfterPlayback(int)));
- ret = ret && connect(displayInNewFlipBookCB, SIGNAL(stateChanged(int)), this, SLOT(onPreviewAlwaysOpenNewFlip(int)));
- ret = ret && connect(fitToFlipbookCB, SIGNAL(stateChanged(int)), this, SLOT(onFitToFlipbook(int)));
-
- //--- Onion Skin ----------------------
- ret = ret && connect(m_frontOnionColor, SIGNAL(colorChanged(const TPixel32 &, bool)), SLOT(onOnionDataChanged(const TPixel32 &, bool)));
- ret = ret && connect(m_backOnionColor, SIGNAL(colorChanged(const TPixel32 &, bool)), SLOT(onOnionDataChanged(const TPixel32 &, bool)));
- ret = ret && connect(m_inksOnly, SIGNAL(stateChanged(int)), SLOT(onOnionDataChanged(int)));
- ret = ret && connect(m_onionSkinVisibility, SIGNAL(stateChanged(int)), SLOT(onOnionSkinVisibilityChanged(int)));
- ret = ret && connect(m_onionPaperThickness, SIGNAL(editingFinished()), SLOT(onOnionPaperThicknessChanged()));
-
- //--- Transparency Check ----------------------
- ret = ret && connect(m_transpCheckBgColor, SIGNAL(colorChanged(const TPixel32 &, bool)), SLOT(onTranspCheckDataChanged(const TPixel32 &, bool)));
- ret = ret && connect(m_transpCheckInkColor, SIGNAL(colorChanged(const TPixel32 &, bool)), SLOT(onTranspCheckDataChanged(const TPixel32 &, bool)));
- ret = ret && connect(m_transpCheckPaintColor, SIGNAL(colorChanged(const TPixel32 &, bool)), SLOT(onTranspCheckDataChanged(const TPixel32 &, bool)));
-
- //--- Version Control ----------------------
- ret = ret && connect(m_enableVersionControl, SIGNAL(stateChanged(int)), SLOT(onSVNEnabledChanged(int)));
- ret = ret && connect(autoRefreshFolderContentsCB, SIGNAL(stateChanged(int)), SLOT(onAutomaticSVNRefreshChanged(int)));
-
- assert(ret);
+ m_defLevelDpi->setRange(0.1, (std::numeric_limits<double>::max)());
+ m_defLevelDpi->setValue(m_pref->getDefLevelDpi());
+ QStringList autocreationTypes;
+ autocreationTypes << tr("Disabled") << tr("Enabled")
+ << tr("Use Xsheet as Animation Sheet");
+ m_autocreationType->addItems(autocreationTypes);
+ int autocreationType = m_pref->getAutocreationType();
+ m_autocreationType->setCurrentIndex(autocreationType);
+
+ //--- Xsheet ------------------------------
+ xsheetAutopanDuringPlaybackCB->setChecked(m_pref->isXsheetAutopanEnabled());
+ m_cellsDragBehaviour->addItem(tr("Cells Only"));
+ m_cellsDragBehaviour->addItem(tr("Cells and Column Data"));
+ m_cellsDragBehaviour->setCurrentIndex(m_pref->getDragCellsBehaviour());
+ ignoreAlphaonColumn1CB->setChecked(m_pref->isIgnoreAlphaonColumn1Enabled());
+ showKeyframesOnCellAreaCB->setChecked(
+ m_pref->isShowKeyframesOnXsheetCellAreaEnabled());
+
+ //--- Animation ------------------------------
+ QStringList list;
+ list << tr("Linear") << tr("Speed In / Speed Out") << tr("Ease In / Ease Out")
+ << tr("Ease In / Ease Out %");
+ m_keyframeType->addItems(list);
+ int keyframeType = m_pref->getKeyframeType();
+ m_keyframeType->setCurrentIndex(keyframeType - 2);
+ m_animationStepField->setValue(m_pref->getAnimationStep());
+
+ //--- Preview ------------------------------
+ int blanksCount;
+ TPixel32 blankColor;
+ m_pref->getBlankValues(blanksCount, blankColor);
+ m_blanksCount->setValue(blanksCount);
+ m_blankColor->setColor(blankColor);
+
+ rewindAfterPlaybackCB->setChecked(m_pref->rewindAfterPlaybackEnabled());
+ displayInNewFlipBookCB->setChecked(m_pref->previewAlwaysOpenNewFlipEnabled());
+ fitToFlipbookCB->setChecked(m_pref->fitToFlipbookEnabled());
+
+ //--- Onion Skin ------------------------------
+ m_onionSkinVisibility->setChecked(m_pref->isOnionSkinEnabled());
+ m_frontOnionColor->setEnabled(m_pref->isOnionSkinEnabled());
+ m_backOnionColor->setEnabled(m_pref->isOnionSkinEnabled());
+ m_inksOnly->setEnabled(m_pref->isOnionSkinEnabled());
+
+ //--- Version Control ------------------------------
+ m_enableVersionControl->setChecked(m_pref->isSVNEnabled());
+ autoRefreshFolderContentsCB->setChecked(
+ m_pref->isAutomaticSVNFolderRefreshEnabled());
+
+ /*--- layout ---*/
+
+ QHBoxLayout *mainLayout = new QHBoxLayout();
+ mainLayout->setMargin(0);
+ mainLayout->setSpacing(0);
+ {
+ // Category
+ QVBoxLayout *categoryLayout = new QVBoxLayout();
+ categoryLayout->setMargin(5);
+ categoryLayout->setSpacing(10);
+ {
+ categoryLayout->addWidget(new QLabel(tr("Category"), this), 0,
+ Qt::AlignLeft | Qt::AlignVCenter);
+ categoryLayout->addWidget(categoryList, 1);
+ }
+ mainLayout->addLayout(categoryLayout, 0);
+
+ //--- General --------------------------
+ QWidget *generalBox = new QWidget(this);
+ QVBoxLayout *generalFrameLay = new QVBoxLayout();
+ generalFrameLay->setMargin(15);
+ generalFrameLay->setSpacing(10);
+ {
+ generalFrameLay->addWidget(useDefaultViewerCB, 0,
+ Qt::AlignLeft | Qt::AlignVCenter);
+ generalFrameLay->addWidget(minimizeRasterMemoryCB, 0,
+ Qt::AlignLeft | Qt::AlignVCenter);
+ QHBoxLayout *saveAutoLay = new QHBoxLayout();
+ saveAutoLay->setMargin(0);
+ saveAutoLay->setSpacing(15);
+ {
+ saveAutoLay->addWidget(autoSaveCB, 0);
+ saveAutoLay->addWidget(m_minuteFld, 0);
+ saveAutoLay->addStretch(1);
+ }
+ generalFrameLay->addLayout(saveAutoLay, 0);
+
+ // Unit, CameraUnit
+ QGridLayout *unitLay = new QGridLayout();
+ unitLay->setMargin(0);
+ unitLay->setHorizontalSpacing(5);
+ unitLay->setVerticalSpacing(10);
+ {
+ unitLay->addWidget(new QLabel(tr("Undo Memory Size (MB)"), this), 0, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ unitLay->addWidget(m_undoMemorySize, 0, 1);
+
+ unitLay->addWidget(new QLabel(tr("Render Task Chunk Size:"), this), 1,
+ 0, Qt::AlignRight | Qt::AlignVCenter);
+ unitLay->addWidget(m_chunkSizeFld, 1, 1);
+ }
+ unitLay->setColumnStretch(0, 0);
+ unitLay->setColumnStretch(1, 0);
+ unitLay->setColumnStretch(2, 1);
+
+ generalFrameLay->addLayout(unitLay, 0);
+
+ generalFrameLay->addWidget(replaceAfterSaveLevelAsCB, 0,
+ Qt::AlignLeft | Qt::AlignVCenter);
+ generalFrameLay->addWidget(m_levelsBackup, 0,
+ Qt::AlignLeft | Qt::AlignVCenter);
+ generalFrameLay->addWidget(sceneNumberingCB, 0,
+ Qt::AlignLeft | Qt::AlignVCenter);
+ generalFrameLay->addStretch(1);
+
+ generalFrameLay->addWidget(note_general, 0);
+ }
+ generalBox->setLayout(generalFrameLay);
+ stackedWidget->addWidget(generalBox);
+
+ //--- Interface --------------------------
+ QWidget *userInterfaceBox = new QWidget(this);
+ QVBoxLayout *userInterfaceFrameLay = new QVBoxLayout();
+ userInterfaceFrameLay->setMargin(15);
+ userInterfaceFrameLay->setSpacing(10);
+ {
+ QGridLayout *styleLay = new QGridLayout();
+ styleLay->setMargin(0);
+ styleLay->setHorizontalSpacing(5);
+ styleLay->setVerticalSpacing(10);
+ {
+ styleLay->addWidget(new QLabel(tr("Style:")), 0, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ styleLay->addWidget(styleSheetType, 0, 1);
+
+ styleLay->addWidget(new QLabel(tr("Unit:"), this), 1, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ styleLay->addWidget(unitOm, 1, 1);
+
+ styleLay->addWidget(new QLabel(tr("Camera Unit:"), this), 2, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ styleLay->addWidget(cameraUnitOm, 2, 1);
+
+ styleLay->addWidget(new QLabel(tr("Rooms *:"), this), 3, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ styleLay->addWidget(roomChoice, 3, 1);
+ }
+ styleLay->setColumnStretch(0, 0);
+ styleLay->setColumnStretch(1, 0);
+ styleLay->setColumnStretch(2, 1);
+ userInterfaceFrameLay->addLayout(styleLay, 0);
+
+ userInterfaceFrameLay->addWidget(openFlipbookAfterCB, 0,
+ Qt::AlignLeft | Qt::AlignVCenter);
+ userInterfaceFrameLay->addWidget(moveCurrentFrameCB, 0,
+ Qt::AlignLeft | Qt::AlignVCenter);
+ userInterfaceFrameLay->addWidget(actualPixelOnSceneModeCB, 0,
+ Qt::AlignLeft | Qt::AlignVCenter);
+ userInterfaceFrameLay->addWidget(levelNameOnEachMarkerCB, 0,
+ Qt::AlignLeft | Qt::AlignVCenter);
+ userInterfaceFrameLay->addWidget(showRasterImageDarkenBlendedInViewerCB,
+ 0, Qt::AlignLeft | Qt::AlignVCenter);
+ userInterfaceFrameLay->addWidget(showShowFrameNumberWithLettersCB, 0,
+ Qt::AlignLeft | Qt::AlignVCenter);
+
+ QGridLayout *bgColorsLay = new QGridLayout();
+ bgColorsLay->setMargin(0);
+ bgColorsLay->setHorizontalSpacing(5);
+ bgColorsLay->setVerticalSpacing(10);
+ {
+ bgColorsLay->addWidget(new QLabel(tr("Icon Size *"), this), 0, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ bgColorsLay->addWidget(m_iconSizeLx, 0, 1);
+ bgColorsLay->addWidget(new QLabel(tr("X"), this), 0, 2,
+ Qt::AlignCenter);
+ bgColorsLay->addWidget(m_iconSizeLy, 0, 3);
+
+ bgColorsLay->addWidget(new QLabel(tr("Viewer Shrink"), this), 1, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ bgColorsLay->addWidget(m_viewShrink, 1, 1);
+ bgColorsLay->addWidget(new QLabel(tr("Step"), this), 1, 3,
+ Qt::AlignRight | Qt::AlignVCenter);
+ bgColorsLay->addWidget(m_viewStep, 1, 4);
+
+ bgColorsLay->addWidget(new QLabel(tr("Viewer BG Color"), this), 2, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ bgColorsLay->addWidget(m_viewerBgColorFld, 2, 1, 1, 5);
+
+ bgColorsLay->addWidget(new QLabel(tr("Preview BG Color"), this), 3, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ bgColorsLay->addWidget(m_previewBgColorFld, 3, 1, 1, 5);
+
+ bgColorsLay->addWidget(new QLabel(tr("ChessBoard Color 1"), this), 4, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ bgColorsLay->addWidget(m_chessboardColor1Fld, 4, 1, 1, 5);
+
+ bgColorsLay->addWidget(new QLabel(tr("Chessboard Color 2"), this), 5, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ bgColorsLay->addWidget(m_chessboardColor2Fld, 5, 1, 1, 5);
+
+ bgColorsLay->addWidget(new QLabel(tr("Viewer Zoom Center"), this), 6, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ bgColorsLay->addWidget(viewerZoomCenterComboBox, 6, 1, 1, 4);
+
+ if (languageType) {
+ bgColorsLay->addWidget(new QLabel(tr("Language *:")), 7, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ bgColorsLay->addWidget(languageType, 7, 1, 1, 4);
+ }
+ }
+ bgColorsLay->setColumnStretch(0, 0);
+ bgColorsLay->setColumnStretch(1, 0);
+ bgColorsLay->setColumnStretch(2, 0);
+ bgColorsLay->setColumnStretch(3, 0);
+ bgColorsLay->setColumnStretch(4, 0);
+ bgColorsLay->setColumnStretch(5, 1);
+ userInterfaceFrameLay->addLayout(bgColorsLay, 0);
+
+ userInterfaceFrameLay->addStretch(1);
+
+ userInterfaceFrameLay->addWidget(note_interface, 0);
+ }
+ userInterfaceBox->setLayout(userInterfaceFrameLay);
+ stackedWidget->addWidget(userInterfaceBox);
+
+ //--- Visualization ---------------------
+ QWidget *visualizatonBox = new QWidget(this);
+ QVBoxLayout *visualizatonFrameLay = new QVBoxLayout();
+ visualizatonFrameLay->setMargin(15);
+ visualizatonFrameLay->setSpacing(10);
+ {
+ visualizatonFrameLay->addWidget(show0ThickLinesCB, 0);
+ visualizatonFrameLay->addWidget(regionAntialiasCB, 0);
+ visualizatonFrameLay->addStretch(1);
+ }
+ visualizatonBox->setLayout(visualizatonFrameLay);
+ stackedWidget->addWidget(visualizatonBox);
+
+ //--- Loading --------------------------
+ QWidget *loadingBox = new QWidget(this);
+ QVBoxLayout *loadingFrameLay = new QVBoxLayout();
+ loadingFrameLay->setMargin(15);
+ loadingFrameLay->setSpacing(10);
+ {
+ loadingFrameLay->addWidget(exposeLoadedLevelsCB, 0,
+ Qt::AlignLeft | Qt::AlignVCenter);
+ loadingFrameLay->addWidget(createSubfolderCB, 0,
+ Qt::AlignLeft | Qt::AlignVCenter);
+ loadingFrameLay->addWidget(removeSceneNumberFromLoadedLevelNameCB, 0,
+ Qt::AlignLeft | Qt::AlignVCenter);
+
+ QGridLayout *cacheLay = new QGridLayout();
+ cacheLay->setMargin(0);
+ cacheLay->setHorizontalSpacing(5);
+ cacheLay->setVerticalSpacing(10);
+ {
+ cacheLay->addWidget(new QLabel(tr("Default TLV Caching Behavior")), 0,
+ 0, Qt::AlignRight | Qt::AlignVCenter);
+ cacheLay->addWidget(initialLoadTlvCachingBehaviorComboBox, 0, 1);
+
+ cacheLay->addWidget(new QLabel(tr("Column Icon"), this), 1, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ cacheLay->addWidget(m_columnIconOm, 1, 1);
+
+ cacheLay->addWidget(new QLabel(tr("Level Settings by File Format:")), 2,
+ 0, Qt::AlignRight | Qt::AlignVCenter);
+ cacheLay->addWidget(m_levelFormatNames, 2, 1);
+ cacheLay->addWidget(m_addLevelFormat, 2, 2);
+ cacheLay->addWidget(m_removeLevelFormat, 2, 3);
+ cacheLay->addWidget(m_editLevelFormat, 2, 4);
+
+ cacheLay->addWidget(
+ new QLabel(
+ tr("Palette Type on Loading Raster Image as Color Model")),
+ 3, 0, Qt::AlignRight | Qt::AlignVCenter);
+ cacheLay->addWidget(paletteTypeForRasterColorModelComboBox, 3, 1, 1, 5);
+ }
+ cacheLay->setColumnStretch(0, 0);
+ cacheLay->setColumnStretch(1, 0);
+ cacheLay->setColumnStretch(2, 0);
+ cacheLay->setColumnStretch(3, 0);
+ cacheLay->setColumnStretch(4, 0);
+ cacheLay->setColumnStretch(5, 1);
+ loadingFrameLay->addLayout(cacheLay, 0);
+
+ loadingFrameLay->addStretch(1);
+ }
+ loadingBox->setLayout(loadingFrameLay);
+ stackedWidget->addWidget(loadingBox);
+
+ //--- Drawing --------------------------
+ QWidget *drawingBox = new QWidget(this);
+ QVBoxLayout *drawingFrameLay = new QVBoxLayout();
+ drawingFrameLay->setMargin(15);
+ drawingFrameLay->setSpacing(10);
+ {
+ QGridLayout *drawingTopLay = new QGridLayout();
+ drawingTopLay->setVerticalSpacing(10);
+ drawingTopLay->setHorizontalSpacing(15);
+ drawingTopLay->setMargin(0);
+ {
+ drawingTopLay->addWidget(new QLabel(tr("Scan File Format:")), 0, 0,
+ Qt::AlignRight);
+ drawingTopLay->addWidget(m_defScanLevelType, 0, 1, 1, 3);
+
+ drawingTopLay->addWidget(new QLabel(tr("Default Level Type:")), 1, 0,
+ Qt::AlignRight);
+ drawingTopLay->addWidget(m_defLevelType, 1, 1, 1, 3);
+
+ drawingTopLay->addWidget(new QLabel(tr("Width:")), 2, 0,
+ Qt::AlignRight);
+ drawingTopLay->addWidget(m_defLevelWidth, 2, 1);
+ drawingTopLay->addWidget(new QLabel(tr(" Height:")), 2, 2,
+ Qt::AlignRight);
+ drawingTopLay->addWidget(m_defLevelHeight, 2, 3);
+
+ drawingTopLay->addWidget(new QLabel(tr("DPI:")), 3, 0, Qt::AlignRight);
+ drawingTopLay->addWidget(m_defLevelDpi, 3, 1);
+
+ drawingTopLay->addWidget(new QLabel(tr("Autocreation:")), 4, 0,
+ Qt::AlignRight);
+ drawingTopLay->addWidget(m_autocreationType, 4, 1, 1, 3);
+ }
+ drawingFrameLay->addLayout(drawingTopLay, 0);
+
+ drawingFrameLay->addWidget(keepOriginalCleanedUpCB, 0,
+ Qt::AlignLeft | Qt::AlignVCenter);
+ drawingFrameLay->addWidget(minimizeSaveboxAfterEditingCB, 0,
+ Qt::AlignLeft | Qt::AlignVCenter); // 6.4
+ drawingFrameLay->addWidget(useSaveboxToLimitFillingOpCB, 0,
+ Qt::AlignLeft | Qt::AlignVCenter);
+ drawingFrameLay->addWidget(multiLayerStylePickerCB, 0,
+ Qt::AlignLeft | Qt::AlignVCenter);
+ drawingFrameLay->addStretch(1);
+ }
+ drawingBox->setLayout(drawingFrameLay);
+ stackedWidget->addWidget(drawingBox);
+
+ //--- Xsheet --------------------------
+ QWidget *xsheetBox = new QWidget(this);
+ QGridLayout *xsheetFrameLay = new QGridLayout();
+ xsheetFrameLay->setMargin(15);
+ xsheetFrameLay->setHorizontalSpacing(15);
+ xsheetFrameLay->setVerticalSpacing(10);
+ {
+ xsheetFrameLay->addWidget(new QLabel(tr("Next/Previous Step Frames:")), 0,
+ 0, Qt::AlignRight | Qt::AlignVCenter);
+ xsheetFrameLay->addWidget(m_xsheetStep, 0, 1);
+
+ xsheetFrameLay->addWidget(xsheetAutopanDuringPlaybackCB, 1, 0, 1, 2);
+
+ xsheetFrameLay->addWidget(new QLabel(tr("Cell-dragging Behaviour:")), 2,
+ 0, Qt::AlignRight | Qt::AlignVCenter);
+ xsheetFrameLay->addWidget(m_cellsDragBehaviour, 2, 1);
+
+ xsheetFrameLay->addWidget(ignoreAlphaonColumn1CB, 3, 0, 1, 2);
+ xsheetFrameLay->addWidget(showKeyframesOnCellAreaCB, 4, 0, 1, 2);
+ }
+ xsheetFrameLay->setColumnStretch(0, 0);
+ xsheetFrameLay->setColumnStretch(1, 0);
+ xsheetFrameLay->setColumnStretch(2, 1);
+ xsheetFrameLay->setRowStretch(5, 1);
+ xsheetBox->setLayout(xsheetFrameLay);
+ stackedWidget->addWidget(xsheetBox);
+
+ //--- Animation --------------------------
+ QWidget *animationBox = new QWidget(this);
+ QGridLayout *animationFrameLay = new QGridLayout();
+ animationFrameLay->setMargin(15);
+ animationFrameLay->setHorizontalSpacing(15);
+ animationFrameLay->setVerticalSpacing(10);
+ {
+ animationFrameLay->addWidget(new QLabel(tr("Default Interpolation:")), 0,
+ 0, Qt::AlignRight | Qt::AlignVCenter);
+ animationFrameLay->addWidget(m_keyframeType, 0, 1);
+
+ animationFrameLay->addWidget(new QLabel(tr("Animation Step:")), 1, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ animationFrameLay->addWidget(m_animationStepField, 1, 1);
+ }
+ animationFrameLay->setColumnStretch(0, 0);
+ animationFrameLay->setColumnStretch(1, 0);
+ animationFrameLay->setColumnStretch(2, 1);
+ animationFrameLay->setRowStretch(0, 0);
+ animationFrameLay->setRowStretch(1, 0);
+ animationFrameLay->setRowStretch(2, 1);
+ animationBox->setLayout(animationFrameLay);
+ stackedWidget->addWidget(animationBox);
+
+ //--- Preview --------------------------
+ QWidget *previewBox = new QWidget(this);
+ QGridLayout *previewLayout = new QGridLayout();
+ previewLayout->setMargin(15);
+ previewLayout->setHorizontalSpacing(15);
+ previewLayout->setVerticalSpacing(10);
+ {
+ previewLayout->addWidget(new QLabel(tr("Blank Frames:")), 0, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ previewLayout->addWidget(m_blanksCount, 0, 1);
+
+ previewLayout->addWidget(new QLabel(tr("Blank Frames Color:")), 1, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ previewLayout->addWidget(m_blankColor, 1, 1, 1, 2);
+
+ previewLayout->addWidget(rewindAfterPlaybackCB, 2, 0, 1, 3,
+ Qt::AlignLeft | Qt::AlignVCenter);
+ previewLayout->addWidget(displayInNewFlipBookCB, 3, 0, 1, 3,
+ Qt::AlignLeft | Qt::AlignVCenter);
+ previewLayout->addWidget(fitToFlipbookCB, 4, 0, 1, 3,
+ Qt::AlignLeft | Qt::AlignVCenter);
+ }
+ previewLayout->setColumnStretch(0, 0);
+ previewLayout->setColumnStretch(1, 0);
+ previewLayout->setColumnStretch(2, 1);
+ previewLayout->setRowStretch(0, 0);
+ previewLayout->setRowStretch(1, 0);
+ previewLayout->setRowStretch(2, 0);
+ previewLayout->setRowStretch(3, 0);
+ previewLayout->setRowStretch(4, 0);
+ previewLayout->setRowStretch(5, 1);
+ previewBox->setLayout(previewLayout);
+ stackedWidget->addWidget(previewBox);
+
+ //--- Onion Skin --------------------------
+ QWidget *onionBox = new QWidget(this);
+ QVBoxLayout *onionLay = new QVBoxLayout();
+ onionLay->setMargin(15);
+ onionLay->setSpacing(10);
+ {
+ onionLay->addWidget(m_onionSkinVisibility, 0,
+ Qt::AlignLeft | Qt::AlignVCenter);
+ QGridLayout *onionColorLay = new QGridLayout();
+ {
+ onionColorLay->addWidget(new QLabel(tr("Paper Thickness:")), 0, 0,
+ Qt::AlignRight | Qt::AlignVCenter);
+ onionColorLay->addWidget(m_onionPaperThickness, 0, 1);
+
+ onionColorLay->addWidget(new QLabel(tr("Previous Frames Correction:")),
+ 1, 0, Qt::AlignRight | Qt::AlignVCenter);
+ onionColorLay->addWidget(m_backOnionColor, 1, 1);
+
+ onionColorLay->addWidget(new QLabel(tr("Following Frames Correction:")),
+ 2, 0, Qt::AlignRight | Qt::AlignVCenter);
+ onionColorLay->addWidget(m_frontOnionColor, 2, 1);
+ }
+ onionColorLay->setColumnStretch(0, 0);
+ onionColorLay->setColumnStretch(1, 0);
+ onionColorLay->setColumnStretch(2, 1);
+ onionLay->addLayout(onionColorLay, 0);
+
+ onionLay->addWidget(m_inksOnly, 0, Qt::AlignLeft | Qt::AlignVCenter);
+
+ onionLay->addStretch(1);
+ }
+ onionBox->setLayout(onionLay);
+ stackedWidget->addWidget(onionBox);
+
+ //--- Transparency Check --------------------------
+ QWidget *tcBox = new QWidget(this);
+ QGridLayout *tcLay = new QGridLayout();
+ tcLay->setMargin(15);
+ tcLay->setHorizontalSpacing(10);
+ tcLay->setVerticalSpacing(10);
+ {
+ tcLay->addWidget(new QLabel(tr("Ink Color on White Bg:")), 0, 0,
+ Qt::AlignRight);
+ tcLay->addWidget(m_transpCheckInkColor, 0, 1);
+
+ tcLay->addWidget(new QLabel(tr("Ink Color on Black Bg:")), 1, 0,
+ Qt::AlignRight);
+ tcLay->addWidget(m_transpCheckBgColor, 1, 1);
+
+ tcLay->addWidget(new QLabel(tr("Paint Color:")), 2, 0, Qt::AlignRight);
+ tcLay->addWidget(m_transpCheckPaintColor, 2, 1);
+ }
+ tcLay->setColumnStretch(0, 0);
+ tcLay->setColumnStretch(1, 0);
+ tcLay->setColumnStretch(2, 1);
+ tcLay->setRowStretch(0, 0);
+ tcLay->setRowStretch(1, 0);
+ tcLay->setRowStretch(2, 0);
+ tcLay->setRowStretch(3, 1);
+ tcBox->setLayout(tcLay);
+ stackedWidget->addWidget(tcBox);
+
+ //--- Version Control --------------------------
+ QWidget *versionControlBox = new QWidget(this);
+ QVBoxLayout *vcLay = new QVBoxLayout();
+ vcLay->setMargin(15);
+ vcLay->setSpacing(10);
+ {
+ vcLay->addWidget(m_enableVersionControl, 0,
+ Qt::AlignLeft | Qt::AlignVCenter);
+ vcLay->addWidget(autoRefreshFolderContentsCB, 0,
+ Qt::AlignLeft | Qt::AlignVCenter);
+
+ vcLay->addStretch(1);
+
+ vcLay->addWidget(note_version, 0);
+ }
+ versionControlBox->setLayout(vcLay);
+ stackedWidget->addWidget(versionControlBox);
+
+ mainLayout->addWidget(stackedWidget, 1);
+ }
+ setLayout(mainLayout);
+
+ /*---- signal-slot connections -----*/
+
+ bool ret = true;
+ ret = ret && connect(categoryList, SIGNAL(currentRowChanged(int)),
+ stackedWidget, SLOT(setCurrentIndex(int)));
+
+ //--- General ----------------------
+ ret = ret && connect(useDefaultViewerCB, SIGNAL(stateChanged(int)), this,
+ SLOT(onDefaultViewerChanged(int)));
+ ret = ret && connect(minimizeRasterMemoryCB, SIGNAL(stateChanged(int)), this,
+ SLOT(onRasterOptimizedMemoryChanged(int)));
+ ret = ret && connect(autoSaveCB, SIGNAL(stateChanged(int)),
+ SLOT(onAutoSaveChanged(int)));
+ ret = ret && connect(m_minuteFld, SIGNAL(editingFinished()),
+ SLOT(onMinuteChanged()));
+ ret = ret && connect(m_cellsDragBehaviour, SIGNAL(currentIndexChanged(int)),
+ SLOT(onDragCellsBehaviourChanged(int)));
+ ret = ret && connect(m_undoMemorySize, SIGNAL(editingFinished()),
+ SLOT(onUndoMemorySizeChanged()));
+ ret = ret && connect(m_levelsBackup, SIGNAL(stateChanged(int)),
+ SLOT(onLevelsBackupChanged(int)));
+ ret = ret && connect(sceneNumberingCB, SIGNAL(stateChanged(int)),
+ SLOT(onSceneNumberingChanged(int)));
+ ret = ret && connect(m_chunkSizeFld, SIGNAL(editingFinished()), this,
+ SLOT(onChunkSizeChanged()));
+
+ //--- Interface ----------------------
+ ret = ret && connect(styleSheetType, SIGNAL(currentIndexChanged(int)),
+ SLOT(onStyleSheetTypeChanged(int)));
+ ret = ret && connect(unitOm, SIGNAL(currentIndexChanged(int)),
+ SLOT(onUnitChanged(int)));
+ ret = ret && connect(cameraUnitOm, SIGNAL(currentIndexChanged(int)),
+ SLOT(onCameraUnitChanged(int)));
+ ret = ret && connect(roomChoice, SIGNAL(currentIndexChanged(int)),
+ SLOT(onRoomChoiceChanged(int)));
+ ret = ret && connect(openFlipbookAfterCB, SIGNAL(stateChanged(int)), this,
+ SLOT(onViewGeneratedMovieChanged(int)));
+ ret = ret && connect(m_iconSizeLx, SIGNAL(editingFinished()),
+ SLOT(onIconSizeChanged()));
+ ret = ret && connect(m_iconSizeLy, SIGNAL(editingFinished()),
+ SLOT(onIconSizeChanged()));
+ ret = ret && connect(m_viewShrink, SIGNAL(editingFinished()),
+ SLOT(onViewValuesChanged()));
+ ret = ret && connect(m_viewStep, SIGNAL(editingFinished()),
+ SLOT(onViewValuesChanged()));
+ if (languageList.size() > 1)
+ ret = ret && connect(languageType, SIGNAL(currentIndexChanged(int)),
+ SLOT(onLanguageTypeChanged(int)));
+ ret = ret && connect(moveCurrentFrameCB, SIGNAL(stateChanged(int)), this,
+ SLOT(onMoveCurrentFrameChanged(int)));
+ ret =
+ ret && connect(viewerZoomCenterComboBox, SIGNAL(currentIndexChanged(int)),
+ this, SLOT(onViewerZoomCenterChanged(int)));
+ ret = ret && connect(replaceAfterSaveLevelAsCB, SIGNAL(stateChanged(int)),
+ this, SLOT(onReplaceAfterSaveLevelAsChanged(int)));
+ ret =
+ ret &&
+ connect(showRasterImageDarkenBlendedInViewerCB, SIGNAL(stateChanged(int)),
+ this, SLOT(onShowRasterImageDarkenBlendedInViewerChanged(int)));
+ ret = ret &&
+ connect(showShowFrameNumberWithLettersCB, SIGNAL(stateChanged(int)),
+ this, SLOT(onShowFrameNumberWithLettersChanged(int)));
+ // Viewer BG color
+ ret = ret && connect(m_viewerBgColorFld,
+ SIGNAL(colorChanged(const TPixel32 &, bool)), this,
+ SLOT(setViewerBgColor(const TPixel32 &, bool)));
+ // Preview BG color
+ ret = ret && connect(m_previewBgColorFld,
+ SIGNAL(colorChanged(const TPixel32 &, bool)), this,
+ SLOT(setPreviewBgColor(const TPixel32 &, bool)));
+ // bg chessboard colors
+ ret = ret && connect(m_chessboardColor1Fld,
+ SIGNAL(colorChanged(const TPixel32 &, bool)), this,
+ SLOT(setChessboardColor1(const TPixel32 &, bool)));
+ ret = ret && connect(m_chessboardColor2Fld,
+ SIGNAL(colorChanged(const TPixel32 &, bool)), this,
+ SLOT(setChessboardColor2(const TPixel32 &, bool)));
+ // Column Icon
+ ret = ret &&
+ connect(m_columnIconOm, SIGNAL(currentIndexChanged(const QString &)),
+ this, SLOT(onColumnIconChange(const QString &)));
+ ret = ret && connect(actualPixelOnSceneModeCB, SIGNAL(stateChanged(int)),
+ SLOT(onActualPixelOnSceneModeChanged(int)));
+ ret = ret && connect(levelNameOnEachMarkerCB, SIGNAL(stateChanged(int)),
+ SLOT(onLevelNameOnEachMarkerChanged(int)));
+
+ //--- Visualization ---------------------
+ ret = ret && connect(show0ThickLinesCB, SIGNAL(stateChanged(int)), this,
+ SLOT(onShow0ThickLinesChanged(int)));
+ ret = ret && connect(regionAntialiasCB, SIGNAL(stateChanged(int)), this,
+ SLOT(onRegionAntialiasChanged(int)));
+
+ //--- Loading ----------------------
+ ret = ret && connect(exposeLoadedLevelsCB, SIGNAL(stateChanged(int)), this,
+ SLOT(onAutoExposeChanged(int)));
+ ret = ret && connect(initialLoadTlvCachingBehaviorComboBox,
+ SIGNAL(currentIndexChanged(int)), this,
+ SLOT(onInitialLoadTlvCachingBehaviorChanged(int)));
+ ret = ret && connect(createSubfolderCB, SIGNAL(stateChanged(int)), this,
+ SLOT(onSubsceneFolderChanged(int)));
+ ret =
+ ret &&
+ connect(removeSceneNumberFromLoadedLevelNameCB, SIGNAL(stateChanged(int)),
+ this, SLOT(onRemoveSceneNumberFromLoadedLevelNameChanged(int)));
+ ret = ret &&
+ connect(m_addLevelFormat, SIGNAL(clicked()), SLOT(onAddLevelFormat()));
+ ret = ret && connect(m_removeLevelFormat, SIGNAL(clicked()),
+ SLOT(onRemoveLevelFormat()));
+ ret = ret && connect(m_editLevelFormat, SIGNAL(clicked()),
+ SLOT(onEditLevelFormat()));
+ ret = ret && connect(paletteTypeForRasterColorModelComboBox,
+ SIGNAL(currentIndexChanged(int)), this,
+ SLOT(onPaletteTypeForRasterColorModelChanged(int)));
+
+ //--- Drawing ----------------------
+ ret = ret && connect(keepOriginalCleanedUpCB, SIGNAL(stateChanged(int)), this,
+ SLOT(onSaveUnpaintedInCleanupChanged(int)));
+ ret = ret && connect(multiLayerStylePickerCB, SIGNAL(stateChanged(int)), this,
+ SLOT(onMultiLayerStylePickerChanged(int)));
+ ret = ret && connect(useSaveboxToLimitFillingOpCB, SIGNAL(stateChanged(int)),
+ this, SLOT(onGetFillOnlySavebox(int)));
+ ret = ret && connect(m_defScanLevelType,
+ SIGNAL(currentIndexChanged(const QString &)),
+ SLOT(onScanLevelTypeChanged(const QString &)));
+ ret = ret && connect(minimizeSaveboxAfterEditingCB, SIGNAL(stateChanged(int)),
+ this, SLOT(onMinimizeSaveboxAfterEditing(int)));
+ ret = ret && connect(m_defLevelType, SIGNAL(currentIndexChanged(int)),
+ SLOT(onDefLevelTypeChanged(int)));
+ ret = ret && connect(m_autocreationType, SIGNAL(currentIndexChanged(int)),
+ SLOT(onAutocreationTypeChanged(int)));
+ ret = ret && connect(m_defLevelWidth, SIGNAL(valueChanged()),
+ SLOT(onDefLevelParameterChanged()));
+ ret = ret && connect(m_defLevelHeight, SIGNAL(valueChanged()),
+ SLOT(onDefLevelParameterChanged()));
+ ret = ret && connect(m_defLevelDpi, SIGNAL(valueChanged()),
+ SLOT(onDefLevelParameterChanged()));
+
+ //--- Xsheet ----------------------
+ ret = ret && connect(xsheetAutopanDuringPlaybackCB, SIGNAL(stateChanged(int)),
+ this, SLOT(onXsheetAutopanChanged(int)));
+ ret = ret && connect(ignoreAlphaonColumn1CB, SIGNAL(stateChanged(int)), this,
+ SLOT(onIgnoreAlphaonColumn1Changed(int)));
+ ret = ret && connect(m_xsheetStep, SIGNAL(editingFinished()),
+ SLOT(onXsheetStepChanged()));
+ ret = ret && connect(m_cellsDragBehaviour, SIGNAL(currentIndexChanged(int)),
+ SLOT(onDragCellsBehaviourChanged(int)));
+ ret = ret && connect(showKeyframesOnCellAreaCB, SIGNAL(stateChanged(int)),
+ this, SLOT(onShowKeyframesOnCellAreaChanged(int)));
+
+ //--- Animation ----------------------
+ ret = ret && connect(m_keyframeType, SIGNAL(currentIndexChanged(int)),
+ SLOT(onKeyframeTypeChanged(int)));
+ ret = ret && connect(m_animationStepField, SIGNAL(editingFinished()),
+ SLOT(onAnimationStepChanged()));
+
+ //--- Preview ----------------------
+ ret = ret && connect(m_blanksCount, SIGNAL(editingFinished()),
+ SLOT(onBlankCountChanged()));
+ ret =
+ ret && connect(m_blankColor, SIGNAL(colorChanged(const TPixel32 &, bool)),
+ SLOT(onBlankColorChanged(const TPixel32 &, bool)));
+ ret = ret && connect(rewindAfterPlaybackCB, SIGNAL(stateChanged(int)), this,
+ SLOT(onRewindAfterPlayback(int)));
+ ret = ret && connect(displayInNewFlipBookCB, SIGNAL(stateChanged(int)), this,
+ SLOT(onPreviewAlwaysOpenNewFlip(int)));
+ ret = ret && connect(fitToFlipbookCB, SIGNAL(stateChanged(int)), this,
+ SLOT(onFitToFlipbook(int)));
+
+ //--- Onion Skin ----------------------
+ ret = ret &&
+ connect(m_frontOnionColor, SIGNAL(colorChanged(const TPixel32 &, bool)),
+ SLOT(onOnionDataChanged(const TPixel32 &, bool)));
+ ret = ret &&
+ connect(m_backOnionColor, SIGNAL(colorChanged(const TPixel32 &, bool)),
+ SLOT(onOnionDataChanged(const TPixel32 &, bool)));
+ ret = ret && connect(m_inksOnly, SIGNAL(stateChanged(int)),
+ SLOT(onOnionDataChanged(int)));
+ ret = ret && connect(m_onionSkinVisibility, SIGNAL(stateChanged(int)),
+ SLOT(onOnionSkinVisibilityChanged(int)));
+ ret = ret && connect(m_onionPaperThickness, SIGNAL(editingFinished()),
+ SLOT(onOnionPaperThicknessChanged()));
+
+ //--- Transparency Check ----------------------
+ ret = ret && connect(m_transpCheckBgColor,
+ SIGNAL(colorChanged(const TPixel32 &, bool)),
+ SLOT(onTranspCheckDataChanged(const TPixel32 &, bool)));
+ ret = ret && connect(m_transpCheckInkColor,
+ SIGNAL(colorChanged(const TPixel32 &, bool)),
+ SLOT(onTranspCheckDataChanged(const TPixel32 &, bool)));
+ ret = ret && connect(m_transpCheckPaintColor,
+ SIGNAL(colorChanged(const TPixel32 &, bool)),
+ SLOT(onTranspCheckDataChanged(const TPixel32 &, bool)));
+
+ //--- Version Control ----------------------
+ ret = ret && connect(m_enableVersionControl, SIGNAL(stateChanged(int)),
+ SLOT(onSVNEnabledChanged(int)));
+ ret = ret && connect(autoRefreshFolderContentsCB, SIGNAL(stateChanged(int)),
+ SLOT(onAutomaticSVNRefreshChanged(int)));
+
+ assert(ret);
}
//-----------------------------------------------------------------------------
diff --cc toonz/sources/toonzqt/camerasettingswidget.cpp
index 71966cecc,705ff6fb9..f0daef81b
--- a/toonz/sources/toonzqt/camerasettingswidget.cpp
+++ b/toonz/sources/toonzqt/camerasettingswidget.cpp
@@@ -187,234 -173,240 +174,241 @@@ void SimpleExpField::focusOutEvent(QFoc
//=============================================================================
CameraSettingsWidget::CameraSettingsWidget(bool forCleanup)
- : m_forCleanup(forCleanup), m_arValue(0), m_presetListFile(""), m_currentLevel(0)
- {
- m_xPrev = new QRadioButton();
- m_yPrev = new QRadioButton();
- m_arPrev = new QRadioButton();
- m_inchPrev = new QRadioButton();
- m_dotPrev = new QRadioButton();
-
- m_lxFld = new MeasuredDoubleLineEdit();
- m_lyFld = new MeasuredDoubleLineEdit();
-
- m_arFld = new SimpleExpField(this);
-
- m_xResFld = new DVGui::IntLineEdit();
- m_yResFld = new DVGui::IntLineEdit();
- m_xDpiFld = new DoubleLineEdit();
- m_yDpiFld = new DoubleLineEdit();
-
- m_fspChk = new QPushButton("");
-
- m_useLevelSettingsBtn = new QPushButton(tr("Use Current Level Settings"));
-
- m_presetListOm = new QComboBox();
- m_addPresetBtn = new QPushButton(tr("Add"));
- m_removePresetBtn = new QPushButton(tr("Remove"));
-
- //----
- m_useLevelSettingsBtn->setEnabled(false);
- m_useLevelSettingsBtn->setFocusPolicy(Qt::NoFocus);
- m_lxFld->installEventFilter(this);
- m_lyFld->installEventFilter(this);
- m_arFld->installEventFilter(this);
- m_xResFld->installEventFilter(this);
- m_yResFld->installEventFilter(this);
- m_xDpiFld->installEventFilter(this);
- m_yDpiFld->installEventFilter(this);
- m_xResFld->setMinimumWidth(0);
- m_xResFld->setMaximumWidth(QWIDGETSIZE_MAX);
- m_yResFld->setMinimumWidth(0);
- m_yResFld->setMaximumWidth(QWIDGETSIZE_MAX);
-
- /*--- 表示精度を4桁にする ---*/
- m_lxFld->setDecimals(4);
- m_lyFld->setDecimals(4);
-
- m_lxFld->setMeasure("camera.lx");
- m_lyFld->setMeasure("camera.ly");
- m_lxFld->setRange(numeric_limits<double>::epsilon(), numeric_limits<double>::infinity());
- m_lyFld->setRange(numeric_limits<double>::epsilon(), numeric_limits<double>::infinity());
-
- m_xResFld->setRange(1, 10000000);
- m_yResFld->setRange(1, 10000000);
-
- m_xDpiFld->setRange(1, numeric_limits<double>::infinity());
- m_yDpiFld->setRange(1, numeric_limits<double>::infinity());
-
- m_fspChk->setFixedSize(20, 20);
- m_fspChk->setCheckable(true);
- m_fspChk->setChecked(true);
-
- m_fspChk->setToolTip(tr("Force Squared Pixel"));
- m_fspChk->setObjectName("ForceSquaredPixelButton");
- m_addPresetBtn->setObjectName("PushButton_NoPadding");
- m_removePresetBtn->setObjectName("PushButton_NoPadding");
-
- m_inchPrev->setFixedSize(11, 21);
- m_dotPrev->setFixedSize(11, 21);
- m_inchPrev->setObjectName("CameraSettingsRadioButton_Small");
- m_dotPrev->setObjectName("CameraSettingsRadioButton_Small");
-
- m_xPrev->setObjectName("CameraSettingsRadioButton");
- m_yPrev->setObjectName("CameraSettingsRadioButton");
- m_arPrev->setObjectName("CameraSettingsRadioButton");
-
- // radio buttons groups
- QButtonGroup *group;
- group = new QButtonGroup;
- group->addButton(m_xPrev);
- group->addButton(m_yPrev);
- group->addButton(m_arPrev);
- group = new QButtonGroup;
- group->addButton(m_inchPrev);
- group->addButton(m_dotPrev);
- m_arPrev->setChecked(true);
- m_dotPrev->setChecked(true);
-
- //------ layout
-
- QVBoxLayout *mainLay = new QVBoxLayout();
- mainLay->setSpacing(3);
- mainLay->setMargin(3);
- {
- QGridLayout *gridLay = new QGridLayout();
- gridLay->setHorizontalSpacing(2);
- gridLay->setVerticalSpacing(3);
- {
- gridLay->addWidget(m_xPrev, 0, 2, Qt::AlignCenter);
- gridLay->addWidget(m_yPrev, 0, 4, Qt::AlignCenter);
-
- gridLay->addWidget(m_inchPrev, 1, 0, Qt::AlignRight | Qt::AlignVCenter);
- QString units = Preferences::instance()->getCameraUnits();
- gridLay->addWidget(new QLabel(units), 1, 1, Qt::AlignRight | Qt::AlignVCenter);
- gridLay->addWidget(m_lxFld, 1, 2);
- gridLay->addWidget(new QLabel("x"), 1, 3, Qt::AlignCenter);
- gridLay->addWidget(m_lyFld, 1, 4);
-
- gridLay->addWidget(m_arPrev, 2, 2, Qt::AlignRight | Qt::AlignVCenter);
- gridLay->addWidget(new QLabel("A/R"), 2, 3, Qt::AlignCenter);
- gridLay->addWidget(m_arFld, 2, 4);
-
- gridLay->addWidget(m_dotPrev, 3, 0, Qt::AlignRight | Qt::AlignVCenter);
- gridLay->addWidget(new QLabel("Pixel"), 3, 1, Qt::AlignRight | Qt::AlignVCenter);
- gridLay->addWidget(m_xResFld, 3, 2);
- gridLay->addWidget(new QLabel("x"), 3, 3, Qt::AlignCenter);
- gridLay->addWidget(m_yResFld, 3, 4);
-
- gridLay->addWidget(new QLabel("DPI"), 4, 1, Qt::AlignRight | Qt::AlignVCenter);
- gridLay->addWidget(m_xDpiFld, 4, 2);
- gridLay->addWidget(m_fspChk, 4, 3, Qt::AlignCenter);
- gridLay->addWidget(m_yDpiFld, 4, 4);
- }
- gridLay->setColumnStretch(0, 0);
- gridLay->setColumnStretch(1, 0);
- gridLay->setColumnStretch(2, 1);
- gridLay->setColumnStretch(3, 0);
- gridLay->setColumnStretch(4, 1);
- mainLay->addLayout(gridLay);
-
- mainLay->addWidget(m_useLevelSettingsBtn);
-
- QHBoxLayout *resListLay = new QHBoxLayout();
- resListLay->setSpacing(3);
- resListLay->setMargin(1);
- {
- resListLay->addWidget(m_presetListOm, 1);
- resListLay->addWidget(m_addPresetBtn, 0);
- resListLay->addWidget(m_removePresetBtn, 0);
- }
- mainLay->addLayout(resListLay);
- }
- setLayout(mainLay);
-
- // initialize fields
- TCamera camera;
- setFields(&camera);
-
- // connect events
- bool ret = true;
- ret = ret && connect(m_lxFld, SIGNAL(editingFinished()), SLOT(onLxChanged()));
- ret = ret && connect(m_lyFld, SIGNAL(editingFinished()), SLOT(onLyChanged()));
- ret = ret && connect(m_arFld, SIGNAL(editingFinished()), SLOT(onArChanged()));
- ret = ret && connect(m_xResFld, SIGNAL(editingFinished()), SLOT(onXResChanged()));
- ret = ret && connect(m_yResFld, SIGNAL(editingFinished()), SLOT(onYResChanged()));
- ret = ret && connect(m_xDpiFld, SIGNAL(editingFinished()), SLOT(onXDpiChanged()));
- ret = ret && connect(m_yDpiFld, SIGNAL(editingFinished()), SLOT(onYDpiChanged()));
-
- ret = ret && connect(m_fspChk, SIGNAL(clicked(bool)), SLOT(onFspChanged(bool)));
-
- ret = ret && connect(m_xPrev, SIGNAL(toggled(bool)), SLOT(onPrevToggled(bool)));
- ret = ret && connect(m_yPrev, SIGNAL(toggled(bool)), SLOT(onPrevToggled(bool)));
- ret = ret && connect(m_dotPrev, SIGNAL(toggled(bool)), SLOT(onPrevToggled(bool)));
- ret = ret && connect(m_inchPrev, SIGNAL(toggled(bool)), SLOT(onPrevToggled(bool)));
-
- ret = ret && connect(m_useLevelSettingsBtn, SIGNAL(clicked()), this, SLOT(useLevelSettings()));
-
- ret = ret && connect(m_presetListOm, SIGNAL(activated(const QString &)),
- SLOT(onPresetSelected(const QString &)));
- ret = ret && connect(m_addPresetBtn, SIGNAL(clicked()), SLOT(addPreset()));
- ret = ret && connect(m_removePresetBtn, SIGNAL(clicked()), SLOT(removePreset()));
-
- assert(ret);
- }
-
- CameraSettingsWidget::~CameraSettingsWidget()
- {
- setCurrentLevel(0);
- }
-
- void CameraSettingsWidget::loadPresetList()
- {
- if (m_presetListFile == "")
- return;
- m_presetListOm->clear();
- m_presetListOm->addItem(custom);
-
- QFile file(m_presetListFile);
- if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
- QTextStream in(&file);
- while (!in.atEnd()) {
- QString line = in.readLine().trimmed();
- if (line != "")
- m_presetListOm->addItem(line);
- }
- }
- m_presetListOm->setCurrentIndex(0);
- }
-
- void CameraSettingsWidget::savePresetList()
- {
- QFile file(m_presetListFile);
- if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
- return;
- QTextStream out(&file);
- int n = m_presetListOm->count();
- for (int i = 1; i < n; i++)
- out << m_presetListOm->itemText(i) << "\n";
- }
-
- bool CameraSettingsWidget::parsePresetString(const QString &str, QString &name, int &xres, int &yres, QString &ar)
- {
- // str : name, 1024x768, 4/3
- int b;
- b = str.lastIndexOf(",");
- if (b <= 1)
- return false;
- b = str.lastIndexOf(",", b - 1);
- if (b <= 0)
- return false;
-
- QRegExp rx(" *([0-9]+)x([0-9]+) *, *(\\d*(\\.\\d+)?|\\d+/\\d+) *");
- if (!rx.exactMatch(str.mid(b + 1)))
- return false;
-
- name = b > 0 ? str.left(b).trimmed() : "";
- xres = rx.cap(1).toInt();
- yres = rx.cap(2).toInt();
- ar = rx.cap(3);
- return true;
+ : m_forCleanup(forCleanup)
+ , m_arValue(0)
+ , m_presetListFile("")
+ , m_currentLevel(0) {
+ m_xPrev = new QRadioButton();
+ m_yPrev = new QRadioButton();
+ m_arPrev = new QRadioButton();
+ m_inchPrev = new QRadioButton();
+ m_dotPrev = new QRadioButton();
+
+ m_lxFld = new MeasuredDoubleLineEdit();
+ m_lyFld = new MeasuredDoubleLineEdit();
+
+ m_arFld = new SimpleExpField(this);
+
+ m_xResFld = new DVGui::IntLineEdit();
+ m_yResFld = new DVGui::IntLineEdit();
+ m_xDpiFld = new DoubleLineEdit();
+ m_yDpiFld = new DoubleLineEdit();
+
+ m_fspChk = new QPushButton("");
+
+ m_useLevelSettingsBtn = new QPushButton(tr("Use Current Level Settings"));
+
+ m_presetListOm = new QComboBox();
+ m_addPresetBtn = new QPushButton(tr("Add"));
+ m_removePresetBtn = new QPushButton(tr("Remove"));
+
+ //----
+ m_useLevelSettingsBtn->setEnabled(false);
+ m_useLevelSettingsBtn->setFocusPolicy(Qt::NoFocus);
+ m_lxFld->installEventFilter(this);
+ m_lyFld->installEventFilter(this);
+ m_arFld->installEventFilter(this);
+ m_xResFld->installEventFilter(this);
+ m_yResFld->installEventFilter(this);
+ m_xDpiFld->installEventFilter(this);
+ m_yDpiFld->installEventFilter(this);
+ m_xResFld->setMinimumWidth(0);
+ m_xResFld->setMaximumWidth(QWIDGETSIZE_MAX);
+ m_yResFld->setMinimumWidth(0);
+ m_yResFld->setMaximumWidth(QWIDGETSIZE_MAX);
+
+ /*--- 表示精度を4桁にする ---*/
+ m_lxFld->setDecimals(4);
+ m_lyFld->setDecimals(4);
+
+ m_lxFld->setMeasure("camera.lx");
+ m_lyFld->setMeasure("camera.ly");
+ m_lxFld->setRange(numeric_limits<double>::epsilon(),
+ numeric_limits<double>::infinity());
+ m_lyFld->setRange(numeric_limits<double>::epsilon(),
+ numeric_limits<double>::infinity());
+
+ m_xResFld->setRange(1, 10000000);
+ m_yResFld->setRange(1, 10000000);
+
+ m_xDpiFld->setRange(1, numeric_limits<double>::infinity());
+ m_yDpiFld->setRange(1, numeric_limits<double>::infinity());
+
+ m_fspChk->setFixedSize(20, 20);
+ m_fspChk->setCheckable(true);
+ m_fspChk->setChecked(true);
+
+ m_fspChk->setToolTip(tr("Force Squared Pixel"));
+ m_fspChk->setObjectName("ForceSquaredPixelButton");
+ m_addPresetBtn->setObjectName("PushButton_NoPadding");
+ m_removePresetBtn->setObjectName("PushButton_NoPadding");
+
+ m_inchPrev->setFixedSize(11, 21);
+ m_dotPrev->setFixedSize(11, 21);
+ m_inchPrev->setObjectName("CameraSettingsRadioButton_Small");
+ m_dotPrev->setObjectName("CameraSettingsRadioButton_Small");
+
+ m_xPrev->setObjectName("CameraSettingsRadioButton");
+ m_yPrev->setObjectName("CameraSettingsRadioButton");
+ m_arPrev->setObjectName("CameraSettingsRadioButton");
+
+ // radio buttons groups
+ QButtonGroup *group;
+ group = new QButtonGroup;
+ group->addButton(m_xPrev);
+ group->addButton(m_yPrev);
+ group->addButton(m_arPrev);
+ group = new QButtonGroup;
+ group->addButton(m_inchPrev);
+ group->addButton(m_dotPrev);
+ m_arPrev->setChecked(true);
+ m_dotPrev->setChecked(true);
+
+ //------ layout
+
+ QVBoxLayout *mainLay = new QVBoxLayout();
+ mainLay->setSpacing(3);
+ mainLay->setMargin(3);
+ {
+ QGridLayout *gridLay = new QGridLayout();
+ gridLay->setHorizontalSpacing(2);
+ gridLay->setVerticalSpacing(3);
+ {
+ gridLay->addWidget(m_xPrev, 0, 2, Qt::AlignCenter);
+ gridLay->addWidget(m_yPrev, 0, 4, Qt::AlignCenter);
+
+ gridLay->addWidget(m_inchPrev, 1, 0, Qt::AlignRight | Qt::AlignVCenter);
- gridLay->addWidget(new QLabel("Inch"), 1, 1,
- Qt::AlignRight | Qt::AlignVCenter);
++ QString units = Preferences::instance()->getCameraUnits();
++ gridLay->addWidget(new QLabel(units), 1, 1,
++ Qt::AlignRight | Qt::AlignVCenter);
+ gridLay->addWidget(m_lxFld, 1, 2);
+ gridLay->addWidget(new QLabel("x"), 1, 3, Qt::AlignCenter);
+ gridLay->addWidget(m_lyFld, 1, 4);
+
+ gridLay->addWidget(m_arPrev, 2, 2, Qt::AlignRight | Qt::AlignVCenter);
+ gridLay->addWidget(new QLabel("A/R"), 2, 3, Qt::AlignCenter);
+ gridLay->addWidget(m_arFld, 2, 4);
+
+ gridLay->addWidget(m_dotPrev, 3, 0, Qt::AlignRight | Qt::AlignVCenter);
+ gridLay->addWidget(new QLabel("Pixel"), 3, 1,
+ Qt::AlignRight | Qt::AlignVCenter);
+ gridLay->addWidget(m_xResFld, 3, 2);
+ gridLay->addWidget(new QLabel("x"), 3, 3, Qt::AlignCenter);
+ gridLay->addWidget(m_yResFld, 3, 4);
+
+ gridLay->addWidget(new QLabel("DPI"), 4, 1,
+ Qt::AlignRight | Qt::AlignVCenter);
+ gridLay->addWidget(m_xDpiFld, 4, 2);
+ gridLay->addWidget(m_fspChk, 4, 3, Qt::AlignCenter);
+ gridLay->addWidget(m_yDpiFld, 4, 4);
+ }
+ gridLay->setColumnStretch(0, 0);
+ gridLay->setColumnStretch(1, 0);
+ gridLay->setColumnStretch(2, 1);
+ gridLay->setColumnStretch(3, 0);
+ gridLay->setColumnStretch(4, 1);
+ mainLay->addLayout(gridLay);
+
+ mainLay->addWidget(m_useLevelSettingsBtn);
+
+ QHBoxLayout *resListLay = new QHBoxLayout();
+ resListLay->setSpacing(3);
+ resListLay->setMargin(1);
+ {
+ resListLay->addWidget(m_presetListOm, 1);
+ resListLay->addWidget(m_addPresetBtn, 0);
+ resListLay->addWidget(m_removePresetBtn, 0);
+ }
+ mainLay->addLayout(resListLay);
+ }
+ setLayout(mainLay);
+
+ // initialize fields
+ TCamera camera;
+ setFields(&camera);
+
+ // connect events
+ bool ret = true;
+ ret = ret && connect(m_lxFld, SIGNAL(editingFinished()), SLOT(onLxChanged()));
+ ret = ret && connect(m_lyFld, SIGNAL(editingFinished()), SLOT(onLyChanged()));
+ ret = ret && connect(m_arFld, SIGNAL(editingFinished()), SLOT(onArChanged()));
+ ret = ret &&
+ connect(m_xResFld, SIGNAL(editingFinished()), SLOT(onXResChanged()));
+ ret = ret &&
+ connect(m_yResFld, SIGNAL(editingFinished()), SLOT(onYResChanged()));
+ ret = ret &&
+ connect(m_xDpiFld, SIGNAL(editingFinished()), SLOT(onXDpiChanged()));
+ ret = ret &&
+ connect(m_yDpiFld, SIGNAL(editingFinished()), SLOT(onYDpiChanged()));
+
+ ret =
+ ret && connect(m_fspChk, SIGNAL(clicked(bool)), SLOT(onFspChanged(bool)));
+
+ ret =
+ ret && connect(m_xPrev, SIGNAL(toggled(bool)), SLOT(onPrevToggled(bool)));
+ ret =
+ ret && connect(m_yPrev, SIGNAL(toggled(bool)), SLOT(onPrevToggled(bool)));
+ ret = ret &&
+ connect(m_dotPrev, SIGNAL(toggled(bool)), SLOT(onPrevToggled(bool)));
+ ret = ret &&
+ connect(m_inchPrev, SIGNAL(toggled(bool)), SLOT(onPrevToggled(bool)));
+
+ ret = ret && connect(m_useLevelSettingsBtn, SIGNAL(clicked()), this,
+ SLOT(useLevelSettings()));
+
+ ret = ret && connect(m_presetListOm, SIGNAL(activated(const QString &)),
+ SLOT(onPresetSelected(const QString &)));
+ ret = ret && connect(m_addPresetBtn, SIGNAL(clicked()), SLOT(addPreset()));
+ ret = ret &&
+ connect(m_removePresetBtn, SIGNAL(clicked()), SLOT(removePreset()));
+
+ assert(ret);
+ }
+
+ CameraSettingsWidget::~CameraSettingsWidget() { setCurrentLevel(0); }
+
+ void CameraSettingsWidget::loadPresetList() {
+ if (m_presetListFile == "") return;
+ m_presetListOm->clear();
+ m_presetListOm->addItem(custom);
+
+ QFile file(m_presetListFile);
+ if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ QTextStream in(&file);
+ while (!in.atEnd()) {
+ QString line = in.readLine().trimmed();
+ if (line != "") m_presetListOm->addItem(line);
+ }
+ }
+ m_presetListOm->setCurrentIndex(0);
+ }
+
+ void CameraSettingsWidget::savePresetList() {
+ QFile file(m_presetListFile);
+ if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) return;
+ QTextStream out(&file);
+ int n = m_presetListOm->count();
+ for (int i = 1; i < n; i++) out << m_presetListOm->itemText(i) << "\n";
+ }
+
+ bool CameraSettingsWidget::parsePresetString(const QString &str, QString &name,
+ int &xres, int &yres,
+ QString &ar) {
+ // str : name, 1024x768, 4/3
+ int b;
+ b = str.lastIndexOf(",");
+ if (b <= 1) return false;
+ b = str.lastIndexOf(",", b - 1);
+ if (b <= 0) return false;
+
+ QRegExp rx(" *([0-9]+)x([0-9]+) *, *(\\d*(\\.\\d+)?|\\d+/\\d+) *");
+ if (!rx.exactMatch(str.mid(b + 1))) return false;
+
+ name = b > 0 ? str.left(b).trimmed() : "";
+ xres = rx.cap(1).toInt();
+ yres = rx.cap(2).toInt();
+ ar = rx.cap(3);
+ return true;
}
//--------------------------------------------------------------------------