@@ -138,9 +138,14 @@ TranscribeAudioDialog::TranscribeAudioDialog(const QString &trackName, QWidget *
138138 grid->addWidget (m_nonspoken, 4 , 0 , Qt::AlignRight);
139139 grid->addWidget (new QLabel (tr (" Include non-spoken sounds" )), 4 , 1 , Qt::AlignLeft);
140140
141+ m_useGpu = new QCheckBox (this );
142+ m_useGpu->setCheckState (Settings.whisperUseGpu () ? Qt::Checked : Qt::Unchecked);
143+ grid->addWidget (m_useGpu, 5 , 0 , Qt::AlignRight);
144+ grid->addWidget (new QLabel (tr (" Use GPU" )), 5 , 1 , Qt::AlignLeft);
145+
141146 QLabel *tracksLabel = new QLabel (tr (" Tracks with speech" ));
142147 tracksLabel->setToolTip (tr (" Select tracks that contain speech to be transcribed." ));
143- grid->addWidget (tracksLabel, 5 , 0 , Qt::AlignRight);
148+ grid->addWidget (tracksLabel, 6 , 0 , Qt::AlignRight);
144149 m_trackList = new QListWidget (this );
145150 m_trackList->setSelectionMode (QAbstractItemView::NoSelection);
146151 m_trackList->setSizeAdjustPolicy (QAbstractScrollArea::AdjustToContentsOnFirstShow);
@@ -172,7 +177,7 @@ TranscribeAudioDialog::TranscribeAudioDialog(const QString &trackName, QWidget *
172177 }
173178 }
174179 }
175- grid->addWidget (m_trackList, 5 , 1 , Qt::AlignLeft);
180+ grid->addWidget (m_trackList, 6 , 1 , Qt::AlignLeft);
176181
177182 // The config section is a single widget with a unique grid layout inside of it.
178183 // The config section is hidden by hiding the config widget (and the layout it contains)
@@ -274,7 +279,7 @@ TranscribeAudioDialog::TranscribeAudioDialog(const QString &trackName, QWidget *
274279
275280 configLayout->addWidget (m_table, 4 , 0 , 1 , 3 );
276281
277- grid->addWidget (m_configWidget, 6 , 0 , 1 , 2 );
282+ grid->addWidget (m_configWidget, 7 , 0 , 1 , 2 );
278283
279284 // Add a button box to the dialog
280285 m_buttonBox = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
@@ -294,7 +299,7 @@ TranscribeAudioDialog::TranscribeAudioDialog(const QString &trackName, QWidget *
294299 m_configWidget->setVisible (false );
295300 }
296301 m_buttonBox->addButton (configButton, QDialogButtonBox::ActionRole);
297- grid->addWidget (m_buttonBox, 7 , 0 , 1 , 2 );
302+ grid->addWidget (m_buttonBox, 8 , 0 , 1 , 2 );
298303 connect (m_buttonBox,
299304 SIGNAL (clicked (QAbstractButton *)),
300305 this ,
@@ -321,6 +326,7 @@ void TranscribeAudioDialog::onButtonClicked(QAbstractButton *button)
321326{
322327 QDialogButtonBox::ButtonRole role = m_buttonBox->buttonRole (button);
323328 if (role == QDialogButtonBox::AcceptRole) {
329+ Settings.setWhisperUseGpu (m_useGpu->checkState () == Qt::Checked);
324330 LOG_DEBUG () << " Accept" ;
325331 accept ();
326332 } else if (role == QDialogButtonBox::RejectRole) {
@@ -378,6 +384,11 @@ bool TranscribeAudioDialog::includeNonspoken()
378384 return m_nonspoken->checkState () == Qt::Checked;
379385}
380386
387+ bool TranscribeAudioDialog::useGpu ()
388+ {
389+ return m_useGpu->checkState () == Qt::Checked;
390+ }
391+
381392void TranscribeAudioDialog::showEvent (QShowEvent *event)
382393{
383394 QDialog::showEvent (event);
0 commit comments