52 consoleList.append("gnome-terminal -e") |
51 consoleList.append("gnome-terminal -e") |
53 consoleList.append("mate-terminal -e") |
52 consoleList.append("mate-terminal -e") |
54 consoleList.append("xfce4-terminal -e") |
53 consoleList.append("xfce4-terminal -e") |
55 consoleList.append("xterm -e") |
54 consoleList.append("xterm -e") |
56 self.consoleCommandCombo.addItems(consoleList) |
55 self.consoleCommandCombo.addItems(consoleList) |
57 |
56 |
58 self.colorSchemeComboBox.addItems( |
57 self.colorSchemeComboBox.addItems(sorted(AnsiTools.getAvailableColorSchemes())) |
59 sorted(AnsiTools.getAvailableColorSchemes())) |
58 |
60 |
59 self.urlResetButton.setIcon(UI.PixmapCache.getIcon("editUndo")) |
61 self.urlResetButton.setIcon( |
60 self.py3VenvNamesReloadButton.setIcon(UI.PixmapCache.getIcon("reload")) |
62 UI.PixmapCache.getIcon("editUndo")) |
61 |
63 self.py3VenvNamesReloadButton.setIcon( |
|
64 UI.PixmapCache.getIcon("reload")) |
|
65 |
|
66 venvManager = ericApp().getObject("VirtualEnvManager") |
62 venvManager = ericApp().getObject("VirtualEnvManager") |
67 self.py3VenvNameComboBox.addItems( |
63 self.py3VenvNameComboBox.addItems( |
68 [""] + sorted(venvManager.getVirtualenvNames())) |
64 [""] + sorted(venvManager.getVirtualenvNames()) |
69 |
65 ) |
70 self.translationsEditorPicker.setMode( |
66 |
71 EricPathPickerModes.OPEN_FILE_MODE) |
67 self.translationsEditorPicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) |
72 self.translationsEditorPicker.setFilters(self.tr("All Files (*)")) |
68 self.translationsEditorPicker.setFilters(self.tr("All Files (*)")) |
73 |
69 |
74 # set initial values |
70 # set initial values |
75 self.consoleCommandCombo.setEditText( |
71 self.consoleCommandCombo.setEditText( |
76 self.__plugin.getPreferences("ConsoleCommand")) |
72 self.__plugin.getPreferences("ConsoleCommand") |
77 |
73 ) |
|
74 |
78 self.externalBrowserCheckBox.setChecked( |
75 self.externalBrowserCheckBox.setChecked( |
79 self.__plugin.getPreferences("UseExternalBrowser")) |
76 self.__plugin.getPreferences("UseExternalBrowser") |
80 |
77 ) |
81 venvName = self.__plugin.getPreferences( |
78 |
82 "VirtualEnvironmentNamePy3") |
79 venvName = self.__plugin.getPreferences("VirtualEnvironmentNamePy3") |
83 if venvName: |
80 if venvName: |
84 index = self.py3VenvNameComboBox.findText(venvName) |
81 index = self.py3VenvNameComboBox.findText(venvName) |
85 if index < 0: |
82 if index < 0: |
86 index = 0 |
83 index = 0 |
87 self.py3VenvNameComboBox.setCurrentIndex(index) |
84 self.py3VenvNameComboBox.setCurrentIndex(index) |
88 |
85 |
89 self.colorSchemeComboBox.setCurrentText( |
86 self.colorSchemeComboBox.setCurrentText( |
90 self.__plugin.getPreferences("AnsiColorScheme")) |
87 self.__plugin.getPreferences("AnsiColorScheme") |
91 |
88 ) |
92 self.urlEdit.setText( |
89 |
93 self.__plugin.getPreferences("FlaskDocUrl")) |
90 self.urlEdit.setText(self.__plugin.getPreferences("FlaskDocUrl")) |
94 |
91 |
95 self.translationsEditorPicker.setText( |
92 self.translationsEditorPicker.setText( |
96 self.__plugin.getPreferences("TranslationsEditor")) |
93 self.__plugin.getPreferences("TranslationsEditor") |
97 |
94 ) |
|
95 |
98 def save(self): |
96 def save(self): |
99 """ |
97 """ |
100 Public slot to save the Flask configuration. |
98 Public slot to save the Flask configuration. |
101 """ |
99 """ |
102 self.__plugin.setPreferences( |
100 self.__plugin.setPreferences( |
103 "ConsoleCommand", self.consoleCommandCombo.currentText()) |
101 "ConsoleCommand", self.consoleCommandCombo.currentText() |
104 |
102 ) |
|
103 |
105 self.__plugin.setPreferences( |
104 self.__plugin.setPreferences( |
106 "UseExternalBrowser", self.externalBrowserCheckBox.isChecked()) |
105 "UseExternalBrowser", self.externalBrowserCheckBox.isChecked() |
107 |
106 ) |
|
107 |
108 self.__plugin.setPreferences( |
108 self.__plugin.setPreferences( |
109 "VirtualEnvironmentNamePy3", |
109 "VirtualEnvironmentNamePy3", self.py3VenvNameComboBox.currentText() |
110 self.py3VenvNameComboBox.currentText()) |
110 ) |
111 |
111 |
112 self.__plugin.setPreferences( |
112 self.__plugin.setPreferences( |
113 "AnsiColorScheme", |
113 "AnsiColorScheme", self.colorSchemeComboBox.currentText() |
114 self.colorSchemeComboBox.currentText()) |
114 ) |
115 |
115 |
|
116 self.__plugin.setPreferences("FlaskDocUrl", self.urlEdit.text()) |
|
117 |
116 self.__plugin.setPreferences( |
118 self.__plugin.setPreferences( |
117 "FlaskDocUrl", self.urlEdit.text()) |
119 "TranslationsEditor", self.translationsEditorPicker.text() |
118 |
120 ) |
119 self.__plugin.setPreferences( |
121 |
120 "TranslationsEditor", self.translationsEditorPicker.text()) |
|
121 |
|
122 @pyqtSlot() |
122 @pyqtSlot() |
123 def on_py3VenvNamesReloadButton_clicked(self): |
123 def on_py3VenvNamesReloadButton_clicked(self): |
124 """ |
124 """ |
125 Private slot to reload the virtual environment names. |
125 Private slot to reload the virtual environment names. |
126 """ |
126 """ |
127 currentVenvName = self.py3VenvNameComboBox.currentText() |
127 currentVenvName = self.py3VenvNameComboBox.currentText() |
128 self.py3VenvNameComboBox.clear() |
128 self.py3VenvNameComboBox.clear() |
129 venvManager = ericApp().getObject("VirtualEnvManager") |
129 venvManager = ericApp().getObject("VirtualEnvManager") |
130 self.py3VenvNameComboBox.addItems( |
130 self.py3VenvNameComboBox.addItems( |
131 [""] + sorted(venvManager.getVirtualenvNames())) |
131 [""] + sorted(venvManager.getVirtualenvNames()) |
|
132 ) |
132 if currentVenvName: |
133 if currentVenvName: |
133 index = self.py3VenvNameComboBox.findText(currentVenvName) |
134 index = self.py3VenvNameComboBox.findText(currentVenvName) |
134 if index < 0: |
135 if index < 0: |
135 index = 0 |
136 index = 0 |
136 self.py3VenvNameComboBox.setCurrentIndex(index) |
137 self.py3VenvNameComboBox.setCurrentIndex(index) |
137 |
138 |
138 @pyqtSlot() |
139 @pyqtSlot() |
139 def on_urlResetButton_clicked(self): |
140 def on_urlResetButton_clicked(self): |
140 """ |
141 """ |
141 Private slot to reset the Flask documentation URL. |
142 Private slot to reset the Flask documentation URL. |
142 """ |
143 """ |
143 self.urlEdit.setText( |
144 self.urlEdit.setText(self.__plugin.getDefaultPreference("FlaskDocUrl")) |
144 self.__plugin.getDefaultPreference("FlaskDocUrl")) |
|