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
 
KisConfig::ColorSamplerPreviewCirclePosition colorSamplerPreviewCirclePosition () const
 
qreal colorSamplerPreviewCircleThickness () const
 
KisConfig::ColorSamplerPreviewStyle colorSamplerPreviewStyle () const
 
bool colorSamplerZoomPreviewEnabled () const
 
qreal colorSamplerZoomPreviewScale () const
 
bool compressKra ()
 
bool convertToImageColorspaceOnImport ()
 
CursorStyle cursorStyle ()
 
CursorStyle eraserCursorStyle ()
 
OutlineStyle eraserOutlineStyle ()
 
QString exportMimeType ()
 
int forcedFontDpi ()
 
 GeneralTab (QWidget *parent=0, const char *name=0)
 
KisConfig::IconsInMenu iconsInMenu () const
 
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 234 of file kis_dlg_preferences.cc.

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

1136{
1137 return m_chkAdaptivePlaybackRange->isChecked();
1138}

◆ autopinLayersToTimeline()

bool GeneralTab::autopinLayersToTimeline ( )

Definition at line 1130 of file kis_dlg_preferences.cc.

1131{
1132 return m_chkAutoPin->isChecked();
1133}

◆ autoSaveInterval()

int GeneralTab::autoSaveInterval ( )

Definition at line 1024 of file kis_dlg_preferences.cc.

1025{
1026 //convert to seconds
1027 return m_autosaveCheckBox->isChecked() ? m_autosaveSpinBox->value() * 60 : 0;
1028}

◆ autoZoomTimelineToPlaybackRange()

bool GeneralTab::autoZoomTimelineToPlaybackRange ( )

Definition at line 1140 of file kis_dlg_preferences.cc.

1141{
1142 return m_chkAutoZoom->isChecked();
1143}

◆ checkResourcePath

void GeneralTab::checkResourcePath ( )
privateslot

Definition at line 1215 of file kis_dlg_preferences.cc.

