work save

This commit is contained in:
Roy Qu 2021-12-08 22:47:28 +08:00
parent 095a0897f2
commit ee3864f565
6 changed files with 14 additions and 29 deletions

View File

@ -2678,7 +2678,7 @@ void Editor::showCompletion(const QString& preWord,bool autoComplete)
caretXY(), caretXY(),
memberOperator, memberOperator,
memberExpression); memberExpression);
qDebug()<<ownerExpression<<memberExpression; // qDebug()<<ownerExpression<<memberExpression;
word = memberExpression.join(""); word = memberExpression.join("");
mCompletionPopup->prepareSearch( mCompletionPopup->prepareSearch(
preWord, preWord,

View File

@ -1802,20 +1802,18 @@ void MainWindow::updateTools()
foreach (const PToolItem& item, mToolsManager->tools()) { foreach (const PToolItem& item, mToolsManager->tools()) {
QAction* action = new QAction(item->title,ui->menuTools); QAction* action = new QAction(item->title,ui->menuTools);
connect(action, &QAction::triggered, connect(action, &QAction::triggered,
[item] (){ [item,this] (){
if (item->pauseAfterExit QString params = parseMacros(item->parameters);
&& programHasConsole(parseMacros(item->program))) { params.replace("/",QDir::separator());
executeFile( QByteArray newContent = runAndGetOutput(
includeTrailingPathDelimiter(pSettings->dirs().app())+"ConsolePauser.exe",
" 0 \""+parseMacros(item->program)+"\" "+parseMacros(item->parameters),
parseMacros(item->workingDirectory));
} else {
executeFile(
parseMacros(item->program), parseMacros(item->program),
parseMacros(item->parameters), parseMacros(item->workingDirectory),
parseMacros(item->workingDirectory)); QProcess::splitCommand(params),
QByteArray(),
} true
);
qDebug()<<"running"<<item->program;
ui->txtCompilerOutput->appendPlainText(QString::fromLocal8Bit(newContent));
}); });
ui->menuTools->addAction(action); ui->menuTools->addAction(action);
} }

View File

@ -301,7 +301,7 @@ void SettingsDialog::widget_settings_changed(bool value)
ui->btnApply->setEnabled(value); ui->btnApply->setEnabled(value);
} }
void SettingsDialog::on_btnCancle_pressed() void SettingsDialog::on_btnCancel_pressed()
{ {
this->close(); this->close();
} }

View File

@ -39,7 +39,7 @@ private slots:
void widget_settings_changed(bool value); void widget_settings_changed(bool value);
void on_widgetsView_clicked(const QModelIndex &index); void on_widgetsView_clicked(const QModelIndex &index);
void on_btnCancle_pressed(); void on_btnCancel_pressed();
void on_btnApply_pressed(); void on_btnApply_pressed();

View File

@ -829,17 +829,6 @@ QString parseMacros(const QString &s)
return result; return result;
} }
void executeFile(const QString &fileName, const QString &params, const QString &workingDir)
{
ShellExecuteA(NULL,
NULL,
fileName.toLocal8Bit(),
params.toLocal8Bit(),
workingDir.toLocal8Bit(),
SW_SHOW
);
}
void stringToFile(const QString &str, const QString &fileName) void stringToFile(const QString &str, const QString &fileName)
{ {
QFile file(fileName); QFile file(fileName);

View File

@ -121,8 +121,6 @@ QByteArray runAndGetOutput(const QString& cmd, const QString& workingDir, const
const QByteArray& inputContent = QByteArray(), const QByteArray& inputContent = QByteArray(),
bool inheritEnvironment = false); bool inheritEnvironment = false);
void executeFile(const QString& fileName, const QString& params, const QString& workingDir);
bool isNonPrintableAsciiChar(char ch); bool isNonPrintableAsciiChar(char ch);
bool fileExists(const QString& file); bool fileExists(const QString& file);