Compare commits

..

No commits in common. "4357e0e0386111a82be3e7be7e8f71ca813a7edb" and "00d3add0d37d196cda0929778f693a567dcaec4d" have entirely different histories.

7 changed files with 28 additions and 197 deletions

View File

@ -184,7 +184,6 @@ class Window(QMainWindow, Ui_MainWindow):
def connect_signals_slots(self) -> None: def connect_signals_slots(self) -> None:
self.action_About.triggered.connect(self.about) self.action_About.triggered.connect(self.about)
self.action_Clear_selection.triggered.connect(self.clear_selection) self.action_Clear_selection.triggered.connect(self.clear_selection)
self.actionDebug.triggered.connect(self.debug)
self.actionClosePlaylist.triggered.connect(self.close_playlist_tab) self.actionClosePlaylist.triggered.connect(self.close_playlist_tab)
self.actionDownload_CSV_of_played_tracks.triggered.connect( self.actionDownload_CSV_of_played_tracks.triggered.connect(
self.download_played_tracks) self.download_played_tracks)
@ -257,12 +256,6 @@ class Window(QMainWindow, Ui_MainWindow):
idx = self.tabPlaylist.addTab(playlist_tab, playlist.name) idx = self.tabPlaylist.addTab(playlist_tab, playlist.name)
self.tabPlaylist.setCurrentIndex(idx) self.tabPlaylist.setCurrentIndex(idx)
def debug(self):
"""Invoke debugger"""
import ipdb
ipdb.set_trace()
def disable_play_next_controls(self) -> None: def disable_play_next_controls(self) -> None:
""" """
Disable "play next" keyboard controls Disable "play next" keyboard controls
@ -834,7 +827,6 @@ class Window(QMainWindow, Ui_MainWindow):
def show_current(self) -> None: def show_current(self) -> None:
"""Scroll to show current track""" """Scroll to show current track"""
log.debug(f"musicmuster.show_current()")
if self.current_track_playlist_tab != self.visible_playlist_tab: if self.current_track_playlist_tab != self.visible_playlist_tab:
self.tabPlaylist.setCurrentWidget(self.current_track_playlist_tab) self.tabPlaylist.setCurrentWidget(self.current_track_playlist_tab)
self.tabPlaylist.currentWidget().scroll_current_to_top() self.tabPlaylist.currentWidget().scroll_current_to_top()
@ -842,7 +834,6 @@ class Window(QMainWindow, Ui_MainWindow):
def show_next(self) -> None: def show_next(self) -> None:
"""Scroll to show next track""" """Scroll to show next track"""
log.debug(f"musicmuster.show_next()")
if self.next_track_playlist_tab != self.visible_playlist_tab: if self.next_track_playlist_tab != self.visible_playlist_tab:
self.tabPlaylist.setCurrentWidget(self.next_track_playlist_tab) self.tabPlaylist.setCurrentWidget(self.next_track_playlist_tab)
self.tabPlaylist.currentWidget().scroll_next_to_top() self.tabPlaylist.currentWidget().scroll_next_to_top()
@ -1089,10 +1080,6 @@ class DbDialog(QDialog):
self.ui.searchString.textEdited.connect(self.chars_typed) self.ui.searchString.textEdited.connect(self.chars_typed)
self.ui.track = None self.ui.track = None
if get_one_track:
self.ui.txtNote.hide()
self.ui.lblNote.hide()
record = Settings.get_int_settings(self.session, "dbdialog_width") record = Settings.get_int_settings(self.session, "dbdialog_width")
width = record.f_int or 800 width = record.f_int or 800
record = Settings.get_int_settings(self.session, "dbdialog_height") record = Settings.get_int_settings(self.session, "dbdialog_height")
@ -1113,14 +1100,11 @@ class DbDialog(QDialog):
def add_selected(self) -> None: def add_selected(self) -> None:
"""Handle Add button""" """Handle Add button"""
if (not self.ui.matchList.selectedItems() and if not self.ui.matchList.selectedItems():
not self.ui.txtNote.text()):
return return
track = None
item = self.ui.matchList.currentItem() item = self.ui.matchList.currentItem()
if item: track = item.data(Qt.UserRole)
track = item.data(Qt.UserRole)
self.add_track(track) self.add_track(track)
def add_selected_and_close(self) -> None: def add_selected_and_close(self) -> None:
@ -1137,13 +1121,10 @@ class DbDialog(QDialog):
self.accept() self.accept()
return return
self.parent().visible_playlist_tab().insert_track( self.parent().visible_playlist_tab().insert_track(self.session, track)
self.session, track, note=self.ui.txtNote.text())
# Commit session to get correct row numbers if more tracks added # Commit session to get correct row numbers if more tracks added
self.session.commit() self.session.commit()
# Clear note field and select search text to make it easier for # Select search text to make it easier for next search
# next search
self.ui.txtNote.clear()
self.select_searchtext() self.select_searchtext()
def chars_typed(self, s: str) -> None: def chars_typed(self, s: str) -> None:

