diff --git a/meson.build b/meson.build index 99ccef6..eafecf5 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('rhino-setup', 'rust', - version: '0.1.0', + version: '0.2.0', meson_version: '>= 0.59.0', license: 'GPL-3.0-or-later' ) diff --git a/po/POTFILES.in b/po/POTFILES.in index 74e185b..39c1d25 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -3,4 +3,3 @@ data/org.rhinolinux.RhinoSetup.gschema.xml.in src/main.rs src/welcome.rs -src/theme.rs diff --git a/po/ar.po b/po/ar.po index 3b991bc..a5521ff 100644 --- a/po/ar.po +++ b/po/ar.po @@ -58,7 +58,7 @@ msgstr "Nala هي واجهة بديلة لـ APT, مع جمالية واجهة msgid "Apport is a crash reporting system that helps us improve the stability of the system." msgstr "Apport هو نظام تقارير الأعطال يساعدك على الحفاظ على استقرار الجهاز." -#: src/extra_settings.rs:84 src/package_manager.rs:104 src/theme.rs:83 +#: src/extra_settings.rs:84 src/package_manager.rs:104 msgid "Next" msgstr "التالي" @@ -98,14 +98,6 @@ msgstr "تنسيق قابل للتنفيذ ومضغوط ذاتيًا لمنصة msgid "The changes are being applied. Please Wait..." msgstr "يتم تطبيق التغييرات. من فضلك انتظر..." -#: src/theme.rs:77 -msgid "Color Scheme" -msgstr "نظام الألوان" - -#: src/theme.rs:78 -msgid "Choose a color scheme for your system." -msgstr "إختر نظام الألوان الخاص بنظامك." - #: src/welcome.rs:44 msgid "Make your choices, this wizard will take care of everything." msgstr "إتخذ قرارك, هذا الويزارد سيهتم بكل شيء." diff --git a/po/bn.po b/po/bn.po index 9a2cb51..1e8c958 100644 --- a/po/bn.po +++ b/po/bn.po @@ -65,7 +65,7 @@ msgstr "" "Apport একটি ক্র্যাশ রিপোর্টিং সিস্টেম যা আমাদের সিস্টেমের স্থিতিশীলতা উন্নত করতে " "সাহায্য করে।" -#: src/extra_settings.rs:84 src/package_manager.rs:104 src/theme.rs:83 +#: src/extra_settings.rs:84 src/package_manager.rs:104 msgid "Next" msgstr "পরবর্তী" @@ -106,14 +106,6 @@ msgstr "Linux প্ল্যাটফর্মের জন্য স্বয msgid "The changes are being applied. Please Wait..." msgstr "পরিবর্তনগুলো স্থাপন করা হচ্ছে। অনুগ্রহকরে অপেক্ষা করুন..." -#: src/theme.rs:77 -msgid "Color Scheme" -msgstr "বর্ণবিন্যাস" - -#: src/theme.rs:78 -msgid "Choose a color scheme for your system." -msgstr "আপনার সিস্টেমের জন্য একটি বর্ণবিন্যাস চয়ন করুন।" - #: src/welcome.rs:44 msgid "Make your choices, this wizard will take care of everything." msgstr "আপনি পছন্দ করুন, এই উইজার্ড সবকিছুর যত্ন নেবে।" diff --git a/po/de.po b/po/de.po index 50f5a43..014c65d 100644 --- a/po/de.po +++ b/po/de.po @@ -63,7 +63,7 @@ msgstr "" msgid "Apport is a crash reporting system that helps us improve the stability of the system." msgstr "Apport ist ein Absturzberichtsprogramm, welches uns hilft die Stabilität des Systems zu verbessern." -#: src/extra_settings.rs:84 src/package_manager.rs:104 src/theme.rs:83 +#: src/extra_settings.rs:84 src/package_manager.rs:104 msgid "Next" msgstr "Weiter" @@ -105,14 +105,6 @@ msgstr "Komprimiertes Format für Ausführbare Dateien für Linux-Plattformen, u msgid "The changes are being applied. Please Wait..." msgstr "Die Änderungen werden angewandt. Bitte warten Sie..." -#: src/theme.rs:77 -msgid "Color Scheme" -msgstr "Farbschema" - -#: src/theme.rs:78 -msgid "Choose a color scheme for your system." -msgstr "Wählen Sie ein Farbschema für Ihr System" - #: src/welcome.rs:44 msgid "Make your choices, this wizard will take care of everything." msgstr "Treffen Sie Ihre Auswahl, dieser Assistent wird sich um alles weitere kümmern." diff --git a/po/enm.po b/po/enm.po index 26863cb..f602f40 100644 --- a/po/enm.po +++ b/po/enm.po @@ -54,7 +54,7 @@ msgstr "" msgid "Apport is a crash reporting system that helps us improve the stability of the system." msgstr "" -#: src/extra_settings.rs:84 src/package_manager.rs:104 src/theme.rs:83 +#: src/extra_settings.rs:84 src/package_manager.rs:104 msgid "Next" msgstr "" @@ -94,14 +94,6 @@ msgstr "" msgid "The changes are being applied. Please Wait..." msgstr "" -#: src/theme.rs:77 -msgid "Color Scheme" -msgstr "" - -#: src/theme.rs:78 -msgid "Choose a color scheme for your system." -msgstr "" - #: src/welcome.rs:44 msgid "Make your choices, this wizard will take care of everything." msgstr "" diff --git a/po/es.po b/po/es.po index 51bd6ea..f571293 100644 --- a/po/es.po +++ b/po/es.po @@ -65,7 +65,7 @@ msgstr "" "Apport es un sistema de notificación de fallos que nos ayuda a mejorar la " "estabilidad del sistema." -#: src/extra_settings.rs:84 src/package_manager.rs:104 src/theme.rs:83 +#: src/extra_settings.rs:84 src/package_manager.rs:104 msgid "Next" msgstr "Próximo" @@ -108,14 +108,6 @@ msgstr "Formato ejecutable autocontenido y comprimido para la plataforma Linux." msgid "The changes are being applied. Please Wait..." msgstr "Se están aplicando los cambios. Espere por favor..." -#: src/theme.rs:77 -msgid "Color Scheme" -msgstr "Esquema de Colores" - -#: src/theme.rs:78 -msgid "Choose a color scheme for your system." -msgstr "Elija una esquema de colores para tú sistema." - #: src/welcome.rs:44 msgid "Make your choices, this wizard will take care of everything." msgstr "Elija tú elecciones, este programa ayuda con todo." diff --git a/po/fr.po b/po/fr.po index 95115aa..2847576 100644 --- a/po/fr.po +++ b/po/fr.po @@ -57,7 +57,7 @@ msgstr "" msgid "Apport is a crash reporting system that helps us improve the stability of the system." msgstr "" -#: src/extra_settings.rs:84 src/package_manager.rs:104 src/theme.rs:83 +#: src/extra_settings.rs:84 src/package_manager.rs:104 msgid "Next" msgstr "" @@ -97,14 +97,6 @@ msgstr "" msgid "The changes are being applied. Please Wait..." msgstr "" -#: src/theme.rs:77 -msgid "Color Scheme" -msgstr "" - -#: src/theme.rs:78 -msgid "Choose a color scheme for your system." -msgstr "" - #: src/welcome.rs:44 msgid "Make your choices, this wizard will take care of everything." msgstr "" diff --git a/po/hi.po b/po/hi.po index 016d05a..29a7d33 100644 --- a/po/hi.po +++ b/po/hi.po @@ -64,7 +64,7 @@ msgstr "" "Apport एक क्रैश रिपोर्टिंग सिस्टम है जो सिस्टम की स्थिरता को बेहतर बनाने में हमारी मदद " "करता है।" -#: src/extra_settings.rs:84 src/package_manager.rs:104 src/theme.rs:83 +#: src/extra_settings.rs:84 src/package_manager.rs:104 msgid "Next" msgstr "अगला" @@ -105,14 +105,6 @@ msgstr "Linux प्लेटफॉर्म के लिए स्व-नि msgid "The changes are being applied. Please Wait..." msgstr "परिवर्तन लागू किए जा रहे हैं। कृपया प्रतीक्षा करें..." -#: src/theme.rs:77 -msgid "Color Scheme" -msgstr "रंग योजना" - -#: src/theme.rs:78 -msgid "Choose a color scheme for your system." -msgstr "अपने सिस्टम के लिए एक रंग योजना चुनें।" - #: src/welcome.rs:44 msgid "Make your choices, this wizard will take care of everything." msgstr "अपने चुनाव करें, यह सॉफ्टवेयर सब कुछ संभाल लेगा।" diff --git a/po/id.po b/po/id.po index 45d2fa3..7c7b72c 100644 --- a/po/id.po +++ b/po/id.po @@ -62,7 +62,7 @@ msgstr "" "Apport adalah sistem pelaporan kerusakan yang membantu kami meningkatkan " "stabilitas sistem." -#: src/extra_settings.rs:84 src/package_manager.rs:104 src/theme.rs:83 +#: src/extra_settings.rs:84 src/package_manager.rs:104 msgid "Next" msgstr "Berikutnya" @@ -105,14 +105,6 @@ msgstr "" msgid "The changes are being applied. Please Wait..." msgstr "Perubahan sedang diterapkan. Mohon Tunggu..." -#: src/theme.rs:77 -msgid "Color Scheme" -msgstr "Skema Warna" - -#: src/theme.rs:78 -msgid "Choose a color scheme for your system." -msgstr "Pilih skema warna untuk sistem Anda." - #: src/welcome.rs:44 msgid "Make your choices, this wizard will take care of everything." msgstr "Tentukan pilihan Anda, wizard ini akan mengurus semuanya." diff --git a/po/ie.po b/po/ie.po index 252b7b6..26e79a0 100644 --- a/po/ie.po +++ b/po/ie.po @@ -59,7 +59,7 @@ msgstr "" "Apport es un sistema de raportation de fracasses, quel assiste nos ameliorar " "li stabilitá del sistema." -#: src/extra_settings.rs:84 src/package_manager.rs:104 src/theme.rs:83 +#: src/extra_settings.rs:84 src/package_manager.rs:104 msgid "Next" msgstr "Avan" @@ -100,14 +100,6 @@ msgstr "" msgid "The changes are being applied. Please Wait..." msgstr "Li modificationes ea applicat. Ples atender…" -#: src/theme.rs:77 -msgid "Color Scheme" -msgstr "Schema de colores" - -#: src/theme.rs:78 -msgid "Choose a color scheme for your system." -msgstr "Selecte un schema de colores por vor sistema." - #: src/welcome.rs:44 msgid "Make your choices, this wizard will take care of everything." msgstr "Fa vor selectiones, e li assistente va far omnicos." diff --git a/po/it.po b/po/it.po index 4d4deb4..e3240f9 100644 --- a/po/it.po +++ b/po/it.po @@ -61,7 +61,7 @@ msgstr "" "Apport è un sistema di crash report che ci aiuta a migliorare la stabilità " "del sistema." -#: src/extra_settings.rs:84 src/package_manager.rs:104 src/theme.rs:83 +#: src/extra_settings.rs:84 src/package_manager.rs:104 msgid "Next" msgstr "Prossimo" @@ -103,14 +103,6 @@ msgstr "Formato eseguibile autonomo e compresso per la piattaforma Linux." msgid "The changes are being applied. Please Wait..." msgstr "Attendi mentre vengono apportate le modifiche." -#: src/theme.rs:77 -msgid "Color Scheme" -msgstr "Schema Colori" - -#: src/theme.rs:78 -msgid "Choose a color scheme for your system." -msgstr "Scegli uno schema colori per il tuo sistema." - #: src/welcome.rs:44 msgid "Make your choices, this wizard will take care of everything." msgstr "Fai la tua scelta, questa procedura si prenderà cura di tutto il resto." diff --git a/po/ka.po b/po/ka.po index 7e1ba83..74f3a9d 100644 --- a/po/ka.po +++ b/po/ka.po @@ -57,7 +57,7 @@ msgstr "" msgid "Apport is a crash reporting system that helps us improve the stability of the system." msgstr "" -#: src/extra_settings.rs:84 src/package_manager.rs:104 src/theme.rs:83 +#: src/extra_settings.rs:84 src/package_manager.rs:104 msgid "Next" msgstr "შემდეგი" @@ -99,14 +99,6 @@ msgstr "" msgid "The changes are being applied. Please Wait..." msgstr "მიმდინარეობს ცვლილებების გადატარება. მოითმინეთ..." -#: src/theme.rs:77 -msgid "Color Scheme" -msgstr "ფერების სქემა" - -#: src/theme.rs:78 -msgid "Choose a color scheme for your system." -msgstr "აირჩიეთ თქვენი სისტემის ფერის სქემა." - #: src/welcome.rs:44 msgid "Make your choices, this wizard will take care of everything." msgstr "გააკეთეთ არჩევანი, ოსტატი ყველაფერს მიხედავს." diff --git a/po/ko.po b/po/ko.po index 4f05ffa..929e1d3 100644 --- a/po/ko.po +++ b/po/ko.po @@ -60,7 +60,7 @@ msgstr "Nala는 아름다운 UI/UX를 특징으로 하는 APT의 대체 프론 msgid "Apport is a crash reporting system that helps us improve the stability of the system." msgstr "Apport는 시스템의 안정성을 개선하는 데 도움이 되는 충돌 보고 시스템입니다." -#: src/extra_settings.rs:84 src/package_manager.rs:104 src/theme.rs:83 +#: src/extra_settings.rs:84 src/package_manager.rs:104 msgid "Next" msgstr "다음" @@ -100,14 +100,6 @@ msgstr "Linux 플랫폼을 위한 독립적이고 압축된 실행 가능한 형 msgid "The changes are being applied. Please Wait..." msgstr "변경 사항이 적용되고 있습니다. 잠시 기다려주세요..." -#: src/theme.rs:77 -msgid "Color Scheme" -msgstr "색 구성표" - -#: src/theme.rs:78 -msgid "Choose a color scheme for your system." -msgstr "시스템의 색 구성표를 선택하세요." - #: src/welcome.rs:44 msgid "Make your choices, this wizard will take care of everything." msgstr "선택만 하면 마법사가 모든 것을 알아서 처리합니다." diff --git a/po/nl.po b/po/nl.po index 8f78985..02db7f9 100644 --- a/po/nl.po +++ b/po/nl.po @@ -66,7 +66,7 @@ msgstr "" "Apport is een crashmeldingssysteem die ons helpt om de stabiliteit van het " "systeem te verbeteren." -#: src/extra_settings.rs:84 src/package_manager.rs:104 src/theme.rs:83 +#: src/extra_settings.rs:84 src/package_manager.rs:104 msgid "Next" msgstr "Volgende" @@ -110,14 +110,6 @@ msgstr "" msgid "The changes are being applied. Please Wait..." msgstr "De wijzigingen worden toegepast - even geduld…" -#: src/theme.rs:77 -msgid "Color Scheme" -msgstr "Thema" - -#: src/theme.rs:78 -msgid "Choose a color scheme for your system." -msgstr "Kies het systeemthema dat u wilt gebruiken." - #: src/welcome.rs:44 msgid "Make your choices, this wizard will take care of everything." msgstr "Maak uw eigen keuzes - de instelhulp doet de rest." diff --git a/po/pt_BR.po b/po/pt_BR.po index d9a6f93..d5f1397 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -62,7 +62,7 @@ msgstr "" "Apport é um sistema de relatório de falhas que nos ajuda a melhorar a " "estabilidade do sistema." -#: src/extra_settings.rs:84 src/package_manager.rs:104 src/theme.rs:83 +#: src/extra_settings.rs:84 src/package_manager.rs:104 msgid "Next" msgstr "Próximo" @@ -104,14 +104,6 @@ msgstr "Formato executável independente e compactado para a plataforma Linux." msgid "The changes are being applied. Please Wait..." msgstr "As alterações estão sendo aplicadas. Por favor, aguarde..." -#: src/theme.rs:77 -msgid "Color Scheme" -msgstr "Esquema de cores" - -#: src/theme.rs:78 -msgid "Choose a color scheme for your system." -msgstr "Escolha um esquema de cores para o seu sistema." - #: src/welcome.rs:44 msgid "Make your choices, this wizard will take care of everything." msgstr "Faça suas escolhas, este assistente cuidará de tudo." diff --git a/po/rhino-setup.pot b/po/rhino-setup.pot index 2ea8832..1c9173f 100644 --- a/po/rhino-setup.pot +++ b/po/rhino-setup.pot @@ -54,7 +54,7 @@ msgstr "" msgid "Apport is a crash reporting system that helps us improve the stability of the system." msgstr "" -#: src/extra_settings.rs:84 src/package_manager.rs:104 src/theme.rs:83 +#: src/extra_settings.rs:84 src/package_manager.rs:104 msgid "Next" msgstr "" @@ -94,14 +94,6 @@ msgstr "" msgid "The changes are being applied. Please Wait..." msgstr "" -#: src/theme.rs:77 -msgid "Color Scheme" -msgstr "" - -#: src/theme.rs:78 -msgid "Choose a color scheme for your system." -msgstr "" - #: src/welcome.rs:44 msgid "Make your choices, this wizard will take care of everything." msgstr "" diff --git a/po/ro.po b/po/ro.po index 74e72cb..5f93230 100644 --- a/po/ro.po +++ b/po/ro.po @@ -54,7 +54,7 @@ msgstr "" msgid "Apport is a crash reporting system that helps us improve the stability of the system." msgstr "" -#: src/extra_settings.rs:84 src/package_manager.rs:104 src/theme.rs:83 +#: src/extra_settings.rs:84 src/package_manager.rs:104 msgid "Next" msgstr "" @@ -94,14 +94,6 @@ msgstr "" msgid "The changes are being applied. Please Wait..." msgstr "" -#: src/theme.rs:77 -msgid "Color Scheme" -msgstr "" - -#: src/theme.rs:78 -msgid "Choose a color scheme for your system." -msgstr "" - #: src/welcome.rs:44 msgid "Make your choices, this wizard will take care of everything." msgstr "" diff --git a/po/ru.po b/po/ru.po index 46340bc..28e3428 100644 --- a/po/ru.po +++ b/po/ru.po @@ -60,7 +60,7 @@ msgstr "" "Apport — система сообщений о сбоях, помогающая нам улучшать стабильность " "системы." -#: src/extra_settings.rs:84 src/package_manager.rs:104 src/theme.rs:83 +#: src/extra_settings.rs:84 src/package_manager.rs:104 msgid "Next" msgstr "Далее" @@ -100,14 +100,6 @@ msgstr "Автономный и сжатый формат исполняемых msgid "The changes are being applied. Please Wait..." msgstr "Применение настроек..." -#: src/theme.rs:77 -msgid "Color Scheme" -msgstr "Цветовая схема" - -#: src/theme.rs:78 -msgid "Choose a color scheme for your system." -msgstr "Выберите цветовую схему для системы." - #: src/welcome.rs:44 msgid "Make your choices, this wizard will take care of everything." msgstr "Выберите нужное, а мастер все настроит." diff --git a/po/sv.po b/po/sv.po index dacddf7..574fddd 100644 --- a/po/sv.po +++ b/po/sv.po @@ -63,7 +63,7 @@ msgstr "" "Apport är ett felrapporteringsprogram som hjälper oss att förbättra " "systemets stabilitet." -#: src/extra_settings.rs:84 src/package_manager.rs:104 src/theme.rs:83 +#: src/extra_settings.rs:84 src/package_manager.rs:104 msgid "Next" msgstr "Nästa" @@ -104,14 +104,6 @@ msgstr "Fristående och komprimerade körbara format för Linux Plattform." msgid "The changes are being applied. Please Wait..." msgstr "Inställningarna tillämpas. Var vänligt vänta..." -#: src/theme.rs:77 -msgid "Color Scheme" -msgstr "Färgschema" - -#: src/theme.rs:78 -msgid "Choose a color scheme for your system." -msgstr "Välj ett färgschema för ditt system." - #: src/welcome.rs:44 msgid "Make your choices, this wizard will take care of everything." msgstr "Gör dina val, installationsguiden tar hand om resten." diff --git a/po/uk.po b/po/uk.po index 6243eee..bc78614 100644 --- a/po/uk.po +++ b/po/uk.po @@ -62,7 +62,7 @@ msgstr "" "Apport - це система повідомлень про збої, яка допомагає нам підвищити " "стабільність системи." -#: src/extra_settings.rs:84 src/package_manager.rs:104 src/theme.rs:83 +#: src/extra_settings.rs:84 src/package_manager.rs:104 msgid "Next" msgstr "Далі" @@ -104,14 +104,6 @@ msgstr "Самодостатній і стислий виконуваний фо msgid "The changes are being applied. Please Wait..." msgstr "Зміни застосовуються. Будь ласка, зачекайте..." -#: src/theme.rs:77 -msgid "Color Scheme" -msgstr "Кольорова схема" - -#: src/theme.rs:78 -msgid "Choose a color scheme for your system." -msgstr "Виберіть кольорову схему для вашої системи." - #: src/welcome.rs:44 msgid "Make your choices, this wizard will take care of everything." msgstr "Зробіть свій вибір, цей чарівник подбає про все." diff --git a/po/ur.po b/po/ur.po index d7ee3ba..4a1d487 100644 --- a/po/ur.po +++ b/po/ur.po @@ -54,7 +54,7 @@ msgstr "" msgid "Apport is a crash reporting system that helps us improve the stability of the system." msgstr "" -#: src/extra_settings.rs:84 src/package_manager.rs:104 src/theme.rs:83 +#: src/extra_settings.rs:84 src/package_manager.rs:104 msgid "Next" msgstr "" @@ -94,14 +94,6 @@ msgstr "" msgid "The changes are being applied. Please Wait..." msgstr "" -#: src/theme.rs:77 -msgid "Color Scheme" -msgstr "" - -#: src/theme.rs:78 -msgid "Choose a color scheme for your system." -msgstr "" - #: src/welcome.rs:44 msgid "Make your choices, this wizard will take care of everything." msgstr "" diff --git a/po/zh_Hans.po b/po/zh_Hans.po index 52f038f..a2fdb3c 100644 --- a/po/zh_Hans.po +++ b/po/zh_Hans.po @@ -57,7 +57,7 @@ msgstr "Nala 是 APT 的替代前端,具有漂亮的 UI/UX。" msgid "Apport is a crash reporting system that helps us improve the stability of the system." msgstr "Apport 是崩溃日志上报系统,可以帮助我们改进系统稳定性。" -#: src/extra_settings.rs:84 src/package_manager.rs:104 src/theme.rs:83 +#: src/extra_settings.rs:84 src/package_manager.rs:104 msgid "Next" msgstr "继续" @@ -97,14 +97,6 @@ msgstr "适用于 Linux 平台的独立压缩可执行格式。" msgid "The changes are being applied. Please Wait..." msgstr "正在应用更改。请稍候…" -#: src/theme.rs:77 -msgid "Color Scheme" -msgstr "配色方案" - -#: src/theme.rs:78 -msgid "Choose a color scheme for your system." -msgstr "请为你的系统选择配色方案。" - #: src/welcome.rs:44 msgid "Make your choices, this wizard will take care of everything." msgstr "做出你的选择,安装向导会处理一切。" diff --git a/src/carousel.rs b/src/carousel.rs index 1e0f401..0fa67d6 100644 --- a/src/carousel.rs +++ b/src/carousel.rs @@ -6,14 +6,12 @@ use crate::done::DoneModel; use crate::extra_settings::{ExtraSettingsModel, ExtraSettingsOutput}; use crate::package_manager::{PackageManagerModel, PackageManagerOutput}; use crate::progress::{ProgressInput, ProgressModel, ProgressOutput}; -use crate::theme::{ThemeModel, ThemeOutput}; use crate::welcome::{WelcomeModel, WelcomeOutput}; pub(crate) struct CarouselPagesModel { current: u32, welcome: Controller<WelcomeModel>, - theme: Controller<ThemeModel>, package_manager: Controller<PackageManagerModel>, containers: Controller<ContainersModel>, extra_settings: Controller<ExtraSettingsModel>, @@ -58,7 +56,6 @@ impl SimpleComponent for CarouselPagesModel { set_allow_long_swipes: false, append: model.welcome.widget(), - append: model.theme.widget(), append: model.package_manager.widget(), append: model.containers.widget(), append: model.extra_settings.widget(), @@ -79,13 +76,6 @@ impl SimpleComponent for CarouselPagesModel { .forward(sender.input_sender(), |msg| match msg { WelcomeOutput::NextPage => CarouselInput::NextPage, }), - theme: ThemeModel::builder().launch(()).forward( - sender.input_sender(), - |msg| match msg { - ThemeOutput::NextPage => CarouselInput::NextPage, - ThemeOutput::ErrorOccured => CarouselInput::SkipToErrorPage, - }, - ), package_manager: PackageManagerModel::builder().launch(()).forward( sender.input_sender(), |msg| match msg { diff --git a/src/main.rs b/src/main.rs index bbe2a0b..d7230e9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,7 +23,6 @@ mod done; mod extra_settings; mod package_manager; mod progress; -mod theme; mod welcome; /// Gathers all the commands to be executed from different pages. diff --git a/src/theme.rs b/src/theme.rs deleted file mode 100644 index b7ba6d6..0000000 --- a/src/theme.rs +++ /dev/null @@ -1,216 +0,0 @@ -use std::process::Command; - -use gettextrs::gettext; -use relm4::adw::prelude::*; -use relm4::adw::StyleManager; -use relm4::gtk::gio; -use relm4::{adw, gtk, ComponentParts, ComponentSender, SimpleComponent}; - -pub(crate) struct ThemeModel { - style_manager: StyleManager, -} - -#[derive(Debug)] -pub(crate) enum ThemeInput { - EnableDarkTheme, - EnableLightTheme, -} - -#[derive(Debug)] -pub(crate) enum ThemeOutput { - /// Move to the next page. - NextPage, - /// Move to the error page. - ErrorOccured, -} - -#[relm4::component(pub)] -impl SimpleComponent for ThemeModel { - type Init = (); - type Input = ThemeInput; - type Output = ThemeOutput; - type Widgets = ThemeWidgets; - - view! { - #[root] - gtk::Box { - set_orientation: gtk::Orientation::Vertical, - set_halign: gtk::Align::Fill, - set_valign: gtk::Align::Center, - set_hexpand: true, - - gtk::Box { - set_valign: gtk::Align::Center, - set_spacing: 10, - set_halign: gtk::Align::Center, - - - #[name = "dark_button"] - gtk::CheckButton { - set_tooltip_text: Some("Dark"), - set_halign: gtk::Align::Center, - set_active: true, - - set_css_classes: &["theme-selector", "dark", "card"], - - connect_toggled[sender] => move |btn| { - if btn.is_active() && btn.is_focus() { - sender.input(Self::Input::EnableDarkTheme); - } - } - }, - - gtk::CheckButton { - set_tooltip_text: Some("Default"), - set_halign: gtk::Align::Center, - - // Add `dark_button` to the group, turning both of them mutually exclusive. - set_group: Some(&dark_button), - - set_css_classes: &["theme-selector", "light", "card"], - - connect_toggled[sender] => move |btn| { - if btn.is_active() && btn.is_focus() { - sender.input(Self::Input::EnableLightTheme); - } - } - }, - - }, - - adw::StatusPage { - set_title: &gettext("Color Scheme"), - set_description: Some(&gettext("Choose a color scheme for your system.")), - set_halign: gtk::Align::Fill, - set_valign: gtk::Align::Fill, - set_hexpand: true, - - gtk::Button::with_label(&gettext("Next")) { - set_halign: gtk::Align::Center, - set_css_classes: &["pill", "suggested-action"], - - connect_clicked[sender] => move |_| { - sender.output(Self::Output::NextPage).expect("Failed to send the signal to move to the next page"); - } - } - } - } - } - - fn init( - _init: Self::Init, - root: Self::Root, - sender: ComponentSender<Self>, - ) -> ComponentParts<Self> { - let model = ThemeModel { - style_manager: relm4::main_application() - .downcast_ref::<adw::Application>() - .unwrap() - .style_manager(), - }; - - let widgets = view_output!(); - - ComponentParts { model, widgets } - } - - fn update(&mut self, message: Self::Input, sender: relm4::ComponentSender<Self>) { - let style_manager = &self.style_manager; - match message { - Self::Input::EnableLightTheme => { - tracing::info!("Enabling on Light theme"); - if let Err(error) = Command::new("xfconf-query") - .args([ - "--channel", - "xsettings", - "--property", - "/Net/ThemeName", - "--set", - "Adw", - ]) - .status() - { - tracing::error!("Error enabling light theme: {}", error); - sender.output(Self::Output::ErrorOccured).expect(""); - } - - if let Err(error) = Command::new("xfconf-query") - .args([ - "--channel", - "xfwm4", - "--property", - "/general/theme", - "--set", - "Adw", - ]) - .status() - { - tracing::error!("Error enabling dark theme: {}", error); - sender - .output(Self::Output::ErrorOccured) - .expect("Failed to send the signal to move to the error page"); - } - - style_manager.set_color_scheme(adw::ColorScheme::ForceLight); - - if let Err(error) = gio::Settings::new("org.gnome.desktop.interface") - .set_string("color-scheme", "default") - { - tracing::error!("Unable to change gsettings: {}", error); - sender.output(Self::Output::ErrorOccured).expect( - "Failed to send the signal to move to the - error page", - ); - } - }, - Self::Input::EnableDarkTheme => { - tracing::info!("Enabling Dark theme"); - if let Err(error) = Command::new("xfconf-query") - .args([ - "--channel", - "xsettings", - "--property", - "/Net/ThemeName", - "--set", - "Adw-dark", - ]) - .status() - { - tracing::error!("Error enabling dark theme: {}", error); - sender - .output(Self::Output::ErrorOccured) - .expect("Failed to send the signal to move to the error page"); - } - - if let Err(error) = Command::new("xfconf-query") - .args([ - "--channel", - "xfwm4", - "--property", - "/general/theme", - "--set", - "Adw-dark", - ]) - .status() - { - tracing::error!("Error enabling dark theme: {}", error); - sender - .output(Self::Output::ErrorOccured) - .expect("Failed to send the signal to move to the error page"); - } - - style_manager.set_color_scheme(adw::ColorScheme::ForceDark); - - if let Err(error) = gio::Settings::new("org.gnome.desktop.interface") - .set_string("color-scheme", "prefer-dark") - { - tracing::error!("Unable to change gsettings: {}", error); - sender.output(Self::Output::ErrorOccured).expect( - "Failed to send the signal to move to the - error page", - ); - } - }, - } - } -}