22 QTableWidgetItem, |
22 QTableWidgetItem, |
23 QVBoxLayout, |
23 QVBoxLayout, |
24 QWidget, |
24 QWidget, |
25 ) |
25 ) |
26 |
26 |
27 from eric7 import Globals, Preferences, Utilities |
27 from eric7 import Preferences |
28 from eric7.EricGui import EricPixmapCache |
28 from eric7.EricGui import EricPixmapCache |
29 from eric7.EricWidgets import EricFileDialog, EricMessageBox |
29 from eric7.EricWidgets import EricFileDialog, EricMessageBox |
30 from eric7.EricWidgets.EricMainWindow import EricMainWindow |
30 from eric7.EricWidgets.EricMainWindow import EricMainWindow |
|
31 from eric7.SystemUtilities import FileSystemUtilities, PythonUtilities |
31 |
32 |
32 from .Ui_QRegularExpressionWizardDialog import Ui_QRegularExpressionWizardDialog |
33 from .Ui_QRegularExpressionWizardDialog import Ui_QRegularExpressionWizardDialog |
33 |
34 |
34 |
35 |
35 class QRegularExpressionWizardWidget(QWidget, Ui_QRegularExpressionWizardDialog): |
36 class QRegularExpressionWizardWidget(QWidget, Ui_QRegularExpressionWizardDialog): |
73 |
74 |
74 # start the PyQt6 server part |
75 # start the PyQt6 server part |
75 self.__pyqt6Available = False |
76 self.__pyqt6Available = False |
76 self.__pyqt6Server = QProcess(self) |
77 self.__pyqt6Server = QProcess(self) |
77 self.__pyqt6Server.start( |
78 self.__pyqt6Server.start( |
78 Globals.getPythonExecutable(), |
79 PythonUtilities.getPythonExecutable(), |
79 [ |
80 [ |
80 os.path.join( |
81 os.path.join( |
81 os.path.dirname(__file__), "QRegularExpressionWizardServer.py" |
82 os.path.dirname(__file__), "QRegularExpressionWizardServer.py" |
82 ) |
83 ) |
83 ], |
84 ], |
456 self.tr("Load regular expression"), |
457 self.tr("Load regular expression"), |
457 "", |
458 "", |
458 self.tr("RegExp Files (*.rx);;All Files (*)"), |
459 self.tr("RegExp Files (*.rx);;All Files (*)"), |
459 ) |
460 ) |
460 if fname: |
461 if fname: |
461 fname = Utilities.toNativeSeparators(fname) |
462 fname = FileSystemUtilities.toNativeSeparators(fname) |
462 try: |
463 try: |
463 with open(fname, "r", encoding="utf-8") as f: |
464 with open(fname, "r", encoding="utf-8") as f: |
464 regexp = f.read() |
465 regexp = f.read() |
465 self.regexpTextEdit.setPlainText(regexp) |
466 self.regexpTextEdit.setPlainText(regexp) |
466 except OSError as err: |
467 except OSError as err: |