diff --git a/src/lib/3rdparty/lineedit.cpp b/src/lib/3rdparty/lineedit.cpp index 62e7a20d2..46d7e4401 100644 --- a/src/lib/3rdparty/lineedit.cpp +++ b/src/lib/3rdparty/lineedit.cpp @@ -1,3 +1,20 @@ +/* ============================================================ +* QupZilla - WebKit based browser +* Copyright (C) 2010-2013 David Rosca +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +* ============================================================ */ #include "lineedit.h" #include @@ -47,11 +64,11 @@ void LineEdit::setLeftMargin(int margin) void LineEdit::init() { - ////we use setTextMargins() instead of padding property, and we should - //// uncomment following line or just update padding property of LineEdit's - //// subclasses in all themes and use same value for padding-left and padding-right, - //// with this new implementation padding-left and padding-right show padding from - //// edges of m_leftWidget and m_rightWidget. + // We use setTextMargins() instead of padding property, and we should + // uncomment following line or just update padding property of LineEdit's + // subclasses in all themes and use same value for padding-left and padding-right, + // with this new implementation padding-left and padding-right show padding from + // edges of m_leftWidget and m_rightWidget. mainLayout = new QHBoxLayout(this); mainLayout->setContentsMargins(0, 0, 0, 0); @@ -180,7 +197,31 @@ void LineEdit::updateTextMargins() int top = 0; int bottom = 0; setTextMargins(left, top, right, bottom); -// updateSideWidgetLocations(); + // updateSideWidgetLocations(); +} + +void LineEdit::mouseReleaseEvent(QMouseEvent* event) +{ + // Workaround issue in QLineEdit::setDragEnabled(true) + // It will incorrectly set cursor position at the end + // of selection when clicking (and not dragging) into selected text + + if (!dragEnabled()) { + QLineEdit::mouseReleaseEvent(event); + return; + } + + bool wasSelectedText = !selectedText().isEmpty(); + + QLineEdit::mouseReleaseEvent(event); + + bool isSelectedText = !selectedText().isEmpty(); + + if (wasSelectedText && !isSelectedText) { + QMouseEvent ev(QEvent::MouseButtonPress, event->pos(), event->button(), + event->buttons(), event->modifiers()); + mousePressEvent(&ev); + } } //void LineEdit::updateSideWidgetLocations() diff --git a/src/lib/3rdparty/lineedit.h b/src/lib/3rdparty/lineedit.h index 910f74c74..079512d3f 100644 --- a/src/lib/3rdparty/lineedit.h +++ b/src/lib/3rdparty/lineedit.h @@ -28,6 +28,23 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ +/* ============================================================ +* QupZilla - WebKit based browser +* Copyright (C) 2010-2013 David Rosca +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +* ============================================================ */ #include #include "qz_namespace.h" @@ -72,6 +89,7 @@ public slots: void updateTextMargins(); protected: + void mouseReleaseEvent(QMouseEvent* event); // void resizeEvent(QResizeEvent* event); bool event(QEvent* event); diff --git a/src/lib/autofill/autofillicon.cpp b/src/lib/autofill/autofillicon.cpp index 361579f2b..90f7e4390 100644 --- a/src/lib/autofill/autofillicon.cpp +++ b/src/lib/autofill/autofillicon.cpp @@ -18,13 +18,23 @@ #include "autofillicon.h" #include "autofillwidget.h" +#include + AutoFillIcon::AutoFillIcon(QWidget* parent) : ClickableLabel(parent) + , m_view(0) { setObjectName("locationbar-autofillicon"); setCursor(Qt::PointingHandCursor); setToolTip(AutoFillWidget::tr("Choose username to login")); setFocusPolicy(Qt::ClickFocus); + + connect(this, SIGNAL(clicked(QPoint)), this, SLOT(iconClicked())); +} + +void AutoFillIcon::setWebView(WebView* view) +{ + m_view = view; } void AutoFillIcon::setFormData(const QList &data) @@ -32,7 +42,27 @@ void AutoFillIcon::setFormData(const QList &data) m_data = data; } -QList AutoFillIcon::formData() const +void AutoFillIcon::iconClicked() { - return m_data; + if (!m_view) { + return; + } + + AutoFillWidget* widget = new AutoFillWidget(m_view, this); + widget->setFormData(m_data); + widget->showAt(parentWidget()); +} + +void AutoFillIcon::contextMenuEvent(QContextMenuEvent* ev) +{ + // Prevent propagating to LocationBar + ev->accept(); +} + +void AutoFillIcon::mousePressEvent(QMouseEvent* ev) +{ + ClickableLabel::mousePressEvent(ev); + + // Prevent propagating to LocationBar + ev->accept(); } diff --git a/src/lib/autofill/autofillicon.h b/src/lib/autofill/autofillicon.h index a6ef8452c..c2126e34b 100644 --- a/src/lib/autofill/autofillicon.h +++ b/src/lib/autofill/autofillicon.h @@ -22,17 +22,27 @@ #include "clickablelabel.h" #include "autofill.h" -struct AutoFillData; +class WebView; class QT_QUPZILLA_EXPORT AutoFillIcon : public ClickableLabel { + Q_OBJECT + public: explicit AutoFillIcon(QWidget* parent = 0); + void setWebView(WebView* view); void setFormData(const QList &data); - QList formData() const; + +private slots: + void iconClicked(); private: + void contextMenuEvent(QContextMenuEvent* ev); + void mousePressEvent(QMouseEvent* ev); + + WebView* m_view; + QList m_data; }; diff --git a/src/lib/bookmarks/bookmarkicon.cpp b/src/lib/bookmarks/bookmarkicon.cpp index 11db50edc..5e4b0a58b 100644 --- a/src/lib/bookmarks/bookmarkicon.cpp +++ b/src/lib/bookmarks/bookmarkicon.cpp @@ -16,10 +16,11 @@ * along with this program. If not, see . * ============================================================ */ #include "bookmarkicon.h" +#include "bookmarksmodel.h" +#include "bookmarkswidget.h" #include "mainapplication.h" #include "tabbedwebview.h" #include "locationbar.h" -#include "bookmarksmodel.h" #include "pluginproxy.h" #include "speeddial.h" @@ -30,6 +31,7 @@ BookmarkIcon::BookmarkIcon(QWidget* parent) : ClickableLabel(parent) , m_bookmarksModel(0) , m_speedDial(mApp->plugins()->speedDial()) + , m_view(0) { setObjectName("locationbar-bookmarkicon"); setCursor(Qt::PointingHandCursor); @@ -40,6 +42,12 @@ BookmarkIcon::BookmarkIcon(QWidget* parent) connect(m_bookmarksModel, SIGNAL(bookmarkAdded(BookmarksModel::Bookmark)), this, SLOT(bookmarkAdded(BookmarksModel::Bookmark))); connect(m_bookmarksModel, SIGNAL(bookmarkDeleted(BookmarksModel::Bookmark)), this, SLOT(bookmarkDeleted(BookmarksModel::Bookmark))); connect(m_speedDial, SIGNAL(pagesChanged()), this, SLOT(speedDialChanged())); + connect(this, SIGNAL(clicked(QPoint)), this, SLOT(iconClicked())); +} + +void BookmarkIcon::setWebView(WebView* view) +{ + m_view = view; } void BookmarkIcon::checkBookmark(const QUrl &url, bool forceCheck) @@ -77,6 +85,16 @@ void BookmarkIcon::speedDialChanged() checkBookmark(m_lastUrl, true); } +void BookmarkIcon::iconClicked() +{ + if (!m_view) { + return; + } + + BookmarksWidget* widget = new BookmarksWidget(m_view, parentWidget()); + widget->showAt(parentWidget()); +} + void BookmarkIcon::setBookmarkSaved() { setProperty("bookmarked", QVariant(true)); diff --git a/src/lib/bookmarks/bookmarkicon.h b/src/lib/bookmarks/bookmarkicon.h index bd5ad6aa5..b929171b7 100644 --- a/src/lib/bookmarks/bookmarkicon.h +++ b/src/lib/bookmarks/bookmarkicon.h @@ -25,12 +25,15 @@ #include "qz_namespace.h" class SpeedDial; +class WebView; class QT_QUPZILLA_EXPORT BookmarkIcon : public ClickableLabel { Q_OBJECT public: explicit BookmarkIcon(QWidget* parent = 0); + + void setWebView(WebView* view); void checkBookmark(const QUrl &url, bool forceCheck = false); private slots: @@ -38,6 +41,8 @@ private slots: void bookmarkDeleted(const BookmarksModel::Bookmark &bookmark); void speedDialChanged(); + void iconClicked(); + private: void contextMenuEvent(QContextMenuEvent* ev); void mousePressEvent(QMouseEvent* ev); @@ -47,6 +52,7 @@ private: BookmarksModel* m_bookmarksModel; SpeedDial* m_speedDial; + WebView* m_view; QUrl m_lastUrl; diff --git a/src/lib/navigation/locationbar.cpp b/src/lib/navigation/locationbar.cpp index b19095a96..ca3053799 100644 --- a/src/lib/navigation/locationbar.cpp +++ b/src/lib/navigation/locationbar.cpp @@ -21,12 +21,9 @@ #include "rssmanager.h" #include "mainapplication.h" #include "clickablelabel.h" -#include "siteinfowidget.h" -#include "rsswidget.h" #include "webpage.h" #include "tabwidget.h" #include "bookmarkicon.h" -#include "bookmarkswidget.h" #include "progressbar.h" #include "statusbarmessage.h" #include "toolbutton.h" @@ -40,13 +37,13 @@ #include "qzsettings.h" #include "colors.h" #include "autofillicon.h" -#include "autofillwidget.h" #include #include #include #include -#include +#include +#include LocationBar::LocationBar(QupZilla* mainClass) : LineEdit(mainClass) @@ -65,8 +62,7 @@ LocationBar::LocationBar(QupZilla* mainClass) m_bookmarkIcon = new BookmarkIcon(this); m_goIcon = new GoIcon(this); m_rssIcon = new RssIcon(this); - m_rssIcon->setToolTip(tr("Add RSS from this page...")); - m_siteIcon = new SiteIcon(this); + m_siteIcon = new SiteIcon(p_QupZilla, this); m_autofillIcon = new AutoFillIcon(this); DownIcon* down = new DownIcon(this); @@ -88,11 +84,7 @@ LocationBar::LocationBar(QupZilla* mainClass) connect(&m_completer, SIGNAL(completionActivated()), this, SLOT(urlEnter())); connect(this, SIGNAL(textEdited(QString)), this, SLOT(textEdit())); - connect(m_siteIcon, SIGNAL(clicked()), this, SLOT(showSiteInfo())); connect(m_goIcon, SIGNAL(clicked(QPoint)), this, SLOT(urlEnter())); - connect(m_rssIcon, SIGNAL(clicked(QPoint)), this, SLOT(rssIconClicked())); - connect(m_bookmarkIcon, SIGNAL(clicked(QPoint)), this, SLOT(bookmarkIconClicked())); - connect(m_autofillIcon, SIGNAL(clicked(QPoint)), this, SLOT(autofillIconClicked())); connect(down, SIGNAL(clicked(QPoint)), this, SLOT(showMostVisited())); connect(mApp->searchEnginesManager(), SIGNAL(activeEngineChanged()), this, SLOT(updatePlaceHolderText())); connect(mApp->searchEnginesManager(), SIGNAL(defaultEngineChanged()), this, SLOT(updatePlaceHolderText())); @@ -113,6 +105,11 @@ void LocationBar::setWebView(TabbedWebView* view) { m_webView = view; + m_bookmarkIcon->setWebView(m_webView); + m_rssIcon->setWebView(m_webView); + m_siteIcon->setWebView(m_webView); + m_autofillIcon->setWebView(m_webView); + connect(m_webView, SIGNAL(loadStarted()), SLOT(onLoadStarted())); connect(m_webView, SIGNAL(loadProgress(int)), SLOT(onLoadProgress(int))); connect(m_webView, SIGNAL(loadFinished(bool)), SLOT(onLoadFinished())); @@ -234,37 +231,6 @@ void LocationBar::showMostVisited() m_completer.complete(QString()); } -void LocationBar::showSiteInfo() -{ - QUrl url = p_QupZilla->weView()->url(); - - if (url.isEmpty() || url.scheme() == QLatin1String("qupzilla")) { - return; - } - - SiteInfoWidget* info = new SiteInfoWidget(p_QupZilla); - info->showAt(this); -} - -void LocationBar::rssIconClicked() -{ - RSSWidget* rss = new RSSWidget(m_webView, this); - rss->showAt(this); -} - -void LocationBar::bookmarkIconClicked() -{ - BookmarksWidget* bWidget = new BookmarksWidget(m_webView, this); - bWidget->showAt(this); -} - -void LocationBar::autofillIconClicked() -{ - AutoFillWidget* widget = new AutoFillWidget(m_webView, this); - widget->setFormData(m_autofillIcon->formData()); - widget->showAt(this); -} - void LocationBar::showRSSIcon(bool state) { m_rssIcon->setVisible(state); @@ -469,24 +435,6 @@ void LocationBar::mousePressEvent(QMouseEvent* event) LineEdit::mousePressEvent(event); } -void LocationBar::mouseReleaseEvent(QMouseEvent* event) -{ - // Workaround issue in QLineEdit::setDragEnabled - // It will incorrectly set cursor position at the end - // of selection when clicking into selected text - bool wasSelectedText = !selectedText().isEmpty(); - - LineEdit::mouseReleaseEvent(event); - - bool isSelectedText = !selectedText().isEmpty(); - - if (wasSelectedText && !isSelectedText) { - QMouseEvent ev(QEvent::MouseButtonPress, event->pos(), event->button(), - event->buttons(), event->modifiers()); - mousePressEvent(&ev); - } -} - void LocationBar::keyPressEvent(QKeyEvent* event) { switch (event->key()) { diff --git a/src/lib/navigation/locationbar.h b/src/lib/navigation/locationbar.h index 2ff3fca28..7553e0443 100644 --- a/src/lib/navigation/locationbar.h +++ b/src/lib/navigation/locationbar.h @@ -57,21 +57,18 @@ public slots: void setText(const QString &text); protected: - virtual void paintEvent(QPaintEvent* event); + void paintEvent(QPaintEvent* event); private slots: + void showMostVisited(); + void textEdit(); + void urlEnter(); + void pasteAndGo(); + + void clearIcon(); void siteIconChanged(); void setPrivacy(bool state); - void textEdit(); - void showMostVisited(); - void showSiteInfo(); - void rssIconClicked(); - void bookmarkIconClicked(); - void autofillIconClicked(); - void urlEnter(); - void clearIcon(); void showRSSIcon(bool state); - void pasteAndGo(); void updatePlaceHolderText(); void showCompletion(const QString &newText); @@ -95,7 +92,6 @@ private: void focusOutEvent(QFocusEvent* event); void mouseDoubleClickEvent(QMouseEvent* event); void mousePressEvent(QMouseEvent* event); - void mouseReleaseEvent(QMouseEvent* event); void keyPressEvent(QKeyEvent* event); void keyReleaseEvent(QKeyEvent* event); void dropEvent(QDropEvent* event); diff --git a/src/lib/navigation/locationbarpopup.cpp b/src/lib/navigation/locationbarpopup.cpp index 1c8edb16c..2141a5038 100644 --- a/src/lib/navigation/locationbarpopup.cpp +++ b/src/lib/navigation/locationbarpopup.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 Franz Fellner +* Copyright (C) 2010-2013 Franz Fellner * David Rosca * * This program is free software: you can redistribute it and/or modify @@ -16,10 +16,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ -#include - #include "locationbarpopup.h" +#include + LocationBarPopup::LocationBarPopup(QWidget* parent) : QFrame(parent, Qt::Popup) , m_alignment(Qt::AlignRight) @@ -32,6 +32,11 @@ LocationBarPopup::LocationBarPopup(QWidget* parent) void LocationBarPopup::showAt(QWidget* parent) { + if (!parent) { + return; + } + + // Calculate sizes before showing layout()->invalidate(); layout()->activate(); @@ -46,3 +51,13 @@ void LocationBarPopup::showAt(QWidget* parent) QFrame::show(); } + +void LocationBarPopup::setPopupAlignment(Qt::Alignment alignment) +{ + m_alignment = alignment; +} + +Qt::Alignment LocationBarPopup::popupAlignment() const +{ + return m_alignment; +} diff --git a/src/lib/navigation/locationbarpopup.h b/src/lib/navigation/locationbarpopup.h index ada3f0cab..0881a905e 100644 --- a/src/lib/navigation/locationbarpopup.h +++ b/src/lib/navigation/locationbarpopup.h @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 Franz Fellner +* Copyright (C) 2010-2013 Franz Fellner * David Rosca * * This program is free software: you can redistribute it and/or modify @@ -21,18 +21,17 @@ #include -class LocationBarPopup : public QFrame +#include "qz_namespace.h" + +class QT_QUPZILLA_EXPORT LocationBarPopup : public QFrame { public: - LocationBarPopup(QWidget* parent); - void showAt(QWidget* parent); - void setPopupAlignment(Qt::Alignment alignment) { - m_alignment = alignment; - } + explicit LocationBarPopup(QWidget* parent); - Qt::Alignment popupAlignment() const { - return m_alignment; - } + void showAt(QWidget* parent); + + void setPopupAlignment(Qt::Alignment alignment); + Qt::Alignment popupAlignment() const; private: Qt::Alignment m_alignment; diff --git a/src/lib/navigation/siteicon.cpp b/src/lib/navigation/siteicon.cpp index c11c45308..246b24dff 100644 --- a/src/lib/navigation/siteicon.cpp +++ b/src/lib/navigation/siteicon.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,6 +16,7 @@ * along with this program. If not, see . * ============================================================ */ #include "siteicon.h" +#include "siteinfowidget.h" #include "locationbar.h" #include "tabbedwebview.h" #include "qztools.h" @@ -25,15 +26,40 @@ #include #include -SiteIcon::SiteIcon(LocationBar* parent) +SiteIcon::SiteIcon(QupZilla* window, LocationBar* parent) : ToolButton(parent) + , p_QupZilla(window) , m_locationBar(parent) + , m_view(0) { setObjectName("locationbar-siteicon"); setToolButtonStyle(Qt::ToolButtonIconOnly); setCursor(Qt::ArrowCursor); setToolTip(LocationBar::tr("Show information about this page")); setFocusPolicy(Qt::ClickFocus); + + connect(this, SIGNAL(clicked()), this, SLOT(iconClicked())); +} + +void SiteIcon::setWebView(WebView* view) +{ + m_view = view; +} + +void SiteIcon::iconClicked() +{ + if (!m_view || !p_QupZilla) { + return; + } + + QUrl url = m_view->url(); + + if (url.isEmpty() || url.scheme() == QLatin1String("qupzilla")) { + return; + } + + SiteInfoWidget* info = new SiteInfoWidget(p_QupZilla); + info->showAt(parentWidget()); } void SiteIcon::contextMenuEvent(QContextMenuEvent* e) diff --git a/src/lib/navigation/siteicon.h b/src/lib/navigation/siteicon.h index 3177f1571..dbdef13d6 100644 --- a/src/lib/navigation/siteicon.h +++ b/src/lib/navigation/siteicon.h @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,18 +22,29 @@ #include "toolbutton.h" class LocationBar; +class WebView; +class QupZilla; class QT_QUPZILLA_EXPORT SiteIcon : public ToolButton { + Q_OBJECT + public: - explicit SiteIcon(LocationBar* parent); + explicit SiteIcon(QupZilla* window, LocationBar* parent); + + void setWebView(WebView* view); + +private slots: + void iconClicked(); private: void contextMenuEvent(QContextMenuEvent* e); void mousePressEvent(QMouseEvent* e); void mouseMoveEvent(QMouseEvent* e); + QupZilla* p_QupZilla; LocationBar* m_locationBar; + WebView* m_view; QPoint m_dragStartPosition; }; diff --git a/src/lib/navigation/websearchbar.cpp b/src/lib/navigation/websearchbar.cpp index 5ede196cc..54a97bf82 100644 --- a/src/lib/navigation/websearchbar.cpp +++ b/src/lib/navigation/websearchbar.cpp @@ -387,21 +387,3 @@ void WebSearchBar::keyPressEvent(QKeyEvent* event) LineEdit::keyPressEvent(event); } - -void WebSearchBar::mouseReleaseEvent(QMouseEvent* event) -{ - // Workaround issue in QLineEdit::setDragEnabled - // It will incorrectly set cursor position at the end - // of selection when clicking into selected text - bool wasSelectedText = !selectedText().isEmpty(); - - LineEdit::mouseReleaseEvent(event); - - bool isSelectedText = !selectedText().isEmpty(); - - if (wasSelectedText && !isSelectedText) { - QMouseEvent ev(QEvent::MouseButtonPress, event->pos(), event->button(), - event->buttons(), event->modifiers()); - mousePressEvent(&ev); - } -} diff --git a/src/lib/navigation/websearchbar.h b/src/lib/navigation/websearchbar.h index bfa96c8b4..14ca26c40 100644 --- a/src/lib/navigation/websearchbar.h +++ b/src/lib/navigation/websearchbar.h @@ -76,7 +76,6 @@ private: void focusOutEvent(QFocusEvent* e); void dropEvent(QDropEvent* event); void keyPressEvent(QKeyEvent* event); - void mouseReleaseEvent(QMouseEvent* event); void completeMenuWithAvailableEngines(QMenu* menu); void contextMenuEvent(QContextMenuEvent* event); diff --git a/src/lib/rss/rssicon.cpp b/src/lib/rss/rssicon.cpp index 601a675e4..08a83b50b 100644 --- a/src/lib/rss/rssicon.cpp +++ b/src/lib/rss/rssicon.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,16 +16,35 @@ * along with this program. If not, see . * ============================================================ */ #include "rssicon.h" +#include "rsswidget.h" #include RssIcon::RssIcon(QWidget* parent) : ClickableLabel(parent) + , m_view(0) { setObjectName("locationbar-rss-icon"); setCursor(Qt::PointingHandCursor); setFocusPolicy(Qt::ClickFocus); - setVisible(false); + setToolTip(tr("Add RSS from this page...")); + + connect(this, SIGNAL(clicked(QPoint)), this, SLOT(iconClicked())); +} + +void RssIcon::setWebView(WebView* view) +{ + m_view = view; +} + +void RssIcon::iconClicked() +{ + if (!m_view) { + return; + } + + RSSWidget* rss = new RSSWidget(m_view, parentWidget()); + rss->showAt(parentWidget()); } void RssIcon::contextMenuEvent(QContextMenuEvent* ev) diff --git a/src/lib/rss/rssicon.h b/src/lib/rss/rssicon.h index a84c2f965..6c3e3914a 100644 --- a/src/lib/rss/rssicon.h +++ b/src/lib/rss/rssicon.h @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,15 +21,24 @@ #include "qz_namespace.h" #include "clickablelabel.h" +class WebView; + class QT_QUPZILLA_EXPORT RssIcon : public ClickableLabel { Q_OBJECT public: explicit RssIcon(QWidget* parent = 0); + void setWebView(WebView* view); + +private slots: + void iconClicked(); + private: void contextMenuEvent(QContextMenuEvent* ev); void mousePressEvent(QMouseEvent* ev); + + WebView* m_view; }; #endif // RSSICON_H diff --git a/translations/empty.ts b/translations/empty.ts index cd2f0518f..172e42d55 100644 --- a/translations/empty.ts +++ b/translations/empty.ts @@ -1725,10 +1725,6 @@ LocationBar - - Add RSS from this page... - - Enter URL address or search on %1 @@ -3743,6 +3739,13 @@ Maybe relaunch with administrator right do a magic for you! ;) + + RssIcon + + Add RSS from this page... + + + SSLManager