Merge branch 'pr/364'
Make actions shown in message view menu configurable
BIN
res/drawable-hdpi/ic_action_copy_dark.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
res/drawable-hdpi/ic_action_copy_light.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 612 B After Width: | Height: | Size: 612 B |
Before Width: | Height: | Size: 712 B After Width: | Height: | Size: 712 B |
Before Width: | Height: | Size: 320 B After Width: | Height: | Size: 320 B |
Before Width: | Height: | Size: 381 B After Width: | Height: | Size: 381 B |
BIN
res/drawable-mdpi/ic_action_copy_dark.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
res/drawable-mdpi/ic_action_copy_light.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 418 B After Width: | Height: | Size: 418 B |
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 491 B |
BIN
res/drawable-xhdpi/ic_action_copy_dark.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
res/drawable-xhdpi/ic_action_copy_light.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 817 B After Width: | Height: | Size: 817 B |
Before Width: | Height: | Size: 948 B After Width: | Height: | Size: 948 B |
@ -28,11 +28,12 @@
|
|||||||
android:id="@+id/move"
|
android:id="@+id/move"
|
||||||
android:title="@string/move_action"
|
android:title="@string/move_action"
|
||||||
android:showAsAction="ifRoom"
|
android:showAsAction="ifRoom"
|
||||||
android:icon="?attr/iconActionMoveOrCopy"
|
android:icon="?attr/iconActionMove"
|
||||||
/>
|
/>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/copy"
|
android:id="@+id/copy"
|
||||||
android:title="@string/copy_action"
|
android:title="@string/copy_action"
|
||||||
|
android:icon="?attr/iconActionCopy"
|
||||||
/>
|
/>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/flag"
|
android:id="@+id/flag"
|
||||||
|
@ -56,6 +56,30 @@
|
|||||||
android:icon="?attr/iconActionDelete"
|
android:icon="?attr/iconActionDelete"
|
||||||
android:showAsAction="always"
|
android:showAsAction="always"
|
||||||
android:title="@string/delete_action"/>
|
android:title="@string/delete_action"/>
|
||||||
|
<!-- MessageView -->
|
||||||
|
<item
|
||||||
|
android:id="@+id/archive"
|
||||||
|
android:icon="?attr/iconActionArchive"
|
||||||
|
android:showAsAction="ifRoom"
|
||||||
|
android:title="@string/archive_action"/>
|
||||||
|
<!-- MessageView -->
|
||||||
|
<item
|
||||||
|
android:id="@+id/spam"
|
||||||
|
android:icon="?attr/iconActionSpam"
|
||||||
|
android:showAsAction="ifRoom"
|
||||||
|
android:title="@string/spam_action"/>
|
||||||
|
<!-- MessageView -->
|
||||||
|
<item
|
||||||
|
android:id="@+id/move"
|
||||||
|
android:icon="?attr/iconActionMove"
|
||||||
|
android:showAsAction="ifRoom"
|
||||||
|
android:title="@string/move_action"/>
|
||||||
|
<!-- MessageView -->
|
||||||
|
<item
|
||||||
|
android:id="@+id/copy"
|
||||||
|
android:icon="?attr/iconActionCopy"
|
||||||
|
android:showAsAction="ifRoom"
|
||||||
|
android:title="@string/copy_action"/>
|
||||||
|
|
||||||
<!-- MessageView -->
|
<!-- MessageView -->
|
||||||
<item
|
<item
|
||||||
@ -88,22 +112,16 @@
|
|||||||
<menu>
|
<menu>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/archive"
|
android:id="@+id/archive"
|
||||||
android:icon="?attr/iconActionArchive"
|
|
||||||
android:showAsAction="ifRoom"
|
|
||||||
android:title="@string/archive_action"/>
|
android:title="@string/archive_action"/>
|
||||||
|
|
||||||
<!-- MessageView -->
|
<!-- MessageView -->
|
||||||
<item
|
<item
|
||||||
android:id="@+id/spam"
|
android:id="@+id/spam"
|
||||||
android:icon="?attr/iconActionSpam"
|
|
||||||
android:showAsAction="ifRoom"
|
|
||||||
android:title="@string/spam_action"/>
|
android:title="@string/spam_action"/>
|
||||||
|
|
||||||
<!-- MessageView -->
|
<!-- MessageView -->
|
||||||
<item
|
<item
|
||||||
android:id="@+id/move"
|
android:id="@+id/move"
|
||||||
android:icon="?attr/iconActionMoveOrCopy"
|
|
||||||
android:showAsAction="ifRoom"
|
|
||||||
android:title="@string/move_action"/>
|
android:title="@string/move_action"/>
|
||||||
|
|
||||||
<!-- MessageView -->
|
<!-- MessageView -->
|
||||||
@ -204,7 +222,7 @@
|
|||||||
android:id="@+id/toggle_message_view_theme"
|
android:id="@+id/toggle_message_view_theme"
|
||||||
android:showAsAction="never"
|
android:showAsAction="never"
|
||||||
android:title="@string/message_view_theme_action_dark"/>
|
android:title="@string/message_view_theme_action_dark"/>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/show_folder_list"
|
android:id="@+id/show_folder_list"
|
||||||
android:showAsAction="never"
|
android:showAsAction="never"
|
||||||
android:title="@string/folders_title" />
|
android:title="@string/folders_title" />
|
||||||
|
@ -10,7 +10,8 @@
|
|||||||
<attr name="iconActionArchive" format="reference" />
|
<attr name="iconActionArchive" format="reference" />
|
||||||
<attr name="iconActionCompose" format="reference" />
|
<attr name="iconActionCompose" format="reference" />
|
||||||
<attr name="iconActionDelete" format="reference" />
|
<attr name="iconActionDelete" format="reference" />
|
||||||
<attr name="iconActionMoveOrCopy" format="reference" />
|
<attr name="iconActionMove" format="reference" />
|
||||||
|
<attr name="iconActionCopy" format="reference" />
|
||||||
<attr name="iconActionNextMessage" format="reference" />
|
<attr name="iconActionNextMessage" format="reference" />
|
||||||
<attr name="iconActionPreviousMessage" format="reference" />
|
<attr name="iconActionPreviousMessage" format="reference" />
|
||||||
<attr name="iconActionRefresh" format="reference" />
|
<attr name="iconActionRefresh" format="reference" />
|
||||||
|
@ -1153,4 +1153,7 @@ Please submit bug reports, contribute new features and ask questions at
|
|||||||
<string name="mark_all_as_read">Mark all as read</string>
|
<string name="mark_all_as_read">Mark all as read</string>
|
||||||
|
|
||||||
<string name="global_settings_colorize_missing_contact_pictures">Colorize missing contact pictures</string>
|
<string name="global_settings_colorize_missing_contact_pictures">Colorize missing contact pictures</string>
|
||||||
|
|
||||||
|
<string name="global_settings_messageview_visible_refile_actions_title">Visisble message actions</string>
|
||||||
|
<string name="global_settings_messageview_visible_refile_actions_summary">Show selected actions in the message view menu</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -12,7 +12,8 @@
|
|||||||
<item name="iconActionArchive">@drawable/ic_action_archive_light</item>
|
<item name="iconActionArchive">@drawable/ic_action_archive_light</item>
|
||||||
<item name="iconActionCompose">@drawable/ic_action_compose_light</item>
|
<item name="iconActionCompose">@drawable/ic_action_compose_light</item>
|
||||||
<item name="iconActionDelete">@drawable/ic_action_delete_light</item>
|
<item name="iconActionDelete">@drawable/ic_action_delete_light</item>
|
||||||
<item name="iconActionMoveOrCopy">@drawable/ic_action_move_or_copy_light</item>
|
<item name="iconActionMove">@drawable/ic_action_move_light</item>
|
||||||
|
<item name="iconActionCopy">@drawable/ic_action_copy_light</item>
|
||||||
<item name="iconActionNextMessage">@drawable/ic_action_next_message_light</item>
|
<item name="iconActionNextMessage">@drawable/ic_action_next_message_light</item>
|
||||||
<item name="iconActionPreviousMessage">@drawable/ic_action_previous_message_light</item>
|
<item name="iconActionPreviousMessage">@drawable/ic_action_previous_message_light</item>
|
||||||
<item name="iconActionRefresh">@drawable/ic_action_refresh_light</item>
|
<item name="iconActionRefresh">@drawable/ic_action_refresh_light</item>
|
||||||
@ -63,7 +64,8 @@
|
|||||||
<item name="iconActionArchive">@drawable/ic_action_archive_dark</item>
|
<item name="iconActionArchive">@drawable/ic_action_archive_dark</item>
|
||||||
<item name="iconActionCompose">@drawable/ic_action_compose_dark</item>
|
<item name="iconActionCompose">@drawable/ic_action_compose_dark</item>
|
||||||
<item name="iconActionDelete">@drawable/ic_action_delete_dark</item>
|
<item name="iconActionDelete">@drawable/ic_action_delete_dark</item>
|
||||||
<item name="iconActionMoveOrCopy">@drawable/ic_action_move_or_copy_dark</item>
|
<item name="iconActionMove">@drawable/ic_action_move_dark</item>
|
||||||
|
<item name="iconActionCopy">@drawable/ic_action_copy_dark</item>
|
||||||
<item name="iconActionNextMessage">@drawable/ic_action_next_message_dark</item>
|
<item name="iconActionNextMessage">@drawable/ic_action_next_message_dark</item>
|
||||||
<item name="iconActionPreviousMessage">@drawable/ic_action_previous_message_dark</item>
|
<item name="iconActionPreviousMessage">@drawable/ic_action_previous_message_dark</item>
|
||||||
<item name="iconActionRefresh">@drawable/ic_action_refresh_dark</item>
|
<item name="iconActionRefresh">@drawable/ic_action_refresh_dark</item>
|
||||||
|
@ -225,6 +225,15 @@
|
|||||||
android:title="@string/global_settings_messageview_fixedwidth_label"
|
android:title="@string/global_settings_messageview_fixedwidth_label"
|
||||||
android:summary="@string/global_settings_messageview_fixedwidth_summary" />
|
android:summary="@string/global_settings_messageview_fixedwidth_summary" />
|
||||||
|
|
||||||
|
<com.fsck.k9.preferences.CheckBoxListPreference
|
||||||
|
android:persistent="false"
|
||||||
|
android:key="messageview_visible_refile_actions"
|
||||||
|
android:title="@string/global_settings_messageview_visible_refile_actions_title"
|
||||||
|
android:summary="@string/global_settings_messageview_visible_refile_actions_summary"
|
||||||
|
android:dialogTitle="@string/global_settings_messageview_visible_refile_actions_title"
|
||||||
|
android:positiveButtonText="@android:string/ok"
|
||||||
|
android:negativeButtonText="@android:string/cancel" />
|
||||||
|
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:persistent="false"
|
android:persistent="false"
|
||||||
android:key="messageview_mobile_layout"
|
android:key="messageview_mobile_layout"
|
||||||
|
@ -263,6 +263,13 @@ public class K9 extends Application {
|
|||||||
private static SplitViewMode sSplitViewMode = SplitViewMode.NEVER;
|
private static SplitViewMode sSplitViewMode = SplitViewMode.NEVER;
|
||||||
private static boolean sColorizeMissingContactPictures = true;
|
private static boolean sColorizeMissingContactPictures = true;
|
||||||
|
|
||||||
|
private static boolean sMessageViewArchiveActionVisible = false;
|
||||||
|
private static boolean sMessageViewDeleteActionVisible = true;
|
||||||
|
private static boolean sMessageViewMoveActionVisible = false;
|
||||||
|
private static boolean sMessageViewCopyActionVisible = false;
|
||||||
|
private static boolean sMessageViewSpamActionVisible = false;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see #areDatabasesUpToDate()
|
* @see #areDatabasesUpToDate()
|
||||||
*/
|
*/
|
||||||
@ -541,6 +548,13 @@ public class K9 extends Application {
|
|||||||
editor.putBoolean("threadedView", sThreadedViewEnabled);
|
editor.putBoolean("threadedView", sThreadedViewEnabled);
|
||||||
editor.putString("splitViewMode", sSplitViewMode.name());
|
editor.putString("splitViewMode", sSplitViewMode.name());
|
||||||
editor.putBoolean("colorizeMissingContactPictures", sColorizeMissingContactPictures);
|
editor.putBoolean("colorizeMissingContactPictures", sColorizeMissingContactPictures);
|
||||||
|
|
||||||
|
editor.putBoolean("messageViewArchiveActionVisible", sMessageViewArchiveActionVisible);
|
||||||
|
editor.putBoolean("messageViewDeleteActionVisible", sMessageViewDeleteActionVisible);
|
||||||
|
editor.putBoolean("messageViewMoveActionVisible", sMessageViewMoveActionVisible);
|
||||||
|
editor.putBoolean("messageViewCopyActionVisible", sMessageViewCopyActionVisible);
|
||||||
|
editor.putBoolean("messageViewSpamActionVisible", sMessageViewSpamActionVisible);
|
||||||
|
|
||||||
fontSizes.save(editor);
|
fontSizes.save(editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -766,6 +780,13 @@ public class K9 extends Application {
|
|||||||
|
|
||||||
sColorizeMissingContactPictures = sprefs.getBoolean("colorizeMissingContactPictures", true);
|
sColorizeMissingContactPictures = sprefs.getBoolean("colorizeMissingContactPictures", true);
|
||||||
|
|
||||||
|
sMessageViewArchiveActionVisible = sprefs.getBoolean("messageViewArchiveActionVisible", false);
|
||||||
|
sMessageViewDeleteActionVisible = sprefs.getBoolean("messageViewDeleteActionVisible", true);
|
||||||
|
sMessageViewMoveActionVisible = sprefs.getBoolean("messageViewMoveActionVisible", false);
|
||||||
|
sMessageViewCopyActionVisible = sprefs.getBoolean("messageViewCopyActionVisible", false);
|
||||||
|
sMessageViewSpamActionVisible = sprefs.getBoolean("messageViewSpamActionVisible", false);
|
||||||
|
|
||||||
|
|
||||||
K9.setK9Language(sprefs.getString("language", ""));
|
K9.setK9Language(sprefs.getString("language", ""));
|
||||||
|
|
||||||
int themeValue = sprefs.getInt("theme", Theme.LIGHT.ordinal());
|
int themeValue = sprefs.getInt("theme", Theme.LIGHT.ordinal());
|
||||||
@ -1326,6 +1347,45 @@ public class K9 extends Application {
|
|||||||
sColorizeMissingContactPictures = enabled;
|
sColorizeMissingContactPictures = enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isMessageViewArchiveActionVisible() {
|
||||||
|
return sMessageViewArchiveActionVisible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setMessageViewArchiveActionVisible(boolean visible) {
|
||||||
|
sMessageViewArchiveActionVisible = visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMessageViewDeleteActionVisible() {
|
||||||
|
return sMessageViewDeleteActionVisible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setMessageViewDeleteActionVisible(boolean visible) {
|
||||||
|
sMessageViewDeleteActionVisible = visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMessageViewMoveActionVisible() {
|
||||||
|
return sMessageViewMoveActionVisible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setMessageViewMoveActionVisible(boolean visible) {
|
||||||
|
sMessageViewMoveActionVisible = visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMessageViewCopyActionVisible() {
|
||||||
|
return sMessageViewCopyActionVisible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setMessageViewCopyActionVisible(boolean visible) {
|
||||||
|
sMessageViewCopyActionVisible = visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMessageViewSpamActionVisible() {
|
||||||
|
return sMessageViewSpamActionVisible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setMessageViewSpamActionVisible(boolean visible) {
|
||||||
|
sMessageViewSpamActionVisible = visible;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if we already know whether all databases are using the current database schema.
|
* Check if we already know whether all databases are using the current database schema.
|
||||||
|
@ -973,8 +973,12 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
|
|||||||
|| !mMessageViewFragment.isInitialized()) {
|
|| !mMessageViewFragment.isInitialized()) {
|
||||||
menu.findItem(R.id.next_message).setVisible(false);
|
menu.findItem(R.id.next_message).setVisible(false);
|
||||||
menu.findItem(R.id.previous_message).setVisible(false);
|
menu.findItem(R.id.previous_message).setVisible(false);
|
||||||
menu.findItem(R.id.delete).setVisible(false);
|
|
||||||
menu.findItem(R.id.single_message_options).setVisible(false);
|
menu.findItem(R.id.single_message_options).setVisible(false);
|
||||||
|
menu.findItem(R.id.delete).setVisible(false);
|
||||||
|
menu.findItem(R.id.archive).setVisible(false);
|
||||||
|
menu.findItem(R.id.move).setVisible(false);
|
||||||
|
menu.findItem(R.id.copy).setVisible(false);
|
||||||
|
menu.findItem(R.id.spam).setVisible(false);
|
||||||
menu.findItem(R.id.refile).setVisible(false);
|
menu.findItem(R.id.refile).setVisible(false);
|
||||||
menu.findItem(R.id.toggle_unread).setVisible(false);
|
menu.findItem(R.id.toggle_unread).setVisible(false);
|
||||||
menu.findItem(R.id.select_text).setVisible(false);
|
menu.findItem(R.id.select_text).setVisible(false);
|
||||||
@ -1022,19 +1026,43 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
|
|||||||
menu.findItem(R.id.toggle_unread).setTitle(R.string.mark_as_read_action);
|
menu.findItem(R.id.toggle_unread).setTitle(R.string.mark_as_read_action);
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.findItem(R.id.copy).setVisible(mMessageViewFragment.isCopyCapable());
|
|
||||||
|
|
||||||
// Jellybean has built-in long press selection support
|
// Jellybean has built-in long press selection support
|
||||||
menu.findItem(R.id.select_text).setVisible(Build.VERSION.SDK_INT < 16);
|
menu.findItem(R.id.select_text).setVisible(Build.VERSION.SDK_INT < 16);
|
||||||
|
|
||||||
|
menu.findItem(R.id.delete).setVisible(K9.isMessageViewDeleteActionVisible());
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set visibility of copy, move, archive, spam in action bar and refile submenu
|
||||||
|
*/
|
||||||
|
Menu refileSubmenu = menu.findItem(R.id.refile).getSubMenu();
|
||||||
|
|
||||||
|
if (mMessageViewFragment.isCopyCapable()) {
|
||||||
|
menu.findItem(R.id.copy).setVisible(K9.isMessageViewCopyActionVisible());
|
||||||
|
refileSubmenu.findItem(R.id.copy).setVisible(true);
|
||||||
|
} else {
|
||||||
|
menu.findItem(R.id.copy).setVisible(false);
|
||||||
|
refileSubmenu.findItem(R.id.copy).setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
if (mMessageViewFragment.isMoveCapable()) {
|
if (mMessageViewFragment.isMoveCapable()) {
|
||||||
menu.findItem(R.id.move).setVisible(true);
|
boolean canMessageBeArchived = mMessageViewFragment.canMessageBeArchived();
|
||||||
menu.findItem(R.id.archive).setVisible(mMessageViewFragment.canMessageBeArchived());
|
boolean canMessageBeMovedToSpam = mMessageViewFragment.canMessageBeMovedToSpam();
|
||||||
menu.findItem(R.id.spam).setVisible(mMessageViewFragment.canMessageBeMovedToSpam());
|
|
||||||
|
menu.findItem(R.id.move).setVisible(K9.isMessageViewMoveActionVisible());
|
||||||
|
menu.findItem(R.id.archive).setVisible(canMessageBeArchived &&
|
||||||
|
K9.isMessageViewArchiveActionVisible());
|
||||||
|
menu.findItem(R.id.spam).setVisible(canMessageBeMovedToSpam &&
|
||||||
|
K9.isMessageViewSpamActionVisible());
|
||||||
|
|
||||||
|
refileSubmenu.findItem(R.id.move).setVisible(true);
|
||||||
|
refileSubmenu.findItem(R.id.archive).setVisible(canMessageBeArchived);
|
||||||
|
refileSubmenu.findItem(R.id.spam).setVisible(canMessageBeMovedToSpam);
|
||||||
} else {
|
} else {
|
||||||
menu.findItem(R.id.move).setVisible(false);
|
menu.findItem(R.id.move).setVisible(false);
|
||||||
menu.findItem(R.id.archive).setVisible(false);
|
menu.findItem(R.id.archive).setVisible(false);
|
||||||
menu.findItem(R.id.spam).setVisible(false);
|
menu.findItem(R.id.spam).setVisible(false);
|
||||||
|
|
||||||
|
menu.findItem(R.id.refile).setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mMessageViewFragment.allHeadersVisible()) {
|
if (mMessageViewFragment.allHeadersVisible()) {
|
||||||
@ -1042,7 +1070,6 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
|
|||||||
} else {
|
} else {
|
||||||
menu.findItem(R.id.hide_headers).setVisible(false);
|
menu.findItem(R.id.hide_headers).setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -76,6 +76,7 @@ public class Prefs extends K9PreferenceActivity {
|
|||||||
private static final String PREFERENCE_MESSAGELIST_COLORIZE_MISSING_CONTACT_PICTURES =
|
private static final String PREFERENCE_MESSAGELIST_COLORIZE_MISSING_CONTACT_PICTURES =
|
||||||
"messagelist_colorize_missing_contact_pictures";
|
"messagelist_colorize_missing_contact_pictures";
|
||||||
private static final String PREFERENCE_MESSAGEVIEW_FIXEDWIDTH = "messageview_fixedwidth_font";
|
private static final String PREFERENCE_MESSAGEVIEW_FIXEDWIDTH = "messageview_fixedwidth_font";
|
||||||
|
private static final String PREFERENCE_MESSAGEVIEW_VISIBLE_REFILE_ACTIONS = "messageview_visible_refile_actions";
|
||||||
|
|
||||||
private static final String PREFERENCE_MESSAGEVIEW_RETURN_TO_LIST = "messageview_return_to_list";
|
private static final String PREFERENCE_MESSAGEVIEW_RETURN_TO_LIST = "messageview_return_to_list";
|
||||||
private static final String PREFERENCE_MESSAGEVIEW_SHOW_NEXT = "messageview_show_next";
|
private static final String PREFERENCE_MESSAGEVIEW_SHOW_NEXT = "messageview_show_next";
|
||||||
@ -99,6 +100,12 @@ public class Prefs extends K9PreferenceActivity {
|
|||||||
|
|
||||||
private static final int ACTIVITY_CHOOSE_FOLDER = 1;
|
private static final int ACTIVITY_CHOOSE_FOLDER = 1;
|
||||||
|
|
||||||
|
// Named indices for the mVisibleRefileActions field
|
||||||
|
private static final int VISIBLE_REFILE_ACTIONS_DELETE = 0;
|
||||||
|
private static final int VISIBLE_REFILE_ACTIONS_ARCHIVE = 1;
|
||||||
|
private static final int VISIBLE_REFILE_ACTIONS_MOVE = 2;
|
||||||
|
private static final int VISIBLE_REFILE_ACTIONS_COPY = 3;
|
||||||
|
private static final int VISIBLE_REFILE_ACTIONS_SPAM = 4;
|
||||||
|
|
||||||
private ListPreference mLanguage;
|
private ListPreference mLanguage;
|
||||||
private ListPreference mTheme;
|
private ListPreference mTheme;
|
||||||
@ -133,6 +140,7 @@ public class Prefs extends K9PreferenceActivity {
|
|||||||
private CheckBoxPreference mDebugLogging;
|
private CheckBoxPreference mDebugLogging;
|
||||||
private CheckBoxPreference mSensitiveLogging;
|
private CheckBoxPreference mSensitiveLogging;
|
||||||
private CheckBoxPreference mWrapFolderNames;
|
private CheckBoxPreference mWrapFolderNames;
|
||||||
|
private CheckBoxListPreference mVisibleRefileActions;
|
||||||
|
|
||||||
private CheckBoxPreference mQuietTimeEnabled;
|
private CheckBoxPreference mQuietTimeEnabled;
|
||||||
private com.fsck.k9.preferences.TimePickerPreference mQuietTimeStarts;
|
private com.fsck.k9.preferences.TimePickerPreference mQuietTimeStarts;
|
||||||
@ -410,6 +418,24 @@ public class Prefs extends K9PreferenceActivity {
|
|||||||
mWrapFolderNames = (CheckBoxPreference)findPreference(PREFERENCE_FOLDERLIST_WRAP_NAME);
|
mWrapFolderNames = (CheckBoxPreference)findPreference(PREFERENCE_FOLDERLIST_WRAP_NAME);
|
||||||
mWrapFolderNames.setChecked(K9.wrapFolderNames());
|
mWrapFolderNames.setChecked(K9.wrapFolderNames());
|
||||||
|
|
||||||
|
mVisibleRefileActions = (CheckBoxListPreference) findPreference(PREFERENCE_MESSAGEVIEW_VISIBLE_REFILE_ACTIONS);
|
||||||
|
CharSequence[] visibleRefileActionsEntries = new CharSequence[5];
|
||||||
|
visibleRefileActionsEntries[VISIBLE_REFILE_ACTIONS_DELETE] = getString(R.string.delete_action);
|
||||||
|
visibleRefileActionsEntries[VISIBLE_REFILE_ACTIONS_ARCHIVE] = getString(R.string.archive_action);
|
||||||
|
visibleRefileActionsEntries[VISIBLE_REFILE_ACTIONS_MOVE] = getString(R.string.move_action);
|
||||||
|
visibleRefileActionsEntries[VISIBLE_REFILE_ACTIONS_COPY] = getString(R.string.copy_action);
|
||||||
|
visibleRefileActionsEntries[VISIBLE_REFILE_ACTIONS_SPAM] = getString(R.string.spam_action);
|
||||||
|
|
||||||
|
boolean[] visibleRefileActionsValues = new boolean[5];
|
||||||
|
visibleRefileActionsValues[VISIBLE_REFILE_ACTIONS_DELETE] = K9.isMessageViewDeleteActionVisible();
|
||||||
|
visibleRefileActionsValues[VISIBLE_REFILE_ACTIONS_ARCHIVE] = K9.isMessageViewArchiveActionVisible();
|
||||||
|
visibleRefileActionsValues[VISIBLE_REFILE_ACTIONS_MOVE] = K9.isMessageViewMoveActionVisible();
|
||||||
|
visibleRefileActionsValues[VISIBLE_REFILE_ACTIONS_COPY] = K9.isMessageViewCopyActionVisible();
|
||||||
|
visibleRefileActionsValues[VISIBLE_REFILE_ACTIONS_SPAM] = K9.isMessageViewSpamActionVisible();
|
||||||
|
|
||||||
|
mVisibleRefileActions.setItems(visibleRefileActionsEntries);
|
||||||
|
mVisibleRefileActions.setCheckedItems(visibleRefileActionsValues);
|
||||||
|
|
||||||
mSplitViewMode = (ListPreference) findPreference(PREFERENCE_SPLITVIEW_MODE);
|
mSplitViewMode = (ListPreference) findPreference(PREFERENCE_SPLITVIEW_MODE);
|
||||||
initListPreference(mSplitViewMode, K9.getSplitViewMode().name(),
|
initListPreference(mSplitViewMode, K9.getSplitViewMode().name(),
|
||||||
mSplitViewMode.getEntries(), mSplitViewMode.getEntryValues());
|
mSplitViewMode.getEntries(), mSplitViewMode.getEntryValues());
|
||||||
@ -479,6 +505,13 @@ public class Prefs extends K9PreferenceActivity {
|
|||||||
K9.setAutofitWidth(mAutofitWidth.isChecked());
|
K9.setAutofitWidth(mAutofitWidth.isChecked());
|
||||||
K9.setQuietTimeEnabled(mQuietTimeEnabled.isChecked());
|
K9.setQuietTimeEnabled(mQuietTimeEnabled.isChecked());
|
||||||
|
|
||||||
|
boolean[] enabledRefileActions = mVisibleRefileActions.getCheckedItems();
|
||||||
|
K9.setMessageViewDeleteActionVisible(enabledRefileActions[VISIBLE_REFILE_ACTIONS_DELETE]);
|
||||||
|
K9.setMessageViewArchiveActionVisible(enabledRefileActions[VISIBLE_REFILE_ACTIONS_ARCHIVE]);
|
||||||
|
K9.setMessageViewMoveActionVisible(enabledRefileActions[VISIBLE_REFILE_ACTIONS_MOVE]);
|
||||||
|
K9.setMessageViewCopyActionVisible(enabledRefileActions[VISIBLE_REFILE_ACTIONS_COPY]);
|
||||||
|
K9.setMessageViewSpamActionVisible(enabledRefileActions[VISIBLE_REFILE_ACTIONS_SPAM]);
|
||||||
|
|
||||||
K9.setQuietTimeStarts(mQuietTimeStarts.getTime());
|
K9.setQuietTimeStarts(mQuietTimeStarts.getTime());
|
||||||
K9.setQuietTimeEnds(mQuietTimeEnds.getTime());
|
K9.setQuietTimeEnds(mQuietTimeEnds.getTime());
|
||||||
K9.setWrapFolderNames(mWrapFolderNames.isChecked());
|
K9.setWrapFolderNames(mWrapFolderNames.isChecked());
|
||||||
|
@ -230,6 +230,21 @@ public class GlobalSettings {
|
|||||||
s.put("colorizeMissingContactPictures", Settings.versions(
|
s.put("colorizeMissingContactPictures", Settings.versions(
|
||||||
new V(29, new BooleanSetting(true))
|
new V(29, new BooleanSetting(true))
|
||||||
));
|
));
|
||||||
|
s.put("messageViewDeleteActionVisible", Settings.versions(
|
||||||
|
new V(30, new BooleanSetting(true))
|
||||||
|
));
|
||||||
|
s.put("messageViewArchiveActionVisible", Settings.versions(
|
||||||
|
new V(30, new BooleanSetting(false))
|
||||||
|
));
|
||||||
|
s.put("messageViewMoveActionVisible", Settings.versions(
|
||||||
|
new V(30, new BooleanSetting(false))
|
||||||
|
));
|
||||||
|
s.put("messageViewCopyActionVisible", Settings.versions(
|
||||||
|
new V(30, new BooleanSetting(false))
|
||||||
|
));
|
||||||
|
s.put("messageViewSpamActionVisible", Settings.versions(
|
||||||
|
new V(30, new BooleanSetting(false))
|
||||||
|
));
|
||||||
|
|
||||||
SETTINGS = Collections.unmodifiableMap(s);
|
SETTINGS = Collections.unmodifiableMap(s);
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ public class Settings {
|
|||||||
*
|
*
|
||||||
* @see SettingsExporter
|
* @see SettingsExporter
|
||||||
*/
|
*/
|
||||||
public static final int VERSION = 28;
|
public static final int VERSION = 30;
|
||||||
|
|
||||||
public static Map<String, Object> validate(int version, Map<String,
|
public static Map<String, Object> validate(int version, Map<String,
|
||||||
TreeMap<Integer, SettingsDescription>> settings,
|
TreeMap<Integer, SettingsDescription>> settings,
|
||||||
|