Add Get-Hot-New-Stuff support
REVIEW: 114477
This commit is contained in:
parent
b48ebd300c
commit
f590506818
7 changed files with 49 additions and 9 deletions
|
@ -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:
|
# 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)
|
find_package(KF5Declarative REQUIRED NO_MODULE)
|
||||||
|
@ -87,6 +87,7 @@ target_link_libraries(kwincompositing
|
||||||
KF5::I18n
|
KF5::I18n
|
||||||
KF5::Service
|
KF5::Service
|
||||||
KF5::KCMUtils
|
KF5::KCMUtils
|
||||||
|
KF5::NewStuff
|
||||||
KF5::Declarative
|
KF5::Declarative
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -111,11 +112,13 @@ target_link_libraries(effectModelTest
|
||||||
KF5::I18n
|
KF5::I18n
|
||||||
KF5::Service
|
KF5::Service
|
||||||
KF5::KCMUtils
|
KF5::KCMUtils
|
||||||
|
KF5::NewStuff
|
||||||
KF5::Declarative)
|
KF5::Declarative)
|
||||||
|
|
||||||
INSTALL(DIRECTORY qml DESTINATION ${DATA_INSTALL_DIR}/kwincompositing)
|
INSTALL(DIRECTORY qml DESTINATION ${DATA_INSTALL_DIR}/kwincompositing)
|
||||||
INSTALL(TARGETS kwincompositing DESTINATION ${PLUGIN_INSTALL_DIR})
|
INSTALL(TARGETS kwincompositing DESTINATION ${PLUGIN_INSTALL_DIR})
|
||||||
install(FILES kwincompositing.desktop DESTINATION ${SERVICES_INSTALL_DIR})
|
install(FILES kwincompositing.desktop DESTINATION ${SERVICES_INSTALL_DIR})
|
||||||
|
install(FILES kwineffect.knsrc DESTINATION ${CONFIG_INSTALL_DIR})
|
||||||
################# list the subdirectories #################
|
################# list the subdirectories #################
|
||||||
|
|
||||||
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
||||||
|
|
|
@ -24,9 +24,12 @@
|
||||||
#include <KPluginInfo>
|
#include <KPluginInfo>
|
||||||
#include <KServiceTypeTrader>
|
#include <KServiceTypeTrader>
|
||||||
|
|
||||||
|
#include <KNS3/DownloadDialog>
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
#include <QPointer>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <QString>
|
#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 Compositing
|
||||||
}//end namespace KWin
|
}//end namespace KWin
|
||||||
|
|
|
@ -38,6 +38,10 @@ public:
|
||||||
|
|
||||||
Q_INVOKABLE bool effectUiConfigExists(const QString &effectName);
|
Q_INVOKABLE bool effectUiConfigExists(const QString &effectName);
|
||||||
Q_INVOKABLE void openConfig(const QString &effectName);
|
Q_INVOKABLE void openConfig(const QString &effectName);
|
||||||
|
Q_INVOKABLE void openGHNS();
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
void effectListChanged();
|
||||||
};
|
};
|
||||||
}//end namespace Compositing
|
}//end namespace Compositing
|
||||||
}//end namespace KWin
|
}//end namespace KWin
|
||||||
|
|
6
kcmkwin/kwincompositing/kwineffect.knsrc
Normal file
6
kcmkwin/kwincompositing/kwineffect.knsrc
Normal 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
|
|
@ -131,12 +131,12 @@ public:
|
||||||
Q_INVOKABLE void updateEffectStatus(int rowIndex, bool effectState);
|
Q_INVOKABLE void updateEffectStatus(int rowIndex, bool effectState);
|
||||||
Q_INVOKABLE void syncConfig();
|
Q_INVOKABLE void syncConfig();
|
||||||
Q_INVOKABLE void enableWidnowManagement(bool enabled);
|
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 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 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(); };
|
QColor backgroundAlternateColor() { return KColorScheme(QPalette::Active, KColorScheme::View, KSharedConfigPtr(0)).background(KColorScheme::AlternateBackground).color(); };
|
||||||
|
|
||||||
void load();
|
|
||||||
void defaults();
|
void defaults();
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
|
|
|
@ -211,10 +211,6 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EffectConfig {
|
|
||||||
id: effectConfig
|
|
||||||
}
|
|
||||||
|
|
||||||
} //end Row
|
} //end Row
|
||||||
} //end Rectangle
|
} //end Rectangle
|
||||||
} //end item
|
} //end item
|
||||||
|
|
|
@ -56,19 +56,37 @@ Item {
|
||||||
id: compositingType
|
id: compositingType
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EffectConfig {
|
||||||
|
id: effectConfig
|
||||||
|
onEffectListChanged: {
|
||||||
|
searchModel.load()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: row
|
id: row
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height
|
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 {
|
CheckBox {
|
||||||
id: useCompositing
|
id: useCompositing
|
||||||
text: i18n("Enable desktop effects on startup")
|
text: i18n("Enable desktop effects on startup")
|
||||||
checked: compositing.compositingEnabled
|
checked: compositing.compositingEnabled
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: ghnsButton.bottom
|
||||||
left: col.right
|
left: col.right
|
||||||
topMargin: col.height/8
|
|
||||||
}
|
}
|
||||||
Connections {
|
Connections {
|
||||||
target: compositing
|
target: compositing
|
||||||
|
@ -84,7 +102,6 @@ Item {
|
||||||
checked: false
|
checked: false
|
||||||
anchors.left: col.right
|
anchors.left: col.right
|
||||||
anchors.top: useCompositing.bottom
|
anchors.top: useCompositing.bottom
|
||||||
//anchors.topMargin: col.height/8
|
|
||||||
onClicked: searchModel.enableWidnowManagement(windowManagement.checked)
|
onClicked: searchModel.enableWidnowManagement(windowManagement.checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue