Top Level Namespace

Defined Under Namespace

Modules: Ui Classes: Bus, Byte, CType, Chip, Chip_editor, Cmd, Command_editor, Command_table, Console, CustomItem, Export_manager, Firmware, Generic_commands, HardsploitAPI, HardsploitGUI, Hardsploit_GUI, I2C, I2c_command, I2c_export, I2c_import, I2c_settings, Manufacturer, Package, Parallel, Parallel_export, Parallel_import, Parallel_settings, Pin, Progress_bar, SWD_DEBUG_PORT, SWD_MEM_AP, SWD_STM32, Signall, Spi, Spi_export, Spi_import, Spi_settings, Ui_Chip_editor, Ui_Chip_management, Ui_Command_editor, Ui_Export_manager, Ui_Generic_commands, Ui_Generic_export, Ui_Generic_import, Ui_I2c_command, Ui_I2c_settings, Ui_Parallel_settings, Ui_Progress_bar, Ui_Spi_import, Ui_Spi_settings, Ui_Wire_helper, UniqPin, Use, VersionFPGA, VersionUC, Wire_helper

Constant Summary

Constants included from VersionUC::VERSION_UC

VersionUC::VERSION_UC::UC

Constants included from VersionFPGA::VERSION_FPGA

VersionFPGA::VERSION_FPGA::FPGA

Instance Method Summary collapse

Instance Method Details

#centerWindow(win) ⇒ Object



125
126
127
128
129
130
131
# File 'lib/hardsploit.rb', line 125

def centerWindow(win)
  desktop = Qt::DesktopWidget.new
  rect  = desktop.screenGeometry(desktop.primaryScreen)
  centerX = (rect.width - win.width ) / 2
  centerY = (rect.height - win.height)  / 2
  win.move(centerX,centerY)
end

#inputRestrict(lineEdit, type) ⇒ Object



110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/hardsploit.rb', line 110

def inputRestrict(lineEdit, type)
  case type
  when 0
    reg = Qt::RegExp.new("[0-9]+")
  when 1
    reg = Qt::RegExp.new("^[a-zA-Z_@-]+( [a-zA-Z_@-]+)*$")
  when 2
    reg = Qt::RegExp.new("^[a-zA-Z0-9_@-]+( [a-zA-Z0-9_@-]+)*$")
  when 3
    reg = Qt::RegExp.new("^[A-Fa-f0-9]{2}")
  end
  regVal = Qt::RegExpValidator.new(reg, self)
  lineEdit.setValidator(regVal)
end