Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Unmaintained
KDE Workspace
Commits
f7539c1c
Commit
f7539c1c
authored
Oct 26, 2012
by
Martin Flöser
Browse files
Add GHNS support for Scripted KWin Effects
BUG: 296773 FIXED-IN: 4.10 REVIEW: 107051
parent
09af8f0c
Changes
5
Hide whitespace changes
Inline
Side-by-side
kwin/kcmkwin/kwincompositing/CMakeLists.txt
View file @
f7539c1c
...
...
@@ -11,12 +11,13 @@ set(kwin_xml ${KDEBASE_WORKSPACE_SOURCE_DIR}/kwin/org.kde.KWin.xml)
set_source_files_properties
(
${
kwin_xml
}
PROPERTIES INCLUDE
"interface_util.h"
)
QT4_ADD_DBUS_INTERFACE
(
kcm_kwincompositing_PART_SRCS
${
kwin_xml
}
kwin_interface
)
kde4_add_plugin
(
kcm_kwincompositing
${
kcm_kwincompositing_PART_SRCS
}
)
target_link_libraries
(
kcm_kwincompositing
${
KDE4_KCMUTILS_LIBS
}
${
KDE4_KDEUI_LIBS
}
${
X11_LIBRARIES
}
)
target_link_libraries
(
kcm_kwincompositing
${
KDE4_KNEWSTUFF3_LIBS
}
${
KDE4_KCMUTILS_LIBS
}
${
KDE4_KDEUI_LIBS
}
${
X11_LIBRARIES
}
)
install
(
TARGETS kcm_kwincompositing DESTINATION
${
PLUGIN_INSTALL_DIR
}
)
########### install files ###############
install
(
FILES kwincompositing.desktop DESTINATION
${
SERVICES_INSTALL_DIR
}
)
install
(
FILES kwineffect.knsrc DESTINATION
${
CONFIG_INSTALL_DIR
}
)
kwin/kcmkwin/kwincompositing/kwineffect.knsrc
0 → 100644
View file @
f7539c1c
[KNewStuff3]
Categories=KWin Effects
StandardResource=tmp
InstallationCommand=plasmapkg -t kwineffect -i %f
UninstallCommand=plasmapkg -t kwineffect -r %f
kwin/kcmkwin/kwincompositing/main.cpp
View file @
f7539c1c
...
...
@@ -37,6 +37,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include
<kservice.h>
#include
<ktitlewidget.h>
#include
<knotification.h>
#include
<KNS3/DownloadDialog>
#include
<QtDBus/QtDBus>
#include
<QPainter>
...
...
@@ -91,6 +92,7 @@ KWinCompositingConfig::KWinCompositingConfig(QWidget *parent, const QVariantList
ui
.
messageBox
->
setVisible
(
false
);
ui
.
messageBox
->
addAction
(
m_showDetailedErrors
);
ui
.
messageBox
->
setMessageType
(
KMessageWidget
::
Warning
);
ui
.
ghns
->
setIcon
(
KIcon
(
"get-hot-new-stuff"
));
// For future use
(
void
)
I18N_NOOP
(
"Use GLSL shaders"
);
...
...
@@ -129,6 +131,7 @@ KWinCompositingConfig::KWinCompositingConfig(QWidget *parent, const QVariantList
connect
(
ui
.
glVSync
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
changed
()));
connect
(
ui
.
glShaders
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
changed
()));
connect
(
m_showDetailedErrors
,
SIGNAL
(
triggered
(
bool
)),
SLOT
(
showDetailedEffectLoadingInformation
()));
connect
(
ui
.
ghns
,
SIGNAL
(
clicked
(
bool
)),
SLOT
(
slotGHNS
()));
// Open the temporary config file
// Temporary conf file is used to synchronize effect checkboxes with effect
...
...
@@ -759,6 +762,17 @@ QString KWinCompositingConfig::quickHelp() const
return
i18n
(
"<h1>Desktop Effects</h1>"
);
}
void
KWinCompositingConfig
::
slotGHNS
()
{
QPointer
<
KNS3
::
DownloadDialog
>
downloadDialog
=
new
KNS3
::
DownloadDialog
(
"kwineffect.knsrc"
,
this
);
if
(
downloadDialog
->
exec
()
==
KDialog
::
Accepted
)
{
if
(
!
downloadDialog
->
changedEntries
().
isEmpty
())
{
initEffectSelector
();
}
}
delete
downloadDialog
;
}
}
// namespace
#include
"main.moc"
kwin/kcmkwin/kwincompositing/main.h
View file @
f7539c1c
...
...
@@ -82,6 +82,7 @@ private slots:
void
toggleEffectShortcutChanged
(
const
QKeySequence
&
seq
);
void
updateStatusUI
(
bool
compositingIsPossible
);
void
showDetailedEffectLoadingInformation
();
void
slotGHNS
();
private:
bool
effectEnabled
(
const
QString
&
effect
,
const
KConfigGroup
&
cfg
)
const
;
...
...
kwin/kcmkwin/kwincompositing/main.ui
View file @
f7539c1c
...
...
@@ -6,7 +6,7 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
5
57
</width>
<width>
5
83
</width>
<height>
530
</height>
</rect>
</property>
...
...
@@ -451,17 +451,45 @@
</widget>
</item>
<item>
<widget
class=
"KPluginSelector"
name=
"effectSelector"
native=
"true"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Expanding"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"focusPolicy"
>
<enum>
Qt::WheelFocus
</enum>
</property>
</widget>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_5"
>
<item>
<widget
class=
"KPluginSelector"
name=
"effectSelector"
native=
"true"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Expanding"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"focusPolicy"
>
<enum>
Qt::WheelFocus
</enum>
</property>
</widget>
</item>
<item>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_6"
>
<item>
<widget
class=
"QPushButton"
name=
"ghns"
>
<property
name=
"text"
>
<string>
Get New Effect
</string>
</property>
</widget>
</item>
<item>
<spacer
name=
"verticalSpacer_4"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
40
</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment