1306 act.triggered[()].connect(self.esm.map) |
1306 act.triggered[()].connect(self.esm.map) |
1307 self.editActions.append(act) |
1307 self.editActions.append(act) |
1308 |
1308 |
1309 act = E5Action( |
1309 act = E5Action( |
1310 QApplication.translate('ViewManager', 'Formfeed'), |
1310 QApplication.translate('ViewManager', 'Formfeed'), |
1311 QApplication.translate('ViewManager', 'Formfeed'), |
1311 QApplication.translate('ViewManager', 'Formfeed'), |
1312 0, 0, |
1312 0, 0, |
1313 self.editorActGrp, 'vm_edit_formfeed') |
1313 self.editorActGrp, 'vm_edit_formfeed') |
1314 self.esm.setMapping(act, QsciScintilla.SCI_FORMFEED) |
1314 self.esm.setMapping(act, QsciScintilla.SCI_FORMFEED) |
1315 act.triggered[()].connect(self.esm.map) |
1315 act.triggered[()].connect(self.esm.map) |
1316 self.editActions.append(act) |
1316 self.editActions.append(act) |
1317 |
1317 |
1318 act = E5Action( |
1318 act = E5Action( |
1987 self.trUtf8('&What\'s This?'), |
1987 self.trUtf8('&What\'s This?'), |
1988 QKeySequence(self.trUtf8("Shift+F1", "Help|What's This?'")), |
1988 QKeySequence(self.trUtf8("Shift+F1", "Help|What's This?'")), |
1989 0, self, 'help_help_whats_this') |
1989 0, self, 'help_help_whats_this') |
1990 self.whatsThisAct.setStatusTip(self.trUtf8('Context sensitive help')) |
1990 self.whatsThisAct.setStatusTip(self.trUtf8('Context sensitive help')) |
1991 self.whatsThisAct.setWhatsThis(self.trUtf8( |
1991 self.whatsThisAct.setWhatsThis(self.trUtf8( |
1992 """<b>Display context sensitive help</b>""" |
1992 """<b>Display context sensitive help</b>""" |
1993 """<p>In What's This? mode, the mouse cursor shows an arrow""" |
1993 """<p>In What's This? mode, the mouse cursor shows an arrow""" |
1994 """ with a question mark, and you can click on the interface""" |
1994 """ with a question mark, and you can click on the interface""" |
1995 """ elements to get a short description of what they do and""" |
1995 """ elements to get a short description of what they do and""" |
1996 """ how to use them. In dialogs, this feature can be""" |
1996 """ how to use them. In dialogs, this feature can be""" |
1997 """ accessed using the context help button in the titlebar.""" |
1997 """ accessed using the context help button in the titlebar.""" |
1998 """</p>""" |
1998 """</p>""" |
1999 )) |
1999 )) |
2000 self.whatsThisAct.triggered[()].connect(self.__whatsThis) |
2000 self.whatsThisAct.triggered[()].connect(self.__whatsThis) |
2001 self.helpActions.append(self.whatsThisAct) |
2001 self.helpActions.append(self.whatsThisAct) |
2002 |
2002 |
2003 def __createMenus(self): |
2003 def __createMenus(self): |
2155 QApplication.restoreOverrideCursor() |
2155 QApplication.restoreOverrideCursor() |
2156 E5MessageBox.critical( |
2156 E5MessageBox.critical( |
2157 self, self.trUtf8('Open File'), |
2157 self, self.trUtf8('Open File'), |
2158 self.trUtf8('<p>The file <b>{0}</b> could not be opened.</p>' |
2158 self.trUtf8('<p>The file <b>{0}</b> could not be opened.</p>' |
2159 '<p>Reason: {1}</p>') |
2159 '<p>Reason: {1}</p>') |
2160 .format(fileName, str(why))) |
2160 .format(fileName, str(why))) |
2161 QApplication.restoreOverrideCursor() |
2161 QApplication.restoreOverrideCursor() |
2162 return |
2162 return |
2163 |
2163 |
2164 self.__textEdit.setText(txt) |
2164 self.__textEdit.setText(txt) |
2165 QApplication.restoreOverrideCursor() |
2165 QApplication.restoreOverrideCursor() |
2190 except (IOError, Utilities.CodingError, UnicodeError) as why: |
2190 except (IOError, Utilities.CodingError, UnicodeError) as why: |
2191 E5MessageBox.critical( |
2191 E5MessageBox.critical( |
2192 self, self.trUtf8('Save File'), |
2192 self, self.trUtf8('Save File'), |
2193 self.trUtf8('<p>The file <b>{0}</b> could not be saved.<br/>' |
2193 self.trUtf8('<p>The file <b>{0}</b> could not be saved.<br/>' |
2194 'Reason: {1}</p>') |
2194 'Reason: {1}</p>') |
2195 .format(fileName, str(why))) |
2195 .format(fileName, str(why))) |
2196 QApplication.restoreOverrideCursor() |
2196 QApplication.restoreOverrideCursor() |
2197 |
2197 |
2198 self.__checkActions() |
2198 self.__checkActions() |
2199 |
2199 |
2200 return False |
2200 return False |
2793 |
2793 |
2794 if self.filetype == "": |
2794 if self.filetype == "": |
2795 line0 = self.__textEdit.text(0) |
2795 line0 = self.__textEdit.text(0) |
2796 if line0.startswith("#!") and \ |
2796 if line0.startswith("#!") and \ |
2797 ("python2" in line0 or |
2797 ("python2" in line0 or |
2798 ("python" in line0 and not "python3" in line0)): |
2798 ("python" in line0 and not "python3" in line0)): |
2799 return True |
2799 return True |
2800 |
2800 |
2801 if self.__curFile is not None: |
2801 if self.__curFile is not None: |
2802 exts = [] |
2802 exts = [] |
2803 for ext in Preferences.getDebugger("PythonExtensions").split(): |
2803 for ext in Preferences.getDebugger("PythonExtensions").split(): |