eric6/ViewManager/ViewManager.py

changeset 7759
51aa6c6b66f7
parent 7746
12d5e1e6abd1
child 7762
e77f58e5f663
equal deleted inserted replaced
7758:dd54d33d21d2 7759:51aa6c6b66f7
306 """ 306 """
307 aw = self.activeWindow() 307 aw = self.activeWindow()
308 if aw is not None: 308 if aw is not None:
309 menu = aw.getMenu("Languages") 309 menu = aw.getMenu("Languages")
310 if menu is not None: 310 if menu is not None:
311 menu.exec_(pos) 311 menu.exec(pos)
312 312
313 def __showEolMenu(self, pos): 313 def __showEolMenu(self, pos):
314 """ 314 """
315 Private slot to show the EOL menu of the current editor. 315 Private slot to show the EOL menu of the current editor.
316 316
318 """ 318 """
319 aw = self.activeWindow() 319 aw = self.activeWindow()
320 if aw is not None: 320 if aw is not None:
321 menu = aw.getMenu("Eol") 321 menu = aw.getMenu("Eol")
322 if menu is not None: 322 if menu is not None:
323 menu.exec_(pos) 323 menu.exec(pos)
324 324
325 def __showEncodingsMenu(self, pos): 325 def __showEncodingsMenu(self, pos):
326 """ 326 """
327 Private slot to show the Encodings menu of the current editor. 327 Private slot to show the Encodings menu of the current editor.
328 328
330 """ 330 """
331 aw = self.activeWindow() 331 aw = self.activeWindow()
332 if aw is not None: 332 if aw is not None:
333 menu = aw.getMenu("Encodings") 333 menu = aw.getMenu("Encodings")
334 if menu is not None: 334 if menu is not None:
335 menu.exec_(pos) 335 menu.exec(pos)
336 336
337 ########################################################################### 337 ###########################################################################
338 ## methods below need to be implemented by a subclass 338 ## methods below need to be implemented by a subclass
339 ########################################################################### 339 ###########################################################################
340 340
5384 """ 5384 """
5385 Private method to edit the list of bookmarked files. 5385 Private method to edit the list of bookmarked files.
5386 """ 5386 """
5387 from .BookmarkedFilesDialog import BookmarkedFilesDialog 5387 from .BookmarkedFilesDialog import BookmarkedFilesDialog
5388 dlg = BookmarkedFilesDialog(self.bookmarked, self.ui) 5388 dlg = BookmarkedFilesDialog(self.bookmarked, self.ui)
5389 if dlg.exec_() == QDialog.Accepted: 5389 if dlg.exec() == QDialog.Accepted:
5390 self.bookmarked = dlg.getBookmarkedFiles() 5390 self.bookmarked = dlg.getBookmarkedFiles()
5391 5391
5392 def __clearBookmarked(self): 5392 def __clearBookmarked(self):
5393 """ 5393 """
5394 Private method to clear the bookmarked files menu. 5394 Private method to clear the bookmarked files menu.
5993 5993
5994 aw = self.activeWindow() 5994 aw = self.activeWindow()
5995 lines = aw.lines() 5995 lines = aw.lines()
5996 curLine = aw.getCursorPosition()[0] + 1 5996 curLine = aw.getCursorPosition()[0] + 1
5997 dlg = GotoDialog(lines, curLine, self.ui, None, True) 5997 dlg = GotoDialog(lines, curLine, self.ui, None, True)
5998 if dlg.exec_() == QDialog.Accepted: 5998 if dlg.exec() == QDialog.Accepted:
5999 aw.gotoLine(dlg.getLinenumber(), expand=True) 5999 aw.gotoLine(dlg.getLinenumber(), expand=True)
6000 6000
6001 def __gotoBrace(self): 6001 def __gotoBrace(self):
6002 """ 6002 """
6003 Private method to handle the goto brace action. 6003 Private method to handle the goto brace action.
6103 else: 6103 else:
6104 aw = self.activeWindow() 6104 aw = self.activeWindow()
6105 if aw: 6105 if aw:
6106 from QScintilla.ZoomDialog import ZoomDialog 6106 from QScintilla.ZoomDialog import ZoomDialog
6107 dlg = ZoomDialog(aw.getZoom(), self.ui, None, True) 6107 dlg = ZoomDialog(aw.getZoom(), self.ui, None, True)
6108 if dlg.exec_() == QDialog.Accepted: 6108 if dlg.exec() == QDialog.Accepted:
6109 value = dlg.getZoomSize() 6109 value = dlg.getZoomSize()
6110 self.__zoomTo(value) 6110 self.__zoomTo(value)
6111 6111
6112 def __zoomTo(self, value): 6112 def __zoomTo(self, value):
6113 """ 6113 """
6612 dlg = SpellingDictionaryEditDialog( 6612 dlg = SpellingDictionaryEditDialog(
6613 data, 6613 data,
6614 QCoreApplication.translate('ViewManager', "Editing {0}") 6614 QCoreApplication.translate('ViewManager', "Editing {0}")
6615 .format(fileInfo), 6615 .format(fileInfo),
6616 self.ui) 6616 self.ui)
6617 if dlg.exec_() == QDialog.Accepted: 6617 if dlg.exec() == QDialog.Accepted:
6618 data = dlg.getData() 6618 data = dlg.getData()
6619 try: 6619 try:
6620 f = open(dictionaryFile, "w", encoding="utf-8") 6620 f = open(dictionaryFile, "w", encoding="utf-8")
6621 f.write(data) 6621 f.write(data)
6622 f.close() 6622 f.close()

eric ide

mercurial