namespace forgotten; refs #167

master
Marc Wäckerlin 12 years ago
parent 041ed6b783
commit 7264422549
  1. 22
      src/browser.hxx

@ -65,7 +65,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
qbrowserlib::Settings::MimeTypes(), qbrowserlib::Settings::MimeTypes(),
bool kiosk = false, bool login = true, bool quirks=true, bool kiosk = false, bool login = true, bool quirks=true,
QString bookmarkfile=QString()): QString bookmarkfile=QString()):
_url(0), _find(new ButtonLineEdit), _url(0), _find(new qbrowserlib::ButtonLineEdit),
_kiosk(kiosk), _kiosk(kiosk),
_downloadManager(new DownloadManager), _downloadManager(new DownloadManager),
_settings(mimeTypes, this, settings, !kiosk), _settings(mimeTypes, this, settings, !kiosk),
@ -73,7 +73,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
_proxy("http://swisssign.com", this), _proxy("http://swisssign.com", this),
_showErrorLog(0), _showErrorLog(0),
_startUrl(urls.size()), _startUrl(urls.size()),
_quirks(quirks), _search(new ButtonLineEdit), _quirks(quirks), _search(new qbrowserlib::ButtonLineEdit),
_searchEngines(new QComboBox), _searchEngines(new QComboBox),
_bookmarkfile(bookmarkfile), _bookmarkfile(bookmarkfile),
_executor(&_settings) { _executor(&_settings) {
@ -129,7 +129,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
_toolbar->addWidget(urlFrame); _toolbar->addWidget(urlFrame);
layout->addWidget(_url); layout->addWidget(_url);
combo->setInsertPolicy(QComboBox::NoInsert); combo->setInsertPolicy(QComboBox::NoInsert);
combo->setLineEdit(new ButtonLineEdit(combo)); combo->setLineEdit(new qbrowserlib::ButtonLineEdit(combo));
combo->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength); combo->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength);
sp=combo->sizePolicy(); sp=combo->sizePolicy();
sp.setHorizontalPolicy(QSizePolicy::Expanding); sp.setHorizontalPolicy(QSizePolicy::Expanding);
@ -142,15 +142,15 @@ class Browser: public QMainWindow, protected Ui::Browser {
assert(connect(combo->lineEdit(), SIGNAL(textChanged(QString)), assert(connect(combo->lineEdit(), SIGNAL(textChanged(QString)),
SLOT(goodUrl()))); SLOT(goodUrl())));
if (_quirks) { if (_quirks) {
dynamic_cast<ButtonLineEdit*>(combo->lineEdit())->add dynamic_cast<qbrowserlib::ButtonLineEdit*>(combo->lineEdit())->add
(actionStop); (actionStop);
dynamic_cast<ButtonLineEdit*>(combo->lineEdit())->add dynamic_cast<qbrowserlib::ButtonLineEdit*>(combo->lineEdit())->add
(actionReload); (actionReload);
} }
if (!_quirks) { if (!_quirks) {
dynamic_cast<ButtonLineEdit*>(combo->lineEdit())->add dynamic_cast<qbrowserlib::ButtonLineEdit*>(combo->lineEdit())->add
(actionAddBookmark); (actionAddBookmark);
dynamic_cast<ButtonLineEdit*>(combo->lineEdit())->add dynamic_cast<qbrowserlib::ButtonLineEdit*>(combo->lineEdit())->add
(actionClearLocation); (actionClearLocation);
} }
_editbookmarks = _editbookmarks =
@ -1455,7 +1455,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
void badUrl() { void badUrl() {
if (qobject_cast<QComboBox*>(_url)) if (qobject_cast<QComboBox*>(_url))
dynamic_cast<ButtonLineEdit*> dynamic_cast<qbrowserlib::ButtonLineEdit*>
(qobject_cast<QComboBox*>(_url)->lineEdit()) (qobject_cast<QComboBox*>(_url)->lineEdit())
->changeStyleSheet(tr("background-color: #F77", "invalid url")); ->changeStyleSheet(tr("background-color: #F77", "invalid url"));
else else
@ -1465,7 +1465,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
void goodUrl() { void goodUrl() {
if (qobject_cast<QComboBox*>(_url)) if (qobject_cast<QComboBox*>(_url))
dynamic_cast<ButtonLineEdit*> dynamic_cast<qbrowserlib::ButtonLineEdit*>
(qobject_cast<QComboBox*>(_url)->lineEdit()) (qobject_cast<QComboBox*>(_url)->lineEdit())
->changeStyleSheet(tr("background-color: white", "valid url")); ->changeStyleSheet(tr("background-color: white", "valid url"));
else else
@ -1517,7 +1517,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
private: private:
QWidget* _url; QWidget* _url;
ButtonLineEdit* _find; qbrowserlib::ButtonLineEdit* _find;
QSlider* _zoom; QSlider* _zoom;
QProgressBar* _progress; QProgressBar* _progress;
QString _home; QString _home;
@ -1533,7 +1533,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
std::auto_ptr<EditBookmarks> _editbookmarks; std::auto_ptr<EditBookmarks> _editbookmarks;
bool _startUrl; bool _startUrl;
bool _quirks; bool _quirks;
ButtonLineEdit* _search; qbrowserlib::ButtonLineEdit* _search;
QComboBox* _searchEngines; QComboBox* _searchEngines;
FileStorage _bookmarkfile; FileStorage _bookmarkfile;
qbrowserlib::Executor _executor; qbrowserlib::Executor _executor;

Loading…
Cancel
Save