Subversion Repositories Scribus

Rev

Rev 14539 | Rev 15021 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
14539 jghali 1
/*
2
For general Scribus (>=1.3.2) copyright and licensing information please refer
3
to the COPYING file provided with the program. Following this notice may exist
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
5
for which a new license (GPL+exception) is in place.
6
*/
7
 
8
#include <QFileDialog>
9
#include <QString>
10
 
11
#include "prefs_imagecache.h"
12
#include "prefsstructs.h"
13
 
14
Prefs_ImageCache::Prefs_ImageCache(QWidget* parent)
15
        : Prefs_Pane(parent)
16
{
17
        setupUi(this);
18
        languageChange();
19
}
20
 
21
Prefs_ImageCache::~Prefs_ImageCache()
22
{
23
}
24
 
25
void Prefs_ImageCache::languageChange()
26
{
27
        enableImageCacheCheckBox->setToolTip( "<qt>" + tr( "Enabling the image cache will significantly speed up the loading of images. Enable the cache if you are often working on large documents with lots of images and if you have plenty of disk space in your application data directory." ) + "</qt>" );
28
        cacheSizeLimitSpinBox->setToolTip( "<qt>"+ tr("Limit the total size of all files in the image cache directory to this amount.")+"</qt>" );
29
        cacheEntryLimitSpinBox->setToolTip( "<qt>" + tr( "Limit the number of cache entries to this number." ) + "</qt>" );
30
        compressionLevelSpinBox->setToolTip( "<qt>" + tr( "Set the level of compression for images in the cache. Higher values result in smaller cache files but also make writes to the cache slower." ) + "</qt>" );
31
}
32
 
33
void Prefs_ImageCache::restoreDefaults(struct ApplicationPrefs *prefsData)
34
{
35
        enableImageCacheCheckBox->setChecked(prefsData->imageCachePrefs.cacheEnabled);
36
        cacheSizeLimitSpinBox->setValue(prefsData->imageCachePrefs.maxCacheSizeMiB);
37
        cacheEntryLimitSpinBox->setValue(prefsData->imageCachePrefs.maxCacheEntries);
38
        compressionLevelSpinBox->setValue(prefsData->imageCachePrefs.compressionLevel);
39
}
40
 
41
void Prefs_ImageCache::saveGuiToPrefs(struct ApplicationPrefs *prefsData) const
42
{
43
        prefsData->imageCachePrefs.cacheEnabled = enableImageCacheCheckBox->isChecked();
44
        prefsData->imageCachePrefs.maxCacheSizeMiB = cacheSizeLimitSpinBox->value();
45
        prefsData->imageCachePrefs.maxCacheEntries = cacheEntryLimitSpinBox->value();
46
        prefsData->imageCachePrefs.compressionLevel = compressionLevelSpinBox->value();
47
}
14610 cbradney 48