Preferences/ConfigurationPages/CondaPage.py

branch
conda
changeset 6672
2af01e538c57
child 6678
5f1de9e59227
equal deleted inserted replaced
6671:8baaf3bce895 6672:2af01e538c57
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2019 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing the conda configuration page.
8 """
9
10 from __future__ import unicode_literals
11
12 from E5Gui.E5PathPicker import E5PathPickerModes
13
14 from .ConfigurationPageBase import ConfigurationPageBase
15 from .Ui_CondaPage import Ui_CondaPage
16
17 import Preferences
18
19
20 class CondaPage(ConfigurationPageBase, Ui_CondaPage):
21 """
22 Class implementing the conda configuration page.
23 """
24 def __init__(self):
25 """
26 Constructor
27
28 @param parent reference to the parent widget
29 @type QWidget
30 """
31 super(CondaPage, self).__init__()
32 self.setupUi(self)
33 self.setObjectName("CondaPage")
34
35 self.condaExePicker.setMode(E5PathPickerModes.OpenFileMode)
36 self.condaExePicker.setToolTip(self.tr(
37 "Press to select the conda executable via a file selection"
38 " dialog."))
39
40 # set initial values
41 self.condaExePicker.setText(Preferences.getConda("CondaExecutable"))
42
43 def save(self):
44 """
45 Public slot to save the conda configuration.
46 """
47 Preferences.setConda("CondaExecutable", self.condaExePicker.text())
48
49
50 def create(dlg):
51 """
52 Module function to create the configuration page.
53
54 @param dlg reference to the configuration dialog
55 @return reference to the instantiated page (ConfigurationPageBase)
56 """
57 page = CondaPage()
58 return page

eric ide

mercurial