792 "vm_file_save_as_remote", |
792 "vm_file_save_as_remote", |
793 ) |
793 ) |
794 self.saveAsRemoteAct.setStatusTip( |
794 self.saveAsRemoteAct.setStatusTip( |
795 QCoreApplication.translate( |
795 QCoreApplication.translate( |
796 "ViewManager", |
796 "ViewManager", |
797 "Save the current file to a new one on an eric-ide server" |
797 "Save the current file to a new one on an eric-ide server", |
798 ) |
798 ) |
799 ) |
799 ) |
800 self.saveAsRemoteAct.setWhatsThis( |
800 self.saveAsRemoteAct.setWhatsThis( |
801 QCoreApplication.translate( |
801 QCoreApplication.translate( |
802 "ViewManager", |
802 "ViewManager", |
8188 # if we have an active source, return its path |
8188 # if we have an active source, return its path |
8189 if self.activeWindow() is not None: |
8189 if self.activeWindow() is not None: |
8190 fn = self.activeWindow().getFileName() |
8190 fn = self.activeWindow().getFileName() |
8191 if forRemote and FileSystemUtilities.isRemoteFileName(fn): |
8191 if forRemote and FileSystemUtilities.isRemoteFileName(fn): |
8192 return ( |
8192 return ( |
8193 ericApp().getObject("EricServer").getServiceInterface("FileSystem") |
8193 ericApp() |
|
8194 .getObject("EricServer") |
|
8195 .getServiceInterface("FileSystem") |
8194 .dirname(fn) |
8196 .dirname(fn) |
8195 ) |
8197 ) |
8196 if not forRemote and FileSystemUtilities.isPlainFileName(fn): |
8198 if not forRemote and FileSystemUtilities.isPlainFileName(fn): |
8197 return os.path.dirname(fn) |
8199 return os.path.dirname(fn) |
8198 |
8200 |
8199 # check, if there is an active project and return its path |
8201 # check, if there is an active project and return its path |
8200 if ericApp().getObject("Project").isOpen(): |
8202 if ericApp().getObject("Project").isOpen(): |
8201 ppath = ericApp().getObject("Project").ppath |
8203 ppath = ericApp().getObject("Project").ppath |
8202 if ( |
8204 if (forRemote and FileSystemUtilities.isRemoteFileName(ppath)) or ( |
8203 (forRemote and FileSystemUtilities.isRemoteFileName(ppath)) |
8205 not forRemote and FileSystemUtilities.isPlainFileName(ppath) |
8204 or (not forRemote and FileSystemUtilities.isPlainFileName(ppath)) |
|
8205 ): |
8206 ): |
8206 return ppath |
8207 return ppath |
8207 |
8208 |
8208 if not forRemote: |
8209 if not forRemote: |
8209 return Preferences.getMultiProject("Workspace") or OSUtilities.getHomeDir() |
8210 return Preferences.getMultiProject("Workspace") or OSUtilities.getHomeDir() |