minor changes to mainwindow.py
[sface.git] / sface / mainwindow.py
index 39e68a0..ab552ce 100644 (file)
@@ -8,6 +8,7 @@ from PyQt4.QtGui import *
 
 from sface.config import config
 from sface.logwindow import LogWindow
 
 from sface.config import config
 from sface.logwindow import LogWindow
+from sface.xmlwindow import XmlWindow
 from sface.screens.configscreen import ConfigScreen
 from sface.screens.mainscreen import MainScreen
 
 from sface.screens.configscreen import ConfigScreen
 from sface.screens.mainscreen import MainScreen
 
@@ -60,6 +61,7 @@ class MainWindow(QWidget):
         QWidget.__init__(self, parent)
 
         self.logWindow = LogWindow(self)
         QWidget.__init__(self, parent)
 
         self.logWindow = LogWindow(self)
+        self.xmlWindow = XmlWindow(self)
 
         self.pix = QLabel(self)
         self.config_screen = ConfigScreen(self)
 
         self.pix = QLabel(self)
         self.config_screen = ConfigScreen(self)
@@ -77,11 +79,13 @@ class MainWindow(QWidget):
 
         self.status = Status(self)
         self.log = QLabel("<a href='showlog'>Show Log</a>", self)
 
         self.status = Status(self)
         self.log = QLabel("<a href='showlog'>Show Log</a>", self)
+        self.xml = QLabel("<a href='showrspec'>Show RSpec</a>", self)
 
         hlayout = QHBoxLayout()
         hlayout.addWidget(self.status)
         hlayout.addStretch()
         hlayout.addWidget(self.log)
 
         hlayout = QHBoxLayout()
         hlayout.addWidget(self.status)
         hlayout.addStretch()
         hlayout.addWidget(self.log)
+        hlayout.addWidget(self.xml)
 
         layout = QVBoxLayout()
         layout.addWidget(self.nav)
 
         layout = QVBoxLayout()
         layout.addWidget(self.nav)
@@ -94,6 +98,8 @@ class MainWindow(QWidget):
                      self.animateToScreen)
         self.connect(self.log, SIGNAL('linkActivated(QString)'),
                      self.showLogWindow)
                      self.animateToScreen)
         self.connect(self.log, SIGNAL('linkActivated(QString)'),
                      self.showLogWindow)
+        self.connect(self.xml, SIGNAL('linkActivated(QString)'),
+                     self.showXmlWindow)
 
     def redirectOutputToLog(self):
         self.logWindow.redirectOutput()
 
     def redirectOutputToLog(self):
         self.logWindow.redirectOutput()
@@ -104,6 +110,12 @@ class MainWindow(QWidget):
         self.logWindow.raise_()
         self.logWindow.activateWindow()
 
         self.logWindow.raise_()
         self.logWindow.activateWindow()
 
+    def showXmlWindow(self, link):
+        self.xmlWindow.show()
+        self.xmlWindow.resize(500, 500)
+        self.xmlWindow.raise_()
+        self.xmlWindow.activateWindow()
+
     def animatePixmap(self, y):
         self.pix.move(0, y)
 
     def animatePixmap(self, y):
         self.pix.move(0, y)