diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-03-01 18:16:46 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-03-01 18:16:46 +0000 |
commit | a7af74e75730559f7f9661e449eb269e356d9907 (patch) | |
tree | 72026b40b3a513aa21d630fb09ae10edab7f9e18 /app_templates/kcontrol_module/src | |
download | pytdeextensions-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')
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�M�Z��fθ92@� +��2w�l�A;�v�c)�\)��/l F�\��ϓ���~��S���X�Ŧ�=t�j�76��{rumu��_��% ��}�f�b{�Z��RdY�7�C2�TWՓ�Ӳ��O>�f�X�G�ȵ��,F�&/#�x<��&P��%]E��ܖC�fU��S���� +"�l+�*���J�ǰ�M��Jde���9Hz�]�qT�P�B�I�� +��}���Q����� �bR��������� �]�nv��bf,�û����:�L�d�4��PuC����7��AK�\��^�ϟ=.~�����|َ2�w��|x��w��N�Vd/RK��6���+����ɤ�����Ħ�7fmc�5�hr�96�M�D#x�=Ia�ނOHxc�7=# �U�D��oV�i 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���{�\�}�?w�y�;;���}`�����k̲~&�q�R�-H��Gpk +PPJ�&( +�J��EQ���4Iq QDHC~D6��Bص�ٵٝ��̝�;�;��?f�1� i{���+]������}��k��_åòB��e,ˢ3��֖6�Tض�3'�``��Ie�m=����������}�j���^�w��O<w�Y��kV_�˺�x�,��M��?�.���x!��c�Č�l�8����v��oZ�������;ퟙ<��r�V���͌O���>���\O����z��U#fh�a7��Y��I5�r엇�������@�[ +>�u;�j����o���Qk╳�?���ڕkq� +��-��t/�E(�tB ��06�se_���������?���u����7���сQ3�r)%�H+B +��֎6���CHW��RШ7ؾk33��M���_<dzGf�X�bq���@�YӷƬ\o֭Z��8�B!</MP X�i-�z�J�����A(AH�HG�D\�fcTJe��kV�a� l��Yk�/�r�� +�:.��b��X,�[w�s� � �yh�) +�t�������a#� �H㶸��>g�~�So +�/�Y58ȗ���$�i������TJjA +�5���0�> +n���t�Mt?���gj|�#O=�]���d۶ȕr(���߱��z'N���̐��)�E +�<A�BP�0��[,��f���T�R �Va#� �����_y����3z�&˛K��gAP�T�Bcp��n�o�&��+���N�If�S9�~*K�˒�ҌM�Q(�MͲ�����S�FHA(d��Dj�m�B`�aﭷ������fh��z��� +cӳ +PJ��8^*K.����� +�OP �>���(�--H��,�$�R�j9 ���'�$�����z��1�C/���;8��>�|p�-�����Z��f�RY�x?�%7�!���%���c+EĪѡ�m�mb��#I��3x� A�B��3vn�F��4����qv���S�����u�B��BI�T +G)�^s�~*G&�b~.N46ǩ3�H����H���_lϻ%�:ґ�m-dbi\�� +YT�R~ +�3�`��ʮ +��x�S�(W˖eY��,8��a{�Qn���f�*�0%�����I��] +�U�ܲ!�Eg�(6-���:.JJ�T�EZ ��^:E$�r��b�j�q�K*�"��͖L\ +i#�h��h-�ƖM[���rή�Gk� e���TN�r�b�H6�ʼn��/���? h�e3�����Z���B��T�l��*J6�])���X?��C{G�ZG�Q���L�T!�ʒMd�DS�/Y��C�^�]M[?~�������/�E,��T(�B�\�o���ղ,����g}�<�| �h0��[,_�� H'<�ٸG*��5W�fI������ZX�y������m��/��%�u�MTk5�X�a�Ek����d��p���O������e�+(�$gb���\8���/� +���l!0��Z�W'^]�,���B�wؼz�F��%����9-��+ڮ��h�Χ�,�����b�����l�\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 : [email protected] # +# # +########################################################################### +# # +# 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,\ + "[email protected]") + about_data.addAuthor("AUTHOR", None, "[email protected]") + 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() |