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

This commit is contained in:
JunjieBai 2023-04-11 10:52:45 +08:00 committed by iaom
parent 2a22356e05
commit 360f991846
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) { if(FileUtils::openFile(key) == -1) {
QMessageBox msgBox(m_detailPage); QMessageBox msgBox(m_detailPage);
msgBox.setWindowModality(Qt::WindowModal); msgBox.setWindowModality(Qt::WindowModal);
msgBox.setStandardButtons(QMessageBox::Yes); msgBox.addButton(tr("Yes"), QMessageBox::YesRole);
msgBox.setButtonText(QMessageBox::Yes, tr("Yes"));
msgBox.setIcon(QMessageBox::Information); msgBox.setIcon(QMessageBox::Information);
msgBox.setText(tr("Can not get a default application for opening %1.").arg(key)); msgBox.setText(tr("Can not get a default application for opening %1.").arg(key));
msgBox.exec(); msgBox.exec();
@ -204,8 +203,7 @@ void FileSearchPlugin::initDetailPage()
if(FileUtils::openFile(m_currentActionKey) == -1) { if(FileUtils::openFile(m_currentActionKey) == -1) {
QMessageBox msgBox(m_detailPage); QMessageBox msgBox(m_detailPage);
msgBox.setWindowModality(Qt::WindowModal); msgBox.setWindowModality(Qt::WindowModal);
msgBox.setStandardButtons(QMessageBox::Yes); msgBox.addButton(tr("Yes"), QMessageBox::YesRole);
msgBox.setButtonText(QMessageBox::Yes, tr("Yes"));
msgBox.setIcon(QMessageBox::Information); msgBox.setIcon(QMessageBox::Information);
msgBox.setText(tr("Can not get a default application for opening %1.").arg(m_currentActionKey)); msgBox.setText(tr("Can not get a default application for opening %1.").arg(m_currentActionKey));
msgBox.exec(); msgBox.exec();