View File

@ -680,8 +680,8 @@ class PlaylistTab(QTableWidget):
self.save_playlist(session) self.save_playlist(session)
self.update_display(session, clear_selection=False) self.update_display(session, clear_selection=False)
def insert_track(self, session: Session, track: Optional[Tracks], def insert_track(self, session: Session, track: Tracks,
note: str = None, repaint: bool = True) -> None: repaint: bool = True) -> None:
""" """
Insert track into playlist tab. Insert track into playlist tab.
@ -696,12 +696,7 @@ class PlaylistTab(QTableWidget):
# can be reset by calling PlaylistRows.fixup_rownumbers() later, # can be reset by calling PlaylistRows.fixup_rownumbers() later,
# so just fudge a row number for now. # so just fudge a row number for now.
row_number = 0 row_number = 0
if track: plr = PlaylistRows(session, self.playlist_id, track.id, row_number)
track_id = track.id
else:
track_id = None
plr = PlaylistRows(session, self.playlist_id,
track_id, row_number, note)
self.insert_row(session, plr) self.insert_row(session, plr)
PlaylistRows.fixup_rownumbers(session, self.playlist_id) PlaylistRows.fixup_rownumbers(session, self.playlist_id)
if repaint: if repaint:
@ -823,17 +818,13 @@ class PlaylistTab(QTableWidget):
def scroll_current_to_top(self) -> None: def scroll_current_to_top(self) -> None:
"""Scroll currently-playing row to top""" """Scroll currently-playing row to top"""
log.debug("playlists.scroll_current_to_top()")
current_row = self._get_current_track_row() current_row = self._get_current_track_row()
log.debug(f"playlists.scroll_current_to_top(), {current_row=}")
self._scroll_to_top(current_row) self._scroll_to_top(current_row)
def scroll_next_to_top(self) -> None: def scroll_next_to_top(self) -> None:
"""Scroll nextly-playing row to top""" """Scroll nextly-playing row to top"""
log.debug("playlists.scroll_next_to_top()")
next_row = self._get_next_track_row() next_row = self._get_next_track_row()
log.debug(f"playlists.scroll_next_to_top(), {next_row=}")
self._scroll_to_top(next_row) self._scroll_to_top(next_row)
def set_search(self, text: str) -> None: def set_search(self, text: str) -> None:
@ -1257,7 +1248,6 @@ class PlaylistTab(QTableWidget):
last_playtime = Playdates.last_played(session, track.id) last_playtime = Playdates.last_played(session, track.id)
last_played_str = get_relative_date(last_playtime) last_played_str = get_relative_date(last_playtime)
self.item(row, LASTPLAYED).setText(last_played_str) self.item(row, LASTPLAYED).setText(last_played_str)
self.item(row, ROW_NOTES).setText(plr.note)
self.update_display(session) self.update_display(session)

View File

