Recoding: Disable recording buttons when recording is unavailable

Instead of hiding the record action buttons, disable them and indicate the issue on the tooltip.
This commit is contained in:
Shmuel Hazan
2021-12-04 17:53:39 +02:00
parent cf9cea88c3
commit 1b39d39b24

View File

@@ -910,7 +910,7 @@ ComboBoxModel *SongEditor::snappingModel() const
SongEditorWindow::SongEditorWindow(Song* song) :
Editor(Engine::audioEngine()->audioDev()->supportsCapture(), false),
Editor(true, false),
m_editor(new SongEditor(song)),
m_crtlAction( nullptr ),
m_snapSizeLabel( new QLabel( m_toolBar ) )
@@ -1024,6 +1024,15 @@ SongEditorWindow::SongEditorWindow(Song* song) :
connect(song, SIGNAL(projectLoaded()), this, SLOT(adjustUiAfterProjectLoad()));
connect(this, SIGNAL(resized()), m_editor, SLOT(updatePositionLine()));
// In case our current audio device does not support capture,
// disable the record buttons.
if(!Engine::audioEngine()->audioDev()->supportsCapture()) {
for(auto &recordAction : {m_recordAccompanyAction, m_recordAction}) {
recordAction->setEnabled(false);
recordAction->setToolTip(tr("Recording is unavailable: try connecting an input device or switching backend"));
}
}
}
QSize SongEditorWindow::sizeHint() const