Commit 463fa834 authored by Admin's avatar Admin

Merge

parents 0545b90e 1d8c1f28
stages:
- configure
- build
- dist
- pack
configure:win32:
stage: configure
script:
- md build
- set QMAKESPEC=win32-msvc2015
- set INCLUDE=
- set LIB=
- set LIBPATH=
- call vsvars32.bat
- call vcvars32.bat
- cd build
- cmake -Wno-dev -DCMAKE_PREFIX_PATH="%QTDIR%\lib\cmake" -DQt5_DIR="%QTDIR%\lib\cmake\Qt5" -DUSE_QT=5 -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=%PYTHON_EXECUTABLE% -G "NMake Makefiles" ..
tags:
- windows
cache:
key: $CI_PIPELINE_ID
untracked: true
paths:
- build/
build:win32:
stage: build
script:
- cd build
- set QMAKESPEC=win32-msvc2016
- set INCLUDE=
- set LIB=
- set LIBPATH=
- call vsvars32.bat
- call vcvars32.bat
- set CL=/MP
- nmake
tags:
- windows
cache:
key: $CI_PIPELINE_ID
untracked: true
paths:
- build/
dist:win32:
stage: dist
script:
- cd build
- md kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\
- md kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
- md kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\lib\
- md kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\share\
- xcopy /Y /S /E bin kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin
- xcopy /Y /S /E lib kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\lib
- xcopy /Y /S /E share kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\share
- copy /Y ..\LICENSE_RU.rtf kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\
- copy /Y %QTDIR%\bin\Qt5Core.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
- copy /Y %QTDIR%\bin\Qt5Gui.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
- copy /Y %QTDIR%\bin\Qt5Multimedia.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
- copy /Y %QTDIR%\bin\Qt5MultimediaWidgets.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
- copy /Y %QTDIR%\bin\Qt5Network.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
- copy /Y %QTDIR%\bin\Qt5OpenGL.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
- copy /Y %QTDIR%\bin\Qt5Positioning.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
- copy /Y %QTDIR%\bin\Qt5PrintSupport.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
- copy /Y %QTDIR%\bin\Qt5Qml.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
- copy /Y %QTDIR%\bin\Qt5Quick.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
- copy /Y %QTDIR%\bin\Qt5Script.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
- copy /Y %QTDIR%\bin\Qt5Sensors.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
- copy /Y %QTDIR%\bin\Qt5Sql.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
- copy /Y %QTDIR%\bin\Qt5Svg.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
- copy /Y %QTDIR%\bin\Qt5Widgets.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
- copy /Y %QTDIR%\bin\Qt5Xml.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
- copy /Y %QTDIR%\bin\Qt5XmlPatterns.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
- md kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\platforms
- copy /Y %QTDIR%\plugins\platforms\qminimal.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\platforms\
- copy /Y %QTDIR%\plugins\platforms\qwindows.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\platforms\
- copy /Y %QTDIR%\plugins\platforms\qoffscreen.dll kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\platforms\
- xcopy /Y /S /E "%VC_REDIST_DIR%\x86\Microsoft.VC140.CRT\*.dll" kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\bin\
- md kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\src
- cd ..
- call %PYTHON_EXECUTABLE% scripts\get_bundle_name.py --prefix=git@20archive@20--out=build\kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\src\kumir2- --suffix=.src.zip@20--format=zip@20-9@20HEAD --out=run_git_archive.cmd
- copy /Y kumir2.nsi build\kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\
- copy /Y kumir2.nsi build\kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\src\
- call %PYTHON_EXECUTABLE% scripts\query_version_info.py --mode=nsis_include_file --out=build\kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\nsis_version_info.nsh
- copy /Y build\kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\nsis_version_info.nsh build\kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%\src\
- run_git_archive.cmd
tags:
- windows
cache:
key: $CI_PIPELINE_ID
untracked: true
paths:
- build/
pack:win32:
stage: pack
script:
- cd build
- cd kumir2-%CI_COMMIT_REF_NAME%-%CI_PIPELINE_ID%
- call "%NSIS_EXECUTABLE%" kumir2.nsi
- move /Y kumir2-*-install.exe ..\..\
cache:
key: $CI_PIPELINE_ID
untracked: true
paths:
- build/
artifacts:
paths:
- kumir2-*-install.exe
tags:
- windows
project(Kumir2)
cmake_minimum_required(VERSION 3.0)
find_package(PythonInterp 3.2.0 REQUIRED)
set(USE_QT 5) # No more Qt4 support!!!
message(STATUS "Cmake prefix path: ${CMAKE_PREFIX_PATH}")
# Query for version info and pass it as compile definitions
if(EXISTS "${CMAKE_SOURCE_DIR}/version_info.cmake")
......
......@@ -50,6 +50,8 @@ public:
*/
inline virtual QString correctCapitalization(const QString & name, LexemType lxType) const
{ return name; }
inline virtual bool isKnownLexem(const QString &lexem, int lineNo, int colNo, const QString &context) const
{ return false; }
};
......
......@@ -38,7 +38,7 @@ Section "Kumir" Kumir
SetOutPath "$INSTDIR"
File LICENSE_RU.rtf
File vcredist_x86.exe
#File vcredist_x86.exe
SetOutPath "$INSTDIR\bin"
File /r bin\*
SetOutPath "$INSTDIR\lib"
......@@ -57,8 +57,8 @@ Section "Kumir" Kumir
File /nonfatal /r python\*
ExecWait '"$INSTDIR\vcredist_x86.exe" /passive'
Delete /REBOOTOK "$INSTDIR\vcredist_x86.exe"
#ExecWait '"$INSTDIR\vcredist_x86.exe" /passive'
#Delete /REBOOTOK "$INSTDIR\vcredist_x86.exe"
WriteRegStr HKCR ".kum" "" "ru.niisi.kumir2.program"
WriteRegStr HKCR "ru.niisi.kumir2.program" "" " "
......
......@@ -1438,14 +1438,13 @@ class PluginCppClass(CppClassBase):
friend class %s;
Q_OBJECT
#if QT_VERSION >= 0x050000
Q_PLUGIN_METADATA(IID "kumir2.%s" FILE "%s")
Q_PLUGIN_METADATA(IID "kumir2.%s")
#endif
Q_INTERFACES(Shared::ActorInterface)
""" % (
self._module.get_run_thread_cpp_class_name(),
self._module.get_base_cpp_class_name(),
self._module.get_module_cpp_namespace(),
"" # self._module.json_file_name
self._module.get_module_cpp_namespace()
)
self.class_declaration_suffix = """
private:
......
......@@ -94,6 +94,8 @@ def get_version_information(top_level_dir):
else:
result["taggedRelease"] = False
result["date"] = get_date(top_level_dir)
if not result["taggedRelease"] and result["branch"]=="HEAD":
result["branch"] = "master" # fix GitLab naming bug
return result
......
......@@ -240,6 +240,8 @@ namespace ActorRobot {
upWallLine->setPen(pen);
Scene->addItem(upWallLine);
upWallLine->setZValue(1);
Scene->update();
update();
}
void FieldItm::showCharMark(qreal upLeftCornerX, qreal upLeftCornerY, int size)
......@@ -414,6 +416,8 @@ namespace ActorRobot {
downWallLine->setPen(pen);
Scene->addItem(downWallLine);
downWallLine->setZValue(1);
Scene->update();
update();
}
void FieldItm::setLeftLine(QGraphicsLineItem *Line, QPen pen)
......@@ -422,6 +426,8 @@ namespace ActorRobot {
leftWallLine->setPen(pen);
Scene->addItem(leftWallLine);
leftWallLine->setZValue(1);
Scene->update();
update();
}
void FieldItm::setRightLine(QGraphicsLineItem *Line, QPen pen)
......@@ -431,6 +437,8 @@ namespace ActorRobot {
Scene->addItem(rightWallLine);
rightWallLine->setZValue(1);
Scene->update();
update();
}
bool FieldItm::hasUpWall()
......
......@@ -47,7 +47,7 @@ class Plugin
friend class MainWindow;
Q_OBJECT
#if QT_VERSION >= 0x050000
Q_PLUGIN_METADATA(IID "kumir2.CoreGUI" FILE "")
Q_PLUGIN_METADATA(IID "kumir2.CoreGUI")
#endif
Q_INTERFACES(Shared::GuiInterface)
public:
......
......@@ -26,7 +26,7 @@ class Plugin
{
Q_OBJECT
#if QT_VERSION >= 0x050000
Q_PLUGIN_METADATA(IID "kumir2.CourseManager" FILE "")
Q_PLUGIN_METADATA(IID "kumir2.CourseManager")
#endif
Q_INTERFACES(Shared::CoursesInterface)
public:
......
This diff is collapsed.
......@@ -99,6 +99,10 @@ protected:
void doAutocomplete();
void keyReleaseEvent(QKeyEvent *);
void setProperFormat(QPainter * p, Shared::LexemType type, const QChar &c);
QString tryCorrectKeyboardLayout(const QString &source) const;
void tryCorrectKeyboardLayoutForLastLexem();
protected slots:
void updateCursor();
void updateText(int fromLine, int toLine);
......@@ -131,6 +135,7 @@ private:
QLabel * marginHintBox_;
bool escPressFlag_;
bool typeTextFlag_;
signals:
void urlsDragAndDropped(const QList<QUrl> &);
......
......@@ -16,7 +16,7 @@ class EditorPlugin
{
Q_OBJECT
#if QT_VERSION >= 0x050000
Q_PLUGIN_METADATA(IID "kumir2.Editor" FILE "")
Q_PLUGIN_METADATA(IID "kumir2.Editor")
#endif
Q_INTERFACES(Shared::EditorInterface)
public:
......
......@@ -636,6 +636,20 @@ struct Chunk {
QByteArray data;
};
static QString screenCharacter(const QChar &ch)
{
switch (ch.unicode()) {
case '{':
return "\\u123 ";
case '}':
return "\\u125 ";
case '\\':
return "\\u92 ";
default:
return ch;
}
}
static QList<Chunk> splitLineIntoChunks(const ExtensionSystem::SettingsPtr s,
const TextLine & textLine,
const bool primaryAlphabetIsLatin
......@@ -658,7 +672,7 @@ static QList<Chunk> splitLineIntoChunks(const ExtensionSystem::SettingsPtr s,
chunk.bold = chunk.error = false;
chunk.italic = latin && !primaryAlphabetIsLatin;
chunk.format = highlight[i];
chunk.text += text[i];
chunk.text += screenCharacter(text[i]);
result.push_back(chunk);
}
else if (result.last().format==highlight[i] &&
......@@ -666,7 +680,7 @@ static QList<Chunk> splitLineIntoChunks(const ExtensionSystem::SettingsPtr s,
{
// Continue the same format chunk of text
Chunk & chunk = result.last();
chunk.text += text[i];
chunk.text += screenCharacter(text[i]);
}
else
{
......@@ -675,7 +689,7 @@ static QList<Chunk> splitLineIntoChunks(const ExtensionSystem::SettingsPtr s,
chunk.bold = chunk.error = false;
chunk.italic = latin && !primaryAlphabetIsLatin;
chunk.format = highlight[i];
chunk.text += text[i];
chunk.text += screenCharacter(text[i]);
result.push_back(chunk);
}
}
......
......@@ -19,6 +19,31 @@ void Analizer::connectSignalImportsChanged(QObject *receiver, const char *slot)
receiver, slot);
}
bool Analizer::isKnownLexem(const QString &lexem, int lineNo, int colNo, const QString &context) const
{
// Check for keyword
if (lexem.length()>=2 && _lexer->isLanguageReservedName(lexem)) {
return true;
}
// TODO check for russian one-letter keyword 'и'
// Check for function/variable name
if (lexem.length()>=3) {
QString before = context.mid(0, colNo-lexem.length());
QString after = context.mid(colNo);
using Shared::Analizer::Suggestion;
QList<Suggestion> suggestions = suggestAutoComplete(lineNo, before, after);
Q_FOREACH(Suggestion suggestion, suggestions) {
if (suggestion.value.trimmed() == lexem) {
return true;
}
}
}
return false;
}
void Analizer::setSourceLanguage(const QDir & resourcesRoot, const QLocale::Language &language)
{
Lexer::setLanguage(resourcesRoot, language);
......
......@@ -48,6 +48,7 @@ public:
static void setSourceLanguage(const QDir & resourcesRoot, const QLocale::Language & language);
static void setModuleAlwaysAvailable(const QByteArray & moduleName);
void connectSignalImportsChanged(QObject *receiver, const char *slot);
bool isKnownLexem(const QString &lexem, int lineNo, int colNo, const QString &context) const;
public slots:
......
......@@ -21,7 +21,7 @@ class KumirAnalizerPlugin
{
Q_OBJECT
#if QT_VERSION >= 0x050000
Q_PLUGIN_METADATA(IID "kumir2.KumirAnalizer" FILE "")
Q_PLUGIN_METADATA(IID "kumir2.KumirAnalizer")
#endif
Q_INTERFACES(Shared::AnalizerInterface)
friend class AnalizerPrivate;
......
......@@ -1542,6 +1542,19 @@ void Lexer::setSourceDirName(const QString &dir)
_sourceDirName = dir;
}
bool Lexer::isLanguageReservedName(const QString &lexem) const
{
if (_RxKeyWords.exactMatch(lexem) || _KeyWords.contains(lexem))
return true;
if (lexem==QString::fromUtf8("знач") || lexem==QString::fromUtf8("таб"))
return true;
if (_RxTypes.exactMatch(lexem))
return true;
if (_RxConst.exactMatch(lexem))
return true;
return false;
}
QString Lexer::testingAlgorhitmName()
{
QString name = tr("@testing");
......
......@@ -29,6 +29,8 @@ public:
inline QString outputLexemName() const{ return QString::fromUtf8("вывод"); }
void setSourceDirName(const QString &dir);
bool isLanguageReservedName(const QString &lexem) const;
public slots:
int splitIntoStatements(const QStringList &lines
, int baseLineNo
......
......@@ -17,7 +17,7 @@ class KumirCodeGeneratorPlugin
{
Q_OBJECT
#if QT_VERSION >= 0x050000
Q_PLUGIN_METADATA(IID "kumir2.KumirCodeGenerator" FILE "")
Q_PLUGIN_METADATA(IID "kumir2.KumirCodeGenerator")
#endif
Q_INTERFACES(Shared::GeneratorInterface)
......
......@@ -18,7 +18,7 @@ class KumirRunPlugin
{
Q_OBJECT
#if QT_VERSION >= 0x050000
Q_PLUGIN_METADATA(IID "kumir2.KumirCodeRun" FILE "")
Q_PLUGIN_METADATA(IID "kumir2.KumirCodeRun")
#endif
Q_INTERFACES(Shared::RunInterface)
public:
......
......@@ -13,7 +13,7 @@ class KumirCompilerToolPlugin
{
Q_OBJECT
#if QT_VERSION >= 0x050000
Q_PLUGIN_METADATA(IID "kumir2.KumirCompilerTool" FILE "")
Q_PLUGIN_METADATA(IID "kumir2.KumirCompilerTool")
#endif
public:
KumirCompilerToolPlugin();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment