summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/browsermainwindow.cpp170
-rw-r--r--src/browsermainwindow.h11
-rw-r--r--src/findwidget.cpp58
-rw-r--r--src/findwidget.h33
-rw-r--r--src/searchbar.h3
-rw-r--r--src/tabwidget.cpp62
-rw-r--r--src/tabwidget.h19
-rw-r--r--src/urllineedit.h7
9 files changed, 230 insertions, 134 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d10368f9..d4317b2d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -12,6 +12,7 @@ SET( rekonq_SRCS
networkaccessmanager.cpp
searchlineedit.cpp
# searchbar.cpp
+ findwidget.cpp
settings.cpp
squeezelabel.cpp
tabwidget.cpp
diff --git a/src/browsermainwindow.cpp b/src/browsermainwindow.cpp
index 49b357c0..66679ad0 100644
--- a/src/browsermainwindow.cpp
+++ b/src/browsermainwindow.cpp
@@ -19,8 +19,8 @@
 * ============================================================ */
+// Local Includes
#include "browsermainwindow.h"
-
#include "autosaver.h"
#include "bookmarks.h"
#include "browserapplication.h"
@@ -29,9 +29,12 @@
#include "settings.h"
#include "tabwidget.h"
#include "toolbarsearch.h"
-#include "ui_passworddialog.h"
#include "webview.h"
+// UI Includes
+#include "ui_passworddialog.h"
+
+// KDE Includes
#include <KStatusBar>
#include <KMenuBar>
#include <KShortcut>
@@ -39,7 +42,7 @@
#include <KAction>
#include <KActionCollection>
-
+// Qt Includes
#include <QSettings>
#include <QDesktopWidget>
#include <QFileDialog>
@@ -50,10 +53,8 @@
#include <QMessageBox>
#include <QToolBar>
#include <QInputDialog>
-
#include <QWebFrame>
#include <QWebHistory>
-
#include <QDebug>
@@ -78,6 +79,12 @@ BrowserMainWindow::BrowserMainWindow(QWidget *parent, Qt::WindowFlags flags)
layout->setMargin(0);
addToolBarBreak();
layout->addWidget(m_tabWidget);
+
+ // Find Widget
+ m_findWidg = new FindWidget(centralWidget);
+ layout->addWidget(m_findWidg);
+// m_findWidg->setVisible(false);
+
centralWidget->setLayout(layout);
setCentralWidget(centralWidget);
@@ -91,15 +98,12 @@ BrowserMainWindow::BrowserMainWindow(QWidget *parent, Qt::WindowFlags flags)
connect(m_tabWidget, SIGNAL(printRequested(QWebFrame *)), this, SLOT(printRequested(QWebFrame *)));
connect(m_tabWidget, SIGNAL(menuBarVisibilityChangeRequested(bool)), menuBar(), SLOT(setVisible(bool)));
connect(m_tabWidget, SIGNAL(statusBarVisibilityChangeRequested(bool)), statusBar(), SLOT(setVisible(bool)));
-// connect(m_tabWidget, SIGNAL(toolBarVisibilityChangeRequested(bool)), m_navigationBar, SLOT(setVisible(bool)));
+ connect(m_tabWidget, SIGNAL(toolBarVisibilityChangeRequested(bool)), m_navigationBar, SLOT(setVisible(bool)));
connect(m_tabWidget, SIGNAL(lastTabClosed()), m_tabWidget, SLOT(newTab()));
slotUpdateWindowTitle();
loadDefaultState();
m_tabWidget->newTab();
-
- int size = m_tabWidget->lineEditStack()->sizeHint().height();
-// m_navigationBar->setIconSize(QSize(size, size)); // FIXME re-enable me
}
@@ -114,11 +118,11 @@ BrowserMainWindow::~BrowserMainWindow()
void BrowserMainWindow::loadDefaultState()
{
-// QSettings settings;
-// settings.beginGroup(QLatin1String("BrowserMainWindow"));
-// QByteArray data = settings.value(QLatin1String("defaultState")).toByteArray();
-// // restoreState(data); // FIXME re-enable me!
-// settings.endGroup();
+ QSettings settings;
+ settings.beginGroup(QLatin1String("BrowserMainWindow"));
+ QByteArray data = settings.value(QLatin1String("defaultState")).toByteArray();
+// restoreState(data); // FIXME re-enable me!
+ settings.endGroup();
}
@@ -265,19 +269,9 @@ void BrowserMainWindow::setupMenu()
editMenu->addSeparator();
- // FIXME port FIND system to KDE
- QAction *m_find = editMenu->addAction(i18n("&Find"));
- m_find->setShortcuts(QKeySequence::Find);
- connect(m_find, SIGNAL(triggered()), this, SLOT(slotEditFind()));
- new QShortcut(QKeySequence(Qt::Key_Slash), this, SLOT(slotEditFind()));
-
- QAction *m_findNext = editMenu->addAction( i18n("&Find Next"));
- m_findNext->setShortcuts(QKeySequence::FindNext);
- connect(m_findNext, SIGNAL(triggered()), this, SLOT(slotEditFindNext()));
-
- QAction *m_findPrevious = editMenu->addAction( i18n("&Find Previous"));
- m_findPrevious->setShortcuts(QKeySequence::FindPrevious);
- connect(m_findPrevious, SIGNAL(triggered()), this, SLOT(slotEditFindPrevious()));
+ editMenu->addAction( KStandardAction::find(this, SLOT( slotViewtFindWidget() ) , this ) );
+ editMenu->addAction( KStandardAction::findNext(this, SLOT( slotEditFindNext() ) , this ) );
+ editMenu->addAction( KStandardAction::findPrev(this, SLOT( slotEditFindPrevious() ) , this ) );
editMenu->addSeparator();
@@ -295,14 +289,14 @@ void BrowserMainWindow::setupMenu()
viewMenu->addSeparator();
- m_stop = viewMenu->addAction( i18n("&Stop") );
+ m_stop = (KAction *) viewMenu->addAction( KIcon( "process-stop" ), i18n("&Stop") );
QList<QKeySequence> shortcuts;
shortcuts.append(QKeySequence(Qt::CTRL | Qt::Key_Period));
shortcuts.append(Qt::Key_Escape);
m_stop->setShortcuts(shortcuts);
m_tabWidget->addWebAction(m_stop, QWebPage::Stop);
- m_reload = viewMenu->addAction( i18n("Reload Page") );
+ m_reload = (KAction *) viewMenu->addAction( KIcon("view-refresh"), i18n("Reload Page") );
m_reload->setShortcuts(QKeySequence::Refresh);
m_tabWidget->addWebAction(m_reload, QWebPage::Reload);
@@ -402,42 +396,36 @@ void BrowserMainWindow::setupMenu()
void BrowserMainWindow::setupToolBar()
{
-// m_navigationBar = (KToolBar *) addToolBar(i18n("Navigation"));
-// connect(m_navigationBar->toggleViewAction(), SIGNAL(toggled(bool)), this, SLOT(updateToolbarActionText(bool)));
-//
-// m_historyBack->setIcon( (QIcon) KIcon("go-previous") );
-// m_historyBackMenu = new KMenu(this);
-// m_historyBack->setMenu(m_historyBackMenu);
-// connect(m_historyBackMenu, SIGNAL(aboutToShow()), this, SLOT(slotAboutToShowBackMenu()));
-// connect(m_historyBackMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotOpenActionUrl(QAction *)));
-// m_navigationBar->addAction(m_historyBack);
-//
-// m_historyForward->setIcon( (QIcon) KIcon("go-next") );
-// m_historyForwardMenu = new KMenu(this);
-// connect(m_historyForwardMenu, SIGNAL(aboutToShow()), this, SLOT(slotAboutToShowForwardMenu()));
-// connect(m_historyForwardMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotOpenActionUrl(QAction *)));
-// m_historyForward->setMenu(m_historyForwardMenu);
-// m_navigationBar->addAction(m_historyForward);
-//
-// m_stopReload = new KAction(this);
-// m_reloadIcon = KIcon( "view-refresh" );
-// m_stopReload->setIcon(m_reloadIcon);
-// m_navigationBar->addAction(m_stopReload);
-//
-// m_goHome = new KAction(this);
-// m_goHome->setIcon( KIcon( "go-home" ) );
-// m_navigationBar->addAction(m_goHome);
-// connect(m_goHome, SIGNAL(triggered()), this, SLOT(slotHome()));
-//
-// m_navigationBar->addWidget(m_tabWidget->lineEditStack());
-//
-// m_toolbarSearch = new ToolbarSearch(m_navigationBar);
-// m_navigationBar->addWidget(m_toolbarSearch);
-//
-// // fixing toolbar movements
-// m_navigationBar->setFloatable( false );
-//
-// connect(m_toolbarSearch, SIGNAL(search(const QUrl&)), SLOT(loadUrl(const QUrl&)));
+ m_navigationBar = (KToolBar *) addToolBar(i18n("Navigation"));
+ connect(m_navigationBar->toggleViewAction(), SIGNAL(toggled(bool)), this, SLOT(updateToolbarActionText(bool)));
+
+ m_historyBack = new KAction( KIcon("go-previous"), i18n("Back"), this);
+ m_historyBackMenu = new KMenu(this);
+ m_historyBack->setMenu(m_historyBackMenu);
+ connect(m_historyBackMenu, SIGNAL(aboutToShow()), this, SLOT(slotAboutToShowBackMenu()));
+ connect(m_historyBackMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotOpenActionUrl(QAction *)));
+ m_navigationBar->addAction(m_historyBack);
+
+ m_historyForward = new KAction( KIcon("go-next"), i18n("Forward"), this );
+ m_historyForwardMenu = new KMenu(this);
+ connect(m_historyForwardMenu, SIGNAL(aboutToShow()), this, SLOT(slotAboutToShowForwardMenu()));
+ connect(m_historyForwardMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotOpenActionUrl(QAction *)));
+ m_historyForward->setMenu(m_historyForwardMenu);
+ m_navigationBar->addAction(m_historyForward);
+
+ m_stopReload = new KAction( KIcon("view-refresh"), i18n("Reload"), this);
+ m_navigationBar->addAction(m_stopReload);
+
+ m_goHome = new KAction( KIcon( "go-home" ), i18n("Home"),this);
+ m_navigationBar->addAction(m_goHome);
+ connect(m_goHome, SIGNAL(triggered()), this, SLOT(slotHome()));
+
+ m_navigationBar->addWidget(m_tabWidget->lineEditStack());
+
+ m_toolbarSearch = new ToolbarSearch(m_navigationBar);
+ m_navigationBar->addWidget(m_toolbarSearch);
+
+ connect(m_toolbarSearch, SIGNAL(search(const QUrl&)), SLOT(loadUrl(const QUrl&)));
}
@@ -588,19 +576,6 @@ void BrowserMainWindow::slotUpdateWindowTitle(const QString &title)
-
-void BrowserMainWindow::slotAboutApplication()
-{
- QMessageBox::about(this, i18n("About"),
- i18n(
- "<p>reKonq is a simple KDE dedicated browser"
- "<p>webkit and Qt Demo Browser based." // FIXME go new line..
- "<p>QtWebKit is based on the Open Source WebKit Project developed at <a href=\"http://webkit.org/\">http://webkit.org/</a>."
- ));
-}
-
-
-
void BrowserMainWindow::slotFileNew()
{
BrowserApplication::instance()->newMainWindow();
@@ -711,21 +686,34 @@ void BrowserMainWindow::closeEvent(QCloseEvent *event)
}
+void BrowserMainWindow::slotViewFindWidget()
+{
+ if ( m_findWidg->isVisible() )
+ m_findWidg->setVisible( false );
+ else
+ m_findWidg->setVisible( true );
+}
+// FIXME: reimplement me A-LA KATE search bar
void BrowserMainWindow::slotEditFind()
{
- if (!currentTab())
- return;
- bool ok;
- QString search = QInputDialog::getText(this, i18n("Find"),
- i18n("Text:"), QLineEdit::Normal,
- m_lastSearch, &ok);
- if (ok && !search.isEmpty()) {
- m_lastSearch = search;
- if (!currentTab()->findText(m_lastSearch))
- slotUpdateStatusbar( QString(m_lastSearch) + i18n(" not found.") );
- }
+// if (!currentTab())
+// return;
+// bool ok;
+// QString search = QInputDialog::getText(this, i18n("Find"),
+// i18n("Text:"), QLineEdit::Normal,
+// m_lastSearch, &ok);
+// if (ok && !search.isEmpty()) {
+// m_lastSearch = search;
+// if (!currentTab()->findText(m_lastSearch))
+// slotUpdateStatusbar( QString(m_lastSearch) + i18n(" not found.") );
+// }
+// m_findWidg->setVisible( true );
+/*if ( !currentTab() )
+ return;
+bool ok;
+m_lastSearch = findWidg->*/
}
@@ -809,10 +797,10 @@ void BrowserMainWindow::slotViewPageSource()
void BrowserMainWindow::slotHome()
{
-/* QSettings settings;
+ QSettings settings;
settings.beginGroup(QLatin1String("MainWindow"));
QString home = settings.value(QLatin1String("home"), QLatin1String("http://www.kde.org/")).toString();
- loadPage(home);*/
+ loadPage(home);
}
diff --git a/src/browsermainwindow.h b/src/browsermainwindow.h
index 5570564f..ee5e8989 100644
--- a/src/browsermainwindow.h
+++ b/src/browsermainwindow.h
@@ -22,14 +22,20 @@
#ifndef BROWSERMAINWINDOW_H
#define BROWSERMAINWINDOW_H
+// Local Includes
+#include "findwidget.h"
+
+// KDE Includes
#include <KMainWindow>
#include <KIcon>
#include <KToolBar>
#include <KAction>
#include <KMenu>
+// Qt Includes
#include <QUrl>
+
class AutoSaver;
class QWebFrame;
class TabWidget;
@@ -93,7 +99,6 @@ private slots:
void slotWebSearch();
void slotToggleInspector(bool enable);
- void slotAboutApplication();
void slotDownloadManager();
void slotSelectLineEdit();
@@ -103,6 +108,7 @@ private slots:
void slotOpenActionUrl(QAction *action);
void slotShowWindow();
void slotSwapFocus();
+ void slotViewFindWidget();
void printRequested(QWebFrame *frame);
void geometryChangeRequested(const QRect &geometry);
@@ -126,7 +132,7 @@ private:
KMenu *m_historyForwardMenu;
KMenu *m_windowMenu;
- QAction *m_stop;
+ KAction *m_stop;
QAction *m_reload;
KAction *m_stopReload;
KAction *m_goHome;
@@ -137,6 +143,7 @@ private:
KIcon m_reloadIcon;
KIcon m_stopIcon;
+ FindWidget *m_findWidg;
QString m_lastSearch;
};
diff --git a/src/findwidget.cpp b/src/findwidget.cpp
new file mode 100644
index 00000000..4eb10e6b
--- /dev/null
+++ b/src/findwidget.cpp
@@ -0,0 +1,58 @@
+/* ============================================================
+ *
+ * This file is a part of the reKonq project
+ *
+ * Copyright (C) 2008 by Andrea Diamantini <adjam7 at gmail dot com>
+ *
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * ============================================================ */
+
+#include "findwidget.h"
+
+#include <QHBoxLayout>
+#include <QLabel>
+
+#include <KLineEdit>
+#include <KToolBar>
+#include <KAction>
+#include <KStandardAction>
+
+FindWidget::FindWidget(QWidget * parent) : QWidget(parent)
+{
+ QHBoxLayout *layout = new QHBoxLayout();
+
+ KToolBar *bar1 = new KToolBar(this);
+ bar1->addAction( KStandardAction::close(this, SLOT( searchNow() ) , this ) );
+ layout->addWidget( bar1 );
+
+ QLabel *label = new QLabel("Find: ");
+ layout->addWidget( label );
+
+ KLineEdit *findLineEdit = new KLineEdit();
+ layout->addWidget( findLineEdit );
+
+ KToolBar *bar2 = new KToolBar(this);
+ bar2->addAction( KStandardAction::findNext(this, SLOT( searchNow() ) , this ) );
+ bar2->addAction( KStandardAction::findPrev(this, SLOT( searchNow() ) , this ) );
+ layout->addWidget( bar2 );
+
+ layout->addStretch();
+
+ setLayout(layout);
+}
+
+QString FindWidget::searchNow()
+{
+ QString prova("adjam");
+ return prova;
+}
diff --git a/src/findwidget.h b/src/findwidget.h
new file mode 100644
index 00000000..5d8b7b28
--- /dev/null
+++ b/src/findwidget.h
@@ -0,0 +1,33 @@
+/* ============================================================
+ *
+ * This file is a part of the reKonq project
+ *
+ * Copyright (C) 2008 by Andrea Diamantini <adjam7 at gmail dot com>
+ *
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * ============================================================ */
+
+#ifndef FINDWIDGET_H
+#define FINDWIDGET_H
+
+#include <QWidget>
+
+class FindWidget : public QWidget
+{
+public:
+ FindWidget(QWidget * parent = 0);
+
+ QString searchNow();
+};
+
+#endif
diff --git a/src/searchbar.h b/src/searchbar.h
index 222b97e4..e574508b 100644
--- a/src/searchbar.h
+++ b/src/searchbar.h
@@ -29,9 +29,6 @@
#include <QString>
#include <QMenu>
-class KHTMLPart;
-
-
class SearchBarCombo : public KHistoryComboBox
{
Q_OBJECT
diff --git a/src/tabwidget.cpp b/src/tabwidget.cpp
index 8808c926..892c4cc5 100644
--- a/src/tabwidget.cpp
+++ b/src/tabwidget.cpp
@@ -19,7 +19,7 @@
 * ============================================================ */
-
+// Local Includes
#include "tabwidget.h"
#include "browserapplication.h"
@@ -28,6 +28,7 @@
#include "urllineedit.h"
#include "webview.h"
+// Qt Includes
#include <QClipboard>
#include <QCompleter>
#include <QListView>
@@ -37,19 +38,19 @@
#include <QStackedWidget>
#include <QStyle>
#include <QToolButton>
+#include <QDebug>
-#include <QtCore/QDebug>
TabBar::TabBar(QWidget *parent)
- : QTabBar(parent)
+ : KTabBar(parent)
{
setContextMenuPolicy(Qt::CustomContextMenu);
setAcceptDrops(true);
- connect(this, SIGNAL(customContextMenuRequested(const QPoint &)),
- this, SLOT(contextMenuRequested(const QPoint &)));
+ connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(contextMenuRequested(const QPoint &)));
QString alt = QLatin1String("Alt+%1");
- for (int i = 1; i <= 10; ++i) {
+ for (int i = 1; i <= 10; ++i)
+ {
int key = i;
if (key == 10)
key = 0;
@@ -61,7 +62,8 @@ TabBar::TabBar(QWidget *parent)
void TabBar::selectTabAction()
{
- if (QShortcut *shortCut = qobject_cast<QShortcut*>(sender())) {
+ if (QShortcut *shortCut = qobject_cast<QShortcut*>(sender()))
+ {
int index = m_tabShortcuts.indexOf(shortCut);
if (index == 0)
index = 10;
@@ -74,27 +76,26 @@ void TabBar::contextMenuRequested(const QPoint &position)
QMenu menu;
menu.addAction(i18n("New &Tab"), this, SIGNAL(newTab()), QKeySequence::AddTab);
int index = tabAt(position);
- if (-1 != index) {
- QAction *action = menu.addAction(i18n("Clone Tab"),
- this, SLOT(cloneTab()));
+ if (-1 != index)
+ {
+ QAction *action = menu.addAction(i18n("Clone Tab"), this, SLOT(cloneTab()));
action->setData(index);
menu.addSeparator();
- action = menu.addAction(i18n("&Close Tab"),
- this, SLOT(closeTab()), QKeySequence::Close);
+ action = menu.addAction(i18n("&Close Tab"), this, SLOT(closeTab()), QKeySequence::Close);
action->setData(index);
- action = menu.addAction(i18n("Close &Other Tabs"),
- this, SLOT(closeOtherTabs()));
+ action = menu.addAction(i18n("Close &Other Tabs"), this, SLOT(closeOtherTabs()));
action->setData(index);
menu.addSeparator();
- action = menu.addAction(i18n("Reload Tab"),
- this, SLOT(reloadTab()), QKeySequence::Refresh);
+ action = menu.addAction(i18n("Reload Tab"), this, SLOT(reloadTab()), QKeySequence::Refresh);
action->setData(index);
- } else {
+ }
+ else
+ {
menu.addSeparator();
}
menu.addAction(i18n("Reload All Tabs"), this, SIGNAL(reloadAllTabs()));
@@ -111,7 +112,8 @@ void TabBar::cloneTab()
void TabBar::closeTab()
{
- if (QAction *action = qobject_cast<QAction*>(sender())) {
+ if (QAction *action = qobject_cast<QAction*>(sender()))
+ {
int index = action->data().toInt();
emit closeTab(index);
}
@@ -119,7 +121,8 @@ void TabBar::closeTab()
void TabBar::closeOtherTabs()
{
- if (QAction *action = qobject_cast<QAction*>(sender())) {
+ if (QAction *action = qobject_cast<QAction*>(sender()))
+ {
int index = action->data().toInt();
emit closeOtherTabs(index);
}
@@ -134,8 +137,8 @@ void TabBar::mousePressEvent(QMouseEvent *event)
void TabBar::mouseMoveEvent(QMouseEvent *event)
{
- if (event->buttons() == Qt::LeftButton
- && (event->pos() - m_dragStartPos).manhattanLength() > QApplication::startDragDistance()) {
+ if (event->buttons() == Qt::LeftButton && (event->pos() - m_dragStartPos).manhattanLength() > QApplication::startDragDistance())
+ {
QDrag *drag = new QDrag(this);
QMimeData *mimeData = new QMimeData;
QList<QUrl> urls;
@@ -155,8 +158,9 @@ void TabBar::dragEnterEvent(QDragEnterEvent *event)
{
const QMimeData *mimeData = event->mimeData();
QStringList formats = mimeData->formats();
- if (formats.contains(QLatin1String("action"))
- && (mimeData->data(QLatin1String("action")) == "tab-reordering")) {
+
+ if (formats.contains(QLatin1String("action")) && (mimeData->data(QLatin1String("action")) == "tab-reordering"))
+ {
event->acceptProposedAction();
}
QTabBar::dragEnterEvent(event);
@@ -166,7 +170,8 @@ void TabBar::dropEvent(QDropEvent *event)
{
int fromIndex = tabAt(m_dragStartPos);
int toIndex = tabAt(event->pos());
- if (fromIndex != toIndex) {
+ if (fromIndex != toIndex)
+ {
emit tabMoveRequested(fromIndex, toIndex);
event->acceptProposedAction();
}
@@ -194,6 +199,8 @@ void TabBar::reloadTab()
}
}
+// --------------------------------------------------------------------------------------------------------------------------------------------------------
+
TabWidget::TabWidget(QWidget *parent)
: QTabWidget(parent)
, m_recentlyClosedTabsAction(0)
@@ -268,8 +275,7 @@ TabWidget::TabWidget(QWidget *parent)
closeTabButton->setToolButtonStyle(Qt::ToolButtonIconOnly);
setCornerWidget(closeTabButton, Qt::TopRightCorner);
- connect(this, SIGNAL(currentChanged(int)),
- this, SLOT(currentChanged(int)));
+ connect(this, SIGNAL(currentChanged(int)), this, SLOT(currentChanged(int)));
m_lineEdits = new QStackedWidget(this);
}
@@ -385,7 +391,7 @@ QLineEdit *TabWidget::currentLineEdit() const
WebView *TabWidget::currentWebView() const
{
-// return webView(currentIndex()); // FIXME
+ return webView(currentIndex());
}
QLineEdit *TabWidget::lineEdit(int index) const
@@ -406,7 +412,7 @@ WebView *TabWidget::webView(int index) const
if (count() == 1) {
TabWidget *that = const_cast<TabWidget*>(this);
that->setUpdatesEnabled(false);
-// that->newTab(); FIXME
+ that->newTab();
that->closeTab(0);
that->setUpdatesEnabled(true);
return currentWebView();
diff --git a/src/tabwidget.h b/src/tabwidget.h
index 15db1349..b3c31c0e 100644
--- a/src/tabwidget.h
+++ b/src/tabwidget.h
@@ -23,13 +23,12 @@
#ifndef TABWIDGET_H
#define TABWIDGET_H
-#include <QtGui/QTabBar>
-
-#include <QtGui/QShortcut>
+#include <KTabBar>
+#include <QShortcut>
/*
Tab bar with a few more features such as a context menu and shortcuts
*/
-class TabBar : public QTabBar
+class TabBar : public KTabBar
{
Q_OBJECT
@@ -67,7 +66,9 @@ private:
int m_dragCurrentIndex;
};
-#include <QtWebKit/QWebPage>
+
+
+#include <QWebPage>
QT_BEGIN_NAMESPACE
class QAction;
@@ -102,8 +103,12 @@ private:
QWebPage::WebAction m_webAction;
};
-#include <QtCore/QUrl>
-#include <QtGui/QTabWidget>
+
+
+
+#include <QUrl>
+#include <QTabWidget>
+
QT_BEGIN_NAMESPACE
class QCompleter;
class QLineEdit;
diff --git a/src/urllineedit.h b/src/urllineedit.h
index 726a2b2b..eca0c1f5 100644
--- a/src/urllineedit.h
+++ b/src/urllineedit.h
@@ -21,9 +21,10 @@
#ifndef URLLINEEDIT_H
#define URLLINEEDIT_H
-#include <QtCore/QUrl>
-#include <QtGui/QWidget>
-#include <QtGui/QStyleOptionFrame>
+// Qt Includes
+#include <QUrl>
+#include <QWidget>
+#include <QStyleOptionFrame>
QT_BEGIN_NAMESPACE
class QLineEdit;