support for separate ListResources calls for slice and resources
[sface.git] / sface / xmlwidget.py
index 47dedeb..84e1e61 100644 (file)
@@ -191,6 +191,9 @@ class XmlWindow(QDialog):
         self.updateView()
         QDialog.show(self)
 
+    def readContent(self):
+        raise ValueError("readContent needs to be implemented in the subclass")
+
     def updateView(self):
         del self.document
         del self.model
@@ -202,12 +205,7 @@ class XmlWindow(QDialog):
 
         self.view.setModel(self.model)
 
-        #move the code below to rspec window
-        rspec_file = config.getSliceRSpecFile()
-        if not os.path.exists(rspec_file):
-            return
-
-        self.document.setContent(open(rspec_file,'r').read())
+        self.document.setContent(self.readContent())
 
         if self.document.childNodes().count() == 0:
             # empty document - do nothing
@@ -368,4 +366,3 @@ def paint(self, painter, option, index):
     document.drawContents(painter)
     painter.restore()
 
-