From 27bee407e8aac0fe020c061d2a8df3d6ca0f0e47 Mon Sep 17 00:00:00 2001 From: Insoleet <insomniak.fr@gmail.com> Date: Tue, 12 May 2015 11:15:58 +0200 Subject: [PATCH] Multiple fixes for windows - Toast are placed on the bottom right - Generating translations uses lrelease instead of QtChoose --- gen_translations.py | 5 ++++- src/cutecoin/core/watching/monitor.py | 3 ++- src/cutecoin/gui/toast.py | 13 +++++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/gen_translations.py b/gen_translations.py index b5c5a57e..0163910a 100644 --- a/gen_translations.py +++ b/gen_translations.py @@ -27,7 +27,10 @@ def prepare_qm(): for (ts_file, qm_file) in translations: # avoid conflict with qt4 lrelease by running qtchooser directly - subprocess.call(["qtchooser", "-run-tool=lrelease", "-qt=5", ts_file, "-qm", qm_file]) + if sys.platform.startswith('win'): + subprocess.call(["lrelease", ts_file, "-qm", qm_file]) + else: + subprocess.call(["qtchooser", "-run-tool=lrelease", "-qt=5", ts_file, "-qm", qm_file]) print(ts_file + " >> " + qm_file) diff --git a/src/cutecoin/core/watching/monitor.py b/src/cutecoin/core/watching/monitor.py index b2181a2a..ca179e92 100644 --- a/src/cutecoin/core/watching/monitor.py +++ b/src/cutecoin/core/watching/monitor.py @@ -4,7 +4,7 @@ Created on 18 mars 2015 @author: inso ''' -from PyQt5.QtCore import QThread, Qt +from PyQt5.QtCore import QThread, Qt, QObject from .blockchain import BlockchainWatcher from .persons import PersonsWatcher import logging @@ -19,6 +19,7 @@ class Monitor(object): ''' Constructor ''' + super().__init__() self.account = account self.threads_pool = [] self._blockchain_watchers = {} diff --git a/src/cutecoin/gui/toast.py b/src/cutecoin/gui/toast.py index f96cb04a..ef0c8ab7 100644 --- a/src/cutecoin/gui/toast.py +++ b/src/cutecoin/gui/toast.py @@ -6,7 +6,7 @@ Created on 1 mai 2015 import sys, time import logging from PyQt5.QtCore import Qt, QThread -from PyQt5.QtWidgets import QMainWindow +from PyQt5.QtWidgets import QMainWindow, QApplication from PyQt5.QtGui import QImage, QPixmap from ..gen_resources.toast_uic import Ui_Toast @@ -49,9 +49,14 @@ class _Toast(QMainWindow, Ui_Toast): global window # some space outside the local stack window = self # save pointer till killed to avoid GC super().__init__() - self.setWindowFlags(Qt.FramelessWindowHint) + rect = QApplication.desktop().availableGeometry() + height = rect.height() + width = rect.width() + self.setWindowFlags(Qt.FramelessWindowHint |Qt.NoDropShadowWindowHint) self.setupUi(self) - + x = width - self.width() + y = height - self.height() + self.move(x, y) self.display.setText("""<h1>{0}</h1> <p>{1}</p>""".format(title, msg)) @@ -69,4 +74,4 @@ class _ToastThread(QThread): QThread.__init__(self) def run(self): - time.sleep(2.0) \ No newline at end of file + time.sleep(2.0) -- GitLab