- if (mProfile != null) {
- mProfile.setName(profileName.getText());
- mProfile.setUrl(url.getText());
- mProfile.setPostingPermitted(postingPermitted.isChecked());
- mProfile.setAuthEnabled(useAuthentication.isChecked());
- mProfile.setAuthUserName(userName.getText());
- mProfile.setAuthPassword(password.getText());
- mProfile.setThemeId(huePickerView.getTag());
-// Log.d("profiles", String.format("Selected item is %d", mProfile.getThemeId()));
- mProfile.storeInDB();
- Log.d("profiles", "profile stored in DB");
- Data.profiles.triggerItemChangedNotification(mProfile);
-
-
- if (mProfile.getUuid().equals(Data.profile.get().getUuid())) {
- // dummy update to notify the observers of the possibly new name/URL
- Data.profile.set(mProfile);
- }
- }
- else {
- mProfile =
- new MobileLedgerProfile(profileName.getText(), postingPermitted.isChecked(),
- url.getText(), useAuthentication.isChecked(), userName.getText(),
- password.getText(), (int) huePickerView.getTag());
- mProfile.storeInDB();
- Data.profiles.add(mProfile);
- MobileLedgerProfile.storeProfilesOrder();