From f57e1afe76328a8b87f7b6b758178a969a758450 Mon Sep 17 00:00:00 2001 From: Wiktor Zykubek Date: Mon, 12 Jun 2023 20:34:50 +0200 Subject: [PATCH] Add second listWidget to display stations --- form.ui | 9 ++++++++- mainwindow.py | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/form.ui b/form.ui index 55fd116..8eba162 100644 --- a/form.ui +++ b/form.ui @@ -43,7 +43,14 @@ - + + + + + + + + diff --git a/mainwindow.py b/mainwindow.py index 27fa7a7..fc658f9 100644 --- a/mainwindow.py +++ b/mainwindow.py @@ -17,13 +17,13 @@ class MainWindow(QMainWindow): super().__init__(parent) self.ui = Ui_MainWindow() self.ui.setupUi(self) - self.getStations() + self.getGroups() - def getStations(self): + def getGroups(self): resp = requests.get("https://open.fm/radio/api/v2/ofm/stations_slug.json") json_ = json.loads(resp.text) for el in json_["groups"]: - self.ui.listWidget.addItem(el["name"]) + self.ui.groupslistWidget.addItem(el["name"]) if __name__ == "__main__":