Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KF bruger og password gemmes ikke #25

Closed
AsgerPetersen opened this issue Apr 6, 2016 · 1 comment
Closed

KF bruger og password gemmes ikke #25

AsgerPetersen opened this issue Apr 6, 2016 · 1 comment
Labels

Comments

@AsgerPetersen
Copy link
Contributor

@giovanniborella rapporterede dette i #8 :

[...]gør det muligt at gemme ens login-oplysninger, så man ikke skal taste dem ind hver gang man genstarter Qgis [windows]
QGIS 2.14.0(startes med grass), windows 7

@AsgerPetersen
Copy link
Contributor Author

In the process of reviewing #26 I noticed another bug.

In the method show_settings_dialog

def show_settings_dialog(self):
# create and show the dialog
dlg = settingsdialog.SettingsDialog(self.qgisIface)
dlg.loginLineEdit.setText(self.config['username'])
dlg.passwordLineEdit.setText(self.config['password'])
dlg.kommunekoderLineEdit.setText(','.join(map(str, self.config['muncodes'])))
for dic in RESOURCESdic.values():
cb = getattr(dlg,dic['checkbox'])
if dic['id'] in self.config['resources']:
cb.setCheckState(2)
else:
cb.setCheckState(0)
self.updateconfig()
# show the dialog
dlg.show()
result = dlg.exec_()
# See if OK was pressed
if result == 1:
# save settings
self.config['username'] = str(dlg.loginLineEdit.text())
self.config['password'] = str(dlg.passwordLineEdit.text())
self.config['muncodes'] = [int(k) for k in dlg.kommunekoderLineEdit.text().split(',') if not k.strip() == '']
resources_list = []
for dic in sorted(RESOURCESdic.values()):
cb = getattr(dlg,dic['checkbox'])
if cb.isChecked():
resources_list.append(dic['id'])
self.config['resources'] = ', '.join(resources_list)
the line self.updateconfig()
self.updateconfig()
is responsible for saving the updated config. So it should of course be called at the end of the method.

Since this change we have effectively not saved municipality codes. And the other settings would only be saved if the user opened the settings dialog twice...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant