3028{
3029 connect(this->buttonBox(), SIGNAL(clicked(QAbstractButton*)),
this, SLOT(
slotButtonClicked(QAbstractButton*)));
3030
3031 if (page.has_value()) {
3032 PageDesc page_val = page.value();
3033 setCurrentPage(
getPage(page_val.page));
3035 }
3036
3037 int retval = exec();
3038 Q_UNUSED(retval);
3039
3041
3044
3047 cfg.setSeparateEraserCursor(
m_general->m_chkSeparateEraserCursor->isChecked());
3055
3058 cfg.setForceAlwaysFullSizedOutline(!
m_general->m_changeBrushOutline->isChecked());
3060 cfg.setForceAlwaysFullSizedEraserOutline(!
m_general->m_changeEraserBrushOutline->isChecked());
3063
3064 KConfigGroup group = KSharedConfig::openConfig()->group("File Dialogs");
3065 group.writeEntry(
"DontUseNativeFileDialog", !
m_general->m_chkNativeFileDialog->isChecked());
3066
3067 cfgImage.setMaxBrushSize(
m_general->intMaxBrushSize->value());
3068 cfg.setIgnoreHighFunctionKeys(
m_general->chkIgnoreHighFunctionKeys->isChecked());
3069
3070 cfg.writeEntry<
bool>(
"use_custom_system_font",
m_general->chkUseCustomFont->isChecked());
3071 if (
m_general->chkUseCustomFont->isChecked()) {
3072 cfg.writeEntry<QString>(
"custom_system_font",
m_general->cmbCustomFont->currentFont().family());
3073 cfg.writeEntry<
int>(
"custom_font_size",
m_general->intFontSize->value());
3074 }
3075 else {
3076 cfg.writeEntry<QString>("custom_system_font", "");
3077 cfg.writeEntry<int>("custom_font_size", -1);
3078 }
3079
3081 cfg.setMDIBackgroundColor(
m_general->m_mdiColor->color().toXML());
3082 cfg.setMDIBackgroundImage(
m_general->m_backgroundimage->text());
3083 cfg.writeEntry<
int>(
"mdi_rubberband",
m_general->m_chkRubberBand->isChecked());
3085 cfg.writeEntry(
"autosavefileshidden",
m_general->chkHideAutosaveFiles->isChecked());
3086
3087 cfg.setBackupFile(
m_general->m_backupFileCheckBox->isChecked());
3088 cfg.writeEntry(
"backupfilelocation",
m_general->cmbBackupFileLocation->currentIndex());
3089 cfg.writeEntry(
"backupfilesuffix",
m_general->txtBackupFileSuffix->text());
3090 cfg.writeEntry(
"numberofbackupfiles",
m_general->intNumBackupFiles->value());
3091
3092
3100
3101 const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
3102 QSettings kritarc(configPath + QStringLiteral("/kritadisplayrc"), QSettings::IniFormat);
3103 kritarc.setValue(
"EnableHiDPI",
m_general->m_chkHiDPI->isChecked());
3104#if defined(Q_OS_WIN) && defined(HAVE_HIGH_DPI_SCALE_FACTOR_ROUNDING_POLICY)
3105 kritarc.setValue(
"EnableHiDPIFractionalScaling",
m_general->m_chkHiDPIFractionalScaling->isChecked());
3106#endif
3107 kritarc.setValue(
"LogUsage",
m_general->chkUsageLogging->isChecked());
3108
3110
3111 cfg.writeEntry<
bool>(
"useCreamyAlphaDarken", (bool)!
m_general->cmbFlowMode->currentIndex());
3112 cfg.writeEntry<
bool>(
"useSubtractiveBlendingForCmykColorSpaces", (bool)!
m_general->cmbCmykBlendingMode->currentIndex());
3113
3120
3122
3125 cfg.writeEntry(
"useTouchPressureSensitivity",
m_general->chkTouchPressureSensitivity->isChecked());
3126 cfg.setActivateTransformToolAfterPaste(
m_general->chkEnableTransformToolAfterPaste->isChecked());
3127 cfg.setZoomHorizontal(
m_general->chkZoomHorizontally->isChecked());
3128 cfg.setSelectionActionBar(
m_general->chkEnableSelectionActionBar->isChecked());
3129
3132 cfg.setCumulativeUndoRedo(
m_general->chkCumulativeUndo->isChecked());
3134
3135
3139
3140#ifdef Q_OS_ANDROID
3141 QFileInfo fi(
m_general->m_resourceFolderSelector->currentData(Qt::UserRole).value<QString>());
3142#else
3143 QFileInfo fi(
m_general->m_urlResourceFolder->fileName());
3144#endif
3145 if (fi.isWritable()) {
3147 }
3148
3152
3153
3156 for (int i = 0; i < QApplication::screens().count(); ++i) {
3160 cfg.setMonitorForScreen(i, monitorid);
3161 } else {
3162 cfg.setMonitorProfile(i,
3165 }
3166 }
3167 } else {
3171 }
3173 if (cfg.useDefaultColorSpace())
3174 {
3176 cfg.setWorkingColorSpace(currentWorkingColorSpace.
id());
3179 }
3180
3181 cfg.writeEntry(
"ExrDefaultColorProfile",
m_colorSettings->
m_page->cmbColorProfileForEXR->currentText());
3182
3183 cfgImage.setDefaultProofingConfig(*
m_colorSettings->
m_page->wdgProofingOptions->currentProofingConfig());
3189
3190
3192 cfg.setUseRightMiddleTabletButtonWorkaround(
3194
3195#if defined Q_OS_WIN && (defined QT5_HAS_WINTAB_SWITCH || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
3197
3198# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
3199
3200 using QWindowsApplication = QNativeInterface::Private::QWindowsApplication;
3201 if (auto nativeWindowsApp = dynamic_cast<QWindowsApplication *>(QGuiApplicationPrivate::platformIntegration())) {
3202 nativeWindowsApp->setWinTabEnabled(!cfg.useWin8PointerInput());
3203 }
3204# endif
3205#endif
3206 cfg.writeEntry<
bool>(
"useTimestampsForBrushSpeed",
m_tabletSettings->
m_page->chkUseTimestampsForBrushSpeed->isChecked());
3207
3208#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_PAGE_UP_DOWN
3209 cfg.setUsePageUpDownMouseButtonEmulationWorkaround(
3211#endif
3212
3213#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_HIGH_FUNCTION_KEYS
3214 cfg.setUseHighFunctionKeyMouseButtonEmulationWorkaround(
3216#endif
3217
3218#if KRITA_QT_HAS_ANDROID_IGNORE_HISTORIC_TABLET_EVENTS
3219 cfg.setUseIgnoreHistoricTabletEventsWorkaround(
3221#endif
3222
3225
3226 cfg.writeEntry<
int>(
"tiltDirectionOffset", -
m_tabletSettings->
m_page->tiltDirectionOffsetAngle->angle());
3227
3229
3231 cfg.setCanvasState("TRY_OPENGL");
3232
3238 } else {
3240 }
3241
3244 }
3245
3246 cfg.setUseOpenGLTextureBuffer(
m_displaySettings->chkUseTextureBuffer->isChecked());
3248 cfg.setRootSurfaceFormat(&kritarc, indexToFormat(
m_displaySettings->cmbPreferedRootSurfaceFormat->currentIndex()));
3249 cfg.setAssistantsDrawMode(indexToAssistantDrawMode(
m_displaySettings->cmbAssistantsDrawMode->currentIndex()));
3250
3259 cfgImage.setSelectionOverlayMaskColor(c.
toQColor());
3260 cfgImage.setSelectionOutlineOpacity(
m_displaySettings->sldSelectionOutlineOpacity->value());
3262 cfg.setAntialiasSelectionOutline(
m_displaySettings->chkSelectionOutlineAntialiasing->isChecked());
3263 cfg.setShowSingleChannelAsColor(
m_displaySettings->chkChannelsAsColor->isChecked());
3265
3272
3273 cfg.setCursorMainColor(
m_general->cursorColorButton->color().toQColor());
3274 cfg.setEraserCursorMainColor(
m_general->eraserCursorColorButton->color().toQColor());
3275 cfg.setPixelGridColor(
m_displaySettings->pixelGridColorButton->color().toQColor());
3276 cfg.setPixelGridDrawingThreshold(
m_displaySettings->pixelGridDrawingThresholdBox->value() / 100);
3277
3280
3281 cfg.logImportantSettings();
3283 }
3284
3286}
QButtonGroup m_pasteBehaviourGroup
QPointer< QCheckBox > m_chkEnableCanvasColorSpaceManagement
QPointer< KisSqueezedComboBox > m_canvasSurfaceBitDepth
QPointer< KisSqueezedComboBox > m_canvasSurfaceColorSpace
QList< KisSqueezedComboBox * > m_monitorProfileWidgets
WdgColorSettings * m_page
KisConfig::SessionOnStartup sessionOnStartup() const
bool kineticScrollingHiddenScrollbars()
bool renameDuplicatedLayers()
bool showCanvasMessages()
bool saveSessionOnQuit() const
int colorSamplerPreviewCircleDiameter() const
bool autoZoomTimelineToPlaybackRange()
bool renamePastedLayers()
KisConfig::ColorSamplerPreviewStyle colorSamplerPreviewStyle() const
bool kineticScrollingEnabled()
bool toolOptionsInDocker()
bool colorSamplerPreviewCircleExtraCirclesEnabled() const
bool convertToImageColorspaceOnImport()
QButtonGroup m_pasteFormatGroup
OutlineStyle eraserOutlineStyle()
bool switchSelectionCtrlAlt()
int kineticScrollingSensitivity()
KisCumulativeUndoData m_cumulativeUndoData
bool showOutlineWhilePainting()
CursorStyle eraserCursorStyle()
bool renameMergedLayers()
bool colorSamplerPreviewCircleOutlineEnabled() const
bool adaptivePlaybackRange()
OutlineStyle outlineStyle()
bool autopinLayersToTimeline()
bool showEraserOutlineWhilePainting()
CursorStyle cursorStyle()
int kineticScrollingGesture()
qreal colorSamplerPreviewCircleThickness() const
CanvasSurfaceBitDepthMode
KPageWidgetItem * getPage(Page page_enum)
void slotButtonClicked(QAbstractButton *button)
void switchTab(PageDesc tab)
void setRenameDuplicatedLayers(bool value)
void setRenameMergedLayers(bool value)
static std::optional< XcbGLProviderProtocol > xcbGlProviderProtocol()
static void setUserPreferredOpenGLRendererConfig(OpenGLRenderer renderer)
static const QString resourceLocationKey
void setOpacity(quint8 alpha)
void toQColor(QColor *c) const
a convenience method for the above.
WdgTabletSettings * m_page
int toInt(const QString &str, bool *ok=nullptr)
static KoColorSpaceRegistry * instance()
KoID colorSpaceColorDepthId(const QString &_colorSpaceId) const
KoID colorSpaceColorModelId(const QString &_colorSpaceId) const