@ -13,8 +13,8 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Dialog</string> <string>Dialog</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QGridLayout" name="gridLayout_2">
<item> <item row="0" column="0">
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
@ -28,42 +28,10 @@
</item> </item>
</layout> </layout>
</item> </item>
<item> <item row="1" column="0">
<widget class="QListWidget" name="matchList"/> <widget class="QListWidget" name="matchList"/>
</item> </item>
<item> <item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="lblNote">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>46</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>&amp;Note:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="buddy">
<cstring>txtNote</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="txtNote"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QRadioButton" name="radioTitle"> <widget class="QRadioButton" name="radioTitle">
@ -121,14 +89,8 @@
</item> </item>
</layout> </layout>
</item> </item>
<item> <item row="3" column="0">
<widget class="QLabel" name="dbPath"> <widget class="QLabel" name="dbPath">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>

View File

@ -1,8 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'app/ui/dlg_SearchDatabase.ui' # Form implementation generated from reading ui file 'ui/dlg_SearchDatabase.ui'
# #
# Created by: PyQt5 UI code generator 5.15.6 # Created by: PyQt5 UI code generator 5.15.4
# #
# WARNING: Any manual changes made to this file will be lost when pyuic5 is # WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing. # run again. Do not edit this file unless you know what you are doing.
@ -15,8 +15,8 @@ class Ui_Dialog(object):
def setupUi(self, Dialog): def setupUi(self, Dialog):
Dialog.setObjectName("Dialog") Dialog.setObjectName("Dialog")
Dialog.resize(584, 377) Dialog.resize(584, 377)
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) self.gridLayout_2 = QtWidgets.QGridLayout(Dialog)
self.verticalLayout.setObjectName("verticalLayout") self.gridLayout_2.setObjectName("gridLayout_2")
self.gridLayout = QtWidgets.QGridLayout() self.gridLayout = QtWidgets.QGridLayout()
self.gridLayout.setObjectName("gridLayout") self.gridLayout.setObjectName("gridLayout")
self.label = QtWidgets.QLabel(Dialog) self.label = QtWidgets.QLabel(Dialog)
@ -25,26 +25,10 @@ class Ui_Dialog(object):
self.searchString = QtWidgets.QLineEdit(Dialog) self.searchString = QtWidgets.QLineEdit(Dialog)
self.searchString.setObjectName("searchString") self.searchString.setObjectName("searchString")
self.gridLayout.addWidget(self.searchString, 0, 1, 1, 1) self.gridLayout.addWidget(self.searchString, 0, 1, 1, 1)
self.verticalLayout.addLayout(self.gridLayout) self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
self.matchList = QtWidgets.QListWidget(Dialog) self.matchList = QtWidgets.QListWidget(Dialog)
self.matchList.setObjectName("matchList") self.matchList.setObjectName("matchList")
self.verticalLayout.addWidget(self.matchList) self.gridLayout_2.addWidget(self.matchList, 1, 0, 1, 1)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.lblNote = QtWidgets.QLabel(Dialog)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.lblNote.sizePolicy().hasHeightForWidth())
self.lblNote.setSizePolicy(sizePolicy)
self.lblNote.setMaximumSize(QtCore.QSize(46, 16777215))
self.lblNote.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
self.lblNote.setObjectName("lblNote")
self.horizontalLayout_2.addWidget(self.lblNote)
self.txtNote = QtWidgets.QLineEdit(Dialog)
self.txtNote.setObjectName("txtNote")
self.horizontalLayout_2.addWidget(self.txtNote)
self.verticalLayout.addLayout(self.horizontalLayout_2)
self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout") self.horizontalLayout.setObjectName("horizontalLayout")
self.radioTitle = QtWidgets.QRadioButton(Dialog) self.radioTitle = QtWidgets.QRadioButton(Dialog)
@ -66,17 +50,11 @@ class Ui_Dialog(object):
self.btnClose = QtWidgets.QPushButton(Dialog) self.btnClose = QtWidgets.QPushButton(Dialog)
self.btnClose.setObjectName("btnClose") self.btnClose.setObjectName("btnClose")
self.horizontalLayout.addWidget(self.btnClose) self.horizontalLayout.addWidget(self.btnClose)
self.verticalLayout.addLayout(self.horizontalLayout) self.gridLayout_2.addLayout(self.horizontalLayout, 2, 0, 1, 1)
self.dbPath = QtWidgets.QLabel(Dialog) self.dbPath = QtWidgets.QLabel(Dialog)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.dbPath.sizePolicy().hasHeightForWidth())
self.dbPath.setSizePolicy(sizePolicy)
self.dbPath.setText("") self.dbPath.setText("")
self.dbPath.setObjectName("dbPath") self.dbPath.setObjectName("dbPath")
self.verticalLayout.addWidget(self.dbPath) self.gridLayout_2.addWidget(self.dbPath, 3, 0, 1, 1)
self.lblNote.setBuddy(self.txtNote)
self.retranslateUi(Dialog) self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog) QtCore.QMetaObject.connectSlotsByName(Dialog)
@ -85,7 +63,6 @@ class Ui_Dialog(object):
_translate = QtCore.QCoreApplication.translate _translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Dialog")) Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
self.label.setText(_translate("Dialog", "Title:")) self.label.setText(_translate("Dialog", "Title:"))
self.lblNote.setText(_translate("Dialog", "&Note:"))
self.radioTitle.setText(_translate("Dialog", "&Title")) self.radioTitle.setText(_translate("Dialog", "&Title"))
self.radioArtist.setText(_translate("Dialog", "&Artist")) self.radioArtist.setText(_translate("Dialog", "&Artist"))
self.btnAdd.setText(_translate("Dialog", "&Add")) self.btnAdd.setText(_translate("Dialog", "&Add"))

