Added KDE3 version of Desktop Effects

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/desktop-effects-kde@1101884 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
commit 19f9c3f434

@ -0,0 +1,3 @@
if [ -e $HOME/.kde3/share/config/compizasWM ] ; then
export KDEWM="/opt/kde3/bin/compiz"
fi

@ -0,0 +1,230 @@
# -*- coding: utf-8 -*-
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright 2007-2008 Martin Böhm <martin.bohm@kubuntu.org>
# Copyright 2007-2008 Michael Anderson <nosrednaekim@gmail.com>
# a class hosting the desktop-independent methods for the Desktop
# Effects Dialog
import sys
import os
from optparse import OptionParser
# for adept batch launching
import subprocess
# for compiz-kde package checking
import apt_pkg
from apt.progress import OpProgress
import gettext
def _(str):
return unicode(gettext.gettext(str), 'UTF-8')
def __(catalog,str):
return unicode(gettext.dgettext(catalog, str), 'UTF-8')
def utf8(str):
if isinstance(str, unicode):
return str
return unicode(str, 'UTF-8')
class DesktopEffectsCommon(object):
def __init__(self):
self.action = 0
self.ibText = ""
self.check()
self.DATADIR = "/opt/kde3/share/apps/desktop-effects-kde/"
def checkInstalled(self):
progress = OpProgress()
cache = apt_pkg.GetCache(progress)
for pkg in cache.Packages:
if pkg.Name == "compiz-kde-kde3":
if pkg.CurrentVer is not None:
return True
# otherwise
return False
def checkEnabled(self):
'''checks if the compizasWM file is present, and if so, reads what mode we are in'''
if os.path.exists(os.path.expanduser("~/.kde3/share/config/compizasWM")):
compizasWM = open(os.path.expanduser("~/.kde3/share/config/compizasWM"))
state = compizasWM.readline()
return state
else:
return False
def check(self):
''' checks the state and changes the UI accordingly. '''
self.installed = self.checkInstalled()
self.enabled = self.checkEnabled()
if(self.installed == True):
self.ibText = _("&Remove Desktop Effects")
self.showWarning()
self.enable()
self.pText = _("The Compiz engine is installed in your system.")
# remove, not install
self.rm = True
else:
self.pText = _("In order for Compiz Desktop Effects to work,"
" the Compiz engine must be installed on your system.")
self.ibText = _("&Install Desktop Effects")
self.hideWarning()
self.disable()
# install, not remove
self.rm = False
#self.effectsBox.setDisabled(True)
def showWarning(self):
''' shows the warning information, should be implemented in the UI class '''
raise NotImplementedError
def hideWarning(self):
''' hides the warning, should be implemented in the UI class '''
raise NotImplementedError
def disable(self):
''' disables the options, should be implemented in the UI '''
raise NotImplementedError
def enable(self):
''' enables the options, should be implemented in the UI '''
raise NotImplementedError
def done(self):
''' action to be done after the user clicks the "cancel" button '''
print "signalled" # DEBUG
self.close()
def apply(self):
''' action to be done after the user clicks the "apply button '''
print "apply clicked" #DEBUG
if self.action > 0:
if self.action == 1:
self.disableEffects()
elif self.action == 2:
self.enableStandardEffects()
elif self.action == 3:
self.enableExtraEffects()
elif self.action == 4:
self.enableCustomEffects()
if not self.enabled and not self.action == 1:
os.spawnl(os.P_NOWAIT, "/opt/kde3/bin/compiz", "--replace")
self.enabled = True
def btnInstallClicked(self):
if self.installed == True:
self.remove()
return
try:
''' Installs the Compiz package. Not very nice as it is distribution dependent. '''
subprocess.call(['kdesudo', '-c' '/opt/kde3/bin/adept_batch install compiz-kde-kde3 compiz-fusion-plugins-main-kde3 compiz-fusion-plugins-extra-kde3'])
except:
subprocess.call(['kdialog', '--sorry', 'Adept Batch is not installed on this system'])
self.check()
# the functions toggled by radio boxes
def noEffects(self):
print "radio toggled" # DEBUG
self.action = 1
# self.apply()
def standardEffects(self):
print "radio toggled" # DEBUG
self.action = 2
# self.apply()
def extraEffects(self):
print "radio toggled" # DEBUG
self.action = 3
def customEffects(self):
print "radio toggled" # DEBUG
self.action = 4
# self.apply()
def remove(self):
removeAnswer = subprocess.call(['kdialog', "--warningyesno", "Are you sure you wish to remove Compiz KDE?"])
if removeAnswer == 0:
try:
''' Remove the Compiz package. Not very nice as it is distribution dependent. '''
subprocess.call(['kdesudo', '-c' '/opt/kde3/bin/adept_batch remove compiz-kde-kde3 compiz-fusion-plugins-main-kde3 compiz-fusion-plugins-extra-kde3'])
except:
subprocess.call(['kdialog', '--sorry', 'Adept Batch is not installed on this system'])
def disableEffects(self):
'''remove compiz as the default WM'''
os.remove(os.path.expanduser("~/.kde3/share/config/compizasWM"))
self.enabled = False
def enableStandardEffects(self):
'''copy the .ini to Default.ini and enable compiz as default WM'''
code = os.system('mkdir -p ~/.config/compiz/compizconfig')
try:
enable = open(os.path.expanduser("~/.kde3/share/config/compizasWM"),"w")
if enable.readline() == "custom":
customeffects = open(os.path.expanduser("~/.config/compiz/compizconfig/Default.ini"),"r")
backupfile = open(os.path.expanduser("~/.config/compiz/compizconfig/Custom.ini"),"w")
backupfile.write(customeffects)
backupfile.close()
customeffects.close()
except:
print "error"
enable.write("standardeffects")
enable.close()
config = open(os.path.join(self.DATADIR,"MediumEffects.ini"),"r")
dest = open(os.path.expanduser("~/.config/compiz/compizconfig/Default.ini"),"w")
dest.write(config.read())
dest.close()
config.close()
print "standardEffects enabled" #DEBUG
def enableExtraEffects(self):
''' copy the extraeffects.ini to Default.ini and enable compiz as defaultWM'''
code = os.system('mkdir -p ~/.config/compiz/compizconfig')
if os.path.exists(os.path.expanduser("~/.kde3/share/config/compizasWM")):
enable = open(os.path.expanduser("~/.kde3/share/config/compizasWM"),"r")
if enable.readline() == "custom":
customeffects = open(os.path.expanduser("~/.config/compiz/compizconfig/Default.ini"),"r")
backupfile = open(os.path.expanduser("~/.config/compiz/compizconfig/Custom.ini"),"w")
backupfile.write(customeffects)
backupfile.close()
customeffects.close()
enable.close()
enable = open(os.path.expanduser("~/.kde3/share/config/compizasWM"),"w")
enable.write("extraeffects")
enable.close()
config = open(os.path.join(self.DATADIR,"HighEffects.ini"),"r")
dest = open(os.path.expanduser("~/.config/compiz/compizconfig/Default.ini"),"w")
dest.write(config.read())
dest.close()
config.close()
print "extraEffects enabled" #DEBUG
def enableCustomEffects(self):
code = os.system('mkdir -p ~/.config/compiz/compizconfig')
try:
config = open(os.path.expanduser("~/.config/compiz/compizconfig/Custom.ini"),"r")
except:
print "no custom effects file, creating blank .ini" #DEBUG
config = open(os.path.join(self.DATADIR,"BlankEffects.ini"),"r")
enable = open(os.path.expanduser("~/.kde3/share/config/compizasWM"),"w")
enable.write("custom")
enable.close()
dest = open(os.path.expanduser("~/.config/compiz/compizconfig/Default.ini"),"w")
dest.write(config.read())
dest.close()
config.close()

