Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: <vadim@in...> - 2009-12-01 00:25:51
|
Author: vadim Date: 2009-11-30 16:23:43 -0800 (Mon, 30 Nov 2009) New Revision: 1986 Modified: branches/v3_1/build_num branches/v3_1/src/gui/FindObjectWidget.cpp branches/v3_1/src/gui/findobjectwidget_q.ui Log: fixes #755 Modified: branches/v3_1/build_num =================================================================== --- branches/v3_1/build_num 2009-11-30 23:22:07 UTC (rev 1985) +++ branches/v3_1/build_num 2009-12-01 00:23:43 UTC (rev 1986) @@ -1 +1 @@ -#define BUILD_NUM 1984 +#define BUILD_NUM 1985 Modified: branches/v3_1/src/gui/FindObjectWidget.cpp =================================================================== --- branches/v3_1/src/gui/FindObjectWidget.cpp 2009-11-30 23:22:07 UTC (rev 1985) +++ branches/v3_1/src/gui/FindObjectWidget.cpp 2009-12-01 00:23:43 UTC (rev 1986) @@ -50,6 +50,7 @@ #include "fwbuilder/ICMPService.h" #include "fwbuilder/TCPService.h" #include "fwbuilder/UDPService.h" +#include "fwbuilder/MultiAddress.h" #include <QLineEdit> #include <QStackedWidget> @@ -404,33 +405,45 @@ bool FindObjectWidget::validateReplaceObject() { - if (m_widget->findDropArea->isEmpty() || m_widget->replaceDropArea->isEmpty()) + if (m_widget->findDropArea->isEmpty()) { QMessageBox::warning( - this,"Firewall Builder", - tr("Search or Replace object ind't specified.")); + this, "Firewall Builder", tr("Search object is missing.")); return false; } - FWObject *findObj, *replObj; - findObj=m_widget->findDropArea->getObject(); - replObj=m_widget->replaceDropArea->getObject(); - if (findObj==replObj || findObj->getId() == replObj->getId()) + + if (m_widget->replaceDropArea->isEmpty()) { QMessageBox::warning( - this,"Firewall Builder", - tr("Cannot replace object by itself.")); + this, "Firewall Builder", tr("Replace object is missing.")); return false; } - if (!((Address::cast(findObj)!=NULL && Address::cast(replObj)) || - (Service::cast(findObj)!=NULL && Service::cast(replObj)))) + + FWObject* findObj = m_widget->findDropArea->getObject(); + FWObject* replObj = m_widget->replaceDropArea->getObject(); + + if (findObj==replObj || findObj->getId() == replObj->getId()) { QMessageBox::warning( this,"Firewall Builder", - tr("Search and Replace objects are incompatible.")); - + tr("Cannot replace object with itself.")); return false; } - return true; + + bool obj_1_address = Address::cast(findObj)!=NULL || MultiAddress::cast(findObj)!=NULL; + bool obj_2_address = Address::cast(replObj)!=NULL || MultiAddress::cast(replObj)!=NULL; + + bool obj_1_service = Service::cast(findObj)!=NULL; + bool obj_2_service = Service::cast(replObj)!=NULL; + + if ((obj_1_address && obj_2_address) || (obj_1_service && obj_2_service)) + return true; + + QMessageBox::warning( + this,"Firewall Builder", + tr("Search and Replace objects are incompatible.")); + + return false; } void FindObjectWidget::replace() Modified: branches/v3_1/src/gui/findobjectwidget_q.ui =================================================================== --- branches/v3_1/src/gui/findobjectwidget_q.ui 2009-11-30 23:22:07 UTC (rev 1985) +++ branches/v3_1/src/gui/findobjectwidget_q.ui 2009-12-01 00:23:43 UTC (rev 1986) @@ -15,8 +15,8 @@ <property name="windowTitle" > <string>Form1</string> </property> - <layout class="QGridLayout" name="gridLayout_2" > - <item rowspan="3" row="0" column="0" > + <layout class="QGridLayout" name="gridLayout_3" > + <item rowspan="2" row="0" column="0" > <widget class="QGroupBox" name="groupBox4" > <property name="sizePolicy" > <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > @@ -58,7 +58,7 @@ <widget class="QComboBox" name="attribute" > <property name="font" > <font> - <pointsize>9</pointsize> + <pointsize>13</pointsize> </font> </property> <item> @@ -92,7 +92,7 @@ <widget class="QComboBox" name="findAttr" > <property name="font" > <font> - <pointsize>9</pointsize> + <pointsize>13</pointsize> </font> </property> <property name="editable" > @@ -102,6 +102,11 @@ </item> <item row="2" column="0" > <widget class="QCheckBox" name="useRegexp" > + <property name="font" > + <font> + <pointsize>13</pointsize> + </font> + </property> <property name="text" > <string>Use regular expressions</string> </property> @@ -110,7 +115,7 @@ </layout> </widget> </item> - <item rowspan="3" row="0" column="1" > + <item rowspan="2" row="0" column="1" > <widget class="QGroupBox" name="groupBox5" > <property name="sizePolicy" > <sizepolicy vsizetype="Preferred" hsizetype="Preferred" > @@ -158,7 +163,7 @@ </layout> </widget> </item> - <item row="0" column="2" colspan="4" > + <item row="0" column="2" > <widget class="QGroupBox" name="buttonGroup2" > <property name="sizePolicy" > <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > @@ -180,6 +185,11 @@ </property> <item row="0" column="0" > <widget class="QComboBox" name="srScope" > + <property name="font" > + <font> + <pointsize>13</pointsize> + </font> + </property> <item> <property name="text" > <string>Tree only</string> @@ -205,7 +215,7 @@ </layout> </widget> </item> - <item rowspan="3" row="0" column="6" > + <item row="0" column="3" > <spacer> <property name="orientation" > <enum>Qt::Horizontal</enum> @@ -222,58 +232,62 @@ </spacer> </item> <item row="1" column="2" > - <widget class="QPushButton" name="findButton" > - <property name="text" > - <string>Find Next</string> - </property> - <property name="default" > - <bool>true</bool> - </property> - </widget> + <layout class="QGridLayout" name="gridLayout_2" > + <item row="0" column="0" > + <widget class="QPushButton" name="findButton" > + <property name="text" > + <string>Find Next</string> + </property> + <property name="default" > + <bool>true</bool> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="QPushButton" name="replaceButton" > + <property name="text" > + <string>Replace</string> + </property> + </widget> + </item> + <item row="0" column="2" > + <widget class="QPushButton" name="replaceAllButton" > + <property name="text" > + <string>Replace all</string> + </property> + </widget> + </item> + <item row="1" column="0" colspan="2" > + <widget class="QPushButton" name="repNextButton" > + <property name="text" > + <string>Replace Current && Find Next</string> + </property> + <property name="shortcut" > + <string/> + </property> + </widget> + </item> + <item row="1" column="2" > + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>110</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> </item> - <item row="1" column="3" colspan="2" > - <widget class="QPushButton" name="replaceButton" > - <property name="text" > - <string>Replace</string> - </property> - </widget> - </item> - <item row="1" column="5" > - <widget class="QPushButton" name="replaceAllButton" > - <property name="text" > - <string>Replace all</string> - </property> - </widget> - </item> - <item row="2" column="2" colspan="2" > - <widget class="QPushButton" name="repNextButton" > - <property name="text" > - <string>Replace && Find Next</string> - </property> - <property name="shortcut" > - <string/> - </property> - </widget> - </item> - <item row="2" column="4" colspan="2" > + <item row="2" column="2" > <spacer> <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" stdset="0" > - <size> - <width>110</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="3" column="1" colspan="5" > - <spacer> - <property name="orientation" > <enum>Qt::Vertical</enum> </property> <property name="sizeType" > |