修复没有默认打开方式时弹窗按钮为是而不是确定的问题。

This commit is contained in:
JunjieBai 2023-04-11 10:52:45 +08:00 committed by iaom
parent b03fb44f6c
commit eb0b77035d
1 changed files with 2 additions and 4 deletions

View File

@ -92,8 +92,7 @@ void FileSearchPlugin::openAction(int actionkey, QString key, int type)
if(FileUtils::openFile(key) == -1) {
QMessageBox msgBox(m_detailPage);
msgBox.setWindowModality(Qt::WindowModal);
msgBox.setStandardButtons(QMessageBox::Yes);
msgBox.setButtonText(QMessageBox::Yes, tr("Yes"));
msgBox.addButton(tr("Yes"), QMessageBox::YesRole);
msgBox.setIcon(QMessageBox::Information);
msgBox.setText(tr("Can not get a default application for opening %1.").arg(key));
msgBox.exec();
@ -204,8 +203,7 @@ void FileSearchPlugin::initDetailPage()
if(FileUtils::openFile(m_currentActionKey) == -1) {
QMessageBox msgBox(m_detailPage);
msgBox.setWindowModality(Qt::WindowModal);
msgBox.setStandardButtons(QMessageBox::Yes);
msgBox.setButtonText(QMessageBox::Yes, tr("Yes"));
msgBox.addButton(tr("Yes"), QMessageBox::YesRole);
msgBox.setIcon(QMessageBox::Information);
msgBox.setText(tr("Can not get a default application for opening %1.").arg(m_currentActionKey));
msgBox.exec();