summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mainview.cpp1
-rw-r--r--src/networkaccessmanager.cpp2
-rw-r--r--src/sessionmanager.cpp27
-rw-r--r--src/settings/adblockwidget.cpp6
-rw-r--r--src/urlbar/completionwidget.cpp9
-rw-r--r--src/urlbar/urlbar.cpp2
6 files changed, 43 insertions, 4 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 4fbd5959..58247d53 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -123,6 +123,7 @@ void MainView::postLaunch()
// Session Manager
connect(this, SIGNAL(tabsChanged()), Application::sessionManager(), SLOT(saveSession()));
+ connect(this, SIGNAL(currentChanged(int)), Application::sessionManager(), SLOT(saveSession()));
m_addTabButton->setDefaultAction(m_parentWindow->actionByName("new_tab"));
diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp
index e1d2e6eb..4aa2488a 100644
--- a/src/networkaccessmanager.cpp
+++ b/src/networkaccessmanager.cpp
@@ -97,7 +97,7 @@ QNetworkReply *NetworkAccessManager::createRequest(QNetworkAccessManager::Operat
if(!reply)
reply = AccessManager::createRequest(op, req, outgoingData);
- if(parentPage->hasNetworkAnalyzerEnabled())
+ if(parentPage && parentPage->hasNetworkAnalyzerEnabled())
emit networkData( op, req, reply );
return reply;
diff --git a/src/sessionmanager.cpp b/src/sessionmanager.cpp
index 6aada509..97d9bc36 100644
--- a/src/sessionmanager.cpp
+++ b/src/sessionmanager.cpp
@@ -35,6 +35,7 @@
#include "mainwindow.h"
#include "mainview.h"
#include "webtab.h"
+#include "tabbar.h"
// KDE Includes
#include <KStandardDirs>
@@ -79,6 +80,10 @@ void SessionManager::saveSession()
{
out << mv->webTab(i)->url().toEncoded() << "\n";
}
+
+ // Current Tab for window
+ out << "currenttab\n";
+ out << mv->tabBar()->currentIndex() << "\n";
}
sessionFile.close();
m_safe = true;
@@ -108,10 +113,30 @@ bool SessionManager::restoreSession()
kDebug() << "New Window line: " << line;
Application::instance()->loadUrl( KUrl(line), Rekonq::NewWindow);
}
+ else if (line == QString("currenttab"))
+ {
+ kDebug() << "Set Current Tab Line" << endl;
+ line = in.readLine();
+ bool ok;
+ int idx = line.toInt(&ok);
+ if (ok)
+ {
+ kDebug() << "Setting current tab to " << idx << endl;
+ // Get last mainwindow created which will be first one in mainwindow list
+ MainWindowList wl = Application::instance()->mainWindowList();
+ if (wl.count() > 0)
+ {
+ MainView *mv = wl[0].data()->mainView();
+ emit mv->tabBar()->setCurrentIndex(idx);
+ }
+ }
+ else
+ kDebug() << "Failed to convert currenttab index line <" << line << "> to in value" << endl;
+ }
else
{
kDebug() << "New Current Tab line: " << line;
- Application::instance()->loadUrl( KUrl(line), Rekonq::NewCurrentTab);
+ Application::instance()->loadUrl( KUrl(line), Rekonq::NewCurrentTab);
}
}
while (!line.isEmpty());
diff --git a/src/settings/adblockwidget.cpp b/src/settings/adblockwidget.cpp
index 412f03d9..a703fe09 100644
--- a/src/settings/adblockwidget.cpp
+++ b/src/settings/adblockwidget.cpp
@@ -108,6 +108,9 @@ void AdBlockWidget::load()
{
bool isAdBlockEnabled = ReKonfig::adBlockEnabled();
checkEnableAdblock->setChecked(isAdBlockEnabled);
+ // update enabled status
+ checkHideAds->setEnabled(checkEnableAdblock->isChecked());
+ tabWidget->setEnabled(checkEnableAdblock->isChecked());
bool areImageFiltered = ReKonfig::hideAdsEnabled();
checkHideAds->setChecked(areImageFiltered);
@@ -181,6 +184,9 @@ void AdBlockWidget::save()
void AdBlockWidget::hasChanged()
{
+ // update enabled status
+ checkHideAds->setEnabled(checkEnableAdblock->isChecked());
+ tabWidget->setEnabled(checkEnableAdblock->isChecked());
_changed = true;
emit changed(true);
}
diff --git a/src/urlbar/completionwidget.cpp b/src/urlbar/completionwidget.cpp
index b19b163e..9a5c9432 100644
--- a/src/urlbar/completionwidget.cpp
+++ b/src/urlbar/completionwidget.cpp
@@ -85,7 +85,14 @@ void CompletionWidget::insertSearchList(const UrlSearchList &list, const QString
void CompletionWidget::sizeAndPosition()
{
setFixedWidth(_parent->width());
- adjustSize();
+
+ int h=0;
+ for (int i = 0; i < layout()->count(); i++)
+ {
+ QWidget *widget = layout()->itemAt(i)->widget();
+ h += widget->sizeHint().height();
+ }
+ setFixedSize(_parent->width(),h+5);
// position
QPoint p = _parent->mapToGlobal(QPoint(0, 0));
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp
index d2992c4d..06d281e1 100644
--- a/src/urlbar/urlbar.cpp
+++ b/src/urlbar/urlbar.cpp
@@ -402,7 +402,7 @@ void UrlBar::detectTypedString(const QString &typed)
if(_suggestionTimer->isActive())
_suggestionTimer->stop();
- _suggestionTimer->start(150);
+ _suggestionTimer->start(50);
}