|
|
|
@ -105,13 +105,10 @@ class Browser: public QMainWindow, protected Ui::Browser { |
|
|
|
|
assert(connect(_addBookmark, SIGNAL(clicked(bool)), |
|
|
|
|
SLOT(addBookmark()))); |
|
|
|
|
} |
|
|
|
|
if (!_kiosk && _settings.flag("SaveWindowState") && _settings()) { |
|
|
|
|
loadWin(); |
|
|
|
|
for (int i(0); i<urls.size(); ++i) load(urls.at(i), newTab()); |
|
|
|
|
} else { |
|
|
|
|
if (urls.size()) load(urls.at(0)); |
|
|
|
|
for (int i(1); i<urls.size(); ++i) load(urls.at(i), newTab()); |
|
|
|
|
} |
|
|
|
|
if (!_kiosk && _settings.flag("SaveWindowState") && _settings()) |
|
|
|
|
loadWin(urls.size()); |
|
|
|
|
if (urls.size()) load(urls.at(0)); |
|
|
|
|
for (int i(1); i<urls.size(); ++i) load(urls.at(i), newTab()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
~Browser() { |
|
|
|
@ -369,7 +366,9 @@ class Browser: public QMainWindow, protected Ui::Browser { |
|
|
|
|
->selectedText()); |
|
|
|
|
} |
|
|
|
|
disconnect(_find, SIGNAL(returnPressed()), this, SLOT(rfind())); |
|
|
|
|
disconnect(_find, SIGNAL(textEdited(QString)), this, SLOT(rfind())); |
|
|
|
|
assert(connect(_find, SIGNAL(returnPressed()), SLOT(find()))); |
|
|
|
|
assert(connect(_find, SIGNAL(textEdited(QString)), SLOT(find()))); |
|
|
|
|
_find->setFocus(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -380,7 +379,9 @@ class Browser: public QMainWindow, protected Ui::Browser { |
|
|
|
|
->selectedText()); |
|
|
|
|
} |
|
|
|
|
disconnect(_find, SIGNAL(returnPressed()), this, SLOT(find())); |
|
|
|
|
disconnect(_find, SIGNAL(textEdited(QString)), this, SLOT(find())); |
|
|
|
|
assert(connect(_find, SIGNAL(returnPressed()), SLOT(rfind()))); |
|
|
|
|
assert(connect(_find, SIGNAL(textEdited(QString)), SLOT(rfind()))); |
|
|
|
|
_find->setFocus(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -921,14 +922,15 @@ class Browser: public QMainWindow, protected Ui::Browser { |
|
|
|
|
_settings()->setValue("Window/WindowState", saveState()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void loadWin() { |
|
|
|
|
void loadWin(bool noRrestoreTabs=true) { |
|
|
|
|
QStringList urls(_settings()->value("Window/Urls").toStringList()); |
|
|
|
|
urls.sort(); |
|
|
|
|
urls.removeDuplicates(); |
|
|
|
|
_url->addItems(urls); |
|
|
|
|
QStringList tabs(_settings()->value("Window/Tabs").toStringList()); |
|
|
|
|
for (QStringList::iterator it(tabs.begin()); it!=tabs.end(); ++it) |
|
|
|
|
load(*it, newTab()); |
|
|
|
|
if (!noRrestoreTabs) |
|
|
|
|
for (QStringList::iterator it(tabs.begin()); it!=tabs.end(); ++it) |
|
|
|
|
load(*it, newTab()); |
|
|
|
|
if (_tabs->count()>1) _tabs->removeTab(0); |
|
|
|
|
_tabs->setTabsClosable(_tabs->count()>1); |
|
|
|
|
_tabs->setCurrentIndex(_settings()->value("Window/CurrentTab").toInt()); |
|
|
|
|