Add tabWidget and podcasts category to UI

This commit is contained in:
Wiktor Zykubek 2023-06-18 16:14:26 +02:00
parent 30952ad2fb
commit 89cedd4f7c
No known key found for this signature in database
GPG Key ID: 0DAA9DC01449FCA2
3 changed files with 82 additions and 13 deletions

85
form.ui
View File

@ -6,19 +6,19 @@
<rect>
<x>0</x>
<y>0</y>
<width>350</width>
<width>400</width>
<height>500</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>350</width>
<width>400</width>
<height>500</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>350</width>
<width>400</width>
<height>500</height>
</size>
</property>
@ -44,7 +44,7 @@
<rect>
<x>9</x>
<y>9</y>
<width>332</width>
<width>381</width>
<height>461</height>
</rect>
</property>
@ -52,19 +52,76 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QListWidget" name="groupsListWidget">
<widget class="QTabWidget" name="tabWidget">
<property name="minimumSize">
<size>
<width>130</width>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>130</width>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="radioTab">
<attribute name="title">
<string>Radio</string>
</attribute>
<widget class="QListWidget" name="radioGroupsListWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>150</width>
<height>400</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>400</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>400</height>
</size>
</property>
</widget>
</widget>
<widget class="QWidget" name="podcastTab">
<attribute name="title">
<string>Podcasty</string>
</attribute>
<widget class="QListWidget" name="podcastGroupsListWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>150</width>
<height>400</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>400</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>400</height>
</size>
</property>
</widget>
</widget>
</widget>
</item>
<item>
@ -99,6 +156,18 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>16777215</height>
</size>
</property>
<property name="value">
<number>70</number>
</property>
@ -124,7 +193,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>350</width>
<width>400</width>
<height>22</height>
</rect>
</property>

View File

@ -34,7 +34,7 @@ class MainWindow(QMainWindow):
self.setVolume(DEFAULT_VOLUME)
self.printGroups()
self.ui.groupsListWidget.itemClicked.connect(self.printStations)
self.ui.radioGroupsListWidget.itemClicked.connect(self.printStations)
self.ui.stationsListWidget.itemClicked.connect(self.playRadio)
self.ui.playbackToolButton.clicked.connect(self.togglePlayer)
self.ui.volumeHorizontalSlider.valueChanged.connect(self.setVolume)
@ -55,14 +55,14 @@ class MainWindow(QMainWindow):
return json.loads(resp.text)
def printGroups(self) -> None:
"""Print groups (categories) in groupsListWidget."""
self.ui.groupsListWidget.addItems(
"""Print groups (categories) in radioGroupsListWidget."""
self.ui.radioGroupsListWidget.addItems(
[e["name"] for e in self.__stations_data["groups"]]
)
def printStations(self) -> None:
"""Print stations (channels) in stationsListWidget."""
group = self.ui.groupsListWidget.selectedItems()[0].text()
group = self.ui.radioGroupsListWidget.selectedItems()[0].text()
group_id = None
for e in self.__stations_data["groups"]:
if e["name"] == group:

View File

@ -1,6 +1,6 @@
[tool.poetry]
name = "openfm-qt"
version = "0.1.0"
version = "0.2.0"
description = "Qt client for Polish internet radio Open FM."
authors = ["Wiktor Zykubek <wz-git@mailbox.org>"]
license = "ISC"