attempt to load different page set for containments

This commit is contained in:
Marco Martin 2013-02-28 16:33:44 +01:00
parent d2d4faaa3e
commit b88339cb4a
3 changed files with 21 additions and 4 deletions

View File

@ -66,7 +66,7 @@ Containment::Containment(QObject *parent,
// WARNING: do not access config() OR globalConfig() in this method! // WARNING: do not access config() OR globalConfig() in this method!
// that requires a scene, which is not available at this point // that requires a scene, which is not available at this point
setContainmentType(CustomContainment); setContainmentType(CustomContainment);
setHasConfigurationInterface(false); setHasConfigurationInterface(true);
} }
Containment::Containment(QObject *parent, const QVariantList &args) Containment::Containment(QObject *parent, const QVariantList &args)
@ -75,7 +75,7 @@ Containment::Containment(QObject *parent, const QVariantList &args)
{ {
// WARNING: do not access config() OR globalConfig() in this method! // WARNING: do not access config() OR globalConfig() in this method!
// that requires a scene, which is not available at this point // that requires a scene, which is not available at this point
setHasConfigurationInterface(false); setHasConfigurationInterface(true);
} }
Containment::Containment(const QString &packagePath, uint appletId) Containment::Containment(const QString &packagePath, uint appletId)
@ -84,7 +84,7 @@ Containment::Containment(const QString &packagePath, uint appletId)
{ {
// WARNING: do not access config() OR globalConfig() in this method! // WARNING: do not access config() OR globalConfig() in this method!
// that requires a scene, which is not available at this point // that requires a scene, which is not available at this point
setHasConfigurationInterface(false); setHasConfigurationInterface(true);
} }
Containment::~Containment() Containment::~Containment()

View File

@ -320,6 +320,8 @@ void ContainmentInterface::addContainmentActions(KMenu &desktopMenu, QEvent *eve
Plasma::ContainmentActions *plugin = containment()->containmentActions().value(trigger); Plasma::ContainmentActions *plugin = containment()->containmentActions().value(trigger);
if (!plugin) { if (!plugin) {
//FIXME: this action is here only for testing purposes, remove it when plugins work
desktopMenu.addAction(containment()->actions()->action("configure"));
return; return;
} }
@ -334,6 +336,7 @@ void ContainmentInterface::addContainmentActions(KMenu &desktopMenu, QEvent *eve
QList<QAction*> actions = plugin->contextualActions(); QList<QAction*> actions = plugin->contextualActions();
if (actions.isEmpty()) { if (actions.isEmpty()) {
//it probably didn't bother implementing the function. give the user a chance to set //it probably didn't bother implementing the function. give the user a chance to set
//a better plugin. note that if the user sets no-plugin this won't happen... //a better plugin. note that if the user sets no-plugin this won't happen...

View File

@ -34,14 +34,28 @@ Rectangle {
//END properties //END properties
//BEGIN model //BEGIN model
property ConfigModel globalConfigModel: plasmoid.containmentType !== undefined ? globalContainmentConfigModel : globalAppletConfigModel
ConfigModel { ConfigModel {
id: globalConfigModel id: globalAppletConfigModel
ConfigCategory { ConfigCategory {
name: "Keyboard shortcuts" name: "Keyboard shortcuts"
icon: "preferences-desktop-keyboard" icon: "preferences-desktop-keyboard"
source: "ConfigurationShortcuts.qml" source: "ConfigurationShortcuts.qml"
} }
} }
ConfigModel {
id: globalContainmentConfigModel
ConfigCategory {
name: "Appearance"
icon: "preferences-desktop-wallpaper"
source: "ConfigurationContainmentAppearance.qml"
}
ConfigCategory {
name: "Mouse Actions"
icon: "preferences-desktop-mouse"
source: "ConfigurationContainmentActions.qml"
}
}
//END model //END model
//BEGIN functions //BEGIN functions