Buttons are enable only when they have something to do
This commit is contained in:
parent
837c44434d
commit
2431da8222
5 changed files with 36 additions and 2 deletions
|
@ -22,6 +22,7 @@ find_package(Qt5Transitional MODULE)
|
|||
find_package(Qt5Core REQUIRED NO_MODULE)
|
||||
|
||||
find_package(Qt5Quick REQUIRED NO_MODULE)
|
||||
find_package(KCoreAddons REQUIRED NO_MODULE)
|
||||
|
||||
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0 -std=c++0x)
|
||||
|
||||
|
@ -87,7 +88,9 @@ target_link_libraries(kwincompositing
|
|||
${Qt5Widgets_LIBRARIES}
|
||||
${KDE4_KDECORE_LIBS}
|
||||
${KDE4_KCMUTILS_LIBS}
|
||||
)
|
||||
|
||||
${KDE4Support_LIBRARIES}
|
||||
${KCoreAddons_LIBRARIES})
|
||||
|
||||
INSTALL(DIRECTORY qml DESTINATION ${DATA_INSTALL_DIR}/kwincompositing)
|
||||
INSTALL(TARGETS kwincompositing ${INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
|
|
|
@ -56,6 +56,7 @@ void EffectConfig::openConfig(const QString &effectName) {
|
|||
if (plugin.name() == effectName) {
|
||||
QString effectConfig = serviceName(plugin.name() + "_config");
|
||||
KCModuleProxy *proxy = new KCModuleProxy(effectConfig);
|
||||
|
||||
proxy->show();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,8 +23,26 @@
|
|||
#include "model.h"
|
||||
#include <QApplication>
|
||||
|
||||
#include <KAboutData>
|
||||
#include <kcmdlineargs.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
KAboutData aboutData("kwincompositing", 0, i18n("KWinCompositing"),
|
||||
"1.0", i18n("Plasma Add-Ons Creator"),
|
||||
KAboutData::License_GPL,
|
||||
i18n("Copyright 2009-2013 Plasma Development Team"),
|
||||
"", "", "kwin@kde.org");
|
||||
|
||||
aboutData.addAuthor(i18n("Antonis Tsiapaliokas"),
|
||||
i18n("Author and maintainer"),
|
||||
"kok3rs@gmail.com");
|
||||
|
||||
KCmdLineArgs::init(argc, argv,
|
||||
"kwincompositing", "",
|
||||
ki18n("KWinCompositing"),
|
||||
"0.1");
|
||||
|
||||
QApplication app(argc, argv);
|
||||
|
||||
EffectView *view = new EffectView();
|
||||
|
|
|
@ -40,8 +40,13 @@ Component {
|
|||
id: myCheckBox
|
||||
checked: engineObject.isEnabled(model.Name)
|
||||
onClicked: {
|
||||
apply.enabled = true;
|
||||
engineObject.effectStatus(model.Name, checked);
|
||||
}
|
||||
|
||||
onCheckedChanged: {
|
||||
configureButton.enabled = myCheckBox.checked;
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
|
@ -86,6 +91,7 @@ Component {
|
|||
anchors.left: effectItem.right
|
||||
visible: effectConfig.effectUiConfigExists(model.Name)
|
||||
text: "CONFIGURE EFFECT"
|
||||
enabled: myCheckBox.checked
|
||||
onClicked: {
|
||||
effectConfig.openConfig(model.Name);
|
||||
}
|
||||
|
|
|
@ -90,6 +90,7 @@ Item {
|
|||
anchors.fill: parent
|
||||
model: searchModel
|
||||
delegate: Effect {}
|
||||
|
||||
section.property: "Category"
|
||||
section.delegate: sectionHeading
|
||||
}
|
||||
|
@ -98,10 +99,15 @@ Item {
|
|||
Button {
|
||||
id: apply
|
||||
text: "Apply"
|
||||
enabled: false
|
||||
anchors {
|
||||
bottom: parent.bottom
|
||||
}
|
||||
onClicked: { engineObject.syncConfig(); }
|
||||
|
||||
onClicked: {
|
||||
engineObject.syncConfig();
|
||||
apply.enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue