From 04766b207afba7961d4d802313e426f5a2fbef63 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 10 Aug 2011 22:19:39 +0000 Subject: rename the following methods: tqparent parent tqmask mask git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1246260 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- .../scripting/scripts/exporthtml/ExportHtml.py | 4 +- .../scripting/scripts/scripteditor/ScriptEditor.py | 110 ++++++++++----------- 2 files changed, 57 insertions(+), 57 deletions(-) (limited to 'kspread/plugins/scripting/scripts') diff --git a/kspread/plugins/scripting/scripts/exporthtml/ExportHtml.py b/kspread/plugins/scripting/scripts/exporthtml/ExportHtml.py index d4ab99ed..a34a4dd1 100755 --- a/kspread/plugins/scripting/scripts/exporthtml/ExportHtml.py +++ b/kspread/plugins/scripting/scripts/exporthtml/ExportHtml.py @@ -21,14 +21,14 @@ except (ImportError): raise "Failed to import the required PyQt python module." class Dialog(qt.QDialog): - def __init__(self, scriptpath, tqparent): + def __init__(self, scriptpath, parent): self.scriptpath = scriptpath import krosskspreadcore self.doc = krosskspreadcore.get("KSpreadDocument") import qt - qt.QDialog.__init__(self, tqparent, "Dialog", 1, qt.Qt.WDestructiveClose) + qt.QDialog.__init__(self, parent, "Dialog", 1, qt.Qt.WDestructiveClose) self.setCaption("Export to HTML File") tqlayout = qt.QVBoxLayout(self) box = qt.QVBox(self) diff --git a/kspread/plugins/scripting/scripts/scripteditor/ScriptEditor.py b/kspread/plugins/scripting/scripts/scripteditor/ScriptEditor.py index f434bce5..7afde8b9 100755 --- a/kspread/plugins/scripting/scripts/scripteditor/ScriptEditor.py +++ b/kspread/plugins/scripting/scripts/scripteditor/ScriptEditor.py @@ -54,8 +54,8 @@ class EditWidget(Widget): return self.edit.text() class FileWidget(Widget): - def __init__(self, parentwidget, label, filtertqmask, openfiledialog = True): - self.filtertqmask = filtertqmask + def __init__(self, parentwidget, label, filtermask, openfiledialog = True): + self.filtermask = filtermask self.openfiledialog = openfiledialog import qt global Widget @@ -68,9 +68,9 @@ class FileWidget(Widget): import qt text = str( self.edit.text() ) if self.openfiledialog: - filename = str( qt.QFileDialog.getOpenFileName(text, self.filtertqmask, self.parentwidget) ) + filename = str( qt.QFileDialog.getOpenFileName(text, self.filtermask, self.parentwidget) ) else: - filename = qt.QFileDialog.getSaveFileName(text, self.filtertqmask, self.parentwidget) + filename = qt.QFileDialog.getSaveFileName(text, self.filtermask, self.parentwidget) if filename != "": self.edit.setText( filename ) def value(self): return self.edit.text() @@ -105,9 +105,9 @@ class Samples: class PrintDriverDetails: """ Print a the list of available KexiDB drivers and print details about one of them. """ name = "Details about a driver" - def __init__(self, tqparent): + def __init__(self, parent): self.widgets = { - "DriverName" : Samples.KexiDB._DriverWidget( tqparent.parentwidget ), + "DriverName" : Samples.KexiDB._DriverWidget( parent.parentwidget ), } def getCode(self): return ( @@ -125,9 +125,9 @@ class Samples: class ConnectWithFile: """ Connect with a KexiDB database by using a Kexi Connection Project File. """ name = "Connect with file" - def __init__(self, tqparent): + def __init__(self, parent): self.widgets = { - "ProjectFile" : Samples.KexiDB._ProjectWidget( tqparent.parentwidget ), + "ProjectFile" : Samples.KexiDB._ProjectWidget( parent.parentwidget ), } def getCode(self): return ( @@ -164,10 +164,10 @@ class Samples: class IterateThroughTable: """ Iterate through a table within a connected KexiDB database. """ name = "Iterate through table" - def __init__(self, tqparent): + def __init__(self, parent): self.widgets = { - "ProjectFile" : Samples.KexiDB._ProjectWidget( tqparent.parentwidget ), - "TableName" : Samples.KexiDB._TableWidget( tqparent.parentwidget ), + "ProjectFile" : Samples.KexiDB._ProjectWidget( parent.parentwidget ), + "TableName" : Samples.KexiDB._TableWidget( parent.parentwidget ), } def getCode(self): return ( @@ -261,12 +261,12 @@ class Samples: class SetTextOfCells: """ Set the text of the defined cells. """ name = "Set text of cells" - def __init__(self, tqparent): + def __init__(self, parent): pass self.widgets = { - "SheetName" : Samples.KSpread._SheetWidget( tqparent.parentwidget ), - "Cells" : Samples.KSpread._CellsWidget( tqparent.parentwidget ), - "Value" : Samples.KSpread._ValueWidget( tqparent.parentwidget ), + "SheetName" : Samples.KSpread._SheetWidget( parent.parentwidget ), + "Cells" : Samples.KSpread._CellsWidget( parent.parentwidget ), + "Value" : Samples.KSpread._ValueWidget( parent.parentwidget ), } def getCode(self): return ( @@ -292,13 +292,13 @@ class Samples: class SetColorsOfCells: """ Set the colors of the defined cells. """ name = "Set colors of cells" - def __init__(self, tqparent): + def __init__(self, parent): pass self.widgets = { - "SheetName" : Samples.KSpread._SheetWidget( tqparent.parentwidget), - "Cells" : Samples.KSpread._CellsWidget( tqparent.parentwidget ), - "TextColor" : Samples.KSpread._ColorWidget( tqparent.parentwidget, "Textcolor", "ff0000" ), - "BackgroundColor" : Samples.KSpread._ColorWidget( tqparent.parentwidget, "Backgroundcolor", "c0c0c0" ), + "SheetName" : Samples.KSpread._SheetWidget( parent.parentwidget), + "Cells" : Samples.KSpread._CellsWidget( parent.parentwidget ), + "TextColor" : Samples.KSpread._ColorWidget( parent.parentwidget, "Textcolor", "ff0000" ), + "BackgroundColor" : Samples.KSpread._ColorWidget( parent.parentwidget, "Backgroundcolor", "c0c0c0" ), } def getCode(self): return ( @@ -324,10 +324,10 @@ class Samples: class IterateThroughCellsWithContent: """ Iterate over all cells in a sheet that have content (aka that are not empty). """ name = "Iterate through cells" - def __init__(self, tqparent): + def __init__(self, parent): pass self.widgets = { - "SheetName" : Samples.KSpread._SheetWidget( tqparent.parentwidget ), + "SheetName" : Samples.KSpread._SheetWidget( parent.parentwidget ), } def getCode(self): return ( @@ -352,9 +352,9 @@ class Samples: class PrintSheetDetails: """ Print details about the current sheet. """ name = "Details about a sheet" - def __init__(self, tqparent): + def __init__(self, parent): self.widgets = { - "SheetName" : Samples.KSpread._SheetWidget( tqparent.parentwidget ), + "SheetName" : Samples.KSpread._SheetWidget( parent.parentwidget ), } def getCode(self): return ( @@ -376,10 +376,10 @@ class Samples: class LoadDocFromNativeXML: """ Load the document from a native XML file. """ name = "Load document from native XML File" - def __init__(self, tqparent): + def __init__(self, parent): global FileWidget self.widgets = { - "FileName" : FileWidget( tqparent.parentwidget, "XML File:", "*.xml;;*" ), + "FileName" : FileWidget( parent.parentwidget, "XML File:", "*.xml;;*" ), } def getCode(self): return ( @@ -413,10 +413,10 @@ class Samples: class SaveDocToNativeXML: """ Save the document to a native XML file. """ name = "Save document to native XML File" - def __init__(self, tqparent): + def __init__(self, parent): global FileWidget self.widgets = { - "FileName" : FileWidget( tqparent.parentwidget, "XML File:", "*.xml;;*", False ), + "FileName" : FileWidget( parent.parentwidget, "XML File:", "*.xml;;*", False ), } def getCode(self): return ( @@ -451,10 +451,10 @@ class Samples: class CopySheets: """ Copy the text-content from one sheet to another. """ name = "Copy sheets" - def __init__(self, tqparent): + def __init__(self, parent): self.widgets = { - "SourceSheet" : Samples.KSpread._SheetWidget( tqparent.parentwidget, "Source sheet:" ), - "TargetSheet" : Samples.KSpread._SheetWidget( tqparent.parentwidget, "Target sheet:" ), + "SourceSheet" : Samples.KSpread._SheetWidget( parent.parentwidget, "Source sheet:" ), + "TargetSheet" : Samples.KSpread._SheetWidget( parent.parentwidget, "Target sheet:" ), } def getCode(self): return ( @@ -480,10 +480,10 @@ class Samples: class LoadSheetFromCSV: """ Load the content of a CSV file into a KSpread sheet. """ name = "Load data from CSV file into sheet" - def __init__(self, tqparent): + def __init__(self, parent): self.widgets = { - "Sheet" : Samples.KSpread._SheetWidget( tqparent.parentwidget ), - "FileName" : FileWidget( tqparent.parentwidget, "CSV File:", "*.csv;;*", True ), + "Sheet" : Samples.KSpread._SheetWidget( parent.parentwidget ), + "FileName" : FileWidget( parent.parentwidget, "CSV File:", "*.csv;;*", True ), } def getCode(self): return ( @@ -519,10 +519,10 @@ class Samples: class SaveSheetToCSV: """ Save the content of a KSpread sheet into a CSV file. """ name = "Save data from a sheet into a CSV file" - def __init__(self, tqparent): + def __init__(self, parent): self.widgets = { - "Sheet" : Samples.KSpread._SheetWidget( tqparent.parentwidget ), - "FileName" : FileWidget( tqparent.parentwidget, "CSV File:", "*.csv;;*", False ), + "Sheet" : Samples.KSpread._SheetWidget( parent.parentwidget ), + "FileName" : FileWidget( parent.parentwidget, "CSV File:", "*.csv;;*", False ), } def getCode(self): return ( @@ -563,10 +563,10 @@ class Samples: class OpenFileDialog: """ Show the usage of the openfile dialog with QFileDialog. """ name = "Open File Dialog" - def __init__(self, tqparent): + def __init__(self, parent): pass self.widgets = { - "FileName" : FileWidget( tqparent.parentwidget, "Open File:", "*.txt *.html;;*" ), + "FileName" : FileWidget( parent.parentwidget, "Open File:", "*.txt *.html;;*" ), } def getCode(self): return ( @@ -578,10 +578,10 @@ class Samples: class SaveFileDialog: """ Show the usage of the savefile dialog with QFileDialog. """ name = "Save File Dialog" - def __init__(self, tqparent): + def __init__(self, parent): pass self.widgets = { - "FileName" : FileWidget( tqparent.parentwidget, "Save File:", "*.txt *.html;;*", False ), + "FileName" : FileWidget( parent.parentwidget, "Save File:", "*.txt *.html;;*", False ), } def getCode(self): return ( @@ -593,7 +593,7 @@ class Samples: class CustomDialog: """ Show a custom dialog that inherits a QDialog. """ name = "Custom Dialog" - def __init__(self, tqparent): + def __init__(self, parent): pass self.widgets = { } @@ -602,9 +602,9 @@ class Samples: 'import qt', '', 'class MyDialog(qt.QDialog):', - ' def __init__(self, tqparent):', + ' def __init__(self, parent):', ' import qt', - ' qt.QDialog.__init__(self, tqparent, "MyDialog", 1, qt.Qt.WDestructiveClose)', + ' qt.QDialog.__init__(self, parent, "MyDialog", 1, qt.Qt.WDestructiveClose)', ' self.setCaption("My Dialog")', ' btn = qt.QPushButton("Click me",self)', ' qt.QObject.connect(btn, qt.SIGNAL("clicked()"), self.buttonClicked)', @@ -619,11 +619,11 @@ class Samples: class InputDialog: """ Show how to use a QInputDialog. """ name = "Input Dialog" - def __init__(self, tqparent): + def __init__(self, parent): global EditWidget self.widgets = { - "Caption" : EditWidget( tqparent.parentwidget, "Caption" ), - "Message" : EditWidget( tqparent.parentwidget, "Message" ), + "Caption" : EditWidget( parent.parentwidget, "Caption" ), + "Message" : EditWidget( parent.parentwidget, "Message" ), } def getCode(self): return ( @@ -646,7 +646,7 @@ class Samples: class PrintClipboard: """ Print the content from the clipper via DCOP. """ name = "Clipboard content" - def __init__(self, tqparent): + def __init__(self, parent): self.widgets = { } def getCode(self): @@ -663,7 +663,7 @@ class Samples: class AmarokCollectionInfos: """ Fetch some collection informations from the amarok collection via DCOP. """ name = "amarok collection infos" - def __init__(self, tqparent): + def __init__(self, parent): self.widgets = { } def getCode(self): @@ -688,7 +688,7 @@ class Samples: class KopeteContacts: """ Print the names of all contacts Kopete knows via DCOP. """ name = "Kopete contacts" - def __init__(self, tqparent): + def __init__(self, parent): self.widgets = { } def getCode(self): @@ -711,7 +711,7 @@ class Samples: class KWordSelectedText: """ Get the selected text from a KWord instance via DCOP. """ name = "KWord selected text" - def __init__(self, tqparent): + def __init__(self, parent): self.widgets = { } def getCode(self): @@ -759,9 +759,9 @@ class Samples: # Dialog implementations. class SampleDialog(qt.QDialog): - def __init__(self, tqparent, sampleclazz, samplechildclazz): + def __init__(self, parent, sampleclazz, samplechildclazz): import qt - qt.QDialog.__init__(self, tqparent, "SampleDialog", 1) + qt.QDialog.__init__(self, parent, "SampleDialog", 1) tqlayout = qt.QVBoxLayout(self) box = qt.QVBox(self) @@ -817,7 +817,7 @@ class SampleDialog(qt.QDialog): return code class MainDialog(qt.QDialog): - def __init__(self, scriptpath, tqparent): + def __init__(self, scriptpath, parent): self.scriptpath = scriptpath if not hasattr(__main__,"scripteditorfilename"): __main__.scripteditorfilename = self.getFileName("myscript.py") @@ -826,7 +826,7 @@ class MainDialog(qt.QDialog): self.doc = krosskspreadcore.get("KSpreadDocument") import os, qt - qt.QDialog.__init__(self, tqparent, "MainDialog", 1, qt.Qt.WDestructiveClose) + qt.QDialog.__init__(self, parent, "MainDialog", 1, qt.Qt.WDestructiveClose) self.setCaption("Script Editor") tqlayout = qt.QVBoxLayout(self) -- cgit v1.2.1