1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2026-03-22 19:27:13 +01:00
improved design of the widget used to edit ip addresses and other
attributes of an interface in the new firewall, new host and new
cluster wizards. Removed "MAC Address" imput field and rearranged
other input fields according to the result of usability tests.
This commit is contained in:
Vadim Kurland 2010-10-04 23:37:38 +00:00
parent 053ac47849
commit cee564ac89
4 changed files with 244 additions and 180 deletions

View File

@ -1 +1 @@
#define BUILD_NUM 3313
#define BUILD_NUM 3315

View File

@ -1,5 +1,11 @@
2010-10-04 Vadim Kurland <vadim@vk.crocodile.org>
* InterfaceEditorWidget.cpp (InterfaceEditorWidget): fixed #1772
improved design of the widget used to edit ip addresses and other
attributes of an interface in the new firewall, new host and new
cluster wizards. Removed "MAC Address" imput field and rearranged
other input fields according to the result of usability tests.
* SSHCisco.cpp (SSHCisco): fixed #1784 added Cisco ASA (PIX) error
message "cannot add route entry" to the list of errors that
built-in installer recognizes and marks install process as

View File

@ -36,6 +36,22 @@
using namespace libfwbuilder;
using namespace std;
InterfaceEditorWidget::InterfaceEditorWidget(QWidget *parent) :
QWidget(parent),
m_ui(new Ui::InterfaceEditorWidget)
{
tabw = dynamic_cast<QTabWidget*>(parent);
this->interfacep = NULL;
m_ui->setupUi(this);
setClusterMode(false);
this->m_ui->name->setText(""); // blank interface name
this->m_ui->label->clear();
this->m_ui->comment->clear();
// addNewAddress();
}
InterfaceEditorWidget::InterfaceEditorWidget(QWidget *parent, Interface *iface) :
QWidget(parent),
m_ui(new Ui::InterfaceEditorWidget)
@ -47,8 +63,9 @@ InterfaceEditorWidget::InterfaceEditorWidget(QWidget *parent, Interface *iface)
this->m_ui->name->setText(interfacep->getName().c_str());
this->m_ui->label->setText(interfacep->getLabel().c_str());
if (iface->getPhysicalAddress() != NULL)
m_ui->mac->setText(iface->getPhysicalAddress()->getPhysAddress().c_str());
// if (iface->getPhysicalAddress() != NULL)
// m_ui->mac->setText(iface->getPhysicalAddress()->getPhysAddress().c_str());
this->m_ui->comment->setPlainText(iface->getComment().c_str());
if ( this->interfacep->isDyn() ) this->m_ui->type->setCurrentIndex(1);
@ -75,7 +92,8 @@ InterfaceEditorWidget::InterfaceEditorWidget(QWidget *parent, Interface *iface)
}
InterfaceEditorWidget::InterfaceEditorWidget(QWidget *parent, ClusterInterfaceData data) :
InterfaceEditorWidget::InterfaceEditorWidget(QWidget *parent,
ClusterInterfaceData data) :
QWidget(parent),
m_ui(new Ui::InterfaceEditorWidget)
{
@ -112,7 +130,7 @@ void InterfaceEditorWidget::setData(InterfaceData *data)
this->m_ui->name->setText(data->name.c_str());
this->m_ui->label->setText(data->label.c_str());
this->m_ui->mac->setText(data->mac_addr.c_str());
// this->m_ui->mac->setText(data->mac_addr.c_str());
this->m_ui->comment->clear();
@ -135,21 +153,6 @@ void InterfaceEditorWidget::setData(InterfaceData *data)
}
}
InterfaceEditorWidget::InterfaceEditorWidget(QWidget *parent) :
QWidget(parent),
m_ui(new Ui::InterfaceEditorWidget)
{
tabw = dynamic_cast<QTabWidget*>(parent);
this->interfacep = NULL;
m_ui->setupUi(this);
setClusterMode(false);
this->m_ui->name->setText(""); // blank interface name
this->m_ui->label->clear();
this->m_ui->comment->clear();
addNewAddress();
}
void InterfaceEditorWidget::deleteAddress()
{
QPushButton *button = dynamic_cast<QPushButton*>(sender());
@ -247,7 +250,8 @@ EditedInterfaceData InterfaceEditorWidget::getInterfaceData()
res.type = this->m_ui->type->currentIndex();
res.protocol = this->m_ui->protocol->currentText();
res.mac = this->m_ui->mac->text();
// res.mac = this->m_ui->mac->text();
bool noAddrs = false;
// if (clusterMode)
// noAddrs = Resources::os_res[os.toStdString()]->getResourceBool(
@ -441,12 +445,13 @@ void InterfaceEditorWidget::resizeEvent ( QResizeEvent * )
void InterfaceEditorWidget::addressChanged(int row, int col)
{
if (m_ui->addresses->rowCount() >= 1)
m_ui->addAddress->setText(tr("Add another address"));
else
// if (m_ui->addresses->rowCount() >= 1)
// m_ui->addAddress->setText(tr("Add another address"));
// else
m_ui->addAddress->setText(tr("Add address"));
if ( row < 0 || col < 0 || rows.isEmpty() || row > m_ui->addresses->rowCount() || col > 1 ) return;
if ( row < 0 || col < 0 ||
rows.isEmpty() || row > m_ui->addresses->rowCount() || col > 1 ) return;
if (!rows.keys().contains(row)) return;
QString address = this->rows[row].first->text();
@ -464,8 +469,8 @@ void InterfaceEditorWidget::setClusterMode(bool st)
this->m_ui->name->setEnabled(!st);
this->m_ui->protocol->setVisible(st);
this->m_ui->protocolLabel->setVisible(st);
this->m_ui->mac->setVisible(!st);
this->m_ui->macLabel->setVisible(!st);
// this->m_ui->mac->setVisible(!st);
// this->m_ui->macLabel->setVisible(!st);
this->m_ui->type->setVisible(!st);
this->m_ui->typeLabel->setVisible(!st);
}
@ -509,6 +514,9 @@ void InterfaceEditorWidget::setHostOS(const QString &s)
#if (QT_VERSION >= 0x040700)
this->m_ui->name->setPlaceholderText(name_prompt);
this->m_ui->label->setPlaceholderText("outside, inside, etc");
this->m_ui->label->setPlaceholderText("outside, inside, etc (optional)");
#endif
this->m_ui->name->setToolTip(name_prompt);
this->m_ui->label->setToolTip("outside, inside, etc (optional)");
}

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>479</width>
<height>391</height>
<width>434</width>
<height>359</height>
</rect>
</property>
<property name="windowTitle">
@ -15,156 +15,134 @@
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_1">
<property name="text">
<string>Name:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="name">
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Label:</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLineEdit" name="label">
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="typeLabel">
<property name="text">
<string>Type:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="type">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Static IP address</string>
</property>
</item>
<item>
<property name="text">
<string>Dynamic IP address</string>
</property>
</item>
<item>
<property name="text">
<string>Unnumbered interface</string>
</property>
</item>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="macLabel">
<property name="text">
<string>MAC address:</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLineEdit" name="mac">
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Comment:</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="3">
<widget class="QTextEdit" name="comment">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>40</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>70</height>
</size>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="protocolLabel">
<property name="text">
<string>Protocol:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="protocol">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="explanation">
<widget class="QLabel" name="label_1">
<property name="text">
<string/>
<string>Name:</string>
</property>
<property name="wordWrap">
<bool>true</bool>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="name">
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Label:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLineEdit" name="label">
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="typeLabel">
<property name="text">
<string>Type:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="type">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Static IP address</string>
</property>
</item>
<item>
<property name="text">
<string>Dynamic IP address</string>
</property>
</item>
<item>
<property name="text">
<string>Unnumbered interface</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>48</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="addAddress">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Add address</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>228</width>
<height>23</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="3" column="0" colspan="4">
<widget class="QTableWidget" name="addresses">
<attribute name="horizontalHeaderDefaultSectionSize">
<number>50</number>
</attribute>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>50</number>
</attribute>
<column>
<property name="text">
<string>Address</string>
@ -187,18 +165,92 @@
</column>
</widget>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="addAddress">
<item row="4" column="0" colspan="4">
<widget class="QLabel" name="explanation">
<property name="text">
<string>explanation text</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0" colspan="4">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="protocolLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Failover protocol:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="protocol">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>298</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Add address</string>
<string>Comment:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QTextEdit" name="comment">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>40</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>70</height>
</size>
</property>
</widget>
</item>
@ -210,11 +262,9 @@
<tabstop>name</tabstop>
<tabstop>label</tabstop>
<tabstop>type</tabstop>
<tabstop>mac</tabstop>
<tabstop>comment</tabstop>
<tabstop>protocol</tabstop>
<tabstop>addresses</tabstop>
<tabstop>addAddress</tabstop>
</tabstops>
<resources/>
<connections>