Exchanged the cache size slider with a spinbox and enhanced the range (#2170)

remotes/origin/falkon
Voldracarno Draconor 9 years ago committed by David Rosca
parent b5eda4f803
commit ae449974a9
  1. 8
      src/lib/preferences/preferences.cpp
  2. 1
      src/lib/preferences/preferences.h
  3. 35
      src/lib/preferences/preferences.ui

@ -288,7 +288,6 @@ Preferences::Preferences(BrowserWindow* window)
//Cache
ui->allowCache->setChecked(settings.value("AllowLocalCache", true).toBool());
ui->cacheMB->setValue(settings.value("LocalCacheSize", 50).toInt());
ui->MBlabel->setText(settings.value("LocalCacheSize", 50).toString() + " MB");
ui->cachePath->setText(settings.value("CachePath", QWebEngineProfile::defaultProfile()->cachePath()).toString());
connect(ui->allowCache, SIGNAL(clicked(bool)), this, SLOT(allowCacheChanged(bool)));
connect(ui->cacheMB, SIGNAL(valueChanged(int)), this, SLOT(cacheValueChanged(int)));
@ -605,7 +604,7 @@ void Preferences::makeQupZillaDefault()
void Preferences::allowCacheChanged(bool state)
{
ui->cacheFrame->setEnabled(state);
ui->label_21->setEnabled(state); //'Maximum' Label
ui->cacheMB->setEnabled(state);
ui->storeCacheLabel->setEnabled(state);
ui->cachePath->setEnabled(state);
@ -742,11 +741,6 @@ void Preferences::afterLaunchChanged(int value)
ui->dontLoadTabsUntilSelected->setEnabled(value == 3);
}
void Preferences::cacheValueChanged(int value)
{
ui->MBlabel->setText(QString::number(value) + " MB");
}
void Preferences::changeCachePathClicked()
{
QString path = QzTools::getExistingDirectory("Preferences-CachePath", this, tr("Choose cache path..."), ui->cachePath->text());

@ -77,7 +77,6 @@ private slots:
void newTabChanged(int value);
void afterLaunchChanged(int value);
void cacheValueChanged(int value);
void createProfile();
void deleteProfile();

@ -1212,39 +1212,26 @@
<layout class="QGridLayout" name="gridLayout_19">
<item row="0" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout_4">
<item row="1" column="1">
<widget class="QFrame" name="cacheFrame">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="label_21">
<property name="text">
<string>Maximum </string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="MBlabel">
<property name="text">
<string>50 MB</string>
</property>
</widget>
</item>
</layout>
<item row="1" column="1">
<widget class="QLabel" name="label_21">
<property name="text">
<string>Maximum:</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QSlider" name="cacheMB">
<widget class="QSpinBox" name="cacheMB">
<property name="minimum">
<number>20</number>
<number>1</number>
</property>
<property name="maximum">
<number>200</number>
<number>999999999</number>
</property>
<property name="sliderPosition">
<property name="value">
<number>50</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
<property name="suffix">
<string> MB</string>
</property>
</widget>
</item>

Loading…
Cancel
Save