master
Marc Wäckerlin 14 years ago
parent bbe3f9343a
commit b8d0d22838
  1. 2
      swisssurfer/src/browser.hxx
  2. 32
      swisssurfer/src/settings.hxx
  3. 2
      swisssurfer/src/settings.ui
  4. 5
      swisssurfer/src/swisssurfer_de.ts
  5. 5
      swisssurfer/src/swisssurfer_en.ts
  6. 5
      swisssurfer/src/swisssurfer_fr.ts
  7. 5
      swisssurfer/src/swisssurfer_it.ts

@ -80,7 +80,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
_zoom->setValue(100); _zoom->setValue(100);
_zoom->setSingleStep(1); _zoom->setSingleStep(1);
_zoom->setPageStep(10); _zoom->setPageStep(10);
_zoom->setTickPosition(QSlider::TicksBothSides); _zoom->setTickPosition(QSlider::TicksAbove);
assert(connect(_zoom, SIGNAL(valueChanged(int)), SLOT(zoom(int)))); assert(connect(_zoom, SIGNAL(valueChanged(int)), SLOT(zoom(int))));
_url = new QComboBox(_toolbar); _url = new QComboBox(_toolbar);
_url->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, _url->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,

@ -10,6 +10,7 @@
#include <QtCore/QSettings> #include <QtCore/QSettings>
#include <QtCore/QMap> #include <QtCore/QMap>
#include <QtCore/QList> #include <QtCore/QList>
#include <QtGui/QLineEdit>
#include <cassert> #include <cassert>
#include <QtCore/QDebug> #include <QtCore/QDebug>
@ -113,6 +114,11 @@ class Settings: public QDialog, protected Ui::Settings {
return _checkboxes[name].second; return _checkboxes[name].second;
} }
const QString& text(const QString& name) {
assert(_lineedits.find(name)!=_lineedits.end());
return _lineedits[name].second;
}
const MimeTypes& mimetypes() const { const MimeTypes& mimetypes() const {
return _mimetypes; return _mimetypes;
} }
@ -155,6 +161,11 @@ class Settings: public QDialog, protected Ui::Settings {
it!=_checkboxes.end(); ++it) it!=_checkboxes.end(); ++it)
_settings->setValue _settings->setValue
(QString("Flags/%1").arg(it->first), it->second.second); (QString("Flags/%1").arg(it->first), it->second.second);
// LineEdits
for (LineEdits::iterator it(_lineedits.begin());
it!=_lineedits.end(); ++it)
_settings->setValue
(QString("Texts/%1").arg(it->first), it->second.second);
// MimeTypes // MimeTypes
_settings->setValue("QWebSettings/MimeTypes", _mimetypes); _settings->setValue("QWebSettings/MimeTypes", _mimetypes);
// Search Engines // Search Engines
@ -186,6 +197,17 @@ class Settings: public QDialog, protected Ui::Settings {
it->second.second = val.toBool(); it->second.second = val.toBool();
} }
} }
// LineEdits
for (LineEdits::iterator it(_lineedits.begin());
it!=_lineedits.end(); ++it) {
QVariant val
(_settings->value
(QString("Texts/%1").arg(it->first), it->second.second));
if (val.isValid() && val.canConvert(QVariant::String)) {
it->second.first->setText(val.toString());
it->second.second = val.toString();
}
}
// MimeTypes // MimeTypes
if (overwriteMimeTypes) { if (overwriteMimeTypes) {
QVariant val(_settings->value("QWebSettings/MimeTypes")); QVariant val(_settings->value("QWebSettings/MimeTypes"));
@ -212,6 +234,10 @@ class Settings: public QDialog, protected Ui::Settings {
for (CheckBoxes::iterator it(_checkboxes.begin()); for (CheckBoxes::iterator it(_checkboxes.begin());
it!=_checkboxes.end(); ++it) it!=_checkboxes.end(); ++it)
it->second.second = it->second.first->isChecked(); it->second.second = it->second.first->isChecked();
// LineEdits
for (LineEdits::iterator it(_lineedits.begin());
it!=_lineedits.end(); ++it)
it->second.second = it->second.first->text();
// MimeTypes // MimeTypes
_mimetypes.clear(); _mimetypes.clear();
for (int row(_mimeTypeTable->rowCount()); row--;) for (int row(_mimeTypeTable->rowCount()); row--;)
@ -239,6 +265,10 @@ class Settings: public QDialog, protected Ui::Settings {
for (CheckBoxes::iterator it(_checkboxes.begin()); for (CheckBoxes::iterator it(_checkboxes.begin());
it!=_checkboxes.end(); ++it) it!=_checkboxes.end(); ++it)
it->second.first->setChecked(it->second.second); it->second.first->setChecked(it->second.second);
// LineEdits
for (LineEdits::iterator it(_lineedits.begin());
it!=_lineedits.end(); ++it)
it->second.first->setText(it->second.second);
// MimeTypes // MimeTypes
_mimeTypeTable->setRowCount(_mimetypes.size()); _mimeTypeTable->setRowCount(_mimetypes.size());
_mimeTypeTable->verticalHeader()->show(); _mimeTypeTable->verticalHeader()->show();
@ -315,6 +345,8 @@ class Settings: public QDialog, protected Ui::Settings {
Attributes _attributes; Attributes _attributes;
typedef std::map<QString, std::pair<QCheckBox*, bool> > CheckBoxes; typedef std::map<QString, std::pair<QCheckBox*, bool> > CheckBoxes;
CheckBoxes _checkboxes; CheckBoxes _checkboxes;
typedef std::map<QString, std::pair<QLineEdit*, QString> > LineEdits;
LineEdits _lineedits;
QSettings* _settings; QSettings* _settings;
bool _autoWrite; bool _autoWrite;
MimeTypes _mimetypes; MimeTypes _mimetypes;

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>615</width> <width>611</width>
<height>383</height> <height>383</height>
</rect> </rect>
</property> </property>

@ -213,6 +213,11 @@
<source>&amp;Proxy ...</source> <source>&amp;Proxy ...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="browser.ui" line="326"/>
<source>Auto Zoom</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<location filename="browser.ui" line="143"/> <location filename="browser.ui" line="143"/>
<location filename="browser.ui" line="279"/> <location filename="browser.ui" line="279"/>

@ -243,6 +243,11 @@
<source>&amp;Proxy ...</source> <source>&amp;Proxy ...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="browser.ui" line="326"/>
<source>Auto Zoom</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<location filename="browser.hxx" line="442"/> <location filename="browser.hxx" line="442"/>
<source>Checking: %1</source> <source>Checking: %1</source>

@ -213,6 +213,11 @@
<source>&amp;Proxy ...</source> <source>&amp;Proxy ...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="browser.ui" line="326"/>
<source>Auto Zoom</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<location filename="browser.ui" line="143"/> <location filename="browser.ui" line="143"/>
<location filename="browser.ui" line="279"/> <location filename="browser.ui" line="279"/>

@ -213,6 +213,11 @@
<source>&amp;Proxy ...</source> <source>&amp;Proxy ...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="browser.ui" line="326"/>
<source>Auto Zoom</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<location filename="browser.ui" line="143"/> <location filename="browser.ui" line="143"/>
<location filename="browser.ui" line="279"/> <location filename="browser.ui" line="279"/>

Loading…
Cancel
Save