Mercurial > hg > RemoteViewer
changeset 32:040dce23204b
Make the log viewer window non-modal and closeable to avoid blocking the main window. This allows opening another connection while one is already running.
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Wed, 08 Oct 2014 03:26:23 +0200 |
parents | 09bde9fd3dd9 |
children | 405d546410a0 |
files | RemoteViewer/LogViewer.py RemoteViewer/LogViewer.ui RemoteViewer/Viewer.py |
diffstat | 3 files changed, 14 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/RemoteViewer/LogViewer.py Tue Oct 07 04:15:59 2014 +0200 +++ b/RemoteViewer/LogViewer.py Wed Oct 08 03:26:23 2014 +0200 @@ -1,4 +1,4 @@ -from PyQt4.QtCore import pyqtSignal +from PyQt4.QtCore import Qt, pyqtSignal from PyQt4.QtGui import QDialog from .Ui_LogViewer import Ui_LogViewer @@ -8,8 +8,16 @@ def __init__(self): super(LogViewer, self).__init__() + self.__setupUi() + # make the dialog minimizable + self.setWindowFlags(self.windowFlags() & Qt.WindowMinimizeButtonHint) + self.__connectSignals() + + def __setupUi(self): self.ui = Ui_LogViewer() self.ui.setupUi(self) + + def __connectSignals(self): self.appendSignal.connect(self.ui.logText.appendPlainText) self.closeSignal.connect(self.close)
--- a/RemoteViewer/LogViewer.ui Tue Oct 07 04:15:59 2014 +0200 +++ b/RemoteViewer/LogViewer.ui Wed Oct 08 03:26:23 2014 +0200 @@ -17,6 +17,9 @@ <iconset resource="resources.qrc"> <normaloff>:/icons/remote.png</normaloff>:/icons/remote.png</iconset> </property> + <property name="sizeGripEnabled"> + <bool>true</bool> + </property> <layout class="QVBoxLayout" name="verticalLayout"> <item> <widget class="QPlainTextEdit" name="logText">
--- a/RemoteViewer/Viewer.py Tue Oct 07 04:15:59 2014 +0200 +++ b/RemoteViewer/Viewer.py Wed Oct 08 03:26:23 2014 +0200 @@ -52,10 +52,11 @@ logViewer = self.__createLogViewer() readThread = ReadThread(self.process, logViewer) readThread.start() - logViewer.exec_() + logViewer.show() def __createLogViewer(self): viewer = LogViewer() + viewer.setModal(False) viewer.setWindowTitle(self.connection.displayString()) command = 'running ' + ' '.join(self.command) + '\n' viewer.append(command)