summaryrefslogtreecommitdiffstats
path: root/kspread/plugins/scripting/scripts/exporthtml/ExportHtml.py
diff options
context:
space:
mode:
Diffstat (limited to 'kspread/plugins/scripting/scripts/exporthtml/ExportHtml.py')
-rwxr-xr-xkspread/plugins/scripting/scripts/exporthtml/ExportHtml.py58
1 files changed, 29 insertions, 29 deletions
diff --git a/kspread/plugins/scripting/scripts/exporthtml/ExportHtml.py b/kspread/plugins/scripting/scripts/exporthtml/ExportHtml.py
index 7d308ab2..a72c5f6c 100755
--- a/kspread/plugins/scripting/scripts/exporthtml/ExportHtml.py
+++ b/kspread/plugins/scripting/scripts/exporthtml/ExportHtml.py
@@ -16,30 +16,30 @@ Dual-licensed under LGPL v2+higher and the BSD license.
import os, sys
try:
- from TQt import qt
+ from TQt import tqt
except (ImportError):
raise Exception("Failed to import the required PyTQt python module.")
-class Dialog(tqt.QDialog):
+class Dialog(tqt.TQDialog):
def __init__(self, scriptpath, parent):
self.scriptpath = scriptpath
import krosskspreadcore
self.doc = krosskspreadcore.get("KSpreadDocument")
- from TQt import qt
- qt.TQDialog.__init__(self, parent, "Dialog", 1, qt.TQt.WDestructiveClose)
+ from TQt import tqt
+ tqt.TQDialog.__init__(self, parent, "Dialog", 1, tqt.TQt.WDestructiveClose)
self.setCaption("Export to HTML File")
- layout = qt.TQVBoxLayout(self)
- box = qt.TQVBox(self)
+ layout = tqt.TQVBoxLayout(self)
+ box = tqt.TQVBox(self)
box.setMargin(10)
box.setSpacing(10)
layout.addWidget(box)
- sheetbox = qt.TQHBox(box)
+ sheetbox = tqt.TQHBox(box)
sheetbox.setSpacing(6)
- sheetlabel = qt.TQLabel("Sheet:",sheetbox)
- self.sheetcombo = qt.TQComboBox(sheetbox)
+ sheetlabel = tqt.TQLabel("Sheet:",sheetbox)
+ self.sheetcombo = tqt.TQComboBox(sheetbox)
currentsheetname = self.doc.currentSheet().name()
for sheetname in self.doc.sheetNames():
self.sheetcombo.insertItem(sheetname)
@@ -65,10 +65,10 @@ class Dialog(tqt.QDialog):
,
}
- stylebox = qt.TQHBox(box)
+ stylebox = tqt.TQHBox(box)
stylebox.setSpacing(6)
- stylelabel = qt.TQLabel("Style:",stylebox)
- self.stylecombo = qt.TQComboBox(stylebox)
+ stylelabel = tqt.TQLabel("Style:",stylebox)
+ self.stylecombo = tqt.TQComboBox(stylebox)
stylenames = list(self.styles.keys())
stylenames.sort()
for stylename in stylenames:
@@ -76,30 +76,30 @@ class Dialog(tqt.QDialog):
stylelabel.setBuddy(self.stylecombo)
stylebox.setStretchFactor(self.stylecombo,1)
- filebox = qt.TQHBox(box)
+ filebox = tqt.TQHBox(box)
filebox.setSpacing(6)
- filelabel = qt.TQLabel("File:",filebox)
- self.fileedit = qt.TQLineEdit(self.getDefaultFile(),filebox)
- btn = qt.TQPushButton("...",filebox)
- qt.TQObject.connect(btn, qt.SIGNAL("clicked()"),self.browseClicked)
+ filelabel = tqt.TQLabel("File:",filebox)
+ self.fileedit = tqt.TQLineEdit(self.getDefaultFile(),filebox)
+ btn = tqt.TQPushButton("...",filebox)
+ tqt.TQObject.connect(btn, tqt.SIGNAL("clicked()"),self.browseClicked)
filelabel.setBuddy(self.fileedit)
filebox.setStretchFactor(self.fileedit,1)
- btnbox = qt.TQHBox(box)
+ btnbox = tqt.TQHBox(box)
btnbox.setSpacing(6)
- okbtn = qt.TQPushButton(btnbox)
+ okbtn = tqt.TQPushButton(btnbox)
okbtn.setText("Export")
okbtn.setDefault(True)
- qt.TQObject.connect(okbtn,qt.SIGNAL("clicked()"),self.startExport)
- cancelbtn = qt.TQPushButton(btnbox)
+ tqt.TQObject.connect(okbtn,tqt.SIGNAL("clicked()"),self.startExport)
+ cancelbtn = tqt.TQPushButton(btnbox)
cancelbtn.setText("Cancel")
- qt.TQObject.connect(cancelbtn,qt.SIGNAL("clicked()"),self.close)
+ tqt.TQObject.connect(cancelbtn,tqt.SIGNAL("clicked()"),self.close)
box.setMinimumWidth(480)
def browseClicked(self):
- from TQt import qt
- filename = str( qt.TQFileDialog.getSaveFileName(str(self.fileedit.text()),"*.htm *.html *.xhtml;;*", self) )
+ from TQt import tqt
+ filename = str( tqt.TQFileDialog.getSaveFileName(str(self.fileedit.text()),"*.htm *.html *.xhtml;;*", self) )
if filename != "": self.fileedit.setText(filename)
def getDefaultFile(self):
@@ -119,7 +119,7 @@ class Dialog(tqt.QDialog):
return os.path.join(homepath, "kspreadexport.html")
def startExport(self):
- from TQt import qt
+ from TQt import tqt
sheetname = str( self.sheetcombo.currentText() )
sheet = self.doc.sheetByName( sheetname )
@@ -130,7 +130,7 @@ class Dialog(tqt.QDialog):
file = open(filename, "w")
except IOError as xxx_todo_changeme:
(errno, strerror) = xxx_todo_changeme.args
- qt.TQMessageBox.critical(self,"Error","<qt>Failed to create HTML file \"%s\"<br><br>%s</qt>" % (filename,strerror))
+ tqt.TQMessageBox.critical(self,"Error","<qt>Failed to create HTML file \"%s\"<br><br>%s</qt>" % (filename,strerror))
return
file.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n")
@@ -171,10 +171,10 @@ class Dialog(tqt.QDialog):
if __name__ == "__main__":
scriptpath = os.getcwd()
- qtapp = qt.TQApplication(sys.argv)
+ tqtapp = tqt.TQApplication(sys.argv)
else:
scriptpath = os.path.dirname(__name__)
- qtapp = qt.tqApp
+ tqtapp = tqt.tqApp
-dialog = Dialog(scriptpath, qtapp.mainWidget())
+dialog = Dialog(scriptpath, tqtapp.mainWidget())
dialog.exec_loop()