diff --git a/containment.cpp b/containment.cpp index 38186f4db..213695d9c 100644 --- a/containment.cpp +++ b/containment.cpp @@ -865,7 +865,7 @@ void Containment::enableToolBoxTool(const QString &toolname, bool enable) } } -bool Containment::isToolboxToolEnabled(const QString &toolname) const +bool Containment::isToolBoxToolEnabled(const QString &toolname) const { if (d->toolBox) { return d->toolBox->isToolEnabled(toolname); @@ -873,14 +873,23 @@ bool Containment::isToolboxToolEnabled(const QString &toolname) const return false; } -void Containment::showToolbox() +void Containment::setToolBoxOpen(bool open) +{ + if (open) { + openToolBox(); + } else { + closeToolBox(); + } +} + +void Containment::openToolBox() { if (d->toolBox) { d->toolBox->showToolbox(); } } -void Containment::hideToolbox() +void Containment::closeToolBox() { if (d->toolBox) { d->toolBox->hideToolbox(); diff --git a/containment.h b/containment.h index 71435dc19..c3b2a8e3d 100644 --- a/containment.h +++ b/containment.h @@ -235,7 +235,7 @@ class PLASMA_EXPORT Containment : public Applet void loadContainment(KConfigGroup* group); /** - * Constructs a toolbox item and adds it to the toolbox. The toolbox takes over ownership of the item. Returns the constructed tool. + * Constructs a ToolBox item and adds it to the toolbox. The toolbox takes over ownership of the item. Returns the constructed tool. * * @param toolName the name of the tool * @param iconName the name of the icon @@ -256,17 +256,24 @@ class PLASMA_EXPORT Containment : public Applet /** * Returns whether or not a given toolbox tool is enabled */ - bool isToolboxToolEnabled(const QString &toolName) const; + bool isToolBoxToolEnabled(const QString &toolName) const; /** - * Open the Plasma toolbox + * Sets the open or closed state of the Containment's toolbox + * + * @arg open true to open the ToolBox, false to close it */ - void showToolbox(); + void setToolBoxOpen(bool open); /** - * Close the Plasma toolbox + * Open the Containment's toolbox */ - void hideToolbox(); + void openToolBox(); + + /** + * Closes Containment's toolbox + */ + void closeToolBox(); Q_SIGNALS: /**