GUI: the "Choose" label on the style sheet button would disappear when the file choice dialog was cancelled

This commit is contained in:
Jean-Francois Dockes 2018-11-15 15:22:44 +01:00
parent 34f5ee8740
commit 0f8775e42d

View File

@ -438,7 +438,11 @@ void UIPrefsDialog::showStylesheetDialog()
{
qssFile = myGetFileName(false, "Select stylesheet file", true);
string nm = path_getsimple((const char *)qssFile.toLocal8Bit());
stylesheetPB->setText(QString::fromLocal8Bit(nm.c_str()));
if (!nm.empty()) {
stylesheetPB->setText(QString::fromLocal8Bit(nm.c_str()));
} else {
stylesheetPB->setText(tr("Choose"));
}
}
void UIPrefsDialog::resetStylesheet()