5 |
5 |
6 """ |
6 """ |
7 Module implementing the Flask configuration page. |
7 Module implementing the Flask configuration page. |
8 """ |
8 """ |
9 |
9 |
10 from PyQt5.QtCore import pyqtSlot |
10 from PyQt6.QtCore import pyqtSlot |
11 |
11 |
12 from E5Gui.E5Application import e5App |
12 from EricWidgets.EricApplication import ericApp |
13 from E5Gui.E5PathPicker import E5PathPickerModes |
13 from EricWidgets.EricPathPicker import EricPathPickerModes |
14 |
14 |
15 from Preferences.ConfigurationPages.ConfigurationPageBase import ( |
15 from Preferences.ConfigurationPages.ConfigurationPageBase import ( |
16 ConfigurationPageBase |
16 ConfigurationPageBase |
17 ) |
17 ) |
18 from .Ui_FlaskPage import Ui_FlaskPage |
18 from .Ui_FlaskPage import Ui_FlaskPage |
60 self.urlResetButton.setIcon( |
60 self.urlResetButton.setIcon( |
61 UI.PixmapCache.getIcon("editUndo")) |
61 UI.PixmapCache.getIcon("editUndo")) |
62 self.py3VenvNamesReloadButton.setIcon( |
62 self.py3VenvNamesReloadButton.setIcon( |
63 UI.PixmapCache.getIcon("reload")) |
63 UI.PixmapCache.getIcon("reload")) |
64 |
64 |
65 venvManager = e5App().getObject("VirtualEnvManager") |
65 venvManager = ericApp().getObject("VirtualEnvManager") |
66 self.py3VenvNameComboBox.addItems( |
66 self.py3VenvNameComboBox.addItems( |
67 [""] + sorted(venvManager.getVirtualenvNames())) |
67 [""] + sorted(venvManager.getVirtualenvNames())) |
68 |
68 |
69 self.translationsEditorPicker.setMode(E5PathPickerModes.OpenFileMode) |
69 self.translationsEditorPicker.setMode( |
|
70 EricPathPickerModes.OPEN_FILE_MODE) |
70 self.translationsEditorPicker.setFilters(self.tr("All Files (*)")) |
71 self.translationsEditorPicker.setFilters(self.tr("All Files (*)")) |
71 |
72 |
72 # set initial values |
73 # set initial values |
73 self.consoleCommandCombo.setEditText( |
74 self.consoleCommandCombo.setEditText( |
74 self.__plugin.getPreferences("ConsoleCommand")) |
75 self.__plugin.getPreferences("ConsoleCommand")) |
82 index = self.py3VenvNameComboBox.findText(venvName) |
83 index = self.py3VenvNameComboBox.findText(venvName) |
83 if index < 0: |
84 if index < 0: |
84 index = 0 |
85 index = 0 |
85 self.py3VenvNameComboBox.setCurrentIndex(index) |
86 self.py3VenvNameComboBox.setCurrentIndex(index) |
86 |
87 |
87 self.colorSchemeComboBox.setCurrentIndex( |
88 self.colorSchemeComboBox.setCurrentText( |
88 self.colorSchemeComboBox.findText( |
89 self.__plugin.getPreferences("AnsiColorScheme")) |
89 self.__plugin.getPreferences("AnsiColorScheme"))) |
|
90 |
90 |
91 self.urlEdit.setText( |
91 self.urlEdit.setText( |
92 self.__plugin.getPreferences("FlaskDocUrl")) |
92 self.__plugin.getPreferences("FlaskDocUrl")) |
93 |
93 |
94 self.translationsEditorPicker.setText( |
94 self.translationsEditorPicker.setText( |
123 """ |
123 """ |
124 Private slot to reload the virtual environment names. |
124 Private slot to reload the virtual environment names. |
125 """ |
125 """ |
126 currentVenvName = self.py3VenvNameComboBox.currentText() |
126 currentVenvName = self.py3VenvNameComboBox.currentText() |
127 self.py3VenvNameComboBox.clear() |
127 self.py3VenvNameComboBox.clear() |
128 venvManager = e5App().getObject("VirtualEnvManager") |
128 venvManager = ericApp().getObject("VirtualEnvManager") |
129 self.py3VenvNameComboBox.addItems( |
129 self.py3VenvNameComboBox.addItems( |
130 [""] + sorted(venvManager.getVirtualenvNames())) |
130 [""] + sorted(venvManager.getVirtualenvNames())) |
131 if currentVenvName: |
131 if currentVenvName: |
132 index = self.py3VenvNameComboBox.findText(currentVenvName) |
132 index = self.py3VenvNameComboBox.findText(currentVenvName) |
133 if index < 0: |
133 if index < 0: |