Mon, 17 Jun 2013 18:57:32 +0200
Added a plug-in hooks for the 'open' action to the project forms and translations viewers.
--- a/Documentation/Source/eric5.MultiProject.AddProjectDialog.html Sun Jun 16 15:37:09 2013 +0200 +++ b/Documentation/Source/eric5.MultiProject.AddProjectDialog.html Mon Jun 17 18:57:32 2013 +0200 @@ -111,7 +111,7 @@ <dd> tuple of four values (string, string, boolean, string) giving the project name, the name of the project file, a flag telling, whether - the project shall be the master project and a short description + the project shall be the main project and a short description for the project </dd> </dl><a NAME="AddProjectDialog.on_fileButton_clicked" ID="AddProjectDialog.on_fileButton_clicked"></a>
--- a/Documentation/Source/eric5.Project.ProjectFormsBrowser.html Sun Jun 16 15:37:09 2013 +0200 +++ b/Documentation/Source/eric5.Project.ProjectFormsBrowser.html Mon Jun 17 18:57:32 2013 +0200 @@ -361,6 +361,7 @@ <li>compileChangedForms: takes list of filenames as parameter</li> <li>generateDialogCode: takes filename as parameter</li> <li>newForm: takes full directory path of new file as parameter</li> + <li>open: takes a filename as parameter</li> </ul> </p><p> <b>Note</b>: Filenames are relative to the project directory, if not
--- a/Documentation/Source/eric5.Project.ProjectTranslationsBrowser.html Sun Jun 16 15:37:09 2013 +0200 +++ b/Documentation/Source/eric5.Project.ProjectTranslationsBrowser.html Mon Jun 17 18:57:32 2013 +0200 @@ -449,6 +449,7 @@ <li>generateSelectedWithObsolete: takes list of filenames as parameter</li> <li>releaseAll: takes list of filenames as parameter</li> <li>releaseSelected: takes list of filenames as parameter</li> + <li>open: takes a filename as parameter</li> </ul> </p><p> <b>Note</b>: Filenames are relative to the project directory.
--- a/Project/ProjectFormsBrowser.py Sun Jun 16 15:37:09 2013 +0200 +++ b/Project/ProjectFormsBrowser.py Mon Jun 17 18:57:32 2013 +0200 @@ -148,6 +148,10 @@ self.hooks["compileAllForms"] is not None or \ self.hooks["generateDialogCode"] is not None: self.menu.addSeparator() + if self.hooks["open"] is not None: + self.menu.addAction( + self.hooksMenuEntries.get("open", self.trUtf8('Open')), + self.__openFile) self.menu.addAction(self.trUtf8('Open'), self.__openFileInEditor) self.menu.addSeparator() act = self.menu.addAction(self.trUtf8('Rename file'), self._renameFile) @@ -222,6 +226,10 @@ self.trUtf8('Compile forms')), self.__compileSelectedForms) self.multiMenu.addSeparator() + if self.hooks["open"] is not None: + self.multiMenu.addAction( + self.hooksMenuEntries.get("open", self.trUtf8('Open')), + self.__openFile) self.multiMenu.addAction(self.trUtf8('Open'), self.__openFileInEditor) self.multiMenu.addSeparator() act = self.multiMenu.addAction(self.trUtf8('Remove from project'), @@ -423,7 +431,11 @@ for itm in itmList[:]: try: if isinstance(itm, ProjectBrowserFileItem): - self.designerFile.emit(itm.fileName()) + # hook support + if self.hooks["open"] is not None: + self.hooks["open"](itm.fileName()) + else: + self.designerFile.emit(itm.fileName()) except: pass @@ -920,6 +932,7 @@ <li>compileChangedForms: takes list of filenames as parameter</li> <li>generateDialogCode: takes filename as parameter</li> <li>newForm: takes full directory path of new file as parameter</li> + <li>open: takes a filename as parameter</li> </ul> <b>Note</b>: Filenames are relative to the project directory, if not @@ -932,4 +945,5 @@ "compileSelectedForms": None, "generateDialogCode": None, "newForm": None, + "open": None, }
--- a/Project/ProjectTranslationsBrowser.py Sun Jun 16 15:37:09 2013 +0200 +++ b/Project/ProjectTranslationsBrowser.py Mon Jun 17 18:57:32 2013 +0200 @@ -177,8 +177,14 @@ self.__generateObsoleteAll) self.tsprocMenuActions.append(act) self.menu.addSeparator() + if self.hooks["open"] is not None: + act = self.menu.addAction( + self.hooksMenuEntries.get("open", + self.trUtf8('Open')), + self.__openItem) + self.tsMenuActions.append(act) act = self.menu.addAction(self.trUtf8('Open in Editor'), - self.__openFileInEditor) + self._openFileInEditor) self.tsMenuActions.append(act) self.menu.addSeparator() if self.hooks["releaseSelected"] is not None: @@ -313,6 +319,12 @@ self.tsMultiMenuActions.append(act) self.tsprocMultiMenuActions.append(act) self.multiMenu.addSeparator() + if self.hooks["open"] is not None: + act = self.multiMenu.addAction( + self.hooksMenuEntries.get("open", + self.trUtf8('Open')), + self.__openItem) + self.tsMultiMenuActions.append(act) act = self.multiMenu.addAction(self.trUtf8('Open in Editor'), self.__openFileInEditor) self.tsMultiMenuActions.append(act) @@ -571,7 +583,10 @@ itmList = self.getSelectedItems() for itm in itmList: if isinstance(itm, ProjectBrowserFileItem): - if itm.isLinguistFile(): + # hook support + if self.hooks["open"] is not None: + self.hooks["open"](itm.fileName()) + elif itm.isLinguistFile(): if itm.fileExt() == '.ts': self.linguistFile.emit(itm.fileName()) else: @@ -1109,6 +1124,7 @@ <li>generateSelectedWithObsolete: takes list of filenames as parameter</li> <li>releaseAll: takes list of filenames as parameter</li> <li>releaseSelected: takes list of filenames as parameter</li> + <li>open: takes a filename as parameter</li> </ul> <b>Note</b>: Filenames are relative to the project directory. @@ -1121,4 +1137,5 @@ "generateSelectedWithObsolete": None, "releaseAll": None, "releaseSelected": None, + "open": None, }
--- a/changelog Sun Jun 16 15:37:09 2013 +0200 +++ b/changelog Mon Jun 17 18:57:32 2013 +0200 @@ -35,8 +35,11 @@ - Project Viewer -- All --- added a context menu entry to delete the selected directory - -- Project Forms Viewer + -- Forms Viewer --- added support for more widgets in the code creation dialog + --- added a plug-in hook for the 'open' action + -- Translations Viewer + --- added a plug-in hook for the 'open' action - Shell -- changed the line numbers margin to adjust themselves to the size needed - Symbols Viewer