Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "toonz/preferences.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// TnzLib includes
Toshihiro Shimizu 890ddd
#include "toonz/tscenehandle.h"
Toshihiro Shimizu 890ddd
#include "toonz/toonzscene.h"
Toshihiro Shimizu 890ddd
#include "toonz/toonzfolders.h"
Toshihiro Shimizu 890ddd
#include "toonz/tcamera.h"
Toshihiro Shimizu 890ddd
#include "toonz/txshleveltypes.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// TnzBase includes
Toshihiro Shimizu 890ddd
#include "tenv.h"
Toshihiro Shimizu 890ddd
#include "tunit.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// TnzCore includes
Toshihiro Shimizu 890ddd
#include "tsystem.h"
Toshihiro Shimizu 890ddd
#include "tconvert.h"
Toshihiro Shimizu 890ddd
#include "tundo.h"
Toshihiro Shimizu 890ddd
#include "tbigmemorymanager.h"
Toshihiro Shimizu 890ddd
#include "tfilepath.h"
shun-iwasawa 93fdd4
#include "timage_io.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// Qt includes
Toshihiro Shimizu 890ddd
#include <qsettings></qsettings>
Toshihiro Shimizu 890ddd
#include <qstringlist></qstringlist>
shun_iwasawa 4635d8
#include <qaction></qaction>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// boost includes
Toshihiro Shimizu 890ddd
#include <boost bind.hpp=""></boost>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//**********************************************************************************
Toshihiro Shimizu 890ddd
//    Local namespace  stuff
Toshihiro Shimizu 890ddd
//**********************************************************************************
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
namespace {
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef Preferences::LevelFormat LevelFormat;
Toshihiro Shimizu 890ddd
typedef std::vector<levelformat> LevelFormatVector;</levelformat>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
const char *s_bool[2] = {"0", "1"};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
const char *s_show0ThickLines = "show0ThickLines",
Shinya Kitaoka 120a6e
           *s_regionAntialias = "regionAntialias",
Shinya Kitaoka 120a6e
           *s_levelFormats    = "levelFormats";
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
const char *s_name = "name", *s_regexp = "regexp", *s_priority = "priority";
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
const char *s_dpiPolicy = "dpiPolicy", *s_dpi = "dpi",
Shinya Kitaoka 120a6e
           *s_subsampling = "subsampling", *s_antialias = "antialias",
Shinya Kitaoka 120a6e
           *s_premultiply = "premultiply", *s_whiteTransp = "whiteTransp";
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=================================================================
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
inline void getValue(const QSettings &s, const QString &key, bool &ret) {
Shinya Kitaoka 120a6e
  QString val;
Shinya Kitaoka 120a6e
  val                = s.value(key).toString();
Shinya Kitaoka 120a6e
  if (val != "") ret = (val.toInt() != 0);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
inline void getValue(const QSettings &s, const QString &key, int &ret) {
Shinya Kitaoka 120a6e
  QString val;
Shinya Kitaoka 120a6e
  val                = s.value(key).toString();
Shinya Kitaoka 120a6e
  if (val != "") ret = val.toInt();
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
inline void getValue(const QSettings &s, const QString &key, double &ret) {
Shinya Kitaoka 120a6e
  QString val;
Shinya Kitaoka 120a6e
  val                = s.value(key).toString();
Shinya Kitaoka 120a6e
  if (val != "") ret = val.toDouble();
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
inline void getValue(const QSettings &s, QString key, TPixel32 &ret) {
Shinya Kitaoka 120a6e
  QString val;
Shinya Kitaoka 120a6e
  val                  = s.value(QString(key).append("_R")).toString();
Shinya Kitaoka 120a6e
  if (val != "") ret.r = val.toInt();
Shinya Kitaoka 120a6e
  val                  = s.value(QString(key).append("_G")).toString();
Shinya Kitaoka 120a6e
  if (val != "") ret.g = val.toInt();
Shinya Kitaoka 120a6e
  val                  = s.value(QString(key).append("_B")).toString();
Shinya Kitaoka 120a6e
  if (val != "") ret.b = val.toInt();
Shinya Kitaoka 120a6e
  val                  = s.value(QString(key).append("_M")).toString();
Shinya Kitaoka 120a6e
  if (val != "") ret.m = val.toInt();
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
inline bool formatLess(const Preferences::LevelFormat &a,
Shinya Kitaoka 120a6e
                       const Preferences::LevelFormat &b) {
Shinya Kitaoka 120a6e
  return (
Shinya Kitaoka 120a6e
      a.m_priority > b.m_priority  // Observe '>' used here - we want inverse
Shinya Kitaoka 120a6e
      || (!(b.m_priority >
Shinya Kitaoka 120a6e
            a.m_priority)  // sorting on priority, higher priorities come first
Shinya Kitaoka 120a6e
          && a.m_name < b.m_name));
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=================================================================
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void getDefaultLevelFormats(LevelFormatVector &lfv) {
Jeremy Bullock 3101a8
  lfv.resize(3);
Shinya Kitaoka 120a6e
  {
Shinya Kitaoka 120a6e
    LevelFormat &lf = lfv[0];
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
    lf.m_name       = Preferences::tr("Retas Level Format");
Shinya Kitaoka 120a6e
    lf.m_pathFormat = QRegExp(".+[0-9]{4,4}\\.tga", Qt::CaseInsensitive);
Shinya Kitaoka 120a6e
    lf.m_options.m_whiteTransp = true;
Shinya Kitaoka 120a6e
    lf.m_options.m_antialias   = 70;
shun_iwasawa 0becbe
shun_iwasawa 0becbe
    // for all PSD files, set the premultiply options to layers
shun_iwasawa 0becbe
    lfv[1].m_name                  = Preferences::tr("Adobe Photoshop");
shun_iwasawa 0becbe
    lfv[1].m_pathFormat            = QRegExp("..*\\.psd", Qt::CaseInsensitive);
shun_iwasawa 0becbe
    lfv[1].m_options.m_premultiply = true;
Jeremy Bullock 3101a8
Jeremy Bullock 3101a8
    // for all PNG files, set premultiply by default
Jeremy Bullock 15fcba
    lfv[2].m_name                  = Preferences::tr("PNG");
Jeremy Bullock 15fcba
    lfv[2].m_pathFormat            = QRegExp("..*\\.png", Qt::CaseInsensitive);
Jeremy Bullock 3101a8
    lfv[2].m_options.m_premultiply = true;
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=================================================================
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void setValue(QSettings &settings, const LevelOptions &lo) {
Shinya Kitaoka 120a6e
  settings.setValue(s_dpiPolicy, int(lo.m_dpiPolicy));
Shinya Kitaoka 120a6e
  settings.setValue(s_dpi, lo.m_dpi);
Shinya Kitaoka 120a6e
  settings.setValue(s_subsampling, lo.m_subsampling);
Shinya Kitaoka 120a6e
  settings.setValue(s_antialias, lo.m_antialias);
Shinya Kitaoka 120a6e
  settings.setValue(s_premultiply, int(lo.m_premultiply));
Shinya Kitaoka 120a6e
  settings.setValue(s_whiteTransp, int(lo.m_whiteTransp));
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void getValue(const QSettings &settings, LevelOptions &lo) {
Shinya Kitaoka 120a6e
  int dpiPolicy    = settings.value(s_dpiPolicy, int(lo.m_dpiPolicy)).toInt();
Shinya Kitaoka 120a6e
  lo.m_dpiPolicy   = LevelOptions::DpiPolicy(dpiPolicy);
Shinya Kitaoka 120a6e
  lo.m_dpi         = settings.value(s_dpi, lo.m_dpi).toDouble();
Shinya Kitaoka 120a6e
  lo.m_subsampling = settings.value(s_subsampling, lo.m_subsampling).toInt();
Shinya Kitaoka 120a6e
  lo.m_antialias   = settings.value(s_antialias, lo.m_antialias).toInt();
Shinya Kitaoka 120a6e
  lo.m_premultiply =
Shinya Kitaoka 120a6e
      (settings.value(s_premultiply, lo.m_premultiply).toInt() != 0);
Shinya Kitaoka 120a6e
  lo.m_whiteTransp =
Shinya Kitaoka 120a6e
      (settings.value(s_whiteTransp, lo.m_whiteTransp).toInt() != 0);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void setValue(QSettings &settings, const LevelFormat &lf) {
Shinya Kitaoka 120a6e
  settings.setValue(s_name, lf.m_name);
Shinya Kitaoka 120a6e
  settings.setValue(s_regexp, lf.m_pathFormat.pattern());
Shinya Kitaoka 120a6e
  settings.setValue(s_priority, lf.m_priority);
Shinya Kitaoka 120a6e
  setValue(settings, lf.m_options);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void getValue(const QSettings &settings, LevelFormat &lf) {
Shinya Kitaoka 120a6e
  lf.m_name = settings.value(s_name, lf.m_name).toString();
Shinya Kitaoka 120a6e
  lf.m_pathFormat =
Shinya Kitaoka 120a6e
      QRegExp(settings.value(s_regexp, lf.m_pathFormat).toString(),
Shinya Kitaoka 120a6e
              Qt::CaseInsensitive);
Shinya Kitaoka 120a6e
  lf.m_priority = settings.value(s_priority, lf.m_priority).toInt();
Shinya Kitaoka 120a6e
  getValue(settings, lf.m_options);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void setValue(QSettings &settings, const LevelFormatVector &lfv) {
Shinya Kitaoka 120a6e
  int lf, lfCount = int(lfv.size());
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  settings.remove(s_levelFormats);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  settings.beginWriteArray(s_levelFormats, lfCount);
Shinya Kitaoka 120a6e
  {
Shinya Kitaoka 120a6e
    for (lf = 0; lf != lfCount; ++lf) {
Shinya Kitaoka 120a6e
      settings.setArrayIndex(lf);
Shinya Kitaoka 120a6e
      setValue(settings, lfv[lf]);
Shinya Kitaoka 120a6e
    }
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
  settings.endArray();
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void getValue(QSettings &settings,
Shinya Kitaoka 120a6e
              LevelFormatVector &lfv)  // Why does QSettings' interface require
Shinya Kitaoka 120a6e
{  // non-const access on reading arrays/groups?
Shinya Kitaoka 120a6e
  if (!settings.childGroups().contains(s_levelFormats))
Shinya Kitaoka 120a6e
    return;  // Default is no level formats - use builtins
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  int lfCount = settings.beginReadArray(s_levelFormats);  // lfCount could be 0
Shinya Kitaoka 120a6e
  lfv.resize(lfCount);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  for (int lf = 0; lf != lfCount; ++lf) {
Shinya Kitaoka 120a6e
    settings.setArrayIndex(lf);
Shinya Kitaoka 120a6e
    getValue(settings, lfv[lf]);
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
  settings.endArray();
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
}  // namespace
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//**********************************************************************************
Toshihiro Shimizu 890ddd
//    Preferences::LevelFormat  implementation
Toshihiro Shimizu 890ddd
//**********************************************************************************
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
bool Preferences::LevelFormat::matches(const TFilePath &fp) const {
Shinya Kitaoka 120a6e
  return m_pathFormat.exactMatch(fp.getQString());
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//**********************************************************************************
Toshihiro Shimizu 890ddd
//    Preferences  implementation
Toshihiro Shimizu 890ddd
//**********************************************************************************
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Preferences::Preferences()
Jeremy Bullock 2e52c6
    : m_pixelsOnly(false)
Jeremy Bullock 2e52c6
    , m_units("mm")
Shinya Kitaoka 120a6e
    , m_cameraUnits("inch")
Shinya Kitaoka 120a6e
    , m_currentRoomChoice("Default")
Shinya Kitaoka 120a6e
    , m_scanLevelType("tif")
Jeremy Bullock 807052
#ifdef _WIN32
Jeremy Bullock 807052
    , m_interfaceFont("Segoe UI")
artisteacher 9ce0c2
#elif defined Q_OS_MACOS
artisteacher 9ce0c2
    , m_interfaceFont("Helvetica Neue")
Jeremy Bullock 807052
#else
Jeremy Bullock 807052
    , m_interfaceFont("Helvetica")
Jeremy Bullock 807052
#endif
manongjohn b66bc4
    , m_interfaceFontStyle("Regular")
Jeremy Bullock 807052
    , m_interfaceFontWeight(0)
Shinya Kitaoka 120a6e
    , m_defLevelWidth(0.0)
Shinya Kitaoka 120a6e
    , m_defLevelHeight(0.0)
Shinya Kitaoka 120a6e
    , m_defLevelDpi(0.0)
turtletooth fef27f
    , m_iconSize(160, 90)
Shinya Kitaoka 120a6e
    , m_blankColor(TPixel32::White)
Shinya Kitaoka 120a6e
    , m_frontOnionColor(TPixel::Black)
Shinya Kitaoka 120a6e
    , m_backOnionColor(TPixel::Black)
Shinya Kitaoka 120a6e
    , m_transpCheckBg(TPixel::White)
Shinya Kitaoka 120a6e
    , m_transpCheckInk(TPixel::Black)
Shinya Kitaoka 120a6e
    , m_transpCheckPaint(TPixel(127, 127, 127))
Shinya Kitaoka 120a6e
    , m_autosavePeriod(15)
Shinya Kitaoka 120a6e
    , m_chunkSize(10)
Shinya Kitaoka 120a6e
    , m_rasterOptimizedMemory(0)
Shinya Kitaoka 120a6e
    , m_shrink(1)
Shinya Kitaoka 120a6e
    , m_step(1)
Shinya Kitaoka 120a6e
    , m_blanksCount(0)
Shinya Kitaoka 120a6e
    , m_keyframeType(3)
Shinya Kitaoka 120a6e
    , m_animationStep(1)
Shinya Kitaoka 120a6e
    , m_textureSize(0)
Shinya Kitaoka 120a6e
    , m_xsheetStep(10)
Shinya Kitaoka 120a6e
    , m_shmmax(-1)
Shinya Kitaoka 120a6e
    , m_shmseg(-1)
Shinya Kitaoka 120a6e
    , m_shmall(-1)
Shinya Kitaoka 120a6e
    , m_shmmni(-1)
Shinya Kitaoka 120a6e
    , m_onionPaperThickness(50)
shun-iwasawa 9031b4
    , m_currentLanguage("English")
Kite 799aa3
    , m_currentStyleSheet("Default")
Shinya Kitaoka 120a6e
    , m_undoMemorySize(100)
Shinya Kitaoka 120a6e
    , m_dragCellsBehaviour(0)
Shinya Kitaoka 120a6e
    , m_lineTestFpsCapture(25)
Shinya Kitaoka 120a6e
    , m_defLevelType(0)
Jeremy Bullock cd00fd
    , m_vectorSnappingTarget(SnapAll)
Shinya Kitaoka 120a6e
    , m_autocreationType(1)
Shinya Kitaoka 120a6e
    , m_autoExposeEnabled(true)
Shinya Kitaoka 120a6e
    , m_autoCreateEnabled(true)
Shinya Kitaoka 120a6e
    , m_subsceneFolderEnabled(true)
Shinya Kitaoka 120a6e
    , m_generatedMovieViewEnabled(true)
Shinya Kitaoka 120a6e
    , m_xsheetAutopanEnabled(true)
Shinya Kitaoka 120a6e
    , m_ignoreAlphaonColumn1Enabled(false)
Shinya Kitaoka 120a6e
    , m_rewindAfterPlaybackEnabled(true)
Shinya Kitaoka 120a6e
    , m_fitToFlipbookEnabled(false)
Shinya Kitaoka 120a6e
    , m_previewAlwaysOpenNewFlipEnabled(false)
Shinya Kitaoka 120a6e
    , m_autosaveEnabled(false)
Jeremy Bullock 33e7d1
    , m_autosaveSceneEnabled(true)
Jeremy Bullock 33e7d1
    , m_autosaveOtherFilesEnabled(true)
Jeremy Bullock bfe861
    , m_startupPopupEnabled(true)
Shinya Kitaoka 120a6e
    , m_defaultViewerEnabled(false)
Shinya Kitaoka 120a6e
    , m_saveUnpaintedInCleanup(true)
Shinya Kitaoka 120a6e
    , m_askForOverrideRender(true)
Shinya Kitaoka 120a6e
    , m_automaticSVNFolderRefreshEnabled(true)
Shinya Kitaoka 120a6e
    , m_SVNEnabled(false)
Shinya Kitaoka 120a6e
    , m_minimizeSaveboxAfterEditing(true)
manongjohn e1c928
    , m_backupEnabled(true)
Shinya Kitaoka 120a6e
    , m_sceneNumberingEnabled(false)
Shinya Kitaoka 120a6e
    , m_animationSheetEnabled(false)
Shinya Kitaoka 120a6e
    , m_inksOnly(false)
Shinya Kitaoka 120a6e
    , m_fillOnlySavebox(false)
Shinya Kitaoka 120a6e
    , m_show0ThickLines(true)
Shinya Kitaoka 120a6e
    , m_regionAntialias(false)
Jeremy Bullock 3f573c
    , m_keepFillOnVectorSimplify(true)
Jeremy Bullock 3f573c
    , m_useHigherDpiOnVectorSimplify(false)
Jeremy Bullock 3e69f9
    , m_downArrowInLevelStripCreatesNewFrame(false)
Shinya Kitaoka 120a6e
    , m_viewerBGColor(128, 128, 128, 255)
Shinya Kitaoka 120a6e
    , m_previewBGColor(64, 64, 64, 255)
Shinya Kitaoka 120a6e
    , m_chessboardColor1(180, 180, 180)
Shinya Kitaoka 120a6e
    , m_chessboardColor2(230, 230, 230)
Shinya Kitaoka 120a6e
    , m_showRasterImagesDarkenBlendedInViewer(false)
Shinya Kitaoka 120a6e
    , m_actualPixelViewOnSceneEditingMode(false)
Shinya Kitaoka 120a6e
    , m_viewerZoomCenter(0)
Shinya Kitaoka 120a6e
    , m_initialLoadTlvCachingBehavior(0)
Shinya Kitaoka 120a6e
    , m_removeSceneNumberFromLoadedLevelName(false)
Shinya Kitaoka 120a6e
    , m_replaceAfterSaveLevelAs(true)
Shinya Kitaoka 120a6e
    , m_showFrameNumberWithLetters(false)
Shinya Kitaoka 120a6e
    , m_levelNameOnEachMarker(false)
Shinya Kitaoka 120a6e
    , m_columnIconLoadingPolicy((int)LoadAtOnce)
Shinya Kitaoka 120a6e
    , m_moveCurrentFrameByClickCellArea(true)
Shinya Kitaoka 120a6e
    , m_onionSkinEnabled(true)
Jeremy Bullock 17d8f9
    , m_onionSkinDuringPlayback(false)
Jeremy Bullock 3a06bd
    , m_dropdownShortcutsCycleOptions(false)
Shinya Kitaoka 120a6e
    , m_multiLayerStylePickerEnabled(false)
turtletooth 04d8fd
    , m_showKeyframesOnXsheetCellArea(true)
Jeremy Bullock e59b1f
    , m_projectRoot(0x08)
Jeremy Bullock e59b1f
    , m_customProjectRoot("")
shun-iwasawa 27b0cf
    , m_precompute(true)
Jeremy Bullock 3bb5ef
    , m_fastRenderPath("desktop")
Jeremy Bullock 2b8dd0
    , m_ffmpegTimeout(60)
shun_iwasawa 53bef6
    , m_shortcutPreset("defopentoonz")
shun_iwasawa 3639da
    , m_useNumpadForSwitchingStyles(true)
Jeremy Bullock 44af2c
    , m_newLevelSizeToCameraSizeEnabled(false)
Jeremy Bullock 15fcba
    , m_showXSheetToolbar(false)
Jeremy Bullock 4386c6
    , m_syncLevelRenumberWithXsheet(false)
Jeremy Bullock 15fcba
    , m_expandFunctionHeader(false)
shun_iwasawa 0cae24
    , m_showColumnNumbers(false)
shun_iwasawa 0cae24
    , m_useArrowKeyToShiftCellSelection(false)
shun-iwasawa 57bc09
    , m_inputCellsWithoutDoubleClickingEnabled(false)
Jeremy Bullock b53dba
    , m_importPolicy(0)
Jeremy Bullock 1e17ed
    , m_guidedDrawingType(0)
Jeremy Bullock 1e17ed
    , m_animatedGuidedDrawing(false)
Jeremy Bullock 8c5007
    , m_ignoreImageDpi(false)
shun-iwasawa d08c7c
    , m_watchFileSystem(true)
manongjohn 399e7d
    , m_shortcutCommandsWhileRenamingCellEnabled(false)
manongjohn 399e7d
    , m_xsheetLayoutPreference("Classic-revised")
manongjohn 1be264
    , m_loadedXsheetLayout("Classic-revised")
shun-iwasawa c85210
    , m_pathAliasPriority(ProjectFolderOnly)
Jeremy Bullock 4ce953
    , m_functionEditorToggle(ShowGraphEditorInPopup)
manongjohn 29ce0b
    , m_currentTimelineEnabled(true)
manongjohn 75da26
    , m_enableAutoStretch(true)
manongjohn 75da26
    , m_cursorBrushType("Small")
manongjohn 75da26
    , m_cursorBrushStyle("Default")
manongjohn a21b06
    , m_cursorOutlineEnabled(true)
manongjohn c5bc8d
    , m_currentColumnColor(TPixel::Black)
shun-iwasawa 1d5937
    , m_enableWinInk(false)
shun-iwasawa 93fdd4
    , m_useOnionColorsForShiftAndTraceGhosts(false)
manongjohn 177b7c
    , m_rasterBackgroundColor(TPixel::White)
manongjohn 177b7c
    , m_backupKeepCount(1) {
Shinya Kitaoka 120a6e
  TCamera camera;
Shinya Kitaoka 120a6e
  m_defLevelType   = PLI_XSHLEVEL;
Shinya Kitaoka 120a6e
  m_defLevelWidth  = camera.getSize().lx;
Shinya Kitaoka 120a6e
  m_defLevelHeight = camera.getSize().ly;
Shinya Kitaoka 120a6e
  m_defLevelDpi    = camera.getDpi().x;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  TFilePath layoutDir = ToonzFolder::getMyModuleDir();
shun-iwasawa 5e6203
  TFilePath prefPath  = layoutDir + TFilePath("preferences.ini");
shun-iwasawa 5e6203
manongjohn 399e7d
  bool existingUser = true;
manongjohn 399e7d
shun-iwasawa 5e6203
  // In case the personal settings is not exist (for new users)
shun-iwasawa 5e6203
  if (!TFileStatus(prefPath).doesExist()) {
shun-iwasawa 5e6203
    TFilePath templatePath =
shun-iwasawa 5e6203
        ToonzFolder::getTemplateModuleDir() + TFilePath("preferences.ini");
shun-iwasawa 5e6203
    // If there is the template, copy it to the personal one
shun-iwasawa 5e6203
    if (TFileStatus(templatePath).doesExist())
shun-iwasawa 5e6203
      TSystem::copyFile(prefPath, templatePath);
manongjohn 399e7d
manongjohn 399e7d
    existingUser = false;
shun-iwasawa 5e6203
  }
shun_iwasawa a23dac
Shinya Kitaoka 120a6e
  m_settings.reset(new QSettings(
shun-iwasawa 5e6203
      QString::fromStdWString(prefPath.getWideString()), QSettings::IniFormat));
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  getValue(*m_settings, "autoExposeEnabled", m_autoExposeEnabled);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "autoCreateEnabled", m_autoCreateEnabled);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "subsceneFolderEnabled", m_subsceneFolderEnabled);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "generatedMovieViewEnabled",
Shinya Kitaoka 120a6e
           m_generatedMovieViewEnabled);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "xsheetAutopanEnabled", m_xsheetAutopanEnabled);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "ignoreAlphaonColumn1Enabled",
Shinya Kitaoka 120a6e
           m_ignoreAlphaonColumn1Enabled);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "rewindAfterPlayback", m_rewindAfterPlaybackEnabled);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "previewAlwaysOpenNewFlip",
Shinya Kitaoka 120a6e
           m_previewAlwaysOpenNewFlipEnabled);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "fitToFlipbook", m_fitToFlipbookEnabled);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "automaticSVNFolderRefreshEnabled",
Shinya Kitaoka 120a6e
           m_automaticSVNFolderRefreshEnabled);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "SVNEnabled", m_SVNEnabled);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "minimizeSaveboxAfterEditing",
Shinya Kitaoka 120a6e
           m_minimizeSaveboxAfterEditing);
manongjohn e1c928
  getValue(*m_settings, "backupEnabled", m_backupEnabled);
manongjohn 177b7c
  getValue(*m_settings, "backupKeepCount", m_backupKeepCount);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "sceneNumberingEnabled", m_sceneNumberingEnabled);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "animationSheetEnabled", m_animationSheetEnabled);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "autosaveEnabled", m_autosaveEnabled);
Jeremy Bullock 33e7d1
  getValue(*m_settings, "autosaveSceneEnabled", m_autosaveSceneEnabled);
Jeremy Bullock 33e7d1
  getValue(*m_settings, "autosaveOtherFilesEnabled",
Jeremy Bullock 33e7d1
           m_autosaveOtherFilesEnabled);
Jeremy Bullock bfe861
  getValue(*m_settings, "startupPopupEnabled", m_startupPopupEnabled);
Jeremy Bullock 3a06bd
  getValue(*m_settings, "dropdownShortcutsCycleOptions",
Jeremy Bullock 3a06bd
           m_dropdownShortcutsCycleOptions);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "defaultViewerEnabled", m_defaultViewerEnabled);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "rasterOptimizedMemory", m_rasterOptimizedMemory);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "saveUnpaintedInCleanup", m_saveUnpaintedInCleanup);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "autosavePeriod", m_autosavePeriod);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "taskchunksize", m_chunkSize);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "xsheetStep", m_xsheetStep);
