diff --git a/bin/locale/es.qm b/bin/locale/es_ES.qm similarity index 75% rename from bin/locale/es.qm rename to bin/locale/es_ES.qm index 2904023c6..cc4a5ac17 100644 Binary files a/bin/locale/es.qm and b/bin/locale/es_ES.qm differ diff --git a/bin/locale/nl_NL.qm b/bin/locale/nl_NL.qm index cad6ce224..a1ad4f031 100644 Binary files a/bin/locale/nl_NL.qm and b/bin/locale/nl_NL.qm differ diff --git a/src/downloads/downloadfilehelper.cpp b/src/downloads/downloadfilehelper.cpp index 3a414c060..cfa53d0aa 100644 --- a/src/downloads/downloadfilehelper.cpp +++ b/src/downloads/downloadfilehelper.cpp @@ -27,6 +27,7 @@ DownloadFileHelper::DownloadFileHelper(const QString &lastDownloadPath, const QString &downloadPath, bool useNativeDialog, WebPage* page) : QObject() + , m_lastDownloadOption(DownloadManager::SaveFile) , m_lastDownloadPath(lastDownloadPath) , m_downloadPath(downloadPath) , m_useNativeDialog(useNativeDialog) @@ -76,6 +77,7 @@ void DownloadFileHelper::handleUnsupportedContent(QNetworkReply* reply, bool ask if (askWhatToDo) { DownloadOptionsDialog* dialog = new DownloadOptionsDialog(m_h_fileName, m_fileIcon, mimeType, reply->url(), mApp->activeWindow()); + dialog->setLastDownloadOption(m_lastDownloadOption); dialog->show(); connect(dialog, SIGNAL(dialogFinished(int)), this, SLOT(optionsDialogAccepted(int))); } @@ -96,11 +98,15 @@ void DownloadFileHelper::optionsDialogAccepted(int finish) break; case 1: //Open m_openFileChoosed = true; + m_lastDownloadOption = DownloadManager::OpenFile; break; case 2: //Save + m_lastDownloadOption = DownloadManager::SaveFile; break; } + m_manager->setLastDownloadOption(m_lastDownloadOption); + if (!m_openFileChoosed) { if (m_downloadPath.isEmpty()) { if (m_useNativeDialog) { diff --git a/src/downloads/downloadfilehelper.h b/src/downloads/downloadfilehelper.h index 122f4dcd3..4913552b1 100644 --- a/src/downloads/downloadfilehelper.h +++ b/src/downloads/downloadfilehelper.h @@ -28,6 +28,8 @@ #include #include +#include "downloadmanager.h" + class DownloadItem; class DownloadManager; class WebPage; @@ -40,6 +42,8 @@ public: void setListWidget(QListWidget* tw) { m_listWidget = tw; } void setDownloadManager(DownloadManager* m) { m_manager = m; } + void setLastDownloadOption(const DownloadManager::DownloadOption &option) { m_lastDownloadOption = option; } + void handleUnsupportedContent(QNetworkReply* reply, bool askWhatToDo); signals: @@ -52,6 +56,7 @@ private slots: private: QString getFileName(QNetworkReply* reply); + DownloadManager::DownloadOption m_lastDownloadOption; QString m_lastDownloadPath; QString m_downloadPath; bool m_useNativeDialog; diff --git a/src/downloads/downloadmanager.cpp b/src/downloads/downloadmanager.cpp index a8792f96e..c22c4182c 100644 --- a/src/downloads/downloadmanager.cpp +++ b/src/downloads/downloadmanager.cpp @@ -188,6 +188,7 @@ void DownloadManager::handleUnsupportedContent(QNetworkReply* reply, WebPage* pa DownloadFileHelper* h = new DownloadFileHelper(m_lastDownloadPath, m_downloadPath, m_useNativeDialog, page); connect(h, SIGNAL(itemCreated(QListWidgetItem*, DownloadItem*)), this, SLOT(itemCreated(QListWidgetItem*, DownloadItem*))); + h->setLastDownloadOption(m_lastDownloadOption); h->setDownloadManager(this); h->setListWidget(ui->list); h->handleUnsupportedContent(reply, askWhatToDo); diff --git a/src/downloads/downloadmanager.h b/src/downloads/downloadmanager.h index b146264b4..714c9ac19 100644 --- a/src/downloads/downloadmanager.h +++ b/src/downloads/downloadmanager.h @@ -47,8 +47,9 @@ class WebPage; class DownloadManager : public QWidget { Q_OBJECT - public: + enum DownloadOption { OpenFile, SaveFile }; + explicit DownloadManager(QWidget* parent = 0); ~DownloadManager(); @@ -58,6 +59,7 @@ public: void handleUnsupportedContent(QNetworkReply* reply, WebPage* page, bool askWhatToDo = true); bool canClose(); void setLastDownloadPath(const QString &lastPath) { m_lastDownloadPath = lastPath; } + void setLastDownloadOption(const DownloadOption &option) { m_lastDownloadOption = option; } public slots: void show(); @@ -94,6 +96,8 @@ private: bool m_useNativeDialog; bool m_isClosing; bool m_closeOnFinish; + + DownloadOption m_lastDownloadOption; }; #endif // DOWNLOADMANAGER_H diff --git a/src/downloads/downloadoptionsdialog.cpp b/src/downloads/downloadoptionsdialog.cpp index 917dce987..0489f63a9 100644 --- a/src/downloads/downloadoptionsdialog.cpp +++ b/src/downloads/downloadoptionsdialog.cpp @@ -31,9 +31,27 @@ DownloadOptionsDialog::DownloadOptionsDialog(const QString &fileName, const QPix setFixedHeight(sizeHint().height()); + ui->buttonBox->setFocus(); + connect(this, SIGNAL(finished(int)), this, SLOT(emitDialogFinished(int))); } +void DownloadOptionsDialog::setLastDownloadOption(const DownloadManager::DownloadOption &option) +{ + switch (option) { + case DownloadManager::OpenFile: + ui->radioOpen->setChecked(true); + break; + + case DownloadManager::SaveFile: + ui->radioSave->setChecked(true); + break; + + default: + break; + } +} + void DownloadOptionsDialog::emitDialogFinished(int status) { if (status != 0) { diff --git a/src/downloads/downloadoptionsdialog.h b/src/downloads/downloadoptionsdialog.h index fec5c4326..cec1b6907 100644 --- a/src/downloads/downloadoptionsdialog.h +++ b/src/downloads/downloadoptionsdialog.h @@ -22,6 +22,8 @@ #include #include +#include "downloadmanager.h" + namespace Ui { class DownloadOptionsDialog; @@ -35,6 +37,8 @@ public: explicit DownloadOptionsDialog(const QString &fileName, const QPixmap &fileIcon, const QString &mimeType, const QUrl &url, QWidget* parent = 0); ~DownloadOptionsDialog(); + void setLastDownloadOption(const DownloadManager::DownloadOption &option); + private slots: void emitDialogFinished(int status); diff --git a/src/downloads/downloadoptionsdialog.ui b/src/downloads/downloadoptionsdialog.ui index b527839a6..613a0cd2c 100644 --- a/src/downloads/downloadoptionsdialog.ui +++ b/src/downloads/downloadoptionsdialog.ui @@ -137,9 +137,6 @@ Open... - - true - @@ -147,6 +144,9 @@ Save File + + true + diff --git a/src/other/sourceviewer.cpp b/src/other/sourceviewer.cpp index 8e83fcdaa..8c03f4e64 100644 --- a/src/other/sourceviewer.cpp +++ b/src/other/sourceviewer.cpp @@ -91,6 +91,10 @@ SourceViewer::SourceViewer(QWebPage* page, const QString &selectedHtml) : //Highlight selectedHtml if (!selectedHtml.isEmpty()) { m_sourceEdit->find(selectedHtml, QTextDocument::FindWholeWords); + } else { + QTextCursor cursor = m_sourceEdit->textCursor(); + cursor.setPosition(0); + m_sourceEdit->setTextCursor(cursor); } } diff --git a/src/src.pro b/src/src.pro index e43dca92b..06dda7ffc 100644 --- a/src/src.pro +++ b/src/src.pro @@ -35,7 +35,7 @@ TRANSLATIONS +=../translations/cs_CZ.ts\ ../translations/zh_CN.ts\ ../translations/it_IT.ts\ ../translations/pl_PL.ts\ - ../translations/es.ts\ + ../translations/es_ES.ts\ INCLUDEPATH += 3rdparty\ diff --git a/src/webview/webview.cpp b/src/webview/webview.cpp index 63ef0fd52..4616afe9a 100644 --- a/src/webview/webview.cpp +++ b/src/webview/webview.cpp @@ -46,6 +46,7 @@ WebView::WebView(QupZilla* mainClass, WebTab* webTab) , m_page(new WebPage(this, p_QupZilla)) , m_webTab(webTab) , m_locationBar(0) + , m_menu(new QMenu(this)) , m_mouseTrack(false) , m_navigationVisible(false) , m_mouseWheelEnabled(true) @@ -529,7 +530,7 @@ void WebView::mouseMoveEvent(QMouseEvent* event) void WebView::contextMenuEvent(QContextMenuEvent* event) { - QMenu* menu = new QMenu(this); + m_menu->clear(); QWebHitTestResult r = page()->mainFrame()->hitTestContent(event->pos()); @@ -537,83 +538,84 @@ void WebView::contextMenuEvent(QContextMenuEvent* event) if (page()->selectedText() == r.linkText()) { findText(""); } - menu->addAction(QIcon(":/icons/menu/popup.png"), tr("Open link in new &tab"), this, SLOT(openUrlInNewTab()))->setData(r.linkUrl()); - menu->addAction(tr("Open link in new &window"), this, SLOT(openUrlInNewWindow()))->setData(r.linkUrl()); - menu->addSeparator(); - menu->addAction(IconProvider::fromTheme("user-bookmarks"), tr("B&ookmark link"), this, SLOT(bookmarkLink()))->setData(r.linkUrl()); - menu->addAction(QIcon::fromTheme("document-save"), tr("&Save link as..."), this, SLOT(downloadLinkToDisk()))->setData(r.linkUrl()); - menu->addAction(tr("Send link..."), this, SLOT(sendLinkByMail()))->setData(r.linkUrl()); - menu->addAction(QIcon::fromTheme("edit-copy"), tr("&Copy link address"), this, SLOT(copyLinkToClipboard()))->setData(r.linkUrl()); - menu->addSeparator(); + m_menu->addAction(QIcon(":/icons/menu/popup.png"), tr("Open link in new &tab"), this, SLOT(openUrlInNewTab()))->setData(r.linkUrl()); + m_menu->addAction(tr("Open link in new &window"), this, SLOT(openUrlInNewWindow()))->setData(r.linkUrl()); + m_menu->addSeparator(); + m_menu->addAction(IconProvider::fromTheme("user-bookmarks"), tr("B&ookmark link"), this, SLOT(bookmarkLink()))->setData(r.linkUrl()); + m_menu->addAction(QIcon::fromTheme("document-save"), tr("&Save link as..."), this, SLOT(downloadLinkToDisk()))->setData(r.linkUrl()); + m_menu->addAction(tr("Send link..."), this, SLOT(sendLinkByMail()))->setData(r.linkUrl()); + m_menu->addAction(QIcon::fromTheme("edit-copy"), tr("&Copy link address"), this, SLOT(copyLinkToClipboard()))->setData(r.linkUrl()); + m_menu->addSeparator(); if (!selectedText().isEmpty()) { - menu->addAction(pageAction(QWebPage::Copy)); + m_menu->addAction(pageAction(QWebPage::Copy)); } } if (!r.imageUrl().isEmpty()) { - if (!menu->isEmpty()) { - menu->addSeparator(); + if (!m_menu->isEmpty()) { + m_menu->addSeparator(); } - menu->addAction(tr("Show i&mage"), this, SLOT(showImage()))->setData(r.imageUrl()); - menu->addAction(tr("Copy im&age"), this, SLOT(copyImageToClipboard()))->setData(r.imageUrl()); - menu->addAction(QIcon::fromTheme("edit-copy"), tr("Copy image ad&dress"), this, SLOT(copyLinkToClipboard()))->setData(r.imageUrl()); - menu->addSeparator(); - menu->addAction(QIcon::fromTheme("document-save"), tr("&Save image as..."), this, SLOT(downloadImageToDisk()))->setData(r.imageUrl()); - menu->addAction(tr("Send image..."), this, SLOT(sendLinkByMail()))->setData(r.linkUrl()); - menu->addSeparator(); + m_menu->addAction(tr("Show i&mage"), this, SLOT(showImage()))->setData(r.imageUrl()); + m_menu->addAction(tr("Copy im&age"), this, SLOT(copyImageToClipboard()))->setData(r.imageUrl()); + m_menu->addAction(QIcon::fromTheme("edit-copy"), tr("Copy image ad&dress"), this, SLOT(copyLinkToClipboard()))->setData(r.imageUrl()); + m_menu->addSeparator(); + m_menu->addAction(QIcon::fromTheme("document-save"), tr("&Save image as..."), this, SLOT(downloadImageToDisk()))->setData(r.imageUrl()); + m_menu->addAction(tr("Send image..."), this, SLOT(sendLinkByMail()))->setData(r.linkUrl()); + m_menu->addSeparator(); //menu->addAction(tr("Block image"), this, SLOT(blockImage()))->setData(r.imageUrl().toString()); if (!selectedText().isEmpty()) { - menu->addAction(pageAction(QWebPage::Copy)); + m_menu->addAction(pageAction(QWebPage::Copy)); } } QWebElement element = r.element(); - if (!element.isNull() && (element.tagName().toLower() == "input" || element.tagName().toLower() == "textarea")) { - if (menu->isEmpty()) { - delete menu; - menu = page()->createStandardContextMenu(); + if (!element.isNull() && (element.tagName().toLower() == "input" || element.tagName().toLower() == "textarea" || + element.tagName().toLower() == "video" || element.tagName().toLower() == "audio") ) { + if (m_menu->isEmpty()) { + page()->createStandardContextMenu()->popup(QCursor::pos()); + return; } } - if (menu->isEmpty()) { - QAction* action = menu->addAction(tr("&Back"), this, SLOT(back())); + if (m_menu->isEmpty()) { + QAction* action = m_menu->addAction(tr("&Back"), this, SLOT(back())); action->setIcon(IconProvider::standardIcon(QStyle::SP_ArrowBack)); history()->canGoBack() ? action->setEnabled(true) : action->setEnabled(false); - action = menu->addAction(tr("&Forward"), this, SLOT(forward())); + action = m_menu->addAction(tr("&Forward"), this, SLOT(forward())); action->setIcon(IconProvider::standardIcon(QStyle::SP_ArrowForward)); history()->canGoForward() ? action->setEnabled(true) : action->setEnabled(false); - menu->addAction(IconProvider::standardIcon(QStyle::SP_BrowserReload), tr("&Reload"), this, SLOT(slotReload())); - action = menu->addAction(IconProvider::standardIcon(QStyle::SP_BrowserStop), tr("S&top"), this, SLOT(stop())); + m_menu->addAction(IconProvider::standardIcon(QStyle::SP_BrowserReload), tr("&Reload"), this, SLOT(slotReload())); + action = m_menu->addAction(IconProvider::standardIcon(QStyle::SP_BrowserStop), tr("S&top"), this, SLOT(stop())); isLoading() ? action->setEnabled(true) : action->setEnabled(false); - menu->addSeparator(); - menu->addAction(IconProvider::fromTheme("user-bookmarks"), tr("Book&mark page"), this, SLOT(bookmarkLink())); - menu->addAction(QIcon::fromTheme("document-save"), tr("&Save page as..."), this, SLOT(downloadLinkToDisk()))->setData(url()); - menu->addAction(tr("Send page..."), this, SLOT(sendLinkByMail()))->setData(url()); - menu->addSeparator(); - menu->addAction(QIcon::fromTheme("edit-select-all"), tr("Select &all"), this, SLOT(selectAll())); + m_menu->addSeparator(); + m_menu->addAction(IconProvider::fromTheme("user-bookmarks"), tr("Book&mark page"), this, SLOT(bookmarkLink())); + m_menu->addAction(QIcon::fromTheme("document-save"), tr("&Save page as..."), this, SLOT(downloadLinkToDisk()))->setData(url()); + m_menu->addAction(tr("Send page..."), this, SLOT(sendLinkByMail()))->setData(url()); + m_menu->addSeparator(); + m_menu->addAction(QIcon::fromTheme("edit-select-all"), tr("Select &all"), this, SLOT(selectAll())); if (!selectedText().isEmpty()) { - menu->addAction(pageAction(QWebPage::Copy)); + m_menu->addAction(pageAction(QWebPage::Copy)); } - menu->addSeparator(); - menu->addAction(QIcon::fromTheme("text-html"), tr("Show so&urce code"), this, SLOT(showSource())); - menu->addAction(QIcon::fromTheme("dialog-information"), tr("Show info ab&out site"), this, SLOT(showSiteInfo()))->setData(url()); - menu->addAction(tr("Show Web &Inspector"), this, SLOT(showInspector())); + m_menu->addSeparator(); + m_menu->addAction(QIcon::fromTheme("text-html"), tr("Show so&urce code"), this, SLOT(showSource())); + m_menu->addAction(QIcon::fromTheme("dialog-information"), tr("Show info ab&out site"), this, SLOT(showSiteInfo()))->setData(url()); + m_menu->addAction(tr("Show Web &Inspector"), this, SLOT(showInspector())); } - mApp->plugins()->populateWebViewMenu(menu, this, r); + mApp->plugins()->populateWebViewMenu(m_menu, this, r); if (!selectedText().isEmpty()) { - menu->addSeparator(); + m_menu->addSeparator(); QString selectedText = page()->selectedText(); selectedText.truncate(20); SearchEngine engine = mApp->searchEnginesManager()->activeEngine(); - menu->addAction(engine.icon, tr("Search \"%1 ..\" with %2").arg(selectedText, engine.name), this, SLOT(searchSelectedText())); + m_menu->addAction(engine.icon, tr("Search \"%1 ..\" with %2").arg(selectedText, engine.name), this, SLOT(searchSelectedText())); } #if QT_VERSION == 0x040800 @@ -621,12 +623,11 @@ void WebView::contextMenuEvent(QContextMenuEvent* event) // menu->addAction(tr("Show source of selection"), this, SLOT(showSourceOfSelection())); #endif - if (!menu->isEmpty()) { + if (!m_menu->isEmpty()) { //Prevent choosing first option with double rightclick QPoint pos = QCursor::pos(); QPoint p(pos.x(), pos.y() + 1); - menu->exec(p); - delete menu; + m_menu->popup(p); return; } diff --git a/src/webview/webview.h b/src/webview/webview.h index 15dc717b9..ec3a84dec 100644 --- a/src/webview/webview.h +++ b/src/webview/webview.h @@ -153,6 +153,7 @@ private: WebTab* m_webTab; NetworkManagerProxy* m_networkProxy; LocationBar* m_locationBar; + QMenu* m_menu; bool m_mouseTrack; bool m_navigationVisible; diff --git a/translations/es.ts b/translations/es_ES.ts similarity index 98% rename from translations/es.ts rename to translations/es_ES.ts index 3f6e6a50c..38fe65bf8 100644 --- a/translations/es.ts +++ b/translations/es_ES.ts @@ -236,7 +236,7 @@ Username - + Nombre de usuario @@ -280,7 +280,7 @@ Hide Passwords - + Ocultar contraseñas @@ -308,7 +308,7 @@ Do you want QupZilla to remember password for <b>%1</b> on %2? - + ¿Desea que QupZilla recuerde las contraseñas de <b>%1</b> en %2? @@ -1122,7 +1122,7 @@ Native System Notification - + Sistema de notificación nativo @@ -1643,7 +1643,7 @@ .co.uk Append domain name on ALT + Enter = Should be different for every country - .co.uk + .co.uk @@ -1729,12 +1729,12 @@ The page you are trying to access has the following errors in the SSL certificate: - + La página a la que está intentando acceder tiene los siguientes errores en el certificado SSL: Would you like to make an exception for this certificate? - + ¿Le gustaría hacer una excepción para este certificado? @@ -2197,17 +2197,17 @@ Open speed dial - + Abrir speed dial Select all text by clicking in address bar - + Seleccionar todo el texto al hacer click en la barra de direcciones Enable XSS Auditing - + Habilitar Auditoría XSS @@ -2810,7 +2810,7 @@ Character &Encoding - &Carácter y codificación + &Codificación de caracteres @@ -2943,7 +2943,7 @@ Report &Issue - &Informar de un error + &Informar de un fallo @@ -3084,7 +3084,7 @@ Report Issue - + Informar de un fallo @@ -3226,43 +3226,43 @@ Speed Dial - + Speed Dial Add New Page - + Añadir página nueva Edit - Editar + Editar Remove - Quitar + Quitar Reload - Recargar + Recargar Url - Url + Url Title - Título + Título New Page - + Página nueva @@ -3428,28 +3428,29 @@ Por favor, añada alguno con el icono RSS de la barra de navegación en sitios q This is a list of CA Authorities Certificates stored in the standard system path and in user specified paths. - + Esta es una lista con los certificados de autoridades CA alamcenados en la ruta estándard del sistema y en las rutas especificadas por el usuario. This is a list of Local Certificates stored in your user profile. It also contains all certificates, that have received an exception. - + Esta es una lista con los certificados locales almacenados en su perfil de usuario. También contiene todos los certificados que han recibido una excepción. If CA Authorities Certificates were not automatically loaded from the system, you can specify paths manually where the certificates are stored. - + Si los certificados de autoridades CA no se cargaron automáticamente desde el sistema, puede especificar manualmente la ruta donde están almacenados. <b>NOTE:</b> Setting this option is a high security risk! - + <b>NOTA:</b> ¡Establecer esta opción supone un alto riesgo de seguridad! 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. - + Todos los certificados deben tener el sufijo .crt. +Después de añadir o quitar rutas de certificados, es necesario reiniciar QupZilla para que los cambios surjan efecto. @@ -3475,7 +3476,7 @@ After adding or removing certificate paths, it is neccessary to restart QupZilla Ignore all SSL Warnings - Ignorar todos los avisos SLL + Ignorar todos los avisos SSL @@ -4129,7 +4130,7 @@ After adding or removing certificate paths, it is neccessary to restart QupZilla New tab - Nueva pestaña + Nueva pestaña @@ -4373,4 +4374,4 @@ After adding or removing certificate paths, it is neccessary to restart QupZilla Prevenir que esta página cree diálogos adicionales - + \ No newline at end of file diff --git a/translations/nl_NL.ts b/translations/nl_NL.ts index d06a31521..766d044f6 100644 --- a/translations/nl_NL.ts +++ b/translations/nl_NL.ts @@ -236,7 +236,7 @@ Username - + Gebruikersnaam @@ -280,7 +280,7 @@ Hide Passwords - + Verberg wachtwoorden @@ -308,7 +308,7 @@ Do you want QupZilla to remember password for <b>%1</b> on %2? - + Wilt u dat QupZilla het wachtwoord onthoudt voor <b>%1</b> op %2? @@ -1123,7 +1123,7 @@ Native System Notification - + Natieve systeemmelding @@ -1644,7 +1644,7 @@ werd niet gevonden! .co.uk Append domain name on ALT + Enter = Should be different for every country - .nl + .nl @@ -1730,12 +1730,12 @@ werd niet gevonden! The page you are trying to access has the following errors in the SSL certificate: - + De pagina die u probeert te bereiken heeft de volgende fouten in het SSL-certificaat: Would you like to make an exception for this certificate? - + Wilt u een uitzondering maken voor dit certificaat? @@ -2153,7 +2153,7 @@ werd niet gevonden! Open speed dial - + Open speed dial @@ -2178,7 +2178,7 @@ werd niet gevonden! Select all text by clicking in address bar - + Selecteer alle tekst door te klikken in de adresbalk @@ -2188,7 +2188,7 @@ werd niet gevonden! Enable XSS Auditing - + Schakel XSS-auditing in @@ -3229,43 +3229,43 @@ werd niet gevonden! Speed Dial - + Speed Dial Add New Page - + Voeg nieuwe pagina toe Edit - Bewerk + Bewerk Remove - Verwijder + Verwijder Reload - Herlaad + Herlaad Url - URL + URL Title - Titel + Titel New Page - + Nieuwe pagina @@ -4134,7 +4134,7 @@ Na het toevoegen of verwijderen van paden, is het noodzakelijk om de browser te New tab - Nieuw tabblad + Nieuw tabblad