def show_modal(self):
     path = None
     if self.dir_mode:
         self.result = fsui.pick_directory(
             parent=self.parent,
             message=self.title,
             directory=self.directory,
         )
         if self.result:
             path = self.result
     elif self.multiple:
         self.result = fsui.pick_files(
             parent=self.parent,
             message=self.title,
             directory=self.directory,
         )
         if self.result:
             path = self.result[0]
     else:
         self.result = fsui.pick_file(
             parent=self.parent,
             message=self.title,
             directory=self.directory,
         )
         if self.result:
             path = self.result
     if path:
         last_path_dir = os.path.dirname(path)
         LauncherSettings.set(self.settings_key, last_path_dir)
     return bool(self.result)
Example #2
0
 def show_modal(self):
     path = None
     if self.dir_mode:
         self.result = fsui.pick_directory(
             parent=self.parent,
             message=self.title,
             directory=self.directory,
         )
         if self.result:
             path = self.result
     elif self.multiple:
         self.result = fsui.pick_files(
             parent=self.parent,
             message=self.title,
             directory=self.directory,
         )
         if self.result:
             path = self.result[0]
     else:
         self.result = fsui.pick_file(
             parent=self.parent,
             message=self.title,
             directory=self.directory,
         )
         if self.result:
             path = self.result
     if path:
         last_path_dir = os.path.dirname(path)
         LauncherSettings.set(self.settings_key, last_path_dir)
     return bool(self.result)