Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions 3rdparty/clirarplugin/clirarplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
3 changes: 2 additions & 1 deletion 3rdparty/interface/archiveinterface/cliinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,8 @@ PluginFinishType CliInterface::handlePassword()
}
}

PasswordNeededQuery query(name);
PasswordNeededQuery query(name, m_bWrongPasswordRetry);
m_bWrongPasswordRetry = false;
emit signalQuery(&query);
query.waitForResponse();

Expand Down
1 change: 1 addition & 0 deletions 3rdparty/interface/archiveinterface/cliinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<FileEntry> m_files; // 文件
Expand Down
9 changes: 7 additions & 2 deletions 3rdparty/interface/queries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/interface/queries.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
Loading