@@ -627,6 +627,12 @@ def show_current_project(self, _: Any = None) -> None:
627627
628628 async def save_otconfig (self ) -> None :
629629 save_suggestion = self ._application .suggest_save_path (OTCONFIG_FILE_TYPE )
630+ if self ._application .get_current_key_prefix () is not None :
631+ # A project that names a location was opened by an operator naming
632+ # it, not chosen from a picker (OP#10323 decision 1), so it always
633+ # re-saves to its own name and place with no new UI.
634+ await self ._save_otconfig (save_suggestion .file_path )
635+ return
630636 configuration_file = await self ._ui_factory .ask_for_save_file_path (
631637 title = "Save configuration as" ,
632638 filetypes = [(f"{ OTCONFIG_FILE_TYPE } file" , f"*.{ OTCONFIG_FILE_TYPE } " )],
@@ -636,9 +642,9 @@ async def save_otconfig(self) -> None:
636642 )
637643 if not configuration_file :
638644 return
639- self ._save_otconfig (configuration_file )
645+ await self ._save_otconfig (configuration_file )
640646
641- def _save_otconfig (self , otconfig_file : Path ) -> None :
647+ async def _save_otconfig (self , otconfig_file : Path ) -> None :
642648 # Ensure the file has the correct extension
643649 otconfig_file_str = ensure_file_extension_is_present (
644650 str (otconfig_file ), [f"*.{ OTCONFIG_FILE_TYPE } " ], f".{ OTCONFIG_FILE_TYPE } "
@@ -647,7 +653,7 @@ def _save_otconfig(self, otconfig_file: Path) -> None:
647653
648654 logger ().info (f"Config file to save: { otconfig_file } " )
649655 try :
650- self ._application .save_otconfig (otconfig_file )
656+ await self ._application .save_otconfig (otconfig_file )
651657 except NoSectionsToSave :
652658 message = (
653659 f"{ MESSAGE_CONFIGURATION_NOT_SAVED } "
@@ -943,6 +949,12 @@ def _load_otflow(self, otflow_file: Path) -> None:
943949
944950 async def save_configuration (self ) -> None :
945951 save_suggestion = self ._application .suggest_save_path (OTCONFIG_FILE_TYPE )
952+ if self ._application .get_current_key_prefix () is not None :
953+ # A project that names a location is always an otconfig and always
954+ # re-saves to its own name and place with no new UI (OP#10323
955+ # decision 1 & 5).
956+ await self ._save_otconfig (save_suggestion .file_path )
957+ return
946958 configuration_file = await self ._ui_factory .ask_for_save_file_path (
947959 title = "Save configuration as" ,
948960 filetypes = [
@@ -967,13 +979,13 @@ async def save_configuration(self) -> None:
967979 if configuration_file .suffix == f".{ OTFLOW_FILE_TYPE } " :
968980 self ._save_otflow (configuration_file )
969981 elif configuration_file .suffix == f".{ OTCONFIG_FILE_TYPE } " :
970- self ._save_otconfig (configuration_file )
982+ await self ._save_otconfig (configuration_file )
971983 else :
972984 raise ValueError ("Configuration file to save has unknown file extension" )
973985
974986 async def quick_save_configuration (self ) -> None :
975987 try :
976- self ._application .quick_save_configuration ()
988+ await self ._application .quick_save_configuration ()
977989 except NoExistingFileToSave :
978990 await self .save_configuration ()
979991
0 commit comments