From a6da52980ddd987cccc9bb2558edc16a9fb23cc4 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Fri, 24 May 2024 17:53:39 +0800 Subject: [PATCH] - enhancement: Handle problems info from competitive-companion in background thread. - enhancement: Handle time/memory limits in problems info from competitive-companion in background thread. - enhancement: When problems info from competitive-companion received, show tips in the status bar. --- NEWS.md | 3 + RedPandaIDE/mainwindow.cpp | 4 +- RedPandaIDE/mainwindow.h | 2 +- .../problems/competitivecompenionhandler.cpp | 101 +++++-- .../problems/competitivecompenionhandler.h | 37 ++- RedPandaIDE/translations/RedPandaIDE_pt_BR.ts | 266 ++++++++-------- RedPandaIDE/translations/RedPandaIDE_zh_CN.ts | 286 +++++++++--------- RedPandaIDE/translations/RedPandaIDE_zh_TW.ts | 258 ++++++++-------- libs/qsynedit/qsynedit_zh_CN.ts | 2 +- 9 files changed, 548 insertions(+), 411 deletions(-) diff --git a/NEWS.md b/NEWS.md index 2139c823..ec9e2221 100644 --- a/NEWS.md +++ b/NEWS.md @@ -7,6 +7,9 @@ Red Panda C++ Version 3.1 - fix: In compiler options page, Can't save default stack size to 0MB. - enhancement: Support national flag emojis. - fix: Visibility for the interrupt action is not correctly updated. + - enhancement: Handle problems info from competitive-companion in background thread. + - enhancement: Handle time/memory limits in problems info from competitive-companion in background thread. + - enhancement: When problems info from competitive-companion received, show tips in the status bar. Red Panda C++ Version 3.0 diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 6192515b..3fbf6d7b 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -4396,10 +4396,12 @@ void MainWindow::onProblemBatchSetCases() } } -void MainWindow::onNewProblemReceived(POJProblem newProblem) +void MainWindow::onNewProblemReceived(int num, int total, POJProblem newProblem) { if (mOJProblemSetModel.problemNameUsed(newProblem->name)) return; + updateStatusbarMessage(tr("Problem '%1' received (%2/%3).") + .arg(newProblem->name).arg(num).arg(total)); mOJProblemSetModel.addProblem(newProblem); ui->tabExplorer->setCurrentWidget(ui->tabProblemSet); ui->lstProblemSet->setCurrentIndex(mOJProblemSetModel.index( diff --git a/RedPandaIDE/mainwindow.h b/RedPandaIDE/mainwindow.h index 223cdae5..617b7793 100644 --- a/RedPandaIDE/mainwindow.h +++ b/RedPandaIDE/mainwindow.h @@ -374,7 +374,7 @@ private slots: void onProblemNameChanged(int index); void onProblemRunCurrentCase(); void onProblemBatchSetCases(); - void onNewProblemReceived(POJProblem newProblem); + void onNewProblemReceived(int num, int total, POJProblem newProblem); void updateProblemTitle(); void onEditorClosed(); void onToolsOutputClear(); diff --git a/RedPandaIDE/problems/competitivecompenionhandler.cpp b/RedPandaIDE/problems/competitivecompenionhandler.cpp index 7470ac65..f409afda 100644 --- a/RedPandaIDE/problems/competitivecompenionhandler.cpp +++ b/RedPandaIDE/problems/competitivecompenionhandler.cpp @@ -26,41 +26,50 @@ #include "../mainwindow.h" CompetitiveCompanionHandler::CompetitiveCompanionHandler(QObject *parent): - QObject(parent) + QObject(parent), + mThread(nullptr) { - connect(&mTcpServer,&QTcpServer::newConnection, - this, &CompetitiveCompanionHandler::onNewProblemConnection); } void CompetitiveCompanionHandler::start() { - if (pSettings->executor().enableProblemSet()) { - if (pSettings->executor().enableCompetitiveCompanion()) { - if (!mTcpServer.listen(QHostAddress::LocalHost,pSettings->executor().competivieCompanionPort())) { - // QMessageBox::critical(nullptr, - // tr("Listen failed"), - // tr("Can't listen to port %1 form Competitive Companion.").arg(pSettings->executor().competivieCompanionPort()) - // + "
" - // +tr("You can turn off competitive companion support in the Problem Set options.") - // + "
" - // +tr("Or You can choose a different port number and try again.")); - } - } + if (!pSettings->executor().enableProblemSet()) + return; + if (!pSettings->executor().enableCompetitiveCompanion()) + return; + mThread = new CompetitiveCompanionThread(this); + if (!mThread->listen()) { + delete mThread; + mThread = nullptr; + } else { + connect(mThread, + &CompetitiveCompanionThread::newProblemReceived, + this, &CompetitiveCompanionHandler::onNewProblemReceived); + mThread->start(); } - } void CompetitiveCompanionHandler::stop() { - mTcpServer.close(); + if (!mThread) + return; + connect(mThread, &QThread::finished, + mThread, &QObject::deleteLater); + mThread->stop(); + mThread=nullptr; } -void CompetitiveCompanionHandler::onNewProblemConnection() +void CompetitiveCompanionHandler::onNewProblemReceived(int num, int total, POJProblem newProblem) +{ + emit newProblemReceived(num, total, newProblem); +} + +void CompetitiveCompanionThread::onNewProblemConnection() { QTcpSocket* clientConnection = mTcpServer.nextPendingConnection(); - connect(clientConnection, &QAbstractSocket::disconnected, clientConnection, &QObject::deleteLater); + QByteArray content; int unreadCount = 0; while (clientConnection->state() == QTcpSocket::ConnectedState) { @@ -94,11 +103,29 @@ void CompetitiveCompanionHandler::onNewProblemConnection() return; } QJsonObject obj=doc.object(); + //qDebug()<(); problem->name = name; problem->url = obj["url"].toString(); + if (obj.contains("timeLimit")) { + problem->timeLimit = obj["timeLimit"].toInt(); + problem->timeLimitUnit = ProblemTimeLimitUnit::Milliseconds; + } + if (obj.contains("memoryLimit")) { + problem->memoryLimit = obj["memoryLimit"].toInt(); + problem->memoryLimitUnit = ProblemMemoryLimitUnit::MB; + } QJsonArray caseArray = obj["tests"].toArray(); foreach ( const QJsonValue& val, caseArray) { QJsonObject caseObj = val.toObject(); @@ -119,5 +146,39 @@ void CompetitiveCompanionHandler::onNewProblemConnection() problemCase->expected = caseObj["output"].toString(); problem->cases.append(problemCase); } - emit newProblemReceived(problem); + mBatchProblemsRecieved++; + emit newProblemReceived(mBatchProblemsRecieved, mBatchCount, problem); + // if (mBatchProblemsRecieved == mBatchCount) { + // emit batchFinished(mBatchCount); + // } +} + +CompetitiveCompanionThread::CompetitiveCompanionThread(QObject *parent): + QThread{parent}, + mStop{false}, + mBatchProblemsRecieved{0} +{ + connect(&mTcpServer,&QTcpServer::newConnection, + this, &CompetitiveCompanionThread::onNewProblemConnection); +} + +void CompetitiveCompanionThread::stop() +{ + mStop = true; +} + +bool CompetitiveCompanionThread::listen() +{ + if (mTcpServer.listen(QHostAddress::LocalHost,pSettings->executor().competivieCompanionPort())) { + return true; + } + return false; +} + +void CompetitiveCompanionThread::run() +{ + while(!mStop) { + QThread::msleep(100); + } + mTcpServer.close(); } diff --git a/RedPandaIDE/problems/competitivecompenionhandler.h b/RedPandaIDE/problems/competitivecompenionhandler.h index db2cd3e3..abb44ddb 100644 --- a/RedPandaIDE/problems/competitivecompenionhandler.h +++ b/RedPandaIDE/problems/competitivecompenionhandler.h @@ -19,22 +19,53 @@ #include #include #include +#include class OJProblem; using POJProblem = std::shared_ptr; +class QTcpSocket; +class CompetitiveCompanionThread: public QThread { + Q_OBJECT +public: + explicit CompetitiveCompanionThread(QObject *parent=nullptr); + CompetitiveCompanionThread(const CompetitiveCompanionThread&) = delete; + CompetitiveCompanionThread &operator=(const CompetitiveCompanionThread&) = delete; + void stop(); + bool listen(); +signals: + void newProblemReceived(int num, int total, POJProblem newProblem); + // void newBatchReceived(int total); + // void batchFinished(int total); +private slots: + void onNewProblemConnection(); + // QThread interface +protected: + void run() override; +private: + QTcpServer mTcpServer; + bool mStop; + QString mBatchId; + int mBatchCount; + int mBatchProblemsRecieved; +}; + + class CompetitiveCompanionHandler: public QObject { Q_OBJECT public: explicit CompetitiveCompanionHandler(QObject* parent=nullptr); + CompetitiveCompanionHandler(const CompetitiveCompanionHandler&) = delete; + CompetitiveCompanionHandler &operator =(const CompetitiveCompanionHandler&) = delete; void start(); void stop(); signals: - void newProblemReceived(POJProblem newProblem); + void newProblemReceived(int num, int total, POJProblem newProblem); private slots: - void onNewProblemConnection(); + void onNewProblemReceived(int num, int total, POJProblem newProblem); private: - QTcpServer mTcpServer; + CompetitiveCompanionThread *mThread; }; + #endif // COMPETITIVECOMPANIONHANDLER_H diff --git a/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts b/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts index 4de97881..2561f254 100644 --- a/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts +++ b/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts @@ -149,7 +149,7 @@ BacktraceModel - + Function Função @@ -495,6 +495,14 @@ Cor + + CompetitiveCompanionThread + + + Problem Case %1 + Caso do problema %1 + + Compiler @@ -1420,7 +1428,7 @@ O texto a ser removido excede o limite de caracteres! - + Print Document Imprimir documento @@ -1458,7 +1466,7 @@ Apenas leitura - + Error Load File Erro ao carregar arquivo @@ -2418,7 +2426,7 @@ Usar conjunto de ícones personalizado - + English Inglês @@ -4281,7 +4289,7 @@ MainWindow - + Red Panda C++ Red Panda C++ @@ -4320,15 +4328,15 @@ - - + + New Problem Set Novo conjunto de problemas - + Add Problem Acrescentar problema @@ -4343,26 +4351,26 @@ - + Save Problem Set Salvar conjunto de problemas - - + + Load Problem Set Carregar conjunto de problemas - + - + Issues Problemas @@ -4378,12 +4386,12 @@ - + - + Debug Depurar @@ -4394,7 +4402,7 @@ - + Debug Console Console do depurador @@ -4427,7 +4435,7 @@ - + Search Procurar @@ -4472,7 +4480,7 @@ - + Problem @@ -4571,7 +4579,7 @@ - + @@ -4727,7 +4735,7 @@ - + Copy @@ -5083,7 +5091,7 @@ - + Clear all breakpoints Limpar todos os pontos de paradas @@ -5219,7 +5227,7 @@ - + Rename Symbol Renomear símbolo @@ -5511,25 +5519,25 @@ Ctrl+Shift+Down - + - - + + - + - + Error Erro - + New Novo @@ -5555,18 +5563,18 @@ - + Problem Set %1 Conjunto de problemas %1 - + Load Theme Error Erro ao carregar tema - + @@ -5633,7 +5641,7 @@ Confirmar - + Source file is not compiled. Arquivo fonte não compilado. @@ -5759,7 +5767,7 @@ Propriedades... - + - Command: %1 @@ -5779,7 +5787,7 @@ - + Open Source File Abrir arquivo fonte @@ -5845,12 +5853,12 @@ - + Add Folder Acrescentar pasta - + Rename Folder Renomear pasta @@ -5896,26 +5904,26 @@ - + New Folder Nova pasta - + New File Novo arquivo - + - + Delete Remover - + Open in Editor Abrir no editor @@ -5951,22 +5959,22 @@ - + - + Confirm Convertion Confirmar conversão - - + + - + The editing file will be saved using %1 encoding. <br />This operation can't be reverted. <br />Are you sure to continue? O arquivo editado será salvo usando a codificação %1. <br /> Essa operação não poderá ser revertida. <br />Quer mesmo continuar? - + %1 files autosaved Salvamento automático dos arquivos %1 @@ -5997,13 +6005,12 @@ Arquivos fontes C/C++ (*.c *.cpp *.cc *.cxx) - - + Problem Case %1 Caso do problema %1 - + New Folder %1 Nova pasta %1 @@ -6030,20 +6037,20 @@ - + Bookmark Description Marcar descrição - - + + Description: Descrição: - + New folder Nova pasta @@ -6054,7 +6061,7 @@ Nome da pasta: - + Break point condition Condição para o ponto de parada @@ -6064,7 +6071,7 @@ Inserir a condição do ponto de parada: - + Save project Salvar projeto @@ -6075,12 +6082,12 @@ - + Do you want to save it? Quer salvar? - + File Changed Arquivo alterado @@ -6107,20 +6114,20 @@ - + New Project File? Novo arquivo de projeto? - - + + Do you want to add the new file to the project? Quer acrescentar novo arquivo ao projeto? - + Open Abrir @@ -6129,12 +6136,12 @@ - + Save Error Salvar erro - + Change Project Compiler Set Alterar o compilador do projeto @@ -6144,13 +6151,18 @@ Alterar o compilador do projeto resultará na perda de todas as opções personalizadas para compilação. - - + + Do you really want to do that? Quer mesmo fazer isso? - + + Problem '%1' received (%2/%3). + + + + Compile Failed Falha ao compilar @@ -6261,7 +6273,7 @@ sem nome - + New Project File Name Nome do arquivo do novo projeto @@ -6449,7 +6461,7 @@ Escolher arquivo para a saída esperada de dados - + Batch Set Cases Conjunto de casos em lote @@ -6515,7 +6527,7 @@ Ctrl+F10 - + Modify Watch Modificar observações @@ -6525,7 +6537,7 @@ Expressão a observar - + Rename Renomear @@ -6558,7 +6570,7 @@ Deslocar para a linha ... - + Go to Line Deslocar para linha @@ -6576,7 +6588,7 @@ - + Open Anwser Source File @@ -6596,7 +6608,7 @@ - + Template Exists @@ -6606,35 +6618,35 @@ - + - + Wrong Compiler Settings - + - + Compiler is set not to generate executable. - - + + We need the executabe to run problem case. - - + + Please correct this before start debugging - + Can't open last open information file '%1' for write! @@ -6686,12 +6698,12 @@ - + Import FPS Problem Set - + Rename Problem @@ -6701,7 +6713,7 @@ - + FPS Problem Set Files (*.fps;*.xml) @@ -6712,8 +6724,8 @@ - - + + Export FPS Problem Set @@ -6728,7 +6740,7 @@ - + Rename Problem Set @@ -6778,7 +6790,7 @@ - + Failed to generate the executable. @@ -6823,7 +6835,7 @@ - + Watchpoint variable name @@ -6833,7 +6845,7 @@ - + Watchpoint hitted @@ -6858,7 +6870,7 @@ - + Missing Project Files @@ -6868,7 +6880,7 @@ - + Save settings failed! @@ -6893,14 +6905,14 @@ - + - + Correct compile settings for debug - + The generated executable won't have debug symbol infos, and can't be debugged. @@ -6908,49 +6920,49 @@ - + Or you can manually change the following settings in the options dialog's compiler set page: - + - + - Turned on the "Generate debug info (-g3)" option. - + - + - Turned off the "Strip executable (-s)" option. - + - + - Turned off the "Optimization level (-O)" option or set it to "Debug (-Og)". - + - + If you are using the Release compiler set, please use choose the Debug version from toolbar. - + - + Do you want to mannually change the compiler set settings now? - + - + You should recompile after change the compiler set or it's settings. @@ -7051,7 +7063,7 @@ - + Exact @@ -7066,7 +7078,7 @@ - + Folder Not Empty @@ -7081,7 +7093,7 @@ - + Line: %1/%2 Char: %3/%4 @@ -8401,7 +8413,7 @@ QApplication - + Error Erro @@ -8422,7 +8434,7 @@ QFileSystemModel - + <b>The name "%1" cannot be used.</b><p>Try using another name, with fewer characters or no punctuation marks. @@ -8433,7 +8445,7 @@ - + Can't open file '%1' for read. @@ -8684,7 +8696,7 @@ - + Error Erro @@ -8722,7 +8734,7 @@ - + Save Salvar @@ -8743,7 +8755,7 @@ Impossível gravar arquivo de configurações %1 - + Can't load autolink settings Impossível carregar configurações para autolink @@ -10223,7 +10235,7 @@ SettingsDialog - + Options Opções @@ -10248,7 +10260,7 @@ Cancelar - + @@ -10312,9 +10324,9 @@ Desempenho - + - + @@ -10322,8 +10334,8 @@ Compilador - - + + Compiler @@ -10432,8 +10444,8 @@ Opções de projeto - - + + diff --git a/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts b/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts index a9a8dd62..80cc951c 100644 --- a/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts +++ b/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts @@ -217,7 +217,7 @@ p, li { white-space: pre-wrap; } BacktraceModel - + Function 函数 @@ -563,6 +563,14 @@ p, li { white-space: pre-wrap; } 配色 + + CompetitiveCompanionThread + + + Problem Case %1 + 试题案例%1 + + Compiler @@ -1678,7 +1686,7 @@ p, li { white-space: pre-wrap; } 十进制: %1 - + Print Document 打印文档 @@ -2714,7 +2722,7 @@ p, li { white-space: pre-wrap; } 大小: - + English 英语 @@ -4666,18 +4674,18 @@ p, li { white-space: pre-wrap; } MainWindow - + Red Panda C++ 小熊猫C++ - + - + Issues 编译器 @@ -4692,7 +4700,7 @@ p, li { white-space: pre-wrap; } - + Tools 工具 @@ -4742,12 +4750,12 @@ p, li { white-space: pre-wrap; } - + - + Debug 调试 @@ -4758,7 +4766,7 @@ p, li { white-space: pre-wrap; } - + Debug Console 调试主控台 @@ -4781,7 +4789,7 @@ p, li { white-space: pre-wrap; } - + Search 查找 @@ -4840,7 +4848,7 @@ p, li { white-space: pre-wrap; } 工具栏2 - + New 新建 @@ -4972,7 +4980,7 @@ p, li { white-space: pre-wrap; } - + Copy @@ -5127,14 +5135,14 @@ p, li { white-space: pre-wrap; } - + New Problem Set 新建试题集 - + Add Problem 添加试题 @@ -5149,15 +5157,15 @@ p, li { white-space: pre-wrap; } - + Save Problem Set 保存试题集 - - + + Load Problem Set 载入试题集 @@ -5193,7 +5201,7 @@ p, li { white-space: pre-wrap; } - + Problem @@ -5291,14 +5299,14 @@ p, li { white-space: pre-wrap; } - + Import FPS Problem Set 导入FPS试题集 - - + + Export FPS Problem Set 导出FPS试题集 @@ -5549,7 +5557,7 @@ p, li { white-space: pre-wrap; } - + Clear all breakpoints 删除所有断点 @@ -5941,7 +5949,7 @@ p, li { white-space: pre-wrap; } 保存为模板... - + New File 新建文件 @@ -5982,7 +5990,7 @@ p, li { white-space: pre-wrap; } - + Rename Symbol 重命名符号 @@ -6262,17 +6270,17 @@ p, li { white-space: pre-wrap; } 运行参数... - + File Encoding 文件编码 - + Recent Files 文件历史 - + @@ -6338,7 +6346,7 @@ p, li { white-space: pre-wrap; } 确认 - + Source file is not compiled. 源文件尚未编译。 @@ -6357,27 +6365,27 @@ p, li { white-space: pre-wrap; } - + Wrong Compiler Settings 错误的编译器设置 - + - + Compiler is set not to generate executable. 编译器被设置为不生成可执行文件。 - - + + We need the executabe to run problem case. 我们需要可执行文件来运行试题案例。 - + No compiler set 无编译器设置 @@ -6434,7 +6442,7 @@ p, li { white-space: pre-wrap; } - + Please correct this before start debugging 请在调试前改正设置。 @@ -6443,7 +6451,7 @@ p, li { white-space: pre-wrap; } 重新编译? - + Save last open info error 保存上次打开信息失败 @@ -6483,19 +6491,19 @@ p, li { white-space: pre-wrap; } 行: %1/%2 字符: %3/%4 选中:%5 - + Line: %1/%2 Char: %3/%4 行: %1/%2 字符: %3/%4 - + - + Correct compile settings for debug 纠正调试用编译设置 - + The generated executable won't have debug symbol infos, and can't be debugged. 生成的可执行文件中会缺少调试符号信息,因此无法编译。 @@ -6507,48 +6515,48 @@ p, li { white-space: pre-wrap; } - + Or you can manually change the following settings in the options dialog's compiler set page: 您也可以手动在选项对话框的编译器设置页中修正下列选项: - + - + - Turned on the "Generate debug info (-g3)" option. - 打开“生成调试信息(-g3)"选项. - + - + - Turned off the "Strip executable (-s)" option. - 关闭"剥除附加信息(-s)"选项. - + - + - Turned off the "Optimization level (-O)" option or set it to "Debug (-Og)". - 关闭"优化级别(-O)选项,或将其设置为"调试(-Og)"级别. - + - + You should recompile after change the compiler set or it's settings. 在更换编译器设置集或修改其设置后,需要重新编译. - + - + Do you want to mannually change the compiler set settings now? 您现在就要手动修改编译器设置集的设置吗? - + Batch Set Cases 批量设置案例 @@ -6564,7 +6572,12 @@ p, li { white-space: pre-wrap; } 全部复制 - + + Problem '%1' received (%2/%3). + 收到试题"%1". (%2/%3) + + + Go to Line 跳转到行 @@ -6587,14 +6600,14 @@ p, li { white-space: pre-wrap; } - + Clear 清除 - + Export 导出 @@ -6605,7 +6618,7 @@ p, li { white-space: pre-wrap; } - + Problem Set %1 试题集%1 @@ -6634,7 +6647,7 @@ p, li { white-space: pre-wrap; } 项目已经被修改过,是否需要重新构建? - + Auto Save Error 自动保存出错 @@ -6649,7 +6662,7 @@ p, li { white-space: pre-wrap; } 试题属性... - + Set Problem Set Name 设置试题集名称 @@ -6659,12 +6672,12 @@ p, li { white-space: pre-wrap; } 试题集名称: - + Remove 删除 - + - Command: %1 - 命令: %1 @@ -6689,7 +6702,7 @@ p, li { white-space: pre-wrap; } 行: %1/%2 字符: %3/%4 选中: %5 - + Remove All Bookmarks 删除全部书签 @@ -6699,15 +6712,15 @@ p, li { white-space: pre-wrap; } 修改描述 - - + + Bookmark Description 书签描述 - - + + Description: 描述: @@ -6717,7 +6730,7 @@ p, li { white-space: pre-wrap; } 在调试主控台中显示调试器输出 - + Remove this search 清除这次搜索 @@ -6732,7 +6745,7 @@ p, li { white-space: pre-wrap; } 断点条件... - + Break point condition 断点条件 @@ -6742,7 +6755,7 @@ p, li { white-space: pre-wrap; } 输入当前断点的生效条件: - + Remove All Breakpoints Remove all breakpoints 删除所有断点 @@ -6763,7 +6776,7 @@ p, li { white-space: pre-wrap; } - + Add Folder 添加文件夹 @@ -6779,7 +6792,7 @@ p, li { white-space: pre-wrap; } 文件夹: - + Rename Folder 重命名 @@ -6831,7 +6844,7 @@ p, li { white-space: pre-wrap; } 是否现在去改正? - + Missing Project Files 项目文件缺失 @@ -6857,7 +6870,7 @@ p, li { white-space: pre-wrap; } 行: %1/%2 字符: %3 选中:%4 - + Goto Url 跳转到试题网址 @@ -6923,26 +6936,26 @@ p, li { white-space: pre-wrap; } - + New Folder 新建文件夹 - + Rename 重命名 - + - + Delete 删除 - + Open in Editor 在编辑器中打开 @@ -6997,7 +7010,11 @@ p, li { white-space: pre-wrap; } 选择答案源代码文件 - + Problem '%1' received. + 收到试题"%1". + + + Watchpoint hitted 变量断点被触发 @@ -7047,7 +7064,7 @@ p, li { white-space: pre-wrap; } 您确定要继续吗? - + Watchpoint variable name 被监控的变量 @@ -7081,7 +7098,7 @@ p, li { white-space: pre-wrap; } C/C++源代码文件 (*.c *.cpp *.cc *.cxx) - + New Folder %1 新建文件夹%1 @@ -7113,7 +7130,7 @@ p, li { white-space: pre-wrap; } 变量"%1"有改动: - + Old value: %1 旧值: %1 @@ -7133,41 +7150,41 @@ p, li { white-space: pre-wrap; } - + Do you want to save it? 需要保存吗? - + File Changed 文件已发生变化 - + New Project File? 新建项目文件? - - + + Do you want to add the new file to the project? 您是否要将新建的文件加入项目? - + - + Save Error 保存失败 - + Change Project Compiler Set 改变项目编译器配置集 @@ -7177,8 +7194,8 @@ p, li { white-space: pre-wrap; } 改变项目的编译器配置集会导致所有的自定义编译器选项被重置。 - - + + Do you really want to do that? 你真的想要那么做吗? @@ -7187,7 +7204,7 @@ p, li { white-space: pre-wrap; } 批量设置案例 - + Choose input files 选择输入数据文件 @@ -7201,7 +7218,7 @@ p, li { white-space: pre-wrap; } 无标题%1 - + Modify Watch 修改监视表达式 @@ -7251,7 +7268,7 @@ p, li { white-space: pre-wrap; } - + Folder %1 is not empty. 文件夹%1不是空的。 @@ -7375,7 +7392,7 @@ p, li { white-space: pre-wrap; } 小熊猫Dev-C++项目文件 (*.dev) - + New project fail 新建项目失败 @@ -7399,7 +7416,7 @@ p, li { white-space: pre-wrap; } 无标题 - + New Project File Name 新的项目文件名 @@ -7419,7 +7436,7 @@ p, li { white-space: pre-wrap; } 文件'%1'已经存在! - + Add to project 添加到项目 @@ -7436,7 +7453,7 @@ p, li { white-space: pre-wrap; } 请在工具栏中选择Debug编译器配置集,或者在“编译器配置集”设置的“编译/链接选项”页中<b>启用</b>“生成调试信息(-g3)”、<b>禁用</b>“剥除附件信息(-3)”。 - + C/C++ Source Files (*.c *.cpp *.cc *.cxx) C/C++源代码文件 (*.c *.cpp *.cc *.cxx) @@ -7450,7 +7467,7 @@ p, li { white-space: pre-wrap; } 调试失败 - + The executable doesn't have symbol table, and can't be debugged. 可执行文件中没有符号表信息,无法调试。 @@ -7490,7 +7507,7 @@ p, li { white-space: pre-wrap; } 小熊猫C++项目文件(*.dev) - + Rename Error 重命名出错 @@ -7555,42 +7572,41 @@ p, li { white-space: pre-wrap; } 载入失败 - - + Problem Case %1 试题案例%1 - + - - + + - + - + Error 错误 - + Recent Projects 项目历史 - + Load Theme Error 载入主题失败 - + Clear History 清除历史 @@ -7600,7 +7616,7 @@ p, li { white-space: pre-wrap; } 编译生成的可执行文件中没有符号表,无法被调试。 - + Version Control 版本控制 @@ -7610,7 +7626,7 @@ p, li { white-space: pre-wrap; } 请在工具栏中选用Debug编译器配置集,或者在选项对话框的编辑器配置集页中勾选“生成调试信息(-g3)"选项。 - + File '%1' was changed. 磁盘文件'%1'已被修改。 @@ -7646,15 +7662,15 @@ p, li { white-space: pre-wrap; } 运行失败 - - + + - + Confirm Convertion 确认转换 - + Exact 完全一致 @@ -7673,22 +7689,22 @@ p, li { white-space: pre-wrap; } 行: %1 列: %2 (%3个字符) 总行数: %4 - + - + If you are using the Release compiler set, please use choose the Debug version from toolbar. 如果你正在使用Release版的编译器设置集,请在工具栏中将其改为Debug版本。 - - + + - + The editing file will be saved using %1 encoding. <br />This operation can't be reverted. <br />Are you sure to continue? 当前编辑器中的文件将会使用%1编码保存。<br />这项操作无法被撤回。<br />你确定要继续吗? - + New Watch Expression 新监视表达式 @@ -9109,7 +9125,7 @@ p, li { white-space: pre-wrap; } QApplication - + Error 错误 @@ -9130,7 +9146,7 @@ p, li { white-space: pre-wrap; } QFileSystemModel - + <b>The name "%1" cannot be used.</b><p>Try using another name, with fewer characters or no punctuation marks. <b>文件名 "%1" 无法被使用!</b><p>可能是重名、过长、为空或者是使用了不能出现在文件名里的符号。 @@ -9139,7 +9155,7 @@ p, li { white-space: pre-wrap; } QObject - + Save 保存 @@ -9211,7 +9227,7 @@ p, li { white-space: pre-wrap; } - + Error 错误 @@ -9227,7 +9243,7 @@ p, li { white-space: pre-wrap; } 无法写入配置文件夹"%1" - + Can't load autolink settings 无法载入自动链接设置 @@ -9335,7 +9351,7 @@ p, li { white-space: pre-wrap; } 生成调试信息(-g3) - + Would you like Red Panda C++ to search for compilers in PATH? 您同意小熊猫C++在PATH路径中寻找gcc编译器吗? @@ -11143,7 +11159,7 @@ p, li { white-space: pre-wrap; } SettingsDialog - + Options 选项 @@ -11210,7 +11226,7 @@ p, li { white-space: pre-wrap; } - + @@ -11218,8 +11234,8 @@ p, li { white-space: pre-wrap; } 编译器配置集 - - + + Compiler @@ -11374,8 +11390,8 @@ p, li { white-space: pre-wrap; } 项目选项 - - + + diff --git a/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts b/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts index aaa8552e..e86c132f 100644 --- a/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts +++ b/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts @@ -137,7 +137,7 @@ BacktraceModel - + Function @@ -396,6 +396,14 @@ + + CompetitiveCompanionThread + + + Problem Case %1 + + + Compiler @@ -1241,7 +1249,7 @@ - + Print Document @@ -1279,7 +1287,7 @@ - + Error Load File @@ -2187,7 +2195,7 @@ - + English @@ -4014,7 +4022,7 @@ MainWindow - + Red Panda C++ @@ -4053,15 +4061,15 @@ - - + + New Problem Set - + Add Problem @@ -4076,26 +4084,26 @@ - + Save Problem Set - - + + Load Problem Set - + - + Issues @@ -4111,12 +4119,12 @@ - + - + Debug @@ -4127,7 +4135,7 @@ - + Debug Console @@ -4160,7 +4168,7 @@ - + Search @@ -4205,7 +4213,7 @@ - + Problem @@ -4304,7 +4312,7 @@ - + @@ -4452,7 +4460,7 @@ - + Copy @@ -4799,7 +4807,7 @@ - + Clear all breakpoints @@ -4931,7 +4939,7 @@ - + Rename Symbol @@ -5168,25 +5176,25 @@ - + - - + + - + - + Error - + New @@ -5212,18 +5220,18 @@ - + Problem Set %1 - + Load Theme Error - + @@ -5274,7 +5282,7 @@ - + Source file is not compiled. @@ -5357,7 +5365,7 @@ - + - Command: %1 @@ -5377,7 +5385,7 @@ - + Open Source File @@ -5449,12 +5457,12 @@ - + Add Folder - + Rename Folder @@ -5500,26 +5508,26 @@ - + New Folder - + New File - + - + Delete - + Open in Editor @@ -5555,22 +5563,22 @@ - + - + Confirm Convertion - - + + - + The editing file will be saved using %1 encoding. <br />This operation can't be reverted. <br />Are you sure to continue? - + %1 files autosaved @@ -5607,12 +5615,12 @@ - + Do you really want to do that? - + Choose input files @@ -5622,13 +5630,17 @@ - - + + Problem '%1' received (%2/%3). + + + + Problem Case %1 - + New Folder %1 @@ -5655,20 +5667,20 @@ - + Bookmark Description - - + + Description: - + New folder @@ -5679,7 +5691,7 @@ - + Break point condition @@ -5689,7 +5701,7 @@ - + Save project @@ -5700,12 +5712,12 @@ - + Do you want to save it? - + File Changed @@ -5732,20 +5744,20 @@ - + New Project File? - - + + Do you want to add the new file to the project? - + Open @@ -5754,12 +5766,12 @@ - + Save Error - + Change Project Compiler Set @@ -5876,7 +5888,7 @@ - + New Project File Name @@ -6109,7 +6121,7 @@ - + Modify Watch @@ -6119,7 +6131,7 @@ - + Rename @@ -6144,7 +6156,7 @@ - + Go to Line @@ -6174,35 +6186,35 @@ - + - + Wrong Compiler Settings - + - + Compiler is set not to generate executable. - - + + We need the executabe to run problem case. - - + + Please correct this before start debugging - + Can't open last open information file '%1' for write! @@ -6254,12 +6266,12 @@ - + Import FPS Problem Set - + Rename Problem @@ -6269,7 +6281,7 @@ - + FPS Problem Set Files (*.fps;*.xml) @@ -6280,8 +6292,8 @@ - - + + Export FPS Problem Set @@ -6296,7 +6308,7 @@ - + Rename Problem Set @@ -6346,7 +6358,7 @@ - + Failed to generate the executable. @@ -6391,7 +6403,7 @@ - + Watchpoint variable name @@ -6401,7 +6413,7 @@ - + Watchpoint hitted @@ -6426,7 +6438,7 @@ - + Missing Project Files @@ -6436,7 +6448,7 @@ - + Save settings failed! @@ -6466,14 +6478,14 @@ - + - + Correct compile settings for debug - + The generated executable won't have debug symbol infos, and can't be debugged. @@ -6481,49 +6493,49 @@ - + Or you can manually change the following settings in the options dialog's compiler set page: - + - + - Turned on the "Generate debug info (-g3)" option. - + - + - Turned off the "Strip executable (-s)" option. - + - + - Turned off the "Optimization level (-O)" option or set it to "Debug (-Og)". - + - + If you are using the Release compiler set, please use choose the Debug version from toolbar. - + - + Do you want to mannually change the compiler set settings now? - + - + You should recompile after change the compiler set or it's settings. @@ -6624,7 +6636,7 @@ - + Exact @@ -6639,7 +6651,7 @@ - + Folder Not Empty @@ -6654,7 +6666,7 @@ - + Line: %1/%2 Char: %3/%4 @@ -7890,7 +7902,7 @@ QApplication - + Error @@ -7898,7 +7910,7 @@ QFileSystemModel - + <b>The name "%1" cannot be used.</b><p>Try using another name, with fewer characters or no punctuation marks. @@ -7909,7 +7921,7 @@ - + Can't open file '%1' for read. @@ -8157,7 +8169,7 @@ - + Error @@ -8191,7 +8203,7 @@ - + Save @@ -8212,7 +8224,7 @@ - + Can't load autolink settings @@ -9364,7 +9376,7 @@ SettingsDialog - + Options @@ -9389,7 +9401,7 @@ - + @@ -9449,9 +9461,9 @@ - + - + @@ -9459,8 +9471,8 @@ - - + + Compiler @@ -9569,8 +9581,8 @@ - - + + diff --git a/libs/qsynedit/qsynedit_zh_CN.ts b/libs/qsynedit/qsynedit_zh_CN.ts index 0016f056..03bc7671 100644 --- a/libs/qsynedit/qsynedit_zh_CN.ts +++ b/libs/qsynedit/qsynedit_zh_CN.ts @@ -14,7 +14,7 @@ 写入数据失败。 - + byte swap.