Exemple #1
0
    def import_character(self):
        fname = QFileDialog.getOpenFileName(self, 'Open file', "characters/",
                                            "XML Files (*.xml)")

        if fname[0] == '':
            return

        path = fname[0]
        character = Character.from_xml(path)
        self.parent.mainUI(character, path)
Exemple #2
0
    def import_character(self):
        fname = QFileDialog.getOpenFileName(self, 'Open file', "characters/",
                                            "XML Files (*.xml)")

        if fname[0] == '':
            return

        self.path = fname[0]

        self.character = Character.from_xml(self.path)
        # set as old_character copy for detecting further changes on quit
        self.old_character = copy.deepcopy(self.character)

        # redraw UI with new character object
        self.sheet = Sheet(self.character)
        self.setCentralWidget(self.sheet)