diff --git a/bin/locale/nl_NL.qm b/bin/locale/nl_NL.qm index a1ad4f031..33c85ea50 100644 Binary files a/bin/locale/nl_NL.qm and b/bin/locale/nl_NL.qm differ diff --git a/bin/locale/zh_CN.qm b/bin/locale/zh_CN.qm index 515bc3160..a77ceee60 100644 Binary files a/bin/locale/zh_CN.qm and b/bin/locale/zh_CN.qm differ diff --git a/src/navigation/navigationbar.cpp b/src/navigation/navigationbar.cpp index a8b6d4b6a..a8763a344 100644 --- a/src/navigation/navigationbar.cpp +++ b/src/navigation/navigationbar.cpp @@ -22,6 +22,7 @@ #include "websearchbar.h" #include "reloadstopbutton.h" #include "webhistorywrapper.h" +#include "menu.h" NavigationBar::NavigationBar(QupZilla* mainClass, QWidget* parent) : QWidget(parent) @@ -65,9 +66,9 @@ NavigationBar::NavigationBar(QupZilla* mainClass, QWidget* parent) m_buttonAddTab->setToolButtonStyle(Qt::ToolButtonIconOnly); m_buttonAddTab->setAutoRaise(true); - m_menuBack = new QMenu(this); + m_menuBack = new Menu(this); m_buttonBack->setMenu(m_menuBack); - m_menuForward = new QMenu(); + m_menuForward = new Menu(this); m_buttonNext->setMenu(m_menuForward); m_supMenu = new ToolButton(this); @@ -159,8 +160,18 @@ void NavigationBar::aboutToShowHistoryBackMenu() title.truncate(40); title += ".."; } - QAction* action = m_menuBack->addAction(_iconForUrl(item.url()), title, this, SLOT(goAtHistoryIndex())); - action->setData(i); + + QIcon icon = item.icon(); + if (icon.isNull()) { + icon = _iconForUrl(item.url()); + } + + Action* act = new Action(icon, title); + act->setData(i); + connect (act, SIGNAL(triggered()), this, SLOT(goAtHistoryIndex())); + connect (act, SIGNAL(middleClicked()), this, SLOT(goAtHistoryIndexInNewTab())); + m_menuBack->addAction(act); + lastUrl = item.url(); } @@ -194,8 +205,18 @@ void NavigationBar::aboutToShowHistoryNextMenu() title.truncate(40); title += ".."; } - QAction* action = m_menuForward->addAction(_iconForUrl(item.url()), title, this, SLOT(goAtHistoryIndex())); - action->setData(i); + + QIcon icon = item.icon(); + if (icon.isNull()) { + icon = _iconForUrl(item.url()); + } + + Action* act = new Action(icon, title); + act->setData(i); + connect (act, SIGNAL(triggered()), this, SLOT(goAtHistoryIndex())); + connect (act, SIGNAL(middleClicked()), this, SLOT(goAtHistoryIndexInNewTab())); + m_menuForward->addAction(act); + lastUrl = item.url(); } @@ -218,13 +239,28 @@ void NavigationBar::clearHistory() void NavigationBar::goAtHistoryIndex() { + QWebHistory* history = p_QupZilla->weView()->page()->history(); + if (QAction* action = qobject_cast(sender())) { - p_QupZilla->weView()->page()->history()->goToItem(p_QupZilla->weView()->page()->history()->itemAt(action->data().toInt())); + history->goToItem(history->itemAt(action->data().toInt())); } refreshHistory(); } +void NavigationBar::goAtHistoryIndexInNewTab() +{ + if (QAction* action = qobject_cast(sender())) { + TabWidget* tabWidget = p_QupZilla->tabWidget(); + tabWidget->duplicateTab(tabWidget->currentIndex()); + + int index = tabWidget->count() - 1; + QWebHistory* history = p_QupZilla->weView(index)->page()->history(); + + history->goToItem(history->itemAt(action->data().toInt())); + } +} + void NavigationBar::refreshHistory() { if (mApp->isClosing() || p_QupZilla->isClosing()) { diff --git a/src/navigation/navigationbar.h b/src/navigation/navigationbar.h index 0b038368b..0d4beaad3 100644 --- a/src/navigation/navigationbar.h +++ b/src/navigation/navigationbar.h @@ -27,6 +27,7 @@ class ToolButton; class WebSearchBar; class QupZilla; class ReloadStopButton; +class Menu; class NavigationBar : public QWidget { Q_OBJECT @@ -61,6 +62,8 @@ private slots: void aboutToShowHistoryBackMenu(); void goAtHistoryIndex(); + void goAtHistoryIndexInNewTab(); + void clearHistory(); private: @@ -76,8 +79,8 @@ private: ToolButton* m_exitFullscreen; ReloadStopButton* m_reloadStop; - QMenu* m_menuBack; - QMenu* m_menuForward; + Menu* m_menuBack; + Menu* m_menuForward; WebSearchBar* m_searchLine; }; diff --git a/translations/nl_NL.ts b/translations/nl_NL.ts index aa2d9ff1b..1126890a0 100644 --- a/translations/nl_NL.ts +++ b/translations/nl_NL.ts @@ -358,7 +358,7 @@ From File - + Uit bestand @@ -441,7 +441,7 @@ You can import bookmarks from any browser that supports HTML exporting. This file has usually these suffixes - + U kunt bladwijzers importeren uit elke browser die HTML-exportering ondersteund. Het bestand heeft doorgaans deze extensies @@ -460,7 +460,7 @@ Please press Finish to complete importing process. - + Klik alstublieft op Afronden om het import-proces te voltooiien. @@ -1646,12 +1646,12 @@ werd niet gevonden! No Error - Geen fout + Geen fout Unable to open file. - + Niet in staat om bestand te openen. @@ -2202,7 +2202,7 @@ werd niet gevonden! Hide tabs when there is only one tab - + Verberg tabbladen wanneer er maar 1 tabblad is diff --git a/translations/zh_CN.ts b/translations/zh_CN.ts index 16dc0f3db..db596c384 100644 --- a/translations/zh_CN.ts +++ b/translations/zh_CN.ts @@ -236,7 +236,7 @@ Username - + 用户名 @@ -280,7 +280,7 @@ Hide Passwords - + 隐藏密码 @@ -308,7 +308,7 @@ Do you want QupZilla to remember password for <b>%1</b> on %2? - + 你想QupZilla记住密码<b>%1</b> on %2? @@ -358,7 +358,7 @@ From File - + 从文件 @@ -409,7 +409,7 @@ Please press Finish to complete importing process. - + 请按Finish以完成导入过程。 @@ -432,7 +432,7 @@ Mozilla Firefox stores its bookmarks in <b>places.sqlite</b> SQLite database. This file is usually located in - + Mozilla Firefox的书签</ B> SQLite数据库存储在<b> places.sqlite。此文件通常位于 @@ -445,7 +445,7 @@ Google Chrome stores its bookmarks in <b>Bookmarks</b> text file. This file is usually located in - + 谷歌浏览器存储在<b>书签书签</ b>文本文件。此文件通常位于 @@ -455,7 +455,7 @@ You can import bookmarks from any browser that supports HTML exporting. This file has usually these suffixes - + 您可以从任何支持HTML的浏览器中导入书签。此文件通常这些后缀 @@ -819,7 +819,7 @@ Database successfully optimized.<br/><br/><b>Database Size Before: </b>%1<br/><b>Database Size After: </b>%2 - + 数据库成功优化<br/> <br/><b>优化前数据库大小:</b>%1<br/><b>优化后数据库大小:</b>%2 @@ -827,7 +827,7 @@ <b>Issued To</b> - 导出 + <b>导出<b> @@ -855,12 +855,12 @@ <b>Issued By</b> - + <b>发行人<b> <b>Validity</b> - <b>有效期的</ B> + <b>有效期的</b> @@ -1140,7 +1140,7 @@ Native System Notification - + 本机系统通知 @@ -1154,7 +1154,7 @@ NoNameDownload - + 无命名下载 @@ -1162,109 +1162,109 @@ Remaining time unavailable - + 剩余时间不可用 Done - %1 - + 完成-%1 Cancelled - + 取消 few seconds - + 几秒钟 seconds - + minutes - + 分钟 hours - + 小时 Unknown speed - + 未知速度 Unknown size - + 未知大小 %2 - unknown size (%3) - + %2-未知大小(%3) Remaining %1 - %2 of %3 (%4) - + 剩余 %1-%2 of %3 (%4) Cancelled - %1 - + 取消-%1 Delete file - + 删除文件 Do you want to also delete dowloaded file? - + 你也想删除下载的文件吗? Open File - + 打开文件 Open Folder - + 打开文件夹 Go to Download Page - + 转到下载页面 Copy Download Link - + 复制下载链接 Cancel downloading - + 取消下载 Clear - + 清除 Error - + 错误 @@ -1274,24 +1274,24 @@ Not found - + 未找到 Sorry, the file %1 was not found! - + 对不起,文件%1未找到! Error: Cannot write to file! - + 错误:无法写入文件! Error: - + 错误: @@ -1311,7 +1311,7 @@ %1% of %2 files (%3) %4 remaining - + %1%的%2文件(%3)%4剩余 @@ -1643,12 +1643,12 @@ No Error - 没有错误 + 没有错误 Unable to open file. - 无法打开文件。 + 无法打开文件。 @@ -1672,7 +1672,7 @@ .co.uk Append domain name on ALT + Enter = Should be different for every country - + .co.uk @@ -1685,7 +1685,7 @@ <b>QupZilla crashed :-(</b><br/>Oops, last session of QupZilla ends with its crash. We are very sorry. Would you try to restore saved state? - + QupZilla上次结束时崩溃,我们非常遗憾。您要还原保存的状态吗? @@ -1758,12 +1758,12 @@ The page you are trying to access has the following errors in the SSL certificate: - + 您试图访问的页面有SSL证书错误: Would you like to make an exception for this certificate? - + 你想使这个证书例外吗? @@ -1790,7 +1790,7 @@ A username and password are being requested by %1. The site says: "%2" - + 要求%1的用户名和密码。该网站说:“%2” @@ -2224,22 +2224,22 @@ Open speed dial - + 打开快速拨号 Hide tabs when there is only one tab - + 隐藏选项卡当只有一个选项卡时 Select all text by clicking in address bar - + 通过点击地址栏选择所有文本 Enable XSS Auditing - + 启用的XSS审计 @@ -2975,12 +2975,12 @@ Report &Issue - 报告及发行&I + &I报告及发行 &Web Search - 网页搜索&W + &W网页搜索 @@ -2990,17 +2990,17 @@ &Download Manager - 下载管理&D + &D下载管理 &Cookies Manager - 管理Cookies&C + &C管理Cookies &AdBlock - + &AdBlock @@ -3117,7 +3117,7 @@ Report Issue - + 报告问题 @@ -3259,43 +3259,43 @@ Speed Dial - + 快速拨号 Add New Page - + 添加新网页 Edit - 编辑 + 编辑 Remove - 删除 + 删除 Reload - 刷新 + 刷新 Url - 地址 + 地址 Title - 标题 + 标题 New Page - + 新网页 @@ -3460,28 +3460,28 @@ Please add some with RSS icon in navigation bar on site which offers feeds. This is a list of CA Authorities Certificates stored in the standard system path and in user specified paths. - + 这是一个标准系统路径和用户指定路径中的CA机构的证书列表。 This is a list of Local Certificates stored in your user profile. It also contains all certificates, that have received an exception. - + 这是一个存储在您用户配置文件中的本地证书列表。它也包含了所有的证书,已接收到一个异常。 If CA Authorities Certificates were not automatically loaded from the system, you can specify paths manually where the certificates are stored. - + 如果CA机构证书不会自动加载到系统中,你可以手动指定证书存储路径。 <b>NOTE:</b> Setting this option is a high security risk! - + <b>注意:</b>设置这个选项有很高的安全风险! All certificates must have .crt suffix. After adding or removing certificate paths, it is neccessary to restart QupZilla in order to take effect the changes. - + 所有证书必须有.CRT后缀。添加或删除证书路径后,QupZilla需要重新启动才能生效. @@ -4162,7 +4162,7 @@ After adding or removing certificate paths, it is neccessary to restart QupZilla New tab - 新标签 + 新标签