Commit 9f815464 authored by Victor Yacovlev's avatar Victor Yacovlev

Implemented initial program text

parent a7afe89d
алг
нач
кон
......@@ -4,60 +4,60 @@
<context>
<name>ActorRobot::RobotModule</name>
<message utf8="true">
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2764"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2765"/>
<source>Робот разбился: сверху стена!</source>
<translation type="unfinished"></translation>
</message>
<message utf8="true">
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2765"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2783"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2801"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2818"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2766"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2784"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2802"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2819"/>
<source>Отказ</source>
<translation type="unfinished"></translation>
</message>
<message utf8="true">
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2781"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2782"/>
<source>Робот разбился: снизу стена!</source>
<translation type="unfinished"></translation>
</message>
<message utf8="true">
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2800"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2801"/>
<source>Робот разбился: слева стена!</source>
<translation type="unfinished"></translation>
</message>
<message utf8="true">
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2819"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2820"/>
<source>Робот разбился: справа стена!</source>
<translation type="unfinished"></translation>
</message>
<message utf8="true">
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2842"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2853"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2864"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2875"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2885"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2896"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2907"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2918"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2843"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2854"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2865"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2876"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2886"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2897"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2908"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2919"/>
<source>да</source>
<translation type="unfinished"></translation>
</message>
<message utf8="true">
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2842"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2853"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2864"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2875"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2885"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2896"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2907"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2918"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2843"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2854"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2865"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2876"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2886"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2897"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2908"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2919"/>
<source>нет</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2936"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="3036"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="2937"/>
<location filename="../../../src/actors/robot/robotmodule.cpp" line="3037"/>
<source>Robot</source>
<translation>Робот</translation>
</message>
......
......@@ -150,13 +150,13 @@ p, li { white-space: pre-wrap; }
<translation>Глобальные в исполнителе &quot;%1&quot; </translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/debuggerwindow.cpp" line="736"/>
<location filename="../../../src/plugins/coregui/debuggerwindow.cpp" line="737"/>
<source>This variable is a reference.
Right click to navigate target</source>
<translation>Эта величина является ссылкой. Для перехода по ссылке нажмите правую кнопку мыши</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/debuggerwindow.cpp" line="785"/>
<location filename="../../../src/plugins/coregui/debuggerwindow.cpp" line="786"/>
<source>Current values available only while running program in step-by-step mode</source>
<translation>Текущие значения величин отображаются при выполнении по шагам</translation>
</message>
......@@ -201,7 +201,7 @@ Right click to navigate target</source>
<translation>Без показа на полях и обновления окна величин</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/kumirprogram.cpp" line="297"/>
<location filename="../../../src/plugins/coregui/kumirprogram.cpp" line="280"/>
<source>This program does not have testing algorithm</source>
<translation>У этой программы нет тестирующего алгоритма</translation>
</message>
......@@ -230,25 +230,25 @@ Right click to navigate target</source>
<translation>До конца алгоритма</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/kumirprogram.cpp" line="394"/>
<location filename="../../../src/plugins/coregui/kumirprogram.cpp" line="382"/>
<source>Unknown error</source>
<translation>Нераспознанная ошибка</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/kumirprogram.cpp" line="395"/>
<location filename="../../../src/plugins/coregui/kumirprogram.cpp" line="404"/>
<location filename="../../../src/plugins/coregui/kumirprogram.cpp" line="431"/>
<location filename="../../../src/plugins/coregui/kumirprogram.cpp" line="383"/>
<location filename="../../../src/plugins/coregui/kumirprogram.cpp" line="392"/>
<location filename="../../../src/plugins/coregui/kumirprogram.cpp" line="432"/>
<source>Evaluation error</source>
<translation>Ошибка выполнения</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/kumirprogram.cpp" line="404"/>
<location filename="../../../src/plugins/coregui/kumirprogram.cpp" line="439"/>
<location filename="../../../src/plugins/coregui/kumirprogram.cpp" line="392"/>
<location filename="../../../src/plugins/coregui/kumirprogram.cpp" line="440"/>
<source>Evaluation finished</source>
<translation>Выполнение завершено</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/kumirprogram.cpp" line="422"/>
<location filename="../../../src/plugins/coregui/kumirprogram.cpp" line="423"/>
<source>Evaluation terminated</source>
<translation>Выполнение прервано</translation>
</message>
......@@ -561,7 +561,7 @@ Right click to navigate target</source>
</message>
<message>
<location filename="../../../src/plugins/coregui/mainwindow.ui" line="238"/>
<location filename="../../../src/plugins/coregui/mainwindow.cpp" line="878"/>
<location filename="../../../src/plugins/coregui/mainwindow.cpp" line="872"/>
<source>Restore previous session</source>
<translation>Восстановить предыдущий сеанс</translation>
</message>
......@@ -621,12 +621,12 @@ Right click to navigate target</source>
<translation>Сохранить текущий текст?</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/mainwindow.cpp" line="879"/>
<location filename="../../../src/plugins/coregui/mainwindow.cpp" line="873"/>
<source>Are you sure to restore previous session? All unsaved changes will be lost.</source>
<translation>Вы уверены, что хотите восстановить предыдущий сеанс? Все открытые файлы будут закрыты без сохранения.</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/mainwindow.cpp" line="1001"/>
<location filename="../../../src/plugins/coregui/mainwindow.cpp" line="995"/>
<source>The following files have changes:
%1
Save them?</source>
......@@ -635,7 +635,7 @@ Save them?</source>
Сохранить их?</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/mainwindow.cpp" line="1002"/>
<location filename="../../../src/plugins/coregui/mainwindow.cpp" line="996"/>
<source>Close Kumir</source>
<translation>Выход из Кумир</translation>
</message>
......@@ -660,7 +660,7 @@ Save them?</source>
<translation type="obsolete">Закрыть без сохранения</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/mainwindow.cpp" line="901"/>
<location filename="../../../src/plugins/coregui/mainwindow.cpp" line="895"/>
<source>Start</source>
<translation>Начало</translation>
</message>
......@@ -675,12 +675,12 @@ Using Qt version %2</source>
Использует Qt версии %2</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/mainwindow.cpp" line="1109"/>
<location filename="../../../src/plugins/coregui/mainwindow.cpp" line="1103"/>
<source>Load file...</source>
<translation>Загрузить файл...</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/mainwindow.cpp" line="1111"/>
<location filename="../../../src/plugins/coregui/mainwindow.cpp" line="1105"/>
<source>Kumir programs (*.kum);;Pascal programs (*.pas *.pp);;Web pages (*.html *.htm);;Text files (*.txt);;All files (*)</source>
<translation>Программы Кумир (*.kum);;Программы Pascal (*.pas *.pp);; Web-страницы (*.html *.htm);;Текстовые файлы (*.txt);;Все файлы (*)</translation>
</message>
......@@ -703,22 +703,22 @@ Using Qt version %2</source>
<translation type="obsolete">Область ввода/вывода</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/plugin.cpp" line="273"/>
<location filename="../../../src/plugins/coregui/plugin.cpp" line="272"/>
<source>Variables</source>
<translation>Значения величин</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/plugin.cpp" line="198"/>
<location filename="../../../src/plugins/coregui/plugin.cpp" line="197"/>
<source>Remote Control</source>
<translation>Пульт</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/plugin.cpp" line="247"/>
<location filename="../../../src/plugins/coregui/plugin.cpp" line="246"/>
<source>Help</source>
<translation>Справка</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/plugin.cpp" line="346"/>
<location filename="../../../src/plugins/coregui/plugin.cpp" line="345"/>
<source>Editing</source>
<translation>Редактирование</translation>
</message>
......@@ -804,49 +804,54 @@ p, li { white-space: pre-wrap; }
<context>
<name>Terminal::OneSession</name>
<message>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="83"/>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="125"/>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="87"/>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="129"/>
<source>&gt;&gt; %1:%2:%3 - %4 - Process started</source>
<translation>&gt;&gt; %1:%2:%3 - %4 - Начало выполнения</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="89"/>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="131"/>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="93"/>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="135"/>
<source>&gt;&gt; %1:%2:%3 - %4 - Process finished</source>
<translation>&gt;&gt; %1:%2:%3 - %4 - Выполнение завершено</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="235"/>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="239"/>
<source>INPUT </source>
<translation>ВВОД </translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="242"/>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="246"/>
<source>string</source>
<translation>лит</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="244"/>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="248"/>
<source>integer</source>
<translation>цел</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="246"/>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="250"/>
<source>real</source>
<translation>вещ</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="248"/>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="252"/>
<source>charect</source>
<translation>сим</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="250"/>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="254"/>
<source>boolean</source>
<translation>лог</translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="388"/>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="409"/>
<source>Not a &apos;%1&apos; value</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../src/plugins/coregui/terminal_onesession.cpp" line="445"/>
<source>RUNTIME ERROR: %1</source>
<translation>ОШИБКА ВЫПОЛНЕНИЯ: %1</translation>
</message>
......
......@@ -11,12 +11,17 @@
<context>
<name>Editor::EditorPlugin</name>
<message>
<location filename="../../../src/plugins/editor/editorplugin.cpp" line="187"/>
<location filename="../../../src/plugins/editor/editorplugin.cpp" line="194"/>
<source>Can&apos;t open file %1 for writing</source>
<translation>Не могу открыть %1 для записи</translation>
</message>
<message>
<location filename="../../../src/plugins/editor/editorplugin.cpp" line="218"/>
<location filename="../../../src/plugins/editor/editorplugin.cpp" line="213"/>
<source>Can&apos;t open file %1 for reading</source>
<translation>Не могу открыть %1 для чтения</translation>
</message>
<message>
<location filename="../../../src/plugins/editor/editorplugin.cpp" line="244"/>
<source>Editor</source>
<translation>Редактор</translation>
</message>
......@@ -233,21 +238,51 @@
</message>
<message>
<location filename="../../../src/plugins/editor/settingspage.ui" line="548"/>
<source>Initial Text</source>
<translation>Текст исходной программы</translation>
</message>
<message>
<location filename="../../../src/plugins/editor/settingspage.ui" line="554"/>
<source>Browse...</source>
<translation>Найти...</translation>
</message>
<message>
<location filename="../../../src/plugins/editor/settingspage.ui" line="616"/>
<source>Initial program template file:</source>
<translation>Имя файла с текстом исходной программы:</translation>
</message>
<message>
<location filename="../../../src/plugins/editor/settingspage.ui" line="629"/>
<source>Other</source>
<translation>Другое</translation>
</message>
<message>
<location filename="../../../src/plugins/editor/settingspage.ui" line="554"/>
<location filename="../../../src/plugins/editor/settingspage.ui" line="635"/>
<source>Force press program text to the left</source>
<translation>Прижимать текст программы к левому краю</translation>
</message>
<message>
<location filename="../../../src/plugins/editor/settingspage.ui" line="561"/>
<location filename="../../../src/plugins/editor/settingspage.ui" line="642"/>
<source>Show trailing spaces</source>
<translation>Отображать пробелы в конце строк</translation>
</message>
<message>
<location filename="../../../src/plugins/editor/settingspage.cpp" line="265"/>
<location filename="../../../src/plugins/editor/settingspage.cpp" line="244"/>
<source>File not exists</source>
<translation>Файл не найден</translation>
</message>
<message>
<location filename="../../../src/plugins/editor/settingspage.cpp" line="247"/>
<source>File access denied</source>
<translation>Нет доступа к файлу</translation>
</message>
<message>
<location filename="../../../src/plugins/editor/settingspage.cpp" line="256"/>
<source>Choose initial program file</source>
<translation>Выбор файла с исходным текстом программы</translation>
</message>
<message>
<location filename="../../../src/plugins/editor/settingspage.cpp" line="315"/>
<source>Choose color</source>
<translation>Выберете цвет</translation>
</message>
......@@ -321,7 +356,7 @@
<translation>...</translation>
</message>
<message>
<location filename="../../../src/plugins/editor/suggestionswindow.cpp" line="243"/>
<location filename="../../../src/plugins/editor/suggestionswindow.cpp" line="244"/>
<source>No suggestions</source>
<translation>Ничем не могу помочь</translation>
</message>
......
......@@ -17,27 +17,27 @@
<context>
<name>KumirAnalizer::SyntaxAnalizerPrivate</name>
<message>
<location filename="../../../src/plugins/kumiranalizer/syntaxanalizer.cpp" line="317"/>
<location filename="../../../src/plugins/kumiranalizer/syntaxanalizer.cpp" line="318"/>
<source>Built-it module %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../src/plugins/kumiranalizer/syntaxanalizer.cpp" line="328"/>
<location filename="../../../src/plugins/kumiranalizer/syntaxanalizer.cpp" line="329"/>
<source>Use file &quot;%1&quot; as module</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../src/plugins/kumiranalizer/syntaxanalizer.cpp" line="337"/>
<location filename="../../../src/plugins/kumiranalizer/syntaxanalizer.cpp" line="338"/>
<source>Use precompiled file &quot;%1&quot; as module</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../src/plugins/kumiranalizer/syntaxanalizer.cpp" line="519"/>
<location filename="../../../src/plugins/kumiranalizer/syntaxanalizer.cpp" line="520"/>
<source>Loop for variable</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../src/plugins/kumiranalizer/syntaxanalizer.cpp" line="524"/>
<location filename="../../../src/plugins/kumiranalizer/syntaxanalizer.cpp" line="525"/>
<source>Repeat while condition is true</source>
<translation type="unfinished"></translation>
</message>
......
......@@ -4,12 +4,12 @@
<context>
<name>KumirCodeRun::Plugin</name>
<message>
<location filename="../../../src/plugins/kumircoderun/plugin.cpp" line="589"/>
<location filename="../../../src/plugins/kumircoderun/plugin.cpp" line="497"/>
<source>RUNTIME ERROR: </source>
<translation>ОШИБКА ВЫПОЛНЕНИЯ: </translation>
</message>
<message>
<location filename="../../../src/plugins/kumircoderun/plugin.cpp" line="592"/>
<location filename="../../../src/plugins/kumircoderun/plugin.cpp" line="500"/>
<source>RUNTIME ERROR AT LINE </source>
<translation>ОШИБКА ВЫПОЛНЕНИЯ В СТРОКЕ </translation>
</message>
......@@ -17,24 +17,8 @@
<context>
<name>KumirCodeRun::Run</name>
<message>
<location filename="../../../src/plugins/kumircoderun/run.cpp" line="186"/>
<source>Please enter %1: </source>
<translation>Введите %1: </translation>
</message>
<message>
<location filename="../../../src/plugins/kumircoderun/run.cpp" line="194"/>
<source>Please enter %1[%2]: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../src/plugins/kumircoderun/run.cpp" line="206"/>
<source>Please enter %1[%2,%3]: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../src/plugins/kumircoderun/run.cpp" line="220"/>
<source>Please enter %1[%2,%3,%4]: </source>
<translation type="unfinished"></translation>
<translation type="obsolete">Введите %1: </translation>
</message>
</context>
<context>
......
......@@ -598,11 +598,9 @@ void MainWindow::newProgram()
if (b_notabs && !closeTab(ui->tabWidget->currentIndex())) {
return;
}
QString defaultText = QString::fromUtf8("алг\nнач\n\nкон");
QString suffix = ".kum";
DocumentType type = Kumir;
const QString initialText = m_plugin->mySettings()->value(Plugin::InitialTextKey, defaultText).toString();
Shared::EditorComponent doc = m_plugin->plugin_editor->newDocument("KumirAnalizer", initialText, QDir::currentPath(), false);
Shared::EditorComponent doc = m_plugin->plugin_editor->newDocument("KumirAnalizer", QDir::currentPath(), false);
QWidget* vc = doc.widget;
int id = doc.id;
vc->setProperty("documentId", id);
......@@ -627,11 +625,9 @@ void MainWindow::newPythonProgram()
if (b_notabs && !closeTab(ui->tabWidget->currentIndex())) {
return;
}
QString defaultText = QString::fromUtf8("#!/usr/bin/python3\n#coding=utf-8\n\n");
QString suffix = ".py";
DocumentType type = Python;
const QString initialText = m_plugin->mySettings()->value(Plugin::InitialTextKey, defaultText).toString();
Shared::EditorComponent doc = m_plugin->plugin_editor->newDocument("Python3Language", initialText, QDir::currentPath(), false);
DocumentType type = Python;
Shared::EditorComponent doc = m_plugin->plugin_editor->newDocument("Python3Language", QDir::currentPath(), false);
QWidget* vc = doc.widget;
int id = doc.id;
vc->setProperty("documentId", id);
......@@ -658,10 +654,8 @@ void MainWindow::newPascalProgram()
}
QString suffix = ".pas";
QString fileName = suggestNewFileName(suffix);
QString defaultText = QString::fromUtf8("program %1;\n\nbegin\n\nend.\n").arg(fileName.left(fileName.length()-4));
DocumentType type = Pascal;
const QString initialText = m_plugin->mySettings()->value(Plugin::InitialTextKey, defaultText).toString();
Shared::EditorComponent doc = m_plugin->plugin_editor->newDocument("PascalAnalizer", initialText, QDir::currentPath(), false);
Shared::EditorComponent doc = m_plugin->plugin_editor->newDocument("PascalAnalizer", QDir::currentPath(), false);
QWidget* vc = doc.widget;
int id = doc.id;
vc->setProperty("documentId", id);
......@@ -687,7 +681,7 @@ void MainWindow::newText()
void MainWindow::newText(const QString &fileName, const QString & text)
{
Shared::EditorComponent doc = m_plugin->plugin_editor->newDocument("", text, QDir::currentPath(), true);
Shared::EditorComponent doc = m_plugin->plugin_editor->newDocument("", QDir::currentPath(), true);
QWidget * vc = doc.widget;
int id = doc.id;
vc->setProperty("documentId", id);
......@@ -936,7 +930,7 @@ void MainWindow::restoreSession()
analizerName = "PascalAnalizer";
doctype = Pascal;
}
EditorComponent doc = m_plugin->plugin_editor->newDocument(analizerName, QDir::currentPath(), "", false);
EditorComponent doc = m_plugin->plugin_editor->newDocument(analizerName, QDir::currentPath(), false);
QByteArray editorSession = f.readAll();
QWidget * vc = doc.widget;
vc->setProperty("documentId", doc.id);
......@@ -1189,19 +1183,12 @@ TabWidgetElement * MainWindow::loadFromUrl(const QUrl & url, bool addToRecentFil
if (addToRecentFiles && type!=WWW)
addToRecent(url.toLocalFile());
if (type==Kumir) {
QFile f(url.toLocalFile());
if (f.open(QIODevice::ReadOnly)) {
QByteArray rawData = f.readAll();
f.close();
QStringList lines = KumFile::readRawDataAsString(rawData, "").split("\n");
for (int i=0; i<lines.size(); i++) {
while (lines[i].startsWith(".")||lines[i].startsWith(" ")) {
lines[i] = lines[i].mid(1);
}
}
EditorComponent doc = m_plugin->plugin_editor->newDocument("KumirAnalizer", lines.join("\n"), QFileInfo(f).absoluteDir().absolutePath(), false);
QFileInfo f(url.toLocalFile());
if (f.isReadable()) {
EditorComponent doc = m_plugin->plugin_editor->newDocument("KumirAnalizer", QFileInfo(f).absoluteDir().absolutePath(), false);
QWidget * vc = doc.widget;
int id = doc.id;
m_plugin->plugin_editor->loadDocument(id, f.absoluteFilePath());
vc->setProperty("documentId", id);
QString fileName = QFileInfo(url.toLocalFile()).fileName();
vc->setProperty("fileName", url.toLocalFile());
......@@ -1227,7 +1214,7 @@ TabWidgetElement * MainWindow::loadFromUrl(const QUrl & url, bool addToRecentFil
ts.setAutoDetectUnicode(true);
QString data = ts.readAll();
f.close();
EditorComponent doc = m_plugin->plugin_editor->newDocument("PascalAnalizer", data, QFileInfo(f).absoluteDir().absolutePath(), false);
EditorComponent doc = m_plugin->plugin_editor->newDocument("PascalAnalizer", QFileInfo(f).absoluteDir().absolutePath(), false);
QWidget* vc = doc.widget;
int id = doc.id;
vc->setProperty("documentId", id);
......@@ -1254,7 +1241,7 @@ TabWidgetElement * MainWindow::loadFromUrl(const QUrl & url, bool addToRecentFil
ts.setAutoDetectUnicode(true);
QString data = ts.readAll();
f.close();
EditorComponent doc = m_plugin->plugin_editor->newDocument("", data, "", false);
EditorComponent doc = m_plugin->plugin_editor->newDocument("", "", false);
QWidget* vc = doc.widget;
int id = doc.id;
vc->setProperty("documentId", id);
......
......@@ -69,7 +69,7 @@ void EditorPlugin::clearMargin(int documentId, int fromLine, int toLine)
ed->clearMarginText(fromLine, toLine);
}
Shared::EditorComponent EditorPlugin::newDocument(const QString &analizerName, const QString &initia