File diff suppressed because it is too large Load Diff

@ -0,0 +1,149 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright 2007-2008 Martin Böhm <martin.bohm@kubuntu.org>
# Copyright 2007-2008 Michael Anderson <nosrednaekim@gmail.com>
import sys
import os
from optparse import OptionParser
from qt import *
from kdeui import *
from kdecore import *
# for adept batch launching
import subprocess
# for compiz-kde package checking
import apt_pkg
from apt.progress import OpProgress
from DesktopEffectsDialog import DesktopEffectsDialog
from DesktopEffectsCommon import DesktopEffectsCommon
import gettext
def _(str):
return unicode(gettext.gettext(str), 'UTF-8')
def __(catalog,str):
return unicode(gettext.dgettext(catalog, str), 'UTF-8')
def utf8(str):
if isinstance(str, unicode):
return str
return unicode(str, 'UTF-8')
class DesktopEffectsKDE(DesktopEffectsDialog, DesktopEffectsCommon):
def __init__(self):
'''launches the app, draws the window '''
app = KApplication (sys.argv, "gd-test")
DesktopEffectsCommon.__init__(self)
DesktopEffectsDialog.__init__(self)
# bind the locale
localesApp="desktop-effects"
localesDir="/opt/kde3/share/locale"
gettext.bindtextdomain(localesApp, localesDir)
gettext.textdomain(localesApp)
# initialize variables
# self.action contains the action to be done after the user clicks "Apply".
# 0 - do not do anything
# 1 - disable effects
# 2 - set standard effects
# 3 - set extra effects
# 4 - keep the custom effects, or revert to the last known effects state
self.action = 0
# set the screenshot pictures
self.noEffectsImage.setPixmap(QPixmap("./data/noeffects.png"))
self.standardEffectsImage.setPixmap(QPixmap("./data/standardeffects.png"))
self.extraEffectsImage.setPixmap(QPixmap("./data/extraeffects.png"))
# set the translations & icons
# Apply
self.applyButton.setText(__("kdelibs","&Apply"))
self.applyButton.setIconSet(KGlobal.iconLoader().loadIconSet("apply",
KIcon.NoGroup, KIcon.SizeSmall))
# Close
self.cancelButton.setText(__("kdelibs","&Cancel"))
self.cancelButton.setIconSet(KGlobal.iconLoader().loadIconSet("cancel",
KIcon.NoGroup, KIcon.SizeSmall))
# check the state
self.check()
app.setMainWidget(self)
self.show()
app.exec_loop()
def check(self):
''' checks the state and changes the UI accordingly. '''
self.installed = self.checkInstalled()
self.enabled = self.checkEnabled()
if(self.installed == True):
self.installButton.setText(_("&Remove Desktop Effects"))
self.effectsGroup.setDisabled(False)
self.warningText.show()
self.warningIcon.show()
self.packageText.setText(_("The Compiz engine is installed in your system."))
self.installButton.setIconSet(KGlobal.iconLoader().loadIconSet("remove",KIcon.NoGroup,KIcon.SizeSmall))
# remove, not install
self.rm = True
else:
self.packageText.setText(_("In order for Compiz Desktop Effects to work,"
" the Compiz engine must be installed on your system."))
self.installButton.setText(_("&Install Desktop Effects"))
self.warningText.show()
self.warningIcon.show()
# install, not remove
self.rm = False
#self.effectsBox.setDisabled(True)
self.installButton.setIconSet(KGlobal.iconLoader().loadIconSet("add",KIcon.NoGroup,KIcon.SizeSmall))
def checkInstalled(self):
progress = OpProgress()
cache = apt_pkg.GetCache(progress)
for pkg in cache.Packages:
if pkg.Name == "compiz-kde-kde3":
if pkg.CurrentVer is not None:
return True
# otherwise
return False
def checkEnabled(self):
return False
def cancel(self):
''' action to be done after the user clicks the "cancel" button '''
self.close()
def apply(self):
''' action to be done after the user click the "apply button '''
# if self.action > 0:
# if self.action == 1:
# elif self.action == 2:
# elif self.action == 3:
# elif self.action == 4:
self.close()
def installButtonClicked(self):
''' Installs or removes the compiz packages. '''
if self.rm == True:
self.remove()
else:
self.install()
# check (again) if the package is installed
self.check()

