Make the "show inline images as attachments" optional and cleanup localization data

This commit is contained in:
the-djmaze 2022-10-03 20:15:12 +02:00
parent 02eb5ad4e8
commit a51f86ae28
45 changed files with 1006 additions and 1251 deletions

View file

@ -81,8 +81,8 @@ class SquireUI
// html: '〈〉',
// cmd: () => this.setMode('plain' == this.mode ? 'wysiwyg' : 'plain'),
select: [
[i18n('SETTINGS_GENERAL/LABEL_EDITOR_HTML'),'wysiwyg'],
[i18n('SETTINGS_GENERAL/LABEL_EDITOR_PLAIN'),'plain']
[i18n('SETTINGS_GENERAL/EDITOR_HTML'),'wysiwyg'],
[i18n('SETTINGS_GENERAL/EDITOR_PLAIN'),'plain']
],
cmd: s => this.setMode('plain' == s.value ? 'plain' : 'wysiwyg'),
hint: i18n('EDITOR/TEXT_SWITCHER_PLAIN_TEXT', 'Plain')

View file

@ -150,8 +150,9 @@ export class MessageModel extends AbstractModel {
this.addComputables({
attachmentIconClass: () => FileInfo.getAttachmentsIconClass(this.attachments()),
threadsLen: () => this.threads().length,
// hasAttachments: () => this.attachments().filter(item => !item.isLinked()).length,
hasAttachments: () => this.attachments().length,
listAttachments: () => this.attachments()
.filter(item => SettingsUserStore.listInlineAttachments() || !item.isLinked()),
hasAttachments: () => this.listAttachments().length,
isUnseen: () => !this.flags().includes('\\seen'),
isFlagged: () => this.flags().includes('\\flagged'),

View file

@ -42,7 +42,7 @@ export class UserSettingsGeneral extends AbstractViewSettings {
['layout', 'messageReadDelay', 'messagesPerPage',
'editorDefaultType', 'requestReadReceipt', 'requestDsn', 'pgpSign', 'pgpEncrypt',
'viewHTML', 'showImages', 'removeColors', 'hideDeleted',
'viewHTML', 'showImages', 'removeColors', 'hideDeleted', 'listInlineAttachments',
'useCheckboxesInList', 'useThreads', 'replySameFolder', 'msgDefaultAction'
].forEach(name => this[name] = SettingsUserStore[name]);
@ -68,8 +68,8 @@ export class UserSettingsGeneral extends AbstractViewSettings {
editorDefaultTypes: () => {
translatorTrigger();
return [
{ id: EditorDefaultType.Html, name: i18n('SETTINGS_GENERAL/LABEL_EDITOR_HTML') },
{ id: EditorDefaultType.Plain, name: i18n('SETTINGS_GENERAL/LABEL_EDITOR_PLAIN') }
{ id: EditorDefaultType.Html, name: i18n('SETTINGS_GENERAL/EDITOR_HTML') },
{ id: EditorDefaultType.Plain, name: i18n('SETTINGS_GENERAL/EDITOR_PLAIN') }
];
},
@ -84,9 +84,9 @@ export class UserSettingsGeneral extends AbstractViewSettings {
layoutTypes: () => {
translatorTrigger();
return [
{ id: Layout.NoPreview, name: i18n('SETTINGS_GENERAL/LABEL_LAYOUT_NO_SPLIT') },
{ id: Layout.SidePreview, name: i18n('SETTINGS_GENERAL/LABEL_LAYOUT_VERTICAL_SPLIT') },
{ id: Layout.BottomPreview, name: i18n('SETTINGS_GENERAL/LABEL_LAYOUT_HORIZONTAL_SPLIT') }
{ id: Layout.NoPreview, name: i18n('SETTINGS_GENERAL/LAYOUT_NO_SPLIT') },
{ id: Layout.SidePreview, name: i18n('SETTINGS_GENERAL/LAYOUT_VERTICAL_SPLIT') },
{ id: Layout.BottomPreview, name: i18n('SETTINGS_GENERAL/LAYOUT_HORIZONTAL_SPLIT') }
];
}
});
@ -97,7 +97,8 @@ export class UserSettingsGeneral extends AbstractViewSettings {
this.addSetting('MessagesPerPage');
this.addSetting('Layout');
this.addSettings(['ViewHTML', 'ShowImages', 'HideDeleted', 'UseCheckboxesInList', 'ReplySameFolder',
this.addSettings(['ViewHTML', 'ShowImages', 'HideDeleted', 'ListInlineAttachments',
'UseCheckboxesInList', 'ReplySameFolder',
'requestReadReceipt', 'requestDsn', 'pgpSign', 'pgpEncrypt',
'DesktopNotifications', 'SoundNotification']);

View file

@ -19,6 +19,7 @@ export const SettingsUserStore = new class {
viewHTML: 1,
showImages: 0,
removeColors: 0,
listInlineAttachments: 0,
useCheckboxesInList: 1,
allowDraftAutosave: 1,
useThreads: 0,
@ -78,6 +79,7 @@ export const SettingsUserStore = new class {
self.viewHTML(SettingsGet('ViewHTML'));
self.showImages(SettingsGet('ShowImages'));
self.removeColors(SettingsGet('RemoveColors'));
self.listInlineAttachments(SettingsGet('ListInlineAttachments'));
self.useCheckboxesInList(SettingsGet('UseCheckboxesInList'));
self.allowDraftAutosave(SettingsGet('AllowDraftAutosave'));
self.useThreads(SettingsGet('UseThreads'));