55 consoleList.append("xfce4-terminal -e") |
54 consoleList.append("xfce4-terminal -e") |
56 consoleList.append("xterm -e") |
55 consoleList.append("xterm -e") |
57 self.consoleCommandCombo.addItems(consoleList) |
56 self.consoleCommandCombo.addItems(consoleList) |
58 |
57 |
59 self.virtualEnvPy3Button.setIcon(UI.PixmapCache.getIcon("open")) |
58 self.virtualEnvPy3Button.setIcon(UI.PixmapCache.getIcon("open")) |
60 self.virtualEnvPy2Button.setIcon(UI.PixmapCache.getIcon("open")) |
|
61 self.translationsButton.setIcon(UI.PixmapCache.getIcon("open")) |
59 self.translationsButton.setIcon(UI.PixmapCache.getIcon("open")) |
62 self.urlResetButton.setIcon(UI.PixmapCache.getIcon("editUndo")) |
60 self.urlResetButton.setIcon(UI.PixmapCache.getIcon("editUndo")) |
63 |
61 |
64 self.virtualEnvPy2Completer = E5DirCompleter(self.virtualEnvPy2Edit) |
|
65 self.virtualEnvPy3Completer = E5DirCompleter(self.virtualEnvPy3Edit) |
62 self.virtualEnvPy3Completer = E5DirCompleter(self.virtualEnvPy3Edit) |
66 |
|
67 self.py2ShellCombo.addItem(self.tr("Plain Python"), "python") |
|
68 self.py2ShellCombo.addItem(self.tr("IPython"), "ipython") |
|
69 self.py2ShellCombo.addItem(self.tr("bpython"), "bpython") |
|
70 |
63 |
71 self.py3ShellCombo.addItem(self.tr("Plain Python"), "python") |
64 self.py3ShellCombo.addItem(self.tr("Plain Python"), "python") |
72 self.py3ShellCombo.addItem(self.tr("IPython"), "ipython") |
65 self.py3ShellCombo.addItem(self.tr("IPython"), "ipython") |
73 self.py3ShellCombo.addItem(self.tr("bpython"), "bpython") |
66 self.py3ShellCombo.addItem(self.tr("bpython"), "bpython") |
74 |
67 |
75 try: |
68 venvManager = e5App().getObject("VirtualEnvManager") |
76 venvManager = e5App().getObject("VirtualEnvManager") |
69 |
77 |
70 self.py3VenvNameComboBox.addItems( |
78 self.py2VenvNameComboBox.addItems( |
71 [""] + sorted(venvManager.getVirtualenvNames())) |
79 [""] + sorted(venvManager.getVirtualenvNamesForVariant(2))) |
72 self.pyramidVirtualEnvPy3Group.hide() |
80 self.py3VenvNameComboBox.addItems( |
|
81 [""] + sorted(venvManager.getVirtualenvNamesForVariant(3))) |
|
82 |
|
83 self.pyramidVirtualEnvPy2Group.hide() |
|
84 self.pyramidVirtualEnvPy3Group.hide() |
|
85 |
|
86 self.__hasVirtualEnvironmentManager = True |
|
87 except KeyError: |
|
88 venvManager = None |
|
89 |
|
90 self.pyramidVirtualEnvironmentPy2Group.hide() |
|
91 self.pyramidVirtualEnvironmentPy3Group.hide() |
|
92 |
|
93 self.__hasVirtualEnvironmentManager = False |
|
94 |
73 |
95 # set initial values |
74 # set initial values |
96 self.consoleCommandCombo.setEditText( |
75 self.consoleCommandCombo.setEditText( |
97 self.__plugin.getPreferences("ConsoleCommand")) |
76 self.__plugin.getPreferences("ConsoleCommand")) |
98 |
77 |
99 self.externalBrowserCheckBox.setChecked( |
78 self.externalBrowserCheckBox.setChecked( |
100 self.__plugin.getPreferences("UseExternalBrowser")) |
79 self.__plugin.getPreferences("UseExternalBrowser")) |
101 |
80 |
102 if venvManager: |
81 venvName = self.__plugin.getPreferences( |
103 venvName = self.__plugin.getPreferences( |
82 "VirtualEnvironmentNamePy3") |
104 "VirtualEnvironmentNamePy2") |
83 if venvName: |
105 if venvName: |
84 index = self.py3VenvNameComboBox.findText(venvName) |
106 index = self.py2VenvNameComboBox.findText(venvName) |
85 if index < 0: |
107 if index < 0: |
86 index = 0 |
108 index = 0 |
87 self.py3VenvNameComboBox.setCurrentIndex(index) |
109 self.py2VenvNameComboBox.setCurrentIndex(index) |
|
110 else: |
|
111 self.virtualEnvPy2Edit.setText( |
|
112 self.__plugin.getPreferences("VirtualEnvironmentPy2")) |
|
113 self.py2ShellCombo.setCurrentIndex(self.py2ShellCombo.findData( |
|
114 self.__plugin.getPreferences("Python2ConsoleType"))) |
|
115 |
|
116 if venvManager: |
|
117 venvName = self.__plugin.getPreferences( |
|
118 "VirtualEnvironmentNamePy3") |
|
119 if venvName: |
|
120 index = self.py3VenvNameComboBox.findText(venvName) |
|
121 if index < 0: |
|
122 index = 0 |
|
123 self.py3VenvNameComboBox.setCurrentIndex(index) |
|
124 else: |
|
125 self.virtualEnvPy3Edit.setText( |
|
126 self.__plugin.getPreferences("VirtualEnvironmentPy3")) |
|
127 self.py3ShellCombo.setCurrentIndex(self.py3ShellCombo.findData( |
88 self.py3ShellCombo.setCurrentIndex(self.py3ShellCombo.findData( |
128 self.__plugin.getPreferences("Python3ConsoleType"))) |
89 self.__plugin.getPreferences("Python3ConsoleType"))) |
129 |
90 |
130 self.urlEdit.setText( |
91 self.urlEdit.setText( |
131 self.__plugin.getPreferences("PyramidDocUrl")) |
92 self.__plugin.getPreferences("PyramidDocUrl")) |
141 "ConsoleCommand", self.consoleCommandCombo.currentText()) |
102 "ConsoleCommand", self.consoleCommandCombo.currentText()) |
142 |
103 |
143 self.__plugin.setPreferences( |
104 self.__plugin.setPreferences( |
144 "UseExternalBrowser", self.externalBrowserCheckBox.isChecked()) |
105 "UseExternalBrowser", self.externalBrowserCheckBox.isChecked()) |
145 |
106 |
146 if self.__hasVirtualEnvironmentManager: |
|
147 self.__plugin.setPreferences( |
|
148 "VirtualEnvironmentNamePy2", |
|
149 self.py2VenvNameComboBox.currentText()) |
|
150 else: |
|
151 self.__plugin.setPreferences( |
|
152 "VirtualEnvironmentPy2", self.virtualEnvPy2Edit.text()) |
|
153 self.__plugin.setPreferences( |
107 self.__plugin.setPreferences( |
154 "Python2ConsoleType", |
108 "VirtualEnvironmentNamePy3", |
155 self.py2ShellCombo.itemData(self.py2ShellCombo.currentIndex())) |
109 self.py3VenvNameComboBox.currentText()) |
156 |
|
157 if self.__hasVirtualEnvironmentManager: |
|
158 self.__plugin.setPreferences( |
|
159 "VirtualEnvironmentNamePy3", |
|
160 self.py3VenvNameComboBox.currentText()) |
|
161 else: |
|
162 self.__plugin.setPreferences( |
|
163 "VirtualEnvironmentPy3", self.virtualEnvPy3Edit.text()) |
|
164 self.__plugin.setPreferences( |
110 self.__plugin.setPreferences( |
165 "Python3ConsoleType", |
111 "Python3ConsoleType", |
166 self.py3ShellCombo.itemData(self.py3ShellCombo.currentIndex())) |
112 self.py3ShellCombo.itemData(self.py3ShellCombo.currentIndex())) |
167 |
113 |
168 self.__plugin.setPreferences( |
114 self.__plugin.setPreferences( |