more features hidden in kiosk/no-settings mode; refs #109

master
Marc Wäckerlin 13 years ago
parent 4c815ad950
commit dd70dd969b
  1. 16
      src/browser.hxx

@ -202,6 +202,9 @@ class Browser: public QMainWindow, protected Ui::Browser {
if (!settings || _kiosk) { if (!settings || _kiosk) {
actionSettings->setVisible(false); actionSettings->setVisible(false);
actionEditBookmarks->setVisible(false); actionEditBookmarks->setVisible(false);
actionSaveWindowState->setVisible(false);
actionLoadWindowState->setVisible(false);
delete _bookmarks; _bookmarks=0;
} }
if (_kiosk) { if (_kiosk) {
actionNew->setEnabled(false); actionNew->setEnabled(false);
@ -580,6 +583,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
void on_actionAddBookmark_triggered() { void on_actionAddBookmark_triggered() {
QComboBox* url(qobject_cast<QComboBox*>(_url)); QComboBox* url(qobject_cast<QComboBox*>(_url));
if (!_bookmarks) return;
if (_url) { if (_url) {
url->addItem(url->currentText()); url->addItem(url->currentText());
QAction* a(_bookmarks->addAction(url->currentText())); QAction* a(_bookmarks->addAction(url->currentText()));
@ -859,11 +863,13 @@ class Browser: public QMainWindow, protected Ui::Browser {
qobject_cast<QComboBox*>(_url)->clear(); qobject_cast<QComboBox*>(_url)->clear();
qobject_cast<QComboBox*>(_url)->addItems(urls); qobject_cast<QComboBox*>(_url)->addItems(urls);
} }
_bookmarks->clear(); if (_bookmarks) {
for (QStringList::iterator it(urls.begin()); it!=urls.end(); ++it) { _bookmarks->clear();
QAction* a(_bookmarks->addAction(*it)); for (QStringList::iterator it(urls.begin()); it!=urls.end(); ++it) {
a->setData(*it); QAction* a(_bookmarks->addAction(*it));
connect(a, SIGNAL(triggered(bool)), SLOT(loadFromHistory())); a->setData(*it);
connect(a, SIGNAL(triggered(bool)), SLOT(loadFromHistory()));
}
} }
QStringList tabs(_settings()->value("Window/Tabs").toStringList()); QStringList tabs(_settings()->value("Window/Tabs").toStringList());
int oldCnt(_tabs->count()); int oldCnt(_tabs->count());

Loading…
Cancel
Save