Don't check Audacity; save splitter position
This commit is contained in:
parent
7d71e8ce64
commit
568dc1ef68
@ -2,12 +2,9 @@
|
|||||||
|
|
||||||
from log import log
|
from log import log
|
||||||
# import argparse
|
# import argparse
|
||||||
# import psutil
|
|
||||||
import sys
|
import sys
|
||||||
# import threading
|
# import threading
|
||||||
# import webbrowser
|
|
||||||
#
|
|
||||||
#
|
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
# from typing import Callable, Dict, List, Optional, Tuple
|
# from typing import Callable, Dict, List, Optional, Tuple
|
||||||
#
|
#
|
||||||
@ -78,38 +75,41 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
self.previous_track: Optional[TrackData] = None
|
self.previous_track: Optional[TrackData] = None
|
||||||
self.previous_track_position: Optional[int] = None
|
self.previous_track_position: Optional[int] = None
|
||||||
|
|
||||||
# self.set_main_window_size()
|
self.set_main_window_size()
|
||||||
self.lblSumPlaytime = QLabel("")
|
self.lblSumPlaytime = QLabel("")
|
||||||
self.statusbar.addPermanentWidget(self.lblSumPlaytime)
|
self.statusbar.addPermanentWidget(self.lblSumPlaytime)
|
||||||
# self.txtSearch = QLineEdit()
|
# self.txtSearch = QLineEdit()
|
||||||
# self.statusbar.addWidget(self.txtSearch)
|
# self.statusbar.addWidget(self.txtSearch)
|
||||||
# self.txtSearch.setHidden(True)
|
# self.txtSearch.setHidden(True)
|
||||||
self.hide_played_tracks = False
|
self.hide_played_tracks = False
|
||||||
#
|
|
||||||
self.splitter.setSizes([200, 200])
|
|
||||||
self.visible_playlist_tab: Callable[[], PlaylistTab] = \
|
self.visible_playlist_tab: Callable[[], PlaylistTab] = \
|
||||||
self.tabPlaylist.currentWidget
|
self.tabPlaylist.currentWidget
|
||||||
|
|
||||||
self._load_last_playlists()
|
self._load_last_playlists()
|
||||||
self.enable_play_next_controls()
|
self.enable_play_next_controls()
|
||||||
# self.check_audacity()
|
|
||||||
self.timer.start(Config.TIMER_MS)
|
self.timer.start(Config.TIMER_MS)
|
||||||
self.connect_signals_slots()
|
self.connect_signals_slots()
|
||||||
#
|
|
||||||
# def set_main_window_size(self) -> None:
|
def set_main_window_size(self) -> None:
|
||||||
# """Set size of window from database"""
|
"""Set size of window from database"""
|
||||||
#
|
|
||||||
# with Session() as session:
|
with Session() as session:
|
||||||
# record = Settings.get_int_settings(session, "mainwindow_x")
|
record = Settings.get_int_settings(session, "mainwindow_x")
|
||||||
# x = record.f_int or 1
|
x = record.f_int or 1
|
||||||
# record = Settings.get_int_settings(session, "mainwindow_y")
|
record = Settings.get_int_settings(session, "mainwindow_y")
|
||||||
# y = record.f_int or 1
|
y = record.f_int or 1
|
||||||
# record = Settings.get_int_settings(session, "mainwindow_width")
|
record = Settings.get_int_settings(session, "mainwindow_width")
|
||||||
# width = record.f_int or 1599
|
width = record.f_int or 1599
|
||||||
# record = Settings.get_int_settings(session, "mainwindow_height")
|
record = Settings.get_int_settings(session, "mainwindow_height")
|
||||||
# height = record.f_int or 981
|
height = record.f_int or 981
|
||||||
# self.setGeometry(x, y, width, height)
|
self.setGeometry(x, y, width, height)
|
||||||
# return
|
record = Settings.get_int_settings(session, "splitter_top")
|
||||||
|
splitter_top = record.f_int or 256
|
||||||
|
record = Settings.get_int_settings(session, "splitter_bottom")
|
||||||
|
splitter_bottom = record.f_int or 256
|
||||||
|
self.splitter.setSizes([splitter_top, splitter_bottom])
|
||||||
|
return
|
||||||
#
|
#
|
||||||
# @staticmethod
|
# @staticmethod
|
||||||
# def print_current_database():
|
# def print_current_database():
|
||||||
@ -117,18 +117,6 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
# db = session.bind.engine.url.database
|
# db = session.bind.engine.url.database
|
||||||
# print(f"{db=}")
|
# print(f"{db=}")
|
||||||
#
|
#
|
||||||
# @staticmethod
|
|
||||||
# def check_audacity() -> None:
|
|
||||||
# """Offer to run Audacity if not running"""
|
|
||||||
#
|
|
||||||
# if not Config.CHECK_AUDACITY_AT_STARTUP:
|
|
||||||
# return
|
|
||||||
#
|
|
||||||
# if "audacity" in [i.name() for i in psutil.process_iter()]:
|
|
||||||
# return
|
|
||||||
#
|
|
||||||
# if helpers.ask_yes_no("Audacity not running", "Start Audacity?"):
|
|
||||||
# QProcess.startDetached(Config.AUDACITY_COMMAND, [])
|
|
||||||
|
|
||||||
def clear_selection(self) -> None:
|
def clear_selection(self) -> None:
|
||||||
""" Clear selected row"""
|
""" Clear selected row"""
|
||||||
@ -695,27 +683,6 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
idx = self.tabPlaylist.indexOf(widget)
|
idx = self.tabPlaylist.indexOf(widget)
|
||||||
self.tabPlaylist.tabBar().setTabTextColor(idx, colour)
|
self.tabPlaylist.tabBar().setTabTextColor(idx, colour)
|
||||||
#
|
|
||||||
# def song_info_search(self) -> None:
|
|
||||||
# """
|
|
||||||
# Open browser tab for Wikipedia, searching for
|
|
||||||
# the first that exists of:
|
|
||||||
# - selected track
|
|
||||||
# - next track
|
|
||||||
# - current track
|
|
||||||
# """
|
|
||||||
#
|
|
||||||
# title: Optional[str] = self.visible_playlist_tab().get_selected_title()
|
|
||||||
# if not title:
|
|
||||||
# if self.next_track:
|
|
||||||
# title = self.next_track.title
|
|
||||||
# if not title:
|
|
||||||
# if self.current_track:
|
|
||||||
# title = self.current_track.title
|
|
||||||
# if title:
|
|
||||||
# txt = urllib.parse.quote_plus(title)
|
|
||||||
# url = Config.TAB_URL % txt
|
|
||||||
# webbrowser.open(url, new=2)
|
|
||||||
|
|
||||||
def stop(self) -> None:
|
def stop(self) -> None:
|
||||||
"""Stop playing immediately"""
|
"""Stop playing immediately"""
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user