From fcce3c562c11742beb022befd0c97a51b16a3cda Mon Sep 17 00:00:00 2001 From: Filipe Moreira Date: Mon, 9 Nov 2026 09:53:58 -0300 Subject: [PATCH] feat: the Legacy build (1.6.2 that keeps the current app's settings) Legacy is Console Mode 1.6.2, with both interfaces, published next to 1.7.0 for those who prefer the old one. It is frozen. - AppConfig keeps the settings it doesn't know (JsonExtensionData) and BuildConfig hands them back, so switching to Legacy and back to the current app loses nothing. A launcher only the current app has (one of its custom apps) also goes back to the file untouched unless another one is picked here; Steam Big Picture shows and opens meanwhile. - It never checks for updates and the update settings are hidden in both interfaces; their saved values stay for the current app. - Version 1.7.0, shown as "Console Mode Legacy" in the window title, the tray, Settings, the log and the installer. Co-Authored-By: Claude Fable 5.1 --- CHANGELOG.en-US.md | 7 ++ CHANGELOG.md | 7 ++ build/ConsoleMode.iss | 4 +- src/ConsoleMode/App.xaml.cs | 2 +- src/ConsoleMode/ConsoleMode.csproj | 8 +-- src/ConsoleMode/MainWindow.xaml | 2 +- src/ConsoleMode/Models/Models.cs | 6 ++ src/ConsoleMode/Services/AppEdition.cs | 13 ++++ src/ConsoleMode/Services/TrayService.cs | 2 +- .../ViewModels/MainViewModel.Updates.cs | 3 +- src/ConsoleMode/ViewModels/MainViewModel.cs | 16 ++++- src/ConsoleMode/Views/ConsoleHomeView.xaml | 6 +- src/ConsoleMode/Views/SettingsView.xaml | 6 +- .../ConsoleMode.Tests.csproj | 1 + tests/ConsoleMode.Tests/LegacyConfigTests.cs | 68 +++++++++++++++++++ 15 files changed, 133 insertions(+), 18 deletions(-) create mode 100644 src/ConsoleMode/Services/AppEdition.cs create mode 100644 tests/ConsoleMode.Tests/LegacyConfigTests.cs diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 1eea3db..cf2ce66 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -4,6 +4,13 @@ English (US) release notes, mirroring CHANGELOG.md (Brazilian Portuguese). Befor ## [Unreleased] +## [1.7.0-legacy] +**Legacy** is Console Mode 1.6.2, with both interfaces (Desktop and Console), published next to 1.7.0 for those who prefer the old interface. It is frozen: no new features and no fixes. +### Changes +- Keeps the settings only the current version has (added apps, per-game profiles, the opening, the Task View shortcut...) and saves them back untouched: switching to Legacy and back to the current version loses nothing. +- It never checks for updates or offers the current version; the update settings are gone from both interfaces. To go back to the current version, install it over this one. +- It shows as **Console Mode Legacy** in the window title, the tray, Settings and the installer. + ## [1.6.2] ### What's new - Minimize to the system tray: with the new option in Settings (also in the Console interface, under System), minimizing the window takes Console Mode off the taskbar and leaves just its icon in the hidden icons; one click on the icon opens it again. Off by default. (#150) diff --git a/CHANGELOG.md b/CHANGELOG.md index 517ade7..524eac9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ Notas em português do Brasil; a versão em inglês (Estados Unidos) fica em `CH ## [Unreleased] +## [1.7.0-legacy] +A **Legacy** é o Console Mode 1.6.2, com as duas interfaces (Desktop e Console), publicada junto da 1.7.0 para quem prefere a interface antiga. Está congelada: não recebe novas funções nem correções. +### Mudanças +- Guarda os ajustes que só a versão atual tem (aplicativos adicionados, perfis por jogo, abertura, atalho da visão de tarefas...) e os grava de volta sem mexer: trocar para a Legacy e voltar para a versão atual não perde nada. +- Não procura atualizações nem avisa da versão atual; os ajustes de atualização saem das duas interfaces. Para voltar à versão atual, instale-a por cima. +- Aparece como **Console Mode Legacy** no título da janela, na bandeja, em Ajustes e no instalador. + ## [1.6.2] ### Novidades - Minimizar para a bandeja: com a nova opção em Ajustes (também na interface Console, em Sistema), minimizar a janela tira o Console Mode da barra de tarefas e deixa só o ícone nos ícones ocultos; um clique no ícone abre de novo. Vem desligada. (#150) diff --git a/build/ConsoleMode.iss b/build/ConsoleMode.iss index 96e37a5..456eaa4 100644 --- a/build/ConsoleMode.iss +++ b/build/ConsoleMode.iss @@ -22,7 +22,7 @@ AppId={{6C1C3E8B-4F0E-4E0B-9C62-3A7E1D0C5B21} AppName={#AppName} AppVersion={#AppVersion} -AppVerName={#AppName} {#AppVersion} +AppVerName={#AppName} {#AppVersion} Legacy AppPublisher=lippdev AppPublisherURL=https://github.com/lippdev/consolemode AppSupportURL=https://github.com/lippdev/consolemode/issues @@ -38,7 +38,7 @@ OutputDir={#OutputDir} OutputBaseFilename=ConsoleMode-Setup-{#Arch} SetupIconFile=..\assets\icon.ico UninstallDisplayIcon={app}\{#AppExe} -UninstallDisplayName={#AppName} +UninstallDisplayName={#AppName} Legacy Compression=lzma2/ultra64 SolidCompression=yes WizardStyle=modern diff --git a/src/ConsoleMode/App.xaml.cs b/src/ConsoleMode/App.xaml.cs index 042b143..ee54638 100644 --- a/src/ConsoleMode/App.xaml.cs +++ b/src/ConsoleMode/App.xaml.cs @@ -78,7 +78,7 @@ protected override async void OnLaunched(LaunchActivatedEventArgs args) AppLog.Write("Controles: " + ControllerInput.DescribeDevices().ReplaceLineEndings(" | ")); ProtocolService.EnsureRegistered(); AppLog.Write($"Startup: exe={Environment.ProcessPath}, args={string.Join(' ', Environment.GetCommandLineArgs().Skip(1))}, " + - $"rtss-cli={AppPaths.HasRtssCli}"); + $"rtss-cli={AppPaths.HasRtssCli}, edição={AppEdition.Name} {UpdateService.CurrentVersion}"); ViewModel = new MainViewModel(); _window = new MainWindow(ViewModel); diff --git a/src/ConsoleMode/ConsoleMode.csproj b/src/ConsoleMode/ConsoleMode.csproj index a60ae9d..ff65db7 100644 --- a/src/ConsoleMode/ConsoleMode.csproj +++ b/src/ConsoleMode/ConsoleMode.csproj @@ -17,10 +17,10 @@ true latest x64 - 1.6.2 - 1.6.2.0 - 1.6.2.0 - 1.6.2 + 1.7.0 + 1.7.0.0 + 1.7.0.0 + 1.7.0 Console Mode Console Mode lippdev diff --git a/src/ConsoleMode/MainWindow.xaml b/src/ConsoleMode/MainWindow.xaml index 99f9f38..bae7211 100644 --- a/src/ConsoleMode/MainWindow.xaml +++ b/src/ConsoleMode/MainWindow.xaml @@ -4,7 +4,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:views="using:ConsoleMode.Views" - Title="Console Mode"> + Title="Console Mode Legacy"> diff --git a/src/ConsoleMode/Models/Models.cs b/src/ConsoleMode/Models/Models.cs index 69808fc..400f35f 100644 --- a/src/ConsoleMode/Models/Models.cs +++ b/src/ConsoleMode/Models/Models.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using ConsoleMode.Services; @@ -7,6 +8,11 @@ public sealed class AppConfig { /// 2 = monitor fields hold ; 0/1 = GDI names (\\.\DISPLAYn). public int Version { get; set; } + /// + /// Settings this build doesn't have (the current Console Mode wrote them: custom apps, game profiles, the + /// opening...). Kept as they came and saved back, so switching to Legacy and back loses nothing. + /// + [JsonExtensionData] public Dictionary? NewerSettings { get; set; } /// Empty until the user (or the installer) picks one; the app then follows Windows. public string AppLanguage { get; set; } = ""; public string FocusMonitor { get; set; } = ""; diff --git a/src/ConsoleMode/Services/AppEdition.cs b/src/ConsoleMode/Services/AppEdition.cs new file mode 100644 index 0000000..3c11fab --- /dev/null +++ b/src/ConsoleMode/Services/AppEdition.cs @@ -0,0 +1,13 @@ +namespace ConsoleMode.Services; + +/// +/// This build is "Legacy": Console Mode 1.6.2 with both interfaces, published next to 1.7.0 for those who prefer +/// the old one. It is frozen, so it has nothing to update to. +/// +public static class AppEdition +{ + public const string Name = "Legacy"; + + /// Never: the only newer release is the current app, which a Legacy user chose not to use. + public static readonly bool ChecksForUpdates = false; +} diff --git a/src/ConsoleMode/Services/TrayService.cs b/src/ConsoleMode/Services/TrayService.cs index df1c0eb..2e30a85 100644 --- a/src/ConsoleMode/Services/TrayService.cs +++ b/src/ConsoleMode/Services/TrayService.cs @@ -23,7 +23,7 @@ public TrayService(Window window, MainViewModel vm) _vm = vm; _icon = new TaskbarIcon { - ToolTipText = "Console Mode" + ToolTipText = "Console Mode Legacy" }; var iconPath = AppPaths.IconPath; diff --git a/src/ConsoleMode/ViewModels/MainViewModel.Updates.cs b/src/ConsoleMode/ViewModels/MainViewModel.Updates.cs index 22601cd..667f886 100644 --- a/src/ConsoleMode/ViewModels/MainViewModel.Updates.cs +++ b/src/ConsoleMode/ViewModels/MainViewModel.Updates.cs @@ -129,7 +129,8 @@ private void RefreshHomeButtonHint() /// Startup check: quiet on failure, respects "ignorar esta versão". private async Task CheckForUpdatesOnStartupAsync() { - if (!CheckUpdates) return; + // Legacy is frozen: there is nothing to update to, and it must not keep offering the current app. + if (!AppEdition.ChecksForUpdates || !CheckUpdates) return; await CheckForUpdatesAsync(manual: false); } diff --git a/src/ConsoleMode/ViewModels/MainViewModel.cs b/src/ConsoleMode/ViewModels/MainViewModel.cs index 4e2f267..6a58c1c 100644 --- a/src/ConsoleMode/ViewModels/MainViewModel.cs +++ b/src/ConsoleMode/ViewModels/MainViewModel.cs @@ -38,6 +38,11 @@ public partial class MainViewModel : ObservableObject /// Last config read from disk; monitor fields survive a failed monitor listing. private AppConfig _loadedConfig = new(); + /// + /// The launcher the current app saved when Legacy doesn't have it (one of its custom apps). Steam Big Picture + /// shows and opens here; the saved one goes back to the file as it came, until another launcher is picked. + /// + private string? _newerLaunchMode; private List _availableAudioDevices = []; public MainViewModel() => LocalizationService.LanguageChanged += OnLanguageChanged; @@ -70,7 +75,7 @@ public partial class MainViewModel : ObservableObject [ObservableProperty] private MonitorRowViewModel? _selectedMonitor; [ObservableProperty] private MonitorRowViewModel? _focusRow; - public string AppVersion => UpdateService.CurrentVersion; + public string AppVersion => $"{UpdateService.CurrentVersion} {AppEdition.Name}"; public bool HasSelectedMonitor => SelectedMonitor is not null; public bool HasFocusRow => FocusRow is not null; @@ -303,6 +308,7 @@ private void Apply(LoadResult data) IsPlayniteAvailable = Engine.Launch.IsPlayniteAvailable(); BuildLocalizedOptions(); SelectedLaunch = LaunchOptions.FirstOrDefault(o => o.Value == config.FullscreenMode) ?? LaunchOptions[0]; + _newerLaunchMode = config.FullscreenMode is { } saved && saved.StartsWith("customApp", StringComparison.Ordinal) ? saved : null; ApplyTv(config.Tv); HdrEnable = config.HdrEnable; VrrEnable = config.VrrEnable; @@ -538,6 +544,7 @@ partial void OnSelectedLanguageChanged(ComboOption? value) partial void OnVrrEnableChanged(bool value) { SettingChanged(); OnPropertyChanged(nameof(VrrText)); } partial void OnSelectedLaunchChanged(ComboOption? value) { + if (!_applying) _newerLaunchMode = null; OnPropertyChanged(nameof(LaunchDescription)); SettingChanged(); } @@ -899,6 +906,7 @@ private AppConfig BuildConfig() var auto = audioId == ConsoleEngine.AudioOnConnectId; var config = new AppConfig { + NewerSettings = _loadedConfig.NewerSettings, AppLanguage = SelectedLanguage?.Value ?? LocalizationService.Language, // Listing failed: keep the saved screens instead of wiping them. FocusMonitor = _loadedConfig.FocusMonitor, @@ -965,7 +973,11 @@ private void TrySave(AppConfig config) { try { - ConfigService.Save(config); + // Only in the file: what runs here is the launcher on screen. + var shown = config.FullscreenMode; + if (_newerLaunchMode is not null) config.FullscreenMode = _newerLaunchMode; + try { ConfigService.Save(config); } + finally { config.FullscreenMode = shown; } _loadedConfig = config; } catch (Exception ex) diff --git a/src/ConsoleMode/Views/ConsoleHomeView.xaml b/src/ConsoleMode/Views/ConsoleHomeView.xaml index f4dc119..d4befcb 100644 --- a/src/ConsoleMode/Views/ConsoleHomeView.xaml +++ b/src/ConsoleMode/Views/ConsoleHomeView.xaml @@ -624,19 +624,19 @@ - - -