1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2026-03-19 17:57:22 +01:00

* instDialog.cpp (instDialog::show): fixed #1419: clear progress

log display when instDialog is opened
This commit is contained in:
Vadim Kurland 2010-04-25 01:54:41 +00:00
parent 3c420d0c92
commit 5f58d6bcf2
6 changed files with 59 additions and 59 deletions

View File

@ -1 +1 @@
#define BUILD_NUM 2834
#define BUILD_NUM 2837

View File

@ -1,3 +1,8 @@
2010-04-24 Vadim Kurland <vadim@vk.crocodile.org>
* instDialog.cpp (instDialog::show): fixed #1419: clear progress
log display when instDialog is opened
2010-04-23 vadim <vadim@vk.crocodile.org>
* MangleTableCompiler_ipt.cpp (keepMangleTableRules::processNext):

View File

@ -125,8 +125,7 @@ instDialog::instDialog(QWidget *p) : QDialog(p)
}
currentLog = m_dialog->procLogDisplay;
QTextCursor cursor(currentLog->textCursor());
QTextCursor cursor(m_dialog->procLogDisplay->textCursor());
normal_format = cursor.charFormat();
error_format = normal_format;
error_format.setForeground(QBrush(Qt::red));
@ -191,6 +190,7 @@ void instDialog::show(ProjectPanel *proj,
compile_only = ! install;
m_dialog->warning_space->hide();
m_dialog->procLogDisplay->clear();
firewalls.clear();
clusters.clear();
@ -409,7 +409,7 @@ void instDialog::showPage(const int page)
currentFirewallsBar->reset();
currentFirewallsBar->setMaximum(compile_list_initial_size);
currentLog->clear();
m_dialog->procLogDisplay->clear();
fillCompileUIList();
qApp->processEvents();
mainLoopCompile();
@ -423,7 +423,7 @@ void instDialog::showPage(const int page)
{
currentFirewallsBar->reset();
currentFirewallsBar->setMaximum(install_list_initial_size);
currentLog->clear();
m_dialog->procLogDisplay->clear();
fillInstallUIList();
qApp->processEvents();
mainLoopInstall();

View File

@ -134,7 +134,6 @@ class instDialog : public QDialog, public FakeWizard
bool finished;
bool onlySelected;
QTextBrowser *currentLog;
QTextCharFormat normal_format;
QTextCharFormat error_format;
QTextCharFormat warning_format;

View File

@ -438,7 +438,7 @@ void instDialog::summary()
str.append("");
QTextCursor cursor = currentLog->textCursor();
QTextCursor cursor = m_dialog->procLogDisplay->textCursor();
cursor.insertBlock();
cursor.insertText(str.join("\n"), highlight_format);
}
@ -620,7 +620,7 @@ void instDialog::hideEvent( QHideEvent *ev)
void instDialog::saveLog()
{
QString dir;
if (currentLog==NULL) return;
//if (m_dialog->procLogDisplay==NULL) return;
dir=st->getWDir();
if (dir.isEmpty()) dir=st->getOpenFileDir();
if (dir.isEmpty()) dir="~";
@ -632,8 +632,7 @@ void instDialog::saveLog()
adding text from each paragraph separately.
*/
QString logText;
logText = currentLog->toPlainText();
//logText = currentLog->toHtml();
logText = m_dialog->procLogDisplay->toPlainText();
QString s = QFileDialog::getSaveFileName(
this,
@ -672,57 +671,54 @@ void instDialog::addToLog(const QString &line)
if (line.isEmpty()) return;
if (currentLog)
QString txt = line.trimmed();
QTextCharFormat format = normal_format;
list<QRegExp>::const_iterator it;
for (it=error_re.begin(); it!=error_re.end(); ++it)
{
QString txt = line.trimmed();
QTextCharFormat format = normal_format;
list<QRegExp>::const_iterator it;
for (it=error_re.begin(); it!=error_re.end(); ++it)
if ((*it).indexIn(txt) != -1)
{
if ((*it).indexIn(txt) != -1)
{
format = error_format;
break;
}
format = error_format;
break;
}
for (it=warning_re.begin(); it!=warning_re.end(); ++it)
{
if ((*it).indexIn(txt) != -1)
{
format = warning_format;
break;
}
}
/* See sourceforge bug https://sourceforge.net/tracker/?func=detail&aid=2847263&group_id=5314&atid=1070394
*
* QTextEditor::insertHtml() becomes incrementally slow as the
* amount of text already in the QTextEditor
* increases. Compiling ~10 firewalls with few dozen rules
* each slows the output to a crawl on Windows. Keeping each
* line in a separate block makes it much faster.
*/
txt = line;
while (!txt.isEmpty() && (txt.endsWith("\n") || txt.endsWith("\r")))
txt.chop(1);
if (format == error_format || format == warning_format )
format.setAnchorHref(txt);
QTextCursor cursor = currentLog->textCursor();
cursor.insertBlock();
cursor.insertText(txt, format);
//m_dialog->procLogDisplayList->addItem(txt);
currentLog->ensureCursorVisible();
qApp->processEvents();
}
for (it=warning_re.begin(); it!=warning_re.end(); ++it)
{
if ((*it).indexIn(txt) != -1)
{
format = warning_format;
break;
}
}
/* See sourceforge bug https://sourceforge.net/tracker/?func=detail&aid=2847263&group_id=5314&atid=1070394
*
* QTextEditor::insertHtml() becomes incrementally slow as the
* amount of text already in the QTextEditor
* increases. Compiling ~10 firewalls with few dozen rules
* each slows the output to a crawl on Windows. Keeping each
* line in a separate block makes it much faster.
*/
txt = line;
while (!txt.isEmpty() && (txt.endsWith("\n") || txt.endsWith("\r")))
txt.chop(1);
if (format == error_format || format == warning_format )
format.setAnchorHref(txt);
QTextCursor cursor = m_dialog->procLogDisplay->textCursor();
cursor.insertBlock();
cursor.insertText(txt, format);
//m_dialog->procLogDisplayList->addItem(txt);
m_dialog->procLogDisplay->ensureCursorVisible();
qApp->processEvents();
}
void instDialog::interpretLogLine(const QString &line)

View File

@ -29306,7 +29306,7 @@ echo '%FWBPROMPT%'; sh /tmp/%FWSCRIPT%
<Option name="verify_interfaces">true</Option>
</FirewallOptions>
</Firewall>
<Firewall id="id4513DEA62143" host_OS="linux24" inactive="False" lastCompiled="1247364284" lastInstalled="0" lastModified="1256245133" platform="iptables" version="" name="test-shadowing-1" comment="testing shadowing detection&#10;compiler runs with -xt flag&#10;firewall is assumed to be part of any" ro="False">
<Firewall id="id4513DEA62143" host_OS="linux24" inactive="False" lastCompiled="1272160238" lastInstalled="0" lastModified="1256245133" platform="iptables" version="" name="test-shadowing-1" comment="testing shadowing detection&#10;compiler runs with -xt flag&#10;firewall is assumed to be part of any" ro="False">
<NAT id="id4513DEAA2143" name="NAT" comment="" ro="False" ipv4_rule_set="False" ipv6_rule_set="False" top_rule_set="True">
<RuleSetOptions/>
</NAT>
@ -29617,7 +29617,7 @@ echo '%FWBPROMPT%'; sh /tmp/%FWSCRIPT%
<Option name="verify_interfaces">True</Option>
</FirewallOptions>
</Firewall>
<Firewall id="id451488C42143" host_OS="linux24" inactive="False" lastCompiled="1247364292" lastInstalled="0" lastModified="1158818614" platform="iptables" version="" name="test-shadowing-2" comment="testing shadowing detection&#10;compiler runs with -xt flag&#10;firewall is NOT assumed to be part of any" ro="False">
<Firewall id="id451488C42143" host_OS="linux24" inactive="False" lastCompiled="1272159361" lastInstalled="0" lastModified="1158818614" platform="iptables" version="" name="test-shadowing-2" comment="testing shadowing detection&#10;compiler runs with -xt flag&#10;firewall is NOT assumed to be part of any" ro="False">
<NAT id="id451489072143" name="NAT" comment="" ro="False" ipv4_rule_set="False" ipv6_rule_set="False" top_rule_set="True">
<RuleSetOptions/>
</NAT>