diff --git a/changelog.txt b/changelog.txt index 1fd3e0b2c..d1951cb7f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,7 +1,10 @@ -January 8, 2012 +January 26, 2013 +-Added "Reload" option to the menu. This option reloads all game data. + +January 8, 2013 -Made a value of zero for "list selected color" mean no change. -January 6, 2012 +January 6, 2013 -Added tag support. December 20, 2012 diff --git a/src/components/GuiGameList.h b/src/components/GuiGameList.h index 4e9867ed6..a6cefda90 100644 --- a/src/components/GuiGameList.h +++ b/src/components/GuiGameList.h @@ -14,7 +14,7 @@ //This is where the magic happens - GuiGameList is the parent of almost every graphical element in ES at the moment. //It has a GuiList child that handles the game list, a GuiTheme that handles the theming system, and a GuiImage for game images. -class GuiGameList : GuiComponent +class GuiGameList : public GuiComponent { public: GuiGameList(bool useDetail = false); diff --git a/src/components/GuiMenu.cpp b/src/components/GuiMenu.cpp index 23d42330a..70fd19135 100644 --- a/src/components/GuiMenu.cpp +++ b/src/components/GuiMenu.cpp @@ -2,11 +2,13 @@ #include #include #include "../Log.h" +#include "../SystemData.h" +#include "GuiGameList.h" //defined in main.cpp extern bool DONTSHOWEXIT; -GuiMenu::GuiMenu(GuiComponent* parent) +GuiMenu::GuiMenu(GuiGameList* parent) { mParent = parent; parent->pause(); @@ -58,6 +60,11 @@ void GuiMenu::executeCommand(std::string command) SDL_Event* event = new SDL_Event(); event->type = SDL_QUIT; SDL_PushEvent(event); + }else if(command == "es_reload") + { + //reload the game list + SystemData::loadConfig(); + mParent->setSystemId(0); }else{ if(system(command.c_str()) != 0) { @@ -78,6 +85,8 @@ void GuiMenu::populateList() mList->addObject("Restart", "sudo shutdown -r now", 0x0000FFFF); mList->addObject("Shutdown", "sudo shutdown -h now", 0x0000FFFF); + mList->addObject("Reload", "es_reload", 0x0000FFFF); + if(!DONTSHOWEXIT) mList->addObject("Exit", "exit", 0xFF0000FF); //a special case; pushes an SDL quit event to the event stack instead of being called by system() } diff --git a/src/components/GuiMenu.h b/src/components/GuiMenu.h index 981383ebc..b919c9bad 100644 --- a/src/components/GuiMenu.h +++ b/src/components/GuiMenu.h @@ -4,18 +4,20 @@ #include "../GuiComponent.h" #include "GuiList.h" +class GuiGameList; + //This is a very simple menu that is opened by pressing the Menu key. class GuiMenu : public GuiComponent { public: - GuiMenu(GuiComponent* parent); + GuiMenu(GuiGameList* parent); ~GuiMenu(); void onInput(InputManager::InputButton button, bool keyDown); void onRender(); private: - GuiComponent* mParent; + GuiGameList* mParent; GuiList* mList; void populateList();