~ubuntu-branches/ubuntu/oneiric/koffice/oneiric-updates

« back to all changes in this revision

Viewing changes to krita/ui/kis_config.cc

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-27 17:52:57 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101027175257-s04zqqk5bs8ckm9o
Tags: 1:2.2.83-0ubuntu1
* Merge with Debian git remaining changes:
 - Add build-deps on librcps-dev, opengtl-dev, libqtgtl-dev, freetds-dev,
   create-resources, libspnav-dev
 - Remove needless build-dep on libwv2-dev
 - koffice-libs recommends create-resources
 - krita recommends pstoedit
 - Keep our patches
* New upstream release 2.3 beta 3
  - Remove debian/patches fixed by upstream
  - Update install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include <QStringList>
31
31
 
32
32
#include "kis_global.h"
 
33
#include <KoColorSpaceRegistry.h>
 
34
#include <KoColorProfile.h>
33
35
 
34
36
 
35
37
namespace
98
100
    return m_cfg.readEntry("imageResolutionDef", IMAGE_DEFAULT_RESOLUTION) / 72.0;
99
101
}
100
102
 
 
103
QString KisConfig::defColorModel() const
 
104
{
 
105
    return m_cfg.readEntry("colorModelDef", KoColorSpaceRegistry::instance()->rgb8()->colorModelId().id());
 
106
}
 
107
 
 
108
void KisConfig::defColorModel(const QString & model)
 
109
{
 
110
    m_cfg.writeEntry("colorModelDef", model);
 
111
}
 
112
 
 
113
QString KisConfig::defColorDepth() const
 
114
{
 
115
    return m_cfg.readEntry("colorDepthDef", KoColorSpaceRegistry::instance()->rgb8()->colorDepthId().id());
 
116
}
 
117
 
 
118
void KisConfig::defColorDepth(const QString & depth)
 
119
{
 
120
    m_cfg.writeEntry("colorDepthDef", depth);
 
121
}
 
122
 
 
123
QString KisConfig::defColorProfile() const
 
124
{
 
125
    return m_cfg.readEntry("colorProfileDef", KoColorSpaceRegistry::instance()->rgb8()->profile()->name());
 
126
}
 
127
 
 
128
void KisConfig::defColorProfile(const QString & profile)
 
129
{
 
130
    m_cfg.writeEntry("colorProfileDef", profile);
 
131
}
 
132
 
101
133
void KisConfig::defImageWidth(qint32 width)
102
134
{
103
135
    m_cfg.writeEntry("imageWidthDef", width);
153
185
 
154
186
QString KisConfig::printerColorSpace() const
155
187
{
156
 
    return m_cfg.readEntry("printerColorSpace", "RGBA");
 
188
    //TODO currently only rgb8 is supported
 
189
    //return m_cfg.readEntry("printerColorSpace", "RGBA");
 
190
    return QString("RGBA");
157
191
}
158
192
 
159
193
void KisConfig::setPrinterColorSpace(const QString & printerColorSpace)
237
271
    m_cfg.writeEntry("useOpenGLShaders", useOpenGLShaders);
238
272
}
239
273
 
 
274
bool KisConfig::useOpenGLToolOutlineWorkaround() const
 
275
{
 
276
    return m_cfg.readEntry("useOpenGLToolOutlineWorkaround", false);
 
277
}
 
278
 
 
279
void KisConfig::setUseOpenGLToolOutlineWorkaround(bool useWorkaround)
 
280
{
 
281
    m_cfg.writeEntry("useOpenGLToolOutlineWorkaround", useWorkaround);
 
282
}
 
283
 
240
284
qint32 KisConfig::maxNumberOfThreads()
241
285
{
242
286
    return m_cfg.readEntry("maxthreads", QThread::idealThreadCount());
411
455
    m_cfg.writeEntry("scrollingcheckers", sc);
412
456
}
413
457
 
 
458
QColor KisConfig::canvasBorderColor()
 
459
{
 
460
    QColor color(Qt::gray);
 
461
    return m_cfg.readEntry("canvasBorderColor", color);
 
462
}
 
463
 
 
464
void KisConfig::setCanvasBorderColor(const QColor& color)
 
465
{
 
466
    m_cfg.writeEntry("canvasBorderColor", color);
 
467
}
 
468
 
 
469
 
