diff --git a/bin/locale/cs_CZ.qm b/bin/locale/cs_CZ.qm index 95e2405bd..45a367b75 100644 Binary files a/bin/locale/cs_CZ.qm and b/bin/locale/cs_CZ.qm differ diff --git a/src/QupZilla.pro b/src/QupZilla.pro index 7ef145575..c0a5adce5 100644 --- a/src/QupZilla.pro +++ b/src/QupZilla.pro @@ -81,8 +81,9 @@ SOURCES += main.cpp\ plugins/webpluginfactory.cpp \ downloads/downloaditem.cpp \ 3rdparty/ecwin7.cpp \ - autofill/autofillwidget.cpp \ - webview/webtab.cpp + webview/webtab.cpp \ + rss/rsswidget.cpp \ + autofill/autofillnotification.cpp HEADERS += 3rdparty/squeezelabel.h \ 3rdparty/qtwin.h \ @@ -133,8 +134,9 @@ HEADERS += 3rdparty/squeezelabel.h \ plugins/webpluginfactory.h \ downloads/downloaditem.h \ 3rdparty/ecwin7.h \ - autofill/autofillwidget.h \ - webview/webtab.h + webview/webtab.h \ + rss/rsswidget.h \ + autofill/autofillnotification.h FORMS += \ preferences/autofillmanager.ui \ @@ -151,7 +153,8 @@ FORMS += \ webview/siteinfowidget.ui \ downloads/downloaditem.ui \ downloads/downloadmanager.ui \ - autofill/autofillwidget.ui + rss/rsswidget.ui \ + autofill/autofillnotification.ui RESOURCES += \ data/icons.qrc \ diff --git a/src/autofill/autofillmodel.cpp b/src/autofill/autofillmodel.cpp index 0129182d9..6e2051242 100644 --- a/src/autofill/autofillmodel.cpp +++ b/src/autofill/autofillmodel.cpp @@ -177,7 +177,7 @@ void AutoFillModel::post(const QNetworkRequest &request, const QByteArray &outgo } } - AutoFillWidget* aWidget = new AutoFillWidget(request.url(), outgoingData, pass); + AutoFillNotification* aWidget = new AutoFillNotification(request.url(), outgoingData, pass); webView->addNotification(aWidget); } diff --git a/src/autofill/autofillwidget.cpp b/src/autofill/autofillnotification.cpp similarity index 79% rename from src/autofill/autofillwidget.cpp rename to src/autofill/autofillnotification.cpp index e243b959a..7fc5654d3 100644 --- a/src/autofill/autofillwidget.cpp +++ b/src/autofill/autofillnotification.cpp @@ -1,9 +1,9 @@ -#include "autofillwidget.h" -#include "ui_autofillwidget.h" +#include "autofillnotification.h" +#include "ui_autofillnotification.h" #include "autofillmodel.h" #include "mainapplication.h" -AutoFillWidget::AutoFillWidget(QUrl url, QByteArray data, QString pass, QWidget *parent) +AutoFillNotification::AutoFillNotification(QUrl url, QByteArray data, QString pass, QWidget *parent) :QWidget(parent) ,ui(new Ui::AutoFillWidget) ,m_url(url) @@ -35,7 +35,7 @@ AutoFillWidget::AutoFillWidget(QUrl url, QByteArray data, QString pass, QWidget QTimer::singleShot(300, m_animation, SLOT(start())); } -void AutoFillWidget::hide() +void AutoFillNotification::hide() { m_animation->setDirection(QTimeLine::Backward); @@ -44,25 +44,25 @@ void AutoFillWidget::hide() connect(m_animation, SIGNAL(finished()), this, SLOT(close())); } -void AutoFillWidget::frameChanged(int frame) +void AutoFillNotification::frameChanged(int frame) { setMinimumHeight(frame); setMaximumHeight(frame); } -void AutoFillWidget::never() +void AutoFillNotification::never() { MainApplication::getInstance()->autoFill()->blockStoringfor(m_url); hide(); } -void AutoFillWidget::remember() +void AutoFillNotification::remember() { MainApplication::getInstance()->autoFill()->addEntry(m_url, m_data, m_pass); hide(); } -AutoFillWidget::~AutoFillWidget() +AutoFillNotification::~AutoFillNotification() { delete ui; } diff --git a/src/autofill/autofillwidget.h b/src/autofill/autofillnotification.h similarity index 72% rename from src/autofill/autofillwidget.h rename to src/autofill/autofillnotification.h index 267341441..4f9b5a039 100644 --- a/src/autofill/autofillwidget.h +++ b/src/autofill/autofillnotification.h @@ -10,13 +10,13 @@ namespace Ui { class AutoFillWidget; } -class AutoFillWidget : public QWidget +class AutoFillNotification : public QWidget { Q_OBJECT public: - explicit AutoFillWidget(QUrl url, QByteArray data, QString pass, QWidget *parent = 0); - ~AutoFillWidget(); + explicit AutoFillNotification(QUrl url, QByteArray data, QString pass, QWidget *parent = 0); + ~AutoFillNotification(); private slots: void frameChanged(int frame); diff --git a/src/autofill/autofillwidget.ui b/src/autofill/autofillnotification.ui similarity index 100% rename from src/autofill/autofillwidget.ui rename to src/autofill/autofillnotification.ui diff --git a/src/bookmarks/bookmarkswidget.ui b/src/bookmarks/bookmarkswidget.ui index 04f5c5523..ee0fd9a4b 100644 --- a/src/bookmarks/bookmarkswidget.ui +++ b/src/bookmarks/bookmarkswidget.ui @@ -14,17 +14,17 @@ + + 0 + QFrame::NoFrame - - 0 - - 0 + 9 @@ -32,7 +32,7 @@ - :/icons/other/bigstar.png + :/icons/other/bigstar.png @@ -136,7 +136,7 @@ - + diff --git a/src/data/icons.qrc b/src/data/icons.qrc index 4bf491b65..ea75d4dc2 100644 --- a/src/data/icons.qrc +++ b/src/data/icons.qrc @@ -64,5 +64,6 @@ icons/other/flash.png icons/other/flashstart.png icons/other/keys.png + icons/other/bigrss.png diff --git a/src/navigation/locationbar.cpp b/src/navigation/locationbar.cpp index c2c5a5eb8..84278cffa 100644 --- a/src/navigation/locationbar.cpp +++ b/src/navigation/locationbar.cpp @@ -8,6 +8,7 @@ #include "bookmarkswidget.h" #include "bookmarksmodel.h" #include "siteinfowidget.h" +#include "rsswidget.h" LocationBar::LocationBar(QupZilla* mainClass, QWidget *parent) : LineEdit(parent) @@ -27,17 +28,12 @@ LocationBar::LocationBar(QupZilla* mainClass, QWidget *parent) m_siteIcon->setStyleSheet("QToolButton{border-image: url(:/icons/locationbar/searchchoose.png); margin-left:2px;}"); m_siteIcon->setFocusPolicy(Qt::ClickFocus); - m_rssIcon = new QToolButton(this); - m_rssIcon->setIcon(QIcon(":/icons/menu/rss.png")); - m_rssIcon->setCursor(Qt::ArrowCursor); - m_rssIcon->setMaximumSize(30, 23); - m_rssIcon->setAutoRaise(true); - m_rssIcon->setVisible(false); - m_rssIcon->setPopupMode(QToolButton::InstantPopup); + m_rssIcon = new ClickableLabel(this); + m_rssIcon->setPixmap(QPixmap(":/icons/menu/rss.png")); + m_rssIcon->setCursor(Qt::PointingHandCursor); m_rssIcon->setToolTip(tr("Add RSS from this page...")); m_rssIcon->setStyleSheet("margin-bottom:2px"); m_rssIcon->setFocusPolicy(Qt::ClickFocus); - m_rssMenu = new QMenu(this); m_goButton = new ClickableLabel(this); m_goButton->setPixmap(QPixmap(":/icons/locationbar/gotoaddress.png")); @@ -78,10 +74,11 @@ LocationBar::LocationBar(QupZilla* mainClass, QWidget *parent) connect(down, SIGNAL(clicked(QPoint)), this, SLOT(showPopup())); connect(m_goButton, SIGNAL(clicked(QPoint)), p_QupZilla, SLOT(urlEnter())); connect(m_bookmarkButton, SIGNAL(clicked(QPoint)), this, SLOT(bookmarkIconClicked())); - - setLeftMargin(33); + connect(m_rssIcon, SIGNAL(clicked(QPoint)), this, SLOT(rssIconClicked())); setStyleSheet("QLineEdit { background: transparent; border-image: url(:/icons/locationbar/lineedit.png); border-width:4; color:black;}"); +// setLeftMargin(33); + setLeftMargin(m_siteIcon->sizeHint().width()+1); } void LocationBar::loadSettings() @@ -149,6 +146,14 @@ void LocationBar::bookmarkIconClicked() } } +void LocationBar::rssIconClicked() +{ + QList > _rss = p_QupZilla->weView()->getRss(); + + RSSWidget* rss = new RSSWidget(_rss, this); + rss->showAt(this); +} + void LocationBar::checkBookmark() { if (m_bookmarksModel->isBookmarked(QUrl(text()))) { @@ -160,41 +165,6 @@ void LocationBar::checkBookmark() } } -void LocationBar::checkRss() -{ - WebView* view = p_QupZilla->weView(); - if (!view) - return; - QWebFrame* frame = view->page()->mainFrame(); - QWebElementCollection links = frame->findAllElements("link"); - - bool found = false; - m_rssMenu->clear(); - for (int i = 0; isetData(href); - act->setToolTip(title); - m_rssMenu->addAction(act); - found = true; - } - - m_rssMenu->addSeparator(); - m_rssMenu->addAction(QIcon(":/icons/menu/rss.png"), tr("Read RSS news"), p_QupZilla, SLOT(showRSSManager())); - - m_rssIcon->setVisible(found); - m_rssIcon->setMenu(m_rssMenu); -} - QIcon LocationBar::icon(const QUrl &url) { QUrl url2 = url.scheme() + "://" + url.host(); diff --git a/src/navigation/locationbar.h b/src/navigation/locationbar.h index 328794f88..a4b54ecae 100644 --- a/src/navigation/locationbar.h +++ b/src/navigation/locationbar.h @@ -36,8 +36,9 @@ public: void loadSettings(); public slots: - void checkRss(); void showUrl(const QUrl &url, bool empty = true); + +private slots: void siteIconChanged(); void setPrivacy(bool state); void addRss(); @@ -46,6 +47,7 @@ public slots: void bookmarkIconClicked(); void checkBookmark(); void showSiteInfo(); + void rssIconClicked(); private: void focusOutEvent(QFocusEvent* e); @@ -58,8 +60,8 @@ private: ClickableLabel* m_bookmarkButton; ClickableLabel* m_goButton; + ClickableLabel* m_rssIcon; QToolButton* m_siteIcon; - QToolButton* m_rssIcon; QMenu* m_rssMenu; bool m_selectAllOnDoubleClick; diff --git a/src/rss/rsswidget.cpp b/src/rss/rsswidget.cpp new file mode 100644 index 000000000..a1ea77f85 --- /dev/null +++ b/src/rss/rsswidget.cpp @@ -0,0 +1,22 @@ +#include "rsswidget.h" +#include "ui_rsswidget.h" + +RSSWidget::RSSWidget(QList > availableRss, QWidget *parent) + :QMenu(parent) + ,ui(new Ui::RSSWidget) + ,m_avRss(availableRss) +{ + ui->setupUi(this); +} + +void RSSWidget::showAt(QWidget* _parent) +{ + QPoint p = _parent->mapToGlobal(QPoint(0, 0)); + move( (p.x()+_parent->width() ) - width(), p.y() + _parent->height()); + show(); +} + +RSSWidget::~RSSWidget() +{ + delete ui; +} diff --git a/src/rss/rsswidget.h b/src/rss/rsswidget.h new file mode 100644 index 000000000..e6fe965ba --- /dev/null +++ b/src/rss/rsswidget.h @@ -0,0 +1,26 @@ +#ifndef RSSWIDGET_H +#define RSSWIDGET_H + +#include +#include + +namespace Ui { + class RSSWidget; +} + +class RSSWidget : public QMenu +{ + Q_OBJECT + +public: + explicit RSSWidget(QList > availableRss, QWidget *parent = 0); + ~RSSWidget(); + + void showAt(QWidget* _parent); + +private: + Ui::RSSWidget *ui; + QList > m_avRss; +}; + +#endif // RSSWIDGET_H diff --git a/src/rss/rsswidget.ui b/src/rss/rsswidget.ui new file mode 100644 index 000000000..2abb9c1ea --- /dev/null +++ b/src/rss/rsswidget.ui @@ -0,0 +1,72 @@ + + + RSSWidget + + + + 0 + 0 + 245 + 66 + + + + Form + + + + 0 + + + + + QFrame::NoFrame + + + + 6 + + + 9 + + + + + + 0 + 0 + + + + + + + :/icons/other/bigrss.png + + + + + + + Add RSS Feeds from this site + + + + + + + + + + + Frame + QFrame +
frame.h
+ 1 +
+
+ + + + +
diff --git a/src/webview/webview.cpp b/src/webview/webview.cpp index fe946e9b5..ab4972eae 100644 --- a/src/webview/webview.cpp +++ b/src/webview/webview.cpp @@ -91,6 +91,7 @@ void WebView::setProgress(int prog) if (isCurrent()) { emit showUrl(url()); } + checkRss(); } void WebView::loadStarted() @@ -172,7 +173,6 @@ void WebView::loadFinished(bool state) p_QupZilla->getMainApp()->history()->addHistoryEntry(this); if (isCurrent()) { emit showUrl(url()); - emit checkRss(); } iconChanged(); @@ -285,6 +285,25 @@ QUrl WebView::guessUrlFromString(const QString &string) return QUrl(); } +void WebView::checkRss() +{ + QWebFrame* frame = page()->mainFrame(); + QWebElementCollection links = frame->findAllElements("link"); + m_rss.clear(); + + for (int i = 0; i(title, href)); + } +} + void WebView::mousePressEvent(QMouseEvent *event) { switch (event->button()) { diff --git a/src/webview/webview.h b/src/webview/webview.h index 0b59fec89..397b36183 100644 --- a/src/webview/webview.h +++ b/src/webview/webview.h @@ -41,6 +41,8 @@ public: QString getIp() { return m_currentIp; } QLabel* animationLoading(int index, bool addMovie); void addNotification(QWidget* notif); + bool hasRss() { return !m_rss.isEmpty(); } + QList > getRss() { return m_rss; } static QUrl guessUrlFromString(const QString &string); static bool isUrlValid(const QUrl &url); @@ -82,6 +84,7 @@ private slots: void showInspector(); void stopAnimation(); void setIp(QHostInfo info); + void checkRss(); private: void keyPressEvent(QKeyEvent *event); @@ -103,6 +106,7 @@ private: QUrl m_aboutToLoadUrl; bool m_wantsClose; QString m_currentIp; + QList > m_rss; WebPage* m_page; NetworkManagerProxy* m_networkProxy; @@ -112,7 +116,6 @@ signals: void showUrl(QUrl url); void siteIconChanged(); void setPrivacy(bool state); - void checkRss(); void wantsCloseTab(int index); void changed(); void ipChanged(QString ip); diff --git a/translations/cs_CZ.ts b/translations/cs_CZ.ts index 65e1b2df6..aa9350c98 100644 --- a/translations/cs_CZ.ts +++ b/translations/cs_CZ.ts @@ -136,28 +136,31 @@ p, li { white-space: pre-wrap; } Změnit heslo: + + AutoFillNotification + + + Do you want QupZilla to remember password on %1? + Chcete aby si QupZilla zapamatovala heslo pro %1? + + AutoFillWidget - + Remember Zapamatovat - + Never For This Site Nikdy pro tuto stránku - + Not Now Nyní ne - - - Do you want QupZilla to remember password on %1? - Chcete aby si QupZilla zapamatovala heslo pro %1? - BookmarksManager @@ -849,54 +852,44 @@ neexistuje! LocationBar - + Show informations about this page Zobrazit informace o stránce - + Add RSS from this page... Přidat RSS kanál ... - - + + Bookmark this Page Přidat stránku do záložek - + Enter URL address or search on Google.com Zadejte internetovou adresu nebo vyhledávejte na Google.com - - Add RSS channel with title ' - Přidat kanál s titulkem ' - - - - Read RSS news - Číst RSS novinky - - - + Loading... Načítám... - + Done Hotovo - + Edit this bookmark Upravit záložku - + .co.uk .cz Append domain name on ALT key = Should be different for every country @@ -2068,6 +2061,19 @@ Prosím přidejte si nějaký kliknutím na RSS ikonku v navigačním řádku.Tento kanál již odebíráte. + + RSSWidget + + + Form + Form + + + + Add RSS Feeds from this site + Přidat RSS kanál z této stránky + + SearchToolBar @@ -2444,14 +2450,14 @@ Prosím přidejte si nějaký kliknutím na RSS ikonku v navigačním řádku. WebView - + Loading... Načítám... - + No Named Page Bezejmenná stránka @@ -2461,130 +2467,130 @@ Prosím přidejte si nějaký kliknutím na RSS ikonku v navigačním řádku.Hotovo - - - + + + New tab Nový panel - + Open link in new window Otevřít odkaz v novém okně - + Open link in new tab Otevřít odkaz v novém panelu - + Bookmark link Přidat odkaz do záložek - + Save link as... Uložit odkaz jako... - + Send link... Odeslat odkaz... - + Copy link address Kopírovat adresu odkazu - + Show image Zobrazit obrázek - + Copy image Kopírovat obrázek - + Copy image address Coyp image address Kopírovat adresu obrázku - + Save image as... Uložit obrázek jako... - + Send image... Odeslat obrázek... - + Back Zpět - + Forward Vpřed - + Reload Obnovit - + Stop Zastavit - + Bookmark page Přidat stránku do záložek - + Save page as... Uložit stránku jako... - + Send page... Odeslat stránku... - + Select all Vybrat vše - + Show source code Zobrazit zdrojový kód - + Show info about site Zobrazit informace o stránce - + Show Web Inspector Zobrazit Web Inspektor - + Search Hledat - + ... on Google ... na Googlu diff --git a/translations/sk_SK.ts b/translations/sk_SK.ts index ea7721b34..f6397d6d2 100644 --- a/translations/sk_SK.ts +++ b/translations/sk_SK.ts @@ -140,28 +140,31 @@ p, li { white-space: pre-wrap; } Zmeniť heslo: + + AutoFillNotification + + + Do you want QupZilla to remember password on %1? + + + AutoFillWidget - + Remember - + Never For This Site - + Not Now - - - Do you want QupZilla to remember password on %1? - - BookmarksManager @@ -850,54 +853,44 @@ p, li { white-space: pre-wrap; } LocationBar - + Show informations about this page Zobraziť informácie o tejto stránke - + Add RSS from this page... Pridať RSS kanál... - - + + Bookmark this Page Pridať stránku do záložiek - + Enter URL address or search on Google.com Zadajte URL adresu alebo vyhľadajte na Google.com - - Add RSS channel with title ' - Pridať RSS kanál s názvom - - - - Read RSS news - Čítať RSS novinky - - - + Loading... Nahrávam... - + Done Hotovo - + Edit this bookmark Upraviť záložku - + .co.uk Append domain name on ALT key = Should be different for every country .sk @@ -2067,6 +2060,19 @@ Prosím pridajte si nejaký kliknutím na RSS ikonku v navigačnom riadku.Tento kanál už odoberáte. + + RSSWidget + + + Form + Form + + + + Add RSS Feeds from this site + + + SearchToolBar @@ -2442,14 +2448,14 @@ Prosím pridajte si nejaký kliknutím na RSS ikonku v navigačnom riadku. WebView - + Loading... Načítavam... - + No Named Page Stránka bez mena @@ -2459,129 +2465,129 @@ Prosím pridajte si nejaký kliknutím na RSS ikonku v navigačnom riadku.Hotovo - - - + + + New tab Nový panel - + Open link in new window Otvoriť odkaz v novom okne - + Open link in new tab Otvoriť odkaz na novom panely - + Bookmark link Pridať odkaz do záložiek - + Save link as... Odoslať odkaz... - + Send link... Odoslať odkaz... - + Copy link address Kopírovať adresu odkazu - + Show image Zobraziť obrázok - + Copy image Kopírovať obrázok - + Copy image address Kopírovať adresu obrázku - + Save image as... Uložiť obrázok ako... - + Send image... Odoslať obrázok... - + Back Späť - + Forward Dopredu - + Reload Obnoviť - + Stop Zastaviť - + Bookmark page Pridať stránku do záložiek - + Save page as... Uložiť stránku ako... - + Send page... Odoslať stránku... - + Select all Vybrať všetko - + Show source code Zobraziť zdrojový kód - + Show info about site Zobraziť informácie o stránke - + Show Web Inspector Zobraziť Web inšpektora - + Search Hľadať - + ... on Google ... na Googlu