-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathSettings.cpp
56 lines (47 loc) · 1.13 KB
/
Settings.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include<fsm-editor/Settings.h>
#include <QCoreApplication>
#include <QRegExp>
void Settings::initializeCodeHighlighter(QTextDocument* document)
{}
QString Settings::getExportExtension() const
{
return "fsm";
}
QString Settings::getOrganizationName() const
{
QString res = QCoreApplication::organizationName();
if (res.isEmpty())
{
res = "FSM Editor Corp.";
}
return res;
}
QString Settings::getApplicationName() const
{
QString res = QCoreApplication::applicationName();
if (res.isEmpty())
{
res = "FSM Editor";
}
return res;
}
QString Settings::validateStateName(const QString& name)
{
return "";
}
bool Settings::showMenu()
{
return true;
}
bool Settings::showFileActions()
{
return true;
}
QString Settings::validateCode(const QString& valid)
{
if (valid.count("{") > valid.count("}"))
return QObject::tr("Missing %1 closing curly brace(s)").arg(valid.count("{") - valid.count("}"));
if (valid.count("{") < valid.count("}"))
return QObject::tr("Missing %1 opening curly brace(s)").arg(valid.count("}") - valid.count("{"));
return "";
}