From 2036ed1670dacc27b8afc90914a70e31093f4571 Mon Sep 17 00:00:00 2001 From: Chani Armitage Date: Mon, 14 Apr 2008 09:23:35 +0000 Subject: [PATCH] it helps if I commit *both* halves of the "add activity" button svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=796754 --- containment.cpp | 8 ++++++++ containment.h | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/containment.cpp b/containment.cpp index 80b039981..7048fd898 100644 --- a/containment.cpp +++ b/containment.cpp @@ -280,6 +280,9 @@ void Containment::setContainmentType(Containment::Type type) i18n("Lock Widgets")); connect(lockTool, SIGNAL(clicked()), this, SLOT(toggleDesktopImmutability())); } + + Plasma::Widget *activityTool = addToolBoxTool("addSiblingContainment", "list-add", i18n("Add Activity")); + connect(activityTool, SIGNAL(clicked()), this, SLOT(addSiblingContainment())); } } else { delete d->toolbox; @@ -542,6 +545,11 @@ void Containment::zoomIn() emit zoomIn(this); } +void Containment::addSiblingContainment() +{ + emit addSiblingContainment(this); +} + void Containment::clearApplets() { qDeleteAll(d->applets); diff --git a/containment.h b/containment.h index bbf5a5a1a..fa6ac12ff 100644 --- a/containment.h +++ b/containment.h @@ -337,6 +337,12 @@ class PLASMA_EXPORT Containment : public Applet */ void zoomOut(); + /** + * Emitted when the containment wants a new containment to be created. + * Usually only used for desktop containments. + */ + void addSiblingContainment(Plasma::Containment *); + /** * Emitted when the containment requests an add widgets dialog is shown. * Usually only used for desktop containments. @@ -383,6 +389,11 @@ class PLASMA_EXPORT Containment : public Applet */ void zoomIn(); + /** + * Tells the corona to create a new desktop containment + */ + void addSiblingContainment(); + protected: /** * Optionally creates a layout for the Containment for the new