Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime van Kessel <nallath@gmail.com>2017-09-20 11:43:06 +0300
committerJaime van Kessel <nallath@gmail.com>2017-09-20 11:43:06 +0300
commit3cdf3f609779db443d01decfd9903e2a0c168d5b (patch)
tree7ce780389ee0a411ea1548977b6724921082f9ac /cura/CuraSplashScreen.py
parent5d4b23e72a86277e51143af886d551824670b21f (diff)
parentddacdf523eca634ce78582dc226dbae9133fe321 (diff)
Merge branch '3.0' of github.com:Ultimaker/Cura
Diffstat (limited to 'cura/CuraSplashScreen.py')
-rw-r--r--cura/CuraSplashScreen.py26
1 files changed, 24 insertions, 2 deletions
diff --git a/cura/CuraSplashScreen.py b/cura/CuraSplashScreen.py
index ac06d665d5..4fc81e815f 100644
--- a/cura/CuraSplashScreen.py
+++ b/cura/CuraSplashScreen.py
@@ -3,7 +3,7 @@
from threading import Thread, Event
-from PyQt5.QtCore import Qt, QCoreApplication
+from PyQt5.QtCore import Qt, QCoreApplication, QTimer
from PyQt5.QtGui import QPixmap, QColor, QFont, QPen, QPainter
from PyQt5.QtWidgets import QSplashScreen
@@ -24,10 +24,22 @@ class CuraSplashScreen(QSplashScreen):
self._loading_image_rotation_angle = 0
self._to_stop = False
+ self._change_timer = QTimer()
+ self._change_timer.setInterval(50)
+ self._change_timer.setSingleShot(False)
+ #self.timeoutSignal.connect(self._onTimeout)
+ self._change_timer.timeout.connect(self.updateLoadingImage)
def show(self):
super().show()
- self._to_stop = False
+ self._change_timer.start()
+
+ def updateLoadingImage(self):
+ if self._to_stop:
+ return
+
+ self._loading_image_rotation_angle -= 10
+ self.repaint()
def drawContents(self, painter):
if self._to_stop:
@@ -55,6 +67,13 @@ class CuraSplashScreen(QSplashScreen):
painter.drawText(252, 105, 330 * self._scale, 255 * self._scale, Qt.AlignLeft | Qt.AlignTop, version[1])
painter.setPen(QColor(255, 255, 255, 255))
+ # draw the loading image
+ pen = QPen()
+ pen.setWidth(6 * self._scale)
+ pen.setColor(QColor(32, 166, 219, 255))
+ painter.setPen(pen)
+ painter.drawArc(60, 150, 32 * self._scale, 32 * self._scale, self._loading_image_rotation_angle * 16, 300 * 16)
+
# draw message text
if self._current_message:
font = QFont() # Using system-default font here
@@ -82,4 +101,7 @@ class CuraSplashScreen(QSplashScreen):
def close(self):
# set stop flags
self._to_stop = True
+ self._change_timer.stop()
super().close()
+
+