3024{
3025 connect(this->buttonBox(), SIGNAL(clicked(QAbstractButton*)),
this, SLOT(
slotButtonClicked(QAbstractButton*)));
3026
3027 if (page.has_value()) {
3028 PageDesc page_val = page.value();
3029 setCurrentPage(
getPage(page_val.page));
3031 }
3032
3033 int retval = exec();
3034 Q_UNUSED(retval);
3035
3037
3040
3043 cfg.setSeparateEraserCursor(
m_general->m_chkSeparateEraserCursor->isChecked());
3054
3057 cfg.setForceAlwaysFullSizedOutline(!
m_general->m_changeBrushOutline->isChecked());
3059 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
3155 cfg.setEnableCanvasSurfaceColorSpaceManagement(
3157 cfg.setCanvasSurfaceColorSpaceManagementMode(
3161 }
3163 if (cfg.useDefaultColorSpace())
3164 {
3166 cfg.setWorkingColorSpace(currentWorkingColorSpace.
id());
3169 }
3170
3171 cfg.writeEntry(
"ExrDefaultColorProfile",
m_colorSettings->
m_page->cmbColorProfileForEXR->currentText());
3172
3173 cfgImage.setDefaultProofingConfig(*
m_colorSettings->
m_page->wdgProofingOptions->currentProofingConfig());
3179
3180
3182 cfg.setUseRightMiddleTabletButtonWorkaround(
3184
3185#if defined Q_OS_WIN && (defined QT5_HAS_WINTAB_SWITCH || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
3187
3188# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
3189
3190 using QWindowsApplication = QNativeInterface::Private::QWindowsApplication;
3191 if (auto nativeWindowsApp = dynamic_cast<QWindowsApplication *>(QGuiApplicationPrivate::platformIntegration())) {
3192 nativeWindowsApp->setWinTabEnabled(!cfg.useWin8PointerInput());
3193 }
3194# endif
3195#endif
3196 cfg.writeEntry<
bool>(
"useTimestampsForBrushSpeed",
m_tabletSettings->
m_page->chkUseTimestampsForBrushSpeed->isChecked());
3197
3198#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_PAGE_UP_DOWN
3199 cfg.setUsePageUpDownMouseButtonEmulationWorkaround(
3201#endif
3202
3203#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_HIGH_FUNCTION_KEYS
3204 cfg.setUseHighFunctionKeyMouseButtonEmulationWorkaround(
3206#endif
3207
3208#if KRITA_QT_HAS_ANDROID_IGNORE_HISTORIC_TABLET_EVENTS
3209 cfg.setUseIgnoreHistoricTabletEventsWorkaround(
3211#endif
3212
3215
3216 cfg.writeEntry<
int>(
"tiltDirectionOffset", -
m_tabletSettings->
m_page->tiltDirectionOffsetAngle->angle());
3217
3219
3221 cfg.setCanvasState("TRY_OPENGL");
3222
3228 } else {
3230 }
3231
3234 }
3235
3236 cfg.setUseOpenGLTextureBuffer(
m_displaySettings->chkUseTextureBuffer->isChecked());
3238 cfg.setRootSurfaceFormat(&kritarc, indexToFormat(
m_displaySettings->cmbPreferedRootSurfaceFormat->currentIndex()));
3239 cfg.setAssistantsDrawMode(indexToAssistantDrawMode(
m_displaySettings->cmbAssistantsDrawMode->currentIndex()));
3240
3249 cfgImage.setSelectionOverlayMaskColor(c.
toQColor());
3250 cfgImage.setSelectionOutlineOpacity(
m_displaySettings->sldSelectionOutlineOpacity->value());
3252 cfg.setAntialiasSelectionOutline(
m_displaySettings->chkSelectionOutlineAntialiasing->isChecked());
3253 cfg.setShowSingleChannelAsColor(
m_displaySettings->chkChannelsAsColor->isChecked());
3255
3262
3263 cfg.setCursorMainColor(
m_general->cursorColorButton->color().toQColor());
3264 cfg.setEraserCursorMainColor(
m_general->eraserCursorColorButton->color().toQColor());
3265 cfg.setPixelGridColor(
m_displaySettings->pixelGridColorButton->color().toQColor());
3266 cfg.setPixelGridDrawingThreshold(
m_displaySettings->pixelGridDrawingThresholdBox->value() / 100);
3267
3270
3271 cfg.logImportantSettings();
3273 }
3274
3276}
QButtonGroup m_pasteBehaviourGroup
QPointer< QCheckBox > m_chkEnableCanvasColorSpaceManagement
QPointer< KisSqueezedComboBox > m_canvasSurfaceBitDepth
QPointer< KisSqueezedComboBox > m_canvasSurfaceColorSpace
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()
qreal colorSamplerZoomPreviewScale() const
bool colorSamplerPreviewCircleExtraCirclesEnabled() const
bool convertToImageColorspaceOnImport()
QButtonGroup m_pasteFormatGroup
OutlineStyle eraserOutlineStyle()
bool switchSelectionCtrlAlt()
int kineticScrollingSensitivity()
KisCumulativeUndoData m_cumulativeUndoData
bool showOutlineWhilePainting()
CursorStyle eraserCursorStyle()
KisConfig::IconsInMenu iconsInMenu() const
bool renameMergedLayers()
KisConfig::ColorSamplerPreviewCirclePosition colorSamplerPreviewCirclePosition() const
bool colorSamplerPreviewCircleOutlineEnabled() const
bool colorSamplerZoomPreviewEnabled() 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()