Add support for parallel progress printing

This commit is contained in:
Jack Andersen 2018-03-23 11:55:42 -10:00
parent 77765679b0
commit 007ad244ee
3 changed files with 25 additions and 6 deletions

View File

@ -2,7 +2,7 @@
#define GUI_LAUNCHMENU_HPP
#include <QMenu>
namespace hecl { class CVarCommons; }
namespace hecl { struct CVarCommons; }
class LaunchMenu : public QMenu
{

View File

@ -171,6 +171,11 @@ void MainWindow::onPackage()
m_ui->packageBtn->setEnabled(true);
disconnect(m_ui->packageBtn, SIGNAL(clicked()), nullptr, nullptr);
connect(m_ui->packageBtn, SIGNAL(clicked()), this, SLOT(doHECLTerminate()));
QSize size = QWidget::size();
if (size.width() < 1100)
size.setWidth(1100);
resize(size);
}
void MainWindow::onPackageFinished(int returnCode)
@ -516,16 +521,17 @@ void MainWindow::setTextTermFormatting(const QString& text)
{
m_inContinueNote = false;
QRegExp const escapeSequenceExpression(R"(\x1B\[([\d;\?]+)([mlh]))");
QRegExp const escapeSequenceExpression(R"(\x1B\[([\d;\?F]+)([mlh]?))");
QTextCharFormat defaultTextCharFormat = m_cursor.charFormat();
int offset = escapeSequenceExpression.indexIn(text);
ReturnInsert(m_cursor, text.mid(0, offset));
QTextCharFormat textCharFormat = defaultTextCharFormat;
while (offset >= 0) {
int previousOffset = offset + escapeSequenceExpression.matchedLength();
if (escapeSequenceExpression.capturedTexts()[2] == "m")
QStringList captures = escapeSequenceExpression.capturedTexts();
if (captures.size() >= 3 && captures[2] == "m")
{
QStringList capturedTexts = escapeSequenceExpression.capturedTexts()[1].split(';');
QStringList capturedTexts = captures[1].split(';');
QListIterator<QString> i(capturedTexts);
while (i.hasNext()) {
bool ok = false;
@ -534,6 +540,19 @@ void MainWindow::setTextTermFormatting(const QString& text)
ParseEscapeSequence(attribute, i, textCharFormat, defaultTextCharFormat);
}
}
else if (captures.size() >= 2 && captures[1].endsWith('F'))
{
int lineCount = captures[1].chopped(1).toInt();
if (!lineCount)
lineCount = 1;
for (int i=0 ; i<lineCount ; ++i)
{
m_cursor.movePosition(QTextCursor::PreviousBlock);
m_cursor.select(QTextCursor::BlockUnderCursor);
m_cursor.removeSelectedText();
m_cursor.insertBlock();
}
}
offset = escapeSequenceExpression.indexIn(text, previousOffset);
if (offset < 0) {
ReturnInsert(m_cursor, text.mid(previousOffset), textCharFormat);

View File

@ -105,7 +105,7 @@
<item row="1" column="0" colspan="6">
<widget class="QTabWidget" name="heclTabs">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="dataTab">
<attribute name="title">
@ -705,7 +705,7 @@
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt; font-weight:600;&quot;&gt;About HECL Frontend&lt;/span&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt;&quot;&gt;&lt;br /&gt;The hecl frontend UI is designed and built by &lt;/span&gt;&lt;a href=&quot;https://axiodl.com&quot;&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt; text-decoration: underline; color:#007af4;&quot;&gt;Axiomatic Data Laboratories&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt;&quot;&gt; Copyright 2018&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt; font-weight:600;&quot;&gt;Authors:&lt;/span&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt;&quot;&gt;&lt;br /&gt;Phillip &amp;quot;Antidote&amp;quot; Stephens&lt;br /&gt;Jack &amp;quot;jackoalan&amp;quot; Andersen&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Courier New'; font-size:10pt;&quot;&gt;The MIT License&lt;/span&gt;&lt;/p&gt;