ScriptConsole.cpp   ScriptConsole.cpp 
skipping to change at line 104 skipping to change at line 104
connect(&StelApp::getInstance().getScriptMgr(), SIGNAL(scriptRunning ()), this, SLOT(scriptStarted())); connect(&StelApp::getInstance().getScriptMgr(), SIGNAL(scriptRunning ()), this, SLOT(scriptStarted()));
connect(&StelApp::getInstance().getScriptMgr(), SIGNAL(scriptStopped ()), this, SLOT(scriptEnded())); connect(&StelApp::getInstance().getScriptMgr(), SIGNAL(scriptStopped ()), this, SLOT(scriptEnded()));
connect(&StelApp::getInstance().getScriptMgr(), SIGNAL(scriptDebug(c onst QString&)), this, SLOT(appendLogLine(const QString&))); connect(&StelApp::getInstance().getScriptMgr(), SIGNAL(scriptDebug(c onst QString&)), this, SLOT(appendLogLine(const QString&)));
connect(&StelApp::getInstance().getScriptMgr(), SIGNAL(scriptOutput( const QString&)), this, SLOT(appendOutputLine(const QString&))); connect(&StelApp::getInstance().getScriptMgr(), SIGNAL(scriptOutput( const QString&)), this, SLOT(appendOutputLine(const QString&)));
ui->tabs->setCurrentIndex(0); ui->tabs->setCurrentIndex(0);
ui->scriptEdit->setFocus(); ui->scriptEdit->setFocus();
} }
void ScriptConsole::loadScript() void ScriptConsole::loadScript()
{ {
QString fileName = QFileDialog::getOpenFileName(&StelMainView::getIn QString fileName = QFileDialog::getOpenFileName(Q_NULLPTR,
stance(), q_("Load Script"),
tr("Load Script"),
StelFileMgr::getInst allationDir() + "/scripts", StelFileMgr::getInst allationDir() + "/scripts",
tr("Script Files") + " " + getFileMask()); q_("Script Files") + " " + getFileMask());
QFile file(fileName); QFile file(fileName);
if (file.open(QIODevice::ReadOnly)) if (file.open(QIODevice::ReadOnly))
{ {
ui->scriptEdit->setPlainText(file.readAll()); ui->scriptEdit->setPlainText(file.readAll());
ui->includeEdit->setText(StelFileMgr::dirName(fileName)); ui->includeEdit->setText(StelFileMgr::dirName(fileName));
file.close(); file.close();
} }
ui->tabs->setCurrentIndex(0); ui->tabs->setCurrentIndex(0);
} }
void ScriptConsole::saveScript() void ScriptConsole::saveScript()
{ {
QString saveDir = StelFileMgr::findFile("scripts", StelFileMgr::Flag s(StelFileMgr::Writable|StelFileMgr::Directory)); QString saveDir = StelFileMgr::findFile("scripts", StelFileMgr::Flag s(StelFileMgr::Writable|StelFileMgr::Directory));
if (saveDir.isEmpty()) if (saveDir.isEmpty())
saveDir = StelFileMgr::getUserDir(); saveDir = StelFileMgr::getUserDir();
QString fileName = QFileDialog::getSaveFileName(&StelMainView::getIn QString fileName = QFileDialog::getSaveFileName(Q_NULLPTR,
stance(), q_("Save Script"),
tr("Save Script"),
saveDir, saveDir,
tr("Script Files") + " " + getFileMask()); q_("Script Files") + " " + getFileMask());
QFile file(fileName); QFile file(fileName);
if (file.open(QIODevice::WriteOnly)) if (file.open(QIODevice::WriteOnly))
{ {
QTextStream out(&file); QTextStream out(&file);
out << ui->scriptEdit->toPlainText(); out << ui->scriptEdit->toPlainText();
file.close(); file.close();
} }
else else
qWarning() << "ERROR - cannot write script file"; qWarning() << "ERROR - cannot write script file";
} }
skipping to change at line 226 skipping to change at line 226
// if (html!="") // if (html!="")
// html += "<br />"; // html += "<br />";
html += s; html += s;
ui->outputBrowser->setHtml(html); ui->outputBrowser->setHtml(html);
} }
void ScriptConsole::includeBrowse() void ScriptConsole::includeBrowse()
{ {
ui->includeEdit->setText(QFileDialog::getExistingDirectory(&StelMain View::getInstance(), ui->includeEdit->setText(QFileDialog::getExistingDirectory(&StelMain View::getInstance(),
tr("Selec t Script Includ Directory"), q_("Selec t Script Include Directory"),
StelFileM gr::getInstallationDir() + "/scripts")); StelFileM gr::getInstallationDir() + "/scripts"));
} }
void ScriptConsole::quickRun(int idx) void ScriptConsole::quickRun(int idx)
{ {
ui->quickrunCombo->setCurrentIndex(0); ui->quickrunCombo->setCurrentIndex(0);
QString scriptText; QString scriptText;
if (idx==1) if (idx==1)
{ {
scriptText = QTextDocumentFragment::fromHtml(ui->scriptEdit- >textCursor().selectedText(), ui->scriptEdit->document()).toPlainText(); scriptText = QTextDocumentFragment::fromHtml(ui->scriptEdit- >textCursor().selectedText(), ui->scriptEdit->document()).toPlainText();
 End of changes. 5 change blocks. 
9 lines changed or deleted 7 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/