Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ type Config struct {
DisableImages bool `json:"disable_images,omitempty"`
HideTips bool `json:"hide_tips,omitempty"`
DisableNotifications bool `json:"disable_notifications,omitempty"`
DisableDaemon bool `json:"disable_daemon,omitempty"`
EnableSplitPane bool `json:"enable_split_pane,omitempty"`
EnableThreaded bool `json:"enable_threaded,omitempty"`
EnableDetailedDates bool `json:"enable_detailed_dates,omitempty"`
Expand Down Expand Up @@ -444,6 +445,7 @@ type secureDiskConfig struct {
DisableImages bool `json:"disable_images,omitempty"`
HideTips bool `json:"hide_tips,omitempty"`
DisableNotifications bool `json:"disable_notifications,omitempty"`
DisableDaemon bool `json:"disable_daemon,omitempty"`
EnableSplitPane bool `json:"enable_split_pane,omitempty"`
EnableThreaded bool `json:"enable_threaded,omitempty"`
EnableDetailedDates bool `json:"enable_detailed_dates,omitempty"`
Expand Down Expand Up @@ -494,6 +496,7 @@ func SaveConfig(config *Config) error {
DisableImages: config.DisableImages,
HideTips: config.HideTips,
DisableNotifications: config.DisableNotifications,
DisableDaemon: config.DisableDaemon,
EnableSplitPane: config.EnableSplitPane,
EnableThreaded: config.EnableThreaded,
EnableDetailedDates: config.EnableDetailedDates,
Expand Down Expand Up @@ -602,6 +605,7 @@ func LoadConfig() (*Config, error) {
DisableImages bool `json:"disable_images,omitempty"`
HideTips bool `json:"hide_tips,omitempty"`
DisableNotifications bool `json:"disable_notifications,omitempty"`
DisableDaemon bool `json:"disable_daemon,omitempty"`
EnableSplitPane bool `json:"enable_split_pane,omitempty"`
EnableThreaded bool `json:"enable_threaded,omitempty"`
EnableDetailedDates bool `json:"enable_detailed_dates,omitempty"`
Expand Down Expand Up @@ -644,6 +648,7 @@ func LoadConfig() (*Config, error) {
config.DisableImages = raw.DisableImages
config.HideTips = raw.HideTips
config.DisableNotifications = raw.DisableNotifications
config.DisableDaemon = raw.DisableDaemon
config.EnableSplitPane = raw.EnableSplitPane
config.EnableThreaded = raw.EnableThreaded
config.EnableDetailedDates = raw.EnableDetailedDates
Expand Down
7 changes: 6 additions & 1 deletion daemonclient/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@ type Service interface {
}

// NewService connects to the daemon, auto-starting it if needed.
// Falls back to direct mode only if daemon cannot be started.
// Falls back to direct mode only if daemon cannot be started, or if DisableDaemon is set.
func NewService(cfg *config.Config) Service {
if cfg.DisableDaemon {
log.Println("service: daemon disabled by config, using direct mode")
return newDirectService(cfg)
}

// Try connecting to existing daemon.
if svc := tryConnect(); svc != nil {
return svc
Expand Down
1 change: 1 addition & 0 deletions i18n/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
"disable_images": "تعطيل عرض الصور",
"hide_tips": "إخفاء النصائح السياقية",
"disable_notifications": "تعطيل الإشعارات",
"disable_daemon": "Background Daemon",
"enable_split_pane": "عرض مقسم",
"enable_threaded": "عرض المحادثات",
"enable_detailed_dates": "تواريخ مفصلة",
Expand Down
1 change: 1 addition & 0 deletions i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
"disable_images": "Bildanzeige Deaktivieren",
"hide_tips": "Kontextuelle Tipps Ausblenden",
"disable_notifications": "Benachrichtigungen Deaktivieren",
"disable_daemon": "Background Daemon",
"enable_split_pane": "Geteilte Ansicht",
"enable_threaded": "Konversations-Threads",
"enable_detailed_dates": "Detaillierte Datumsangaben",
Expand Down
1 change: 1 addition & 0 deletions i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
"disable_images": "Disable Image Display",
"hide_tips": "Hide Contextual Tips",
"disable_notifications": "Disable Notifications",
"disable_daemon": "Background Daemon",
"enable_split_pane": "Split Pane View",
"enable_threaded": "Threaded Conversation View",
"enable_detailed_dates": "Detailed Dates",
Expand Down
1 change: 1 addition & 0 deletions i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
"disable_images": "Deshabilitar Visualización de Imágenes",
"hide_tips": "Ocultar Consejos Contextuales",
"disable_notifications": "Deshabilitar Notificaciones",
"disable_daemon": "Background Daemon",
"enable_split_pane": "Vista dividida",
"enable_threaded": "Vista de conversación",
"enable_detailed_dates": "Fechas detalladas",
Expand Down
1 change: 1 addition & 0 deletions i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
"disable_images": "Désactiver l'Affichage des Images",
"hide_tips": "Masquer les Conseils Contextuels",
"disable_notifications": "Désactiver les Notifications",
"disable_daemon": "Background Daemon",
"enable_split_pane": "Vue divisée",
"enable_threaded": "Vue par conversation",
"enable_detailed_dates": "Dates détaillées",
Expand Down
1 change: 1 addition & 0 deletions i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
"disable_images": "画像表示を無効化",
"hide_tips": "コンテキストヒントを非表示",
"disable_notifications": "通知を無効化",
"disable_daemon": "Background Daemon",
"enable_split_pane": "分割ビュー",
"enable_threaded": "スレッド表示",
"enable_detailed_dates": "詳細な日付",
Expand Down
1 change: 1 addition & 0 deletions i18n/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
"disable_images": "Wyłącz Wyświetlanie Obrazów",
"hide_tips": "Ukryj Wskazówki Kontekstowe",
"disable_notifications": "Wyłącz Powiadomienia",
"disable_daemon": "Background Daemon",
"enable_split_pane": "Widok podzielony",
"enable_threaded": "Widok wątków",
"enable_detailed_dates": "Szczegółowe daty",
Expand Down
1 change: 1 addition & 0 deletions i18n/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
"disable_images": "Desativar Exibição de Imagens",
"hide_tips": "Ocultar Dicas Contextuais",
"disable_notifications": "Desativar Notificações",
"disable_daemon": "Background Daemon",
"enable_split_pane": "Vista dividida",
"enable_threaded": "Vista de conversação",
"enable_detailed_dates": "Datas detalhadas",
Expand Down
1 change: 1 addition & 0 deletions i18n/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
"disable_images": "Отключить Отображение Изображений",
"hide_tips": "Скрыть Контекстные Подсказки",
"disable_notifications": "Отключить Уведомления",
"disable_daemon": "Background Daemon",
"enable_split_pane": "Разделённый вид",
"enable_threaded": "Просмотр беседами",
"enable_detailed_dates": "Подробные даты",
Expand Down
1 change: 1 addition & 0 deletions i18n/locales/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
"disable_images": "Вимкнути показ зображень",
"hide_tips": "Приховати контекстні підказки",
"disable_notifications": "Вимкнути сповіщення",
"disable_daemon": "Background Daemon",
"enable_split_pane": "Розділений вигляд",
"enable_threaded": "Перегляд розмов",
"enable_detailed_dates": "Детальні дати",
Expand Down
1 change: 1 addition & 0 deletions i18n/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
"disable_images": "禁用图片显示",
"hide_tips": "隐藏上下文提示",
"disable_notifications": "禁用通知",
"disable_daemon": "Background Daemon",
"enable_split_pane": "分屏视图",
"enable_threaded": "会话视图",
"enable_detailed_dates": "详细日期",
Expand Down
21 changes: 13 additions & 8 deletions tui/settings_general.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func (m *Settings) buildGeneralOptions() []generalOption {
{"settings_general.disable_images", onOff(m.cfg.DisableImages), "Prevent images from loading automatically in emails."},
{"settings_general.hide_tips", onOff(m.cfg.HideTips), "Hide helpful hints displayed at the bottom of the screen."},
{"settings_general.disable_notifications", onOff(m.cfg.DisableNotifications), "Turn off desktop notifications for new mail."},
{"settings_general.disable_daemon", onOff(!m.cfg.DisableDaemon), "Run a background daemon for push notifications and sync. Takes effect on restart."},
{"settings_general.enable_split_pane", onOff(m.cfg.EnableSplitPane), "View inbox and email side-by-side."},
{"settings_general.enable_threaded", onOff(m.cfg.EnableThreaded), "Group emails into conversations by reply chain. Per-folder overrides are kept."},
{"settings_general.enable_detailed_dates", onOff(m.cfg.EnableDetailedDates), "Show detailed inbox dates."},
Expand Down Expand Up @@ -57,27 +58,31 @@ func (m *Settings) updateGeneral(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) {
m.cfg.DisableNotifications = !m.cfg.DisableNotifications
_ = config.SaveConfig(m.cfg)
saved = true
case 3: // Split Pane View
case 3: // Background Daemon
m.cfg.DisableDaemon = !m.cfg.DisableDaemon
_ = config.SaveConfig(m.cfg)
saved = true
case 4: // Split Pane View
m.cfg.EnableSplitPane = !m.cfg.EnableSplitPane
_ = config.SaveConfig(m.cfg)
saved = true
case 4: // Threaded Conversation View
case 5: // Threaded Conversation View
m.cfg.EnableThreaded = !m.cfg.EnableThreaded
_ = config.SaveConfig(m.cfg)
saved = true
case 5: // Detailed Dates
case 6: // Detailed Dates
m.cfg.EnableDetailedDates = !m.cfg.EnableDetailedDates
_ = config.SaveConfig(m.cfg)
saved = true
case 6: // Spellcheck
case 7: // Spellcheck
m.cfg.DisableSpellcheck = !m.cfg.DisableSpellcheck
_ = config.SaveConfig(m.cfg)
saved = true
case 7: // Spell Suggestions
case 8: // Spell Suggestions
m.cfg.DisableSpellSuggestions = !m.cfg.DisableSpellSuggestions
_ = config.SaveConfig(m.cfg)
saved = true
case 8: // Date Format
case 9: // Date Format
switch m.cfg.DateFormat {
case config.DateFormatEU:
m.cfg.DateFormat = config.DateFormatUS
Expand All @@ -88,7 +93,7 @@ func (m *Settings) updateGeneral(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) {
}
_ = config.SaveConfig(m.cfg)
saved = true
case 9: // Language
case 10: // Language
// Cycle through available languages
langs := i18n.LanguageCodes()
currentLang := m.cfg.GetLanguage()
Expand All @@ -109,7 +114,7 @@ func (m *Settings) updateGeneral(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) {
func() tea.Msg { return ConfigSavedMsg{} },
func() tea.Msg { return LanguageChangedMsg{} },
)
case 10: // Edit Signature
case 11: // Edit Signature
if msg.String() == keyEnter || msg.String() == keyRight || msg.String() == "l" {
return m, func() tea.Msg { return GoToSignatureEditorMsg{} }
}
Expand Down
Loading