Jeremy Bullock cd00fd
  getValue(*m_settings, "vectorSnappingTarget", m_vectorSnappingTarget);
turtletooth 238254
  int r = 0, g = 255, b = 0;
Shinya Kitaoka 120a6e
  getValue(*m_settings, "frontOnionColor.r", r);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "frontOnionColor.g", g);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "frontOnionColor.b", b);
Shinya Kitaoka 120a6e
  m_frontOnionColor = TPixel32(r, g, b);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  getValue(*m_settings, "onionPaperThickness", m_onionPaperThickness);
Shinya Kitaoka 120a6e
turtletooth 238254
  r = 255, g = 0, b = 0;
Shinya Kitaoka 120a6e
  getValue(*m_settings, "backOnionColor.r", r);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "backOnionColor.g", g);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "backOnionColor.b", b);
Shinya Kitaoka 120a6e
  m_backOnionColor = TPixel32(r, g, b);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  r = m_transpCheckBg.r, g = m_transpCheckBg.g, b = m_transpCheckBg.b;
Shinya Kitaoka 120a6e
  getValue(*m_settings, "transpCheckInkOnBlack.r", r);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "transpCheckInkOnBlack.g", g);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "transpCheckInkOnBlack.b", b);
Shinya Kitaoka 120a6e
  m_transpCheckBg = TPixel32(r, g, b);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  r = m_transpCheckInk.r, g = m_transpCheckInk.g, b = m_transpCheckInk.b;
