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 ()
 
QString splashScreenImage () const
 
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
 
QString m_splashScreenImage
 

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 slotChangeSplashScreen ()
 
void slotUpdateCurrentSplashScreenTitle ()
 
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 239 of file kis_dlg_preferences.cc.

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

1168{
1169 return m_chkAdaptivePlaybackRange->isChecked();
1170}

◆ autopinLayersToTimeline()

bool GeneralTab::autopinLayersToTimeline ( )

Definition at line 1162 of file kis_dlg_preferences.cc.

1163{
1164 return m_chkAutoPin->isChecked();
1165}

◆ autoSaveInterval()

int GeneralTab::autoSaveInterval ( )

Definition at line 1051 of file kis_dlg_preferences.cc.

1052{
1053 //convert to seconds
1054 return m_autosaveCheckBox->isChecked() ? m_autosaveSpinBox->value() * 60 : 0;
1055}

◆ autoZoomTimelineToPlaybackRange()

bool GeneralTab::autoZoomTimelineToPlaybackRange ( )

Definition at line 1172 of file kis_dlg_preferences.cc.

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

◆ checkResourcePath

void GeneralTab::checkResourcePath ( )
privateslot

Definition at line 1247 of file kis_dlg_preferences.cc.

1248{
1249 const QFileInfo fi(m_urlResourceFolder->fileName());
1250 if (!fi.isWritable()) {
1251 grpNonWritableLocation->setPixmap(
1252 grpNonWritableLocation->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
1253 grpNonWritableLocation->setText(
1254 i18nc("@info resource folder", "<b>Warning:</b> this location is not writable."));
1255 grpNonWritableLocation->setVisible(true);
1256 } else {
1257 grpNonWritableLocation->setVisible(false);
1258 }
1259}

◆ clearBackgroundImage

void GeneralTab::clearBackgroundImage ( )
privateslot

Definition at line 1241 of file kis_dlg_preferences.cc.

1242{
1243 // clearing the background image text will implicitly make the background color be used
1244 m_backgroundimage->setText("");
1245}

◆ colorSamplePreviewOutlineEnabledChanged

void GeneralTab::colorSamplePreviewOutlineEnabledChanged ( int value)
privateslot

Definition at line 942 of file kis_dlg_preferences.cc.

943{
944 m_lblColorSamplerPreviewSizePreview->setOutlineEnabled(value);
945}
float value(const T *src, size_t ch)

References value().

◆ colorSamplePreviewSizeChanged

void GeneralTab::colorSamplePreviewSizeChanged ( int value)
privateslot

Definition at line 932 of file kis_dlg_preferences.cc.

933{
934 m_lblColorSamplerPreviewSizePreview->setDiameter(value);
935}

References value().

◆ colorSamplePreviewStyleChanged

void GeneralTab::colorSamplePreviewStyleChanged ( int index)
privateslot

Definition at line 926 of file kis_dlg_preferences.cc.

927{
928 bool circleSettingsVisible = index == int(KisConfig::ColorSamplerPreviewStyle::Circle);
929 m_frmColorSamplerCircleSettings->setVisible(circleSettingsVisible);
930}

References KisConfig::Circle.

◆ colorSamplePreviewThicknessChanged

void GeneralTab::colorSamplePreviewThicknessChanged ( qreal value)
privateslot

Definition at line 937 of file kis_dlg_preferences.cc.

938{
939 m_lblColorSamplerPreviewSizePreview->setThickness(value/100.0);
940}

References value().

◆ colorSamplerPreviewCircleDiameter()

int GeneralTab::colorSamplerPreviewCircleDiameter ( ) const

Definition at line 995 of file kis_dlg_preferences.cc.

996{
997 return m_nmbColorSamplerPreviewSize->value();
998}

◆ colorSamplerPreviewCircleExtraCirclesEnabled()

bool GeneralTab::colorSamplerPreviewCircleExtraCirclesEnabled ( ) const

Definition at line 1010 of file kis_dlg_preferences.cc.

1011{
1012 return m_chkColorSamplerPreviewExtraCircles->isChecked();
1013}

◆ colorSamplerPreviewCircleOutlineEnabled()

bool GeneralTab::colorSamplerPreviewCircleOutlineEnabled ( ) const

Definition at line 1005 of file kis_dlg_preferences.cc.

1006{
1007 return m_chkColorSamplerPreviewOutlineEnabled->isChecked();
1008}

◆ colorSamplerPreviewCirclePosition()

KisConfig::ColorSamplerPreviewCirclePosition GeneralTab::colorSamplerPreviewCirclePosition ( ) const

Definition at line 1025 of file kis_dlg_preferences.cc.

1026{
1027 int index = m_cmbColorSamplerPreviewCirclePosition->currentIndex();
1029}
ColorSamplerPreviewCirclePosition
Definition kis_config.h:168

◆ colorSamplerPreviewCircleThickness()

qreal GeneralTab::colorSamplerPreviewCircleThickness ( ) const

Definition at line 1000 of file kis_dlg_preferences.cc.

1001{
1002 return m_ssbColorSamplerPreviewThickness->value();
1003}

◆ colorSamplerPreviewStyle()

KisConfig::ColorSamplerPreviewStyle GeneralTab::colorSamplerPreviewStyle ( ) const

Definition at line 990 of file kis_dlg_preferences.cc.

991{
992 return getColorSamplerPreviewStyleValue(m_cmbColorSamplerPreviewStyle);
993}
static KisConfig::ColorSamplerPreviewStyle getColorSamplerPreviewStyleValue(const QComboBox *cmb)

References getColorSamplerPreviewStyleValue().

◆ colorSamplerZoomPreviewEnabled()

bool GeneralTab::colorSamplerZoomPreviewEnabled ( ) const

Definition at line 1020 of file kis_dlg_preferences.cc.

1021{
1022 return m_grpColorSamplerZoomPreview->isChecked();
1023}

◆ colorSamplerZoomPreviewScale()

qreal GeneralTab::colorSamplerZoomPreviewScale ( ) const

Definition at line 1015 of file kis_dlg_preferences.cc.

1016{
1017 return m_ssbColorSamplerZoomPreviewScale->value();
1018}

◆ compressKra()

bool GeneralTab::compressKra ( )

Definition at line 1087 of file kis_dlg_preferences.cc.

1088{
1089 return m_chkCompressKra->isChecked();
1090}

◆ convertToImageColorspaceOnImport()

bool GeneralTab::convertToImageColorspaceOnImport ( )

Definition at line 1157 of file kis_dlg_preferences.cc.

1158{
1159 return m_chkConvertOnImport->isChecked();
1160}

◆ cursorStyle()

CursorStyle GeneralTab::cursorStyle ( )

Definition at line 970 of file kis_dlg_preferences.cc.

971{
972 return (CursorStyle)m_cmbCursorShape->currentIndex();
973}
CursorStyle
Definition kis_global.h:62

◆ enableSubWindowOptions

void GeneralTab::enableSubWindowOptions ( int mdi_mode)
privateslot

Definition at line 1261 of file kis_dlg_preferences.cc.

1262{
1263 group_subWinMode->setEnabled(mdi_mode == QMdiArea::SubWindowView);
1264}

◆ eraserCursorStyle()

CursorStyle GeneralTab::eraserCursorStyle ( )

Definition at line 980 of file kis_dlg_preferences.cc.

981{
982 return (CursorStyle)m_cmbEraserCursorShape->currentIndex();
983}

◆ eraserOutlineStyle()

OutlineStyle GeneralTab::eraserOutlineStyle ( )

Definition at line 985 of file kis_dlg_preferences.cc.

986{
987 return (OutlineStyle)m_cmbEraserOutlineShape->currentIndex();
988}
OutlineStyle
Definition kis_global.h:53

◆ exportMimeType()

QString GeneralTab::exportMimeType ( )

Definition at line 1102 of file kis_dlg_preferences.cc.

1103{
1104 return cmbDefaultExportFileType->currentData().toString();
1105}

◆ forcedFontDpi()

int GeneralTab::forcedFontDpi ( )

Definition at line 1177 of file kis_dlg_preferences.cc.

1178{
1179 return chkForcedFontDPI->isChecked() ? intForcedFontDPI->value() : -1;
1180}

◆ getBackgroundImage

void GeneralTab::getBackgroundImage ( )
privateslot

Definition at line 1219 of file kis_dlg_preferences.cc.

1220{
1221 KoFileDialog dialog(this, KoFileDialog::OpenFile, "BackgroundImages");
1222 dialog.setCaption(i18n("Select a Background Image"));
1223 dialog.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
1224 dialog.setImageFilters();
1225
1226 QString fn = dialog.filename();
1227 // dialog box was canceled or somehow no file was selected
1228 if (fn.isEmpty()) {
1229 return;
1230 }
1231
1232 QImage image(fn);
1233 if (image.isNull()) {
1234 QMessageBox::warning(this, i18nc("@title:window", "Krita"), i18n("%1 is not a valid image file!", fn));
1235 }
1236 else {
1237 m_backgroundimage->setText(fn);
1238 }
1239}

References KoFileDialog::OpenFile.

◆ getColorSamplerPreviewStyleValue()

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

Definition at line 1199 of file kis_dlg_preferences.cc.

1200{
1201 return KisConfig::ColorSamplerPreviewStyle(cmb->currentIndex());
1202}
ColorSamplerPreviewStyle
Definition kis_config.h:138

◆ iconsInMenu()

KisConfig::IconsInMenu GeneralTab::iconsInMenu ( ) const

Definition at line 1036 of file kis_dlg_preferences.cc.

1037{
1038 return (KisConfig::IconsInMenu)cmbIconsInMenu->currentIndex();
1039}

◆ kineticScrollingEnabled()

bool GeneralTab::kineticScrollingEnabled ( )

Definition at line 1127 of file kis_dlg_preferences.cc.

1128{
1129 return m_groupBoxKineticScrollingSettings->isChecked();
1130}

◆ kineticScrollingGesture()

int GeneralTab::kineticScrollingGesture ( )

Definition at line 1132 of file kis_dlg_preferences.cc.

1133{
1134 return m_cmbKineticScrollingGesture->currentIndex();
1135}

◆ kineticScrollingHiddenScrollbars()

bool GeneralTab::kineticScrollingHiddenScrollbars ( )

Definition at line 1142 of file kis_dlg_preferences.cc.

1143{
1144 return m_chkKineticScrollingHideScrollbars->isChecked();
1145}

◆ kineticScrollingSensitivity()

int GeneralTab::kineticScrollingSensitivity ( )

Definition at line 1137 of file kis_dlg_preferences.cc.

1138{
1139 return m_kineticScrollingSensitivitySlider->value();
1140}

◆ longPressEnabled()

bool GeneralTab::longPressEnabled ( )

Definition at line 1122 of file kis_dlg_preferences.cc.

1123{
1124 return chkEnableLongPress->isChecked();
1125}

◆ mdiMode()

int GeneralTab::mdiMode ( )

Definition at line 1077 of file kis_dlg_preferences.cc.

1078{
1079 return m_cmbMDIType->currentIndex();
1080}

◆ outlineStyle()

OutlineStyle GeneralTab::outlineStyle ( )

Definition at line 975 of file kis_dlg_preferences.cc.

976{
977 return (OutlineStyle)m_cmbOutlineShape->currentIndex();
978}

◆ renameDuplicatedLayers()

bool GeneralTab::renameDuplicatedLayers ( )

Definition at line 1214 of file kis_dlg_preferences.cc.

1215{
1216 return chkRenameDuplicatedLayers->isChecked();
1217}

◆ renameMergedLayers()

bool GeneralTab::renameMergedLayers ( )

Definition at line 1204 of file kis_dlg_preferences.cc.

1205{
1206 return chkRenameMergedLayers->isChecked();
1207}

◆ renamePastedLayers()

bool GeneralTab::renamePastedLayers ( )

Definition at line 1209 of file kis_dlg_preferences.cc.

1210{
1211 return chkRenamePastedLayers->isChecked();
1212}

◆ saveSessionOnQuit()

bool GeneralTab::saveSessionOnQuit ( ) const

Definition at line 1041 of file kis_dlg_preferences.cc.

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

◆ sessionOnStartup()

KisConfig::SessionOnStartup GeneralTab::sessionOnStartup ( ) const

Definition at line 1031 of file kis_dlg_preferences.cc.

1032{
1033 return (KisConfig::SessionOnStartup)cmbStartupSession->currentIndex();
1034}

◆ setButtonGroupEnabled

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

Definition at line 961 of file kis_dlg_preferences.cc.

962{
963 Q_FOREACH(QAbstractButton* button, buttonGroup.buttons()) {
964 if (button) {
965 button->setEnabled(value);
966 }
967 }
968}

References button(), and value().

◆ setColorSamplerPreviewStyleIndexByValue()

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

Definition at line 1194 of file kis_dlg_preferences.cc.

1195{
1196 cmb->setCurrentIndex(int(style));
1197}

◆ setColorSamplerPreviewStyleItems()

void GeneralTab::setColorSamplerPreviewStyleItems ( QComboBox * cmb)
static

Definition at line 1182 of file kis_dlg_preferences.cc.

1183{
1184 // Order is synchronized with KisConfig::ColorSamplerPreviewStyle.
1185 cmb->addItems({
1186 i18nc("Preview option for no color sampler", "None"),
1187 i18nc("Preview option for a circular/ring-shaped color sampler", "Circle"),
1188 i18nc("Preview option for a rectangular color sampler left of the cursor", "Rectangle Left"),
1189 i18nc("Preview option for a rectangular color sampler right of the cursor", "Rectangle Right"),
1190 i18nc("Preview option for a rectangular color sampler above the cursor", "Rectangle Above"),
1191 });
1192}

◆ setDefault()

void GeneralTab::setDefault ( )

Definition at line 799 of file kis_dlg_preferences.cc.

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

919{
920 KisDlgConfigureCumulativeUndo dlg(m_cumulativeUndoData, m_undoStackSize->value(), this);
921 if (dlg.exec() == KoDialog::Accepted) {
922 m_cumulativeUndoData = dlg.cumulativeUndoData();
923 }
924}

References KisDlgConfigureCumulativeUndo::cumulativeUndoData(), and m_cumulativeUndoData.

◆ showCanvasMessages()

bool GeneralTab::showCanvasMessages ( )

Definition at line 1082 of file kis_dlg_preferences.cc.

1083{
1084 return m_chkCanvasMessages->isChecked();
1085}

◆ showEraserOutlineWhilePainting()

bool GeneralTab::showEraserOutlineWhilePainting ( )

Definition at line 1072 of file kis_dlg_preferences.cc.

1073{
1074 return m_showEraserOutlinePainting->isChecked();
1075}

◆ showOutlineWhilePainting()

bool GeneralTab::showOutlineWhilePainting ( )

Definition at line 1067 of file kis_dlg_preferences.cc.

1068{
1069 return m_showOutlinePainting->isChecked();
1070}

◆ showRootLayer()

bool GeneralTab::showRootLayer ( )

Definition at line 1046 of file kis_dlg_preferences.cc.

1047{
1048 return chkShowRootLayer->isChecked();
1049}

◆ slotChangeSplashScreen

void GeneralTab::slotChangeSplashScreen ( )
privateslot

Definition at line 952 of file kis_dlg_preferences.cc.

953{
955 if (dlg.exec() == QDialog::Accepted) {
956 m_splashScreenImage = dlg.selectedKey();
958 }
959}

References m_splashScreenImage, KisSplashSourceDialog::selectedKey(), and slotUpdateCurrentSplashScreenTitle().

◆ slotUpdateCurrentSplashScreenTitle

void GeneralTab::slotUpdateCurrentSplashScreenTitle ( )
privateslot

Definition at line 947 of file kis_dlg_preferences.cc.

948{
949 m_lblCurrentSplash->setText(KisSplashScreen::getAvailableSource(m_splashScreenImage).description());
950}
static Source getAvailableSource(const QString &key)

References KisSplashScreen::getAvailableSource(), and m_splashScreenImage.

◆ splashScreenImage()

QString GeneralTab::splashScreenImage ( ) const

Definition at line 1057 of file kis_dlg_preferences.cc.

1058{
1059 return m_splashScreenImage;
1060}

References m_splashScreenImage.

◆ switchSelectionCtrlAlt()

bool GeneralTab::switchSelectionCtrlAlt ( )

Definition at line 1152 of file kis_dlg_preferences.cc.

1153{
1154 return m_chkSwitchSelectionCtrlAlt->isChecked();
1155}

◆ toolOptionsInDocker()

bool GeneralTab::toolOptionsInDocker ( )

Definition at line 1112 of file kis_dlg_preferences.cc.

1113{
1114 return m_radioToolOptionsInDocker->isChecked();
1115}

◆ trimFramesImport()

bool GeneralTab::trimFramesImport ( )

Definition at line 1097 of file kis_dlg_preferences.cc.

1098{
1099 return m_chkTrimFramesImport->isChecked();
1100}

◆ trimKra()

bool GeneralTab::trimKra ( )

Definition at line 1092 of file kis_dlg_preferences.cc.

1093{
1094 return m_chkTrimKra->isChecked();
1095}

◆ undoStackSize()

int GeneralTab::undoStackSize ( )

Definition at line 1062 of file kis_dlg_preferences.cc.

1063{
1064 return m_undoStackSize->value();
1065}

◆ updateTouchPressureSensitivityEnabled

void GeneralTab::updateTouchPressureSensitivityEnabled ( int touchPainting)
privateslot

Definition at line 1266 of file kis_dlg_preferences.cc.

1267{
1268 chkTouchPressureSensitivity->setEnabled(touchPainting != int(KisConfig::TOUCH_PAINTING_DISABLED));
1269}
@ TOUCH_PAINTING_DISABLED
Definition kis_config.h:50

References KisConfig::TOUCH_PAINTING_DISABLED.

◆ useZip64()

bool GeneralTab::useZip64 ( )

Definition at line 1107 of file kis_dlg_preferences.cc.

1108{
1109 return chkZip64->isChecked();
1110}

◆ zoomMarginSize()

int GeneralTab::zoomMarginSize ( )

Definition at line 1147 of file kis_dlg_preferences.cc.

1148{
1149 return intZoomMarginSize->value();
1150}

◆ zoomSteps()

int GeneralTab::zoomSteps ( )

Definition at line 1117 of file kis_dlg_preferences.cc.

1118{
1119 return spnZoomSteps->value();
1120}

Member Data Documentation

◆ m_cumulativeUndoData

KisCumulativeUndoData GeneralTab::m_cumulativeUndoData

Definition at line 143 of file kis_dlg_preferences.h.

◆ m_pasteFormatGroup

QButtonGroup GeneralTab::m_pasteFormatGroup

Definition at line 142 of file kis_dlg_preferences.h.

◆ m_splashScreenImage

QString GeneralTab::m_splashScreenImage

Definition at line 144 of file kis_dlg_preferences.h.


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