@ -0,0 +1,146 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright 2007-2008 Martin Böhm <martin.bohm@kubuntu.org>
# Copyright 2007-2008 Michael Anderson <nosrednaekim@gmail.com>
import sys
import os
from optparse import OptionParser
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4.QtSvg import *
from DesktopEffectsQt4Dialog import Ui_Dialog
from DesktopEffectsCommon import DesktopEffectsCommon
import gettext
def _(str):
''' the traditional gettext function '''
return unicode(gettext.gettext(str), 'UTF-8')
def __(catalog,str):
''' selects a different catalog for the str translation;
useful when you want to use the standard KDE labels. '''
return unicode(gettext.dgettext(catalog, str), 'UTF-8')
def utf8(str):
if isinstance(str, unicode):
return str
return unicode(str, 'UTF-8')
class DesktopEffectsKDE4(DesktopEffectsCommon):
def __init__(self):
'''launches the app, draws the window '''
# needed for all Qt actions
app = QApplication (sys.argv)
# Qt4 explanations:
# self.qd is the link to the main QDialog (what you can see)
# self.ui is its UI (the UI defined in Qt-Designer
self.qd = QDialog()
self.ui = Ui_Dialog()
self.ui.setupUi(self.qd)
localesApp="desktop-effects-kde"
localesDir="/opt/kde3/share/locale"
gettext.bindtextdomain(localesApp, localesDir)
gettext.textdomain(localesApp)
# the Common class triggers some UI text settings, so we need to
# init the UI first
DesktopEffectsCommon.__init__(self)
self.radioGroup = QButtonGroup(self.qd)
self.radioGroup.setExclusive(True)
self.radioGroup.addButton(self.ui.noEffectsButton)
self.radioGroup.addButton(self.ui.stdEffectsButton)
self.radioGroup.addButton(self.ui.extraEffectsButton)
self.radioGroup.addButton(self.ui.customEffectsButton)
# connect signals and slots -- we have to do it ourselves in Qt4
QObject.connect(self.ui.installButton, SIGNAL("clicked()"), self.btnInstallClicked)
QObject.connect(self.ui.done, SIGNAL("clicked()"), self.done)
QObject.connect(self.ui.apply, SIGNAL("clicked()"), self.apply)
# connect radio buttons - methods provided by the Common class
QObject.connect(self.ui.noEffectsButton, SIGNAL("clicked()"), self.noEffects)
QObject.connect(self.ui.stdEffectsButton, SIGNAL("clicked()"), self.standardEffects)
QObject.connect(self.ui.extraEffectsButton, SIGNAL("clicked()"), self.extraEffects)
QObject.connect(self.ui.customEffectsButton, SIGNAL("clicked()"), self.customEffects)
self.ui.installButton.setText(_("Install"))
self.ui.warningText.setText(_("Desktop Effects are a great way to enjoy a modern desktop experience without transitioning to KDE4"))
self.ui.groupBox.setTitle(_("Effects Level"))
self.ui.noEffectsButton.setText(_("No Effects"))
self.ui.label_6.setText(_("All effects are disabled and KDE Window manager is used. This is the default behaviour."))
self.ui.stdEffectsButton.setText(_("Standard Effects"))
self.ui.label_12.setText(_("Some simple effects."))
self.ui.extraEffectsButton.setText(_("Extra Effects"))
self.ui.label_14.setText(_("You\'ll need sunglasses"))
self.ui.customEffectsButton.setText(_("Custom Effects"))
self.ui.label_16.setText(_("Use custom settings from another settings manager. Switching from this option to another will back up any custom settings"))
self.ui.apply.setText(_("Apply"))
self.ui.done.setText(_("Done"))
self.qd.show()
sys.exit(self.qd.exec_())
def check(self):
''' overrides the DesktopEffectsCommon.check() method, does some painting '''
DesktopEffectsCommon.check(self)
self.ui.packageText.setText(self.pText)
self.ui.installButton.setText(self.ibText)
if os.path.exists(os.path.expanduser("~/.kde3/share/config/compizasWM")):
compizasWM = open(os.path.expanduser("~/.kde3/share/config/compizasWM"))
state = compizasWM.readline()
if state == "standardeffects":
self.action = 2
self.ui.stdEffectsButton.toggle()
elif state == "extraeffects":
self.action = 3
self.ui.extraEffectsButton.toggle()
elif state == "custom":
self.action = 4
self.ui.customEffectsButton.toggle()
else:
self.action = 1
self.ui.noEffectsButton.toggle()
def apply(self):
DesktopEffectsCommon.apply(self)
if self.action == 1:
print "hi"
os.popen("kwin --replace &")
def showWarning(self):
''' shows the warning box if the package is installed '''
self.ui.warningText.show()
self.ui.warningIcon.show()
def hideWarning(self):
''' hides the warning because the package is not yet there '''
self.ui.warningText.hide()
self.ui.warningIcon.hide()
def enable(self):
''' enables the radio boxes, compiz is installed '''
self.ui.groupBox.setDisabled(False)
def disable(self):
''' disables the group box, you have to install compiz first '''
self.ui.groupBox.setDisabled(True)
def close(self):
''' triggers the QDialog to close '''
self.qd.close()

