def list_selection_changed(self, widget, data):
        """
        Signal that reacts to either available or installed games list
        being clicked.
        """
        if data == self.availablegamestree or data == self.installedgamestree:
            self.rightpanel.show()
            items, paths = data.get_selection().get_selected_rows()
            if len(paths) == 0:
                self.rightpanel.hide()
                return
            element = items.get_iter(paths[0])
            if data == self.availablegamestree:
                game = self.game_data[items.get_value(element, 3)]
            else:
                # XXX: This should be refactored to be more pleasant
                game = self.database.games[items.get_value(element, 3)]
                game = gog_db.GameRecord.serialize(game)
                game["title"] = game["full_name"]  # for compatibility
                game = json.loads(json.dumps(game))
            self.show_game_card(game, items.get_value(element, 3))
        else:
            self.rightpanel.hide()
dataset/ETHPy150Open Morgawr/gogonlinux/gog_utils/gog_gui.py/GogTuxGUI.list_selection_changed/original