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 57 of file kis_dlg_preferences.h.

Constructor & Destructor Documentation

◆ GeneralTab()

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

Definition at line 200 of file kis_dlg_preferences.cc.

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

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

◆ autopinLayersToTimeline()

bool GeneralTab::autopinLayersToTimeline ( )

Definition at line 1045 of file kis_dlg_preferences.cc.

1046{
1047 return m_chkAutoPin->isChecked();
1048}

◆ autoSaveInterval()

int GeneralTab::autoSaveInterval ( )

Definition at line 939 of file kis_dlg_preferences.cc.

940{
941 //convert to seconds
942 return m_autosaveCheckBox->isChecked() ? m_autosaveSpinBox->value() * 60 : 0;
943}

◆ autoZoomTimelineToPlaybackRange()

bool GeneralTab::autoZoomTimelineToPlaybackRange ( )

Definition at line 1055 of file kis_dlg_preferences.cc.

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

◆ checkResourcePath

void GeneralTab::checkResourcePath ( )
privateslot

Definition at line 1130 of file kis_dlg_preferences.cc.

1131{
1132 const QFileInfo fi(m_urlResourceFolder->fileName());
1133 if (!fi.isWritable()) {
1134 grpNonWritableLocation->setPixmap(
1135 grpNonWritableLocation->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
1136 grpNonWritableLocation->setText(
1137 i18nc("@info resource folder", "<b>Warning:</b> this location is not writable."));
1138 grpNonWritableLocation->setVisible(true);
1139 } else {
1140 grpNonWritableLocation->setVisible(false);
1141 }
1142}

◆ clearBackgroundImage

void GeneralTab::clearBackgroundImage ( )
privateslot

Definition at line 1124 of file kis_dlg_preferences.cc.

1125{
1126 // clearing the background image text will implicitly make the background color be used
1127 m_backgroundimage->setText("");
1128}

◆ colorSamplePreviewOutlineEnabledChanged

void GeneralTab::colorSamplePreviewOutlineEnabledChanged ( int value)
privateslot

Definition at line 873 of file kis_dlg_preferences.cc.

874{
875 m_lblColorSamplerPreviewSizePreview->setOutlineEnabled(value);
876}
float value(const T *src, size_t ch)

References value().

◆ colorSamplePreviewSizeChanged

void GeneralTab::colorSamplePreviewSizeChanged ( int value)
privateslot

Definition at line 863 of file kis_dlg_preferences.cc.

864{
865 m_lblColorSamplerPreviewSizePreview->setDiameter(value);
866}

References value().

◆ colorSamplePreviewStyleChanged

void GeneralTab::colorSamplePreviewStyleChanged ( int index)
privateslot

Definition at line 857 of file kis_dlg_preferences.cc.

858{
859 bool circleSettingsVisible = index == int(KisConfig::ColorSamplerPreviewStyle::Circle);
860 m_frmColorSamplerCircleSettings->setVisible(circleSettingsVisible);
861}

References KisConfig::Circle.

◆ colorSamplePreviewThicknessChanged

void GeneralTab::colorSamplePreviewThicknessChanged ( qreal value)
privateslot

Definition at line 868 of file kis_dlg_preferences.cc.

869{
870 m_lblColorSamplerPreviewSizePreview->setThickness(value/100.0);
871}

References value().

◆ colorSamplerPreviewCircleDiameter()

int GeneralTab::colorSamplerPreviewCircleDiameter ( ) const

Definition at line 903 of file kis_dlg_preferences.cc.

904{
905 return m_nmbColorSamplerPreviewSize->value();
906}

◆ colorSamplerPreviewCircleExtraCirclesEnabled()

bool GeneralTab::colorSamplerPreviewCircleExtraCirclesEnabled ( ) const

Definition at line 918 of file kis_dlg_preferences.cc.

919{
920 return m_chkColorSamplerPreviewExtraCircles->isChecked();
921}

◆ colorSamplerPreviewCircleOutlineEnabled()

bool GeneralTab::colorSamplerPreviewCircleOutlineEnabled ( ) const

Definition at line 913 of file kis_dlg_preferences.cc.

914{
915 return m_chkColorSamplerPreviewOutlineEnabled->isChecked();
916}

◆ colorSamplerPreviewCircleThickness()

qreal GeneralTab::colorSamplerPreviewCircleThickness ( ) const

Definition at line 908 of file kis_dlg_preferences.cc.

909{
910 return m_ssbColorSamplerPreviewThickness->value();
911}

◆ colorSamplerPreviewStyle()

KisConfig::ColorSamplerPreviewStyle GeneralTab::colorSamplerPreviewStyle ( ) const

Definition at line 898 of file kis_dlg_preferences.cc.

899{
900 return getColorSamplerPreviewStyleValue(m_cmbColorSamplerPreviewStyle);
901}
static KisConfig::ColorSamplerPreviewStyle getColorSamplerPreviewStyleValue(const QComboBox *cmb)

References getColorSamplerPreviewStyleValue().

◆ compressKra()

bool GeneralTab::compressKra ( )

Definition at line 970 of file kis_dlg_preferences.cc.

971{
972 return m_chkCompressKra->isChecked();
973}

◆ convertToImageColorspaceOnImport()

bool GeneralTab::convertToImageColorspaceOnImport ( )

Definition at line 1040 of file kis_dlg_preferences.cc.

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

◆ cursorStyle()

CursorStyle GeneralTab::cursorStyle ( )

Definition at line 878 of file kis_dlg_preferences.cc.

879{
880 return (CursorStyle)m_cmbCursorShape->currentIndex();
881}
CursorStyle
Definition kis_global.h:62

◆ enableSubWindowOptions

void GeneralTab::enableSubWindowOptions ( int mdi_mode)
privateslot

Definition at line 1144 of file kis_dlg_preferences.cc.

1145{
1146 group_subWinMode->setEnabled(mdi_mode == QMdiArea::SubWindowView);
1147}

◆ eraserCursorStyle()

CursorStyle GeneralTab::eraserCursorStyle ( )

Definition at line 888 of file kis_dlg_preferences.cc.

889{
890 return (CursorStyle)m_cmbEraserCursorShape->currentIndex();
891}

◆ eraserOutlineStyle()

OutlineStyle GeneralTab::eraserOutlineStyle ( )

Definition at line 893 of file kis_dlg_preferences.cc.

894{
895 return (OutlineStyle)m_cmbEraserOutlineShape->currentIndex();
896}
OutlineStyle
Definition kis_global.h:53

◆ exportMimeType()

QString GeneralTab::exportMimeType ( )

Definition at line 985 of file kis_dlg_preferences.cc.

986{
987 return cmbDefaultExportFileType->currentData().toString();
988}

◆ forcedFontDpi()

int GeneralTab::forcedFontDpi ( )

Definition at line 1060 of file kis_dlg_preferences.cc.

1061{
1062 return chkForcedFontDPI->isChecked() ? intForcedFontDPI->value() : -1;
1063}

◆ getBackgroundImage

void GeneralTab::getBackgroundImage ( )
privateslot

Definition at line 1102 of file kis_dlg_preferences.cc.

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

References KoFileDialog::OpenFile.

◆ getColorSamplerPreviewStyleValue()

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

Definition at line 1082 of file kis_dlg_preferences.cc.

1083{
1084 return KisConfig::ColorSamplerPreviewStyle(cmb->currentIndex());
1085}
ColorSamplerPreviewStyle
Definition kis_config.h:138

◆ kineticScrollingEnabled()

bool GeneralTab::kineticScrollingEnabled ( )

Definition at line 1010 of file kis_dlg_preferences.cc.

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

◆ kineticScrollingGesture()

int GeneralTab::kineticScrollingGesture ( )

Definition at line 1015 of file kis_dlg_preferences.cc.

1016{
1017 return m_cmbKineticScrollingGesture->currentIndex();
1018}

◆ kineticScrollingHiddenScrollbars()

bool GeneralTab::kineticScrollingHiddenScrollbars ( )

Definition at line 1025 of file kis_dlg_preferences.cc.

1026{
1027 return m_chkKineticScrollingHideScrollbars->isChecked();
1028}

◆ kineticScrollingSensitivity()

int GeneralTab::kineticScrollingSensitivity ( )

Definition at line 1020 of file kis_dlg_preferences.cc.

1021{
1022 return m_kineticScrollingSensitivitySlider->value();
1023}

◆ longPressEnabled()

bool GeneralTab::longPressEnabled ( )

Definition at line 1005 of file kis_dlg_preferences.cc.

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

◆ mdiMode()

int GeneralTab::mdiMode ( )

Definition at line 960 of file kis_dlg_preferences.cc.

961{
962 return m_cmbMDIType->currentIndex();
963}

◆ outlineStyle()

OutlineStyle GeneralTab::outlineStyle ( )

Definition at line 883 of file kis_dlg_preferences.cc.

884{
885 return (OutlineStyle)m_cmbOutlineShape->currentIndex();
886}

◆ renameDuplicatedLayers()

bool GeneralTab::renameDuplicatedLayers ( )

Definition at line 1097 of file kis_dlg_preferences.cc.

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

◆ renameMergedLayers()

bool GeneralTab::renameMergedLayers ( )

Definition at line 1087 of file kis_dlg_preferences.cc.

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

◆ renamePastedLayers()

bool GeneralTab::renamePastedLayers ( )

Definition at line 1092 of file kis_dlg_preferences.cc.

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

◆ saveSessionOnQuit()

bool GeneralTab::saveSessionOnQuit ( ) const

Definition at line 929 of file kis_dlg_preferences.cc.

930{
931 return chkSaveSessionOnQuit->isChecked();
932}

◆ sessionOnStartup()

KisConfig::SessionOnStartup GeneralTab::sessionOnStartup ( ) const

Definition at line 924 of file kis_dlg_preferences.cc.

925{
926 return (KisConfig::SessionOnStartup)cmbStartupSession->currentIndex();
927}

◆ setColorSamplerPreviewStyleIndexByValue()

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

Definition at line 1077 of file kis_dlg_preferences.cc.

1078{
1079 cmb->setCurrentIndex(int(style));
1080}

◆ setColorSamplerPreviewStyleItems()

void GeneralTab::setColorSamplerPreviewStyleItems ( QComboBox * cmb)
static

Definition at line 1065 of file kis_dlg_preferences.cc.

1066{
1067 // Order is synchronized with KisConfig::ColorSamplerPreviewStyle.
1068 cmb->addItems({
1069 i18nc("Preview option for no color sampler", "None"),
1070 i18nc("Preview option for a circular/ring-shaped color sampler", "Circle"),
1071 i18nc("Preview option for a rectangular color sampler left of the cursor", "Rectangle Left"),
1072 i18nc("Preview option for a rectangular color sampler right of the cursor", "Rectangle Right"),
1073 i18nc("Preview option for a rectangular color sampler above the cursor", "Rectangle Above"),
1074 });
1075}

◆ setDefault()

void GeneralTab::setDefault ( )

Definition at line 736 of file kis_dlg_preferences.cc.

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

850{
851 KisDlgConfigureCumulativeUndo dlg(m_cumulativeUndoData, m_undoStackSize->value(), this);
852 if (dlg.exec() == KoDialog::Accepted) {
853 m_cumulativeUndoData = dlg.cumulativeUndoData();
854 }
855}

References KisDlgConfigureCumulativeUndo::cumulativeUndoData(), and m_cumulativeUndoData.

◆ showCanvasMessages()

bool GeneralTab::showCanvasMessages ( )

Definition at line 965 of file kis_dlg_preferences.cc.

966{
967 return m_chkCanvasMessages->isChecked();
968}

◆ showEraserOutlineWhilePainting()

bool GeneralTab::showEraserOutlineWhilePainting ( )

Definition at line 955 of file kis_dlg_preferences.cc.

956{
957 return m_showEraserOutlinePainting->isChecked();
958}

◆ showOutlineWhilePainting()

bool GeneralTab::showOutlineWhilePainting ( )

Definition at line 950 of file kis_dlg_preferences.cc.

951{
952 return m_showOutlinePainting->isChecked();
953}

◆ showRootLayer()

bool GeneralTab::showRootLayer ( )

Definition at line 934 of file kis_dlg_preferences.cc.

935{
936 return chkShowRootLayer->isChecked();
937}

◆ switchSelectionCtrlAlt()

bool GeneralTab::switchSelectionCtrlAlt ( )

Definition at line 1035 of file kis_dlg_preferences.cc.

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

◆ toolOptionsInDocker()

bool GeneralTab::toolOptionsInDocker ( )

Definition at line 995 of file kis_dlg_preferences.cc.

996{
997 return m_radioToolOptionsInDocker->isChecked();
998}

◆ trimFramesImport()

bool GeneralTab::trimFramesImport ( )

Definition at line 980 of file kis_dlg_preferences.cc.

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

◆ trimKra()

bool GeneralTab::trimKra ( )

Definition at line 975 of file kis_dlg_preferences.cc.

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

◆ undoStackSize()

int GeneralTab::undoStackSize ( )

Definition at line 945 of file kis_dlg_preferences.cc.

946{
947 return m_undoStackSize->value();
948}

◆ updateTouchPressureSensitivityEnabled

void GeneralTab::updateTouchPressureSensitivityEnabled ( int touchPainting)
privateslot

Definition at line 1149 of file kis_dlg_preferences.cc.

1150{
1151 chkTouchPressureSensitivity->setEnabled(touchPainting != int(KisConfig::TOUCH_PAINTING_DISABLED));
1152}
@ TOUCH_PAINTING_DISABLED
Definition kis_config.h:50

References KisConfig::TOUCH_PAINTING_DISABLED.

◆ useZip64()

bool GeneralTab::useZip64 ( )

Definition at line 990 of file kis_dlg_preferences.cc.

991{
992 return chkZip64->isChecked();
993}

◆ zoomMarginSize()

int GeneralTab::zoomMarginSize ( )

Definition at line 1030 of file kis_dlg_preferences.cc.

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

◆ zoomSteps()

int GeneralTab::zoomSteps ( )

Definition at line 1000 of file kis_dlg_preferences.cc.

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

Member Data Documentation

◆ m_cumulativeUndoData

KisCumulativeUndoData GeneralTab::m_cumulativeUndoData

Definition at line 130 of file kis_dlg_preferences.h.

◆ m_pasteFormatGroup

QButtonGroup GeneralTab::m_pasteFormatGroup

Definition at line 129 of file kis_dlg_preferences.h.


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