summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-07-02 10:35:15 +0200
committerAndrea Diamantini <adjam7@gmail.com>2011-07-11 12:52:53 +0200
commitcc1df88787dcea2ae064de086fb448a9fa633323 (patch)
treeb94da2ae2a4717d61f2125054e383a0e697404bc
parentMove to KMessageWidget (diff)
downloadrekonq-cc1df88787dcea2ae064de086fb448a9fa633323.tar.xz
Insert back notification bars in webtab layout
As Pierre pointed out, better insert bars inside layout to avoid usability loss.
-rw-r--r--src/application.cpp8
-rw-r--r--src/webtab.cpp20
-rw-r--r--src/webtab.h2
3 files changed, 22 insertions, 8 deletions
diff --git a/src/application.cpp b/src/application.cpp
index a61c1ce3..40cfcffe 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -42,7 +42,6 @@
#include "iconmanager.h"
#include "mainview.h"
#include "mainwindow.h"
-#include "messagebar.h"
#include "opensearchmanager.h"
#include "sessionmanager.h"
#include "stackedurlbar.h"
@@ -163,12 +162,7 @@ int Application::newInstance()
if (isRekonqCrashed && isFirstLoad)
{
loadUrl(KUrl("about:closedTabs"), Rekonq::NewWindow);
- MessageBar *msgBar = new MessageBar(i18n("It seems rekonq was not closed properly. Do you want "
- "to restore the last saved session?")
- , mainWindow()->currentTab());
-
- connect(msgBar, SIGNAL(accepted()), sessionManager(), SLOT(restoreSession()));
- msgBar->animatedShow();
+ mainWindow()->currentTab()->showMessageBar();
}
if (areThereArguments)
diff --git a/src/webtab.cpp b/src/webtab.cpp
index 386ad5dc..1493725b 100644
--- a/src/webtab.cpp
+++ b/src/webtab.cpp
@@ -40,7 +40,9 @@
#include "webpage.h"
#include "webshortcutwidget.h"
#include "application.h"
+#include "sessionmanager.h"
#include "opensearchmanager.h"
+#include "messagebar.h"
// KDE Includes
#include <KWebWallet>
@@ -140,11 +142,13 @@ void WebTab::createWalletBar(const QString &key, const QUrl &url)
{
m_walletBar = new WalletBar(this);
m_walletBar.data()->onSaveFormData(key, url);
+ qobject_cast<QVBoxLayout *>(layout())->insertWidget(0, m_walletBar.data());
m_walletBar.data()->animatedShow();
}
else
{
disconnect(wallet);
+ qobject_cast<QVBoxLayout *>(layout())->insertWidget(0, m_walletBar.data());
m_walletBar.data()->animatedShow();
}
@@ -160,6 +164,7 @@ void WebTab::createPreviewSelectorBar(int index)
if (m_previewSelectorBar.isNull())
{
m_previewSelectorBar = new PreviewSelectorBar(index, this);
+ qobject_cast<QVBoxLayout *>(layout())->insertWidget(0, m_previewSelectorBar.data());
m_previewSelectorBar.data()->animatedShow();
}
else
@@ -172,7 +177,7 @@ void WebTab::createPreviewSelectorBar(int index)
connect(page(), SIGNAL(loadStarted()), m_previewSelectorBar.data(), SLOT(loadProgress()), Qt::UniqueConnection);
connect(page(), SIGNAL(loadProgress(int)), m_previewSelectorBar.data(), SLOT(loadProgress()), Qt::UniqueConnection);
connect(page(), SIGNAL(loadFinished(bool)), m_previewSelectorBar.data(), SLOT(loadFinished()), Qt::UniqueConnection);
- connect(page()->mainFrame(), SIGNAL(urlChanged(QUrl)), m_previewSelectorBar.data(), SLOT(verifyUrl()), Qt::UniqueConnection);
+ connect(page()->mainFrame(), SIGNAL(urlChanged(QUrl)), m_previewSelectorBar.data(), SLOT(verifyUrl()), Qt::UniqueConnection);
}
@@ -298,3 +303,16 @@ void WebTab::openSearchEngineAdded()
disconnect(rApp->opensearchManager(), SIGNAL(openSearchEngineAdded(const QString &, const QString &, const QString &)),
this, SLOT(openSearchEngineAdded()));
}
+
+
+void WebTab::showMessageBar()
+{
+ MessageBar *msgBar = new MessageBar(i18n("It seems rekonq was not closed properly. Do you want "
+ "to restore the last saved session?")
+ , this);
+
+ qobject_cast<QVBoxLayout *>(layout())->insertWidget(0, msgBar);
+ msgBar->animatedShow();
+
+ connect(msgBar, SIGNAL(accepted()), rApp->sessionManager(), SLOT(restoreSession()));
+}
diff --git a/src/webtab.h b/src/webtab.h
index ff347414..55c0dff4 100644
--- a/src/webtab.h
+++ b/src/webtab.h
@@ -89,6 +89,8 @@ public:
}
void setPart(KParts::ReadOnlyPart *p, const KUrl &u);
+ void showMessageBar();
+
private Q_SLOTS:
void updateProgress(int progress);
void loadFinished(bool);