8 """ |
8 """ |
9 |
9 |
10 from PyQt5.QtCore import pyqtSlot |
10 from PyQt5.QtCore import pyqtSlot |
11 |
11 |
12 from E5Gui.E5Application import e5App |
12 from E5Gui.E5Application import e5App |
|
13 from E5Gui.E5PathPicker import E5PathPickerModes |
13 |
14 |
14 from Preferences.ConfigurationPages.ConfigurationPageBase import ( |
15 from Preferences.ConfigurationPages.ConfigurationPageBase import ( |
15 ConfigurationPageBase |
16 ConfigurationPageBase |
16 ) |
17 ) |
17 from .Ui_FlaskPage import Ui_FlaskPage |
18 from .Ui_FlaskPage import Ui_FlaskPage |
63 |
64 |
64 venvManager = e5App().getObject("VirtualEnvManager") |
65 venvManager = e5App().getObject("VirtualEnvManager") |
65 self.py3VenvNameComboBox.addItems( |
66 self.py3VenvNameComboBox.addItems( |
66 [""] + sorted(venvManager.getVirtualenvNames())) |
67 [""] + sorted(venvManager.getVirtualenvNames())) |
67 |
68 |
|
69 self.translationsEditorPicker.setMode(E5PathPickerModes.OpenFileMode) |
|
70 self.translationsEditorPicker.setFilters(self.tr("All Files (*)")) |
|
71 |
68 # set initial values |
72 # set initial values |
69 self.consoleCommandCombo.setEditText( |
73 self.consoleCommandCombo.setEditText( |
70 self.__plugin.getPreferences("ConsoleCommand")) |
74 self.__plugin.getPreferences("ConsoleCommand")) |
71 |
75 |
72 self.externalBrowserCheckBox.setChecked( |
76 self.externalBrowserCheckBox.setChecked( |
84 self.colorSchemeComboBox.findText( |
88 self.colorSchemeComboBox.findText( |
85 self.__plugin.getPreferences("AnsiColorScheme"))) |
89 self.__plugin.getPreferences("AnsiColorScheme"))) |
86 |
90 |
87 self.urlEdit.setText( |
91 self.urlEdit.setText( |
88 self.__plugin.getPreferences("FlaskDocUrl")) |
92 self.__plugin.getPreferences("FlaskDocUrl")) |
|
93 |
|
94 self.translationsEditorPicker.setText( |
|
95 self.__plugin.getPreferences("TranslationsEditor")) |
89 |
96 |
90 def save(self): |
97 def save(self): |
91 """ |
98 """ |
92 Public slot to save the Flask configuration. |
99 Public slot to save the Flask configuration. |
93 """ |
100 """ |
105 "AnsiColorScheme", |
112 "AnsiColorScheme", |
106 self.colorSchemeComboBox.currentText()) |
113 self.colorSchemeComboBox.currentText()) |
107 |
114 |
108 self.__plugin.setPreferences( |
115 self.__plugin.setPreferences( |
109 "FlaskDocUrl", self.urlEdit.text()) |
116 "FlaskDocUrl", self.urlEdit.text()) |
|
117 |
|
118 self.__plugin.setPreferences( |
|
119 "TranslationsEditor", self.translationsEditorPicker.text()) |
110 |
120 |
111 @pyqtSlot() |
121 @pyqtSlot() |
112 def on_py3VenvNamesReloadButton_clicked(self): |
122 def on_py3VenvNamesReloadButton_clicked(self): |
113 """ |
123 """ |
114 Private slot to reload the virtual environment names. |
124 Private slot to reload the virtual environment names. |