summaryrefslogtreecommitdiffstats
path: root/app_templates/kcontrol_module/src
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-03-01 18:16:46 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-03-01 18:16:46 +0000
commita7af74e75730559f7f9661e449eb269e356d9907 (patch)
tree72026b40b3a513aa21d630fb09ae10edab7f9e18 /app_templates/kcontrol_module/src
downloadpytdeextensions-a7af74e75730559f7f9661e449eb269e356d9907.tar.gz
pytdeextensions-a7af74e75730559f7f9661e449eb269e356d9907.zip
Added KDE3 version of pykdeextensions
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/libraries/pykdeextensions@1097589 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'app_templates/kcontrol_module/src')
-rw-r--r--app_templates/kcontrol_module/src/KcontrolModuleWidgetUI.ui33
-rw-r--r--app_templates/kcontrol_module/src/hi16-app-kcontrol_module.png8
-rw-r--r--app_templates/kcontrol_module/src/hi32-app-kcontrol_module.png26
-rw-r--r--app_templates/kcontrol_module/src/kcontrol_module.desktop15
-rw-r--r--app_templates/kcontrol_module/src/kcontrol_module.lsm16
-rwxr-xr-xapp_templates/kcontrol_module/src/kcontrol_module.py166
6 files changed, 264 insertions, 0 deletions
diff --git a/app_templates/kcontrol_module/src/KcontrolModuleWidgetUI.ui b/app_templates/kcontrol_module/src/KcontrolModuleWidgetUI.ui
new file mode 100644
index 0000000..4ff94d7
--- /dev/null
+++ b/app_templates/kcontrol_module/src/KcontrolModuleWidgetUI.ui
@@ -0,0 +1,33 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KcontrolModuleWidgetUI</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KcontrolModuleWidgetUI</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Form1</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Congratulations, Kcontrol_module template application is working!</string>
+ </property>
+ </widget>
+ </hbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/app_templates/kcontrol_module/src/hi16-app-kcontrol_module.png b/app_templates/kcontrol_module/src/hi16-app-kcontrol_module.png
new file mode 100644
index 0000000..40fe05e
--- /dev/null
+++ b/app_templates/kcontrol_module/src/hi16-app-kcontrol_module.png
@@ -0,0 +1,8 @@
+PNG
+
+
+IHDR
+5 MZfθ92@
+2wlA;vc)\)/l F\ϓ~SXŦ=tj76{rumu_% }fb{ZRdY7C2TWՓӲO>fXGȵ,F&/#x<&P%]EܖCf US
+"l+*JǰMJde9Hz]qTPBI
+}Q bR ]nvbf,û:Ld4PuC7AK \^ϟ=.~|َ2w|xwNVd/RK6+ɤĦ7fmc5 hr96MD#x=IaނOHxc7=# UDoVi
diff --git a/app_templates/kcontrol_module/src/hi32-app-kcontrol_module.png b/app_templates/kcontrol_module/src/hi32-app-kcontrol_module.png
new file mode 100644
index 0000000..8a6093e
--- /dev/null
+++ b/app_templates/kcontrol_module/src/hi32-app-kcontrol_module.png
@@ -0,0 +1,26 @@
+PNG
+
+
+IHDR
+:IDATx{\}?wy;;}`k̲~&qR- HGpk
+PPJ&(
+JEQ4Iq QDHC~D6Bص׮ٵ̝ٝ;;?f1 i{+]}k_åòBe,ˢ3֖6Tض3'``Iem=}j^wO<wYkV_˺x,M?.x!cČl8voZ;ퟙ<rV͌O>\OzU#fha7YI5r엇@[
+>u;joQk╳?ڕkq
+-t/E(tB 06 se_?u7сQ3r)%H+B
+֎6CHWRШ7ؾk33M_<dzGfXbq@YӷƬ\o֭Z8B!</MP Xi-zJA(AHHGD\fcTJekV a lYk/r
+:.bX,[ws yh)
+ta# H㶸>g~So
+/Y58ȗ$iTJjA
+50>
+ntMt?gj|#O=]d۶ȕr(߱z'N̐)E
+<ABP0[,fTR Va# _y3z&˛KgAPTBcpno&+NIfS9~*K˒ҌMQ(MͲSFHA(dDjmB`aﭷfhz
+c ӳ
+PJ8^*K.
+OP >(--H, $Rj9 '$z1C/;8 >|p-ZfRYx?%7!%c+EĪѡmmb#I3x AB3vnF4qvSuBBIT
+G)^s~*G&b~.N46ǩ3HH_lϻ%:ґm-dbi\
+YTR~
+3`ʮ
+xS(W˖eY,8a{Qnf*0%I]
+Uܲ!Eg(6-:.JJTEZ ^:E$rbjqK*"͖L\
+i#hh-ƖM[rήGk eTNrbH6ʼn/? he3ZBTl*J6])X ?C{GZGQLT!ʒMdDS/YC^]M[?~/E,T(B\oղ,g}<| h0[,_ H'<ٸG*5WfIZXym/%uMTk5XaEk dpOe+($gb\8/
+l!0ZW'^],BwؼzF%9-+ڮhΧ,bl\l4f7
diff --git a/app_templates/kcontrol_module/src/kcontrol_module.desktop b/app_templates/kcontrol_module/src/kcontrol_module.desktop
new file mode 100644
index 0000000..f0381c5
--- /dev/null
+++ b/app_templates/kcontrol_module/src/kcontrol_module.desktop
@@ -0,0 +1,15 @@
+[Desktop Entry]
+Name=Kcontrol module
+Name[en]=Kcontrol module
+name[en_GB]=Kcontrol module
+Comment=Kcontrol module template
+Comment[en]=Kcontrol module template
+Comment[en_GB]=Kcontrol module template
+Icon=daemons.png
+X-KDE-ModuleType=Library
+X-KDE-Library=kcontrol_module
+X-KDE-FactoryName=kcontrol_module
+X-KDE-RootOnly=false
+Type=Application
+Exec=kcmshell kcontrol_module
+Categories=QT;KDE;X-KDE-settings-system;
diff --git a/app_templates/kcontrol_module/src/kcontrol_module.lsm b/app_templates/kcontrol_module/src/kcontrol_module.lsm
new file mode 100644
index 0000000..43d0d5f
--- /dev/null
+++ b/app_templates/kcontrol_module/src/kcontrol_module.lsm
@@ -0,0 +1,16 @@
+Begin3
+Title: $APPNAME$ -- Some description
+Version: $VERSION$
+Entered-date:
+Description:
+Keywords: KDE Qt
+Author: $AUTHOR$ <$EMAIL$>
+Maintained-by: $AUTHOR$ <$EMAIL$>
+Home-page:
+Alternate-site:
+Primary-site: ftp://ftp.kde.org/pub/kde/unstable/apps/utils
+ xxxxxx $APPNAMELC$-$VERSION$.tar.gz
+ xxx $APPNAMELC$-$VERSION$.lsm
+Platform: Linux. Needs KDE
+Copying-policy: $LICENSE$
+End
diff --git a/app_templates/kcontrol_module/src/kcontrol_module.py b/app_templates/kcontrol_module/src/kcontrol_module.py
new file mode 100755
index 0000000..b435287
--- /dev/null
+++ b/app_templates/kcontrol_module/src/kcontrol_module.py
@@ -0,0 +1,166 @@
+#!/usr/bin/python
+###########################################################################
+# kcontrol_module - description #
+# ------------------------------ #
+# begin : Mon May 2 2005 #
+# copyright : (C) 2005 by AUTHOR #
+# email : your@email.com #
+# #
+###########################################################################
+# #
+# 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. #
+# #
+###########################################################################
+
+import sys
+from qt import *
+from kdecore import *
+from kdeui import *
+
+import kdedesigner
+from KcontrolModuleWidgetUI import *
+
+description = "A Kcontrol module"
+version = "0.1"
+
+############################################################################
+def AboutData():
+ global version,description
+
+ about_data = KAboutData("kcontrol_module", "kcontrol_module", version, \
+ description, KAboutData.License_GPL, "(C) 2005 AUTHOR", None, None,\
+ "your@email.com")
+ about_data.addAuthor("AUTHOR", None, "your@email.com")
+ return about_data
+
+############################################################################
+class KcontrolModuleWidget(KcontrolModuleWidgetUI):
+ def __init__(self,parent=None):
+ KcontrolModuleWidgetUI.__init__(self,parent,"Kcontrol module")
+ # Add other methods, slots and signals here.
+
+############################################################################
+# The base class that we use depends on whether this is running inside
+# kcontrol or as a standalone application.
+# Are we running as a separate standalone application or in KControl?
+standalone = __name__=='__main__'
+
+if standalone:
+ programbase = KDialogBase
+else:
+ programbase = KCModule
+
+class KcontrolModuleApp(programbase):
+ ########################################################################
+ def __init__(self,parent=None,name=None):
+ global standalone
+ if standalone:
+ KDialogBase.__init__(self,KJanusWidget.Plain,"Kcontrol module",KDialogBase.User1|KDialogBase.Close, KDialogBase.Close)
+ self.setButtonText(KDialogBase.User1,"About")
+ else:
+ KCModule.__init__(self,parent,name)
+ # Create a configuration object.
+ self.config = KConfig("kcontrol_module")
+ self.setButtons(0)
+ self.aboutdata = AboutData()
+
+ # The appdir needs to be explicitly otherwise we won't be able to
+ # load our icons and images.
+ KGlobal.iconLoader().addAppDir("kcontrol_module")
+
+ if standalone:
+ toplayout = QVBoxLayout( self.plainPage(), 0, KDialog.spacingHint() )
+ mainwidget = KcontrolModuleWidget(self.plainPage())
+ else:
+ toplayout = QVBoxLayout( self, 0, KDialog.spacingHint() )
+ mainwidget = KcontrolModuleWidget(self)
+
+ toplayout.addWidget(mainwidget)
+
+ self.aboutus = KAboutApplication(self)
+
+ ########################################################################
+ def __del__(self):
+ pass
+
+ ########################################################################
+ # KDialogBase method
+ def exec_loop(self):
+ global programbase
+
+ # Load configuration here
+ self.__loadOptions()
+
+ programbase.exec_loop(self)
+
+ # Save configuration here
+ self.__saveOptions()
+
+ ########################################################################
+ # KDialogBase method
+ def slotUser1(self):
+ self.aboutus.show()
+
+ ########################################################################
+ def slotCloseButton(self):
+ self.close()
+
+ ########################################################################
+ def __loadOptions(self):
+ global kapp
+ config = kapp.config()
+ config.setGroup("General")
+ size = config.readSizeEntry("Geometry")
+ if size.isEmpty()==False:
+ self.resize(size)
+
+ #######################################################################
+ def __saveOptions(self):
+ global kapp
+ config = kapp.config()
+ config.setGroup("General")
+ config.writeEntry("Geometry", self.size())
+ config.sync()
+
+ #######################################################################
+ # KControl virtual void methods
+ def load(self):
+ pass
+ def save(self):
+ pass
+ def defaults(self):
+ pass
+ def sysdefaults(self):
+ pass
+
+ def aboutData(self):
+ # Return the KAboutData object which we created during initialisation.
+ return self.aboutdata
+
+ def buttons(self):
+ # Only supply a Help button. Other choices are Default and Apply.
+ return KCModule.Help
+
+############################################################################
+# This is the entry point used when running this module outside of kcontrol.
+def main():
+ global kapp
+ about_data = AboutData()
+ KCmdLineArgs.init(sys.argv,about_data)
+ kapp = KApplication()
+ myapp = KcontrolModuleApp()
+ myapp.exec_loop()
+
+############################################################################
+# Factory function for KControl
+def create_kcontrol_module(parent,name):
+ global kapp
+ kapp = KApplication.kApplication()
+ return KcontrolModuleApp(parent, name)
+
+############################################################################
+if standalone:
+ main()