mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-19 09:41:32 +08:00
UI: Make sure all dialogs have close buttons
This adds close buttons to remux dialog, output timer dialog, and advanced audio properties dialog. I also did a small refactor of the remux dialog so the buttons were consistent with other dialogs. Closes jp9000/obs-studio#876
This commit is contained in:
+19
-6
@@ -40,7 +40,8 @@ OBSRemux::OBSRemux(const char *path, QWidget *parent)
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->progressBar->setVisible(false);
|
||||
ui->remux->setEnabled(false);
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->
|
||||
setEnabled(false);
|
||||
ui->targetFile->setEnabled(false);
|
||||
ui->browseTarget->setEnabled(false);
|
||||
|
||||
@@ -54,11 +55,19 @@ OBSRemux::OBSRemux(const char *path, QWidget *parent)
|
||||
[&]() { BrowseInput(); });
|
||||
connect(ui->browseTarget, &QPushButton::clicked,
|
||||
[&]() { BrowseOutput(); });
|
||||
connect(ui->remux, &QPushButton::clicked, [&]() { Remux(); });
|
||||
|
||||
connect(ui->sourceFile, &QLineEdit::textChanged,
|
||||
this, &OBSRemux::inputChanged);
|
||||
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->
|
||||
setText(QTStr("Remux.Remux"));
|
||||
|
||||
connect(ui->buttonBox->button(QDialogButtonBox::Ok),
|
||||
SIGNAL(clicked()), this, SLOT(Remux()));
|
||||
|
||||
connect(ui->buttonBox->button(QDialogButtonBox::Close),
|
||||
SIGNAL(clicked()), this, SLOT(close()));
|
||||
|
||||
worker->moveToThread(&remuxer);
|
||||
remuxer.start();
|
||||
|
||||
@@ -116,12 +125,14 @@ void OBSRemux::BrowseInput()
|
||||
void OBSRemux::inputChanged(const QString &path)
|
||||
{
|
||||
if (!QFileInfo::exists(path)) {
|
||||
ui->remux->setEnabled(false);
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->
|
||||
setEnabled(false);
|
||||
return;
|
||||
}
|
||||
|
||||
ui->sourceFile->setText(path);
|
||||
ui->remux->setEnabled(true);
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->
|
||||
setEnabled(true);
|
||||
|
||||
QFileInfo fi(path);
|
||||
QString mp4 = fi.path() + "/" + fi.baseName() + ".mp4";
|
||||
@@ -161,7 +172,8 @@ void OBSRemux::Remux()
|
||||
worker->lastProgress = 0.f;
|
||||
|
||||
ui->progressBar->setVisible(true);
|
||||
ui->remux->setEnabled(false);
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->
|
||||
setEnabled(false);
|
||||
|
||||
emit remux();
|
||||
}
|
||||
@@ -195,7 +207,8 @@ void OBSRemux::remuxFinished(bool success)
|
||||
|
||||
worker->job.reset();
|
||||
ui->progressBar->setVisible(false);
|
||||
ui->remux->setEnabled(true);
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->
|
||||
setEnabled(true);
|
||||
}
|
||||
|
||||
RemuxWorker::RemuxWorker()
|
||||
|
||||
Reference in New Issue
Block a user