Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TypeError: "on_remove_entry() takes 1 positional argument but 2 were given" #6962

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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