[fwbuilder-commits] r1564 - in branches/v3_1: . src/gui
Brought to you by:
mikehorn
From: <va...@in...> - 2009-10-07 01:50:07
|
Author: vadim Date: 2009-10-06 18:49:39 -0700 (Tue, 06 Oct 2009) New Revision: 1564 Modified: branches/v3_1/build_num branches/v3_1/src/gui/FWBMainWindow_q.ui branches/v3_1/src/gui/MainRes.qrc branches/v3_1/src/gui/ObjectManipulator.cpp branches/v3_1/src/gui/ProjectPanel.cpp branches/v3_1/src/gui/ProjectPanel.h branches/v3_1/src/gui/clusterdialog_q.ui branches/v3_1/src/gui/firewalldialog_q.ui branches/v3_1/src/gui/projectpanel_q.ui Log: fixes #496 Add "Compile" and "Install" buttons to the title above the policy view to let the user quickly compile/install currently opened firewall Modified: branches/v3_1/build_num =================================================================== --- branches/v3_1/build_num 2009-10-06 18:16:32 UTC (rev 1563) +++ branches/v3_1/build_num 2009-10-07 01:49:39 UTC (rev 1564) @@ -1 +1 @@ -#define BUILD_NUM 1562 +#define BUILD_NUM 1563 Modified: branches/v3_1/src/gui/FWBMainWindow_q.ui =================================================================== --- branches/v3_1/src/gui/FWBMainWindow_q.ui 2009-10-06 18:16:32 UTC (rev 1563) +++ branches/v3_1/src/gui/FWBMainWindow_q.ui 2009-10-07 01:49:39 UTC (rev 1564) @@ -1056,7 +1056,7 @@ <action name="compileAction" > <property name="icon" > <iconset resource="MainRes.qrc" > - <normaloff>:/Icons/compile_25.png</normaloff>:/Icons/compile_25.png</iconset> + <normaloff>:/Icons/Compile</normaloff>:/Icons/Compile</iconset> </property> <property name="text" > <string>Compile</string> @@ -1067,11 +1067,17 @@ <property name="toolTip" > <string>Compile rules</string> </property> + <property name="statusTip" > + <string>Compile rules</string> + </property> + <property name="whatsThis" > + <string>Compile rules</string> + </property> </action> <action name="installAction" > <property name="icon" > <iconset resource="MainRes.qrc" > - <normaloff>:/Icons/install_25.png</normaloff>:/Icons/install_25.png</iconset> + <normaloff>:/Icons/Install</normaloff>:/Icons/Install</iconset> </property> <property name="text" > <string>Install</string> @@ -1082,6 +1088,12 @@ <property name="toolTip" > <string>Install firewall policy</string> </property> + <property name="statusTip" > + <string>Install firewall policy</string> + </property> + <property name="whatsThis" > + <string>Install firewall policy</string> + </property> </action> <action name="backAction" > <property name="enabled" > @@ -1604,7 +1616,6 @@ </customwidgets> <resources> <include location="MainRes.qrc" /> - <include location="MainRes.qrc" /> </resources> <connections> <connection> Modified: branches/v3_1/src/gui/MainRes.qrc =================================================================== --- branches/v3_1/src/gui/MainRes.qrc 2009-10-06 18:16:32 UTC (rev 1563) +++ branches/v3_1/src/gui/MainRes.qrc 2009-10-07 01:49:39 UTC (rev 1564) @@ -60,7 +60,7 @@ <file alias="Icons/Interval/icon-tree" >Icons/clock_16.png</file> <file alias="Icons/Interval/icon" >Icons/clock_25.png</file> <file>Icons/close.png</file> - <file>Icons/compile_25.png</file> + <file alias="Icons/Compile" >Icons/compile_25.png</file> <file alias="Icons/Continue-tree" >Icons/continue_16.png</file> <file alias="Icons/Continue" >Icons/continue_25.png</file> <file alias="Icons/Custom-tree" >Icons/custom_16.png</file> @@ -97,7 +97,7 @@ <file alias="Icons/Inbound" >Icons/inbound_25.png</file> <file alias="Icons/Inbound-tree" >Icons/inbound_16.png</file> <file>Icons/info_25.png</file> - <file>Icons/install_25.png</file> + <file alias="Icons/Install" >Icons/install_25.png</file> <file alias="Icons/Interface/icon-neg-tree" >Icons/interface-neg_16.png</file> <file alias="Icons/Interface/icon-neg" >Icons/interface-neg_25.png</file> <file alias="Icons/Interface/icon-ref" >Icons/interface-ref_25.png</file> Modified: branches/v3_1/src/gui/ObjectManipulator.cpp =================================================================== --- branches/v3_1/src/gui/ObjectManipulator.cpp 2009-10-06 18:16:32 UTC (rev 1563) +++ branches/v3_1/src/gui/ObjectManipulator.cpp 2009-10-07 01:49:39 UTC (rev 1564) @@ -1665,7 +1665,6 @@ extractFirewallsFromGroup(gr,fo); } } - } void ObjectManipulator::extractFirewallsFromGroup(ObjectGroup *gr, @@ -1683,16 +1682,10 @@ { if (getCurrentObjectTree()->getNumSelected()==0) return; - //FWObject *obj=getCurrentObjectTree()->getSelectedObjects().front(); - //if (obj==NULL) return; - //m_project->showFirewall(obj); - vector<FWObject*> so = getCurrentObjectTree()->getSimplifiedSelection(); set<Firewall*> fo; filterFirewallsFromSelection(so,fo); - - m_project->install(fo); } Modified: branches/v3_1/src/gui/ProjectPanel.cpp =================================================================== --- branches/v3_1/src/gui/ProjectPanel.cpp 2009-10-06 18:16:32 UTC (rev 1563) +++ branches/v3_1/src/gui/ProjectPanel.cpp 2009-10-07 01:49:39 UTC (rev 1564) @@ -222,9 +222,9 @@ getCurrentRuleSetView()->selectRE( obj ); } -RuleSetView * ProjectPanel::getCurrentRuleSetView () +RuleSetView * ProjectPanel::getCurrentRuleSetView() { - return dynamic_cast<RuleSetView*>(m_panel->ruleSets->currentWidget ()); + return dynamic_cast<RuleSetView*>(m_panel->ruleSets->currentWidget()); } @@ -324,8 +324,7 @@ void ProjectPanel::updateFirewallName() { - if (visibleRuleSet==NULL) - return ; + if (visibleRuleSet==NULL) return ; QString name = "<B>"; FWObject * p = visibleRuleSet->getParent(); @@ -756,6 +755,30 @@ return rcs; } +void ProjectPanel::compileThis() +{ + if (visibleRuleSet==NULL) return ; + set<Firewall*> fw; + Firewall *f = Firewall::cast(visibleRuleSet->getParent()); + if (f) + { + fw.insert(f); + compile(fw); + } +} + +void ProjectPanel::installThis() +{ + if (visibleRuleSet==NULL) return ; + set<Firewall*> fw; + Firewall *f = Firewall::cast(visibleRuleSet->getParent()); + if (f) + { + fw.insert(f); + install(fw); + } +} + void ProjectPanel::compile() { if (mw->isEditorVisible() && Modified: branches/v3_1/src/gui/ProjectPanel.h =================================================================== --- branches/v3_1/src/gui/ProjectPanel.h 2009-10-06 18:16:32 UTC (rev 1563) +++ branches/v3_1/src/gui/ProjectPanel.h 2009-10-07 01:49:39 UTC (rev 1564) @@ -278,7 +278,9 @@ void splitterMoved ( int pos, int index ); virtual void autoSave(); - + virtual void compileThis(); + virtual void installThis(); + public: QString getFileName(); bool editingLibrary(); Modified: branches/v3_1/src/gui/clusterdialog_q.ui =================================================================== --- branches/v3_1/src/gui/clusterdialog_q.ui 2009-10-06 18:16:32 UTC (rev 1563) +++ branches/v3_1/src/gui/clusterdialog_q.ui 2009-10-07 01:49:39 UTC (rev 1564) @@ -252,11 +252,23 @@ <item row="1" column="1" > <widget class="QCheckBox" name="inactive" > <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Minimum" > + <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>215</width> + <height>0</height> + </size> + </property> + <property name="maximumSize" > + <size> + <width>215</width> + <height>16777215</height> + </size> + </property> <property name="toolTip" > <string>Skip this firewall for batch compile and install operations</string> </property> @@ -268,7 +280,7 @@ <item row="1" column="2" > <widget class="QTextEdit" name="comment" > <property name="sizePolicy" > - <sizepolicy vsizetype="Expanding" hsizetype="Fixed" > + <sizepolicy vsizetype="Expanding" hsizetype="Expanding" > <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -308,7 +320,6 @@ <tabstop>inactive</tabstop> <tabstop>comment</tabstop> </tabstops> - <includes/> <resources> <include location="MainRes.qrc" /> </resources> Modified: branches/v3_1/src/gui/firewalldialog_q.ui =================================================================== --- branches/v3_1/src/gui/firewalldialog_q.ui 2009-10-06 18:16:32 UTC (rev 1563) +++ branches/v3_1/src/gui/firewalldialog_q.ui 2009-10-07 01:49:39 UTC (rev 1564) @@ -368,11 +368,23 @@ <item row="3" column="1" > <widget class="QCheckBox" name="inactive" > <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Minimum" > + <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>215</width> + <height>0</height> + </size> + </property> + <property name="maximumSize" > + <size> + <width>215</width> + <height>16777215</height> + </size> + </property> <property name="toolTip" > <string>Skip this firewall for batch compile and install operations</string> </property> @@ -412,7 +424,6 @@ <tabstop>inactive</tabstop> <tabstop>comment</tabstop> </tabstops> - <includes/> <resources> <include location="MainRes.qrc" /> </resources> Modified: branches/v3_1/src/gui/projectpanel_q.ui =================================================================== --- branches/v3_1/src/gui/projectpanel_q.ui 2009-10-06 18:16:32 UTC (rev 1563) +++ branches/v3_1/src/gui/projectpanel_q.ui 2009-10-07 01:49:39 UTC (rev 1564) @@ -97,37 +97,96 @@ <enum>QFrame::Raised</enum> </property> <layout class="QGridLayout" name="gridLayout" > - <property name="leftMargin" > + <property name="margin" > <number>0</number> </property> - <property name="topMargin" > - <number>10</number> - </property> - <property name="rightMargin" > + <property name="spacing" > <number>0</number> </property> - <property name="bottomMargin" > - <number>0</number> - </property> - <property name="horizontalSpacing" > - <number>0</number> - </property> <item row="0" column="0" > - <widget class="QLabel" name="rulesetname" > - <property name="font" > - <font> - <pointsize>14</pointsize> - <weight>75</weight> - <bold>true</bold> - </font> + <layout class="QHBoxLayout" name="horizontalLayout" > + <property name="spacing" > + <number>12</number> </property> - <property name="text" > - <string>Firewall / ruleset</string> - </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> - </property> - </widget> + <item> + <widget class="QToolButton" name="compile_this_fw" > + <property name="toolTip" > + <string>Compile this firewall</string> + </property> + <property name="statusTip" > + <string>Compile this firewall</string> + </property> + <property name="whatsThis" > + <string>Compile this firewall</string> + </property> + <property name="text" > + <string>...</string> + </property> + <property name="icon" > + <iconset resource="MainRes.qrc" > + <normaloff>:/Icons/Compile</normaloff>:/Icons/Compile</iconset> + </property> + <property name="iconSize" > + <size> + <width>25</width> + <height>25</height> + </size> + </property> + <property name="checkable" > + <bool>false</bool> + </property> + <property name="popupMode" > + <enum>QToolButton::DelayedPopup</enum> + </property> + <property name="arrowType" > + <enum>Qt::NoArrow</enum> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="install_this_fw" > + <property name="toolTip" > + <string>Compile and install this firewall</string> + </property> + <property name="statusTip" > + <string>Compile and install this firewall</string> + </property> + <property name="whatsThis" > + <string>Compile and install this firewall</string> + </property> + <property name="text" > + <string>...</string> + </property> + <property name="icon" > + <iconset resource="MainRes.qrc" > + <normaloff>:/Icons/Install</normaloff>:/Icons/Install</iconset> + </property> + <property name="iconSize" > + <size> + <width>25</width> + <height>25</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="rulesetname" > + <property name="font" > + <font> + <pointsize>14</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text" > + <string>Firewall / ruleset</string> + </property> + <property name="alignment" > + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + </widget> + </item> + </layout> </item> <item row="1" column="0" > <widget class="QStackedWidget" name="ruleSets" > @@ -155,5 +214,42 @@ <resources> <include location="MainRes.qrc" /> </resources> - <connections/> + <connections> + <connection> + <sender>compile_this_fw</sender> + <signal>clicked()</signal> + <receiver>ProjectPanel_q</receiver> + <slot>compileThis()</slot> + <hints> + <hint type="sourcelabel" > + <x>344</x> + <y>30</y> + </hint> + <hint type="destinationlabel" > + <x>417</x> + <y>246</y> + </hint> + </hints> + </connection> + <connection> + <sender>install_this_fw</sender> + <signal>clicked()</signal> + <receiver>ProjectPanel_q</receiver> + <slot>installThis()</slot> + <hints> + <hint type="sourcelabel" > + <x>391</x> + <y>30</y> + </hint> + <hint type="destinationlabel" > + <x>417</x> + <y>246</y> + </hint> + </hints> + </connection> + </connections> + <slots> + <slot>compileThis()</slot> + <slot>installThis()</slot> + </slots> </ui> |