From ded8496439c0a1bfa2d244470cbd99113b8e84be Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 13 Oct 2020 13:49:22 +0200 Subject: Port to PyQt5. --- nephilim/plugins/Notify.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'nephilim/plugins/Notify.py') diff --git a/nephilim/plugins/Notify.py b/nephilim/plugins/Notify.py index bb01aab..6ac0be3 100644 --- a/nephilim/plugins/Notify.py +++ b/nephilim/plugins/Notify.py @@ -16,7 +16,7 @@ # along with Nephilim. If not, see . # -from PyQt4 import QtGui, QtCore +from PyQt5 import QtGui, QtWidgets, QtCore from ..common import sec2min, APPNAME, expand_tags from ..plugin import Plugin @@ -25,7 +25,7 @@ from .. import plugins NOTIFY_PRIORITY_SONG = 1 NOTIFY_PRIORITY_VOLUME = 2 -class winNotify(QtGui.QWidget): +class winNotify(QtWidgets.QWidget): parent = None p = None @@ -36,7 +36,7 @@ class winNotify(QtGui.QWidget): text_label = None def __init__(self, p): - QtGui.QWidget.__init__(self, p.parent()) + QtWidgets.QWidget.__init__(self, p.parent()) self.p = p self.parent = p.parent() @@ -44,12 +44,12 @@ class winNotify(QtGui.QWidget): self.timer.setSingleShot(True) self.timer.timeout.connect(self._hide) - layout = QtGui.QHBoxLayout() - self.cover_label = QtGui.QLabel() - self.text_label = QtGui.QLabel() + layout = QtWidgets.QHBoxLayout() + self.cover_label = QtWidgets.QLabel() + self.text_label = QtWidgets.QLabel() self.text_label.setWordWrap(True) - self.setLayout(QtGui.QHBoxLayout()) + self.setLayout(QtWidgets.QHBoxLayout()) self.layout().addWidget(self.cover_label) self.layout().addWidget(self.text_label) @@ -60,7 +60,7 @@ class winNotify(QtGui.QWidget): font.setPixelSize(20) self.setFont(font) - ac = QtGui.QApplication.instance().plugins.plugin('AlbumCover') + ac = QtWidgets.QApplication.instance().plugins.plugin('AlbumCover') if ac: ac.cover_changed.connect(self.on_cover_changed) @@ -91,7 +91,7 @@ class winNotify(QtGui.QWidget): self._current_priority = -1 def centerH(self): - screen = QtGui.QDesktopWidget().screenGeometry() + screen = QtWidgets.QDesktopWidget().screenGeometry() size = self.geometry() self.move((screen.width()-size.width())/2, 100) @@ -142,12 +142,12 @@ class Notify(Plugin): Plugin.SettingsWidget.__init__(self, plugin) self.settings.beginGroup(self.plugin.name) - self.format = QtGui.QLineEdit(self.settings.value('songformat')) + self.format = QtWidgets.QLineEdit(self.settings.value('songformat')) - self.timer = QtGui.QLineEdit(self.settings.value('timer')) + self.timer = QtWidgets.QLineEdit(self.settings.value('timer')) self.timer.setValidator(QtGui.QIntValidator(self.timer)) - self.setLayout(QtGui.QVBoxLayout()) + self.setLayout(QtWidgets.QVBoxLayout()) self._add_widget(self.format, 'Format', 'Format of notifications. All tags supported by MPD\n' 'will be expanded to their values for current song,\n' 'e.g. ${track}, ${title}, ${artist}, ${album}, ${length}, ${date}, etc.') -- cgit v1.2.3