523 if flags & SessionManager.CloneSession: |
523 if flags & SessionManager.CloneSession: |
524 if not shutil.copy(sessionFilePath, newSessionPath): |
524 if not shutil.copy(sessionFilePath, newSessionPath): |
525 EricMessageBox.critical( |
525 EricMessageBox.critical( |
526 WebBrowserWindow.getWindow(), |
526 WebBrowserWindow.getWindow(), |
527 title, |
527 title, |
528 self.tr( |
528 self.tr("""An error occurred while cloning the session file."""), |
529 """An error occurred while cloning the session file.""" |
|
530 ), |
|
531 ) |
529 ) |
532 return |
530 return |
533 else: |
531 else: |
534 try: |
532 try: |
535 os.rename(sessionFilePath, newSessionPath) |
533 os.rename(sessionFilePath, newSessionPath) |
536 except OSError: |
534 except OSError: |
537 EricMessageBox.critical( |
535 EricMessageBox.critical( |
538 WebBrowserWindow.getWindow(), |
536 WebBrowserWindow.getWindow(), |
539 title, |
537 title, |
540 self.tr( |
538 self.tr("""An error occurred while renaming the session file."""), |
541 """An error occurred while renaming the session file.""" |
|
542 ), |
|
543 ) |
539 ) |
544 return |
540 return |
545 if self.__isActive(sessionFilePath): |
541 if self.__isActive(sessionFilePath): |
546 self.__lastActiveSession = newSessionPath |
542 self.__lastActiveSession = newSessionPath |
547 self.__sessionMetaData = [] |
543 self.__sessionMetaData = [] |