414
470
QColor KisConfig::checkersColor()
415
471
{
416
472
    QColor col(220, 220, 220);
492
548
    m_cfg.writeEntry("fast_zoom", useNearestNeigbour);
493
549
}
494
550
 
495
 
bool KisConfig::useMipmapping()
496
 
{
497
 
    return m_cfg.readEntry("useMipmapping", false);
498
 
}
499
 
 
500
 
void KisConfig::setUseMipmapping(bool useMipmapping)
501
 
{
502
 
    m_cfg.writeEntry("useMipmapping", useMipmapping);
503
 
}
504
 
 
505
551
bool KisConfig::useSampling()
506
552
{
507
553
    return m_cfg.readEntry("sampled_scaling", false);
563
609
    m_cfg.writeEntry("ShowRootLayer", showRootLayer);
564
610
}
565
611
 
 
612
bool KisConfig::showOutlineWhilePainting()
 
613
{
 
614
    return m_cfg.readEntry("ShowOutlineWhilePainting", true);
 
615
}
 
616
 
 
617
void KisConfig::setShowOutlineWhilePainting(bool showOutlineWhilePainting)
 
618
{
 
619
    m_cfg.writeEntry("ShowOutlineWhilePainting", showOutlineWhilePainting);
 
620
}
 
621
 
566
622
int KisConfig::autoSaveInterval() {
567
623
    return m_cfg.readEntry("AutoSaveInterval", KoDocument::defaultAutoSave());
568
624
}
571
627
    return m_cfg.writeEntry("AutoSaveInterval", seconds);
572
628
}
573
629
 
 
630
bool KisConfig::backupFile()
 
631
{
 
632
    return m_cfg.readEntry("CreateBackupFile", true);
 
633
}
 
634
 
 
635
void KisConfig::setBackupFile(bool backupFile)
 
636
{
 
637
     m_cfg.writeEntry("CreateBackupFile", backupFile);
 
638
}
 
639
 
574
640
quint32 KisConfig::maxCachedImageSize()
575
641
{
576
642
    // Let's say, 5 megapixels
647
713
{
648
714
    m_cfg.writeEntry("PaintopPopupDetached", detached);
649
715
}
 
716
 
 
717
QString KisConfig::pressureTabletCurve() const
 
718
{
 
719
    return m_cfg.readEntry("tabletPressureCurve","0,0;1,1;");
 
720
}
 
721
 
 
722
void KisConfig::setPressureTabletCurve(const QString& curveString) const
 
723
{
 
724
    m_cfg.writeEntry("tabletPressureCurve", curveString);
 
725
}
 
726
 
 
727
bool KisConfig::zoomWithWheel() const
 
728
{
 
729
    return m_cfg.readEntry("ZoomWithWheel", true);
 
730
}
 
731
 
 
732
void KisConfig::setZoomWithWheel(const bool zoom) const
 
733
{
 
734
    m_cfg.writeEntry("ZoomWithWheel", zoom);
 
735
}
 
736
 
 
737
qreal KisConfig::vastScrolling() const
 
738
{
 
739
    return m_cfg.readEntry("vastScrolling", 0.9);
 
740
}
 
741
 
 
742
void KisConfig::setVastScrolling(const qreal factor) const
 
743
{
 
744
    m_cfg.writeEntry("vastScrolling", factor);
 
745
}
 
746
 
 
747
int KisConfig::presetChooserViewMode() const
 
748
{
 
749
    return m_cfg.readEntry("presetChooserViewMode", 0);
 
750
}
 
751
 
 
752
void KisConfig::setPresetChooserViewMode(const int mode)
 
753
{
 
754
    m_cfg.writeEntry("presetChooserViewMode", mode);
 
755
}
 
756
 
 
757
bool KisConfig::firstRun() const
 
758
{
 
759
    return m_cfg.readEntry("firstRun", true);
 
760
}
 
761
 
 
762
void KisConfig::setFirstRun(const bool first) const
 
763
{
 
764
    m_cfg.writeEntry("firstRun", first);
 
765
}
 
766
 
 
767
bool KisConfig::clicklessSpacePan() const
 
768
{
 
769
    return m_cfg.readEntry("clicklessSpacePan", true);
 
770
}
 
771
 
 
772
void KisConfig::setClicklessSpacePan(const bool toggle) const
 
773
{
 
774
    m_cfg.writeEntry("clicklessSpacePan", toggle);
 
775
}