Shinya Kitaoka 120a6e
  getValue(*m_settings, "transpCheckInkOnWhite.r", r);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "transpCheckInkOnWhite.g", g);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "transpCheckInkOnWhite.b", b);
Shinya Kitaoka 120a6e
  m_transpCheckInk = TPixel32(r, g, b);
Shinya Kitaoka 120a6e
  r = m_transpCheckPaint.r, g = m_transpCheckPaint.g, b = m_transpCheckPaint.b;
Shinya Kitaoka 120a6e
  getValue(*m_settings, "transpCheckPaint.r", r);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "transpCheckPaint.g", g);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "transpCheckPaint.b", b);
Shinya Kitaoka 120a6e
  m_transpCheckPaint = TPixel32(r, g, b);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  getValue(*m_settings, "onionInksOnly", m_inksOnly);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "iconSizeX", m_iconSize.lx);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "iconSizeY", m_iconSize.ly);
Shinya Kitaoka 120a6e
  getValue(*m_settings, s_show0ThickLines, m_show0ThickLines);
Shinya Kitaoka 120a6e
  getValue(*m_settings, s_regionAntialias, m_regionAntialias);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "viewShrink", m_shrink);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "viewStep", m_step);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "blanksCount", m_blanksCount);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "askForOverrideRender", m_askForOverrideRender);
Shinya Kitaoka 120a6e
  r = 255, g = 255, b = 255;
Shinya Kitaoka 120a6e
  getValue(*m_settings, "blankColor.r", r);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "blankColor.g", g);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "blankColor.b", b);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "undoMemorySize", m_undoMemorySize);
Shinya Kitaoka 120a6e
  setUndoMemorySize(m_undoMemorySize);
Shinya Kitaoka 120a6e
  m_blankColor = TPixel32(r, g, b);
Shinya Kitaoka 120a6e
Jeremy Bullock 59dbbf
  // for Pixels only
Jeremy Bullock 59dbbf
Jeremy Bullock 59dbbf
  getValue(*m_settings, "pixelsOnly",
Jeremy Bullock 59dbbf
           m_pixelsOnly);  // doesn't work for some reason.
Jeremy Bullock 59dbbf
  QString pos                     = m_settings->value("pixelsOnly").toString();
Jeremy Bullock 20a966
  if (pos == "true") m_pixelsOnly = true;
Jeremy Bullock 59dbbf
Shinya Kitaoka 120a6e
  QString units;
Jeremy Bullock 59dbbf
  units      = m_settings->value("oldUnits", m_units).toString();
Jeremy Bullock 7c096e
  m_oldUnits = units;
Jeremy Bullock 7c096e
Jeremy Bullock 59dbbf
  units = m_settings->value("oldCameraUnits", m_cameraUnits).toString();
Jeremy Bullock 7c096e
  m_oldCameraUnits = units;
Jeremy Bullock 59dbbf
  // end for pixels only
Jeremy Bullock 7c096e
Jeremy Bullock e59b1f
  getValue(*m_settings, "projectRoot", m_projectRoot);
Jeremy Bullock e59b1f
  m_customProjectRoot = m_settings->value("customProjectRoot").toString();
Jeremy Bullock e59b1f
Shinya Kitaoka 120a6e
  units                    = m_settings->value("linearUnits").toString();
Shinya Kitaoka 120a6e
  if (units != "") m_units = units;
Shinya Kitaoka 120a6e
  setUnits(m_units.toStdString());
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  units                          = m_settings->value("cameraUnits").toString();
Shinya Kitaoka 120a6e
  if (units != "") m_cameraUnits = units;
Shinya Kitaoka 120a6e
  setCameraUnits(m_cameraUnits.toStdString());
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  getValue(*m_settings, "keyframeType", m_keyframeType);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  getValue(*m_settings, "animationStep", m_animationStep);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  getValue(*m_settings, "textureSize", m_textureSize);
Shinya Kitaoka 120a6e
  QString scanLevelType;
Shinya Kitaoka 120a6e
  scanLevelType = m_settings->value("scanLevelType").toString();
Shinya Kitaoka 120a6e
  if (scanLevelType != "") m_scanLevelType = scanLevelType;
Shinya Kitaoka 120a6e
  setScanLevelType(m_scanLevelType.toStdString());
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  getValue(*m_settings, "shmmax", m_shmmax);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "shmseg", m_shmseg);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "shmall", m_shmall);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "shmmni", m_shmmni);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  // Load level formats
Shinya Kitaoka 120a6e
  getDefaultLevelFormats(m_levelFormats);
Shinya Kitaoka 120a6e
  getValue(*m_settings, m_levelFormats);
Shinya Kitaoka 120a6e
  std::sort(m_levelFormats.begin(),
Shinya Kitaoka 120a6e
            m_levelFormats.end(),  // Format sorting must be
Shinya Kitaoka 120a6e
            formatLess);           // enforced
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  // load languages
Shinya Kitaoka 120a6e
  TFilePath lang_path = TEnv::getConfigDir() + "loc";
Shinya Kitaoka 120a6e
  TFilePathSet lang_fpset;
shun-iwasawa 9031b4
  m_languageList.append("English");
Shinya Kitaoka 120a6e
  // m_currentLanguage=0;
Shinya Kitaoka 120a6e
  try {
Shinya Kitaoka 120a6e
    TFileStatus langPathFs(lang_path);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
    if (langPathFs.doesExist() && langPathFs.isDirectory()) {
Shinya Kitaoka 120a6e
      TSystem::readDirectory(lang_fpset, lang_path, true, false);
Shinya Kitaoka 120a6e
    }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
    int i = 0;
Shinya Kitaoka 120a6e
    for (auto const &newPath : lang_fpset) {
Shinya Kitaoka 120a6e
      ++i;
Shinya Kitaoka 120a6e
      if (newPath == lang_path) continue;
Shinya Kitaoka 120a6e
      if (TFileStatus(newPath).isDirectory()) {
shun-iwasawa 9031b4
        QString string = QString::fromStdWString(newPath.getWideName());
shun-iwasawa 9031b4
        m_languageList.append(string);
Shinya Kitaoka 120a6e
      }
Shinya Kitaoka 120a6e
    }
Shinya Kitaoka 120a6e
  } catch (...) {
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  // load styles
Shinya Kitaoka 120a6e
  TFilePath path(TEnv::getConfigDir() + "qss");
Shinya Kitaoka 120a6e
  TFilePathSet fpset;
Shinya Kitaoka 120a6e
  try {
Shinya Kitaoka 120a6e
    TSystem::readDirectory(fpset, path, true, false);
Shinya Kitaoka 120a6e
    int i = -1;
Shinya Kitaoka 120a6e
    for (auto const &newPath : fpset) {
Shinya Kitaoka 120a6e
      ++i;
Shinya Kitaoka 120a6e
      if (newPath == path) continue;
Shinya Kitaoka 120a6e
      QString fpName = QString::fromStdWString(newPath.getWideName());
shun-iwasawa 9031b4
      m_styleSheetList.append(fpName);
Shinya Kitaoka 120a6e
    }
Shinya Kitaoka 120a6e
  } catch (...) {
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  // load rooms or layouts
Shinya Kitaoka 120a6e
  QString rooms;
Shinya Kitaoka 120a6e
  bool roomsExist = false;
Shinya Kitaoka 120a6e
  rooms           = m_settings->value("CurrentRoomChoice").toString();
Shinya Kitaoka 120a6e
shun-iwasawa 7af4c5
  TFilePath room_path(ToonzFolder::getRoomsDir());
Shinya Kitaoka 120a6e
  TFilePathSet room_fpset;
Shinya Kitaoka 120a6e
  try {
Shinya Kitaoka 120a6e
    TSystem::readDirectory(room_fpset, room_path, true, false);
Shinya Kitaoka 120a6e
    TFilePathSet::iterator it = room_fpset.begin();
Shinya Kitaoka 120a6e
    int i                     = 0;
Shinya Kitaoka 120a6e
    for (it; it != room_fpset.end(); it++) {
Shinya Kitaoka 120a6e
      TFilePath newPath = *it;
Shinya Kitaoka 120a6e
      if (newPath == room_path) continue;
Shinya Kitaoka 120a6e
      if (TFileStatus(newPath).isDirectory()) {
Shinya Kitaoka 120a6e
        QString string = QString::fromStdWString(newPath.getWideName());
Shinya Kitaoka 120a6e
        if (string == rooms) roomsExist = true;
Shinya Kitaoka 120a6e
        m_roomMaps[i]                   = string;
Shinya Kitaoka 120a6e
        i++;
Shinya Kitaoka 120a6e
      }
Shinya Kitaoka 120a6e
    }
Shinya Kitaoka 120a6e
  } catch (...) {
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
  // make sure the selected rooms exists
Shinya Kitaoka 120a6e
  if (rooms != "" && roomsExist) {
Shinya Kitaoka 120a6e
    m_currentRoomChoice = rooms;
Shinya Kitaoka 120a6e
    setCurrentRoomChoice(rooms);
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
  // or set the selected rooms to the first ones in the folder
Shinya Kitaoka 120a6e
  else {
Shinya Kitaoka 120a6e
    m_currentRoomChoice = m_roomMaps[0];
Shinya Kitaoka 120a6e
    setCurrentRoomChoice(0);
Shinya Kitaoka 120a6e
  }
turtletooth 8d9ba3
shun-iwasawa 9031b4
  QString currentLanguage;
shun-iwasawa 9031b4
  currentLanguage = m_settings->value("CurrentLanguageName").toString();
shun-iwasawa 9031b4
  if (!currentLanguage.isEmpty() && m_languageList.contains(currentLanguage))
shun-iwasawa 9031b4
    m_currentLanguage = currentLanguage;
shun-iwasawa 9031b4
  QString currentStyleSheet;
shun-iwasawa 9031b4
  currentStyleSheet = m_settings->value("CurrentStyleSheetName").toString();
shun-iwasawa 9031b4
  if (!currentStyleSheet.isEmpty() &&
shun-iwasawa 9031b4
      m_styleSheetList.contains(currentStyleSheet))
shun-iwasawa 9031b4
    m_currentStyleSheet = currentStyleSheet;
Jeremy Bullock 3f573c
  getValue(*m_settings, "useHigherDpiOnVectorSimplify",
Jeremy Bullock 3f573c
           m_useHigherDpiOnVectorSimplify);
Jeremy Bullock 3f573c
  getValue(*m_settings, "keepFillOnVectorSimplify", m_keepFillOnVectorSimplify);
Jeremy Bullock 3e69f9
  getValue(*m_settings, "downArrowInLevelStripCreatesNewFrame",
Jeremy Bullock 3e69f9
           m_downArrowInLevelStripCreatesNewFrame);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "DragCellsBehaviour", m_dragCellsBehaviour);
turtletooth 8d9ba3
Shinya Kitaoka 120a6e
  getValue(*m_settings, "LineTestFpsCapture", m_lineTestFpsCapture);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "FillOnlysavebox", m_fillOnlySavebox);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "AutocreationType", m_autocreationType);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "DefLevelType", m_defLevelType);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "DefLevelWidth", m_defLevelWidth);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "DefLevelHeight", m_defLevelHeight);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "DefLevelDpi", m_defLevelDpi);
