feat: 完善脚本调试器;完善脚本编辑器;
This commit is contained in:
parent
7b1a77ae60
commit
598c20ac1a
|
@ -1 +1 @@
|
|||
Subproject commit b2af78b2b0a9d9370a69f0f762fd0f405cf63e41
|
||||
Subproject commit f2034769ce887367e97a5fbaced5b14aa8039fd3
|
|
@ -76,7 +76,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef Q_GL_EDITOR
|
||||
#include <QGLWidget>
|
||||
#include <QtOpenGLWidgets/QOpenGLWidget>
|
||||
#endif
|
||||
|
||||
#define QCE_ACTION(name, action) \
|
||||
|
@ -444,7 +444,7 @@ QEditor::~QEditor() {
|
|||
*/
|
||||
void QEditor::init(bool actions) {
|
||||
#ifdef Q_GL_EDITOR
|
||||
setViewport(new QGLWidget);
|
||||
setViewport(new QOpenGLWidget);
|
||||
#endif
|
||||
|
||||
viewport()->setCursor(Qt::IBeamCursor);
|
||||
|
@ -512,7 +512,7 @@ void QEditor::init(bool actions) {
|
|||
|
||||
QAction *a, *sep;
|
||||
|
||||
a = new QAction(QIcon(":/undo.png"), tr("&Undo"), this);
|
||||
a = new QAction(QIcon(":/qeditor/undo.png"), tr("&Undo"), this);
|
||||
a->setObjectName("undo");
|
||||
Q_SHORTCUT(a, "Ctrl+Z", "Edit");
|
||||
a->setEnabled(false);
|
||||
|
@ -521,7 +521,7 @@ void QEditor::init(bool actions) {
|
|||
|
||||
addAction(a, "&Edit", "Edit");
|
||||
|
||||
a = new QAction(QIcon(":/redo.png"), tr("&Redo"), this);
|
||||
a = new QAction(QIcon(":/qeditor/redo.png"), tr("&Redo"), this);
|
||||
a->setObjectName("redo");
|
||||
Q_SHORTCUT(a, "Ctrl+Y", "Edit");
|
||||
a->setEnabled(false);
|
||||
|
@ -534,7 +534,7 @@ void QEditor::init(bool actions) {
|
|||
sep->setSeparator(true);
|
||||
addAction(sep, "&Edit", "Edit");
|
||||
|
||||
a = new QAction(QIcon(":/cut.png"), tr("Cu&t"), this);
|
||||
a = new QAction(QIcon(":/qeditor/cut.png"), tr("Cu&t"), this);
|
||||
a->setObjectName("cut");
|
||||
Q_SHORTCUT(a, "Ctrl+X", "Edit");
|
||||
a->setEnabled(false);
|
||||
|
@ -543,7 +543,7 @@ void QEditor::init(bool actions) {
|
|||
|
||||
addAction(a, "&Edit", "Edit");
|
||||
|
||||
a = new QAction(QIcon(":/copy.png"), tr("&Copy"), this);
|
||||
a = new QAction(QIcon(":/qeditor/copy.png"), tr("&Copy"), this);
|
||||
a->setObjectName("copy");
|
||||
Q_SHORTCUT(a, "Ctrl+C", "Edit");
|
||||
a->setEnabled(false);
|
||||
|
@ -552,7 +552,7 @@ void QEditor::init(bool actions) {
|
|||
|
||||
addAction(a, "&Edit", "Edit");
|
||||
|
||||
a = new QAction(QIcon(":/paste.png"), tr("&Paste"), this);
|
||||
a = new QAction(QIcon(":/qeditor/paste.png"), tr("&Paste"), this);
|
||||
a->setObjectName("paste");
|
||||
// aPaste->setEnabled(QApplication::clipboard()->text().count());
|
||||
Q_SHORTCUT(a, "Ctrl+V", "Edit");
|
||||
|
@ -567,14 +567,14 @@ void QEditor::init(bool actions) {
|
|||
sep->setSeparator(true);
|
||||
addAction(sep, "&Edit", "Edit");
|
||||
|
||||
a = new QAction(QIcon(":/indent.png"), tr("&Indent"), this);
|
||||
a = new QAction(tr("&Indent"), this);
|
||||
a->setObjectName("indent");
|
||||
Q_SHORTCUT(a, "Ctrl+I", "Edit");
|
||||
connect(a, SIGNAL(triggered()), this, SLOT(indentSelection()));
|
||||
|
||||
addAction(a, "&Edit", "Edit");
|
||||
|
||||
a = new QAction(QIcon(":/unindent.png"), tr("&Unindent"), this);
|
||||
a = new QAction(tr("&Unindent"), this);
|
||||
a->setObjectName("unindent");
|
||||
Q_SHORTCUT(a, "Ctrl+Shift+I", "Edit");
|
||||
connect(a, SIGNAL(triggered()), this, SLOT(unindentSelection()));
|
||||
|
@ -585,14 +585,14 @@ void QEditor::init(bool actions) {
|
|||
sep->setSeparator(true);
|
||||
addAction(sep, "&Edit", "");
|
||||
|
||||
a = new QAction(QIcon(":/comment.png"), tr("Co&mment"), this);
|
||||
a = new QAction(tr("Co&mment"), this);
|
||||
a->setObjectName("comment");
|
||||
Q_SHORTCUT(a, "Ctrl+D", "Edit");
|
||||
connect(a, SIGNAL(triggered()), this, SLOT(commentSelection()));
|
||||
|
||||
addAction(a, "&Edit", "Edit");
|
||||
|
||||
a = new QAction(QIcon(":/uncomment.png"), tr("Unc&omment"), this);
|
||||
a = new QAction(tr("Unc&omment"), this);
|
||||
a->setObjectName("uncomment");
|
||||
Q_SHORTCUT(a, "Ctrl+Shift+D", "Edit");
|
||||
connect(a, SIGNAL(triggered()), this, SLOT(uncommentSelection()));
|
||||
|
@ -614,21 +614,21 @@ void QEditor::init(bool actions) {
|
|||
sep->setSeparator(true);
|
||||
addAction(sep, QString());
|
||||
|
||||
a = new QAction(QIcon(":/find.png"), tr("&Find"), this);
|
||||
a = new QAction(QIcon(":/qeditor/find.png"), tr("&Find"), this);
|
||||
a->setObjectName("find");
|
||||
Q_SHORTCUT(a, "Ctrl+F", "Search");
|
||||
connect(a, SIGNAL(triggered()), this, SLOT(find()));
|
||||
|
||||
addAction(a, "&Search", "Search");
|
||||
|
||||
a = new QAction(QIcon(":/next.png"), tr("Fin&d next"), pMenu);
|
||||
a = new QAction(tr("Fin&d next"), pMenu);
|
||||
a->setObjectName("findNext");
|
||||
Q_SHORTCUT(a, "F3", "Search");
|
||||
connect(a, SIGNAL(triggered()), this, SLOT(findNext()));
|
||||
|
||||
addAction(a, "&Search", "Search");
|
||||
|
||||
a = new QAction(QIcon(":/replace.png"), tr("&Replace"), this);
|
||||
a = new QAction(QIcon(":/qeditor/replace.png"), tr("&Replace"), this);
|
||||
a->setObjectName("replace");
|
||||
Q_SHORTCUT(a, "Ctrl+R", "Search");
|
||||
connect(a, SIGNAL(triggered()), this, SLOT(replace()));
|
||||
|
@ -639,7 +639,7 @@ void QEditor::init(bool actions) {
|
|||
sep->setSeparator(true);
|
||||
addAction(sep, "&Search", "Search");
|
||||
|
||||
a = new QAction(QIcon(":/goto.png"), tr("&Goto line..."), this);
|
||||
a = new QAction(QIcon(":/qeditor/goto.png"), tr("&Goto line..."), this);
|
||||
a->setObjectName("goto");
|
||||
Q_SHORTCUT(a, "Ctrl+G", "Search");
|
||||
connect(a, SIGNAL(triggered()), this, SLOT(gotoLine()));
|
||||
|
|
|
@ -156,23 +156,12 @@ void QLineMarkPanel::mouseReleaseEvent(QMouseEvent *e) {
|
|||
}
|
||||
|
||||
// QMessageBox::warning(0, 0, "clik.");
|
||||
|
||||
QDocumentLine l;
|
||||
QLanguageDefinition *d = editor()->languageDefinition();
|
||||
const int id =
|
||||
QLineMarksInfoCenter::instance()->markTypeId(d->defaultLineMark());
|
||||
|
||||
if (id < 0)
|
||||
return;
|
||||
|
||||
e->accept();
|
||||
|
||||
for (int i = 0; i < m_rects.count(); ++i) {
|
||||
if (m_rects.at(i).contains(e->pos())) {
|
||||
l = editor()->document()->line(m_lines.at(i));
|
||||
l.toggleMark(id);
|
||||
// m->toggleDefaultMark(l, -1);
|
||||
|
||||
auto l = editor()->document()->line(m_lines.at(i));
|
||||
emit onToggleMark(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,6 +41,9 @@ public:
|
|||
|
||||
virtual QString type() const;
|
||||
|
||||
signals:
|
||||
void onToggleMark(int lineIndex);
|
||||
|
||||
protected:
|
||||
virtual bool paint(QPainter *p, QEditor *e);
|
||||
virtual void mousePressEvent(QMouseEvent *e);
|
||||
|
|
|
@ -45,6 +45,7 @@ set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
|
|||
option(QWINDOWKIT_BUILD_STATIC "Build static libraries" TRUE)
|
||||
option(QWINDOWKIT_INSTALL "Install library" OFF)
|
||||
set(ADS_VERSION 4.3.1)
|
||||
option(BUILD_EXAMPLES "Build the examples" FALSE)
|
||||
|
||||
add_subdirectory(3rdparty/qwindowkit)
|
||||
add_subdirectory(3rdparty/QHexView)
|
||||
|
@ -287,8 +288,6 @@ set(CODEEDIT_WIDGET
|
|||
src/qcodeeditwidget/qeditconfig.h
|
||||
src/qcodeeditwidget/qeditconfig.cpp
|
||||
src/qcodeeditwidget/qeditconfig.ui
|
||||
src/qcodeeditwidget/qstatuspanel.cpp
|
||||
src/qcodeeditwidget/qstatuspanel.h
|
||||
src/qcodeeditwidget/qformatconfig.h
|
||||
src/qcodeeditwidget/qformatconfig.cpp
|
||||
src/qcodeeditwidget/qformatconfig.ui)
|
||||
|
|
|
@ -1818,7 +1818,7 @@
|
|||
<location filename="../../3rdparty/qcodeedit2/lib/qcodecompletionengine.cpp" line="38"/>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qcodecompletionengine.cpp" line="57"/>
|
||||
<source>&Trigger completion</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>触发填充(&T)</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -1941,25 +1941,30 @@ Restart from the begining ?</source>
|
|||
<source>Preserve trailing indent</source>
|
||||
<translation>保留尾部缩进</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qcodeeditwidget/qeditconfig.cpp" line="193"/>
|
||||
<source>Edit</source>
|
||||
<translation>编辑</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QEditor</name>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qcodeedit.cpp" line="240"/>
|
||||
<source>Panels</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>面板</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qcodeedit.cpp" line="243"/>
|
||||
<source>&View</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>视图(&V)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="210"/>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="670"/>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="1129"/>
|
||||
<source>Default</source>
|
||||
<translation type="unfinished">默认</translation>
|
||||
<translation>默认</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="515"/>
|
||||
|
@ -1995,102 +2000,102 @@ Restart from the begining ?</source>
|
|||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="570"/>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="1109"/>
|
||||
<source>&Indent</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>缩进(&I)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="577"/>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="1110"/>
|
||||
<source>&Unindent</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>取消缩进(&U)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="588"/>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="1111"/>
|
||||
<source>Co&mment</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>批注(&M)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="595"/>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="1112"/>
|
||||
<source>Unc&omment</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>取消批注(&O)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="606"/>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="1114"/>
|
||||
<source>&Select all</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>全选(&S)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="617"/>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="1116"/>
|
||||
<source>&Find</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>查找(&F)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="624"/>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="1117"/>
|
||||
<source>Fin&d next</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>查找下一个(&D)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="631"/>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="1118"/>
|
||||
<source>&Replace</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>替换(&R)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="642"/>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="1120"/>
|
||||
<source>&Goto line...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>跳转到行(&G)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="653"/>
|
||||
<source>Dynamic line wrapping</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>自动换行</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="663"/>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="1126"/>
|
||||
<source>Input binding</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>输入绑定</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="688"/>
|
||||
<source>Line endings</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>行尾</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="695"/>
|
||||
<source>Conservative</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>老式</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="697"/>
|
||||
<source>Local</source>
|
||||
<translation type="unfinished">本地</translation>
|
||||
<translation>本地</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="698"/>
|
||||
<source>Unix/Linux</source>
|
||||
<translation type="unfinished">Unix/Linux</translation>
|
||||
<translation>Unix/Linux</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="699"/>
|
||||
<source>Dos/Windows</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Dos/Windows</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="700"/>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="1295"/>
|
||||
<source>Old Mac</source>
|
||||
<translation type="unfinished">老版 Mac</translation>
|
||||
<translation>老版 Mac</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="839"/>
|
||||
<source>Conflict!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>冲突!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="840"/>
|
||||
|
@ -2100,12 +2105,16 @@ Press "Save" to overwrite the file on disk
|
|||
Press "Reset"to be reload the file from disk.
|
||||
Press "Discard" to ignore this warning.
|
||||
</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>%1
|
||||
已被另一个应用程序修改。
|
||||
按“保存”覆盖磁盘上的文件
|
||||
按“重置”从磁盘重新加载文件。
|
||||
按“放弃”忽略此警告。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="977"/>
|
||||
<source>File changed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>文件被修改</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="978"/>
|
||||
|
@ -2114,37 +2123,41 @@ has been modified by another application.
|
|||
|
||||
Undo/Redo stack would be discarded by the auto-reload.
|
||||
Do you wish to keep up to date by reloading the file?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>%1
|
||||
已被另一个应用程序修改。
|
||||
|
||||
撤消/重做堆栈将被自动重新加载丢弃。
|
||||
您是否希望通过重新加载文件来保持最新状态?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="1132"/>
|
||||
<source>&Edit</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>编辑(&E)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="1133"/>
|
||||
<source>&Search</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>查找(&S)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="1135"/>
|
||||
<source>Edit</source>
|
||||
<translation type="unfinished">编辑</translation>
|
||||
<translation>编辑</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="1136"/>
|
||||
<source>Search</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>查找</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="1293"/>
|
||||
<source>Windows</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>窗口</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="1297"/>
|
||||
<source>Unix</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Unix</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../3rdparty/qcodeedit2/lib/qeditor.cpp" line="3262"/>
|
||||
|
@ -2180,59 +2193,64 @@ Do you wish to keep up to date by reloading the file?</source>
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="266"/>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="104"/>
|
||||
<source>Format</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="268"/>
|
||||
<source>Bold</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="272"/>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="274"/>
|
||||
<source>Italic</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="278"/>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="280"/>
|
||||
<source>Underline</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="284"/>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="286"/>
|
||||
<source>Overline</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="290"/>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="292"/>
|
||||
<source>Strikeout</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="297"/>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="299"/>
|
||||
<source>Wave underline</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="303"/>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="305"/>
|
||||
<source>Text color (aka foreground)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="308"/>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="310"/>
|
||||
<source>Background color</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="314"/>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="316"/>
|
||||
<source>Lines color (used by all lines formatting : underline, overline, ...)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="426"/>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="446"/>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="428"/>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="448"/>
|
||||
<source>Unsaved changes</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="427"/>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="447"/>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="429"/>
|
||||
<location filename="../../src/qcodeeditwidget/qformatconfig.cpp" line="449"/>
|
||||
<source>There are unsaved changes in this format scheme.
|
||||
Do you want them to be saved?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
|
@ -2452,29 +2470,6 @@ Do you want them to be saved?</source>
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QStatusPanel</name>
|
||||
<message>
|
||||
<location filename="../../src/qcodeeditwidget/qstatuspanel.cpp" line="100"/>
|
||||
<source>Line : %1 Visual column : %2 Text column : %3</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qcodeeditwidget/qstatuspanel.cpp" line="124"/>
|
||||
<source>OVERWRITE</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qcodeeditwidget/qstatuspanel.cpp" line="124"/>
|
||||
<source>INSERT</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/qcodeeditwidget/qstatuspanel.cpp" line="131"/>
|
||||
<source>Conflict</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RecentFileManager</name>
|
||||
<message>
|
||||
|
@ -4298,353 +4293,354 @@ Do you want them to be saved?</source>
|
|||
<context>
|
||||
<name>ScriptingDialog</name>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="89"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="91"/>
|
||||
<source>ScriptEditor</source>
|
||||
<translation>脚本编辑器</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="170"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="199"/>
|
||||
<source>File</source>
|
||||
<translation>文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="171"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="200"/>
|
||||
<source>Edit</source>
|
||||
<translation>编辑</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="173"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="202"/>
|
||||
<source>Debugger</source>
|
||||
<translation>调试器</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="174"/>
|
||||
<source>Setting</source>
|
||||
<translation>设置</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="175"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="206"/>
|
||||
<source>About</source>
|
||||
<translation>关于</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="188"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="219"/>
|
||||
<source>Basic</source>
|
||||
<translation>基础</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="189"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="220"/>
|
||||
<source>New</source>
|
||||
<translation>新建</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="192"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="223"/>
|
||||
<source>OpenF</source>
|
||||
<translation>打开文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="195"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="226"/>
|
||||
<source>RecentFiles</source>
|
||||
<translation>最近打开</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="199"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="230"/>
|
||||
<source>Reload</source>
|
||||
<translation>重新加载</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="204"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="206"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="235"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="237"/>
|
||||
<source>Save</source>
|
||||
<translation>保存</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="211"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="242"/>
|
||||
<source>SaveAs</source>
|
||||
<translation>另存为</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="223"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="254"/>
|
||||
<source>General</source>
|
||||
<translation>基本</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="225"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="256"/>
|
||||
<source>Undo</source>
|
||||
<translation>撤销</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="230"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="261"/>
|
||||
<source>Redo</source>
|
||||
<translation>恢复</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="236"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="267"/>
|
||||
<source>Cut</source>
|
||||
<translation>剪切</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="240"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="271"/>
|
||||
<source>Copy</source>
|
||||
<translation>复制</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="245"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="276"/>
|
||||
<source>Paste</source>
|
||||
<translation>粘贴</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="249"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="280"/>
|
||||
<source>Delete</source>
|
||||
<translation>删除</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="255"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="286"/>
|
||||
<source>Lookup</source>
|
||||
<translation>查询</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="256"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="287"/>
|
||||
<source>Find</source>
|
||||
<translation>查找</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="260"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="291"/>
|
||||
<source>Replace</source>
|
||||
<translation>替换</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="265"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="296"/>
|
||||
<source>Goto</source>
|
||||
<translation>跳转</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="277"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="308"/>
|
||||
<source>Display</source>
|
||||
<translation>显示</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="304"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="335"/>
|
||||
<source>Scale</source>
|
||||
<translation>缩放</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="306"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="337"/>
|
||||
<source>ResetScale</source>
|
||||
<translation>重置缩放</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="312"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="343"/>
|
||||
<source>Window</source>
|
||||
<translation>窗体</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="315"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="380"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="346"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="426"/>
|
||||
<source>Editor</source>
|
||||
<translation>编辑器</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="319"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="350"/>
|
||||
<source>Tools</source>
|
||||
<translation>工具</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="363"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="409"/>
|
||||
<source>BreakPoint</source>
|
||||
<translation>断点</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="365"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="411"/>
|
||||
<source>ToggleBreakPoint</source>
|
||||
<translation>切换断点</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="368"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="414"/>
|
||||
<source>AddBreakPoint</source>
|
||||
<translation>添加断点</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="378"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="424"/>
|
||||
<source>Settings</source>
|
||||
<translation>设置</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="414"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="460"/>
|
||||
<source>Local</source>
|
||||
<translation>本地</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="420"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="466"/>
|
||||
<source>Global</source>
|
||||
<translation>全局</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="423"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="469"/>
|
||||
<source>Variables</source>
|
||||
<translation>变量</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="436"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="482"/>
|
||||
<source>BreakPoints</source>
|
||||
<translation>断点</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="448"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="494"/>
|
||||
<source>ConsoleOutput</source>
|
||||
<translation>输出</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="462"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="508"/>
|
||||
<source>StackTrace</source>
|
||||
<translation>栈跟踪</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="476"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="522"/>
|
||||
<source>Watch</source>
|
||||
<translation>监视</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="560"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="743"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="787"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="823"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="838"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="863"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="606"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="812"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="920"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="956"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="971"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="996"/>
|
||||
<source>Error</source>
|
||||
<translation>错误</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="561"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="607"/>
|
||||
<source>Too much opened files</source>
|
||||
<translation>打开的文件过多,无法继续操作!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="766"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="802"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="899"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="935"/>
|
||||
<source>ChooseFile</source>
|
||||
<translation>选择文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="743"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="787"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="838"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="812"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="920"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="971"/>
|
||||
<source>FilePermission</source>
|
||||
<translation>因文件权限无法继续!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="821"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="954"/>
|
||||
<source>ReloadSuccessfully</source>
|
||||
<translation>文件重新加载成功!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="823"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="956"/>
|
||||
<source>ReloadUnSuccessfully</source>
|
||||
<translation>文件重新加载失败!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="850"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="983"/>
|
||||
<source>ChooseSaveFile</source>
|
||||
<translation>请选择保存文件路径:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="836"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="861"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="969"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="994"/>
|
||||
<source>SaveSuccessfully</source>
|
||||
<translation>保存成功!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="863"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="996"/>
|
||||
<source>SaveUnSuccessfully</source>
|
||||
<translation>保存失败!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1057"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1098"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1113"/>
|
||||
<source>CannotSave2RunScript</source>
|
||||
<translation>无法保存,故无法继续运行脚本。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="1233"/>
|
||||
<source>ScriptStillRunning</source>
|
||||
<translation>脚本仍在运行,你确定要退出吗?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="172"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="201"/>
|
||||
<source>View</source>
|
||||
<translation>视图</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="328"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="359"/>
|
||||
<source>Debug</source>
|
||||
<translation>调试</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="330"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="362"/>
|
||||
<source>Run</source>
|
||||
<translation>运行</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="334"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="367"/>
|
||||
<source>RunWithDbg</source>
|
||||
<translation>调试运行</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="337"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="373"/>
|
||||
<source>Pause</source>
|
||||
<translation>暂停</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="340"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="378"/>
|
||||
<source>Continue</source>
|
||||
<translation>继续</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="343"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="383"/>
|
||||
<source>Stop</source>
|
||||
<translation>停止</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="346"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="387"/>
|
||||
<source>Restart</source>
|
||||
<translation>重启</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="349"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="392"/>
|
||||
<source>StepInto</source>
|
||||
<translation>单步步入</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="352"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="397"/>
|
||||
<source>StepOver</source>
|
||||
<translation>单步步过</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="355"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="401"/>
|
||||
<source>StepOut</source>
|
||||
<translation>单步跳出</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="371"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="417"/>
|
||||
<source>RemoveBreakPoint</source>
|
||||
<translation>删除断点</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="387"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="433"/>
|
||||
<source>Info</source>
|
||||
<translation>信息</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="389"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="435"/>
|
||||
<source>Software</source>
|
||||
<translation>软件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="392"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="438"/>
|
||||
<source>Sponsor</source>
|
||||
<translation>赞助</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="395"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="441"/>
|
||||
<source>Wiki</source>
|
||||
<translation>网页 Wiki</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="398"/>
|
||||
<location filename="../../src/dialog/scriptingdialog.cpp" line="444"/>
|
||||
<source>AboutQT</source>
|
||||
<translation>关于 QT</translation>
|
||||
</message>
|
||||
|
@ -4924,29 +4920,29 @@ Do you want them to be saved?</source>
|
|||
<message>
|
||||
<location filename="../../src/class/asbuilder.cpp" line="139"/>
|
||||
<source>Failed to open script file </source>
|
||||
<translation>带卡脚本文件失败</translation>
|
||||
<translation>打开脚本文件失败</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/class/asbuilder.cpp" line="405"/>
|
||||
<location filename="../../src/class/asbuilder.cpp" line="455"/>
|
||||
<source>Invalid file name for #include; it contains a line-break: </source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>#include 的文件名无效;它包含换行符:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/class/asbuilder.cpp" line="472"/>
|
||||
<source>Invalid file name for #include; it contains a line-break or unpaired symbol</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>#include 的文件名无效;它包含换行符或不成对的符号</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/class/asbuilder.cpp" line="499"/>
|
||||
<source>Invalid #pragma directive</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>#pragma 指令无效</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>asDebugger</name>
|
||||
<message>
|
||||
<location filename="../../src/class/asdebugger.cpp" line="397"/>
|
||||
<location filename="../../src/class/asdebugger.cpp" line="413"/>
|
||||
<source>{no engine}</source>
|
||||
<translation>{无引擎}</translation>
|
||||
</message>
|
||||
|
|
|
@ -110,4 +110,15 @@
|
|||
<file alias="as_light.qxf">src/qxs/as_light.qxf</file>
|
||||
<file alias="marks.qxm">src/qxs/marks.qxm</file>
|
||||
</qresource>
|
||||
<qresource prefix="/qeditor">
|
||||
<file alias="copy.png">images/copy.png</file>
|
||||
<file alias="cut.png">images/cut.png</file>
|
||||
<file alias="find.png">images/find.png</file>
|
||||
<file alias="paste.png">images/paste.png</file>
|
||||
<file alias="redo.png">images/redo.png</file>
|
||||
<file alias="replace.png">images/replace.png</file>
|
||||
<file alias="undo.png">images/undo.png</file>
|
||||
<file alias="goto.png">images/goto.png</file>
|
||||
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
@ -21,10 +21,6 @@ void asDebugger::registerToStringCallback(const asITypeInfo *ti,
|
|||
m_toStringCallbacks.insert(ti, callback);
|
||||
}
|
||||
|
||||
void asDebugger::registerBreakPointHitCallback(BreakPointHitCallback callback) {
|
||||
m_bphitCallback = callback;
|
||||
}
|
||||
|
||||
void asDebugger::takeCommands(asIScriptContext *ctx) {
|
||||
emit onPullVariables(globalVariables(ctx), localVariables(ctx));
|
||||
emit onPullCallStack(retriveCallstack(ctx));
|
||||
|
@ -38,11 +34,14 @@ void asDebugger::takeCommands(asIScriptContext *ctx) {
|
|||
ctx->Abort();
|
||||
return;
|
||||
case PAUSE:
|
||||
Q_ASSERT(false);
|
||||
break;
|
||||
case STEP_OVER:
|
||||
case STEP_OUT:
|
||||
m_lastCommandAtStackLevel = ctx ? ctx->GetCallstackSize() : 1;
|
||||
break;
|
||||
case STEP_OUT:
|
||||
m_lastCommandAtStackLevel = ctx ? ctx->GetCallstackSize() : 0;
|
||||
break;
|
||||
case CONTINUE:
|
||||
case STEP_INTO:
|
||||
break;
|
||||
|
@ -56,6 +55,25 @@ void asDebugger::lineCallback(asIScriptContext *ctx) {
|
|||
if (ctx == nullptr)
|
||||
return;
|
||||
|
||||
const char *file = 0;
|
||||
int lineNbr = ctx->GetLineNumber(0, nullptr, &file);
|
||||
|
||||
// why?
|
||||
// LineCallBack will be called each only a sentence,
|
||||
// just like a bytecode level debugger
|
||||
// for(auto i = 0; i < 5 ; i++) this line will break twice at first
|
||||
if (ctx->GetUserData() == nullptr) {
|
||||
auto dbgContext = new ContextDbgInfo;
|
||||
ctx->SetUserData(dbgContext);
|
||||
} else {
|
||||
auto dbgContext =
|
||||
reinterpret_cast<ContextDbgInfo *>(ctx->GetUserData());
|
||||
if (dbgContext->line == lineNbr && dbgContext->file == file &&
|
||||
dbgContext->stackCount == ctx->GetCallstackSize()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// By default we ignore callbacks when the context is not active.
|
||||
// An application might override this to for example disconnect the
|
||||
// debugger as the execution finished.
|
||||
|
@ -64,18 +82,14 @@ void asDebugger::lineCallback(asIScriptContext *ctx) {
|
|||
|
||||
switch (m_action) {
|
||||
case ABORT:
|
||||
ctx->Abort();
|
||||
return;
|
||||
case PAUSE:
|
||||
break;
|
||||
return;
|
||||
case CONTINUE:
|
||||
if (!checkBreakPoint(ctx))
|
||||
return;
|
||||
break;
|
||||
case STEP_INTO:
|
||||
// Always break, but we call the check break point anyway
|
||||
// to tell user when break point has been reached
|
||||
checkBreakPoint(ctx);
|
||||
m_action = PAUSE;
|
||||
break;
|
||||
case STEP_OVER:
|
||||
|
@ -89,8 +103,12 @@ void asDebugger::lineCallback(asIScriptContext *ctx) {
|
|||
break;
|
||||
}
|
||||
|
||||
const char *file = 0;
|
||||
int lineNbr = ctx->GetLineNumber(0, nullptr, &file);
|
||||
auto dbgContext = reinterpret_cast<ContextDbgInfo *>(ctx->GetUserData());
|
||||
Q_ASSERT(dbgContext);
|
||||
dbgContext->file = file;
|
||||
dbgContext->line = lineNbr;
|
||||
dbgContext->stackCount = ctx->GetCallstackSize();
|
||||
|
||||
emit onRunCurrentLine(file, lineNbr);
|
||||
|
||||
takeCommands(ctx);
|
||||
|
@ -213,7 +231,7 @@ void asDebugger::listMemberProperties(asIScriptContext *ctx) {
|
|||
}
|
||||
|
||||
bool asDebugger::checkBreakPoint(asIScriptContext *ctx) {
|
||||
if (ctx == 0)
|
||||
if (ctx == nullptr)
|
||||
return false;
|
||||
|
||||
const char *tmp = 0;
|
||||
|
@ -272,8 +290,6 @@ bool asDebugger::checkBreakPoint(asIScriptContext *ctx) {
|
|||
#else
|
||||
bpName == file) {
|
||||
#endif
|
||||
ctx->Suspend();
|
||||
m_bphitCallback(m_breakPoints[n], this);
|
||||
m_action = PAUSE; // hit and pause script
|
||||
return true;
|
||||
}
|
||||
|
@ -414,6 +430,8 @@ asDebugger::GCStatistic asDebugger::gcStatistics() {
|
|||
|
||||
void asDebugger::runDebugAction(DebugAction action) { m_action = action; }
|
||||
|
||||
asDebugger::DebugAction asDebugger::currentState() const { return m_action; }
|
||||
|
||||
void asDebugger::setEngine(asIScriptEngine *engine) {
|
||||
if (m_engine != engine) {
|
||||
if (m_engine)
|
||||
|
|
|
@ -78,10 +78,6 @@ public:
|
|||
void registerToStringCallback(const asITypeInfo *ti,
|
||||
ToStringCallback callback);
|
||||
|
||||
typedef void (*BreakPointHitCallback)(const BreakPoint &bp,
|
||||
asDebugger *dbg);
|
||||
void registerBreakPointHitCallback(BreakPointHitCallback callback);
|
||||
|
||||
// Commands
|
||||
void addFileBreakPoint(const QString &file, int lineNbr);
|
||||
void removeFileBreakPoint(const QString &file, int lineNbr);
|
||||
|
@ -108,6 +104,8 @@ public:
|
|||
|
||||
void runDebugAction(DebugAction action);
|
||||
|
||||
DebugAction currentState() const;
|
||||
|
||||
private:
|
||||
QVector<VariablesInfo> globalVariables(asIScriptContext *ctx);
|
||||
QVector<VariablesInfo> localVariables(asIScriptContext *ctx);
|
||||
|
@ -131,6 +129,13 @@ signals:
|
|||
void onPullCallStack(const QList<CallStackItem> &callstacks);
|
||||
void onRunCurrentLine(const QString &file, int lineNr);
|
||||
|
||||
private:
|
||||
struct ContextDbgInfo {
|
||||
QString file;
|
||||
int line = -1;
|
||||
int stackCount = -1;
|
||||
};
|
||||
|
||||
private:
|
||||
std::atomic<DebugAction> m_action;
|
||||
|
||||
|
@ -143,7 +148,6 @@ private:
|
|||
|
||||
// Registered callbacks for converting types to strings
|
||||
QMap<const asITypeInfo *, ToStringCallback> m_toStringCallbacks;
|
||||
BreakPointHitCallback m_bphitCallback;
|
||||
|
||||
QStringList m_watchVars;
|
||||
|
||||
|
|
|
@ -31,12 +31,16 @@ ScriptEditor::ScriptEditor(QWidget *parent)
|
|||
|
||||
auto lineMark = new QLineMarkPanel(editor);
|
||||
m_editor->addPanel(lineMark, QCodeEdit::West, true);
|
||||
connect(lineMark, &QLineMarkPanel::onToggleMark, this,
|
||||
&ScriptEditor::onToggleMark);
|
||||
|
||||
auto lineNum = new QLineNumberPanel(editor);
|
||||
lineNum->setVerboseMode(true);
|
||||
m_editor->addPanel(lineNum, QCodeEdit::West, true);
|
||||
|
||||
m_editor->addPanel(QStringLiteral("Fold Panel"), QCodeEdit::West, true);
|
||||
m_editor->addPanel(QStringLiteral("Line Change Panel"), QCodeEdit::West,
|
||||
true);
|
||||
m_editor->addPanel(QStringLiteral("Goto Line Panel"), QCodeEdit::South,
|
||||
true);
|
||||
m_editor->addPanel(QStringLiteral("Search Replace Panel"), QCodeEdit::South,
|
||||
|
|
|
@ -15,6 +15,9 @@ public:
|
|||
|
||||
QEditor *editor() const;
|
||||
|
||||
signals:
|
||||
void onToggleMark(int lineIndex);
|
||||
|
||||
public slots:
|
||||
bool openFile(const QString &filename);
|
||||
|
||||
|
|
|
@ -57,6 +57,8 @@ ScriptingDialog::ScriptingDialog(QWidget *parent)
|
|||
layout->addWidget(m_status);
|
||||
buildUpContent(cw);
|
||||
|
||||
buildUpSettingDialog();
|
||||
|
||||
QFormatScheme *format = nullptr;
|
||||
|
||||
switch (SkinManager::instance().currentTheme()) {
|
||||
|
@ -98,7 +100,9 @@ void ScriptingDialog::initConsole() {
|
|||
m_consoleout->init();
|
||||
auto machine = m_consoleout->machine();
|
||||
connect(machine, &ScriptMachine::onDebugFinished, this, [=] {
|
||||
this->setRunDebugMode(false);
|
||||
_DebugingScript.clear();
|
||||
|
||||
this->updateRunDebugMode();
|
||||
m_callstack->updateData({});
|
||||
|
||||
// clean up
|
||||
|
@ -106,23 +110,28 @@ void ScriptingDialog::initConsole() {
|
|||
// no need
|
||||
return;
|
||||
}
|
||||
QLineMark mrk(_lastCurLine.first, _lastCurLine.second,
|
||||
m_symID.value(Symbols::DbgRunCurrentLine));
|
||||
QLineMarksInfoCenter::instance()->removeLineMark(mrk);
|
||||
|
||||
auto bpMark = m_symID.value(Symbols::BreakPoint);
|
||||
auto curMark = m_symID.value(Symbols::DbgRunCurrentLine);
|
||||
auto curHitMark = m_symID.value(Symbols::DbgRunHitBreakPoint);
|
||||
|
||||
// remove the last mark
|
||||
if (!_lastCurLine.first.isEmpty() && _lastCurLine.second >= 0) {
|
||||
auto lastCur = QCodeEdit::managed(_lastCurLine.first);
|
||||
auto doc = lastCur->document();
|
||||
auto line = doc->line(_lastCurLine.second - 1);
|
||||
if (line.hasMark(curMark)) {
|
||||
line.removeMark(curMark);
|
||||
} else if (line.hasMark(curHitMark)) {
|
||||
line.removeMark(curHitMark);
|
||||
line.addMark(bpMark);
|
||||
}
|
||||
}
|
||||
_lastCurLine.first.clear();
|
||||
_lastCurLine.second = -1;
|
||||
});
|
||||
auto dbg = machine->debugger();
|
||||
Q_ASSERT(dbg);
|
||||
dbg->setProperty("scriptdlg", QVariant::fromValue(this));
|
||||
dbg->registerBreakPointHitCallback(
|
||||
[](const asDebugger::BreakPoint &bp, asDebugger *dbg) {
|
||||
auto p = dbg->property("scriptdlg");
|
||||
if (p.isValid()) {
|
||||
auto dlg = p.value<ScriptingDialog *>();
|
||||
QMessageBox::information(dlg, "", "Hint");
|
||||
}
|
||||
});
|
||||
connect(dbg, &asDebugger::onAdjustBreakPointLine, this,
|
||||
[=](const asDebugger::BreakPoint &old, int newLineNr) {
|
||||
|
||||
|
@ -152,16 +161,36 @@ void ScriptingDialog::initConsole() {
|
|||
}
|
||||
}
|
||||
|
||||
// remove the last mark
|
||||
QLineMark mrk(_lastCurLine.first, _lastCurLine.second,
|
||||
m_symID.value(Symbols::DbgRunCurrentLine));
|
||||
QLineMarksInfoCenter::instance()->removeLineMark(mrk);
|
||||
|
||||
auto doc = e->editor()->document();
|
||||
auto bpMark = m_symID.value(Symbols::BreakPoint);
|
||||
auto curMark = m_symID.value(Symbols::DbgRunCurrentLine);
|
||||
auto curHitMark = m_symID.value(Symbols::DbgRunHitBreakPoint);
|
||||
|
||||
// remove the last mark
|
||||
if (!_lastCurLine.first.isEmpty() && _lastCurLine.second >= 0) {
|
||||
auto lastCur = QCodeEdit::managed(_lastCurLine.first);
|
||||
auto doc = lastCur->document();
|
||||
auto line = doc->line(_lastCurLine.second - 1);
|
||||
if (line.hasMark(curMark)) {
|
||||
line.removeMark(curMark);
|
||||
} else if (line.hasMark(curHitMark)) {
|
||||
line.removeMark(curHitMark);
|
||||
line.addMark(bpMark);
|
||||
}
|
||||
}
|
||||
|
||||
// add the new mark
|
||||
auto doc = e->editor()->document();
|
||||
auto line = doc->line(lineNr - 1);
|
||||
line.addMark(curMark);
|
||||
if (line.hasMark(bpMark)) {
|
||||
line.removeMark(bpMark);
|
||||
line.addMark(curHitMark);
|
||||
} else {
|
||||
line.addMark(curMark);
|
||||
}
|
||||
|
||||
_lastCurLine = {file, lineNr};
|
||||
|
||||
updateRunDebugMode();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -171,7 +200,9 @@ void ScriptingDialog::buildUpRibbonBar() {
|
|||
m_editStateWidgets << buildEditPage(m_ribbon->addTab(tr("Edit")));
|
||||
buildViewPage(m_ribbon->addTab(tr("View")));
|
||||
m_editStateWidgets << buildDebugPage(m_ribbon->addTab(tr("Debugger")));
|
||||
buildSettingPage(m_ribbon->addTab(tr("Setting")));
|
||||
|
||||
// TODO: not available for v1.0.0
|
||||
// buildSettingPage(m_ribbon->addTab(tr("Setting")));
|
||||
buildAboutPage(m_ribbon->addTab(tr("About")));
|
||||
|
||||
connect(m_ribbon, &Ribbon::onDragDropFiles, this,
|
||||
|
@ -326,35 +357,50 @@ RibbonTabContent *ScriptingDialog::buildViewPage(RibbonTabContent *tab) {
|
|||
RibbonTabContent *ScriptingDialog::buildDebugPage(RibbonTabContent *tab) {
|
||||
{
|
||||
auto pannel = tab->addGroup(tr("Debug"));
|
||||
m_Tbtneditors[ToolButtonIndex::DBG_RUN] =
|
||||
m_Tbtneditors.insert(
|
||||
ToolButtonIndex::DBG_RUN_ACTION,
|
||||
addPannelAction(pannel, QStringLiteral("dbgrun"), tr("Run"),
|
||||
&ScriptingDialog::on_runscript,
|
||||
QKeySequence(Qt::CTRL | Qt::Key_F5));
|
||||
m_Tbtneditors[ToolButtonIndex::DBG_RUN_DBG] = addPannelAction(
|
||||
pannel, QStringLiteral("dbgdebug"), tr("RunWithDbg"),
|
||||
&ScriptingDialog::on_rundbgscript, QKeySequence(Qt::Key_F5));
|
||||
m_dbgStateWidgets << addPannelAction(pannel, QStringLiteral("dbgpause"),
|
||||
QKeySequence(Qt::CTRL | Qt::Key_F5)));
|
||||
m_Tbtneditors.insert(ToolButtonIndex::DBG_RUN_DBG_ACTION,
|
||||
addPannelAction(pannel, QStringLiteral("dbgdebug"),
|
||||
tr("RunWithDbg"),
|
||||
&ScriptingDialog::on_rundbgscript,
|
||||
QKeySequence(Qt::Key_F5)));
|
||||
|
||||
m_Tbtneditors.insert(ToolButtonIndex::DBG_PAUSE_ACTION,
|
||||
addPannelAction(pannel, QStringLiteral("dbgpause"),
|
||||
tr("Pause"),
|
||||
&ScriptingDialog::on_pausescript);
|
||||
m_dbgStateWidgets << addPannelAction(
|
||||
pannel, QStringLiteral("dbgcontinue"), tr("Continue"),
|
||||
&ScriptingDialog::on_continuescript);
|
||||
m_dbgStateWidgets << addPannelAction(pannel, QStringLiteral("dbgstop"),
|
||||
&ScriptingDialog::on_pausescript));
|
||||
m_Tbtneditors.insert(
|
||||
ToolButtonIndex::DBG_CONTINUE_ACTION,
|
||||
addPannelAction(pannel, QStringLiteral("dbgcontinue"),
|
||||
tr("Continue"),
|
||||
&ScriptingDialog::on_continuescript));
|
||||
|
||||
m_Tbtneditors.insert(ToolButtonIndex::DBG_STOP_ACTION,
|
||||
addPannelAction(pannel, QStringLiteral("dbgstop"),
|
||||
tr("Stop"),
|
||||
&ScriptingDialog::on_stopscript);
|
||||
m_dbgStateWidgets << addPannelAction(
|
||||
pannel, QStringLiteral("dbgrestart"), tr("Restart"),
|
||||
&ScriptingDialog::on_restartscript);
|
||||
m_dbgStateWidgets << addPannelAction(
|
||||
pannel, QStringLiteral("dbgstepinto"), tr("StepInto"),
|
||||
&ScriptingDialog::on_stepinscript, QKeySequence(Qt::Key_F11));
|
||||
m_dbgStateWidgets << addPannelAction(
|
||||
pannel, QStringLiteral("dbgstepover"), tr("StepOver"),
|
||||
&ScriptingDialog::on_stepoverscript, QKeySequence(Qt::Key_F10));
|
||||
m_dbgStateWidgets << addPannelAction(
|
||||
pannel, QStringLiteral("dbgstepout"), tr("StepOut"),
|
||||
&ScriptingDialog::on_stepoutscript,
|
||||
QKeySequence(Qt::SHIFT | Qt::Key_F11));
|
||||
&ScriptingDialog::on_stopscript));
|
||||
m_Tbtneditors.insert(
|
||||
ToolButtonIndex::DBG_RESTART_ACTION,
|
||||
addPannelAction(pannel, QStringLiteral("dbgrestart"), tr("Restart"),
|
||||
&ScriptingDialog::on_restartscript));
|
||||
m_Tbtneditors.insert(
|
||||
ToolButtonIndex::DBG_STEPINTO_ACTION,
|
||||
addPannelAction(pannel, QStringLiteral("dbgstepinto"),
|
||||
tr("StepInto"), &ScriptingDialog::on_stepinscript,
|
||||
QKeySequence(Qt::Key_F11)));
|
||||
m_Tbtneditors.insert(
|
||||
ToolButtonIndex::DBG_STEPOVER_ACTION,
|
||||
addPannelAction(pannel, QStringLiteral("dbgstepover"),
|
||||
tr("StepOver"), &ScriptingDialog::on_stepoverscript,
|
||||
QKeySequence(Qt::Key_F10)));
|
||||
m_Tbtneditors.insert(
|
||||
ToolButtonIndex::DBG_STEPOUT_ACTION,
|
||||
addPannelAction(pannel, QStringLiteral("dbgstepout"), tr("StepOut"),
|
||||
&ScriptingDialog::on_stepoutscript,
|
||||
QKeySequence(Qt::SHIFT | Qt::Key_F11)));
|
||||
|
||||
m_editStateWidgets << pannel;
|
||||
}
|
||||
|
@ -590,7 +636,7 @@ void ScriptingDialog::registerEditorView(ScriptEditor *editor) {
|
|||
|
||||
auto m = m_consoleout->machine();
|
||||
if (m->isInDebugMode()) {
|
||||
auto dbg = m->debugger();
|
||||
// TODO
|
||||
}
|
||||
|
||||
m_views.removeOne(editor);
|
||||
|
@ -637,12 +683,7 @@ void ScriptingDialog::updateEditModeEnabled() {
|
|||
item->setEnabled(b);
|
||||
}
|
||||
|
||||
auto runner = m_consoleout->machine();
|
||||
if (runner) {
|
||||
setRunDebugMode(runner->isRunning(), runner->isInDebugMode());
|
||||
} else {
|
||||
setRunDebugMode(false);
|
||||
}
|
||||
updateRunDebugMode();
|
||||
}
|
||||
|
||||
ScriptEditor *ScriptingDialog::currentEditor() const { return m_curEditor; }
|
||||
|
@ -653,6 +694,7 @@ void ScriptingDialog::swapEditor(ScriptEditor *old, ScriptEditor *cur) {
|
|||
}
|
||||
|
||||
if (old != nullptr) {
|
||||
old->disconnect(SLOT(onToggleMark(int)));
|
||||
auto editor = old->editor();
|
||||
editor->disconnect(SLOT(copyAvailable(bool)));
|
||||
editor->disconnect(SLOT(contentModified(bool)));
|
||||
|
@ -672,6 +714,11 @@ void ScriptingDialog::swapEditor(ScriptEditor *old, ScriptEditor *cur) {
|
|||
m_Tbtneditors.value(ToolButtonIndex::COPY_ACTION)
|
||||
->setEnabled(editor->cursor().hasSelection());
|
||||
|
||||
connect(cur, &ScriptEditor::onToggleMark, this, [=](int lineIndex) {
|
||||
auto editor = qobject_cast<ScriptEditor *>(sender());
|
||||
Q_ASSERT(editor);
|
||||
toggleBreakPoint(editor, lineIndex);
|
||||
});
|
||||
connect(editor, &QEditor::copyAvailable,
|
||||
m_Tbtneditors.value(ToolButtonIndex::COPY_ACTION),
|
||||
&QToolButton::setEnabled);
|
||||
|
@ -695,12 +742,34 @@ void ScriptingDialog::swapEditor(ScriptEditor *old, ScriptEditor *cur) {
|
|||
m_curEditor = cur;
|
||||
}
|
||||
|
||||
void ScriptingDialog::setRunDebugMode(bool isRun, bool isDebug) {
|
||||
m_Tbtneditors.value(ToolButtonIndex::DBG_RUN)->setEnabled(!isRun);
|
||||
m_Tbtneditors.value(ToolButtonIndex::DBG_RUN_DBG)->setEnabled(!isRun);
|
||||
for (auto &w : m_dbgStateWidgets) {
|
||||
w->setEnabled(isRun && isDebug);
|
||||
void ScriptingDialog::updateRunDebugMode() {
|
||||
auto runner = m_consoleout->machine();
|
||||
bool isRun = false;
|
||||
bool isDbg = false;
|
||||
bool isPaused = false;
|
||||
if (runner) {
|
||||
isRun = runner->isRunning();
|
||||
isDbg = runner->isInDebugMode();
|
||||
auto dbg = runner->debugger();
|
||||
isPaused = dbg->currentState() == asDebugger::PAUSE;
|
||||
}
|
||||
m_Tbtneditors.value(ToolButtonIndex::DBG_RUN_ACTION)->setEnabled(!isRun);
|
||||
m_Tbtneditors.value(ToolButtonIndex::DBG_RUN_DBG_ACTION)
|
||||
->setEnabled(!isRun);
|
||||
m_Tbtneditors.value(ToolButtonIndex::DBG_RESTART_ACTION)
|
||||
->setEnabled(isRun && isDbg);
|
||||
m_Tbtneditors.value(ToolButtonIndex::DBG_STOP_ACTION)->setEnabled(isRun);
|
||||
m_Tbtneditors.value(ToolButtonIndex::DBG_PAUSE_ACTION)
|
||||
->setEnabled(isRun && isDbg && !isPaused);
|
||||
|
||||
auto dbgop = isRun && isDbg && isPaused;
|
||||
m_Tbtneditors.value(ToolButtonIndex::DBG_CONTINUE_ACTION)
|
||||
->setEnabled(dbgop);
|
||||
m_Tbtneditors.value(ToolButtonIndex::DBG_STEPINTO_ACTION)
|
||||
->setEnabled(dbgop);
|
||||
m_Tbtneditors.value(ToolButtonIndex::DBG_STEPOVER_ACTION)
|
||||
->setEnabled(dbgop);
|
||||
m_Tbtneditors.value(ToolButtonIndex::DBG_STEPOUT_ACTION)->setEnabled(dbgop);
|
||||
}
|
||||
|
||||
ScriptEditor *ScriptingDialog::findEditorView(const QString &filename) {
|
||||
|
@ -758,6 +827,70 @@ void ScriptingDialog::runDbgCommand(asDebugger::DebugAction action) {
|
|||
}
|
||||
}
|
||||
|
||||
void ScriptingDialog::buildUpSettingDialog() {
|
||||
m_setdialog = new SettingDialog(this);
|
||||
|
||||
auto edit = new QEditConfig(m_setdialog);
|
||||
m_setdialog->addPage(edit);
|
||||
|
||||
m_setdialog->build();
|
||||
}
|
||||
|
||||
void ScriptingDialog::startDebugScript(const QString &fileName) {
|
||||
m_consoleout->clear();
|
||||
|
||||
// add breakpoints
|
||||
auto marks = QLineMarksInfoCenter::instance()->marks(
|
||||
fileName, m_symID.value(Symbols::BreakPoint));
|
||||
auto dbg = m_consoleout->machine()->debugger();
|
||||
for (auto &bp : marks) {
|
||||
dbg->addFileBreakPoint(bp.file, bp.line);
|
||||
}
|
||||
m_consoleout->machine()->executeScript(fileName, true);
|
||||
updateRunDebugMode();
|
||||
}
|
||||
|
||||
void ScriptingDialog::toggleBreakPoint(ScriptEditor *editor, int lineIndex) {
|
||||
Q_ASSERT(editor);
|
||||
auto curLine = lineIndex + 1;
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
if (m_consoleout->machine()->isInDebugMode() &&
|
||||
editor->fileName().compare(_lastCurLine.first, Qt::CaseInsensitive) == 0
|
||||
#else
|
||||
if (editor->fileName() == _lastCurLine.first
|
||||
#endif
|
||||
&& _lastCurLine.second == curLine) {
|
||||
auto line = editor->editor()->document()->line(lineIndex);
|
||||
auto bpMark = m_symID.value(Symbols::BreakPoint);
|
||||
auto hitCur = m_symID.value(Symbols::DbgRunHitBreakPoint);
|
||||
auto curSym = m_symID.value(Symbols::DbgRunCurrentLine);
|
||||
|
||||
auto dbg = m_consoleout->machine()->debugger();
|
||||
if (line.hasMark(hitCur)) {
|
||||
line.removeMark(hitCur);
|
||||
line.addMark(curSym);
|
||||
dbg->removeFileBreakPoint(editor->fileName(), curLine);
|
||||
} else if (line.hasMark(curSym)) {
|
||||
line.removeMark(curSym);
|
||||
line.addMark(hitCur);
|
||||
dbg->addFileBreakPoint(editor->fileName(), curLine);
|
||||
} else {
|
||||
if (line.hasMark(bpMark)) {
|
||||
line.removeMark(bpMark);
|
||||
dbg->removeFileBreakPoint(editor->fileName(), curLine);
|
||||
} else {
|
||||
line.addMark(bpMark);
|
||||
dbg->addFileBreakPoint(editor->fileName(), curLine);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
QLineMark mrk(editor->fileName(), curLine,
|
||||
m_symID.value(Symbols::BreakPoint));
|
||||
QLineMarksInfoCenter::instance()->toggleLineMark(mrk);
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptingDialog::on_newfile() {
|
||||
if (!newOpenFileSafeCheck()) {
|
||||
return;
|
||||
|
@ -927,11 +1060,7 @@ void ScriptingDialog::on_gotoline() {
|
|||
}
|
||||
}
|
||||
|
||||
void ScriptingDialog::on_setting() {
|
||||
// TODO
|
||||
QEditConfig cfg;
|
||||
cfg.show();
|
||||
}
|
||||
void ScriptingDialog::on_setting() { m_setdialog->showConfig(); }
|
||||
|
||||
void ScriptingDialog::on_about() { AboutSoftwareDialog().exec(); }
|
||||
|
||||
|
@ -964,12 +1093,14 @@ void ScriptingDialog::on_runscript() {
|
|||
auto editor = currentEditor();
|
||||
if (editor) {
|
||||
auto e = editor->editor();
|
||||
m_consoleout->clear();
|
||||
setRunDebugMode(true, false);
|
||||
if (!m_consoleout->machine()->executeScript(e->fileName())) {
|
||||
setRunDebugMode(false);
|
||||
if (!e->save()) {
|
||||
WingMessageBox::critical(this, qAppName(),
|
||||
tr("CannotSave2RunScript"));
|
||||
return;
|
||||
}
|
||||
setRunDebugMode(false);
|
||||
m_consoleout->clear();
|
||||
m_consoleout->machine()->executeScript(e->fileName());
|
||||
updateRunDebugMode();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -977,20 +1108,12 @@ void ScriptingDialog::on_rundbgscript() {
|
|||
auto editor = currentEditor();
|
||||
if (editor) {
|
||||
auto e = editor->editor();
|
||||
m_consoleout->clear();
|
||||
setRunDebugMode(true, true);
|
||||
|
||||
// add breakpoints
|
||||
auto marks = QLineMarksInfoCenter::instance()->marks(
|
||||
e->fileName(), m_symID.value(Symbols::BreakPoint));
|
||||
auto dbg = m_consoleout->machine()->debugger();
|
||||
for (auto &bp : marks) {
|
||||
dbg->addFileBreakPoint(bp.file, bp.line);
|
||||
}
|
||||
|
||||
if (!m_consoleout->machine()->executeScript(e->fileName(), true)) {
|
||||
setRunDebugMode(false);
|
||||
if (!e->save()) {
|
||||
WingMessageBox::critical(this, qAppName(),
|
||||
tr("CannotSave2RunScript"));
|
||||
return;
|
||||
}
|
||||
startDebugScript(e->fileName());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1002,7 +1125,10 @@ void ScriptingDialog::on_continuescript() {
|
|||
|
||||
void ScriptingDialog::on_stopscript() { runDbgCommand(asDebugger::ABORT); }
|
||||
|
||||
void ScriptingDialog::on_restartscript() {}
|
||||
void ScriptingDialog::on_restartscript() {
|
||||
on_stopscript();
|
||||
startDebugScript(_DebugingScript);
|
||||
}
|
||||
|
||||
void ScriptingDialog::on_stepinscript() {
|
||||
runDbgCommand(asDebugger::STEP_INTO);
|
||||
|
@ -1019,21 +1145,44 @@ void ScriptingDialog::on_stepoverscript() {
|
|||
void ScriptingDialog::on_togglebreakpoint() {
|
||||
auto editor = currentEditor();
|
||||
if (editor) {
|
||||
QLineMark mrk(editor->fileName(),
|
||||
editor->editor()->cursor().lineNumber() + 1,
|
||||
m_symID.value(Symbols::BreakPoint));
|
||||
QLineMarksInfoCenter::instance()->toggleLineMark(mrk);
|
||||
toggleBreakPoint(editor, editor->editor()->cursor().lineNumber());
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptingDialog::on_addbreakpoint() {
|
||||
auto editor = currentEditor();
|
||||
if (editor) {
|
||||
auto line = editor->editor()->document()->line(
|
||||
editor->editor()->cursor().lineNumber());
|
||||
auto id = m_symID.value(Symbols::BreakPoint);
|
||||
if (!line.hasMark(id)) {
|
||||
line.addMark(id);
|
||||
auto curLineInd = editor->editor()->cursor().lineNumber();
|
||||
auto bpMark = m_symID.value(Symbols::BreakPoint);
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
if (m_consoleout->machine()->isInDebugMode() &&
|
||||
editor->fileName().compare(_lastCurLine.first,
|
||||
Qt::CaseInsensitive) == 0
|
||||
#else
|
||||
if (editor->fileName() == _lastCurLine.first
|
||||
#endif
|
||||
&& _lastCurLine.second == curLineInd + 1) {
|
||||
auto line = editor->editor()->document()->line(curLineInd);
|
||||
auto hitCur = m_symID.value(Symbols::DbgRunHitBreakPoint);
|
||||
auto curSym = m_symID.value(Symbols::DbgRunCurrentLine);
|
||||
|
||||
auto dbg = m_consoleout->machine()->debugger();
|
||||
if (line.hasMark(curSym)) {
|
||||
line.removeMark(curSym);
|
||||
line.addMark(hitCur);
|
||||
dbg->addFileBreakPoint(editor->fileName(), curLineInd + 1);
|
||||
} else {
|
||||
if (!line.hasMark(bpMark)) {
|
||||
line.addMark(bpMark);
|
||||
dbg->addFileBreakPoint(editor->fileName(), curLineInd + 1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
auto line = editor->editor()->document()->line(curLineInd);
|
||||
if (!line.hasMark(bpMark)) {
|
||||
line.addMark(bpMark);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1041,11 +1190,38 @@ void ScriptingDialog::on_addbreakpoint() {
|
|||
void ScriptingDialog::on_removebreakpoint() {
|
||||
auto editor = currentEditor();
|
||||
if (editor) {
|
||||
auto line = editor->editor()->document()->line(
|
||||
editor->editor()->cursor().lineNumber());
|
||||
auto id = m_symID.value(Symbols::BreakPoint);
|
||||
if (line.hasMark(id)) {
|
||||
line.removeMark(id);
|
||||
auto curLineInd = editor->editor()->cursor().lineNumber();
|
||||
auto bpMark = m_symID.value(Symbols::BreakPoint);
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
if (m_consoleout->machine()->isInDebugMode() &&
|
||||
editor->fileName().compare(_lastCurLine.first,
|
||||
Qt::CaseInsensitive) == 0
|
||||
#else
|
||||
if (editor->fileName() == _lastCurLine.first
|
||||
#endif
|
||||
&& _lastCurLine.second == curLineInd + 1) {
|
||||
auto line = editor->editor()->document()->line(curLineInd);
|
||||
auto hitCur = m_symID.value(Symbols::DbgRunHitBreakPoint);
|
||||
auto curSym = m_symID.value(Symbols::DbgRunCurrentLine);
|
||||
|
||||
auto dbg = m_consoleout->machine()->debugger();
|
||||
if (line.hasMark(hitCur)) {
|
||||
line.removeMark(hitCur);
|
||||
line.addMark(curSym);
|
||||
dbg->removeFileBreakPoint(editor->fileName(), curLineInd + 1);
|
||||
} else {
|
||||
if (line.hasMark(bpMark)) {
|
||||
line.removeMark(bpMark);
|
||||
dbg->removeFileBreakPoint(editor->fileName(),
|
||||
curLineInd + 1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
auto line = editor->editor()->document()->line(curLineInd);
|
||||
if (line.hasMark(bpMark)) {
|
||||
line.removeMark(bpMark);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1059,7 +1235,7 @@ void ScriptingDialog::closeEvent(QCloseEvent *event) {
|
|||
event->ignore();
|
||||
return;
|
||||
}
|
||||
// TODO stop the script
|
||||
on_stopscript();
|
||||
}
|
||||
|
||||
auto &set = SettingManager::instance();
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define SCRIPTINGDIALOG_H
|
||||
|
||||
#include "control/scriptingconsole.h"
|
||||
#include "dialog/settingdialog.h"
|
||||
#include "framelessmainwindow.h"
|
||||
|
||||
#include "QWingRibbon/ribbon.h"
|
||||
|
@ -29,8 +30,15 @@ private:
|
|||
REDO_ACTION,
|
||||
SAVE_ACTION,
|
||||
COPY_ACTION,
|
||||
DBG_RUN,
|
||||
DBG_RUN_DBG,
|
||||
DBG_RUN_ACTION,
|
||||
DBG_RUN_DBG_ACTION,
|
||||
DBG_PAUSE_ACTION,
|
||||
DBG_CONTINUE_ACTION,
|
||||
DBG_STOP_ACTION,
|
||||
DBG_RESTART_ACTION,
|
||||
DBG_STEPINTO_ACTION,
|
||||
DBG_STEPOVER_ACTION,
|
||||
DBG_STEPOUT_ACTION,
|
||||
EDITOR_VIEWS,
|
||||
TOOL_VIEWS
|
||||
};
|
||||
|
@ -153,7 +161,7 @@ private:
|
|||
ScriptEditor *currentEditor() const;
|
||||
void swapEditor(ScriptEditor *old, ScriptEditor *cur);
|
||||
|
||||
void setRunDebugMode(bool isRun, bool isDebug = false);
|
||||
void updateRunDebugMode();
|
||||
|
||||
ScriptEditor *findEditorView(const QString &filename);
|
||||
|
||||
|
@ -165,6 +173,12 @@ private:
|
|||
|
||||
void runDbgCommand(asDebugger::DebugAction action);
|
||||
|
||||
void buildUpSettingDialog();
|
||||
|
||||
void startDebugScript(const QString &fileName);
|
||||
|
||||
void toggleBreakPoint(ScriptEditor *editor, int lineIndex);
|
||||
|
||||
private slots:
|
||||
void on_newfile();
|
||||
void on_openfile();
|
||||
|
@ -213,13 +227,13 @@ private:
|
|||
|
||||
ScriptEditor *m_curEditor = nullptr;
|
||||
QList<QWidget *> m_editStateWidgets;
|
||||
QList<QWidget *> m_dbgStateWidgets;
|
||||
|
||||
QMap<ToolButtonIndex, QToolButton *> m_Tbtneditors;
|
||||
|
||||
QMenu *m_recentMenu = nullptr;
|
||||
RecentFileManager *m_recentmanager = nullptr;
|
||||
Ribbon *m_ribbon = nullptr;
|
||||
SettingDialog *m_setdialog = nullptr;
|
||||
|
||||
size_t m_newIndex = 1;
|
||||
QPair<QString, int> _lastCurLine = {QString(), -1};
|
||||
|
@ -236,6 +250,8 @@ private:
|
|||
DbgVarShowModel *m_watch = nullptr;
|
||||
DbgCallStackModel *m_callstack = nullptr;
|
||||
|
||||
QString _DebugingScript;
|
||||
|
||||
QStatusBar *m_status = nullptr;
|
||||
};
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "qdocument_p.h"
|
||||
#include "qeditor.h"
|
||||
#include "ui_qeditconfig.h"
|
||||
#include "utilities.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
|
@ -39,108 +40,14 @@
|
|||
*/
|
||||
|
||||
QEditConfig::QEditConfig(QWidget *w)
|
||||
: QWidget(w), ui(new Ui::QEditConfig()), m_direct(false) {
|
||||
: WingHex::SettingPage(w), ui(new Ui::QEditConfig()) {
|
||||
ui->setupUi(this);
|
||||
|
||||
restore();
|
||||
reset();
|
||||
}
|
||||
|
||||
QEditConfig::~QEditConfig() { delete ui; }
|
||||
|
||||
/*!
|
||||
\brief run-time translation entry point
|
||||
*/
|
||||
void QEditConfig::retranslate() { ui->retranslateUi(this); }
|
||||
|
||||
/*!
|
||||
\brief
|
||||
*/
|
||||
bool QEditConfig::hasUnsavedChanges() const {
|
||||
if (m_direct)
|
||||
return false;
|
||||
|
||||
QFont font = ui->cbFont->currentFont();
|
||||
// font.setPointSize(spnFontSize->value());
|
||||
|
||||
const QFont &docFont = QDocument::font();
|
||||
|
||||
if (font.family() != docFont.family() ||
|
||||
ui->spnFontSize->value() != docFont.pointSize()) {
|
||||
// qDebug("font!");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (ui->spnTabWidth->value() != QDocument::tabStop()) {
|
||||
// qDebug("tab stop!");
|
||||
return true;
|
||||
}
|
||||
|
||||
QDocument::LineEnding le = QDocument::defaultLineEnding();
|
||||
|
||||
if (ui->chkDetectLE->isChecked()) {
|
||||
if (le != QDocument::Conservative) {
|
||||
// qDebug("conservative line endings! : %i", le);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (le !=
|
||||
QDocument::LineEnding(ui->cbLineEndings->currentIndex() + 1)) {
|
||||
// qDebug("line endings!");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
QDocument::WhiteSpaceMode ws = QDocument::ShowNone;
|
||||
|
||||
if (ui->chkShowLeadingWhitespace->isChecked())
|
||||
ws |= QDocument::ShowLeading;
|
||||
|
||||
if (ui->chkShowTrailingWhitespace->isChecked())
|
||||
ws |= QDocument::ShowTrailing;
|
||||
|
||||
if (ui->chkShowTabsInText->isChecked())
|
||||
ws |= QDocument::ShowTabs;
|
||||
|
||||
if (ws != QDocument::showSpaces()) {
|
||||
// qDebug("spaces!");
|
||||
return true;
|
||||
}
|
||||
|
||||
int flags = QEditor::defaultFlags();
|
||||
|
||||
if (ui->chkReplaceTabs->isChecked())
|
||||
flags |= QEditor::ReplaceTabs;
|
||||
else
|
||||
flags &= ~QEditor::ReplaceTabs;
|
||||
|
||||
if (ui->chkAutoRemoveTrailingWhitespace->isChecked())
|
||||
flags |= QEditor::RemoveTrailing;
|
||||
else
|
||||
flags &= ~QEditor::RemoveTrailing;
|
||||
|
||||
if (ui->chkPreserveTrailingIndent->isChecked())
|
||||
flags |= QEditor::PreserveTrailingIndent;
|
||||
else
|
||||
flags &= ~QEditor::PreserveTrailingIndent;
|
||||
|
||||
if (flags != QEditor::defaultFlags()) {
|
||||
// qDebug("flags!");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*!
|
||||
\return whether user changes are immediately applied
|
||||
*/
|
||||
bool QEditConfig::applyImmediately() const { return m_direct; }
|
||||
|
||||
/*!
|
||||
\brief Set whether user changes are immediately applied
|
||||
*/
|
||||
void QEditConfig::setApplyImmediately(bool y) { m_direct = y; }
|
||||
|
||||
/*!
|
||||
\brief Apply changes
|
||||
*/
|
||||
|
@ -199,11 +106,6 @@ void QEditConfig::apply() {
|
|||
*/
|
||||
void QEditConfig::cancel() {
|
||||
// reload the current config
|
||||
|
||||
bool oldDir = m_direct;
|
||||
|
||||
m_direct = false;
|
||||
|
||||
ui->cbFont->setFont(QDocument::font());
|
||||
ui->spnFontSize->setValue(QDocument::font().pointSize());
|
||||
|
||||
|
@ -224,10 +126,6 @@ void QEditConfig::cancel() {
|
|||
QEditor::RemoveTrailing);
|
||||
ui->chkPreserveTrailingIndent->setChecked(flags &
|
||||
QEditor::PreserveTrailingIndent);
|
||||
|
||||
auto c = QEditor::defaultCodecName();
|
||||
|
||||
m_direct = oldDir;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -235,13 +133,9 @@ void QEditConfig::cancel() {
|
|||
|
||||
\note The widgets are changed but these changes are NOT applied.
|
||||
*/
|
||||
void QEditConfig::restore() {
|
||||
void QEditConfig::reset() {
|
||||
// restore default configuration
|
||||
|
||||
bool oldDir = m_direct;
|
||||
|
||||
m_direct = false;
|
||||
|
||||
QFont font("Monospace", 10);
|
||||
font.setStyleHint(QFont::Courier);
|
||||
|
||||
|
@ -260,8 +154,6 @@ void QEditConfig::restore() {
|
|||
ui->chkReplaceTabs->setChecked(false);
|
||||
ui->chkAutoRemoveTrailingWhitespace->setChecked(false);
|
||||
ui->chkPreserveTrailingIndent->setChecked(true);
|
||||
|
||||
m_direct = oldDir;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -296,6 +188,12 @@ QMap<QString, QVariant> QEditConfig::dumpKeys() const {
|
|||
return m;
|
||||
}
|
||||
|
||||
QIcon QEditConfig::categoryIcon() const { return ICONRES("file"); }
|
||||
|
||||
QString QEditConfig::name() const { return tr("Edit"); }
|
||||
|
||||
bool QEditConfig::isInPluginPage() const { return false; }
|
||||
|
||||
/*!
|
||||
\brief Fills the widget subcontrols from a settings map
|
||||
|
||||
|
@ -314,40 +212,31 @@ void QEditConfig::loadKeys(const QMap<QString, QVariant> &keys) {
|
|||
ui->cbFont->setCurrentFont(f);
|
||||
ui->spnFontSize->setValue(f.pointSize());
|
||||
|
||||
if (m_direct)
|
||||
QDocument::setFont(f);
|
||||
QDocument::setFont(f);
|
||||
|
||||
ui->lblSampleText->setFont(f);
|
||||
|
||||
} else if (it.key() == "tab_width") {
|
||||
ui->spnTabWidth->setValue(it->toInt());
|
||||
|
||||
if (m_direct)
|
||||
on_spnTabWidth_valueChanged(it->toInt());
|
||||
on_spnTabWidth_valueChanged(it->toInt());
|
||||
} else if (it.key() == "replace_tabs") {
|
||||
ui->chkReplaceTabs->setChecked(it->toBool());
|
||||
if (m_direct)
|
||||
on_chkReplaceTabs_toggled(it->toBool());
|
||||
on_chkReplaceTabs_toggled(it->toBool());
|
||||
} else if (it.key() == "remove_trailing") {
|
||||
ui->chkAutoRemoveTrailingWhitespace->setChecked(it->toBool());
|
||||
if (m_direct)
|
||||
on_chkAutoRemoveTrailingWhitespace_toggled(it->toBool());
|
||||
on_chkAutoRemoveTrailingWhitespace_toggled(it->toBool());
|
||||
} else if (it.key() == "preserve_trailing_indent") {
|
||||
ui->chkPreserveTrailingIndent->setChecked(it->toBool());
|
||||
if (m_direct)
|
||||
on_chkPreserveTrailingIndent_toggled(it->toBool());
|
||||
on_chkPreserveTrailingIndent_toggled(it->toBool());
|
||||
} else if (it.key() == "show_tabs_in_text") {
|
||||
ui->chkShowTabsInText->setChecked(it->toBool());
|
||||
if (m_direct)
|
||||
on_chkShowTabsInText_toggled(it->toBool());
|
||||
on_chkShowTabsInText_toggled(it->toBool());
|
||||
} else if (it.key() == "show_leading_whitespace") {
|
||||
ui->chkShowLeadingWhitespace->setChecked(it->toBool());
|
||||
if (m_direct)
|
||||
on_chkShowLeadingWhitespace_toggled(it->toBool());
|
||||
on_chkShowLeadingWhitespace_toggled(it->toBool());
|
||||
} else if (it.key() == "show_trailing_whitespace") {
|
||||
ui->chkShowTrailingWhitespace->setChecked(it->toBool());
|
||||
if (m_direct)
|
||||
on_chkShowTrailingWhitespace_toggled(it->toBool());
|
||||
on_chkShowTrailingWhitespace_toggled(it->toBool());
|
||||
} else if (it.key() == "line_endings") {
|
||||
int le = it->toInt();
|
||||
|
||||
|
@ -379,10 +268,8 @@ void QEditConfig::on_spnFontSize_valueChanged(int size) {
|
|||
|
||||
ui->lblSampleText->setFont(font);
|
||||
|
||||
if (m_direct) {
|
||||
QDocument::setFont(font);
|
||||
emit keyChanged("font", font);
|
||||
}
|
||||
QDocument::setFont(font);
|
||||
emit keyChanged("font", font);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -392,90 +279,76 @@ void QEditConfig::on_cbFont_currentFontChanged(QFont font) {
|
|||
font.setPointSize(ui->spnFontSize->value());
|
||||
ui->lblSampleText->setFont(font);
|
||||
|
||||
if (m_direct) {
|
||||
QDocument::setFont(font);
|
||||
emit keyChanged("font", font);
|
||||
}
|
||||
QDocument::setFont(font);
|
||||
emit keyChanged("font", font);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Slot used to apply tab width settings
|
||||
*/
|
||||
void QEditConfig::on_spnTabWidth_valueChanged(int n) {
|
||||
if (m_direct) {
|
||||
QDocument::setTabStop(n);
|
||||
emit keyChanged("tab_width", n);
|
||||
}
|
||||
|
||||
QDocument::setTabStop(n);
|
||||
emit keyChanged("tab_width", n);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Slot used to apply tabs replacement settings
|
||||
*/
|
||||
void QEditConfig::on_chkReplaceTabs_toggled(bool y) {
|
||||
if (m_direct) {
|
||||
// FIXME
|
||||
foreach (QEditor *e, QEditor::m_editors) {
|
||||
e->setFlag(QEditor::ReplaceTabs, y);
|
||||
}
|
||||
emit keyChanged("replace_tabs", y);
|
||||
// FIXME
|
||||
foreach (QEditor *e, QEditor::m_editors) {
|
||||
e->setFlag(QEditor::ReplaceTabs, y);
|
||||
}
|
||||
emit keyChanged("replace_tabs", y);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Slot used to apply tabs display settings
|
||||
*/
|
||||
void QEditConfig::on_chkShowTabsInText_toggled(bool y) {
|
||||
if (m_direct) {
|
||||
if (y)
|
||||
QDocument::setShowSpaces(QDocument::showSpaces() |
|
||||
QDocument::ShowTabs);
|
||||
else
|
||||
QDocument::setShowSpaces(QDocument::showSpaces() &
|
||||
~QDocument::ShowTabs);
|
||||
if (y)
|
||||
QDocument::setShowSpaces(QDocument::showSpaces() | QDocument::ShowTabs);
|
||||
else
|
||||
QDocument::setShowSpaces(QDocument::showSpaces() &
|
||||
~QDocument::ShowTabs);
|
||||
|
||||
emit keyChanged("show_tabs_in_text", y);
|
||||
}
|
||||
emit keyChanged("show_tabs_in_text", y);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Slot used to apply trailing whitespace display settings
|
||||
*/
|
||||
void QEditConfig::on_chkShowLeadingWhitespace_toggled(bool y) {
|
||||
if (m_direct) {
|
||||
if (y)
|
||||
QDocument::setShowSpaces(QDocument::showSpaces() |
|
||||
QDocument::ShowLeading);
|
||||
else
|
||||
QDocument::setShowSpaces(QDocument::showSpaces() &
|
||||
~QDocument::ShowLeading);
|
||||
if (y)
|
||||
QDocument::setShowSpaces(QDocument::showSpaces() |
|
||||
QDocument::ShowLeading);
|
||||
else
|
||||
QDocument::setShowSpaces(QDocument::showSpaces() &
|
||||
~QDocument::ShowLeading);
|
||||
|
||||
emit keyChanged("show_leading_whitespace", y);
|
||||
}
|
||||
emit keyChanged("show_leading_whitespace", y);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Slot used to apply leading whitespace display settings
|
||||
*/
|
||||
void QEditConfig::on_chkShowTrailingWhitespace_toggled(bool y) {
|
||||
if (m_direct) {
|
||||
if (y)
|
||||
QDocument::setShowSpaces(QDocument::showSpaces() |
|
||||
QDocument::ShowTrailing);
|
||||
else
|
||||
QDocument::setShowSpaces(QDocument::showSpaces() &
|
||||
~QDocument::ShowTrailing);
|
||||
if (y)
|
||||
QDocument::setShowSpaces(QDocument::showSpaces() |
|
||||
QDocument::ShowTrailing);
|
||||
else
|
||||
QDocument::setShowSpaces(QDocument::showSpaces() &
|
||||
~QDocument::ShowTrailing);
|
||||
|
||||
emit keyChanged("show_trailing_whitespace", y);
|
||||
}
|
||||
emit keyChanged("show_trailing_whitespace", y);
|
||||
}
|
||||
|
||||
void QEditConfig::on_cbLineEndings_currentIndexChanged(int idx) {
|
||||
QDocument::LineEnding le = QDocument::LineEnding(idx + 1);
|
||||
|
||||
if (m_direct) {
|
||||
QDocument::setDefaultLineEnding(le);
|
||||
emit keyChanged("line_endings", (int)le);
|
||||
}
|
||||
QDocument::setDefaultLineEnding(le);
|
||||
emit keyChanged("line_endings", (int)le);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -488,36 +361,30 @@ void QEditConfig::on_chkDetectLE_toggled(bool y) {
|
|||
le = QDocument::LineEnding(ui->cbLineEndings->currentIndex() + 1);
|
||||
}
|
||||
|
||||
if (m_direct) {
|
||||
QDocument::setDefaultLineEnding(le);
|
||||
emit keyChanged("line_endings", (int)le);
|
||||
}
|
||||
QDocument::setDefaultLineEnding(le);
|
||||
emit keyChanged("line_endings", (int)le);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Slot used to apply trailing space removal settings
|
||||
*/
|
||||
void QEditConfig::on_chkAutoRemoveTrailingWhitespace_toggled(bool y) {
|
||||
if (m_direct) {
|
||||
// FIXME
|
||||
foreach (QEditor *e, QEditor::m_editors) {
|
||||
e->setFlag(QEditor::RemoveTrailing, y);
|
||||
}
|
||||
emit keyChanged("remove_trailing", y);
|
||||
// FIXME
|
||||
foreach (QEditor *e, QEditor::m_editors) {
|
||||
e->setFlag(QEditor::RemoveTrailing, y);
|
||||
}
|
||||
emit keyChanged("remove_trailing", y);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Slot used to indent preservation settings
|
||||
*/
|
||||
void QEditConfig::on_chkPreserveTrailingIndent_toggled(bool y) {
|
||||
if (m_direct) {
|
||||
// FIXME
|
||||
foreach (QEditor *e, QEditor::m_editors) {
|
||||
e->setFlag(QEditor::PreserveTrailingIndent, y);
|
||||
}
|
||||
emit keyChanged("preserve_trailing_indent", y);
|
||||
// FIXME
|
||||
foreach (QEditor *e, QEditor::m_editors) {
|
||||
e->setFlag(QEditor::PreserveTrailingIndent, y);
|
||||
}
|
||||
emit keyChanged("preserve_trailing_indent", y);
|
||||
}
|
||||
|
||||
/*! @} */
|
||||
|
|
|
@ -1,36 +1,34 @@
|
|||
#ifndef QEDITCONFIG_H
|
||||
#define QEDITCONFIG_H
|
||||
|
||||
#include "plugin/settingpage.h"
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class QEditConfig;
|
||||
}
|
||||
|
||||
class QEditConfig : public QWidget {
|
||||
class QEditConfig : public WingHex::SettingPage {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit QEditConfig(QWidget *parent = nullptr);
|
||||
virtual ~QEditConfig();
|
||||
|
||||
bool hasUnsavedChanges() const;
|
||||
|
||||
bool applyImmediately() const;
|
||||
|
||||
QMap<QString, QVariant> dumpKeys() const;
|
||||
|
||||
public:
|
||||
virtual QIcon categoryIcon() const override;
|
||||
virtual QString name() const override;
|
||||
virtual bool isInPluginPage() const override;
|
||||
|
||||
virtual void apply() override;
|
||||
virtual void cancel() override;
|
||||
virtual void reset() override;
|
||||
|
||||
public slots:
|
||||
void retranslate();
|
||||
|
||||
void apply();
|
||||
void cancel();
|
||||
void restore();
|
||||
|
||||
void loadKeys(const QMap<QString, QVariant> &keys);
|
||||
|
||||
void setApplyImmediately(bool y);
|
||||
|
||||
signals:
|
||||
void keyChanged(const QString &key, const QVariant &value);
|
||||
|
||||
|
@ -53,8 +51,6 @@ private slots:
|
|||
|
||||
private:
|
||||
Ui::QEditConfig *ui;
|
||||
|
||||
bool m_direct;
|
||||
};
|
||||
|
||||
#endif // QEDITCONFIG_H
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include <QVBoxLayout>
|
||||
|
||||
#include "class/wingmessagebox.h"
|
||||
#include "utilities.h"
|
||||
|
||||
/*!
|
||||
\ingroup dialogs
|
||||
|
@ -48,7 +49,7 @@
|
|||
*/
|
||||
|
||||
QFormatConfig::QFormatConfig(QWidget *w)
|
||||
: QWidget(w), ui(new Ui::QFormatConfig()), m_autonomous(false),
|
||||
: WingHex::SettingPage(w), ui(new Ui::QFormatConfig()), m_autonomous(false),
|
||||
m_currentScheme(0) {
|
||||
ui->setupUi(this);
|
||||
|
||||
|
@ -72,11 +73,6 @@ QFormatConfig::QFormatConfig(QWidget *w)
|
|||
|
||||
QFormatConfig::~QFormatConfig() { delete ui; }
|
||||
|
||||
/*!
|
||||
\brief run-time translation entry point
|
||||
*/
|
||||
void QFormatConfig::retranslate() { ui->retranslateUi(this); }
|
||||
|
||||
/*!
|
||||
\return Whether the format config widget is in "autonomous" mode
|
||||
*/
|
||||
|
@ -103,6 +99,12 @@ bool QFormatConfig::hasUnsavedChanges() const {
|
|||
*/
|
||||
QList<QFormatScheme *> QFormatConfig::schemes() const { return m_schemes; }
|
||||
|
||||
QIcon QFormatConfig::categoryIcon() const { return ICONRES(""); }
|
||||
|
||||
QString QFormatConfig::name() const { return tr("Format"); }
|
||||
|
||||
bool QFormatConfig::isInPluginPage() const { return false; }
|
||||
|
||||
/*!
|
||||
\brief Add a format scheme to the config widget
|
||||
|
||||
|
@ -325,7 +327,7 @@ void QFormatConfig::cancel() {
|
|||
|
||||
\note The widgets are changed but these changes are NOT applied.
|
||||
*/
|
||||
void QFormatConfig::restore() {
|
||||
void QFormatConfig::reset() {
|
||||
// restoring what? this is only provided for API consistency and in case
|
||||
// (very unlikely to ever happen) design changes make restore() a sensible
|
||||
// thing to do on format schemes
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef QFORMATCONFIG_H
|
||||
#define QFORMATCONFIG_H
|
||||
|
||||
#include "plugin/settingpage.h"
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
|
@ -9,7 +10,7 @@ class QFormatConfig;
|
|||
|
||||
class QFormatScheme;
|
||||
|
||||
class QFormatConfig : public QWidget {
|
||||
class QFormatConfig : public WingHex::SettingPage {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
@ -22,13 +23,15 @@ public:
|
|||
|
||||
QList<QFormatScheme *> schemes() const;
|
||||
|
||||
public:
|
||||
virtual QIcon categoryIcon() const override;
|
||||
virtual QString name() const override;
|
||||
virtual bool isInPluginPage() const override;
|
||||
virtual void apply() override;
|
||||
virtual void cancel() override;
|
||||
virtual void reset() override;
|
||||
|
||||
public slots:
|
||||
void retranslate();
|
||||
|
||||
void apply();
|
||||
void cancel();
|
||||
void restore();
|
||||
|
||||
void setAutonomous(bool y);
|
||||
|
||||
void addScheme(const QString &name, QFormatScheme *scheme);
|
||||
|
@ -37,7 +40,7 @@ public slots:
|
|||
void setCurrentScheme(QFormatScheme *scheme);
|
||||
|
||||
protected:
|
||||
virtual void hideEvent(QHideEvent *e);
|
||||
virtual void hideEvent(QHideEvent *e) override;
|
||||
|
||||
private slots:
|
||||
void on_m_selector_currentIndexChanged(int idx);
|
||||
|
|
|
@ -1,177 +0,0 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2006-2009 fullmetalcoder <fullmetalcoder@hotmail.fr>
|
||||
**
|
||||
** This file is part of the Edyuk project <http://edyuk.org>
|
||||
**
|
||||
** This file may be used under the terms of the GNU General Public License
|
||||
** version 3 as published by the Free Software Foundation and appearing in the
|
||||
** file GPL.txt included in the packaging of this file.
|
||||
**
|
||||
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qstatuspanel.h"
|
||||
|
||||
/*!
|
||||
\file qstatuspanel.cpp
|
||||
\brief Implementation of the QStatusPanel class.
|
||||
|
||||
\see QStatusPanel
|
||||
*/
|
||||
|
||||
#include "qeditor.h"
|
||||
|
||||
#include "qdocument.h"
|
||||
#include "qdocumentcursor.h"
|
||||
#include "qdocumentline.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDateTime>
|
||||
#include <QFontMetrics>
|
||||
#include <QPaintEvent>
|
||||
#include <QPainter>
|
||||
#include <QTimer>
|
||||
|
||||
/*!
|
||||
\ingroup widgets
|
||||
@{
|
||||
*/
|
||||
|
||||
/*!
|
||||
\class QStatusPanel
|
||||
\brief A panel that display some status informations
|
||||
*/
|
||||
|
||||
QCE_AUTO_REGISTER(QStatusPanel)
|
||||
|
||||
/*!
|
||||
\brief Constructor
|
||||
*/
|
||||
QStatusPanel::QStatusPanel(QWidget *p) : QPanel(p) {
|
||||
setFixedHeight(fontMetrics().lineSpacing() + 4);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Empty destructor
|
||||
*/
|
||||
QStatusPanel::~QStatusPanel() {}
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
QString QStatusPanel::type() const { return "Status"; }
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
void QStatusPanel::editorChange(QEditor *e) {
|
||||
if (editor()) {
|
||||
disconnect(editor(), SIGNAL(cursorPositionChanged()), this,
|
||||
SLOT(update()));
|
||||
}
|
||||
|
||||
if (e) {
|
||||
connect(e, SIGNAL(cursorPositionChanged()), this, SLOT(update()));
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
bool QStatusPanel::paint(QPainter *p, QEditor *e) {
|
||||
// qDebug("drawing status panel... [%i, %i, %i, %i]",
|
||||
// geometry().x(),
|
||||
// geometry().y(),
|
||||
// geometry().width(),
|
||||
// geometry().height());
|
||||
static QPixmap _warn(":/warning.png"), _mod(":/save.png");
|
||||
|
||||
QString s;
|
||||
int xpos = 10;
|
||||
QDocumentCursor c = e->cursor();
|
||||
const QFontMetrics fm(fontMetrics());
|
||||
|
||||
const int ls = fm.lineSpacing();
|
||||
const int ascent = fm.ascent() + 3;
|
||||
|
||||
s = tr("Line : %1 Visual column : %2 Text column : %3")
|
||||
.arg(c.lineNumber() + 1)
|
||||
.arg(c.visualColumnNumber())
|
||||
.arg(c.columnNumber());
|
||||
|
||||
p->drawText(xpos, ascent, s);
|
||||
xpos += fm.horizontalAdvance(s) + 10;
|
||||
|
||||
int sz = qMin(height(), _mod.height());
|
||||
// int lastMod = d->lastModified().secsTo(QDateTime::currentDateTime());
|
||||
// QString timeDiff = tr("(%1 min %2 s ago)").arg(lastMod / 60).arg(lastMod
|
||||
// % 60);
|
||||
|
||||
// xpos += 10;
|
||||
if (e->isContentModified()) {
|
||||
p->drawPixmap(xpos, (height() - sz) / 2, sz, sz, _mod);
|
||||
// xpos += sz;
|
||||
// xpos += 10;
|
||||
// p->drawText(xpos, ascent, timeDiff);
|
||||
}
|
||||
xpos += sz + 10;
|
||||
// xpos += fm.width(timeDiff);
|
||||
// xpos += 20;
|
||||
|
||||
s = editor()->flag(QEditor::Overwrite) ? tr("OVERWRITE") : tr("INSERT");
|
||||
p->drawText(xpos, ascent, s);
|
||||
xpos += fm.horizontalAdvance(s) + 10;
|
||||
|
||||
m_conflictSpot = 0;
|
||||
|
||||
if (editor()->isInConflict()) {
|
||||
s = tr("Conflict");
|
||||
int w = fm.horizontalAdvance(s) + 30;
|
||||
|
||||
if (xpos + w + _warn.width() < width()) {
|
||||
m_conflictSpot = width() - (w + _warn.width());
|
||||
p->drawText(width() - w + 15, ascent, s);
|
||||
p->drawPixmap(m_conflictSpot, (ls - _warn.height()) / 2 + 2, _warn);
|
||||
} else if (xpos + _warn.width() < width()) {
|
||||
m_conflictSpot = width() - _warn.width();
|
||||
p->drawPixmap(m_conflictSpot, (ls - _warn.height()) / 2 + 2, _warn);
|
||||
}
|
||||
}
|
||||
|
||||
setFixedHeight(ls + 4);
|
||||
|
||||
QTimer::singleShot(1000, this, SLOT(update()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
void QStatusPanel::mousePressEvent(QMouseEvent *e) {
|
||||
if (!editor() || (e->button() != Qt::LeftButton) || !m_conflictSpot ||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
e->position().x() < m_conflictSpot) {
|
||||
#else
|
||||
e->x() < m_conflictSpot) {
|
||||
#endif
|
||||
editor()->setFocus();
|
||||
return;
|
||||
}
|
||||
|
||||
editor()->save();
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
void QStatusPanel::mouseReleaseEvent(QMouseEvent *e) {
|
||||
Q_UNUSED(e)
|
||||
|
||||
editor()->setFocus();
|
||||
}
|
||||
|
||||
/*! @} */
|
|
@ -1,54 +0,0 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2006-2009 fullmetalcoder <fullmetalcoder@hotmail.fr>
|
||||
**
|
||||
** This file is part of the Edyuk project <http://edyuk.org>
|
||||
**
|
||||
** This file may be used under the terms of the GNU General Public License
|
||||
** version 3 as published by the Free Software Foundation and appearing in the
|
||||
** file GPL.txt included in the packaging of this file.
|
||||
**
|
||||
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef _QSTATUS_PANEL_H_
|
||||
#define _QSTATUS_PANEL_H_
|
||||
|
||||
#include "qpanel.h"
|
||||
|
||||
/*!
|
||||
\file qstatuspanel.h
|
||||
\brief Definition of the QStatusPanel class.
|
||||
|
||||
\see QStatusPanel
|
||||
*/
|
||||
|
||||
class QLabel;
|
||||
|
||||
class QDocumentLine;
|
||||
|
||||
class QCE_EXPORT QStatusPanel : public QPanel {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Q_PANEL(QStatusPanel, "Status Panel")
|
||||
|
||||
QStatusPanel(QWidget *p = nullptr);
|
||||
virtual ~QStatusPanel();
|
||||
|
||||
virtual QString type() const;
|
||||
|
||||
protected:
|
||||
virtual void editorChange(QEditor *e);
|
||||
virtual bool paint(QPainter *p, QEditor *e);
|
||||
|
||||
virtual void mousePressEvent(QMouseEvent *e);
|
||||
virtual void mouseReleaseEvent(QMouseEvent *e);
|
||||
|
||||
private:
|
||||
int m_conflictSpot;
|
||||
};
|
||||
|
||||
#endif // _QSTATUS_PANEL_H_
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef GENERALSETTINGDIALOG_H
|
||||
#define GENERALSETTINGDIALOG_H
|
||||
|
||||
#include "../plugin/settingpage.h"
|
||||
#include "plugin/settingpage.h"
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
|
|
Loading…
Reference in New Issue