Widgets

GUI uses a various kinds of Qt widgets.

(e.g. Check Boxes, Labels, Tabs, Layouts, etc.)

Unfortunately these widgets does not provide the functionality we need. So it was necessary to extend some of the existing widgets.

Own Widgets

(hotfuzzwidget)

GUI reimplements 4 types of the basic widgets - Check Box, Line Edit, Spin Box and Radio Button. (hotfuzzwidget.HotFuzzCheckBoxWidget, hotfuzzwidget.HotFuzzLineEditWidget, hotfuzzwidget.HotFuzzSpinBoxWidget, hotfuzzwidget.HotFuzzRadioButtonWidget) These classes were modified to override the default focusInEvent and focusOutEvent event handlers. During the focusInEvent the class stores its original value to an internal class variable. The original value is compared to the current widget value during focusOutEvent and when these values differ, widget emits a signal containing the original value.

The Radio Button widget was modified more than the others. It was necessary to remember the state of the whole group to which the Radio Button belongs. (hotfuzzwidget.HotFuzzRadioButtonWidget)

GUI also reimplements the tree widget items of the datamodel tree widget. These widgets are associated with a corresponding node of the fuzzing XML element tree. (xmlmanipulators.HotFuzzTreeWidgetItem) The change of the state of the widget can be immediately reflected in the fuzzing XML tree thanks to this feature.

Some other tree widget items are reimplemented as well. (dumpreader.dumpTreeWidgetItem, dumpreader.dateTreeWidgetItem) These modification extends the original class with additional informations (e.g. a path to dump file).

Qt designer plugin

Unfortunately modified basic widgets can not be used in the Qt Designer, because the Qt Designer is not aware of their existence. This was quite unpleasant, since these widgets form the vast majority of widgets we use in the Main Window of the application.

So we created a new Qt Designer plugin for each widget. (GUI/hotfuzzplugin.py). If you want to use the Qt Designer, you need to force the Qt Designer to load plugins from a specific location.

The easiest way to do this, is to modify PYQTDESIGNERPATH environmental variable.
E.g. export PYQTDESIGNERPATH="path to hotfuzz root dir"/GUI/

Or you may just copy the plugin file into the standard Qt Designer plugin directory.

After the Qt designer is started, four new components should appear in the Widget Box - HotFuzzRadioButtonWidget, HotFuzzCheckBoxWidget, HotFuzzLineEditWidget and HotFuzzSpinBoxWidget. (hotfuzzplugin.HotFuzzCheckBoxPlugin, hotfuzzplugin.HotFuzzLineEditPlugin, hotfuzzplugin.HotFuzzSpinBoxPlugin, hotfuzzplugin.HotFuzzRadioButtonPlugin)

Undo Actions

The main reason, why we have to use modified basic widgets, is to provide useful undo/redo actions for the GUI application. (window.Window.projectModify) The modified widgets generate signals, which are caught by the Main Window class. As a reaction to these signals a new undo action is created and placed on the top of the active undo stack. There are 3 stacks, which are bounded to a currently opened tab. (window.Window.undoGroup, window.Window.mutableUndoStack, window.Window.recordingUndoStack, window.Window.fuzzingUndoStack, window.Window.switchTab)

The undo/redo actions can be triggered through the Main Menu or by pressing a corresponding shortcut.

Undo stacks are cleared whenever a new project or a corresponding part of the project is loaded. (window.Window.projectLoadFiles)


Generated on Sun Sep 5 12:41:36 2010 for HotFuzz by  doxygen 1.5.8