diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 64ebc6ac9..e6d1fc937 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -105,6 +105,7 @@ libneutrino_gui_a_SOURCES = \ timeosd.cpp \ update.cpp \ update_check.cpp \ + update_check_packages.cpp \ update_menue.cpp \ update_settings.cpp \ user_menue.cpp \ diff --git a/src/gui/update_check_packages.cpp b/src/gui/update_check_packages.cpp new file mode 100644 index 000000000..ed00838ab --- /dev/null +++ b/src/gui/update_check_packages.cpp @@ -0,0 +1,62 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + Update check for Neutrino-GUI + + Copyright (C) 2020 T. Graf 'dbt' + + License: GPL + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "update_check_packages.h" +#include "opkg_manager.h" +#include "widget/msgbox.h" +#include +#include + +CUpdateCheck::CUpdateCheck():CComponentsTimer(1000*60/*1000*6*60*/) +{ + tm_thread_name = "n:update_check"; + + //init slot for package check + OnTimer.connect(sigc::mem_fun(*this, &CUpdateCheck::check4PackageUpdates)); +} + +CUpdateCheck* CUpdateCheck::getInstance() +{ + static CUpdateCheck * uc = NULL; + if (!uc) + uc = new CUpdateCheck(); + + return uc; +} + +void CUpdateCheck::check4PackageUpdates() +{ + if (!g_settings.softupdate_autocheck) + return; + + COPKGManager man; + if (!man.hasOpkgSupport()) + return; + + man.setUpdateCheckResult(false); +} diff --git a/src/gui/update_check_packages.h b/src/gui/update_check_packages.h new file mode 100644 index 000000000..9be74c6c2 --- /dev/null +++ b/src/gui/update_check_packages.h @@ -0,0 +1,42 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + Update check for Neutrino-GUI + + Copyright (C) 2020 T. Graf 'dbt' + + License: GPL + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#ifndef __UPDATE_CHECK_PACKAGES_H__ +#define __UPDATE_CHECK_PACKAGES_H__ + +#include "components/cc_timer.h" + +class CUpdateCheck : public CComponentsTimer +{ + private: + void check4PackageUpdates(); + + public: + CUpdateCheck(); + virtual ~CUpdateCheck(){}; + static CUpdateCheck* getInstance(); + void startThread() {initThread();} +}; + +#endif // __UPDATE_CHECK_PACKAGES_H__