Removed unused update-tab in addons manager.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7264 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2011-01-05 05:38:11 +00:00
parent cd8ea2eead
commit 93daa15d73
5 changed files with 1 additions and 167 deletions

View File

@ -10,8 +10,6 @@
I18N="Section in the addons menu" text="Karts"/>
<icon-button id="tab_track" width="128" height="128" icon="gui/mode_normal.png"
I18N="Section in the addons menu" text="Tracks"/>
<icon-button id="tab_update" width="128" height="128" icon="gui/package.png"
I18N="Section in the addons menu" text="Update"/>
</tabs>
<box proportion="1" width="100%" layout="vertical-row">

View File

@ -339,8 +339,6 @@ supertuxkart_SOURCES = \
states_screens/options_screen_video.hpp \
states_screens/addons_screen.cpp \
states_screens/addons_screen.hpp \
states_screens/addons_update_screen.cpp \
states_screens/addons_update_screen.hpp \
states_screens/race_gui_base.hpp \
states_screens/race_gui.cpp \
states_screens/race_gui.hpp \

View File

@ -28,7 +28,6 @@
#include "guiengine/widgets/ribbon_widget.hpp"
#include "guiengine/CGUISpriteBank.h"
#include "io/file_manager.hpp"
#include "states_screens/addons_update_screen.hpp"
#include "states_screens/dialogs/addons_loading.hpp"
#include "states_screens/state_manager.hpp"
@ -143,9 +142,7 @@ void AddonsScreen::eventCallback(GUIEngine::Widget* widget,
std::string selection = ((GUIEngine::RibbonWidget*)widget)
->getSelectionIDString(PLAYER_ID_GAME_MASTER).c_str();
std::cout << selection << std::endl;
if (selection == "tab_update")
StateManager::get()->replaceTopMostScreen(AddonsUpdateScreen::getInstance());
else if (selection == "tab_track")
if (selection == "tab_track")
{
m_type = "track";
loadList();

View File

@ -1,105 +0,0 @@
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2010 Lucas Baudin
//
// 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 3
// 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, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifdef ADDONS_MANAGER
#include "states_screens/addons_update_screen.hpp"
#include <pthread.h>
#include <sstream>
#include "addons/addons_manager.hpp"
#include "addons/network_http.hpp"
#include "guiengine/widget.hpp"
#include "guiengine/widgets/label_widget.hpp"
#include "guiengine/widgets/ribbon_widget.hpp"
#include "guiengine/widgets.hpp"
#include "io/file_manager.hpp"
#include "states_screens/addons_screen.hpp"
#include "states_screens/state_manager.hpp"
#include "states_screens/dialogs/addons_loading.hpp"
DEFINE_SCREEN_SINGLETON( AddonsUpdateScreen );
// ------------------------------------------------------------------------------------------------------
AddonsUpdateScreen::AddonsUpdateScreen() : Screen("addons_update.stkgui")
{
}
// ------------------------------------------------------------------------------------------------------
void AddonsUpdateScreen::loadedFromFile()
{
}
// ------------------------------------------------------------------------------------------------------
void AddonsUpdateScreen::eventCallback(GUIEngine::Widget* widget,
const std::string& name,
const int playerID)
{
if (name == "back")
{
StateManager::get()->escapePressed();
}
else if (name == "list_addons")
{
GUIEngine::ListWidget* list = getWidget<GUIEngine::ListWidget>("list_addons");
std::string addons = list->getSelectionInternalName();
new AddonsLoading(0.8f, 0.8f, addons);
}
else if (name == "category")
{
std::string selection =
((GUIEngine::RibbonWidget*)widget)->getSelectionIDString(PLAYER_ID_GAME_MASTER);
if (selection == "tab_track")
{
StateManager::get()->replaceTopMostScreen(AddonsScreen::getInstance());
AddonsScreen::getInstance()->loadList();
}
else if (selection == "tab_kart")
{
StateManager::get()->replaceTopMostScreen(AddonsScreen::getInstance());
AddonsScreen::getInstance()->loadList();
}
}
} // eventCallback
// ------------------------------------------------------------------------------------------------------
void AddonsUpdateScreen::init()
{
Screen::init();
getWidget<GUIEngine::RibbonWidget>("category")->select("tab_update", PLAYER_ID_GAME_MASTER);
GUIEngine::ListWidget* w_list = this->getWidget<GUIEngine::ListWidget>("list_addons");
w_list->clear();
for(unsigned int i=0; i<addons_manager->getNumAddons(); i++)
{
const Addon &addon = addons_manager->getAddon(i);
if(addon.isInstalled() && addon.needsUpdate())
{
std::cout << addon.getName() << std::endl;
w_list->addItem(addon.getId(), addon.getName().c_str(), 0);
}
} // for i<getNumAddons
}
#endif

View File

@ -1,54 +0,0 @@
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2010 Lucas Baudin
//
// 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 3
// 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, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifdef ADDONS_MANAGER
#ifndef HEADER_ADDONS_UPDATE_SCREEN_HPP
#define HEADER_ADDONS_UPDATE_SCREEN_HPP
#include "guiengine/screen.hpp"
class Addons;
class AddonsLoading;
namespace GUIEngine { class Widget; }
/**
* \brief Help screen, part 1
* \ingroup states_screens
*/
class AddonsUpdateScreen : public GUIEngine::Screen,
public GUIEngine::ScreenSingleton<AddonsUpdateScreen>
{
friend class GUIEngine::ScreenSingleton<AddonsUpdateScreen>;
AddonsUpdateScreen();
void loadInformations();
public:
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void loadedFromFile();
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void eventCallback(GUIEngine::Widget* widget,
const std::string& name, const int playerID);
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void init();
};
#endif
#endif