From 801c6ac411f787c8ad0febab9da2f1b20fc2c84e Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 1 Aug 2009 02:06:55 +0200 Subject: Some string changes and various fixes --- src/application.cpp | 7 ++++--- src/mainview.cpp | 10 +++++++--- src/mainview.h | 2 +- src/webpage.cpp | 4 ++-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/application.cpp b/src/application.cpp index 06e67218..ff52d935 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -283,8 +283,8 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) // this should let rekonq to support the beautiful KDE web browsing shortcuts loadingUrl = KUriFilter::self()->filteredUri(loadingUrl); - WebView *webView=m_mainWindow->mainView()->currentWebView(); - + WebView *webView; + switch(type) { case Rekonq::SettingOpenTab: @@ -296,7 +296,8 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) case Rekonq::BackgroundTab: webView = m_mainWindow->mainView()->newTab(false); break; - case Rekonq::CurrentTab: // nothing to do here.. just to save a warning!! + case Rekonq::CurrentTab: + webView = m_mainWindow->mainView()->currentWebView(); break; }; diff --git a/src/mainview.cpp b/src/mainview.cpp index 8c1de1f6..5fc24512 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -350,7 +350,7 @@ WebView *MainView::webView(int index) const } -WebView *MainView::newTab(bool focus) +WebView *MainView::newTab(bool focused) { // line edit UrlBar *urlBar = new UrlBar; // Ownership of widget is passed on to the QStackedWidget (addWidget method). @@ -380,8 +380,12 @@ WebView *MainView::newTab(bool focus) connect(webView->page(), SIGNAL(printRequested(QWebFrame *)), this, SIGNAL(printRequested(QWebFrame *))); addTab(webView, i18n("(Untitled)")); - if (focus) setCurrentWidget(webView); - + + if (focused) + { + setCurrentWidget(webView); + } + urlBar->setFocus(); emit tabsChanged(); diff --git a/src/mainview.h b/src/mainview.h index 99693ed6..d7f7675b 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -102,7 +102,7 @@ public slots: * * @return a pointer to the new WebView */ - WebView *newTab(bool focus = true); + WebView *newTab(bool focused = true); void slotCloneTab(int index = -1); void slotCloseTab(int index = -1); diff --git a/src/webpage.cpp b/src/webpage.cpp index 7938208a..11d17a6e 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -105,7 +105,7 @@ bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &r // if frame doesn't exists (perhaps) we are pointing to a blank target.. if (!frame) { - Application::instance()->loadUrl(request.url(), Rekonq::NewTab); + Application::instance()->loadUrl(request.url(), Rekonq::SettingOpenTab); return false; } } @@ -131,7 +131,7 @@ WebPage *WebPage::newWindow(WebWindowType type) kDebug() << "Modal Dialog ---------------------------------------"; } - WebView *w = Application::instance()->mainWindow()->mainView()->newTab(); + WebView *w = Application::instance()->mainWindow()->mainView()->newTab(!ReKonfig::openTabsBack()); return w->page(); } -- cgit v1.2.1