1216{
1217 const QFileInfo fi(m_urlResourceFolder->fileName());
1218 if (!fi.isWritable()) {
1219 grpNonWritableLocation->setPixmap(
1220 grpNonWritableLocation->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
1221 grpNonWritableLocation->setText(
1222 i18nc("@info resource folder", "<b>Warning:</b> this location is not writable."));
1223 grpNonWritableLocation->setVisible(true);
1224 } else {
1225 grpNonWritableLocation->setVisible(false);
1226 }
1227}

◆ clearBackgroundImage

void GeneralTab::clearBackgroundImage ( )
privateslot

Definition at line 1209 of file kis_dlg_preferences.cc.

1210{
1211 // clearing the background image text will implicitly make the background color be used
1212 m_backgroundimage->setText("");
1213}

◆ colorSamplePreviewOutlineEnabledChanged

void GeneralTab::colorSamplePreviewOutlineEnabledChanged ( int value)
privateslot

Definition at line 929 of file kis_dlg_preferences.cc.

930{
931 m_lblColorSamplerPreviewSizePreview->setOutlineEnabled(value);
932}
float value(const T *src, size_t ch)

References value().

◆ colorSamplePreviewSizeChanged

void GeneralTab::colorSamplePreviewSizeChanged ( int value)
privateslot

Definition at line 919 of file kis_dlg_preferences.cc.

920{
921 m_lblColorSamplerPreviewSizePreview->setDiameter(value);
922}

References value().

◆ colorSamplePreviewStyleChanged

void GeneralTab::colorSamplePreviewStyleChanged ( int index)
privateslot

Definition at line 913 of file kis_dlg_preferences.cc.

914{
915 bool circleSettingsVisible = index == int(KisConfig::ColorSamplerPreviewStyle::Circle);
916 m_frmColorSamplerCircleSettings->setVisible(circleSettingsVisible);
917}

References KisConfig::Circle.

◆ colorSamplePreviewThicknessChanged

void GeneralTab::colorSamplePreviewThicknessChanged ( qreal value)
privateslot

Definition at line 924 of file kis_dlg_preferences.cc.

925{
926 m_lblColorSamplerPreviewSizePreview->setThickness(value/100.0);
927}

References value().

◆ colorSamplerPreviewCircleDiameter()

int GeneralTab::colorSamplerPreviewCircleDiameter ( ) const

Definition at line 968 of file kis_dlg_preferences.cc.

969{
970 return m_nmbColorSamplerPreviewSize->value();
971}

◆ colorSamplerPreviewCircleExtraCirclesEnabled()

bool GeneralTab::colorSamplerPreviewCircleExtraCirclesEnabled ( ) const

Definition at line 983 of file kis_dlg_preferences.cc.

984{
985 return m_chkColorSamplerPreviewExtraCircles->isChecked();
986}

◆ colorSamplerPreviewCircleOutlineEnabled()

bool GeneralTab::colorSamplerPreviewCircleOutlineEnabled ( ) const

Definition at line 978 of file kis_dlg_preferences.cc.

979{
980 return m_chkColorSamplerPreviewOutlineEnabled->isChecked();
981}

◆ colorSamplerPreviewCirclePosition()

KisConfig::ColorSamplerPreviewCirclePosition GeneralTab::colorSamplerPreviewCirclePosition ( ) const

Definition at line 998 of file kis_dlg_preferences.cc.

999{
1000 int index = m_cmbColorSamplerPreviewCirclePosition->currentIndex();
1002}
ColorSamplerPreviewCirclePosition
Definition kis_config.h:168

◆ colorSamplerPreviewCircleThickness()

qreal GeneralTab::colorSamplerPreviewCircleThickness ( ) const

Definition at line 973 of file kis_dlg_preferences.cc.

974{
975 return m_ssbColorSamplerPreviewThickness->value();
976}

◆ colorSamplerPreviewStyle()

KisConfig::ColorSamplerPreviewStyle GeneralTab::colorSamplerPreviewStyle ( ) const

Definition at line 963 of file kis_dlg_preferences.cc.

964{
965 return getColorSamplerPreviewStyleValue(m_cmbColorSamplerPreviewStyle);
966}
static KisConfig::ColorSamplerPreviewStyle getColorSamplerPreviewStyleValue(const QComboBox *cmb)

References getColorSamplerPreviewStyleValue().

◆ colorSamplerZoomPreviewEnabled()

bool GeneralTab::colorSamplerZoomPreviewEnabled ( ) const

Definition at line 993 of file kis_dlg_preferences.cc.

994{
995 return m_grpColorSamplerZoomPreview->isChecked();
996}

◆ colorSamplerZoomPreviewScale()

qreal GeneralTab::colorSamplerZoomPreviewScale ( ) const

Definition at line 988 of file kis_dlg_preferences.cc.

989{
990 return m_ssbColorSamplerZoomPreviewScale->value();
991}

◆ compressKra()

bool GeneralTab::compressKra ( )

Definition at line 1055 of file kis_dlg_preferences.cc.

1056{
1057 return m_chkCompressKra->isChecked();
1058}

◆ convertToImageColorspaceOnImport()

bool GeneralTab::convertToImageColorspaceOnImport ( )

Definition at line 1125 of file kis_dlg_preferences.cc.

1126{
1127 return m_chkConvertOnImport->isChecked();
1128}

◆ cursorStyle()

CursorStyle GeneralTab::cursorStyle ( )

Definition at line 943 of file kis_dlg_preferences.cc.

944{
945 return (CursorStyle)m_cmbCursorShape->currentIndex();
946}
CursorStyle
Definition kis_global.h:62

◆ enableSubWindowOptions

void GeneralTab::enableSubWindowOptions ( int mdi_mode)
privateslot

Definition at line 1229 of file kis_dlg_preferences.cc.

1230{
1231 group_subWinMode->setEnabled(mdi_mode == QMdiArea::SubWindowView);
1232}

◆ eraserCursorStyle()

CursorStyle GeneralTab::eraserCursorStyle ( )

Definition at line 953 of file kis_dlg_preferences.cc.

954{
955 return (CursorStyle)m_cmbEraserCursorShape->currentIndex();
956}

◆ eraserOutlineStyle()

OutlineStyle GeneralTab::eraserOutlineStyle ( )

Definition at line 958 of file kis_dlg_preferences.cc.

959{
960 return (OutlineStyle)m_cmbEraserOutlineShape->currentIndex();
961}
OutlineStyle
Definition kis_global.h:53

◆ exportMimeType()

QString GeneralTab::exportMimeType ( )

Definition at line 1070 of file kis_dlg_preferences.cc.

1071{
1072 return cmbDefaultExportFileType->currentData().toString();
1073}

◆ forcedFontDpi()

int GeneralTab::forcedFontDpi ( )

Definition at line 1145 of file kis_dlg_preferences.cc.

1146{
1147 return chkForcedFontDPI->isChecked() ? intForcedFontDPI->value() : -1;
1148}

◆ getBackgroundImage

void GeneralTab::getBackgroundImage ( )
privateslot

Definition at line 1187 of file kis_dlg_preferences.cc.

1188{
1189 KoFileDialog dialog(this, KoFileDialog::OpenFile, "BackgroundImages");
1190 dialog.setCaption(i18n("Select a Background Image"));
1191 dialog.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
1192 dialog.setImageFilters();
1193
1194 QString fn = dialog.filename();
1195 // dialog box was canceled or somehow no file was selected
1196 if (fn.isEmpty()) {
1197 return;
1198 }
1199
1200 QImage image(fn);
1201 if (image.isNull()) {
1202 QMessageBox::warning(this, i18nc("@title:window", "Krita"), i18n("%1 is not a valid image file!", fn));
1203 }
1204 else {
1205 m_backgroundimage->setText(fn);
1206 }
1207}

References KoFileDialog::OpenFile.

◆ getColorSamplerPreviewStyleValue()

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

Definition at line 1167 of file kis_dlg_preferences.cc.

1168{
1169 return KisConfig::ColorSamplerPreviewStyle(cmb->currentIndex());
1170}
ColorSamplerPreviewStyle
Definition kis_config.h:138

◆ iconsInMenu()

KisConfig::IconsInMenu GeneralTab::iconsInMenu ( ) const

Definition at line 1009 of file kis_dlg_preferences.cc.

1010{
1011 return (KisConfig::IconsInMenu)cmbIconsInMenu->currentIndex();
1012}

◆ kineticScrollingEnabled()

bool GeneralTab::kineticScrollingEnabled ( )

Definition at line 1095 of file kis_dlg_preferences.cc.

1096{
1097 return m_groupBoxKineticScrollingSettings->isChecked();
1098}

◆ kineticScrollingGesture()

int GeneralTab::kineticScrollingGesture ( )

Definition at line 1100 of file kis_dlg_preferences.cc.

1101{
1102 return m_cmbKineticScrollingGesture->currentIndex();
1103}

◆ kineticScrollingHiddenScrollbars()

bool GeneralTab::kineticScrollingHiddenScrollbars ( )

Definition at line 1110 of file kis_dlg_preferences.cc.

1111{
1112 return m_chkKineticScrollingHideScrollbars->isChecked();
1113}

◆ kineticScrollingSensitivity()

int GeneralTab::kineticScrollingSensitivity ( )

Definition at line 1105 of file kis_dlg_preferences.cc.

1106{
1107 return m_kineticScrollingSensitivitySlider->value();
1108}

◆ longPressEnabled()

bool GeneralTab::longPressEnabled ( )

Definition at line 1090 of file kis_dlg_preferences.cc.

1091{
1092 return chkEnableLongPress->isChecked();
1093}

◆ mdiMode()

int GeneralTab::mdiMode ( )

Definition at line 1045 of file kis_dlg_preferences.cc.

1046{
1047 return m_cmbMDIType->currentIndex();
1048}

◆ outlineStyle()

OutlineStyle GeneralTab::outlineStyle ( )

Definition at line 948 of file kis_dlg_preferences.cc.

949{
950 return (OutlineStyle)m_cmbOutlineShape->currentIndex();
951}

◆ renameDuplicatedLayers()

bool GeneralTab::renameDuplicatedLayers ( )

Definition at line 1182 of file kis_dlg_preferences.cc.

1183{
1184 return chkRenameDuplicatedLayers->isChecked();
1185}

◆ renameMergedLayers()

bool GeneralTab::renameMergedLayers ( )

Definition at line 1172 of file kis_dlg_preferences.cc.

1173{
1174 return chkRenameMergedLayers->isChecked();
1175}

◆ renamePastedLayers()

bool GeneralTab::renamePastedLayers ( )

Definition at line 1177 of file kis_dlg_preferences.cc.

1178{
1179 return chkRenamePastedLayers->isChecked();
1180}

◆ saveSessionOnQuit()

bool GeneralTab::saveSessionOnQuit ( ) const

Definition at line 1014 of file kis_dlg_preferences.cc.

1015{
1016 return chkSaveSessionOnQuit->isChecked();
1017}

◆ sessionOnStartup()

KisConfig::SessionOnStartup GeneralTab::sessionOnStartup ( ) const

Definition at line 1004 of file kis_dlg_preferences.cc.

1005{
1006 return (KisConfig::SessionOnStartup)cmbStartupSession->currentIndex();
1007}

◆ setButtonGroupEnabled

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

Definition at line 934 of file kis_dlg_preferences.cc.

935{
936 Q_FOREACH(QAbstractButton* button, buttonGroup.buttons()) {
937 if (button) {
938 button->setEnabled(value);
939 }
940 }
941}

References button(), and value().

◆ setColorSamplerPreviewStyleIndexByValue()

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

Definition at line 1162 of file kis_dlg_preferences.cc.

1163{
1164 cmb->setCurrentIndex(int(style));
1165}

◆ setColorSamplerPreviewStyleItems()

void GeneralTab::setColorSamplerPreviewStyleItems ( QComboBox * cmb)
static

Definition at line 1150 of file kis_dlg_preferences.cc.

1151{
1152 // Order is synchronized with KisConfig::ColorSamplerPreviewStyle.
1153 cmb->addItems({
1154 i18nc("Preview option for no color sampler", "None"),
1155 i18nc("Preview option for a circular/ring-shaped color sampler", "Circle"),
1156 i18nc("Preview option for a rectangular color sampler left of the cursor", "Rectangle Left"),
1157 i18nc("Preview option for a rectangular color sampler right of the cursor", "Rectangle Right"),
1158 i18nc("Preview option for a rectangular color sampler above the cursor", "Rectangle Above"),
1159 });
1160}

◆ setDefault()

void GeneralTab::setDefault ( )

Definition at line 789 of file kis_dlg_preferences.cc.

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

906{
907 KisDlgConfigureCumulativeUndo dlg(m_cumulativeUndoData, m_undoStackSize->value(), this);
908 if (dlg.exec() == KoDialog::Accepted) {
909 m_cumulativeUndoData = dlg.cumulativeUndoData();
910 }
911}

References KisDlgConfigureCumulativeUndo::cumulativeUndoData(), and m_cumulativeUndoData.

◆ showCanvasMessages()

bool GeneralTab::showCanvasMessages ( )

Definition at line 1050 of file kis_dlg_preferences.cc.

1051{
1052 return m_chkCanvasMessages->isChecked();
1053}

◆ showEraserOutlineWhilePainting()

bool GeneralTab::showEraserOutlineWhilePainting ( )

Definition at line 1040 of file kis_dlg_preferences.cc.

1041{
1042 return m_showEraserOutlinePainting->isChecked();
1043}

◆ showOutlineWhilePainting()

bool GeneralTab::showOutlineWhilePainting ( )

Definition at line 1035 of file kis_dlg_preferences.cc.

1036{
1037 return m_showOutlinePainting->isChecked();
1038}

◆ showRootLayer()

bool GeneralTab::showRootLayer ( )

Definition at line 1019 of file kis_dlg_preferences.cc.

1020{
1021 return chkShowRootLayer->isChecked();
1022}

◆ switchSelectionCtrlAlt()

bool GeneralTab::switchSelectionCtrlAlt ( )

Definition at line 1120 of file kis_dlg_preferences.cc.

1121{
1122 return m_chkSwitchSelectionCtrlAlt->isChecked();
1123}

◆ toolOptionsInDocker()

bool GeneralTab::toolOptionsInDocker ( )

Definition at line 1080 of file kis_dlg_preferences.cc.

1081{
1082 return m_radioToolOptionsInDocker->isChecked();
1083}

◆ trimFramesImport()

bool GeneralTab::trimFramesImport ( )

Definition at line 1065 of file kis_dlg_preferences.cc.

1066{
1067 return m_chkTrimFramesImport->isChecked();
1068}

◆ trimKra()

bool GeneralTab::trimKra ( )

Definition at line 1060 of file kis_dlg_preferences.cc.

1061{
1062 return m_chkTrimKra->isChecked();
1063}

◆ undoStackSize()

int GeneralTab::undoStackSize ( )

Definition at line 1030 of file kis_dlg_preferences.cc.

1031{
1032 return m_undoStackSize->value();
1033}

◆ updateTouchPressureSensitivityEnabled

void GeneralTab::updateTouchPressureSensitivityEnabled ( int touchPainting)
privateslot

Definition at line 1234 of file kis_dlg_preferences.cc.

1235{
1236 chkTouchPressureSensitivity->setEnabled(touchPainting != int(KisConfig::TOUCH_PAINTING_DISABLED));
1237}
@ TOUCH_PAINTING_DISABLED
Definition kis_config.h:50

References KisConfig::TOUCH_PAINTING_DISABLED.

◆ useZip64()

bool GeneralTab::useZip64 ( )

Definition at line 1075 of file kis_dlg_preferences.cc.

1076{
1077 return chkZip64->isChecked();
1078}

◆ zoomMarginSize()

int GeneralTab::zoomMarginSize ( )

Definition at line 1115 of file kis_dlg_preferences.cc.

1116{
1117 return intZoomMarginSize->value();
1118}

◆ zoomSteps()

int GeneralTab::zoomSteps ( )

Definition at line 1085 of file kis_dlg_preferences.cc.

1086{
1087 return spnZoomSteps->value();
1088}

Member Data Documentation

◆ m_cumulativeUndoData

KisCumulativeUndoData GeneralTab::m_cumulativeUndoData

Definition at line 139 of file kis_dlg_preferences.h.

◆ m_pasteFormatGroup

QButtonGroup GeneralTab::m_pasteFormatGroup

Definition at line 138 of file kis_dlg_preferences.h.


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