summaryrefslogtreecommitdiffstats
path: root/kexi/plugins/scripting/scripts/copycenter/CopyCenter.py
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kexi/plugins/scripting/scripts/copycenter/CopyCenter.py
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/plugins/scripting/scripts/copycenter/CopyCenter.py')
-rw-r--r--kexi/plugins/scripting/scripts/copycenter/CopyCenter.py78
1 files changed, 39 insertions, 39 deletions
diff --git a/kexi/plugins/scripting/scripts/copycenter/CopyCenter.py b/kexi/plugins/scripting/scripts/copycenter/CopyCenter.py
index 3718512f..3a2734aa 100644
--- a/kexi/plugins/scripting/scripts/copycenter/CopyCenter.py
+++ b/kexi/plugins/scripting/scripts/copycenter/CopyCenter.py
@@ -89,14 +89,14 @@ def runGuiApp(copycenter, name):
#--------------------------------------------------------------------
class ListViewDialog(qt.QDialog):
- def __init__(self, parent, caption):
- qt.QDialog.__init__(self, parent, "ProgressDialog", 1)
- self.parent = parent
+ def __init__(self, tqparent, caption):
+ qt.QDialog.__init__(self, tqparent, "ProgressDialog", 1)
+ self.tqparent = tqparent
self.setCaption(caption)
- layout = qt.QVBoxLayout(self)
+ tqlayout = qt.QVBoxLayout(self)
box = qt.QVBox(self)
box.setMargin(2)
- layout.addWidget(box)
+ tqlayout.addWidget(box)
self.listview = qt.QListView(box)
self.listview.setAllColumnsShowFocus(True)
self.listview.header().setStretchEnabled(True,0)
@@ -124,9 +124,9 @@ def runGuiApp(copycenter, name):
#--------------------------------------------------------------------
class CopyJobWidget(qt.QVBox):
- def __init__(self,dialog,parent):
+ def __init__(self,dialog,tqparent):
self.dialog = dialog
- qt.QVBox.__init__(self,parent)
+ qt.QVBox.__init__(self,tqparent)
self.setSpacing(6)
typebox = qt.QHBox(self)
typebox.setSpacing(6)
@@ -165,7 +165,7 @@ def runGuiApp(copycenter, name):
def doubleClicked(self, **args):
print "CopyJobWidget.doubleClicked"
item = self.listview.selectedItem()
- if item and item.parent(): item.startRename(1)
+ if item and item.tqparent(): item.startRename(1)
def readOptions(self,domnode,plugininst):
print "CopyJobWidget.readOptions plugintype=\"%s\"" % plugininst.plugintype
@@ -210,13 +210,13 @@ def runGuiApp(copycenter, name):
if filename != "": self.jobfilecombobox.setCurrentText(filename)
def escape(self,s):
- return s.replace("&", "&amp;").replace("'", "&apos;").replace("<", "&lt;").replace(">", "&gt;").replace('"', "&quot;")
+ return s.tqreplace("&", "&amp;").tqreplace("'", "&apos;").tqreplace("<", "&lt;").tqreplace(">", "&gt;").tqreplace('"', "&quot;")
def writeOptions(self,writer,pluginname,plugininst):
print "CopyJobWidget.writeOptions"
writer.write("<%s plugin=\"%s\">\n" % (plugininst.plugintype, pluginname))
for optionname in plugininst.options:
- value = self.escape( unicode(plugininst.options[optionname]).encode("utf-8") )
+ value = self.escape( tqunicode(plugininst.options[optionname]).encode("utf-8") )
writer.write("\t<%s value=\"%s\" />\n" % (optionname,value))
writer.write("</%s>\n" % plugininst.plugintype)
@@ -238,19 +238,19 @@ def runGuiApp(copycenter, name):
f.close()
print "File \%s\" successfully written." % filename
- def addItem(self, pluginimpl, afteritem = None, parentitem = None):
+ def addItem(self, pluginimpl, afteritem = None, tqparentitem = None):
#print "CopyJobWidget.addItem"
class ListViewItem(qt.QListViewItem):
- def __init__(self, pluginimpl, listview, parentitem = None, afteritem = None):
+ def __init__(self, pluginimpl, listview, tqparentitem = None, afteritem = None):
self.pluginimpl = pluginimpl
- if parentitem == None:
+ if tqparentitem == None:
qt.QListViewItem.__init__(self,listview)
self.setOpen(True)
else:
if afteritem == None:
- qt.QListViewItem.__init__(self,parentitem)
+ qt.QListViewItem.__init__(self,tqparentitem)
else:
- qt.QListViewItem.__init__(self,parentitem,afteritem)
+ qt.QListViewItem.__init__(self,tqparentitem,afteritem)
self.setRenameEnabled(1,True)
def startRename(self, columnindex):
qt.QListViewItem.startRename(self,columnindex)
@@ -271,10 +271,10 @@ def runGuiApp(copycenter, name):
def text(self, columnindex):
if columnindex == 1:
- if qt.QListViewItem.text(self,0).contains("password"):
+ if qt.QListViewItem.text(self,0).tqcontains("password"):
return "*" * len(str(qt.QListViewItem.text(self,1)))
return qt.QListViewItem.text(self,columnindex)
- return ListViewItem(pluginimpl, self.listview, parentitem, afteritem)
+ return ListViewItem(pluginimpl, self.listview, tqparentitem, afteritem)
def updateItem(self,pluginname,pluginimpl):
#print "CopyJobWidget.updateItem"
@@ -309,31 +309,31 @@ def runGuiApp(copycenter, name):
self.starttime = None
qt.QDialog.__init__(self, dialog, "ProgressDialog", 1)
self.setCaption("Copying...")
- layout = qt.QVBoxLayout(self)
+ tqlayout = qt.QVBoxLayout(self)
box = qt.QVBox(self)
box.setSpacing(6)
box.setMargin(6)
- layout.addWidget(box)
+ tqlayout.addWidget(box)
self.textbrowser = qt.QTextBrowser(box)
self.textbrowser.setWordWrap(qt.QTextEdit.WidgetWidth)
self.textbrowser.setTextFormat(qt.Qt.RichText)
statusbox = qt.QFrame(box)
- layout = qt.QGridLayout(statusbox,4,2,0,2)
- layout.addWidget(qt.QLabel("Number of records done:",statusbox),0,0)
+ tqlayout = qt.QGridLayout(statusbox,4,2,0,2)
+ tqlayout.addWidget(qt.QLabel("Number of records done:",statusbox),0,0)
self.donecounter = 0
self.donelabel = qt.QLabel("-",statusbox)
- layout.addWidget(self.donelabel,0,1)
- layout.addWidget(qt.QLabel("Successfully copied records:",statusbox),1,0)
+ tqlayout.addWidget(self.donelabel,0,1)
+ tqlayout.addWidget(qt.QLabel("Successfully copied records:",statusbox),1,0)
self.successcounter = 0
self.successlabel = qt.QLabel("-",statusbox)
- layout.addWidget(self.successlabel,1,1)
- layout.addWidget(qt.QLabel("Failed to copy records:",statusbox),2,0)
+ tqlayout.addWidget(self.successlabel,1,1)
+ tqlayout.addWidget(qt.QLabel("Failed to copy records:",statusbox),2,0)
self.failedcounter = 0
self.failedlabel = qt.QLabel("-",statusbox)
- layout.addWidget(self.failedlabel,2,1)
- layout.addWidget(qt.QLabel("Elapsed time in seconds:",statusbox),3,0)
+ tqlayout.addWidget(self.failedlabel,2,1)
+ tqlayout.addWidget(qt.QLabel("Elapsed time in seconds:",statusbox),3,0)
self.elapsedlabel = qt.QLabel("-",statusbox)
- layout.addWidget(self.elapsedlabel,3,1)
+ tqlayout.addWidget(self.elapsedlabel,3,1)
btnbox = qt.QHBox(box)
btnbox.setSpacing(6)
self.donebtn = qt.QPushButton(btnbox)
@@ -359,11 +359,11 @@ def runGuiApp(copycenter, name):
def writeSuccess(self, record, rowcount):
self.donecounter += rowcount
self.successcounter += rowcount
- qt.qApp.processEvents()
+ qt.tqApp.processEvents()
def writeFailed(self, record):
self.donecounter += 1
self.failedcounter += 1
- qt.qApp.processEvents()
+ qt.tqApp.processEvents()
def startCopy(self):
try:
@@ -397,7 +397,7 @@ def runGuiApp(copycenter, name):
self.starttime.start()
self.updatetimer.start(500)
- qt.qApp.processEvents()
+ qt.tqApp.processEvents()
# Copy the records
self.textbrowser.append("<hr><i>Copy the records...</i>")
@@ -428,7 +428,7 @@ def runGuiApp(copycenter, name):
def show(self):
qt.QDialog.show(self)
qt.QTimer.singleShot(10,self.startCopy)
- qt.qApp.processEvents()
+ qt.tqApp.processEvents()
def closeEvent(self, closeevent):
if not self.dialog.getSourcePluginImpl().isFinished():
@@ -442,13 +442,13 @@ def runGuiApp(copycenter, name):
#--------------------------------------------------------------------
class DataSelector(qt.QVGroupBox):
- def __init__(self, plugintype, title, caption, parent, dialog, items):
+ def __init__(self, plugintype, title, caption, tqparent, dialog, items):
self.plugintype = plugintype
self.pluginimpl = None
self.dialog = dialog
self.mainbox = None
- qt.QVGroupBox.__init__(self,title,parent)
+ qt.QVGroupBox.__init__(self,title,tqparent)
self.setInsideMargin(6)
self.setInsideSpacing(0)
@@ -520,7 +520,7 @@ def runGuiApp(copycenter, name):
#--------------------------------------------------------------------
class Dialog(qt.QDialog):
- def __init__(self, copycenter, parent):
+ def __init__(self, copycenter, tqparent):
self.copycenter = copycenter
import qt
@@ -528,13 +528,13 @@ def runGuiApp(copycenter, name):
import sys
self.ListViewDialog = ListViewDialog
- qt.QDialog.__init__(self, parent, "Dialog", 1, qt.Qt.WDestructiveClose)
+ qt.QDialog.__init__(self, tqparent, "Dialog", 1, qt.Qt.WDestructiveClose)
self.setCaption("Copy Center")
- layout = qt.QVBoxLayout(self)
+ tqlayout = qt.QVBoxLayout(self)
box = qt.QVBox(self)
box.setMargin(6)
box.setSpacing(6)
- layout.addWidget(box)
+ tqlayout.addWidget(box)
self.tab = qt.QTabWidget(box)
self.tab.setMargin(6)
box.setStretchFactor(self.tab,1)
@@ -629,7 +629,7 @@ def runGuiApp(copycenter, name):
if name == "__main__":
qtapp = qt.QApplication(sys.argv)
else:
- qtapp = qt.qApp
+ qtapp = qt.tqApp
dialog = Dialog(copycenter, qtapp.mainWidget())
dialog.exec_loop()