View File

@ -134,15 +134,9 @@ border: 1px solid rgb(85, 87, 83);</string>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QLabel" name="hdrPreviousTrack"> <widget class="QLabel" name="hdrPreviousTrack">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>16</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
@ -166,18 +160,12 @@ border: 1px solid rgb(85, 87, 83);</string>
<string/> <string/>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>false</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="hdrCurrentTrack"> <widget class="QPushButton" name="hdrCurrentTrack">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font"> <property name="font">
<font> <font>
<pointsize>20</pointsize> <pointsize>20</pointsize>
@ -186,9 +174,7 @@ border: 1px solid rgb(85, 87, 83);</string>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background-color: #d4edda; <string notr="true">background-color: #d4edda;
border: 1px solid rgb(85, 87, 83); border: 1px solid rgb(85, 87, 83);
text-align: left; text-align: left;</string>
padding-left: 8px;
</string>
</property> </property>
<property name="text"> <property name="text">
<string/> <string/>
@ -200,12 +186,6 @@ padding-left: 8px;
</item> </item>
<item> <item>
<widget class="QPushButton" name="hdrNextTrack"> <widget class="QPushButton" name="hdrNextTrack">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font"> <property name="font">
<font> <font>
<pointsize>20</pointsize> <pointsize>20</pointsize>
@ -214,8 +194,7 @@ padding-left: 8px;
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background-color: #fff3cd; <string notr="true">background-color: #fff3cd;
border: 1px solid rgb(85, 87, 83); border: 1px solid rgb(85, 87, 83);
text-align: left; text-align: left;</string>
padding-left: 8px;</string>
</property> </property>
<property name="text"> <property name="text">
<string/> <string/>
@ -842,7 +821,6 @@ padding-left: 8px;</string>
<string>&amp;Help</string> <string>&amp;Help</string>
</property> </property>
<addaction name="action_About"/> <addaction name="action_About"/>
<addaction name="actionDebug"/>
</widget> </widget>
<addaction name="menuFile"/> <addaction name="menuFile"/>
<addaction name="menuPlaylist"/> <addaction name="menuPlaylist"/>
@ -1127,11 +1105,6 @@ padding-left: 8px;</string>
<string>New from template...</string> <string>New from template...</string>
</property> </property>
</action> </action>
<action name="actionDebug">
<property name="text">
<string>Debug</string>
</property>
</action>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>

