Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "preferencespopup.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// Tnz6 includes
Toshihiro Shimizu 890ddd
#include "menubarcommandids.h"
Toshihiro Shimizu 890ddd
#include "versioncontrol.h"
Toshihiro Shimizu 890ddd
#include "levelsettingspopup.h"
Toshihiro Shimizu 890ddd
#include "tapp.h"
Jeremy Bullock 3eeb02
#include "cleanupsettingsmodel.h"
shun-iwasawa fc0d80
#include "formatsettingspopups.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// TnzQt includes
Toshihiro Shimizu 890ddd
#include "toonzqt/tabbar.h"
Toshihiro Shimizu 890ddd
#include "toonzqt/menubarcommand.h"
Toshihiro Shimizu 890ddd
#include "toonzqt/checkbox.h"
Toshihiro Shimizu 890ddd
#include "toonzqt/gutil.h"
Toshihiro Shimizu 890ddd
#include "toonzqt/doublefield.h"
Toshihiro Shimizu 890ddd
#include "toonzqt/dvdialog.h"
Toshihiro Shimizu 890ddd
#include "toonzqt/filefield.h"
shun-iwasawa ad7711
#include "toonzqt/lutcalibrator.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// TnzLib includes
Jeremy Bullock 15fcba
#include "toonz/txsheethandle.h"
Toshihiro Shimizu 890ddd
#include "toonz/tscenehandle.h"
Toshihiro Shimizu 890ddd
#include "toonz/txshlevelhandle.h"
Toshihiro Shimizu 890ddd
#include "toonz/txshleveltypes.h"
Jeremy Bullock 7c096e
#include "toonz/toonzscene.h"
Jeremy Bullock 7c096e
#include "toonz/tcamera.h"
Toshihiro Shimizu 890ddd
#include "toonz/levelproperties.h"
Toshihiro Shimizu 890ddd
#include "toonz/tonionskinmaskhandle.h"
shun_iwasawa d6df3f
#include "toonz/stage.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// TnzCore includes
Toshihiro Shimizu 890ddd
#include "tsystem.h"
Jeremy Bullock 807052
#include "tfont.h"
Toshihiro Shimizu 890ddd
manongjohn c5bc8d
#include "kis_tablet_support_win8.h"
manongjohn c5bc8d
Toshihiro Shimizu 890ddd
// Qt includes
Toshihiro Shimizu 890ddd
#include <qhboxlayout></qhboxlayout>
Toshihiro Shimizu 890ddd
#include <qcombobox></qcombobox>
manongjohn b66bc4
#include <qfontcombobox></qfontcombobox>
Toshihiro Shimizu 890ddd
#include <qlabel></qlabel>
Toshihiro Shimizu 890ddd
#include <qstackedwidget></qstackedwidget>
Toshihiro Shimizu 890ddd
#include <qlineedit></qlineedit>
Toshihiro Shimizu 890ddd
#include <qfiledialog></qfiledialog>
Toshihiro Shimizu 890ddd
#include <qfile></qfile>
Toshihiro Shimizu 890ddd
#include <qpushbutton></qpushbutton>
Toshihiro Shimizu 890ddd
#include <qapplication></qapplication>
Toshihiro Shimizu 890ddd
#include <qmainwindow></qmainwindow>
Toshihiro Shimizu 890ddd
#include <qstringlist></qstringlist>
Toshihiro Shimizu 890ddd
#include <qlistwidget></qlistwidget>
Jeremy Bullock e59b1f
#include <qgroupbox></qgroupbox>
shun-iwasawa c9a4a1
#include <qkeysequence></qkeysequence>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
using namespace DVGui;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//*******************************************************************************************
Toshihiro Shimizu 890ddd
//    Local namespace
Toshihiro Shimizu 890ddd
//*******************************************************************************************
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
namespace {
Shinya Kitaoka 120a6e
enum DpiPolicy { DP_ImageDpi, DP_CustomDpi };
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
inline void setupLayout(QGridLayout* lay, int margin = 15) {
shun-iwasawa 8fb291
  lay->setMargin(margin);
shun-iwasawa 8fb291
  lay->setHorizontalSpacing(5);
shun-iwasawa 8fb291
  lay->setVerticalSpacing(10);
shun-iwasawa 8fb291
  lay->setColumnStretch(2, 1);
shun-iwasawa 8fb291
}
shun-iwasawa 8fb291
shun-iwasawa 8fb291
QGridLayout* insertGroupBox(const QString label, QGridLayout* layout) {
shun-iwasawa 8fb291
  QGroupBox* box   = new QGroupBox(label);
shun-iwasawa 8fb291
  QGridLayout* lay = new QGridLayout();
shun-iwasawa 8fb291
  setupLayout(lay, 5);
shun-iwasawa 8fb291
  box->setLayout(lay);
shun-iwasawa 8fb291
  layout->addWidget(box, layout->rowCount(), 0, 1, 3);
shun-iwasawa 8fb291
  return lay;
shun-iwasawa 8fb291
}
shun-iwasawa 8fb291
shun-iwasawa 8fb291
inline TPixel colorToTPixel(const QColor& color) {
shun-iwasawa 8fb291
  return TPixel(color.red(), color.green(), color.blue(), color.alpha());
shun-iwasawa 8fb291
}
Shinya Kitaoka 120a6e
}  // namespace
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
//-----------------------------------------------------------------------------
shun-iwasawa 8fb291
shun-iwasawa 8fb291
SizeField::SizeField(QSize min, QSize max, QSize value, QWidget* parent)
shun-iwasawa 8fb291
    : QWidget(parent) {
shun-iwasawa 8fb291
  m_fieldX =
shun-iwasawa 8fb291
      new DVGui::IntLineEdit(this, value.width(), min.width(), max.width());
shun-iwasawa 8fb291
  m_fieldY =
shun-iwasawa 8fb291
      new DVGui::IntLineEdit(this, value.height(), min.height(), max.height());
shun-iwasawa 8fb291
  QHBoxLayout* lay = new QHBoxLayout();
shun-iwasawa 8fb291
  lay->setSpacing(5);
shun-iwasawa 8fb291
  lay->setMargin(0);
shun-iwasawa 8fb291
  lay->addWidget(m_fieldX, 1);
MrBlockCat 845bc7
  lay->addWidget(new QLabel("x", this), 0);
shun-iwasawa 8fb291
  lay->addWidget(m_fieldY, 1);
shun-iwasawa 8fb291
  lay->addStretch(1);
shun-iwasawa 8fb291
  setLayout(lay);
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  bool ret = true;
shun-iwasawa 8fb291
  ret      = ret && connect(m_fieldX, SIGNAL(editingFinished()), this,
shun-iwasawa 7c3c0a
                            SIGNAL(editingFinished()));
shun-iwasawa c54dfb
  ret      = ret && connect(m_fieldY, SIGNAL(editingFinished()), this,
shun-iwasawa 7c3c0a
                            SIGNAL(editingFinished()));
shun-iwasawa 8fb291
  assert(ret);
shun-iwasawa 8fb291
}
shun-iwasawa 8fb291
shun-iwasawa 8fb291
QSize SizeField::getValue() const {
shun-iwasawa 8fb291
  return QSize(m_fieldX->getValue(), m_fieldY->getValue());
shun-iwasawa 8fb291
}
shun-iwasawa 8fb291
shun-iwasawa 8fb291
void SizeField::setValue(const QSize& size) {
shun-iwasawa 8fb291
  m_fieldX->setValue(size.width());
shun-iwasawa 8fb291
  m_fieldY->setValue(size.height());
shun-iwasawa 8fb291
}
shun-iwasawa 8fb291
Toshihiro Shimizu 890ddd
//**********************************************************************************
Toshihiro Shimizu 890ddd
//    PreferencesPopup::FormatProperties  implementation
Toshihiro Shimizu 890ddd
//**********************************************************************************
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
PreferencesPopup::FormatProperties::FormatProperties(PreferencesPopup* parent)
Shinya Kitaoka 120a6e
    : DVGui::Dialog(parent, false, true) {
Shinya Kitaoka 120a6e
  setWindowTitle(tr("Level Settings by File Format"));
Shinya Kitaoka 120a6e
  setModal(true);  // The underlying selected format should not
Shinya Kitaoka 120a6e
  // be changed by the user
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  // Main layout
Shinya Kitaoka 120a6e
  beginVLayout();
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  QGridLayout* gridLayout = new QGridLayout;
Shinya Kitaoka 120a6e
  int row                 = 0;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  // Key values
shun-iwasawa 8fb291
  QLabel* nameLabel = new QLabel(tr("Name:"));
Shinya Kitaoka 120a6e
  nameLabel->setFixedHeight(20);  // Due to DVGui::Dialog's quirky behavior
Shinya Kitaoka 120a6e
  gridLayout->addWidget(nameLabel, row, 0, Qt::AlignRight);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_name = new DVGui::LineEdit;
Shinya Kitaoka 120a6e
  gridLayout->addWidget(m_name, row++, 1);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  QLabel* regExpLabel = new QLabel(tr("Regular Expression:"));
Shinya Kitaoka 120a6e
  gridLayout->addWidget(regExpLabel, row, 0, Qt::AlignRight);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_regExp = new DVGui::LineEdit;
Shinya Kitaoka 120a6e
  gridLayout->addWidget(m_regExp, row++, 1);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  QLabel* priorityLabel = new QLabel(tr("Priority"));
Shinya Kitaoka 120a6e
  gridLayout->addWidget(priorityLabel, row, 0, Qt::AlignRight);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_priority = new DVGui::IntLineEdit;
Shinya Kitaoka 120a6e
  gridLayout->addWidget(m_priority, row++, 1);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  gridLayout->setRowMinimumHeight(row++, 20);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  // LevelProperties
Shinya Kitaoka 120a6e
  m_dpiPolicy = new QComboBox;
Shinya Kitaoka 120a6e
  gridLayout->addWidget(m_dpiPolicy, row++, 1);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_dpiPolicy->addItem(QObject::tr("Image DPI"));
Shinya Kitaoka 120a6e
  m_dpiPolicy->addItem(QObject::tr("Custom DPI"));
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  QLabel* dpiLabel = new QLabel(LevelSettingsPopup::tr("DPI:"));
Shinya Kitaoka 120a6e
  gridLayout->addWidget(dpiLabel, row, 0, Qt::AlignRight);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_dpi = new DVGui::DoubleLineEdit;
Shinya Kitaoka 120a6e
  m_dpi->setRange(1, (std::numeric_limits<double>::max)());  // Tried</double>
Shinya Kitaoka 120a6e
                                                             // limits::min(),
Shinya Kitaoka 120a6e
                                                             // but input 0 was
Shinya Kitaoka 120a6e
  gridLayout->addWidget(m_dpi, row++,
Shinya Kitaoka 120a6e
                        1);  // then replaced with something * e^-128
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_premultiply = new DVGui::CheckBox(LevelSettingsPopup::tr("Premultiply"));
Shinya Kitaoka 120a6e
  gridLayout->addWidget(m_premultiply, row++, 1);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_whiteTransp =
Shinya Kitaoka 120a6e
      new DVGui::CheckBox(LevelSettingsPopup::tr("White As Transparent"));
Shinya Kitaoka 120a6e
  gridLayout->addWidget(m_whiteTransp, row++, 1);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_doAntialias =
Shinya Kitaoka 120a6e
      new DVGui::CheckBox(LevelSettingsPopup::tr("Add Antialiasing"));
Shinya Kitaoka 120a6e
  gridLayout->addWidget(m_doAntialias, row++, 1);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  QLabel* antialiasLabel =
Shinya Kitaoka 120a6e
      new QLabel(LevelSettingsPopup::tr("Antialias Softness:"));
Shinya Kitaoka 120a6e
  gridLayout->addWidget(antialiasLabel, row, 0, Qt::AlignRight);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_antialias = new DVGui::IntLineEdit(
Shinya Kitaoka 120a6e
      this, 10, 0, 100);  // Tried 1, but then m_doAntialias was forcedly
Shinya Kitaoka 120a6e
  gridLayout->addWidget(m_antialias, row++, 1);  // initialized to true
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  QLabel* subsamplingLabel = new QLabel(LevelSettingsPopup::tr("Subsampling:"));
Shinya Kitaoka 120a6e
  gridLayout->addWidget(subsamplingLabel, row, 0, Qt::AlignRight);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_subsampling = new DVGui::IntLineEdit(this, 1, 1);
Shinya Kitaoka 120a6e
  gridLayout->addWidget(m_subsampling, row++, 1);
Toshihiro Shimizu 890ddd
shun-iwasawa 481b59
  QLabel* gammaLabel = new QLabel(LevelSettingsPopup::tr("Color Space Gamma:"));
shun-iwasawa 481b59
  gridLayout->addWidget(gammaLabel, row, 0, Qt::AlignRight);
shun-iwasawa 481b59
shun-iwasawa 481b59
  m_colorSpaceGamma = new DVGui::DoubleLineEdit(this);
shun-iwasawa 481b59
  m_colorSpaceGamma->setRange(0.1, 10.);
shun-iwasawa 481b59
  gridLayout->addWidget(m_colorSpaceGamma, row++, 1);
shun-iwasawa 481b59
Shinya Kitaoka 120a6e
  addLayout(gridLayout);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  endVLayout();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  // Establish connections
Shinya Kitaoka 120a6e
  bool ret = true;
Toshihiro Shimizu 890ddd
shun-iwasawa 481b59
  // enable gamma field only when the regexp field contains ".exr"
shun-iwasawa 481b59
  ret = connect(m_regExp, SIGNAL(editingFinished()),
shun-iwasawa 481b59
                SLOT(updateEnabledStatus())) &&
shun-iwasawa 481b59
        ret;
Shinya Kitaoka 120a6e
  ret = connect(m_dpiPolicy, SIGNAL(currentIndexChanged(int)),
Shinya Kitaoka 120a6e
                SLOT(updateEnabledStatus())) &&
Shinya Kitaoka 120a6e
        ret;
Shinya Kitaoka 120a6e
  ret =
Shinya Kitaoka 120a6e
      connect(m_doAntialias, SIGNAL(clicked()), SLOT(updateEnabledStatus())) &&
Shinya Kitaoka 120a6e
      ret;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  assert(ret);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void PreferencesPopup::FormatProperties::updateEnabledStatus() {
Shinya Kitaoka 120a6e
  m_dpi->setEnabled(m_dpiPolicy->currentIndex() == DP_CustomDpi);
Shinya Kitaoka 120a6e
  m_antialias->setEnabled(m_doAntialias->isChecked());
shun-iwasawa 481b59
shun-iwasawa 481b59
  // enable gamma field only when the regexp field contains ".exr"
shun-iwasawa 481b59
  m_colorSpaceGamma->setEnabled(m_regExp->text().contains(".exr"));
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
void PreferencesPopup::FormatProperties::setLevelFormat(
shun-iwasawa 8fb291
    const Preferences::LevelFormat& lf) {
shun-iwasawa 8fb291
  const LevelOptions& lo = lf.m_options;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_name->setText(lf.m_name);
Shinya Kitaoka 120a6e
  m_regExp->setText(lf.m_pathFormat.pattern());
Shinya Kitaoka 120a6e
  m_priority->setValue(lf.m_priority);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_dpiPolicy->setCurrentIndex(
Shinya Kitaoka 120a6e
      lo.m_dpiPolicy == LevelOptions::DP_ImageDpi ? DP_ImageDpi : DP_CustomDpi);
Shinya Kitaoka 120a6e
  m_dpi->setValue(lo.m_dpi);
Shinya Kitaoka 120a6e
  m_premultiply->setChecked(lo.m_premultiply);
Shinya Kitaoka 120a6e
  m_whiteTransp->setChecked(lo.m_whiteTransp);
Shinya Kitaoka 120a6e
  m_doAntialias->setChecked(lo.m_antialias > 0);
Shinya Kitaoka 120a6e
  m_antialias->setValue(lo.m_antialias);
Shinya Kitaoka 120a6e
  m_subsampling->setValue(lo.m_subsampling);
shun-iwasawa 481b59
  m_colorSpaceGamma->setValue(lo.m_colorSpaceGamma);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  updateEnabledStatus();
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
Preferences::LevelFormat PreferencesPopup::FormatProperties::levelFormat()
Shinya Kitaoka 120a6e
    const {
Shinya Kitaoka 120a6e
  Preferences::LevelFormat lf(m_name->text());
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  // Assign key values
Shinya Kitaoka 120a6e
  lf.m_pathFormat.setPattern(m_regExp->text());
Shinya Kitaoka 120a6e
  lf.m_priority = m_priority->getValue();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  // Assign level format values
shun-iwasawa 7c3c0a
  lf.m_options.m_dpiPolicy   = (m_dpiPolicy->currentIndex() == DP_ImageDpi)
shun-iwasawa 7c3c0a
                                   ? LevelOptions::DP_ImageDpi
shun-iwasawa 7c3c0a
                                   : LevelOptions::DP_CustomDpi;
Shinya Kitaoka 120a6e
  lf.m_options.m_dpi         = m_dpi->getValue();
Shinya Kitaoka 120a6e
  lf.m_options.m_subsampling = m_subsampling->getValue();
Shinya Kitaoka 120a6e
  lf.m_options.m_antialias =
Shinya Kitaoka 120a6e
      m_doAntialias->isChecked() ? m_antialias->getValue() : 0;
Shinya Kitaoka 120a6e
  lf.m_options.m_premultiply = m_premultiply->isChecked();
Shinya Kitaoka 120a6e
  lf.m_options.m_whiteTransp = m_whiteTransp->isChecked();
Toshihiro Shimizu 890ddd
shun-iwasawa 481b59
  if (m_colorSpaceGamma->isEnabled())
shun-iwasawa 481b59
    lf.m_options.m_colorSpaceGamma = m_colorSpaceGamma->getValue();
shun-iwasawa 481b59
Shinya Kitaoka 120a6e
  return lf;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//**********************************************************************************
shun-iwasawa c54dfb
//    PreferencesPopup::AdditionalStyleEdit  implementation
shun-iwasawa c54dfb
//**********************************************************************************
shun-iwasawa c54dfb
shun-iwasawa c54dfb
PreferencesPopup::AdditionalStyleEdit::AdditionalStyleEdit(
shun-iwasawa c54dfb
    PreferencesPopup* parent)
shun-iwasawa c54dfb
    : DVGui::Dialog(parent, true, false, "AdditionalStyleEdit") {
shun-iwasawa c54dfb
  setWindowTitle(tr("Additional Style Sheet"));
shun-iwasawa c54dfb
  setModal(true);
shun-iwasawa c54dfb
shun-iwasawa c54dfb
  m_edit                   = new QTextEdit(this);
shun-iwasawa c54dfb
  QPushButton* okButton    = new QPushButton(tr("OK"), this);
shun-iwasawa c54dfb
  QPushButton* applyButton = new QPushButton(tr("Apply"), this);
shun-iwasawa c54dfb
  QPushButton* closeButton = new QPushButton(tr("Close"), this);
shun-iwasawa c54dfb
shun-iwasawa c54dfb
  QString placeHolderTxt(
shun-iwasawa c54dfb
      "/* Type additional style sheet here to customize GUI. \n"
shun-iwasawa c54dfb
      "   Example: To enlarge the Style Editor buttons */\n\n"
shun-iwasawa c54dfb
      "#StyleEditor #bottomWidget QPushButton{ \n  padding : 13 21; \n }");
shun-iwasawa c54dfb
  m_edit->setPlaceholderText(placeHolderTxt);
shun-iwasawa c54dfb
  m_edit->setAcceptRichText(false);
shun-iwasawa c54dfb
shun-iwasawa c54dfb
  m_topLayout->addWidget(m_edit);
shun-iwasawa c54dfb
shun-iwasawa c54dfb
  addButtonBarWidget(okButton, applyButton, closeButton);
shun-iwasawa c54dfb
shun-iwasawa c54dfb
  bool ret = true;
shun-iwasawa c54dfb
  ret      = ret && connect(okButton, SIGNAL(pressed()), this, SLOT(onOK()));
shun-iwasawa c54dfb
  ret = ret && connect(applyButton, SIGNAL(pressed()), this, SLOT(onApply()));
shun-iwasawa c54dfb
  ret = ret && connect(closeButton, SIGNAL(pressed()), this, SLOT(close()));
shun-iwasawa c54dfb
}
shun-iwasawa c54dfb
shun-iwasawa c54dfb
void PreferencesPopup::AdditionalStyleEdit::showEvent(QShowEvent*) {
shun-iwasawa c54dfb
  m_edit->setPlainText(Preferences::instance()->getAdditionalStyleSheet());
shun-iwasawa c54dfb
}
shun-iwasawa c54dfb
shun-iwasawa c54dfb
void PreferencesPopup::AdditionalStyleEdit::onOK() {
shun-iwasawa c54dfb
  onApply();
shun-iwasawa c54dfb
  close();
shun-iwasawa c54dfb
}
shun-iwasawa c54dfb
shun-iwasawa c54dfb
void PreferencesPopup::AdditionalStyleEdit::onApply() {
shun-iwasawa c54dfb
  Preferences::instance()->setValue(additionalStyleSheet,
shun-iwasawa c54dfb
                                    m_edit->toPlainText());
shun-iwasawa c54dfb
  emit additionalSheetEdited();
shun-iwasawa c54dfb
}
shun-iwasawa c54dfb
shun-iwasawa c54dfb
//**********************************************************************************
shun-iwasawa 215a5b
//   PreferencesPopup::Display30bitCheckerView  implementation
shun-iwasawa 215a5b
//**********************************************************************************
shun-iwasawa 215a5b
shun-iwasawa 215a5b
PreferencesPopup::Display30bitChecker::GLView::GLView(QWidget* parent,
shun-iwasawa 215a5b
                                                      bool is30bit)
shun-iwasawa 215a5b
    : QOpenGLWidget(parent), m_is30bit(is30bit) {
shun-iwasawa 215a5b
  setFixedSize(500, 100);
shun-iwasawa 215a5b
  if (m_is30bit) setTextureFormat(TGL_TexFmt10);
shun-iwasawa 215a5b
}
shun-iwasawa 215a5b
shun-iwasawa 215a5b
void PreferencesPopup::Display30bitChecker::GLView::initializeGL() {
shun-iwasawa 215a5b
  initializeOpenGLFunctions();
shun-iwasawa 215a5b
  glClear(GL_COLOR_BUFFER_BIT);
shun-iwasawa 215a5b
}
shun-iwasawa 215a5b
void PreferencesPopup::Display30bitChecker::GLView::resizeGL(int width,
shun-iwasawa 215a5b
                                                             int height) {
shun-iwasawa 215a5b
  glViewport(0, 0, width, height);
shun-iwasawa 215a5b
  glMatrixMode(GL_PROJECTION);
shun-iwasawa 215a5b
  glLoadIdentity();
shun-iwasawa 215a5b
  glOrtho(0, 1, 0, 1, -1, 1);
shun-iwasawa 215a5b
  glMatrixMode(GL_MODELVIEW);
shun-iwasawa 215a5b
  glLoadIdentity();
shun-iwasawa 215a5b
}
shun-iwasawa 215a5b
void PreferencesPopup::Display30bitChecker::GLView::paintGL() {
shun-iwasawa 215a5b
  initializeOpenGLFunctions();
shun-iwasawa 215a5b
  glPushMatrix();
shun-iwasawa 215a5b
  glBegin(GL_QUADS);
shun-iwasawa 215a5b
  glColor3d(0.071, 0.153, 0.0);
shun-iwasawa 215a5b
  glVertex3d(0, 0, 0);
shun-iwasawa 215a5b
  glVertex3d(0, 1, 0);
shun-iwasawa 215a5b
  glColor3d(0.141, 0.239, 0.0);
shun-iwasawa 215a5b
  glVertex3d(1, 1, 0);
shun-iwasawa 215a5b
  glVertex3d(1, 0, 0);
shun-iwasawa 215a5b
  glEnd();
shun-iwasawa 215a5b
  glPopMatrix();
shun-iwasawa 215a5b
}
shun-iwasawa 215a5b
shun-iwasawa 215a5b
//-------------------------
shun-iwasawa 215a5b
shun-iwasawa 215a5b
PreferencesPopup::Display30bitChecker::Display30bitChecker(
shun-iwasawa 215a5b
    PreferencesPopup* parent)
shun-iwasawa 215a5b
    : QDialog(parent) {
shun-iwasawa 215a5b
  setModal(true);
shun-iwasawa 215a5b
  m_currentDefaultFormat = QSurfaceFormat::defaultFormat();
shun-iwasawa 215a5b
shun-iwasawa 215a5b
  setWindowTitle(tr("Check 30bit display availability"));
shun-iwasawa 215a5b
shun-iwasawa 215a5b
  QSurfaceFormat sFmt = m_currentDefaultFormat;
shun-iwasawa 215a5b
  sFmt.setRedBufferSize(10);
shun-iwasawa 215a5b
  sFmt.setGreenBufferSize(10);
shun-iwasawa 215a5b
  sFmt.setBlueBufferSize(10);
shun-iwasawa 215a5b
  sFmt.setAlphaBufferSize(2);
shun-iwasawa 215a5b
  QSurfaceFormat::setDefaultFormat(sFmt);
shun-iwasawa 215a5b
shun-iwasawa 215a5b
  GLView* view8bit      = new GLView(this, false);
shun-iwasawa 215a5b
  GLView* view10bit     = new GLView(this, true);
shun-iwasawa 215a5b
  QPushButton* closeBtn = new QPushButton(tr("Close"), this);
shun-iwasawa 215a5b
  QString infoLabel     = tr(
shun-iwasawa 481b59
      "If the lower gradient looks smooth and has no banding compared to the upper gradient,\n\
shun-iwasawa 215a5b
30bit display is available in the current configuration.");
shun-iwasawa 215a5b
shun-iwasawa 215a5b
  QVBoxLayout* lay = new QVBoxLayout();
shun-iwasawa 215a5b
  lay->setMargin(10);
shun-iwasawa 215a5b
  lay->setSpacing(10);
shun-iwasawa 215a5b
  {
shun-iwasawa 215a5b
    lay->addWidget(view8bit);
shun-iwasawa 215a5b
    lay->addWidget(view10bit);
shun-iwasawa 215a5b
    lay->addWidget(new QLabel(infoLabel, this));
shun-iwasawa 215a5b
    lay->addWidget(closeBtn, 0, Qt::AlignCenter);
shun-iwasawa 215a5b
  }
shun-iwasawa 215a5b
  setLayout(lay);
shun-iwasawa 215a5b
  lay->setSizeConstraint(QLayout::SetFixedSize);
shun-iwasawa 215a5b
shun-iwasawa 215a5b
  connect(closeBtn, SIGNAL(clicked()), this, SLOT(accept()));
shun-iwasawa 215a5b
}
shun-iwasawa 215a5b
shun-iwasawa 215a5b
PreferencesPopup::Display30bitChecker::~Display30bitChecker() {
shun-iwasawa 215a5b
  QSurfaceFormat::setDefaultFormat(m_currentDefaultFormat);
shun-iwasawa 215a5b
}
shun-iwasawa 215a5b
shun-iwasawa 215a5b
//**********************************************************************************
Toshihiro Shimizu 890ddd
//    PreferencesPopup  implementation
Toshihiro Shimizu 890ddd
//**********************************************************************************
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
void PreferencesPopup::rebuildFormatsList() {
shun-iwasawa 8fb291
  const Preferences& prefs = *Preferences::instance();
Jeremy Bullock 59dbbf
shun-iwasawa 8fb291
  m_levelFormatNames->clear();
Jeremy Bullock 7c096e
shun-iwasawa 8fb291
  int lf, lfCount = prefs.levelFormatsCount();
shun-iwasawa 8fb291
  for (lf = 0; lf != lfCount; ++lf)
shun-iwasawa 8fb291
    m_levelFormatNames->addItem(prefs.levelFormat(lf).m_name);
shun_iwasawa bb0d83
shun-iwasawa 8fb291
  m_editLevelFormat->setEnabled(m_levelFormatNames->count() > 0);
Jeremy Bullock e59b1f
}
Jeremy Bullock e59b1f
Jeremy Bullock e59b1f
//-----------------------------------------------------------------------------
Jeremy Bullock e59b1f
shun-iwasawa 8fb291
QList<comboboxitem> PreferencesPopup::buildFontStyleList() const {</comboboxitem>
shun-iwasawa 8fb291
  TFontManager* instance = TFontManager::instance();
shun-iwasawa 8fb291
  std::vector<std::wstring> typefaces;</std::wstring>
shun-iwasawa 8fb291
  std::vector<std::wstring>::iterator it;</std::wstring>
shun-iwasawa 8fb291
  QString font  = m_pref->getStringValue(interfaceFont);
shun-iwasawa 8fb291
  QString style = m_pref->getStringValue(interfaceFontStyle);
shun-iwasawa 8fb291
  try {
shun-iwasawa 8fb291
    instance->loadFontNames();
shun-iwasawa 8fb291
    instance->setFamily(font.toStdWString());
shun-iwasawa 8fb291
    instance->getAllTypefaces(typefaces);
shun-iwasawa 8fb291
  } catch (TFontCreationError&) {
shun-iwasawa 8fb291
    it = typefaces.begin();
shun-iwasawa 8fb291
    typefaces.insert(it, style.toStdWString());
shun-iwasawa 8fb291
  }
shun-iwasawa 8fb291
  QList<comboboxitem> styleList;</comboboxitem>
shun-iwasawa 8fb291
  for (it = typefaces.begin(); it != typefaces.end(); ++it)
shun-iwasawa 8fb291
    styleList.append(ComboBoxItem(QString::fromStdWString(*it),
shun-iwasawa 8fb291
                                  QString::fromStdWString(*it)));
shun-iwasawa 8fb291
  return styleList;
Jeremy Bullock e59b1f
}
Jeremy Bullock e59b1f
Jeremy Bullock e59b1f
//-----------------------------------------------------------------------------
Jeremy Bullock e59b1f
shun-iwasawa 8fb291
void PreferencesPopup::onAutoSaveChanged() {
shun-iwasawa 8fb291
  bool on = getUI<qgroupbox*>(autosaveEnabled)->isChecked();</qgroupbox*>
shun-iwasawa 8fb291
  if (!on) return;
shun-iwasawa 8fb291
  CheckBox* autoSaveSceneCB      = getUI<checkbox*>(autosaveSceneEnabled);</checkbox*>
shun-iwasawa 8fb291
  CheckBox* autoSaveOtherFilesCB = getUI<checkbox*>(autosaveOtherFilesEnabled);</checkbox*>
shun-iwasawa 8fb291
  if (!autoSaveSceneCB->isChecked() && !autoSaveOtherFilesCB->isChecked()) {
shun-iwasawa 8fb291
    autoSaveSceneCB->setChecked(true);
shun-iwasawa 8fb291
    autoSaveOtherFilesCB->setChecked(true);
Jeremy Bullock 59dbbf
  }
shun_iwasawa bb0d83
}
shun_iwasawa bb0d83
shun_iwasawa bb0d83
//-----------------------------------------------------------------------------
shun_iwasawa bb0d83
shun-iwasawa 8fb291
void PreferencesPopup::onAutoSaveOptionsChanged() {
shun-iwasawa 8fb291
  bool autoSaveScene = getUI<checkbox*>(autosaveSceneEnabled)->isChecked();</checkbox*>
shun-iwasawa 8fb291
  bool autoSaveOtherFiles =
shun-iwasawa 8fb291
      getUI<checkbox*>(autosaveOtherFilesEnabled)->isChecked();</checkbox*>
shun-iwasawa 8fb291
  if (!autoSaveScene && !autoSaveOtherFiles) {
shun-iwasawa 8fb291
    getUI<qgroupbox*>(autosaveEnabled)->setChecked(false);</qgroupbox*>
Jeremy Bullock 59dbbf
  }
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
void PreferencesPopup::onWatchFileSystemClicked() {
shun-iwasawa 8fb291
  // emit signal to update behavior of the File browser
shun-iwasawa 8fb291
  TApp::instance()->getCurrentScene()->notifyPreferenceChanged(
shun-iwasawa 8fb291
      "WatchFileSystem");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
void PreferencesPopup::onPathAliasPriorityChanged() {
shun-iwasawa 8fb291
  TApp::instance()->getCurrentScene()->notifyPreferenceChanged(
shun-iwasawa 8fb291
      "PathAliasPriority");
Jeremy Bullock 4ce953
}
Jeremy Bullock 4ce953
Jeremy Bullock 4ce953
//-----------------------------------------------------------------------------
Jeremy Bullock 4ce953
shun-iwasawa 8fb291
void PreferencesPopup::onStyleSheetTypeChanged() {
shun-iwasawa 8fb291
  QApplication::setOverrideCursor(Qt::WaitCursor);
shun-iwasawa c54dfb
  QString currentStyle = m_pref->getCurrentStyleSheet();
shun-iwasawa 8fb291
  qApp->setStyleSheet(currentStyle);
shun-iwasawa 8fb291
  QApplication::restoreOverrideCursor();
turtletooth 8d9ba3
}
turtletooth 8d9ba3
turtletooth 8d9ba3
//-----------------------------------------------------------------------------
turtletooth 8d9ba3
Kite 521c84
void PreferencesPopup::onIconThemeChanged() {
Kite 521c84
  // Switch between dark or light icons
Kite 521c84
  QIcon::setThemeName(Preferences::instance()->getIconTheme() ? "dark"
Kite 521c84
                                                              : "light");
Kite 521c84
  // qDebug() << "Icon theme name (preference switch):" << QIcon::themeName();
Kite 521c84
}
Kite 521c84
Kite 521c84
//-----------------------------------------------------------------------------
Kite 521c84
shun-iwasawa 8fb291
void PreferencesPopup::onPixelsOnlyChanged() {
shun-iwasawa 8fb291
  QComboBox* unitOm           = getUI<qcombobox*>(linearUnits);</qcombobox*>
shun-iwasawa 8fb291
  QComboBox* cameraUnitOm     = getUI<qcombobox*>(cameraUnits);</qcombobox*>
shun-iwasawa 8fb291
  DoubleLineEdit* defLevelDpi = getUI<doublelineedit*>(DefLevelDpi);</doublelineedit*>
shun-iwasawa 8fb291
  MeasuredDoubleLineEdit* defLevelWidth =
shun-iwasawa 8fb291
      getUI<measureddoublelineedit*>(DefLevelWidth);</measureddoublelineedit*>
shun-iwasawa 8fb291
  MeasuredDoubleLineEdit* defLevelHeight =
shun-iwasawa 8fb291
      getUI<measureddoublelineedit*>(DefLevelHeight);</measureddoublelineedit*>
Jeremy Bullock 3a06bd
shun-iwasawa 8fb291
  bool isPixel = m_pref->getBoolValue(pixelsOnly);
shun-iwasawa 8fb291
  if (isPixel) {
shun-iwasawa 8fb291
    m_pref->setValue(DefLevelDpi, Stage::standardDpi);
shun-iwasawa 8fb291
    TCamera* camera =
shun-iwasawa 8fb291
        TApp::instance()->getCurrentScene()->getScene()->getCurrentCamera();
shun-iwasawa 8fb291
    TDimension camRes = camera->getRes();
shun-iwasawa 8fb291
    TDimensionD camSize;
shun-iwasawa 8fb291
    camSize.lx = camRes.lx / Stage::standardDpi;
shun-iwasawa 8fb291
    camSize.ly = camRes.ly / Stage::standardDpi;
shun-iwasawa 8fb291
    camera->setSize(camSize);
shun-iwasawa 8fb291
    TDimension cleanupRes = CleanupSettingsModel::instance()
shun-iwasawa 8fb291
                                ->getCurrentParameters()
shun-iwasawa 8fb291
                                ->m_camera.getRes();
shun-iwasawa 8fb291
    TDimensionD cleanupSize;
shun-iwasawa 8fb291
    cleanupSize.lx = cleanupRes.lx / Stage::standardDpi;
shun-iwasawa 8fb291
    cleanupSize.ly = cleanupRes.ly / Stage::standardDpi;
shun-iwasawa 8fb291
    CleanupSettingsModel::instance()->getCurrentParameters()->m_camera.setSize(
shun-iwasawa 8fb291
        cleanupSize);
Jeremy Bullock 3a06bd
shun-iwasawa 8fb291
    m_pref->storeOldUnits();
manongjohn b66bc4
shun-iwasawa 8fb291
    if (unitOm->currentText() != tr("pixel"))
shun-iwasawa 8fb291
      unitOm->setCurrentText(tr("pixel"));
shun-iwasawa 8fb291
    if (cameraUnitOm->currentText() != tr("pixel"))
shun-iwasawa 8fb291
      cameraUnitOm->setCurrentText(tr("pixel"));
shun-iwasawa 8fb291
    unitOm->setDisabled(true);
shun-iwasawa 8fb291
    cameraUnitOm->setDisabled(true);
shun-iwasawa 8fb291
    defLevelDpi->setDisabled(true);
shun-iwasawa 8fb291
    defLevelDpi->setValue(Stage::standardDpi);
shun-iwasawa 8fb291
    defLevelWidth->setMeasure("camera.lx");
shun-iwasawa 8fb291
    defLevelHeight->setMeasure("camera.ly");
shun-iwasawa 8fb291
    defLevelWidth->setValue(m_pref->getDoubleValue(DefLevelWidth));
shun-iwasawa 8fb291
    defLevelHeight->setValue(m_pref->getDoubleValue(DefLevelHeight));
shun-iwasawa 8fb291
    defLevelHeight->setDecimals(0);
shun-iwasawa 8fb291
    defLevelWidth->setDecimals(0);
shun-iwasawa 8fb291
  } else {
shun-iwasawa 8fb291
    QString tempUnit = m_pref->getStringValue(oldUnits);
shun-iwasawa 8fb291
    unitOm->setCurrentIndex(unitOm->findData(tempUnit));
shun-iwasawa 8fb291
    tempUnit = m_pref->getStringValue(oldCameraUnits);
shun-iwasawa 8fb291
    cameraUnitOm->setCurrentIndex(cameraUnitOm->findData(tempUnit));
shun-iwasawa 8fb291
    unitOm->setDisabled(false);
shun-iwasawa 8fb291
    cameraUnitOm->setDisabled(false);
shun-iwasawa 8fb291
    bool isRaster = m_pref->getIntValue(DefLevelType) != PLI_XSHLEVEL;
shun-iwasawa 8fb291
    if (isRaster) {
shun-iwasawa 8fb291
      defLevelDpi->setDisabled(false);
shun-iwasawa 8fb291
    }
shun-iwasawa 8fb291
    defLevelHeight->setMeasure("level.ly");
shun-iwasawa 8fb291
    defLevelWidth->setMeasure("level.lx");
shun-iwasawa 8fb291
    defLevelWidth->setValue(m_pref->getDoubleValue(DefLevelWidth));
shun-iwasawa 8fb291
    defLevelHeight->setValue(m_pref->getDoubleValue(DefLevelHeight));
shun-iwasawa 8fb291
    defLevelHeight->setDecimals(4);
shun-iwasawa 8fb291
    defLevelWidth->setDecimals(4);
manongjohn b66bc4
  }
shun-iwasawa 29ceb2
  TApp::instance()->getCurrentScene()->notifyPreferenceChanged("pixelsOnly");
Jeremy Bullock 807052
}
Jeremy Bullock 807052
Jeremy Bullock 807052
//-----------------------------------------------------------------------------
Jeremy Bullock 807052
shun-iwasawa 8fb291
void PreferencesPopup::onUnitChanged() {
shun-iwasawa 8fb291
  CheckBox* pixelsOnlyCB = getUI<checkbox*>(pixelsOnly);</checkbox*>
shun-iwasawa 8fb291
  if (!pixelsOnlyCB->isChecked() &&
shun-iwasawa 8fb291
      (m_pref->getStringValue(linearUnits) == "pixel" ||
shun-iwasawa 8fb291
       m_pref->getStringValue(cameraUnits) == "pixel")) {
shun-iwasawa 8fb291
    pixelsOnlyCB->setCheckState(Qt::Checked);
shun-iwasawa 8fb291
  }
Jeremy Bullock 807052
}
Jeremy Bullock 807052
Jeremy Bullock 807052
//-----------------------------------------------------------------------------
Jeremy Bullock 807052
shun-iwasawa 8fb291
void PreferencesPopup::beforeRoomChoiceChanged() {
shun-iwasawa 8fb291
  TApp::instance()->writeSettings();
Jeremy Bullock b53dba
}
Jeremy Bullock b53dba
Jeremy Bullock b53dba
//-----------------------------------------------------------------------------
Jeremy Bullock b53dba
shun-iwasawa a8f111
void PreferencesPopup::onColorCalibrationChanged() {
shun-iwasawa a8f111
  LutManager::instance()->update();
shun-iwasawa a8f111
  TApp::instance()->getCurrentScene()->notifyPreferenceChanged(
shun-iwasawa a8f111
      "ColorCalibration");
shun-iwasawa a8f111
}
shun-iwasawa a8f111
shun-iwasawa a8f111
//-----------------------------------------------------------------------------
shun-iwasawa a8f111
shun-iwasawa 8fb291
void PreferencesPopup::onDefLevelTypeChanged() {
shun-iwasawa 8fb291
  bool isRaster = m_pref->getIntValue(DefLevelType) != PLI_XSHLEVEL &&
shun-iwasawa 8fb291
                  !m_pref->getBoolValue(newLevelSizeToCameraSizeEnabled);
shun-iwasawa 8fb291
  m_controlIdMap.key(DefLevelWidth)->setEnabled(isRaster);
shun-iwasawa 8fb291
  m_controlIdMap.key(DefLevelHeight)->setEnabled(isRaster);
shun-iwasawa 8fb291
  if (!m_pref->getBoolValue(pixelsOnly))
shun-iwasawa 8fb291
    m_controlIdMap.key(DefLevelDpi)->setEnabled(isRaster);
Jeremy Bullock b53dba
}
Jeremy Bullock b53dba
Jeremy Bullock b53dba
//-----------------------------------------------------------------------------
Jeremy Bullock b53dba
shun-iwasawa 8fb291
void PreferencesPopup::onUseNumpadForSwitchingStylesClicked() {
shun-iwasawa 8fb291
  bool checked = m_pref->getBoolValue(useNumpadForSwitchingStyles);
shun-iwasawa 8fb291
  if (checked) {
shun-iwasawa 8fb291
    // check if there are any commands with numpadkey shortcuts
shun-iwasawa 8fb291
    CommandManager* cm = CommandManager::instance();
shun-iwasawa 8fb291
    QList<qaction*> actionsList;</qaction*>
shun-iwasawa 8fb291
    for (int key = Qt::Key_0; key <= Qt::Key_9; key++) {
shun-iwasawa 8fb291
      std::string str = QKeySequence(key).toString().toStdString();
shun-iwasawa 8fb291
      QAction* action = cm->getActionFromShortcut(str);
shun-iwasawa 8fb291
      if (action) actionsList.append(action);
shun-iwasawa 8fb291
    }
shun-iwasawa 8fb291
    QAction* tabAction = cm->getActionFromShortcut("Tab");
shun-iwasawa 8fb291
    if (tabAction) actionsList.append(tabAction);
shun-iwasawa 8fb291
    tabAction = cm->getActionFromShortcut("Shift+Tab");
shun-iwasawa 8fb291
    if (tabAction) actionsList.append(tabAction);
shun-iwasawa 8fb291
    // if there are actions using numpad shortcuts, notify to release them.
shun-iwasawa 8fb291
    if (!actionsList.isEmpty()) {
shun-iwasawa 8fb291
      QString msgStr =
shun-iwasawa 8fb291
          tr("Numpad keys are assigned to the following commands.\nIs it OK to "
shun-iwasawa 8fb291
             "release these shortcuts?");
shun-iwasawa 8fb291
      for (int a = 0; a < actionsList.size(); a++) {
shun-iwasawa 8fb291
        msgStr += "\n" + actionsList.at(a)->iconText() + "  (" +
shun-iwasawa 8fb291
                  actionsList.at(a)->shortcut().toString() + ")";
shun-iwasawa 8fb291
      }
shun-iwasawa 8fb291
      int ret = DVGui::MsgBox(msgStr, tr("OK"), tr("Cancel"), 1);
shun-iwasawa 8fb291
      if (ret == 2 || ret == 0) {  // canceled
shun-iwasawa 8fb291
        getUI<checkbox*>(useNumpadForSwitchingStyles)->setChecked(false);</checkbox*>
shun-iwasawa 8fb291
        return;
shun-iwasawa 8fb291
      } else {  // accepted, then release shortcuts
shun-iwasawa 8fb291
        for (int a = 0; a < actionsList.size(); a++)
shun-iwasawa 8fb291
          cm->setShortcut(actionsList[a], "");
shun-iwasawa 8fb291
      }
shun-iwasawa 8fb291
    }
shun-iwasawa 8fb291
  }
shun-iwasawa 8fb291
  // emit signal to update Palette and Viewer
shun-iwasawa 8fb291
  TApp::instance()->getCurrentScene()->notifyPreferenceChanged(
shun-iwasawa 8fb291
      "NumpadForSwitchingStyles");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
void PreferencesPopup::onLevelBasedToolsDisplayChanged() {
shun-iwasawa 8fb291
  TApp::instance()->getCurrentScene()->notifyPreferenceChanged(
shun-iwasawa 8fb291
      "ToolbarDisplay");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
void PreferencesPopup::onShowKeyframesOnCellAreaChanged() {
shun-iwasawa 8fb291
  TApp::instance()->getCurrentScene()->notifyPreferenceChanged("XsheetCamera");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
void PreferencesPopup::onShowXSheetToolbarClicked() {
shun-iwasawa 8fb291
  TApp::instance()->getCurrentScene()->notifyPreferenceChanged("XSheetToolbar");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 4a3868
void PreferencesPopup::onModifyExpressionOnMovingReferencesChanged() {
shun-iwasawa 4a3868
  TApp::instance()->getCurrentScene()->notifyPreferenceChanged(
shun-iwasawa 4a3868
      "modifyExpressionOnMovingReferences");
shun-iwasawa 4a3868
}
shun-iwasawa 4a3868
shun-iwasawa 4a3868
//-----------------------------------------------------------------------------
shun-iwasawa 4a3868
shun-iwasawa 8fb291
void PreferencesPopup::onBlankCountChanged() {
shun-iwasawa 8fb291
  TApp::instance()->getCurrentScene()->notifyPreferenceChanged("BlankCount");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
void PreferencesPopup::onBlankColorChanged() {
shun-iwasawa 8fb291
  TApp::instance()->getCurrentScene()->notifyPreferenceChanged("BlankColor");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
void PreferencesPopup::onOnionSkinVisibilityChanged() {
shun-iwasawa 8fb291
  bool onionActive = m_pref->getBoolValue(onionSkinEnabled);
shun-iwasawa 8fb291
  m_controlIdMap.key(onionPaperThickness)->setEnabled(onionActive);
shun-iwasawa 8fb291
  m_controlIdMap.key(backOnionColor)->setEnabled(onionActive);
shun-iwasawa 8fb291
  m_controlIdMap.key(frontOnionColor)->setEnabled(onionActive);
shun-iwasawa 8fb291
  m_controlIdMap.key(onionInksOnly)->setEnabled(onionActive);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  OnionSkinMask osm =
shun-iwasawa 8fb291
      TApp::instance()->getCurrentOnionSkin()->getOnionSkinMask();
shun-iwasawa 8fb291
  osm.enable(onionActive);
shun-iwasawa 8fb291
  TApp::instance()->getCurrentOnionSkin()->setOnionSkinMask(osm);
shun-iwasawa 8fb291
  TApp::instance()->getCurrentOnionSkin()->notifyOnionSkinMaskChanged();
shun-iwasawa 133733
}
shun-iwasawa 133733
Toshihiro Shimizu 890ddd
//---------------------------------------------------------------------------------------
shun-iwasawa 133733
shun-iwasawa 8fb291
void PreferencesPopup::onOnionColorChanged() {
Shinya Kitaoka 120a6e
  TApp::instance()->getCurrentScene()->notifySceneChanged();
Shinya Kitaoka 120a6e
  TApp::instance()->getCurrentLevel()->notifyLevelViewChange();
shun-iwasawa 1d5937
  TApp::instance()->getCurrentOnionSkin()->notifyOnionSkinMaskChanged();
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void invalidateIcons();  // implemented in sceneviewer.cpp; in which fucking
Shinya Kitaoka 120a6e
                         // header  I can put this declaration?!
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
void PreferencesPopup::onTranspCheckDataChanged() { invalidateIcons(); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
justburner a13da2
void PreferencesPopup::onChessboardChanged() {
justburner a13da2
  CommonChessboard::instance()->update();
justburner a13da2
}
justburner a13da2
justburner a13da2
//-----------------------------------------------------------------------------
justburner a13da2
shun-iwasawa 8fb291
void PreferencesPopup::onSVNEnabledChanged() {
shun-iwasawa 8fb291
  if (m_pref->getBoolValue(SVNEnabled)) {
shun-iwasawa 8fb291
    if (!VersionControl::instance()->testSetup())
shun-iwasawa 8fb291
      getUI<checkbox*>(SVNEnabled)->setChecked(false);</checkbox*>
shun-iwasawa 8fb291
  }
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
void PreferencesPopup::notifySceneChanged() {
Shinya Kitaoka 120a6e
  TApp::instance()->getCurrentScene()->notifySceneChanged();
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
void PreferencesPopup::onAutoSaveExternallyChanged() {
shun-iwasawa 8fb291
  QGroupBox* autoSaveGroup = getUI<qgroupbox*>(autosaveEnabled);</qgroupbox*>
shun-iwasawa 8fb291
  autoSaveGroup->setChecked(m_pref->getBoolValue(autosaveEnabled));
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
void PreferencesPopup::onAutoSavePeriodExternallyChanged() {
shun-iwasawa 8fb291
  IntLineEdit* minuteFld = getUI<intlineedit*>(autosavePeriod);</intlineedit*>
shun-iwasawa 8fb291
  minuteFld->setValue(m_pref->getIntValue(autosavePeriod));
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
void PreferencesPopup::onProjectRootChanged() {
shun-iwasawa 8fb291
  int index = 0;
shun-iwasawa 8fb291
  // if (m_projectRootStuff->isChecked())
shun-iwasawa 8fb291
  index |= 0x08;
shun-iwasawa 8fb291
  if (m_projectRootDocuments->isChecked()) index |= 0x04;
shun-iwasawa 8fb291
  if (m_projectRootDesktop->isChecked()) index |= 0x02;
shun-iwasawa 8fb291
  if (m_projectRootCustom->isChecked()) index |= 0x01;
shun-iwasawa 8fb291
  m_pref->setValue(projectRoot, index);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa c54dfb
void PreferencesPopup::onEditAdditionalStyleSheet() {
shun-iwasawa c54dfb
  if (!m_additionalStyleEdit) {
shun-iwasawa c54dfb
    m_additionalStyleEdit = new AdditionalStyleEdit(this);
shun-iwasawa c54dfb
shun-iwasawa c54dfb
    bool ret = connect(m_additionalStyleEdit, SIGNAL(additionalSheetEdited()),
shun-iwasawa c54dfb
                       this, SLOT(onAdditionalStyleSheetEdited()));
shun-iwasawa c54dfb
    assert(ret);
shun-iwasawa c54dfb
  }
shun-iwasawa c54dfb
  m_additionalStyleEdit->show();
shun-iwasawa c54dfb
}
shun-iwasawa c54dfb
shun-iwasawa c54dfb
//-----------------------------------------------------------------------------
shun-iwasawa c54dfb
shun-iwasawa c54dfb
void PreferencesPopup::onAdditionalStyleSheetEdited() {
shun-iwasawa c54dfb
  onStyleSheetTypeChanged();
shun-iwasawa c54dfb
}
shun-iwasawa c54dfb
shun-iwasawa c54dfb
//-----------------------------------------------------------------------------
shun-iwasawa c54dfb
shun-iwasawa 8fb291
void PreferencesPopup::onPixelUnitExternallySelected(bool on) {
shun-iwasawa 8fb291
  CheckBox* pixelsOnlyCB = getUI<checkbox*>(pixelsOnly);</checkbox*>
shun-iwasawa 8fb291
  // call slot function onPixelsOnlyChanged() accordingly
shun-iwasawa 8fb291
  pixelsOnlyCB->setCheckState((on) ? Qt::Checked : Qt::Unchecked);
Jeremy Bullock 8c5007
}
Jeremy Bullock 8c5007
Jeremy Bullock 8c5007
//-----------------------------------------------------------------------------
Jeremy Bullock 8c5007
shun-iwasawa 8fb291
void PreferencesPopup::onInterfaceFontChanged(const QString& text) {
shun-iwasawa 8fb291
  m_pref->setValue(interfaceFont, text);
Jeremy Bullock 3f573c
shun-iwasawa 8fb291
  // rebuild font styles
shun-iwasawa 8fb291
  QComboBox* fontStyleCombo         = getUI<qcombobox*>(interfaceFontStyle);</qcombobox*>
shun-iwasawa 8fb291
  QString oldTypeface               = fontStyleCombo->currentText();
shun-iwasawa 8fb291
  QList<comboboxitem> newStyleItems = buildFontStyleList();</comboboxitem>
shun-iwasawa 8fb291
  fontStyleCombo->clear();
shun-iwasawa 8fb291
  for (ComboBoxItem& item : newStyleItems)
shun-iwasawa 8fb291
    fontStyleCombo->addItem(item.first, item.second);
shun-iwasawa 8fb291
  if (!oldTypeface.isEmpty()) {
shun-iwasawa c54dfb
    int newIndex = fontStyleCombo->findText(oldTypeface);
shun-iwasawa 8fb291
    if (newIndex < 0) newIndex = 0;
shun-iwasawa 8fb291
    fontStyleCombo->setCurrentIndex(newIndex);
shun-iwasawa 8fb291
  }
Jeremy Bullock 3f573c
shun-iwasawa 8fb291
  if (text.contains("Comic Sans"))
shun-iwasawa 8fb291
    DVGui::warning(tr("Life is too short for Comic Sans"));
shun-iwasawa 8fb291
  if (text.contains("Wingdings"))
shun-iwasawa 8fb291
    DVGui::warning(tr("Good luck.  You're on your own from here."));
Jeremy Bullock 3f573c
}
Jeremy Bullock 3f573c
Jeremy Bullock 3f573c
//-----------------------------------------------------------------------------
Jeremy Bullock 3f573c
shun-iwasawa 8fb291
void PreferencesPopup::onLutPathChanged() {
shun-iwasawa 8fb291
  FileField* lutPathFileField = getUI<filefield*>(colorCalibrationLutPaths);</filefield*>
shun-iwasawa 8fb291
  m_pref->setColorCalibrationLutPath(LutManager::instance()->getMonitorName(),
shun-iwasawa 8fb291
                                     lutPathFileField->getPath());
shun-iwasawa a8f111
  onColorCalibrationChanged();
Jeremy Bullock 3e69f9
}
Jeremy Bullock 3e69f9
Jeremy Bullock 3e69f9
//-----------------------------------------------------------------------------
Jeremy Bullock 3e69f9
shun-iwasawa 215a5b
void PreferencesPopup::onCheck30bitDisplay() {
shun-iwasawa 215a5b
  Display30bitChecker checker(this);
shun-iwasawa 215a5b
  checker.exec();
shun-iwasawa 215a5b
}
shun-iwasawa 215a5b
shun-iwasawa 215a5b
//-----------------------------------------------------------------------------
shun-iwasawa 215a5b
shun-iwasawa 8fb291
void PreferencesPopup::onAddLevelFormat() {
shun-iwasawa 8fb291
  bool ok            = true;
shun-iwasawa 8fb291
  QString formatName = DVGui::getText(tr("New Level Format"),
shun-iwasawa 8fb291
                                      tr("Assign the new level format name:"),
shun-iwasawa 8fb291
                                      tr("New Format"), &ok);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  if (ok) {
shun-iwasawa 8fb291
    int formatIdx = Preferences::instance()->addLevelFormat(formatName);
shun-iwasawa 8fb291
    rebuildFormatsList();
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
    m_levelFormatNames->setCurrentIndex(formatIdx);
shun-iwasawa 8fb291
  }
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
void PreferencesPopup::onRemoveLevelFormat() {
shun-iwasawa 8fb291
  Preferences::instance()->removeLevelFormat(
shun-iwasawa 8fb291
      m_levelFormatNames->currentIndex());
shun-iwasawa 8fb291
  rebuildFormatsList();
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
void PreferencesPopup::onEditLevelFormat() {
shun-iwasawa 8fb291
  if (!m_formatProperties) {
shun-iwasawa 8fb291
    m_formatProperties = new FormatProperties(this);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
    bool ret = connect(m_formatProperties, SIGNAL(dialogClosed()),
shun-iwasawa 8fb291
                       SLOT(onLevelFormatEdited()));
shun-iwasawa 8fb291
    assert(ret);
shun-iwasawa 8fb291
  }
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  const Preferences::LevelFormat& lf =
shun-iwasawa 8fb291
      Preferences::instance()->levelFormat(m_levelFormatNames->currentIndex());
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  m_formatProperties->setLevelFormat(lf);
shun-iwasawa 8fb291
  m_formatProperties->show();
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
void PreferencesPopup::onLevelFormatEdited() {
shun-iwasawa 8fb291
  assert(m_formatProperties);
Jeremy Bullock 890b52
shun-iwasawa 8fb291
  Preferences& prefs = *Preferences::instance();
shun-iwasawa 8fb291
  int formatIdx      = m_levelFormatNames->currentIndex();
Jeremy Bullock 890b52
shun-iwasawa 8fb291
  prefs.removeLevelFormat(formatIdx);
shun-iwasawa 8fb291
  formatIdx = prefs.addLevelFormat(m_formatProperties->levelFormat());
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  rebuildFormatsList();
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  m_levelFormatNames->setCurrentIndex(formatIdx);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
void PreferencesPopup::onImportPolicyExternallyChanged(int policy) {
shun-iwasawa 8fb291
  QComboBox* importPolicyCombo = getUI<qcombobox*>(importPolicy);</qcombobox*>
shun-iwasawa 8fb291
  // update preferences data accordingly
shun-iwasawa 8fb291
  importPolicyCombo->setCurrentIndex(policy);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
QWidget* PreferencesPopup::createUI(PreferencesItemId id,
shun-iwasawa 8fb291
                                    const QList<comboboxitem>& comboItems) {</comboboxitem>
shun-iwasawa 8fb291
  PreferencesItem item = m_pref->getItem(id);
shun-iwasawa 8fb291
  // create widget depends on the parameter types
shun-iwasawa 8fb291
  QWidget* widget = nullptr;
shun-iwasawa 8fb291
  bool ret        = false;
shun-iwasawa 8fb291
  switch (item.type) {
shun-iwasawa 8fb291
  case QMetaType::Bool:  // create CheckBox
shun-iwasawa 8fb291
  {
shun-iwasawa 8fb291
    CheckBox* cb = new CheckBox(getUIString(id), this);
shun-iwasawa 8fb291
    cb->setChecked(item.value.toBool());
shun-iwasawa 8fb291
    ret    = connect(cb, SIGNAL(stateChanged(int)), this, SLOT(onChange()));
shun-iwasawa 8fb291
    widget = cb;
shun-iwasawa 8fb291
  } break;
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  case QMetaType::Int:            // create either QComboBox or IntLineEdit
shun-iwasawa 8fb291
    if (!comboItems.isEmpty()) {  // create QComboBox
shun-iwasawa 8fb291
      QComboBox* combo = new QComboBox(this);
shun-iwasawa 8fb291
      for (const ComboBoxItem& item : comboItems)
shun-iwasawa 8fb291
        combo->addItem(item.first, item.second);
shun-iwasawa 8fb291
      combo->setCurrentIndex(combo->findData(item.value));
shun-iwasawa c54dfb
      ret    = connect(combo, SIGNAL(currentIndexChanged(int)), this,
shun-iwasawa 7c3c0a
                       SLOT(onChange()));
shun-iwasawa 8fb291
      widget = combo;
shun-iwasawa 8fb291
    } else {  // create IntLineEdit
shun-iwasawa 8fb291
      assert(item.max.toInt() != -1);
shun-iwasawa 8fb291
      DVGui::IntLineEdit* field = new DVGui::IntLineEdit(
shun-iwasawa 8fb291
          this, item.value.toInt(), item.min.toInt(), item.max.toInt());
shun-iwasawa 8fb291
      ret = connect(field, SIGNAL(editingFinished()), this, SLOT(onChange()));
shun-iwasawa 8fb291
      widget = field;
shun-iwasawa 8fb291
    }
shun-iwasawa 8fb291
    break;
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  case QMetaType::Double:     // create either MeasuredDoubleLineEdit or
shun-iwasawa 8fb291
                              // DoubleLineEdit
shun-iwasawa 8fb291
    if (id == DefLevelDpi) {  // currently DoubleLineEdit is only used in the
shun-iwasawa 8fb291
                              // dpi field
shun-iwasawa 8fb291
      DoubleLineEdit* field = new DoubleLineEdit(this, item.value.toDouble());
shun-iwasawa 8fb291
      field->setRange(item.min.toDouble(), item.max.toDouble());
shun-iwasawa 8fb291
      ret    = connect(field, SIGNAL(valueChanged()), this, SLOT(onChange()));
shun-iwasawa 8fb291
      widget = field;
shun-iwasawa 8fb291
    } else {
shun-iwasawa 8fb291
      MeasuredDoubleLineEdit* field = new MeasuredDoubleLineEdit(this);
shun-iwasawa 8fb291
      field->setRange(item.min.toDouble(), item.max.toDouble());
shun-iwasawa 8fb291
      if (m_pref->getStringValue(linearUnits) == "pixel")
shun-iwasawa 8fb291
        field->setMeasure((id == DefLevelWidth) ? "camera.lx" : "camera.ly");
shun-iwasawa 8fb291
      else
shun-iwasawa 8fb291
        field->setMeasure((id == DefLevelWidth) ? "level.lx" : "level.ly");
shun-iwasawa 8fb291
      field->setValue(item.value.toDouble());
shun-iwasawa 8fb291
      ret    = connect(field, SIGNAL(valueChanged()), this, SLOT(onChange()));
shun-iwasawa 8fb291
      widget = field;
shun-iwasawa 8fb291
    }
shun-iwasawa 8fb291
    break;
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  case QMetaType::QString:      // create QFontComboBox, QComboBox or FileField
shun-iwasawa 8fb291
    if (id == interfaceFont) {  // create QFontComboBox
shun-iwasawa 8fb291
      QFontComboBox* combo = new QFontComboBox(this);
shun-iwasawa 8fb291
      combo->setCurrentText(item.value.toString());
shun-iwasawa c54dfb
      ret    = connect(combo, SIGNAL(currentIndexChanged(const QString&)), this,
shun-iwasawa 7c3c0a
                       SLOT(onInterfaceFontChanged(const QString&)));
shun-iwasawa 8fb291
      widget = combo;
shun-iwasawa 8fb291
    } else if (!comboItems.isEmpty()) {  // create QComboBox
shun-iwasawa 8fb291
      QComboBox* combo = new QComboBox(this);
shun-iwasawa 8fb291
      for (const ComboBoxItem& item : comboItems)
shun-iwasawa 8fb291
        combo->addItem(item.first, item.second);
shun-iwasawa 8fb291
      combo->setCurrentIndex(combo->findData(item.value));
shun-iwasawa c54dfb
      ret    = connect(combo, SIGNAL(currentIndexChanged(int)), this,
shun-iwasawa 7c3c0a
                       SLOT(onChange()));
shun-iwasawa 8fb291
      widget = combo;
shun-iwasawa 8fb291
    } else {  // create FileField
shun-iwasawa 8fb291
      DVGui::FileField* field =
shun-iwasawa 8fb291
          new DVGui::FileField(this, item.value.toString());
shun-iwasawa 8fb291
      ret    = connect(field, SIGNAL(pathChanged()), this, SLOT(onChange()));
shun-iwasawa 8fb291
      widget = field;
shun-iwasawa 8fb291
    }
shun-iwasawa 8fb291
    break;
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  case QMetaType::QSize:  // create SizeField
shun-iwasawa 8fb291
  {
shun-iwasawa 8fb291
    SizeField* field = new SizeField(item.min.toSize(), item.max.toSize(),
shun-iwasawa 8fb291
                                     item.value.toSize(), this);
shun-iwasawa 8fb291
    ret    = connect(field, SIGNAL(editingFinished()), this, SLOT(onChange()));
shun-iwasawa 8fb291
    widget = field;
shun-iwasawa 8fb291
  } break;
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  case QMetaType::QColor:  // create ColorField
shun-iwasawa 8fb291
  {
shun-iwasawa 8fb291
    ColorField* field =
shun-iwasawa 8fb291
        new ColorField(this, false, colorToTPixel(item.value.value<qcolor>()));</qcolor>
shun-iwasawa c54dfb
    ret    = connect(field, SIGNAL(colorChanged(const TPixel32&, bool)), this,
shun-iwasawa 7c3c0a
                     SLOT(onColorFieldChanged(const TPixel32&, bool)));
shun-iwasawa 8fb291
    widget = field;
shun-iwasawa 8fb291
  } break;
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  case QMetaType::QVariantMap:  // used in colorCalibrationLutPaths
shun-iwasawa 8fb291
  {
shun-iwasawa 8fb291
    assert(id == colorCalibrationLutPaths);
shun-iwasawa 8fb291
    DVGui::FileField* field = new DVGui::FileField(
shun-iwasawa 8fb291
        this, QString("- Please specify 3DLUT file (.3dl) -"), false, true);
shun-iwasawa 8fb291
    QString lutPath = m_pref->getColorCalibrationLutPath(
shun-iwasawa 8fb291
        LutManager::instance()->getMonitorName());
shun-iwasawa 8fb291
    if (!lutPath.isEmpty()) field->setPath(lutPath);
shun-iwasawa 8fb291
    field->setFileMode(QFileDialog::ExistingFile);
shun-iwasawa 8fb291
    QStringList lutFileTypes = {"3dl"};
shun-iwasawa 8fb291
    field->setFilters(lutFileTypes);
shun-iwasawa 8fb291
    ret = connect(field, SIGNAL(pathChanged()), this, SLOT(onLutPathChanged()));
shun-iwasawa 8fb291
    widget = field;
shun-iwasawa 8fb291
  } break;
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  default:
shun-iwasawa 8fb291
    std::cout << "unsupported value type" << std::endl;
shun-iwasawa 8fb291
    break;
shun-iwasawa 8fb291
  }
shun-iwasawa 8fb291
  assert(ret);
shun-iwasawa 8fb291
  m_controlIdMap[widget] = id;
shun-iwasawa 8fb291
  return widget;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
QGridLayout* PreferencesPopup::insertGroupBoxUI(PreferencesItemId id,
shun-iwasawa 8fb291
                                                QGridLayout* layout) {
shun-iwasawa 8fb291
  PreferencesItem item = m_pref->getItem(id);
shun-iwasawa 8fb291
  assert(item.type == QMetaType::Bool);
shun-iwasawa 8fb291
  QGroupBox* box = new QGroupBox(getUIString(id), this);
shun-iwasawa 8fb291
  box->setCheckable(true);
shun-iwasawa 8fb291
  box->setChecked(item.value.toBool());
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  QGridLayout* lay = new QGridLayout();
shun-iwasawa 8fb291
  setupLayout(lay, 5);
shun-iwasawa 8fb291
  box->setLayout(lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  layout->addWidget(box, layout->rowCount(), 0, 1, 3);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  bool ret = connect(box, SIGNAL(clicked(bool)), this, SLOT(onChange()));
shun-iwasawa 8fb291
  // bool ret = connect(box, SIGNAL(clicked(bool)), this,
shun-iwasawa 8fb291
  // SLOT(onGroupBoxChanged(bool)));
shun-iwasawa 8fb291
  assert(ret);
shun-iwasawa 8fb291
  m_controlIdMap[box] = id;
shun-iwasawa 8fb291
  return lay;
Jeremy Bullock 33e7d1
}
Jeremy Bullock 33e7d1
Jeremy Bullock 33e7d1
//-----------------------------------------------------------------------------
Jeremy Bullock 33e7d1
shun-iwasawa 8fb291
void PreferencesPopup::insertUI(PreferencesItemId id, QGridLayout* layout,
shun-iwasawa 8fb291
                                const QList<comboboxitem>& comboItems) {</comboboxitem>
shun-iwasawa 8fb291
  PreferencesItem item = m_pref->getItem(id);
Jeremy Bullock 4c6224
shun-iwasawa 8fb291
  QWidget* widget = createUI(id, comboItems);
shun-iwasawa 8fb291
  if (!widget) return;
Jeremy Bullock 4c6224
shun-iwasawa 8fb291
  bool isFileField = false;
shun-iwasawa 8fb291
  if (item.type == QMetaType::QVariantMap ||
shun-iwasawa 8fb291
      (item.type == QMetaType::QString && dynamic_cast<filefield*>(widget)))</filefield*>
shun-iwasawa 8fb291
    isFileField = true;
Jeremy Bullock 4c6224
shun-iwasawa 8fb291
  // CheckBox contains label in itself
shun-iwasawa 8fb291
  if (item.type == QMetaType::Bool)
shun-iwasawa fc0d80
    layout->addWidget(widget, layout->rowCount(), 0, 1, 3, Qt::AlignLeft);
shun-iwasawa 8fb291
  else {  // insert labels for other types
shun-iwasawa 8fb291
    int row = layout->rowCount();
shun-iwasawa 8fb291
    layout->addWidget(new QLabel(getUIString(id), this), row, 0,
shun-iwasawa 8fb291
                      Qt::AlignRight | Qt::AlignVCenter);
shun-iwasawa 8fb291
    if (isFileField)
shun-iwasawa 8fb291
      layout->addWidget(widget, row, 1, 1, 2);
shun-iwasawa fc0d80
    else {
shun-iwasawa fc0d80
      bool isWideComboBox = false;
shun-iwasawa fc0d80
      for (auto cbItem : comboItems) {
shun-iwasawa fc0d80
        if (widget->fontMetrics().width(cbItem.first) > 100) {
shun-iwasawa fc0d80
          isWideComboBox = true;
shun-iwasawa fc0d80
          break;
shun-iwasawa fc0d80
        }
shun-iwasawa fc0d80
      }
shun-iwasawa fc0d80
      if (id == interfaceFont) isWideComboBox = true;
shun-iwasawa fc0d80
shun-iwasawa fc0d80
      layout->addWidget(widget, row, 1, 1, (isWideComboBox) ? 2 : 1,
shun-iwasawa fc0d80
                        Qt::AlignLeft | Qt::AlignVCenter);
shun-iwasawa fc0d80
    }
Jeremy Bullock 33e7d1
  }
Jeremy Bullock 33e7d1
}
Jeremy Bullock 33e7d1
Jeremy Bullock 33e7d1
//-----------------------------------------------------------------------------
Jeremy Bullock 33e7d1
shun-iwasawa 8fb291
void PreferencesPopup::insertDualUIs(
shun-iwasawa 8fb291
    PreferencesItemId leftId, PreferencesItemId rightId, QGridLayout* layout,
shun-iwasawa 8fb291
    const QList<comboboxitem>& leftComboItems,</comboboxitem>
shun-iwasawa 8fb291
    const QList<comboboxitem>& rightComboItems) {</comboboxitem>
shun-iwasawa 8fb291
  // currently this function does not suppose that the checkbox is on the left
shun-iwasawa 8fb291
  assert(m_pref->getItem(leftId).type != QMetaType::Bool);
shun-iwasawa 8fb291
  int row = layout->rowCount();
shun-iwasawa 8fb291
  layout->addWidget(new QLabel(getUIString(leftId), this), row, 0,
shun-iwasawa 8fb291
                    Qt::AlignRight | Qt::AlignVCenter);
shun-iwasawa 8fb291
  QHBoxLayout* innerLay = new QHBoxLayout();
shun-iwasawa 8fb291
  innerLay->setMargin(0);
shun-iwasawa 8fb291
  innerLay->setSpacing(10);
shun-iwasawa 8fb291
  {
shun-iwasawa 8fb291
    innerLay->addWidget(createUI(leftId, leftComboItems), 0);
shun-iwasawa 8fb291
    if (m_pref->getItem(rightId).type != QMetaType::Bool)
shun-iwasawa 8fb291
      innerLay->addWidget(new QLabel(getUIString(rightId), this), 0,
shun-iwasawa 8fb291
                          Qt::AlignRight | Qt::AlignVCenter);
shun-iwasawa 8fb291
    innerLay->addWidget(createUI(rightId, rightComboItems), 0);
shun-iwasawa 8fb291
    innerLay->addStretch(1);
Jeremy Bullock 33e7d1
  }
shun-iwasawa 8fb291
  layout->addLayout(innerLay, row, 1, 1, 2);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
void PreferencesPopup::insertFootNote(QGridLayout* layout) {
Jeremy Bullock 175c6b
  QLabel* note = new QLabel(
Jeremy Bullock 175c6b
      tr("* Changes will take effect the next time you run OpenToonz"));
shun-iwasawa 8fb291
  note->setStyleSheet("font-size: 10px; font: italic;");
shun-iwasawa fc0d80
  layout->addWidget(note, layout->rowCount(), 0, 1, 3,
shun-iwasawa 8fb291
                    Qt::AlignLeft | Qt::AlignVCenter);
shun-iwasawa 8fb291
}
shun-iwasawa 8fb291
shun-iwasawa 8fb291
//-----------------------------------------------------------------------------
shun-iwasawa 8fb291
shun-iwasawa 8fb291
QString PreferencesPopup::getUIString(PreferencesItemId id) {
shun-iwasawa c9a4a1
  auto CtrlAltStr = []() {
shun-iwasawa c9a4a1
    QString str =
shun-iwasawa c9a4a1
        QKeySequence(Qt::CTRL + Qt::ALT).toString(QKeySequence::NativeText);
shun-iwasawa c9a4a1
    if (str.endsWith("+")) str.chop(1);
shun-iwasawa c9a4a1
    return str;
shun-iwasawa c9a4a1
  };
shun-iwasawa c9a4a1
shun-iwasawa 8fb291
  const static QMap<preferencesitemid, qstring=""> uiStringTable = {</preferencesitemid,>
shun-iwasawa 8fb291
      // General
shun-iwasawa 8fb291
      {defaultViewerEnabled, tr("Use Default Viewer for Movie Formats")},
MrBlockCat 845bc7
      {rasterOptimizedMemory, tr("Minimize Raster Memory Fragmentation*")},
shun-iwasawa 8fb291
      {autosaveEnabled, tr("Save Automatically")},
MrBlockCat 845bc7
      {autosavePeriod, tr("Interval (Minutes):")},
shun-iwasawa 8fb291
      {autosaveSceneEnabled, tr("Automatically Save the Scene File")},
shun-iwasawa 8fb291
      {autosaveOtherFilesEnabled, tr("Automatically Save Non-Scene Files")},
shun-iwasawa 8fb291
      {startupPopupEnabled, tr("Show Startup Window when OpenToonz Starts")},
MrBlockCat 845bc7
      {undoMemorySize, tr("Undo Memory Size (MB):")},
shun-iwasawa 8fb291
      {taskchunksize, tr("Render Task Chunk Size:")},
shun-iwasawa 8fb291
      {replaceAfterSaveLevelAs,
shun-iwasawa 8fb291
       tr("Replace Toonz Level after SaveLevelAs command")},
shun-iwasawa 8fb291
      {backupEnabled, tr("Backup Scene and Animation Levels when Saving")},
MrBlockCat 845bc7
      {backupKeepCount, tr("# of backups to keep:")},
shun-iwasawa 8fb291
      {sceneNumberingEnabled, tr("Show Info in Rendered Frames")},
shun-iwasawa 8fb291
      {watchFileSystemEnabled,
shun-iwasawa 8fb291
       tr("Watch File System and Update File Browser Automatically")},
shun-iwasawa 8fb291
      //{ projectRoot,               tr("") },
MrBlockCat 845bc7
      {customProjectRoot, tr("Custom Project Path(s):")},
shun-iwasawa 8fb291
      {pathAliasPriority, tr("Path Alias Priority:")},
shun-iwasawa 8fb291
shun-iwasawa 8fb291
      // Interface
shun-iwasawa 8fb291
      {CurrentStyleSheetName, tr("Theme:")},
Kite 521c84
      {iconTheme, tr("Switch to dark icons")},
shun-iwasawa 8fb291
      {pixelsOnly, tr("All imported images will use the same DPI")},
shun-iwasawa 8fb291
      //{ oldUnits,                               tr("") },
shun-iwasawa 8fb291
      //{ oldCameraUnits,                         tr("") },
shun-iwasawa 8fb291
      {linearUnits, tr("Unit:")},
shun-iwasawa 8fb291
      {cameraUnits, tr("Camera Unit:")},
shun-iwasawa 8fb291
      {CurrentRoomChoice, tr("Rooms*:")},
shun-iwasawa 8fb291
      {functionEditorToggle, tr("Function Editor*:")},
shun-iwasawa 8fb291
      {moveCurrentFrameByClickCellArea,
shun-iwasawa 8fb291
       tr("Move Current Frame by Clicking on Xsheet / Numerical Columns Cell "
shun-iwasawa 8fb291
          "Area")},
shun-iwasawa 8fb291
      {actualPixelViewOnSceneEditingMode,
shun-iwasawa 8fb291
       tr("Enable Actual Pixel View on Scene Editing Mode")},
shun-iwasawa 8fb291
      {showRasterImagesDarkenBlendedInViewer,
shun-iwasawa 8fb291
       tr("Show Raster Images Darken Blended")},
Jeremy Bullock 2c9cf6
      {iconSize, tr("Level Strip Thumbnail Size*:")},
MrBlockCat 845bc7
      {viewShrink, tr("Viewer Shrink:")},
MrBlockCat 845bc7
      {viewStep, tr("Step:")},
MrBlockCat 845bc7
      {viewerZoomCenter, tr("Viewer Zoom Center:")},
MrBlockCat 845bc7
      {CurrentLanguageName, tr("Language*:")},
MrBlockCat 845bc7
      {interfaceFont, tr("Font*:")},
MrBlockCat 845bc7
      {interfaceFontStyle, tr("Style*:")},
shun-iwasawa a8f111
      {colorCalibrationEnabled, tr("Color Calibration using 3D Look-up Table")},
shun-iwasawa 8fb291
      {colorCalibrationLutPaths,
shun-iwasawa a8f111
       tr("3DLUT File for [%1]:")
shun-iwasawa 8fb291
           .arg(LutManager::instance()->getMonitorName())},
shun-iwasawa 215a5b
      {displayIn30bit, tr("30bit Display*")},
shun-iwasawa bb8132
      {showIconsInMenu, tr("Show Icons In Menu*")},
shun-iwasawa 8fb291
shun-iwasawa 8fb291
      // Visualization
shun-iwasawa 8fb291
      {show0ThickLines, tr("Show Lines with Thickness 0")},
shun-iwasawa 8fb291
      {regionAntialias, tr("Antialiased Region Boundaries")},
shun-iwasawa 8fb291
shun-iwasawa 8fb291
      // Loading
shun-iwasawa 8fb291
      {importPolicy, tr("Default File Import Behavior:")},
shun-iwasawa 8fb291
      {autoExposeEnabled, tr("Expose Loaded Levels in Xsheet")},
shun-iwasawa 409dec
      {autoRemoveUnusedLevels,
shun-iwasawa 409dec
       tr("Automatically Remove Unused Levels From Scene Cast")},
shun-iwasawa 8fb291
      {subsceneFolderEnabled,
MrBlockCat 52b9e0
       tr("Create Sub-folder when Importing Sub-Xsheet")},
shun-iwasawa 8fb291
      {removeSceneNumberFromLoadedLevelName,
shun-iwasawa 8fb291
       tr("Automatically Remove Scene Number from Loaded Level Name")},
shun-iwasawa 8fb291
      {IgnoreImageDpi, tr("Use Camera DPI for All Imported Images")},
shun-iwasawa 8fb291
      {initialLoadTlvCachingBehavior, tr("Default TLV Caching Behavior:")},
shun-iwasawa 8fb291
      {columnIconLoadingPolicy, tr("Column Icon:")},
shun-iwasawa 8fb291
      //{ levelFormats,                           tr("") },
shun-iwasawa 8fb291
shun-iwasawa 8fb291
      // Saving
MrBlockCat 845bc7
      {rasterBackgroundColor, tr("Matte color:")},
shun-iwasawa d2bb27
      {resetUndoOnSavingLevel, tr("Clear Undo History when Saving Levels")},
shun-iwasawa 8fb291
shun-iwasawa 8fb291
      // Import / Export
MrBlockCat 845bc7
      {ffmpegPath, tr("FFmpeg Path:")},
shun-iwasawa 8fb291
      {ffmpegTimeout, tr("FFmpeg Timeout:")},
MrBlockCat 845bc7
      {fastRenderPath, tr("Fast Render Path:")},
shun-iwasawa c18bfa
      {ffmpegMultiThread,
shun-iwasawa c18bfa
       tr("Allow Multi-Thread in FFMPEG Rendering (UNSTABLE)")},
justburner 08eb1b
      {rhubarbPath, tr("Rhubarb Path:")},
justburner 08eb1b
      {rhubarbTimeout, tr("Rhubarb Timeout:")},
shun-iwasawa 8fb291
shun-iwasawa 8fb291
      // Drawing
shun-iwasawa fc0d80
      {DefRasterFormat, tr("Default Raster / Scan Level Format:")},
shun-iwasawa fc0d80
      //{scanLevelType, tr("Scan File Format:")},
shun-iwasawa 8fb291
      {DefLevelType, tr("Default Level Type:")},
shun-iwasawa 8fb291
      {newLevelSizeToCameraSizeEnabled,
shun-iwasawa 8fb291
       tr("New Levels Default to the Current Camera Size")},
shun-iwasawa 8fb291
      {DefLevelWidth, tr("Width:")},
MrBlockCat 845bc7
      {DefLevelHeight, tr("Height:")},
shun-iwasawa 8fb291
      {DefLevelDpi, tr("DPI:")},
shun-iwasawa 536025
      {EnableAutocreation, tr("Enable Autocreation")},
shun-iwasawa 536025
      {NumberingSystem, tr("Numbering System:")},
shun-iwasawa 536025
      {EnableAutoStretch, tr("Enable Auto-stretch Frame")},
shun-iwasawa 536025
      {EnableCreationInHoldCells, tr("Enable Creation in Hold Cells")},
shun-iwasawa 536025
      {EnableAutoRenumber, tr("Enable Autorenumber")},
shun-iwasawa 8fb291
      {vectorSnappingTarget, tr("Vector Snapping:")},
shun-iwasawa 8fb291
      {saveUnpaintedInCleanup,
shun-iwasawa 8fb291
       tr("Keep Original Cleaned Up Drawings As Backup")},
shun-iwasawa 8fb291
      {minimizeSaveboxAfterEditing, tr("Minimize Savebox after Editing")},
shun-iwasawa 8fb291
      {useNumpadForSwitchingStyles,
shun-iwasawa 8fb291
       tr("Use Numpad and Tab keys for Switching Styles")},
shun-iwasawa 8fb291
      {downArrowInLevelStripCreatesNewFrame,
shun-iwasawa 8fb291
       tr("Down Arrow at End of Level Strip Creates a New Frame")},
shun-iwasawa 8fb291
      {keepFillOnVectorSimplify,
shun-iwasawa 8fb291
       tr("Keep fill when using \"Replace Vectors\" command")},
shun-iwasawa 8fb291
      {useHigherDpiOnVectorSimplify,
shun-iwasawa 8fb291
       tr("Use higher DPI for calculations - Slower but more accurate")},
shun-iwasawa 8fb291
shun-iwasawa 8fb291
      // Tools
shun-iwasawa 390cff
      // {dropdownShortcutsCycleOptions, tr("Dropdown Shortcuts:")}, // removed
shun-iwasawa 8fb291
      {FillOnlysavebox, tr("Use the TLV Savebox to Limit Filling Operations")},
shun-iwasawa 8fb291
      {multiLayerStylePickerEnabled,
MrBlockCat 845bc7
       tr("Multi Layer Style Picker: Switch Levels by Picking")},
shun-iwasawa 8fb291
      {cursorBrushType, tr("Basic Cursor Type:")},
shun-iwasawa 8fb291
      {cursorBrushStyle, tr("Cursor Style:")},
shun-iwasawa 8fb291
      {cursorOutlineEnabled, tr("Show Cursor Size Outlines")},
shun-iwasawa 8fb291
      {levelBasedToolsDisplay, tr("Toolbar Display Behaviour:")},
shun-iwasawa c9a4a1
      {useCtrlAltToResizeBrush, tr("Use %1 to Resize Brush").arg(CtrlAltStr())},
Kite ce2d82
      {tempToolSwitchTimer,
Kite ce2d82
       tr("Switch Tool Temporarily Keypress Length (ms):")},
shun-iwasawa 8fb291
shun-iwasawa 8fb291
      // Xsheet
shun-iwasawa 8fb291
      {xsheetLayoutPreference, tr("Column Header Layout*:")},
shun-iwasawa 8fb291
      {xsheetStep, tr("Next/Previous Step Frames:")},
shun-iwasawa 8fb291
      {xsheetAutopanEnabled, tr("Xsheet Autopan during Playback")},
shun-iwasawa 8fb291
      {DragCellsBehaviour, tr("Cell-dragging Behaviour:")},
shun-iwasawa 8fb291
      {ignoreAlphaonColumn1Enabled,
shun-iwasawa 8fb291
       tr("Ignore Alpha Channel on Levels in Column 1")},
shun-iwasawa 8fb291
      {showKeyframesOnXsheetCellArea, tr("Show Keyframes on Cell Area")},
shun-iwasawa 8fb291
      {showXsheetCameraColumn, tr("Show Camera Column")},
shun-iwasawa 8fb291
      {useArrowKeyToShiftCellSelection,
shun-iwasawa 8fb291
       tr("Use Arrow Key to Shift Cell Selection")},
shun-iwasawa 8fb291
      {inputCellsWithoutDoubleClickingEnabled,
shun-iwasawa 8fb291
       tr("Enable to Input Cells without Double Clicking")},
shun-iwasawa 8fb291
      {shortcutCommandsWhileRenamingCellEnabled,
shun-iwasawa 8fb291
       tr("Enable OpenToonz Commands' Shortcut Keys While Renaming Cell")},
MrBlockCat 845bc7
      {showXSheetToolbar, tr("Show Toolbar in the Xsheet")},
shun-iwasawa 8fb291
      {expandFunctionHeader,
shun-iwasawa 8fb291
       tr("Expand Function Editor Header to Match Xsheet Toolbar Height*")},
shun-iwasawa 8fb291
      {showColumnNumbers, tr("Show Column Numbers in Column Headers")},
justburner c2d6ed
      {parentColorsInXsheetColumn,
justburner c2d6ed
       tr("Show Column Parent's Color in the Xsheet")},
shun-iwasawa fe3506
      {highlightLineEverySecond, tr("Highlight Line Every Second")},
shun-iwasawa 8fb291
      {syncLevelRenumberWithXsheet,
shun-iwasawa 8fb291
       tr("Sync Level Strip Drawing Number Changes with the Xsheet")},
shun-iwasawa 7c3c0a
      {currentTimelineEnabled, tr("Show Current Time Indicator")},
shun-iwasawa 8fb291
      {currentColumnColor, tr("Current Column Color:")},
shun-iwasawa 855b12
      //{ levelNameOnEachMarkerEnabled, tr("Display Level Name on Each Marker")
shun-iwasawa 855b12
      //},
shun-iwasawa 855b12
      {levelNameDisplayType, tr("Level Name Display:")},
shun-iwasawa 855b12
      {showFrameNumberWithLetters,
shun-iwasawa 855b12
       tr("Show \"ABC\" Appendix to the Frame Number in Xsheet Cell")},
shun-iwasawa 8fb291
shun-iwasawa 8fb291
      // Animation
shun-iwasawa 8fb291
      {keyframeType, tr("Default Interpolation:")},
shun-iwasawa 8fb291
      {animationStep, tr("Animation Step:")},
shun-iwasawa 4a3868
      {modifyExpressionOnMovingReferences,
shun-iwasawa 4a3868
       tr("[Experimental Feature] ") +
shun-iwasawa 4a3868
           tr("Automatically Modify Expression On Moving Referenced Objects")},
shun-iwasawa 8fb291
shun-iwasawa 8fb291
      // Preview
shun-iwasawa 8fb291
      {blanksCount, tr("Blank Frames:")},
shun-iwasawa 8fb291
      {blankColor, tr("Blank Frames Color:")},
shun-iwasawa 8fb291
      {rewindAfterPlayback, tr("Rewind after Playback")},
shun-iwasawa fc0d80
      {shortPlayFrameCount, tr("Number of Frames to Play \nfor Short Play:")},
shun-iwasawa 8fb291
      {previewAlwaysOpenNewFlip, tr("Display in a New Flipbook Window")},
shun-iwasawa 8fb291
      {fitToFlipbook, tr("Fit to Flipbook")},
shun-iwasawa 8fb291
      {generatedMovieViewEnabled, tr("Open Flipbook after Rendering")},
shun-iwasawa 8fb291
shun-iwasawa 8fb291
      // Onion Skin
shun-iwasawa 8fb291
      {onionSkinEnabled, tr("Onion Skin ON")},
shun-iwasawa 8fb291
      {onionPaperThickness, tr("Paper Thickness:")},
MrBlockCat 845bc7
      {backOnionColor, tr("Previous Frames Correction:")},
shun-iwasawa 8fb291
      {frontOnionColor, tr("Following Frames Correction:")},
MrBlockCat 845bc7
      {onionInksOnly, tr("Display Lines Only")},
shun-iwasawa 8fb291
      {onionSkinDuringPlayback, tr("Show Onion Skin During Playback")},
shun-iwasawa 8fb291
      {useOnionColorsForShiftAndTraceGhosts,
shun-iwasawa 8fb291
       tr("Use Onion Skin Colors for Reference Drawings of Shift and Trace")},
shun-iwasawa 8fb291
      {animatedGuidedDrawing, tr("Vector Guided Style:")},
shun-iwasawa 8fb291
shun-iwasawa 8fb291
      // Colors
MrBlockCat 845bc7
      {viewerBGColor, tr("Viewer BG Color:")},
MrBlockCat 845bc7
      {previewBGColor, tr("Preview BG Color:")},
MrBlockCat 845bc7
      {levelEditorBoxColor, tr("Level Editor Box Color:")},
MrBlockCat 845bc7
      {chessboardColor1, tr("Chessboard Color 1:")},
MrBlockCat 845bc7
      {chessboardColor2, tr("Chessboard Color 2:")},
MrBlockCat 845bc7
      {transpCheckInkOnWhite, tr("Ink Color on White BG:")},
MrBlockCat 845bc7
      {transpCheckInkOnBlack, tr("Ink Color on Black BG:")},
shun-iwasawa 8fb291
      {transpCheckPaint, tr("Paint Color:")},
shun-iwasawa 8fb291
shun-iwasawa 8fb291
      // Version Control
shun-iwasawa 8fb291
      {SVNEnabled, tr("Enable Version Control*")},
shun-iwasawa 8fb291
      {automaticSVNFolderRefreshEnabled,
shun-iwasawa 8fb291
       tr("Automatically Refresh Folder Contents")},
shun-iwasawa 8fb291
      {latestVersionCheckEnabled,
shun-iwasawa 8fb291
       tr("Check for the Latest Version of OpenToonz on Launch")},
shun-iwasawa 8fb291
shun-iwasawa 8fb291
      // Touch / Tablet Settings
shun-iwasawa 8fb291
      // TounchGestureControl // Touch Gesture is a checkable command and not in
shun-iwasawa 8fb291
      // preferences.ini
shun-iwasawa 19cec1
      {winInkEnabled, tr("Enable Windows Ink Support* (EXPERIMENTAL)")},
shun-iwasawa 19cec1
      {useQtNativeWinInk,
shun-iwasawa 19cec1
       tr("Use Qt's Native Windows Ink Support*\n(CAUTION: This options is for "
shun-iwasawa 19cec1
          "maintenance purpose. \n Do not activate this option or the tablet "
shun-iwasawa 19cec1
          "won't work properly.)")}};
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  return uiStringTable.value(id, QString());
shun-iwasawa 8fb291
}
shun-iwasawa 8fb291
shun-iwasawa 8fb291
//-----------------------------------------------------------------------------
shun-iwasawa 8fb291
// returns list for combo items
shun-iwasawa 8fb291
// ComboBoxItem consists of an item label string and data to be stored in
shun-iwasawa 8fb291
// preferences
shun-iwasawa 8fb291
shun-iwasawa 8fb291
QList<comboboxitem> PreferencesPopup::getComboItemList(</comboboxitem>
shun-iwasawa 8fb291
    PreferencesItemId id) const {
shun-iwasawa 8fb291
  const static QMap<preferencesitemid, qlist<comboboxitem="">> comboItemsTable = {</preferencesitemid,>
shun-iwasawa 8fb291
      {pathAliasPriority,
shun-iwasawa 8fb291
       {{tr("Project Folder Aliases (+drawings, +scenes, etc.)"),
shun-iwasawa 8fb291
         Preferences::ProjectFolderAliases},
shun-iwasawa 8fb291
        {tr("Scene Folder Alias ($scenefolder)"),
shun-iwasawa 8fb291
         Preferences::SceneFolderAlias},
shun-iwasawa 8fb291
        {tr("Use Project Folder Aliases Only"),
shun-iwasawa 8fb291
         Preferences::ProjectFolderOnly}}},
shun-iwasawa 8fb291
      {linearUnits,  // cameraUnits shares items with linearUnits
shun-iwasawa 8fb291
       {{tr("cm"), "cm"},
shun-iwasawa 8fb291
        {tr("mm"), "mm"},
shun-iwasawa 8fb291
        {tr("inch"), "inch"},
shun-iwasawa 8fb291
        {tr("field"), "field"},
shun-iwasawa 8fb291
        {tr("pixel"), "pixel"}}},
shun-iwasawa 8fb291
      {functionEditorToggle,
shun-iwasawa 8fb291
       {{tr("Graph Editor Opens in Popup"),
shun-iwasawa 8fb291
         Preferences::ShowGraphEditorInPopup},
shun-iwasawa 8fb291
        {tr("Spreadsheet Opens in Popup"),
shun-iwasawa 8fb291
         Preferences::ShowFunctionSpreadsheetInPopup},
shun-iwasawa 8fb291
        {tr("Toggle Between Graph Editor and Spreadsheet"),
shun-iwasawa 8fb291
         Preferences::ToggleBetweenGraphAndSpreadsheet}}},
shun-iwasawa 8fb291
      {viewerZoomCenter, {{tr("Mouse Cursor"), 0}, {tr("Viewer Center"), 1}}},
shun-iwasawa 8fb291
      {importPolicy,
shun-iwasawa 8fb291
       {{tr("Always ask before loading or importing"), 0},
shun-iwasawa 8fb291
        {tr("Always import the file to the current project"), 1},
shun-iwasawa 8fb291
        {tr("Always load the file from the current location"), 2}}},
shun-iwasawa 8fb291
      {initialLoadTlvCachingBehavior,
shun-iwasawa 8fb291
       {{tr("On Demand"), 0},
shun-iwasawa 8fb291
        {tr("All Icons"), 1},
shun-iwasawa 8fb291
        {tr("All Icons & Images"), 2}}},
shun-iwasawa 8fb291
      {columnIconLoadingPolicy,
shun-iwasawa 8fb291
       {{tr("At Once"), Preferences::LoadAtOnce},
shun-iwasawa 8fb291
        {tr("On Demand"), Preferences::LoadOnDemand}}},
shun-iwasawa fc0d80
      {DefRasterFormat, {{"tif", "tif"}, {"png", "png"}}},
shun-iwasawa fc0d80
      //{scanLevelType, {{"tif", "tif"}, {"png", "png"}}},
shun-iwasawa 8fb291
      {DefLevelType,
shun-iwasawa 8fb291
       {{tr("Toonz Vector Level"), PLI_XSHLEVEL},
shun-iwasawa 8fb291
        {tr("Toonz Raster Level"), TZP_XSHLEVEL},
shun-iwasawa 8fb291
        {tr("Raster Level"), OVL_XSHLEVEL}}},
shun-iwasawa 536025
      {NumberingSystem,
shun-iwasawa 536025
       {{tr("Incremental"), 0}, {tr("Use Xsheet as Animation Sheet"), 1}}},
shun-iwasawa 8fb291
      {vectorSnappingTarget,
shun-iwasawa 8fb291
       {{tr("Strokes"), 0}, {tr("Guides"), 1}, {tr("All"), 2}}},
shun-iwasawa 390cff
      //{dropdownShortcutsCycleOptions,
shun-iwasawa 390cff
      // {{tr("Open the dropdown to display all options"), 0},
shun-iwasawa 390cff
      //  {tr("Cycle through the available options"), 1}}},
shun-iwasawa 8fb291
      {cursorBrushType,
shun-iwasawa 8fb291
       {{tr("Small"), "Small"},
shun-iwasawa 8fb291
        {tr("Large"), "Large"},
shun-iwasawa 8fb291
        {tr("Crosshair"), "Crosshair"}}},
shun-iwasawa 8fb291
      {cursorBrushStyle,
shun-iwasawa 8fb291
       {{tr("Default"), "Default"},
shun-iwasawa 8fb291
        {tr("Left-Handed"), "Left-Handed"},
shun-iwasawa 8fb291
        {tr("Simple"), "Simple"}}},
shun-iwasawa 8fb291
      {levelBasedToolsDisplay,
shun-iwasawa 8fb291
       {{tr("Default"), 0},
shun-iwasawa 8fb291
        {tr("Enable Tools For Level Only"), 1},
shun-iwasawa 8fb291
        {tr("Show Tools For Level Only"), 2}}},
shun-iwasawa 8fb291
      {xsheetLayoutPreference,
shun-iwasawa 8fb291
       {{tr("Classic"), "Classic"},
shun-iwasawa 8fb291
        {tr("Classic-revised"), "Classic-revised"},
shun-iwasawa 855b12
        {tr("Compact"), "Compact"},
shun-iwasawa 855b12
        {tr("Minimum"), "Minimum"}}},
shun-iwasawa 855b12
      {levelNameDisplayType,
shun-iwasawa 855b12
       {{tr("Default"), Preferences::ShowLevelName_Default},
shun-iwasawa 855b12
        {tr("Display on Each Marker"), Preferences::ShowLevelNameOnEachMarker},
shun-iwasawa 855b12
        {tr("Display on Column Header"),
shun-iwasawa 855b12
         Preferences::ShowLevelNameOnColumnHeader}}},
shun-iwasawa 8fb291
      {DragCellsBehaviour,
shun-iwasawa 8fb291
       {{tr("Cells Only"), 0}, {tr("Cells and Column Data"), 1}}},
shun-iwasawa 8fb291
      {keyframeType,  // note that the value starts from 1, not 0
shun-iwasawa 8fb291
       {{tr("Constant"), 1},
shun-iwasawa 8fb291
        {tr("Linear"), 2},
shun-iwasawa 8fb291
        {tr("Speed In / Speed Out"), 3},
shun-iwasawa 8fb291
        {tr("Ease In / Ease Out"), 4},
shun-iwasawa 8fb291
        {tr("Ease In / Ease Out %"), 5},
shun-iwasawa 8fb291
        {tr("Exponential"), 6},
shun-iwasawa 8fb291
        {tr("Expression "), 7},
shun-iwasawa 8fb291
        {tr("File"), 8}}},
shun-iwasawa 8fb291
      {animatedGuidedDrawing,
shun-iwasawa 8fb291
       {{tr("Arrow Markers"), 0}, {tr("Animated Guide"), 1}}}};
shun-iwasawa 8fb291
  assert(comboItemsTable.contains(id));
shun-iwasawa 8fb291
  return comboItemsTable.value(id, QList<comboboxitem>());</comboboxitem>
shun-iwasawa 8fb291
}
shun-iwasawa 8fb291
shun-iwasawa 8fb291
template <typename t=""></typename>
shun-iwasawa 8fb291
inline T PreferencesPopup::getUI(PreferencesItemId id) {
shun-iwasawa 8fb291
  assert(m_controlIdMap.keys(id).count() == 1);
shun-iwasawa 8fb291
  T ret = dynamic_cast<t>(m_controlIdMap.key(id));</t>
shun-iwasawa 8fb291
  assert(ret);
shun-iwasawa 8fb291
  return ret;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
//**********************************************************************************
luz paz 6454c4
//    PreferencesPopup's  constructor
shun-iwasawa 8fb291
//**********************************************************************************
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
PreferencesPopup::PreferencesPopup()
shun-iwasawa c54dfb
    : QDialog(TApp::instance()->getMainWindow())
shun-iwasawa c54dfb
    , m_formatProperties()
shun-iwasawa c54dfb
    , m_additionalStyleEdit(nullptr) {
shun-iwasawa 8fb291
  setWindowTitle(tr("Preferences"));
shun-iwasawa 8fb291
  setObjectName("PreferencesPopup");
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  m_pref = Preferences::instance();
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  // Category List
shun-iwasawa 8fb291
  QListWidget* categoryList = new QListWidget(this);
shun-iwasawa 8fb291
  QStringList categories;
shun-iwasawa 8fb291
  categories << tr("General") << tr("Interface") << tr("Visualization")
shun-iwasawa 8fb291
             << tr("Loading") << tr("Saving") << tr("Import/Export")
justburner 08eb1b
             << tr("Auto Lip-Sync") << tr("Drawing") << tr("Tools")
justburner 08eb1b
             << tr("Xsheet") << tr("Animation") << tr("Preview")
justburner 08eb1b
             << tr("Onion Skin") << tr("Colors") << tr("Version Control")
justburner 08eb1b
             << tr("Touch/Tablet Settings");
shun-iwasawa 8fb291
  categoryList->addItems(categories);
shun-iwasawa 8fb291
  categoryList->setFixedWidth(160);
shun-iwasawa 8fb291
  categoryList->setCurrentRow(0);
shun-iwasawa 8fb291
  categoryList->setAlternatingRowColors(true);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  QStackedWidget* stackedWidget = new QStackedWidget(this);
shun-iwasawa 8fb291
  stackedWidget->addWidget(createGeneralPage());
shun-iwasawa 8fb291
  stackedWidget->addWidget(createInterfacePage());
shun-iwasawa 8fb291
  stackedWidget->addWidget(createVisualizationPage());
shun-iwasawa 8fb291
  stackedWidget->addWidget(createLoadingPage());
shun-iwasawa 8fb291
  stackedWidget->addWidget(createSavingPage());
shun-iwasawa 8fb291
  stackedWidget->addWidget(createImportExportPage());
justburner 08eb1b
  stackedWidget->addWidget(createAutoLipSyncPage());
shun-iwasawa 8fb291
  stackedWidget->addWidget(createDrawingPage());
shun-iwasawa 8fb291
  stackedWidget->addWidget(createToolsPage());
shun-iwasawa 8fb291
  stackedWidget->addWidget(createXsheetPage());
shun-iwasawa 8fb291
  stackedWidget->addWidget(createAnimationPage());
shun-iwasawa 8fb291
  stackedWidget->addWidget(createPreviewPage());
shun-iwasawa 8fb291
  stackedWidget->addWidget(createOnionSkinPage());
shun-iwasawa 8fb291
  stackedWidget->addWidget(createColorsPage());
shun-iwasawa 8fb291
  stackedWidget->addWidget(createVersionControlPage());
shun-iwasawa 8fb291
  stackedWidget->addWidget(createTouchTabletPage());
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  QHBoxLayout* mainLayout = new QHBoxLayout();
shun-iwasawa 8fb291
  mainLayout->setMargin(0);
shun-iwasawa 8fb291
  mainLayout->setSpacing(0);
shun-iwasawa 8fb291
  {
shun-iwasawa 8fb291
    // Category
shun-iwasawa 8fb291
    QVBoxLayout* categoryLayout = new QVBoxLayout();
shun-iwasawa 8fb291
    categoryLayout->setMargin(5);
shun-iwasawa 8fb291
    categoryLayout->setSpacing(10);
Kite 521c84
    categoryLayout->addWidget(categoryList, 1);
shun-iwasawa 8fb291
    mainLayout->addLayout(categoryLayout, 0);
shun-iwasawa 8fb291
    mainLayout->addWidget(stackedWidget, 1);
shun-iwasawa 8fb291
  }
shun-iwasawa 8fb291
  setLayout(mainLayout);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  bool ret = connect(categoryList, SIGNAL(currentRowChanged(int)),
shun-iwasawa 8fb291
                     stackedWidget, SLOT(setCurrentIndex(int)));
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  assert(ret);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
QWidget* PreferencesPopup::createGeneralPage() {
shun-iwasawa 8fb291
  m_projectRootDocuments = new CheckBox(tr("My Documents/OpenToonz*"), this);
shun-iwasawa 8fb291
  m_projectRootDesktop   = new CheckBox(tr("Desktop/OpenToonz*"), this);
shun-iwasawa 8fb291
  m_projectRootCustom    = new CheckBox(tr("Custom*"), this);
shun-iwasawa 8fb291
  QWidget* customField   = new QWidget(this);
shun-iwasawa 8fb291
  QGridLayout* customLay = new QGridLayout();
shun-iwasawa 8fb291
  setupLayout(customLay, 5);
shun-iwasawa 8fb291
  {
shun-iwasawa 8fb291
    insertUI(customProjectRoot, customLay);
shun-iwasawa 8fb291
    customLay->addWidget(
shun-iwasawa 8fb291
        new QLabel(
shun-iwasawa 8fb291
            tr("Advanced: Multiple paths can be separated by ** (No Spaces)"),
shun-iwasawa 8fb291
            this),
shun-iwasawa 8fb291
        customLay->rowCount(), 0, 1, 2, Qt::AlignLeft | Qt::AlignVCenter);
shun-iwasawa 8fb291
  }
shun-iwasawa 8fb291
  customField->setLayout(customLay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  QWidget* widget  = new QWidget(this);
shun-iwasawa 8fb291
  QGridLayout* lay = new QGridLayout();
shun-iwasawa 8fb291
  setupLayout(lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  insertUI(defaultViewerEnabled, lay);
shun-iwasawa 8fb291
  insertUI(rasterOptimizedMemory, lay);
shun-iwasawa 8fb291
  insertUI(startupPopupEnabled, lay);
shun-iwasawa 8fb291
  insertUI(undoMemorySize, lay);
shun-iwasawa 8fb291
  insertUI(taskchunksize, lay);
shun-iwasawa 8fb291
  insertUI(sceneNumberingEnabled, lay);
shun-iwasawa 8fb291
  insertUI(watchFileSystemEnabled, lay);
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  QGridLayout* projectRootLay =
shun-iwasawa 8fb291
      insertGroupBox(tr("Additional Project Locations"), lay);
shun-iwasawa 8fb291
  {
shun-iwasawa 8fb291
    projectRootLay->addWidget(m_projectRootDocuments, 0, 0, 1, 2);
shun-iwasawa 8fb291
    projectRootLay->addWidget(m_projectRootDesktop, 1, 0, 1, 2);
shun-iwasawa 8fb291
    projectRootLay->addWidget(m_projectRootCustom, 2, 0, 1, 2);
shun-iwasawa 8fb291
    projectRootLay->addWidget(customField, 3, 0, 1, 2);
shun-iwasawa 8fb291
  }
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  insertUI(pathAliasPriority, lay, getComboItemList(pathAliasPriority));
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  lay->setRowStretch(lay->rowCount(), 1);
shun-iwasawa 8fb291
  insertFootNote(lay);
shun-iwasawa 8fb291
  widget->setLayout(lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  int projectPaths = m_pref->getIntValue(projectRoot);
shun-iwasawa 8fb291
  m_projectRootDocuments->setChecked(projectPaths & 0x04);
shun-iwasawa 8fb291
  m_projectRootDesktop->setChecked(projectPaths & 0x02);
shun-iwasawa 8fb291
  m_projectRootCustom->setChecked(projectPaths & 0x01);
shun-iwasawa 8fb291
  if (!(projectPaths & 0x01)) customField->hide();
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  QComboBox* pathAliasPriorityCB = getUI<qcombobox*>(pathAliasPriority);</qcombobox*>
shun-iwasawa 8fb291
  pathAliasPriorityCB->setToolTip(
shun-iwasawa 8fb291
      tr("This option defines which alias to be used\nif both are possible on "
shun-iwasawa 8fb291
         "coding file path."));
shun-iwasawa 8fb291
  pathAliasPriorityCB->setItemData(0, QString(" "), Qt::ToolTipRole);
shun-iwasawa 8fb291
  QString scenefolderTooltip =
shun-iwasawa 8fb291
      tr("Choosing this option will set initial location of all file browsers "
shun-iwasawa 8fb291
         "to $scenefolder.\n"
shun-iwasawa 8fb291
         "Also the initial output destination for new scenes will be set to "
shun-iwasawa 8fb291
         "$scenefolder as well.");
shun-iwasawa 8fb291
  pathAliasPriorityCB->setItemData(1, scenefolderTooltip, Qt::ToolTipRole);
shun-iwasawa 8fb291
  pathAliasPriorityCB->setItemData(2, QString(" "), Qt::ToolTipRole);
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(autosaveEnabled,
shun-iwasawa 8fb291
                           &PreferencesPopup::onAutoSaveChanged);
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(autosaveSceneEnabled,
shun-iwasawa 8fb291
                           &PreferencesPopup::onAutoSaveOptionsChanged);
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(autosaveOtherFilesEnabled,
shun-iwasawa 8fb291
                           &PreferencesPopup::onAutoSaveOptionsChanged);
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(watchFileSystemEnabled,
shun-iwasawa 8fb291
                           &PreferencesPopup::onWatchFileSystemClicked);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  bool ret = true;
shun-iwasawa 8fb291
  ret      = ret && connect(m_pref, SIGNAL(stopAutoSave()), this,
shun-iwasawa 7c3c0a
                            SLOT(onAutoSaveExternallyChanged()));
shun-iwasawa c54dfb
  ret      = ret && connect(m_pref, SIGNAL(startAutoSave()), this,
shun-iwasawa 7c3c0a
                            SLOT(onAutoSaveExternallyChanged()));
shun-iwasawa c54dfb
  ret      = ret && connect(m_pref, SIGNAL(autoSavePeriodChanged()), this,
shun-iwasawa 7c3c0a
                            SLOT(onAutoSavePeriodExternallyChanged()));
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  ret = ret && connect(m_projectRootDocuments, SIGNAL(stateChanged(int)),
shun-iwasawa 8fb291
                       SLOT(onProjectRootChanged()));
shun-iwasawa 8fb291
  ret = ret && connect(m_projectRootDesktop, SIGNAL(stateChanged(int)),
shun-iwasawa 8fb291
                       SLOT(onProjectRootChanged()));
shun-iwasawa 8fb291
  ret = ret && connect(m_projectRootCustom, SIGNAL(stateChanged(int)),
shun-iwasawa 8fb291
                       SLOT(onProjectRootChanged()));
shun-iwasawa 8fb291
  ret = ret && connect(m_projectRootCustom, SIGNAL(clicked(bool)), customField,
shun-iwasawa 8fb291
                       SLOT(setVisible(bool)));
shun-iwasawa 8fb291
  assert(ret);
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  return widget;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
QWidget* PreferencesPopup::createInterfacePage() {
shun-iwasawa 8fb291
  QList<comboboxitem> styleSheetItemList;</comboboxitem>
shun-iwasawa 8fb291
  for (const QString& str : m_pref->getStyleSheetList()) {
shun-iwasawa 8fb291
    TFilePath path(str.toStdWString());
shun-iwasawa 8fb291
    QString name = QString::fromStdWString(path.getWideName());
shun-iwasawa 8fb291
    styleSheetItemList.push_back(ComboBoxItem(name, name));
shun-iwasawa 8fb291
  }
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  QList<comboboxitem> roomItemList;</comboboxitem>
shun-iwasawa 8fb291
  foreach (QString roomName, m_pref->getRoomMap())
shun-iwasawa 8fb291
    roomItemList.push_back(ComboBoxItem(roomName, roomName));
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  QList<comboboxitem> languageItemList;</comboboxitem>
shun-iwasawa 8fb291
  for (const QString& name : m_pref->getLanguageList())
shun-iwasawa 8fb291
    languageItemList.push_back(ComboBoxItem(name, name));
shun-iwasawa 8fb291
shun-iwasawa c54dfb
  QPushButton* additionalStyleSheetBtn =
shun-iwasawa c54dfb
      new QPushButton(tr("Edit Additional Style Sheet.."));
shun-iwasawa 215a5b
  QPushButton* check30bitBtn = new QPushButton(tr("Check Availability"));
shun-iwasawa c54dfb
shun-iwasawa 8fb291
  QWidget* widget  = new QWidget(this);
shun-iwasawa 8fb291
  QGridLayout* lay = new QGridLayout();
shun-iwasawa 8fb291
  setupLayout(lay);
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  insertUI(CurrentStyleSheetName, lay, styleSheetItemList);
shun-iwasawa c54dfb
  int row = lay->rowCount();
shun-iwasawa fc0d80
  lay->addWidget(additionalStyleSheetBtn, row - 1, 2, Qt::AlignRight);
shun-iwasawa 8fb291
Kite 521c84
  lay->addWidget(new QLabel(tr("Icon Theme*:"), this), 2, 0,
shun-iwasawa 8fb291
                 Qt::AlignRight | Qt::AlignVCenter);
Kite 521c84
  lay->addWidget(createUI(iconTheme), 2, 1);
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  insertUI(linearUnits, lay, getComboItemList(linearUnits));
shun-iwasawa 8fb291
  insertUI(cameraUnits, lay,
shun-iwasawa 8fb291
           getComboItemList(linearUnits));  // share items with linearUnits
Kite 521c84
Kite 521c84
  lay->addWidget(new QLabel(tr("Pixels Only:"), this), 5, 0,
Kite 521c84
                 Qt::AlignRight | Qt::AlignVCenter);
shun-iwasawa fc0d80
  lay->addWidget(createUI(pixelsOnly), 5, 1, 1, 2, Qt::AlignLeft);
Kite 521c84
shun-iwasawa 8fb291
  insertUI(CurrentRoomChoice, lay, roomItemList);
shun-iwasawa 8fb291
  insertUI(functionEditorToggle, lay, getComboItemList(functionEditorToggle));
shun-iwasawa 8fb291
  insertUI(moveCurrentFrameByClickCellArea, lay);
shun-iwasawa 8fb291
  insertUI(actualPixelViewOnSceneEditingMode, lay);
shun-iwasawa 8fb291
  insertUI(showRasterImagesDarkenBlendedInViewer, lay);
shun-iwasawa 8fb291
  insertUI(iconSize, lay);
shun-iwasawa 8fb291
  insertDualUIs(viewShrink, viewStep, lay);
shun-iwasawa 8fb291
  insertUI(viewerZoomCenter, lay, getComboItemList(viewerZoomCenter));
shun-iwasawa 8fb291
  insertUI(CurrentLanguageName, lay, languageItemList);
shun-iwasawa 8fb291
  insertUI(interfaceFont, lay);  // creates QFontComboBox
shun-iwasawa 8fb291
  insertUI(interfaceFontStyle, lay, buildFontStyleList());
shun-iwasawa 475715
  qobject_cast<qcombobox*>(m_controlIdMap.key(interfaceFontStyle))</qcombobox*>
shun-iwasawa 475715
      ->setSizeAdjustPolicy(QComboBox::AdjustToContents);
shun-iwasawa 475715
shun-iwasawa 8fb291
  QGridLayout* colorCalibLay = insertGroupBoxUI(colorCalibrationEnabled, lay);
shun-iwasawa 8fb291
  { insertUI(colorCalibrationLutPaths, colorCalibLay); }
shun-iwasawa 215a5b
  insertUI(displayIn30bit, lay);
shun-iwasawa 215a5b
  row = lay->rowCount();
shun-iwasawa fc0d80
  lay->addWidget(check30bitBtn, row - 1, 2, Qt::AlignRight);
shun-iwasawa bb8132
  insertUI(showIconsInMenu, lay);
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  lay->setRowStretch(lay->rowCount(), 1);
shun-iwasawa 8fb291
  insertFootNote(lay);
shun-iwasawa 8fb291
  widget->setLayout(lay);
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  if (m_pref->getBoolValue(pixelsOnly)) {
shun-iwasawa 8fb291
    m_controlIdMap.key(linearUnits)->setDisabled(true);
shun-iwasawa 8fb291
    m_controlIdMap.key(cameraUnits)->setDisabled(true);
shun-iwasawa 8fb291
  }
shun-iwasawa 8fb291
  // pixels unit may deactivated externally on loading scene (see
shun-iwasawa 8fb291
  // IoCmd::loadScene())
shun-iwasawa 8fb291
  bool ret = true;
shun-iwasawa 8fb291
  ret      = ret && connect(TApp::instance()->getCurrentScene(),
shun-iwasawa 7c3c0a
                            SIGNAL(pixelUnitSelected(bool)), this,
shun-iwasawa 7c3c0a
                            SLOT(onPixelUnitExternallySelected(bool)));
shun-iwasawa c54dfb
  ret      = ret && connect(additionalStyleSheetBtn, SIGNAL(clicked()), this,
shun-iwasawa 7c3c0a
                            SLOT(onEditAdditionalStyleSheet()));
shun-iwasawa 215a5b
  ret      = ret && connect(check30bitBtn, SIGNAL(clicked()), this,
shun-iwasawa 7c3c0a
                            SLOT(onCheck30bitDisplay()));
shun-iwasawa 8fb291
  assert(ret);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(CurrentStyleSheetName,
shun-iwasawa 8fb291
                           &PreferencesPopup::onStyleSheetTypeChanged);
Kite 521c84
  m_onEditedFuncMap.insert(iconTheme, &PreferencesPopup::onIconThemeChanged);
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(pixelsOnly, &PreferencesPopup::onPixelsOnlyChanged);
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(linearUnits, &PreferencesPopup::onUnitChanged);
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(cameraUnits, &PreferencesPopup::onUnitChanged);
shun-iwasawa 8fb291
  m_preEditedFuncMap.insert(CurrentRoomChoice,
shun-iwasawa 8fb291
                            &PreferencesPopup::beforeRoomChoiceChanged);
shun-iwasawa a8f111
  m_onEditedFuncMap.insert(colorCalibrationEnabled,
shun-iwasawa a8f111
                           &PreferencesPopup::onColorCalibrationChanged);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  return widget;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
QWidget* PreferencesPopup::createVisualizationPage() {
shun-iwasawa 8fb291
  QWidget* widget  = new QWidget(this);
shun-iwasawa 8fb291
  QGridLayout* lay = new QGridLayout();
shun-iwasawa 8fb291
  setupLayout(lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  insertUI(show0ThickLines, lay);
shun-iwasawa 8fb291
  insertUI(regionAntialias, lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  lay->setRowStretch(lay->rowCount(), 1);
shun-iwasawa 8fb291
  widget->setLayout(lay);
shun-iwasawa 8fb291
  return widget;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
QWidget* PreferencesPopup::createLoadingPage() {
shun-iwasawa 8fb291
  m_levelFormatNames = new QComboBox;
shun-iwasawa 475715
  m_levelFormatNames->setSizeAdjustPolicy(QComboBox::AdjustToContents);
shun-iwasawa 475715
  m_editLevelFormat = new QPushButton(tr("Edit"));
Jeremy Bullock 17d8f9
shun-iwasawa 8fb291
  QPushButton* addLevelFormat    = new QPushButton("+");
shun-iwasawa 8fb291
  QPushButton* removeLevelFormat = new QPushButton("-");
shun-iwasawa 8fb291
  addLevelFormat->setFixedSize(20, 20);
shun-iwasawa 8fb291
  removeLevelFormat->setFixedSize(20, 20);
shun-iwasawa 8fb291
  rebuildFormatsList();
Jeremy Bullock 17d8f9
shun-iwasawa 8fb291
  QWidget* widget  = new QWidget(this);
shun-iwasawa 8fb291
  QGridLayout* lay = new QGridLayout();
shun-iwasawa 8fb291
  setupLayout(lay);
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  insertUI(importPolicy, lay, getComboItemList(importPolicy));
shun-iwasawa 409dec
  QGridLayout* autoExposeLay = insertGroupBoxUI(autoExposeEnabled, lay);
shun-iwasawa 409dec
  { insertUI(autoRemoveUnusedLevels, autoExposeLay); }
shun-iwasawa 8fb291
  insertUI(subsceneFolderEnabled, lay);
shun-iwasawa 8fb291
  insertUI(removeSceneNumberFromLoadedLevelName, lay);
shun-iwasawa 8fb291
  insertUI(IgnoreImageDpi, lay);
shun-iwasawa 8fb291
  insertUI(initialLoadTlvCachingBehavior, lay,
shun-iwasawa 8fb291
           getComboItemList(initialLoadTlvCachingBehavior));
shun-iwasawa 8fb291
  insertUI(columnIconLoadingPolicy, lay,
shun-iwasawa 8fb291
           getComboItemList(columnIconLoadingPolicy));
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  // levelFormats,// need to be handle separately
shun-iwasawa 8fb291
  int row = lay->rowCount();
shun-iwasawa 8fb291
  lay->addWidget(new QLabel(tr("Level Settings by File Format:")), row, 0,
shun-iwasawa 8fb291
                 Qt::AlignRight | Qt::AlignVCenter);
shun-iwasawa 8fb291
  QHBoxLayout* levelFormatLay = new QHBoxLayout();
shun-iwasawa 8fb291
  levelFormatLay->setMargin(0);
shun-iwasawa 8fb291
  levelFormatLay->setSpacing(5);
shun-iwasawa 8fb291
  {
shun-iwasawa 8fb291
    levelFormatLay->addWidget(m_levelFormatNames);
shun-iwasawa 8fb291
    levelFormatLay->addWidget(addLevelFormat);
shun-iwasawa 8fb291
    levelFormatLay->addWidget(removeLevelFormat);
shun-iwasawa 8fb291
    levelFormatLay->addWidget(m_editLevelFormat);
shun-iwasawa 8fb291
    levelFormatLay->addStretch(1);
shun-iwasawa 8fb291
  }
shun-iwasawa 8fb291
  lay->addLayout(levelFormatLay, row, 1, 1, 2);
shun-iwasawa 1d5937
shun-iwasawa 8fb291
  lay->setRowStretch(lay->rowCount(), 1);
shun-iwasawa 8fb291
  widget->setLayout(lay);
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  bool ret = true;
shun-iwasawa 8fb291
  ret      = ret &&
shun-iwasawa 8fb291
        connect(addLevelFormat, SIGNAL(clicked()), SLOT(onAddLevelFormat()));
shun-iwasawa 8fb291
  ret = ret && connect(removeLevelFormat, SIGNAL(clicked()),
shun-iwasawa 8fb291
                       SLOT(onRemoveLevelFormat()));
shun-iwasawa 8fb291
  ret = ret && connect(m_editLevelFormat, SIGNAL(clicked()),
shun-iwasawa 8fb291
                       SLOT(onEditLevelFormat()));
shun-iwasawa 8fb291
  ret = ret && connect(TApp::instance()->getCurrentScene(),
shun-iwasawa 8fb291
                       SIGNAL(importPolicyChanged(int)), this,
shun-iwasawa 8fb291
                       SLOT(onImportPolicyExternallyChanged(int)));
shun-iwasawa 8fb291
  assert(ret);
shun-iwasawa 1d5937
shun-iwasawa 8fb291
  return widget;
Jeremy Bullock 1e17ed
}
Jeremy Bullock 1e17ed
Jeremy Bullock 1e17ed
//-----------------------------------------------------------------------------
Jeremy Bullock 1e17ed
shun-iwasawa 8fb291
QWidget* PreferencesPopup::createSavingPage() {
shun-iwasawa 8fb291
  QWidget* widget  = new QWidget(this);
shun-iwasawa 8fb291
  QGridLayout* lay = new QGridLayout();
shun-iwasawa 8fb291
  setupLayout(lay);
Jeremy Bullock 2c9cf6
  QGridLayout* autoSaveLay = insertGroupBoxUI(autosaveEnabled, lay);
Jeremy Bullock 2c9cf6
  {
shun-iwasawa c9a4a1
    insertUI(autosavePeriod, autoSaveLay);
shun-iwasawa c9a4a1
    insertUI(autosaveSceneEnabled, autoSaveLay);
shun-iwasawa c9a4a1
    insertUI(autosaveOtherFilesEnabled, autoSaveLay);
Jeremy Bullock 2c9cf6
  }
Jeremy Bullock 2c9cf6
  insertUI(replaceAfterSaveLevelAs, lay);
Jeremy Bullock 2c9cf6
  QGridLayout* backupLay = insertGroupBoxUI(backupEnabled, lay);
Jeremy Bullock 2c9cf6
  { insertUI(backupKeepCount, backupLay); }
shun-iwasawa 8fb291
  QLabel* matteColorLabel =
shun-iwasawa 8fb291
      new QLabel(tr("Matte color is used for background when overwriting "
shun-iwasawa 8fb291
                    "raster levels with transparent pixels\nin non "
shun-iwasawa 8fb291
                    "alpha-enabled image format."),
shun-iwasawa 8fb291
                 this);
shun-iwasawa c9a4a1
  lay->addWidget(matteColorLabel, lay->rowCount(), 0, 1, 3, Qt::AlignLeft);
shun-iwasawa 8fb291
  insertUI(rasterBackgroundColor, lay);
shun-iwasawa d2bb27
  insertUI(resetUndoOnSavingLevel, lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  lay->setRowStretch(lay->rowCount(), 1);
shun-iwasawa 8fb291
  widget->setLayout(lay);
shun-iwasawa 8fb291
  return widget;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
QWidget* PreferencesPopup::createImportExportPage() {
shun-iwasawa 8fb291
  auto putLabel = [&](const QString& labelStr, QGridLayout* lay) {
shun-iwasawa 8fb291
    lay->addWidget(new QLabel(labelStr, this), lay->rowCount(), 0, 1, 3,
shun-iwasawa 8fb291
                   Qt::AlignLeft | Qt::AlignVCenter);
shun-iwasawa 8fb291
  };
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  QWidget* widget  = new QWidget(this);
shun-iwasawa 8fb291
  QGridLayout* lay = new QGridLayout();
shun-iwasawa 8fb291
  setupLayout(lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  putLabel(tr("OpenToonz can use FFmpeg for additional file formats.\n") +
shun-iwasawa 8fb291
               tr("FFmpeg is not bundled with OpenToonz.\n") +
shun-iwasawa 8fb291
               tr("Please provide the path where FFmpeg is located on your "
shun-iwasawa 8fb291
                  "computer."),
shun-iwasawa 8fb291
           lay);
shun-iwasawa 8fb291
  insertUI(ffmpegPath, lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  putLabel(tr("Number of seconds to wait for FFmpeg to complete processing the "
shun-iwasawa 8fb291
              "output:"),
shun-iwasawa 8fb291
           lay);
shun-iwasawa 8fb291
  putLabel(
shun-iwasawa 8fb291
      tr("Note: FFmpeg begins working once all images have been processed."),
shun-iwasawa 8fb291
      lay);
shun-iwasawa 8fb291
  insertUI(ffmpegTimeout, lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  putLabel(tr("Please indicate where you would like exports from Fast "
MrBlockCat 845bc7
              "Render (MP4) to go."),
shun-iwasawa 8fb291
           lay);
shun-iwasawa 8fb291
  insertUI(fastRenderPath, lay);
Toshihiro Shimizu 890ddd
justburner 69bbaf
  putLabel("", lay);
justburner 69bbaf
  putLabel(
shun-iwasawa fc0d80
      tr("Enabling multi-thread rendering will render significantly faster \n"
justburner 69bbaf
         "but a random crash might occur, use at your own risk."),
justburner 69bbaf
      lay);
justburner 69bbaf
  insertUI(ffmpegMultiThread, lay);
justburner 69bbaf
shun-iwasawa 8fb291
  lay->setRowStretch(lay->rowCount(), 1);
shun-iwasawa 8fb291
  insertFootNote(lay);
shun-iwasawa 8fb291
  widget->setLayout(lay);
justburner 08eb1b
  return widget;
justburner 08eb1b
}
justburner 08eb1b
justburner 08eb1b
//-----------------------------------------------------------------------------
justburner 08eb1b
justburner 08eb1b
QWidget* PreferencesPopup::createAutoLipSyncPage() {
justburner 08eb1b
  auto putLabel = [&](const QString& labelStr, QGridLayout* lay) {
justburner 08eb1b
    lay->addWidget(new QLabel(labelStr, this), lay->rowCount(), 0, 1, 3,
justburner 08eb1b
                   Qt::AlignLeft | Qt::AlignVCenter);
justburner 08eb1b
  };
justburner 08eb1b
justburner 08eb1b
  QWidget* widget  = new QWidget(this);
justburner 08eb1b
  QGridLayout* lay = new QGridLayout();
justburner 08eb1b
  setupLayout(lay);
justburner 08eb1b
justburner 08eb1b
  putLabel(tr("OpenToonz can use Rhubarb for auto lip-syncing.\n") +
justburner 08eb1b
               tr("Rhubarb is not bundled with OpenToonz.\n") +
justburner 08eb1b
               tr("Please provide the path where Rhubarb is located on your "
justburner 08eb1b
                  "computer."),
justburner 08eb1b
           lay);
justburner 08eb1b
justburner 08eb1b
  insertUI(rhubarbPath, lay);
justburner 08eb1b
justburner 08eb1b
  putLabel(tr("Number of seconds to wait for Rhubarb to complete processing "
justburner 08eb1b
              "the audio:"),
justburner 08eb1b
           lay);
justburner 08eb1b
  insertUI(rhubarbTimeout, lay);
justburner 08eb1b
justburner 08eb1b
  lay->setRowStretch(lay->rowCount(), 1);
justburner 08eb1b
  insertFootNote(lay);
justburner 08eb1b
  widget->setLayout(lay);
shun-iwasawa 8fb291
  return widget;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
QWidget* PreferencesPopup::createDrawingPage() {
shun-iwasawa 8fb291
  QWidget* widget  = new QWidget(this);
shun-iwasawa 8fb291
  QGridLayout* lay = new QGridLayout();
shun-iwasawa 8fb291
  setupLayout(lay);
Toshihiro Shimizu 890ddd
shun-iwasawa fc0d80
  insertUI(DefRasterFormat, lay, getComboItemList(DefRasterFormat));
shun-iwasawa 8fb291
  insertUI(DefLevelType, lay, getComboItemList(DefLevelType));
shun-iwasawa 8fb291
  insertUI(newLevelSizeToCameraSizeEnabled, lay);
shun-iwasawa 8fb291
  insertDualUIs(DefLevelWidth, DefLevelHeight, lay);
shun-iwasawa 8fb291
  insertUI(DefLevelDpi, lay);
shun-iwasawa 536025
  QGridLayout* autoCreationLay = insertGroupBoxUI(EnableAutocreation, lay);
shun-iwasawa 536025
  {
shun-iwasawa 536025
    insertUI(NumberingSystem, autoCreationLay,
shun-iwasawa 536025
             getComboItemList(NumberingSystem));
shun-iwasawa 536025
    insertUI(EnableAutoStretch, autoCreationLay);
shun-iwasawa 536025
    insertUI(EnableCreationInHoldCells, autoCreationLay);
shun-iwasawa 536025
    insertUI(EnableAutoRenumber, autoCreationLay);
shun-iwasawa 536025
  }
shun-iwasawa 8fb291
  insertUI(vectorSnappingTarget, lay, getComboItemList(vectorSnappingTarget));
shun-iwasawa 8fb291
  insertUI(saveUnpaintedInCleanup, lay);
shun-iwasawa 8fb291
  insertUI(minimizeSaveboxAfterEditing, lay);
shun-iwasawa 8fb291
  insertUI(useNumpadForSwitchingStyles, lay);
shun-iwasawa 8fb291
  insertUI(downArrowInLevelStripCreatesNewFrame, lay);
shun-iwasawa 8fb291
  QGridLayout* replaceVectorsLay = insertGroupBox(
shun-iwasawa 8fb291
      tr("Replace Vectors with Simplified Vectors Command"), lay);
shun-iwasawa 8fb291
  {
shun-iwasawa 8fb291
    insertUI(keepFillOnVectorSimplify, replaceVectorsLay);
shun-iwasawa 8fb291
    insertUI(useHigherDpiOnVectorSimplify, replaceVectorsLay);
shun-iwasawa 8fb291
  }
shun-iwasawa 8fb291
  lay->setRowStretch(lay->rowCount(), 1);
shun-iwasawa 8fb291
  widget->setLayout(lay);
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(DefLevelType,
shun-iwasawa 8fb291
                           &PreferencesPopup::onDefLevelTypeChanged);
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(newLevelSizeToCameraSizeEnabled,
shun-iwasawa 8fb291
                           &PreferencesPopup::onDefLevelTypeChanged);
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  onDefLevelTypeChanged();
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  if (m_pref->getBoolValue(pixelsOnly)) {
shun-iwasawa 8fb291
    m_controlIdMap.key(DefLevelDpi)->setDisabled(true);
shun-iwasawa 8fb291
    getUI<measureddoublelineedit*>(DefLevelWidth)->setDecimals(0);</measureddoublelineedit*>
shun-iwasawa 8fb291
    getUI<measureddoublelineedit*>(DefLevelHeight)->setDecimals(0);</measureddoublelineedit*>
shun-iwasawa 8fb291
  }
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  return widget;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
QWidget* PreferencesPopup::createToolsPage() {
shun-iwasawa 8fb291
  QWidget* widget  = new QWidget(this);
shun-iwasawa 8fb291
  QGridLayout* lay = new QGridLayout();
shun-iwasawa 8fb291
  setupLayout(lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 390cff
  // insertUI(dropdownShortcutsCycleOptions, lay,
shun-iwasawa 390cff
  //         getComboItemList(dropdownShortcutsCycleOptions));
shun-iwasawa 8fb291
  insertUI(FillOnlysavebox, lay);
shun-iwasawa 8fb291
  insertUI(multiLayerStylePickerEnabled, lay);
shun-iwasawa 8fb291
  QGridLayout* cursorOptionsLay = insertGroupBox(tr("Cursor Options"), lay);
shun-iwasawa 8fb291
  {
shun-iwasawa 8fb291
    insertUI(cursorBrushType, cursorOptionsLay,
shun-iwasawa 8fb291
             getComboItemList(cursorBrushType));
shun-iwasawa 8fb291
    insertUI(cursorBrushStyle, cursorOptionsLay,
shun-iwasawa 8fb291
             getComboItemList(cursorBrushStyle));
shun-iwasawa 8fb291
    insertUI(cursorOutlineEnabled, cursorOptionsLay);
shun-iwasawa 8fb291
  }
shun-iwasawa 8fb291
  insertUI(levelBasedToolsDisplay, lay,
shun-iwasawa 8fb291
           getComboItemList(levelBasedToolsDisplay));
shun-iwasawa c9a4a1
  insertUI(useCtrlAltToResizeBrush, lay);
Kite ce2d82
  insertUI(tempToolSwitchTimer, lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  lay->setRowStretch(lay->rowCount(), 1);
shun-iwasawa 8fb291
  widget->setLayout(lay);
shun_iwasawa 9f6fb4
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(FillOnlysavebox,
shun-iwasawa 8fb291
                           &PreferencesPopup::notifySceneChanged);
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(levelBasedToolsDisplay,
shun-iwasawa 8fb291
                           &PreferencesPopup::onLevelBasedToolsDisplayChanged);
shun_iwasawa 9f6fb4
shun-iwasawa 8fb291
  return widget;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
QWidget* PreferencesPopup::createXsheetPage() {
shun-iwasawa 8fb291
  QWidget* widget  = new QWidget(this);
shun-iwasawa 8fb291
  QGridLayout* lay = new QGridLayout();
shun-iwasawa 8fb291
  setupLayout(lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  insertUI(xsheetLayoutPreference, lay,
shun-iwasawa 8fb291
           getComboItemList(xsheetLayoutPreference));
shun-iwasawa 855b12
  insertUI(levelNameDisplayType, lay, getComboItemList(levelNameDisplayType));
shun-iwasawa 8fb291
  insertUI(xsheetStep, lay);
shun-iwasawa 8fb291
  insertUI(xsheetAutopanEnabled, lay);
shun-iwasawa 8fb291
  insertUI(DragCellsBehaviour, lay, getComboItemList(DragCellsBehaviour));
shun-iwasawa 8fb291
  insertUI(ignoreAlphaonColumn1Enabled, lay);
shun-iwasawa 8fb291
  QGridLayout* showKeyLay =
shun-iwasawa 8fb291
      insertGroupBoxUI(showKeyframesOnXsheetCellArea, lay);
shun-iwasawa 8fb291
  { insertUI(showXsheetCameraColumn, showKeyLay); }
shun-iwasawa 8fb291
  insertUI(useArrowKeyToShiftCellSelection, lay);
shun-iwasawa 8fb291
  insertUI(inputCellsWithoutDoubleClickingEnabled, lay);
shun-iwasawa 8fb291
  insertUI(shortcutCommandsWhileRenamingCellEnabled, lay);
shun-iwasawa 8fb291
  QGridLayout* xshToolbarLay = insertGroupBoxUI(showXSheetToolbar, lay);
shun-iwasawa 8fb291
  { insertUI(expandFunctionHeader, xshToolbarLay); }
shun-iwasawa 8fb291
  insertUI(showColumnNumbers, lay);
justburner c2d6ed
  insertUI(parentColorsInXsheetColumn, lay);
shun-iwasawa fe3506
  insertUI(highlightLineEverySecond, lay);
shun-iwasawa 8fb291
  insertUI(syncLevelRenumberWithXsheet, lay);
shun-iwasawa 8fb291
  insertUI(currentTimelineEnabled, lay);
shun-iwasawa 8fb291
  insertUI(currentColumnColor, lay);
shun-iwasawa 855b12
  insertUI(showFrameNumberWithLetters, lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  lay->setRowStretch(lay->rowCount(), 1);
shun-iwasawa 8fb291
  insertFootNote(lay);
shun-iwasawa 8fb291
  widget->setLayout(lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(showKeyframesOnXsheetCellArea,
shun-iwasawa 8fb291
                           &PreferencesPopup::onShowKeyframesOnCellAreaChanged);
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(showXsheetCameraColumn,
shun-iwasawa 8fb291
                           &PreferencesPopup::onShowKeyframesOnCellAreaChanged);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  return widget;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
QWidget* PreferencesPopup::createAnimationPage() {
shun-iwasawa 8fb291
  QWidget* widget  = new QWidget(this);
shun-iwasawa 8fb291
  QGridLayout* lay = new QGridLayout();
shun-iwasawa 8fb291
  setupLayout(lay);
manongjohn 177b7c
shun-iwasawa 8fb291
  insertUI(keyframeType, lay, getComboItemList(keyframeType));
shun-iwasawa 8fb291
  insertUI(animationStep, lay);
shun-iwasawa 4a3868
  insertUI(modifyExpressionOnMovingReferences, lay);
manongjohn 177b7c
shun-iwasawa 8fb291
  lay->setRowStretch(lay->rowCount(), 1);
shun-iwasawa 8fb291
  widget->setLayout(lay);
shun-iwasawa 4a3868
shun-iwasawa 4a3868
  m_onEditedFuncMap.insert(
shun-iwasawa 4a3868
      modifyExpressionOnMovingReferences,
shun-iwasawa 4a3868
      &PreferencesPopup::onModifyExpressionOnMovingReferencesChanged);
shun-iwasawa 4a3868
shun-iwasawa 8fb291
  return widget;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
QWidget* PreferencesPopup::createPreviewPage() {
shun-iwasawa 8fb291
  QWidget* widget  = new QWidget(this);
shun-iwasawa 8fb291
  QGridLayout* lay = new QGridLayout();
shun-iwasawa 8fb291
  setupLayout(lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  insertUI(blanksCount, lay);
shun-iwasawa 8fb291
  insertUI(blankColor, lay);
shun-iwasawa 8fb291
  insertUI(rewindAfterPlayback, lay);
Jeremy Bullock a956af
  insertUI(shortPlayFrameCount, lay);
shun-iwasawa 8fb291
  insertUI(previewAlwaysOpenNewFlip, lay);
shun-iwasawa 8fb291
  insertUI(fitToFlipbook, lay);
shun-iwasawa 8fb291
  insertUI(generatedMovieViewEnabled, lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  lay->setRowStretch(lay->rowCount(), 1);
shun-iwasawa 8fb291
  widget->setLayout(lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(blanksCount, &PreferencesPopup::onBlankCountChanged);
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(blankColor, &PreferencesPopup::onBlankColorChanged);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  return widget;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
QWidget* PreferencesPopup::createOnionSkinPage() {
shun-iwasawa 8fb291
  QWidget* widget  = new QWidget(this);
shun-iwasawa 8fb291
  QGridLayout* lay = new QGridLayout();
shun-iwasawa 8fb291
  setupLayout(lay);
Jeremy Bullock cd00fd
shun-iwasawa 8fb291
  insertUI(onionSkinEnabled, lay);
shun-iwasawa 8fb291
  insertUI(onionPaperThickness, lay);
shun-iwasawa 8fb291
  insertUI(backOnionColor, lay);
shun-iwasawa 8fb291
  insertUI(frontOnionColor, lay);
shun-iwasawa 8fb291
  insertUI(onionInksOnly, lay);
shun-iwasawa 8fb291
  insertUI(onionSkinDuringPlayback, lay);
shun-iwasawa 8fb291
  insertUI(useOnionColorsForShiftAndTraceGhosts, lay);
shun-iwasawa 8fb291
  insertUI(animatedGuidedDrawing, lay, getComboItemList(animatedGuidedDrawing));
Jeremy Bullock cd00fd
shun-iwasawa 8fb291
  lay->setRowStretch(lay->rowCount(), 1);
shun-iwasawa 8fb291
  widget->setLayout(lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(onionSkinEnabled,
shun-iwasawa 8fb291
                           &PreferencesPopup::onOnionSkinVisibilityChanged);
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(onionPaperThickness,
shun-iwasawa 8fb291
                           &PreferencesPopup::notifySceneChanged);
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(backOnionColor,
shun-iwasawa 8fb291
                           &PreferencesPopup::onOnionColorChanged);
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(frontOnionColor,
shun-iwasawa 8fb291
                           &PreferencesPopup::onOnionColorChanged);
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(onionInksOnly,
shun-iwasawa 8fb291
                           &PreferencesPopup::notifySceneChanged);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  bool onionActive = m_pref->getBoolValue(onionSkinEnabled);
shun-iwasawa 8fb291
  if (!onionActive) {
shun-iwasawa 8fb291
    m_controlIdMap.key(onionPaperThickness)->setDisabled(true);
shun-iwasawa 8fb291
    m_controlIdMap.key(backOnionColor)->setDisabled(true);
shun-iwasawa 8fb291
    m_controlIdMap.key(frontOnionColor)->setDisabled(true);
shun-iwasawa 8fb291
    m_controlIdMap.key(onionInksOnly)->setDisabled(true);
shun-iwasawa 8fb291
  }
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  return widget;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
QWidget* PreferencesPopup::createColorsPage() {
shun-iwasawa 8fb291
  QWidget* widget  = new QWidget(this);
shun-iwasawa 8fb291
  QGridLayout* lay = new QGridLayout();
shun-iwasawa 8fb291
  setupLayout(lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  insertUI(viewerBGColor, lay);
shun-iwasawa 8fb291
  insertUI(previewBGColor, lay);
shun-iwasawa 8fb291
  insertUI(levelEditorBoxColor, lay);
shun-iwasawa 8fb291
  insertUI(chessboardColor1, lay);
shun-iwasawa 8fb291
  insertUI(chessboardColor2, lay);
shun-iwasawa 8fb291
  QGridLayout* tcLay = insertGroupBox(tr("Transparency Check"), lay);
shun-iwasawa 8fb291
  {
shun-iwasawa 8fb291
    insertUI(transpCheckInkOnWhite, tcLay);
shun-iwasawa 8fb291
    insertUI(transpCheckInkOnBlack, tcLay);
shun-iwasawa 8fb291
    insertUI(transpCheckPaint, tcLay);
Shinya Kitaoka 120a6e
  }
shun-iwasawa 8fb291
  lay->setRowStretch(lay->rowCount(), 1);
shun-iwasawa 8fb291
  widget->setLayout(lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(viewerBGColor,
shun-iwasawa 8fb291
                           &PreferencesPopup::notifySceneChanged);
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(previewBGColor,
shun-iwasawa 8fb291
                           &PreferencesPopup::notifySceneChanged);
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(levelEditorBoxColor,
shun-iwasawa 8fb291
                           &PreferencesPopup::notifySceneChanged);
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(chessboardColor1,
shun-iwasawa 8fb291
                           &PreferencesPopup::notifySceneChanged);
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(chessboardColor2,
shun-iwasawa 8fb291
                           &PreferencesPopup::notifySceneChanged);
justburner a13da2
  m_onEditedFuncMap.insert(chessboardColor1,
justburner a13da2
                           &PreferencesPopup::onChessboardChanged);
justburner a13da2
  m_onEditedFuncMap.insert(chessboardColor2,
justburner a13da2
                           &PreferencesPopup::onChessboardChanged);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  return widget;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
QWidget* PreferencesPopup::createVersionControlPage() {
shun-iwasawa 8fb291
  QWidget* widget  = new QWidget(this);
shun-iwasawa 8fb291
  QGridLayout* lay = new QGridLayout();
shun-iwasawa 8fb291
  setupLayout(lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  insertUI(SVNEnabled, lay);
shun-iwasawa 8fb291
  insertUI(automaticSVNFolderRefreshEnabled, lay);
shun-iwasawa 8fb291
  insertUI(latestVersionCheckEnabled, lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  lay->setRowStretch(lay->rowCount(), 1);
shun-iwasawa 8fb291
  insertFootNote(lay);
shun-iwasawa 8fb291
  widget->setLayout(lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  m_onEditedFuncMap.insert(SVNEnabled, &PreferencesPopup::onSVNEnabledChanged);
shun-iwasawa 8fb291
shun-iwasawa 8fb291
  return widget;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
QWidget* PreferencesPopup::createTouchTabletPage() {
shun-iwasawa 8fb291
  bool winInkAvailable = false;
shun-iwasawa 8fb291
#ifdef _WIN32
shun-iwasawa 8fb291
  winInkAvailable = KisTabletSupportWin8::isAvailable();
shun-iwasawa 8fb291
#endif
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  QAction* touchAction =
shun-iwasawa 8fb291
      CommandManager::instance()->getAction(MI_TouchGestureControl);
shun-iwasawa 8fb291
  CheckBox* enableTouchGestures =
shun-iwasawa 8fb291
      new CheckBox(tr("Enable Touch Gesture Controls"));
shun-iwasawa 8fb291
  enableTouchGestures->setChecked(touchAction->isChecked());
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  QWidget* widget  = new QWidget(this);
shun-iwasawa 8fb291
  QGridLayout* lay = new QGridLayout();
shun-iwasawa 8fb291
  setupLayout(lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  lay->addWidget(enableTouchGestures, 0, 0, 1, 2);
shun-iwasawa 8fb291
  if (winInkAvailable) insertUI(winInkEnabled, lay);
shun-iwasawa 19cec1
#ifdef WITH_WINTAB
shun-iwasawa 19cec1
  insertUI(useQtNativeWinInk, lay);
shun-iwasawa 19cec1
#endif
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  lay->setRowStretch(lay->rowCount(), 1);
shun-iwasawa 8fb291
  if (winInkAvailable) insertFootNote(lay);
shun-iwasawa 8fb291
  widget->setLayout(lay);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  bool ret = true;
shun-iwasawa 8fb291
  ret = ret && connect(enableTouchGestures, SIGNAL(clicked(bool)), touchAction,
shun-iwasawa 8fb291
                       SLOT(setChecked(bool)));
shun-iwasawa 8fb291
  ret = ret && connect(touchAction, SIGNAL(triggered(bool)),
shun-iwasawa 8fb291
                       enableTouchGestures, SLOT(setChecked(bool)));
shun-iwasawa 8fb291
  assert(ret);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  return widget;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
void PreferencesPopup::onChange() {
shun-iwasawa 8fb291
  QWidget* senderWidget = qobject_cast<qwidget*>(sender());</qwidget*>
shun-iwasawa 8fb291
  if (!senderWidget) return;
shun-iwasawa 8fb291
  PreferencesItemId id = m_controlIdMap.value(senderWidget);
Toshihiro Shimizu 890ddd
shun-iwasawa 8fb291
  if (m_preEditedFuncMap.contains(id)) (this->*m_preEditedFuncMap[id])();
turtletooth 04d8fd
shun-iwasawa 8fb291
  if (CheckBox* cb = dynamic_cast<checkbox*>(senderWidget))</checkbox*>
shun-iwasawa 8fb291
    m_pref->setValue(id, cb->isChecked());
shun-iwasawa 8fb291
  else if (IntLineEdit* edit = dynamic_cast<intlineedit*>(senderWidget))</intlineedit*>
shun-iwasawa 8fb291
    m_pref->setValue(id, edit->getValue());
shun-iwasawa 8fb291
  else if (QComboBox* comboBox = dynamic_cast<qcombobox*>(senderWidget))</qcombobox*>
shun-iwasawa 8fb291
    m_pref->setValue(id, comboBox->currentData());
shun-iwasawa 8fb291
  else if (DoubleValueLineEdit* field =
shun-iwasawa 8fb291
               dynamic_cast<doublevaluelineedit*>(senderWidget))</doublevaluelineedit*>
shun-iwasawa 8fb291
    m_pref->setValue(id, field->getValue());
shun-iwasawa 8fb291
  else if (FileField* field = dynamic_cast<filefield*>(senderWidget))</filefield*>
shun-iwasawa 8fb291
    m_pref->setValue(id, field->getPath());
shun-iwasawa 8fb291
  else if (SizeField* field = dynamic_cast<sizefield*>(senderWidget))</sizefield*>
shun-iwasawa 8fb291
    m_pref->setValue(id, field->getValue());
shun-iwasawa 8fb291
  else if (QGroupBox* groupBox = dynamic_cast<qgroupbox*>(senderWidget))</qgroupbox*>
shun-iwasawa 8fb291
    m_pref->setValue(id, groupBox->isChecked());
shun-iwasawa 8fb291
  else
shun-iwasawa 8fb291
    return;
turtletooth 04d8fd
shun-iwasawa 8fb291
  if (m_onEditedFuncMap.contains(id)) (this->*m_onEditedFuncMap[id])();
turtletooth 04d8fd
}
turtletooth 04d8fd
turtletooth 04d8fd
//-----------------------------------------------------------------------------
turtletooth 04d8fd
shun-iwasawa 8fb291
void PreferencesPopup::onColorFieldChanged(const TPixel32& color,
shun-iwasawa 8fb291
                                           bool isDragging) {
shun-iwasawa 8fb291
  QWidget* senderWidget = qobject_cast<qwidget*>(sender());</qwidget*>
shun-iwasawa 8fb291
  if (!senderWidget) return;
shun-iwasawa 8fb291
  PreferencesItemId id = m_controlIdMap.value(senderWidget);
Jeremy Bullock 3bb5ef
shun-iwasawa 8fb291
  if (m_preEditedFuncMap.contains(id)) (this->*m_preEditedFuncMap[id])();
Jeremy Bullock 3bb5ef
shun-iwasawa 8fb291
  // do not save to file while dragging
shun-iwasawa 8fb291
  m_pref->setValue(id, QColor(color.r, color.g, color.b, color.m), !isDragging);
turtletooth 04d8fd
shun-iwasawa 8fb291
  // very dirty implementation but I want to avoid calling invalidateIcons
shun-iwasawa 8fb291
  // while dragging transparency colors sliders..!
shun-iwasawa 8fb291
  if (id == transpCheckInkOnWhite || id == transpCheckInkOnBlack ||
shun-iwasawa 8fb291
      id == transpCheckPaint)
shun-iwasawa 8fb291
    return;
shun_iwasawa 4635d8
shun-iwasawa 8fb291
  if (m_onEditedFuncMap.contains(id)) (this->*m_onEditedFuncMap[id])();
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
OpenPopupCommandHandler<preferencespopup> openPreferencesPopup(MI_Preferences);</preferencespopup>