a toggleActivityManager action

still a stub, will be completely managed in qml
This commit is contained in:
Marco Martin 2013-10-18 15:56:24 +02:00
parent 9b002a8bea
commit 0baecfcdb5
3 changed files with 30 additions and 4 deletions

View File

@ -30,6 +30,11 @@ Rectangle {
property Item containment
function toggleActivityManager() {
console.log("Activity manger toggled")
}
onContainmentChanged: {
print("New Containment: " + containment);
print("Old Containment: " + internal.oldContainment);

View File

@ -117,6 +117,14 @@ ShellCorona::ShellCorona(QObject *parent)
//Activity stuff
QAction *activityAction = actions()->addAction("manage activities");
connect(activityAction, &QAction::triggered,
this, &ShellCorona::toggleActivityManager);
activityAction->setText(i18n("Activities..."));
activityAction->setIcon(QIcon::fromTheme("preferences-activities"));
activityAction->setData(Plasma::Types::ConfigureAction);
activityAction->setShortcut(QKeySequence("alt+d, alt+a"));
activityAction->setShortcutContext(Qt::ApplicationShortcut);
connect(this, SIGNAL(immutabilityChanged(Plasma::ImmutabilityType)),
this, SLOT(updateImmutability(Plasma::ImmutabilityType)));
@ -455,6 +463,18 @@ void ShellCorona::showWidgetExplorer()
d->widgetExplorerView->show();
}
void ShellCorona::toggleActivityManager()
{
QPoint cursorPos = QCursor::pos();
foreach (DesktopView *view, d->views) {
if (view->screen()->geometry().contains(cursorPos)) {
//The view QML has to provide something to display the activity explorer
view->rootObject()->metaObject()->invokeMethod(view->rootObject(), "toggleActivityManager");
return;
}
}
}
void ShellCorona::syncAppConfig()
{
qDebug() << "Syncing plasma-shellrc config";

View File

@ -72,6 +72,10 @@ public:
PanelView *panelView(Plasma::Containment *containment) const;
Activity* activity(const QString &id);
KActivities::Controller *activityController();
public Q_SLOTS:
/**
* Request saving applicationConfig on disk, it's event compressed, not immediate
@ -119,14 +123,11 @@ protected Q_SLOTS:
*/
void processUpdateScripts();
Activity* activity(const QString &id);
KActivities::Controller *activityController();
private Q_SLOTS:
void checkLoadingDesktopsComplete();
void handleContainmentAdded(Plasma::Containment *c);
void showWidgetExplorer();
void toggleActivityManager();
void syncAppConfig();
void setDashboardShown(bool show);
void checkActivities();