From d78df618b04ab4f9196adb795230dd91b1f80951 Mon Sep 17 00:00:00 2001 From: nowrep Date: Thu, 26 Jan 2012 20:19:56 +0100 Subject: [PATCH] Little changes in "open new tab after active" + in ctrl+click on links - when opening clean new tab, it will be opened at the end of tabbar regardless of user settings - fixing issue when ctrl+left clicking on dial in speed dial opening page in new tab and also started to drag dial --- bin/locale/pt_PT.qm | Bin 93049 -> 93577 bytes src/app/mainapplication.cpp | 4 ++-- src/app/qupzilla.cpp | 9 ++++---- src/app/qz_namespace.h | 3 +++ src/webview/tabbar.cpp | 4 ++-- src/webview/tabwidget.cpp | 2 +- src/webview/webpage.cpp | 6 ----- src/webview/webview.cpp | 45 +++++++++++++++--------------------- translations/pt_PT.ts | 12 +++++----- 9 files changed, 37 insertions(+), 48 deletions(-) diff --git a/bin/locale/pt_PT.qm b/bin/locale/pt_PT.qm index 31415a8a6862c97f0534018a7634ceb0e8b3e65f..85040694cb92494371feecd6310e10397dc091cf 100644 GIT binary patch delta 6510 zcmY*dd00*B+rHnu_u6akwe}z>3QfvT8VpHNP7;z|R-xcNWZ=o(qxz&lnK81c;}x z!WIHOY=9Bd!7OfO&b88gG=*f>S)i;fWQ*1Vi7z0_*b6+G2-&uoG>Q(g9b14W$&eko zPcxZiK&GVUifMF{jYfQ0VL&F(ICP)cG==Pv1DNd%!d_r@D#&iF1oAgS_Sqds`WIXa zPv|X~iSBC)aDkryoAu!0uLD!P!7bfO@05bepl{SH1NTQM(0w4d4Gw@{PS^{0pAK%j z9yt0F-0n!Q4xhlCrS}{>!IgglVywVbm(lfjaCeG<-l-6qrvjNyuz&dotW7-HPIiHg zHI6{rSDk^i7I6F(gmb0_WPY)5{I$rkH*loIpu8m^eYkue9ACQu6@cTf#ZF z79Iq%oQY8@P66F25nJd8Y*iulMk_#FhOzS~>2>EZNtp-MG69oT3qWK#CQl@`4Zn_Q zUdzGUdSTZ4RQmlMQYR^ZxnGg?7cpYocdRZ>0P_jMIuk4CJIX9{7UOZ4JqB|&!SO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m;S57a-xD{A*FIk!9I^22!f&_WV(;edR& z*t4` zvdOQikA^$AA2w{I!lR+dw5q-7}g( z%2^AS8l7%L19`c|iobE4#)pm0f)=s8#8@Y;4`7~Sbnh^d)^@>IFDH^ri;*^|YD=s8 z6XSr$J=9X7aZnQ1U$xsfkTKdAGocql ze9M@yauY-BW1MW=%k2H#_+#j9de(2o#E^U@fwOV;_gU0(gmKPRdS7}4<1gdNXkAN< z^S-GLZxLA6xV(ciO)=EC{Ca!3hqo~$g3LcjFs>+iL-D>c{@RWc^JUw^s=n42myNlC zxu9Nc%$wT+@XK}Js4xe<3pN%MxiFXN8w=Mnkgtvz&rIfdL!TPYymAFuMjP7* z0XYzc1*V3cISgEq$>$9B{c~MY+w_q@w`fz>coNWWjj6}qzp>PAH}#r(g{}N$Q?E3M z*D#JxO#|L-G=;b2hUz$(2EXEZI)f=9lRUItZW?og_7#7^H0CDV=;TT}icV)tW$NB(cTCd{;HR}tG| zU(>dE+gN<#OnaLL(byK5atzswT?JEqiU*7RYSW3+0sKN`wWFwf)O2cU3v$r3iK#4` z7HqC;Dqq}<&VJ7HJ~xq8tT+Al9nZAC)bwFXMOKJf=89duiZRY?7iE)4=8EUeLo^*? zuB2KFQQ?8vIh<$wx39TopqZZ_E}LCyW$@EkSF_LlvGj|0v(HD0Kdq&?Rk!wvWSu4zaY7y6+HIMLOv@gCgM}%Hu2i?;=Zb=pPL(j|;{1~J$|HFxe z_OWQx%7MYx%+{FmSw4FN5fJ zzH7~|?vzuNea)X==CicKIPjc{9Yy^u7I_~lb^8nlM!7lgVwfF;MY2>3%i~RGs-@P+ zSav<(iEf122shuqC+&o!CXIp|g@w01t$r5~*QgZKV>C-BaH=ztme>XtabWidget()->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