r11108 - in lmledit/trunk: . ui
[email protected] Wed, 11 Feb 2009 22:56:25 +0100 (CET)
Newsgroups
gmane.comp.security.ids.prelude.cvs
Message-ID
<[email protected] >
Author: pollux
Date: 2009-02-11 22:56:24 +0100 (Wed, 11 Feb 2009)
New Revision: 11108
Modified:
lmledit/trunk/mainwindow.cpp
lmledit/trunk/mainwindow.h
lmledit/trunk/ui/mainwindow.ui
Log:
First step towards save function: add action, callback, and code to save rule (on stdout for the moment)
Modified: lmledit/trunk/mainwindow.cpp
===================================================================
--- lmledit/trunk/mainwindow.cpp 2009-02-11 21:00:31 UTC (rev 11107)
+++ lmledit/trunk/mainwindow.cpp 2009-02-11 21:56:24 UTC (rev 11108)
@@ -35,6 +35,7 @@
{
connect(ui->addRuleAct, SIGNAL(triggered()), this, SLOT(addRule()));
connect(ui->openRulesetAct, SIGNAL(triggered()), this, SLOT(openRuleset()));
+ connect(ui->saveAct, SIGNAL(triggered()), this, SLOT(saveRuleset()));
connect(ui->rulesView,SIGNAL(itemActivated(QListWidgetItem *)),this,SLOT(editRule(QListWidgetItem*)));
@@ -75,6 +76,15 @@
// }
}
+void LMLEditMainWindow::saveRuleset()
+{
+ for (int i = 0; i < rulesList.size(); ++i) {
+ Rule * rule = rulesList.at(i);
+ std::cout << "Rule " << i << ": " << rule << "\n";
+ }
+
+}
+
void LMLEditMainWindow::showConfig()
{
QDialog * configDlg = getConfigDialog();
@@ -104,6 +114,7 @@
} else {
it = ui->rulesView->item(rule_index);
if (it != NULL) {
+ // TODO display relevant part of rule
it->setData(Qt::DisplayRole,ruleEdit->regex());
old_rule = rulesList.at(rule_index);
Q_ASSERT(old_rule != NULL);
Modified: lmledit/trunk/mainwindow.h
===================================================================
--- lmledit/trunk/mainwindow.h 2009-02-11 21:00:31 UTC (rev 11107)
+++ lmledit/trunk/mainwindow.h 2009-02-11 21:56:24 UTC (rev 11108)
@@ -31,6 +31,7 @@
void editRule(QListWidgetItem * item);
void openRuleset();
+ void saveRuleset();
void ruleModified();
Modified: lmledit/trunk/ui/mainwindow.ui
===================================================================
--- lmledit/trunk/ui/mainwindow.ui 2009-02-11 21:00:31 UTC (rev 11107)
+++ lmledit/trunk/ui/mainwindow.ui 2009-02-11 21:56:24 UTC (rev 11108)
@@ -10,9 +10,7 @@
</rect>
</property>
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -22,18 +20,16 @@
</property>
<widget class="QWidget" name="centralwidget" >
<layout class="QHBoxLayout" >
+ <property name="spacing" >
+ <number>6</number>
+ </property>
<property name="margin" >
<number>9</number>
</property>
- <property name="spacing" >
- <number>6</number>
- </property>
<item>
<widget class="QListWidget" name="rulesView" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>7</vsizetype>
+ <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>9</horstretch>
<verstretch>9</verstretch>
</sizepolicy>
@@ -48,7 +44,7 @@
<x>0</x>
<y>0</y>
<width>664</width>
- <height>29</height>
+ <height>30</height>
</rect>
</property>
<widget class="QMenu" name="menu_Edit" >
@@ -88,10 +84,14 @@
<enum>Qt::Horizontal</enum>
</property>
<attribute name="toolBarArea" >
- <number>4</number>
+ <enum>TopToolBarArea</enum>
</attribute>
+ <attribute name="toolBarBreak" >
+ <bool>false</bool>
+ </attribute>
<addaction name="openRulesetAct" />
<addaction name="addRuleAct" />
+ <addaction name="saveAct" />
<addaction name="settingsAct" />
</widget>
<action name="actionQuit" >
@@ -112,7 +112,8 @@
</action>
<action name="openRulesetAct" >
<property name="icon" >
- <iconset resource="../application.qrc" >:/images/open.png</iconset>
+ <iconset resource="../application.qrc" >
+ <normaloff>:/images/open.png</normaloff>:/images/open.png</iconset>
</property>
<property name="text" >
<string>&Open Ruleset</string>
@@ -126,7 +127,8 @@
</action>
<action name="addRuleAct" >
<property name="icon" >
- <iconset resource="../application.qrc" >:/images/plus.png</iconset>
+ <iconset resource="../application.qrc" >
+ <normaloff>:/images/plus.png</normaloff>:/images/plus.png</iconset>
</property>
<property name="text" >
<string>&Add Rule</string>
@@ -140,7 +142,8 @@
</action>
<action name="settingsAct" >
<property name="icon" >
- <iconset resource="../application.qrc" >:/images/settings.png</iconset>
+ <iconset resource="../application.qrc" >
+ <normaloff>:/images/settings.png</normaloff>:/images/settings.png</iconset>
</property>
<property name="text" >
<string>&Settings</string>
@@ -176,6 +179,18 @@
<string>F1</string>
</property>
</action>
+ <action name="saveAct" >
+ <property name="icon" >
+ <iconset resource="../application.qrc" >
+ <normaloff>:/images/save.png</normaloff>:/images/save.png</iconset>
+ </property>
+ <property name="text" >
+ <string>&Save</string>
+ </property>
+ <property name="statusTip" >
+ <string>Save ruleset file</string>
+ </property>
+ </action>
</widget>
<resources>
<include location="../application.qrc" />
_______________________________________________
Prelude-cvslog site list
[email protected]
http://lists.prelude-ids.org/mailman/listinfo/prelude-cvslog