Preferences/ConfigurationPages/PluginManagerPage.py

branch
Py2 comp.
changeset 3484
645c12de6b0c
parent 3178
f25fc1364c88
parent 3200
83bde5e6f146
child 3656
441956d8fce5
equal deleted inserted replaced
3456:96232974dcdb 3484:645c12de6b0c
19 from .ConfigurationPageBase import ConfigurationPageBase 19 from .ConfigurationPageBase import ConfigurationPageBase
20 from .Ui_PluginManagerPage import Ui_PluginManagerPage 20 from .Ui_PluginManagerPage import Ui_PluginManagerPage
21 21
22 import Preferences 22 import Preferences
23 import Utilities 23 import Utilities
24 import UI.PixmapCache
24 25
25 26
26 class PluginManagerPage(ConfigurationPageBase, Ui_PluginManagerPage): 27 class PluginManagerPage(ConfigurationPageBase, Ui_PluginManagerPage):
27 """ 28 """
28 Class implementing the Plugin Manager configuration page. 29 Class implementing the Plugin Manager configuration page.
33 """ 34 """
34 super(PluginManagerPage, self).__init__() 35 super(PluginManagerPage, self).__init__()
35 self.setupUi(self) 36 self.setupUi(self)
36 self.setObjectName("PluginManagerPage") 37 self.setObjectName("PluginManagerPage")
37 38
39 self.downloadDirButton.setIcon(UI.PixmapCache.getIcon("open.png"))
40
38 self.downloadDirCompleter = E5DirCompleter(self.downloadDirEdit) 41 self.downloadDirCompleter = E5DirCompleter(self.downloadDirEdit)
39 42
40 # set initial values 43 # set initial values
41 self.activateExternalPluginsCheckBox.setChecked( 44 self.activateExternalPluginsCheckBox.setChecked(
42 Preferences.getPluginManager("ActivateExternal")) 45 Preferences.getPluginManager("ActivateExternal"))
43 self.downloadDirEdit.setText( 46 self.downloadDirEdit.setText(
44 Preferences.getPluginManager("DownloadPath")) 47 Preferences.getPluginManager("DownloadPath"))
48 self.generationsSpinBox.setValue(
49 Preferences.getPluginManager("KeepGenerations"))
50 self.keepHiddenCheckBox.setChecked(
51 Preferences.getPluginManager("KeepHidden"))
45 52
46 period = Preferences.getPluginManager("UpdatesCheckInterval") 53 period = Preferences.getPluginManager("UpdatesCheckInterval")
47 if period == 0: 54 if period == 0:
48 self.noCheckRadioButton.setChecked(True) 55 self.noCheckRadioButton.setChecked(True)
49 elif period == 1: 56 elif period == 1:
67 "ActivateExternal", 74 "ActivateExternal",
68 self.activateExternalPluginsCheckBox.isChecked()) 75 self.activateExternalPluginsCheckBox.isChecked())
69 Preferences.setPluginManager( 76 Preferences.setPluginManager(
70 "DownloadPath", 77 "DownloadPath",
71 self.downloadDirEdit.text()) 78 self.downloadDirEdit.text())
79 Preferences.setPluginManager(
80 "KeepGenerations",
81 self.generationsSpinBox.value())
82 Preferences.setPluginManager(
83 "KeepHidden",
84 self.keepHiddenCheckBox.isChecked())
72 85
73 if self.noCheckRadioButton.isChecked(): 86 if self.noCheckRadioButton.isChecked():
74 period = 0 87 period = 0
75 elif self.dailyCheckRadioButton.isChecked(): 88 elif self.dailyCheckRadioButton.isChecked():
76 period = 1 89 period = 1
93 """ 106 """
94 Private slot to handle the directory selection via dialog. 107 Private slot to handle the directory selection via dialog.
95 """ 108 """
96 directory = E5FileDialog.getExistingDirectory( 109 directory = E5FileDialog.getExistingDirectory(
97 self, 110 self,
98 self.trUtf8("Select plugins download directory"), 111 self.tr("Select plugins download directory"),
99 self.downloadDirEdit.text(), 112 self.downloadDirEdit.text(),
100 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) 113 E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
101 114
102 if directory: 115 if directory:
103 dn = Utilities.toNativeSeparators(directory) 116 dn = Utilities.toNativeSeparators(directory)

eric ide

mercurial