feat: 记住上次选中的配置,下次启动自动选中
- 启用 AppConfig.DefaultProfileID 字段(此前声明但未使用) - 启动时 loadProfiles() 优先选中上次记录的配置,找不到则回退到第一个 - 切换配置时立即持久化到 config.yml,防止崩溃丢失 - 使用 Profile ID 而非名称,避免重命名后失效
This commit is contained in:
@@ -54,6 +54,7 @@ func (a *App) buildMainWindow() fyne.CanvasObject {
|
||||
// Profile selector.
|
||||
a.profileSelect = widget.NewSelect(a.profileNames(), func(sel string) {
|
||||
a.selectProfileByName(sel)
|
||||
a.saveDefaultProfile()
|
||||
})
|
||||
|
||||
// Status display.
|
||||
|
||||
Reference in New Issue
Block a user