def __init__(self, parent=None): PreferencesDialog.PreferencesDialog.__init__(self, parent) self.iface = PisiIface.Iface() #add icons to buttons self.addButton.setIconSet(Icons.loadIconSet("add", KIcon.Small)) self.editButton.setIconSet(Icons.loadIconSet("configure", KIcon.Small)) self.removeButton.setIconSet(Icons.loadIconSet("remove", KIcon.Small)) self.moveUpButton.setIconSet(Icons.loadIconSet("up", KIcon.Small)) self.moveDownButton.setIconSet(Icons.loadIconSet("down", KIcon.Small)) self.buttonOk.setIconSet(Icons.loadIconSet("button_ok", KIcon.Small)) self.buttonCancel.setIconSet(Icons.loadIconSet("button_cancel", KIcon.Small)) self.buttonHelp.setIconSet(Icons.loadIconSet("help", KIcon.Small)) self.parent = parent self.connect(self.addButton, SIGNAL("clicked()"), self.addNewRepo) self.connect(self.editButton, SIGNAL("clicked()"), self.editRepo) self.connect(self.removeButton, SIGNAL("clicked()"), self.removeRepo) self.connect(self.repoListView, SIGNAL("selectionChanged()"), self.updateButtons) self.connect(self.moveUpButton, SIGNAL("clicked()"), self.moveUp) self.connect(self.moveDownButton, SIGNAL("clicked()"), self.moveDown) self.connect(self.buttonOk, SIGNAL("clicked()"), self.saveSettings) self.connect(self.intervalCheck, SIGNAL("toggled(bool)"), self.enableCheckInterval) self.connect(self.useCacheCheck, SIGNAL("toggled(bool)"), self.enableUseCache) self.connect(self.clearCacheButton, SIGNAL("clicked()"), self.clearAllCached) self.connect(self.buttonHelp, SIGNAL("clicked()"), self.showHelp) self.connect(self.useHttpForAll, SIGNAL("toggled(bool)"), self.useHttpToggled) self.connect(self.useBandwidthLimit, SIGNAL("toggled(bool)"), self.bandwidthSettingChanged) self.connect(self.bandwidthValue, SIGNAL("valueChanged(int)"), self.bandwidthSettingChanged) self.connect(self.httpProxy, SIGNAL("textChanged(const QString&)"), self.proxyDataChanged) self.connect(self.httpProxyPort, SIGNAL("valueChanged(int)"), self.proxyDataChanged) self.connect(self.httpsProxy, SIGNAL("textChanged(const QString&)"), self.proxyDataChanged) self.connect(self.httpsProxyPort, SIGNAL("valueChanged(int)"), self.proxyDataChanged) self.connect(self.ftpProxy, SIGNAL("textChanged(const QString&)"), self.proxyDataChanged) self.connect(self.ftpProxyPort, SIGNAL("valueChanged(int)"), self.proxyDataChanged) self.connect(self.noProxyButton, SIGNAL("toggled(bool)"), self.proxyDataChanged) self.editButton.setEnabled(False) self.removeButton.setEnabled(False) self.repoListView.setSorting(-1) self.updateListView() self.updateButtons() self.onlyGuiApp.setChecked(self.parent.settings.getBoolValue(Settings.general, "ShowOnlyGuiApp")) self.intervalCheck.setChecked(self.parent.settings.getBoolValue(Settings.general, "UpdateCheck")) self.intervalSpin.setValue(self.parent.settings.getNumValue(Settings.general, "UpdateCheckInterval")) self.systemTray.setChecked(self.parent.settings.getBoolValue(Settings.general, "SystemTray")) self.noProxyButton.setChecked(True) self.getProxySettings() self.getCacheSettings() self.getBandwidthSetting() # This is to not call setRepositories unnecessarily self.reposChanged = False self.bandwidthChanged = False self.proxyChanged = False
def __init__(self, parent=None): PreferencesDialog.PreferencesDialog.__init__(self, parent) #add icons to buttons self.addButton.setIconSet(Icons.loadIconSet("add", KIcon.Small)) self.editButton.setIconSet(Icons.loadIconSet("configure", KIcon.Small)) self.removeButton.setIconSet(Icons.loadIconSet("remove", KIcon.Small)) self.moveUpButton.setIconSet(Icons.loadIconSet("up", KIcon.Small)) self.moveDownButton.setIconSet(Icons.loadIconSet("down", KIcon.Small)) self.buttonOk.setIconSet(Icons.loadIconSet("ok", KIcon.Small)) self.buttonCancel.setIconSet(Icons.loadIconSet("cancel", KIcon.Small)) self.buttonHelp.setIconSet(Icons.loadIconSet("help1", KIcon.Small)) self.parent = parent self.connect(self.addButton, SIGNAL("clicked()"), self.addNewRepo) self.connect(self.editButton, SIGNAL("clicked()"), self.editRepo) self.connect(self.removeButton, SIGNAL("clicked()"), self.removeRepo) self.connect(self.repoListView, SIGNAL("selectionChanged()"), self.updateButtons) self.connect(self.moveUpButton, SIGNAL("clicked()"), self.moveUp) self.connect(self.moveDownButton, SIGNAL("clicked()"), self.moveDown) self.connect(self.buttonOk, SIGNAL("clicked()"), self.saveSettings) self.connect(self.intervalCheck, SIGNAL("toggled(bool)"), self.enableCheckInterval) self.connect(self.useCacheCheck, SIGNAL("toggled(bool)"), self.enableUseCache) self.connect(self.clearCacheButton, SIGNAL("clicked()"), self.clearAllCached) self.connect(self.buttonHelp, SIGNAL("clicked()"), self.showHelp) self.editButton.setEnabled(False) self.removeButton.setEnabled(False) self.repoListView.setSorting(-1) self.updateListView() self.updateButtons() self.onlyGuiApp.setChecked(self.parent.settings.getBoolValue(Settings.general, "ShowOnlyGuiApp")) self.intervalCheck.setChecked(self.parent.settings.getBoolValue(Settings.general, "UpdateCheck")) self.intervalSpin.setValue(self.parent.settings.getNumValue(Settings.general, "UpdateCheckInterval")) self.systemTray.setChecked(self.parent.settings.getBoolValue(Settings.general, "SystemTray")) self.getCacheSettings() self.reposChanged = False