+void MainWindow::enable_or_disable_preview_button()
+{
+ // Follows the logic in preview_clicked().
+
+ if (ui->playlist->hasFocus()) {
+ // Allow the playlist as preview iff it has focus and something is selected.
+ // TODO: Is this part really relevant?
+ QItemSelectionModel *selected = ui->playlist->selectionModel();
+ if (selected->hasSelection()) {
+ ui->preview_btn->setEnabled(true);
+ return;
+ }
+ }
+
+ // TODO: Perhaps only enable this if something is actually selected.
+ ui->preview_btn->setEnabled(!cliplist_clips->empty());
+}
+