Merge branch 'master' of git://git.onelab.eu/sface
authorGiovanni Gherdovich <ggherdov@brentaal.inria.fr>
Mon, 20 Sep 2010 17:20:32 +0000 (19:20 +0200)
committerGiovanni Gherdovich <ggherdov@brentaal.inria.fr>
Mon, 20 Sep 2010 17:20:32 +0000 (19:20 +0200)
INSTALL
sface.bin
sface/logwindow.py
sface/mainwindow.py
sface/rspecwindow.py
sface/screens/configscreen.py
sface/screens/mainscreen.py

diff --git a/INSTALL b/INSTALL
index 80f6901..2c77fe8 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -1,15 +1,27 @@
 
 
-(1) Install SFA command line tools (sfi.py): http://svn.planet-lab.org/wiki/SFAInstallationGuide
+(1) Install SFA command line tools (sfi.py):
+
+Please find the installation instructions at http://svn.planet-lab.org/wiki/SFAInstallationGuide
+
+
 (2) Install PyQt4
 
 For Linux:
+----------
 You can use the package manager to install PyQt4
 
 For Mac:
+--------
 You'll need to download and install Qt, PyQt and Sip from the following
 links:
 
 http://qt.nokia.com/downloads
 http://www.riverbankcomputing.co.uk/software/sip/download
-http://www.riverbankcomputing.co.uk/software/pyqt/download
\ No newline at end of file
+http://www.riverbankcomputing.co.uk/software/pyqt/download
+
+For Windows:
+------------
+Install ActivePython from ActiveState: http://www.activestate.com/activepython/downloads
+Install PyQt4 binaries: http://www.riverbankcomputing.co.uk/software/pyqt/download
+
index 5e7eb2e..86ba346 100755 (executable)
--- a/sface.bin
+++ b/sface.bin
@@ -1,10 +1,16 @@
 #!/bin/bash
 
-#export PATH=$HOME/stree/sfa//trunk/:$PATH
-
-PYTHONPATH=/opt/local/lib/python2.5/site-packages/
-PYTHONPATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/:$PYTHONPATH
-PYTHONPATH=$HOME/stree/sfa/trunk:$PYTHONPATH
+PYTHONPATH=$PYTHONPATH:/opt/local/lib/python2.5/site-packages/
+# thierry : I have this in my .bashrc now
+#PYTHONPATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/:$PYTHONPATH
+# ditto
+#PYTHONPATH=$HOME/stree/sfa/trunk:$PYTHONPATH
 export PYTHONPATH
 
+echo Using PYTHONPATH=$PYTHONPATH
+
+sfacedir=$(dirname $0)
+cd $sfacedir
+echo Running from directory $(pwd)
+
 exec python sface.py "$@" &
index a77eab2..c5c41dd 100644 (file)
@@ -24,6 +24,7 @@ class LogWindow(QDialog):
         QWidget.__init__(self, parent)
         self.setWindowTitle("SFI Log")
         self.text = QTextBrowser(self)
+        self.text.ensureCursorVisible()
 
         layout = QVBoxLayout()
         layout.addWidget(self.text)
@@ -40,6 +41,9 @@ class LogWindow(QDialog):
 
     def update(self):
         self.text.setText(self.logio.getText())
+        c = self.text.textCursor()
+        c.movePosition(QTextCursor.End)
+        self.text.setTextCursor(c)
         
         
         
index fde8ad8..0b52d95 100644 (file)
@@ -142,6 +142,9 @@ class MainWindow(QWidget):
             self.setStatus("Already showing %s" % curr_screen.getTitleText(), timeout=1000)
             return
 
+        # This is an optimization to have a smoother animation. We
+        # render the widget into a pixmap and animate that instead of
+        # moving the whole widget around.
         pixmap = QPixmap(self.screens.size())
         curr_screen.render(pixmap)
         self.screens.setCurrentWidget(self.pix)
@@ -172,4 +175,5 @@ class MainWindow(QWidget):
         self.status.set(msg, timeout)
 
     def nodeSelectionChanged(self, hostname):
-        self.rspecWindow.showNode(hostname)
+        if self.rspecWindow.isVisible():
+            self.rspecWindow.showNode(hostname)
index da70b1c..1e25735 100644 (file)
@@ -24,6 +24,8 @@ class RSpecView(QTreeView):
         self.collapseAll()
         self.expandToDepth(0)
 
+        model = self.model()
+
         def recursiveExpand(index):
             parent = index.parent()
             if parent and parent.isValid():
@@ -34,13 +36,13 @@ class RSpecView(QTreeView):
             if index.data().toString() == txt:
                 recursiveExpand(index)
                 self.scrollTo(index, self.PositionAtCenter)
+                return
             
             rows = model.rowCount(index)
             for r in range(rows):
                 child_index = index.child(r, 0)
                 search(child_index)
             
-        model = self.model()
         root_rows = model.rowCount()
         for r in range(root_rows):
             index = model.index(r, 0)
index 3f2440e..80105a4 100644 (file)
@@ -19,7 +19,7 @@ class ConfigWidget(QWidget):
                 if config.is_true(config.get(field)):
                     edit.setCheckState(Qt.Checked)
             else:
-                edit=QLineEdit(config.get(field), self)
+                edit=QLineEdit(config.get(field) or "", self)
                 edit.setAttribute(Qt.WA_MacShowFocusRect, 0)
             setattr(self,field,edit)
 
index 96b5728..6ffd7e0 100644 (file)
@@ -459,9 +459,13 @@ class MainScreen(SfaScreen):
         slice = SliceWidget(self)
         self.init(slice, "Main Window", "OneLab Federation GUI")
 
+    def rspecUpdated(self):
+        self.mainwin.rspecWindow.updateView()
+        
     def configurationChanged(self):
         self.widget.updateSliceName()
         self.widget.updateView()
+        self.mainwin.rspecWindow.updateView()
 
     def nodeSelectionChanged(self, hostname):
         self.mainwin.nodeSelectionChanged(hostname)