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

master
Marc Wäckerlin 13 years ago
parent 4c815ad950
commit dd70dd969b
  1. 6
      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,12 +863,14 @@ 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);
} }
if (_bookmarks) {
_bookmarks->clear(); _bookmarks->clear();
for (QStringList::iterator it(urls.begin()); it!=urls.end(); ++it) { for (QStringList::iterator it(urls.begin()); it!=urls.end(); ++it) {
QAction* a(_bookmarks->addAction(*it)); QAction* a(_bookmarks->addAction(*it));
a->setData(*it); a->setData(*it);
connect(a, SIGNAL(triggered(bool)), SLOT(loadFromHistory())); 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());
for (QStringList::iterator it(tabs.begin()); it!=tabs.end(); ++it) { for (QStringList::iterator it(tabs.begin()); it!=tabs.end(); ++it) {

Loading…
Cancel
Save