Commit 441ad0f8 authored by Aaron J. Seigo's avatar Aaron J. Seigo
Browse files

toggle the activity manager

BUG:265075
parent 5fe9fde0
...@@ -479,23 +479,26 @@ ControllerWindow *PlasmaApp::showWidgetExplorer(int screen, Plasma::Containment ...@@ -479,23 +479,26 @@ ControllerWindow *PlasmaApp::showWidgetExplorer(int screen, Plasma::Containment
return showController(screen, containment, true); return showController(screen, containment, true);
} }
//FIXME it'd be easier if we knew which containment triggered this action void PlasmaApp::toggleActivityManager()
ControllerWindow *PlasmaApp::showActivityManager()
{ {
const int currentScreen = m_corona->screenId(QCursor::pos());
QWeakPointer<ControllerWindow> controllerPtr = m_widgetExplorers.value(currentScreen);
ControllerWindow *controller = controllerPtr.data();
if (controller) {
controller->deleteLater();
return;
}
//try to find the "active" containment //try to find the "active" containment
int currentScreen = m_corona->screenId(QCursor::pos());
int currentDesktop = -1; int currentDesktop = -1;
if (AppSettings::perVirtualDesktopViews()) { if (AppSettings::perVirtualDesktopViews()) {
currentDesktop = KWindowSystem::currentDesktop()-1; currentDesktop = KWindowSystem::currentDesktop() - 1;
} }
Plasma::Containment *containment = m_corona->containmentForScreen(currentScreen, currentDesktop);
return showController(currentScreen, containment, false); Plasma::Containment *containment = m_corona->containmentForScreen(currentScreen, currentDesktop);
}
ControllerWindow *PlasmaApp::showActivityManager(int screen, Plasma::Containment *containment) showController(currentScreen, containment, false);
{
return showController(screen, containment, false);
} }
ControllerWindow *PlasmaApp::showController(int screen, Plasma::Containment *containment, bool widgetExplorerMode) ControllerWindow *PlasmaApp::showController(int screen, Plasma::Containment *containment, bool widgetExplorerMode)
...@@ -779,7 +782,7 @@ DesktopCorona* PlasmaApp::corona() ...@@ -779,7 +782,7 @@ DesktopCorona* PlasmaApp::corona()
//actions! //actions!
KAction *activityAction = c->addAction("manage activities"); KAction *activityAction = c->addAction("manage activities");
connect(activityAction, SIGNAL(triggered()), this, SLOT(showActivityManager())); connect(activityAction, SIGNAL(triggered()), this, SLOT(toggleActivityManager()));
activityAction->setText(i18n("Activities...")); activityAction->setText(i18n("Activities..."));
activityAction->setIcon(KIcon("preferences-activities")); activityAction->setIcon(KIcon("preferences-activities"));
activityAction->setData(Plasma::AbstractToolBox::ConfigureTool); activityAction->setData(Plasma::AbstractToolBox::ConfigureTool);
......
...@@ -75,7 +75,6 @@ public: ...@@ -75,7 +75,6 @@ public:
QList<PanelView*> panelViews() const; QList<PanelView*> panelViews() const;
ControllerWindow *showWidgetExplorer(int screen, Plasma::Containment *c); ControllerWindow *showWidgetExplorer(int screen, Plasma::Containment *c);
ControllerWindow *showActivityManager(int screen, Plasma::Containment *c);
void hideController(int screen); void hideController(int screen);
static bool isPanelContainment(Plasma::Containment *containment); static bool isPanelContainment(Plasma::Containment *containment);
...@@ -108,7 +107,8 @@ public Q_SLOTS: ...@@ -108,7 +107,8 @@ public Q_SLOTS:
void createWaitingDesktops(); void createWaitingDesktops();
void createView(Plasma::Containment *containment); void createView(Plasma::Containment *containment);
ControllerWindow *showActivityManager(); void toggleActivityManager();
/** /**
* create a new activity based on the active one * create a new activity based on the active one
*/ */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment