Skip to content

Commit

Permalink
Merge pull request #6962 from kozlovsky/fix/feedback_dialog_remove_entry
Browse files Browse the repository at this point in the history
Fix TypeError: "on_remove_entry() takes 1 positional argument but 2 were given"
  • Loading branch information
kozlovsky authored Jul 8, 2022
2 parents 02f7975 + 372c1b8 commit b75fa1b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/tribler/gui/dialogs/feedbackdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def __init__( # pylint: disable=too-many-arguments, too-many-locals
uic.loadUi(get_ui_file_path('feedback_dialog.ui'), self)

self.setWindowTitle(tr("Unexpected error"))
self.selected_item_index = 0
self.tribler_version = tribler_version
self.reported_error = reported_error
self.scrubber = SentryScrubber()
Expand Down Expand Up @@ -122,20 +121,18 @@ def add_item_to_info_widget(key, value):
self.stop_application_on_close = True
self.on_send_clicked(True)

def on_remove_entry(self):
self.env_variables_list.takeTopLevelItem(self.selected_item_index)
def on_remove_entry(self, index):
self.env_variables_list.takeTopLevelItem(index)

def on_right_click_item(self, pos):
item_clicked = self.env_variables_list.itemAt(pos)
if not item_clicked:
return

self.selected_item_index = self.env_variables_list.indexOfTopLevelItem(item_clicked)

selected_item_index = self.env_variables_list.indexOfTopLevelItem(item_clicked)
menu = TriblerActionMenu(self)

remove_action = QAction(tr("Remove entry"), self)
connect(remove_action.triggered, self.on_remove_entry)
connect(remove_action.triggered, lambda checked: self.on_remove_entry(selected_item_index))
menu.addAction(remove_action)
menu.exec_(self.env_variables_list.mapToGlobal(pos))

Expand Down

0 comments on commit b75fa1b

Please sign in to comment.