Merge remote-tracking branch 'shyotl/master'

This commit is contained in:
Latif Khalifa
2013-01-14 10:53:27 +01:00
8 changed files with 41 additions and 72 deletions

View File

@@ -752,7 +752,12 @@ LLScrollListCtrl::LLScrollListCtrl(const std::string& name, const LLRect& rect,
addChild(mBorder); 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() S32 LLScrollListCtrl::getSearchColumn()
@@ -1688,7 +1693,7 @@ void LLScrollListCtrl::deselectAllItems(BOOL no_commit_on_change)
void LLScrollListCtrl::setCommentText(const std::string& comment_text) 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) LLScrollListItem* LLScrollListCtrl::addSeparator(EAddPosition pos)
@@ -2045,6 +2050,7 @@ void LLScrollListCtrl::draw()
updateColumns(); updateColumns();
getChildView("comment_text")->setVisible(mItemList.empty());
drawItems(); drawItems();
@@ -3256,20 +3262,7 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac
} }
std::string contents = node->getTextContents(); std::string contents = node->getTextContents();
if (!contents.empty()) scroll_list->setCommentText(contents);
{
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;
}
}
return scroll_list; return scroll_list;
} }

View File

@@ -515,6 +515,7 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
delete data; delete data;
} }
#if 0 //Client side compiling disabled.
// static // static
void LLFloaterCompileQueue::onSaveTextComplete(const LLUUID& asset_id, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed) 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. // compile the file given and save it out.
#if 0 //Client side compiling disabled.
void LLFloaterCompileQueue::compile(const std::string& filename, void LLFloaterCompileQueue::compile(const std::string& filename,
const LLUUID& item_id) const LLUUID& item_id)
{ {

View File

@@ -136,10 +136,6 @@ public:
// will be responsible for it's own destruction. // will be responsible for it's own destruction.
static LLFloaterCompileQueue* create(BOOL mono); 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. // remove any object in mScriptScripts with the matching uuid.
void removeItemByItemID(const LLUUID& item_id); void removeItemByItemID(const LLUUID& item_id);
@@ -158,6 +154,7 @@ protected:
LLAssetType::EType type, LLAssetType::EType type,
void* user_data, S32 status, LLExtStat ext_status); 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 onSaveTextComplete(const LLUUID& asset_id, void* user_data, S32 status, LLExtStat ext_status);
static void onSaveBytecodeComplete(const LLUUID& asset_id, static void onSaveBytecodeComplete(const LLUUID& asset_id,
@@ -165,7 +162,6 @@ protected:
S32 status, LLExtStat ext_status); S32 status, LLExtStat ext_status);
// compile the file given and save it out. // compile the file given and save it out.
#if 0 //Client side compiling disabled.
void compile(const std::string& filename, const LLUUID& asset_id); void compile(const std::string& filename, const LLUUID& asset_id);
#endif #endif

View File

@@ -180,7 +180,7 @@ void LLFloaterBulkPermission::onCommitCopy(LLUICtrl* ctrl, void* data)
BOOL LLFloaterBulkPermission::start() BOOL LLFloaterBulkPermission::start()
{ {
// note: number of top-level objects to modify is mObjectIDs.count(). // 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(); return nextObject();
} }
@@ -203,7 +203,7 @@ BOOL LLFloaterBulkPermission::nextObject()
if(isDone() && !mDone) if(isDone() && !mDone)
{ {
getChild<LLScrollListCtrl>("queue output")->setCommentText(getString("done_text")); getChild<LLScrollListCtrl>("queue output")->addSimpleElement(getString("done_text"));
mDone = TRUE; mDone = TRUE;
} }
return successful_start; return successful_start;
@@ -349,7 +349,7 @@ void LLFloaterBulkPermission::handleInventory(LLViewerObject* viewer_obj, LLInv
status_text.setArg("[STATUS]", ""); 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 //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 //open the inventory of the object and recurse - Michelle2 Zenovka

View File

@@ -457,18 +457,7 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto
} }
std::string contents = node->getTextContents(); std::string contents = node->getTextContents();
name_list->setCommentText(contents);
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;
}
return name_list; return name_list;
} }

