Implement carts
This commit is contained in:
parent
a649fa8c59
commit
1899aac9ae
@ -81,20 +81,6 @@ class Carts(Base):
|
|||||||
session.add(self)
|
session.add(self)
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def all_as_dict(cls, session: Session) -> dict:
|
|
||||||
"""Return a dictionary of all carts keyed by cart number"""
|
|
||||||
|
|
||||||
result = (
|
|
||||||
session.execute(
|
|
||||||
select(Carts)
|
|
||||||
.order_by(Carts.cart_number)
|
|
||||||
)
|
|
||||||
.scalars()
|
|
||||||
.all()
|
|
||||||
)
|
|
||||||
return {a.id: a for a in result}
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_or_create(cls, session: Session, cart_number: int) -> "Carts":
|
def get_or_create(cls, session: Session, cart_number: int) -> "Carts":
|
||||||
"""
|
"""
|
||||||
|
|||||||
@ -48,6 +48,42 @@ from ui.main_window_ui import Ui_MainWindow # type: ignore
|
|||||||
from utilities import check_db, update_bitrates
|
from utilities import check_db, update_bitrates
|
||||||
|
|
||||||
|
|
||||||
|
class CartButton(QPushButton):
|
||||||
|
"""Button for playing carts"""
|
||||||
|
|
||||||
|
def __init__(self, parent: QMainWindow, cart: Carts):
|
||||||
|
"""Create a cart pushbutton and set it disabled"""
|
||||||
|
|
||||||
|
super().__init__(parent)
|
||||||
|
self.parent = parent
|
||||||
|
self.cart_id = cart.id
|
||||||
|
self.path = cart.path
|
||||||
|
self.player = None
|
||||||
|
self.is_playing = False
|
||||||
|
|
||||||
|
self.clicked.connect(self.parent.cart_click)
|
||||||
|
self.setEnabled(True)
|
||||||
|
self.setMinimumSize(QSize(147, 61))
|
||||||
|
font = QFont()
|
||||||
|
font.setPointSize(14)
|
||||||
|
self.setFont(font)
|
||||||
|
self.setObjectName("cart_" + str(cart.cart_number))
|
||||||
|
|
||||||
|
def __repr__(self) -> str:
|
||||||
|
return (
|
||||||
|
f"<CartButton(cart_id={self.cart_id} "
|
||||||
|
f"path={self.path}, is_playing={self.is_playing}>"
|
||||||
|
)
|
||||||
|
|
||||||
|
def event(self, event):
|
||||||
|
if event.type() == QEvent.MouseButtonRelease:
|
||||||
|
if event.button() == Qt.RightButton:
|
||||||
|
self.parent.cart_edit(self, event)
|
||||||
|
return True
|
||||||
|
|
||||||
|
return super().event(event)
|
||||||
|
|
||||||
|
|
||||||
class TrackData:
|
class TrackData:
|
||||||
def __init__(self, track):
|
def __init__(self, track):
|
||||||
self.id = track.id
|
self.id = track.id
|
||||||
@ -104,50 +140,28 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
self.timer.start(Config.TIMER_MS)
|
self.timer.start(Config.TIMER_MS)
|
||||||
self.connect_signals_slots()
|
self.connect_signals_slots()
|
||||||
|
|
||||||
def cart_add(self) -> None:
|
|
||||||
"""Add a cart"""
|
|
||||||
|
|
||||||
pass
|
|
||||||
|
|
||||||
def cart_button(self, cart: Carts) -> QPushButton:
|
|
||||||
"""Create a cart pushbutton and set it disabled"""
|
|
||||||
|
|
||||||
btn = QPushButton(self)
|
|
||||||
btn.setEnabled(True)
|
|
||||||
btn.setMinimumSize(QSize(147, 61))
|
|
||||||
font = QFont()
|
|
||||||
font.setPointSize(14)
|
|
||||||
btn.setFont(font)
|
|
||||||
btn.setObjectName("cart_" + str(cart.cart_number))
|
|
||||||
btn.setText(cart.name)
|
|
||||||
btn.clicked.connect(self.cart_click)
|
|
||||||
btn.setEnabled(False)
|
|
||||||
# Insert button on left of cart space after existing buttons
|
|
||||||
self.horizontalLayout_Carts.insertWidget(len(self.carts), btn)
|
|
||||||
|
|
||||||
return btn
|
|
||||||
|
|
||||||
def cart_click(self) -> None:
|
def cart_click(self) -> None:
|
||||||
"""Handle cart click"""
|
"""Handle cart click"""
|
||||||
|
|
||||||
# print(f"cart_click({self.sender()=})")
|
|
||||||
# print(f"{self.carts[self.sender()]['name']}")
|
|
||||||
btn = self.sender()
|
btn = self.sender()
|
||||||
cart = self.carts[btn]
|
if helpers.file_is_readable(btn.path):
|
||||||
if helpers.file_is_readable(cart['path']):
|
btn.player.play()
|
||||||
cart['player'].play()
|
btn.is_playing = True
|
||||||
self.carts[btn]['playing'] = True
|
|
||||||
colour = Config.COLOUR_CART_PLAYING
|
colour = Config.COLOUR_CART_PLAYING
|
||||||
else:
|
else:
|
||||||
colour = Config.COLOUR_CART_ERROR
|
colour = Config.COLOUR_CART_ERROR
|
||||||
btn.setStyleSheet("background-color: " + colour + ";\n")
|
btn.setStyleSheet("background-color: " + colour + ";\n")
|
||||||
|
|
||||||
def cart_edit(self, cart_number: int) -> None:
|
def cart_edit(self, btn: CartButton, event: QEvent):
|
||||||
"""Edit carts"""
|
"""Handle context menu for cart button"""
|
||||||
|
|
||||||
with Session() as session:
|
with Session() as session:
|
||||||
cart = Carts.get_or_create(session, cart_number)
|
cart = session.query(Carts).get(btn.cart_id)
|
||||||
dlg = CartDialog(self, cart, cart_number)
|
if cart is None:
|
||||||
|
log.ERROR("cart_edit: cart not found")
|
||||||
|
return
|
||||||
|
|
||||||
|
dlg = CartDialog(parent=self, session=session, cart=cart)
|
||||||
if dlg.exec():
|
if dlg.exec():
|
||||||
name = dlg.ui.lineEditName.text()
|
name = dlg.ui.lineEditName.text()
|
||||||
if not name:
|
if not name:
|
||||||
@ -157,41 +171,48 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
if not path:
|
if not path:
|
||||||
QMessageBox.warning(self, "Error", "Filename required")
|
QMessageBox.warning(self, "Error", "Filename required")
|
||||||
return
|
return
|
||||||
cart.name = name
|
if cart.path and helpers.file_is_readable(cart.path):
|
||||||
cart.path = path
|
|
||||||
if cart.path:
|
|
||||||
tags = helpers.get_tags(cart.path)
|
tags = helpers.get_tags(cart.path)
|
||||||
cart.duration = tags['duration']
|
cart.duration = tags['duration']
|
||||||
|
|
||||||
cart.enabled = dlg.ui.chkEnabled.isChecked()
|
cart.enabled = dlg.ui.chkEnabled.isChecked()
|
||||||
|
cart.name = name
|
||||||
|
cart.path = path
|
||||||
|
|
||||||
session.add(cart)
|
session.add(cart)
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|
||||||
|
self.cart_configure(cart, btn)
|
||||||
|
|
||||||
def carts_init(self) -> None:
|
def carts_init(self) -> None:
|
||||||
"""Initialse carts data structures"""
|
"""Initialse carts data structures"""
|
||||||
|
|
||||||
with Session() as session:
|
with Session() as session:
|
||||||
carts_in_db = Carts.all_as_dict(session)
|
|
||||||
# Number carts from 1 for humanity
|
# Number carts from 1 for humanity
|
||||||
for cart_number in range(1, Config.CARTS_COUNT + 1):
|
for cart_number in range(1, Config.CARTS_COUNT + 1):
|
||||||
if cart_number in carts_in_db:
|
cart = session.query(Carts).get(cart_number)
|
||||||
cart = carts_in_db[cart_number]
|
if cart is None:
|
||||||
else:
|
|
||||||
cart = Carts(session, cart_number,
|
cart = Carts(session, cart_number,
|
||||||
name=f"Cart #{cart_number}")
|
name=f"Cart #{cart_number}")
|
||||||
|
|
||||||
btn = self.cart_button(cart)
|
btn = CartButton(self, cart)
|
||||||
|
# Insert button on left of cart space starting at
|
||||||
|
# location zero
|
||||||
|
self.horizontalLayout_Carts.insertWidget(cart.id - 1, btn)
|
||||||
|
# Configure button
|
||||||
|
self.cart_configure(cart, btn)
|
||||||
|
|
||||||
self.carts[btn] = {}
|
def cart_configure(self, cart: Carts, btn: CartButton) -> None:
|
||||||
self.carts[btn]['name'] = cart.name
|
"""Configure button with cart data"""
|
||||||
self.carts[btn]['duration'] = cart.duration
|
|
||||||
self.carts[btn]['path'] = cart.path
|
btn.setEnabled(False)
|
||||||
self.carts[btn]['playing'] = False
|
|
||||||
player = self.music.VLC.media_player_new(cart.path)
|
|
||||||
player.audio_set_volume(Config.VOLUME_VLC_DEFAULT)
|
|
||||||
self.carts[btn]['player'] = player
|
|
||||||
if cart.path:
|
if cart.path:
|
||||||
if helpers.file_is_readable(cart.path):
|
if helpers.file_is_readable(cart.path):
|
||||||
colour = Config.COLOUR_CART_READY
|
colour = Config.COLOUR_CART_READY
|
||||||
|
btn.path = cart.path
|
||||||
|
btn.player = self.music.VLC.media_player_new(cart.path)
|
||||||
|
btn.player.audio_set_volume(Config.VOLUME_VLC_DEFAULT)
|
||||||
|
if cart.enabled:
|
||||||
btn.setEnabled(True)
|
btn.setEnabled(True)
|
||||||
else:
|
else:
|
||||||
colour = Config.COLOUR_CART_ERROR
|
colour = Config.COLOUR_CART_ERROR
|
||||||
@ -199,16 +220,22 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
colour = Config.COLOUR_CART_UNCONFIGURED
|
colour = Config.COLOUR_CART_UNCONFIGURED
|
||||||
|
|
||||||
btn.setStyleSheet("background-color: " + colour + ";\n")
|
btn.setStyleSheet("background-color: " + colour + ";\n")
|
||||||
|
btn.setText(cart.name)
|
||||||
|
|
||||||
def cart_tick(self) -> None:
|
def cart_tick(self) -> None:
|
||||||
"""Cart clock actions"""
|
"""Cart clock actions"""
|
||||||
|
|
||||||
for btn, cart in self.carts.items():
|
for i in range(self.horizontalLayout_Carts.count()):
|
||||||
if cart['playing']:
|
btn = self.horizontalLayout_Carts.itemAt(i).widget()
|
||||||
if not cart['player'].is_playing():
|
if not btn:
|
||||||
|
continue
|
||||||
|
if btn.is_playing:
|
||||||
|
if not btn.player.is_playing():
|
||||||
# Cart has finished playing
|
# Cart has finished playing
|
||||||
cart['playing'] = False
|
btn.is_playing = False
|
||||||
cart['player'].set_position(0)
|
# Setting to position 0 doesn't seem to work
|
||||||
|
btn.player = self.music.VLC.media_player_new(btn.path)
|
||||||
|
btn.player.audio_set_volume(Config.VOLUME_VLC_DEFAULT)
|
||||||
colour = Config.COLOUR_CART_READY
|
colour = Config.COLOUR_CART_READY
|
||||||
btn.setStyleSheet("background-color: " + colour + ";\n")
|
btn.setStyleSheet("background-color: " + colour + ";\n")
|
||||||
|
|
||||||
@ -296,10 +323,8 @@ 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.actionAdd_cart.triggered.connect(self.cart_add)
|
|
||||||
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.actionDebug.triggered.connect(self.debug)
|
||||||
self.actionAdd_cart.triggered.connect(self.cart_add)
|
|
||||||
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)
|
||||||
@ -1199,26 +1224,25 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
class CartDialog(QDialog):
|
class CartDialog(QDialog):
|
||||||
"""Edit cart details"""
|
"""Edit cart details"""
|
||||||
|
|
||||||
def __init__(self, parent: QMainWindow,
|
def __init__(self, parent: QMainWindow, session: Session,
|
||||||
cart: Optional[Carts],
|
cart: Carts) -> None:
|
||||||
cart_number: int) -> None:
|
|
||||||
"""
|
"""
|
||||||
Manage carts
|
Manage carts
|
||||||
"""
|
"""
|
||||||
|
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
self.parent = parent
|
||||||
|
self.session = session
|
||||||
|
|
||||||
self.ui = Ui_DialogCartEdit()
|
self.ui = Ui_DialogCartEdit()
|
||||||
self.ui.setupUi(self)
|
self.ui.setupUi(self)
|
||||||
self.ui.chkEnabled.setChecked(True)
|
|
||||||
self.path = ""
|
|
||||||
|
|
||||||
self.ui.windowTitle = "Edit Cart " + str(cart_number)
|
|
||||||
|
|
||||||
if cart:
|
|
||||||
self.ui.lineEditName.setText(cart.name)
|
|
||||||
self.path = cart.path
|
self.path = cart.path
|
||||||
|
|
||||||
self.ui.lblPath.setText(self.path)
|
self.ui.lblPath.setText(self.path)
|
||||||
|
self.ui.lineEditName.setText(cart.name)
|
||||||
|
self.ui.chkEnabled.setChecked(cart.enabled)
|
||||||
|
|
||||||
|
self.ui.windowTitle = "Edit Cart " + str(cart.id)
|
||||||
|
|
||||||
self.ui.btnFile.clicked.connect(self.choose_file)
|
self.ui.btnFile.clicked.connect(self.choose_file)
|
||||||
|
|
||||||
def choose_file(self) -> None:
|
def choose_file(self) -> None:
|
||||||
|
|||||||
@ -6,37 +6,21 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>400</width>
|
<width>564</width>
|
||||||
<height>171</height>
|
<height>148</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Carts</string>
|
<string>Carts</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<property name="geometry">
|
<item row="0" column="0">
|
||||||
<rect>
|
|
||||||
<x>200</x>
|
|
||||||
<y>140</y>
|
|
||||||
<width>171</width>
|
|
||||||
<height>32</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="standardButtons">
|
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="geometry">
|
<property name="maximumSize">
|
||||||
<rect>
|
<size>
|
||||||
<x>10</x>
|
<width>56</width>
|
||||||
<y>60</y>
|
<height>16777215</height>
|
||||||
<width>76</width>
|
</size>
|
||||||
<height>19</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Name:</string>
|
<string>&Name:</string>
|
||||||
@ -45,64 +29,102 @@
|
|||||||
<cstring>lineEditName</cstring>
|
<cstring>lineEditName</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1" colspan="2">
|
||||||
<widget class="QLineEdit" name="lineEditName">
|
<widget class="QLineEdit" name="lineEditName">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>90</x>
|
|
||||||
<y>60</y>
|
|
||||||
<width>291</width>
|
|
||||||
<height>27</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="inputMask">
|
<property name="inputMask">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QLabel" name="lblPath">
|
</item>
|
||||||
<property name="geometry">
|
<item row="0" column="3">
|
||||||
<rect>
|
<widget class="QCheckBox" name="chkEnabled">
|
||||||
<x>10</x>
|
<property name="text">
|
||||||
<y>10</y>
|
<string>&Enabled</string>
|
||||||
<width>371</width>
|
</property>
|
||||||
<height>41</height>
|
</widget>
|
||||||
</rect>
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>56</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>xxx</string>
|
<string>File:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>lblPath</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLabel" name="lblPath">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>301</width>
|
||||||
|
<height>41</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::PlainText</enum>
|
<enum>Qt::PlainText</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
|
</property>
|
||||||
<property name="wordWrap">
|
<property name="wordWrap">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="3">
|
||||||
<widget class="QPushButton" name="btnFile">
|
<widget class="QPushButton" name="btnFile">
|
||||||
<property name="geometry">
|
<property name="maximumSize">
|
||||||
<rect>
|
<size>
|
||||||
<x>10</x>
|
<width>31</width>
|
||||||
<y>100</y>
|
<height>16777215</height>
|
||||||
<width>100</width>
|
</size>
|
||||||
<height>27</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&File</string>
|
<string>...</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QCheckBox" name="chkEnabled">
|
</item>
|
||||||
<property name="geometry">
|
<item row="2" column="1">
|
||||||
<rect>
|
<spacer name="horizontalSpacer">
|
||||||
<x>280</x>
|
<property name="orientation">
|
||||||
<y>100</y>
|
<enum>Qt::Horizontal</enum>
|
||||||
<width>104</width>
|
|
||||||
<height>25</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="sizeHint" stdset="0">
|
||||||
<string>&Enabled</string>
|
<size>
|
||||||
|
<width>116</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2" colspan="2">
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections>
|
||||||
|
|||||||
@ -14,31 +14,50 @@ from PyQt5 import QtCore, QtGui, QtWidgets
|
|||||||
class Ui_DialogCartEdit(object):
|
class Ui_DialogCartEdit(object):
|
||||||
def setupUi(self, DialogCartEdit):
|
def setupUi(self, DialogCartEdit):
|
||||||
DialogCartEdit.setObjectName("DialogCartEdit")
|
DialogCartEdit.setObjectName("DialogCartEdit")
|
||||||
DialogCartEdit.resize(400, 171)
|
DialogCartEdit.resize(564, 148)
|
||||||
|
self.gridLayout = QtWidgets.QGridLayout(DialogCartEdit)
|
||||||
|
self.gridLayout.setObjectName("gridLayout")
|
||||||
|
self.label = QtWidgets.QLabel(DialogCartEdit)
|
||||||
|
self.label.setMaximumSize(QtCore.QSize(56, 16777215))
|
||||||
|
self.label.setObjectName("label")
|
||||||
|
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
|
||||||
|
self.lineEditName = QtWidgets.QLineEdit(DialogCartEdit)
|
||||||
|
self.lineEditName.setInputMask("")
|
||||||
|
self.lineEditName.setObjectName("lineEditName")
|
||||||
|
self.gridLayout.addWidget(self.lineEditName, 0, 1, 1, 2)
|
||||||
|
self.chkEnabled = QtWidgets.QCheckBox(DialogCartEdit)
|
||||||
|
self.chkEnabled.setObjectName("chkEnabled")
|
||||||
|
self.gridLayout.addWidget(self.chkEnabled, 0, 3, 1, 1)
|
||||||
|
self.label_2 = QtWidgets.QLabel(DialogCartEdit)
|
||||||
|
self.label_2.setMaximumSize(QtCore.QSize(56, 16777215))
|
||||||
|
self.label_2.setObjectName("label_2")
|
||||||
|
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
|
||||||
|
self.lblPath = QtWidgets.QLabel(DialogCartEdit)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(0)
|
||||||
|
sizePolicy.setHeightForWidth(self.lblPath.sizePolicy().hasHeightForWidth())
|
||||||
|
self.lblPath.setSizePolicy(sizePolicy)
|
||||||
|
self.lblPath.setMinimumSize(QtCore.QSize(301, 41))
|
||||||
|
self.lblPath.setText("")
|
||||||
|
self.lblPath.setTextFormat(QtCore.Qt.PlainText)
|
||||||
|
self.lblPath.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
|
||||||
|
self.lblPath.setWordWrap(True)
|
||||||
|
self.lblPath.setObjectName("lblPath")
|
||||||
|
self.gridLayout.addWidget(self.lblPath, 1, 1, 1, 1)
|
||||||
|
self.btnFile = QtWidgets.QPushButton(DialogCartEdit)
|
||||||
|
self.btnFile.setMaximumSize(QtCore.QSize(31, 16777215))
|
||||||
|
self.btnFile.setObjectName("btnFile")
|
||||||
|
self.gridLayout.addWidget(self.btnFile, 1, 3, 1, 1)
|
||||||
|
spacerItem = QtWidgets.QSpacerItem(116, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||||
|
self.gridLayout.addItem(spacerItem, 2, 1, 1, 1)
|
||||||
self.buttonBox = QtWidgets.QDialogButtonBox(DialogCartEdit)
|
self.buttonBox = QtWidgets.QDialogButtonBox(DialogCartEdit)
|
||||||
self.buttonBox.setGeometry(QtCore.QRect(200, 140, 171, 32))
|
|
||||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||||
self.buttonBox.setObjectName("buttonBox")
|
self.buttonBox.setObjectName("buttonBox")
|
||||||
self.label = QtWidgets.QLabel(DialogCartEdit)
|
self.gridLayout.addWidget(self.buttonBox, 2, 2, 1, 2)
|
||||||
self.label.setGeometry(QtCore.QRect(10, 60, 76, 19))
|
|
||||||
self.label.setObjectName("label")
|
|
||||||
self.lineEditName = QtWidgets.QLineEdit(DialogCartEdit)
|
|
||||||
self.lineEditName.setGeometry(QtCore.QRect(90, 60, 291, 27))
|
|
||||||
self.lineEditName.setInputMask("")
|
|
||||||
self.lineEditName.setObjectName("lineEditName")
|
|
||||||
self.lblPath = QtWidgets.QLabel(DialogCartEdit)
|
|
||||||
self.lblPath.setGeometry(QtCore.QRect(10, 10, 371, 41))
|
|
||||||
self.lblPath.setTextFormat(QtCore.Qt.PlainText)
|
|
||||||
self.lblPath.setWordWrap(True)
|
|
||||||
self.lblPath.setObjectName("lblPath")
|
|
||||||
self.btnFile = QtWidgets.QPushButton(DialogCartEdit)
|
|
||||||
self.btnFile.setGeometry(QtCore.QRect(10, 100, 100, 27))
|
|
||||||
self.btnFile.setObjectName("btnFile")
|
|
||||||
self.chkEnabled = QtWidgets.QCheckBox(DialogCartEdit)
|
|
||||||
self.chkEnabled.setGeometry(QtCore.QRect(280, 100, 104, 25))
|
|
||||||
self.chkEnabled.setObjectName("chkEnabled")
|
|
||||||
self.label.setBuddy(self.lineEditName)
|
self.label.setBuddy(self.lineEditName)
|
||||||
|
self.label_2.setBuddy(self.lblPath)
|
||||||
|
|
||||||
self.retranslateUi(DialogCartEdit)
|
self.retranslateUi(DialogCartEdit)
|
||||||
self.buttonBox.accepted.connect(DialogCartEdit.accept) # type: ignore
|
self.buttonBox.accepted.connect(DialogCartEdit.accept) # type: ignore
|
||||||
@ -49,6 +68,6 @@ class Ui_DialogCartEdit(object):
|
|||||||
_translate = QtCore.QCoreApplication.translate
|
_translate = QtCore.QCoreApplication.translate
|
||||||
DialogCartEdit.setWindowTitle(_translate("DialogCartEdit", "Carts"))
|
DialogCartEdit.setWindowTitle(_translate("DialogCartEdit", "Carts"))
|
||||||
self.label.setText(_translate("DialogCartEdit", "&Name:"))
|
self.label.setText(_translate("DialogCartEdit", "&Name:"))
|
||||||
self.lblPath.setText(_translate("DialogCartEdit", "xxx"))
|
|
||||||
self.btnFile.setText(_translate("DialogCartEdit", "&File"))
|
|
||||||
self.chkEnabled.setText(_translate("DialogCartEdit", "&Enabled"))
|
self.chkEnabled.setText(_translate("DialogCartEdit", "&Enabled"))
|
||||||
|
self.label_2.setText(_translate("DialogCartEdit", "File:"))
|
||||||
|
self.btnFile.setText(_translate("DialogCartEdit", "..."))
|
||||||
|
|||||||
@ -861,16 +861,10 @@ padding-left: 8px;</string>
|
|||||||
<addaction name="action_About"/>
|
<addaction name="action_About"/>
|
||||||
<addaction name="actionDebug"/>
|
<addaction name="actionDebug"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menu_Carts">
|
|
||||||
<property name="title">
|
|
||||||
<string>&Carts</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<addaction name="menuFile"/>
|
<addaction name="menuFile"/>
|
||||||
<addaction name="menuPlaylist"/>
|
<addaction name="menuPlaylist"/>
|
||||||
<addaction name="menuSearc_h"/>
|
<addaction name="menuSearc_h"/>
|
||||||
<addaction name="menuHelp"/>
|
<addaction name="menuHelp"/>
|
||||||
<addaction name="menu_Carts"/>
|
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QStatusBar" name="statusbar">
|
<widget class="QStatusBar" name="statusbar">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
|
|||||||
@ -381,8 +381,6 @@ class Ui_MainWindow(object):
|
|||||||
self.menuSearc_h.setObjectName("menuSearc_h")
|
self.menuSearc_h.setObjectName("menuSearc_h")
|
||||||
self.menuHelp = QtWidgets.QMenu(self.menubar)
|
self.menuHelp = QtWidgets.QMenu(self.menubar)
|
||||||
self.menuHelp.setObjectName("menuHelp")
|
self.menuHelp.setObjectName("menuHelp")
|
||||||
self.menu_Carts = QtWidgets.QMenu(self.menubar)
|
|
||||||
self.menu_Carts.setObjectName("menu_Carts")
|
|
||||||
MainWindow.setMenuBar(self.menubar)
|
MainWindow.setMenuBar(self.menubar)
|
||||||
self.statusbar = QtWidgets.QStatusBar(MainWindow)
|
self.statusbar = QtWidgets.QStatusBar(MainWindow)
|
||||||
self.statusbar.setEnabled(True)
|
self.statusbar.setEnabled(True)
|
||||||
@ -534,7 +532,6 @@ class Ui_MainWindow(object):
|
|||||||
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())
|
||||||
self.menubar.addAction(self.menuHelp.menuAction())
|
self.menubar.addAction(self.menuHelp.menuAction())
|
||||||
self.menubar.addAction(self.menu_Carts.menuAction())
|
|
||||||
|
|
||||||
self.retranslateUi(MainWindow)
|
self.retranslateUi(MainWindow)
|
||||||
self.tabPlaylist.setCurrentIndex(-1)
|
self.tabPlaylist.setCurrentIndex(-1)
|
||||||
@ -573,7 +570,6 @@ class Ui_MainWindow(object):
|
|||||||
self.menuPlaylist.setTitle(_translate("MainWindow", "Sho&wtime"))
|
self.menuPlaylist.setTitle(_translate("MainWindow", "Sho&wtime"))
|
||||||
self.menuSearc_h.setTitle(_translate("MainWindow", "&Search"))
|
self.menuSearc_h.setTitle(_translate("MainWindow", "&Search"))
|
||||||
self.menuHelp.setTitle(_translate("MainWindow", "&Help"))
|
self.menuHelp.setTitle(_translate("MainWindow", "&Help"))
|
||||||
self.menu_Carts.setTitle(_translate("MainWindow", "&Carts"))
|
|
||||||
self.actionPlay_next.setText(_translate("MainWindow", "&Play next"))
|
self.actionPlay_next.setText(_translate("MainWindow", "&Play next"))
|
||||||
self.actionPlay_next.setShortcut(_translate("MainWindow", "Return"))
|
self.actionPlay_next.setShortcut(_translate("MainWindow", "Return"))
|
||||||
self.actionSkipToNext.setText(_translate("MainWindow", "Skip to &next"))
|
self.actionSkipToNext.setText(_translate("MainWindow", "Skip to &next"))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user