Krita Source Code Documentation
Loading...
Searching...
No Matches
GeneralTab Class Reference

#include <kis_dlg_preferences.h>

+ Inheritance diagram for GeneralTab:

Public Member Functions

bool adaptivePlaybackRange ()
 
bool autopinLayersToTimeline ()
 
int autoSaveInterval ()
 
bool autoZoomTimelineToPlaybackRange ()
 
int colorSamplerPreviewCircleDiameter () const
 
bool colorSamplerPreviewCircleExtraCirclesEnabled () const
 
bool colorSamplerPreviewCircleOutlineEnabled () const
 
qreal colorSamplerPreviewCircleThickness () const
 
KisConfig::ColorSamplerPreviewStyle colorSamplerPreviewStyle () const
 
bool compressKra ()
 
bool convertToImageColorspaceOnImport ()
 
CursorStyle cursorStyle ()
 
CursorStyle eraserCursorStyle ()
 
OutlineStyle eraserOutlineStyle ()
 
QString exportMimeType ()
 
int forcedFontDpi ()
 
 GeneralTab (QWidget *parent=0, const char *name=0)
 
bool kineticScrollingEnabled ()
 
int kineticScrollingGesture ()
 
bool kineticScrollingHiddenScrollbars ()
 
int kineticScrollingSensitivity ()
 
bool longPressEnabled ()
 
int mdiMode ()
 
OutlineStyle outlineStyle ()
 
bool renameDuplicatedLayers ()
 
bool renameMergedLayers ()
 
bool renamePastedLayers ()
 
bool saveSessionOnQuit () const
 
KisConfig::SessionOnStartup sessionOnStartup () const
 
void setDefault ()
 
bool showCanvasMessages ()
 
bool showEraserOutlineWhilePainting ()
 
bool showOutlineWhilePainting ()
 
bool showRootLayer ()
 
bool switchSelectionCtrlAlt ()
 
bool toolOptionsInDocker ()
 
bool trimFramesImport ()
 
bool trimKra ()
 
int undoStackSize ()
 
bool useZip64 ()
 
int zoomMarginSize ()
 
int zoomSteps ()
 
- Public Member Functions inherited from WdgGeneralSettings
 WdgGeneralSettings (QWidget *parent, const char *name)
 

Static Public Member Functions

static KisConfig::ColorSamplerPreviewStyle getColorSamplerPreviewStyleValue (const QComboBox *cmb)
 
static void setColorSamplerPreviewStyleIndexByValue (QComboBox *cmb, KisConfig::ColorSamplerPreviewStyle style)
 
static void setColorSamplerPreviewStyleItems (QComboBox *cmb)
 

Public Attributes

KisCumulativeUndoData m_cumulativeUndoData
 
QButtonGroup m_pasteFormatGroup
 

Private Slots

void checkResourcePath ()
 
void clearBackgroundImage ()
 
void colorSamplePreviewOutlineEnabledChanged (int value)
 
void colorSamplePreviewSizeChanged (int value)
 
void colorSamplePreviewStyleChanged (int index)
 
void colorSamplePreviewThicknessChanged (qreal value)
 
void enableSubWindowOptions (int)
 
void getBackgroundImage ()
 
static void setButtonGroupEnabled (const QButtonGroup &buttonGroup, bool value)
 
void showAdvancedCumulativeUndoSettings ()
 
void updateTouchPressureSensitivityEnabled (int)
 

Detailed Description

Definition at line 59 of file kis_dlg_preferences.h.

Constructor & Destructor Documentation

◆ GeneralTab()

GeneralTab::GeneralTab ( QWidget * parent = 0,
const char * name = 0 )

Definition at line 235 of file kis_dlg_preferences.cc.

