From 93daa15d73802c3b0f6486e8d963705ed7cf873f Mon Sep 17 00:00:00 2001 From: hikerstk <hikerstk@178a84e3-b1eb-0310-8ba1-8eac791a3b58> Date: Wed, 5 Jan 2011 05:38:11 +0000 Subject: [PATCH] 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 --- data/gui/addons.stkgui | 2 - src/Makefile.am | 2 - src/states_screens/addons_screen.cpp | 5 +- src/states_screens/addons_update_screen.cpp | 105 -------------------- src/states_screens/addons_update_screen.hpp | 54 ---------- 5 files changed, 1 insertion(+), 167 deletions(-) delete mode 100644 src/states_screens/addons_update_screen.cpp delete mode 100644 src/states_screens/addons_update_screen.hpp diff --git a/data/gui/addons.stkgui b/data/gui/addons.stkgui index 07691ee18..ad0b0579b 100644 --- a/data/gui/addons.stkgui +++ b/data/gui/addons.stkgui @@ -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"> diff --git a/src/Makefile.am b/src/Makefile.am index 5f7f9368d..0bf768b01 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 \ diff --git a/src/states_screens/addons_screen.cpp b/src/states_screens/addons_screen.cpp index 9c92d61fd..d09f1f9f7 100644 --- a/src/states_screens/addons_screen.cpp +++ b/src/states_screens/addons_screen.cpp @@ -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(); diff --git a/src/states_screens/addons_update_screen.cpp b/src/states_screens/addons_update_screen.cpp deleted file mode 100644 index b419fe6a0..000000000 --- a/src/states_screens/addons_update_screen.cpp +++ /dev/null @@ -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 diff --git a/src/states_screens/addons_update_screen.hpp b/src/states_screens/addons_update_screen.hpp deleted file mode 100644 index 8789c32dd..000000000 --- a/src/states_screens/addons_update_screen.hpp +++ /dev/null @@ -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