- enhancement: add a demo for custom tool
This commit is contained in:
parent
1df289c131
commit
3f708cf887
5
NEWS.md
5
NEWS.md
|
@ -1,11 +1,12 @@
|
|||
Version 0.11.0 For Dev-C++ 7 Beta
|
||||
- enhancement: use token list instead of single string to do code completion ( intial version)
|
||||
- fix: language options in the project wizard don't work
|
||||
- enhancement: redesign the expression parser for code completion
|
||||
- fix: "make as default language" option in the project wizard doesn't work
|
||||
- fix: "ake as default language" option in the project wizard doesn't work
|
||||
- fix: typo errors in settings dialog
|
||||
- enhancement: console pauser clears STDIN buffer before show "press any key to continue..."
|
||||
- fix: path in macros should use system's path separator
|
||||
- fix: custom tools doesn't work
|
||||
- enhancement: add a demo for custom tool
|
||||
|
||||
Version 0.10.4 For Dev-C++ 7 Beta
|
||||
- fix: can't correctly undo/redo indent
|
||||
|
|
Binary file not shown.
|
@ -7074,34 +7074,39 @@ Are you really want to continue?</source>
|
|||
<context>
|
||||
<name>ToolsManager</name>
|
||||
<message>
|
||||
<location filename="toolsmanager.cpp" line="26"/>
|
||||
<location filename="toolsmanager.cpp" line="37"/>
|
||||
<location filename="toolsmanager.cpp" line="23"/>
|
||||
<source>Remove Compiled</source>
|
||||
<translation>删除编译文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="toolsmanager.cpp" line="35"/>
|
||||
<location filename="toolsmanager.cpp" line="46"/>
|
||||
<source>Read tools config failed</source>
|
||||
<translation>读取工具配置失败</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="toolsmanager.cpp" line="27"/>
|
||||
<location filename="toolsmanager.cpp" line="36"/>
|
||||
<source>Can't open tools config file '%1' for read.</source>
|
||||
<translation>无法读取工具配置文件'%1'</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="toolsmanager.cpp" line="38"/>
|
||||
<location filename="toolsmanager.cpp" line="47"/>
|
||||
<source>Read tools config file '%1' failed:%2</source>
|
||||
<translation>读取工具配置文件'%1'失败:%2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="toolsmanager.cpp" line="65"/>
|
||||
<location filename="toolsmanager.cpp" line="84"/>
|
||||
<location filename="toolsmanager.cpp" line="73"/>
|
||||
<location filename="toolsmanager.cpp" line="92"/>
|
||||
<source>Save tools config failed</source>
|
||||
<translation>保存工具配置失败</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="toolsmanager.cpp" line="66"/>
|
||||
<location filename="toolsmanager.cpp" line="74"/>
|
||||
<source>Can't open tools config file '%1' for write.</source>
|
||||
<translation>无法写入工具配置文件'%1'。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="toolsmanager.cpp" line="85"/>
|
||||
<location filename="toolsmanager.cpp" line="93"/>
|
||||
<source>Write to tools config file '%1' failed.</source>
|
||||
<oldsource>Write to tool config file '%1' failed.</oldsource>
|
||||
<translation>写入工具配置文件'%1'失败。</translation>
|
||||
|
|
|
@ -194,9 +194,9 @@ void CodeSnippetsModel::remove(int index)
|
|||
|
||||
void CodeSnippetsModel::clear()
|
||||
{
|
||||
beginRemoveRows(QModelIndex(),0,mSnippets.count()-1);
|
||||
beginResetModel();
|
||||
mSnippets.clear();
|
||||
endRemoveRows();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
QModelIndex CodeSnippetsModel::lastSnippetCaption()
|
||||
|
|
|
@ -1434,9 +1434,9 @@ void BreakpointModel::addBreakpoint(PBreakpoint p)
|
|||
|
||||
void BreakpointModel::clear()
|
||||
{
|
||||
beginRemoveRows(QModelIndex(),0,mList.size()-1);
|
||||
beginResetModel();
|
||||
mList.clear();
|
||||
endRemoveRows();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
void BreakpointModel::removeBreakpoint(int row)
|
||||
|
@ -1640,9 +1640,9 @@ void BacktraceModel::addTrace(PTrace p)
|
|||
|
||||
void BacktraceModel::clear()
|
||||
{
|
||||
beginRemoveRows(QModelIndex(),0,mList.size()-1);
|
||||
beginResetModel();
|
||||
mList.clear();
|
||||
endRemoveRows();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
void BacktraceModel::removeTrace(int row)
|
||||
|
|
|
@ -1801,7 +1801,7 @@ void MainWindow::updateTools()
|
|||
if (!mToolsManager->tools().isEmpty()) {
|
||||
ui->menuTools->addSeparator();
|
||||
foreach (const PToolItem& item, mToolsManager->tools()) {
|
||||
QAction* action = new QAction(tr(item->title.toUtf8()),ui->menuTools);
|
||||
QAction* action = new QAction(item->title,ui->menuTools);
|
||||
connect(action, &QAction::triggered,
|
||||
[item] (){
|
||||
QString program = parseMacros(item->program);
|
||||
|
|
|
@ -17,8 +17,17 @@ void ToolsManager::load()
|
|||
{
|
||||
//if config file not exists, copy it from data
|
||||
QString filename = includeTrailingPathDelimiter(pSettings->dirs().config()) + DEV_TOOLS_FILE;
|
||||
if (!fileExists(filename))
|
||||
if (!fileExists(filename)) {
|
||||
mTools.clear();
|
||||
PToolItem item = std::make_shared<ToolItem>();
|
||||
item->title = tr("Remove Compiled");
|
||||
item->program = "del";
|
||||
item->workingDirectory = "<SOURCEPATH>";
|
||||
item->parameters = "<EXENAME>";
|
||||
item->pauseAfterExit = false;
|
||||
mTools.append(item);
|
||||
return;
|
||||
}
|
||||
//read config file
|
||||
QFile file(filename);
|
||||
if (!file.open(QFile::ReadOnly)) {
|
||||
|
@ -36,8 +45,7 @@ void ToolsManager::load()
|
|||
QMessageBox::critical(nullptr,
|
||||
tr("Read tools config failed"),
|
||||
tr("Read tools config file '%1' failed:%2")
|
||||
.arg(filename)
|
||||
.arg(error.errorString()));
|
||||
.arg(filename,error.errorString()));
|
||||
return;
|
||||
}
|
||||
mTools.clear();
|
||||
|
|
|
@ -15,9 +15,9 @@ OJProblemSetModel::OJProblemSetModel(QObject *parent) : QAbstractListModel(paren
|
|||
|
||||
void OJProblemSetModel::clear()
|
||||
{
|
||||
beginRemoveRows(QModelIndex(),0,mProblemSet.problems.count()-1);
|
||||
beginResetModel();
|
||||
mProblemSet.problems.clear();
|
||||
endRemoveRows();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
int OJProblemSetModel::count()
|
||||
|
@ -261,9 +261,9 @@ void OJProblemModel::clear()
|
|||
{
|
||||
if (mProblem==nullptr)
|
||||
return;
|
||||
beginRemoveRows(QModelIndex(),0,mProblem->cases.count()-1);
|
||||
beginResetModel();
|
||||
mProblem->cases.clear();
|
||||
endRemoveRows();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
int OJProblemModel::count()
|
||||
|
|
Loading…
Reference in New Issue