9 |
9 |
10 import re |
10 import re |
11 import os |
11 import os |
12 import contextlib |
12 import contextlib |
13 |
13 |
14 from PyQt5.QtCore import ( |
14 from PyQt6.QtCore import ( |
15 pyqtSignal, pyqtSlot, Qt, QSignalMapper, QTimer, QFileInfo, QPoint, |
15 pyqtSignal, pyqtSlot, Qt, QSignalMapper, QTimer, QFileInfo, QPoint, |
16 QCoreApplication |
16 QCoreApplication |
17 ) |
17 ) |
18 from PyQt5.QtGui import QKeySequence, QPixmap |
18 from PyQt6.QtGui import QKeySequence, QPixmap |
19 from PyQt5.QtWidgets import ( |
19 from PyQt6.QtWidgets import ( |
20 QToolBar, QDialog, QApplication, QMenu, QWidget |
20 QToolBar, QDialog, QApplication, QMenu, QWidget |
21 ) |
21 ) |
22 from PyQt5.Qsci import QsciScintilla |
22 from PyQt6.Qsci import QsciScintilla |
23 |
23 |
24 from E5Gui.E5Application import e5App |
24 from E5Gui.E5Application import e5App |
25 from E5Gui import E5FileDialog, E5MessageBox |
25 from E5Gui import E5FileDialog, E5MessageBox |
26 |
26 |
27 from Globals import recentNameFiles, isMacPlatform |
27 from Globals import recentNameFiles, isMacPlatform |
1445 #################################################################### |
1445 #################################################################### |
1446 ## Below follow the actions for QScintilla standard commands. |
1446 ## Below follow the actions for QScintilla standard commands. |
1447 #################################################################### |
1447 #################################################################### |
1448 |
1448 |
1449 self.esm = QSignalMapper(self) |
1449 self.esm = QSignalMapper(self) |
1450 try: |
1450 self.esm.mappedInt.connect(self.__editorCommand) |
1451 self.alignMapper.mappedInt.connect(self.__editorCommand) |
|
1452 except AttributeError: |
|
1453 # pre Qt 5.15 |
|
1454 self.esm.mapped[int].connect(self.__editorCommand) |
|
1455 |
1451 |
1456 self.editorActGrp = createActionGroup(self.editActGrp) |
1452 self.editorActGrp = createActionGroup(self.editActGrp) |
1457 |
1453 |
1458 act = E5Action( |
1454 act = E5Action( |
1459 QCoreApplication.translate('ViewManager', |
1455 QCoreApplication.translate('ViewManager', |
3313 tb.addAction(self.searchOpenFilesAct) |
3309 tb.addAction(self.searchOpenFilesAct) |
3314 tb.addSeparator() |
3310 tb.addSeparator() |
3315 tb.addAction(self.gotoLastEditAct) |
3311 tb.addAction(self.gotoLastEditAct) |
3316 |
3312 |
3317 tb.setAllowedAreas( |
3313 tb.setAllowedAreas( |
3318 Qt.ToolBarAreas(Qt.ToolBarArea.TopToolBarArea | |
3314 Qt.ToolBarArea.TopToolBarArea | |
3319 Qt.ToolBarArea.BottomToolBarArea)) |
3315 Qt.ToolBarArea.BottomToolBarArea |
|
3316 ) |
3320 |
3317 |
3321 toolbarManager.addToolBar(tb, tb.windowTitle()) |
3318 toolbarManager.addToolBar(tb, tb.windowTitle()) |
3322 toolbarManager.addAction(self.gotoAct, tb.windowTitle()) |
3319 toolbarManager.addAction(self.gotoAct, tb.windowTitle()) |
3323 toolbarManager.addAction(self.gotoBraceAct, tb.windowTitle()) |
3320 toolbarManager.addAction(self.gotoBraceAct, tb.windowTitle()) |
3324 toolbarManager.addAction(self.replaceSelectionAct, tb.windowTitle()) |
3321 toolbarManager.addAction(self.replaceSelectionAct, tb.windowTitle()) |