diff options
author | James Cook <james@lindenlab.com> | 2009-07-07 00:53:05 +0000 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2009-07-07 00:53:05 +0000 |
commit | 52aeaa32841e7d0b37abab0a2a2540c2be2f16b7 (patch) | |
tree | d8f5c98644029dd289a97aa0d8b55c5a6200c214 /indra/newview/llfloateruipreview.cpp | |
parent | 2c722655bd6701a3dc8518c6518c51f538765dcd (diff) |
Merge skinning-14 to viewer-2, including refactoring many floaters to register them with LLFloaterReg, support for introspection of ParamBlock based UI widgets to dump XML schema, splitting llfolderview.cpp into three separate files to unravel dependencies and skeleton for for LLListView widget. Resolved conflicts in these files:
lldraghandle.h, lluictrl.h, llchiclet.cpp, llfolderview.h/cpp, lliinventorybridge.cpp, llpanelpicks.cpp, llviewermenu.cpp, floater_mute.xml, floater_preferences.xml, notifications.xml, panel_preferences_audio.xml, panel_preferences_graphics1.xml, panel_region_general.xml
svn merge -r124961:126284 svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/skinning-14
Diffstat (limited to 'indra/newview/llfloateruipreview.cpp')
-rw-r--r-- | indra/newview/llfloateruipreview.cpp | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 34db895b52..e7304ea5a9 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -264,6 +264,8 @@ BOOL LLFloaterUIPreview::postBuild() main_panel_tmp->getChild<LLButton>("save_floater")->setClickedCallback(onClickSaveFloater, (void*)&PRIMARY_FLOATER); main_panel_tmp->getChild<LLButton>("save_all_floaters")->setClickedCallback(onClickSaveAll, (void*)&PRIMARY_FLOATER); + getChild<LLButton>("export_schema")->setClickedCallback(boost::bind(&LLFloaterUIPreview::onClickExportSchema, this)); + // get pointers to text fields mEditorPathTextBox = editor_panel_tmp->getChild<LLLineEditor>("executable_path_field"); mEditorArgsTextBox = editor_panel_tmp->getChild<LLLineEditor>("executable_args_field"); @@ -354,6 +356,34 @@ void LLFloaterUIPreview::onLanguageComboSelect(LLUICtrl* ctrl) } +void LLFloaterUIPreview::onClickExportSchema() +{ + std::string template_path = gDirUtilp->getExpandedFilename(LL_PATH_DEFAULT_SKIN, "xui", "schema"); + + typedef LLWidgetTypeRegistry::Registrar::registry_map_t::const_iterator registry_it; + registry_it end_it = LLWidgetTypeRegistry::defaultRegistrar().endItems(); + for(registry_it it = LLWidgetTypeRegistry::defaultRegistrar().beginItems(); + it != end_it; + ++it) + { + std::string widget_name = it->first; + const LLInitParam::BaseBlock& block = + (*LLDefaultParamBlockRegistry::instance().getValue(*LLWidgetTypeRegistry::instance().getValue(widget_name)))(); + LLXMLNodePtr root_nodep = new LLXMLNode(); + LLRNGWriter().writeRNG(widget_name, root_nodep, block, "http://www.lindenlab.com/xui"); + + std::string file_name(template_path + gDirUtilp->getDirDelimiter() + widget_name + ".rng"); + + LLFILE* rng_file = LLFile::fopen(file_name.c_str(), "w"); + { + LLXMLNode::writeHeaderToFile(rng_file); + root_nodep->writeToFile(rng_file); + } + fclose(rng_file); + } +} + + // Close click handler -- delete my displayed floater if it exists void LLFloaterUIPreview::onClose(bool app_quitting) { @@ -614,7 +644,7 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save) if (save) { LLXMLNodePtr menu_write = new LLXMLNode(); - LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>(path, gMenuHolder, menu_write); + LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>(path, gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance(), menu_write); if (!menu_write->isNull()) { @@ -779,6 +809,10 @@ void LLFloaterUIPreview::onClickEditFloater(void*) { exe_path_char = path_in_textfield.c_str(); } + else if (!LLUI::sSettingGroups["config"]->getString("XUIEditor").empty()) + { + exe_path_char = LLUI::sSettingGroups["config"]->getString("XUIEditor").c_str(); + } else // otherwise use the path specified by the environment variable { exe_path_char = getenv("LL_XUI_EDITOR"); |