Prevent users from changing special folder assignments for POP3 accounts
This commit is contained in:
parent
8e7950164b
commit
de2c6cdae3
1 changed files with 29 additions and 16 deletions
|
@ -97,7 +97,7 @@ public class AccountSettings extends K9PreferenceActivity {
|
||||||
|
|
||||||
private static final String PREFERENCE_LOCAL_STORAGE_PROVIDER = "local_storage_provider";
|
private static final String PREFERENCE_LOCAL_STORAGE_PROVIDER = "local_storage_provider";
|
||||||
|
|
||||||
|
private static final String PREFERENCE_CATEGORY_FOLDERS = "folders";
|
||||||
private static final String PREFERENCE_ARCHIVE_FOLDER = "archive_folder";
|
private static final String PREFERENCE_ARCHIVE_FOLDER = "archive_folder";
|
||||||
private static final String PREFERENCE_DRAFTS_FOLDER = "drafts_folder";
|
private static final String PREFERENCE_DRAFTS_FOLDER = "drafts_folder";
|
||||||
private static final String PREFERENCE_SENT_FOLDER = "sent_folder";
|
private static final String PREFERENCE_SENT_FOLDER = "sent_folder";
|
||||||
|
@ -713,11 +713,13 @@ public class AccountSettings extends K9PreferenceActivity {
|
||||||
else
|
else
|
||||||
mAccount.setAutoExpandFolderName(reverseTranslateFolder(mAutoExpandFolder.getValue()));
|
mAccount.setAutoExpandFolderName(reverseTranslateFolder(mAutoExpandFolder.getValue()));
|
||||||
|
|
||||||
mAccount.setArchiveFolderName(mArchiveFolder.getValue());
|
if (mIsMoveCapable) {
|
||||||
mAccount.setDraftsFolderName(mDraftsFolder.getValue());
|
mAccount.setArchiveFolderName(mArchiveFolder.getValue());
|
||||||
mAccount.setSentFolderName(mSentFolder.getValue());
|
mAccount.setDraftsFolderName(mDraftsFolder.getValue());
|
||||||
mAccount.setSpamFolderName(mSpamFolder.getValue());
|
mAccount.setSentFolderName(mSentFolder.getValue());
|
||||||
mAccount.setTrashFolderName(mTrashFolder.getValue());
|
mAccount.setSpamFolderName(mSpamFolder.getValue());
|
||||||
|
mAccount.setTrashFolderName(mTrashFolder.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (mIsPushCapable) {
|
if (mIsPushCapable) {
|
||||||
|
@ -911,22 +913,33 @@ public class AccountSettings extends K9PreferenceActivity {
|
||||||
mTrashFolder = (ListPreference)findPreference(PREFERENCE_TRASH_FOLDER);
|
mTrashFolder = (ListPreference)findPreference(PREFERENCE_TRASH_FOLDER);
|
||||||
mTrashFolder.setEnabled(false);
|
mTrashFolder.setEnabled(false);
|
||||||
|
|
||||||
|
if (!mIsMoveCapable) {
|
||||||
|
PreferenceScreen foldersCategory =
|
||||||
|
(PreferenceScreen) findPreference(PREFERENCE_CATEGORY_FOLDERS);
|
||||||
|
foldersCategory.removePreference(mArchiveFolder);
|
||||||
|
foldersCategory.removePreference(mSpamFolder);
|
||||||
|
foldersCategory.removePreference(mDraftsFolder);
|
||||||
|
foldersCategory.removePreference(mSentFolder);
|
||||||
|
foldersCategory.removePreference(mTrashFolder);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Void res) {
|
protected void onPostExecute(Void res) {
|
||||||
initListPreference(mAutoExpandFolder, mAccount.getAutoExpandFolderName(), allFolderLabels, allFolderValues);
|
initListPreference(mAutoExpandFolder, mAccount.getAutoExpandFolderName(), allFolderLabels, allFolderValues);
|
||||||
initListPreference(mArchiveFolder, mAccount.getArchiveFolderName(), allFolderLabels, allFolderValues);
|
|
||||||
initListPreference(mDraftsFolder, mAccount.getDraftsFolderName(), allFolderLabels, allFolderValues);
|
|
||||||
initListPreference(mSentFolder, mAccount.getSentFolderName(), allFolderLabels, allFolderValues);
|
|
||||||
initListPreference(mSpamFolder, mAccount.getSpamFolderName(), allFolderLabels, allFolderValues);
|
|
||||||
initListPreference(mTrashFolder, mAccount.getTrashFolderName(), allFolderLabels, allFolderValues);
|
|
||||||
mAutoExpandFolder.setEnabled(true);
|
mAutoExpandFolder.setEnabled(true);
|
||||||
mArchiveFolder.setEnabled(true);
|
if (mIsMoveCapable) {
|
||||||
mDraftsFolder.setEnabled(true);
|
initListPreference(mArchiveFolder, mAccount.getArchiveFolderName(), allFolderLabels, allFolderValues);
|
||||||
mSentFolder.setEnabled(true);
|
initListPreference(mDraftsFolder, mAccount.getDraftsFolderName(), allFolderLabels, allFolderValues);
|
||||||
mSpamFolder.setEnabled(true);
|
initListPreference(mSentFolder, mAccount.getSentFolderName(), allFolderLabels, allFolderValues);
|
||||||
mTrashFolder.setEnabled(true);
|
initListPreference(mSpamFolder, mAccount.getSpamFolderName(), allFolderLabels, allFolderValues);
|
||||||
|
initListPreference(mTrashFolder, mAccount.getTrashFolderName(), allFolderLabels, allFolderValues);
|
||||||
|
mArchiveFolder.setEnabled(true);
|
||||||
|
mSpamFolder.setEnabled(true);
|
||||||
|
mDraftsFolder.setEnabled(true);
|
||||||
|
mSentFolder.setEnabled(true);
|
||||||
|
mTrashFolder.setEnabled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue