diff options
author | Jacek Antonelli | 2008-08-15 23:45:07 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:07 -0500 |
commit | 8465910c79b8e746e04fd581cca2d60399e569b9 (patch) | |
tree | f43fec3e83c46e0d6190dca923d6fb268b52ffdd /linden/indra/newview/llpreviewscript.cpp | |
parent | Second Life viewer sources 1.18.2.1 (diff) | |
download | meta-impy-8465910c79b8e746e04fd581cca2d60399e569b9.zip meta-impy-8465910c79b8e746e04fd581cca2d60399e569b9.tar.gz meta-impy-8465910c79b8e746e04fd581cca2d60399e569b9.tar.bz2 meta-impy-8465910c79b8e746e04fd581cca2d60399e569b9.tar.xz |
Second Life viewer sources 1.18.3.2-RC
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llpreviewscript.cpp | 46 |
1 files changed, 39 insertions, 7 deletions
diff --git a/linden/indra/newview/llpreviewscript.cpp b/linden/indra/newview/llpreviewscript.cpp index a2ea141..cce672b 100644 --- a/linden/indra/newview/llpreviewscript.cpp +++ b/linden/indra/newview/llpreviewscript.cpp | |||
@@ -291,6 +291,7 @@ LLScriptEdCore::LLScriptEdCore( | |||
291 | const LLViewHandle& floater_handle, | 291 | const LLViewHandle& floater_handle, |
292 | void (*load_callback)(void*), | 292 | void (*load_callback)(void*), |
293 | void (*save_callback)(void*, BOOL), | 293 | void (*save_callback)(void*, BOOL), |
294 | void (*search_replace_callback) (void* userdata), | ||
294 | void* userdata, | 295 | void* userdata, |
295 | S32 bottom_pad) | 296 | S32 bottom_pad) |
296 | : | 297 | : |
@@ -300,6 +301,7 @@ LLScriptEdCore::LLScriptEdCore( | |||
300 | mEditor( NULL ), | 301 | mEditor( NULL ), |
301 | mLoadCallback( load_callback ), | 302 | mLoadCallback( load_callback ), |
302 | mSaveCallback( save_callback ), | 303 | mSaveCallback( save_callback ), |
304 | mSearchReplaceCallback( search_replace_callback ), | ||
303 | mUserdata( userdata ), | 305 | mUserdata( userdata ), |
304 | mForceClose( FALSE ), | 306 | mForceClose( FALSE ), |
305 | mLastHelpToken(NULL), | 307 | mLastHelpToken(NULL), |
@@ -1028,7 +1030,9 @@ BOOL LLScriptEdCore::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) | |||
1028 | { | 1030 | { |
1029 | if(getVisible() && getEnabled()) | 1031 | if(getVisible() && getEnabled()) |
1030 | { | 1032 | { |
1031 | if(('S' == key) && (MASK_CONTROL == (mask & MASK_CONTROL))) | 1033 | bool just_control = MASK_CONTROL == (mask & MASK_MODIFIERS); |
1034 | |||
1035 | if(('S' == key) && just_control) | ||
1032 | { | 1036 | { |
1033 | if(mSaveCallback) | 1037 | if(mSaveCallback) |
1034 | { | 1038 | { |
@@ -1038,6 +1042,16 @@ BOOL LLScriptEdCore::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) | |||
1038 | 1042 | ||
1039 | return TRUE; | 1043 | return TRUE; |
1040 | } | 1044 | } |
1045 | |||
1046 | if(('F' == key) && just_control) | ||
1047 | { | ||
1048 | if(mSearchReplaceCallback) | ||
1049 | { | ||
1050 | mSearchReplaceCallback(mUserdata); | ||
1051 | } | ||
1052 | |||
1053 | return TRUE; | ||
1054 | } | ||
1041 | } | 1055 | } |
1042 | return FALSE; | 1056 | return FALSE; |
1043 | } | 1057 | } |
@@ -1071,6 +1085,7 @@ void* LLPreviewLSL::createScriptEdPanel(void* userdata) | |||
1071 | self->mViewHandle, | 1085 | self->mViewHandle, |
1072 | LLPreviewLSL::onLoad, | 1086 | LLPreviewLSL::onLoad, |
1073 | LLPreviewLSL::onSave, | 1087 | LLPreviewLSL::onSave, |
1088 | LLPreviewLSL::onSearchReplace, | ||
1074 | self, | 1089 | self, |
1075 | 0); | 1090 | 0); |
1076 | 1091 | ||
@@ -1220,6 +1235,13 @@ void LLPreviewLSL::open() /*Flawfinder: ignore*/ | |||
1220 | LLFloater::open(); /*Flawfinder: ignore*/ | 1235 | LLFloater::open(); /*Flawfinder: ignore*/ |
1221 | } | 1236 | } |
1222 | 1237 | ||
1238 | void LLPreviewLSL::onSearchReplace(void* userdata) | ||
1239 | { | ||
1240 | LLPreviewLSL* self = (LLPreviewLSL*)userdata; | ||
1241 | LLScriptEdCore* sec = self->mScriptEd; | ||
1242 | LLFloaterScriptSearch::show(sec); | ||
1243 | } | ||
1244 | |||
1223 | // static | 1245 | // static |
1224 | void LLPreviewLSL::onLoad(void* userdata) | 1246 | void LLPreviewLSL::onLoad(void* userdata) |
1225 | { | 1247 | { |
@@ -1386,7 +1408,7 @@ void LLPreviewLSL::uploadAssetLegacy(const std::string& filename, | |||
1386 | 1408 | ||
1387 | 1409 | ||
1388 | // static | 1410 | // static |
1389 | void LLPreviewLSL::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32 status) // StoreAssetData callback (fixed) | 1411 | void LLPreviewLSL::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed) |
1390 | { | 1412 | { |
1391 | LLScriptSaveInfo* info = reinterpret_cast<LLScriptSaveInfo*>(user_data); | 1413 | LLScriptSaveInfo* info = reinterpret_cast<LLScriptSaveInfo*>(user_data); |
1392 | if(0 == status) | 1414 | if(0 == status) |
@@ -1435,7 +1457,7 @@ void LLPreviewLSL::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32 | |||
1435 | } | 1457 | } |
1436 | 1458 | ||
1437 | // static | 1459 | // static |
1438 | void LLPreviewLSL::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_data, S32 status) // StoreAssetData callback (fixed) | 1460 | void LLPreviewLSL::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed) |
1439 | { | 1461 | { |
1440 | LLUUID* instance_uuid = (LLUUID*)user_data; | 1462 | LLUUID* instance_uuid = (LLUUID*)user_data; |
1441 | LLPreviewLSL* self = NULL; | 1463 | LLPreviewLSL* self = NULL; |
@@ -1474,7 +1496,7 @@ void LLPreviewLSL::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_d | |||
1474 | 1496 | ||
1475 | // static | 1497 | // static |
1476 | void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAssetType::EType type, | 1498 | void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAssetType::EType type, |
1477 | void* user_data, S32 status) | 1499 | void* user_data, S32 status, LLExtStat ext_status) |
1478 | { | 1500 | { |
1479 | lldebugs << "LLPreviewLSL::onLoadComplete: got uuid " << asset_uuid | 1501 | lldebugs << "LLPreviewLSL::onLoadComplete: got uuid " << asset_uuid |
1480 | << llendl; | 1502 | << llendl; |
@@ -1579,6 +1601,7 @@ void* LLLiveLSLEditor::createScriptEdPanel(void* userdata) | |||
1579 | self->mViewHandle, | 1601 | self->mViewHandle, |
1580 | &LLLiveLSLEditor::onLoad, | 1602 | &LLLiveLSLEditor::onLoad, |
1581 | &LLLiveLSLEditor::onSave, | 1603 | &LLLiveLSLEditor::onSave, |
1604 | &LLLiveLSLEditor::onSearchReplace, | ||
1582 | self, | 1605 | self, |
1583 | 0); | 1606 | 0); |
1584 | 1607 | ||
@@ -1793,7 +1816,7 @@ void LLLiveLSLEditor::loadAsset(BOOL is_new) | |||
1793 | // static | 1816 | // static |
1794 | void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id, | 1817 | void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id, |
1795 | LLAssetType::EType type, | 1818 | LLAssetType::EType type, |
1796 | void* user_data, S32 status) | 1819 | void* user_data, S32 status, LLExtStat ext_status) |
1797 | { | 1820 | { |
1798 | lldebugs << "LLLiveLSLEditor::onLoadComplete: got uuid " << asset_id | 1821 | lldebugs << "LLLiveLSLEditor::onLoadComplete: got uuid " << asset_id |
1799 | << llendl; | 1822 | << llendl; |
@@ -1976,6 +1999,15 @@ void LLLiveLSLEditor::draw() | |||
1976 | } | 1999 | } |
1977 | } | 2000 | } |
1978 | 2001 | ||
2002 | |||
2003 | void LLLiveLSLEditor::onSearchReplace(void* userdata) | ||
2004 | { | ||
2005 | LLLiveLSLEditor* self = (LLLiveLSLEditor*)userdata; | ||
2006 | |||
2007 | LLScriptEdCore* sec = self->mScriptEd; | ||
2008 | LLFloaterScriptSearch::show(sec); | ||
2009 | } | ||
2010 | |||
1979 | struct LLLiveLSLSaveData | 2011 | struct LLLiveLSLSaveData |
1980 | { | 2012 | { |
1981 | LLLiveLSLSaveData(const LLUUID& id, const LLViewerInventoryItem* item, BOOL active); | 2013 | LLLiveLSLSaveData(const LLUUID& id, const LLViewerInventoryItem* item, BOOL active); |
@@ -2189,7 +2221,7 @@ void LLLiveLSLEditor::uploadAssetLegacy(const std::string& filename, | |||
2189 | runningCheckbox->setEnabled(TRUE); | 2221 | runningCheckbox->setEnabled(TRUE); |
2190 | } | 2222 | } |
2191 | 2223 | ||
2192 | void LLLiveLSLEditor::onSaveTextComplete(const LLUUID& asset_uuid, void* user_data, S32 status) // StoreAssetData callback (fixed) | 2224 | void LLLiveLSLEditor::onSaveTextComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed) |
2193 | { | 2225 | { |
2194 | LLLiveLSLSaveData* data = (LLLiveLSLSaveData*)user_data; | 2226 | LLLiveLSLSaveData* data = (LLLiveLSLSaveData*)user_data; |
2195 | 2227 | ||
@@ -2219,7 +2251,7 @@ void LLLiveLSLEditor::onSaveTextComplete(const LLUUID& asset_uuid, void* user_da | |||
2219 | } | 2251 | } |
2220 | 2252 | ||
2221 | 2253 | ||
2222 | void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_data, S32 status) // StoreAssetData callback (fixed) | 2254 | void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed) |
2223 | { | 2255 | { |
2224 | LLLiveLSLSaveData* data = (LLLiveLSLSaveData*)user_data; | 2256 | LLLiveLSLSaveData* data = (LLLiveLSLSaveData*)user_data; |
2225 | if(!data) | 2257 | if(!data) |