1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

FCM, TabManager: add them to extension sub-menu.

This commit is contained in:
srazi 2015-10-13 04:23:17 +03:30 committed by David Rosca
parent 3fd23a54cb
commit e604120f49
4 changed files with 23 additions and 1 deletions

View File

@ -29,6 +29,7 @@
#include <QSettings> #include <QSettings>
#include <QTranslator> #include <QTranslator>
#include <QDir> #include <QDir>
#include <QMenu>
#if defined(Q_OS_WIN) || defined(Q_OS_OS2) #if defined(Q_OS_WIN) || defined(Q_OS_OS2)
#include <QProcessEnvironment> #include <QProcessEnvironment>
@ -121,6 +122,13 @@ void FCM_Plugin::showSettings(QWidget* parent)
m_fcmDialog->showPage(2); m_fcmDialog->showPage(2);
} }
void FCM_Plugin::populateExtensionsMenu(QMenu* menu)
{
QAction* showFCM = new QAction(QIcon(":/flashcookiemanager/data/flash-cookie-manager.png"), tr("Flash Cookie Manager"), menu);
connect(showFCM, SIGNAL(triggered()), this, SLOT(showFlashCookieManager()));
menu->addAction(showFCM);
}
void FCM_Plugin::setFlashCookies(const QList<FlashCookie> &flashCookies) void FCM_Plugin::setFlashCookies(const QList<FlashCookie> &flashCookies)
{ {
m_flashCookies = flashCookies; m_flashCookies = flashCookies;
@ -383,7 +391,7 @@ QWidget* FCM_Plugin::createStatusBarIcon(BrowserWindow* mainWindow)
icon->setCursor(Qt::PointingHandCursor); icon->setCursor(Qt::PointingHandCursor);
QPixmap p(":/flashcookiemanager/data/flash-cookie-manager.png"); QPixmap p(":/flashcookiemanager/data/flash-cookie-manager.png");
icon->setPixmap(p.scaledToHeight(16)); icon->setPixmap(p.scaledToHeight(16));
icon->setToolTip(tr("Show/Hide Flash Cookie Manager")); icon->setToolTip(tr("Show Flash Cookie Manager"));
connect(icon, SIGNAL(clicked(QPoint)), this, SLOT(showFlashCookieManager())); connect(icon, SIGNAL(clicked(QPoint)), this, SLOT(showFlashCookieManager()));

View File

@ -61,6 +61,7 @@ public:
QTranslator* getTranslator(const QString &locale); QTranslator* getTranslator(const QString &locale);
void showSettings(QWidget* parent = 0); void showSettings(QWidget* parent = 0);
void populateExtensionsMenu(QMenu* menu);
void setFlashCookies(const QList<FlashCookie> &flashCookies); void setFlashCookies(const QList<FlashCookie> &flashCookies);
QList<FlashCookie> flashCookies(); QList<FlashCookie> flashCookies();

View File

@ -28,6 +28,7 @@
#include <QSettings> #include <QSettings>
#include <QAction> #include <QAction>
#include <QTimer> #include <QTimer>
#include <QMenu>
QString TabManagerPlugin::s_settingsPath; QString TabManagerPlugin::s_settingsPath;
@ -135,6 +136,17 @@ void TabManagerPlugin::showSettings(QWidget* parent)
} }
} }
void TabManagerPlugin::populateExtensionsMenu(QMenu* menu)
{
if (m_controller->viewType() == TabManagerWidgetController::ShowAsWindow) {
QAction* showAction = m_controller->createMenuAction();
showAction->setParent(menu);
showAction->setCheckable(false);
connect(showAction, SIGNAL(triggered()), m_controller, SLOT(raiseTabManager()));
menu->addAction(showAction);
}
}
void TabManagerPlugin::insertManagerWidget() void TabManagerPlugin::insertManagerWidget()
{ {
if (m_controller->viewType() == TabManagerWidgetController::ShowAsSideBar) { if (m_controller->viewType() == TabManagerWidgetController::ShowAsSideBar) {

View File

@ -49,6 +49,7 @@ public:
QTranslator* getTranslator(const QString &locale); QTranslator* getTranslator(const QString &locale);
void showSettings(QWidget* parent = 0); void showSettings(QWidget* parent = 0);
void populateExtensionsMenu(QMenu* menu);
void removeManagerWidget(); void removeManagerWidget();