X-Git-Url: http://git.onelab.eu/?p=sface.git;a=blobdiff_plain;f=sface%2Fmainwindow.py;h=0b52d95670689bad917ae6632d5eeb43005edb07;hp=c1c80b63faa9e64f359fa3ee45fd5ef88720a823;hb=08264e3523d39d7dc843c3a96a0a2849c6eb8a49;hpb=dd3e0cf249a536798fcbb3aaf788dca1d674ab26 diff --git a/sface/mainwindow.py b/sface/mainwindow.py index c1c80b6..0b52d95 100644 --- a/sface/mainwindow.py +++ b/sface/mainwindow.py @@ -62,6 +62,7 @@ class Status(QLabel): self.setText("") QTimer.singleShot(1500, self.sliceUpdateDate) + class MainWindow(QWidget): def __init__(self, parent=None): QWidget.__init__(self, parent) @@ -141,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) @@ -171,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)