236 : WdgGeneralSettings(_parent, _name)
237{
238 KisConfig cfg(true);
239
240 // HACK ALERT!
241 // QScrollArea contents are opaque at multiple levels
242 // The contents themselves AND the viewport widget
243 {
244 scrollAreaWidgetContents->setAutoFillBackground(false);
245 scrollAreaWidgetContents->parentWidget()->setAutoFillBackground(false);
246 }
247
248 //
249 // Cursor Tab
250 //
251
252 QStringList cursorItems = QStringList()
253 << i18n("No Cursor")
254 << i18n("Tool Icon")
255 << i18n("Arrow")
256 << i18n("Small Circle")
257 << i18n("Crosshair")
258 << i18n("Triangle Righthanded")
259 << i18n("Triangle Lefthanded")
260 << i18n("Black Pixel")
261 << i18n("White Pixel");
262
263 QStringList outlineItems = QStringList()
264 << i18nc("Display options label to not DISPLAY brush outline", "No Outline")
265 << i18n("Circle Outline")
266 << i18n("Preview Outline")
267 << i18n("Tilt Outline");
268
269 // brush
270
271 m_cmbCursorShape->addItems(cursorItems);
272
273 m_cmbCursorShape->setCurrentIndex(cfg.newCursorStyle());
274
275 m_cmbOutlineShape->addItems(outlineItems);
276
277 m_cmbOutlineShape->setCurrentIndex(cfg.newOutlineStyle());
278
279 m_showOutlinePainting->setChecked(cfg.showOutlineWhilePainting());
280 m_changeBrushOutline->setChecked(!cfg.forceAlwaysFullSizedOutline());
281
282 KoColor cursorColor(KoColorSpaceRegistry::instance()->rgb8());
283 cursorColor.fromQColor(cfg.getCursorMainColor());
284 cursorColorButton->setColor(cursorColor);
285
286 // eraser
287
288 m_chkSeparateEraserCursor->setChecked(cfg.separateEraserCursor());
289
290 m_cmbEraserCursorShape->addItems(cursorItems);
291 m_cmbEraserCursorShape->addItem(i18n("Eraser"));
292
293 m_cmbEraserCursorShape->setCurrentIndex(cfg.eraserCursorStyle());
294
295 m_cmbEraserOutlineShape->addItems(outlineItems);
296
297 m_cmbEraserOutlineShape->setCurrentIndex(cfg.eraserOutlineStyle());
298
299 m_showEraserOutlinePainting->setChecked(cfg.showEraserOutlineWhilePainting());
300 m_changeEraserBrushOutline->setChecked(!cfg.forceAlwaysFullSizedEraserOutline());
301
302 KoColor eraserCursorColor(KoColorSpaceRegistry::instance()->rgb8());
303 eraserCursorColor.fromQColor(cfg.getEraserCursorMainColor());
304 eraserCursorColorButton->setColor(eraserCursorColor);
305
306 // Color sampler
307
308 setColorSamplerPreviewStyleItems(m_cmbColorSamplerPreviewStyle);
309 setColorSamplerPreviewStyleIndexByValue(m_cmbColorSamplerPreviewStyle, cfg.colorSamplerPreviewStyle());
310 connect(m_cmbColorSamplerPreviewStyle,
311 QOverload<int>::of(&QComboBox::currentIndexChanged),
312 this,
314 colorSamplePreviewStyleChanged(m_cmbColorSamplerPreviewStyle->currentIndex());
315
316 m_nmbColorSamplerPreviewSize->setRange(1, 400);
317 m_nmbColorSamplerPreviewSize->setValue(cfg.colorSamplerPreviewCircleDiameter());
318 m_lblColorSamplerPreviewSizePreview->setDiameter(cfg.colorSamplerPreviewCircleDiameter());
319 connect(m_nmbColorSamplerPreviewSize,SIGNAL(valueChanged(int)), SLOT(colorSamplePreviewSizeChanged(int)));
320
321 m_ssbColorSamplerPreviewThickness->setRange(1, 50);
322 m_ssbColorSamplerPreviewThickness->setValue(cfg.colorSamplerPreviewCircleThickness());
323 m_lblColorSamplerPreviewSizePreview->setThickness(cfg.colorSamplerPreviewCircleThickness()/100.0);
324 connect(m_ssbColorSamplerPreviewThickness,SIGNAL(valueChanged(qreal)), SLOT(colorSamplePreviewThicknessChanged(qreal)));
325
326 m_chkColorSamplerPreviewOutlineEnabled->setChecked(cfg.colorSamplerPreviewCircleOutlineEnabled());
327 m_lblColorSamplerPreviewSizePreview->setOutlineEnabled(cfg.colorSamplerPreviewCircleOutlineEnabled());
328 connect(m_chkColorSamplerPreviewOutlineEnabled,SIGNAL(stateChanged(int)), SLOT(colorSamplePreviewOutlineEnabledChanged(int)));
329
330 m_chkColorSamplerPreviewExtraCircles->setChecked(cfg.colorSamplerPreviewCircleExtraCirclesEnabled());
331
332
333 KisSpinBoxI18nHelper::setText(m_ssbColorSamplerPreviewThickness, i18nc("{n} is the number value, % is the percent sign", "{n}%"));
334
335
336
337
338
339
340
341
342 //
343 // Window Tab
344 //
345 chkUseCustomFont->setChecked(cfg.readEntry<bool>("use_custom_system_font", false));
346 cmbCustomFont->findChild <QComboBox*>("stylesComboBox")->setVisible(false);
347
348 QString fontName = cfg.readEntry<QString>("custom_system_font", "");
349 if (fontName.isEmpty()) {
350 cmbCustomFont->setCurrentFont(qApp->font());
351
352 }
353 else {
354 int pointSize = qApp->font().pointSize();
355 cmbCustomFont->setCurrentFont(QFont(fontName, pointSize));
356 }
357 int fontSize = cfg.readEntry<int>("custom_font_size", -1);
358 if (fontSize < 0) {
359 intFontSize->setValue(qApp->font().pointSize());
360 }
361 else {
362 intFontSize->setValue(fontSize);
363 }
364
365 m_cmbMDIType->setCurrentIndex(cfg.readEntry<int>("mdi_viewmode", (int)QMdiArea::TabbedView));
366 enableSubWindowOptions(m_cmbMDIType->currentIndex());
367 connect(m_cmbMDIType, SIGNAL(currentIndexChanged(int)), SLOT(enableSubWindowOptions(int)));
368
369 m_backgroundimage->setText(cfg.getMDIBackgroundImage());
370 connect(m_bnFileName, SIGNAL(clicked()), SLOT(getBackgroundImage()));
371 connect(clearBgImageButton, SIGNAL(clicked()), SLOT(clearBackgroundImage()));
372
373 QString xml = cfg.getMDIBackgroundColor();
374 KoColor mdiColor = KoColor::fromXML(xml);
375 m_mdiColor->setColor(mdiColor);
376
377 m_chkRubberBand->setChecked(cfg.readEntry<int>("mdi_rubberband", cfg.useOpenGL()));
378
379 m_chkCanvasMessages->setChecked(cfg.showCanvasMessages());
380
381 const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
382 QSettings kritarc(configPath + QStringLiteral("/kritadisplayrc"), QSettings::IniFormat);
383 m_chkHiDPI->setChecked(kritarc.value("EnableHiDPI", true).toBool());
384#if defined(Q_OS_WIN) && defined(HAVE_HIGH_DPI_SCALE_FACTOR_ROUNDING_POLICY)
385 m_chkHiDPIFractionalScaling->setChecked(kritarc.value("EnableHiDPIFractionalScaling", false).toBool());
386#else
387 m_wdgHiDPIFractionalScaling->setEnabled(false);
388#endif
389 chkUsageLogging->setChecked(kritarc.value("LogUsage", true).toBool());
390
391
392 //
393 // Tools tab
394 //
395 m_radioToolOptionsInDocker->setChecked(cfg.toolOptionsInDocker());
396 cmbFlowMode->setCurrentIndex((int)!cfg.readEntry<bool>("useCreamyAlphaDarken", true));
397 cmbCmykBlendingMode->setCurrentIndex((int)!cfg.readEntry<bool>("useSubtractiveBlendingForCmykColorSpaces", true));
398 m_chkSwitchSelectionCtrlAlt->setChecked(cfg.switchSelectionCtrlAlt());
399 cmbTouchPainting->addItem(
400 KoPointerEvent::tabletInputReceived() ? i18nc("touch painting", "Auto (Disabled)")
401 : i18nc("touch painting", "Auto (Enabled)"));
402 cmbTouchPainting->addItem(i18nc("touch painting", "Enabled"));
403 cmbTouchPainting->addItem(i18nc("touch painting", "Disabled"));
404 cmbTouchPainting->setCurrentIndex(int(cfg.touchPainting()));
405 chkTouchPressureSensitivity->setChecked(cfg.readEntry("useTouchPressureSensitivity", true));
406 connect(cmbTouchPainting, SIGNAL(currentIndexChanged(int)),
408 updateTouchPressureSensitivityEnabled(cmbTouchPainting->currentIndex());
409
410 chkEnableTransformToolAfterPaste->setChecked(cfg.activateTransformToolAfterPaste());
411 chkZoomHorizontally->setChecked(cfg.zoomHorizontal());
412
413 chkEnableLongPress->setChecked(cfg.longPressEnabled());
414
415 m_groupBoxKineticScrollingSettings->setChecked(cfg.kineticScrollingEnabled());
416
417 m_cmbKineticScrollingGesture->addItem(i18n("On Touch Drag"));
418 m_cmbKineticScrollingGesture->addItem(i18n("On Click Drag"));
419 m_cmbKineticScrollingGesture->addItem(i18n("On Middle-Click Drag"));
420 //m_cmbKineticScrollingGesture->addItem(i18n("On Right Click Drag"));
421
422 spnZoomSteps->setValue(cfg.zoomSteps());
423
424
425 m_cmbKineticScrollingGesture->setCurrentIndex(cfg.kineticScrollingGesture());
426 m_kineticScrollingSensitivitySlider->setRange(0, 100);
427 m_kineticScrollingSensitivitySlider->setValue(cfg.kineticScrollingSensitivity());
428 m_chkKineticScrollingHideScrollbars->setChecked(cfg.kineticScrollingHiddenScrollbars());
429
430 intZoomMarginSize->setValue(cfg.zoomMarginSize());
431
432 bool sapEnabled = cfg.selectionActionBar();
433
434 chkEnableSelectionActionBar->setChecked(sapEnabled);
435
436 //
437 // File handling
438 //
439 int autosaveInterval = cfg.autoSaveInterval();
440 //convert to minutes
441 m_autosaveSpinBox->setValue(autosaveInterval / 60);
442 m_autosaveCheckBox->setChecked(autosaveInterval > 0);
443 chkHideAutosaveFiles->setChecked(cfg.readEntry<bool>("autosavefileshidden", true));
444
445 m_chkCompressKra->setChecked(cfg.compressKra());
446 chkZip64->setChecked(cfg.useZip64());
447 m_chkTrimKra->setChecked(cfg.trimKra());
448 m_chkTrimFramesImport->setChecked(cfg.trimFramesImport());
449
450 m_backupFileCheckBox->setChecked(cfg.backupFile());
451 cmbBackupFileLocation->setCurrentIndex(cfg.readEntry<int>("backupfilelocation", 0));
452 txtBackupFileSuffix->setText(cfg.readEntry<QString>("backupfilesuffix", "~"));
453 QValidator *validator = new BackupSuffixValidator(txtBackupFileSuffix);
454 txtBackupFileSuffix->setValidator(validator);
455 intNumBackupFiles->setValue(cfg.readEntry<int>("numberofbackupfiles", 1));
456
457 cmbDefaultExportFileType->clear();
459
460 QMap<QString, QString> mimeTypeMap;
461
462 foreach (const QString &mimeType, mimeFilter) {
463 QString description = KisMimeDatabase::descriptionForMimeType(mimeType);
464 mimeTypeMap.insert(description, mimeType);
465 }
466
467 // Sort after we get the description because mimeType values have image, application, etc... in front
468 QStringList sortedDescriptions = mimeTypeMap.keys();
469 sortedDescriptions.sort(Qt::CaseInsensitive);
470
471 cmbDefaultExportFileType->addItem(i18n("All Supported Files"), "all/mime");
472 foreach (const QString &description, sortedDescriptions) {
473 const QString &mimeType = mimeTypeMap.value(description);
474 cmbDefaultExportFileType->addItem(description, mimeType);
475 }
476
477 const QString mimeTypeToFind = cfg.exportMimeType(false).toUtf8();
478 const int index = cmbDefaultExportFileType->findData(mimeTypeToFind);
479
480 if (index >= 0) {
481 cmbDefaultExportFileType->setCurrentIndex(index);
482 } else {
483 // Index can't be found, default set to image/png
484 const QString defaultMimeType = "image/png";
485 const int defaultIndex = cmbDefaultExportFileType->findData(defaultMimeType);
486 if (defaultIndex >= 0) {
487 cmbDefaultExportFileType->setCurrentIndex(defaultIndex);
488 } else {
489 // Case where the default mime type is also not found in the combo box
490 qDebug() << "Default mime type not found in the combo box.";
491 }
492 }
493
494 QString selectedMimeType = cmbDefaultExportFileType->currentData().toString();
495
496 //
497 // Animation tab
498 //
499 m_chkAutoPin->setChecked(cfg.autoPinLayersToTimeline());
500 m_chkAdaptivePlaybackRange->setChecked(cfg.adaptivePlaybackRange());
501 m_chkAutoZoom->setChecked(cfg.autoZoomTimelineToPlaybackRange());
502
503 //
504 // Miscellaneous tab
505 //
506 cmbStartupSession->addItem(i18n("Open default window"));
507 cmbStartupSession->addItem(i18n("Load previous session"));
508 cmbStartupSession->addItem(i18n("Show session manager"));
509 cmbStartupSession->setCurrentIndex(cfg.sessionOnStartup());
510
511 chkSaveSessionOnQuit->setChecked(cfg.saveSessionOnQuit(false));
512
513 m_chkConvertOnImport->setChecked(cfg.convertToImageColorspaceOnImport());
514
515 m_undoStackSize->setValue(cfg.undoStackLimit());
516 chkCumulativeUndo->setChecked(cfg.useCumulativeUndoRedo());
517 connect(chkCumulativeUndo, SIGNAL(toggled(bool)), btnAdvancedCumulativeUndo, SLOT(setEnabled(bool)));
518 btnAdvancedCumulativeUndo->setEnabled(chkCumulativeUndo->isChecked());
519 connect(btnAdvancedCumulativeUndo, SIGNAL(clicked()), SLOT(showAdvancedCumulativeUndoSettings()));
520 m_cumulativeUndoData = cfg.cumulativeUndoData();
521
522 chkShowRootLayer->setChecked(cfg.showRootLayer());
523
524 chkRenameMergedLayers->setChecked(KisImageConfig(true).renameMergedLayers());
525 chkRenamePastedLayers->setChecked(cfg.renamePastedLayers());
526 chkRenameDuplicatedLayers->setChecked(KisImageConfig(true).renameDuplicatedLayers());
527
528 KConfigGroup group = KSharedConfig::openConfig()->group("File Dialogs");
529 bool dontUseNative = true;
530#ifdef Q_OS_ANDROID
531 dontUseNative = false;
532#endif
533#ifdef Q_OS_UNIX
534 if (qgetenv("XDG_CURRENT_DESKTOP") == "KDE") {
535 dontUseNative = false;
536 }
537#endif
538#ifdef Q_OS_MACOS
539 dontUseNative = false;
540#endif
541#ifdef Q_OS_WIN
542 dontUseNative = false;
543#endif
544 m_chkNativeFileDialog->setChecked(!group.readEntry("DontUseNativeFileDialog", dontUseNative));
545
546 if (!qEnvironmentVariable("APPIMAGE").isEmpty()) {
547 // AppImages don't have access to platform plugins. BUG: 447805
548 // Setting the checkbox to false is
549 m_chkNativeFileDialog->setChecked(false);
550 m_chkNativeFileDialog->setEnabled(false);
551 }
552
553 intMaxBrushSize->setValue(KisImageConfig(true).maxBrushSize());
554 chkIgnoreHighFunctionKeys->setChecked(cfg.ignoreHighFunctionKeys());
555#ifndef Q_OS_WIN
556 // we properly support ignoring high F-keys on Windows only. To support on other platforms
557 // we should synchronize KisExtendedModifiersMatcher to ignore the keys as well.
558 chkIgnoreHighFunctionKeys->setVisible(false);
559#endif
560
561 //
562 // Resources
563 //
564 m_urlResourceFolder->setMode(KoFileDialog::OpenDirectory);
565 m_urlResourceFolder->setConfigurationName("resource_directory");
566 const QString resourceLocation = KoResourcePaths::getAppDataLocation();
567 if (QFileInfo(resourceLocation).isWritable()) {
568 m_urlResourceFolder->setFileName(resourceLocation);
569 }
570 else {
571 m_urlResourceFolder->setFileName(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
572 }
573 QValidator *writableValidator = new WritableLocationValidator(m_urlResourceFolder);
574 m_urlResourceFolder->setValidator(writableValidator);
575 connect(m_urlResourceFolder, SIGNAL(textChanged(QString)), SLOT(checkResourcePath()));
577
578 grpRestartMessage->setPixmap(
579 grpRestartMessage->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
580 grpRestartMessage->setText(i18n("You will need to Restart Krita for the changes to take an effect."));
581
582 grpAndroidWarningMessage->setVisible(false);
583 grpAndroidWarningMessage->setPixmap(
584 grpAndroidWarningMessage->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
585 grpAndroidWarningMessage->setText(
586 i18n("Saving at a Location picked from the File Picker may slow down the startup!"));
587
588#ifdef Q_OS_ANDROID
589 m_urlResourceFolder->setVisible(false);
590
591 m_resourceFolderSelector->setVisible(true);
592 m_resourceFolderSelector->installEventFilter(new UnscrollableComboBox(this));
593
594 const QList<QPair<QString, QString>> writableLocations = []() {
595 QList<QPair<QString, QString>> writableLocationsAndText;
596 // filters out the duplicates
597 const QList<QString> locations = []() {
598 QStringList filteredLocations;
599 const QStringList locations = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation);
600 Q_FOREACH(const QString &location, locations) {
601 if (!filteredLocations.contains(location)) {
602 filteredLocations.append(location);
603 }
604 }
605 return filteredLocations;
606 }();
607
608 bool isFirst = true;
609
610 Q_FOREACH (QString location, locations) {
611 QString text;
612 QFileInfo fileLocation(location);
613 // The first one that we get from is the "Default"
614 if (isFirst) {
615 text = i18n("Default");
616 isFirst = false;
617 } else if (location.startsWith("/data")) {
618 text = i18n("Internal Storage");
619 } else {
620 text = i18n("SD-Card");
621 }
622 if (fileLocation.isWritable()) {
623 writableLocationsAndText.append({text, location});
624 }
625 }
626 return writableLocationsAndText;
627 }();
628
629 for (auto it = writableLocations.constBegin(); it != writableLocations.constEnd(); ++it) {
630 m_resourceFolderSelector->addItem(it->first + " - " + it->second);
631 // we need it to extract out the path
632 m_resourceFolderSelector->setItemData(m_resourceFolderSelector->count() - 1, it->second, Qt::UserRole);
633 }
634
635 // if the user has selected a custom location, we add it to the list as well.
636 if (resourceLocation.startsWith("content://")) {
637 m_resourceFolderSelector->addItem(resourceLocation);
638 int index = m_resourceFolderSelector->count() - 1;
639 m_resourceFolderSelector->setItemData(index, resourceLocation, Qt::UserRole);
640 m_resourceFolderSelector->setCurrentIndex(index);
641 grpAndroidWarningMessage->setVisible(true);
642 } else {
643 // find the index of the current resource location in the writableLocation, so we can set our view to that
644 auto iterator = std::find_if(writableLocations.constBegin(),
645 writableLocations.constEnd(),
646 [&resourceLocation](QPair<QString, QString> location) {
647 return location.second == resourceLocation;
648 });
649
650 if (iterator != writableLocations.constEnd()) {
651 int index = writableLocations.indexOf(*iterator);
652 KIS_SAFE_ASSERT_RECOVER_NOOP(index < m_resourceFolderSelector->count());
653 m_resourceFolderSelector->setCurrentIndex(index);
654 }
655 }
656
657 // this should be the last item we add.
658 m_resourceFolderSelector->addItem(i18n("Choose Manually"));
659
660 connect(m_resourceFolderSelector, qOverload<int>(&QComboBox::activated), [this](int index) {
661 const int previousIndex = m_resourceFolderSelector->currentIndex();
662
663 // if it is the last item in the last item, then open file picker and set the name returned as the filename
664 if (m_resourceFolderSelector->count() - 1 == index) {
665 KoFileDialog dialog(this, KoFileDialog::OpenDirectory, "Select Directory");
666 const QString selectedDirectory = dialog.filename();
667
668 if (!selectedDirectory.isEmpty()) {
669 // if the index above "Choose Manually" is a content Uri, then we just modify it, and then set that as
670 // the index.
671 if (m_resourceFolderSelector->itemData(index - 1, Qt::DisplayRole)
672 .value<QString>()
673 .startsWith("content://")) {
674 m_resourceFolderSelector->setItemText(index - 1, selectedDirectory);
675 m_resourceFolderSelector->setItemData(index - 1, selectedDirectory, Qt::UserRole);
676 m_resourceFolderSelector->setCurrentIndex(index - 1);
677 } else {
678 // There isn't any content Uri in the ComboBox list, so just insert one, and set that as the index.
679 m_resourceFolderSelector->insertItem(index, selectedDirectory);
680 m_resourceFolderSelector->setItemData(index, selectedDirectory, Qt::UserRole);
681 m_resourceFolderSelector->setCurrentIndex(index);
682 }
683 // since we have selected the custom location, make the warning visible.
684 grpAndroidWarningMessage->setVisible(true);
685 } else {
686 m_resourceFolderSelector->setCurrentIndex(previousIndex);
687 }
688 }
689
690 // hide-unhide based on the selection of user.
691 grpAndroidWarningMessage->setVisible(
692 m_resourceFolderSelector->currentData(Qt::UserRole).value<QString>().startsWith("content://"));
693 });
694
695#else
696 m_resourceFolderSelector->setVisible(false);
697#endif
698
699 grpWindowsAppData->setVisible(false);
700#ifdef Q_OS_WIN
701 QString folderInStandardAppData;
702 QString folderInPrivateAppData;
703 KoResourcePaths::getAllUserResourceFoldersLocationsForWindowsStore(folderInStandardAppData, folderInPrivateAppData);
704
705 if (!folderInPrivateAppData.isEmpty()) {
706 const auto pathToDisplay = [](const QString &path) {
707 // Due to how Unicode word wrapping works, the string does not
708 // wrap after backslashes in Qt 5.12. We don't want the path to
709 // become too long, so we add a U+200B ZERO WIDTH SPACE to allow
710 // wrapping. The downside is that we cannot let the user select
711 // and copy the path because it now contains invisible unicode
712 // code points.
713 // See: https://bugreports.qt.io/browse/QTBUG-80892
714 return QDir::toNativeSeparators(path).replace(QChar('\\'), QStringLiteral(u"\\\u200B"));
715 };
716
717 const QDir privateResourceDir(folderInPrivateAppData);
718 const QDir appDataDir(folderInStandardAppData);
719 grpWindowsAppData->setPixmap(
720 grpWindowsAppData->style()->standardIcon(QStyle::SP_MessageBoxInformation).pixmap(QSize(32, 32)));
721 // Similar text is also used in KisViewManager.cpp
722 grpWindowsAppData->setText(i18nc("@info resource folder",
723 "<p>You are using the Microsoft Store package version of Krita. "
724 "Even though Krita can be configured to place resources under the "
725 "user AppData location, Windows may actually store the files "
726 "inside a private app location.</p>\n"
727 "<p>You should check both locations to determine where "
728 "the files are located.</p>\n"
729 "<p><b>User AppData</b> (<a href=\"copyuser\">Copy</a>):<br/>\n"
730 "%1</p>\n"
731 "<p><b>Private app location</b> (<a href=\"copyprivate\">Copy</a>):<br/>\n"
732 "%2</p>",
733 pathToDisplay(appDataDir.absolutePath()),
734 pathToDisplay(privateResourceDir.absolutePath())));
735 grpWindowsAppData->setVisible(true);
736
737 connect(grpWindowsAppData,
739 [userPath = appDataDir.absolutePath(),
740 privatePath = privateResourceDir.absolutePath()](const QString &link) {
741 if (link == QStringLiteral("copyuser")) {
742 qApp->clipboard()->setText(QDir::toNativeSeparators(userPath));
743 } else if (link == QStringLiteral("copyprivate")) {
744 qApp->clipboard()->setText(QDir::toNativeSeparators(privatePath));
745 } else {
746 qWarning() << "Unexpected link activated in lblWindowsAppDataNote:" << link;
747 }
748 });
749 }
750#endif
751
752
753 const int forcedFontDPI = cfg.readEntry("forcedDpiForQtFontBugWorkaround", -1);
754 chkForcedFontDPI->setChecked(forcedFontDPI > 0);
755 intForcedFontDPI->setValue(forcedFontDPI > 0 ? forcedFontDPI : qt_defaultDpi());
756 intForcedFontDPI->setEnabled(forcedFontDPI > 0);
757 connect(chkForcedFontDPI, SIGNAL(toggled(bool)), intForcedFontDPI, SLOT(setEnabled(bool)));
758
763
764 QAbstractButton *button = m_pasteFormatGroup.button(cfg.pasteFormat(false));
765
766 Q_ASSERT(button);
767
768 if (button) {
769 button->setChecked(true);
770 }
771}
qreal u
QList< QString > QStringList
Q_GUI_EXPORT int qt_defaultDpi()
void showAdvancedCumulativeUndoSettings()
void colorSamplePreviewThicknessChanged(qreal value)
void colorSamplePreviewOutlineEnabledChanged(int value)
void colorSamplePreviewStyleChanged(int index)
QButtonGroup m_pasteFormatGroup
void colorSamplePreviewSizeChanged(int value)
KisCumulativeUndoData m_cumulativeUndoData
void updateTouchPressureSensitivityEnabled(int)
static void setColorSamplerPreviewStyleItems(QComboBox *cmb)
static void setColorSamplerPreviewStyleIndexByValue(QComboBox *cmb, KisConfig::ColorSamplerPreviewStyle style)
void enableSubWindowOptions(int)
static QStringList supportedMimeTypes(Direction direction)
static QString descriptionForMimeType(const QString &mimeType)
Find the user-readable description for the given mimetype.
static KoColor fromXML(const QDomElement &elt, const QString &channelDepthId)
Definition KoColor.cpp:350
static bool tabletInputReceived()
static void getAllUserResourceFoldersLocationsForWindowsStore(QString &standardLocation, QString &privateLocation)
getAllAppDataLocationsForWindowsStore Use this to get both private and general appdata folders which ...
static QString getAppDataLocation()
WdgGeneralSettings(QWidget *parent, const char *name)
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:130
QString button(const QWheelEvent &ev)
void setText(QSpinBox *spinBox, const QStringView textTemplate)
void linkActivated(const QString &link)
static KoColorSpaceRegistry * instance()

References KisConfig::activateTransformToolAfterPaste(), KisConfig::adaptivePlaybackRange(), KisConfig::autoPinLayersToTimeline(), KisConfig::autoSaveInterval(), KisConfig::autoZoomTimelineToPlaybackRange(), KisConfig::backupFile(), checkResourcePath(), clearBackgroundImage(), colorSamplePreviewOutlineEnabledChanged(), colorSamplePreviewSizeChanged(), colorSamplePreviewStyleChanged(), colorSamplePreviewThicknessChanged(), KisConfig::colorSamplerPreviewCircleDiameter(), KisConfig::colorSamplerPreviewCircleExtraCirclesEnabled(), KisConfig::colorSamplerPreviewCircleOutlineEnabled(), KisConfig::colorSamplerPreviewCircleThickness(), KisConfig::colorSamplerPreviewStyle(), KisConfig::compressKra(), KisConfig::convertToImageColorspaceOnImport(), KisConfig::cumulativeUndoData(), KisMimeDatabase::descriptionForMimeType(), enableSubWindowOptions(), KisConfig::eraserCursorStyle(), KisConfig::eraserOutlineStyle(), KisImportExportManager::Export, KisConfig::exportMimeType(), KisConfig::forceAlwaysFullSizedEraserOutline(), KisConfig::forceAlwaysFullSizedOutline(), KoColor::fromQColor(), KoColor::fromXML(), KoResourcePaths::getAppDataLocation(), getBackgroundImage(), KisConfig::getCursorMainColor(), KisConfig::getEraserCursorMainColor(), KisConfig::getMDIBackgroundColor(), KisConfig::getMDIBackgroundImage(), KisConfig::ignoreHighFunctionKeys(), KoColorSpaceRegistry::instance(), KisConfig::kineticScrollingEnabled(), KisConfig::kineticScrollingGesture(), KisConfig::kineticScrollingHiddenScrollbars(), KisConfig::kineticScrollingSensitivity(), KIS_SAFE_ASSERT_RECOVER_NOOP, KisConfig::longPressEnabled(), m_cumulativeUndoData, KisConfig::newCursorStyle(), KisConfig::newOutlineStyle(), KoFileDialog::OpenDirectory, KisConfig::readEntry(), renameDuplicatedLayers(), renameMergedLayers(), KisConfig::renamePastedLayers(), KisConfig::saveSessionOnQuit(), KisConfig::selectionActionBar(), KisConfig::separateEraserCursor(), KisConfig::sessionOnStartup(), setColorSamplerPreviewStyleIndexByValue(), setColorSamplerPreviewStyleItems(), KisSpinBoxI18nHelper::setText(), showAdvancedCumulativeUndoSettings(), KisConfig::showCanvasMessages(), KisConfig::showEraserOutlineWhilePainting(), KisConfig::showOutlineWhilePainting(), KisConfig::showRootLayer(), KisImportExportManager::supportedMimeTypes(), KisConfig::switchSelectionCtrlAlt(), KoPointerEvent::tabletInputReceived(), KisConfig::toolOptionsInDocker(), KisConfig::touchPainting(), KisConfig::trimFramesImport(), KisConfig::trimKra(), KisConfig::undoStackLimit(), updateTouchPressureSensitivityEnabled(), KisConfig::useCumulativeUndoRedo(), KisConfig::useOpenGL(), KisConfig::useZip64(), KisConfig::zoomHorizontal(), KisConfig::zoomMarginSize(), and KisConfig::zoomSteps().

Member Function Documentation

◆ adaptivePlaybackRange()

bool GeneralTab::adaptivePlaybackRange ( )

Definition at line 1096 of file kis_dlg_preferences.cc.

1097{
1098 return m_chkAdaptivePlaybackRange->isChecked();
1099}

◆ autopinLayersToTimeline()

bool GeneralTab::autopinLayersToTimeline ( )

Definition at line 1091 of file kis_dlg_preferences.cc.

1092{
1093 return m_chkAutoPin->isChecked();
1094}

◆ autoSaveInterval()

int GeneralTab::autoSaveInterval ( )

Definition at line 985 of file kis_dlg_preferences.cc.

986{
987 //convert to seconds
988 return m_autosaveCheckBox->isChecked() ? m_autosaveSpinBox->value() * 60 : 0;
989}

◆ autoZoomTimelineToPlaybackRange()

bool GeneralTab::autoZoomTimelineToPlaybackRange ( )

Definition at line 1101 of file kis_dlg_preferences.cc.

1102{
1103 return m_chkAutoZoom->isChecked();
1104}

◆ checkResourcePath

void GeneralTab::checkResourcePath ( )
privateslot

Definition at line 1176 of file kis_dlg_preferences.cc.

1177{
1178 const QFileInfo fi(m_urlResourceFolder->fileName());
1179 if (!fi.isWritable()) {
1180 grpNonWritableLocation->setPixmap(
1181 grpNonWritableLocation->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
1182 grpNonWritableLocation->setText(
1183 i18nc("@info resource folder", "<b>Warning:</b> this location is not writable."));
1184 grpNonWritableLocation->setVisible(true);
1185 } else {
1186 grpNonWritableLocation->setVisible(false);
1187 }
1188}

◆ clearBackgroundImage

void GeneralTab::clearBackgroundImage ( )
privateslot

Definition at line 1170 of file kis_dlg_preferences.cc.

1171{
1172 // clearing the background image text will implicitly make the background color be used
1173 m_backgroundimage->setText("");
1174}

◆ colorSamplePreviewOutlineEnabledChanged

void GeneralTab::colorSamplePreviewOutlineEnabledChanged ( int value)
privateslot

Definition at line 910 of file kis_dlg_preferences.cc.

911{
912 m_lblColorSamplerPreviewSizePreview->setOutlineEnabled(value);
913}
float value(const T *src, size_t ch)

References value().

◆ colorSamplePreviewSizeChanged

void GeneralTab::colorSamplePreviewSizeChanged ( int value)
privateslot

Definition at line 900 of file kis_dlg_preferences.cc.

901{
902 m_lblColorSamplerPreviewSizePreview->setDiameter(value);
903}

References value().

◆ colorSamplePreviewStyleChanged

void GeneralTab::colorSamplePreviewStyleChanged ( int index)
privateslot

Definition at line 894 of file kis_dlg_preferences.cc.

895{
896 bool circleSettingsVisible = index == int(KisConfig::ColorSamplerPreviewStyle::Circle);
897 m_frmColorSamplerCircleSettings->setVisible(circleSettingsVisible);
898}

References KisConfig::Circle.

◆ colorSamplePreviewThicknessChanged

void GeneralTab::colorSamplePreviewThicknessChanged ( qreal value)
privateslot

Definition at line 905 of file kis_dlg_preferences.cc.

906{
907 m_lblColorSamplerPreviewSizePreview->setThickness(value/100.0);
908}

References value().

◆ colorSamplerPreviewCircleDiameter()

int GeneralTab::colorSamplerPreviewCircleDiameter ( ) const

Definition at line 949 of file kis_dlg_preferences.cc.

950{
951 return m_nmbColorSamplerPreviewSize->value();
952}

◆ colorSamplerPreviewCircleExtraCirclesEnabled()

bool GeneralTab::colorSamplerPreviewCircleExtraCirclesEnabled ( ) const

Definition at line 964 of file kis_dlg_preferences.cc.

965{
966 return m_chkColorSamplerPreviewExtraCircles->isChecked();
967}

◆ colorSamplerPreviewCircleOutlineEnabled()

bool GeneralTab::colorSamplerPreviewCircleOutlineEnabled ( ) const

Definition at line 959 of file kis_dlg_preferences.cc.

960{
961 return m_chkColorSamplerPreviewOutlineEnabled->isChecked();
962}

◆ colorSamplerPreviewCircleThickness()

qreal GeneralTab::colorSamplerPreviewCircleThickness ( ) const

Definition at line 954 of file kis_dlg_preferences.cc.

955{
956 return m_ssbColorSamplerPreviewThickness->value();
957}

◆ colorSamplerPreviewStyle()

KisConfig::ColorSamplerPreviewStyle GeneralTab::colorSamplerPreviewStyle ( ) const

Definition at line 944 of file kis_dlg_preferences.cc.

945{
946 return getColorSamplerPreviewStyleValue(m_cmbColorSamplerPreviewStyle);
947}
static KisConfig::ColorSamplerPreviewStyle getColorSamplerPreviewStyleValue(const QComboBox *cmb)

References getColorSamplerPreviewStyleValue().

◆ compressKra()

bool GeneralTab::compressKra ( )

Definition at line 1016 of file kis_dlg_preferences.cc.

1017{
1018 return m_chkCompressKra->isChecked();
1019}

◆ convertToImageColorspaceOnImport()

bool GeneralTab::convertToImageColorspaceOnImport ( )

Definition at line 1086 of file kis_dlg_preferences.cc.

1087{
1088 return m_chkConvertOnImport->isChecked();
1089}

◆ cursorStyle()

CursorStyle GeneralTab::cursorStyle ( )

Definition at line 924 of file kis_dlg_preferences.cc.

925{
926 return (CursorStyle)m_cmbCursorShape->currentIndex();
927}
CursorStyle
Definition kis_global.h:62

◆ enableSubWindowOptions

void GeneralTab::enableSubWindowOptions ( int mdi_mode)
privateslot

Definition at line 1190 of file kis_dlg_preferences.cc.

1191{
1192 group_subWinMode->setEnabled(mdi_mode == QMdiArea::SubWindowView);
1193}

◆ eraserCursorStyle()

CursorStyle GeneralTab::eraserCursorStyle ( )

Definition at line 934 of file kis_dlg_preferences.cc.

935{
936 return (CursorStyle)m_cmbEraserCursorShape->currentIndex();
937}

◆ eraserOutlineStyle()

OutlineStyle GeneralTab::eraserOutlineStyle ( )

Definition at line 939 of file kis_dlg_preferences.cc.

940{
941 return (OutlineStyle)m_cmbEraserOutlineShape->currentIndex();
942}
OutlineStyle
Definition kis_global.h:53

◆ exportMimeType()

QString GeneralTab::exportMimeType ( )

Definition at line 1031 of file kis_dlg_preferences.cc.

1032{
1033 return cmbDefaultExportFileType->currentData().toString();
1034}

◆ forcedFontDpi()

int GeneralTab::forcedFontDpi ( )

Definition at line 1106 of file kis_dlg_preferences.cc.

1107{
1108 return chkForcedFontDPI->isChecked() ? intForcedFontDPI->value() : -1;
1109}

◆ getBackgroundImage

void GeneralTab::getBackgroundImage ( )
privateslot

Definition at line 1148 of file kis_dlg_preferences.cc.

1149{
1150 KoFileDialog dialog(this, KoFileDialog::OpenFile, "BackgroundImages");
1151 dialog.setCaption(i18n("Select a Background Image"));
1152 dialog.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
1153 dialog.setImageFilters();
1154
1155 QString fn = dialog.filename();
1156 // dialog box was canceled or somehow no file was selected
1157 if (fn.isEmpty()) {
1158 return;
1159 }
1160
1161 QImage image(fn);
1162 if (image.isNull()) {
1163 QMessageBox::warning(this, i18nc("@title:window", "Krita"), i18n("%1 is not a valid image file!", fn));
1164 }
1165 else {
1166 m_backgroundimage->setText(fn);
1167 }
1168}

References KoFileDialog::OpenFile.

◆ getColorSamplerPreviewStyleValue()

KisConfig::ColorSamplerPreviewStyle GeneralTab::getColorSamplerPreviewStyleValue ( const QComboBox * cmb)
static

Definition at line 1128 of file kis_dlg_preferences.cc.

1129{
1130 return KisConfig::ColorSamplerPreviewStyle(cmb->currentIndex());
1131}
ColorSamplerPreviewStyle
Definition kis_config.h:138

◆ kineticScrollingEnabled()

bool GeneralTab::kineticScrollingEnabled ( )

Definition at line 1056 of file kis_dlg_preferences.cc.

1057{
1058 return m_groupBoxKineticScrollingSettings->isChecked();
1059}

◆ kineticScrollingGesture()

int GeneralTab::kineticScrollingGesture ( )

Definition at line 1061 of file kis_dlg_preferences.cc.

1062{
1063 return m_cmbKineticScrollingGesture->currentIndex();
1064}

◆ kineticScrollingHiddenScrollbars()

bool GeneralTab::kineticScrollingHiddenScrollbars ( )

Definition at line 1071 of file kis_dlg_preferences.cc.

1072{
1073 return m_chkKineticScrollingHideScrollbars->isChecked();
1074}

◆ kineticScrollingSensitivity()

int GeneralTab::kineticScrollingSensitivity ( )

Definition at line 1066 of file kis_dlg_preferences.cc.

1067{
1068 return m_kineticScrollingSensitivitySlider->value();
1069}

◆ longPressEnabled()

bool GeneralTab::longPressEnabled ( )

Definition at line 1051 of file kis_dlg_preferences.cc.

1052{
1053 return chkEnableLongPress->isChecked();
1054}

◆ mdiMode()

int GeneralTab::mdiMode ( )

Definition at line 1006 of file kis_dlg_preferences.cc.

1007{
1008 return m_cmbMDIType->currentIndex();
1009}

◆ outlineStyle()

OutlineStyle GeneralTab::outlineStyle ( )

Definition at line 929 of file kis_dlg_preferences.cc.

930{
931 return (OutlineStyle)m_cmbOutlineShape->currentIndex();
932}

◆ renameDuplicatedLayers()

bool GeneralTab::renameDuplicatedLayers ( )

Definition at line 1143 of file kis_dlg_preferences.cc.

1144{
1145 return chkRenameDuplicatedLayers->isChecked();
1146}

◆ renameMergedLayers()

bool GeneralTab::renameMergedLayers ( )

Definition at line 1133 of file kis_dlg_preferences.cc.

1134{
1135 return chkRenameMergedLayers->isChecked();
1136}

◆ renamePastedLayers()

bool GeneralTab::renamePastedLayers ( )

Definition at line 1138 of file kis_dlg_preferences.cc.

1139{
1140 return chkRenamePastedLayers->isChecked();
1141}

◆ saveSessionOnQuit()

bool GeneralTab::saveSessionOnQuit ( ) const

Definition at line 975 of file kis_dlg_preferences.cc.

976{
977 return chkSaveSessionOnQuit->isChecked();
978}

◆ sessionOnStartup()

KisConfig::SessionOnStartup GeneralTab::sessionOnStartup ( ) const

Definition at line 970 of file kis_dlg_preferences.cc.

971{
972 return (KisConfig::SessionOnStartup)cmbStartupSession->currentIndex();
973}

◆ setButtonGroupEnabled

void GeneralTab::setButtonGroupEnabled ( const QButtonGroup & buttonGroup,
bool value )
staticprivateslot

Definition at line 915 of file kis_dlg_preferences.cc.

916{
917 Q_FOREACH(QAbstractButton* button, buttonGroup.buttons()) {
918 if (button) {
919 button->setEnabled(value);
920 }
921 }
922}

References button(), and value().

◆ setColorSamplerPreviewStyleIndexByValue()

void GeneralTab::setColorSamplerPreviewStyleIndexByValue ( QComboBox * cmb,
KisConfig::ColorSamplerPreviewStyle style )
static

Definition at line 1123 of file kis_dlg_preferences.cc.

1124{
1125 cmb->setCurrentIndex(int(style));
1126}

◆ setColorSamplerPreviewStyleItems()

void GeneralTab::setColorSamplerPreviewStyleItems ( QComboBox * cmb)
static

Definition at line 1111 of file kis_dlg_preferences.cc.

1112{
1113 // Order is synchronized with KisConfig::ColorSamplerPreviewStyle.
1114 cmb->addItems({
1115 i18nc("Preview option for no color sampler", "None"),
1116 i18nc("Preview option for a circular/ring-shaped color sampler", "Circle"),
1117 i18nc("Preview option for a rectangular color sampler left of the cursor", "Rectangle Left"),
1118 i18nc("Preview option for a rectangular color sampler right of the cursor", "Rectangle Right"),
1119 i18nc("Preview option for a rectangular color sampler above the cursor", "Rectangle Above"),
1120 });
1121}

◆ setDefault()

void GeneralTab::setDefault ( )

Definition at line 773 of file kis_dlg_preferences.cc.

774{
775 KisConfig cfg(true);
776
777 m_cmbCursorShape->setCurrentIndex(cfg.newCursorStyle(true));
778 m_cmbOutlineShape->setCurrentIndex(cfg.newOutlineStyle(true));
779 m_chkSeparateEraserCursor->setChecked(cfg.readEntry<bool>("separateEraserCursor", false));
780 m_cmbEraserCursorShape->setCurrentIndex(cfg.eraserCursorStyle(true));
781 m_cmbEraserOutlineShape->setCurrentIndex(cfg.eraserOutlineStyle(true));
782 setColorSamplerPreviewStyleIndexByValue(m_cmbColorSamplerPreviewStyle, cfg.colorSamplerPreviewStyle(true));
783 m_ssbColorSamplerPreviewThickness->setValue(cfg.colorSamplerPreviewCircleThickness(true));
784 m_nmbColorSamplerPreviewSize->setValue(cfg.colorSamplerPreviewCircleDiameter(true));
785 m_chkColorSamplerPreviewOutlineEnabled->setChecked(cfg.colorSamplerPreviewCircleOutlineEnabled(true));
786
787
788 chkShowRootLayer->setChecked(cfg.showRootLayer(true));
789 m_autosaveCheckBox->setChecked(cfg.autoSaveInterval(true) > 0);
790 //convert to minutes
791 m_autosaveSpinBox->setValue(cfg.autoSaveInterval(true) / 60);
792 chkHideAutosaveFiles->setChecked(true);
793
794 m_undoStackSize->setValue(cfg.undoStackLimit(true));
795 chkCumulativeUndo->setChecked(cfg.useCumulativeUndoRedo(true));
796 m_cumulativeUndoData = cfg.cumulativeUndoData(true);
797
798 m_backupFileCheckBox->setChecked(cfg.backupFile(true));
799 cmbBackupFileLocation->setCurrentIndex(0);
800 txtBackupFileSuffix->setText("~");
801 intNumBackupFiles->setValue(1);
802
803 m_showOutlinePainting->setChecked(cfg.showOutlineWhilePainting(true));
804 m_changeBrushOutline->setChecked(!cfg.forceAlwaysFullSizedOutline(true));
805 m_showEraserOutlinePainting->setChecked(cfg.showEraserOutlineWhilePainting(true));
806 m_changeEraserBrushOutline->setChecked(!cfg.forceAlwaysFullSizedEraserOutline(true));
807
808#if defined Q_OS_ANDROID || defined Q_OS_MACOS || defined Q_OS_WIN
809 m_chkNativeFileDialog->setChecked(true);
810#else
811 m_chkNativeFileDialog->setChecked(false);
812#endif
813
814 intMaxBrushSize->setValue(1000);
815
816 chkIgnoreHighFunctionKeys->setChecked(cfg.ignoreHighFunctionKeys(true));
817
818
819 chkUseCustomFont->setChecked(false);
820 cmbCustomFont->setCurrentFont(qApp->font());
821 intFontSize->setValue(qApp->font().pointSize());
822
823
824 m_cmbMDIType->setCurrentIndex((int)QMdiArea::TabbedView);
825 m_chkRubberBand->setChecked(cfg.useOpenGL(true));
826 KoColor mdiColor;
827 mdiColor.fromXML(cfg.getMDIBackgroundColor(true));
828 m_mdiColor->setColor(mdiColor);
829 m_backgroundimage->setText(cfg.getMDIBackgroundImage(true));
830 m_chkCanvasMessages->setChecked(cfg.showCanvasMessages(true));
831 m_chkCompressKra->setChecked(cfg.compressKra(true));
832 m_chkTrimKra->setChecked(cfg.trimKra(true));
833 m_chkTrimFramesImport->setChecked(cfg.trimFramesImport(true));
834 chkZip64->setChecked(cfg.useZip64(true));
835 m_chkHiDPI->setChecked(true);
836#if defined(Q_OS_WIN) && defined(HAVE_HIGH_DPI_SCALE_FACTOR_ROUNDING_POLICY)
837 m_chkHiDPIFractionalScaling->setChecked(true);
838#endif
839 chkUsageLogging->setChecked(true);
840 m_radioToolOptionsInDocker->setChecked(cfg.toolOptionsInDocker(true));
841 cmbFlowMode->setCurrentIndex(0);
842 chkEnableLongPress->setChecked(cfg.longPressEnabled(true));
843 m_groupBoxKineticScrollingSettings->setChecked(cfg.kineticScrollingEnabled(true));
844 m_cmbKineticScrollingGesture->setCurrentIndex(cfg.kineticScrollingGesture(true));
845 spnZoomSteps->setValue(cfg.zoomSteps(true));
846 m_kineticScrollingSensitivitySlider->setValue(cfg.kineticScrollingSensitivity(true));
847 m_chkKineticScrollingHideScrollbars->setChecked(cfg.kineticScrollingHiddenScrollbars(true));
848 intZoomMarginSize->setValue(cfg.zoomMarginSize(true));
849 m_chkSwitchSelectionCtrlAlt->setChecked(cfg.switchSelectionCtrlAlt(true));
850 cmbTouchPainting->setCurrentIndex(int(cfg.touchPainting(true)));
851 chkTouchPressureSensitivity->setChecked(true);
852 chkEnableTransformToolAfterPaste->setChecked(cfg.activateTransformToolAfterPaste(true));
853 chkZoomHorizontally->setChecked(cfg.zoomHorizontal(true));
854 m_chkConvertOnImport->setChecked(cfg.convertToImageColorspaceOnImport(true));
855
856 KoColor cursorColor(KoColorSpaceRegistry::instance()->rgb8());
857 cursorColor.fromQColor(cfg.getCursorMainColor(true));
858 cursorColorButton->setColor(cursorColor);
859
860 KoColor eraserCursorColor(KoColorSpaceRegistry::instance()->rgb8());
861 eraserCursorColor.fromQColor(cfg.getEraserCursorMainColor(true));
862 eraserCursorColorButton->setColor(eraserCursorColor);
863
864
865 m_chkAutoPin->setChecked(cfg.autoPinLayersToTimeline(true));
866 m_chkAdaptivePlaybackRange->setChecked(cfg.adaptivePlaybackRange(false));
867
868 m_urlResourceFolder->setFileName(KoResourcePaths::getAppDataLocation());
869
870 chkForcedFontDPI->setChecked(false);
871 intForcedFontDPI->setValue(qt_defaultDpi());
872 intForcedFontDPI->setEnabled(false);
873
874 chkRenameMergedLayers->setChecked(KisImageConfig(true).renameMergedLayers(true));
875 chkRenamePastedLayers->setChecked(cfg.renamePastedLayers(true));
876 chkRenameDuplicatedLayers->setChecked(KisImageConfig(true).renameDuplicatedLayers(true));
877
878 QAbstractButton *button = m_pasteFormatGroup.button(cfg.pasteFormat(true));
879 Q_ASSERT(button);
880
881 if (button) {
882 button->setChecked(true);
883 }
884}
void setColor(const quint8 *data, const KoColorSpace *colorSpace=0)
Definition KoColor.cpp:186

References KisConfig::activateTransformToolAfterPaste(), KisConfig::adaptivePlaybackRange(), KisConfig::autoPinLayersToTimeline(), KisConfig::autoSaveInterval(), KisConfig::backupFile(), button(), KisConfig::colorSamplerPreviewCircleDiameter(), KisConfig::colorSamplerPreviewCircleOutlineEnabled(), KisConfig::colorSamplerPreviewCircleThickness(), KisConfig::colorSamplerPreviewStyle(), KisConfig::compressKra(), KisConfig::convertToImageColorspaceOnImport(), KisConfig::cumulativeUndoData(), KisConfig::eraserCursorStyle(), KisConfig::eraserOutlineStyle(), KisConfig::forceAlwaysFullSizedEraserOutline(), KisConfig::forceAlwaysFullSizedOutline(), KoColor::fromQColor(), KoColor::fromXML(), KoResourcePaths::getAppDataLocation(), KisConfig::getCursorMainColor(), KisConfig::getEraserCursorMainColor(), KisConfig::getMDIBackgroundColor(), KisConfig::getMDIBackgroundImage(), KisConfig::ignoreHighFunctionKeys(), KoColorSpaceRegistry::instance(), KisConfig::kineticScrollingEnabled(), KisConfig::kineticScrollingGesture(), KisConfig::kineticScrollingHiddenScrollbars(), KisConfig::kineticScrollingSensitivity(), KisConfig::longPressEnabled(), m_cumulativeUndoData, m_pasteFormatGroup, KisConfig::newCursorStyle(), KisConfig::newOutlineStyle(), KisConfig::pasteFormat(), qt_defaultDpi(), KisConfig::readEntry(), renameDuplicatedLayers(), renameMergedLayers(), KisConfig::renamePastedLayers(), KoColor::setColor(), setColorSamplerPreviewStyleIndexByValue(), KisConfig::showCanvasMessages(), KisConfig::showEraserOutlineWhilePainting(), KisConfig::showOutlineWhilePainting(), KisConfig::showRootLayer(), KisConfig::switchSelectionCtrlAlt(), KisConfig::toolOptionsInDocker(), KisConfig::touchPainting(), KisConfig::trimFramesImport(), KisConfig::trimKra(), KisConfig::undoStackLimit(), KisConfig::useCumulativeUndoRedo(), KisConfig::useOpenGL(), KisConfig::useZip64(), KisConfig::zoomHorizontal(), KisConfig::zoomMarginSize(), and KisConfig::zoomSteps().

◆ showAdvancedCumulativeUndoSettings

void GeneralTab::showAdvancedCumulativeUndoSettings ( )
privateslot

Definition at line 886 of file kis_dlg_preferences.cc.

887{
888 KisDlgConfigureCumulativeUndo dlg(m_cumulativeUndoData, m_undoStackSize->value(), this);
889 if (dlg.exec() == KoDialog::Accepted) {
890 m_cumulativeUndoData = dlg.cumulativeUndoData();
891 }
892}

References KisDlgConfigureCumulativeUndo::cumulativeUndoData(), and m_cumulativeUndoData.

◆ showCanvasMessages()

bool GeneralTab::showCanvasMessages ( )

Definition at line 1011 of file kis_dlg_preferences.cc.

1012{
1013 return m_chkCanvasMessages->isChecked();
1014}

◆ showEraserOutlineWhilePainting()

bool GeneralTab::showEraserOutlineWhilePainting ( )

Definition at line 1001 of file kis_dlg_preferences.cc.

1002{
1003 return m_showEraserOutlinePainting->isChecked();
1004}

◆ showOutlineWhilePainting()

bool GeneralTab::showOutlineWhilePainting ( )

Definition at line 996 of file kis_dlg_preferences.cc.

997{
998 return m_showOutlinePainting->isChecked();
999}

◆ showRootLayer()

bool GeneralTab::showRootLayer ( )

Definition at line 980 of file kis_dlg_preferences.cc.

981{
982 return chkShowRootLayer->isChecked();
983}

◆ switchSelectionCtrlAlt()

bool GeneralTab::switchSelectionCtrlAlt ( )

Definition at line 1081 of file kis_dlg_preferences.cc.

1082{
1083 return m_chkSwitchSelectionCtrlAlt->isChecked();
1084}

◆ toolOptionsInDocker()

bool GeneralTab::toolOptionsInDocker ( )

Definition at line 1041 of file kis_dlg_preferences.cc.

1042{
1043 return m_radioToolOptionsInDocker->isChecked();
1044}

◆ trimFramesImport()

bool GeneralTab::trimFramesImport ( )

Definition at line 1026 of file kis_dlg_preferences.cc.

1027{
1028 return m_chkTrimFramesImport->isChecked();
1029}

◆ trimKra()

bool GeneralTab::trimKra ( )

Definition at line 1021 of file kis_dlg_preferences.cc.

1022{
1023 return m_chkTrimKra->isChecked();
1024}

◆ undoStackSize()

int GeneralTab::undoStackSize ( )

Definition at line 991 of file kis_dlg_preferences.cc.

992{
993 return m_undoStackSize->value();
994}

◆ updateTouchPressureSensitivityEnabled

void GeneralTab::updateTouchPressureSensitivityEnabled ( int touchPainting)
privateslot

Definition at line 1195 of file kis_dlg_preferences.cc.

1196{
1197 chkTouchPressureSensitivity->setEnabled(touchPainting != int(KisConfig::TOUCH_PAINTING_DISABLED));
1198}
@ TOUCH_PAINTING_DISABLED
Definition kis_config.h:50

References KisConfig::TOUCH_PAINTING_DISABLED.

◆ useZip64()

bool GeneralTab::useZip64 ( )

Definition at line 1036 of file kis_dlg_preferences.cc.

1037{
1038 return chkZip64->isChecked();
1039}

◆ zoomMarginSize()

int GeneralTab::zoomMarginSize ( )

Definition at line 1076 of file kis_dlg_preferences.cc.

1077{
1078 return intZoomMarginSize->value();
1079}

◆ zoomSteps()

int GeneralTab::zoomSteps ( )

Definition at line 1046 of file kis_dlg_preferences.cc.

1047{
1048 return spnZoomSteps->value();
1049}

Member Data Documentation

◆ m_cumulativeUndoData

KisCumulativeUndoData GeneralTab::m_cumulativeUndoData

Definition at line 135 of file kis_dlg_preferences.h.

◆ m_pasteFormatGroup

QButtonGroup GeneralTab::m_pasteFormatGroup

Definition at line 134 of file kis_dlg_preferences.h.


The documentation for this class was generated from the following files: