diff --git a/Directory.Build.props b/Directory.Build.props index cda20b1f..c0c906ca 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -43,6 +43,14 @@ + + + false + + + + + true diff --git a/i18n/ar/Shell.ar.resx b/i18n/ar/Shell.ar.resx index 528d0290..856a83b5 100644 --- a/i18n/ar/Shell.ar.resx +++ b/i18n/ar/Shell.ar.resx @@ -39,7 +39,6 @@ ضم مجلد موجود تغيير… اختيار… - ساعد في تحسين Titano بإحصاءات استخدام مجهولة متابعة مُكتشَف إنشاء أرشيف محلي diff --git a/i18n/bg/Shell.bg.resx b/i18n/bg/Shell.bg.resx index 5f26d1ef..9930dae6 100644 --- a/i18n/bg/Shell.bg.resx +++ b/i18n/bg/Shell.bg.resx @@ -31,7 +31,6 @@ Присъединяване на съществуваща папка Промяна… Избор… - Помогнете за подобряването на Titano с анонимна статистика за използването Продължаване Открит Създаване на локален архив diff --git a/i18n/cs/Shell.cs.resx b/i18n/cs/Shell.cs.resx index 2c4b79bc..f03fbdcc 100644 --- a/i18n/cs/Shell.cs.resx +++ b/i18n/cs/Shell.cs.resx @@ -35,7 +35,6 @@ Převzít existující složku Změnit… Vybrat… - Pomozte vylepšit Titano anonymními statistikami používání Pokračovat Nalezeno Vytvořit místní archiv diff --git a/i18n/da/Shell.da.resx b/i18n/da/Shell.da.resx index cfdc32ee..bd1958d4 100644 --- a/i18n/da/Shell.da.resx +++ b/i18n/da/Shell.da.resx @@ -31,7 +31,6 @@ Overtag en eksisterende mappe Skift… Vælg… - Hjælp med at forbedre Titano med anonym brugsstatistik Fortsæt Fundet Opret et lokalt arkiv diff --git a/i18n/de/Shell.de.resx b/i18n/de/Shell.de.resx index 142cbae4..82de2333 100644 --- a/i18n/de/Shell.de.resx +++ b/i18n/de/Shell.de.resx @@ -31,7 +31,6 @@ Vorhandenen Ordner einbinden Ändern… Auswählen… - Helfen Sie, Titano mit anonymer Nutzungsstatistik zu verbessern Weiter Gefunden Lokales Archiv erstellen diff --git a/i18n/el/Shell.el.resx b/i18n/el/Shell.el.resx index 2e3c714a..065ad238 100644 --- a/i18n/el/Shell.el.resx +++ b/i18n/el/Shell.el.resx @@ -31,7 +31,6 @@ Ενσωμάτωση υπάρχοντος φακέλου Αλλαγή… Επιλογή… - Βοηθήστε στη βελτίωση του Titano με ανώνυμα στατιστικά χρήσης Συνέχεια Βρέθηκε Δημιουργία τοπικής αρχειοθήκης diff --git a/i18n/en/Shell.resx b/i18n/en/Shell.resx index 47ad54db..0adc9e09 100644 --- a/i18n/en/Shell.resx +++ b/i18n/en/Shell.resx @@ -32,7 +32,6 @@ Adopt an existing folder Change… Choose… - Help improve Titano with anonymous usage countslong Continue Found Create a local archive diff --git a/i18n/es/Shell.es.resx b/i18n/es/Shell.es.resx index f6e87daa..9e4d85e9 100644 --- a/i18n/es/Shell.es.resx +++ b/i18n/es/Shell.es.resx @@ -31,7 +31,6 @@ Incorporar una carpeta existente Cambiar… Elegir… - Ayuda a mejorar Titano con recuentos de uso anónimos Continuar Encontrado Crear una fototeca local diff --git a/i18n/et/Shell.et.resx b/i18n/et/Shell.et.resx index a806fabd..c95b1c56 100644 --- a/i18n/et/Shell.et.resx +++ b/i18n/et/Shell.et.resx @@ -31,7 +31,6 @@ Võta olemasolev kaust üle Muuda… Vali… - Aidake Titanot anonüümse kasutusstatistikaga paremaks muuta Jätka Leitud Loo kohalik arhiiv diff --git a/i18n/fi/Shell.fi.resx b/i18n/fi/Shell.fi.resx index db730a16..9f31b8e1 100644 --- a/i18n/fi/Shell.fi.resx +++ b/i18n/fi/Shell.fi.resx @@ -31,7 +31,6 @@ Sisällytä nykyinen kansio Muuta… Valitse… - Auta kehittämään Titanoa nimettömillä käyttötilastoilla Jatka Löydetty Luo paikallinen arkisto diff --git a/i18n/fr/Shell.fr.resx b/i18n/fr/Shell.fr.resx index 52e8de32..a254b083 100644 --- a/i18n/fr/Shell.fr.resx +++ b/i18n/fr/Shell.fr.resx @@ -31,7 +31,6 @@ Adopter un dossier existant Modifier… Choisir… - Aider à améliorer Titano grâce à des statistiques d'utilisation anonymes Continuer Trouvé Créer une archive locale diff --git a/i18n/he/Shell.he.resx b/i18n/he/Shell.he.resx index e491455c..18e00362 100644 --- a/i18n/he/Shell.he.resx +++ b/i18n/he/Shell.he.resx @@ -35,7 +35,6 @@ אמץ תיקייה קיימת שנה… בחר… - עזור לשפר את Titano באמצעות נתוני שימוש אנונימיים המשך נמצא צור ארכיון מקומי diff --git a/i18n/hi/Shell.hi.resx b/i18n/hi/Shell.hi.resx index 3f18e088..bfc6588c 100644 --- a/i18n/hi/Shell.hi.resx +++ b/i18n/hi/Shell.hi.resx @@ -31,7 +31,6 @@ मौजूदा फ़ोल्डर अपनाएँ बदलें… चुनें… - अनाम उपयोग गणना भेजकर Titano को बेहतर बनाने में मदद करें जारी रखें मिला स्थानीय संग्रह बनाएँ diff --git a/i18n/hr/Shell.hr.resx b/i18n/hr/Shell.hr.resx index d8560c71..42363850 100644 --- a/i18n/hr/Shell.hr.resx +++ b/i18n/hr/Shell.hr.resx @@ -35,7 +35,6 @@ Usvoji postojeću mapu Promijeni… Odaberi… - Pomozite poboljšati Titano anonimnom statistikom korištenja Nastavi Pronađen Stvori lokalnu arhivu diff --git a/i18n/hu/Shell.hu.resx b/i18n/hu/Shell.hu.resx index 9261a318..557e7443 100644 --- a/i18n/hu/Shell.hu.resx +++ b/i18n/hu/Shell.hu.resx @@ -31,7 +31,6 @@ Meglévő mappa átvétele Módosítás… Kiválasztás… - Segítsen fejleszteni a Titanót névtelen használati statisztikával Folytatás Megtalálva Helyi archívum létrehozása diff --git a/i18n/id/Shell.id.resx b/i18n/id/Shell.id.resx index 12a3a20d..b74244da 100644 --- a/i18n/id/Shell.id.resx +++ b/i18n/id/Shell.id.resx @@ -31,7 +31,6 @@ Adopsi folder yang ada Ubah… Pilih… - Bantu tingkatkan Titano dengan hitungan penggunaan anonim Lanjutkan Ditemukan Buat arsip lokal diff --git a/i18n/it/Shell.it.resx b/i18n/it/Shell.it.resx index 4e62588a..d5b6e695 100644 --- a/i18n/it/Shell.it.resx +++ b/i18n/it/Shell.it.resx @@ -31,7 +31,6 @@ Adotta una cartella esistente Cambia… Scegli… - Aiuta a migliorare Titano con conteggi d'uso anonimi Continua Trovato Crea un archivio locale diff --git a/i18n/ja/Shell.ja.resx b/i18n/ja/Shell.ja.resx index 2342591b..1ed74d63 100644 --- a/i18n/ja/Shell.ja.resx +++ b/i18n/ja/Shell.ja.resx @@ -31,7 +31,6 @@ 既存のフォルダーを登録 変更… 選択… - 匿名の利用状況の集計を送信して Titano の改善に協力する 続行 検出済み ローカルアーカイブを作成 diff --git a/i18n/ko/Shell.ko.resx b/i18n/ko/Shell.ko.resx index 4fd7d651..afcaad3d 100644 --- a/i18n/ko/Shell.ko.resx +++ b/i18n/ko/Shell.ko.resx @@ -31,7 +31,6 @@ 기존 폴더 등록 변경… 선택… - 익명 사용 통계를 보내 Titano 개선에 도움 주기 계속 찾음 로컬 아카이브 만들기 diff --git a/i18n/lt/Shell.lt.resx b/i18n/lt/Shell.lt.resx index 121bc3e0..d7949b79 100644 --- a/i18n/lt/Shell.lt.resx +++ b/i18n/lt/Shell.lt.resx @@ -35,7 +35,6 @@ Perimti esamą aplanką Keisti… Pasirinkti… - Padėkite tobulinti Titano siųsdami anoniminę naudojimo statistiką Tęsti Rasta Kurti vietinį archyvą diff --git a/i18n/lv/Shell.lv.resx b/i18n/lv/Shell.lv.resx index 85119191..db58111c 100644 --- a/i18n/lv/Shell.lv.resx +++ b/i18n/lv/Shell.lv.resx @@ -35,7 +35,6 @@ Pārņemt esošu mapi Mainīt… Izvēlēties… - Palīdzēt uzlabot Titano ar anonīmu lietojuma statistiku Turpināt Atrasts Izveidot lokālu arhīvu diff --git a/i18n/ms/Shell.ms.resx b/i18n/ms/Shell.ms.resx index 558dad41..c753d096 100644 --- a/i18n/ms/Shell.ms.resx +++ b/i18n/ms/Shell.ms.resx @@ -31,7 +31,6 @@ Terima pakai folder sedia ada Tukar… Pilih… - Bantu tingkatkan Titano dengan kiraan penggunaan tanpa nama Teruskan Ditemui Cipta arkib setempat diff --git a/i18n/nb/Shell.nb.resx b/i18n/nb/Shell.nb.resx index a6997790..0e29cba2 100644 --- a/i18n/nb/Shell.nb.resx +++ b/i18n/nb/Shell.nb.resx @@ -31,7 +31,6 @@ Overta en eksisterende mappe Endre… Velg… - Hjelp med å forbedre Titano med anonym bruksstatistikk Fortsett Funnet Opprett et lokalt arkiv diff --git a/i18n/nl/Shell.nl.resx b/i18n/nl/Shell.nl.resx index 5ba5bb82..fc90d1e7 100644 --- a/i18n/nl/Shell.nl.resx +++ b/i18n/nl/Shell.nl.resx @@ -31,7 +31,6 @@ Een bestaande map opnemen Wijzigen… Kiezen… - Help Titano te verbeteren met anonieme gebruikstellingen Doorgaan Gevonden Een lokaal archief maken diff --git a/i18n/pl/Shell.pl.resx b/i18n/pl/Shell.pl.resx index c1f1542f..45d4c003 100644 --- a/i18n/pl/Shell.pl.resx +++ b/i18n/pl/Shell.pl.resx @@ -39,7 +39,6 @@ Dołącz istniejący folder Zmień… Wybierz… - Pomóż ulepszać Titano, wysyłając anonimowe statystyki użycia Kontynuuj Znaleziono Utwórz archiwum lokalne diff --git a/i18n/pt-BR/Shell.pt-BR.resx b/i18n/pt-BR/Shell.pt-BR.resx index 08ce87a8..ed06d9db 100644 --- a/i18n/pt-BR/Shell.pt-BR.resx +++ b/i18n/pt-BR/Shell.pt-BR.resx @@ -31,7 +31,6 @@ Adotar uma pasta existente Alterar… Escolher… - Ajude a melhorar o Titano com contagens de uso anônimas Continuar Encontrado Criar um acervo local diff --git a/i18n/pt-PT/Shell.pt-PT.resx b/i18n/pt-PT/Shell.pt-PT.resx index b8f0f008..123b9b94 100644 --- a/i18n/pt-PT/Shell.pt-PT.resx +++ b/i18n/pt-PT/Shell.pt-PT.resx @@ -31,7 +31,6 @@ Adotar uma pasta existente Alterar… Escolher… - Ajudar a melhorar o Titano com contagens de utilização anónimas Continuar Encontrados Criar um arquivo local diff --git a/i18n/ro/Shell.ro.resx b/i18n/ro/Shell.ro.resx index c5a6f846..a4938de9 100644 --- a/i18n/ro/Shell.ro.resx +++ b/i18n/ro/Shell.ro.resx @@ -35,7 +35,6 @@ Adoptare folder existent Modificare… Alegere… - Ajutați la îmbunătățirea Titano cu statistici de utilizare anonime Continuare Găsit Creare arhivă locală diff --git a/i18n/ru/Shell.ru.resx b/i18n/ru/Shell.ru.resx index 7ffd714f..30843e67 100644 --- a/i18n/ru/Shell.ru.resx +++ b/i18n/ru/Shell.ru.resx @@ -39,7 +39,6 @@ Присоединить имеющуюся папку Изменить… Выбрать… - Помогите улучшить Titano, отправляя анонимную статистику использования Продолжить Найден Создать локальный архив diff --git a/i18n/sk/Shell.sk.resx b/i18n/sk/Shell.sk.resx index 85ca138e..ddcfcb30 100644 --- a/i18n/sk/Shell.sk.resx +++ b/i18n/sk/Shell.sk.resx @@ -35,7 +35,6 @@ Prevziať existujúci priečinok Zmeniť… Vybrať… - Pomôžte zlepšiť Titano anonymnými štatistikami používania Pokračovať Nájdené Vytvoriť lokálny archív diff --git a/i18n/sl/Shell.sl.resx b/i18n/sl/Shell.sl.resx index 6b480c53..92d66260 100644 --- a/i18n/sl/Shell.sl.resx +++ b/i18n/sl/Shell.sl.resx @@ -35,7 +35,6 @@ Prevzemi obstoječo mapo Spremeni … Izberi … - Pomagajte izboljšati Titano z anonimno statistiko uporabe Nadaljuj Najdeno Ustvari lokalni arhiv diff --git a/i18n/sv/Shell.sv.resx b/i18n/sv/Shell.sv.resx index 70ca90d7..877b1a3a 100644 --- a/i18n/sv/Shell.sv.resx +++ b/i18n/sv/Shell.sv.resx @@ -31,7 +31,6 @@ Införliva en befintlig mapp Ändra… Välj… - Hjälp till att förbättra Titano med anonym användningsstatistik Fortsätt Hittad Skapa ett lokalt arkiv diff --git a/i18n/th/Shell.th.resx b/i18n/th/Shell.th.resx index 9ef16233..1dd34756 100644 --- a/i18n/th/Shell.th.resx +++ b/i18n/th/Shell.th.resx @@ -31,7 +31,6 @@ ลงทะเบียนโฟลเดอร์ที่มีอยู่ เปลี่ยน… เลือก… - ช่วยปรับปรุง Titano ด้วยสถิติการใช้งานแบบไม่ระบุตัวตน ดำเนินการต่อ พบแล้ว สร้างคลังภาพในเครื่อง diff --git a/i18n/tr/Shell.tr.resx b/i18n/tr/Shell.tr.resx index 5ac8e601..9d88e660 100644 --- a/i18n/tr/Shell.tr.resx +++ b/i18n/tr/Shell.tr.resx @@ -31,7 +31,6 @@ Mevcut klasörü dahil et Değiştir… Seç… - Anonim kullanım sayılarıyla Titano'nun gelişmesine yardım edin Devam Bulundu Yerel arşiv oluştur diff --git a/i18n/uk/Shell.uk.resx b/i18n/uk/Shell.uk.resx index c2193cf5..c1a444a3 100644 --- a/i18n/uk/Shell.uk.resx +++ b/i18n/uk/Shell.uk.resx @@ -39,7 +39,6 @@ Приєднати наявну папку Змінити… Вибрати… - Допомогти покращити Titano анонімною статистикою використання Продовжити Знайдено Створити локальний архів diff --git a/i18n/vi/Shell.vi.resx b/i18n/vi/Shell.vi.resx index b4d450de..f18d4deb 100644 --- a/i18n/vi/Shell.vi.resx +++ b/i18n/vi/Shell.vi.resx @@ -31,7 +31,6 @@ Tiếp nhận thư mục có sẵn Thay đổi… Chọn… - Giúp cải thiện Titano bằng số liệu sử dụng ẩn danh Tiếp tục Đã tìm thấy Tạo kho lưu trữ cục bộ diff --git a/i18n/zh-Hans/Shell.zh-Hans.resx b/i18n/zh-Hans/Shell.zh-Hans.resx index bd6f881a..2b6b3c52 100644 --- a/i18n/zh-Hans/Shell.zh-Hans.resx +++ b/i18n/zh-Hans/Shell.zh-Hans.resx @@ -31,7 +31,6 @@ 纳入现有文件夹 更改… 选择… - 发送匿名使用统计,帮助改进 Titano 继续 已发现 创建本地档案库 diff --git a/i18n/zh-Hant/Shell.zh-Hant.resx b/i18n/zh-Hant/Shell.zh-Hant.resx index c2d72e5a..c26fecc4 100644 --- a/i18n/zh-Hant/Shell.zh-Hant.resx +++ b/i18n/zh-Hant/Shell.zh-Hant.resx @@ -31,7 +31,6 @@ 納入現有資料夾 變更… 選擇… - 以匿名使用統計協助改善 Titano 繼續 已找到 建立本機典藏庫 diff --git a/src/Titano.App/Infrastructure/AppSettings.cs b/src/Titano.App/Infrastructure/AppSettings.cs index 21066cbe..a1773ce8 100644 --- a/src/Titano.App/Infrastructure/AppSettings.cs +++ b/src/Titano.App/Infrastructure/AppSettings.cs @@ -56,7 +56,10 @@ public sealed class AppSettings public string? Language { get; set; } public AppTheme Theme { get; set; } = AppTheme.Dark; public bool RailCollapsed { get; set; } + + /// The first-run consent of BRIEF §21; offered only by builds with . public bool AnonymousUsageCounts { get; set; } + public WindowPlacement? Window { get; set; } /// The first-run choice (local archive, adopted folder or server) was made. diff --git a/src/Titano.App/Infrastructure/ProductFeatures.cs b/src/Titano.App/Infrastructure/ProductFeatures.cs new file mode 100644 index 00000000..e150d321 --- /dev/null +++ b/src/Titano.App/Infrastructure/ProductFeatures.cs @@ -0,0 +1,17 @@ +using System.Reflection; + +namespace Titano.App.Infrastructure; + +/// Features a build switches on through MSBuild properties (Directory.Build.props), read from the assembly metadata. +public static class ProductFeatures +{ + /// + /// Monetization (BRIEF §21: ads, the anonymous usage counts consent, the licence) ships disabled until a build sets + /// TitanoAdsEnabled=true; until then nothing of it shows. + /// + public static bool AdsEnabled { get; } = Flag("TitanoAdsEnabled"); + + private static bool Flag(string key) => + typeof(ProductFeatures).Assembly.GetCustomAttributes().FirstOrDefault(a => a.Key == key)?.Value is { } value + && bool.TryParse(value, out var on) && on; +} diff --git a/src/Titano.App/Sections/SettingsView.xaml b/src/Titano.App/Sections/SettingsView.xaml index c19a884f..1547ac25 100644 --- a/src/Titano.App/Sections/SettingsView.xaml +++ b/src/Titano.App/Sections/SettingsView.xaml @@ -134,7 +134,9 @@ - + + diff --git a/src/Titano.App/Sections/SettingsViewModel.cs b/src/Titano.App/Sections/SettingsViewModel.cs index 45299c80..2e79ab42 100644 --- a/src/Titano.App/Sections/SettingsViewModel.cs +++ b/src/Titano.App/Sections/SettingsViewModel.cs @@ -43,7 +43,7 @@ public sealed class SettingsViewModel : SectionViewModel _s = shell.Services.Settings; AllPages = [ - new(SettingsPage.General, ["Settings.General.Language", "Settings.General.Theme", "Settings.General.Usage"]), + new(SettingsPage.General, ["Settings.General.Language", "Settings.General.Theme", .. ProductFeatures.AdsEnabled ? (string[])["Settings.General.Usage"] : []]), new(SettingsPage.Archive, ["Settings.Archive.Root", "Settings.Archive.Folders", "Settings.Archive.Files", "Settings.Archive.Proxies"]), new(SettingsPage.Rendering, ["Settings.Rendering.Quality", "Settings.Rendering.Memory", "Settings.Rendering.Parallelism", "Settings.Rendering.Hardware", "Settings.Rendering.Encoders"]), new(SettingsPage.Storage, ["Settings.Storage.Folder", "Settings.Storage.Thumbnails", "Settings.Storage.Limit"]), @@ -247,6 +247,9 @@ public sealed class SettingsViewModel : SectionViewModel } } + /// The usage counts consent belongs to monetization (BRIEF §21): only builds with it enabled offer it. + public bool ShowsUsageCounts => ProductFeatures.AdsEnabled; + public bool UsageCounts { get => _s.AnonymousUsageCounts; diff --git a/src/Titano.App/Sections/WelcomeView.xaml b/src/Titano.App/Sections/WelcomeView.xaml index 7ec7dc6f..8e58a9db 100644 --- a/src/Titano.App/Sections/WelcomeView.xaml +++ b/src/Titano.App/Sections/WelcomeView.xaml @@ -106,14 +106,16 @@ - + + HorizontalAlignment="Left" Foreground="{DynamicResource Brush.TextMuted}" + Visibility="{Binding ShowsUsageCounts, Converter={StaticResource BoolToVisibility}}" />