From c26d8833b32dc739e11d03272a4e5bcbf63cc788 Mon Sep 17 00:00:00 2001 From: Wiktor Zykubek Date: Sun, 18 Jun 2023 17:46:16 +0200 Subject: [PATCH] Clear stationsListWidget each time listWidget is changed --- openfm_qt/mainwindow.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openfm_qt/mainwindow.py b/openfm_qt/mainwindow.py index 6019ebd..5e1f1b0 100644 --- a/openfm_qt/mainwindow.py +++ b/openfm_qt/mainwindow.py @@ -64,12 +64,14 @@ class MainWindow(QMainWindow): def printRadioGroups(self) -> None: """Print groups (categories) in radioGroupsListWidget.""" + self.ui.stationsListWidget.clear() self.ui.radioGroupsListWidget.addItems( [e["name"] for e in self.__stations["groups"]] ) def printPodcastGroups(self) -> None: """Print groups (categories) in podcastGroupsListWidget.""" + self.ui.stationsListWidget.clear() self.ui.podcastGroupsListWidget.addItems( [e["name"] for e in self.__podcasts_groups] ) @@ -93,6 +95,7 @@ class MainWindow(QMainWindow): def printPodcasts(self) -> None: """Print podcasts in podcastListWidget.""" + self.ui.stationsListWidget.clear() group = self.ui.podcastGroupsListWidget.selectedItems()[0].text() group_name = None for e in self.__podcasts_groups: