summaryrefslogtreecommitdiff
path: root/src/urlbar
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-02-13 22:13:05 +0100
committerAndrea Diamantini <adjam7@gmail.com>2012-03-13 10:24:41 +0100
commitac7c15f3ed41a51b830a79ab5c78e0580e42e798 (patch)
treefb25ede8736fda823765edd99f14a427dbff97a7 /src/urlbar
parentUpdate adblock dialog (diff)
downloadrekonq-ac7c15f3ed41a51b830a79ab5c78e0580e42e798.tar.xz
Add adblock icon to inform users that some contents was hidden
This is a patch by Andrea Di Menna, changed a bit to allow element blocked/hided listing (you'll see it in next commit) REVIEW:102761 REVIEWED-BY: adjam
Diffstat (limited to 'src/urlbar')
-rw-r--r--src/urlbar/urlbar.cpp10
-rw-r--r--src/urlbar/urlbar.h3
2 files changed, 12 insertions, 1 deletions
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp
index 43109db3..9ef51f47 100644
--- a/src/urlbar/urlbar.cpp
+++ b/src/urlbar/urlbar.cpp
@@ -402,6 +402,12 @@ void UrlBar::loadFinished()
connect(bt, SIGNAL(clicked(QPoint)), _tab, SLOT(showSearchEngine(QPoint)));
}
+ if (_tab->hasAdBlockedElements())
+ {
+ IconButton *bt = addRightIcon(UrlBar::AdBlock);
+ connect(bt, SIGNAL(clicked(QPoint)), (QObject *) rApp->adblockManager(), SLOT(showBlockedItems()));
+ }
+
// we need to update urlbar after the right icon settings
// removing this code (where setStyleSheet automatically calls update) needs adding again
// an update call
@@ -599,6 +605,10 @@ IconButton *UrlBar::addRightIcon(UrlBar::icon ic)
rightIcon->setIcon(KIcon("emblem-favorite"));
rightIcon->setToolTip(i18n("Remove from favorite"));
break;
+ case UrlBar::AdBlock:
+ rightIcon->setIcon(KIcon("preferences-web-browser-adblock"));
+ rightIcon->setToolTip(i18n("There are elements blocked by AdBlock"));
+ break;
default:
ASSERT_NOT_REACHED("ERROR.. default non extant case!!");
break;
diff --git a/src/urlbar/urlbar.h b/src/urlbar/urlbar.h
index fb7bcb2b..7cd79853 100644
--- a/src/urlbar/urlbar.h
+++ b/src/urlbar/urlbar.h
@@ -83,7 +83,8 @@ public:
SSL = 0x00000100,
BK = 0x00001000,
SearchEngine = 0x00010000,
- Favorite = 0x00100000
+ Favorite = 0x00100000,
+ AdBlock = 0x01000000
};
explicit UrlBar(QWidget *parent = 0);