[prelude-cvslog] r10480 - lmledit/trunk

noreply at prelude-ids.org noreply at prelude-ids.org
Mon Apr 7 17:48:14 CEST 2008


Author: pollux
Date: 2008-04-07 17:48:12 +0200 (Mon, 07 Apr 2008)
New Revision: 10480

Added:
   lmledit/trunk/helpwindow.cpp
   lmledit/trunk/helpwindow.h
   lmledit/trunk/helpwindow.ui
   lmledit/trunk/mainwindow.ui
Modified:
   lmledit/trunk/CMakeLists.txt
   lmledit/trunk/main.cpp
   lmledit/trunk/mainwindow.cpp
   lmledit/trunk/mainwindow.h
   lmledit/trunk/rule-editor.cpp
Log:
Convert UI interfaces to designer
Add help window (text has to be written)


Modified: lmledit/trunk/CMakeLists.txt
===================================================================
--- lmledit/trunk/CMakeLists.txt	2008-04-03 15:06:47 UTC (rev 10479)
+++ lmledit/trunk/CMakeLists.txt	2008-04-07 15:48:12 UTC (rev 10480)
@@ -29,6 +29,7 @@
 
 SET(GUI_SRCS
 	configdialog.cpp
+	helpwindow.cpp
 	highlighter.cpp
 	mainwindow.cpp
 	regex-pcre.cpp
@@ -40,6 +41,7 @@
 
 SET(GUI_HDRS
 	configdialog.h
+	helpwindow.h
 	highlighter.h
 	mainwindow.h
 	regex-pcre.h
@@ -56,7 +58,9 @@
 QT4_AUTOMOC( ${GUI_SRCS} )
 
 SET(lmledit_UIS
-        dialogConfig.ui
+	dialogConfig.ui
+	helpwindow.ui
+	mainwindow.ui
 )
 QT4_WRAP_UI(lmledit_UIS_H ${lmledit_UIS})
 

Added: lmledit/trunk/helpwindow.cpp
===================================================================
--- lmledit/trunk/helpwindow.cpp	                        (rev 0)
+++ lmledit/trunk/helpwindow.cpp	2008-04-07 15:48:12 UTC (rev 10480)
@@ -0,0 +1,33 @@
+#include <QDialog>
+#include <QFile>
+#include <QMessageBox>
+#include <QObject>
+#include <QTextStream>
+
+#include "helpwindow.h"
+
+#include <ui_helpwindow.h>
+
+void show_helpwindow()
+{
+	QString fileName = "PreludeLML.txt";
+	QFile file(fileName);
+	if (!file.open(QFile::ReadOnly | QFile::Text)) {
+		QMessageBox::warning(NULL, QObject::tr("Application"),
+				QObject::tr("Cannot read file %1:\n%2.")
+				.arg(fileName)
+				.arg(file.errorString()));
+		return;
+	}
+
+	QDialog *window = new QDialog;
+	Ui::helpWindow ui;
+	ui.setupUi(window);
+
+	QTextStream in(&file);
+	QApplication::setOverrideCursor(Qt::WaitCursor);
+	ui.textEdit->setPlainText(in.readAll());
+	QApplication::restoreOverrideCursor();
+
+	window->show();
+}

Added: lmledit/trunk/helpwindow.h
===================================================================
--- lmledit/trunk/helpwindow.h	                        (rev 0)
+++ lmledit/trunk/helpwindow.h	2008-04-07 15:48:12 UTC (rev 10480)
@@ -0,0 +1,6 @@
+#ifndef __HELP_WINDOW__
+#define __HELP_WINDOW__
+
+void show_helpwindow();
+
+#endif /* __HELP_WINDOW__ */

Added: lmledit/trunk/helpwindow.ui
===================================================================
--- lmledit/trunk/helpwindow.ui	                        (rev 0)
+++ lmledit/trunk/helpwindow.ui	2008-04-07 15:48:12 UTC (rev 10480)
@@ -0,0 +1,43 @@
+<ui version="4.0" >
+ <class>helpWindow</class>
+ <widget class="QWidget" name="helpWindow" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>600</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>LMLEdit Help</string>
+  </property>
+  <widget class="QWidget" name="horizontalLayout" >
+   <property name="geometry" >
+    <rect>
+     <x>-1</x>
+     <y>-1</y>
+     <width>801</width>
+     <height>601</height>
+    </rect>
+   </property>
+   <layout class="QHBoxLayout" >
+    <property name="margin" >
+     <number>0</number>
+    </property>
+    <property name="spacing" >
+     <number>6</number>
+    </property>
+    <item>
+     <widget class="QTextEdit" name="textEdit" >
+      <property name="readOnly" >
+       <bool>true</bool>
+      </property>
+     </widget>
+    </item>
+   </layout>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

Modified: lmledit/trunk/main.cpp
===================================================================
--- lmledit/trunk/main.cpp	2008-04-03 15:06:47 UTC (rev 10479)
+++ lmledit/trunk/main.cpp	2008-04-07 15:48:12 UTC (rev 10480)
@@ -1,8 +1,6 @@
 #include <QApplication>
 #include <QLocale>
 #include <QTranslator>
-//#include <QPushButton>
-//#include <QGridLayout>
 
 #include "mainwindow.h"
 
@@ -10,29 +8,15 @@
 {
 	QApplication app(argc, argv);
 
-//	qDebug("Hello, world !");
-//
-//	QWidget *window = new QWidget;
-//	QGridLayout *layout = new QGridLayout;
-//
-//	QPushButton hello("Hello world!");
-//	hello.resize(100,30);
-//
-//	layout->addWidget(&hello, 0, 0);
-//
-//	window->setLayout(layout);
-//	window->show();
+	// see http://doc.trolltech.com/4.3/linguist-programmers.html
+	QTranslator translator;
+	QString locale = QLocale::system().name();
+	qDebug("Locale: %s",(const char*)locale.toAscii());
+	translator.load(QString("lmledit_") + locale);
+	app.installTranslator(&translator);
 
-        // see http://doc.trolltech.com/4.3/linguist-programmers.html
-        QTranslator translator;
-        QString locale = QLocale::system().name();
-        qDebug("Locale: %s",(const char*)locale.toAscii());
-        translator.load(QString("lmledit_") + locale);
-        app.installTranslator(&translator);
+	LMLEditMainWindow * mainWindow = new LMLEditMainWindow();
+	mainWindow->show();
 
-	MainWindow mainWin;
-
-	mainWin.show();
-
 	return app.exec();
 }

Modified: lmledit/trunk/mainwindow.cpp
===================================================================
--- lmledit/trunk/mainwindow.cpp	2008-04-03 15:06:47 UTC (rev 10479)
+++ lmledit/trunk/mainwindow.cpp	2008-04-07 15:48:12 UTC (rev 10480)
@@ -1,6 +1,7 @@
 #include <QtGui>
 
 #include "configdialog.h"
+#include "helpwindow.h"
 #include "mainwindow.h"
 #include "highlighter.h"
 
@@ -9,6 +10,8 @@
 
 #include "rule-editor.h"
 
+#include <ui_mainwindow.h>
+
 #include "mainwindow.moc"
 
 /*
@@ -16,139 +19,114 @@
  * Recent files : http://doc.trolltech.com/4.3/mainwindows-recentfiles.html
  */
 
-MainWindow::MainWindow()
-	: QMainWindow(), ruleEdit(NULL)
+LMLEditMainWindow::LMLEditMainWindow(QWidget *parent)
+	: QMainWindow(parent)
 {
-	createActions();
-	createMenus();
+	ui = new Ui::MainWindow();
+	ui->setupUi(this);
 
-	createToolBars();
+	connectSlots();
 
-	createStatusBar();
-
-	createRulesWidgets();
-
-	layout = new QVBoxLayout;
-	layout->addWidget(rulesView);
-
-	QWidget * w = new QWidget;
-	w->setLayout(layout);
-	setCentralWidget(w);
-
-	this->resize(600,500);
+	ruleEdit = new RuleEditor();
+	connect(ruleEdit,SIGNAL(accepted()),this,SLOT(ruleModified()));
 }
 
-void MainWindow::createMenus()
+void LMLEditMainWindow::connectSlots()
 {
-	fileMenu = menuBar()->addMenu(tr("&File"));
-	fileMenu->addAction(importRulesetAct);
-	fileMenu->addAction(addRuleAct);
-	fileMenu->addAction(exitAct);
+	connect(ui->addRuleAct, SIGNAL(triggered()), this, SLOT(addRule()));
+	connect(ui->openRulesetAct, SIGNAL(triggered()), this, SLOT(openRuleset()));
 
-	editMenu = menuBar()->addMenu(tr("&Edit"));
-	editMenu->addAction(settingsAct);
+	connect(ui->rulesView,SIGNAL(itemActivated(QListWidgetItem *)),this,SLOT(editRule(QListWidgetItem*)));
 
-	menuBar()->addSeparator();
-	helpMenu = menuBar()->addMenu(tr("&Help"));
-	helpMenu->addAction(aboutAct);
-	helpMenu->addAction(aboutQtAct);
-}
+	connect(ui->settingsAct, SIGNAL(triggered()), this, SLOT(showConfig()));
 
-void MainWindow::createActions()
-{
-	addRuleAct = new QAction(QIcon(":/images/plus.png"), tr("&Add Rule..."), this);
-	addRuleAct->setShortcut(tr("Ctrl++"));
-	addRuleAct->setStatusTip(tr("Add rule to current ruleset"));
-	connect(addRuleAct, SIGNAL(triggered()), this, SLOT(addRule()));
-
-	importRulesetAct = new QAction(QIcon(":/images/open.png"), tr("&Open Ruleset..."), this);
-	importRulesetAct->setShortcut(tr("Ctrl+O"));
-	importRulesetAct->setStatusTip(tr("Open a ruleset file"));
-	connect(importRulesetAct, SIGNAL(triggered()), this, SLOT(importRuleset()));
-
-	exitAct = new QAction(tr("&Quit"), this);
-	exitAct->setShortcut(tr("Ctrl+Q"));
-	exitAct->setStatusTip(tr("Quit application"));
-	connect(exitAct, SIGNAL(triggered()), qApp, SLOT(quit()));
-
-	settingsAct = new QAction(QIcon(":/images/settings.png"), tr("&Settings"), this);
-	settingsAct->setStatusTip(tr("Configure application"));
-	settingsAct->setShortcut(tr("Ctrl+P"));
-	connect(settingsAct, SIGNAL(triggered()), this, SLOT(showConfig()));
-
-	aboutAct = new QAction(tr("&About"), this);
-	aboutAct->setStatusTip(tr("Show the application's About box"));
-	connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
-
-	aboutQtAct = new QAction(tr("About &Qt"), this);
-	aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
-	connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
+	connect(ui->helpAct, SIGNAL(triggered()), this, SLOT(showHelp()));
+	connect(ui->aboutAct, SIGNAL(triggered()), this, SLOT(about()));
+	connect(ui->aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
 }
 
-void MainWindow::createToolBars()
+void LMLEditMainWindow::addRule()
 {
-	fileToolBar = addToolBar(tr("File"));
-//	fileToolBar->addAction(newAct);
-	fileToolBar->addAction(importRulesetAct);
-	fileToolBar->addAction(addRuleAct);
-//	fileToolBar->addAction(saveAct);
-	fileToolBar->addAction(settingsAct);
-//
-//	editToolBar = addToolBar(tr("Edit"));
-//	editToolBar->addAction(cutAct);
-//	editToolBar->addAction(copyAct);
-//	editToolBar->addAction(pasteAct);
-}
+	ruleEdit->clear();
+	ruleEdit->setId(-1); // -1 means we will create a new entry. See ruleModified()
 
-void MainWindow::createStatusBar()
-{
-	statusBar()->showMessage(tr("Ready"));
+	ruleEdit->show();
 }
 
-void MainWindow::createRulesWidgets()
+void LMLEditMainWindow::editRule(QListWidgetItem * item)
 {
-	rulesView = new QListWidget;
-	connect(rulesView,SIGNAL(itemActivated(QListWidgetItem *)),this,SLOT(editRule(QListWidgetItem*)));
+	ruleEdit->clear();
+	ruleEdit->setId( ui->rulesView->row(item) );
+	Rule * rule = rulesList.at(ui->rulesView->row(item));
+	Q_ASSERT(rule != NULL);
+	ruleEdit->setRule( rule );
 
-	ruleEdit = new RuleEditor();
-	connect(ruleEdit,SIGNAL(accepted()),this,SLOT(ruleModified()));
+	ruleEdit->show();
 }
 
-void MainWindow::importRuleset()
+void LMLEditMainWindow::openRuleset()
 {
 //	if (maybeSave()) {
 		QString fileName = QFileDialog::getOpenFileName(this,tr("Open Ruleset"),"",tr("Ruleset files (*.rules)"));
 		if (!fileName.isEmpty())
-			importRulesetFile(fileName);
+			openRulesetFile(fileName);
 //	}
 }
 
-void MainWindow::closeEvent ( QCloseEvent * event )
+void LMLEditMainWindow::showConfig()
 {
-	if (ruleEdit != NULL)
-		ruleEdit->close();
+	QDialog * configDlg = getConfigDialog();
+
+	if (configDlg->exec()) {
+		// apply new configuration
+	}
 }
 
+/** \brief Add or edit rule
+ */
+void LMLEditMainWindow::ruleModified()
+{
+	QListWidgetItem * it;
+	Rule * rule;
+	QString str = ruleEdit->regex();
 
+	if (! str.isEmpty()) {
+		if (ruleEdit->id() == -1) {
+			it = new QListWidgetItem(str,ui->rulesView);
+			// create and add new Rule object to list
+			rule = new Rule(str,str);
+			rulesList.append(rule);
+			Q_ASSERT(rulesList.size() == ui->rulesView->count());
+			it->setToolTip("tooltip");
+		} else {
+			it = ui->rulesView->item(ruleEdit->id());
+			if (it != NULL) {
+				it->setData(Qt::DisplayRole,ruleEdit->regex());
+				rule = rulesList.at(ruleEdit->id());
+				Q_ASSERT(rule != NULL);
+				rule->setRegex(ruleEdit->regex());
+			} else {
+				qCritical("Edited rule id %d is not valid !",ruleEdit->id());
+			}
+		}
+	}
+}
 
+void LMLEditMainWindow::showHelp()
+{
+	show_helpwindow();
+}
 
-
-void MainWindow::importRulesetFile(const QString &fileName)
+void LMLEditMainWindow::about()
 {
-	//QFile file(fileName);
-	//if (!file.open(QFile::ReadOnly | QFile::Text)) {
-	//	QMessageBox::warning(this, tr("Application"),
-	//			tr("Cannot read file %1:\n%2.")
-	//			.arg(fileName)
-	//			.arg(file.errorString()));
-	//	return;
-	//}
+	QMessageBox::about(this, tr("About Application"),
+			tr("<b>lmledit</b>, a regular expression editor for "
+				"<a href=\"http://www.prelude-ids.org\">Prelude-IDS</a><br>"
+				"(C) 2007,2008 Pierre Chifflier (chifflier AT inl.fr)"));
+}
 
-	//QTextStream in(&file);
-	//QApplication::setOverrideCursor(Qt::WaitCursor);
-	//regexEditor->setText(in.readAll());
-	//QApplication::restoreOverrideCursor();
-
+void LMLEditMainWindow::openRulesetFile(const QString &fileName)
+{
 	QApplication::setOverrideCursor(Qt::WaitCursor);
 
 	RulesetParser parser(fileName);
@@ -168,10 +146,10 @@
 	rulesList = parser.rules();
 
 	// rebuild rules view
-	rulesView->clear();
+	ui->rulesView->clear();
 	for (int i = 0; i < rulesList.size(); ++i) {
 		Rule * rule = rulesList.at(i);
-		QListWidgetItem * it = new QListWidgetItem(rule->buffer(),rulesView);
+		QListWidgetItem * it = new QListWidgetItem(rule->buffer(),ui->rulesView);
 	}
 
 	setCurrentRulesetFile(fileName);
@@ -220,74 +198,8 @@
 	statusBar()->showMessage(tr("Ruleset loaded"), 2000);
 }
 
-void MainWindow::about()
+void LMLEditMainWindow::setCurrentRulesetFile(const QString &fileName)
 {
-	QMessageBox::about(this, tr("About Application"),
-			tr("<b>lmledit</b>, a regular expression editor for "
-				"<a href=\"http://www.prelude-ids.org\">Prelude-IDS</a><br>"
-				"(C) 2007,2008 Pierre Chifflier (chifflier AT inl.fr)"));
-}
-
-void MainWindow::addRule()
-{
-	ruleEdit->clear();
-	ruleEdit->setId(-1); // -1 means we will create a new entry. See ruleModified()
-
-	ruleEdit->show();
-}
-
-void MainWindow::editRule(QListWidgetItem * item)
-{
-	ruleEdit->clear();
-	ruleEdit->setId( rulesView->row(item) );
-	Rule * rule = rulesList.at(rulesView->row(item));
-	Q_ASSERT(rule != NULL);
-	ruleEdit->setRule( rule );
-
-	ruleEdit->show();
-}
-
-/** \brief Add or edit rule
- */
-void MainWindow::ruleModified()
-{
-	QListWidgetItem * it;
-	Rule * rule;
-	QString str = ruleEdit->regex();
-
-	if (! str.isEmpty()) {
-		if (ruleEdit->id() == -1) {
-			it = new QListWidgetItem(str,rulesView);
-			// create and add new Rule object to list
-			rule = new Rule(str,str);
-			rulesList.append(rule);
-			Q_ASSERT(rulesList.size() == rulesView->count());
-			it->setToolTip("tooltip");
-		} else {
-			it = rulesView->item(ruleEdit->id());
-			if (it != NULL) {
-				it->setData(Qt::DisplayRole,ruleEdit->regex());
-				rule = rulesList.at(ruleEdit->id());
-				Q_ASSERT(rule != NULL);
-				rule->setRegex(ruleEdit->regex());
-			} else {
-				qCritical("Edited rule id %d is not valid !",ruleEdit->id());
-			}
-		}
-	}
-}
-
-void MainWindow::showConfig()
-{
-	QDialog * configDlg = getConfigDialog();
-
-	if (configDlg->exec()) {
-		// apply new configuration
-	}
-}
-
-void MainWindow::setCurrentRulesetFile(const QString &fileName)
-{
 	curRuleSet = fileName;
 	//textEdit->document()->setModified(false);
 	setWindowModified(false);
@@ -301,7 +213,7 @@
 	setWindowTitle(tr("%1[*] - %2").arg(shownName).arg(tr("lmledit")));
 }
 
-QString MainWindow::strippedName(const QString &fullFileName)
+QString LMLEditMainWindow::strippedName(const QString &fullFileName)
 {
 	return QFileInfo(fullFileName).fileName();
 }

Modified: lmledit/trunk/mainwindow.h
===================================================================
--- lmledit/trunk/mainwindow.h	2008-04-03 15:06:47 UTC (rev 10479)
+++ lmledit/trunk/mainwindow.h	2008-04-07 15:48:12 UTC (rev 10480)
@@ -3,11 +3,6 @@
 
 #include <QMainWindow>
 
-class QVBoxLayout;
-class QLineEdit;
-class QTextEdit;
-class QTableWidget;
-class QListWidget;
 class QListWidgetItem;
 
 class ConfigDialog;
@@ -16,66 +11,42 @@
 class RuleSet;
 class RuleEditor;
 
-class MainWindow: public QMainWindow {
+namespace Ui {
+	class MainWindow;
+};
+
+class LMLEditMainWindow : public QMainWindow {
 	Q_OBJECT
 
 public:
-	MainWindow();
+	LMLEditMainWindow(QWidget *parent = 0);
 
 private slots:
 	void addRule();
 	void editRule(QListWidgetItem * item);
 
-	void importRuleset();
+	void openRuleset();
 
 	void ruleModified();
 
+	void showConfig();
+	void showHelp();
 	void about();
 
-	void showConfig();
-
-protected:
-	void closeEvent ( QCloseEvent * event );
-
 private:
-	void createMenus();
-	void createActions();
-	void createToolBars();
-	void createStatusBar();
-	void createRulesWidgets();
+	void connectSlots();
+	void openRulesetFile(const QString &fileName);
 
-	void importRulesetFile(const QString &fileName);
-
 	void setCurrentRulesetFile(const QString &fileName);
 	QString strippedName(const QString &fullFileName);
 
-	QVBoxLayout *layout;
+	Ui::MainWindow *ui;
 
-	/** \brief The widget displaying rules */
-	QListWidget *rulesView;
+	RuleEditor *ruleEdit;
 
-	RuleSetHighlighter * highlighter;
-
 	/** \brief Name of the current ruleset file */
 	QString curRuleSet;
-	/** \brief List of rules corresponding to \ref rulesView */
 	QList<Rule*> rulesList;
-
-	QMenu *fileMenu;
-	QMenu *editMenu;
-	QMenu *helpMenu;
-
-	QToolBar *fileToolBar;
-	QToolBar *editToolBar;
-
-	QAction *addRuleAct;
-	QAction *importRulesetAct;
-	QAction *exitAct;
-	QAction *settingsAct;
-	QAction *aboutAct;
-	QAction *aboutQtAct;
-
-	RuleEditor *ruleEdit;
 };
 
 #endif /* __MAIN_WINDOW__ */

Added: lmledit/trunk/mainwindow.ui
===================================================================
--- lmledit/trunk/mainwindow.ui	                        (rev 0)
+++ lmledit/trunk/mainwindow.ui	2008-04-07 15:48:12 UTC (rev 10480)
@@ -0,0 +1,196 @@
+<ui version="4.0" >
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>664</width>
+    <height>540</height>
+   </rect>
+  </property>
+  <property name="sizePolicy" >
+   <sizepolicy>
+    <hsizetype>0</hsizetype>
+    <vsizetype>0</vsizetype>
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="windowTitle" >
+   <string>LMLEdit</string>
+  </property>
+  <widget class="QWidget" name="centralwidget" >
+   <widget class="QListWidget" name="rulesView" >
+    <property name="geometry" >
+     <rect>
+      <x>0</x>
+      <y>0</y>
+      <width>661</width>
+      <height>461</height>
+     </rect>
+    </property>
+    <property name="sizePolicy" >
+     <sizepolicy>
+      <hsizetype>7</hsizetype>
+      <vsizetype>7</vsizetype>
+      <horstretch>9</horstretch>
+      <verstretch>9</verstretch>
+     </sizepolicy>
+    </property>
+   </widget>
+  </widget>
+  <widget class="QMenuBar" name="menubar" >
+   <property name="geometry" >
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>664</width>
+     <height>29</height>
+    </rect>
+   </property>
+   <widget class="QMenu" name="menu_Edit" >
+    <property name="title" >
+     <string>&amp;Edit</string>
+    </property>
+    <addaction name="settingsAct" />
+   </widget>
+   <widget class="QMenu" name="menuFile" >
+    <property name="title" >
+     <string>&amp;File</string>
+    </property>
+    <addaction name="openRulesetAct" />
+    <addaction name="addRuleAct" />
+    <addaction name="separator" />
+    <addaction name="actionQuit" />
+   </widget>
+   <widget class="QMenu" name="menuHelp" >
+    <property name="layoutDirection" >
+     <enum>Qt::LeftToRight</enum>
+    </property>
+    <property name="title" >
+     <string>&amp;Help</string>
+    </property>
+    <addaction name="helpAct" />
+    <addaction name="separator" />
+    <addaction name="aboutAct" />
+    <addaction name="aboutQtAct" />
+   </widget>
+   <addaction name="menuFile" />
+   <addaction name="menu_Edit" />
+   <addaction name="menuHelp" />
+  </widget>
+  <widget class="QStatusBar" name="statusbar" />
+  <widget class="QToolBar" name="toolBar" >
+   <property name="orientation" >
+    <enum>Qt::Horizontal</enum>
+   </property>
+   <attribute name="toolBarArea" >
+    <number>4</number>
+   </attribute>
+   <addaction name="openRulesetAct" />
+   <addaction name="addRuleAct" />
+   <addaction name="settingsAct" />
+  </widget>
+  <action name="actionQuit" >
+   <property name="text" >
+    <string>&amp;Quit</string>
+   </property>
+   <property name="statusTip" >
+    <string>Quit application</string>
+   </property>
+   <property name="shortcut" >
+    <string>Ctrl+Q</string>
+   </property>
+  </action>
+  <action name="actionNew_ruleset" >
+   <property name="text" >
+    <string>New ruleset</string>
+   </property>
+  </action>
+  <action name="openRulesetAct" >
+   <property name="icon" >
+    <iconset resource="application.qrc" >:/images/open.png</iconset>
+   </property>
+   <property name="text" >
+    <string>&amp;Open Ruleset</string>
+   </property>
+   <property name="statusTip" >
+    <string>Open a ruleset file</string>
+   </property>
+   <property name="shortcut" >
+    <string>Ctrl+O</string>
+   </property>
+  </action>
+  <action name="addRuleAct" >
+   <property name="icon" >
+    <iconset resource="application.qrc" >:/images/plus.png</iconset>
+   </property>
+   <property name="text" >
+    <string>&amp;Add Rule</string>
+   </property>
+   <property name="statusTip" >
+    <string>Add rule to current ruleset</string>
+   </property>
+   <property name="shortcut" >
+    <string>Ctrl++</string>
+   </property>
+  </action>
+  <action name="settingsAct" >
+   <property name="icon" >
+    <iconset resource="application.qrc" >:/images/settings.png</iconset>
+   </property>
+   <property name="text" >
+    <string>&amp;Settings</string>
+   </property>
+   <property name="statusTip" >
+    <string>Configure application</string>
+   </property>
+   <property name="shortcut" >
+    <string>Ctrl+P</string>
+   </property>
+  </action>
+  <action name="aboutAct" >
+   <property name="text" >
+    <string>&amp;About</string>
+   </property>
+   <property name="statusTip" >
+    <string>Show the application's About box</string>
+   </property>
+  </action>
+  <action name="aboutQtAct" >
+   <property name="text" >
+    <string>About &amp;Qt</string>
+   </property>
+   <property name="statusTip" >
+    <string>Show the Qt library's About box</string>
+   </property>
+  </action>
+  <action name="helpAct" >
+   <property name="text" >
+    <string>&amp;Help</string>
+   </property>
+  </action>
+ </widget>
+ <resources>
+  <include location="application.qrc" />
+ </resources>
+ <connections>
+  <connection>
+   <sender>actionQuit</sender>
+   <signal>activated()</signal>
+   <receiver>MainWindow</receiver>
+   <slot>close()</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>399</x>
+     <y>299</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>

Modified: lmledit/trunk/rule-editor.cpp
===================================================================
--- lmledit/trunk/rule-editor.cpp	2008-04-03 15:06:47 UTC (rev 10479)
+++ lmledit/trunk/rule-editor.cpp	2008-04-07 15:48:12 UTC (rev 10480)
@@ -17,8 +17,8 @@
 	connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
 	connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
 
-        QShortcut *shortcut = new QShortcut(QKeySequence(tr("Esc", "Close")), this);
-        connect(shortcut, SIGNAL(activated()), this, SLOT(reject()));
+	QShortcut *shortcut = new QShortcut(QKeySequence(tr("Esc", "Close")), this);
+	connect(shortcut, SIGNAL(activated()), this, SLOT(reject()));
 
 	createActions();
 	createToolBars();




More information about the Prelude-cvslog mailing list