              self.set_command_args(command, options)
                  
      def set_command_args(self, command, options):
          ''' Pass the saved config items back to the GUI '''
          for src_option, src_value in options.items():
              for dst_options in self.opts[command]:
                  if dst_options['control_title'] == src_option:
                      dst_options['value'].set(src_value)
                      break
          
      def save_config(self, command=None):
          ''' Save the current GUI state to a config file in json format '''
          config_file = filedialog.asksaveasfile(mode='w', filetypes=self.filetypes, defaultextension='.fsw')
 
</s> remove             options = config[command]
            self.set_command_args(command, options)
 </s> add             opts = cfg[command]
            self.set_command_args(command, opts) </s> remove         config_file = filedialog.asksaveasfile(mode='w', filetypes=self.filetypes, defaultextension='.fsw')
        if not config_file:
 </s> add         cfgfile = filedialog.asksaveasfile( mode='w',
                                            filetypes=self.filetypes, 
                                            defaultextension='.fsw')
        if not cfgfile: </s> remove         config_file = filedialog.askopenfile(mode='r', filetypes=self.filetypes)
        if not config_file:
 </s> add         cfgfile = filedialog.askopenfile(mode='r', filetypes=self.filetypes)
        if not cfgfile: </s> remove         config = self.serializer.unmarshal(config_file.read())
 </s> add         cfg = self.serializer.unmarshal(cfgfile.read()) </s> remove             for command, options in config.items():
                self.set_command_args(command, options)
 </s> add             for cmd, opts in cfg.items():
                self.set_command_args(cmd, opts)
        for srcopt, srcval in options.items():
            for dstopts in self.opts[command]:
                if dstopts['control_title'] == srcopt:
                    dstopts['value'].set(srcval)
              self.set_command_args(command, options)
                  
      def set_command_args(self, command, options):
          ''' Pass the saved config items back to the GUI '''
        for srcopt, srcval in options.items():
            for dstopts in self.opts[command]:
                if dstopts['control_title'] == srcopt:
                    dstopts['value'].set(srcval)
        for srcopt, srcval in options.items():
            for dstopts in self.opts[command]:
                if dstopts['control_title'] == srcopt:
                    dstopts['value'].set(srcval)
        for srcopt, srcval in options.items():
            for dstopts in self.opts[command]:
                if dstopts['control_title'] == srcopt:
                    dstopts['value'].set(srcval)
        for srcopt, srcval in options.items():
            for dstopts in self.opts[command]:
                if dstopts['control_title'] == srcopt:
                    dstopts['value'].set(srcval)
                      break
          
      def save_config(self, command=None):
          ''' Save the current GUI state to a config file in json format '''
          config_file = filedialog.asksaveasfile(mode='w', filetypes=self.filetypes, defaultextension='.fsw')
keep keep keep keep replace replace replace replace keep keep keep keep keep
 GUI v0.1.0a (#336)

* Code clean up

* Code refactor

* bugfix: Find paths to icons when launched from outside faceswap dir

* Bugfix: Disable GUI if TkInter app not available

* BugFix: Disable GUI if $DISPLAY not detected

* Minor code ammends

* Code Refactor

* DISPLAY check fix 
scripts/gui.py