@ -0,0 +1,225 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'data/DesktopEffectsQt4Dialog.ui'
#
# Created: Wed Mar 12 21:46:04 2008
# by: PyQt4 UI code generator 4.3.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(QtCore.QSize(QtCore.QRect(0,0,744,512).size()).expandedTo(Dialog.minimumSizeHint()))
self.vboxlayout = QtGui.QVBoxLayout(Dialog)
self.vboxlayout.setObjectName("vboxlayout")
self.hboxlayout = QtGui.QHBoxLayout()
self.hboxlayout.setObjectName("hboxlayout")
spacerItem = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Minimum,QtGui.QSizePolicy.Minimum)
self.hboxlayout.addItem(spacerItem)
self.label_2 = QtGui.QLabel(Dialog)
self.label_2.setObjectName("label_2")
self.hboxlayout.addWidget(self.label_2)
self.packageText = QtGui.QLabel(Dialog)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.packageText.sizePolicy().hasHeightForWidth())
self.packageText.setSizePolicy(sizePolicy)
self.packageText.setWordWrap(True)
self.packageText.setObjectName("packageText")
self.hboxlayout.addWidget(self.packageText)
self.installButton = QtGui.QPushButton(Dialog)
self.installButton.setObjectName("installButton")
self.hboxlayout.addWidget(self.installButton)
self.vboxlayout.addLayout(self.hboxlayout)
self.hboxlayout1 = QtGui.QHBoxLayout()
self.hboxlayout1.setObjectName("hboxlayout1")
self.warningIcon = QtGui.QLabel(Dialog)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.warningIcon.sizePolicy().hasHeightForWidth())
self.warningIcon.setSizePolicy(sizePolicy)
self.warningIcon.setObjectName("warningIcon")
self.hboxlayout1.addWidget(self.warningIcon)
self.warningText = QtGui.QLabel(Dialog)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,QtGui.QSizePolicy.Maximum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.warningText.sizePolicy().hasHeightForWidth())
self.warningText.setSizePolicy(sizePolicy)
self.warningText.setWordWrap(True)
self.warningText.setObjectName("warningText")
self.hboxlayout1.addWidget(self.warningText)
self.vboxlayout.addLayout(self.hboxlayout1)
self.groupBox = QtGui.QGroupBox(Dialog)
self.groupBox.setObjectName("groupBox")
self.gridlayout = QtGui.QGridLayout(self.groupBox)
self.gridlayout.setObjectName("gridlayout")
self.hboxlayout2 = QtGui.QHBoxLayout()
self.hboxlayout2.setObjectName("hboxlayout2")
self.vboxlayout1 = QtGui.QVBoxLayout()
self.vboxlayout1.setObjectName("vboxlayout1")
self.noEffectsButton = QtGui.QRadioButton(self.groupBox)
self.noEffectsButton.setObjectName("noEffectsButton")
self.vboxlayout1.addWidget(self.noEffectsButton)
self.label_6 = QtGui.QLabel(self.groupBox)
self.label_6.setWordWrap(True)
self.label_6.setObjectName("label_6")
self.vboxlayout1.addWidget(self.label_6)
self.hboxlayout2.addLayout(self.vboxlayout1)
self.label_5 = QtGui.QLabel(self.groupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_5.sizePolicy().hasHeightForWidth())
self.label_5.setSizePolicy(sizePolicy)
self.label_5.setPixmap(QtGui.QPixmap("/usr/share/apps/desktop-effects-kde/noeffects.png"))
self.label_5.setObjectName("label_5")
self.hboxlayout2.addWidget(self.label_5)
self.gridlayout.addLayout(self.hboxlayout2,0,0,1,1)
self.hboxlayout3 = QtGui.QHBoxLayout()
self.hboxlayout3.setObjectName("hboxlayout3")
self.vboxlayout2 = QtGui.QVBoxLayout()
self.vboxlayout2.setObjectName("vboxlayout2")
self.stdEffectsButton = QtGui.QRadioButton(self.groupBox)
self.stdEffectsButton.setObjectName("stdEffectsButton")
self.vboxlayout2.addWidget(self.stdEffectsButton)
self.label_12 = QtGui.QLabel(self.groupBox)
self.label_12.setObjectName("label_12")
self.vboxlayout2.addWidget(self.label_12)
self.hboxlayout3.addLayout(self.vboxlayout2)
self.label_13 = QtGui.QLabel(self.groupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_13.sizePolicy().hasHeightForWidth())
self.label_13.setSizePolicy(sizePolicy)
self.label_13.setPixmap(QtGui.QPixmap("/usr/share/apps/desktop-effects-kde/standardeffects.png"))
self.label_13.setObjectName("label_13")
self.hboxlayout3.addWidget(self.label_13)
self.gridlayout.addLayout(self.hboxlayout3,1,0,1,1)
self.hboxlayout4 = QtGui.QHBoxLayout()
self.hboxlayout4.setObjectName("hboxlayout4")
self.vboxlayout3 = QtGui.QVBoxLayout()
self.vboxlayout3.setObjectName("vboxlayout3")
self.extraEffectsButton = QtGui.QRadioButton(self.groupBox)
self.extraEffectsButton.setObjectName("extraEffectsButton")
self.vboxlayout3.addWidget(self.extraEffectsButton)
self.label_14 = QtGui.QLabel(self.groupBox)
self.label_14.setObjectName("label_14")
self.vboxlayout3.addWidget(self.label_14)
self.hboxlayout4.addLayout(self.vboxlayout3)
self.label_15 = QtGui.QLabel(self.groupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_15.sizePolicy().hasHeightForWidth())
self.label_15.setSizePolicy(sizePolicy)
self.label_15.setPixmap(QtGui.QPixmap("/usr/share/apps/desktop-effects-kde/extraeffects.png"))
self.label_15.setObjectName("label_15")
self.hboxlayout4.addWidget(self.label_15)
self.gridlayout.addLayout(self.hboxlayout4,2,0,1,1)
self.hboxlayout5 = QtGui.QHBoxLayout()
self.hboxlayout5.setObjectName("hboxlayout5")
self.vboxlayout4 = QtGui.QVBoxLayout()
self.vboxlayout4.setObjectName("vboxlayout4")
self.customEffectsButton = QtGui.QRadioButton(self.groupBox)
self.customEffectsButton.setObjectName("customEffectsButton")
self.vboxlayout4.addWidget(self.customEffectsButton)
self.label_16 = QtGui.QLabel(self.groupBox)
self.label_16.setWordWrap(True)
self.label_16.setObjectName("label_16")
self.vboxlayout4.addWidget(self.label_16)
self.hboxlayout5.addLayout(self.vboxlayout4)
self.label_17 = QtGui.QLabel(self.groupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_17.sizePolicy().hasHeightForWidth())
self.label_17.setSizePolicy(sizePolicy)
self.label_17.setPixmap(QtGui.QPixmap("/usr/share/apps/desktop-effects-kde/extraeffects.png"))
self.label_17.setObjectName("label_17")
self.hboxlayout5.addWidget(self.label_17)
self.gridlayout.addLayout(self.hboxlayout5,3,0,1,1)
spacerItem1 = QtGui.QSpacerItem(20,40,QtGui.QSizePolicy.Minimum,QtGui.QSizePolicy.Expanding)
self.gridlayout.addItem(spacerItem1,4,0,1,1)
self.vboxlayout.addWidget(self.groupBox)
self.hboxlayout6 = QtGui.QHBoxLayout()
self.hboxlayout6.setObjectName("hboxlayout6")
spacerItem2 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum)
self.hboxlayout6.addItem(spacerItem2)
self.apply = QtGui.QPushButton(Dialog)
self.apply.setObjectName("apply")
self.hboxlayout6.addWidget(self.apply)
self.done = QtGui.QPushButton(Dialog)
self.done.setObjectName("done")
self.hboxlayout6.addWidget(self.done)
self.vboxlayout.addLayout(self.hboxlayout6)
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Compiz Desktop Effects", None, QtGui.QApplication.UnicodeUTF8))
self.packageText.setText(QtGui.QApplication.translate("Dialog", "In order for Compiz Desktop Effects to work, the Compiz engine must be installed on your system.", None, QtGui.QApplication.UnicodeUTF8))
self.installButton.setText(QtGui.QApplication.translate("Dialog", "Install", None, QtGui.QApplication.UnicodeUTF8))
self.warningText.setText(QtGui.QApplication.translate("Dialog", "Desktop Effects are a great way to enjoy a modern desktop experience without transitioning to KDE4", None, QtGui.QApplication.UnicodeUTF8))
self.groupBox.setTitle(QtGui.QApplication.translate("Dialog", "Effects Level", None, QtGui.QApplication.UnicodeUTF8))
self.noEffectsButton.setText(QtGui.QApplication.translate("Dialog", "No Effects", None, QtGui.QApplication.UnicodeUTF8))
self.label_6.setText(QtGui.QApplication.translate("Dialog", "All effects are disabled and KDE Window manager is used. This is the default behaviour.", None, QtGui.QApplication.UnicodeUTF8))
self.stdEffectsButton.setText(QtGui.QApplication.translate("Dialog", "Standard Effects", None, QtGui.QApplication.UnicodeUTF8))
self.label_12.setText(QtGui.QApplication.translate("Dialog", "Some simple effects.", None, QtGui.QApplication.UnicodeUTF8))
self.extraEffectsButton.setText(QtGui.QApplication.translate("Dialog", "Extra Effects", None, QtGui.QApplication.UnicodeUTF8))
self.label_14.setText(QtGui.QApplication.translate("Dialog", "You\'ll need sunglasses", None, QtGui.QApplication.UnicodeUTF8))
self.customEffectsButton.setText(QtGui.QApplication.translate("Dialog", "Custom Effects", None, QtGui.QApplication.UnicodeUTF8))
self.label_16.setText(QtGui.QApplication.translate("Dialog", "Use custom settings from another settings manager. Switching from this option to another will back up any custom settings", None, QtGui.QApplication.UnicodeUTF8))
self.apply.setText(QtGui.QApplication.translate("Dialog", "Apply", None, QtGui.QApplication.UnicodeUTF8))
self.done.setText(QtGui.QApplication.translate("Dialog", "Done", None, QtGui.QApplication.UnicodeUTF8))

