diff --git a/bin/locale/pt_PT.qm b/bin/locale/pt_PT.qm index 31415a8a6..85040694c 100644 Binary files a/bin/locale/pt_PT.qm and b/bin/locale/pt_PT.qm differ diff --git a/src/app/mainapplication.cpp b/src/app/mainapplication.cpp index ad571b338..cede50749 100644 --- a/src/app/mainapplication.cpp +++ b/src/app/mainapplication.cpp @@ -255,7 +255,7 @@ void MainApplication::postLaunch() } if (m_postLaunchActions.contains(OpenNewTab)) { - getWindow()->tabWidget()->addView(); + getWindow()->tabWidget()->addView(QUrl(), Qz::NT_SelectedTabAtTheEnd); } } @@ -479,7 +479,7 @@ void MainApplication::addNewTab(const QUrl &url) if (!getWindow()) { return; } - getWindow()->tabWidget()->addView(url); + getWindow()->tabWidget()->addView(url, Qz::NT_SelectedTabAtTheEnd); } QupZilla* MainApplication::makeNewWindow(Qz::BrowserWindow type, const QUrl &startUrl) diff --git a/src/app/qupzilla.cpp b/src/app/qupzilla.cpp index 30119d7a8..6e3df5904 100644 --- a/src/app/qupzilla.cpp +++ b/src/app/qupzilla.cpp @@ -127,7 +127,7 @@ void QupZilla::postLaunch() for (int i = 0; i < qApp->arguments().count(); i++) { QString arg = arguments.at(i); if (arg.startsWith("-url=")) { - m_tabWidget->addView(QUrl(arg.replace("-url=", ""))); + m_tabWidget->addView(QUrl(arg.replace("-url=", "")), Qz::NT_SelectedTabAtTheEnd); addTab = false; } } @@ -181,8 +181,7 @@ void QupZilla::postLaunch() } if (addTab) { - int index = m_tabWidget->addView(startUrl, Qz::NT_CleanSelectedTab); - m_tabWidget->setCurrentIndex(index); + m_tabWidget->addView(startUrl, Qz::NT_SelectedTabAtTheEnd); if (startUrl.isEmpty() || startUrl.toString() == "qupzilla:speeddial") { locationBar()->setFocus(); @@ -191,7 +190,7 @@ void QupZilla::postLaunch() if (m_tabWidget->getTabBar()->normalTabsCount() <= 0 && m_startBehaviour != Qz::BW_OtherRestoredWindow) { //Something went really wrong .. add one tab - m_tabWidget->addView(m_homepage); + m_tabWidget->addView(m_homepage, Qz::NT_SelectedTabAtTheEnd); } aboutToShowBookmarksMenu(); @@ -1351,7 +1350,7 @@ void QupZilla::aboutQupZilla() void QupZilla::addTab() { - m_tabWidget->addView(QUrl(), Qz::NT_SelectedTab, true); + m_tabWidget->addView(QUrl(), Qz::NT_SelectedTabAtTheEnd, true); } void QupZilla::webSearch() diff --git a/src/app/qz_namespace.h b/src/app/qz_namespace.h index 1743651d7..c08295afd 100644 --- a/src/app/qz_namespace.h +++ b/src/app/qz_namespace.h @@ -37,7 +37,10 @@ enum NewTabPositionFlag { NT_SelectedTab = 1, NT_NotSelectedTab = 2, NT_CleanTab = 4, + NT_TabAtTheEnd = 8, + NT_SelectedTabAtTheEnd = NT_SelectedTab | NT_TabAtTheEnd, + NT_NotSelectedTabAtTheEnd = NT_NotSelectedTab | NT_TabAtTheEnd, NT_CleanSelectedTab = NT_CleanTab | NT_SelectedTab, NT_CleanNotSelectedTab = NT_CleanTab | NT_NotSelectedTab }; diff --git a/src/webview/tabbar.cpp b/src/webview/tabbar.cpp index a86b4a62c..7d66597a7 100644 --- a/src/webview/tabbar.cpp +++ b/src/webview/tabbar.cpp @@ -341,7 +341,7 @@ void TabBar::mouseMoveEvent(QMouseEvent* event) void TabBar::mouseDoubleClickEvent(QMouseEvent* event) { if (event->button() == Qt::LeftButton && tabAt(event->pos()) == -1) { - m_tabWidget->addView(QUrl(), Qz::NT_SelectedTab, true); + m_tabWidget->addView(QUrl(), Qz::NT_SelectedTabAtTheEnd, true); return; } @@ -365,7 +365,7 @@ void TabBar::mouseReleaseEvent(QMouseEvent* event) return; } if (id == -1 && event->button() == Qt::MiddleButton) { - m_tabWidget->addView(QUrl(), Qz::NT_SelectedTab, true); + m_tabWidget->addView(QUrl(), Qz::NT_SelectedTabAtTheEnd, true); return; } diff --git a/src/webview/tabwidget.cpp b/src/webview/tabwidget.cpp index 9e89e8406..b1688cbb7 100644 --- a/src/webview/tabwidget.cpp +++ b/src/webview/tabwidget.cpp @@ -278,7 +278,7 @@ int TabWidget::addView(QUrl url, const QString &title, const Qz::NewTabPositionF url = m_urlOnNewTab; } - if (m_newTabAfterActive) { + if (m_newTabAfterActive && !(openFlags & Qz::NT_TabAtTheEnd)) { // If we are opening newBgTab from pinned tab, make sure it won't be // opened between other pinned tabs position = qMax(currentIndex() + 1, m_tabBar->pinnedTabsCount()); diff --git a/src/webview/webpage.cpp b/src/webview/webpage.cpp index 2426e5814..ed258b669 100644 --- a/src/webview/webpage.cpp +++ b/src/webview/webpage.cpp @@ -265,12 +265,6 @@ void WebPage::populateNetworkRequest(QNetworkRequest &request) QWebPage* WebPage::createWindow(QWebPage::WebWindowType type) { -#if 0 - Q_UNUSED(type); - int index = p_QupZilla->tabWidget()->addView(QUrl(), TabWidget::CleanSelectedPage); - return p_QupZilla->weView(index)->page(); -#endif - return new PopupWebPage(type, p_QupZilla); } diff --git a/src/webview/webview.cpp b/src/webview/webview.cpp index 7419afefe..900fa0333 100644 --- a/src/webview/webview.cpp +++ b/src/webview/webview.cpp @@ -553,14 +553,14 @@ void WebView::createContextMenu(QMenu* menu, const QWebHitTestResult &hitTest, c } #if (QTWEBKIT_VERSION >= QTWEBKIT_VERSION_CHECK(2, 2, 0)) -// still bugged? in 4.8 RC (it shows selection of webkit's internal source, not html from page) -// it may or may not be bug, but this implementation is useless for us -// -// if (!selectedHtml().isEmpty()) -// menu->addAction(tr("Show source of selection"), this, SLOT(showSourceOfSelection())); + // still bugged? in 4.8 RC (it shows selection of webkit's internal source, not html from page) + // it may or may not be bug, but this implementation is useless for us + // + // if (!selectedHtml().isEmpty()) + // menu->addAction(tr("Show source of selection"), this, SLOT(showSourceOfSelection())); #endif -// mApp->plugins()->populateWebViewMenu(m_menu, this, hitTest); + // mApp->plugins()->populateWebViewMenu(m_menu, this, hitTest); } void WebView::createPageContextMenu(QMenu* menu, const QPoint &pos) @@ -608,8 +608,8 @@ void WebView::createPageContextMenu(QMenu* menu, const QPoint &pos) menu->addAction(QIcon::fromTheme("edit-select-all"), tr("Select &all"), this, SLOT(selectAll())); menu->addSeparator(); if (url().scheme() == "http" || url().scheme() == "https") { -// bool result = validateConfirm(tr("Do you want to upload this page to an online source code validator?")); -// if (result) + // bool result = validateConfirm(tr("Do you want to upload this page to an online source code validator?")); + // if (result) menu->addAction(tr("Validate page"), this, SLOT(openUrlInSelectedTab()))->setData("http://validator.w3.org/check?uri=" + url().toString()); } @@ -783,12 +783,21 @@ void WebView::mousePressEvent(QMouseEvent* event) return; } #endif + QWebFrame* frame = page()->frameAt(event->pos()); + if (frame) { + m_clickedUrl = frame->hitTestContent(event->pos()).linkUrl(); + } } case Qt::LeftButton: { QWebFrame* frame = page()->frameAt(event->pos()); if (frame) { - m_clickedUrl = frame->hitTestContent(event->pos()).linkUrl(); + QUrl link = frame->hitTestContent(event->pos()).linkUrl(); + if (event->modifiers() == Qt::ControlModifier && isUrlValid(link)) { + openUrlInNewTab(link, Qz::NT_NotSelectedTab); + event->accept(); + return; + } } } @@ -816,22 +825,6 @@ void WebView::mouseReleaseEvent(QMouseEvent* event) break; } - case Qt::LeftButton: { - QWebFrame* frame = page()->frameAt(event->pos()); - if (frame) { - QUrl link = frame->hitTestContent(event->pos()).linkUrl(); - if (m_clickedUrl == link && event->modifiers() == Qt::ControlModifier) { - if (isUrlValid(link)) { - openUrlInNewTab(link, Qz::NT_NotSelectedTab); - event->accept(); - return; - } - } - } - - break; - } - default: break; } @@ -905,7 +898,7 @@ bool WebView::eventFilter(QObject* obj, QEvent* event) QTouchEvent::TouchPoint touchPoint; touchPoint.setState(Qt::TouchPointMoved); if ((ev->type() == QEvent::MouseButtonPress - || ev->type() == QEvent::MouseButtonDblClick)) { + || ev->type() == QEvent::MouseButtonDblClick)) { touchPoint.setState(Qt::TouchPointPressed); } else if (ev->type() == QEvent::MouseButtonRelease) { diff --git a/translations/pt_PT.ts b/translations/pt_PT.ts index aed35e85c..e391d49eb 100644 --- a/translations/pt_PT.ts +++ b/translations/pt_PT.ts @@ -2475,12 +2475,12 @@ não foi encontrado! Allow HTML5 local storage - + Permitir armazenamento local HTML5 Delete local storage on close - + Eliminar armazenamento local ao fechar @@ -2565,12 +2565,12 @@ não foi encontrado! Filter tracking cookies - + Filtrar cookies de rastreio <b>Warning:</b> Match domain exactly and filter tracking cookies options can lead to deny some cookies from sites. If you have problems with cookies, try to disable this options first! - + <b>Aviso:</b> as opções Coincidente com domínio e Filtrar cookies de rastreio podem recusar alguns cookies das páginas visitados. Se ocorrem problemas, tente desativar estas opções! Default Font @@ -2694,7 +2694,7 @@ não foi encontrado! <b>SSL Certificates</b> - + <b>Certificados SSL</b> @@ -2704,7 +2704,7 @@ não foi encontrado! Edit CA certificates in SSL Manager - + Editar certificados no gestor SSL