src/eric7/Project/Project.py

branch
eric7
changeset 9608
8dcfd48355df
parent 9605
e7d404c1780d
child 9610
b45bccbdf331
equal deleted inserted replaced
9607:8b8357e0ce4c 9608:8dcfd48355df
2229 if filetype != fileCategory: 2229 if filetype != fileCategory:
2230 reorganized = True 2230 reorganized = True
2231 2231
2232 if reorganized: 2232 if reorganized:
2233 # copy the reorganized files back to the project 2233 # copy the reorganized files back to the project
2234 ##for key in [
2235 ##"SOURCES",
2236 ##"FORMS",
2237 ##"INTERFACES",
2238 ##"PROTOCOLS",
2239 ##"RESOURCES",
2240 ##"OTHERS",
2241 ##"TRANSLATIONS",
2242 ##]:
2243 for fileCategory in self.getFileCategories(): 2234 for fileCategory in self.getFileCategories():
2244 self.__pdata[fileCategory] = newPdata[fileCategory][:] 2235 self.__pdata[fileCategory] = newPdata[fileCategory][:]
2245 2236
2246 # repopulate the model 2237 # repopulate the model
2247 self.__model.projectClosed(False) 2238 self.__model.projectClosed(False)
2254 @param olddn original directory name (string) 2245 @param olddn original directory name (string)
2255 @param newdn new directory name (string) 2246 @param newdn new directory name (string)
2256 """ 2247 """
2257 olddn = self.getRelativePath(olddn) 2248 olddn = self.getRelativePath(olddn)
2258 newdn = self.getRelativePath(newdn) 2249 newdn = self.getRelativePath(newdn)
2259 ##for key in [
2260 ##"SOURCES",
2261 ##"FORMS",
2262 ##"INTERFACES",
2263 ##"PROTOCOLS",
2264 ##"RESOURCES",
2265 ##"OTHERS",
2266 ##]:
2267 for fileCategory in [ 2250 for fileCategory in [
2268 c for c in self.getFileCategories() if c != "TRANSLATIONS" 2251 c for c in self.getFileCategories() if c != "TRANSLATIONS"
2269 ]: 2252 ]:
2270 for entry in self.__pdata[fileCategory][:]: 2253 for entry in self.__pdata[fileCategory][:]:
2271 if entry.startswith(olddn): 2254 if entry.startswith(olddn):
2283 @param newdn new directory name (string) 2266 @param newdn new directory name (string)
2284 """ 2267 """
2285 olddn = self.getRelativePath(olddn) 2268 olddn = self.getRelativePath(olddn)
2286 newdn = self.getRelativePath(newdn) 2269 newdn = self.getRelativePath(newdn)
2287 typeStrings = [] 2270 typeStrings = []
2288 ##for key in [
2289 ##"SOURCES",
2290 ##"FORMS",
2291 ##"INTERFACES",
2292 ##"PROTOCOLS",
2293 ##"RESOURCES",
2294 ##"OTHERS",
2295 ##]:
2296 for fileCategory in [ 2271 for fileCategory in [
2297 c for c in self.getFileCategories() if c != "TRANSLATIONS" 2272 c for c in self.getFileCategories() if c != "TRANSLATIONS"
2298 ]: 2273 ]:
2299 for entry in self.__pdata[fileCategory][:]: 2274 for entry in self.__pdata[fileCategory][:]:
2300 if entry.startswith(olddn): 2275 if entry.startswith(olddn):
2810 Preferences.setProject("AutoSaveProject", autoSaveProject) 2785 Preferences.setProject("AutoSaveProject", autoSaveProject)
2811 2786
2812 if self.__pdata["EMBEDDED_VENV"]: 2787 if self.__pdata["EMBEDDED_VENV"]:
2813 self.__createEmbeddedEnvironment() 2788 self.__createEmbeddedEnvironment()
2814 self.menuEnvironmentAct.setEnabled(self.__pdata["EMBEDDED_VENV"]) 2789 self.menuEnvironmentAct.setEnabled(self.__pdata["EMBEDDED_VENV"])
2790
2791 self.projectOpenedHooks.emit()
2792 self.projectOpened.emit()
2793
2794 # open the main script
2795 if self.__pdata["MAINSCRIPT"]:
2796 if not os.path.isabs(self.__pdata["MAINSCRIPT"]):
2797 ms = os.path.join(self.ppath, self.__pdata["MAINSCRIPT"])
2798 else:
2799 ms = self.__pdata["MAINSCRIPT"]
2800 self.sourceFile.emit(ms)
2815 2801
2816 def newProjectAddFiles(self, mainscript): 2802 def newProjectAddFiles(self, mainscript):
2817 """ 2803 """
2818 Public method to add files to a new project. 2804 Public method to add files to a new project.
2819 2805
4287 ) 4273 )
4288 act.setStatusTip(self.tr("Search new files in the project directory.")) 4274 act.setStatusTip(self.tr("Search new files in the project directory."))
4289 act.setWhatsThis( 4275 act.setWhatsThis(
4290 self.tr( 4276 self.tr(
4291 """<b>Search new files...</b>""" 4277 """<b>Search new files...</b>"""
4292 """<p>This searches for new files (sources, *.ui, *.idl,""" 4278 """<p>This searches for new files (sources, forms, ...) in the"""
4293 """ *.proto) in the project directory and registered""" 4279 """ project directory and registered subdirectories.</p>"""
4294 """ subdirectories.</p>"""
4295 ) 4280 )
4296 ) 4281 )
4297 act.triggered.connect(self.__searchNewFiles) 4282 act.triggered.connect(self.__searchNewFiles)
4298 self.actions.append(act) 4283 self.actions.append(act)
4299 4284

eric ide

mercurial