Jeremy Bullock 8c5007
  getValue(*m_settings, "IgnoreImageDpi", m_ignoreImageDpi);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "viewerBGColor", m_viewerBGColor);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "previewBGColor", m_previewBGColor);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "chessboardColor1", m_chessboardColor1);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "chessboardColor2", m_chessboardColor2);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "showRasterImagesDarkenBlendedInViewer",
Shinya Kitaoka 120a6e
           m_showRasterImagesDarkenBlendedInViewer);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "actualPixelViewOnSceneEditingMode",
Shinya Kitaoka 120a6e
           m_actualPixelViewOnSceneEditingMode);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "viewerZoomCenter", m_viewerZoomCenter);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "initialLoadTlvCachingBehavior",
Shinya Kitaoka 120a6e
           m_initialLoadTlvCachingBehavior);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "removeSceneNumberFromLoadedLevelName",
Shinya Kitaoka 120a6e
           m_removeSceneNumberFromLoadedLevelName);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "replaceAfterSaveLevelAs", m_replaceAfterSaveLevelAs);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "showFrameNumberWithLetters",
Shinya Kitaoka 120a6e
           m_showFrameNumberWithLetters);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "levelNameOnEachMarkerEnabled",
Shinya Kitaoka 120a6e
           m_levelNameOnEachMarker);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "columnIconLoadingPolicy", m_columnIconLoadingPolicy);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "moveCurrentFrameByClickCellArea",
Shinya Kitaoka 120a6e
           m_moveCurrentFrameByClickCellArea);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "onionSkinEnabled", m_onionSkinEnabled);
Jeremy Bullock 17d8f9
  getValue(*m_settings, "onionSkinDuringPlayback", m_onionSkinDuringPlayback);
shun-iwasawa 1d5937
  getValue(*m_settings, "useOnionColorsForShiftAndTraceGhosts",
shun-iwasawa 1d5937
           m_useOnionColorsForShiftAndTraceGhosts);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "multiLayerStylePickerEnabled",
Shinya Kitaoka 120a6e
           m_multiLayerStylePickerEnabled);
Shinya Kitaoka 120a6e
  getValue(*m_settings, "showKeyframesOnXsheetCellArea",
Shinya Kitaoka 120a6e
           m_showKeyframesOnXsheetCellArea);
turtletooth 04d8fd
  QString ffmpegPath = m_settings->value("ffmpegPath").toString();
turtletooth 04d8fd
  if (ffmpegPath != "") m_ffmpegPath = ffmpegPath;
turtletooth 04d8fd
  setFfmpegPath(m_ffmpegPath.toStdString());
Jeremy Bullock 3bb5ef
  QString fastRenderPath = m_settings->value("fastRenderPath").toString();
Jeremy Bullock 3bb5ef
  if (fastRenderPath != "") m_fastRenderPath = fastRenderPath;
Jeremy Bullock 3bb5ef
  setFastRenderPath(m_fastRenderPath.toStdString());
shun-iwasawa 27b0cf
  getValue(*m_settings, "ffmpegTimeout", m_ffmpegTimeout);
Jeremy Bullock e8903b
  QString shortcutPreset = m_settings->value("shortcutPreset").toString();
Jeremy Bullock e8903b
  if (shortcutPreset != "") m_shortcutPreset = shortcutPreset;
Jeremy Bullock e8903b
  setShortcutPreset(m_shortcutPreset.toStdString());
Jeremy Bullock 807052
  QString interfaceFont = m_settings->value("interfaceFont").toString();
Jeremy Bullock 807052
  if (interfaceFont != "") m_interfaceFont = interfaceFont;
Jeremy Bullock 807052
  setInterfaceFont(m_interfaceFont.toStdString());
manongjohn b66bc4
  QString interfaceFontStyle =
manongjohn b66bc4
      m_settings->value("interfaceFontStyle").toString();
manongjohn b66bc4
  if (interfaceFontStyle != "") m_interfaceFontStyle = interfaceFontStyle;
manongjohn b66bc4
  setInterfaceFontStyle(m_interfaceFontStyle.toStdString());
Jeremy Bullock 807052
  getValue(*m_settings, "interfaceFontWeight", m_interfaceFontWeight);
shun_iwasawa 4635d8
  getValue(*m_settings, "useNumpadForSwitchingStyles",
shun_iwasawa 4635d8
           m_useNumpadForSwitchingStyles);
Jeremy Bullock 1e17ed
  getValue(*m_settings, "guidedDrawingType", m_guidedDrawingType);
Jeremy Bullock 1e17ed
  getValue(*m_settings, "animatedGuidedDrawing", m_animatedGuidedDrawing);
Jeremy Bullock 44af2c
  getValue(*m_settings, "newLevelSizeToCameraSizeEnabled",
Jeremy Bullock 44af2c
           m_newLevelSizeToCameraSizeEnabled);
Jeremy Bullock 15fcba
  getValue(*m_settings, "showXSheetToolbar", m_showXSheetToolbar);
Jeremy Bullock 4386c6
  getValue(*m_settings, "syncLevelRenumberWithXsheet",
Jeremy Bullock 4386c6
           m_syncLevelRenumberWithXsheet);
Jeremy Bullock 15fcba
  getValue(*m_settings, "expandFunctionHeader", m_expandFunctionHeader);
Jaroslav 203cc8
  getValue(*m_settings, "showColumnNumbers", m_showColumnNumbers);
shun_iwasawa 3639da
  getValue(*m_settings, "useArrowKeyToShiftCellSelection",
shun_iwasawa 3639da
           m_useArrowKeyToShiftCellSelection);
shun_iwasawa 3639da
  getValue(*m_settings, "inputCellsWithoutDoubleClickingEnabled",
shun_iwasawa 3639da
           m_inputCellsWithoutDoubleClickingEnabled);
Jeremy Bullock b53dba
  getValue(*m_settings, "importPolicy", m_importPolicy);
shun-iwasawa 57bc09
  getValue(*m_settings, "watchFileSystemEnabled", m_watchFileSystem);
shun-iwasawa d08c7c
  getValue(*m_settings, "shortcutCommandsWhileRenamingCellEnabled",
shun-iwasawa d08c7c
           m_shortcutCommandsWhileRenamingCellEnabled);
shun-iwasawa c85210
  int pathAliasPriority = static_cast<int>(m_pathAliasPriority);</int>
shun-iwasawa c85210
  getValue(*m_settings, "pathAliasPriority", pathAliasPriority);
shun-iwasawa c85210
  m_pathAliasPriority = static_cast<pathaliaspriority>(pathAliasPriority);</pathaliaspriority>
manongjohn 399e7d
Jeremy Bullock 4ce953
  int functionEditorToggle = static_cast<int>(m_functionEditorToggle);</int>
Jeremy Bullock 4ce953
  getValue(*m_settings, "functionEditorToggle", functionEditorToggle);
Jeremy Bullock 4ce953
  m_functionEditorToggle =
Jeremy Bullock 4ce953
      static_cast<functioneditortoggle>(functionEditorToggle);</functioneditortoggle>
Jeremy Bullock 4ce953
manongjohn 399e7d
  QString xsheetLayoutPreference;
manongjohn 399e7d
  xsheetLayoutPreference =
manongjohn 399e7d
      m_settings->value("xsheetLayoutPreference").toString();
manongjohn 399e7d
  if (xsheetLayoutPreference != "")
manongjohn 399e7d
    m_xsheetLayoutPreference = xsheetLayoutPreference;
manongjohn 399e7d
  else if (existingUser)  // Existing users with missing preference defaults to
manongjohn 399e7d
                          // Classic. New users will be Classic-revised
manongjohn 399e7d
    m_xsheetLayoutPreference = QString("Classic");
manongjohn 399e7d
  setXsheetLayoutPreference(m_xsheetLayoutPreference.toStdString());
manongjohn 399e7d
  m_loadedXsheetLayout = m_xsheetLayoutPreference;
manongjohn 1be264
manongjohn 1be264
  getValue(*m_settings, "currentTimelineEnabled", m_currentTimelineEnabled);
shun-iwasawa ad7711
shun-iwasawa ad7711
  getValue(*m_settings, "colorCalibrationEnabled", m_colorCalibrationEnabled);
shun-iwasawa ad7711
  QVariant val = m_settings->value("colorCalibrationLutPaths");
shun-iwasawa ad7711
  if (val.canConvert<qvariantmap>()) {</qvariantmap>
shun-iwasawa ad7711
    QAssociativeIterable iterable           = val.value<qassociativeiterable>();</qassociativeiterable>
shun-iwasawa ad7711
    QAssociativeIterable::const_iterator it = iterable.begin();
shun-iwasawa ad7711
    const QAssociativeIterable::const_iterator end = iterable.end();
shun-iwasawa ad7711
    for (; it != end; ++it) {
shun-iwasawa ad7711
      m_colorCalibrationLutPaths.insert(it.key().toString(),
shun-iwasawa ad7711
                                        it.value().toString());
shun-iwasawa ad7711
    }
shun-iwasawa ad7711
  }
shun-iwasawa 133733
  getValue(*m_settings, "latestVersionCheckEnabled",
shun-iwasawa 133733
           m_latestVersionCheckEnabled);
manongjohn 29ce0b
manongjohn 29ce0b
  getValue(*m_settings, "EnableAutoStretch", m_enableAutoStretch);
manongjohn 75da26
manongjohn 75da26
  QString brushType;
manongjohn 75da26
  brushType = m_settings->value("cursorBrushType").toString();
manongjohn 75da26
  if (brushType != "") m_cursorBrushType = brushType;
manongjohn 75da26
  setCursorBrushType(m_cursorBrushType.toStdString());
manongjohn 75da26
manongjohn 75da26
  QString brushStyle;
manongjohn 75da26
  brushStyle = m_settings->value("cursorBrushStyle").toString();
manongjohn 75da26
  if (brushStyle != "") m_cursorBrushStyle = brushStyle;
manongjohn 75da26
  setCursorBrushStyle(m_cursorBrushStyle.toStdString());
manongjohn 75da26
manongjohn 75da26
  getValue(*m_settings, "cursorOutlineEnabled", m_cursorOutlineEnabled);
manongjohn a21b06
shun-iwasawa 045b61
  r = 255, g = 255, b = 0;
manongjohn a21b06
  getValue(*m_settings, "currentColumnColor.r", r);
manongjohn a21b06
  getValue(*m_settings, "currentColumnColor.g", g);
manongjohn a21b06
  getValue(*m_settings, "currentColumnColor.b", b);
manongjohn a21b06
  m_currentColumnColor = TPixel32(r, g, b);
manongjohn c5bc8d
manongjohn c5bc8d
  getValue(*m_settings, "winInkEnabled", m_enableWinInk);
shun-iwasawa 93fdd4
shun-iwasawa 93fdd4
  getValue(*m_settings, "rasterBackgroundColor", m_rasterBackgroundColor);
shun-iwasawa 93fdd4
  TImageWriter::setBackgroundColor(m_rasterBackgroundColor);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
