147 |
147 |
148 # initialize the file system watcher |
148 # initialize the file system watcher |
149 self.__watcher = QFileSystemWatcher(self) |
149 self.__watcher = QFileSystemWatcher(self) |
150 self.__watcher.fileChanged.connect(self.__watchedFileChanged) |
150 self.__watcher.fileChanged.connect(self.__watchedFileChanged) |
151 |
151 |
152 def setReferences(self, ui, dbs): |
152 def setReferences(self, ui, dbs, remoteServerInterface): |
153 """ |
153 """ |
154 Public method to set some references needed later on. |
154 Public method to set some references needed later on. |
155 |
155 |
156 @param ui reference to the main user interface |
156 @param ui reference to the main user interface |
157 @type UserInterface |
157 @type UserInterface |
158 @param dbs reference to the debug server object |
158 @param dbs reference to the debug server object |
159 @type DebugServer |
159 @type DebugServer |
|
160 @param remoteServerInterface reference to the 'eric-ide' server interface |
|
161 @type EricServerInterface |
160 """ |
162 """ |
161 from eric7.QScintilla.SearchReplaceWidget import SearchReplaceSlidingWidget |
163 from eric7.QScintilla.SearchReplaceWidget import SearchReplaceSlidingWidget |
162 |
164 |
163 self.ui = ui |
165 self.ui = ui |
164 self.dbs = dbs |
166 self.dbs = dbs |
|
167 self.__remotefsInterface = remoteServerInterface.getServiceInterface( |
|
168 "FileSystem" |
|
169 ) |
165 |
170 |
166 self.__searchReplaceWidget = SearchReplaceSlidingWidget(self, ui) |
171 self.__searchReplaceWidget = SearchReplaceSlidingWidget(self, ui) |
167 |
172 |
168 self.editorClosedEd.connect(self.__searchReplaceWidget.editorClosed) |
173 self.editorClosedEd.connect(self.__searchReplaceWidget.editorClosed) |
169 self.checkActions.connect(self.__searchReplaceWidget.updateSelectionCheckBox) |
174 self.checkActions.connect(self.__searchReplaceWidget.updateSelectionCheckBox) |
6112 @rtype list of str |
6117 @rtype list of str |
6113 """ |
6118 """ |
6114 filenames = [] |
6119 filenames = [] |
6115 for editor in self.editors: |
6120 for editor in self.editors: |
6116 fn = editor.getFileName() |
6121 fn = editor.getFileName() |
6117 if fn is not None and fn not in filenames and os.path.exists(fn): |
6122 if fn is not None and fn not in filenames: |
6118 # only return names of existing files |
6123 # only return names of existing files |
6119 filenames.append(fn) |
6124 exists = ( |
|
6125 self.__remotefsInterface.exists(fn) |
|
6126 if FileSystemUtilities.isRemoteFileName(fn) |
|
6127 else os.path.exists(fn) |
|
6128 ) |
|
6129 if exists: |
|
6130 filenames.append(fn) |
6120 |
6131 |
6121 return filenames |
6132 return filenames |
6122 |
6133 |
6123 def getEditor(self, fn, filetype="", addNext=False, indexes=None): |
6134 def getEditor(self, fn, filetype="", addNext=False, indexes=None): |
6124 """ |
6135 """ |