mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-16 01:49:23 +02:00
@@ -47,7 +47,27 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="fileSelector"/>
|
||||
<widget class="QComboBox" name="fileSelector">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
@@ -122,8 +142,8 @@ p, li { white-space: pre-wrap; }
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>238</x>
|
||||
<y>406</y>
|
||||
<x>337</x>
|
||||
<y>475</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>447</x>
|
||||
@@ -138,8 +158,8 @@ p, li { white-space: pre-wrap; }
|
||||
<slot>fileSelected(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>55</x>
|
||||
<y>26</y>
|
||||
<x>90</x>
|
||||
<y>53</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>4</x>
|
||||
|
||||
+32
-11
@@ -847,19 +847,40 @@ void ProjectPanel::inspectAll()
|
||||
list<Firewall*> fws;
|
||||
om->findAllFirewalls(fws);
|
||||
QStringList files;
|
||||
|
||||
set<Firewall*> needCompile;
|
||||
foreach(Firewall *fw, fws)
|
||||
if (fw->needsCompile())
|
||||
needCompile.insert(fw);
|
||||
if (!needCompile.empty())
|
||||
{
|
||||
QString text;
|
||||
QStringList names;
|
||||
foreach(Firewall *fw, needCompile)
|
||||
names.append(fw->getName().c_str());
|
||||
if (needCompile.size() > 1 && needCompile.size() < 5)
|
||||
{
|
||||
QString last = names.last();
|
||||
names.pop_back();
|
||||
QString firewalls = "\"" + names.join("\", \"") + "\" " + tr("and") + " \"" + last + "\"";
|
||||
text = tr("Firewall objects %1 has been modified and needs to be recompiled.").arg(firewalls);
|
||||
}
|
||||
else if (needCompile.size() == 1)
|
||||
text = tr("Firewall object \"%1\" has been modified and needs to be recompiled.").arg(names.first());
|
||||
else
|
||||
{
|
||||
text = tr("%1 firewall objects has been modified and needs to be recompiled.").arg(needCompile.size());
|
||||
}
|
||||
messageBox.setText(text);
|
||||
messageBox.exec();
|
||||
if (messageBox.result() == QMessageBox::Accepted)
|
||||
{
|
||||
this->compile(needCompile);
|
||||
}
|
||||
return;
|
||||
}
|
||||
foreach(Firewall *fw, fws)
|
||||
{
|
||||
if (fw->getLastModified() > fw->getLastCompiled())
|
||||
{
|
||||
messageBox.setText(tr("Firewall object \"%1\" has been modified and needs to be recompiled.").arg(fw->getName().c_str()));
|
||||
messageBox.exec();
|
||||
if (messageBox.result() == QMessageBox::Accepted)
|
||||
{
|
||||
this->compileThis();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
bool canShowCode = true;
|
||||
QString mainFile = FirewallInstaller::getGeneratedFileFullPath(fw);
|
||||
if (QFile::exists(mainFile))
|
||||
|
||||
+10
-3
@@ -480,15 +480,23 @@ void instDialog::showPage(const int page)
|
||||
foreach(Firewall *f, firewalls)
|
||||
{
|
||||
QString mainFile = FirewallInstaller::getGeneratedFileFullPath(f);
|
||||
if (!QFile::exists(mainFile)) continue;
|
||||
instConf cnf;
|
||||
cnf.fwobj = f;
|
||||
cnf.script = mainFile;
|
||||
QMap<QString, QString> res;
|
||||
FirewallInstaller(NULL, &cnf, "").readManifest(mainFile, &res);
|
||||
files += res.keys();
|
||||
foreach(QString item, res.keys())
|
||||
if (QFile::exists(item))
|
||||
files.append(item);
|
||||
}
|
||||
|
||||
if (files.isEmpty())
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), tr("No files were generated, there is nothing to show."));
|
||||
return;
|
||||
}
|
||||
|
||||
// what is this?
|
||||
if (m_dialog->stackedWidget->count() == 4 )
|
||||
m_dialog->stackedWidget->removeWidget(m_dialog->stackedWidget->widget(3));
|
||||
|
||||
@@ -521,7 +529,6 @@ void instDialog::showPage(const int page)
|
||||
frame->layout()->setContentsMargins(0,0,0,0);
|
||||
|
||||
m_dialog->stackedWidget->addWidget(container);
|
||||
|
||||
m_dialog->stackedWidget->setCurrentIndex(m_dialog->stackedWidget->count()-1);
|
||||
|
||||
setNextEnabled(page, true);
|
||||
|
||||
Reference in New Issue
Block a user