diff --git a/app/config.py b/app/config.py index 7344c01..3b4fd65 100644 --- a/app/config.py +++ b/app/config.py @@ -79,6 +79,7 @@ class Config(object): MAIL_SERVER = os.environ.get("MAIL_SERVER") or "woodlands.midnighthax.com" MAIL_USERNAME = os.environ.get("MAIL_USERNAME") MAIL_USE_TLS = os.environ.get("MAIL_USE_TLS") is not None + MAIN_WINDOW_TITLE = "MusicMuster" MAX_IMPORT_MATCHES = 5 MAX_IMPORT_THREADS = 3 MAX_INFO_TABS = 5 @@ -112,7 +113,6 @@ class Config(object): TEXT_NO_TRACK_NO_NOTE = "[Section header]" TOD_TIME_FORMAT = "%H:%M:%S" TRACK_TIME_FORMAT = "%H:%M:%S" - USE_INTERNAL_BROWSER = False VLC_MAIN_PLAYER_NAME = "MusicMuster Main Player" VLC_PREVIEW_PLAYER_NAME = "MusicMuster Preview Player" VLC_VOLUME_DEFAULT = 75 diff --git a/app/infotabs.py b/app/infotabs.py deleted file mode 100644 index 2542ea1..0000000 --- a/app/infotabs.py +++ /dev/null @@ -1,68 +0,0 @@ -# Standard library imports -import datetime as dt -from typing import Dict, Optional - -# PyQt imports -from PyQt6.QtCore import QUrl -from PyQt6.QtWebEngineWidgets import QWebEngineView -from PyQt6.QtWidgets import QTabWidget, QWidget - -# Third party imports - -# App imports -from config import Config - - -class InfoTabs(QTabWidget): - """ - Class to manage info tabs - """ - - def __init__(self, parent: Optional[QWidget] = None) -> None: - super().__init__(parent) - - if Config.USE_INTERNAL_BROWSER: - # re-use the oldest one later) - self.last_update: Dict[QWebEngineView, dt.datetime] = {} - self.tabtitles: Dict[int, str] = {} - - # Create one tab which (for some reason) creates flickering if - # done later - widget = QWebEngineView() - widget.setZoomFactor(Config.WEB_ZOOM_FACTOR) - self.last_update[widget] = dt.datetime.now() - _ = self.addTab(widget, "") - - def open_tab(self, url: str, title: str) -> None: - """ - Open passed URL. If URL currently displayed, switch to that tab. - Create new tab if we're below the maximum - number otherwise reuse oldest content tab. - """ - - if url in self.tabtitles.values(): - self.setCurrentIndex( - list(self.tabtitles.keys())[list(self.tabtitles.values()).index(url)] - ) - return - - short_title = title[: Config.INFO_TAB_TITLE_LENGTH] - - if self.count() < Config.MAX_INFO_TABS: - # Create a new tab - widget = QWebEngineView() - widget.setZoomFactor(Config.WEB_ZOOM_FACTOR) - tab_index = self.addTab(widget, short_title) - - else: - # Reuse oldest widget - widget = min(self.last_update, key=self.last_update.get) # type: ignore - tab_index = self.indexOf(widget) - self.setTabText(tab_index, short_title) - - widget.setUrl(QUrl(url)) - self.last_update[widget] = dt.datetime.now() - self.tabtitles[tab_index] = url - - # Show newly updated tab - self.setCurrentIndex(tab_index) diff --git a/app/musicmuster.py b/app/musicmuster.py index 1b661e2..89504d6 100755 --- a/app/musicmuster.py +++ b/app/musicmuster.py @@ -2,7 +2,7 @@ # Standard library imports from slugify import slugify # type: ignore -from typing import Optional +from typing import Callable, Optional import argparse import datetime as dt import os @@ -19,6 +19,7 @@ from PyQt6.QtCore import ( QTimer, ) from PyQt6.QtGui import ( + QAction, QCloseEvent, QColor, QIcon, @@ -66,7 +67,10 @@ from playlists import PlaylistTab from ui import icons_rc # noqa F401 from ui.dlg_SelectPlaylist_ui import Ui_dlgSelectPlaylist # type: ignore from ui.downloadcsv_ui import Ui_DateSelect # type: ignore -from ui.main_window_ui import Ui_MainWindow # type: ignore +from ui.main_window_header_ui import Ui_HeaderSection # type: ignore +from ui.main_window_playlist_ui import Ui_PlaylistSection # type: ignore +from ui.main_window_footer_ui import Ui_FooterSection # type: ignore + from utilities import check_db, update_bitrates import helpers @@ -366,12 +370,47 @@ class TemplateSelectorDialog(QDialog): self.reject() -class Window(QMainWindow, Ui_MainWindow): +# Per-section UI files +class HeaderSection(QWidget, Ui_HeaderSection): + def __init__(self, parent=None): + super().__init__(parent) + self.setupUi(self) + + +class PlaylistSection(QWidget, Ui_PlaylistSection): + def __init__(self, parent=None): + super().__init__(parent) + self.setupUi(self) + + +class FooterSection(QWidget, Ui_FooterSection): + def __init__(self, parent=None): + super().__init__(parent) + self.setupUi(self) + + +class Window(QMainWindow): def __init__( self, parent: Optional[QWidget] = None, *args: list, **kwargs: dict ) -> None: super().__init__(parent) - self.setupUi(self) + + # Build main window from per-section classes defined above + central_widget = QWidget(self) + self.setCentralWidget(central_widget) + + layout = QVBoxLayout(central_widget) + self.header_section = HeaderSection() + self.playlist_section = PlaylistSection() + self.footer_section = FooterSection() + + layout.addWidget(self.header_section) + layout.addWidget(self.playlist_section) + layout.addWidget(self.footer_section) + + self.setWindowTitle(Config.MAIN_WINDOW_TITLE) + # Add menu bar + self.create_menu_bar() self.timer10: QTimer = QTimer() self.timer100: QTimer = QTimer() @@ -380,17 +419,19 @@ class Window(QMainWindow, Ui_MainWindow): self.set_main_window_size() self.lblSumPlaytime = QLabel("") - self.statusbar.addPermanentWidget(self.lblSumPlaytime) - self.txtSearch = QLineEdit() - self.txtSearch.setHidden(True) - self.statusbar.addWidget(self.txtSearch) + self.statusbar = self.statusBar() + if self.statusbar: + self.statusbar.addPermanentWidget(self.lblSumPlaytime) + self.txtSearch = QLineEdit() + self.txtSearch.setHidden(True) + self.statusbar.addWidget(self.txtSearch) self.hide_played_tracks = False self.preview_manager = PreviewManager() - self.widgetFadeVolume.hideAxis("bottom") - self.widgetFadeVolume.hideAxis("left") - self.widgetFadeVolume.setDefaultPadding(0) - self.widgetFadeVolume.setBackground(Config.FADE_CURVE_BACKGROUND) + self.footer_section.widgetFadeVolume.hideAxis("bottom") + self.footer_section.widgetFadeVolume.hideAxis("left") + self.footer_section.widgetFadeVolume.setDefaultPadding(0) + self.footer_section.widgetFadeVolume.setBackground(Config.FADE_CURVE_BACKGROUND) self.move_source_rows: Optional[list[int]] = None self.move_source_model: Optional[PlaylistModel] = None @@ -407,12 +448,11 @@ class Window(QMainWindow, Ui_MainWindow): self.importer: Optional[FileImporter] = None self.current = Current() - if not Config.USE_INTERNAL_BROWSER: - webbrowser.register( - "browser", - None, - webbrowser.BackgroundBrowser(Config.EXTERNAL_BROWSER_PATH), - ) + webbrowser.register( + "browser", + None, + webbrowser.BackgroundBrowser(Config.EXTERNAL_BROWSER_PATH), + ) # Set up shortcut key for instant logging from keyboard self.action_quicklog = QShortcut(QKeySequence("Ctrl+L"), self) @@ -421,6 +461,122 @@ class Window(QMainWindow, Ui_MainWindow): self.load_last_playlists() self.stop_autoplay = False + def create_action( + self, text: str, handler: Callable, shortcut: Optional[str] = None + ) -> QAction: + """ + Helper function to create an action, bind it to a method, and set a shortcut if provided. + """ + + action = QAction(text, self) + action.triggered.connect(handler) + if shortcut: + action.setShortcut(shortcut) # Adding the shortcut + return action + + def create_menu_bar(self): + menu_bar = self.menuBar() + + # Playlist Menu + playlist_menu = menu_bar.addMenu("&Playlist") + playlist_menu.addSeparator() + playlist_menu.addAction( + self.create_action("Insert Track", self.insert_track, "Ctrl+T") + ) + # playlist_menu.addAction(self.create_action("Remove", self.remove)) + playlist_menu.addAction( + self.create_action("Insert Section Header", self.insert_header, "Ctrl+H") + ) + playlist_menu.addSeparator() + playlist_menu.addAction( + self.create_action("Mark for Moving", self.mark_rows_for_moving, "Ctrl+C") + ) + playlist_menu.addAction(self.create_action("Paste", self.paste_rows, "Ctrl+V")) + playlist_menu.addSeparator() + playlist_menu.addAction( + self.create_action("Export Playlist", self.export_playlist_tab) + ) + playlist_menu.addAction( + self.create_action( + "Download CSV of Played Tracks", self.download_played_tracks + ) + ) + playlist_menu.addSeparator() + playlist_menu.addAction( + self.create_action( + "Select Duplicate Rows", + lambda: self.active_tab().select_duplicate_rows(), + ) + ) + playlist_menu.addAction(self.create_action("Move Selected", self.move_selected)) + playlist_menu.addAction(self.create_action("Move Unplayed", self.move_unplayed)) + + # Clear Selection with Escape key. Save in module so we can + # enable/disable it later + self.action_Clear_selection = self.create_action( + "Clear Selection", self.clear_selection, "Esc" + ) + playlist_menu.addAction(self.action_Clear_selection) + + # File Menu + file_menu = menu_bar.addMenu("&File") + file_menu.addAction( + self.create_action("Open Playlist", self.open_playlist, "Ctrl+O") + ) + file_menu.addAction(self.create_action("New Playlist", self.new_playlist)) + file_menu.addAction( + self.create_action("Close Playlist", self.close_playlist_tab) + ) + file_menu.addAction(self.create_action("Rename Playlist", self.rename_playlist)) + file_menu.addAction(self.create_action("Delete Playlist", self.delete_playlist)) + file_menu.addSeparator() + file_menu.addAction( + self.create_action("Save as Template", self.save_as_template) + ) + file_menu.addAction( + self.create_action("Manage Templates", self.manage_templates) + ) + file_menu.addSeparator() + file_menu.addAction( + self.create_action( + "Import Files", self.import_files_wrapper, "Ctrl+Shift+I" + ) + ) + file_menu.addSeparator() + file_menu.addAction( + self.create_action("Exit", self.close) + ) # Default action for closing + + # Music Menu + music_menu = menu_bar.addMenu("&Music") + music_menu.addAction( + self.create_action("Set Next", self.set_selected_track_next, "Ctrl+N") + ) + music_menu.addAction(self.create_action("Play Next", self.play_next, "Return")) + music_menu.addAction(self.create_action("Fade", self.fade, "Ctrl+Z")) + music_menu.addAction(self.create_action("Stop", self.stop, "Ctrl+Alt+S")) + music_menu.addAction(self.create_action("Resume", self.resume, "Ctrl+R")) + music_menu.addAction( + self.create_action("Skip to Next", self.play_next, "Ctrl+Alt+Return") + ) + music_menu.addSeparator() + music_menu.addAction(self.create_action("Search", self.search_playlist, "/")) + music_menu.addAction( + self.create_action( + "Search Title in Wikipedia", self.lookup_row_in_wikipedia, "Ctrl+W" + ) + ) + music_menu.addAction( + self.create_action( + "Search Title in Songfacts", self.lookup_row_in_songfacts, "Ctrl+S" + ) + ) + + # Help Menu + help_menu = menu_bar.addMenu("Help") + help_menu.addAction(self.create_action("About", self.about)) + help_menu.addAction(self.create_action("Debug", self.debug)) + def about(self) -> None: """Get git tag and database name""" @@ -446,7 +602,7 @@ class Window(QMainWindow, Ui_MainWindow): return self.current.base_model def active_tab(self) -> PlaylistTab: - return self.tabPlaylist.currentWidget() + return self.playlist_section.tabPlaylist.currentWidget() def clear_next(self) -> None: """ @@ -482,8 +638,10 @@ class Window(QMainWindow, Ui_MainWindow): with db.Session() as session: # Save tab number of open playlists open_playlist_ids: dict[int, int] = {} - for idx in range(self.tabPlaylist.count()): - open_playlist_ids[self.tabPlaylist.widget(idx).playlist_id] = idx + for idx in range(self.playlist_section.tabPlaylist.count()): + open_playlist_ids[ + self.playlist_section.tabPlaylist.widget(idx).playlist_id + ] = idx Playlists.clear_tabs(session, list(open_playlist_ids.keys())) for playlist_id, idx in open_playlist_ids.items(): playlist = session.get(Playlists, playlist_id) @@ -492,15 +650,12 @@ class Window(QMainWindow, Ui_MainWindow): playlist.tab = idx # Save window attributes - splitter_top, splitter_bottom = self.splitter.sizes() attributes_to_save = dict( mainwindow_height=self.height(), mainwindow_width=self.width(), mainwindow_x=self.x(), mainwindow_y=self.y(), - splitter_top=splitter_top, - splitter_bottom=splitter_bottom, - active_tab=self.tabPlaylist.currentIndex(), + active_tab=self.playlist_section.tabPlaylist.currentIndex(), ) for name, value in attributes_to_save.items(): record = Settings.get_setting(session, name) @@ -515,7 +670,7 @@ class Window(QMainWindow, Ui_MainWindow): Close active playlist tab, called by menu item """ - return self.close_tab(self.tabPlaylist.currentIndex()) + return self.close_tab(self.playlist_section.tabPlaylist.currentIndex()) def close_tab(self, tab_index: int) -> bool: """ @@ -525,7 +680,9 @@ class Window(QMainWindow, Ui_MainWindow): Return True if tab closed else False. """ - closing_tab_playlist_id = self.tabPlaylist.widget(tab_index).playlist_id + closing_tab_playlist_id = self.playlist_section.tabPlaylist.widget( + tab_index + ).playlist_id # Don't close current track playlist if track_sequence.current is not None: @@ -554,66 +711,30 @@ class Window(QMainWindow, Ui_MainWindow): playlist.close(session) # Close playlist and remove tab - self.tabPlaylist.widget(tab_index).close() - self.tabPlaylist.removeTab(tab_index) + self.playlist_section.tabPlaylist.widget(tab_index).close() + self.playlist_section.tabPlaylist.removeTab(tab_index) return True def connect_signals_slots(self) -> None: - self.action_About.triggered.connect(self.about) - self.action_Clear_selection.triggered.connect(self.clear_selection) - self.actionClosePlaylist.triggered.connect(self.close_playlist_tab) - self.actionDebug.triggered.connect(self.debug) - self.actionDeletePlaylist.triggered.connect(self.delete_playlist) - self.actionDownload_CSV_of_played_tracks.triggered.connect( - self.download_played_tracks - ) - self.actionExport_playlist.triggered.connect(self.export_playlist_tab) - self.actionFade.triggered.connect(self.fade) - self.actionImport_files.triggered.connect(self.import_files_wrapper) - self.actionInsertSectionHeader.triggered.connect(self.insert_header) - self.actionInsertTrack.triggered.connect(self.insert_track) - self.actionManage_templates.triggered.connect(self.manage_templates) - self.actionMark_for_moving.triggered.connect(self.mark_rows_for_moving) - self.actionMoveSelected.triggered.connect(self.move_selected) - self.actionMoveUnplayed.triggered.connect(self.move_unplayed) - self.actionNewPlaylist.triggered.connect(self.new_playlist) - self.actionOpenPlaylist.triggered.connect(self.open_playlist) - self.actionPaste.triggered.connect(self.paste_rows) - self.actionPlay_next.triggered.connect(self.play_next) - self.actionRenamePlaylist.triggered.connect(self.rename_playlist) - self.actionResume.triggered.connect(self.resume) - self.actionSave_as_template.triggered.connect(self.save_as_template) - self.actionSearch_title_in_Songfacts.triggered.connect( - self.lookup_row_in_songfacts - ) - self.actionSearch_title_in_Wikipedia.triggered.connect( - self.lookup_row_in_wikipedia - ) - self.actionSearch.triggered.connect(self.search_playlist) - self.actionSelect_duplicate_rows.triggered.connect( - lambda: self.active_tab().select_duplicate_rows() - ) - self.actionSetNext.triggered.connect(self.set_selected_track_next) - self.actionSkipToNext.triggered.connect(self.play_next) - self.actionStop.triggered.connect(self.stop) + # Menu bars connections are in create_menu_bar() - self.btnDrop3db.clicked.connect(self.drop3db) - self.btnFade.clicked.connect(self.fade) - self.btnHidePlayed.clicked.connect(self.hide_played) - self.btnPreviewArm.clicked.connect(self.preview_arm) - self.btnPreviewBack.clicked.connect(self.preview_back) - self.btnPreview.clicked.connect(self.preview) - self.btnPreviewEnd.clicked.connect(self.preview_end) - self.btnPreviewFwd.clicked.connect(self.preview_fwd) - self.btnPreviewMark.clicked.connect(self.preview_mark) - self.btnPreviewStart.clicked.connect(self.preview_start) - self.btnStop.clicked.connect(self.stop) - self.hdrCurrentTrack.clicked.connect(self.show_current) - self.hdrNextTrack.clicked.connect(self.show_next) - self.tabPlaylist.currentChanged.connect(self.tab_change) - self.tabPlaylist.tabCloseRequested.connect(self.close_tab) - self.tabBar = self.tabPlaylist.tabBar() + self.footer_section.btnDrop3db.clicked.connect(self.drop3db) + self.footer_section.btnFade.clicked.connect(self.fade) + self.footer_section.btnHidePlayed.clicked.connect(self.hide_played) + self.footer_section.btnPreviewArm.clicked.connect(self.preview_arm) + self.footer_section.btnPreviewBack.clicked.connect(self.preview_back) + self.footer_section.btnPreview.clicked.connect(self.preview) + self.footer_section.btnPreviewEnd.clicked.connect(self.preview_end) + self.footer_section.btnPreviewFwd.clicked.connect(self.preview_fwd) + self.footer_section.btnPreviewMark.clicked.connect(self.preview_mark) + self.footer_section.btnPreviewStart.clicked.connect(self.preview_start) + self.footer_section.btnStop.clicked.connect(self.stop) + self.header_section.hdrCurrentTrack.clicked.connect(self.show_current) + self.header_section.hdrNextTrack.clicked.connect(self.show_next) + self.playlist_section.tabPlaylist.currentChanged.connect(self.tab_change) + self.playlist_section.tabPlaylist.tabCloseRequested.connect(self.close_tab) + self.tabBar = self.playlist_section.tabPlaylist.tabBar() self.txtSearch.textChanged.connect(self.search_playlist_text_changed) self.signals.enable_escape_signal.connect(self.enable_escape) @@ -661,7 +782,7 @@ class Window(QMainWindow, Ui_MainWindow): # Create tab playlist_tab = PlaylistTab(musicmuster=self, model=proxy_model) - idx = self.tabPlaylist.addTab(playlist_tab, playlist.name) + idx = self.playlist_section.tabPlaylist.addTab(playlist_tab, playlist.name) log.debug(f"create_playlist_tab() returned: {idx=}") @@ -733,7 +854,7 @@ class Window(QMainWindow, Ui_MainWindow): """Drop music level by 3db if button checked""" if track_sequence.current: - track_sequence.current.drop3db(self.btnDrop3db.isChecked()) + track_sequence.current.drop3db(self.footer_section.btnDrop3db.isChecked()) def enable_escape(self, enabled: bool) -> None: """ @@ -770,10 +891,10 @@ class Window(QMainWindow, Ui_MainWindow): self.current.base_model.previous_track_ended() # Reset clocks - self.frame_fade.setStyleSheet("") - self.frame_silent.setStyleSheet("") - self.label_fade_timer.setText("00:00") - self.label_silent_timer.setText("00:00") + self.footer_section.frame_fade.setStyleSheet("") + self.footer_section.frame_silent.setStyleSheet("") + self.footer_section.label_fade_timer.setText("00:00") + self.footer_section.label_silent_timer.setText("00:00") # Update headers self.update_headers() @@ -903,7 +1024,7 @@ class Window(QMainWindow, Ui_MainWindow): # Set active tab record = Settings.get_setting(session, "active_tab") if record.f_int is not None and record.f_int >= 0: - self.tabPlaylist.setCurrentIndex(record.f_int) + self.playlist_section.tabPlaylist.setCurrentIndex(record.f_int) # Tabs may move during use. Rather than track where tabs # are, we record the tab index when we close the main @@ -961,7 +1082,7 @@ class Window(QMainWindow, Ui_MainWindow): # Simply load the template as a playlist. Any changes # made will persist idx = self.create_playlist_tab(playlist) - self.tabPlaylist.setCurrentIndex(idx) + self.playlist_section.tabPlaylist.setCurrentIndex(idx) elif action == "Delete": if helpers.ask_yes_no( @@ -1097,7 +1218,7 @@ class Window(QMainWindow, Ui_MainWindow): # the database before it is opened by the model. session.commit() idx = self.create_playlist_tab(playlist) - self.tabPlaylist.setCurrentIndex(idx) + self.playlist_section.tabPlaylist.setCurrentIndex(idx) else: log.error("Playlist failed to create") @@ -1114,7 +1235,7 @@ class Window(QMainWindow, Ui_MainWindow): playlist.mark_open() session.commit() - self.tabPlaylist.setCurrentIndex(idx) + self.playlist_section.tabPlaylist.setCurrentIndex(idx) def open_songfacts_browser(self, title: str) -> None: """Search Songfacts for title""" @@ -1123,10 +1244,7 @@ class Window(QMainWindow, Ui_MainWindow): log.info(f"Songfacts browser tab for {title=}") url = f"https://www.songfacts.com/search/songs/{slug}" - if Config.USE_INTERNAL_BROWSER: - self.tabInfolist.open_tab(url, title) - else: - webbrowser.get("browser").open_new_tab(url) + webbrowser.get("browser").open_new_tab(url) def open_wikipedia_browser(self, title: str) -> None: """Search Wikipedia for title""" @@ -1135,10 +1253,7 @@ class Window(QMainWindow, Ui_MainWindow): log.info(f"Wikipedia browser tab for {title=}") url = f"https://www.wikipedia.org/w/index.php?search={str}" - if Config.USE_INTERNAL_BROWSER: - self.tabInfolist.open_tab(url, title) - else: - webbrowser.get("browser").open_new_tab(url) + webbrowser.get("browser").open_new_tab(url) def paste_rows(self) -> None: """ @@ -1222,8 +1337,8 @@ class Window(QMainWindow, Ui_MainWindow): self.clear_next() # Restore volume if -3dB active - if self.btnDrop3db.isChecked(): - self.btnDrop3db.setChecked(False) + if self.footer_section.btnDrop3db.isChecked(): + self.footer_section.btnDrop3db.setChecked(False) # Play (new) current track log.debug(f"Play: {track_sequence.current.title}") @@ -1234,7 +1349,9 @@ class Window(QMainWindow, Ui_MainWindow): # Show closing volume graph if track_sequence.current.fade_graph: - track_sequence.current.fade_graph.GraphWidget = self.widgetFadeVolume + track_sequence.current.fade_graph.GraphWidget = ( + self.footer_section.widgetFadeVolume + ) track_sequence.current.fade_graph.clear() track_sequence.current.fade_graph.plot() @@ -1255,7 +1372,7 @@ class Window(QMainWindow, Ui_MainWindow): tracklist.append(f"{track.title} ({track.artist})") tt = "
".join(tracklist) - self.hdrPreviousTrack.setToolTip(tt) + self.header_section.hdrPreviousTrack.setToolTip(tt) def preview(self) -> None: """ @@ -1264,7 +1381,7 @@ class Window(QMainWindow, Ui_MainWindow): differently (eg, to headphones). """ - if self.btnPreview.isChecked(): + if self.footer_section.btnPreview.isChecked(): # Get track path for first selected track if there is one track_info = self.active_tab().get_selected_row_track_info() if not track_info: @@ -1286,7 +1403,7 @@ class Window(QMainWindow, Ui_MainWindow): def preview_arm(self): """Manager arm button for setting intro length""" - self.btnPreviewMark.setEnabled(self.btnPreviewArm.isChecked()) + self.footer_section.btnPreviewMark.setEnabled(self.btnPreviewArm.isChecked()) def preview_back(self) -> None: """Wind back preview file""" @@ -1527,17 +1644,6 @@ class Window(QMainWindow, Ui_MainWindow): height = Settings.get_setting(session, "mainwindow_height").f_int or 100 self.setGeometry(x, y, width, height) - if Config.USE_INTERNAL_BROWSER: - splitter_top = ( - Settings.get_setting(session, "splitter_top").f_int or 100 - ) - splitter_bottom = ( - Settings.get_setting(session, "splitter_bottom").f_int or 100 - ) - self.splitter.setSizes([splitter_top, splitter_bottom]) - else: - self.tabInfolist.hide() - def set_selected_track_next(self) -> None: """ Set currently-selected row on visible playlist tab as next track @@ -1554,8 +1660,8 @@ class Window(QMainWindow, Ui_MainWindow): Find the tab containing the widget and set the text colour """ - idx = self.tabPlaylist.indexOf(widget) - self.tabPlaylist.tabBar().setTabTextColor(idx, colour) + idx = self.playlist_section.tabPlaylist.indexOf(widget) + self.playlist_section.tabPlaylist.tabBar().setTabTextColor(idx, colour) def show_current(self) -> None: """Scroll to show current track""" @@ -1582,7 +1688,8 @@ class Window(QMainWindow, Ui_MainWindow): Show status message in status bar for timing milliseconds """ - self.statusbar.showMessage(message, timing) + if self.statusbar: + self.statusbar.showMessage(message, timing) def show_track(self, playlist_track: RowAndTrack) -> None: """Scroll to show track in plt""" @@ -1595,9 +1702,12 @@ class Window(QMainWindow, Ui_MainWindow): # Switch to correct tab if playlist_id != self.current.playlist_id: - for idx in range(self.tabPlaylist.count()): - if self.tabPlaylist.widget(idx).playlist_id == playlist_id: - self.tabPlaylist.setCurrentIndex(idx) + for idx in range(self.playlist_section.tabPlaylist.count()): + if ( + self.playlist_section.tabPlaylist.widget(idx).playlist_id + == playlist_id + ): + self.playlist_section.tabPlaylist.setCurrentIndex(idx) break self.active_tab().scroll_to_top(playlist_track.row_number) @@ -1663,34 +1773,38 @@ class Window(QMainWindow, Ui_MainWindow): # preview. intro_ms_remaining = track_sequence.current.time_remaining_intro() if intro_ms_remaining > 0: - self.label_intro_timer.setText(f"{intro_ms_remaining / 1000:.1f}") + self.footer_section.label_intro_timer.setText( + f"{intro_ms_remaining / 1000:.1f}" + ) if intro_ms_remaining <= Config.INTRO_SECONDS_WARNING_MS: - self.label_intro_timer.setStyleSheet( + self.footer_section.label_intro_timer.setStyleSheet( f"background: {Config.COLOUR_WARNING_TIMER}" ) return else: - if self.label_intro_timer.styleSheet() != "": - self.label_intro_timer.setStyleSheet("") - self.label_intro_timer.setText("0.0") + if self.footer_section.label_intro_timer.styleSheet() != "": + self.footer_section.label_intro_timer.setStyleSheet("") + self.footer_section.label_intro_timer.setText("0.0") except AttributeError: # current track ended during servicing tick pass # Ensure preview button is reset if preview finishes playing # Update preview timer - if self.btnPreview.isChecked(): + if self.footer_section.btnPreview.isChecked(): if self.preview_manager.is_playing(): - self.btnPreview.setChecked(True) + self.footer_section.btnPreview.setChecked(True) minutes, seconds = divmod( self.preview_manager.get_playtime() / 1000, 60 ) - self.label_intro_timer.setText(f"{int(minutes)}:{seconds:04.1f}") + self.footer_section.label_intro_timer.setText( + f"{int(minutes)}:{seconds:04.1f}" + ) else: - self.btnPreview.setChecked(False) - self.label_intro_timer.setText("0.0") - self.label_intro_timer.setStyleSheet("") - self.btnPreview.setChecked(False) + self.footer_section.btnPreview.setChecked(False) + self.footer_section.label_intro_timer.setText("0.0") + self.footer_section.label_intro_timer.setStyleSheet("") + self.footer_section.btnPreview.setChecked(False) def tick_1000ms(self) -> None: """ @@ -1707,7 +1821,9 @@ class Window(QMainWindow, Ui_MainWindow): Called every 500ms """ - self.lblTOD.setText(dt.datetime.now().strftime(Config.TOD_TIME_FORMAT)) + self.header_section.lblTOD.setText( + dt.datetime.now().strftime(Config.TOD_TIME_FORMAT) + ) def update_clocks(self) -> None: """ @@ -1717,7 +1833,7 @@ class Window(QMainWindow, Ui_MainWindow): # If track is playing, update track clocks time and colours if track_sequence.current and track_sequence.current.is_playing(): # Elapsed time - self.label_elapsed_timer.setText( + self.header_section.label_elapsed_timer.setText( helpers.ms_to_mmss(track_sequence.current.time_playing()) + " / " + helpers.ms_to_mmss(track_sequence.current.duration) @@ -1726,22 +1842,24 @@ class Window(QMainWindow, Ui_MainWindow): # Time to fade time_to_fade = track_sequence.current.time_to_fade() time_to_silence = track_sequence.current.time_to_silence() - self.label_fade_timer.setText(helpers.ms_to_mmss(time_to_fade)) + self.footer_section.label_fade_timer.setText( + helpers.ms_to_mmss(time_to_fade) + ) # If silent in the next 5 seconds, put warning colour on # time to silence box and enable play controls if time_to_silence <= Config.WARNING_MS_BEFORE_SILENCE: css_silence = f"background: {Config.COLOUR_ENDING_TIMER}" - if self.frame_silent.styleSheet() != css_silence: - self.frame_silent.setStyleSheet(css_silence) + if self.footer_section.frame_silent.styleSheet() != css_silence: + self.footer_section.frame_silent.setStyleSheet(css_silence) self.catch_return_key = False self.show_status_message("Play controls: Enabled", 0) # Set warning colour on time to silence box when fade starts elif time_to_fade <= 500: css_fade = f"background: {Config.COLOUR_WARNING_TIMER}" - if self.frame_silent.styleSheet() != css_fade: - self.frame_silent.setStyleSheet(css_fade) + if self.footer_section.frame_silent.styleSheet() != css_fade: + self.footer_section.frame_silent.setStyleSheet(css_fade) # WARNING_MS_BEFORE_FADE milliseconds before fade starts, set # warning colour on time to silence box and enable play @@ -1749,7 +1867,7 @@ class Window(QMainWindow, Ui_MainWindow): # timer (see play_next() and issue #223). elif time_to_fade <= Config.WARNING_MS_BEFORE_FADE: - self.frame_fade.setStyleSheet( + self.footer_section.frame_fade.setStyleSheet( f"background: {Config.COLOUR_WARNING_TIMER}" ) self.catch_return_key = False @@ -1760,10 +1878,12 @@ class Window(QMainWindow, Ui_MainWindow): log.debug("issue223: update_clocks: 10ms timer enabled") else: - self.frame_silent.setStyleSheet("") - self.frame_fade.setStyleSheet("") + self.footer_section.frame_silent.setStyleSheet("") + self.footer_section.frame_fade.setStyleSheet("") - self.label_silent_timer.setText(helpers.ms_to_mmss(time_to_silence)) + self.footer_section.label_silent_timer.setText( + helpers.ms_to_mmss(time_to_silence) + ) def update_headers(self) -> None: """ @@ -1771,27 +1891,27 @@ class Window(QMainWindow, Ui_MainWindow): """ if track_sequence.previous: - self.hdrPreviousTrack.setText( + self.header_section.hdrPreviousTrack.setText( f"{track_sequence.previous.title} - {track_sequence.previous.artist}" ) else: - self.hdrPreviousTrack.setText("") + self.header_section.hdrPreviousTrack.setText("") if track_sequence.current: - self.hdrCurrentTrack.setText( + self.header_section.hdrCurrentTrack.setText( f"{track_sequence.current.title.replace('&', '&&')} - " f"{track_sequence.current.artist.replace('&', '&&')}" ) else: - self.hdrCurrentTrack.setText("") + self.header_section.hdrCurrentTrack.setText("") if track_sequence.next: - self.hdrNextTrack.setText( + self.header_section.hdrNextTrack.setText( f"{track_sequence.next.title.replace('&', '&&')} - " f"{track_sequence.next.artist.replace('&', '&&')}" ) else: - self.hdrNextTrack.setText("") + self.header_section.hdrNextTrack.setText("") self.update_playlist_icons() @@ -1810,20 +1930,24 @@ class Window(QMainWindow, Ui_MainWindow): set_next = False for idx in range(self.tabBar.count()): - widget = self.tabPlaylist.widget(idx) + widget = self.playlist_section.tabPlaylist.widget(idx) if ( track_sequence.next and set_next and widget.playlist_id == track_sequence.next.playlist_id ): - self.tabPlaylist.setTabIcon(idx, QIcon(Config.PLAYLIST_ICON_NEXT)) + self.playlist_section.tabPlaylist.setTabIcon( + idx, QIcon(Config.PLAYLIST_ICON_NEXT) + ) elif ( track_sequence.current and widget.playlist_id == track_sequence.current.playlist_id ): - self.tabPlaylist.setTabIcon(idx, QIcon(Config.PLAYLIST_ICON_CURRENT)) + self.playlist_section.tabPlaylist.setTabIcon( + idx, QIcon(Config.PLAYLIST_ICON_CURRENT) + ) else: - self.tabPlaylist.setTabIcon(idx, QIcon()) + self.playlist_section.tabPlaylist.setTabIcon(idx, QIcon()) if __name__ == "__main__": diff --git a/app/ui/main_window_footer.ui b/app/ui/main_window_footer.ui new file mode 100644 index 0000000..b2f066f --- /dev/null +++ b/app/ui/main_window_footer.ui @@ -0,0 +1,589 @@ + + + FooterSection + + + + 0 + 0 + 1237 + 154 + + + + Form + + + + + + + 16777215 + 16777215 + + + + background-color: rgb(192, 191, 188) + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 152 + 112 + + + + + 184 + 16777215 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 132 + 41 + + + + Preview + + + + :/icons/headphones:/icons/headphones + + + + 30 + 30 + + + + true + + + + + + + + 132 + 46 + + + + + 132 + 46 + + + + + + + + + 0 + 0 + 44 + 23 + + + + + 44 + 23 + + + + + 44 + 23 + + + + << + + + + + + 44 + 0 + 44 + 23 + + + + + 44 + 23 + + + + + 44 + 23 + + + + + + + + :/icons/record-button.png + :/icons/record-red-button.png:/icons/record-button.png + + + true + + + + + + 88 + 0 + 44 + 23 + + + + + 44 + 23 + + + + + 44 + 23 + + + + >> + + + + + + 0 + 23 + 44 + 23 + + + + + 44 + 23 + + + + + 44 + 23 + + + + < + + + + + false + + + + 44 + 23 + 44 + 23 + + + + + 44 + 23 + + + + + 44 + 23 + + + + + + + + :/icons/star.png + :/icons/star_empty.png + + + + + + + 88 + 23 + 44 + 23 + + + + + 44 + 23 + + + + + 44 + 23 + + + + > + + + + + + + + + + + + 152 + 112 + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + Intro + + + Qt::AlignCenter + + + + + + + + FreeSans + 40 + 50 + false + + + + 0:0 + + + Qt::AlignCenter + + + + + + + + + + + 152 + 112 + + + + + 184 + 16777215 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 132 + 41 + + + + + 164 + 16777215 + + + + -3dB to talk + + + true + + + + + + + + 132 + 41 + + + + + 164 + 16777215 + + + + Hide played + + + true + + + + + + + + + + + 152 + 112 + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + Fade + + + Qt::AlignCenter + + + + + + + + FreeSans + 40 + 50 + false + + + + 00:00 + + + Qt::AlignCenter + + + + + + + + + + + 152 + 112 + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + Silent + + + Qt::AlignCenter + + + + + + + + FreeSans + 40 + 50 + false + + + + 00:00 + + + Qt::AlignCenter + + + + + + + + + + + 1 + 0 + + + + + 0 + 0 + + + + + + + + + 151 + 0 + + + + + 151 + 112 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 132 + 32 + + + + + 164 + 16777215 + + + + Fade + + + + :/icons/fade:/icons/fade + + + + 30 + 30 + + + + + + + + + 0 + 36 + + + + Stop + + + + :/icons/stopsign:/icons/stopsign + + + + + + + + + + + + + + PlotWidget + QWidget +
pyqtgraph
+ 1 +
+
+ + + + +
diff --git a/app/ui/main_window_footer_ui.py b/app/ui/main_window_footer_ui.py new file mode 100644 index 0000000..0abc6af --- /dev/null +++ b/app/ui/main_window_footer_ui.py @@ -0,0 +1,274 @@ +# Form implementation generated from reading ui file 'app/ui/main_window_footer.ui' +# +# Created by: PyQt6 UI code generator 6.8.1 +# +# WARNING: Any manual changes made to this file will be lost when pyuic6 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt6 import QtCore, QtGui, QtWidgets + + +class Ui_FooterSection(object): + def setupUi(self, FooterSection): + FooterSection.setObjectName("FooterSection") + FooterSection.resize(1237, 154) + self.horizontalLayout_2 = QtWidgets.QHBoxLayout(FooterSection) + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.InfoFooterFrame = QtWidgets.QFrame(parent=FooterSection) + self.InfoFooterFrame.setMaximumSize(QtCore.QSize(16777215, 16777215)) + self.InfoFooterFrame.setStyleSheet("background-color: rgb(192, 191, 188)") + self.InfoFooterFrame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) + self.InfoFooterFrame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.InfoFooterFrame.setObjectName("InfoFooterFrame") + self.horizontalLayout = QtWidgets.QHBoxLayout(self.InfoFooterFrame) + self.horizontalLayout.setObjectName("horizontalLayout") + self.FadeStopInfoFrame = QtWidgets.QFrame(parent=self.InfoFooterFrame) + self.FadeStopInfoFrame.setMinimumSize(QtCore.QSize(152, 112)) + self.FadeStopInfoFrame.setMaximumSize(QtCore.QSize(184, 16777215)) + self.FadeStopInfoFrame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) + self.FadeStopInfoFrame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.FadeStopInfoFrame.setObjectName("FadeStopInfoFrame") + self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.FadeStopInfoFrame) + self.verticalLayout_4.setObjectName("verticalLayout_4") + self.btnPreview = QtWidgets.QPushButton(parent=self.FadeStopInfoFrame) + self.btnPreview.setMinimumSize(QtCore.QSize(132, 41)) + icon = QtGui.QIcon() + icon.addPixmap( + QtGui.QPixmap(":/icons/headphones"), + QtGui.QIcon.Mode.Normal, + QtGui.QIcon.State.Off, + ) + self.btnPreview.setIcon(icon) + self.btnPreview.setIconSize(QtCore.QSize(30, 30)) + self.btnPreview.setCheckable(True) + self.btnPreview.setObjectName("btnPreview") + self.verticalLayout_4.addWidget(self.btnPreview) + self.groupBoxIntroControls = QtWidgets.QGroupBox(parent=self.FadeStopInfoFrame) + self.groupBoxIntroControls.setMinimumSize(QtCore.QSize(132, 46)) + self.groupBoxIntroControls.setMaximumSize(QtCore.QSize(132, 46)) + self.groupBoxIntroControls.setTitle("") + self.groupBoxIntroControls.setObjectName("groupBoxIntroControls") + self.btnPreviewStart = QtWidgets.QPushButton(parent=self.groupBoxIntroControls) + self.btnPreviewStart.setGeometry(QtCore.QRect(0, 0, 44, 23)) + self.btnPreviewStart.setMinimumSize(QtCore.QSize(44, 23)) + self.btnPreviewStart.setMaximumSize(QtCore.QSize(44, 23)) + self.btnPreviewStart.setObjectName("btnPreviewStart") + self.btnPreviewArm = QtWidgets.QPushButton(parent=self.groupBoxIntroControls) + self.btnPreviewArm.setGeometry(QtCore.QRect(44, 0, 44, 23)) + self.btnPreviewArm.setMinimumSize(QtCore.QSize(44, 23)) + self.btnPreviewArm.setMaximumSize(QtCore.QSize(44, 23)) + self.btnPreviewArm.setText("") + icon1 = QtGui.QIcon() + icon1.addPixmap( + QtGui.QPixmap(":/icons/record-button.png"), + QtGui.QIcon.Mode.Normal, + QtGui.QIcon.State.Off, + ) + icon1.addPixmap( + QtGui.QPixmap(":/icons/record-red-button.png"), + QtGui.QIcon.Mode.Normal, + QtGui.QIcon.State.On, + ) + self.btnPreviewArm.setIcon(icon1) + self.btnPreviewArm.setCheckable(True) + self.btnPreviewArm.setObjectName("btnPreviewArm") + self.btnPreviewEnd = QtWidgets.QPushButton(parent=self.groupBoxIntroControls) + self.btnPreviewEnd.setGeometry(QtCore.QRect(88, 0, 44, 23)) + self.btnPreviewEnd.setMinimumSize(QtCore.QSize(44, 23)) + self.btnPreviewEnd.setMaximumSize(QtCore.QSize(44, 23)) + self.btnPreviewEnd.setObjectName("btnPreviewEnd") + self.btnPreviewBack = QtWidgets.QPushButton(parent=self.groupBoxIntroControls) + self.btnPreviewBack.setGeometry(QtCore.QRect(0, 23, 44, 23)) + self.btnPreviewBack.setMinimumSize(QtCore.QSize(44, 23)) + self.btnPreviewBack.setMaximumSize(QtCore.QSize(44, 23)) + self.btnPreviewBack.setObjectName("btnPreviewBack") + self.btnPreviewMark = QtWidgets.QPushButton(parent=self.groupBoxIntroControls) + self.btnPreviewMark.setEnabled(False) + self.btnPreviewMark.setGeometry(QtCore.QRect(44, 23, 44, 23)) + self.btnPreviewMark.setMinimumSize(QtCore.QSize(44, 23)) + self.btnPreviewMark.setMaximumSize(QtCore.QSize(44, 23)) + self.btnPreviewMark.setText("") + icon2 = QtGui.QIcon() + icon2.addPixmap( + QtGui.QPixmap(":/icons/star.png"), + QtGui.QIcon.Mode.Normal, + QtGui.QIcon.State.On, + ) + icon2.addPixmap( + QtGui.QPixmap(":/icons/star_empty.png"), + QtGui.QIcon.Mode.Disabled, + QtGui.QIcon.State.Off, + ) + self.btnPreviewMark.setIcon(icon2) + self.btnPreviewMark.setObjectName("btnPreviewMark") + self.btnPreviewFwd = QtWidgets.QPushButton(parent=self.groupBoxIntroControls) + self.btnPreviewFwd.setGeometry(QtCore.QRect(88, 23, 44, 23)) + self.btnPreviewFwd.setMinimumSize(QtCore.QSize(44, 23)) + self.btnPreviewFwd.setMaximumSize(QtCore.QSize(44, 23)) + self.btnPreviewFwd.setObjectName("btnPreviewFwd") + self.verticalLayout_4.addWidget(self.groupBoxIntroControls) + self.horizontalLayout.addWidget(self.FadeStopInfoFrame) + self.frame_intro = QtWidgets.QFrame(parent=self.InfoFooterFrame) + self.frame_intro.setMinimumSize(QtCore.QSize(152, 112)) + self.frame_intro.setStyleSheet("") + self.frame_intro.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) + self.frame_intro.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.frame_intro.setObjectName("frame_intro") + self.verticalLayout_9 = QtWidgets.QVBoxLayout(self.frame_intro) + self.verticalLayout_9.setObjectName("verticalLayout_9") + self.label_7 = QtWidgets.QLabel(parent=self.frame_intro) + self.label_7.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) + self.label_7.setObjectName("label_7") + self.verticalLayout_9.addWidget(self.label_7) + self.label_intro_timer = QtWidgets.QLabel(parent=self.frame_intro) + font = QtGui.QFont() + font.setFamily("FreeSans") + font.setPointSize(40) + font.setBold(False) + font.setWeight(50) + self.label_intro_timer.setFont(font) + self.label_intro_timer.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) + self.label_intro_timer.setObjectName("label_intro_timer") + self.verticalLayout_9.addWidget(self.label_intro_timer) + self.horizontalLayout.addWidget(self.frame_intro) + self.frame_toggleplayed_3db = QtWidgets.QFrame(parent=self.InfoFooterFrame) + self.frame_toggleplayed_3db.setMinimumSize(QtCore.QSize(152, 112)) + self.frame_toggleplayed_3db.setMaximumSize(QtCore.QSize(184, 16777215)) + self.frame_toggleplayed_3db.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) + self.frame_toggleplayed_3db.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.frame_toggleplayed_3db.setObjectName("frame_toggleplayed_3db") + self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.frame_toggleplayed_3db) + self.verticalLayout_6.setObjectName("verticalLayout_6") + self.btnDrop3db = QtWidgets.QPushButton(parent=self.frame_toggleplayed_3db) + self.btnDrop3db.setMinimumSize(QtCore.QSize(132, 41)) + self.btnDrop3db.setMaximumSize(QtCore.QSize(164, 16777215)) + self.btnDrop3db.setCheckable(True) + self.btnDrop3db.setObjectName("btnDrop3db") + self.verticalLayout_6.addWidget(self.btnDrop3db) + self.btnHidePlayed = QtWidgets.QPushButton(parent=self.frame_toggleplayed_3db) + self.btnHidePlayed.setMinimumSize(QtCore.QSize(132, 41)) + self.btnHidePlayed.setMaximumSize(QtCore.QSize(164, 16777215)) + self.btnHidePlayed.setCheckable(True) + self.btnHidePlayed.setObjectName("btnHidePlayed") + self.verticalLayout_6.addWidget(self.btnHidePlayed) + self.horizontalLayout.addWidget(self.frame_toggleplayed_3db) + self.frame_fade = QtWidgets.QFrame(parent=self.InfoFooterFrame) + self.frame_fade.setMinimumSize(QtCore.QSize(152, 112)) + self.frame_fade.setStyleSheet("") + self.frame_fade.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) + self.frame_fade.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.frame_fade.setObjectName("frame_fade") + self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.frame_fade) + self.verticalLayout_2.setObjectName("verticalLayout_2") + self.label_4 = QtWidgets.QLabel(parent=self.frame_fade) + self.label_4.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) + self.label_4.setObjectName("label_4") + self.verticalLayout_2.addWidget(self.label_4) + self.label_fade_timer = QtWidgets.QLabel(parent=self.frame_fade) + font = QtGui.QFont() + font.setFamily("FreeSans") + font.setPointSize(40) + font.setBold(False) + font.setWeight(50) + self.label_fade_timer.setFont(font) + self.label_fade_timer.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) + self.label_fade_timer.setObjectName("label_fade_timer") + self.verticalLayout_2.addWidget(self.label_fade_timer) + self.horizontalLayout.addWidget(self.frame_fade) + self.frame_silent = QtWidgets.QFrame(parent=self.InfoFooterFrame) + self.frame_silent.setMinimumSize(QtCore.QSize(152, 112)) + self.frame_silent.setStyleSheet("") + self.frame_silent.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) + self.frame_silent.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.frame_silent.setObjectName("frame_silent") + self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.frame_silent) + self.verticalLayout_7.setObjectName("verticalLayout_7") + self.label_5 = QtWidgets.QLabel(parent=self.frame_silent) + self.label_5.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) + self.label_5.setObjectName("label_5") + self.verticalLayout_7.addWidget(self.label_5) + self.label_silent_timer = QtWidgets.QLabel(parent=self.frame_silent) + font = QtGui.QFont() + font.setFamily("FreeSans") + font.setPointSize(40) + font.setBold(False) + font.setWeight(50) + self.label_silent_timer.setFont(font) + self.label_silent_timer.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) + self.label_silent_timer.setObjectName("label_silent_timer") + self.verticalLayout_7.addWidget(self.label_silent_timer) + self.horizontalLayout.addWidget(self.frame_silent) + self.widgetFadeVolume = PlotWidget(parent=self.InfoFooterFrame) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Policy.Preferred, + QtWidgets.QSizePolicy.Policy.Preferred, + ) + sizePolicy.setHorizontalStretch(1) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth( + self.widgetFadeVolume.sizePolicy().hasHeightForWidth() + ) + self.widgetFadeVolume.setSizePolicy(sizePolicy) + self.widgetFadeVolume.setMinimumSize(QtCore.QSize(0, 0)) + self.widgetFadeVolume.setObjectName("widgetFadeVolume") + self.horizontalLayout.addWidget(self.widgetFadeVolume) + self.frame = QtWidgets.QFrame(parent=self.InfoFooterFrame) + self.frame.setMinimumSize(QtCore.QSize(151, 0)) + self.frame.setMaximumSize(QtCore.QSize(151, 112)) + self.frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) + self.frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.frame.setObjectName("frame") + self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.frame) + self.verticalLayout_5.setObjectName("verticalLayout_5") + self.btnFade = QtWidgets.QPushButton(parent=self.frame) + self.btnFade.setMinimumSize(QtCore.QSize(132, 32)) + self.btnFade.setMaximumSize(QtCore.QSize(164, 16777215)) + icon3 = QtGui.QIcon() + icon3.addPixmap( + QtGui.QPixmap(":/icons/fade"), + QtGui.QIcon.Mode.Normal, + QtGui.QIcon.State.Off, + ) + self.btnFade.setIcon(icon3) + self.btnFade.setIconSize(QtCore.QSize(30, 30)) + self.btnFade.setObjectName("btnFade") + self.verticalLayout_5.addWidget(self.btnFade) + self.btnStop = QtWidgets.QPushButton(parent=self.frame) + self.btnStop.setMinimumSize(QtCore.QSize(0, 36)) + icon4 = QtGui.QIcon() + icon4.addPixmap( + QtGui.QPixmap(":/icons/stopsign"), + QtGui.QIcon.Mode.Normal, + QtGui.QIcon.State.Off, + ) + self.btnStop.setIcon(icon4) + self.btnStop.setObjectName("btnStop") + self.verticalLayout_5.addWidget(self.btnStop) + self.horizontalLayout.addWidget(self.frame) + self.horizontalLayout_2.addWidget(self.InfoFooterFrame) + + self.retranslateUi(FooterSection) + QtCore.QMetaObject.connectSlotsByName(FooterSection) + + def retranslateUi(self, FooterSection): + _translate = QtCore.QCoreApplication.translate + FooterSection.setWindowTitle(_translate("FooterSection", "Form")) + self.btnPreview.setText(_translate("FooterSection", " Preview")) + self.btnPreviewStart.setText(_translate("FooterSection", "<<")) + self.btnPreviewEnd.setText(_translate("FooterSection", ">>")) + self.btnPreviewBack.setText(_translate("FooterSection", "<")) + self.btnPreviewFwd.setText(_translate("FooterSection", ">")) + self.label_7.setText(_translate("FooterSection", "Intro")) + self.label_intro_timer.setText(_translate("FooterSection", "0:0")) + self.btnDrop3db.setText(_translate("FooterSection", "-3dB to talk")) + self.btnHidePlayed.setText(_translate("FooterSection", "Hide played")) + self.label_4.setText(_translate("FooterSection", "Fade")) + self.label_fade_timer.setText(_translate("FooterSection", "00:00")) + self.label_5.setText(_translate("FooterSection", "Silent")) + self.label_silent_timer.setText(_translate("FooterSection", "00:00")) + self.btnFade.setText(_translate("FooterSection", " Fade")) + self.btnStop.setText(_translate("FooterSection", " Stop")) + + +from pyqtgraph import PlotWidget # type: ignore diff --git a/app/ui/main_window_header.ui b/app/ui/main_window_header.ui new file mode 100644 index 0000000..2be4a2d --- /dev/null +++ b/app/ui/main_window_header.ui @@ -0,0 +1,314 @@ + + + HeaderSection + + + + 0 + 0 + 1273 + 179 + + + + Form + + + + + + + + + + + + + 0 + 0 + + + + + 230 + 16777215 + + + + + Sans + 20 + + + + background-color: #f8d7da; +border: 1px solid rgb(85, 87, 83); + + + Last track: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 230 + 16777215 + + + + + Sans + 20 + + + + background-color: #d4edda; +border: 1px solid rgb(85, 87, 83); + + + Current track: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 230 + 16777215 + + + + + Sans + 20 + + + + background-color: #fff3cd; +border: 1px solid rgb(85, 87, 83); + + + Next track: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + + Sans + 20 + + + + background-color: #f8d7da; +border: 1px solid rgb(85, 87, 83); + + + + + + false + + + + + + + + 0 + 0 + + + + + 20 + + + + background-color: #d4edda; +border: 1px solid rgb(85, 87, 83); +text-align: left; +padding-left: 8px; + + + + + + + true + + + + + + + + 0 + 0 + + + + + 20 + + + + background-color: #fff3cd; +border: 1px solid rgb(85, 87, 83); +text-align: left; +padding-left: 8px; + + + + + + true + + + + + + + + + + 0 + 131 + + + + + 230 + 131 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 208 + 0 + + + + + 35 + + + + 00:00:00 + + + Qt::AlignCenter + + + + + + + + FreeSans + 18 + 50 + false + + + + color: black; + + + 00:00 / 00:00 + + + Qt::AlignCenter + + + + + + + + + + + + + 0 + 16 + + + + false + + + background-color: rgb(154, 153, 150) + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + + + diff --git a/app/ui/main_window_header_ui.py b/app/ui/main_window_header_ui.py new file mode 100644 index 0000000..6630427 --- /dev/null +++ b/app/ui/main_window_header_ui.py @@ -0,0 +1,178 @@ +# Form implementation generated from reading ui file 'app/ui/main_window_header.ui' +# +# Created by: PyQt6 UI code generator 6.8.1 +# +# WARNING: Any manual changes made to this file will be lost when pyuic6 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt6 import QtCore, QtGui, QtWidgets + + +class Ui_HeaderSection(object): + def setupUi(self, HeaderSection): + HeaderSection.setObjectName("HeaderSection") + HeaderSection.resize(1273, 179) + self.horizontalLayout = QtWidgets.QHBoxLayout(HeaderSection) + self.horizontalLayout.setObjectName("horizontalLayout") + self.gridLayout = QtWidgets.QGridLayout() + self.gridLayout.setObjectName("gridLayout") + self.horizontalLayout_3 = QtWidgets.QHBoxLayout() + self.horizontalLayout_3.setObjectName("horizontalLayout_3") + self.verticalLayout_3 = QtWidgets.QVBoxLayout() + self.verticalLayout_3.setObjectName("verticalLayout_3") + self.previous_track_2 = QtWidgets.QLabel(parent=HeaderSection) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.previous_track_2.sizePolicy().hasHeightForWidth()) + self.previous_track_2.setSizePolicy(sizePolicy) + self.previous_track_2.setMaximumSize(QtCore.QSize(230, 16777215)) + font = QtGui.QFont() + font.setFamily("Sans") + font.setPointSize(20) + self.previous_track_2.setFont(font) + self.previous_track_2.setStyleSheet("background-color: #f8d7da;\n" +"border: 1px solid rgb(85, 87, 83);") + self.previous_track_2.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter) + self.previous_track_2.setObjectName("previous_track_2") + self.verticalLayout_3.addWidget(self.previous_track_2) + self.current_track_2 = QtWidgets.QLabel(parent=HeaderSection) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.current_track_2.sizePolicy().hasHeightForWidth()) + self.current_track_2.setSizePolicy(sizePolicy) + self.current_track_2.setMaximumSize(QtCore.QSize(230, 16777215)) + font = QtGui.QFont() + font.setFamily("Sans") + font.setPointSize(20) + self.current_track_2.setFont(font) + self.current_track_2.setStyleSheet("background-color: #d4edda;\n" +"border: 1px solid rgb(85, 87, 83);") + self.current_track_2.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter) + self.current_track_2.setObjectName("current_track_2") + self.verticalLayout_3.addWidget(self.current_track_2) + self.next_track_2 = QtWidgets.QLabel(parent=HeaderSection) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.next_track_2.sizePolicy().hasHeightForWidth()) + self.next_track_2.setSizePolicy(sizePolicy) + self.next_track_2.setMaximumSize(QtCore.QSize(230, 16777215)) + font = QtGui.QFont() + font.setFamily("Sans") + font.setPointSize(20) + self.next_track_2.setFont(font) + self.next_track_2.setStyleSheet("background-color: #fff3cd;\n" +"border: 1px solid rgb(85, 87, 83);") + self.next_track_2.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter) + self.next_track_2.setObjectName("next_track_2") + self.verticalLayout_3.addWidget(self.next_track_2) + self.horizontalLayout_3.addLayout(self.verticalLayout_3) + self.verticalLayout = QtWidgets.QVBoxLayout() + self.verticalLayout.setObjectName("verticalLayout") + self.hdrPreviousTrack = QtWidgets.QLabel(parent=HeaderSection) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred) + 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)) + font = QtGui.QFont() + font.setFamily("Sans") + font.setPointSize(20) + self.hdrPreviousTrack.setFont(font) + self.hdrPreviousTrack.setStyleSheet("background-color: #f8d7da;\n" +"border: 1px solid rgb(85, 87, 83);") + self.hdrPreviousTrack.setText("") + self.hdrPreviousTrack.setWordWrap(False) + self.hdrPreviousTrack.setObjectName("hdrPreviousTrack") + self.verticalLayout.addWidget(self.hdrPreviousTrack) + self.hdrCurrentTrack = QtWidgets.QPushButton(parent=HeaderSection) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.hdrCurrentTrack.sizePolicy().hasHeightForWidth()) + self.hdrCurrentTrack.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setPointSize(20) + self.hdrCurrentTrack.setFont(font) + self.hdrCurrentTrack.setStyleSheet("background-color: #d4edda;\n" +"border: 1px solid rgb(85, 87, 83);\n" +"text-align: left;\n" +"padding-left: 8px;\n" +"") + self.hdrCurrentTrack.setText("") + self.hdrCurrentTrack.setFlat(True) + self.hdrCurrentTrack.setObjectName("hdrCurrentTrack") + self.verticalLayout.addWidget(self.hdrCurrentTrack) + self.hdrNextTrack = QtWidgets.QPushButton(parent=HeaderSection) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.hdrNextTrack.sizePolicy().hasHeightForWidth()) + self.hdrNextTrack.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setPointSize(20) + self.hdrNextTrack.setFont(font) + self.hdrNextTrack.setStyleSheet("background-color: #fff3cd;\n" +"border: 1px solid rgb(85, 87, 83);\n" +"text-align: left;\n" +"padding-left: 8px;") + self.hdrNextTrack.setText("") + self.hdrNextTrack.setFlat(True) + self.hdrNextTrack.setObjectName("hdrNextTrack") + self.verticalLayout.addWidget(self.hdrNextTrack) + self.horizontalLayout_3.addLayout(self.verticalLayout) + self.frame_2 = QtWidgets.QFrame(parent=HeaderSection) + self.frame_2.setMinimumSize(QtCore.QSize(0, 131)) + self.frame_2.setMaximumSize(QtCore.QSize(230, 131)) + self.frame_2.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) + self.frame_2.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.frame_2.setObjectName("frame_2") + self.verticalLayout_10 = QtWidgets.QVBoxLayout(self.frame_2) + self.verticalLayout_10.setObjectName("verticalLayout_10") + self.lblTOD = QtWidgets.QLabel(parent=self.frame_2) + self.lblTOD.setMinimumSize(QtCore.QSize(208, 0)) + font = QtGui.QFont() + font.setPointSize(35) + self.lblTOD.setFont(font) + self.lblTOD.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) + self.lblTOD.setObjectName("lblTOD") + self.verticalLayout_10.addWidget(self.lblTOD) + self.label_elapsed_timer = QtWidgets.QLabel(parent=self.frame_2) + font = QtGui.QFont() + font.setFamily("FreeSans") + font.setPointSize(18) + font.setBold(False) + font.setWeight(50) + self.label_elapsed_timer.setFont(font) + self.label_elapsed_timer.setStyleSheet("color: black;") + self.label_elapsed_timer.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) + self.label_elapsed_timer.setObjectName("label_elapsed_timer") + self.verticalLayout_10.addWidget(self.label_elapsed_timer) + self.horizontalLayout_3.addWidget(self.frame_2) + self.gridLayout.addLayout(self.horizontalLayout_3, 0, 0, 1, 1) + self.frame_4 = QtWidgets.QFrame(parent=HeaderSection) + self.frame_4.setMinimumSize(QtCore.QSize(0, 16)) + self.frame_4.setAutoFillBackground(False) + self.frame_4.setStyleSheet("background-color: rgb(154, 153, 150)") + self.frame_4.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) + self.frame_4.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.frame_4.setObjectName("frame_4") + self.gridLayout.addWidget(self.frame_4, 1, 0, 1, 1) + self.horizontalLayout.addLayout(self.gridLayout) + + self.retranslateUi(HeaderSection) + QtCore.QMetaObject.connectSlotsByName(HeaderSection) + + def retranslateUi(self, HeaderSection): + _translate = QtCore.QCoreApplication.translate + HeaderSection.setWindowTitle(_translate("HeaderSection", "Form")) + self.previous_track_2.setText(_translate("HeaderSection", "Last track:")) + self.current_track_2.setText(_translate("HeaderSection", "Current track:")) + self.next_track_2.setText(_translate("HeaderSection", "Next track:")) + self.lblTOD.setText(_translate("HeaderSection", "00:00:00")) + self.label_elapsed_timer.setText(_translate("HeaderSection", "00:00 / 00:00")) diff --git a/app/ui/main_window_playlist.ui b/app/ui/main_window_playlist.ui new file mode 100644 index 0000000..6bcee88 --- /dev/null +++ b/app/ui/main_window_playlist.ui @@ -0,0 +1,42 @@ + + + PlaylistSection + + + + 0 + 0 + 1249 + 499 + + + + Form + + + + + + Qt::Vertical + + + + -1 + + + false + + + true + + + true + + + + + + + + + diff --git a/app/ui/main_window_playlist_ui.py b/app/ui/main_window_playlist_ui.py new file mode 100644 index 0000000..f074234 --- /dev/null +++ b/app/ui/main_window_playlist_ui.py @@ -0,0 +1,34 @@ +# Form implementation generated from reading ui file 'app/ui/main_window_playlist.ui' +# +# Created by: PyQt6 UI code generator 6.8.1 +# +# WARNING: Any manual changes made to this file will be lost when pyuic6 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt6 import QtCore, QtGui, QtWidgets + + +class Ui_PlaylistSection(object): + def setupUi(self, PlaylistSection): + PlaylistSection.setObjectName("PlaylistSection") + PlaylistSection.resize(1249, 499) + self.horizontalLayout = QtWidgets.QHBoxLayout(PlaylistSection) + self.horizontalLayout.setObjectName("horizontalLayout") + self.splitter = QtWidgets.QSplitter(parent=PlaylistSection) + self.splitter.setOrientation(QtCore.Qt.Orientation.Vertical) + self.splitter.setObjectName("splitter") + self.tabPlaylist = QtWidgets.QTabWidget(parent=self.splitter) + self.tabPlaylist.setDocumentMode(False) + self.tabPlaylist.setTabsClosable(True) + self.tabPlaylist.setMovable(True) + self.tabPlaylist.setObjectName("tabPlaylist") + self.horizontalLayout.addWidget(self.splitter) + + self.retranslateUi(PlaylistSection) + self.tabPlaylist.setCurrentIndex(-1) + QtCore.QMetaObject.connectSlotsByName(PlaylistSection) + + def retranslateUi(self, PlaylistSection): + _translate = QtCore.QCoreApplication.translate + PlaylistSection.setWindowTitle(_translate("PlaylistSection", "Form")) diff --git a/app/ui/main_window_ui.py b/app/ui/main_window_ui.py index 114c163..cad53d2 100644 --- a/app/ui/main_window_ui.py +++ b/app/ui/main_window_ui.py @@ -15,7 +15,11 @@ class Ui_MainWindow(object): MainWindow.resize(1280, 857) MainWindow.setMinimumSize(QtCore.QSize(1280, 0)) icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap(":/icons/musicmuster"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + icon.addPixmap( + QtGui.QPixmap(":/icons/musicmuster"), + QtGui.QIcon.Mode.Normal, + QtGui.QIcon.State.Off, + ) MainWindow.setWindowIcon(icon) MainWindow.setStyleSheet("") self.centralwidget = QtWidgets.QWidget(parent=MainWindow) @@ -27,39 +31,62 @@ class Ui_MainWindow(object): self.verticalLayout_3 = QtWidgets.QVBoxLayout() self.verticalLayout_3.setObjectName("verticalLayout_3") self.previous_track_2 = QtWidgets.QLabel(parent=self.centralwidget) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Policy.Preferred, + QtWidgets.QSizePolicy.Policy.Preferred, + ) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.previous_track_2.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.previous_track_2.sizePolicy().hasHeightForWidth() + ) self.previous_track_2.setSizePolicy(sizePolicy) self.previous_track_2.setMaximumSize(QtCore.QSize(230, 16777215)) font = QtGui.QFont() font.setFamily("Sans") font.setPointSize(20) self.previous_track_2.setFont(font) - self.previous_track_2.setStyleSheet("background-color: #f8d7da;\n" -"border: 1px solid rgb(85, 87, 83);") - self.previous_track_2.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter) + self.previous_track_2.setStyleSheet( + "background-color: #f8d7da;\n" "border: 1px solid rgb(85, 87, 83);" + ) + self.previous_track_2.setAlignment( + QtCore.Qt.AlignmentFlag.AlignRight + | QtCore.Qt.AlignmentFlag.AlignTrailing + | QtCore.Qt.AlignmentFlag.AlignVCenter + ) self.previous_track_2.setObjectName("previous_track_2") self.verticalLayout_3.addWidget(self.previous_track_2) self.current_track_2 = QtWidgets.QLabel(parent=self.centralwidget) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Policy.Preferred, + QtWidgets.QSizePolicy.Policy.Preferred, + ) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.current_track_2.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.current_track_2.sizePolicy().hasHeightForWidth() + ) self.current_track_2.setSizePolicy(sizePolicy) self.current_track_2.setMaximumSize(QtCore.QSize(230, 16777215)) font = QtGui.QFont() font.setFamily("Sans") font.setPointSize(20) self.current_track_2.setFont(font) - self.current_track_2.setStyleSheet("background-color: #d4edda;\n" -"border: 1px solid rgb(85, 87, 83);") - self.current_track_2.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter) + self.current_track_2.setStyleSheet( + "background-color: #d4edda;\n" "border: 1px solid rgb(85, 87, 83);" + ) + self.current_track_2.setAlignment( + QtCore.Qt.AlignmentFlag.AlignRight + | QtCore.Qt.AlignmentFlag.AlignTrailing + | QtCore.Qt.AlignmentFlag.AlignVCenter + ) self.current_track_2.setObjectName("current_track_2") self.verticalLayout_3.addWidget(self.current_track_2) self.next_track_2 = QtWidgets.QLabel(parent=self.centralwidget) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Policy.Preferred, + QtWidgets.QSizePolicy.Policy.Preferred, + ) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.next_track_2.sizePolicy().hasHeightForWidth()) @@ -69,19 +96,29 @@ class Ui_MainWindow(object): font.setFamily("Sans") font.setPointSize(20) self.next_track_2.setFont(font) - self.next_track_2.setStyleSheet("background-color: #fff3cd;\n" -"border: 1px solid rgb(85, 87, 83);") - self.next_track_2.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter) + self.next_track_2.setStyleSheet( + "background-color: #fff3cd;\n" "border: 1px solid rgb(85, 87, 83);" + ) + self.next_track_2.setAlignment( + QtCore.Qt.AlignmentFlag.AlignRight + | QtCore.Qt.AlignmentFlag.AlignTrailing + | QtCore.Qt.AlignmentFlag.AlignVCenter + ) self.next_track_2.setObjectName("next_track_2") self.verticalLayout_3.addWidget(self.next_track_2) self.horizontalLayout_3.addLayout(self.verticalLayout_3) self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.hdrPreviousTrack = QtWidgets.QLabel(parent=self.centralwidget) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Policy.Preferred, + QtWidgets.QSizePolicy.Policy.Preferred, + ) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.hdrPreviousTrack.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.hdrPreviousTrack.sizePolicy().hasHeightForWidth() + ) self.hdrPreviousTrack.setSizePolicy(sizePolicy) self.hdrPreviousTrack.setMinimumSize(QtCore.QSize(0, 0)) self.hdrPreviousTrack.setMaximumSize(QtCore.QSize(16777215, 16777215)) @@ -89,32 +126,43 @@ class Ui_MainWindow(object): font.setFamily("Sans") font.setPointSize(20) self.hdrPreviousTrack.setFont(font) - self.hdrPreviousTrack.setStyleSheet("background-color: #f8d7da;\n" -"border: 1px solid rgb(85, 87, 83);") + self.hdrPreviousTrack.setStyleSheet( + "background-color: #f8d7da;\n" "border: 1px solid rgb(85, 87, 83);" + ) self.hdrPreviousTrack.setText("") self.hdrPreviousTrack.setWordWrap(False) self.hdrPreviousTrack.setObjectName("hdrPreviousTrack") self.verticalLayout.addWidget(self.hdrPreviousTrack) self.hdrCurrentTrack = QtWidgets.QPushButton(parent=self.centralwidget) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Policy.Preferred, + QtWidgets.QSizePolicy.Policy.Preferred, + ) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.hdrCurrentTrack.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.hdrCurrentTrack.sizePolicy().hasHeightForWidth() + ) self.hdrCurrentTrack.setSizePolicy(sizePolicy) font = QtGui.QFont() font.setPointSize(20) self.hdrCurrentTrack.setFont(font) - self.hdrCurrentTrack.setStyleSheet("background-color: #d4edda;\n" -"border: 1px solid rgb(85, 87, 83);\n" -"text-align: left;\n" -"padding-left: 8px;\n" -"") + self.hdrCurrentTrack.setStyleSheet( + "background-color: #d4edda;\n" + "border: 1px solid rgb(85, 87, 83);\n" + "text-align: left;\n" + "padding-left: 8px;\n" + "" + ) self.hdrCurrentTrack.setText("") self.hdrCurrentTrack.setFlat(True) self.hdrCurrentTrack.setObjectName("hdrCurrentTrack") self.verticalLayout.addWidget(self.hdrCurrentTrack) self.hdrNextTrack = QtWidgets.QPushButton(parent=self.centralwidget) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Policy.Preferred, + QtWidgets.QSizePolicy.Policy.Preferred, + ) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.hdrNextTrack.sizePolicy().hasHeightForWidth()) @@ -122,10 +170,12 @@ class Ui_MainWindow(object): font = QtGui.QFont() font.setPointSize(20) self.hdrNextTrack.setFont(font) - self.hdrNextTrack.setStyleSheet("background-color: #fff3cd;\n" -"border: 1px solid rgb(85, 87, 83);\n" -"text-align: left;\n" -"padding-left: 8px;") + self.hdrNextTrack.setStyleSheet( + "background-color: #fff3cd;\n" + "border: 1px solid rgb(85, 87, 83);\n" + "text-align: left;\n" + "padding-left: 8px;" + ) self.hdrNextTrack.setText("") self.hdrNextTrack.setFlat(True) self.hdrNextTrack.setObjectName("hdrNextTrack") @@ -172,7 +222,12 @@ class Ui_MainWindow(object): self.cartsWidget.setObjectName("cartsWidget") self.horizontalLayout_Carts = QtWidgets.QHBoxLayout(self.cartsWidget) self.horizontalLayout_Carts.setObjectName("horizontalLayout_Carts") - spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + spacerItem = QtWidgets.QSpacerItem( + 40, + 20, + QtWidgets.QSizePolicy.Policy.Expanding, + QtWidgets.QSizePolicy.Policy.Minimum, + ) self.horizontalLayout_Carts.addItem(spacerItem) self.gridLayout_4.addWidget(self.cartsWidget, 2, 0, 1, 1) self.frame_6 = QtWidgets.QFrame(parent=self.centralwidget) @@ -217,7 +272,11 @@ class Ui_MainWindow(object): self.btnPreview = QtWidgets.QPushButton(parent=self.FadeStopInfoFrame) self.btnPreview.setMinimumSize(QtCore.QSize(132, 41)) icon1 = QtGui.QIcon() - icon1.addPixmap(QtGui.QPixmap(":/icons/headphones"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + icon1.addPixmap( + QtGui.QPixmap(":/icons/headphones"), + QtGui.QIcon.Mode.Normal, + QtGui.QIcon.State.Off, + ) self.btnPreview.setIcon(icon1) self.btnPreview.setIconSize(QtCore.QSize(30, 30)) self.btnPreview.setCheckable(True) @@ -239,8 +298,16 @@ class Ui_MainWindow(object): self.btnPreviewArm.setMaximumSize(QtCore.QSize(44, 23)) self.btnPreviewArm.setText("") icon2 = QtGui.QIcon() - icon2.addPixmap(QtGui.QPixmap(":/icons/record-button.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) - icon2.addPixmap(QtGui.QPixmap(":/icons/record-red-button.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.On) + icon2.addPixmap( + QtGui.QPixmap(":/icons/record-button.png"), + QtGui.QIcon.Mode.Normal, + QtGui.QIcon.State.Off, + ) + icon2.addPixmap( + QtGui.QPixmap(":/icons/record-red-button.png"), + QtGui.QIcon.Mode.Normal, + QtGui.QIcon.State.On, + ) self.btnPreviewArm.setIcon(icon2) self.btnPreviewArm.setCheckable(True) self.btnPreviewArm.setObjectName("btnPreviewArm") @@ -261,8 +328,16 @@ class Ui_MainWindow(object): self.btnPreviewMark.setMaximumSize(QtCore.QSize(44, 23)) self.btnPreviewMark.setText("") icon3 = QtGui.QIcon() - icon3.addPixmap(QtGui.QPixmap(":/icons/star.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.On) - icon3.addPixmap(QtGui.QPixmap(":/icons/star_empty.png"), QtGui.QIcon.Mode.Disabled, QtGui.QIcon.State.Off) + icon3.addPixmap( + QtGui.QPixmap(":/icons/star.png"), + QtGui.QIcon.Mode.Normal, + QtGui.QIcon.State.On, + ) + icon3.addPixmap( + QtGui.QPixmap(":/icons/star_empty.png"), + QtGui.QIcon.Mode.Disabled, + QtGui.QIcon.State.Off, + ) self.btnPreviewMark.setIcon(icon3) self.btnPreviewMark.setObjectName("btnPreviewMark") self.btnPreviewFwd = QtWidgets.QPushButton(parent=self.groupBoxIntroControls) @@ -363,10 +438,15 @@ class Ui_MainWindow(object): self.verticalLayout_7.addWidget(self.label_silent_timer) self.horizontalLayout.addWidget(self.frame_silent) self.widgetFadeVolume = PlotWidget(parent=self.InfoFooterFrame) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred) + sizePolicy = QtWidgets.QSizePolicy( + QtWidgets.QSizePolicy.Policy.Preferred, + QtWidgets.QSizePolicy.Policy.Preferred, + ) sizePolicy.setHorizontalStretch(1) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.widgetFadeVolume.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.widgetFadeVolume.sizePolicy().hasHeightForWidth() + ) self.widgetFadeVolume.setSizePolicy(sizePolicy) self.widgetFadeVolume.setMinimumSize(QtCore.QSize(0, 0)) self.widgetFadeVolume.setObjectName("widgetFadeVolume") @@ -383,7 +463,11 @@ class Ui_MainWindow(object): self.btnFade.setMinimumSize(QtCore.QSize(132, 32)) self.btnFade.setMaximumSize(QtCore.QSize(164, 16777215)) icon4 = QtGui.QIcon() - icon4.addPixmap(QtGui.QPixmap(":/icons/fade"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + icon4.addPixmap( + QtGui.QPixmap(":/icons/fade"), + QtGui.QIcon.Mode.Normal, + QtGui.QIcon.State.Off, + ) self.btnFade.setIcon(icon4) self.btnFade.setIconSize(QtCore.QSize(30, 30)) self.btnFade.setObjectName("btnFade") @@ -391,7 +475,11 @@ class Ui_MainWindow(object): self.btnStop = QtWidgets.QPushButton(parent=self.frame) self.btnStop.setMinimumSize(QtCore.QSize(0, 36)) icon5 = QtGui.QIcon() - icon5.addPixmap(QtGui.QPixmap(":/icons/stopsign"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + icon5.addPixmap( + QtGui.QPixmap(":/icons/stopsign"), + QtGui.QIcon.Mode.Normal, + QtGui.QIcon.State.Off, + ) self.btnStop.setIcon(icon5) self.btnStop.setObjectName("btnStop") self.verticalLayout_5.addWidget(self.btnStop) @@ -417,39 +505,71 @@ class Ui_MainWindow(object): MainWindow.setStatusBar(self.statusbar) self.actionPlay_next = QtGui.QAction(parent=MainWindow) icon6 = QtGui.QIcon() - icon6.addPixmap(QtGui.QPixmap("app/ui/../../../../../../.designer/backup/icon-play.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + icon6.addPixmap( + QtGui.QPixmap("app/ui/../../../../../../.designer/backup/icon-play.png"), + QtGui.QIcon.Mode.Normal, + QtGui.QIcon.State.Off, + ) self.actionPlay_next.setIcon(icon6) self.actionPlay_next.setObjectName("actionPlay_next") self.actionSkipToNext = QtGui.QAction(parent=MainWindow) icon7 = QtGui.QIcon() - icon7.addPixmap(QtGui.QPixmap(":/icons/next"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + icon7.addPixmap( + QtGui.QPixmap(":/icons/next"), + QtGui.QIcon.Mode.Normal, + QtGui.QIcon.State.Off, + ) self.actionSkipToNext.setIcon(icon7) self.actionSkipToNext.setObjectName("actionSkipToNext") self.actionInsertTrack = QtGui.QAction(parent=MainWindow) icon8 = QtGui.QIcon() - icon8.addPixmap(QtGui.QPixmap("app/ui/../../../../../../.designer/backup/icon_search_database.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + icon8.addPixmap( + QtGui.QPixmap( + "app/ui/../../../../../../.designer/backup/icon_search_database.png" + ), + QtGui.QIcon.Mode.Normal, + QtGui.QIcon.State.Off, + ) self.actionInsertTrack.setIcon(icon8) self.actionInsertTrack.setObjectName("actionInsertTrack") self.actionAdd_file = QtGui.QAction(parent=MainWindow) icon9 = QtGui.QIcon() - icon9.addPixmap(QtGui.QPixmap("app/ui/../../../../../../.designer/backup/icon_open_file.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + icon9.addPixmap( + QtGui.QPixmap( + "app/ui/../../../../../../.designer/backup/icon_open_file.png" + ), + QtGui.QIcon.Mode.Normal, + QtGui.QIcon.State.Off, + ) self.actionAdd_file.setIcon(icon9) self.actionAdd_file.setObjectName("actionAdd_file") self.actionFade = QtGui.QAction(parent=MainWindow) icon10 = QtGui.QIcon() - icon10.addPixmap(QtGui.QPixmap("app/ui/../../../../../../.designer/backup/icon-fade.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + icon10.addPixmap( + QtGui.QPixmap("app/ui/../../../../../../.designer/backup/icon-fade.png"), + QtGui.QIcon.Mode.Normal, + QtGui.QIcon.State.Off, + ) self.actionFade.setIcon(icon10) self.actionFade.setObjectName("actionFade") self.actionStop = QtGui.QAction(parent=MainWindow) icon11 = QtGui.QIcon() - icon11.addPixmap(QtGui.QPixmap(":/icons/stop"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + icon11.addPixmap( + QtGui.QPixmap(":/icons/stop"), + QtGui.QIcon.Mode.Normal, + QtGui.QIcon.State.Off, + ) self.actionStop.setIcon(icon11) self.actionStop.setObjectName("actionStop") self.action_Clear_selection = QtGui.QAction(parent=MainWindow) self.action_Clear_selection.setObjectName("action_Clear_selection") self.action_Resume_previous = QtGui.QAction(parent=MainWindow) icon12 = QtGui.QIcon() - icon12.addPixmap(QtGui.QPixmap(":/icons/previous"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + icon12.addPixmap( + QtGui.QPixmap(":/icons/previous"), + QtGui.QIcon.Mode.Normal, + QtGui.QIcon.State.Off, + ) self.action_Resume_previous.setIcon(icon12) self.action_Resume_previous.setObjectName("action_Resume_previous") self.actionE_xit = QtGui.QAction(parent=MainWindow) @@ -496,7 +616,9 @@ class Ui_MainWindow(object): self.actionImport = QtGui.QAction(parent=MainWindow) self.actionImport.setObjectName("actionImport") self.actionDownload_CSV_of_played_tracks = QtGui.QAction(parent=MainWindow) - self.actionDownload_CSV_of_played_tracks.setObjectName("actionDownload_CSV_of_played_tracks") + self.actionDownload_CSV_of_played_tracks.setObjectName( + "actionDownload_CSV_of_played_tracks" + ) self.actionSearch = QtGui.QAction(parent=MainWindow) self.actionSearch.setObjectName("actionSearch") self.actionInsertSectionHeader = QtGui.QAction(parent=MainWindow) @@ -524,9 +646,13 @@ class Ui_MainWindow(object): self.actionResume = QtGui.QAction(parent=MainWindow) self.actionResume.setObjectName("actionResume") self.actionSearch_title_in_Wikipedia = QtGui.QAction(parent=MainWindow) - self.actionSearch_title_in_Wikipedia.setObjectName("actionSearch_title_in_Wikipedia") + self.actionSearch_title_in_Wikipedia.setObjectName( + "actionSearch_title_in_Wikipedia" + ) self.actionSearch_title_in_Songfacts = QtGui.QAction(parent=MainWindow) - self.actionSearch_title_in_Songfacts.setObjectName("actionSearch_title_in_Songfacts") + self.actionSearch_title_in_Songfacts.setObjectName( + "actionSearch_title_in_Songfacts" + ) self.actionSelect_duplicate_rows = QtGui.QAction(parent=MainWindow) self.actionSelect_duplicate_rows.setObjectName("actionSelect_duplicate_rows") self.actionImport_files = QtGui.QAction(parent=MainWindow) @@ -580,7 +706,7 @@ class Ui_MainWindow(object): self.retranslateUi(MainWindow) self.tabPlaylist.setCurrentIndex(-1) self.tabInfolist.setCurrentIndex(-1) - self.actionE_xit.triggered.connect(MainWindow.close) # type: ignore + self.actionE_xit.triggered.connect(MainWindow.close) # type: ignore QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): @@ -622,38 +748,58 @@ class Ui_MainWindow(object): self.actionFade.setShortcut(_translate("MainWindow", "Ctrl+Z")) self.actionStop.setText(_translate("MainWindow", "S&top")) self.actionStop.setShortcut(_translate("MainWindow", "Ctrl+Alt+S")) - self.action_Clear_selection.setText(_translate("MainWindow", "Clear &selection")) + self.action_Clear_selection.setText( + _translate("MainWindow", "Clear &selection") + ) self.action_Clear_selection.setShortcut(_translate("MainWindow", "Esc")) - self.action_Resume_previous.setText(_translate("MainWindow", "&Resume previous")) + self.action_Resume_previous.setText( + _translate("MainWindow", "&Resume previous") + ) self.actionE_xit.setText(_translate("MainWindow", "E&xit")) self.actionTest.setText(_translate("MainWindow", "&Test")) self.actionOpenPlaylist.setText(_translate("MainWindow", "O&pen...")) self.actionNewPlaylist.setText(_translate("MainWindow", "&New...")) self.actionTestFunction.setText(_translate("MainWindow", "&Test function")) - self.actionSkipToFade.setText(_translate("MainWindow", "&Skip to start of fade")) + self.actionSkipToFade.setText( + _translate("MainWindow", "&Skip to start of fade") + ) self.actionSkipToEnd.setText(_translate("MainWindow", "Skip to &end of track")) self.actionClosePlaylist.setText(_translate("MainWindow", "&Close")) self.actionRenamePlaylist.setText(_translate("MainWindow", "&Rename...")) self.actionDeletePlaylist.setText(_translate("MainWindow", "Dele&te...")) - self.actionMoveSelected.setText(_translate("MainWindow", "Mo&ve selected tracks to...")) + self.actionMoveSelected.setText( + _translate("MainWindow", "Mo&ve selected tracks to...") + ) self.actionExport_playlist.setText(_translate("MainWindow", "E&xport...")) self.actionSetNext.setText(_translate("MainWindow", "Set &next")) self.actionSetNext.setShortcut(_translate("MainWindow", "Ctrl+N")) - self.actionSelect_next_track.setText(_translate("MainWindow", "Select next track")) + self.actionSelect_next_track.setText( + _translate("MainWindow", "Select next track") + ) self.actionSelect_next_track.setShortcut(_translate("MainWindow", "J")) - self.actionSelect_previous_track.setText(_translate("MainWindow", "Select previous track")) + self.actionSelect_previous_track.setText( + _translate("MainWindow", "Select previous track") + ) self.actionSelect_previous_track.setShortcut(_translate("MainWindow", "K")) - self.actionSelect_played_tracks.setText(_translate("MainWindow", "Select played tracks")) - self.actionMoveUnplayed.setText(_translate("MainWindow", "Move &unplayed tracks to...")) + self.actionSelect_played_tracks.setText( + _translate("MainWindow", "Select played tracks") + ) + self.actionMoveUnplayed.setText( + _translate("MainWindow", "Move &unplayed tracks to...") + ) self.actionAdd_note.setText(_translate("MainWindow", "Add note...")) self.actionAdd_note.setShortcut(_translate("MainWindow", "Ctrl+T")) self.actionEnable_controls.setText(_translate("MainWindow", "Enable controls")) self.actionImport.setText(_translate("MainWindow", "Import track...")) self.actionImport.setShortcut(_translate("MainWindow", "Ctrl+Shift+I")) - self.actionDownload_CSV_of_played_tracks.setText(_translate("MainWindow", "Download CSV of played tracks...")) + self.actionDownload_CSV_of_played_tracks.setText( + _translate("MainWindow", "Download CSV of played tracks...") + ) self.actionSearch.setText(_translate("MainWindow", "Search...")) self.actionSearch.setShortcut(_translate("MainWindow", "/")) - self.actionInsertSectionHeader.setText(_translate("MainWindow", "Insert §ion header...")) + self.actionInsertSectionHeader.setText( + _translate("MainWindow", "Insert §ion header...") + ) self.actionInsertSectionHeader.setShortcut(_translate("MainWindow", "Ctrl+H")) self.actionRemove.setText(_translate("MainWindow", "&Remove track")) self.actionFind_next.setText(_translate("MainWindow", "Find next")) @@ -661,8 +807,12 @@ class Ui_MainWindow(object): self.actionFind_previous.setText(_translate("MainWindow", "Find previous")) self.actionFind_previous.setShortcut(_translate("MainWindow", "P")) self.action_About.setText(_translate("MainWindow", "&About")) - self.actionSave_as_template.setText(_translate("MainWindow", "Save as template...")) - self.actionManage_templates.setText(_translate("MainWindow", "Manage templates...")) + self.actionSave_as_template.setText( + _translate("MainWindow", "Save as template...") + ) + self.actionManage_templates.setText( + _translate("MainWindow", "Manage templates...") + ) self.actionDebug.setText(_translate("MainWindow", "Debug")) self.actionAdd_cart.setText(_translate("MainWindow", "Edit cart &1...")) self.actionMark_for_moving.setText(_translate("MainWindow", "Mark for moving")) @@ -671,11 +821,23 @@ class Ui_MainWindow(object): self.actionPaste.setShortcut(_translate("MainWindow", "Ctrl+V")) self.actionResume.setText(_translate("MainWindow", "Resume")) self.actionResume.setShortcut(_translate("MainWindow", "Ctrl+R")) - self.actionSearch_title_in_Wikipedia.setText(_translate("MainWindow", "Search title in Wikipedia")) - self.actionSearch_title_in_Wikipedia.setShortcut(_translate("MainWindow", "Ctrl+W")) - self.actionSearch_title_in_Songfacts.setText(_translate("MainWindow", "Search title in Songfacts")) - self.actionSearch_title_in_Songfacts.setShortcut(_translate("MainWindow", "Ctrl+S")) - self.actionSelect_duplicate_rows.setText(_translate("MainWindow", "Select duplicate rows...")) + self.actionSearch_title_in_Wikipedia.setText( + _translate("MainWindow", "Search title in Wikipedia") + ) + self.actionSearch_title_in_Wikipedia.setShortcut( + _translate("MainWindow", "Ctrl+W") + ) + self.actionSearch_title_in_Songfacts.setText( + _translate("MainWindow", "Search title in Songfacts") + ) + self.actionSearch_title_in_Songfacts.setShortcut( + _translate("MainWindow", "Ctrl+S") + ) + self.actionSelect_duplicate_rows.setText( + _translate("MainWindow", "Select duplicate rows...") + ) self.actionImport_files.setText(_translate("MainWindow", "Import files...")) + + from infotabs import InfoTabs from pyqtgraph import PlotWidget # type: ignore