summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-07-17 00:46:05 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-07-24 01:33:59 +0200
commit7cd00f6764a775934394ac9ee92b2393e5928f50 (patch)
tree1054cf65920aa72316b1922d2f6bfadd2f3c995b /src
parentAdd icons for "history panel" and "page source" items (diff)
downloadrekonq-7cd00f6764a775934394ac9ee92b2393e5928f50.tar.xz
Definitely fixing rekonq API. First step.
newTab function in MainView
Diffstat (limited to 'src')
-rw-r--r--src/application.cpp4
-rw-r--r--src/application.h13
-rw-r--r--src/mainview.cpp47
-rw-r--r--src/mainview.h6
-rw-r--r--src/mainwindow.cpp3
5 files changed, 27 insertions, 46 deletions
diff --git a/src/application.cpp b/src/application.cpp
index afd6a2cc..27dcc83a 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -141,9 +141,9 @@ MainWindow *Application::mainWindow()
}
-WebView *Application::newWebView(Rekonq::OpenType type)
+WebView *Application::newWebView()
{
- return m_mainWindow->mainView()->newWebView(type);
+ return m_mainWindow->mainView()->newTab();
}
diff --git a/src/application.h b/src/application.h
index 46d013e3..24ee7d28 100644
--- a/src/application.h
+++ b/src/application.h
@@ -49,17 +49,6 @@ class WebView;
namespace Rekonq
{
/**
- * @short Open link options
- * Different modes of opening new tab
- */
- enum OpenType
- {
- Default, ///< open url according to users settings
- New, ///< open url in new tab and make it current
- Background ///< open url in new tab in background
- };
-
- /**
* @short notifying message status
* Different message status
*/
@@ -88,7 +77,7 @@ public:
static Application *instance();
MainWindow *mainWindow();
- WebView *newWebView(Rekonq::OpenType type = Rekonq::Default);
+ WebView *newWebView();
static KIcon icon(const KUrl &url);
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 41f5b72d..05e461ee 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -164,12 +164,6 @@ int MainView::webViewIndex(WebView *webView) const
}
-void MainView::setMakeBackTab(bool b)
-{
- m_makeBackTab = b;
-}
-
-
void MainView::showTabBar()
{
if (ReKonfig::alwaysShowTabBar())
@@ -358,7 +352,7 @@ WebView *MainView::webView(int index) const
}
-WebView *MainView::newWebView(Rekonq::OpenType type)
+WebView *MainView::newTab()
{
// line edit
UrlBar *urlBar = new UrlBar; // Ownership of widget is passed on to the QStackedWidget (addWidget method).
@@ -389,22 +383,25 @@ WebView *MainView::newWebView(Rekonq::OpenType type)
addTab(webView, i18n("(Untitled)"));
- switch(type)
- {
- case Rekonq::Default:
- if (!m_makeBackTab)
- {
- setCurrentWidget(webView); // this method does NOT take ownership of webView
- urlBar->setFocus();
- }
- break;
- case Rekonq::New:
- setCurrentWidget(webView); // this method does NOT take ownership of webView
- urlBar->setFocus();
- break;
- case Rekonq::Background:
- break;
- };
+ setCurrentWidget(webView); // this method does NOT take ownership of webView
+ urlBar->setFocus();
+
+// switch(type)
+// {
+// case Rekonq::Default:
+// if (!m_makeBackTab)
+// {
+// setCurrentWidget(webView); // this method does NOT take ownership of webView
+// urlBar->setFocus();
+// }
+// break;
+// case Rekonq::New:
+// setCurrentWidget(webView); // this method does NOT take ownership of webView
+// urlBar->setFocus();
+// break;
+// case Rekonq::Background:
+// break;
+// };
emit tabsChanged();
@@ -480,7 +477,7 @@ void MainView::slotCloneTab(int index)
index = currentIndex();
if (index < 0 || index >= count())
return;
- WebView *tab = newWebView();
+ WebView *tab = newTab();
tab->setUrl(webView(index)->url());
showTabBar();
@@ -758,7 +755,7 @@ void MainView::mouseDoubleClickEvent(QMouseEvent *event)
{
if (!childAt(event->pos()))
{
- newWebView(Rekonq::New);
+ newTab();
return;
}
KTabWidget::mouseDoubleClickEvent(event);
diff --git a/src/mainview.h b/src/mainview.h
index d338402a..05a7d96f 100644
--- a/src/mainview.h
+++ b/src/mainview.h
@@ -72,8 +72,6 @@ public:
StackedUrlBar *urlBarStack() const;
WebView *currentWebView() const;
int webViewIndex(WebView *webView) const;
- KAction *recentlyClosedTabsAction() const;
- void setMakeBackTab(bool b);
/**
* show and hide TabBar if user doesn't choose
@@ -104,7 +102,7 @@ public slots:
*
* @return a pointer to the new WebView
*/
- WebView *newWebView(Rekonq::OpenType type = Rekonq::Default);
+ WebView *newTab();
/**
* Core browser slot. Load an url in a webview
@@ -180,8 +178,6 @@ private:
QString m_loadingGitPath;
- bool m_makeBackTab;
-
QToolButton *m_addTabButton;
};
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 471a469a..54f72e61 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -304,7 +304,7 @@ void MainWindow::setupActions()
a = new KAction(KIcon("tab-new"), i18n("New &Tab"), this);
a->setShortcut(KShortcut(Qt::CTRL + Qt::Key_T, Qt::CTRL + Qt::Key_N));
actionCollection()->addAction(QLatin1String("new_tab"), a);
- connect(a, SIGNAL(triggered(bool)), m_view, SLOT(newWebView()));
+ connect(a, SIGNAL(triggered(bool)), m_view, SLOT(newTab()));
a = new KAction(KIcon("tab-close"), i18n("&Close Tab"), this);
a->setShortcut(KShortcut(Qt::CTRL + Qt::Key_W));
@@ -386,7 +386,6 @@ void MainWindow::slotUpdateConfiguration()
// ============== General ==================
m_homePage = ReKonfig::homePage();
mainView()->showTabBar();
- mainView()->setMakeBackTab( ReKonfig::openTabsBack() );
// "status bar" messages (new notifyMessage system)
if(ReKonfig::showUrlsPopup())