From 374991dddf7e662da44c77720adc6fc0ed6a64de Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 10 Apr 2021 22:14:39 +0200 Subject: [PATCH] start_wizard: add handling update check Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/eb7ebb06f932090bdfbc665450131a7463665540 Author: Thilo Graf Date: 2021-04-10 (Sat, 10 Apr 2021) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 3 +++ data/locale/english.locale | 3 +++ src/gui/start_wizard.cpp | 19 ++++++++++++++++++- src/system/locals.h | 3 +++ src/system/locals_intern.h | 3 +++ 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 246439949..cb14df1af 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -3029,6 +3029,9 @@ webtv.xml.auto WebTV-Dateien automatisch laden window_size Fenstergröße in % wizard.initial_settings Grundeinstellungen gefunden wizard.install_settings Kanalliste für Astra 19.2°E installieren? +wizard.message_check_for_updates Aktualisierung +wizard.message_check_for_updates_ask_enable Soll zukünftig automatisch auf Aktualisierungen geprüft werden?\nDie Prüfung erfolgt dann automatisch bei jedem Start.\nDie Prüfung kann jederzeit auch manuell erfolgen und in den Aktualsierungseinstellungen angepasst werden. +wizard.message_check_for_updates_ask_now Jetzt auf Aktualisierungen prüfen? wizard.setup Erste Installation wizard.setup_advanced Erweitert wizard.setup_easy Einfach diff --git a/data/locale/english.locale b/data/locale/english.locale index 6e647f6f3..69cd83441 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -3029,6 +3029,9 @@ webtv.xml.auto Auto-load WebTV files window_size Window size in % wizard.initial_settings Initial settings found wizard.install_settings Do you want to install channels for Astra 19.2°E? +wizard.message_check_for_updates Update +wizard.message_check_for_updates_ask_enable Should updates be checked automatically in future? The check up will run automatically at background on each startup. The check up can also be launched manually at any time and can be adjusted by the update settings. +wizard.message_check_for_updates_ask_now Now check for updates? wizard.setup First installation wizard.setup_advanced Advanced wizard.setup_easy Easy diff --git a/src/gui/start_wizard.cpp b/src/gui/start_wizard.cpp index c98737016..6c640bfd6 100644 --- a/src/gui/start_wizard.cpp +++ b/src/gui/start_wizard.cpp @@ -48,10 +48,11 @@ #include "scan_setup.h" #include "settings_manager.h" #include "videosettings.h" +#include "opkg_manager.h" #include #include -#include +#include "widget/msgbox.h" #include @@ -138,6 +139,22 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/) res = CNetworkSetup::getInstance()->exec(NULL, ""); CNetworkSetup::getInstance()->setWizardMode(SNeutrinoSettings::WIZARD_OFF); } + + //package update check + if(advanced && res != menu_return::RETURN_EXIT_ALL) + { + COPKGManager man(SNeutrinoSettings::WIZARD_START); + if (man.hasOpkgSupport()) + { + int msg = ShowMsg(LOCALE_WIZARD_MESSAGE_CHECK_FOR_UPDATES, LOCALE_WIZARD_MESSAGE_CHECK_FOR_UPDATES_ASK_NOW, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450); + if (msg == CMsgBox::mbrYes) + res = man.exec(NULL, ""); + msg = ShowMsg(LOCALE_WIZARD_MESSAGE_CHECK_FOR_UPDATES, LOCALE_WIZARD_MESSAGE_CHECK_FOR_UPDATES_ASK_ENABLE, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450); + if (msg == CMsgBox::mbrYes) + g_settings.softupdate_autocheck_packages = true; + } + } + bool init_settings = false; if (CFEManager::getInstance()->haveSat()) init_settings = file_exists(CONFIGDIR "/initial/"); diff --git a/src/system/locals.h b/src/system/locals.h index 1b31ef95a..75ba1d1dd 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -3056,6 +3056,9 @@ typedef enum LOCALE_WINDOW_SIZE, LOCALE_WIZARD_INITIAL_SETTINGS, LOCALE_WIZARD_INSTALL_SETTINGS, + LOCALE_WIZARD_MESSAGE_CHECK_FOR_UPDATES, + LOCALE_WIZARD_MESSAGE_CHECK_FOR_UPDATES_ASK_ENABLE, + LOCALE_WIZARD_MESSAGE_CHECK_FOR_UPDATES_ASK_NOW, LOCALE_WIZARD_SETUP, LOCALE_WIZARD_SETUP_ADVANCED, LOCALE_WIZARD_SETUP_EASY, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 3e0da8e3d..c48fc61bf 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -3056,6 +3056,9 @@ const char * locale_real_names[] = "window_size", "wizard.initial_settings", "wizard.install_settings", + "wizard.message_check_for_updates", + "wizard.message_check_for_updates_ask_enable", + "wizard.message_check_for_updates_ask_now", "wizard.setup", "wizard.setup_advanced", "wizard.setup_easy",