summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/application.cpp45
-rw-r--r--src/application.h11
-rw-r--r--src/bookmarks.cpp2
-rw-r--r--src/mainview.cpp2
-rw-r--r--src/urlbar.cpp1
5 files changed, 37 insertions, 24 deletions
diff --git a/src/application.cpp b/src/application.cpp
index e7ea9f23..8581c56d 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -97,12 +97,13 @@ int Application::newInstance()
{
for (int i = 0; i < args->count(); ++i)
{
- loadUrl(args->arg(i), Rekonq::New);
+ loadUrl(args->arg(i), Rekonq::NewTab);
}
args->clear();
}
else
{
+ m_mainWindow->mainView()->newTab();
m_mainWindow->slotHome();
}
@@ -310,25 +311,35 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type)
loadingUrl.setUrl( QString("http://en.wikipedia.org/wiki/%1").arg(str) );
}
-
- WebView *webView = m_mainWindow->mainView()->newTab();
- m_mainWindow->mainView()->currentUrlBar()->setUrl(loadingUrl.prettyUrl());
-
- switch(type)
+ WebView *webView;
+ if( type == Rekonq::CurrentTab )
+ {
+ webView = m_mainWindow->currentTab();
+ m_mainWindow->mainView()->currentUrlBar()->setUrl(loadingUrl.prettyUrl());
+ }
+ else
{
- case Rekonq::Default:
- if (!ReKonfig::openTabsBack())
+ webView = m_mainWindow->mainView()->newTab();
+ m_mainWindow->mainView()->currentUrlBar()->setUrl(loadingUrl.prettyUrl());
+
+ switch(type)
{
+ case Rekonq::SettingOpenTab:
+ if (!ReKonfig::openTabsBack())
+ {
+ m_mainWindow->mainView()->setCurrentWidget(webView); // this method does NOT take ownership of webView
+ }
+ break;
+ case Rekonq::NewTab:
m_mainWindow->mainView()->setCurrentWidget(webView); // this method does NOT take ownership of webView
- }
- break;
- case Rekonq::New:
- m_mainWindow->mainView()->setCurrentWidget(webView); // this method does NOT take ownership of webView
- break;
- case Rekonq::Background:
- break;
- };
-
+ break;
+ case Rekonq::BackgroundTab: // no need for focus here
+ break;
+ case Rekonq::CurrentTab: // nothing to do here.. just to save a warning!!
+ break;
+ };
+ }
+
if (webView)
{
webView->setFocus();
diff --git a/src/application.h b/src/application.h
index 6f726154..615bfe6b 100644
--- a/src/application.h
+++ b/src/application.h
@@ -67,9 +67,10 @@ namespace Rekonq
*/
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
+ CurrentTab, ///< open url in current tab
+ SettingOpenTab, ///< open url according to users settings
+ NewTab, ///< open url in new tab and make it current
+ BackgroundTab ///< open url in new tab in background
};
}
@@ -107,11 +108,11 @@ public slots:
public slots:
void loadUrl( const KUrl& url,
- const Rekonq::OpenType& type = Rekonq::Default
+ const Rekonq::OpenType& type = Rekonq::CurrentTab
);
void loadUrl( const QString& urlString,
- const Rekonq::OpenType& type = Rekonq::Default
+ const Rekonq::OpenType& type = Rekonq::CurrentTab
);
diff --git a/src/bookmarks.cpp b/src/bookmarks.cpp
index c3787ff0..8797c7cd 100644
--- a/src/bookmarks.cpp
+++ b/src/bookmarks.cpp
@@ -91,7 +91,7 @@ void BookmarkOwner::openFolderinTabs(const KBookmarkGroup &bm)
QList<KUrl>::iterator url;
for (url = urlList.begin(); url != urlList.end(); ++url)
{
- Application::instance()->loadUrl(*url, Rekonq::New);
+ Application::instance()->loadUrl(*url, Rekonq::NewTab);
}
}
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 74fff11b..c0d8591a 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -359,7 +359,7 @@ WebView *MainView::newTab()
connect(urlBar, SIGNAL(activated(const KUrl&)), Application::instance(), SLOT(loadUrl(const KUrl&)));
m_urlBars->addUrlBar(urlBar);
- WebView *webView = new WebView; // should be deleted on tab close
+ WebView *webView = new WebView; // should be deleted on tab close?
// connecting webview with urlbar
connect(webView, SIGNAL(loadProgress(int)), urlBar, SLOT(slotUpdateProgress(int)));
diff --git a/src/urlbar.cpp b/src/urlbar.cpp
index d107ba1a..af336e1c 100644
--- a/src/urlbar.cpp
+++ b/src/urlbar.cpp
@@ -243,6 +243,7 @@ QSize UrlBar::sizeHint() const
return size;
}
+
QLinearGradient UrlBar::generateGradient(const QColor &color, int height)
{
QColor base = s_defaultBaseColor;