diff options
Diffstat (limited to 'nephilim/plugins/Songinfo.py')
-rw-r--r-- | nephilim/plugins/Songinfo.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/nephilim/plugins/Songinfo.py b/nephilim/plugins/Songinfo.py index 88496f6..d0d8ced 100644 --- a/nephilim/plugins/Songinfo.py +++ b/nephilim/plugins/Songinfo.py @@ -15,7 +15,7 @@ # along with Nephilim. If not, see <http://www.gnu.org/licenses/>. # -from PyQt4 import QtGui, QtCore +from PyQt5 import QtGui, QtWidgets, QtCore from ..plugin import Plugin @@ -71,7 +71,7 @@ class Songinfo(Plugin): self.o.set_metadata(metadata) self.mpclient.sticker_list(song['file'], self.o.set_stickers) -class SonginfoWidget(QtGui.QWidget): +class SonginfoWidget(QtWidgets.QWidget): #### PUBLIC #### "parent plugin" @@ -84,16 +84,16 @@ class SonginfoWidget(QtGui.QWidget): #### PUBLIC #### def __init__(self, plugin): - QtGui.QWidget.__init__(self) + QtWidgets.QWidget.__init__(self) self.plugin = plugin self._labels = {} - self._st_label = QtGui.QLabel('<b>Stickers:</b>', self) + self._st_label = QtWidgets.QLabel('<b>Stickers:</b>', self) self._st_label.setAlignment(QtCore.Qt.AlignHCenter) self._stickers = StickersList(self.plugin.mpclient, self) - self.setLayout(QtGui.QGridLayout()) + self.setLayout(QtWidgets.QGridLayout()) self.layout().setColumnStretch(1, 1) def set_tagtypes(self, tagtypes): @@ -113,8 +113,8 @@ class SonginfoWidget(QtGui.QWidget): self.layout().removeWidget(self._stickers) for tag in tagtypes: - label = QtGui.QLabel('<b>%s</b>'%tag) #TODO sort known tags - label1 = QtGui.QLabel() # tag value will go here + label = QtWidgets.QLabel('<b>%s</b>'%tag) #TODO sort known tags + label1 = QtWidgets.QLabel() # tag value will go here label1.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse) label.setWordWrap(True) label1.setWordWrap(True) @@ -148,12 +148,12 @@ class SettingsWidgetSonginfo(Plugin.SettingsWidget): Plugin.SettingsWidget.__init__(self, plugin) self.settings.beginGroup(self.plugin.name) - self._taglist = QtGui.QListWidget(self) - self._taglist.setDragDropMode(QtGui.QAbstractItemView.InternalMove) + self._taglist = QtWidgets.QListWidget(self) + self._taglist.setDragDropMode(QtWidgets.QAbstractItemView.InternalMove) self._update_tags() self.plugin.mpclient.connect_changed.connect(self._update_tags) - self.setLayout(QtGui.QVBoxLayout()) + self.setLayout(QtWidgets.QVBoxLayout()) self._add_widget(self._taglist, label = 'Tags', tooltip = 'A list of tags that should be displayed.\n' 'Use drag and drop to change their order') @@ -181,21 +181,21 @@ class SettingsWidgetSonginfo(Plugin.SettingsWidget): tags_enabled = self.settings.value('tagtypes') tags = self.plugin.mpclient.tagtypes for tag in [tag for tag in tags_enabled if tag in tags]: - it = QtGui.QListWidgetItem(tag) + it = QtWidgets.QListWidgetItem(tag) it.setCheckState(QtCore.Qt.Checked) self._taglist.addItem(it) for tag in [tag for tag in tags if tag not in tags_enabled]: - it = QtGui.QListWidgetItem(tag) + it = QtWidgets.QListWidgetItem(tag) it.setCheckState(QtCore.Qt.Unchecked) self._taglist.addItem(it) -class StickersList(QtGui.QTreeWidget): +class StickersList(QtWidgets.QTreeWidget): #### PUBLIC #### mpclient = None def __init__(self, mpclient, parent): - QtGui.QTreeWidget.__init__(self, parent) + QtWidgets.QTreeWidget.__init__(self, parent) self.mpclient = mpclient self.setAlternatingRowColors(True) @@ -207,5 +207,5 @@ class StickersList(QtGui.QTreeWidget): """Set displayed stickers from a (key, value) iterator.""" self.clear() for key, value in stickers: - it = QtGui.QTreeWidgetItem([key, value]) + it = QtWidgets.QTreeWidgetItem([key, value]) self.addTopLevelItem(it) |