From: <dav...@us...> - 2007-05-24 06:37:40
|
Revision: 7261 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=7261&view=rev Author: davidfancella Date: 2007-05-23 23:37:38 -0700 (Wed, 23 May 2007) Log Message: ----------- Made the genericEditor save properly, so now it can theoretically be used to create resources Modified Paths: -------------- tools/acme/trunk/libacmegui/editors/genericEditor.py tools/acme/trunk/libacmegui/mainqt.py Modified: tools/acme/trunk/libacmegui/editors/genericEditor.py =================================================================== --- tools/acme/trunk/libacmegui/editors/genericEditor.py 2007-05-24 06:15:42 UTC (rev 7260) +++ tools/acme/trunk/libacmegui/editors/genericEditor.py 2007-05-24 06:37:38 UTC (rev 7261) @@ -26,6 +26,8 @@ from PyQt4 import QtGui, QtCore +from xml.dom import minidom + from libacmegui.editors import editorbase class genericEditor(QtGui.QTextEdit, editorbase.EditorBase): @@ -46,6 +48,10 @@ #self.setDocument(theText) self.theDocument.setModified(False) + def CommitToDom(self): + self.theResource.theDom = minidom.parseString(self.theDocument.toPlainText() ) + return [100] + def GetResource(self): return self.theResource @@ -55,44 +61,8 @@ def modificationChanged(self, state): self.emit( QtCore.SIGNAL("modificationChanged"), state) -'''sourceState = [ - SyntaxChunk(name='comment', startMark="<!--", endMark="-->", color=QtGui.QColor(100,100,100), - style="italic", includeMarks=True, state=1, priority=10), - SyntaxChunk(name='element', startMark="<", endMark=">", color=QtGui.Color(0,0,200), - style="normal", includeMarks=False, state=2, priority=5), - SyntaxChunk(name='attributesingle', startMark="'", endMark="'", color=QtGui.Color(200,0,0), - style="normal", includeMarks=True, state=3, priority=6), - SyntaxChunk(name='attributedouble', startMark='"', endMark='"', color=QtGui.Color(200,0,0), - style="normal", includeMarks=True, state=3, priority=6), -]''' - sourceState = { 'comment' : 1, 'normal' : 0, 'element' : 2, 'attribute' : 3 } -class SyntaxChunk(object): - startMark = None - endMark = None - color = None - style = None - includeMarks = None - state = None - priority = None - - def __init__(self, **args): - self.includeMarks = False - self.startMark = args['startMark'] - self.endMark = args['endMark'] - self.color = args['color'] - self.style = args['style'] - self.state = args['state'] - self.priority = args['priority'] - - if args.has_key('includeMarks'): - self.includeMarks = args['includeMarks'] - - def __cmp__(self, other): - return cmp(self.priority, other.priority) - - class ResourceHighlighter(QtGui.QSyntaxHighlighter): def CommentHighlight(self): theFormat = QtGui.QTextCharFormat() Modified: tools/acme/trunk/libacmegui/mainqt.py =================================================================== --- tools/acme/trunk/libacmegui/mainqt.py 2007-05-24 06:15:42 UTC (rev 7260) +++ tools/acme/trunk/libacmegui/mainqt.py 2007-05-24 06:37:38 UTC (rev 7261) @@ -174,6 +174,7 @@ anEditor = self.mainEditor.currentWidget() if thePath is None: thePath = self.editorList[anEditor.idstr()]['path'] + print thePath else: self.editorList[anEditor.idstr()]['path'] = thePath self.SaveResource(anEditor, thePath) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |