summaryrefslogtreecommitdiff
path: root/src/tabwidget.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2008-11-23 00:09:49 +0100
committerAndrea Diamantini <adjam7@gmail.com>2008-11-23 00:09:49 +0100
commitaca0bf7ec9a98c1ef7a4147798c76e90e4cc7992 (patch)
tree186b0fac14b5d35f2e957646bff25ca539ba4dc8 /src/tabwidget.cpp
parentKDE-izing cookie dialogs.. (diff)
downloadrekonq-aca0bf7ec9a98c1ef7a4147798c76e90e4cc7992.tar.xz
1st implementation of new (K)urlbar.
It compiles but doesn't work (yet..)
Diffstat (limited to 'src/tabwidget.cpp')
-rw-r--r--src/tabwidget.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/tabwidget.cpp b/src/tabwidget.cpp
index 892c4cc5..d66b6ba3 100644
--- a/src/tabwidget.cpp
+++ b/src/tabwidget.cpp
@@ -25,7 +25,8 @@
#include "browserapplication.h"
#include "browsermainwindow.h"
#include "history.h"
-#include "urllineedit.h"
+// #include "urllineedit.h"
+#include "urlbar.h"
#include "webview.h"
// Qt Includes
@@ -286,7 +287,7 @@ void TabWidget::clear()
m_recentlyClosedTabs.clear();
// clear the line edit history
for (int i = 0; i < m_lineEdits->count(); ++i) {
- QLineEdit *qLineEdit = lineEdit(i);
+ KLineEdit *qLineEdit = lineEdit(i);
qLineEdit->setText(qLineEdit->text());
}
}
@@ -384,7 +385,7 @@ QWidget *TabWidget::lineEditStack() const
return m_lineEdits;
}
-QLineEdit *TabWidget::currentLineEdit() const
+KLineEdit *TabWidget::currentLineEdit() const
{
return lineEdit(m_lineEdits->currentIndex());
}
@@ -394,9 +395,9 @@ WebView *TabWidget::currentWebView() const
return webView(currentIndex());
}
-QLineEdit *TabWidget::lineEdit(int index) const
+KLineEdit *TabWidget::lineEdit(int index) const
{
- UrlLineEdit *urlLineEdit = qobject_cast<UrlLineEdit*>(m_lineEdits->widget(index));
+ UrlBar *urlLineEdit = qobject_cast<UrlBar*>(m_lineEdits->widget(index));
if (urlLineEdit)
return urlLineEdit->lineEdit();
return 0;
@@ -430,9 +431,10 @@ int TabWidget::webViewIndex(WebView *webView) const
WebView *TabWidget::newTab(bool makeCurrent)
{
// line edit
- UrlLineEdit *urlLineEdit = new UrlLineEdit;
- QLineEdit *lineEdit = urlLineEdit->lineEdit();
- if (!m_lineEditCompleter && count() > 0) {
+ UrlBar *urlLineEdit = new UrlBar;
+ KLineEdit *lineEdit = urlLineEdit->lineEdit();
+ if (!m_lineEditCompleter && count() > 0)
+ {
HistoryCompletionModel *completionModel = new HistoryCompletionModel(this);
completionModel->setSourceModel(BrowserApplication::historyManager()->historyFilterModel());
m_lineEditCompleter = new QCompleter(completionModel, this);
@@ -448,7 +450,8 @@ WebView *TabWidget::newTab(bool makeCurrent)
m_lineEdits->setSizePolicy(lineEdit->sizePolicy());
// optimization to delay creating the more expensive WebView, history, etc
- if (count() == 0) {
+ if (count() == 0)
+ {
QWidget *emptyWidget = new QWidget;
QPalette p = emptyWidget->palette();
p.setColor(QPalette::Window, palette().color(QPalette::Base));
@@ -515,7 +518,8 @@ void TabWidget::reloadAllTabs()
void TabWidget::lineEditReturnPressed()
{
- if (QLineEdit *lineEdit = qobject_cast<QLineEdit*>(sender())) {
+ if (KLineEdit *lineEdit = qobject_cast<KLineEdit*>(sender()))
+ {
emit loadPage(lineEdit->text());
if (m_lineEdits->currentWidget() == lineEdit)
currentWebView()->setFocus();