Add Get-Hot-New-Stuff support

REVIEW: 114477
This commit is contained in:
Antonis Tsiapaliokas 2014-01-12 21:27:10 +02:00 committed by Martin Gräßlin
parent b48ebd300c
commit f590506818
7 changed files with 49 additions and 9 deletions

View file

@ -48,7 +48,7 @@ set (QT_MIN_VERSION "5.2.0")
# Load CMake, Compiler and InstallDirs settings from KF5 and the following are already somewhat "done" tier1/tier2 libs from kdelibs:
find_package(KF5 CONFIG REQUIRED COMPONENTS CoreAddons Config I18n Service XmlGui KCMUtils)
find_package(KF5 CONFIG REQUIRED COMPONENTS CoreAddons Config I18n Service XmlGui KCMUtils NewStuff)
find_package(KF5Declarative REQUIRED NO_MODULE)
@ -87,6 +87,7 @@ target_link_libraries(kwincompositing
KF5::I18n
KF5::Service
KF5::KCMUtils
KF5::NewStuff
KF5::Declarative
)
@ -111,11 +112,13 @@ target_link_libraries(effectModelTest
KF5::I18n
KF5::Service
KF5::KCMUtils
KF5::NewStuff
KF5::Declarative)
INSTALL(DIRECTORY qml DESTINATION ${DATA_INSTALL_DIR}/kwincompositing)
INSTALL(TARGETS kwincompositing DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES kwincompositing.desktop DESTINATION ${SERVICES_INSTALL_DIR})
install(FILES kwineffect.knsrc DESTINATION ${CONFIG_INSTALL_DIR})
################# list the subdirectories #################
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)

View file

@ -24,9 +24,12 @@
#include <KPluginInfo>
#include <KServiceTypeTrader>
#include <KNS3/DownloadDialog>
#include <QDialog>
#include <QDialogButtonBox>
#include <QVBoxLayout>
#include <QPointer>
#include <QStandardPaths>
#include <QString>
@ -81,5 +84,16 @@ void EffectConfig::openConfig(const QString &effectName)
}
}
}
void EffectConfig::openGHNS()
{
QPointer<KNS3::DownloadDialog> downloadDialog = new KNS3::DownloadDialog(QStringLiteral("kwineffect.knsrc"));
if (downloadDialog->exec() == QDialog::Accepted) {
emit effectListChanged();
}
delete downloadDialog;
}
}//end namespace Compositing
}//end namespace KWin

View file

@ -38,6 +38,10 @@ public:
Q_INVOKABLE bool effectUiConfigExists(const QString &effectName);
Q_INVOKABLE void openConfig(const QString &effectName);
Q_INVOKABLE void openGHNS();
Q_SIGNALS:
void effectListChanged();
};
}//end namespace Compositing
}//end namespace KWin

View file

@ -0,0 +1,6 @@
[KNewStuff3]
ProvidersUrl=http://download.kde.org/ocs/providers.xml
Categories=KWin Effects
StandardResource=tmp
InstallationCommand=plasmapkg -t kwineffect -i %f
UninstallCommand=plasmapkg -t kwineffect -r %f

View file

@ -131,12 +131,12 @@ public:
Q_INVOKABLE void updateEffectStatus(int rowIndex, bool effectState);
Q_INVOKABLE void syncConfig();
Q_INVOKABLE void enableWidnowManagement(bool enabled);
Q_INVOKABLE void load();
QColor backgroundActiveColor() { return KColorScheme(QPalette::Active, KColorScheme::Selection, KSharedConfigPtr(0)).background(KColorScheme::LinkBackground).color(); };
QColor backgroundNormalColor() { return KColorScheme(QPalette::Active, KColorScheme::View, KSharedConfigPtr(0)).background(KColorScheme::NormalBackground).color(); };
QColor backgroundAlternateColor() { return KColorScheme(QPalette::Active, KColorScheme::View, KSharedConfigPtr(0)).background(KColorScheme::AlternateBackground).color(); };
void load();
void defaults();
public Q_SLOTS:

View file

@ -211,10 +211,6 @@ Item {
}
}
EffectConfig {
id: effectConfig
}
} //end Row
} //end Rectangle
} //end item

View file

@ -56,19 +56,37 @@ Item {
id: compositingType
}
EffectConfig {
id: effectConfig
onEffectListChanged: {
searchModel.load()
}
}
RowLayout {
id: row
width: parent.width
height: parent.height
Button {
id: ghnsButton
text: i18n("Get New Effects ...")
iconName: "get-hot-new-stuff"
anchors {
left: col.right
top: parent.top
topMargin: col.height/8
}
onClicked: effectConfig.openGHNS()
}
CheckBox {
id: useCompositing
text: i18n("Enable desktop effects on startup")
checked: compositing.compositingEnabled
anchors {
top: parent.top
top: ghnsButton.bottom
left: col.right
topMargin: col.height/8
}
Connections {
target: compositing
@ -84,7 +102,6 @@ Item {
checked: false
anchors.left: col.right
anchors.top: useCompositing.bottom
//anchors.topMargin: col.height/8
onClicked: searchModel.enableWidnowManagement(windowManagement.checked)
}