SVN: UX improvements #136

Merged
Demeter Dzadik merged 15 commits from Mets/blender-studio-pipeline:svn_ux_improvements into main 2023-08-01 15:39:18 +02:00
Showing only changes of commit c368c74772 - Show all commits

View File

@ -13,7 +13,6 @@ from ..threaded.background_process import Processes
from pathlib import Path from pathlib import Path
class SVN_UL_repositories(UIList): class SVN_UL_repositories(UIList):
def draw_item( def draw_item(
self, context, layout, data, item, icon, active_data, active_propname self, context, layout, data, item, icon, active_data, active_propname
@ -41,7 +40,16 @@ class SVN_OT_repo_add(Operator, ImportHelper):
repos = prefs.repositories repos = prefs.repositories
path = Path(self.filepath) path = Path(self.filepath)
if not path.exists():
# It's unlikely that a path that the user JUST BROWSED doesn't exist.
# So, this actually happens when the user leaves a filename in the
# file browser text box while trying to select the folder...
# Basically, Blender is dumb, and it will add that filename to the
# end of the browsed path. We need to discard that.
path = path.parent
if path.is_file(): if path.is_file():
# Maybe the user actually did select an existing file in the repo.
# We still want to discard the filename.
path = path.parent path = path.parent
existing_repos = repos[:] existing_repos = repos[:]