View File

@ -80,12 +80,7 @@ class Ui_MainWindow(object):
self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout") self.verticalLayout.setObjectName("verticalLayout")
self.hdrPreviousTrack = QtWidgets.QLabel(self.centralwidget) self.hdrPreviousTrack = QtWidgets.QLabel(self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) self.hdrPreviousTrack.setMinimumSize(QtCore.QSize(16, 0))
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.hdrPreviousTrack.sizePolicy().hasHeightForWidth())
self.hdrPreviousTrack.setSizePolicy(sizePolicy)
self.hdrPreviousTrack.setMinimumSize(QtCore.QSize(0, 0))
self.hdrPreviousTrack.setMaximumSize(QtCore.QSize(16777215, 16777215)) self.hdrPreviousTrack.setMaximumSize(QtCore.QSize(16777215, 16777215))
font = QtGui.QFont() font = QtGui.QFont()
font.setFamily("Sans") font.setFamily("Sans")
@ -94,40 +89,27 @@ class Ui_MainWindow(object):
self.hdrPreviousTrack.setStyleSheet("background-color: #f8d7da;\n" self.hdrPreviousTrack.setStyleSheet("background-color: #f8d7da;\n"
"border: 1px solid rgb(85, 87, 83);") "border: 1px solid rgb(85, 87, 83);")
self.hdrPreviousTrack.setText("") self.hdrPreviousTrack.setText("")
self.hdrPreviousTrack.setWordWrap(False) self.hdrPreviousTrack.setWordWrap(True)
self.hdrPreviousTrack.setObjectName("hdrPreviousTrack") self.hdrPreviousTrack.setObjectName("hdrPreviousTrack")
self.verticalLayout.addWidget(self.hdrPreviousTrack) self.verticalLayout.addWidget(self.hdrPreviousTrack)
self.hdrCurrentTrack = QtWidgets.QPushButton(self.centralwidget) self.hdrCurrentTrack = QtWidgets.QPushButton(self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.hdrCurrentTrack.sizePolicy().hasHeightForWidth())
self.hdrCurrentTrack.setSizePolicy(sizePolicy)
font = QtGui.QFont() font = QtGui.QFont()
font.setPointSize(20) font.setPointSize(20)
self.hdrCurrentTrack.setFont(font) self.hdrCurrentTrack.setFont(font)
self.hdrCurrentTrack.setStyleSheet("background-color: #d4edda;\n" self.hdrCurrentTrack.setStyleSheet("background-color: #d4edda;\n"
"border: 1px solid rgb(85, 87, 83);\n" "border: 1px solid rgb(85, 87, 83);\n"
"text-align: left;\n" "text-align: left;")
"padding-left: 8px;\n"
"")
self.hdrCurrentTrack.setText("") self.hdrCurrentTrack.setText("")
self.hdrCurrentTrack.setFlat(True) self.hdrCurrentTrack.setFlat(True)
self.hdrCurrentTrack.setObjectName("hdrCurrentTrack") self.hdrCurrentTrack.setObjectName("hdrCurrentTrack")
self.verticalLayout.addWidget(self.hdrCurrentTrack) self.verticalLayout.addWidget(self.hdrCurrentTrack)
self.hdrNextTrack = QtWidgets.QPushButton(self.centralwidget) self.hdrNextTrack = QtWidgets.QPushButton(self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.hdrNextTrack.sizePolicy().hasHeightForWidth())
self.hdrNextTrack.setSizePolicy(sizePolicy)
font = QtGui.QFont() font = QtGui.QFont()
font.setPointSize(20) font.setPointSize(20)
self.hdrNextTrack.setFont(font) self.hdrNextTrack.setFont(font)
self.hdrNextTrack.setStyleSheet("background-color: #fff3cd;\n" self.hdrNextTrack.setStyleSheet("background-color: #fff3cd;\n"
"border: 1px solid rgb(85, 87, 83);\n" "border: 1px solid rgb(85, 87, 83);\n"
"text-align: left;\n" "text-align: left;")
"padding-left: 8px;")
self.hdrNextTrack.setText("") self.hdrNextTrack.setText("")
self.hdrNextTrack.setFlat(True) self.hdrNextTrack.setFlat(True)
self.hdrNextTrack.setObjectName("hdrNextTrack") self.hdrNextTrack.setObjectName("hdrNextTrack")
@ -480,8 +462,6 @@ class Ui_MainWindow(object):
self.actionSave_as_template.setObjectName("actionSave_as_template") self.actionSave_as_template.setObjectName("actionSave_as_template")
self.actionNew_from_template = QtWidgets.QAction(MainWindow) self.actionNew_from_template = QtWidgets.QAction(MainWindow)
self.actionNew_from_template.setObjectName("actionNew_from_template") self.actionNew_from_template.setObjectName("actionNew_from_template")
self.actionDebug = QtWidgets.QAction(MainWindow)
self.actionDebug.setObjectName("actionDebug")
self.menuFile.addAction(self.actionNewPlaylist) self.menuFile.addAction(self.actionNewPlaylist)
self.menuFile.addAction(self.actionOpenPlaylist) self.menuFile.addAction(self.actionOpenPlaylist)
self.menuFile.addAction(self.actionClosePlaylist) self.menuFile.addAction(self.actionClosePlaylist)
@ -520,7 +500,6 @@ class Ui_MainWindow(object):
self.menuSearc_h.addAction(self.actionSelect_next_track) self.menuSearc_h.addAction(self.actionSelect_next_track)
self.menuSearc_h.addAction(self.actionSelect_previous_track) self.menuSearc_h.addAction(self.actionSelect_previous_track)
self.menuHelp.addAction(self.action_About) self.menuHelp.addAction(self.action_About)
self.menuHelp.addAction(self.actionDebug)
self.menubar.addAction(self.menuFile.menuAction()) self.menubar.addAction(self.menuFile.menuAction())
self.menubar.addAction(self.menuPlaylist.menuAction()) self.menubar.addAction(self.menuPlaylist.menuAction())
self.menubar.addAction(self.menuSearc_h.menuAction()) self.menubar.addAction(self.menuSearc_h.menuAction())
@ -616,6 +595,5 @@ class Ui_MainWindow(object):
self.action_About.setText(_translate("MainWindow", "&About")) self.action_About.setText(_translate("MainWindow", "&About"))
self.actionSave_as_template.setText(_translate("MainWindow", "Save as template...")) self.actionSave_as_template.setText(_translate("MainWindow", "Save as template..."))
self.actionNew_from_template.setText(_translate("MainWindow", "New from template...")) self.actionNew_from_template.setText(_translate("MainWindow", "New from template..."))
self.actionDebug.setText(_translate("MainWindow", "Debug"))
from infotabs import InfoTabs from infotabs import InfoTabs
import icons_rc import icons_rc

30
test.py
View File

@ -1,30 +0,0 @@
#!/usr/bin/env python
from PyQt5 import QtGui, QtWidgets
class TabBar(QtWidgets.QTabWidget):
def paintEvent(self, event):
painter = QtGui.QStylePainter(self)
option = QtGui.QStyleOptionTab()
for index in range(self.count()):
self.initStyleOption(option, index)
bgcolor = QtGui.QColor(self.tabText(index))
option.palette.setColor(QtGui.QPalette.Window, bgcolor)
painter.drawControl(QtGui.QStyle.CE_TabBarTabShape, option)
painter.drawControl(QtGui.QStyle.CE_TabBarTabLabel, option)
class Window(QtWidgets.QTabWidget):
def __init__(self):
QtGui.QTabWidget.__init__(self)
self.setTabBar(TabBar(self))
for color in 'tomato orange yellow lightgreen skyblue plum'.split():
self.addTab(QtGui.QWidget(self), color)
if __name__ == '__main__':
import sys
app = QtGui.QApplication(sys.argv)
window = Window()
window.resize(420, 200)
window.show()
sys.exit(app.exec_())