File diff suppressed because one or more lines are too long

@ -0,0 +1,320 @@
<ui version="4.0" >
<class>Dialog</class>
<widget class="QDialog" name="Dialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>744</width>
<height>512</height>
</rect>
</property>
<property name="windowTitle" >
<string>Compiz Desktop Effects</string>
</property>
<layout class="QVBoxLayout" >
<item>
<layout class="QHBoxLayout" >
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_2" >
<property name="text" >
<string/>
</property>
<property name="pixmap" >
<pixmap/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="packageText" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>In order for Compiz Desktop Effects to work, the Compiz engine must be installed on your system.</string>
</property>
<property name="wordWrap" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="installButton" >
<property name="text" >
<string>Install</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="warningIcon" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string/>
</property>
<property name="pixmap" >
<pixmap/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="warningText" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Maximum" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Desktop Effects are a great way to enjoy a modern desktop experience without transitioning to KDE4</string>
</property>
<property name="wordWrap" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string>Effects Level</string>
</property>
<layout class="QGridLayout" >
<item row="0" column="0" >
<layout class="QHBoxLayout" >
<item>
<layout class="QVBoxLayout" >
<item>
<widget class="QRadioButton" name="noEffectsButton" >
<property name="text" >
<string>No Effects</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_6" >
<property name="text" >
<string>All effects are disabled and KDE Window manager is used. This is the default behaviour.</string>
</property>
<property name="wordWrap" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_5" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string/>
</property>
<property name="pixmap" >
<pixmap>/usr/share/apps/desktop-effects-kde/noeffects.png</pixmap>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0" >
<layout class="QHBoxLayout" >
<item>
<layout class="QVBoxLayout" >
<item>
<widget class="QRadioButton" name="stdEffectsButton" >
<property name="text" >
<string>Standard Effects</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_12" >
<property name="text" >
<string>Some simple effects.</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_13" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string/>
</property>
<property name="pixmap" >
<pixmap>/usr/share/apps/desktop-effects-kde/standardeffects.png</pixmap>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0" >
<layout class="QHBoxLayout" >
<item>
<layout class="QVBoxLayout" >
<item>
<widget class="QRadioButton" name="extraEffectsButton" >
<property name="text" >
<string>Extra Effects</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_14" >
<property name="text" >
<string>Over-the-top effects.</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_15" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string/>
</property>
<property name="pixmap" >
<pixmap>/usr/share/apps/desktop-effects-kde/extraeffects.png</pixmap>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0" >
<layout class="QHBoxLayout" >
<item>
<layout class="QVBoxLayout" >
<item>
<widget class="QRadioButton" name="customEffectsButton" >
<property name="text" >
<string>Custom Effects</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_16" >
<property name="text" >
<string>Use custom settings from another settings manager. Switching from this option to another will back up any custom settings</string>
</property>
<property name="wordWrap" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_17" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string/>
</property>
<property name="pixmap" >
<pixmap>/usr/share/apps/desktop-effects-kde/extraeffects.png</pixmap>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="apply" >
<property name="text" >
<string>Apply</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="done" >
<property name="text" >
<string>Done</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

