+void MainWindow::enable_or_disable_queue_button()
+{
+ // Follows the logic in queue_clicked().
+ // TODO: Perhaps only enable this if something is actually selected.
+
+ bool enabled;
+
+ if (cliplist_clips->empty()) {
+ enabled = false;
+ } else {
+ QItemSelectionModel *selected = ui->clip_list->selectionModel();
+ if (!selected->hasSelection()) {
+ Clip clip = *cliplist_clips->back();
+ enabled = clip.pts_out != -1;
+ } else {
+ QModelIndex index = selected->currentIndex();
+ Clip clip = *cliplist_clips->clip(index.row());
+ enabled = clip.pts_out != -1;
+ }
+ }
+
+ ui->queue_btn->setEnabled(enabled);
+}
+