Skip to content

Commit

Permalink
Replace get_selected_types_*() with properties and shorten lines
Browse files Browse the repository at this point in the history
  • Loading branch information
zas committed Sep 13, 2023
1 parent db0ccaf commit cfd5753
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions picard/ui/caa_types_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,12 @@ def fill_lists(self, includes, excludes):
else:
self.list_ignore.addItem(item)

def get_selected_types_include(self):
@property
def included(self):
return list(self.list_include.all_items_data()) or ['front']

def get_selected_types_exclude(self):
@property
def excluded(self):
return list(self.list_exclude.all_items_data()) or ['none']

def clear_focus(self, lists):
Expand Down Expand Up @@ -352,4 +354,4 @@ def set_buttons_enabled_state(self):
def display_caa_types_selector(**kwargs):
dialog = CAATypesSelectorDialog(**kwargs)
result = dialog.exec_()
return (dialog.get_selected_types_include(), dialog.get_selected_types_exclude(), result == QtWidgets.QDialog.DialogCode.Accepted)
return (dialog.included, dialog.excluded, result == QtWidgets.QDialog.DialogCode.Accepted)

0 comments on commit cfd5753

Please sign in to comment.