mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 01:11:12 +02:00
OPKG-Manager: add opkg manager feature
Signed-off-by: Markus Volk <f_l_k@gmx.net> Signed-off-by: Thilo Graf <dbt@novatux.de> Opkg is a lightweight package management system based on Ipkg. For usage with Neutrino, installed opkg programms opkg-cl and opkg-key are required and can be find in service update menu, otherwise this feature is not available. With this feature it is possible to select packages for install and remove via gui-menu. See also: OPKG-Website - http://bitbucket.org/opkg/opkg for more details. Tuxbox: - http://wiki.tuxbox.org/Neutrino-MP Entwicklungsumgebung#OPKG-Pakete - http://wiki.tuxbox.org.Neutrino-HD Entwicklungsumgebung:OPKG-SystemInstall Buildsystems with opkg support: - http://gitorious.org/neutrino-hd/buildsystem-cs - http://sourceforge.net/p/bstuff/bs4cs/ - Yocto OPKG-Manager Neutrino: - picked from http://gitorious.org/neutrino-mp/martiis-neutrino-mp include shellwindow feature by martii - update License text - add missing icon - use macros to get opkg binaries - use matching buttons in footer, menu button is already reserved to left menu
This commit is contained in:
88
src/gui/opkg_manager.h
Normal file
88
src/gui/opkg_manager.h
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
Based up Neutrino-GUI - Tuxbox-Project
|
||||
Copyright (C) 2001 by Steffen Hehn 'McClean'
|
||||
|
||||
OPKG-Manager Class for Neutrino-GUI
|
||||
|
||||
Implementation:
|
||||
Copyright (C) 2012 T. Graf 'dbt'
|
||||
www.dbox2-tuning.net
|
||||
|
||||
Adaptions:
|
||||
Copyright (C) 2013 martii
|
||||
gitorious.org/neutrino-mp/martiis-neutrino-mp
|
||||
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __OPKG_MANAGER__
|
||||
#define __OPKG_MANAGER__
|
||||
|
||||
#include <gui/widget/menue.h>
|
||||
#include <driver/framebuffer.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
class COPKGManager : public CMenuTarget
|
||||
{
|
||||
private:
|
||||
int width;
|
||||
|
||||
CFrameBuffer *frameBuffer;
|
||||
|
||||
struct pkg;
|
||||
|
||||
std::map<std::string,pkg> pkg_map;
|
||||
std::vector<pkg*> pkg_vec;
|
||||
|
||||
CMenuWidget *menu;
|
||||
CMenuForwarder *upgrade_forwarder;
|
||||
bool list_installed_done;
|
||||
bool list_upgradeable_done;
|
||||
bool installed;
|
||||
bool expert_mode;
|
||||
int menu_offset;
|
||||
|
||||
int execCmd(const char* cmdstr, bool verbose = false, bool acknowledge = false);
|
||||
int execCmd(std::string cmdstr, bool verbose = false, bool acknowledge = false) {
|
||||
return execCmd(cmdstr.c_str(), verbose, acknowledge);
|
||||
};
|
||||
void getPkgData(const int pkg_content_id);
|
||||
static std::string getBlankPkgName(const std::string& line);
|
||||
int showMenu();
|
||||
void updateMenu();
|
||||
void refreshMenu();
|
||||
|
||||
struct pkg {
|
||||
std::string name;
|
||||
std::string desc;
|
||||
bool installed;
|
||||
bool upgradable;
|
||||
CMenuForwarder *forwarder;
|
||||
pkg() { }
|
||||
pkg(std::string &_name, std::string &_desc)
|
||||
: name(_name), desc(_desc), installed(false), upgradable(false) { }
|
||||
};
|
||||
public:
|
||||
COPKGManager();
|
||||
~COPKGManager();
|
||||
|
||||
int exec(CMenuTarget* parent, const std::string & actionKey);
|
||||
static bool hasOpkgSupport();
|
||||
};
|
||||
#endif
|
Reference in New Issue
Block a user