Skip to content

Commit

Permalink
Bug Fixed
Browse files Browse the repository at this point in the history
Bugs Fixed

1.  Selection menu stuck after multiple checklist import
2. Added Delete row for vulnerabilities
  • Loading branch information
Anof-cyber authored Apr 15, 2022
1 parent ae84342 commit 129e66a
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion PentestMapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,13 @@ def registerExtenderCallbacks(self, callbacks):
comboColumn = self.table3.getColumnModel().getColumn(2)
comboColumn.setCellEditor(DefaultCellEditor(self.comboBox))



popupMenu2 = JPopupMenu()
deletevulnerability = JMenuItem("Delete Vulnerability", actionPerformed=self.deletevuln)
popupMenu2.add(deletevulnerability)
self.table3.setComponentPopupMenu(popupMenu2)



# adding the table size, width, location and will add the scroller to the table
Expand Down Expand Up @@ -349,6 +356,14 @@ def deleterow(self,event):
#totalrow = self.logTable.getRowCount()
#self.callbacks.printOutput(str(totalrow))


def deletevuln(self,e):
totalvulnrows = self.table3.getSelectedRows()
#self.callbacks.printOutput(str(totalvulnrows))
for rows in totalvulnrows:
#self.callbacks.printOutput(str(rows))
self.dataModel2.removeRow(rows)



# part of custom table model to get total number of row in the table, it will check the data in the list amd will return when called
Expand Down Expand Up @@ -559,7 +574,8 @@ def importchecklist(self, e):
if ret == JFileChooser.APPROVE_OPTION:
fileLoad = chooseFile.getSelectedFile()
self.filepath = fileLoad.getAbsolutePath()

self.comboBox.removeAllItems()
self.comboBox.addItem(None)
self.dataModel.setRowCount(0)
with open(self.filepath, 'rb') as f:
reader2 = csv.reader(f, delimiter=',')
Expand Down

0 comments on commit 129e66a

Please sign in to comment.