diff python/ide.py @ 162:d8c735dc31f9

Used new editor in ide
author Windel Bouwman
date Sun, 10 Mar 2013 11:36:55 +0100
parents 81e08e2e7777
children 8104fc8b5e90
line wrap: on
line diff
--- a/python/ide.py	Sat Mar 09 15:52:55 2013 +0100
+++ b/python/ide.py	Sun Mar 10 11:36:55 2013 +0100
@@ -10,7 +10,8 @@
 from project import Project
 import ppci
 from astviewer import AstViewer
-from codeeditor import CodeEdit
+#from codeeditor import CodeEdit
+from codeedit import CodeEdit
 stutil = __import__('st-util')
 import testc3
 
@@ -195,7 +196,7 @@
     self.loadSettings()
 
     ce = self.newFile()
-    ce.setSource(testc3.testsrc)
+    ce.Source = testc3.testsrc
 
     self.diag = ppci.DiagnosticsManager()
 
@@ -210,8 +211,10 @@
 
   def newFile(self):
      ce = CodeEdit()
-     self.mdiArea.addSubWindow(ce)
+     ce.textChanged.connect(self.buildProject)
+     w = self.mdiArea.addSubWindow(ce)
      ce.show()
+     w.resize(500, 700)
      return ce
   def openFile(self):
      filename = QFileDialog.getOpenFileName(self, "Open K# file...", "*.ks", "K# source files (*.ks)")
@@ -301,7 +304,7 @@
      #   # TODO: ask for save of opened files
      ac = self.activeMdiChild()
      if ac:
-        if ac.filename:
+        if hasattr(ac, 'filename') and ac.filename:
            self.settings.setValue('lastfile', ac.filename)
         else:
            self.settings.remove('lastfile')
@@ -333,7 +336,7 @@
      ce = self.activeMdiChild()
      print('BUILD file')
      if ce:
-        source = ce.source
+        source = ce.Source
         self.buildOutput.clear()
         self.buildOutput.append(str(self.compiler))
         ast = testc3.c3compile(source, self.diag)