Compare commits

...

2 Commits

Author SHA1 Message Date
Keith Edmunds
39f5374b32 Disable set next track during editing
Fixes #130
2022-10-14 22:15:40 +01:00
Keith Edmunds
ed2b919db4 Reorder functions 2022-10-14 21:54:39 +01:00
2 changed files with 24 additions and 32 deletions

View File

@ -99,6 +99,28 @@ class Window(QMainWindow, Ui_MainWindow):
self.timer.start(Config.TIMER_MS)
self.connect_signals_slots()
def about(self) -> None:
"""Get git tag and database name"""
try:
git_tag = str(
subprocess.check_output(
['git', 'describe'], stderr=subprocess.STDOUT
)
).strip('\'b\\n')
except subprocess.CalledProcessError as exc_info:
git_tag = str(exc_info.output)
with Session() as session:
dbname = session.bind.engine.url.database
QMessageBox.information(
self,
"About",
f"MusicMuster {git_tag}\n\nDatabase: {dbname}",
QMessageBox.Ok
)
def clear_selection(self) -> None:
""" Clear selected row"""
@ -408,28 +430,6 @@ class Window(QMainWindow, Ui_MainWindow):
self.stop_playing(fade=True)
def about(self) -> None:
"""Get git tag and database name"""
try:
git_tag = str(
subprocess.check_output(
['git', 'describe'], stderr=subprocess.STDOUT
)
).strip('\'b\\n')
except subprocess.CalledProcessError as exc_info:
git_tag = str(exc_info.output)
with Session() as session:
dbname = session.bind.engine.url.database
QMessageBox.information(
self,
"About",
f"MusicMuster {git_tag}\n\nDatabase: {dbname}",
QMessageBox.Ok
)
def get_one_track(self, session: Session) -> Optional[Tracks]:
"""Show dialog box to select one track and return it to caller"""

View File

@ -465,6 +465,7 @@ class PlaylistTab(QTableWidget):
self.edit_cell_type = None
self.musicmuster.enable_play_next_controls()
self.musicmuster.actionSetNext.setEnabled(True)
super(PlaylistTab, self).closeEditor(editor, hint)
@ -507,6 +508,7 @@ class PlaylistTab(QTableWidget):
# Disable play controls so that keyboard input doesn't
# disturb playing
self.musicmuster.disable_play_next_controls()
self.musicmuster.actionSetNext.setEnabled(False)
# If this is a note cell, we need to remove any existing section
# timing so user can't edit that. Keep it simple: refresh text
@ -1191,11 +1193,6 @@ class PlaylistTab(QTableWidget):
# Does it delimit a section?
if section_start_plr is not None:
if note_text.endswith("-"):
log.debug(
"line 1165: "
f"self._update_note_text({section_start_plr=},"
f"self._get_section_timing_string({section_time=})"
)
self._update_note_text(
section_start_plr,
self._get_section_timing_string(section_time)
@ -1217,11 +1214,6 @@ class PlaylistTab(QTableWidget):
# Have we had a section start but not end?
if section_start_plr is not None:
log.debug(
"line 1191: "
f"self._update_note_text({section_start_plr=},"
f"self._get_section_timing_string({section_time=})"
)
self._update_note_text(
section_start_plr,
self._get_section_timing_string(section_time, no_end=True)