From f25831e90ee69ebdebc459a7ac4c7df582e0ac3f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 10 Apr 2021 15:51:30 +0200 Subject: [PATCH] start_wizard: add handling update check --- 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 9a1188782..15cd71a12 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2870,6 +2870,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 3d7ee2f3e..8afb4640d 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2870,6 +2870,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 8398d6caf..b25234672 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 @@ -133,6 +134,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 2ebb83e03..07792501d 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2897,6 +2897,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 80a700b82..b68df15a8 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2897,6 +2897,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",