diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index dfd80dba9..7820cbd6a 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -262,6 +262,8 @@ namespace NLGUI void browseUndo (); // Redo browse: Browse the precedent url undoed. no op if none void browseRedo (); + // disable refresh button + void clearRefresh(); // clear undo/redo void clearUndoRedo(); @@ -270,6 +272,7 @@ namespace NLGUI void setURL(const std::string &url); + int luaClearRefresh(CLuaState &ls); int luaClearUndoRedo(CLuaState &ls); int luaBrowse(CLuaState &ls); int luaRefresh(CLuaState &ls); @@ -287,6 +290,7 @@ namespace NLGUI REFLECT_LUA_METHOD("browse", luaBrowse) REFLECT_LUA_METHOD("refresh", luaRefresh) REFLECT_LUA_METHOD("clearUndoRedo", luaClearUndoRedo) + REFLECT_LUA_METHOD("clearRefresh", luaClearRefresh) REFLECT_LUA_METHOD("removeContent", luaRemoveContent) REFLECT_LUA_METHOD("insertText", luaInsertText) REFLECT_LUA_METHOD("addString", luaAddString) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 032ffb666..6c1444f5c 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -5787,6 +5787,13 @@ namespace NLGUI return false; } + // *************************************************************************** + void CGroupHTML::clearRefresh() + { + _URL.clear(); + updateRefreshButton(); + } + // *************************************************************************** void CGroupHTML::clearUndoRedo() { @@ -5873,7 +5880,7 @@ namespace NLGUI { CCtrlBaseButton *butRefresh = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(_BrowseRefreshButton)); - bool enabled = !_Browsing && !_Connecting; + bool enabled = !_Browsing && !_Connecting && !_URL.empty(); if(butRefresh) butRefresh->setFrozen(!enabled); } @@ -5912,6 +5919,16 @@ namespace NLGUI return true; } + int CGroupHTML::luaClearRefresh(CLuaState &ls) + { + const char *funcName = "clearRefresh"; + CLuaIHM::checkArgCount(ls, funcName, 0); + + clearRefresh(); + + return 0; + } + int CGroupHTML::luaClearUndoRedo(CLuaState &ls) { const char *funcName = "clearUndoRedo";