diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index 084bf07bc..d8ba77a38 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -43,7 +43,7 @@ #include #include #include - +#include #include #include #include @@ -135,6 +135,27 @@ int COPKGManager::exec(CMenuTarget* parent, const string &actionKey) updateMenu(); return res; } + if (actionKey == "local_package") { + if (parent) + parent->hide(); + CFileFilter fileFilter; + fileFilter.addFilter("opk"); + + CFileBrowser fileBrowser; + fileBrowser.Filter = &fileFilter; + + if (fileBrowser.exec(g_settings.update_dir.c_str())) + { + string pgk_name = fileBrowser.getSelectedFile()->Name; + int r = execCmd(pkg_types[OM_INSTALL] + pgk_name, true, true); + if (r) { + showError(g_Locale->getText(LOCALE_OPKG_FAILURE_INSTALL), strerror(errno), pgk_name); + } else + installed = true; + refreshMenu(); + } + return res; + } if(actionKey == pkg_types[OM_UPGRADE]) { if (parent) parent->hide(); @@ -298,9 +319,16 @@ int COPKGManager::showMenu() menu = new CMenuWidget(g_Locale->getText(LOCALE_SERVICEMENU_UPDATE), NEUTRINO_ICON_UPDATE, width, MN_WIDGET_ID_SOFTWAREUPDATE); menu->addIntroItems(LOCALE_OPKG_TITLE, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_BACK, CMenuWidget::BRIEF_HINT_YES); + //upgrade all installed packages upgrade_forwarder = new CMenuForwarder(LOCALE_OPKG_UPGRADE, true, NULL , this, pkg_types[OM_UPGRADE].c_str(), CRCInput::RC_red); upgrade_forwarder->setHint(NEUTRINO_ICON_HINT_SW_UPDATE, LOCALE_MENU_HINT_OPKG_UPGRADE); menu->addItem(upgrade_forwarder); + + //select and install local package + CMenuForwarder *local; + local = new CMenuForwarder("Install Local Package" , true, NULL, this, "local_package", CRCInput::RC_green); + menu->addItem(local); + menu->addItem(GenericMenuSeparatorLine); menu_offset = menu->getItemsCount();