summarylogtreecommitdiffstats
path: root/0001-Replace_pyqt4_to_pyqt5_as_depends.patch
blob: 512ac1ca87cd2f77e54f96f36b14e81e606ede4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
diff -ura --color musicbox-0.2.5.4/NEMbox/osdlyrics.py musicbox-0.2.5.4.new/NEMbox/osdlyrics.py
--- musicbox-0.2.5.4/NEMbox/osdlyrics.py	2018-11-28 15:23:07.000000000 +0900
+++ musicbox-0.2.5.4.new/NEMbox/osdlyrics.py	2018-12-27 22:17:27.205920448 +0900
@@ -19,16 +19,16 @@
 config = Config()
 
 try:
-    from PyQt4 import QtGui, QtCore, QtDBus
+    from PyQt5 import QtGui, QtWidgets, QtCore, QtDBus
     pyqt_activity = True
 except ImportError:
     pyqt_activity = False
-    log.warn("PyQt4 module not installed.")
+    log.warn("PyQt5 module not installed.")
     log.warn("Osdlyrics Not Available.")
 
 if pyqt_activity:
 
-    class Lyrics(QtGui.QWidget):
+    class Lyrics(QtWidgets.QWidget):
 
         def __init__(self):
             super(Lyrics, self).__init__()
@@ -52,10 +52,10 @@
             self.setMinimumSize(600, 50)
             osdlyrics_size = config.get("osdlyrics_size")
             self.resize(osdlyrics_size[0], osdlyrics_size[1])
-            scn = QtGui.QApplication.desktop().screenNumber(
-                QtGui.QApplication.desktop().cursor().pos())
-            bl = QtGui.QApplication.desktop().screenGeometry(scn).bottomLeft()
-            br = QtGui.QApplication.desktop().screenGeometry(scn).bottomRight()
+            scn = QtWidgets.QApplication.desktop().screenNumber(
+                QtWidgets.QApplication.desktop().cursor().pos())
+            bl = QtWidgets.QApplication.desktop().screenGeometry(scn).bottomLeft()
+            br = QtWidgets.QApplication.desktop().screenGeometry(scn).bottomRight()
             bc = (bl + br) / 2
             frameGeo = self.frameGeometry()
             frameGeo.moveCenter(bc)
@@ -114,7 +114,7 @@
 
     def show_lyrics():
 
-        app = QtGui.QApplication(sys.argv)
+        app = QtWidgets.QApplication(sys.argv)
         lyrics = Lyrics()
         QtDBus.QDBusConnection.sessionBus().registerService('org.musicbox.Bus')
         QtDBus.QDBusConnection.sessionBus().registerObject('/', lyrics)