def __init__(self, parent, assets): self.dialog = QDialog(parent.window) self.ui = qt_openplayer.Ui_OpenPlayer() self.ui.setupUi(self.dialog) self.parent = parent if self.parent.players is not None: self.players = self.parent.players else: self.players = None self.player_folder = Config().read("player_folder") self.backup_folder = Config().read("backup_folder") self.selected = None self.assets = assets self.dialog.rejected.connect(self.dialog.close) self.dialog.accepted.connect(self.accept) self.ui.player_list.itemDoubleClicked.connect(self.dialog.accept) self.ui.trash_button.clicked.connect(self.trash_player) self.ui.refresh_button.clicked.connect(self.get_players) if self.players is None: self.get_players() else: self.populate() self.ui.player_list.setFocus()
def __init__(self, parent): self.dialog = QDialog(parent) self.ui = qt_openplayer.Ui_OpenPlayer() self.ui.setupUi(self.dialog) self.player_folder = Config().read("player_folder") self.backup_folder = Config().read("backup_folder") self.selected = None self.dialog.rejected.connect(self.dialog.close) self.dialog.accepted.connect(self.accept) # bizarre, if i set this to self.accept it just doesn't work... self.ui.player_list.itemDoubleClicked.connect(self.dialog.accept) self.ui.trash_button.clicked.connect(self.trash_player) self.get_players() self.populate() self.ui.player_list.setFocus()