Project/ProjectOthersBrowser.py

changeset 476
121633976eca
parent 461
34528aaedf1c
child 500
c3abc7895a01
equal deleted inserted replaced
475:94b3fdd34c60 476:121633976eca
31 @signal closeSourceWindow(string) emitted after a file has been removed/deleted 31 @signal closeSourceWindow(string) emitted after a file has been removed/deleted
32 from the project 32 from the project
33 @signal showMenu(string, QMenu) emitted when a menu is about to be shown. The name 33 @signal showMenu(string, QMenu) emitted when a menu is about to be shown. The name
34 of the menu and a reference to the menu are given. 34 of the menu and a reference to the menu are given.
35 """ 35 """
36 sourceFile = pyqtSignal(str)
37
36 def __init__(self, project, parent=None): 38 def __init__(self, project, parent=None):
37 """ 39 """
38 Constructor 40 Constructor
39 41
40 @param project reference to the project object 42 @param project reference to the project object
229 elif itm.isSvgFile(): 231 elif itm.isSvgFile():
230 self.emit(SIGNAL('svgFile'), itm.fileName()) 232 self.emit(SIGNAL('svgFile'), itm.fileName())
231 else: 233 else:
232 type_ = mimetypes.guess_type(itm.fileName())[0] 234 type_ = mimetypes.guess_type(itm.fileName())[0]
233 if type_ is None or type_.split("/")[0] == "text": 235 if type_ is None or type_.split("/")[0] == "text":
234 self.emit(SIGNAL('sourceFile'), itm.fileName()) 236 self.sourceFile.emit(itm.fileName())
235 else: 237 else:
236 QDesktopServices.openUrl(QUrl(itm.fileName())) 238 QDesktopServices.openUrl(QUrl(itm.fileName()))
237 239
238 def __removeItem(self): 240 def __removeItem(self):
239 """ 241 """

eric ide

mercurial