Update after renaming qt => tqt in PyTQt module.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/7/head
Slávek Banko 2 years ago
parent 2d380395d2
commit e55e706f31
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -23,7 +23,7 @@ tdedistutils.setup(name="kcontrol_module",
author_email="YOUR@EMAIL.com", author_email="YOUR@EMAIL.com",
url="http://www.TESTAPP.com/", url="http://www.TESTAPP.com/",
min_kde_version = "3.0.0", min_kde_version = "3.0.0",
min_qt_version = "3.0.0", min_tqt_version = "3.0.0",
license = "GPL", license = "GPL",
application_data = ['src/kcontrol_module.py','src/KcontrolModuleWidgetUI.ui'], application_data = ['src/kcontrol_module.py','src/KcontrolModuleWidgetUI.ui'],
executable_links = [('kcontrol_module','kcontrol_module.py')], executable_links = [('kcontrol_module','kcontrol_module.py')],

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>KcontrolModuleWidgetUI</class> <class>KcontrolModuleWidgetUI</class>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>KcontrolModuleWidgetUI</cstring> <cstring>KcontrolModuleWidgetUI</cstring>
</property> </property>
@ -19,7 +19,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>textLabel1</cstring> <cstring>textLabel1</cstring>
</property> </property>

@ -16,7 +16,7 @@
########################################################################### ###########################################################################
import sys import sys
from PyTQt.qt import * from PyTQt.tqt import *
from tdecore import * from tdecore import *
from tdeui import * from tdeui import *
@ -72,10 +72,10 @@ class KcontrolModuleApp(programbase):
TDEGlobal.iconLoader().addAppDir("kcontrol_module") TDEGlobal.iconLoader().addAppDir("kcontrol_module")
if standalone: if standalone:
toplayout = QVBoxLayout( self.plainPage(), 0, KDialog.spacingHint() ) toplayout = TQVBoxLayout( self.plainPage(), 0, KDialog.spacingHint() )
mainwidget = KcontrolModuleWidget(self.plainPage()) mainwidget = KcontrolModuleWidget(self.plainPage())
else: else:
toplayout = QVBoxLayout( self, 0, KDialog.spacingHint() ) toplayout = TQVBoxLayout( self, 0, KDialog.spacingHint() )
mainwidget = KcontrolModuleWidget(self) mainwidget = KcontrolModuleWidget(self)
toplayout.addWidget(mainwidget) toplayout.addWidget(mainwidget)

@ -23,7 +23,7 @@ tdedistutils.setup(name="kdeapp",
author_email="YOUR@EMAIL.com", author_email="YOUR@EMAIL.com",
url="http://www.KDEAPP.com/", url="http://www.KDEAPP.com/",
min_kde_version = "3.0.0", min_kde_version = "3.0.0",
min_qt_version = "3.0.0", min_tqt_version = "3.0.0",
license = "GPL", license = "GPL",
application_data = ['src/kdeapp.py','src/prefdialog.py','src/kdeappview.py'], application_data = ['src/kdeapp.py','src/prefdialog.py','src/kdeappview.py'],
executable_links = [('kdeapp','kdeapp.py')], executable_links = [('kdeapp','kdeapp.py')],

@ -15,7 +15,7 @@
# # # #
########################################################################### ###########################################################################
from PyTQt.qt import * from PyTQt.tqt import *
from tdecore import * from tdecore import *
from tdeui import * from tdeui import *
import sys import sys
@ -55,7 +55,7 @@ class KdeApp(TDEMainWindow):
self.connect(self._view, PYSIGNAL("signalChangeCaption"), self.changeCaption) self.connect(self._view, PYSIGNAL("signalChangeCaption"), self.changeCaption)
def load(self,url): def load(self,url):
target = QString() target = TQString()
# the below code is what you should normally do. in this # the below code is what you should normally do. in this
# example case, we want the url to our own. you probably # example case, we want the url to our own. you probably
# want to use this code instead for your app # want to use this code instead for your app
@ -124,7 +124,7 @@ class KdeApp(TDEMainWindow):
def dropEvent(self,event): def dropEvent(self,event):
# this is a very simplistic implementation of a drop event. we # this is a very simplistic implementation of a drop event. we
# will only accept a dropped URL. the Qt dnd code can do *much* # will only accept a dropped URL. the TQt dnd code can do *much*
# much more, so please read the docs there # much more, so please read the docs there
urls = KURL.List() urls = KURL.List()
@ -150,7 +150,7 @@ class KdeApp(TDEMainWindow):
# button is clicked # button is clicked
## this brings up the generic open dialog ## this brings up the generic open dialog
#KURL url = KURLRequesterDlg::getURL(QString::null, this, i18n("Open Location") ); #KURL url = KURLRequesterDlg::getURL(TQString::null, this, i18n("Open Location") );
# standard filedialog # standard filedialog
url = KFileDialog.getOpenURL(None, One, self, i18n("Open Location")) url = KFileDialog.getOpenURL(None, One, self, i18n("Open Location"))
@ -181,14 +181,14 @@ class KdeApp(TDEMainWindow):
self._printer = KPrinter() self._printer = KPrinter()
if self._printer.setup(self): if self._printer.setup(self):
# setup the printer. with Qt, you always "print" to a # setup the printer. with TQt, you always "print" to a
# QPainter.. whether the output medium is a pixmap, a screen, # TQPainter.. whether the output medium is a pixmap, a screen,
# or paper # or paper
p = QPainter() p = TQPainter()
p.begin(self._printer) p.begin(self._printer)
# we let our view do the actual printing # we let our view do the actual printing
metrics = QPaintDeviceMetrics(m_printer) metrics = TQPaintDeviceMetrics(m_printer)
self._view.print_(p, metrics.height(), metrics.width()) self._view.print_(p, metrics.height(), metrics.width())
# and send the result to the printer # and send the result to the printer

@ -20,7 +20,7 @@ from dcopexport import DCOPExObj
class TestAppIface(DCOPExObj): class TestAppIface(DCOPExObj):
def __init__(self, parent, id="Value"): def __init__(self, parent, id="Value"):
DCOPExObj.__init__(self, id) DCOPExObj.__init__(self, id)
self.addMethod("void openURL(QString url)", self.openURL) self.addMethod("void openURL(TQString url)", self.openURL)
def openURL(self,url): def openURL(self,url):
pass pass

@ -15,7 +15,7 @@
# # # #
########################################################################### ###########################################################################
from PyTQt.qt import * from PyTQt.tqt import *
from tdecore import * from tdecore import *
from tdeui import * from tdeui import *
from tdeio import * from tdeio import *
@ -23,13 +23,13 @@ from tdehtml import *
from tdeparts import * from tdeparts import *
#from kdeappiface import * #from kdeappiface import *
class KdeAppView(QWidget): class KdeAppView(TQWidget):
def __init__(self,parent): def __init__(self,parent):
QWidget.__init__(self,parent) TQWidget.__init__(self,parent)
#self._dcopclient= KdeAppIface(self,"KdeAppIface") #self._dcopclient= KdeAppIface(self,"KdeAppIface")
# setup our layout manager to automatically add our widgets # setup our layout manager to automatically add our widgets
top_layout = QHBoxLayout(self) top_layout = TQHBoxLayout(self)
top_layout.setAutoAdd(True) top_layout.setAutoAdd(True)
if True: if True:
@ -58,7 +58,7 @@ class KdeAppView(QWidget):
# we now know that our offer can handle HTML and is a part. # we now know that our offer can handle HTML and is a part.
# since it is a part, it must also have a library... let's try to # since it is a part, it must also have a library... let's try to
# load that now # load that now
self._html = createReadOnlyPart(ptr.library(),self,ptr.name(),"KParts::ReadOnlyPart",QStringList()) self._html = createReadOnlyPart(ptr.library(),self,ptr.name(),"KParts::ReadOnlyPart", TQStringList())
if self._html is not None: if self._html is not None:
break break
@ -68,8 +68,8 @@ class KdeAppView(QWidget):
KMessageBox.error(self, i18n("Could not find a suitable HTML component")) KMessageBox.error(self, i18n("Could not find a suitable HTML component"))
return return
QObject.connect(self._html, SIGNAL("setWindowCaption(const QString&)"), self.slotSetTitle) TQObject.connect(self._html, SIGNAL("setWindowCaption(const TQString&)"), self.slotSetTitle)
QObject.connect(self._html, SIGNAL("setStatusBarText(const QString&)"), self.slotOnURL) TQObject.connect(self._html, SIGNAL("setStatusBarText(const TQString&)"), self.slotOnURL)
def print_(self,p,height,width): def print_(self,p,height,width):
pass pass
@ -80,7 +80,7 @@ class KdeAppView(QWidget):
return self._html.url().url() return self._html.url().url()
def openURL(self,url): def openURL(self,url):
if isinstance(url,QString): if isinstance(url,TQString):
url = KURL(url) url = KURL(url)
self._html.openURL(url) self._html.openURL(url)

@ -15,7 +15,7 @@
# # # #
########################################################################### ###########################################################################
from PyTQt.qt import * from PyTQt.tqt import *
from tdecore import * from tdecore import *
from tdeui import * from tdeui import *
@ -33,21 +33,21 @@ class TestAppPrefDialog(KDialogBase):
frame = self.addPage(i18n("Second Page"), i18n("Page Two Options")) frame = self.addPage(i18n("Second Page"), i18n("Page Two Options"))
self._pageTwo = TestAppPrefPageTwo(frame) self._pageTwo = TestAppPrefPageTwo(frame)
class TestAppPrefPageOne(QFrame): class TestAppPrefPageOne(TQFrame):
def __init__(self,parent): def __init__(self,parent):
QFrame.__init__(self,parent) TQFrame.__init__(self,parent)
layout = QHBoxLayout(self) layout = TQHBoxLayout(self)
layout.setAutoAdd(True) layout.setAutoAdd(True)
QLabel(i18n("Add something here"), self) TQLabel(i18n("Add something here"), self)
class TestAppPrefPageTwo(QFrame): class TestAppPrefPageTwo(TQFrame):
def __init__(self,parent): def __init__(self,parent):
QFrame.__init__(self,parent) TQFrame.__init__(self,parent)
layout = QHBoxLayout(self) layout = TQHBoxLayout(self)
layout.setAutoAdd(True) layout.setAutoAdd(True)
QLabel(i18n("Add something here"), self) TQLabel(i18n("Add something here"), self)

@ -23,7 +23,7 @@ tdedistutils.setup(name="kdeutility",
author_email="YOUR@EMAIL.com", author_email="YOUR@EMAIL.com",
url="http://www.TESTAPP.com/", url="http://www.TESTAPP.com/",
min_kde_version = "3.0.0", min_kde_version = "3.0.0",
min_qt_version = "3.0.0", min_tqt_version = "3.0.0",
license = "GPL", license = "GPL",
application_data = ['src/kdeutility.py','src/KDEUtilityDialogUI.ui'], application_data = ['src/kdeutility.py','src/KDEUtilityDialogUI.ui'],
executable_links = [('kdeutility','kdeutility.py')], executable_links = [('kdeutility','kdeutility.py')],

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>KDEUtilityDialogUI</class> <class>KDEUtilityDialogUI</class>
<widget class="QDialog"> <widget class="TQDialog">
<property name="name"> <property name="name">
<cstring>KDEUtilityDialogUI</cstring> <cstring>KDEUtilityDialogUI</cstring>
</property> </property>
@ -19,7 +19,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QPushButton"> <widget class="TQPushButton">
<property name="name"> <property name="name">
<cstring>hellobutton</cstring> <cstring>hellobutton</cstring>
</property> </property>

@ -16,7 +16,7 @@
########################################################################### ###########################################################################
import sys import sys
from PyTQt.qt import * from PyTQt.tqt import *
from tdecore import * from tdecore import *
from tdeui import * from tdeui import *
import tdedesigner import tdedesigner

@ -23,7 +23,7 @@ tdedistutils.setup(name="tdeioslave",
author_email="YOUR@EMAIL.com", author_email="YOUR@EMAIL.com",
url="http://www.TESTAPP.com/", url="http://www.TESTAPP.com/",
min_kde_version = "3.0.0", min_kde_version = "3.0.0",
min_qt_version = "3.0.0", min_tqt_version = "3.0.0",
license = "GPL", license = "GPL",
application_data = ['src/tdeioslave.py'], application_data = ['src/tdeioslave.py'],
docbooks = [ ('doc/en','en') ], docbooks = [ ('doc/en','en') ],

@ -15,8 +15,8 @@
# # # #
########################################################################### ###########################################################################
# Import the required Qt and KDE modules. # Import the required TQt and KDE modules.
from PyTQt.qt import * from PyTQt.tqt import *
from tdeio import * from tdeio import *
from tdecore import * from tdecore import *
import os, time import os, time
@ -102,10 +102,10 @@ class SlaveClass(TDEIO.SlaveBase):
self.error(TDEIO.ERR_IS_DIRECTORY, path) self.error(TDEIO.ERR_IS_DIRECTORY, path)
self.totalSize(len(item.getData())) self.totalSize(len(item.getData()))
self.data(QByteArray(item.getData())) self.data(TQByteArray(item.getData()))
# The end of the data string. # The end of the data string.
self.data(QByteArray()) self.data(TQByteArray())
self.finished() self.finished()
@ -132,7 +132,7 @@ class SlaveClass(TDEIO.SlaveBase):
parent_dir.unlink(filename) parent_dir.unlink(filename)
# Read data from the application. # Read data from the application.
bytearray = QByteArray() bytearray = TQByteArray()
bytes = 0 bytes = 0
data = "" data = ""

@ -144,12 +144,12 @@ tdedistutils.setup(name="pytdeextensions",
author_email="simon@simonzone.com", author_email="simon@simonzone.com",
url="http://www.simonzone.com/software/pykdeextensions/", url="http://www.simonzone.com/software/pykdeextensions/",
min_kde_version = "3.0.0", min_kde_version = "3.0.0",
min_qt_version = "3.0.0", min_tqt_version = "3.0.0",
license = "LGPL" ) license = "LGPL" )
</programlisting> </programlisting>
<symbol>min_kde_version</symbol> and <symbol>min_qt_version</symbol> specify <symbol>min_kde_version</symbol> and <symbol>min_tqt_version</symbol> specify
the minimum versions of the Qt library and TDE needed to install and run the minimum versions of the TQt library and TDE needed to install and run
the software. These requirements are checked during install. the software. These requirements are checked during install.
</para> </para>
@ -260,9 +260,9 @@ during install.
</chapter> </chapter>
<!-- Qt-designer --> <!-- TQt-designer -->
<chapter id="using-tqtdesigner"> <chapter id="using-tqtdesigner">
<title>Run-time integration with Qt-Designer</title> <title>Run-time integration with TQt-Designer</title>
<para> <para>
Qt-Designer is a graphical application used for designing user interfaces. Qt-Designer is a graphical application used for designing user interfaces.
It creates <literal role="extension">.ui</literal> files. These files need It creates <literal role="extension">.ui</literal> files. These files need
@ -271,7 +271,7 @@ application. This can be manually done using the <command>pyuic</command>
command from the shell. But it is a lot more convenient to let &appname; command from the shell. But it is a lot more convenient to let &appname;
to this automatically for you. All you need to do is import the to this automatically for you. All you need to do is import the
<symbol>tqtdesigner</symbol> or <symbol>tdedesigner</symbol> module, depending <symbol>tqtdesigner</symbol> or <symbol>tdedesigner</symbol> module, depending
on whether your application is pure Qt or uses TDE, and then you can import on whether your application is pure TQt or uses TDE, and then you can import
your user interface files as though they were normal Python files. your user interface files as though they were normal Python files.
<programlisting> <programlisting>
@ -281,7 +281,7 @@ from tdeui import *
import tdedesigner # This module lets us import .ui file directly. import tdedesigner # This module lets us import .ui file directly.
from MyWindow import * # Loads MyWindow.ui from MyWindow import * # Loads MyWindow.ui
# Subclass the Qt-designer form. # Subclass the TQt-designer form.
class MyWindowCode(MyWindow): class MyWindowCode(MyWindow):
# Implement extra functionality and methods. # Implement extra functionality and methods.
</programlisting> </programlisting>
@ -554,7 +554,7 @@ described below.
<title>Simple TDE utility template</title> <title>Simple TDE utility template</title>
<para> <para>
The <filename>kdeutility</filename> application template is a simple utility The <filename>kdeutility</filename> application template is a simple utility
that uses an interface designed in Qt-Designer. It doesn't have a menubar that uses an interface designed in TQt-Designer. It doesn't have a menubar
or toolbar. or toolbar.
</para> </para>
</sect1> </sect1>

@ -32,10 +32,10 @@ def main():
author_email="simon@simonzone.com", author_email="simon@simonzone.com",
url="http://www.simonzone.com/software/pykdeextensions/", url="http://www.simonzone.com/software/pykdeextensions/",
min_kde_version = "3.0.0", min_kde_version = "3.0.0",
min_qt_version = "3.0.0", min_tqt_version = "3.0.0",
license = "LGPL", license = "LGPL",
package_dir = {'': 'src'}, package_dir = {'': 'src'},
py_modules = ["tdedistutils","qtuicompiler","qtdesigner","tdedesigner"], py_modules = ["tdedistutils","tqtuicompiler","tqtdesigner","tdedesigner"],
application_data = ["app_templates","AUTHORS","ChangeLog","COPYING","INSTALL","NEWS"], application_data = ["app_templates","AUTHORS","ChangeLog","COPYING","INSTALL","NEWS"],
docbooks = [ ('doc/en','en') ], docbooks = [ ('doc/en','en') ],
cmdclass = { cmdclass = {

@ -16,10 +16,10 @@
########################################################################### ###########################################################################
import __builtin__ import __builtin__
import qtuicompiler import tqtuicompiler
python_import = __builtin__.__import__ python_import = __builtin__.__import__
def load(*args): def load(*args):
qtuicompiler.DynamicImport(args,True) tqtuicompiler.DynamicImport(args,True)
return apply(python_import,args) return apply(python_import,args)
__builtin__.__import__ = load __builtin__.__import__ = load

@ -31,7 +31,7 @@ from distutils import log
from distutils import file_util from distutils import file_util
from distutils import dir_util from distutils import dir_util
from distutils.util import byte_compile from distutils.util import byte_compile
import qtuicompiler import tqtuicompiler
import stat import stat
import os,os.path,imp,glob import os,os.path,imp,glob
import sys import sys
@ -56,7 +56,7 @@ def setup(**arg_dict):
'build_messages' : BuildI18NMessages, 'build_messages' : BuildI18NMessages,
'install_messages' : InstallI18NMessages, 'install_messages' : InstallI18NMessages,
'update_messages' : UpdateI18NMessages, 'update_messages' : UpdateI18NMessages,
'checkpyqt' : CheckPyQt, 'checkpytqt' : CheckPyTQt,
'checkpytde' : CheckPyTDE, 'checkpytde' : CheckPyTDE,
'uninstall' : Uninstall, 'uninstall' : Uninstall,
'build' : BuildKDE, 'build' : BuildKDE,
@ -79,7 +79,7 @@ def setup(**arg_dict):
class KDEDistribution(Distribution): class KDEDistribution(Distribution):
def __init__(self,attrs=None): def __init__(self,attrs=None):
self.min_kde_version = None self.min_kde_version = None
self.min_qt_version = None self.min_tqt_version = None
self.kcontrol_modules = None self.kcontrol_modules = None
self.tdeioslaves = None self.tdeioslaves = None
self.executable_links = None self.executable_links = None
@ -179,7 +179,7 @@ class InstallKDE(install):
sub_commands = install.sub_commands[:] sub_commands = install.sub_commands[:]
sub_commands.insert(0, ('checkpytde',None) ) sub_commands.insert(0, ('checkpytde',None) )
sub_commands.insert(0, ('checkpyqt',None) ) sub_commands.insert(0, ('checkpytqt',None) )
sub_commands.append( ('install_executable_links',has_executable_links) ) sub_commands.append( ('install_executable_links',has_executable_links) )
sub_commands.append( ('install_messages',has_messages) ) sub_commands.append( ('install_messages',has_messages) )
sub_commands.append( ('install_html',has_docbook_html) ) sub_commands.append( ('install_html',has_docbook_html) )
@ -501,11 +501,11 @@ class BuildKControlModule(Command):
('kde-inc-dir=',None,'Directory containing C++ header files for KDE'), ('kde-inc-dir=',None,'Directory containing C++ header files for KDE'),
('kde-lib-dir=',None,'Directory containing library files for KDE'), ('kde-lib-dir=',None,'Directory containing library files for KDE'),
('kde-kcm-lib-dir=',None,'Directory for KDE kcm library files'), ('kde-kcm-lib-dir=',None,'Directory for KDE kcm library files'),
('qt-inc-dir=',None,'Directory containing C++ header files for Qt'), ('tqt-inc-dir=',None,'Directory containing C++ header files for TQt'),
('qt-lib-dir=',None,'Directory containing library files for Qt'), ('tqt-lib-dir=',None,'Directory containing library files for TQt'),
('sip-dir=',None,'Directory containing the sip library files'), ('sip-dir=',None,'Directory containing the sip library files'),
('clib=',None,'gcc library and path'), ('clib=',None,'gcc library and path'),
('pyqt-dir=',None,'PyQt module directory'), ('pytqt-dir=',None,'PyTQt module directory'),
('pytde-dir=',None,'PyTDE module directory'), ('pytde-dir=',None,'PyTDE module directory'),
('data-dir=',None,'installation directory for data (script) files')] ('data-dir=',None,'installation directory for data (script) files')]
@ -517,11 +517,11 @@ class BuildKControlModule(Command):
self.kde_inc_dir = None self.kde_inc_dir = None
self.kde_lib_dir = None self.kde_lib_dir = None
self.kde_kcm_lib_dir = None self.kde_kcm_lib_dir = None
self.qt_inc_dir = None self.tqt_inc_dir = None
self.qt_lib_dir = None self.tqt_lib_dir = None
self.sip_dir = None self.sip_dir = None
self.clib = None self.clib = None
self.pyqt_dir = None self.pytqt_dir = None
self.pytde_dir = None self.pytde_dir = None
self.data_dir = None self.data_dir = None
@ -561,38 +561,37 @@ class BuildKControlModule(Command):
self.announce("Using %s for KDE KCM library files" % self.kde_kcm_lib_dir) self.announce("Using %s for KDE KCM library files" % self.kde_kcm_lib_dir)
# TQt inc dir # TQt inc dir
if self.qt_inc_dir is None: if self.tqt_inc_dir is None:
canidatepaths = [] canidatepaths = []
qtinc = os.getenv("QTINC") tqtinc = os.getenv("TQTINC")
if qtinc != None: if tqtinc != None:
canidatepaths.append(qtinc) canidatepaths.append(tqtinc)
qtdir = os.getenv("TQTDIR") tqtdir = os.getenv("TQTDIR")
if qtdir != None: if tqtdir != None:
canidatepaths.append(os.path.join(qtdir,"include")) canidatepaths.append(os.path.join(tqtdir,"include"))
canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/include")) canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/include"))
canidatepaths.append(os.path.join(install.prefix,"lib/qt3/include"))
canidatepaths.append(os.path.join(install.prefix,"include")) canidatepaths.append(os.path.join(install.prefix,"include"))
canidatepaths.append("/opt/tqt3/include") canidatepaths.append("/opt/tqt3/include")
canidatepaths.append("/usr/include/tqt3") canidatepaths.append("/usr/include/tqt3")
self.qt_inc_dir = FindFileInPaths('ntqstring.h',canidatepaths) self.tqt_inc_dir = FindFileInPaths('ntqstring.h',canidatepaths)
if self.qt_inc_dir is None: if self.tqt_inc_dir is None:
self.qt_inc_dir = FindFileInPaths('qstring.h',canidatepaths) self.tqt_inc_dir = FindFileInPaths('tqstring.h',canidatepaths)
if self.qt_inc_dir is None: if self.tqt_inc_dir is None:
raise SystemExit("Failed to find the TQt header file directory") raise SystemExit("Failed to find the TQt header file directory")
if FindFileInPaths('ntqstring.h',[self.qt_inc_dir]) is None: if FindFileInPaths('ntqstring.h',[self.tqt_inc_dir]) is None:
if FindFileInPaths('qstring.h',[self.qt_inc_dir]) is None: if FindFileInPaths('tqstring.h',[self.tqt_inc_dir]) is None:
raise SystemExit("Failed to find TQt header files in: %s" % self.qt_inc_dir) raise SystemExit("Failed to find TQt header files in: %s" % self.tqt_inc_dir)
self.announce("Using %s for TQt header files" % self.qt_inc_dir) self.announce("Using %s for TQt header files" % self.tqt_inc_dir)
# TQt lib dir # TQt lib dir
if self.qt_lib_dir is None: if self.tqt_lib_dir is None:
canidatepaths = [] canidatepaths = []
tqtlib = os.getenv("TQTLIB") tqtlib = os.getenv("TQTLIB")
if tqtlib != None: if tqtlib != None:
canidatepaths.append(tqtlib) canidatepaths.append(tqtlib)
qtdir = os.getenv("TQTDIR") tqtdir = os.getenv("TQTDIR")
if qtdir != None: if tqtdir != None:
canidatepaths.append(os.path.join(qtdir,get_libdir_name())) canidatepaths.append(os.path.join(tqtdir,get_libdir_name()))
canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/"+get_libdir_name())) canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/"+get_libdir_name()))
canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/"+get_libdir_name())) canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/"+get_libdir_name()))
canidatepaths.append(os.path.join(install.prefix,get_libdir_name())) canidatepaths.append(os.path.join(install.prefix,get_libdir_name()))
@ -600,26 +599,23 @@ class BuildKControlModule(Command):
canidatepaths.append("/opt/tqt/"+get_libdir_name()) canidatepaths.append("/opt/tqt/"+get_libdir_name())
canidatepaths.append("/opt/tqt/lib/"+get_libdir_name()) canidatepaths.append("/opt/tqt/lib/"+get_libdir_name())
canidatepaths.append("/opt/tqt3/lib/"+get_libdir_name()) canidatepaths.append("/opt/tqt3/lib/"+get_libdir_name())
self.qt_lib_dir = FindFileInPaths('libtqt*',canidatepaths) self.tqt_lib_dir = FindFileInPaths('libtqt*',canidatepaths)
if self.qt_lib_dir is None: if self.tqt_lib_dir is None:
canidatepaths = [] canidatepaths = []
tqtlib = os.getenv("TQTLIB") tqtlib = os.getenv("TQTLIB")
if tqtlib != None: if tqtlib != None:
canidatepaths.append(tqtlib) canidatepaths.append(tqtlib)
qtdir = os.getenv("TQTDIR") tqtdir = os.getenv("TQTDIR")
if qtdir != None: if tqtdir != None:
canidatepaths.append(os.path.join(qtdir,get_libdir_name())) canidatepaths.append(os.path.join(tqtdir,get_libdir_name()))
canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/"+get_libdir_name())) canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/"+get_libdir_name()))
canidatepaths.append(os.path.join(install.prefix,"lib/qt3/"+get_libdir_name()))
canidatepaths.append(os.path.join(install.prefix,get_libdir_name())) canidatepaths.append(os.path.join(install.prefix,get_libdir_name()))
canidatepaths.append("/opt/tqt3/"+get_libdir_name()) canidatepaths.append("/opt/tqt3/"+get_libdir_name())
canidatepaths.append("/opt/qt/"+get_libdir_name()) canidatepaths.append("/opt/tqt3/lib/"+get_libdir_name())
canidatepaths.append("/opt/qt/lib/"+get_libdir_name()) self.tqt_lib_dir = FindFileInPaths('libtqt*',canidatepaths)
canidatepaths.append("/opt/qt3/lib/"+get_libdir_name()) if self.tqt_lib_dir is None:
self.qt_lib_dir = FindFileInPaths('libtqt*',canidatepaths)
if self.qt_lib_dir is None:
raise SystemExit("Failed to find TQt library files") raise SystemExit("Failed to find TQt library files")
self.announce("Using %s for TQt library files" % self.qt_lib_dir) self.announce("Using %s for TQt library files" % self.tqt_lib_dir)
# Python dir # Python dir
if self.python_dir is None: if self.python_dir is None:
@ -633,13 +629,13 @@ class BuildKControlModule(Command):
self.announce("Using %s for Python header files" % self.python_inc_dir) self.announce("Using %s for Python header files" % self.python_inc_dir)
# PyTQt dir # PyTQt dir
if self.pyqt_dir is None: if self.pytqt_dir is None:
self.pyqt_dir = FindFileInPaths("PyTQt", sys.path) self.pytqt_dir = FindFileInPaths("PyTQt", sys.path)
if self.pyqt_dir is None: if self.pytqt_dir is None:
self.pyqt_dir = os.path.join(sysconfig.get_python_lib(), 'PyTQt') self.pytqt_dir = os.path.join(sysconfig.get_python_lib(), 'PyTQt')
if (FindFileInPaths("libtqtcmodule*",[self.pyqt_dir]) is None) and (FindFileInPaths("qt*",[self.pyqt_dir]) is None): if (FindFileInPaths("libtqtcmodule*",[self.pytqt_dir]) is None) and (FindFileInPaths("tqt*",[self.pytqt_dir]) is None):
raise SystemExit("Failed to find the PyTQt directory: %s" % self.pyqt_dir) raise SystemExit("Failed to find the PyTQt directory: %s" % self.pytqt_dir)
self.announce("Using %s for PyTQt modules" % self.pyqt_dir) self.announce("Using %s for PyTQt modules" % self.pytqt_dir)
# PyTDE dir # PyTDE dir
if self.pytde_dir is None: if self.pytde_dir is None:
@ -796,7 +792,7 @@ class BuildKControlModule(Command):
cmdlist.append("-I" + self.python_inc_dir) cmdlist.append("-I" + self.python_inc_dir)
cmdlist.append("-I" + self.kde_inc_dir) cmdlist.append("-I" + self.kde_inc_dir)
cmdlist.append("-I" + self.kde_inc_dir + "/tde") cmdlist.append("-I" + self.kde_inc_dir + "/tde")
cmdlist.append("-I" + self.qt_inc_dir) cmdlist.append("-I" + self.tqt_inc_dir)
cmdlist.append("-I/usr/include/tqt") cmdlist.append("-I/usr/include/tqt")
cmdlist.append("-I.") cmdlist.append("-I.")
# input # input
@ -831,28 +827,28 @@ class BuildKControlModule(Command):
# FIXME I doubt half of these libraries need to be here. # FIXME I doubt half of these libraries need to be here.
linklist.append(self.sip_dir+"/sip_tqt.so") linklist.append(self.sip_dir+"/sip_tqt.so")
# PyQt libs # PyTQt libs
linklist.append(self.pyqt_dir+"/qt.so") linklist.append(self.pytqt_dir+"/tqt.so")
# PyTDE libs # PyTDE libs
linklist.append(self.pytde_dir+"/tdecore.so") linklist.append(self.pytde_dir+"/tdecore.so")
linklist.append(self.pytde_dir+"/tdeui.so") linklist.append(self.pytde_dir+"/tdeui.so")
# linklist.append("-L"+self.sip_dir); linklist.append("-lsip_tqt") # linklist.append("-L"+self.sip_dir); linklist.append("-lsip_tqt")
# # PyQt libs # # PyTQt libs
# linklist.append("-L"+self.pyqt_dir); linklist.append("-lqtcmodule") # linklist.append("-L"+self.pytqt_dir); linklist.append("-lqtcmodule")
# # PyTDE libs # # PyTDE libs
# linklist.append("-L"+self.pytde_dir); linklist.append("-ltdecorecmodule"); linklist.append("-ltdeuicmodule") # linklist.append("-L"+self.pytde_dir); linklist.append("-ltdecorecmodule"); linklist.append("-ltdeuicmodule")
linklist.append("-L"+self.kde_lib_dir); linklist.append("-L/opt/trinity/lib"); linklist.append("-ltdecore"); linklist.append("-lpythonize") linklist.append("-L"+self.kde_lib_dir); linklist.append("-L/opt/trinity/lib"); linklist.append("-ltdecore"); linklist.append("-lpythonize")
linklist.append("-L"+self.qt_lib_dir); linklist.append("-ltqt-mt") linklist.append("-L"+self.tqt_lib_dir); linklist.append("-ltqt-mt")
linklist.append("-lm") linklist.append("-lm")
linklist.append("-lc") linklist.append("-lc")
linklist.append(self.clib) linklist.append(self.clib)
linklist.append("-R"); linklist.append(self.python_dir) linklist.append("-R"); linklist.append(self.python_dir)
linklist.append("-R"); linklist.append(self.qt_lib_dir) linklist.append("-R"); linklist.append(self.tqt_lib_dir)
linklist.append("-R"); linklist.append(self.sip_dir) linklist.append("-R"); linklist.append(self.sip_dir)
linklist.append("-R"); linklist.append(self.pyqt_dir) linklist.append("-R"); linklist.append(self.pytqt_dir)
linklist.append("-R"); linklist.append(self.pytde_dir) linklist.append("-R"); linklist.append(self.pytde_dir)
linklist.append("-R"); linklist.append(self.kde_lib_dir) linklist.append("-R"); linklist.append(self.kde_lib_dir)
@ -944,10 +940,10 @@ static TDECModule* return_instance( TQWidget *parent, const char *name ) {
// Inject a helper function // Inject a helper function
TQString bridge = TQString("import sip_tqt\n" TQString bridge = TQString("import sip_tqt\n"
"from PyTQt import qt\n" "from PyTQt import tqt\n"
"def kcontrol_bridge_" FACTORY "(parent,name):\n" "def kcontrol_bridge_" FACTORY "(parent,name):\n"
" if parent!=0:\n" " if parent!=0:\n"
" wparent = sip_tqt.wrapinstance(parent,qt.TQWidget)\n" " wparent = sip_tqt.wrapinstance(parent,tqt.TQWidget)\n"
" else:\n" " else:\n"
" wparent = None\n" " wparent = None\n"
" inst = " FACTORY "(wparent, name)\n" " inst = " FACTORY "(wparent, name)\n"
@ -1320,7 +1316,7 @@ class UpdateI18NMessages(Command):
# Compile any UI files # Compile any UI files
for dir in self.distribution.i18n[1]: for dir in self.distribution.i18n[1]:
for file in glob.glob(os.path.join(dir,'*.ui')): for file in glob.glob(os.path.join(dir,'*.ui')):
qtuicompiler.UpdateUI(file,kde=True) tqtuicompiler.UpdateUI(file,kde=True)
# Fetch all of the python files. # Fetch all of the python files.
for dir in self.distribution.i18n[1]: for dir in self.distribution.i18n[1]:
@ -1449,11 +1445,11 @@ class BuildTdeioslave(Command):
('kde-lib-dir=',None,'Directory containing library files for KDE'), ('kde-lib-dir=',None,'Directory containing library files for KDE'),
('kde-tdeioslave-lib-dir=',None,'Directory for KDE tdeioslave library files'), ('kde-tdeioslave-lib-dir=',None,'Directory for KDE tdeioslave library files'),
('kde-protocol-dir=',None,'Directory for KDE tdeioslave protocol files'), ('kde-protocol-dir=',None,'Directory for KDE tdeioslave protocol files'),
('qt-inc-dir=',None,'Directory containing C++ header files for Qt'), ('tqt-inc-dir=',None,'Directory containing C++ header files for TQt'),
('qt-lib-dir=',None,'Directory containing library files for Qt'), ('tqt-lib-dir=',None,'Directory containing library files for TQt'),
('sip-dir=','/usr/lib/pyshared/python*','Directory containing the sip library files'), ('sip-dir=','/usr/lib/pyshared/python*','Directory containing the sip library files'),
('clib=',None,'gcc library and path'), ('clib=',None,'gcc library and path'),
('pyqt-dir=','/usr/lib/pyshared/python*','PyQt module directory'), ('pytqt-dir=','/usr/lib/pyshared/python*','PyTQt module directory'),
('pytde-dir=',None,'PyTDE module directory'), ('pytde-dir=',None,'PyTDE module directory'),
('data-dir=',None,'installation directory for data (script) files')] ('data-dir=',None,'installation directory for data (script) files')]
@ -1466,11 +1462,11 @@ class BuildTdeioslave(Command):
self.kde_lib_dir = None self.kde_lib_dir = None
self.kde_tdeioslave_lib_dir = None self.kde_tdeioslave_lib_dir = None
self.kde_protocol_dir = None self.kde_protocol_dir = None
self.qt_inc_dir = None self.tqt_inc_dir = None
self.qt_lib_dir = None self.tqt_lib_dir = None
self.sip_dir = None self.sip_dir = None
self.clib = None self.clib = None
self.pyqt_dir = None self.pytqt_dir = None
self.pytde_dir = None self.pytde_dir = None
self.data_dir = None self.data_dir = None
@ -1510,40 +1506,37 @@ class BuildTdeioslave(Command):
self.announce("Using %s for KDE Tdeioslave library files" % self.kde_tdeioslave_lib_dir) self.announce("Using %s for KDE Tdeioslave library files" % self.kde_tdeioslave_lib_dir)
# TQt inc dir # TQt inc dir
if self.qt_inc_dir is None: if self.tqt_inc_dir is None:
canidatepaths = [] canidatepaths = []
qtinc = os.getenv("QTINC") tqtinc = os.getenv("TQTINC")
if qtinc != None: if tqtinc != None:
canidatepaths.append(qtinc) canidatepaths.append(tqtinc)
qtdir = os.getenv("TQTDIR") tqtdir = os.getenv("TQTDIR")
if qtdir != None: if tqtdir != None:
canidatepaths.append(os.path.join(qtdir,"include")) canidatepaths.append(os.path.join(tqtdir,"include"))
canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/include")) canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/include"))
canidatepaths.append(os.path.join(install.prefix,"lib/qt3/include"))
canidatepaths.append(os.path.join(install.prefix,"include")) canidatepaths.append(os.path.join(install.prefix,"include"))
canidatepaths.append("/opt/tqt3/include") canidatepaths.append("/opt/tqt3/include")
canidatepaths.append("/opt/qt/include") canidatepaths.append("/opt/tqt3/lib/include")
canidatepaths.append("/opt/qt/lib/include") self.tqt_inc_dir = FindFileInPaths('ntqstring.h',canidatepaths)
canidatepaths.append("/opt/qt3/lib/include") if self.tqt_inc_dir is None:
self.qt_inc_dir = FindFileInPaths('ntqstring.h',canidatepaths) self.tqt_inc_dir = FindFileInPaths('tqstring.h',canidatepaths)
if self.qt_inc_dir is None: if self.tqt_inc_dir is None:
self.qt_inc_dir = FindFileInPaths('qstring.h',canidatepaths)
if self.qt_inc_dir is None:
raise SystemExit("Failed to find the TQt header file directory") raise SystemExit("Failed to find the TQt header file directory")
if FindFileInPaths('ntqstring.h',[self.qt_inc_dir]) is None: if FindFileInPaths('ntqstring.h',[self.tqt_inc_dir]) is None:
if FindFileInPaths('qstring.h',[self.qt_inc_dir]) is None: if FindFileInPaths('tqstring.h',[self.tqt_inc_dir]) is None:
raise SystemExit("Failed to find TQt header files in: %s" % self.qt_inc_dir) raise SystemExit("Failed to find TQt header files in: %s" % self.tqt_inc_dir)
self.announce("Using %s for TQt header files" % self.qt_inc_dir) self.announce("Using %s for TQt header files" % self.tqt_inc_dir)
# TQt lib dir # TQt lib dir
if self.qt_lib_dir is None: if self.tqt_lib_dir is None:
canidatepaths = [] canidatepaths = []
tqtlib = os.getenv("TQTLIB") tqtlib = os.getenv("TQTLIB")
if tqtlib != None: if tqtlib != None:
canidatepaths.append(tqtlib) canidatepaths.append(tqtlib)
qtdir = os.getenv("TQTDIR") tqtdir = os.getenv("TQTDIR")
if qtdir != None: if tqtdir != None:
canidatepaths.append(os.path.join(qtdir,get_libdir_name())) canidatepaths.append(os.path.join(tqtdir,get_libdir_name()))
canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/"+get_libdir_name())) canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/"+get_libdir_name()))
canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/"+get_libdir_name())) canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/"+get_libdir_name()))
canidatepaths.append(os.path.join(install.prefix,get_libdir_name())) canidatepaths.append(os.path.join(install.prefix,get_libdir_name()))
@ -1551,26 +1544,23 @@ class BuildTdeioslave(Command):
canidatepaths.append("/opt/tqt/"+get_libdir_name()) canidatepaths.append("/opt/tqt/"+get_libdir_name())
canidatepaths.append("/opt/tqt/lib/"+get_libdir_name()) canidatepaths.append("/opt/tqt/lib/"+get_libdir_name())
canidatepaths.append("/opt/tqt3/lib/"+get_libdir_name()) canidatepaths.append("/opt/tqt3/lib/"+get_libdir_name())
self.qt_lib_dir = FindFileInPaths('libtqt*',canidatepaths) self.tqt_lib_dir = FindFileInPaths('libtqt*',canidatepaths)
if self.qt_lib_dir is None: if self.tqt_lib_dir is None:
canidatepaths = [] canidatepaths = []
tqtlib = os.getenv("TQTLIB") tqtlib = os.getenv("TQTLIB")
if tqtlib != None: if tqtlib != None:
canidatepaths.append(tqtlib) canidatepaths.append(tqtlib)
qtdir = os.getenv("TQTDIR") tqtdir = os.getenv("TQTDIR")
if qtdir != None: if tqtdir != None:
canidatepaths.append(os.path.join(qtdir,get_libdir_name())) canidatepaths.append(os.path.join(tqtdir,get_libdir_name()))
canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/"+get_libdir_name())) canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/"+get_libdir_name()))
canidatepaths.append(os.path.join(install.prefix,"lib/qt3/"+get_libdir_name()))
canidatepaths.append(os.path.join(install.prefix,get_libdir_name())) canidatepaths.append(os.path.join(install.prefix,get_libdir_name()))
canidatepaths.append("/opt/tqt3/"+get_libdir_name()) canidatepaths.append("/opt/tqt3/"+get_libdir_name())
canidatepaths.append("/opt/qt/"+get_libdir_name()) canidatepaths.append("/opt/tqt3/lib/"+get_libdir_name())
canidatepaths.append("/opt/qt/lib/"+get_libdir_name()) self.tqt_lib_dir = FindFileInPaths('libtqt*',canidatepaths)
canidatepaths.append("/opt/qt3/lib/"+get_libdir_name()) if self.tqt_lib_dir is None:
self.qt_lib_dir = FindFileInPaths('libtqt*',canidatepaths)
if self.qt_lib_dir is None:
raise SystemExit("Failed to find TQt library files") raise SystemExit("Failed to find TQt library files")
self.announce("Using %s for TQt library files" % self.qt_lib_dir) self.announce("Using %s for TQt library files" % self.tqt_lib_dir)
# Python dir # Python dir
if self.python_dir is None: if self.python_dir is None:
@ -1584,13 +1574,13 @@ class BuildTdeioslave(Command):
self.announce("Using %s for Python header files" % self.python_inc_dir) self.announce("Using %s for Python header files" % self.python_inc_dir)
# PyTQt dir # PyTQt dir
if self.pyqt_dir is None: if self.pytqt_dir is None:
self.pyqt_dir = FindFileInPaths("PyTQt", sys.path) self.pytqt_dir = FindFileInPaths("PyTQt", sys.path)
if self.pyqt_dir is None: if self.pytqt_dir is None:
self.pyqt_dir = os.path.join(sysconfig.get_python_lib(), 'PyTQt') self.pytqt_dir = os.path.join(sysconfig.get_python_lib(), 'PyTQt')
if (FindFileInPaths("libtqtcmodule*",[self.pyqt_dir]) is None) and (FindFileInPaths("qt*",[self.pyqt_dir]) is None): if (FindFileInPaths("libtqtcmodule*",[self.pytqt_dir]) is None) and (FindFileInPaths("tqt*",[self.pytqt_dir]) is None):
raise SystemExit("Failed to find the PyTQt directory: %s" % self.pyqt_dir) raise SystemExit("Failed to find the PyTQt directory: %s" % self.pytqt_dir)
self.announce("Using %s for PyTQt modules" % self.pyqt_dir) self.announce("Using %s for PyTQt modules" % self.pytqt_dir)
# PyTDE dir # PyTDE dir
if self.pytde_dir is None: if self.pytde_dir is None:
@ -1731,7 +1721,7 @@ class BuildTdeioslave(Command):
cmdlist.append("-I" + self.python_inc_dir) cmdlist.append("-I" + self.python_inc_dir)
cmdlist.append("-I" + self.kde_inc_dir) cmdlist.append("-I" + self.kde_inc_dir)
cmdlist.append("-I" + self.kde_inc_dir + "/tde") cmdlist.append("-I" + self.kde_inc_dir + "/tde")
cmdlist.append("-I" + self.qt_inc_dir) cmdlist.append("-I" + self.tqt_inc_dir)
cmdlist.append("-I/usr/include/tqt") cmdlist.append("-I/usr/include/tqt")
cmdlist.append("-I.") cmdlist.append("-I.")
# input # input
@ -1767,26 +1757,26 @@ class BuildTdeioslave(Command):
# FIXME I doubt half of these libraries need to be here. # FIXME I doubt half of these libraries need to be here.
linklist.append(self.sip_dir+"/sip_tqt.so") linklist.append(self.sip_dir+"/sip_tqt.so")
# PyTQt libs # PyTQt libs
linklist.append(self.pyqt_dir+"/qt.so") linklist.append(self.pytqt_dir+"/tqt.so")
# PyTDE libs # PyTDE libs
linklist.append(self.pytde_dir+"/tdecore.so") linklist.append(self.pytde_dir+"/tdecore.so")
# linklist.append("-L"+self.sip_dir); linklist.append("-lsip_tqt") # linklist.append("-L"+self.sip_dir); linklist.append("-lsip_tqt")
# # PyTQt libs # # PyTQt libs
# linklist.append("-L"+self.pyqt_dir); linklist.append("-lqtcmodule") # linklist.append("-L"+self.pytqt_dir); linklist.append("-lqtcmodule")
# # PyTDE libs # # PyTDE libs
# linklist.append("-L"+self.pytde_dir); linklist.append("-ltdecorecmodule"); linklist.append("-ltdeuicmodule") # linklist.append("-L"+self.pytde_dir); linklist.append("-ltdecorecmodule"); linklist.append("-ltdeuicmodule")
linklist.append("-L"+self.kde_lib_dir); linklist.append("-L/opt/trinity/lib"); linklist.append("-ltdecore"); linklist.append("-lpythonize") linklist.append("-L"+self.kde_lib_dir); linklist.append("-L/opt/trinity/lib"); linklist.append("-ltdecore"); linklist.append("-lpythonize")
linklist.append("-L"+self.qt_lib_dir); linklist.append("-lqt-mt") linklist.append("-L"+self.tqt_lib_dir); linklist.append("-lqt-mt")
linklist.append("-lm") linklist.append("-lm")
linklist.append("-lc") linklist.append("-lc")
linklist.append(self.clib) linklist.append(self.clib)
linklist.append("-R"); linklist.append(self.python_dir) linklist.append("-R"); linklist.append(self.python_dir)
linklist.append("-R"); linklist.append(self.qt_lib_dir) linklist.append("-R"); linklist.append(self.tqt_lib_dir)
linklist.append("-R"); linklist.append(self.sip_dir) linklist.append("-R"); linklist.append(self.sip_dir)
linklist.append("-R"); linklist.append(self.pyqt_dir) linklist.append("-R"); linklist.append(self.pytqt_dir)
linklist.append("-R"); linklist.append(self.pytde_dir) linklist.append("-R"); linklist.append(self.pytde_dir)
linklist.append("-R"); linklist.append(self.kde_lib_dir) linklist.append("-R"); linklist.append(self.kde_lib_dir)
@ -2010,7 +2000,7 @@ class InstallTdeioslave(Command):
return dir_util.mkpath(name, mode, dry_run=self.dry_run) return dir_util.mkpath(name, mode, dry_run=self.dry_run)
########################################################################### ###########################################################################
class CheckPyQt(Command): class CheckPyTQt(Command):
description = "Checks for the presence of a working PyTQt installation" description = "Checks for the presence of a working PyTQt installation"
user_options = [] user_options = []
@ -2019,17 +2009,17 @@ class CheckPyQt(Command):
pass pass
def finalize_options(self): def finalize_options(self):
self.min_qt_version = self.distribution.min_qt_version self.min_tqt_version = self.distribution.min_tqt_version
def run(self): def run(self):
if self.min_qt_version!=None: if self.min_tqt_version!=None:
qtver,kdever = get_qt_kde_versions() tqtver,kdever = get_tqt_kde_versions()
if compare_versions(self.min_qt_version,qtver)==1: if compare_versions(self.min_tqt_version,tqtver)==1:
raise SystemExit("Your TQt version is too old. Version %s or higher is required, found %s." % (self.min_qt_version,qtver)) raise SystemExit("Your TQt version is too old. Version %s or higher is required, found %s." % (self.min_tqt_version,tqtver))
self.announce("Found TQt version %s." % qtver) self.announce("Found TQt version %s." % tqtver)
try: try:
self.announce("Checking for a working PyTQt...") self.announce("Checking for a working PyTQt...")
from PyTQt import qt from PyTQt import tqt
self.announce(" ...PyTQt is working") self.announce(" ...PyTQt is working")
except: except:
raise SystemExit("Couldn't import TQt! Please make sure that PyTQt is installed and working.") raise SystemExit("Couldn't import TQt! Please make sure that PyTQt is installed and working.")
@ -2050,7 +2040,7 @@ class CheckPyTDE(Command):
def run(self): def run(self):
if self.min_kde_version!=None: if self.min_kde_version!=None:
qtver,kdever = get_qt_kde_versions() tqtver,kdever = get_tqt_kde_versions()
if compare_versions(self.min_kde_version,kdever)==1: if compare_versions(self.min_kde_version,kdever)==1:
raise SystemExit("Your TDE version is too old. Version %s or higher is required, found %s." % (self.min_kde_version,kdever)) raise SystemExit("Your TDE version is too old. Version %s or higher is required, found %s." % (self.min_kde_version,kdever))
self.announce("Found KDE version %s." % kdever) self.announce("Found KDE version %s." % kdever)
@ -2208,24 +2198,26 @@ def compare_versions(a,b):
return 0 return 0
########################################################################### ###########################################################################
def get_qt_kde_versions(): def get_tqt_kde_versions():
versioninfo = ask_kde_config('--version') versioninfo = ask_kde_config('--version')
qtver = None tqtver = None
kdever = None kdever = None
if versioninfo!=None: if versioninfo!=None:
for line in versioninfo.splitlines(): for line in versioninfo.splitlines():
if line.startswith("Qt: "): if line.startswith("TQt: "):
qtver = line[4:] tqtver = line[4:]
elif line.startswith("Qt: "):
tqtver = line[4:]
elif line.startswith("TDE: "): elif line.startswith("TDE: "):
kdever = line[5:] kdever = line[5:]
return qtver,kdever return tqtver,kdever
########################################################################### ###########################################################################
def compile_tqtdesigner(ui_files, def compile_tqtdesigner(ui_files,
force=0, force=0,
prefix=None, base_dir=None, prefix=None, base_dir=None,
verbose=1, dry_run=0): verbose=1, dry_run=0):
"""Compile a collection of QT Designer UI files to .py """Compile a collection of TQT Designer UI files to .py
If 'dry_run' is true, doesn't actually do anything that would If 'dry_run' is true, doesn't actually do anything that would
affect the filesystem. affect the filesystem.
@ -2246,12 +2238,12 @@ def compile_tqtdesigner(ui_files,
pyfile_base = os.path.basename(pyfile) pyfile_base = os.path.basename(pyfile)
if force or newer(uifile, pyfile): if force or newer(uifile, pyfile):
log.info("compiling Qt-Designer UI %s to %s", file, pyfile_base) log.info("compiling TQt-Designer UI %s to %s", file, pyfile_base)
if not dry_run: if not dry_run:
qtuicompiler.CompileUI(uifile, pyfile) tqtuicompiler.CompileUI(uifile, pyfile)
generated_files.append(pyfile) generated_files.append(pyfile)
else: else:
log.debug("skipping Qt-Designer compilation of %s to %s", log.debug("skipping TQt-Designer compilation of %s to %s",
file, pyfile_base) file, pyfile_base)
return generated_files return generated_files

@ -16,11 +16,11 @@
########################################################################### ###########################################################################
import __builtin__ import __builtin__
import qtuicompiler import tqtuicompiler
python_import = __builtin__.__import__ python_import = __builtin__.__import__
def load(*args): def load(*args):
qtuicompiler.DynamicImport(args,False) tqtuicompiler.DynamicImport(args,False)
return apply(python_import,args) return apply(python_import,args)
__builtin__.__import__ = load __builtin__.__import__ = load

@ -1,6 +1,6 @@
#!/usr/bin/python #!/usr/bin/python
########################################################################### ###########################################################################
# qtuicompiler - description # # tqtuicompiler - description #
# ------------------------------ # # ------------------------------ #
# begin : Thu Apr 21 2005 # # begin : Thu Apr 21 2005 #
# copyright : (C) 2005 by Simon Edwards # # copyright : (C) 2005 by Simon Edwards #
@ -17,37 +17,37 @@
import os import os
import sys import sys
from PyTQt import pyqtconfig from PyTQt import pytqtconfig
from distutils.spawn import * from distutils.spawn import *
import traceback import traceback
pyqt_configuration = pyqtconfig.Configuration() pytqt_configuration = pytqtconfig.Configuration()
pyuic_exe = None pytquic_exe = None
############################################################################ ############################################################################
def FindPyuic(): def FindPytquic():
global pyuic_exe global pytquic_exe
if pyuic_exe is not None: return pyuic_exe if pytquic_exe is not None: return pytquic_exe
pyuic_exe = find_executable('pyuic',pyqt_configuration.pyqt_bin_dir) pytquic_exe = find_executable('pytquic',pytqt_configuration.pytqt_bin_dir)
if pyuic_exe is None: if pytquic_exe is None:
# Search on the $Path. # Search on the $Path.
pyuic_exe = find_executable('pyuic') pytquic_exe = find_executable('pytquic')
############################################################################ ############################################################################
def CompileUI(ui_file_name, py_file_name=None, kde=False): def CompileUI(ui_file_name, py_file_name=None, kde=False):
pyuic_exe = find_executable('pyuic',pyqt_configuration.default_bin_dir) pytquic_exe = find_executable('pytquic',pytqt_configuration.default_bin_dir)
if pyuic_exe is None: if pytquic_exe is None:
# Search on the $Path. # Search on the $Path.
pyuic_exe = find_executable('pyuic') pytquic_exe = find_executable('pytquic')
if pyuic_exe is None: if pytquic_exe is None:
pass # FIXME raise something! pass # FIXME raise something!
if py_file_name is None: if py_file_name is None:
py_file_name = os.path.splitext(os.path.basename(ui_file_name))[0] + '.py' py_file_name = os.path.splitext(os.path.basename(ui_file_name))[0] + '.py'
tmp_file_name = py_file_name + '.bak' tmp_file_name = py_file_name + '.bak'
cmd = [pyuic_exe] cmd = [pytquic_exe]
if kde: if kde:
cmd.append('-tr') cmd.append('-tr')
cmd.append('i18n') cmd.append('i18n')
@ -59,12 +59,12 @@ def CompileUI(ui_file_name, py_file_name=None, kde=False):
input = open(tmp_file_name, 'r') input = open(tmp_file_name, 'r')
output = open(py_file_name, 'w') output = open(py_file_name, 'w')
for line in input.readlines(): for line in input.readlines():
if kde and string.strip(line) == 'from PyTQt.qt import *': if kde and string.strip(line) == 'from PyTQt.tqt import *':
output.write(line) output.write(line)
output.write('from tdecore import *\nfrom tdeui import *\n\n') output.write('from tdecore import *\nfrom tdeui import *\n\n')
elif kde and string.find(line, " = KDatePicker(") != -1: elif kde and string.find(line, " = KDatePicker(") != -1:
o = string.find(line, ",") o = string.find(line, ",")
output.write(line[:o] + ",QDate.currentDate()" + line[o:]) output.write(line[:o] + ",TQDate.currentDate()" + line[o:])
else: else:
output.write (line) output.write (line)
@ -82,7 +82,7 @@ def DynamicImport(importargs,kde=False):
UpdateUI(file_name_ui,kde) UpdateUI(file_name_ui,kde)
except: except:
traceback.print_exc() traceback.print_exc()
raise ImportError("Unable to compile Qt designer file %s." % args[0]) raise ImportError("Unable to compile TQt designer file %s." % args[0])
############################################################################ ############################################################################
def UpdateUI(ui_file,kde=False): def UpdateUI(ui_file,kde=False):
@ -101,7 +101,7 @@ def main():
# FIXME parse args and add --kde parameter. # FIXME parse args and add --kde parameter.
if len(sys.argv)!=3: if len(sys.argv)!=3:
print("""\nUsage: print("""\nUsage:
qtuicompiler filename.ui filename.py\n\n tqtuicompiler filename.ui filename.py\n\n
""") """)
return return
Loading…
Cancel
Save