View File

@@ -485,10 +485,7 @@ bool LLScriptEdCore::writeToFile(const std::string& filename)
{ {
llwarns << "Unable to write to " << filename << llendl; llwarns << "Unable to write to " << filename << llendl;
LLSD row; mErrorList->addSimpleElement(LLTrans::getString("CompileQueueProblemWriting"));
row["columns"][0]["value"] = "Error writing to local file. Is your hard drive full?";
row["columns"][0]["font"] = "SANSSERIF_SMALL";
mErrorList->addElement(row);
return false; return false;
} }
@@ -653,15 +650,12 @@ void LLScriptEdCore::autoSave()
//mAutosaveFilename = llformat("%s.lsl", asfilename.c_str()); //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) if(!fp)
{ {
llwarns << "Unable to write to " << mAutosaveFilename << llendl; llwarns << "Unable to write to " << mAutosaveFilename << llendl;
LLSD row; mErrorList->addSimpleElement(LLTrans::getString("CompileQueueProblemWriting"));
row["columns"][0]["value"] = "Error writing to temp file. Is your hard drive full?";
row["columns"][0]["font"] = "SANSSERIF_SMALL";
mErrorList->addElement(row);
return; return;
} }
@@ -706,9 +700,7 @@ void LLScriptEdCore::addHelpItemToHistory(const std::string& help_string)
// separate history items from full item list // separate history items from full item list
if (mLiveHelpHistorySize == 0) if (mLiveHelpHistorySize == 0)
{ {
LLSD row; history_combo->addSeparator(ADD_TOP);
row["columns"][0]["type"] = "separator";
history_combo->addElement(row, ADD_TOP);
} }
// delete all history items over history limit // delete all history items over history limit
while(mLiveHelpHistorySize > MAX_HISTORY_COUNT - 1) while(mLiveHelpHistorySize > MAX_HISTORY_COUNT - 1)
@@ -1321,8 +1313,8 @@ LLPreviewLSL::LLPreviewLSL(const std::string& name, const LLRect& rect,
void LLPreviewLSL::callbackLSLCompileSucceeded() void LLPreviewLSL::callbackLSLCompileSucceeded()
{ {
llinfos << "LSL Bytecode saved" << llendl; llinfos << "LSL Bytecode saved" << llendl;
mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessful")); mScriptEd->mErrorList->addSimpleElement(LLTrans::getString("CompileSuccessful"));
mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete")); mScriptEd->mErrorList->addSimpleElement(LLTrans::getString("SaveComplete"));
closeIfNeeded(); closeIfNeeded();
} }
@@ -1338,6 +1330,7 @@ void LLPreviewLSL::callbackLSLCompileFailed(const LLSD& compile_errors)
LLSD row; LLSD row;
std::string error_message = line->asString(); std::string error_message = line->asString();
LLStringUtil::stripNonprintable(error_message); LLStringUtil::stripNonprintable(error_message);
row["columns"][0]["column"] = "default_column";
row["columns"][0]["value"] = error_message; row["columns"][0]["value"] = error_message;
row["columns"][0]["font"] = "OCRA"; row["columns"][0]["font"] = "OCRA";
mScriptEd->mErrorList->addElement(row); mScriptEd->mErrorList->addElement(row);
@@ -1480,10 +1473,7 @@ void LLPreviewLSL::saveIfNeeded()
{ {
llwarns << "Unable to write to " << filename << llendl; llwarns << "Unable to write to " << filename << llendl;
LLSD row; mScriptEd->mErrorList->addSimpleElement(LLTrans::getString("CompileQueueProblemWriting"));
row["columns"][0]["value"] = "Error writing to local file. Is your hard drive full?";
row["columns"][0]["font"] = "SANSSERIF_SMALL";
mScriptEd->mErrorList->addElement(row);
return; return;
} }
@@ -1506,9 +1496,7 @@ void LLPreviewLSL::saveIfNeeded()
else else
{ {
LLSD row; LLSD row;
row["columns"][0]["value"] = LLTrans::getString("CompileQueueProblemUploading"); mScriptEd->mErrorList->addSimpleElement(LLTrans::getString("CompileQueueProblemUploading"));
row["columns"][0]["font"] = "SANSSERIF_SMALL";
mScriptEd->mErrorList->addElement(row);
LLFile::remove(filename); LLFile::remove(filename);
} }
#if 0 //Client side compiling disabled. #if 0 //Client side compiling disabled.
@@ -1622,7 +1610,6 @@ void LLPreviewLSL::uploadAssetLegacy(const std::string& filename,
LLFile::remove(err_filename); LLFile::remove(err_filename);
LLFile::remove(dst_filename); LLFile::remove(dst_filename);
} }
#endif
// static // static
void LLPreviewLSL::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed) 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; delete instance_uuid;
} }
#endif
// static // static
void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAssetType::EType type, 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) bool is_script_running)
{ {
lldebugs << "LSL Bytecode saved" << llendl; lldebugs << "LSL Bytecode saved" << llendl;
mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessful")); mScriptEd->mErrorList->addSimpleElement(LLTrans::getString("CompileSuccessful"));
mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete")); mScriptEd->mErrorList->addSimpleElement(LLTrans::getString("SaveComplete"));
closeIfNeeded(); closeIfNeeded();
} }
@@ -1947,6 +1935,7 @@ void LLLiveLSLEditor::callbackLSLCompileFailed(const LLSD& compile_errors)
LLSD row; LLSD row;
std::string error_message = line->asString(); std::string error_message = line->asString();
LLStringUtil::stripNonprintable(error_message); LLStringUtil::stripNonprintable(error_message);
row["columns"][0]["column"] = "default_column";
row["columns"][0]["value"] = error_message; row["columns"][0]["value"] = error_message;
row["columns"][0]["font"] = "OCRA"; row["columns"][0]["font"] = "OCRA";
mScriptEd->mErrorList->addElement(row); mScriptEd->mErrorList->addElement(row);
@@ -2389,10 +2378,7 @@ void LLLiveLSLEditor::saveIfNeeded()
{ {
llwarns << "Unable to write to " << filename << llendl; llwarns << "Unable to write to " << filename << llendl;
LLSD row; mScriptEd->mErrorList->addSimpleElement(LLTrans::getString("CompileQueueProblemWriting"));
row["columns"][0]["value"] = "Error writing to local file. Is your hard drive full?";
row["columns"][0]["font"] = "SANSSERIF_SMALL";
mScriptEd->mErrorList->addElement(row);
return; return;
} }
std::string utf8text = mScriptEd->mEditor->getText(); std::string utf8text = mScriptEd->mEditor->getText();
@@ -2419,10 +2405,7 @@ void LLLiveLSLEditor::saveIfNeeded()
} }
else else
{ {
LLSD row; mScriptEd->mErrorList->addSimpleElement(LLTrans::getString("CompileQueueProblemUploading"));
row["columns"][0]["value"] = LLTrans::getString("CompileQueueProblemUploading");
row["columns"][0]["font"] = "SANSSERIF_SMALL";
mScriptEd->mErrorList->addElement(row);
LLFile::remove(filename); LLFile::remove(filename);
} }
#if 0 //Client side compiling disabled. #if 0 //Client side compiling disabled.
@@ -2548,7 +2531,6 @@ void LLLiveLSLEditor::uploadAssetLegacy(const std::string& filename,
runningCheckbox->setLabel(getString("script_running")); runningCheckbox->setLabel(getString("script_running"));
runningCheckbox->setEnabled(TRUE); runningCheckbox->setEnabled(TRUE);
} }
#endif
void LLLiveLSLEditor::onSaveTextComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed) 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; data = NULL;
} }
void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed) void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed)
{ {
LLLiveLSLSaveData* data = (LLLiveLSLSaveData*)user_data; LLLiveLSLSaveData* data = (LLLiveLSLSaveData*)user_data;
@@ -2593,7 +2574,7 @@ void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* use
if(self) if(self)
{ {
// Tell the user that the compile worked. // 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 // close the window if this completes both uploads
self->getWindow()->decBusyCount(); self->getWindow()->decBusyCount();
self->mPendingUploads--; self->mPendingUploads--;
@@ -2627,6 +2608,7 @@ void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* use
LLFile::remove(dst_filename); LLFile::remove(dst_filename);
delete data; delete data;
} }
#endif
void LLLiveLSLEditor::open() void LLLiveLSLEditor::open()
{ {

View File

@@ -202,9 +202,11 @@ protected:
void uploadAssetViaCaps(const std::string& url, void uploadAssetViaCaps(const std::string& url,
const std::string& filename, const std::string& filename,
const LLUUID& item_id); const LLUUID& item_id);
#if 0 //Client side compiling disabled.
void uploadAssetLegacy(const std::string& filename, void uploadAssetLegacy(const std::string& filename,
const LLUUID& item_id, const LLUUID& item_id,
const LLTransactionID& tid); const LLTransactionID& tid);
#endif
// <edit> // <edit>
virtual BOOL canSaveAs() const; virtual BOOL canSaveAs() const;
virtual void saveAs(); virtual void saveAs();
@@ -218,8 +220,10 @@ protected:
static void onLoadComplete(LLVFS *vfs, const LLUUID& uuid, static void onLoadComplete(LLVFS *vfs, const LLUUID& uuid,
LLAssetType::EType type, LLAssetType::EType type,
void* user_data, S32 status, LLExtStat ext_status); 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 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); static void onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status);
#endif
public: public:
static LLPreviewLSL* getInstance(const LLUUID& uuid); static LLPreviewLSL* getInstance(const LLUUID& uuid);
LLTextEditor* getEditor() { return mScriptEd->mEditor; } LLTextEditor* getEditor() { return mScriptEd->mEditor; }
@@ -275,10 +279,12 @@ protected:
const LLUUID& task_id, const LLUUID& task_id,
const LLUUID& item_id, const LLUUID& item_id,
BOOL is_running); BOOL is_running);
#if 0 //Client side compiling disabled.
void uploadAssetLegacy(const std::string& filename, void uploadAssetLegacy(const std::string& filename,
LLViewerObject* object, LLViewerObject* object,
const LLTransactionID& tid, const LLTransactionID& tid,
BOOL is_running); BOOL is_running);
#endif
// <edit> // <edit>
virtual BOOL canSaveAs() const; virtual BOOL canSaveAs() const;
virtual void saveAs(); virtual void saveAs();
@@ -292,8 +298,10 @@ protected:
static void onLoadComplete(LLVFS *vfs, const LLUUID& asset_uuid, static void onLoadComplete(LLVFS *vfs, const LLUUID& asset_uuid,
LLAssetType::EType type, LLAssetType::EType type,
void* user_data, S32 status, LLExtStat ext_status); 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 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); static void onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status);
#endif
static void onRunningCheckboxClicked(LLUICtrl*, void* userdata); static void onRunningCheckboxClicked(LLUICtrl*, void* userdata);
static void onReset(void* userdata); static void onReset(void* userdata);

View File

@@ -3115,6 +3115,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="CompileQueueScriptNotFound">Script not found on server.</string>
<string name="CompileQueueProblemDownloading">Problem downloading</string> <string name="CompileQueueProblemDownloading">Problem downloading</string>
<string name="CompileQueueProblemUploading">Sim lacking UpdateScriptTask capabilities. Unable to request recompile</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="CompileQueueInsufficientPermDownload">Insufficient permissions to download a script.</string>
<string name="CompileQueueInsufficientPermFor">Insufficient permissions for</string> <string name="CompileQueueInsufficientPermFor">Insufficient permissions for</string>
<string name="CompileQueueUnknownFailure">Unknown failure to download</string> <string name="CompileQueueUnknownFailure">Unknown failure to download</string>