diff --git a/3rdparty/clirarplugin/clirarplugin.cpp b/3rdparty/clirarplugin/clirarplugin.cpp index a991a33c..282696a1 100644 --- a/3rdparty/clirarplugin/clirarplugin.cpp +++ b/3rdparty/clirarplugin/clirarplugin.cpp @@ -292,6 +292,7 @@ bool CliRarPlugin::handleLine(const QString &line, WorkType workStatus) return false; } else { // RAR5密码错误:发送错误提示但不中断进程,允许用户重新输入密码 emit error(tr("Wrong password"), tr("The password entered is incorrect. Please try again.")); + m_bWrongPasswordRetry = true; // 标记下次重弹密码框时使用「密码错误」文案 return true; } } diff --git a/3rdparty/interface/archiveinterface/cliinterface.cpp b/3rdparty/interface/archiveinterface/cliinterface.cpp index cd4cdbbe..67ba78b5 100644 --- a/3rdparty/interface/archiveinterface/cliinterface.cpp +++ b/3rdparty/interface/archiveinterface/cliinterface.cpp @@ -1061,7 +1061,8 @@ PluginFinishType CliInterface::handlePassword() } } - PasswordNeededQuery query(name); + PasswordNeededQuery query(name, m_bWrongPasswordRetry); + m_bWrongPasswordRetry = false; emit signalQuery(&query); query.waitForResponse(); diff --git a/3rdparty/interface/archiveinterface/cliinterface.h b/3rdparty/interface/archiveinterface/cliinterface.h index 01b3f3ba..65899ed6 100644 --- a/3rdparty/interface/archiveinterface/cliinterface.h +++ b/3rdparty/interface/archiveinterface/cliinterface.h @@ -285,6 +285,7 @@ private slots: bool m_isProcessKilled = false; // 进程已经结束 bool m_isEmptyArchive = false; // 压缩包内无数据 bool m_isCorruptArchive = false; // 是否非致命错误 + bool m_bWrongPasswordRetry = false; // 密码错误后重弹密码框标记,供 handlePassword 区分重试文案 private: QList m_files; // 文件 diff --git a/3rdparty/interface/queries.cpp b/3rdparty/interface/queries.cpp index d4302e73..78f94dce 100644 --- a/3rdparty/interface/queries.cpp +++ b/3rdparty/interface/queries.cpp @@ -332,10 +332,11 @@ void OverwriteQuery::setWidgetType(QWidget *pWgt, DPalette::ColorType ct, double -PasswordNeededQuery::PasswordNeededQuery(const QString &strFileName, QObject *parent) +PasswordNeededQuery::PasswordNeededQuery(const QString &strFileName, bool bWrongPassword, QObject *parent) : Query(parent) { m_data[QStringLiteral("fileName")] = strFileName; + m_data[QStringLiteral("wrongPassword")] = bWrongPassword; } PasswordNeededQuery::~PasswordNeededQuery() @@ -376,7 +377,11 @@ void PasswordNeededQuery::execute() pTipLbl->setForegroundRole(DPalette::WindowText); // pTipLbl->setWordWrap(true); DFontSizeManager::instance()->bind(pTipLbl, DFontSizeManager::T6, QFont::Normal); - pTipLbl->setText(tr("Encrypted file, please enter the password")); + if (m_data.value(QStringLiteral("wrongPassword")).toBool()) { + pTipLbl->setText(tr("Wrong password, please re-enter the password")); + } else { + pTipLbl->setText(tr("Encrypted file, please enter the password")); + } pTipLbl->setAlignment(Qt::AlignCenter); m_strDesText = pTipLbl->text(); diff --git a/3rdparty/interface/queries.h b/3rdparty/interface/queries.h index e39c80b8..cb8f0911 100644 --- a/3rdparty/interface/queries.h +++ b/3rdparty/interface/queries.h @@ -194,7 +194,7 @@ class PasswordNeededQuery : public Query * @param strFileName 文件名(含路径) * @param parent */ - explicit PasswordNeededQuery(const QString &strFileName, QObject *parent = nullptr); + explicit PasswordNeededQuery(const QString &strFileName, bool bWrongPassword = false, QObject *parent = nullptr); ~PasswordNeededQuery() override; /**