Preferences::~Preferences() {
Shinya Kitaoka 120a6e
  // DO NOT REMOVE
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
Preferences *Preferences::instance() {
Shinya Kitaoka 120a6e
  static Preferences _instance;
Shinya Kitaoka 120a6e
  return &_instance;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableAutoExpose(bool on) {
Shinya Kitaoka 120a6e
  m_autoExposeEnabled = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("autoExposeEnabled", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableSubsceneFolder(bool on) {
Shinya Kitaoka 120a6e
  m_subsceneFolderEnabled = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("subsceneFolderEnabled", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableGeneratedMovieView(bool on) {
Shinya Kitaoka 120a6e
  m_generatedMovieViewEnabled = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("generatedMovieViewEnabled", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableXsheetAutopan(bool on) {
Shinya Kitaoka 120a6e
  m_xsheetAutopanEnabled = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("xsheetAutopanEnabled", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableIgnoreAlphaonColumn1(bool on) {
Shinya Kitaoka 120a6e
  m_ignoreAlphaonColumn1Enabled = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("ignoreAlphaonColumn1Enabled", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
shun_iwasawa 9f6fb4
//------------------------------------------------------------------
shun_iwasawa 9f6fb4
Shinya Kitaoka 120a6e
void Preferences::enableShowKeyframesOnXsheetCellArea(bool on) {
Shinya Kitaoka 120a6e
  m_showKeyframesOnXsheetCellArea = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("showKeyframesOnXsheetCellArea", on ? "1" : "0");
shun_iwasawa 9f6fb4
}
shun_iwasawa 9f6fb4
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableRewindAfterPlayback(bool on) {
Shinya Kitaoka 120a6e
  m_rewindAfterPlaybackEnabled = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("rewindAfterPlayback", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableFitToFlipbook(bool on) {
Shinya Kitaoka 120a6e
  m_fitToFlipbookEnabled = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("fitToFlipbook", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enablePreviewAlwaysOpenNewFlip(bool on) {
Shinya Kitaoka 120a6e
  m_previewAlwaysOpenNewFlipEnabled = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("previewAlwaysOpenNewFlip", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableAutosave(bool on) {
Shinya Kitaoka 120a6e
  m_autosaveEnabled = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("autosaveEnabled", on ? "1" : "0");
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  if (!on)
Shinya Kitaoka 120a6e
    emit stopAutoSave();
Shinya Kitaoka 120a6e
  else
Shinya Kitaoka 120a6e
    emit startAutoSave();
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Jeremy Bullock 33e7d1
void Preferences::enableAutosaveScene(bool on) {
Jeremy Bullock 33e7d1
  m_autosaveSceneEnabled = on;
Jeremy Bullock 33e7d1
  m_settings->setValue("autosaveSceneEnabled", on ? "1" : "0");
Jeremy Bullock 33e7d1
}
Jeremy Bullock 33e7d1
Jeremy Bullock 33e7d1
//-----------------------------------------------------------------
Jeremy Bullock 33e7d1
Jeremy Bullock 33e7d1
void Preferences::enableAutosaveOtherFiles(bool on) {
Jeremy Bullock 33e7d1
  m_autosaveOtherFilesEnabled = on;
Jeremy Bullock 33e7d1
  m_settings->setValue("autosaveOtherFilesEnabled", on ? "1" : "0");
Jeremy Bullock 33e7d1
}
Jeremy Bullock 33e7d1
Jeremy Bullock 33e7d1
//-----------------------------------------------------------------
Jeremy Bullock 33e7d1
Jeremy Bullock bfe861
void Preferences::enableStartupPopup(bool on) {
Jeremy Bullock bfe861
  m_startupPopupEnabled = on;
Jeremy Bullock bfe861
  m_settings->setValue("startupPopupEnabled", on ? "1" : "0");
Jeremy Bullock bfe861
}
Jeremy Bullock bfe861
Jeremy Bullock bfe861
//-----------------------------------------------------------------
Jeremy Bullock bfe861
Shinya Kitaoka 120a6e
void Preferences::setAskForOverrideRender(bool on) {
Shinya Kitaoka 120a6e
  m_autosaveEnabled = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("askForOverrideRender", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableDefaultViewer(bool on) {
Shinya Kitaoka 120a6e
  m_defaultViewerEnabled = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("defaultViewerEnabled", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableRasterOptimizedMemory(bool on) {
Shinya Kitaoka 120a6e
  m_rasterOptimizedMemory = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("rasterOptimizedMemory", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableSaveUnpaintedInCleanup(bool on) {
Shinya Kitaoka 120a6e
  m_saveUnpaintedInCleanup = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("saveUnpaintedInCleanup", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableAutomaticSVNFolderRefresh(bool on) {
Shinya Kitaoka 120a6e
  m_automaticSVNFolderRefreshEnabled = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("automaticSVNFolderRefreshEnabled", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableSVN(bool on) {
Shinya Kitaoka 120a6e
  m_SVNEnabled = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("SVNEnabled", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 133733
void Preferences::enableLatestVersionCheck(bool on) {
shun-iwasawa 133733
  m_latestVersionCheckEnabled = on;
shun-iwasawa 133733
  m_settings->setValue("latestVersionCheckEnabled", on ? "1" : "0");
shun-iwasawa 133733
}
shun-iwasawa 133733
shun-iwasawa 133733
//-----------------------------------------------------------------
shun-iwasawa 133733
Shinya Kitaoka 120a6e
void Preferences::enableMinimizeSaveboxAfterEditing(bool on) {
Shinya Kitaoka 120a6e
  m_minimizeSaveboxAfterEditing = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("minimizeSaveboxAfterEditing", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setAutosavePeriod(int minutes) {
Shinya Kitaoka 120a6e
  m_autosavePeriod = minutes;
Shinya Kitaoka 120a6e
  m_settings->setValue("autosavePeriod", QString::number(minutes));
Shinya Kitaoka 120a6e
  emit stopAutoSave();
Shinya Kitaoka 120a6e
  emit startAutoSave();
Jeremy Bullock 4c6224
  emit autoSavePeriodChanged();
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setDefaultTaskChunkSize(int chunkSize) {
Shinya Kitaoka 120a6e
  m_chunkSize = chunkSize;
Shinya Kitaoka 120a6e
  m_settings->setValue("taskchunksize", QString::number(chunkSize));
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setXsheetStep(int step) {
Shinya Kitaoka 120a6e
  m_xsheetStep = step;
Shinya Kitaoka 120a6e
  m_settings->setValue("xsheetStep", QString::number(m_xsheetStep));
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setTranspCheckData(const TPixel &bg, const TPixel &ink,
Shinya Kitaoka 120a6e
                                     const TPixel &paint) {
Shinya Kitaoka 120a6e
  m_transpCheckBg    = bg;
Shinya Kitaoka 120a6e
  m_transpCheckInk   = ink;
Shinya Kitaoka 120a6e
  m_transpCheckPaint = paint;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_settings->setValue("transpCheckInkOnBlack.r",
Shinya Kitaoka 120a6e
                       QString::number(m_transpCheckBg.r));
Shinya Kitaoka 120a6e
  m_settings->setValue("transpCheckInkOnBlack.g",
Shinya Kitaoka 120a6e
                       QString::number(m_transpCheckBg.g));
Shinya Kitaoka 120a6e
  m_settings->setValue("transpCheckInkOnBlack.b",
Shinya Kitaoka 120a6e
                       QString::number(m_transpCheckBg.b));
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_settings->setValue("transpCheckInkOnWhite.r",
Shinya Kitaoka 120a6e
                       QString::number(m_transpCheckInk.r));
Shinya Kitaoka 120a6e
  m_settings->setValue("transpCheckInkOnWhite.g",
Shinya Kitaoka 120a6e
                       QString::number(m_transpCheckInk.g));
Shinya Kitaoka 120a6e
  m_settings->setValue("transpCheckInkOnWhite.b",
Shinya Kitaoka 120a6e
                       QString::number(m_transpCheckInk.b));
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_settings->setValue("transpCheckPaint.r",
Shinya Kitaoka 120a6e
                       QString::number(m_transpCheckPaint.r));
Shinya Kitaoka 120a6e
  m_settings->setValue("transpCheckPaint.g",
Shinya Kitaoka 120a6e
                       QString::number(m_transpCheckPaint.g));
Shinya Kitaoka 120a6e
  m_settings->setValue("transpCheckPaint.b",
Shinya Kitaoka 120a6e
                       QString::number(m_transpCheckPaint.b));
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setOnionData(const TPixel &frontOnionColor,
Shinya Kitaoka 120a6e
                               const TPixel &backOnionColor, bool inksOnly) {
Shinya Kitaoka 120a6e
  m_frontOnionColor = frontOnionColor;
Shinya Kitaoka 120a6e
  m_backOnionColor  = backOnionColor;
Shinya Kitaoka 120a6e
  m_inksOnly        = inksOnly;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_settings->setValue("frontOnionColor.r", QString::number(frontOnionColor.r));
Shinya Kitaoka 120a6e
  m_settings->setValue("frontOnionColor.g", QString::number(frontOnionColor.g));
Shinya Kitaoka 120a6e
  m_settings->setValue("frontOnionColor.b", QString::number(frontOnionColor.b));
Shinya Kitaoka 120a6e
  m_settings->setValue("backOnionColor.r", QString::number(backOnionColor.r));
Shinya Kitaoka 120a6e
  m_settings->setValue("backOnionColor.g", QString::number(backOnionColor.g));
Shinya Kitaoka 120a6e
  m_settings->setValue("backOnionColor.b", QString::number(backOnionColor.b));
Shinya Kitaoka 120a6e
  m_settings->setValue("onionInksOnly", QString::number(m_inksOnly));
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setIconSize(const TDimension &dim) {
Shinya Kitaoka 120a6e
  m_iconSize = dim;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_settings->setValue("iconSizeX", QString::number(dim.lx));
Shinya Kitaoka 120a6e
  m_settings->setValue("iconSizeY", QString::number(dim.ly));
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setViewerBGColor(const TPixel32 &color, bool isDragging) {
Shinya Kitaoka 120a6e
  m_viewerBGColor = color;
Shinya Kitaoka 120a6e
  if (!isDragging) {
Shinya Kitaoka 120a6e
    m_settings->setValue("viewerBGColor_R", QString::number((int)color.r));
Shinya Kitaoka 120a6e
    m_settings->setValue("viewerBGColor_G", QString::number((int)color.g));
Shinya Kitaoka 120a6e
    m_settings->setValue("viewerBGColor_B", QString::number((int)color.b));
Shinya Kitaoka 120a6e
    m_settings->setValue("viewerBGColor_M", QString::number((int)color.m));
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setPreviewBGColor(const TPixel32 &color, bool isDragging) {
Shinya Kitaoka 120a6e
  m_previewBGColor = color;
Shinya Kitaoka 120a6e
  if (!isDragging) {
Shinya Kitaoka 120a6e
    m_settings->setValue("previewBGColor_R", QString::number((int)color.r));
Shinya Kitaoka 120a6e
    m_settings->setValue("previewBGColor_G", QString::number((int)color.g));
Shinya Kitaoka 120a6e
    m_settings->setValue("previewBGColor_B", QString::number((int)color.b));
Shinya Kitaoka 120a6e
    m_settings->setValue("previewBGColor_M", QString::number((int)color.m));
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setChessboardColor1(const TPixel32 &color, bool isDragging) {
Shinya Kitaoka 120a6e
  m_chessboardColor1 = color;
Shinya Kitaoka 120a6e
  if (!isDragging) {
Shinya Kitaoka 120a6e
    m_settings->setValue("chessboardColor1_R", QString::number((int)color.r));
Shinya Kitaoka 120a6e
    m_settings->setValue("chessboardColor1_G", QString::number((int)color.g));
Shinya Kitaoka 120a6e
    m_settings->setValue("chessboardColor1_B", QString::number((int)color.b));
Shinya Kitaoka 120a6e
    m_settings->setValue("chessboardColor1_M", QString::number((int)color.m));
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setChessboardColor2(const TPixel32 &color, bool isDragging) {
Shinya Kitaoka 120a6e
  m_chessboardColor2 = color;
Shinya Kitaoka 120a6e
  if (!isDragging) {
Shinya Kitaoka 120a6e
    m_settings->setValue("chessboardColor2_R", QString::number((int)color.r));
Shinya Kitaoka 120a6e
    m_settings->setValue("chessboardColor2_G", QString::number((int)color.g));
Shinya Kitaoka 120a6e
    m_settings->setValue("chessboardColor2_B", QString::number((int)color.b));
Shinya Kitaoka 120a6e
    m_settings->setValue("chessboardColor2_M", QString::number((int)color.m));
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableShowRasterImagesDarkenBlendedInViewer(bool on) {
Shinya Kitaoka 120a6e
  m_showRasterImagesDarkenBlendedInViewer = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("showRasterImagesDarkenBlendedInViewer", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableActualPixelViewOnSceneEditingMode(bool on) {
Shinya Kitaoka 120a6e
  m_actualPixelViewOnSceneEditingMode = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("actualPixelViewOnSceneEditingMode", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableMultiLayerStylePicker(bool on) {
Shinya Kitaoka 120a6e
  m_multiLayerStylePickerEnabled = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("multiLayerStylePickerEnabled", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setViewerZoomCenter(int type) {
Shinya Kitaoka 120a6e
  m_viewerZoomCenter = type;
Shinya Kitaoka 120a6e
  m_settings->setValue("viewerZoomCenter", type);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setInitialLoadTlvCachingBehavior(int type) {
Shinya Kitaoka 120a6e
  m_initialLoadTlvCachingBehavior = type;
Shinya Kitaoka 120a6e
  m_settings->setValue("initialLoadTlvCachingBehavior", type);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableShowFrameNumberWithLetters(bool on) {
Shinya Kitaoka 120a6e
  m_showFrameNumberWithLetters = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("showFrameNumberWithLetters", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableLevelNameOnEachMarker(bool on) {
Shinya Kitaoka 120a6e
  m_levelNameOnEachMarker = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("levelNameOnEachMarkerEnabled", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setColumnIconLoadingPolicy(ColumnIconLoadingPolicy cilp) {
Shinya Kitaoka 120a6e
  assert(cilp == LoadAtOnce || cilp == LoadOnDemand);
Shinya Kitaoka 120a6e
  m_columnIconLoadingPolicy = cilp;
Shinya Kitaoka 120a6e
  m_settings->setValue("columnIconLoadingPolicy", QString::number((int)cilp));
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableMoveCurrent(bool on) {
Shinya Kitaoka 120a6e
  m_moveCurrentFrameByClickCellArea = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("moveCurrentFrameByClickCellArea", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableRemoveSceneNumberFromLoadedLevelName(bool on) {
Shinya Kitaoka 120a6e
  m_removeSceneNumberFromLoadedLevelName = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("removeSceneNumberFromLoadedLevelName", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableReplaceAfterSaveLevelAs(bool on) {
Shinya Kitaoka 120a6e
  m_replaceAfterSaveLevelAs = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("replaceAfterSaveLevelAs", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::enableOnionSkin(bool on) {
Shinya Kitaoka 120a6e
  m_onionSkinEnabled = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("onionSkinEnabled", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Jeremy Bullock 17d8f9
void Preferences::setOnionSkinDuringPlayback(bool on) {
Jeremy Bullock 17d8f9
  m_onionSkinDuringPlayback = on;
Jeremy Bullock 17d8f9
  m_settings->setValue("onionSkinDuringPlayback", on ? "1" : "0");
Jeremy Bullock 17d8f9
}
Jeremy Bullock 17d8f9
Jeremy Bullock 17d8f9
//-----------------------------------------------------------------
Jeremy Bullock 17d8f9
shun-iwasawa 1d5937
void Preferences::useOnionColorsForShiftAndTraceGhosts(bool on) {
shun-iwasawa 1d5937
  m_useOnionColorsForShiftAndTraceGhosts = on;
shun-iwasawa 1d5937
  m_settings->setValue("useOnionColorsForShiftAndTraceGhosts", on ? "1" : "0");
shun-iwasawa 1d5937
}
shun-iwasawa 1d5937
shun-iwasawa 1d5937
//-----------------------------------------------------------------
shun-iwasawa 1d5937
Shinya Kitaoka 120a6e
void Preferences::setShow0ThickLines(bool on) {
Shinya Kitaoka 120a6e
  m_show0ThickLines = on;
Shinya Kitaoka 120a6e
  m_settings->setValue(s_show0ThickLines, s_bool[on]);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setRegionAntialias(bool on) {
Shinya Kitaoka 120a6e
  m_regionAntialias = on;
Shinya Kitaoka 120a6e
  m_settings->setValue(s_regionAntialias, s_bool[on]);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setBlankValues(int blanksCount, TPixel32 blankColor) {
Shinya Kitaoka 120a6e
  m_blanksCount = blanksCount;
Shinya Kitaoka 120a6e
  m_blankColor  = blankColor;
Shinya Kitaoka 120a6e
  m_settings->setValue("blanksCount", QString::number(blanksCount));
Shinya Kitaoka 120a6e
  m_settings->setValue("blankColor.r", QString::number(blankColor.r));
Shinya Kitaoka 120a6e
  m_settings->setValue("blankColor.g", QString::number(blankColor.g));
Shinya Kitaoka 120a6e
  m_settings->setValue("blankColor.b", QString::number(blankColor.b));
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setOnionPaperThickness(int thickness) {
Shinya Kitaoka 120a6e
  m_onionPaperThickness = thickness;
Shinya Kitaoka 120a6e
  m_settings->setValue("onionPaperThickness", QString::number(thickness));
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setViewValues(int shrink, int step) {
Shinya Kitaoka 120a6e
  m_shrink = shrink;
Shinya Kitaoka 120a6e
  m_step   = step;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  m_settings->setValue("viewShrink", QString::number(shrink));
Shinya Kitaoka 120a6e
  m_settings->setValue("viewStep", QString::number(step));
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Campbell Barton b3bd84
static void setCurrentUnits(std::string measureName, std::string units) {
Shinya Kitaoka 120a6e
  TMeasure *m = TMeasureManager::instance()->get(measureName);
Shinya Kitaoka 120a6e
  if (!m) return;
Shinya Kitaoka 120a6e
  TUnit *u = m->getUnit(::to_wstring(units));
Shinya Kitaoka 120a6e
  if (!u) return;
Shinya Kitaoka 120a6e
  m->setCurrentUnit(u);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Jeremy Bullock 7c096e
void Preferences::setPixelsOnly(bool state) {
Jeremy Bullock 59dbbf
  m_pixelsOnly = state;
Jeremy Bullock 59dbbf
  m_settings->setValue("pixelsOnly", m_pixelsOnly);
Jeremy Bullock 59dbbf
  if (state) {
Jeremy Bullock 59dbbf
    storeOldUnits();
Jeremy Bullock 59dbbf
  } else {
Jeremy Bullock 59dbbf
    resetOldUnits();
Jeremy Bullock 59dbbf
  }
Jeremy Bullock 7c096e
}
Jeremy Bullock 7c096e
Jeremy Bullock 7c096e
//-----------------------------------------------------------------
Jeremy Bullock 7c096e
Jeremy Bullock e59b1f
void Preferences::setProjectRoot(int index) {
Jeremy Bullock e59b1f
  // storing the index of the selection instead of the text
Jeremy Bullock e59b1f
  // to make translation work
Jeremy Bullock e59b1f
  m_projectRoot = index;
Jeremy Bullock e59b1f
  m_settings->setValue("projectRoot", m_projectRoot);
Jeremy Bullock e59b1f
}
Jeremy Bullock e59b1f
Jeremy Bullock e59b1f
//-----------------------------------------------------------------
Jeremy Bullock e59b1f
Jeremy Bullock e59b1f
void Preferences::setCustomProjectRoot(std::wstring customProjectRoot) {
Jeremy Bullock e59b1f
  m_customProjectRoot = QString::fromStdWString(customProjectRoot);
Jeremy Bullock e59b1f
  m_settings->setValue("customProjectRoot", m_customProjectRoot);
Jeremy Bullock e59b1f
}
Jeremy Bullock e59b1f
Jeremy Bullock e59b1f
//-----------------------------------------------------------------
Jeremy Bullock e59b1f
Shinya Kitaoka 120a6e
void Preferences::setUnits(std::string units) {
Shinya Kitaoka 120a6e
  m_units = QString::fromStdString(units);
Shinya Kitaoka 120a6e
  m_settings->setValue("linearUnits", m_units);
Shinya Kitaoka 120a6e
  setCurrentUnits("length", units);
Shinya Kitaoka 120a6e
  setCurrentUnits("length.x", units);
Shinya Kitaoka 120a6e
  setCurrentUnits("length.y", units);
Shinya Kitaoka 120a6e
  setCurrentUnits("length.lx", units);
Shinya Kitaoka 120a6e
  setCurrentUnits("length.ly", units);
Shinya Kitaoka 120a6e
  setCurrentUnits("fxLength", units);
Shinya Kitaoka 120a6e
  setCurrentUnits("pippo", units);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setCameraUnits(std::string units) {
Shinya Kitaoka 120a6e
  m_cameraUnits = QString::fromStdString(units);
Shinya Kitaoka 120a6e
  m_settings->setValue("cameraUnits", m_cameraUnits);
Shinya Kitaoka 120a6e
  setCurrentUnits("camera.lx", units);
Shinya Kitaoka 120a6e
  setCurrentUnits("camera.ly", units);
Toshihiro Shimizu 890ddd
}
turtletooth 8d9ba3
turtletooth 8d9ba3
//-----------------------------------------------------------------
turtletooth 8d9ba3
Jeremy Bullock 7c096e
void Preferences::storeOldUnits() {
Jeremy Bullock 59dbbf
  m_oldUnits       = getUnits();
Jeremy Bullock 59dbbf
  m_oldCameraUnits = getCameraUnits();
Jeremy Bullock 59dbbf
  m_settings->setValue("oldUnits", m_oldUnits);
Jeremy Bullock 59dbbf
  m_settings->setValue("oldCameraUnits", m_oldCameraUnits);
Jeremy Bullock 7c096e
}
Jeremy Bullock 7c096e
Jeremy Bullock 7c096e
//-----------------------------------------------------------------
Jeremy Bullock 7c096e
Jeremy Bullock 7c096e
void Preferences::resetOldUnits() {
Jeremy Bullock 59dbbf
  if (m_oldUnits != "" && m_oldCameraUnits != "") {
Jeremy Bullock 59dbbf
    setUnits(m_oldUnits.toStdString());
Jeremy Bullock 59dbbf
    setCameraUnits(m_oldCameraUnits.toStdString());
Jeremy Bullock 59dbbf
  }
Jeremy Bullock 7c096e
}
Jeremy Bullock 7c096e
Jeremy Bullock 7c096e
//-----------------------------------------------------------------
Jeremy Bullock 7c096e
Shinya Kitaoka 120a6e
void Preferences::setCurrentRoomChoice(int currentRoomChoice) {
Shinya Kitaoka 120a6e
  m_currentRoomChoice = getRoomChoice(currentRoomChoice);
Shinya Kitaoka 120a6e
  m_settings->setValue("CurrentRoomChoice", m_currentRoomChoice);
turtletooth 8d9ba3
}
turtletooth 8d9ba3
turtletooth 8d9ba3
//-----------------------------------------------------------------
turtletooth 8d9ba3
Shinya Kitaoka 120a6e
void Preferences::setCurrentRoomChoice(QString currentRoomChoice) {
Shinya Kitaoka 120a6e
  m_currentRoomChoice = currentRoomChoice;
Shinya Kitaoka 120a6e
  m_settings->setValue("CurrentRoomChoice", m_currentRoomChoice);
turtletooth 8d9ba3
}
turtletooth 8d9ba3
turtletooth 8d9ba3
//-----------------------------------------------------------------
turtletooth 8d9ba3
Shinya Kitaoka 120a6e
QString Preferences::getCurrentRoomChoice() const {
Shinya Kitaoka 120a6e
  return m_currentRoomChoice;
turtletooth 8d9ba3
}
turtletooth 8d9ba3
turtletooth 8d9ba3
//-----------------------------------------------------------------
turtletooth 8d9ba3
Shinya Kitaoka 120a6e
int Preferences::getRoomChoiceCount() const { return m_roomMaps.size(); }
turtletooth 8d9ba3
turtletooth 8d9ba3
//-----------------------------------------------------------------
turtletooth 8d9ba3
Shinya Kitaoka 120a6e
QString Preferences::getRoomChoice(int index) const {
Shinya Kitaoka 120a6e
  return m_roomMaps[index];
turtletooth 8d9ba3
}
turtletooth 8d9ba3
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setScanLevelType(std::string type) {
Shinya Kitaoka 120a6e
  m_scanLevelType = QString::fromStdString(type);
Shinya Kitaoka 120a6e
  m_settings->setValue("scanLevelType", m_scanLevelType);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setKeyframeType(int s) {
Shinya Kitaoka 120a6e
  m_keyframeType = s;
Shinya Kitaoka 120a6e
  m_settings->setValue("keyframeType", s);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setAnimationStep(int s) {
Shinya Kitaoka 120a6e
  m_animationStep = s;
Shinya Kitaoka 120a6e
  m_settings->setValue("animationStep", s);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setUndoMemorySize(int memorySize) {
Shinya Kitaoka 120a6e
  m_undoMemorySize = memorySize;
Shinya Kitaoka 120a6e
  TUndoManager::manager()->setUndoMemorySize(memorySize);
Shinya Kitaoka 120a6e
  m_settings->setValue("undoMemorySize", memorySize);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
QString Preferences::getCurrentLanguage() const {
shun-iwasawa 9031b4
  if (m_languageList.contains(m_currentLanguage)) return m_currentLanguage;
shun-iwasawa 9031b4
  // If no valid option selected, then return English
shun-iwasawa 9031b4
  return m_languageList[0];
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
QString Preferences::getLanguage(int index) const {
shun-iwasawa 9031b4
  return m_languageList[index];
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 9031b4
int Preferences::getLanguageCount() const { return (int)m_languageList.size(); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 9031b4
void Preferences::setCurrentLanguage(const QString ¤tLanguage) {
Shinya Kitaoka 120a6e
  m_currentLanguage = currentLanguage;
shun-iwasawa 9031b4
  m_settings->setValue("CurrentLanguageName", m_currentLanguage);
shun-iwasawa 9031b4
}
shun-iwasawa 9031b4
shun-iwasawa 9031b4
//-----------------------------------------------------------------
shun-iwasawa 9031b4
shun-iwasawa 9031b4
QString Preferences::getCurrentStyleSheetName() const {
shun-iwasawa 9031b4
  if (m_styleSheetList.contains(m_currentStyleSheet))
shun-iwasawa 9031b4
    return m_currentStyleSheet;
shun-iwasawa 9031b4
  // If no valid option selected, then return the first oprion
shun-iwasawa 9031b4
  return m_styleSheetList.isEmpty() ? QString() : m_styleSheetList[0];
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Jeremy Bullock 807052
void Preferences::setInterfaceFont(std::string font) {
Jeremy Bullock 807052
  m_interfaceFont = QString::fromStdString(font);
Jeremy Bullock 807052
  m_settings->setValue("interfaceFont", m_interfaceFont);
Jeremy Bullock 807052
}
Jeremy Bullock 807052
Jeremy Bullock 807052
//-----------------------------------------------------------------
Jeremy Bullock 807052
manongjohn b66bc4
void Preferences::setInterfaceFontStyle(std::string style) {
manongjohn b66bc4
  m_interfaceFontStyle = QString::fromStdString(style);
manongjohn b66bc4
  m_settings->setValue("interfaceFontStyle", m_interfaceFontStyle);
manongjohn b66bc4
}
manongjohn b66bc4
manongjohn b66bc4
//-----------------------------------------------------------------
manongjohn b66bc4
Jeremy Bullock 807052
void Preferences::setInterfaceFontWeight(int weight) {
Jeremy Bullock 807052
  m_interfaceFontWeight = weight;
Jeremy Bullock 807052
  m_settings->setValue("interfaceFontWeight", m_interfaceFontWeight);
Jeremy Bullock 807052
}
Jeremy Bullock 807052
Jeremy Bullock 807052
//-----------------------------------------------------------------
Jeremy Bullock 807052
shun-iwasawa 9031b4
QString Preferences::getCurrentStyleSheetPath() const {
shun-iwasawa 9031b4
  if (m_currentStyleSheet.isEmpty()) return QString();
shun-iwasawa 9031b4
  TFilePath path(TEnv::getConfigDir() + "qss");
shun-iwasawa 9031b4
  QString string = m_currentStyleSheet + QString("/") + m_currentStyleSheet +
shun-iwasawa 9031b4
                   QString(".qss");
shun-iwasawa 9031b4
  return QString("file:///" + path.getQString() + "/" + string);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
QString Preferences::getStyleSheet(int index) const {
shun-iwasawa 9031b4
  return m_styleSheetList[index];
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
int Preferences::getStyleSheetCount() const {
shun-iwasawa 9031b4
  return (int)m_styleSheetList.size();
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun-iwasawa 9031b4
void Preferences::setCurrentStyleSheet(const QString ¤tStyleSheet) {
Shinya Kitaoka 120a6e
  m_currentStyleSheet = currentStyleSheet;
shun-iwasawa 9031b4
  m_settings->setValue("CurrentStyleSheetName", m_currentStyleSheet);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setAutocreationType(int autocreationType) {
Shinya Kitaoka 120a6e
  m_autocreationType = autocreationType;
Shinya Kitaoka 120a6e
  m_settings->setValue("AutocreationType", m_autocreationType);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setDragCellsBehaviour(int dragCellsBehaviour) {
Shinya Kitaoka 120a6e
  m_dragCellsBehaviour = dragCellsBehaviour;
Shinya Kitaoka 120a6e
  m_settings->setValue("DragCellsBehaviour", m_dragCellsBehaviour);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setLineTestFpsCapture(int lineTestFpsCapture) {
Shinya Kitaoka 120a6e
  m_lineTestFpsCapture = lineTestFpsCapture;
Shinya Kitaoka 120a6e
  m_settings->setValue("LineTestFpsCapture", m_lineTestFpsCapture);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setFillOnlySavebox(bool on) {
Shinya Kitaoka 120a6e
  m_fillOnlySavebox = on;
Shinya Kitaoka 120a6e
  m_settings->setValue("FillOnlysavebox", on ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Jeremy Bullock 3f573c
void Preferences::setKeepFillOnVectorSimplify(bool on) {
Jeremy Bullock 3f573c
  m_keepFillOnVectorSimplify = on;
Jeremy Bullock 3f573c
  m_settings->setValue("keepFillOnVectorSimplify", on ? "1" : "0");
Jeremy Bullock 3f573c
}
Jeremy Bullock 3f573c
Jeremy Bullock 3f573c
//-----------------------------------------------------------------
Jeremy Bullock 3f573c
Jeremy Bullock 3f573c
void Preferences::setUseHigherDpiOnVectorSimplify(bool on) {
Jeremy Bullock 3f573c
  m_useHigherDpiOnVectorSimplify = on;
Jeremy Bullock 3f573c
  m_settings->setValue("useHigherDpiOnVectorSimplify", on ? "1" : "0");
Jeremy Bullock 3f573c
}
Jeremy Bullock 3f573c
Jeremy Bullock 3f573c
//-----------------------------------------------------------------
Jeremy Bullock 3f573c
Jeremy Bullock 3e69f9
void Preferences::setDownArrowLevelStripNewFrame(bool on) {
Jeremy Bullock 3e69f9
  m_downArrowInLevelStripCreatesNewFrame = on;
Jeremy Bullock 3e69f9
  m_settings->setValue("downArrowInLevelStripCreatesNewFrame", on ? "1" : "0");
Jeremy Bullock 3e69f9
}
Jeremy Bullock 3e69f9
Jeremy Bullock 3e69f9
//-----------------------------------------------------------------
Jeremy Bullock 3e69f9
manongjohn e1c928
void Preferences::enableBackup(bool enabled) {
manongjohn e1c928
  m_backupEnabled = enabled;
manongjohn e1c928
  m_settings->setValue("backupEnabled", enabled ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
manongjohn 177b7c
void Preferences::setBackupKeepCount(int count) {
manongjohn 177b7c
  m_backupKeepCount = count;
manongjohn 177b7c
  m_settings->setValue("backupKeepCount", count);
manongjohn 177b7c
}
manongjohn 177b7c
manongjohn 177b7c
//-----------------------------------------------------------------
manongjohn 177b7c
Shinya Kitaoka 120a6e
void Preferences::enableSceneNumbering(bool enabled) {
Shinya Kitaoka 120a6e
  m_sceneNumberingEnabled = enabled;
Shinya Kitaoka 120a6e
  m_settings->setValue("sceneNumberingEnabled", enabled ? "1" : "0");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Jeremy Bullock 3a06bd
void Preferences::setDropdownShortcutsCycleOptions(bool on) {
Jeremy Bullock 3a06bd
  m_dropdownShortcutsCycleOptions = on;
Jeremy Bullock 3a06bd
  m_settings->setValue("dropdownShortcutsCycleOptions", on ? "1" : "0");
Jeremy Bullock 3a06bd
}
Jeremy Bullock 3a06bd
Jeremy Bullock 3a06bd
//-----------------------------------------------------------------
Jeremy Bullock 3a06bd
Shinya Kitaoka 120a6e
void Preferences::setDefLevelType(int levelType) {
Shinya Kitaoka 120a6e
  m_defLevelType = levelType;
Shinya Kitaoka 120a6e
  m_settings->setValue("DefLevelType", levelType);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setDefLevelWidth(double width) {
Shinya Kitaoka 120a6e
  m_defLevelWidth = width;
Shinya Kitaoka 120a6e
  m_settings->setValue("DefLevelWidth", width);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setDefLevelHeight(double height) {
Shinya Kitaoka 120a6e
  m_defLevelHeight = height;
Shinya Kitaoka 120a6e
  m_settings->setValue("DefLevelHeight", height);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::setDefLevelDpi(double dpi) {
Shinya Kitaoka 120a6e
  m_defLevelDpi = dpi;
Shinya Kitaoka 120a6e
  m_settings->setValue("DefLevelDpi", dpi);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Jeremy Bullock 8c5007
void Preferences::setIgnoreImageDpi(bool on) {
Jeremy Bullock 8c5007
  m_ignoreImageDpi = on;
Jeremy Bullock 8c5007
  m_settings->setValue("IgnoreImageDpi", on ? "1" : "0");
Jeremy Bullock 8c5007
}
Jeremy Bullock 8c5007
Jeremy Bullock 8c5007
//-----------------------------------------------------------------
Jeremy Bullock 8c5007
Jeremy Bullock cd00fd
void Preferences::setVectorSnappingTarget(int target) {
Jeremy Bullock cd00fd
  m_vectorSnappingTarget = target;
Jeremy Bullock cd00fd
  m_settings->setValue("vectorSnappingTarget", target);
Jeremy Bullock cd00fd
}
Jeremy Bullock cd00fd
Jeremy Bullock cd00fd
//-----------------------------------------------------------------
Jeremy Bullock cd00fd
turtletooth 04d8fd
void Preferences::setFfmpegPath(std::string path) {
turtletooth 04d8fd
  m_ffmpegPath        = QString::fromStdString(path);
turtletooth 04d8fd
  std::string strPath = m_ffmpegPath.toStdString();
turtletooth 04d8fd
  m_settings->setValue("ffmpegPath", m_ffmpegPath);
turtletooth 04d8fd
}
turtletooth 04d8fd
turtletooth 04d8fd
//-----------------------------------------------------------------
turtletooth 04d8fd
Jeremy Bullock 3bb5ef
void Preferences::setFastRenderPath(std::string path) {
Jeremy Bullock 3bb5ef
  m_fastRenderPath    = QString::fromStdString(path);
Jeremy Bullock 3bb5ef
  std::string strPath = m_ffmpegPath.toStdString();
Jeremy Bullock 3bb5ef
  m_settings->setValue("fastRenderPath", m_fastRenderPath);
Jeremy Bullock 3bb5ef
}
Jeremy Bullock 3bb5ef
Jeremy Bullock 3bb5ef
//-----------------------------------------------------------------
Jeremy Bullock 3bb5ef
Jeremy Bullock e8903b
void Preferences::setShortcutPreset(std::string preset) {
Jeremy Bullock e8903b
  m_shortcutPreset = QString::fromStdString(preset);
Jeremy Bullock e8903b
  m_settings->setValue("shortcutPreset", m_shortcutPreset);
Jeremy Bullock e8903b
}
Jeremy Bullock e8903b
Jeremy Bullock e8903b
//-----------------------------------------------------------------
Jeremy Bullock e8903b
turtletooth 04d8fd
void Preferences::setPrecompute(bool enabled) { m_precompute = enabled; }
turtletooth 04d8fd
turtletooth 04d8fd
//-----------------------------------------------------------------
turtletooth 04d8fd
shun-iwasawa 27b0cf
void Preferences::setFfmpegTimeout(int seconds) {
shun-iwasawa 27b0cf
  m_ffmpegTimeout = seconds;
shun-iwasawa 27b0cf
  m_settings->setValue("ffmpegTimeout", seconds);
turtletooth 04d8fd
}
turtletooth 04d8fd
turtletooth 04d8fd
//-----------------------------------------------------------------
turtletooth 04d8fd
Jeremy Bullock b53dba
void Preferences::setDefaultImportPolicy(int policy) {
Jeremy Bullock b53dba
  m_importPolicy = policy;
Jeremy Bullock b53dba
  m_settings->setValue("importPolicy", policy);
Jeremy Bullock b53dba
}
Jeremy Bullock b53dba
Jeremy Bullock b53dba
//-----------------------------------------------------------------
Jeremy Bullock b53dba
Shinya Kitaoka 120a6e
int Preferences::addLevelFormat(const LevelFormat &format) {
Shinya Kitaoka 120a6e
  LevelFormatVector::iterator lft = m_levelFormats.insert(
Shinya Kitaoka 120a6e
      std::upper_bound(m_levelFormats.begin(), m_levelFormats.end(), format,
Shinya Kitaoka 120a6e
                       formatLess),
Shinya Kitaoka 120a6e
      format);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  int formatIdx = int(
Shinya Kitaoka 120a6e
      lft -
Shinya Kitaoka 120a6e
      m_levelFormats.begin());  // NOTE: Must be disjoint from the instruction
Shinya Kitaoka 120a6e
  //       above, since operator-'s param evaluation
Shinya Kitaoka 120a6e
  //       order is unspecified
Shinya Kitaoka 120a6e
  setValue(*m_settings, m_levelFormats);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  return formatIdx;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void Preferences::removeLevelFormat(int formatIdx) {
Shinya Kitaoka 120a6e
  assert(0 <= formatIdx && formatIdx < int(m_levelFormats.size()));
Shinya Kitaoka 120a6e
  m_levelFormats.erase(m_levelFormats.begin() + formatIdx);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  setValue(*m_settings, m_levelFormats);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
const Preferences::LevelFormat &Preferences::levelFormat(int formatIdx) const {
Shinya Kitaoka 120a6e
  assert(0 <= formatIdx && formatIdx < int(m_levelFormats.size()));
Shinya Kitaoka 120a6e
  return m_levelFormats[formatIdx];
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
int Preferences::levelFormatsCount() const {
Shinya Kitaoka 120a6e
  return int(m_levelFormats.size());
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
int Preferences::matchLevelFormat(const TFilePath &fp) const {
Shinya Kitaoka 120a6e
  LevelFormatVector::const_iterator lft =
Shinya Kitaoka 120a6e
      std::find_if(m_levelFormats.begin(), m_levelFormats.end(),
Shinya Kitaoka 120a6e
                   boost::bind(&LevelFormat::matches, _1, boost::cref(fp)));
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  return (lft != m_levelFormats.end()) ? lft - m_levelFormats.begin() : -1;
Toshihiro Shimizu 890ddd
}
shun_iwasawa 4635d8
shun_iwasawa 4635d8
//-----------------------------------------------------------------
shun_iwasawa 4635d8
shun_iwasawa 4635d8
void Preferences::enableUseNumpadForSwitchingStyles(bool on) {
shun_iwasawa 4635d8
  m_useNumpadForSwitchingStyles = on;
shun_iwasawa 4635d8
  m_settings->setValue("useNumpadForSwitchingStyles", on ? "1" : "0");
shun_iwasawa 3639da
}
shun_iwasawa 3639da
shun_iwasawa 3639da
//-----------------------------------------------------------------
shun_iwasawa 3639da
Jeremy Bullock 1e17ed
void Preferences::setGuidedDrawing(int status) {
Jeremy Bullock 1e17ed
  m_guidedDrawingType = status;
Jeremy Bullock 1e17ed
  m_settings->setValue("guidedDrawingType", status);
Jeremy Bullock 1e17ed
}
Jeremy Bullock 1e17ed
Jeremy Bullock 1e17ed
//-----------------------------------------------------------------
Jeremy Bullock 1e17ed
Jeremy Bullock 1e17ed
void Preferences::setAnimatedGuidedDrawing(bool status) {
Jeremy Bullock 1e17ed
  m_animatedGuidedDrawing = status;
shun-iwasawa 18a7c6
  m_settings->setValue("animatedGuidedDrawing", status ? "1" : "0");
Jeremy Bullock 1e17ed
}
Jeremy Bullock 1e17ed
Jeremy Bullock 1e17ed
//-----------------------------------------------------------------
Jeremy Bullock 1e17ed
Jeremy Bullock 44af2c
void Preferences::enableNewLevelSizeToCameraSize(bool on) {
Jeremy Bullock 44af2c
  m_newLevelSizeToCameraSizeEnabled = on;
Jeremy Bullock 44af2c
  m_settings->setValue("newLevelSizeToCameraSizeEnabled", on ? "1" : "0");
Jeremy Bullock 44af2c
}
Jeremy Bullock 44af2c
Jeremy Bullock 44af2c
//-----------------------------------------------------------------
Jeremy Bullock 44af2c
Jeremy Bullock 15fcba
void Preferences::enableShowXSheetToolbar(bool on) {
Jeremy Bullock 15fcba
  m_showXSheetToolbar = on;
Jeremy Bullock 15fcba
  m_settings->setValue("showXSheetToolbar", on ? "1" : "0");
Jeremy Bullock 15fcba
}
Jeremy Bullock 15fcba
Jeremy Bullock 15fcba
//-----------------------------------------------------------------
Jeremy Bullock 15fcba
Jeremy Bullock 4386c6
void Preferences::enableSyncLevelRenumberWithXsheet(bool on) {
Jeremy Bullock 4386c6
  m_syncLevelRenumberWithXsheet = on;
Jeremy Bullock 4386c6
  m_settings->setValue("syncLevelRenumberWithXsheet", on ? "1" : "0");
Jeremy Bullock 4386c6
}
Jeremy Bullock 4386c6
Jeremy Bullock 4386c6
//-----------------------------------------------------------------
Jeremy Bullock 4386c6
Jeremy Bullock 15fcba
void Preferences::enableExpandFunctionHeader(bool on) {
Jeremy Bullock 15fcba
  m_expandFunctionHeader = on;
Jeremy Bullock 15fcba
  m_settings->setValue("expandFunctionHeader", on ? "1" : "0");
Jeremy Bullock 15fcba
}
Jeremy Bullock 15fcba
Jaroslav 203cc8
void Preferences::enableShowColumnNumbers(bool on) {
shun_iwasawa 0cae24
  m_showColumnNumbers = on;
shun_iwasawa 0cae24
  m_settings->setValue("showColumnNumbers", on ? "1" : "0");
Jaroslav 203cc8
}
Jaroslav 203cc8
manongjohn 399e7d
void Preferences::setXsheetLayoutPreference(std::string layout) {
manongjohn 399e7d
  m_xsheetLayoutPreference = QString::fromStdString(layout);
manongjohn 399e7d
  m_settings->setValue("xsheetLayoutPreference", m_xsheetLayoutPreference);
manongjohn 399e7d
}
manongjohn 399e7d
manongjohn 399e7d
void Preferences::setLoadedXsheetLayout(std::string layout) {
manongjohn 399e7d
  m_loadedXsheetLayout = QString::fromStdString(layout);
manongjohn 399e7d
}
manongjohn 399e7d
Jeremy Bullock 15fcba
//-----------------------------------------------------------------
Jeremy Bullock 15fcba
shun_iwasawa 3639da
void Preferences::enableUseArrowKeyToShiftCellSelection(bool on) {
shun_iwasawa 3639da
  m_useArrowKeyToShiftCellSelection = on;
shun_iwasawa 3639da
  m_settings->setValue("useArrowKeyToShiftCellSelection", on ? "1" : "0");
shun_iwasawa 3639da
}
shun_iwasawa 3639da
shun_iwasawa 3639da
//-----------------------------------------------------------------
shun_iwasawa 3639da
shun_iwasawa 3639da
void Preferences::enableInputCellsWithoutDoubleClicking(bool on) {
shun_iwasawa 3639da
  m_inputCellsWithoutDoubleClickingEnabled = on;
shun_iwasawa 3639da
  m_settings->setValue("inputCellsWithoutDoubleClickingEnabled",
shun_iwasawa 3639da
                       on ? "1" : "0");
shun-iwasawa 57bc09
}
shun-iwasawa 57bc09
shun-iwasawa 57bc09
//-----------------------------------------------------------------
shun-iwasawa 57bc09
shun-iwasawa 57bc09
void Preferences::enableWatchFileSystem(bool on) {
shun-iwasawa 57bc09
  m_watchFileSystem = on;
shun-iwasawa 57bc09
  m_settings->setValue("watchFileSystemEnabled", on ? "1" : "0");
shun-iwasawa d08c7c
}
shun-iwasawa d08c7c
shun-iwasawa d08c7c
//-----------------------------------------------------------------
shun-iwasawa d08c7c
shun-iwasawa d08c7c
void Preferences::enableShortcutCommandsWhileRenamingCell(bool on) {
shun-iwasawa d08c7c
  m_shortcutCommandsWhileRenamingCellEnabled = on;
shun-iwasawa d08c7c
  m_settings->setValue("shortcutCommandsWhileRenamingCellEnabled",
shun-iwasawa d08c7c
                       on ? "1" : "0");
manongjohn 1be264
}
manongjohn 1be264
manongjohn 1be264
//-----------------------------------------------------------------
manongjohn 1be264
shun-iwasawa c85210
void Preferences::setPathAliasPriority(PathAliasPriority priority) {
shun-iwasawa c85210
  m_pathAliasPriority = priority;
shun-iwasawa c85210
  m_settings->setValue("pathAliasPriority", static_cast<int>(priority));</int>
shun-iwasawa c85210
}
shun-iwasawa c85210
shun-iwasawa c85210
//-----------------------------------------------------------------
shun-iwasawa c85210
Jeremy Bullock 4ce953
void Preferences::setFunctionEditorToggle(FunctionEditorToggle status) {
Jeremy Bullock 4ce953
  m_functionEditorToggle = status;
Jeremy Bullock 4ce953
  m_settings->setValue("functionEditorToggle", static_cast<int>(status));</int>
Jeremy Bullock 4ce953
}
Jeremy Bullock 4ce953
Jeremy Bullock 4ce953
//-----------------------------------------------------------------
Jeremy Bullock 4ce953
manongjohn 1be264
void Preferences::enableCurrentTimelineIndicator(bool on) {
manongjohn 1be264
  m_currentTimelineEnabled = on;
manongjohn 1be264
  m_settings->setValue("currentTimelineEnabled", on ? "1" : "0");
manongjohn 1be264
}
shun-iwasawa ad7711
shun-iwasawa ad7711
//-----------------------------------------------------------------
shun-iwasawa ad7711
// color calibration using 3DLUT
shun-iwasawa ad7711
shun-iwasawa ad7711
void Preferences::enableColorCalibration(bool on) {
shun-iwasawa ad7711
  m_colorCalibrationEnabled = on;
shun-iwasawa ad7711
  m_settings->setValue("colorCalibrationEnabled", on ? "1" : "0");
shun-iwasawa ad7711
}
shun-iwasawa ad7711
shun-iwasawa ad7711
void Preferences::setColorCalibrationLutPath(QString monitorName,
shun-iwasawa ad7711
                                             QString path) {
shun-iwasawa ad7711
  m_colorCalibrationLutPaths.insert(monitorName, path);
shun-iwasawa ad7711
  QMap<qstring, qvariant=""> map;</qstring,>
shun-iwasawa ad7711
  QMap<qstring, qstring="">::const_iterator i =</qstring,>
shun-iwasawa ad7711
      m_colorCalibrationLutPaths.constBegin();
shun-iwasawa ad7711
  while (i != m_colorCalibrationLutPaths.constEnd()) {
shun-iwasawa ad7711
    map.insert(i.key(), i.value());
shun-iwasawa ad7711
    i++;
shun-iwasawa ad7711
  }
shun-iwasawa ad7711
  m_settings->setValue("colorCalibrationLutPaths", map);
shun-iwasawa ad7711
}
shun-iwasawa ad7711
shun-iwasawa ad7711
QString Preferences::getColorCalibrationLutPath(QString &monitorName) const {
shun-iwasawa ad7711
  return m_colorCalibrationLutPaths.value(monitorName);
shun-iwasawa ad7711
}
shun-iwasawa ad7711
manongjohn 29ce0b
//-----------------------------------------------------------------
manongjohn 29ce0b
manongjohn 29ce0b
void Preferences::enableAutoStretch(bool on) {
manongjohn 29ce0b
  m_enableAutoStretch = on;
manongjohn 29ce0b
  m_settings->setValue("EnableAutoStretch", on ? "1" : "0");
artisteacher 9ce0c2
}
manongjohn 75da26
manongjohn 75da26
void Preferences::setCursorBrushType(std::string brushType) {
manongjohn 75da26
  m_cursorBrushType = QString::fromStdString(brushType);
manongjohn 75da26
  m_settings->setValue("cursorBrushType", m_cursorBrushType);
manongjohn 75da26
}
manongjohn 75da26
manongjohn 75da26
void Preferences::setCursorBrushStyle(std::string brushStyle) {
manongjohn 75da26
  m_cursorBrushStyle = QString::fromStdString(brushStyle);
manongjohn 75da26
  m_settings->setValue("cursorBrushStyle", m_cursorBrushStyle);
manongjohn 75da26
}
manongjohn 75da26
manongjohn 75da26
void Preferences::enableCursorOutline(bool on) {
manongjohn 75da26
  m_cursorOutlineEnabled = on;
manongjohn 75da26
  m_settings->setValue("cursorOutlineEnabled", on ? "1" : "0");
manongjohn 75da26
}
manongjohn a21b06
manongjohn a21b06
void Preferences::setCurrentColumnData(const TPixel ¤tColumnColor) {
manongjohn a21b06
  m_currentColumnColor = currentColumnColor;
manongjohn a21b06
  m_settings->setValue("currentColumnColor.r",
manongjohn a21b06
                       QString::number(currentColumnColor.r));
manongjohn a21b06
  m_settings->setValue("currentColumnColor.g",
manongjohn a21b06
                       QString::number(currentColumnColor.g));
manongjohn a21b06
  m_settings->setValue("currentColumnColor.b",
manongjohn a21b06
                       QString::number(currentColumnColor.b));
manongjohn a21b06
}
manongjohn c5bc8d
manongjohn c5bc8d
void Preferences::enableWinInk(bool on) {
manongjohn c5bc8d
  m_enableWinInk = on;
manongjohn c5bc8d
  m_settings->setValue("winInkEnabled", on ? "1" : "0");
manongjohn c5bc8d
}
shun-iwasawa 93fdd4
shun-iwasawa 93fdd4
void Preferences::setRasterBackgroundColor(const TPixel32 &color) {
shun-iwasawa 93fdd4
  m_rasterBackgroundColor = color;
shun-iwasawa 93fdd4
  TImageWriter::setBackgroundColor(m_rasterBackgroundColor);
shun-iwasawa 93fdd4
  m_settings->setValue("rasterBackgroundColor_R",
shun-iwasawa 93fdd4
                       QString::number((int)color.r));
shun-iwasawa 93fdd4
  m_settings->setValue("rasterBackgroundColor_G",
shun-iwasawa 93fdd4
                       QString::number((int)color.g));
shun-iwasawa 93fdd4
  m_settings->setValue("rasterBackgroundColor_B",
shun-iwasawa 93fdd4
                       QString::number((int)color.b));
shun-iwasawa 93fdd4
  m_settings->setValue("rasterBackgroundColor_M",
shun-iwasawa 93fdd4
                       QString::number((int)color.m));
shun-iwasawa 93fdd4
}