ViewManager/ViewManager.py

changeset 2108
22e480e4a47e
parent 1980
dd505ca698dc
child 2109
621ffe935354
equal deleted inserted replaced
2107:1690f30db6f3 2108:22e480e4a47e
742 self.redoAct = E5Action(QApplication.translate('ViewManager', 'Redo'), 742 self.redoAct = E5Action(QApplication.translate('ViewManager', 'Redo'),
743 UI.PixmapCache.getIcon("editRedo.png"), 743 UI.PixmapCache.getIcon("editRedo.png"),
744 QApplication.translate('ViewManager', '&Redo'), 744 QApplication.translate('ViewManager', '&Redo'),
745 QKeySequence(QApplication.translate('ViewManager', 745 QKeySequence(QApplication.translate('ViewManager',
746 "Ctrl+Shift+Z", "Edit|Redo")), 746 "Ctrl+Shift+Z", "Edit|Redo")),
747 0, self.editActGrp, 'vm_edit_redo') 747 0,
748 self.editActGrp, 'vm_edit_redo')
748 self.redoAct.setStatusTip(QApplication.translate('ViewManager', 749 self.redoAct.setStatusTip(QApplication.translate('ViewManager',
749 'Redo the last change')) 750 'Redo the last change'))
750 self.redoAct.setWhatsThis(QApplication.translate('ViewManager', 751 self.redoAct.setWhatsThis(QApplication.translate('ViewManager',
751 """<b>Redo</b>""" 752 """<b>Redo</b>"""
752 """<p>Redo the last change done in the current editor.</p>""" 753 """<p>Redo the last change done in the current editor.</p>"""
960 self.editActions.append(self.toggleCommentAct) 961 self.editActions.append(self.toggleCommentAct)
961 962
962 self.streamCommentAct = E5Action(QApplication.translate('ViewManager', 963 self.streamCommentAct = E5Action(QApplication.translate('ViewManager',
963 'Stream Comment'), 964 'Stream Comment'),
964 QApplication.translate('ViewManager', 'Stream Comment'), 965 QApplication.translate('ViewManager', 'Stream Comment'),
965 0, 0, self.editActGrp, 'vm_edit_stream_comment') 966 0, 0,
967 self.editActGrp, 'vm_edit_stream_comment')
966 self.streamCommentAct.setStatusTip(QApplication.translate('ViewManager', 968 self.streamCommentAct.setStatusTip(QApplication.translate('ViewManager',
967 'Stream Comment Line or Selection')) 969 'Stream Comment Line or Selection'))
968 self.streamCommentAct.setWhatsThis(QApplication.translate('ViewManager', 970 self.streamCommentAct.setWhatsThis(QApplication.translate('ViewManager',
969 """<b>Stream Comment</b>""" 971 """<b>Stream Comment</b>"""
970 """<p>Stream comments the current line or the current selection.</p>""" 972 """<p>Stream comments the current line or the current selection.</p>"""
973 self.editActions.append(self.streamCommentAct) 975 self.editActions.append(self.streamCommentAct)
974 976
975 self.boxCommentAct = E5Action(QApplication.translate('ViewManager', 977 self.boxCommentAct = E5Action(QApplication.translate('ViewManager',
976 'Box Comment'), 978 'Box Comment'),
977 QApplication.translate('ViewManager', 'Box Comment'), 979 QApplication.translate('ViewManager', 'Box Comment'),
978 0, 0, self.editActGrp, 'vm_edit_box_comment') 980 0, 0,
981 self.editActGrp, 'vm_edit_box_comment')
979 self.boxCommentAct.setStatusTip(QApplication.translate('ViewManager', 982 self.boxCommentAct.setStatusTip(QApplication.translate('ViewManager',
980 'Box Comment Line or Selection')) 983 'Box Comment Line or Selection'))
981 self.boxCommentAct.setWhatsThis(QApplication.translate('ViewManager', 984 self.boxCommentAct.setWhatsThis(QApplication.translate('ViewManager',
982 """<b>Box Comment</b>""" 985 """<b>Box Comment</b>"""
983 """<p>Box comments the current line or the lines of the""" 986 """<p>Box comments the current line or the lines of the"""
1034 self.editActions.append(self.deselectAllAct) 1037 self.editActions.append(self.deselectAllAct)
1035 1038
1036 self.convertEOLAct = E5Action(QApplication.translate('ViewManager', 1039 self.convertEOLAct = E5Action(QApplication.translate('ViewManager',
1037 'Convert Line End Characters'), 1040 'Convert Line End Characters'),
1038 QApplication.translate('ViewManager', 'Convert &Line End Characters'), 1041 QApplication.translate('ViewManager', 'Convert &Line End Characters'),
1039 0, 0, self.editActGrp, 'vm_edit_convert_eol') 1042 0, 0,
1043 self.editActGrp, 'vm_edit_convert_eol')
1040 self.convertEOLAct.setStatusTip(QApplication.translate('ViewManager', 1044 self.convertEOLAct.setStatusTip(QApplication.translate('ViewManager',
1041 'Convert Line End Characters')) 1045 'Convert Line End Characters'))
1042 self.convertEOLAct.setWhatsThis(QApplication.translate('ViewManager', 1046 self.convertEOLAct.setWhatsThis(QApplication.translate('ViewManager',
1043 """<b>Convert Line End Characters</b>""" 1047 """<b>Convert Line End Characters</b>"""
1044 """<p>Convert the line end characters to the currently set type.</p>""" 1048 """<p>Convert the line end characters to the currently set type.</p>"""
1047 self.editActions.append(self.convertEOLAct) 1051 self.editActions.append(self.convertEOLAct)
1048 1052
1049 self.shortenEmptyAct = E5Action(QApplication.translate('ViewManager', 1053 self.shortenEmptyAct = E5Action(QApplication.translate('ViewManager',
1050 'Shorten empty lines'), 1054 'Shorten empty lines'),
1051 QApplication.translate('ViewManager', 'Shorten empty lines'), 1055 QApplication.translate('ViewManager', 'Shorten empty lines'),
1052 0, 0, self.editActGrp, 'vm_edit_shorten_empty_lines') 1056 0, 0,
1057 self.editActGrp, 'vm_edit_shorten_empty_lines')
1053 self.shortenEmptyAct.setStatusTip(QApplication.translate('ViewManager', 1058 self.shortenEmptyAct.setStatusTip(QApplication.translate('ViewManager',
1054 'Shorten empty lines')) 1059 'Shorten empty lines'))
1055 self.shortenEmptyAct.setWhatsThis(QApplication.translate('ViewManager', 1060 self.shortenEmptyAct.setWhatsThis(QApplication.translate('ViewManager',
1056 """<b>Shorten empty lines</b>""" 1061 """<b>Shorten empty lines</b>"""
1057 """<p>Shorten lines consisting solely of whitespace characters.</p>""" 1062 """<p>Shorten lines consisting solely of whitespace characters.</p>"""
1078 self.autoCompleteFromDocAct = E5Action(QApplication.translate('ViewManager', 1083 self.autoCompleteFromDocAct = E5Action(QApplication.translate('ViewManager',
1079 'Autocomplete from Document'), 1084 'Autocomplete from Document'),
1080 QApplication.translate('ViewManager', 'Autocomplete from Document'), 1085 QApplication.translate('ViewManager', 'Autocomplete from Document'),
1081 QKeySequence(QApplication.translate('ViewManager', "Ctrl+Shift+Space", 1086 QKeySequence(QApplication.translate('ViewManager', "Ctrl+Shift+Space",
1082 "Edit|Autocomplete from Document")), 1087 "Edit|Autocomplete from Document")),
1083 0, self.editActGrp, 'vm_edit_autocomplete_from_document') 1088 0,
1089 self.editActGrp, 'vm_edit_autocomplete_from_document')
1084 self.autoCompleteFromDocAct.setStatusTip(QApplication.translate('ViewManager', 1090 self.autoCompleteFromDocAct.setStatusTip(QApplication.translate('ViewManager',
1085 'Autocomplete current word from Document')) 1091 'Autocomplete current word from Document'))
1086 self.autoCompleteFromDocAct.setWhatsThis(QApplication.translate('ViewManager', 1092 self.autoCompleteFromDocAct.setWhatsThis(QApplication.translate('ViewManager',
1087 """<b>Autocomplete from Document</b>""" 1093 """<b>Autocomplete from Document</b>"""
1088 """<p>Performs an autocompletion from document of the word""" 1094 """<p>Performs an autocompletion from document of the word"""
1094 self.autoCompleteFromAPIsAct = E5Action(QApplication.translate('ViewManager', 1100 self.autoCompleteFromAPIsAct = E5Action(QApplication.translate('ViewManager',
1095 'Autocomplete from APIs'), 1101 'Autocomplete from APIs'),
1096 QApplication.translate('ViewManager', 'Autocomplete from APIs'), 1102 QApplication.translate('ViewManager', 'Autocomplete from APIs'),
1097 QKeySequence(QApplication.translate('ViewManager', "Ctrl+Alt+Space", 1103 QKeySequence(QApplication.translate('ViewManager', "Ctrl+Alt+Space",
1098 "Edit|Autocomplete from APIs")), 1104 "Edit|Autocomplete from APIs")),
1099 0, self.editActGrp, 'vm_edit_autocomplete_from_api') 1105 0,
1106 self.editActGrp, 'vm_edit_autocomplete_from_api')
1100 self.autoCompleteFromAPIsAct.setStatusTip(QApplication.translate('ViewManager', 1107 self.autoCompleteFromAPIsAct.setStatusTip(QApplication.translate('ViewManager',
1101 'Autocomplete current word from APIs')) 1108 'Autocomplete current word from APIs'))
1102 self.autoCompleteFromAPIsAct.setWhatsThis(QApplication.translate('ViewManager', 1109 self.autoCompleteFromAPIsAct.setWhatsThis(QApplication.translate('ViewManager',
1103 """<b>Autocomplete from APIs</b>""" 1110 """<b>Autocomplete from APIs</b>"""
1104 """<p>Performs an autocompletion from APIs of the word containing""" 1111 """<p>Performs an autocompletion from APIs of the word containing"""
1112 'Autocomplete from Document and APIs'), 1119 'Autocomplete from Document and APIs'),
1113 QApplication.translate('ViewManager', 1120 QApplication.translate('ViewManager',
1114 'Autocomplete from Document and APIs'), 1121 'Autocomplete from Document and APIs'),
1115 QKeySequence(QApplication.translate('ViewManager', "Alt+Shift+Space", 1122 QKeySequence(QApplication.translate('ViewManager', "Alt+Shift+Space",
1116 "Edit|Autocomplete from Document and APIs")), 1123 "Edit|Autocomplete from Document and APIs")),
1117 0, self.editActGrp, 'vm_edit_autocomplete_from_all') 1124 0,
1125 self.editActGrp, 'vm_edit_autocomplete_from_all')
1118 self.autoCompleteFromAllAct.setStatusTip(QApplication.translate('ViewManager', 1126 self.autoCompleteFromAllAct.setStatusTip(QApplication.translate('ViewManager',
1119 'Autocomplete current word from Document and APIs')) 1127 'Autocomplete current word from Document and APIs'))
1120 self.autoCompleteFromAllAct.setWhatsThis(QApplication.translate('ViewManager', 1128 self.autoCompleteFromAllAct.setWhatsThis(QApplication.translate('ViewManager',
1121 """<b>Autocomplete from Document and APIs</b>""" 1129 """<b>Autocomplete from Document and APIs</b>"""
1122 """<p>Performs an autocompletion from document and APIs""" 1130 """<p>Performs an autocompletion from document and APIs"""
5170 5178
5171 # save the list of recently opened projects 5179 # save the list of recently opened projects
5172 Preferences.Prefs.settings.setValue('Bookmarked/Sources', self.bookmarked) 5180 Preferences.Prefs.settings.setValue('Bookmarked/Sources', self.bookmarked)
5173 5181
5174 if len(self.editors): 5182 if len(self.editors):
5175 return False 5183 res = False
5176 else: 5184 else:
5177 return True 5185 res = True
5186
5187 if res:
5188 e5App().focusChanged.disconnect(
5189 self.viewmanager.appFocusChanged)
5190
5191 return res
5178 5192
5179 def __lastEditorClosed(self): 5193 def __lastEditorClosed(self):
5180 """ 5194 """
5181 Private slot to handle the lastEditorClosed signal. 5195 Private slot to handle the lastEditorClosed signal.
5182 """ 5196 """

eric ide

mercurial