diff --git a/src/states_screens/addons_screen.cpp b/src/states_screens/addons_screen.cpp index 70433ccfc..91f9dc4bd 100644 --- a/src/states_screens/addons_screen.cpp +++ b/src/states_screens/addons_screen.cpp @@ -93,7 +93,7 @@ void AddonsScreen::loadList() } //remove the text from the widget : "Updating list..." (see l164) - this->update_status->setText(""); + m_update_status->setText(""); this->can_load_list = false; } // ------------------------------------------------------------------------------------------------------ @@ -119,7 +119,7 @@ void AddonsScreen::eventCallback(GUIEngine::Widget* widget, const std::string& n if (name == "category") { std::string selection = ((GUIEngine::RibbonWidget*)widget)->getSelectionIDString(PLAYER_ID_GAME_MASTER).c_str(); - + if (selection == "tab_update") StateManager::get()->replaceTopMostScreen(AddonsUpdateScreen::getInstance()); } } @@ -136,7 +136,7 @@ void AddonsScreen::onUpdate(float delta, irr::video::IVideoDriver* driver) } void AddonsScreen::init() { - this->update_status = this->getWidget("update_status"); + m_update_status = this->getWidget("update_status"); std::cout << "Addons dir:" + file_manager->getAddonsDir() << std::endl; this->type = "track"; GUIEngine::ListWidget* w_list = this->getWidget("list_addons"); @@ -144,6 +144,7 @@ void AddonsScreen::init() //w_list->clear(); std::cout << "icon bank" << std::endl; this->can_load_list = false; + m_update_status->setText(_("Updating the list...")); pthread_t thread; pthread_create(&thread, NULL, &AddonsScreen::downloadList, this); } @@ -157,7 +158,6 @@ void AddonsScreen::tearDown() void * AddonsScreen::downloadList( void * pthis) { AddonsScreen * pt = (AddonsScreen*)pthis; - pt->update_status->setText(_("Updating the list...")); //load all karts... pt->addons = new Addons(); pthread_mutex_lock(&(pt->mutex)); diff --git a/src/states_screens/addons_screen.hpp b/src/states_screens/addons_screen.hpp index 40ff041e1..e51b78959 100644 --- a/src/states_screens/addons_screen.hpp +++ b/src/states_screens/addons_screen.hpp @@ -38,15 +38,15 @@ namespace GUIEngine { class Widget; } class AddonsScreen : public GUIEngine::Screen, public GUIEngine::ScreenSingleton { friend class GUIEngine::ScreenSingleton; - + AddonsScreen(); Addons * addons; AddonsLoading * load; void loadInformations(); /** For the addons list, a package when it is installed. */ irr::gui::STKModifiedSpriteBank* m_icon_bank; - GUIEngine::LabelWidget* update_status; - + GUIEngine::LabelWidget* m_update_status; + public: bool can_load_list; @@ -55,13 +55,13 @@ public: void loadList(); /** \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(); - + /** \brief implement callback from parent class GUIEngine::Screen */ virtual void tearDown(); friend void * startInstall(void *); diff --git a/src/states_screens/dialogs/addons_loading.cpp b/src/states_screens/dialogs/addons_loading.cpp index 28e39a3ab..f9aa4d76e 100644 --- a/src/states_screens/dialogs/addons_loading.cpp +++ b/src/states_screens/dialogs/addons_loading.cpp @@ -47,7 +47,7 @@ AddonsLoading::AddonsLoading(Addons * id, const float w, const float h) : core::rect< s32 > area_left(m_area.getWidth()/2 + 20, 0, m_area.getWidth(), m_area.getHeight()); /*Init the icon here to be able to load a single image*/ - icon = new IconButtonWidget(); + icon = new IconButtonWidget(IconButtonWidget::SCALE_MODE_KEEP_CUSTOM_ASPECT_RATIO, false, /*focusbale*/ false); /* Next and previous button*/ IconButtonWidget * next_previous = new IconButtonWidget(); @@ -133,20 +133,20 @@ void AddonsLoading::loadInfo() - this->back_button = new ButtonWidget(); - /*this->back_button->setLabel(std::string("Back").c_str());*/ - this->back_button->m_text = _("Back"); - this->back_button->m_properties[PROP_ID] = "cancel"; - this->back_button->x = 20; - this->back_button->y = m_area.getHeight()-45; - this->back_button->setParent(m_irrlicht_window); - m_children.push_back(this->back_button); - this->back_button->w = 150; - this->back_button->h = 35; - this->back_button->add(); + m_back_button = new ButtonWidget(); + /*m_back_button->setLabel(std::string("Back").c_str());*/ + m_back_button->m_text = _("Back"); + m_back_button->m_properties[PROP_ID] = "cancel"; + m_back_button->x = 20; + m_back_button->y = m_area.getHeight()-45; + m_back_button->setParent(m_irrlicht_window); + m_children.push_back(m_back_button); + m_back_button->w = 150; + m_back_button->h = 35; + m_back_button->add(); this->install_button = new ButtonWidget(); - /*this->back_button->setLabel(std::string("Back").c_str());*/ + /*m_back_button->setLabel(std::string("Back").c_str());*/ if(this->addons->IsInstalled() == "yes") this->install_button->m_text = _("Uninstall"); else @@ -183,7 +183,7 @@ GUIEngine::EventPropagation AddonsLoading::processEvent(const std::string& event } if(eventSource == "install") { - this->back_button->setDeactivated(); + m_back_button->setDeactivated(); this->install_button->setDeactivated(); pthread_t thread; pthread_create(&thread, NULL, &AddonsLoading::startInstall, this); diff --git a/src/states_screens/dialogs/addons_loading.hpp b/src/states_screens/dialogs/addons_loading.hpp index 905c130b6..b5d48f899 100644 --- a/src/states_screens/dialogs/addons_loading.hpp +++ b/src/states_screens/dialogs/addons_loading.hpp @@ -34,7 +34,7 @@ private: GUIEngine::LabelWidget * description; GUIEngine::LabelWidget * version; GUIEngine::LabelWidget * author; - GUIEngine::ButtonWidget * back_button; + GUIEngine::ButtonWidget * m_back_button; GUIEngine::ButtonWidget * install_button; GUIEngine::IconButtonWidget * icon; static void * startInstall(void*);