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

#include <kis_dlg_preferences.h>

+ Inheritance diagram for GeneralTab:

Public Member Functions

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

Static Public Member Functions

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

Public Attributes

KisCumulativeUndoData m_cumulativeUndoData
 
QButtonGroup m_pasteFormatGroup
 

Private Slots

void checkResourcePath ()
 
void clearBackgroundImage ()
 
void colorSamplePreviewOutlineEnabledChanged (int value)
 
void colorSamplePreviewSizeChanged (int value)
 
void colorSamplePreviewStyleChanged (int index)
 
void colorSamplePreviewThicknessChanged (qreal value)
 
void enableSubWindowOptions (int)
 
void getBackgroundImage ()
 
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 209 of file kis_dlg_preferences.cc.

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

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

Member Function Documentation

◆ adaptivePlaybackRange()

bool GeneralTab::adaptivePlaybackRange ( )

Definition at line 1059 of file kis_dlg_preferences.cc.

1060{
1061 return m_chkAdaptivePlaybackRange->isChecked();
1062}

◆ autopinLayersToTimeline()

bool GeneralTab::autopinLayersToTimeline ( )

Definition at line 1054 of file kis_dlg_preferences.cc.

1055{
1056 return m_chkAutoPin->isChecked();
1057}

◆ autoSaveInterval()

int GeneralTab::autoSaveInterval ( )

Definition at line 948 of file kis_dlg_preferences.cc.

949{
950 //convert to seconds
951 return m_autosaveCheckBox->isChecked() ? m_autosaveSpinBox->value() * 60 : 0;
952}

◆ autoZoomTimelineToPlaybackRange()

bool GeneralTab::autoZoomTimelineToPlaybackRange ( )

Definition at line 1064 of file kis_dlg_preferences.cc.

1065{
1066 return m_chkAutoZoom->isChecked();
1067}

◆ checkResourcePath

void GeneralTab::checkResourcePath ( )
privateslot

Definition at line 1139 of file kis_dlg_preferences.cc.

