new property:
preferredToolBoxPlugin(Containment::Type) used to decide what toolbox plugin dynamically load, only corona implementations can decide this. api review anyone? ;) CCMAIL:plasma-devel@kde.org svn path=/trunk/KDE/kdelibs/; revision=1157190
This commit is contained in:
parent
94a87ab2a3
commit
02faf90355
12
corona.cpp
12
corona.cpp
@ -279,6 +279,7 @@ public:
|
||||
KShortcutsDialog shortcutsDlg;
|
||||
QMap<Containment::Type, ContainmentActionsPluginsConfig> containmentActionsDefaults;
|
||||
QWeakPointer<AbstractDialogManager>dialogManager;
|
||||
QHash<Containment::Type, QString> toolBoxPlugins;
|
||||
};
|
||||
|
||||
bool CoronaPrivate::s_positioningContainments = false;
|
||||
@ -796,6 +797,17 @@ void Corona::loadDefaultLayout()
|
||||
{
|
||||
}
|
||||
|
||||
void Corona::setPreferredToolBoxPlugin(const Containment::Type type, const QString &plugin)
|
||||
{
|
||||
d->toolBoxPlugins[type] = plugin;
|
||||
//TODO: react to plugin changes on the fly? still don't see the use case (maybe for laptops that become tablets?)
|
||||
}
|
||||
|
||||
QString Corona::preferredToolBoxPlugin(const Containment::Type type) const
|
||||
{
|
||||
return d->toolBoxPlugins.value(type);
|
||||
}
|
||||
|
||||
void Corona::dragEnterEvent(QGraphicsSceneDragDropEvent *event)
|
||||
{
|
||||
QGraphicsScene::dragEnterEvent(event);
|
||||
|
17
corona.h
17
corona.h
@ -262,6 +262,15 @@ public:
|
||||
*/
|
||||
QList<Plasma::Containment *> importLayout(const KConfigBase &config);
|
||||
|
||||
/**
|
||||
* Returns the name of the preferred plugin to be used as containment toolboxes.
|
||||
* CustomContainments and CustomPanelContainments can still override it as their liking. It's also not guaranteed that the plugin will actually exist.
|
||||
*
|
||||
* @param type the containment type of which we want to know the associated toolbox plugin
|
||||
* @since 4.6
|
||||
*/
|
||||
QString preferredToolBoxPlugin(const Containment::Type type) const;
|
||||
|
||||
public Q_SLOTS:
|
||||
/**
|
||||
* Initializes the layout from a config file. This will first clear any existing
|
||||
@ -417,6 +426,14 @@ protected:
|
||||
*/
|
||||
void mapAnimation(Animator::Animation from, const QString &to);
|
||||
|
||||
/**
|
||||
* @return The preferred toolbox plugin name for a given containment type.
|
||||
* @param type the containment type of which we want to know the preferred toolbox plugin.
|
||||
* @param plugin the toolbox plugin name
|
||||
* @since 4.6
|
||||
*/
|
||||
void setPreferredToolBoxPlugin(const Containment::Type type, const QString &plugin);
|
||||
|
||||
//Reimplemented from QGraphicsScene
|
||||
void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
|
||||
void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
|
||||
|
Loading…
Reference in New Issue
Block a user