Beispiel #1
0
 def commit(self):
     if (Options.mapname != self.map.get()
             or Options.tile_length != int(self.tile_length.get())
             or Options.language != self.language.get()):
         self.changed = True
     Options.fps = int(self.FPS.get())
     Options.mapname = self.map.get()
     Options.volume = float(self.volume.get())
     Options.mute = self.is_mute.get()
     Options.tile_length = int(self.tile_length.get())
     Options.gender = self.gender.get()
     Options.not_log = self.is_not_log.get()
     Options.no_zombies = self.is_no_zmbs.get()
     Options.debug = self.is_debug.get()
     Options.language = self.language.get()
     Options.loopcolour = self.loopcolour
     Options.fillcolour = self.fillcolour
     try:
         Options.assertions()
     except AssertionError as e:
         messagebox.showwarning("Error", e)
     else:
         try:
             Options.warnings()
         except AssertionError as e:
             if messagebox.askyesno("warning",
                                    str(e) + "\nVil du fortsette?"):
                 self.exit()
             else:
                 return
         else:
             self.exit()
Beispiel #2
0
 def commit(self):
     if (Options.mapname != self.map
             or Options.tile_length != self.tile_length
             or self.lang != Options.language):
         self.changed = True
     Options.fps = self.fps
     Options.mapname = self.map
     Options.volume = self.volume
     Options.mute = self.is_mute
     Options.tile_length = self.tile_length
     Options.gender = self.gender
     Options.not_log = self.is_not_log
     Options.no_zombies = self.is_no_zmbs
     Options.debug = self.is_debug
     Options.language = self.lang
     Options.fillcolour = Colours.get_rgb(self.fillcolour._color)
     Options.loopcolour = Colours.get_rgb(self.loopcolour._color)
     try:
         Options.assertions()
     except AssertionError as e:
         self.error_box = QtGui.QMessageBox()
         self.error_box.setIcon(QtGui.QMessageBox.Critical)
         self.error_box.setText(get_text("error") + str(e))
         self.error_box.exec_()
         return
     try:
         Options.warnings()
     except AssertionError as e:
         self.warning_box = QtGui.QMessageBox.question(
             self, "warning",
             get_text("warning").format(e),
             QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
         if self.warning_box == QtGui.QMessageBox.Yes:
             self.exit()
         else:
             return
     else:
         self.exit()