eric6/MicroPython/MicroPythonProgressInfoDialog.py

Sat, 27 Feb 2021 12:08:23 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 27 Feb 2021 12:08:23 +0100
changeset 8138
169e65a6787c
parent 7923
91e843545d9a
child 8143
2c730d5fd177
permissions
-rw-r--r--

Shell: added functionality to show a prompt when the main client process has exited (e.g. a script ended).

7083
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
3 # Copyright (c) 2019 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
7083
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a dialog to show progress messages.
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10 from PyQt5.QtCore import pyqtSlot
7084
3eddfc540614 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7083
diff changeset
11 from PyQt5.QtGui import QTextCursor
7083
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12 from PyQt5.QtWidgets import QDialog
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14 from .Ui_MicroPythonProgressInfoDialog import Ui_MicroPythonProgressInfoDialog
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 class MicroPythonProgressInfoDialog(QDialog, Ui_MicroPythonProgressInfoDialog):
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 """
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 Class implementing a dialog to show progress messages.
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 """
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 def __init__(self, parent=None):
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 """
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 Constructor
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 @param parent reference to the parent widget
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 @type QWidget
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 """
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 super(MicroPythonProgressInfoDialog, self).__init__(parent)
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 self.setupUi(self)
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 @pyqtSlot(str)
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 def addMessage(self, message):
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 """
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 Public slot to add a message to the progress display.
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 @param message progress information to be shown
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 @type str
217862c28319 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 """
7084
3eddfc540614 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7083
diff changeset
39 tc = self.progressEdit.textCursor()
3eddfc540614 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7083
diff changeset
40 tc.movePosition(QTextCursor.End)
3eddfc540614 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7083
diff changeset
41 self.progressEdit.setTextCursor(tc)
3eddfc540614 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7083
diff changeset
42 self.progressEdit.appendHtml(message)
3eddfc540614 MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7083
diff changeset
43 self.progressEdit.ensureCursorVisible()

eric ide

mercurial