コード例 #1
0
    def update_call(self):
        """
        information update when the update button is clicked.
        :return: <bool> True for success. <bool> False for failure.
        """
        if self.parent.module_form.is_build_toggled:
            QtWidgets.QMessageBox().warning(
                self, "Could not update.",
                "Please revert back to guides (Turn off build).")
            return False

        # get information
        self.get_information()

        # update the selected widget information data
        if self.information:
            self.parent.set_selected_module_name(self.information["name"])

            # update the widgets' published attributes
            self.parent.update_selected_item_attributes(self.information)
            debug_print("Updating module: %s with data: %s " %
                        (self.information["name"], self.information))

        # update each module's guide positions (if any)
        self.parent.update_guide_position_data()

        # trigger the update function for each of the modules loaded in the UI
        update_data_modules()

        # save the dictionary data into the chosen creature file
        creature_name = self.parent.get_selected_creature_name()
        if creature_name:
            save_blueprint(creature_name, get_module_data())
        return True
コード例 #2
0
 def rename_call(self):
     self.result = self.line.widgets['lineEdit'].text()
     if self.result:
         self.deleteLater()
     else:
         QtWidgets.QMessageBox().information(
             self, "Empty field.", "Please fill in the edit field.")
コード例 #3
0
 def toggle_build_call(self, args):
     """
     toggles the build call.
     :param args: <int> incoming set integer.
     :return:
     """
     self.build = 0
     if self.get_selected_blueprint():
         if args == 1:
             self.build = 1
             self.finish_all_call()
         elif args == 0:
             self.build = 0
             self.create_all_call()
     else:
         QtWidgets.QMessageBox().warning(self,
                                         "Creature Blueprint Not Saved.",
                                         "Please save creature blueprint.")
         self.reset_slider(args)