@ -0,0 +1,24 @@
[3d]
s0_max_window_space = 4
[core]
as_active_plugins = svg;dbus;move;screenshot;showdesktop;png;regex;splash;crashhandler;place;decoration;wobbly;cube;rotate;scale;animation;switcher;cubereflex
s0_hsize = 3
[animation]
s0_close_effects = 19;9;9
s0_close_durations = 300;150;150
s0_open_effects = 19;9;9
s0_open_durations = 300;150;150
s0_minimize_options =
s0_shade_options =
s0_focus_options =
[scaleaddon]
s0_title_bold = true
s0_title_size = 18
[shift]
as_next_key = <Alt>Tab
as_prev_key = <Shift><Alt>Tab

@ -0,0 +1,18 @@
[core]
as_active_plugins = place;core;png;regex;text;move;shift;showdesktop;svg;screenshot;imgjpeg;resize;ring;decoration;expo;crashhandler;dbus;workarounds;wall;animation;scale;scaleaddon
s0_hsize = 2
s0_vsize = 2
[animation]
s0_minimize_options =
s0_shade_options =
s0_focus_options =
[scaleaddon]
s0_title_bold = true
s0_title_size = 18
[shift]
as_next_key = <Alt>Tab
as_prev_key = <Shift><Alt>Tab

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,33 @@
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""Desktop Effects for KDE
Without arguments, immediately loads the Desktop Effects Configuration
window.
"""
__copyright__ = "Copyright © 2007 Martin Böhm and the Kubuntu Team"
__author__ = "Kubuntu Team <kubuntu-devel@lists.ubuntu.com>"
import sys
sys.path.append("/opt/kde3/share/pyshared")
if sys.argv[0].endswith("kde3"):
from DesktopEffects.DesktopEffectsKDE import DesktopEffectsKDE as DesktopEffects
else:
from DesktopEffects.DesktopEffectsKDE4 import DesktopEffectsKDE4 as DesktopEffects
de = DesktopEffects()

@ -0,0 +1,10 @@
[Desktop Entry]
Encoding=UTF-8
Name=Desktop Effects
Comment=Compiz Setup
Icon=kcmkwm
Exec=desktop-effects-kde4
Terminal=false
Type=Application
OnlyShowIn=KDE
Categories=Compiz;Settings;DesktopSettings;

@ -0,0 +1,32 @@
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright 2007-2008 Martin Böhm <martin.bohm@kubuntu.org>
# Copyright 2007-2008 Michael Anderson <nosrednaekim@gmail.com>
"""Desktop Effects for KDE
Without arguments, immediately loads the Desktop Effects Configuration
window.
"""
__copyright__ = "Copyright © 2007 Martin Böhm and the Kubuntu Team"
__author__ = "Kubuntu Team <kubuntu-devel@lists.ubuntu.com>"
import sys
sys.path.append("/opt/kde3/share/pyshared")
from DesktopEffects.DesktopEffectsKDE4 import DesktopEffectsKDE4 as DesktopEffects
de = DesktopEffects()

@ -0,0 +1,101 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-04-20 20:28-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: DesktopEffects/DesktopEffectsCommon.py:73
#: DesktopEffects/DesktopEffectsKDE.py:96
msgid "&Remove Desktop Effects"
msgstr ""
#: DesktopEffects/DesktopEffectsCommon.py:76
#: DesktopEffects/DesktopEffectsKDE.py:100
msgid "The Compiz engine is installed in your system."
msgstr ""
#: DesktopEffects/DesktopEffectsCommon.py:80
#: DesktopEffects/DesktopEffectsKDE.py:105
msgid ""
"In order for Compiz Desktop Effects to work, the Compiz engine must be "
"installed on your system."
msgstr ""
#: DesktopEffects/DesktopEffectsCommon.py:82
#: DesktopEffects/DesktopEffectsKDE.py:107
msgid "&Install Desktop Effects"
msgstr ""
#: DesktopEffects/DesktopEffectsKDE4.py:84
msgid "Compiz Desktop Effects"
msgstr ""
#: DesktopEffects/DesktopEffectsKDE4.py:85
msgid "Install"
msgstr ""
#: DesktopEffects/DesktopEffectsKDE4.py:86
msgid ""
"Desktop Effects are an experimental feature of Kubuntu and are not "
"officially supported."
msgstr ""
#: DesktopEffects/DesktopEffectsKDE4.py:87
msgid "Effects Level"
msgstr ""
#: DesktopEffects/DesktopEffectsKDE4.py:88
msgid "No Effects"
msgstr ""
#: DesktopEffects/DesktopEffectsKDE4.py:89
msgid ""
"All effects are disabled and KDE Window manager is used. This is the default "
"behaviour."
msgstr ""
#: DesktopEffects/DesktopEffectsKDE4.py:90
msgid "Standard Effects"
msgstr ""
#: DesktopEffects/DesktopEffectsKDE4.py:91
msgid "Some simple effects."
msgstr ""
#: DesktopEffects/DesktopEffectsKDE4.py:92
msgid "Extra Effects"
msgstr ""
#: DesktopEffects/DesktopEffectsKDE4.py:93
msgid "You'll need sunglasses"
msgstr ""
#: DesktopEffects/DesktopEffectsKDE4.py:94
msgid "Custom Effects"
msgstr ""
#: DesktopEffects/DesktopEffectsKDE4.py:95
msgid ""
"Use custom settings from another settings manager. Switching from this "
"option to another will back up any custom settings"
msgstr ""
#: DesktopEffects/DesktopEffectsKDE4.py:96
msgid "Apply"
msgstr ""
#: DesktopEffects/DesktopEffectsKDE4.py:97
msgid "Done"
msgstr ""

@ -0,0 +1,56 @@
# setup.py file for desktop-effects-kde
# by the Kubuntu Team, inspired by the Restricted Manager setup file
# -*- coding: utf-8 -*-
from distutils.core import setup, Extension
from distutils.command.clean import clean
from distutils.dir_util import remove_tree
import subprocess, glob, os.path, shutil
# for kcm modules building
import kdedistutils
mo_files = []
# HACK: make sure that the mo files are generated and up-to-date
#subprocess.call(["make", "-C", "po", "build-mo"])
for filepath in glob.glob("po/mo/*/LC_MESSAGES/*.mo"):
lang = filepath[len("po/mo/"):]
targetpath = os.path.dirname(os.path.join("share/locale",lang))
mo_files.append((targetpath, [filepath]))
# build .py files from the .ui files.
for file in glob.glob("data/*.ui"):
subprocess.call(["kdepyuic", file])
shutil.move(file[5:-3]+".py","./")
# patch desktopeffectsdialog.py for kcm-specific fixes
subprocess.call(["patch", "-p1", "-i" "data/kcm-fix.patch"])
class RMClean(clean):
''' cleans up the hacks above, mostly '''
def run(self):
clean.run(self)
if os.path.exists('build/'):
remove_tree('build/')
generated_files = ['applications/kde/kcm_restricted-manager.cpp' , 'RestrictedManager/ManagerWindowKDE.py',
'RestrictedManager/FwHandlerBcm.py', 'RestrictedManager/FwHandlerProgress.py']
for file in generated_files:
if os.path.exists(file):
os.remove(file)
kdedistutils.setup(
name="desktop-effects-kde",
author="Martin Böhm",
author_email="martin.bohm@kubuntu.org",
maintainer="Kubuntu Team",
maintainer_email="kubuntu-devel@lists.ubuntu.com",
url="http://www.kubuntu.org",
license="gpl",
description="enable and configure Compiz effects in KDE",
packages=["DesktopEffects/"],
data_files=[("share/desktop-effects", glob.glob("data/*.png")),
("share/applications/kde", glob.glob("applications/kde/*.desktop"))
],
scripts=["desktop-effects-kde"],
kcontrol_modules = [ ('applications/kde/desktop-effects-kde.desktop.in', 'DesktopEffectsKDE')],
cmdclass = { 'clean' : RMClean }
)
Loading…
Cancel
Save