              multi.append(" ".join([ftype[1] for ftype in val if ftype[0] != "All files"]))
              val.insert(0, tuple(multi))
          return filetypes
  
      def set_defaults(self):
          """ Set the default filetype to be first in list of filetypes,
              or set a custom filetype if the first is not correct """
          defaults = {key: val[0][1].replace("*", "")
                      for key, val in self.filetypes.items()}
          defaults["default"] = None
          defaults["video"] = ".mp4"
          defaults["image"] = ".png"
 
</s> remove                     for key, val in self.filetypes.items()}
 </s> add                     for key, val in self._filetypes.items()} </s> remove             tk.font.nametofont(font).configure(family=get_config().default_font[0],
                                               size=get_config().default_font[1])
 </s> add             tk.font.nametofont(font).configure(family=self._config.default_font[0],
                                               size=self._config.default_font[1]) </s> remove     """ Return the font list with any @prefixed or non-unicode characters stripped
 </s> add     """ Return the font list with any @prefixed or non-Unicode characters stripped </s> remove         """ Set the root or widget cursor to default """
 </s> add         """ Set the root or widget cursor to default.

        Parameters
        ----------
        widget: tkinter object, optional
            The widget to set default cursor for. If the provided value is ``None`` then sets the
            cursor busy for the whole of the GUI. Default: ``None``
        """ </s> remove         pathcache = get_config().pathcache if pathcache is None else pathcache
        self.pathicons = os.path.join(pathcache, "icons")
        self.pathpreview = os.path.join(pathcache, "preview")
        self.pathoutput = None
        self.previewoutput = None
        self.previewtrain = dict()
        self.previewcache = dict(modified=None,  # cache for extract and convert
                                 images=None,
                                 filenames=list(),
                                 placeholder=None)
        self.errcount = 0
        self.icons = dict()
        self.icons["folder"] = ImageTk.PhotoImage(file=os.path.join(
            self.pathicons, "open_folder.png"))
        self.icons["load"] = ImageTk.PhotoImage(file=os.path.join(
            self.pathicons, "open_file.png"))
        self.icons["load_multi"] = ImageTk.PhotoImage(file=os.path.join(
            self.pathicons, "open_file.png"))
        self.icons["context"] = ImageTk.PhotoImage(file=os.path.join(
            self.pathicons, "open_file.png"))
        self.icons["save"] = ImageTk.PhotoImage(file=os.path.join(self.pathicons, "save.png"))
        self.icons["reset"] = ImageTk.PhotoImage(file=os.path.join(self.pathicons, "reset.png"))
        self.icons["clear"] = ImageTk.PhotoImage(file=os.path.join(self.pathicons, "clear.png"))
        self.icons["graph"] = ImageTk.PhotoImage(file=os.path.join(self.pathicons, "graph.png"))
        self.icons["zoom"] = ImageTk.PhotoImage(file=os.path.join(self.pathicons, "zoom.png"))
        self.icons["move"] = ImageTk.PhotoImage(file=os.path.join(self.pathicons, "move.png"))
        self.icons["favicon"] = ImageTk.PhotoImage(file=os.path.join(self.pathicons, "logo.png"))
        logger.debug("Initialized %s: (icons: %s)", self.__class__.__name__, self.icons)
 </s> add         self._pathpreview = os.path.join(PATHCACHE, "preview")
        self._pathoutput = None
        self._previewoutput = None
        self._previewtrain = dict()
        self._previewcache = dict(modified=None,  # cache for extract and convert
                                  images=None,
                                  filenames=list(),
                                  placeholder=None)
        self._errcount = 0
        self._icons = self._load_icons()
        logger.debug("Initialized %s", self.__class__.__name__)

    @property
    def previewoutput(self):
        """ Tuple or ``None``: First item in the tuple is the extract or convert preview image
        (:class:`PIL.Image`), the second item is the image in a format that tkinter can display
        (:class:`PIL.ImageTK.PhotoImage`).

        The value of the property is ``None`` if no extract or convert task is running or there are
        no files available in the output folder. """
        return self._previewoutput

    @property
    def previewtrain(self):
        """ dict or ``None``: The training preview images. Dictionary key is the image name
        (`str`). Dictionary values are a `list` of the training image (:class:`PIL.Image`), the
        image formatted for tkinter display (:class:`PIL.ImageTK.PhotoImage`), the last
        modification time of the image (`float`).

        The value of this property is ``None`` if training is not running or there are no preview
        images available.
        """
        return self._previewtrain

    @property
    def icons(self):
        """ dict: The faceswap icons for all parts of the GUI. The dictionary key is the icon
        name (`str`) the value is the icon sized and formatted for display
        (:class:`PIL.ImageTK.PhotoImage`).

        Example
        -------
        >>> icons = get_images().icons
        >>> save = icons["save"]
        >>> button = ttk.Button(parent, image=save)
        >>> button.pack()
        """
        return self._icons

    @staticmethod
    def _load_icons():
        """ Scan the icons cache folder and load the icons into :attr:`icons` for retrieval
        throughout the GUI.

        Returns
        -------
        dict:
            The icons formatted as described in :attr:`icons`

        """
        size = get_config().user_config_dict.get("icon_size", 16)
        size = int(round(size * get_config().scaling_factor))
        icons = dict()
        pathicons = os.path.join(PATHCACHE, "icons")
        for fname in os.listdir(pathicons):
            name, ext = os.path.splitext(fname)
            if ext != ".png":
                continue
            img = Image.open(os.path.join(pathicons, fname))
            img = ImageTk.PhotoImage(img.resize((size, size), resample=Image.HAMMING))
            icons[name] = img
        logger.debug(icons)
        return icons

    def set_faceswap_output_path(self, location):
        """ Set the path that will contain the output from an Extract or Convert task.

        Required so that the GUI can fetch output images to display for return in
        :attr:`previewoutput`.

        Parameters
        ----------
        location: str
            The output location that has been specified for an Extract or Convert task
        """
        self._pathoutput = location
    @property
    def _contexts(self):
        """dict: Mapping of commands, actions and their corresponding file dialog for context
        handle types. """
        return {
            "effmpeg": {
                "input": {
                    "extract": "filename",
                    "gen-vid": "dir",
                    "get-fps": "filename",
                    "get-info": "filename",
                    "mux-audio": "filename",
                    "rescale": "filename",
                    "rotate": "filename",
                    "slice": "filename"},
                "output": {
                    "extract": "dir",
                    "gen-vid": "savefilename",
                    "get-fps": "nothing",
                    "get-info": "nothing",
                    "mux-audio": "savefilename",
                    "rescale": "savefilename",
                    "rotate": "savefilename",
                    "slice": "savefilename"}
                }
            }

    def _set_defaults(self):
        """ Set the default file type for the file dialog. Generally the first found file type
        will be used, but this is overridden if it is not appropriate.

        Returns
        -------
        dict:
            The default file extension for each file type
        """
              multi.append(" ".join([ftype[1] for ftype in val if ftype[0] != "All files"]))
              val.insert(0, tuple(multi))
          return filetypes
  
    @property
    def _contexts(self):
        """dict: Mapping of commands, actions and their corresponding file dialog for context
        handle types. """
        return {
            "effmpeg": {
                "input": {
                    "extract": "filename",
                    "gen-vid": "dir",
                    "get-fps": "filename",
                    "get-info": "filename",
                    "mux-audio": "filename",
                    "rescale": "filename",
                    "rotate": "filename",
                    "slice": "filename"},
                "output": {
                    "extract": "dir",
                    "gen-vid": "savefilename",
                    "get-fps": "nothing",
                    "get-info": "nothing",
                    "mux-audio": "savefilename",
                    "rescale": "savefilename",
                    "rotate": "savefilename",
                    "slice": "savefilename"}
                }
            }

    def _set_defaults(self):
        """ Set the default file type for the file dialog. Generally the first found file type
        will be used, but this is overridden if it is not appropriate.

        Returns
        -------
        dict:
            The default file extension for each file type
        """
    @property
    def _contexts(self):
        """dict: Mapping of commands, actions and their corresponding file dialog for context
        handle types. """
        return {
            "effmpeg": {
                "input": {
                    "extract": "filename",
                    "gen-vid": "dir",
                    "get-fps": "filename",
                    "get-info": "filename",
                    "mux-audio": "filename",
                    "rescale": "filename",
                    "rotate": "filename",
                    "slice": "filename"},
                "output": {
                    "extract": "dir",
                    "gen-vid": "savefilename",
                    "get-fps": "nothing",
                    "get-info": "nothing",
                    "mux-audio": "savefilename",
                    "rescale": "savefilename",
                    "rotate": "savefilename",
                    "slice": "savefilename"}
                }
            }

    def _set_defaults(self):
        """ Set the default file type for the file dialog. Generally the first found file type
        will be used, but this is overridden if it is not appropriate.

        Returns
        -------
        dict:
            The default file extension for each file type
        """
    @property
    def _contexts(self):
        """dict: Mapping of commands, actions and their corresponding file dialog for context
        handle types. """
        return {
            "effmpeg": {
                "input": {
                    "extract": "filename",
                    "gen-vid": "dir",
                    "get-fps": "filename",
                    "get-info": "filename",
                    "mux-audio": "filename",
                    "rescale": "filename",
                    "rotate": "filename",
                    "slice": "filename"},
                "output": {
                    "extract": "dir",
                    "gen-vid": "savefilename",
                    "get-fps": "nothing",
                    "get-info": "nothing",
                    "mux-audio": "savefilename",
                    "rescale": "savefilename",
                    "rotate": "savefilename",
                    "slice": "savefilename"}
                }
            }

    def _set_defaults(self):
        """ Set the default file type for the file dialog. Generally the first found file type
        will be used, but this is overridden if it is not appropriate.

        Returns
        -------
        dict:
            The default file extension for each file type
        """
          defaults = {key: val[0][1].replace("*", "")
                      for key, val in self.filetypes.items()}
          defaults["default"] = None
          defaults["video"] = ".mp4"
          defaults["image"] = ".png"
keep keep keep keep replace replace replace keep keep keep keep keep
 GUI Updates (#940)

* lib.gui: Update icons
* tools.cli: Add video filetype flag to mask input
* lib.gui.popup_configure: Refresh GUI on config save
* lib.gui._config: Add Icon size and load last session options
* lib.gui.control_helper - Add control modification tracking
* lib.gui - Add Projects and Last Session
- Main root title handled by projects
- Add Hotkeys
- Create projects module
- split fsw and fst filetypes
- Add last_session saving

* lib.project
- Documentation
- Ask confirm on closing unsaved project
-Fixups

* Track model folder changes
- Shuffle some globals
- Activate System Verbosity for GUI

* lib.gui.utils - Documentation and clean up
- lib.gui.custom_widgets - Create and document

* Add GUI config option to disable auto loading model stats 
lib/gui/utils.py