Skip to content

Commit

Permalink
FormatSelection: close window when no results
Browse files Browse the repository at this point in the history
The window showed up when no results were found anyway. Instead, the
window shouldn't appear at all.
  • Loading branch information
Robin de Rooij committed Feb 1, 2016
1 parent dc155e1 commit e4c2ddc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions formatselectionwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ void FormatSelectionWindow::populateTable(QVector<MediaFormat> formats)
if (formats.length() == 0) {
QMessageBox::information(this, "No formats found", "No formats found. Note that playlists aren't supported yet", QMessageBox::Ok);
this->close();
return;
}
ui->tableWidget->setRowCount(formats.length());
for(int i = 0; i < formats.length(); ++i) {
Expand All @@ -41,6 +42,7 @@ void FormatSelectionWindow::populateTable(QVector<MediaFormat> formats)
ui->tableWidget->setItem(i, 1, extension);
ui->tableWidget->setItem(i, 2, formatText);
}
show();
}

void FormatSelectionWindow::on_pushButton_clicked()
Expand Down
1 change: 0 additions & 1 deletion mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ void MainWindow::on_pushButton_clicked()
formatWindow->setYoutubeDl(ytdl);
formatWindow->setInputUrl(ui->videoUrlEdit->text());
this->setCursor(Qt::ArrowCursor);
formatWindow->show();
break;
}
}
Expand Down

0 comments on commit e4c2ddc

Please sign in to comment.