From 129e66abca0e37840fcd4fb109a3c8036e1ce891 Mon Sep 17 00:00:00 2001 From: AnoF <39705906+Anof-cyber@users.noreply.github.com> Date: Fri, 15 Apr 2022 23:08:00 +0530 Subject: [PATCH] Bug Fixed Bugs Fixed 1. Selection menu stuck after multiple checklist import 2. Added Delete row for vulnerabilities --- PentestMapper.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/PentestMapper.py b/PentestMapper.py index 84ff73a..33d915d 100644 --- a/PentestMapper.py +++ b/PentestMapper.py @@ -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 @@ -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 @@ -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=',')