From: Giovanni Gherdovich Date: Mon, 20 Sep 2010 17:20:32 +0000 (+0200) Subject: Merge branch 'master' of git://git.onelab.eu/sface X-Git-Tag: sface-0.1-1~8 X-Git-Url: http://git.onelab.eu/?p=sface.git;a=commitdiff_plain;h=4ab45a38d53566d12bc64403bf9b7c19108eb286;hp=79442c9e30b92e048e0a8ce78b74915b5d8b5881 Merge branch 'master' of git://git.onelab.eu/sface --- diff --git a/INSTALL b/INSTALL index 80f6901..2c77fe8 100644 --- 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 + diff --git a/sface.bin b/sface.bin index 5e7eb2e..86ba346 100755 --- 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 "$@" & diff --git a/sface/logwindow.py b/sface/logwindow.py index a77eab2..c5c41dd 100644 --- a/sface/logwindow.py +++ b/sface/logwindow.py @@ -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) diff --git a/sface/mainwindow.py b/sface/mainwindow.py index fde8ad8..0b52d95 100644 --- a/sface/mainwindow.py +++ b/sface/mainwindow.py @@ -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) diff --git a/sface/rspecwindow.py b/sface/rspecwindow.py index da70b1c..1e25735 100644 --- a/sface/rspecwindow.py +++ b/sface/rspecwindow.py @@ -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) diff --git a/sface/screens/configscreen.py b/sface/screens/configscreen.py index 3f2440e..80105a4 100644 --- a/sface/screens/configscreen.py +++ b/sface/screens/configscreen.py @@ -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) diff --git a/sface/screens/mainscreen.py b/sface/screens/mainscreen.py index 96b5728..6ffd7e0 100644 --- a/sface/screens/mainscreen.py +++ b/sface/screens/mainscreen.py @@ -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)