| 1 | // For license of this file, see <project-root-folder>/LICENSE.md.cxx . . $ `<file>/src/librssguard/network-web/adblock/adblockicon.cpp`/ |
| 2 | |
| 3 | #include "network-web/adblock/adblockicon.h"cxx . . $ `<file>/src/librssguard/network-web/adblock/adblockicon.h`/ |
| 4 | |
| 5 | #include "miscellaneous/application.h"cxx . . $ `<file>/src/librssguard/miscellaneous/application.h`/ |
| 6 | #include "miscellaneous/iconfactory.h"cxx . . $ `<file>/src/librssguard/miscellaneous/iconfactory.h`/ |
| 7 | #include "network-web/adblock/adblockmanager.h"cxx . . $ `<file>/src/librssguard/network-web/adblock/adblockmanager.h`/ |
| 8 | |
| 9 | #include <QMenu> |
| 10 | |
| 11 | AdBlockIconcxx . . $ AdBlockIcon#::AdBlockIconcxx . . $ AdBlockIcon#AdBlockIcon(2daae1e9b68044d).(AdBlockManagercxx . . $ AdBlockManager#* parent) : QActioncxx . . $ QAction#(parent), m_managercxx . . $ AdBlockIcon#m_manager.(parent) { |
| 12 | setToolTipcxx . . $ QAction#setToolTip(3520e46b33348bf6).(trcxx . . $ AdBlockIcon#tr(75d9f1c324b4579d).("AdBlock lets you block unwanted content on web pages")); |
| 13 | setTextcxx . . $ QAction#setText(3520e46b33348bf6).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("AdBlock")); |
| 14 | setMenucxx . . $ QAction#setMenu(9b289cee16747614).(new QMenucxx . . $ QMenu#QMenu(108f35f7aa7f3cf9).()); |
| 15 | |
| 16 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(m_managercxx . . $ AdBlockIcon#m_manager., &AdBlockManagercxx . . $ AdBlockManager#::enabledChangedcxx . . $ AdBlockManager#enabledChanged(64b12fddccd2c229)., this, &AdBlockIconcxx . . $ AdBlockIcon#::setIconcxx . . $ AdBlockIcon#setIcon(b45ddcbc8423892c).); |
| 17 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(m_managercxx . . $ AdBlockIcon#m_manager., &AdBlockManagercxx . . $ AdBlockManager#::processTerminatedcxx . . $ AdBlockManager#processTerminated(49f6e7a06ebc5aa8)., this, [this]() { |
| 18 | setIconcxx . . $ AdBlockIcon#setIcon(b45ddcbc8423892c).(false); |
| 19 | }); |
| 20 | |
| 21 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(menucxx . . $ QAction#menu(8f5363d873dd4781).(), &QMenucxx . . $ QMenu#::aboutToShowcxx . . $ QMenu#aboutToShow(49f6e7a06ebc5aa8)., this, [this]() { |
| 22 | createMenucxx . . $ AdBlockIcon#createMenu(cb52c12b49e9b51b).(); |
| 23 | }); |
| 24 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(this, &QActioncxx . . $ QAction#::triggeredcxx . . $ QAction#triggered(b45ddcbc8423892c)., m_managercxx . . $ AdBlockIcon#m_manager., &AdBlockManagercxx . . $ AdBlockManager#::showDialogcxx . . $ AdBlockManager#showDialog(49f6e7a06ebc5aa8).); |
| 25 | |
| 26 | emitcxx . . $ `<external>/4830994369567095248/qtmetamacros.h:51:10`! m_managercxx . . $ AdBlockIcon#m_manager.->enabledChangedcxx . . $ AdBlockManager#enabledChanged(64b12fddccd2c229).(m_managercxx . . $ AdBlockIcon#m_manager.->isEnabledcxx . . $ AdBlockManager#isEnabled(50ce9a9e25b4a850).()); |
| 27 | } |
| 28 | |
| 29 | AdBlockIconcxx . . $ AdBlockIcon#::~cxx . . $ AdBlockIcon#`~AdBlockIcon`(ced63f7c635d850d).AdBlockIconcxx . . $ AdBlockIcon#() { |
| 30 | if (menucxx . . $ QAction#menu(8f5363d873dd4781).() != nullptr) { |
| 31 | menucxx . . $ QAction#menu(8f5363d873dd4781).()->deleteLatercxx . . $ QObject#deleteLater(49f6e7a06ebc5aa8).(); |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | void AdBlockIconcxx . . $ AdBlockIcon#::createMenucxx . . $ AdBlockIcon#createMenu(cb52c12b49e9b51b).(QMenucxx . . $ QMenu#* menu) { |
| 36 | if (menu == nullptr) { |
| 37 | menu = qobject_castcxx . . $ qobject_cast(c988cfc0ca08742e).<QMenucxx . . $ QMenu#*>(sendercxx . . $ QObject#sender(2dbb680a34285c44).()); |
| 38 | |
| 39 | if (menu == nullptr) { |
| 40 | return; |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | menu->clearcxx . . $ QMenu#clear(49f6e7a06ebc5aa8).(); |
| 45 | menu->addActioncxx . . $ QWidget#addAction(b58684e03399114e).(trcxx . . $ AdBlockIcon#tr(75d9f1c324b4579d).("Show AdBlock &settings"), m_managercxx . . $ AdBlockIcon#m_manager., &AdBlockManagercxx . . $ AdBlockManager#::showDialogcxx . . $ AdBlockManager#showDialog(49f6e7a06ebc5aa8).); |
| 46 | } |
| 47 | |
| 48 | void AdBlockIconcxx . . $ AdBlockIcon#::showMenucxx . . $ AdBlockIcon#showMenu(4004cf106c8497cc).(QPointcxx . . $ QPoint# pos) { |
| 49 | QMenucxx . . $ QMenu# menucxx . . $ QMenu#QMenu(108f35f7aa7f3cf9).; |
| 50 | |
| 51 | createMenucxx . . $ AdBlockIcon#createMenu(cb52c12b49e9b51b).(&menu); |
| 52 | menu.execcxx . . $ QMenu#exec(2535b15b88c544d4).(pos); |
| 53 | } |
| 54 | |
| 55 | void AdBlockIconcxx . . $ AdBlockIcon#::setIconcxx . . $ AdBlockIcon#setIcon(b45ddcbc8423892c).(bool adblock_enabled) { |
| 56 | QActioncxx . . $ QAction#::setIconcxx . . $ QAction#setIcon(71dcdac178620ed6).(adblock_enabled ? qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->iconscxx . . $ Application#icons(d976db2a0d825b70).()->miscIconcxx . . $ IconFactory#miscIcon(ef5a0418eb2d5e9b).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(ADBLOCK_ICON_ACTIVEcxx . . $ `src/librssguard/definitions/definitions.h:22:9`!)) |
| 57 | : qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->iconscxx . . $ Application#icons(d976db2a0d825b70).()->miscIconcxx . . $ IconFactory#miscIcon(ef5a0418eb2d5e9b).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(ADBLOCK_ICON_DISABLEDcxx . . $ `src/librssguard/definitions/definitions.h:23:9`!))); |
| 58 | } |