1140{
1141 const QFileInfo fi(m_urlResourceFolder->fileName());
1142 if (!fi.isWritable()) {
1143 grpNonWritableLocation->setPixmap(
1144 grpNonWritableLocation->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
1145 grpNonWritableLocation->setText(
1146 i18nc("@info resource folder", "<b>Warning:</b> this location is not writable."));
1147 grpNonWritableLocation->setVisible(true);
1148 } else {
1149 grpNonWritableLocation->setVisible(false);
1150 }
1151}

◆ clearBackgroundImage

void GeneralTab::clearBackgroundImage ( )
privateslot

Definition at line 1133 of file kis_dlg_preferences.cc.

1134{
1135 // clearing the background image text will implicitly make the background color be used
1136 m_backgroundimage->setText("");
1137}

◆ colorSamplePreviewOutlineEnabledChanged

void GeneralTab::colorSamplePreviewOutlineEnabledChanged ( int value)
privateslot

Definition at line 882 of file kis_dlg_preferences.cc.

883{
884 m_lblColorSamplerPreviewSizePreview->setOutlineEnabled(value);
885}
float value(const T *src, size_t ch)

References value().

◆ colorSamplePreviewSizeChanged

void GeneralTab::colorSamplePreviewSizeChanged ( int value)
privateslot

Definition at line 872 of file kis_dlg_preferences.cc.

873{
874 m_lblColorSamplerPreviewSizePreview->setDiameter(value);
875}

References value().

◆ colorSamplePreviewStyleChanged

void GeneralTab::colorSamplePreviewStyleChanged ( int index)
privateslot

Definition at line 866 of file kis_dlg_preferences.cc.

867{
868 bool circleSettingsVisible = index == int(KisConfig::ColorSamplerPreviewStyle::Circle);
869 m_frmColorSamplerCircleSettings->setVisible(circleSettingsVisible);
870}

References KisConfig::Circle.

◆ colorSamplePreviewThicknessChanged

void GeneralTab::colorSamplePreviewThicknessChanged ( qreal value)
privateslot

Definition at line 877 of file kis_dlg_preferences.cc.

878{
879 m_lblColorSamplerPreviewSizePreview->setThickness(value/100.0);
880}

References value().

◆ colorSamplerPreviewCircleDiameter()

int GeneralTab::colorSamplerPreviewCircleDiameter ( ) const

Definition at line 912 of file kis_dlg_preferences.cc.

913{
914 return m_nmbColorSamplerPreviewSize->value();
915}

◆ colorSamplerPreviewCircleExtraCirclesEnabled()

bool GeneralTab::colorSamplerPreviewCircleExtraCirclesEnabled ( ) const

Definition at line 927 of file kis_dlg_preferences.cc.

928{
929 return m_chkColorSamplerPreviewExtraCircles->isChecked();
930}

◆ colorSamplerPreviewCircleOutlineEnabled()

bool GeneralTab::colorSamplerPreviewCircleOutlineEnabled ( ) const

Definition at line 922 of file kis_dlg_preferences.cc.

923{
924 return m_chkColorSamplerPreviewOutlineEnabled->isChecked();
925}

◆ colorSamplerPreviewCircleThickness()

qreal GeneralTab::colorSamplerPreviewCircleThickness ( ) const

Definition at line 917 of file kis_dlg_preferences.cc.

918{
919 return m_ssbColorSamplerPreviewThickness->value();
920}

◆ colorSamplerPreviewStyle()

KisConfig::ColorSamplerPreviewStyle GeneralTab::colorSamplerPreviewStyle ( ) const

Definition at line 907 of file kis_dlg_preferences.cc.

908{
909 return getColorSamplerPreviewStyleValue(m_cmbColorSamplerPreviewStyle);
910}
static KisConfig::ColorSamplerPreviewStyle getColorSamplerPreviewStyleValue(const QComboBox *cmb)

References getColorSamplerPreviewStyleValue().

◆ compressKra()

bool GeneralTab::compressKra ( )

Definition at line 979 of file kis_dlg_preferences.cc.

980{
981 return m_chkCompressKra->isChecked();
982}

◆ convertToImageColorspaceOnImport()

bool GeneralTab::convertToImageColorspaceOnImport ( )

Definition at line 1049 of file kis_dlg_preferences.cc.

1050{
1051 return m_chkConvertOnImport->isChecked();
1052}

◆ cursorStyle()

CursorStyle GeneralTab::cursorStyle ( )

Definition at line 887 of file kis_dlg_preferences.cc.

888{
889 return (CursorStyle)m_cmbCursorShape->currentIndex();
890}
CursorStyle
Definition kis_global.h:62

◆ enableSubWindowOptions

void GeneralTab::enableSubWindowOptions ( int mdi_mode)
privateslot

Definition at line 1153 of file kis_dlg_preferences.cc.

1154{
1155 group_subWinMode->setEnabled(mdi_mode == QMdiArea::SubWindowView);
1156}

◆ eraserCursorStyle()

CursorStyle GeneralTab::eraserCursorStyle ( )

Definition at line 897 of file kis_dlg_preferences.cc.

898{
899 return (CursorStyle)m_cmbEraserCursorShape->currentIndex();
900}

◆ eraserOutlineStyle()

OutlineStyle GeneralTab::eraserOutlineStyle ( )

Definition at line 902 of file kis_dlg_preferences.cc.

903{
904 return (OutlineStyle)m_cmbEraserOutlineShape->currentIndex();
905}
OutlineStyle
Definition kis_global.h:53

◆ exportMimeType()

QString GeneralTab::exportMimeType ( )

Definition at line 994 of file kis_dlg_preferences.cc.

995{
996 return cmbDefaultExportFileType->currentData().toString();
997}

◆ forcedFontDpi()

int GeneralTab::forcedFontDpi ( )

Definition at line 1069 of file kis_dlg_preferences.cc.

1070{
1071 return chkForcedFontDPI->isChecked() ? intForcedFontDPI->value() : -1;
1072}

◆ getBackgroundImage

void GeneralTab::getBackgroundImage ( )
privateslot

Definition at line 1111 of file kis_dlg_preferences.cc.

1112{
1113 KoFileDialog dialog(this, KoFileDialog::OpenFile, "BackgroundImages");
1114 dialog.setCaption(i18n("Select a Background Image"));
1115 dialog.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
1116 dialog.setImageFilters();
1117
1118 QString fn = dialog.filename();
1119 // dialog box was canceled or somehow no file was selected
1120 if (fn.isEmpty()) {
1121 return;
1122 }
1123
1124 QImage image(fn);
1125 if (image.isNull()) {
1126 QMessageBox::warning(this, i18nc("@title:window", "Krita"), i18n("%1 is not a valid image file!", fn));
1127 }
1128 else {
1129 m_backgroundimage->setText(fn);
1130 }
1131}

References KoFileDialog::OpenFile.

◆ getColorSamplerPreviewStyleValue()

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

Definition at line 1091 of file kis_dlg_preferences.cc.

1092{
1093 return KisConfig::ColorSamplerPreviewStyle(cmb->currentIndex());
1094}
ColorSamplerPreviewStyle
Definition kis_config.h:138

◆ kineticScrollingEnabled()

bool GeneralTab::kineticScrollingEnabled ( )

Definition at line 1019 of file kis_dlg_preferences.cc.

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

◆ kineticScrollingGesture()

int GeneralTab::kineticScrollingGesture ( )

Definition at line 1024 of file kis_dlg_preferences.cc.

1025{
1026 return m_cmbKineticScrollingGesture->currentIndex();
1027}

◆ kineticScrollingHiddenScrollbars()

bool GeneralTab::kineticScrollingHiddenScrollbars ( )

Definition at line 1034 of file kis_dlg_preferences.cc.

1035{
1036 return m_chkKineticScrollingHideScrollbars->isChecked();
1037}

◆ kineticScrollingSensitivity()

int GeneralTab::kineticScrollingSensitivity ( )

Definition at line 1029 of file kis_dlg_preferences.cc.

1030{
1031 return m_kineticScrollingSensitivitySlider->value();
1032}

◆ longPressEnabled()

bool GeneralTab::longPressEnabled ( )

Definition at line 1014 of file kis_dlg_preferences.cc.

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

◆ mdiMode()

int GeneralTab::mdiMode ( )

Definition at line 969 of file kis_dlg_preferences.cc.

970{
971 return m_cmbMDIType->currentIndex();
972}

◆ outlineStyle()

OutlineStyle GeneralTab::outlineStyle ( )

Definition at line 892 of file kis_dlg_preferences.cc.

893{
894 return (OutlineStyle)m_cmbOutlineShape->currentIndex();
895}

◆ renameDuplicatedLayers()

bool GeneralTab::renameDuplicatedLayers ( )

Definition at line 1106 of file kis_dlg_preferences.cc.

1107{
1108 return chkRenameDuplicatedLayers->isChecked();
1109}

◆ renameMergedLayers()

bool GeneralTab::renameMergedLayers ( )

Definition at line 1096 of file kis_dlg_preferences.cc.

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

◆ renamePastedLayers()

bool GeneralTab::renamePastedLayers ( )

Definition at line 1101 of file kis_dlg_preferences.cc.

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

◆ saveSessionOnQuit()

bool GeneralTab::saveSessionOnQuit ( ) const

Definition at line 938 of file kis_dlg_preferences.cc.

939{
940 return chkSaveSessionOnQuit->isChecked();
941}

◆ sessionOnStartup()

KisConfig::SessionOnStartup GeneralTab::sessionOnStartup ( ) const

Definition at line 933 of file kis_dlg_preferences.cc.

934{
935 return (KisConfig::SessionOnStartup)cmbStartupSession->currentIndex();
936}

◆ setColorSamplerPreviewStyleIndexByValue()

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

Definition at line 1086 of file kis_dlg_preferences.cc.

1087{
1088 cmb->setCurrentIndex(int(style));
1089}

◆ setColorSamplerPreviewStyleItems()

void GeneralTab::setColorSamplerPreviewStyleItems ( QComboBox * cmb)
static

Definition at line 1074 of file kis_dlg_preferences.cc.

1075{
1076 // Order is synchronized with KisConfig::ColorSamplerPreviewStyle.
1077 cmb->addItems({
1078 i18nc("Preview option for no color sampler", "None"),
1079 i18nc("Preview option for a circular/ring-shaped color sampler", "Circle"),
1080 i18nc("Preview option for a rectangular color sampler left of the cursor", "Rectangle Left"),
1081 i18nc("Preview option for a rectangular color sampler right of the cursor", "Rectangle Right"),
1082 i18nc("Preview option for a rectangular color sampler above the cursor", "Rectangle Above"),
1083 });
1084}

◆ setDefault()

void GeneralTab::setDefault ( )

Definition at line 745 of file kis_dlg_preferences.cc.

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

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

◆ showAdvancedCumulativeUndoSettings

void GeneralTab::showAdvancedCumulativeUndoSettings ( )
privateslot

Definition at line 858 of file kis_dlg_preferences.cc.

859{
860 KisDlgConfigureCumulativeUndo dlg(m_cumulativeUndoData, m_undoStackSize->value(), this);
861 if (dlg.exec() == KoDialog::Accepted) {
862 m_cumulativeUndoData = dlg.cumulativeUndoData();
863 }
864}

References KisDlgConfigureCumulativeUndo::cumulativeUndoData(), and m_cumulativeUndoData.

◆ showCanvasMessages()

bool GeneralTab::showCanvasMessages ( )

Definition at line 974 of file kis_dlg_preferences.cc.

975{
976 return m_chkCanvasMessages->isChecked();
977}

◆ showEraserOutlineWhilePainting()

bool GeneralTab::showEraserOutlineWhilePainting ( )

Definition at line 964 of file kis_dlg_preferences.cc.

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

◆ showOutlineWhilePainting()

bool GeneralTab::showOutlineWhilePainting ( )

Definition at line 959 of file kis_dlg_preferences.cc.

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

◆ showRootLayer()

bool GeneralTab::showRootLayer ( )

Definition at line 943 of file kis_dlg_preferences.cc.

944{
945 return chkShowRootLayer->isChecked();
946}

◆ switchSelectionCtrlAlt()

bool GeneralTab::switchSelectionCtrlAlt ( )

Definition at line 1044 of file kis_dlg_preferences.cc.

1045{
1046 return m_chkSwitchSelectionCtrlAlt->isChecked();
1047}

◆ toolOptionsInDocker()

bool GeneralTab::toolOptionsInDocker ( )

Definition at line 1004 of file kis_dlg_preferences.cc.

1005{
1006 return m_radioToolOptionsInDocker->isChecked();
1007}

◆ trimFramesImport()

bool GeneralTab::trimFramesImport ( )

Definition at line 989 of file kis_dlg_preferences.cc.

990{
991 return m_chkTrimFramesImport->isChecked();
992}

◆ trimKra()

bool GeneralTab::trimKra ( )

Definition at line 984 of file kis_dlg_preferences.cc.

985{
986 return m_chkTrimKra->isChecked();
987}

◆ undoStackSize()

int GeneralTab::undoStackSize ( )

Definition at line 954 of file kis_dlg_preferences.cc.

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

◆ updateTouchPressureSensitivityEnabled

void GeneralTab::updateTouchPressureSensitivityEnabled ( int touchPainting)
privateslot

Definition at line 1158 of file kis_dlg_preferences.cc.

1159{
1160 chkTouchPressureSensitivity->setEnabled(touchPainting != int(KisConfig::TOUCH_PAINTING_DISABLED));
1161}
@ TOUCH_PAINTING_DISABLED
Definition kis_config.h:50

References KisConfig::TOUCH_PAINTING_DISABLED.

◆ useZip64()

bool GeneralTab::useZip64 ( )

Definition at line 999 of file kis_dlg_preferences.cc.

1000{
1001 return chkZip64->isChecked();
1002}

◆ zoomMarginSize()

int GeneralTab::zoomMarginSize ( )

Definition at line 1039 of file kis_dlg_preferences.cc.

1040{
1041 return intZoomMarginSize->value();
1042}

◆ zoomSteps()

int GeneralTab::zoomSteps ( )

Definition at line 1009 of file kis_dlg_preferences.cc.

1010{
1011 return spnZoomSteps->value();
1012}

Member Data Documentation

◆ m_cumulativeUndoData

KisCumulativeUndoData GeneralTab::m_cumulativeUndoData

Definition at line 132 of file kis_dlg_preferences.h.

◆ m_pasteFormatGroup

QButtonGroup GeneralTab::m_pasteFormatGroup

Definition at line 131 of file kis_dlg_preferences.h.


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