(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.
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).
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)
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)