diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/application.cpp | 10 | ||||
-rw-r--r-- | src/mainview.cpp | 19 | ||||
-rw-r--r-- | src/mainview.h | 2 | ||||
-rw-r--r-- | src/mainwindow.cpp | 45 | ||||
-rw-r--r-- | src/mainwindow.h | 4 | ||||
-rw-r--r-- | src/networkaccessmanager.cpp | 5 | ||||
-rw-r--r-- | src/rekonqui.rc | 5 | ||||
-rw-r--r-- | src/tabbar.cpp | 36 | ||||
-rw-r--r-- | src/tabbar.h | 2 |
9 files changed, 65 insertions, 63 deletions
diff --git a/src/application.cpp b/src/application.cpp index d8b2270f..65f6e8a8 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -44,14 +44,8 @@ #include <kio/jobclasses.h> // Qt Includes -#include <QBuffer> -#include <QDir> -#include <QTextStream> -#include <QFileOpenEvent> -#include <QNetworkProxy> -#include <QWebSettings> -#include <QDebug> - +#include <QtCore> +#include <QtWebKit> HistoryManager *Application::s_historyManager = 0; diff --git a/src/mainview.cpp b/src/mainview.cpp index 3c563230..ac2355ce 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -43,6 +43,7 @@ #include <KMessageBox> #include <KActionCollection> #include <KDebug> +#include <KStandardDirs> // Qt Includes #include <QtCore> @@ -61,6 +62,8 @@ MainView::MainView(QWidget *parent) { setTabBar(m_tabBar); + loadingGitPath = KStandardDirs::locate("appdata" , "pics/loading.gif"); + connect(m_tabBar, SIGNAL(newTab()), this, SLOT(newWebView())); connect(m_tabBar, SIGNAL(closeTab(int)), this, SLOT(closeTab(int))); connect(m_tabBar, SIGNAL(cloneTab(int)), this, SLOT(cloneTab(int))); @@ -77,6 +80,10 @@ MainView::MainView(QWidget *parent) m_recentlyClosedTabsAction->setMenu(m_recentlyClosedTabsMenu); m_recentlyClosedTabsAction->setEnabled(false); + // add close button to tab bar.. + m_tabBar->setTabsClosable(true); + connect(m_tabBar, SIGNAL(tabCloseRequested(int)),this, SLOT(closeTab(int))); + // -- connect(this, SIGNAL(currentChanged(int)), this, SLOT(currentChanged(int))); } @@ -475,6 +482,10 @@ void MainView::cloneTab(int index) // When index is -1 index chooses the current tab void MainView::closeTab(int index) { + // do nothing if just one tab is opened + if( count() == 1 ) + return; + if (index < 0) index = currentIndex(); if (index < 0 || index >= count()) @@ -488,8 +499,8 @@ void MainView::closeTab(int index) int risp = KMessageBox::questionYesNo(this , i18n("You have modified this page and when closing it you would lose the modification.\n" "Do you really want to close this page?\n"), - i18n("Do you really want to close this page?"), - KStandardGuiItem::no()); + i18n("Do you really want to close this page?") + ); if (risp == KMessageBox::No) return; } @@ -516,13 +527,15 @@ void MainView::closeTab(int index) } +// FIXME void MainView::webViewLoadStarted() { WebView *webView = qobject_cast<WebView*>(sender()); int index = webViewIndex(webView); if (-1 != index) { - setTabIcon(index, KIcon("rekonq")); +// setTabIcon(index, KIcon("rekonq")); + setTabIcon(index, QIcon(loadingGitPath)); } } diff --git a/src/mainview.h b/src/mainview.h index 8652a6e5..f7e1bbb9 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -143,6 +143,8 @@ private: QCompleter *m_lineEditCompleter; QStackedWidget *m_lineEdits; TabBar *m_tabBar; + + QString loadingGitPath; }; #endif diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index b028913f..ef0a3951 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -134,7 +134,7 @@ MainWindow::MainWindow() m_bookmarksProvider->provideBmToolbar(bmToolbar); // setup Tab Bar - setupTabBar(); +// setupTabBar(); // setting up toolbars to NOT have context menu enabled setContextMenuPolicy(Qt::DefaultContextMenu); @@ -179,7 +179,6 @@ void MainWindow::setupActions() KAction *a; // Standard Actions - KStandardAction::openNew(this, SLOT(slotFileNew()) , actionCollection()); KStandardAction::open(this, SLOT(slotFileOpen()), actionCollection()); KStandardAction::saveAs(this, SLOT(slotFileSaveAs()), actionCollection()); KStandardAction::printPreview(this, SLOT(slotFilePrintPreview()), actionCollection()); @@ -283,22 +282,22 @@ void MainWindow::setupActions() } -void MainWindow::setupTabBar() -{ - // Left corner button - QToolButton *addTabButton = new QToolButton(this); - addTabButton->setDefaultAction(actionCollection()->action("new_tab")); - addTabButton->setAutoRaise(true); - addTabButton->setToolButtonStyle(Qt::ToolButtonIconOnly); - m_view->setCornerWidget(addTabButton, Qt::TopLeftCorner); - - // right corner button - QToolButton *closeTabButton = new QToolButton(this); - closeTabButton->setDefaultAction(actionCollection()->action("close_tab")); - closeTabButton->setAutoRaise(true); - closeTabButton->setToolButtonStyle(Qt::ToolButtonIconOnly); - m_view->setCornerWidget(closeTabButton, Qt::TopRightCorner); -} +// void MainWindow::setupTabBar() +// { +// // Left corner button +// QToolButton *addTabButton = new QToolButton(this); +// addTabButton->setDefaultAction(actionCollection()->action("new_tab")); +// addTabButton->setAutoRaise(true); +// addTabButton->setToolButtonStyle(Qt::ToolButtonIconOnly); +// m_view->setCornerWidget(addTabButton, Qt::TopLeftCorner); +// +// // right corner button +// QToolButton *closeTabButton = new QToolButton(this); +// closeTabButton->setDefaultAction(actionCollection()->action("close_tab")); +// closeTabButton->setAutoRaise(true); +// closeTabButton->setToolButtonStyle(Qt::ToolButtonIconOnly); +// m_view->setCornerWidget(closeTabButton, Qt::TopRightCorner); +// } void MainWindow::setupHistoryMenu() @@ -476,11 +475,11 @@ void MainWindow::slotUpdateWindowTitle(const QString &title) } -void MainWindow::slotFileNew() -{ - Application::instance()->newWebView(); - slotHome(); -} +// void MainWindow::slotFileNew() +// { +// Application::instance()->newWebView(); +// slotHome(); +// } void MainWindow::slotFileOpen() diff --git a/src/mainwindow.h b/src/mainwindow.h index 9e64022e..dc01d990 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -63,7 +63,7 @@ public: private: void setupActions(); void setupHistoryMenu(); - void setupTabBar(); +// void setupTabBar(); void setupToolBars(); public slots: @@ -87,7 +87,7 @@ private slots: void slotOpenNext(); // File Menu slots - void slotFileNew(); +// void slotFileNew(); void slotFileOpen(); void slotFilePrintPreview(); void slotFilePrint(); diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp index 028dfabb..1d9f2a78 100644 --- a/src/networkaccessmanager.cpp +++ b/src/networkaccessmanager.cpp @@ -64,15 +64,10 @@ NetworkAccessManager::NetworkAccessManager(QObject *parent) loadSettings(); -#if QT_VERSION >= 0x040500 - QNetworkDiskCache *diskCache = new QNetworkDiskCache(this); QString location = KStandardDirs::locateLocal("cache", "", true); diskCache->setCacheDirectory(location); setCache(diskCache); - -#endif - } diff --git a/src/rekonqui.rc b/src/rekonqui.rc index 368c9226..37890393 100644 --- a/src/rekonqui.rc +++ b/src/rekonqui.rc @@ -6,7 +6,6 @@ <!-- ============ FILE menu =========== --> <Menu name="file" noMerge="1"><text>&File</text> - <Action name="file_new" /> <Action name="file_open" /> <Action name="open_location" /> <Separator/> @@ -18,8 +17,6 @@ <Action name="file_print_preview" /> <Action name="file_print" /> <Separator/> - <Action name="private_browsing" /> - <Separator/> <Action name="file_quit" /> </Menu> @@ -59,6 +56,7 @@ <!-- ============ TOOLS menu =========== --> <Menu name="tools" noMerge="1"><text>&Tools</text> <Action name="web_inspector" /> + <Action name="private_browsing" /> </Menu> <!-- ============ SETTINGS menu =========== --> @@ -83,6 +81,7 @@ <Action name="history_forward" /> <Action name="stop_reload" /> <Action name="go_home" /> + <Action name="new_tab" /> </ToolBar> <!-- ============ Location ToolBar =========== --> diff --git a/src/tabbar.cpp b/src/tabbar.cpp index 8163cb5c..ef4fbb7c 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -51,13 +51,13 @@ TabBar::TabBar(QWidget *parent) connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(contextMenuRequested(const QPoint &))); - // we count to 9 because Ctrl+0 is already taken by Normal Font - for (int i = 1; i < 10; ++i) - { - QShortcut *tabShortCut = new QShortcut(QString("Ctrl+%1").arg(i), this); - connect(tabShortCut, SIGNAL(activated()), this, SLOT(selectTabAction())); - m_tabShortcuts.append(tabShortCut); - } +// // we count to 9 because Ctrl+0 is already taken by Normal Font +// for (int i = 1; i < 10; ++i) +// { +// QShortcut *tabShortCut = new QShortcut(QString("Ctrl+%1").arg(i), this); +// connect(tabShortCut, SIGNAL(activated()), this, SLOT(selectTabAction())); +// m_tabShortcuts.append(tabShortCut); +// } QFont standardFont = KGlobalSettings::generalFont(); QString fontFamily = standardFont.family(); @@ -100,17 +100,17 @@ QSize TabBar::tabSizeHint(int index) const } -void TabBar::selectTabAction() -{ - if (QShortcut *shortCut = qobject_cast<QShortcut*>(sender())) - { - int index = m_tabShortcuts.indexOf(shortCut); - if (index != 0) - { - setCurrentIndex(index); - } - } -} +// void TabBar::selectTabAction() +// { +// if (QShortcut *shortCut = qobject_cast<QShortcut*>(sender())) +// { +// int index = m_tabShortcuts.indexOf(shortCut); +// if (index != 0) +// { +// setCurrentIndex(index); +// } +// } +// } void TabBar::contextMenuRequested(const QPoint &position) diff --git a/src/tabbar.h b/src/tabbar.h index ba057e36..b26a62df 100644 --- a/src/tabbar.h +++ b/src/tabbar.h @@ -65,7 +65,7 @@ protected: virtual QSize tabSizeHint(int index) const; private slots: - void selectTabAction(); +// void selectTabAction(); void cloneTab(); void closeTab(); void closeOtherTabs(); |