1143 self.pfile = fn |
1143 self.pfile = fn |
1144 self.ppath = self.__remotefsInterface.dirname(fn) |
1144 self.ppath = self.__remotefsInterface.dirname(fn) |
1145 self.name = self.__remotefsInterface.splitext( |
1145 self.name = self.__remotefsInterface.splitext( |
1146 self.__remotefsInterface.basename(fn) |
1146 self.__remotefsInterface.basename(fn) |
1147 )[0] |
1147 )[0] |
|
1148 # TODO: read in a file system cache of ppath |
|
1149 self.__remotefsInterface.populateFsCache(self.ppath) |
1148 else: |
1150 else: |
1149 self.pfile = os.path.abspath(fn) |
1151 self.pfile = os.path.abspath(fn) |
1150 self.ppath = os.path.abspath(os.path.dirname(fn)) |
1152 self.ppath = os.path.abspath(os.path.dirname(fn)) |
1151 self.name = os.path.splitext(os.path.basename(fn))[0] |
1153 self.name = os.path.splitext(os.path.basename(fn))[0] |
1152 |
1154 |
1183 # get the names of subdirectories the files are stored in |
1185 # get the names of subdirectories the files are stored in |
1184 for fileCategory in [c for c in self.getFileCategories() if c != "OTHERS"]: |
1186 for fileCategory in [c for c in self.getFileCategories() if c != "OTHERS"]: |
1185 for fn in self.__pdata[fileCategory]: |
1187 for fn in self.__pdata[fileCategory]: |
1186 dn = ( |
1188 dn = ( |
1187 self.__remotefsInterface.dirname(fn) |
1189 self.__remotefsInterface.dirname(fn) |
1188 if FileSystemUtilities.isRemoteFileName(fn) |
1190 if FileSystemUtilities.isRemoteFileName(self.ppath) |
1189 else os.path.dirname(fn) |
1191 else os.path.dirname(fn) |
1190 ) |
1192 ) |
1191 if dn and dn not in self.subdirs: |
1193 if dn and dn not in self.subdirs: |
1192 self.subdirs.append(dn) |
1194 self.subdirs.append(dn) |
1193 |
1195 |
1649 """ |
1651 """ |
1650 Private slot to display the debugger properties dialog. |
1652 Private slot to display the debugger properties dialog. |
1651 """ |
1653 """ |
1652 from .DebuggerPropertiesDialog import DebuggerPropertiesDialog |
1654 from .DebuggerPropertiesDialog import DebuggerPropertiesDialog |
1653 |
1655 |
1654 dlg = DebuggerPropertiesDialog(self) |
1656 dlg = DebuggerPropertiesDialog( |
|
1657 self, isRemote=FileSystemUtilities.isRemoteFileName(self.ppath) |
|
1658 ) |
1655 if dlg.exec() == QDialog.DialogCode.Accepted: |
1659 if dlg.exec() == QDialog.DialogCode.Accepted: |
1656 dlg.storeData() |
1660 dlg.storeData() |
1657 |
1661 |
1658 def getDebugProperty(self, key): |
1662 def getDebugProperty(self, key): |
1659 """ |
1663 """ |
1662 @param key key of the property |
1666 @param key key of the property |
1663 @type str |
1667 @type str |
1664 @return value of the property |
1668 @return value of the property |
1665 @rtype Any |
1669 @rtype Any |
1666 """ |
1670 """ |
1667 if key == "INTERPRETER": |
1671 if ( |
|
1672 key == "INTERPRETER" |
|
1673 and not FileSystemUtilities.isRemoteFileName(self.ppath) |
|
1674 ): |
1668 return ( |
1675 return ( |
1669 ericApp() |
1676 ericApp() |
1670 .getObject("VirtualEnvManager") |
1677 .getObject("VirtualEnvManager") |
1671 .getVirtualenvInterpreter(self.debugProperties["VIRTUALENV"]) |
1678 .getVirtualenvInterpreter(self.debugProperties["VIRTUALENV"]) |
1672 ) |
1679 ) |
2366 |
2373 |
2367 fn = self.getRelativePath(oldfn) |
2374 fn = self.getRelativePath(oldfn) |
2368 isSourceFile = fn in self.__pdata["SOURCES"] |
2375 isSourceFile = fn in self.__pdata["SOURCES"] |
2369 |
2376 |
2370 if newfn is None: |
2377 if newfn is None: |
2371 newfn = EricFileDialog.getSaveFileName( |
2378 if isRemote: |
2372 None, |
2379 newfn = EricServerFileDialog.getSaveFileName( |
2373 self.tr("Rename file"), |
2380 None, |
2374 oldfn, |
2381 self.tr("Rename File"), |
2375 "", |
2382 oldfn, |
2376 EricFileDialog.DontConfirmOverwrite, |
2383 "", |
2377 ) |
2384 ) |
|
2385 else: |
|
2386 newfn = EricFileDialog.getSaveFileName( |
|
2387 None, |
|
2388 self.tr("Rename File"), |
|
2389 oldfn, |
|
2390 "", |
|
2391 options=EricFileDialog.DontConfirmOverwrite, |
|
2392 ) |
|
2393 if newfn: |
|
2394 newfn = FileSystemUtilities.toNativeSeparators(newfn) |
|
2395 |
2378 if not newfn: |
2396 if not newfn: |
2379 return False |
2397 return False |
2380 newfn = FileSystemUtilities.toNativeSeparators(newfn) |
|
2381 |
2398 |
2382 if (not isRemote and os.path.exists(newfn)) or ( |
2399 if (not isRemote and os.path.exists(newfn)) or ( |
2383 isRemote and self.__remotefsInterface.exists(newfn) |
2400 isRemote and self.__remotefsInterface.exists(newfn) |
2384 ): |
2401 ): |
2385 res = EricMessageBox.yesNo( |
2402 res = EricMessageBox.yesNo( |
4009 if not noSave: |
4026 if not noSave: |
4010 self.writeTasks() |
4027 self.writeTasks() |
4011 self.ui.taskViewer.clearProjectTasks() |
4028 self.ui.taskViewer.clearProjectTasks() |
4012 self.ui.taskViewer.setProjectOpen(False) |
4029 self.ui.taskViewer.setProjectOpen(False) |
4013 |
4030 |
|
4031 # TODO: clear the file system cache for ppath if remote project |
|
4032 if FileSystemUtilities.isRemoteFileName(self.ppath): |
|
4033 self.__remotefsInterface.removeFromFsCache(self.ppath) |
|
4034 |
4014 # now shutdown the vcs interface |
4035 # now shutdown the vcs interface |
4015 if not FileSystemUtilities.isRemoteFileName(self.ppath) and self.vcs: |
4036 if not FileSystemUtilities.isRemoteFileName(self.ppath) and self.vcs: |
4016 self.vcs.vcsShutdown() |
4037 self.vcs.vcsShutdown() |
4017 self.vcs.deleteLater() |
4038 self.vcs.deleteLater() |
4018 self.vcs = None |
4039 self.vcs = None |
7900 self.saveasRemoteAct.setEnabled( |
7924 self.saveasRemoteAct.setEnabled( |
7901 connected |
7925 connected |
7902 and self.opened |
7926 and self.opened |
7903 and FileSystemUtilities.isRemoteFileName(self.pfile) |
7927 and FileSystemUtilities.isRemoteFileName(self.pfile) |
7904 ) |
7928 ) |
|
7929 if not connected and FileSystemUtilities.isRemoteFileName(self.ppath): |
|
7930 self.closeProject(noSave=True) |
7905 |
7931 |
7906 @pyqtSlot() |
7932 @pyqtSlot() |
7907 def __openRemoteProject(self): |
7933 def __openRemoteProject(self): |
7908 """ |
7934 """ |
7909 Private slot to open a project of an 'eric-ide' server. |
7935 Private slot to open a project of an 'eric-ide' server. |