Fixup LLScrollListCtrl::setCommentText, and incorrect behaviors with script editor and bulk perm editor pertaining to setCommentText inherited from V3.
This commit is contained in:
@@ -752,7 +752,12 @@ LLScrollListCtrl::LLScrollListCtrl(const std::string& name, const LLRect& rect,
|
||||
addChild(mBorder);
|
||||
}
|
||||
|
||||
|
||||
LLTextBox* textBox = new LLTextBox("comment_text",mItemListRect,std::string());
|
||||
textBox->setBorderVisible(false);
|
||||
textBox->setFollowsAll();
|
||||
textBox->setFontShadow(LLFontGL::NO_SHADOW);
|
||||
textBox->setColor(LLUI::sColorsGroup->getColor("DefaultListText"));
|
||||
addChild(textBox);
|
||||
}
|
||||
|
||||
S32 LLScrollListCtrl::getSearchColumn()
|
||||
@@ -1688,7 +1693,7 @@ void LLScrollListCtrl::deselectAllItems(BOOL no_commit_on_change)
|
||||
|
||||
void LLScrollListCtrl::setCommentText(const std::string& comment_text)
|
||||
{
|
||||
getChild<LLTextBox>("comment_text")->setValue(comment_text);
|
||||
getChild<LLTextBox>("comment_text")->setWrappedText(comment_text);
|
||||
}
|
||||
|
||||
LLScrollListItem* LLScrollListCtrl::addSeparator(EAddPosition pos)
|
||||
@@ -2045,6 +2050,7 @@ void LLScrollListCtrl::draw()
|
||||
|
||||
updateColumns();
|
||||
|
||||
getChildView("comment_text")->setVisible(mItemList.empty());
|
||||
|
||||
drawItems();
|
||||
|
||||
@@ -3256,20 +3262,7 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac
|
||||
}
|
||||
|
||||
std::string contents = node->getTextContents();
|
||||
if (!contents.empty())
|
||||
{
|
||||
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
|
||||
boost::char_separator<char> sep("\t\n");
|
||||
tokenizer tokens(contents, sep);
|
||||
tokenizer::iterator token_iter = tokens.begin();
|
||||
|
||||
while(token_iter != tokens.end())
|
||||
{
|
||||
const std::string& line = *token_iter;
|
||||
scroll_list->addSimpleElement(line);
|
||||
++token_iter;
|
||||
}
|
||||
}
|
||||
scroll_list->setCommentText(contents);
|
||||
|
||||
return scroll_list;
|
||||
}
|
||||
|
||||
@@ -515,6 +515,7 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
|
||||
delete data;
|
||||
}
|
||||
|
||||
#if 0 //Client side compiling disabled.
|
||||
// static
|
||||
void LLFloaterCompileQueue::onSaveTextComplete(const LLUUID& asset_id, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed)
|
||||
{
|
||||
@@ -551,7 +552,6 @@ void LLFloaterCompileQueue::onSaveBytecodeComplete(const LLUUID& asset_id, void*
|
||||
}
|
||||
|
||||
// compile the file given and save it out.
|
||||
#if 0 //Client side compiling disabled.
|
||||
void LLFloaterCompileQueue::compile(const std::string& filename,
|
||||
const LLUUID& item_id)
|
||||
{
|
||||
|
||||
@@ -136,10 +136,6 @@ public:
|
||||
// will be responsible for it's own destruction.
|
||||
static LLFloaterCompileQueue* create(BOOL mono);
|
||||
|
||||
static void onSaveBytecodeComplete(const LLUUID& asset_id,
|
||||
void* user_data,
|
||||
S32 status);
|
||||
|
||||
// remove any object in mScriptScripts with the matching uuid.
|
||||
void removeItemByItemID(const LLUUID& item_id);
|
||||
|
||||
@@ -158,6 +154,7 @@ protected:
|
||||
LLAssetType::EType type,
|
||||
void* user_data, S32 status, LLExtStat ext_status);
|
||||
|
||||
#if 0 //Client side compiling disabled.
|
||||
static void onSaveTextComplete(const LLUUID& asset_id, void* user_data, S32 status, LLExtStat ext_status);
|
||||
|
||||
static void onSaveBytecodeComplete(const LLUUID& asset_id,
|
||||
@@ -165,7 +162,6 @@ protected:
|
||||
S32 status, LLExtStat ext_status);
|
||||
|
||||
// compile the file given and save it out.
|
||||
#if 0 //Client side compiling disabled.
|
||||
void compile(const std::string& filename, const LLUUID& asset_id);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ void LLFloaterBulkPermission::onCommitCopy(LLUICtrl* ctrl, void* data)
|
||||
BOOL LLFloaterBulkPermission::start()
|
||||
{
|
||||
// note: number of top-level objects to modify is mObjectIDs.count().
|
||||
getChild<LLScrollListCtrl>("queue output")->setCommentText(getString("start_text"));
|
||||
getChild<LLScrollListCtrl>("queue output")->addSimpleElement(getString("start_text"));
|
||||
return nextObject();
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ BOOL LLFloaterBulkPermission::nextObject()
|
||||
|
||||
if(isDone() && !mDone)
|
||||
{
|
||||
getChild<LLScrollListCtrl>("queue output")->setCommentText(getString("done_text"));
|
||||
getChild<LLScrollListCtrl>("queue output")->addSimpleElement(getString("done_text"));
|
||||
mDone = TRUE;
|
||||
}
|
||||
return successful_start;
|
||||
@@ -349,7 +349,7 @@ void LLFloaterBulkPermission::handleInventory(LLViewerObject* viewer_obj, LLInv
|
||||
status_text.setArg("[STATUS]", "");
|
||||
}
|
||||
|
||||
list->setCommentText(status_text.getString());
|
||||
list->addSimpleElement(status_text.getString());
|
||||
|
||||
//TODO if we are an object inside an object we should check a recuse flag and if set
|
||||
//open the inventory of the object and recurse - Michelle2 Zenovka
|
||||
|
||||
@@ -457,18 +457,7 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto
|
||||
}
|
||||
|
||||
std::string contents = node->getTextContents();
|
||||
|
||||
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
|
||||
boost::char_separator<char> sep("\t\n");
|
||||
tokenizer tokens(contents, sep);
|
||||
tokenizer::iterator token_iter = tokens.begin();
|
||||
|
||||
while(token_iter != tokens.end())
|
||||
{
|
||||
const std::string& line = *token_iter;
|
||||
name_list->setCommentText(line);
|
||||
++token_iter;
|
||||
}
|
||||
name_list->setCommentText(contents);
|
||||
|
||||
return name_list;
|
||||
}
|
||||
|
||||
@@ -485,10 +485,7 @@ bool LLScriptEdCore::writeToFile(const std::string& filename)
|
||||
{
|
||||
llwarns << "Unable to write to " << filename << llendl;
|
||||
|
||||
LLSD row;
|
||||
row["columns"][0]["value"] = "Error writing to local file. Is your hard drive full?";
|
||||
row["columns"][0]["font"] = "SANSSERIF_SMALL";
|
||||
mErrorList->addElement(row);
|
||||
mErrorList->addSimpleElement(LLTrans::getString("CompileQueueProblemWriting"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -653,15 +650,12 @@ void LLScriptEdCore::autoSave()
|
||||
//mAutosaveFilename = llformat("%s.lsl", asfilename.c_str());
|
||||
}
|
||||
|
||||
FILE* fp = LLFile::fopen(mAutosaveFilename.c_str(), "wb");
|
||||
LLFILE* fp = LLFile::fopen(mAutosaveFilename.c_str(), "wb");
|
||||
if(!fp)
|
||||
{
|
||||
llwarns << "Unable to write to " << mAutosaveFilename << llendl;
|
||||
|
||||
LLSD row;
|
||||
row["columns"][0]["value"] = "Error writing to temp file. Is your hard drive full?";
|
||||
row["columns"][0]["font"] = "SANSSERIF_SMALL";
|
||||
mErrorList->addElement(row);
|
||||
mErrorList->addSimpleElement(LLTrans::getString("CompileQueueProblemWriting"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -706,9 +700,7 @@ void LLScriptEdCore::addHelpItemToHistory(const std::string& help_string)
|
||||
// separate history items from full item list
|
||||
if (mLiveHelpHistorySize == 0)
|
||||
{
|
||||
LLSD row;
|
||||
row["columns"][0]["type"] = "separator";
|
||||
history_combo->addElement(row, ADD_TOP);
|
||||
history_combo->addSeparator(ADD_TOP);
|
||||
}
|
||||
// delete all history items over history limit
|
||||
while(mLiveHelpHistorySize > MAX_HISTORY_COUNT - 1)
|
||||
@@ -1321,8 +1313,8 @@ LLPreviewLSL::LLPreviewLSL(const std::string& name, const LLRect& rect,
|
||||
void LLPreviewLSL::callbackLSLCompileSucceeded()
|
||||
{
|
||||
llinfos << "LSL Bytecode saved" << llendl;
|
||||
mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessful"));
|
||||
mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete"));
|
||||
mScriptEd->mErrorList->addSimpleElement(LLTrans::getString("CompileSuccessful"));
|
||||
mScriptEd->mErrorList->addSimpleElement(LLTrans::getString("SaveComplete"));
|
||||
closeIfNeeded();
|
||||
}
|
||||
|
||||
@@ -1338,6 +1330,7 @@ void LLPreviewLSL::callbackLSLCompileFailed(const LLSD& compile_errors)
|
||||
LLSD row;
|
||||
std::string error_message = line->asString();
|
||||
LLStringUtil::stripNonprintable(error_message);
|
||||
row["columns"][0]["column"] = "default_column";
|
||||
row["columns"][0]["value"] = error_message;
|
||||
row["columns"][0]["font"] = "OCRA";
|
||||
mScriptEd->mErrorList->addElement(row);
|
||||
@@ -1480,10 +1473,7 @@ void LLPreviewLSL::saveIfNeeded()
|
||||
{
|
||||
llwarns << "Unable to write to " << filename << llendl;
|
||||
|
||||
LLSD row;
|
||||
row["columns"][0]["value"] = "Error writing to local file. Is your hard drive full?";
|
||||
row["columns"][0]["font"] = "SANSSERIF_SMALL";
|
||||
mScriptEd->mErrorList->addElement(row);
|
||||
mScriptEd->mErrorList->addSimpleElement(LLTrans::getString("CompileQueueProblemWriting"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1506,9 +1496,7 @@ void LLPreviewLSL::saveIfNeeded()
|
||||
else
|
||||
{
|
||||
LLSD row;
|
||||
row["columns"][0]["value"] = LLTrans::getString("CompileQueueProblemUploading");
|
||||
row["columns"][0]["font"] = "SANSSERIF_SMALL";
|
||||
mScriptEd->mErrorList->addElement(row);
|
||||
mScriptEd->mErrorList->addSimpleElement(LLTrans::getString("CompileQueueProblemUploading"));
|
||||
LLFile::remove(filename);
|
||||
}
|
||||
#if 0 //Client side compiling disabled.
|
||||
@@ -1622,7 +1610,6 @@ void LLPreviewLSL::uploadAssetLegacy(const std::string& filename,
|
||||
LLFile::remove(err_filename);
|
||||
LLFile::remove(dst_filename);
|
||||
}
|
||||
#endif
|
||||
|
||||
// static
|
||||
void LLPreviewLSL::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed)
|
||||
@@ -1710,6 +1697,7 @@ void LLPreviewLSL::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_d
|
||||
}
|
||||
delete instance_uuid;
|
||||
}
|
||||
#endif
|
||||
|
||||
// static
|
||||
void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAssetType::EType type,
|
||||
@@ -1931,8 +1919,8 @@ void LLLiveLSLEditor::callbackLSLCompileSucceeded(const LLUUID& task_id,
|
||||
bool is_script_running)
|
||||
{
|
||||
lldebugs << "LSL Bytecode saved" << llendl;
|
||||
mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessful"));
|
||||
mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete"));
|
||||
mScriptEd->mErrorList->addSimpleElement(LLTrans::getString("CompileSuccessful"));
|
||||
mScriptEd->mErrorList->addSimpleElement(LLTrans::getString("SaveComplete"));
|
||||
closeIfNeeded();
|
||||
}
|
||||
|
||||
@@ -1947,6 +1935,7 @@ void LLLiveLSLEditor::callbackLSLCompileFailed(const LLSD& compile_errors)
|
||||
LLSD row;
|
||||
std::string error_message = line->asString();
|
||||
LLStringUtil::stripNonprintable(error_message);
|
||||
row["columns"][0]["column"] = "default_column";
|
||||
row["columns"][0]["value"] = error_message;
|
||||
row["columns"][0]["font"] = "OCRA";
|
||||
mScriptEd->mErrorList->addElement(row);
|
||||
@@ -2389,10 +2378,7 @@ void LLLiveLSLEditor::saveIfNeeded()
|
||||
{
|
||||
llwarns << "Unable to write to " << filename << llendl;
|
||||
|
||||
LLSD row;
|
||||
row["columns"][0]["value"] = "Error writing to local file. Is your hard drive full?";
|
||||
row["columns"][0]["font"] = "SANSSERIF_SMALL";
|
||||
mScriptEd->mErrorList->addElement(row);
|
||||
mScriptEd->mErrorList->addSimpleElement(LLTrans::getString("CompileQueueProblemWriting"));
|
||||
return;
|
||||
}
|
||||
std::string utf8text = mScriptEd->mEditor->getText();
|
||||
@@ -2419,10 +2405,7 @@ void LLLiveLSLEditor::saveIfNeeded()
|
||||
}
|
||||
else
|
||||
{
|
||||
LLSD row;
|
||||
row["columns"][0]["value"] = LLTrans::getString("CompileQueueProblemUploading");
|
||||
row["columns"][0]["font"] = "SANSSERIF_SMALL";
|
||||
mScriptEd->mErrorList->addElement(row);
|
||||
mScriptEd->mErrorList->addSimpleElement(LLTrans::getString("CompileQueueProblemUploading"));
|
||||
LLFile::remove(filename);
|
||||
}
|
||||
#if 0 //Client side compiling disabled.
|
||||
@@ -2548,7 +2531,6 @@ void LLLiveLSLEditor::uploadAssetLegacy(const std::string& filename,
|
||||
runningCheckbox->setLabel(getString("script_running"));
|
||||
runningCheckbox->setEnabled(TRUE);
|
||||
}
|
||||
#endif
|
||||
|
||||
void LLLiveLSLEditor::onSaveTextComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed)
|
||||
{
|
||||
@@ -2579,7 +2561,6 @@ void LLLiveLSLEditor::onSaveTextComplete(const LLUUID& asset_uuid, void* user_da
|
||||
data = NULL;
|
||||
}
|
||||
|
||||
|
||||
void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed)
|
||||
{
|
||||
LLLiveLSLSaveData* data = (LLLiveLSLSaveData*)user_data;
|
||||
@@ -2593,7 +2574,7 @@ void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* use
|
||||
if(self)
|
||||
{
|
||||
// Tell the user that the compile worked.
|
||||
self->mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete"));
|
||||
self->mScriptEd->mErrorList->addSimpleElement(LLTrans::getString("SaveComplete"));
|
||||
// close the window if this completes both uploads
|
||||
self->getWindow()->decBusyCount();
|
||||
self->mPendingUploads--;
|
||||
@@ -2627,6 +2608,7 @@ void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* use
|
||||
LLFile::remove(dst_filename);
|
||||
delete data;
|
||||
}
|
||||
#endif
|
||||
|
||||
void LLLiveLSLEditor::open()
|
||||
{
|
||||
|
||||
@@ -202,9 +202,11 @@ protected:
|
||||
void uploadAssetViaCaps(const std::string& url,
|
||||
const std::string& filename,
|
||||
const LLUUID& item_id);
|
||||
#if 0 //Client side compiling disabled.
|
||||
void uploadAssetLegacy(const std::string& filename,
|
||||
const LLUUID& item_id,
|
||||
const LLTransactionID& tid);
|
||||
#endif
|
||||
// <edit>
|
||||
virtual BOOL canSaveAs() const;
|
||||
virtual void saveAs();
|
||||
@@ -218,8 +220,10 @@ protected:
|
||||
static void onLoadComplete(LLVFS *vfs, const LLUUID& uuid,
|
||||
LLAssetType::EType type,
|
||||
void* user_data, S32 status, LLExtStat ext_status);
|
||||
#if 0 //Client side compiling disabled.
|
||||
static void onSaveComplete(const LLUUID& uuid, void* user_data, S32 status, LLExtStat ext_status);
|
||||
static void onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status);
|
||||
#endif
|
||||
public:
|
||||
static LLPreviewLSL* getInstance(const LLUUID& uuid);
|
||||
LLTextEditor* getEditor() { return mScriptEd->mEditor; }
|
||||
@@ -275,10 +279,12 @@ protected:
|
||||
const LLUUID& task_id,
|
||||
const LLUUID& item_id,
|
||||
BOOL is_running);
|
||||
#if 0 //Client side compiling disabled.
|
||||
void uploadAssetLegacy(const std::string& filename,
|
||||
LLViewerObject* object,
|
||||
const LLTransactionID& tid,
|
||||
BOOL is_running);
|
||||
#endif
|
||||
// <edit>
|
||||
virtual BOOL canSaveAs() const;
|
||||
virtual void saveAs();
|
||||
@@ -292,8 +298,10 @@ protected:
|
||||
static void onLoadComplete(LLVFS *vfs, const LLUUID& asset_uuid,
|
||||
LLAssetType::EType type,
|
||||
void* user_data, S32 status, LLExtStat ext_status);
|
||||
#if 0 //Client side compiling disabled.
|
||||
static void onSaveTextComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status);
|
||||
static void onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status);
|
||||
#endif
|
||||
static void onRunningCheckboxClicked(LLUICtrl*, void* userdata);
|
||||
static void onReset(void* userdata);
|
||||
|
||||
|
||||
@@ -3114,6 +3114,7 @@ Drag folders to this area and click "Send to Marketplace" to list them for sale
|
||||
<string name="CompileQueueScriptNotFound">Script not found on server.</string>
|
||||
<string name="CompileQueueProblemDownloading">Problem downloading</string>
|
||||
<string name="CompileQueueProblemUploading">Sim lacking UpdateScriptTask capabilities. Unable to request recompile</string>
|
||||
<string name="CompileQueueProblemWriting">Error writing to local file. Is your hard drive full?</string>
|
||||
<string name="CompileQueueInsufficientPermDownload">Insufficient permissions to download a script.</string>
|
||||
<string name="CompileQueueInsufficientPermFor">Insufficient permissions for</string>
|
||||
<string name="CompileQueueUnknownFailure">Unknown failure to download</string>
|
||||
|
||||
Reference in New Issue
Block a user