add region exporter to menu, fix a crash in region exporter

This commit is contained in:
Hazim Gazov
2010-06-09 02:12:12 -03:00
parent e9f32dcfbe
commit 29ee9f7a08
4 changed files with 314 additions and 302 deletions

View File

@@ -19,8 +19,7 @@
LLFloaterExportRegion* LLFloaterExportRegion::sInstance = NULL; LLFloaterExportRegion* LLFloaterExportRegion::sInstance = NULL;
LLFloaterExportRegion::LLFloaterExportRegion() LLFloaterExportRegion::LLFloaterExportRegion(const LLSD& unused)
: LLFloater()
{ {
sInstance = this; sInstance = this;
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_export.xml"); LLUICtrlFactory::getInstance()->buildFloater(this, "floater_export.xml");
@@ -54,6 +53,8 @@ void LLFloaterExportRegion::onClickSelectAll(void* user_data)
std::vector<LLScrollListItem*> items = list->getAllData(); std::vector<LLScrollListItem*> items = list->getAllData();
std::vector<LLScrollListItem*>::iterator item_iter = items.begin(); std::vector<LLScrollListItem*>::iterator item_iter = items.begin();
std::vector<LLScrollListItem*>::iterator items_end = items.end(); std::vector<LLScrollListItem*>::iterator items_end = items.end();
if(items.size())
{
bool new_value = !((*item_iter)->getColumn(LIST_CHECKED)->getValue()); bool new_value = !((*item_iter)->getColumn(LIST_CHECKED)->getValue());
for( ; item_iter != items_end; ++item_iter) for( ; item_iter != items_end; ++item_iter)
{ {
@@ -61,6 +62,7 @@ void LLFloaterExportRegion::onClickSelectAll(void* user_data)
item->getColumn(LIST_CHECKED)->setValue(new_value); item->getColumn(LIST_CHECKED)->setValue(new_value);
} }
} }
}
LLSD LLFloaterExportRegion::getLLSD() LLSD LLFloaterExportRegion::getLLSD()
{ {

View File

@@ -7,10 +7,11 @@
#include "llvoavatar.h" #include "llvoavatar.h"
class LLFloaterExportRegion class LLFloaterExportRegion
: public LLFloater : public LLFloater, public LLFloaterSingleton<LLFloaterExportRegion>
{ {
friend class LLUISingleton<LLFloaterExportRegion, VisibilityPolicy<LLFloater> >;
public: public:
LLFloaterExportRegion(); LLFloaterExportRegion(const LLSD& unused);
BOOL postBuild(void); BOOL postBuild(void);
void updateNamesProgress(); void updateNamesProgress();
void receivePrimName(LLViewerObject* object, std::string name); void receivePrimName(LLViewerObject* object, std::string name);

View File

@@ -233,6 +233,7 @@
#include "hgfloatertexteditor.h" #include "hgfloatertexteditor.h"
#include "llfloatermessagelog.h" #include "llfloatermessagelog.h"
#include "llfloatermessagebuilder.h" #include "llfloatermessagebuilder.h"
#include "llfloaterexportregion.h"
// </edit> // </edit>
using namespace LLVOAvatarDefines; using namespace LLVOAvatarDefines;
@@ -5631,6 +5632,10 @@ class LLShowFloater : public view_listener_t
{ {
JCFloaterAreaSearch::toggle(); JCFloaterAreaSearch::toggle();
} }
else if (floater_name == "export region")
{
LLFloaterExportRegion::toggleInstance(LLSD());
}
else if (floater_name == "grid options") else if (floater_name == "grid options")
{ {
LLFloaterBuildOptions::show(NULL); LLFloaterBuildOptions::show(NULL);

View File

@@ -539,6 +539,10 @@
mouse_opaque="true" name="Region/Estate..." width="185"> mouse_opaque="true" name="Region/Estate..." width="185">
<on_click function="ShowFloater" userdata="about region" /> <on_click function="ShowFloater" userdata="about region" />
</menu_item_call> </menu_item_call>
<menu_item_call bottom="-308" enabled="true" height="19" label="Export Region" left="0"
mouse_opaque="true" name="Export Region" width="185">
<on_click function="ShowFloater" userdata="export region" />
</menu_item_call>
<menu_item_separator bottom="-316" enabled="true" height="8" label="-----------" left="0" <menu_item_separator bottom="-316" enabled="true" height="8" label="-----------" left="0"
mouse_opaque="true" name="separator6" width="185" /> mouse_opaque="true" name="separator6" width="185" />
<menu bottom="-554" create_jump_keys="true" drop_shadow="true" enabled="true" <menu bottom="-554" create_jump_keys="true" drop_shadow="true" enabled="true"