Commits

nat_linden  committed 5d73bdf

SWAT-481: add event wrapper for LLFloaterReg::instanceVisible()

  • Participants
  • Parent commits 0137d08

Comments (0)

Files changed (2)

File indra/llui/llfloaterreglistener.cpp

         "Ask to toggle the state of the floater specified in [\"name\"]",
         &LLFloaterRegListener::toggleInstance,
         requiredName);
+    add("instanceVisible",
+        "Return on [\"reply\"] an event whose [\"visible\"] indicates the visibility "
+        "of the floater specified in [\"name\"]",
+        &LLFloaterRegListener::instanceVisible,
+        requiredName);
     LLSD requiredNameButton;
     requiredNameButton["name"] = LLSD();
     requiredNameButton["button"] = LLSD();
     LLFloaterReg::toggleInstance(event["name"], event["key"]);
 }
 
+void LLFloaterRegListener::instanceVisible(const LLSD& event) const
+{
+    LLReqID reqID(event);
+    LLSD reply(reqID.makeResponse());
+    reply["visible"] = LLFloaterReg::instanceVisible(event["name"], event["key"]);
+    LLEventPumps::instance().obtain(event["reply"]).post(reply);
+}
+
 void LLFloaterRegListener::clickButton(const LLSD& event) const
 {
     // If the caller requests a reply, build the reply.

File indra/llui/llfloaterreglistener.h

     void showInstance(const LLSD& event) const;
     void hideInstance(const LLSD& event) const;
     void toggleInstance(const LLSD& event) const;
+    void instanceVisible(const LLSD& event) const;
     void clickButton(const LLSD& event) const;
 };