bool LLFloaterReporter::validateReport() { // Ensure user selected a category from the list LLSD category_sd = childGetValue("category_combo"); U8 category = (U8)category_sd.asInteger(); if (category == 0) { if ( mReportType != BUG_REPORT ) { LLNotifications::instance().add("HelpReportAbuseSelectCategory"); } else { LLNotifications::instance().add("HelpReportBugSelectCategory"); } return false; } if ( mReportType != BUG_REPORT ) { if ( childGetText("abuser_name_edit").empty() ) { LLNotifications::instance().add("HelpReportAbuseAbuserNameEmpty"); return false; }; if ( childGetText("abuse_location_edit").empty() ) { LLNotifications::instance().add("HelpReportAbuseAbuserLocationEmpty"); return false; }; }; if ( childGetText("summary_edit").empty() ) { if ( mReportType != BUG_REPORT ) { LLNotifications::instance().add("HelpReportAbuseSummaryEmpty"); } else { LLNotifications::instance().add("HelpReportBugSummaryEmpty"); } return false; }; if ( childGetText("details_edit") == mDefaultSummary ) { if ( mReportType != BUG_REPORT ) { LLNotifications::instance().add("HelpReportAbuseDetailsEmpty"); } else { LLNotifications::instance().add("HelpReportBugDetailsEmpty"); } return false; }; return true; }
// Sub-classes should override this function if they allow editing void LLPreview::onCommit() { const LLViewerInventoryItem *item = getItem(); if(item) { if (!item->isComplete()) { // We are attempting to save an item that was never loaded llwarns << "LLPreview::onCommit() called with mIsComplete == FALSE" << " Type: " << item->getType() << " ID: " << item->getUUID() << llendl; return; } LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); new_item->setDescription(childGetText("desc")); if(mObjectUUID.notNull()) { // must be in an object LLViewerObject* object = gObjectList.findObject(mObjectUUID); if(object) { object->updateInventory( new_item, TASK_INVENTORY_ITEM_KEY, false); } } else if(item->getPermissions().getOwner() == gAgent.getID()) { new_item->updateServer(FALSE); gInventory.updateItem(new_item); gInventory.notifyObservers(); // If the item is an attachment that is currently being worn, // update the object itself. if( item->getType() == LLAssetType::AT_OBJECT ) { LLVOAvatar* avatar = gAgent.getAvatarObject(); if( avatar ) { LLViewerObject* obj = avatar->getWornAttachment( item->getUUID() ); if( obj ) { LLSelectMgr::getInstance()->deselectAll(); LLSelectMgr::getInstance()->addAsIndividual( obj, SELECT_ALL_TES, FALSE ); LLSelectMgr::getInstance()->selectionSetObjectDescription( childGetText("desc") ); LLSelectMgr::getInstance()->deselectAll(); } } } } } }
void LLPanelDirFind::onClickSearch() { std::string search_text = childGetText("search_editor"); search(search_text); LLFloaterDirectory::sNewSearchCount++; }
void LLFloaterAuction::initialize() { mParcelp = gParcelMgr->getParcelSelection(); LLViewerRegion* region = gParcelMgr->getSelectionRegion(); LLParcel* parcelp = mParcelp->getParcel(); if(parcelp && region && !parcelp->getForSale()) { mParcelHost = region->getHost(); mParcelID = parcelp->getLocalID(); childSetText("parcel_text", parcelp->getName()); childEnable("snapshot_btn"); childEnable("ok_btn"); } else { mParcelHost.invalidate(); if(parcelp && parcelp->getForSale()) { childSetText("parcel_text", childGetText("already for sale")); } else { childSetText("parcel_text", LLString::null); } mParcelID = -1; childSetEnabled("snapshot_btn", false); childSetEnabled("ok_btn", false); } mImageID.setNull(); mImage = NULL; }
void LLPrefsIMImpl::apply() { LLTextEditor* busy = LLUICtrlFactory::getTextEditorByName(this, "busy_response"); LLWString busy_response; if (busy) busy_response = busy->getWText(); LLWString::replaceTabsWithSpaces(busy_response, 4); LLWString::replaceChar(busy_response, '\n', '^'); LLWString::replaceChar(busy_response, ' ', '%'); if(mGotPersonalInfo) { gSavedPerAccountSettings.setString("BusyModeResponse", LLString(wstring_to_utf8str(busy_response))); gSavedPerAccountSettings.setString("InstantMessageLogPath", childGetText("log_path_string").c_str()); gSavedPerAccountSettings.setBOOL("LogInstantMessages",childGetValue("log_instant_messages").asBoolean()); gSavedPerAccountSettings.setBOOL("LogChat",childGetValue("log_chat").asBoolean()); gSavedPerAccountSettings.setBOOL("LogShowHistory",childGetValue("log_show_history").asBoolean()); gSavedPerAccountSettings.setBOOL("IMLogTimestamp",childGetValue("log_instant_messages_timestamp").asBoolean()); gSavedPerAccountSettings.setBOOL("LogChatTimestamp",childGetValue("log_chat_timestamp").asBoolean()); gSavedPerAccountSettings.setBOOL("LogChatIM",childGetValue("log_chat_IM").asBoolean()); gSavedPerAccountSettings.setBOOL("LogTimestampDate",childGetValue("log_date_timestamp").asBoolean()); gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath")); gDirUtilp->setPerAccountChatLogsDir(gSavedSettings.getString("FirstName").c_str(), gSavedSettings.getString("LastName").c_str() ); LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir().c_str()); bool new_im_via_email = childGetValue("send_im_to_email").asBoolean(); bool new_hide_online = childGetValue("online_visibility").asBoolean(); if((new_im_via_email != mOriginalIMViaEmail) ||(new_hide_online != mOriginalHideOnlineStatus)) { LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_UpdateUserInfo); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_UserData); msg->addBOOLFast(_PREHASH_IMViaEMail, new_im_via_email); // This hack is because we are representing several different // possible strings with a single checkbox. Since most users // can only select between 2 values, we represent it as a // checkbox. This breaks down a little bit for liaisons, but // works out in the end. if(new_hide_online != mOriginalHideOnlineStatus) { if(new_hide_online) mDirectoryVisibility = VISIBILITY_HIDDEN; else mDirectoryVisibility = VISIBILITY_DEFAULT; //Update showonline value, otherwise multiple applys won't work mOriginalHideOnlineStatus = new_hide_online; } msg->addString("DirectoryVisibility", mDirectoryVisibility); gAgent.sendReliableMessage(); } } }
BOOL LLPrefsIMImpl::postBuild() { requires("online_visibility"); requires("send_im_to_email"); if (!checkRequirements()) { return FALSE; } mGotPersonalInfo = false; mOriginalIMViaEmail = false; mOriginalHideOnlineStatus = true; childSetLabelArg("send_im_to_email", "[EMAIL]", childGetText("log_in_to_change")); // Don't enable this until we get personal data childDisable("online_visibility"); childDisable("send_im_to_email"); childDisable("log_instant_messages"); childDisable("log_chat"); childDisable("log_show_history"); childDisable("log_path_button"); childDisable("busy_response"); childDisable("log_instant_messages_timestamp"); childDisable("log_chat_timestamp"); childDisable("log_chat_IM"); childDisable("log_date_timestamp"); childSetText("busy_response", childGetText("log_in_to_change")); refresh(); childSetText("log_path_string", mLogPath); childSetValue("log_instant_messages", mLogInstantMessages); childSetValue("log_chat", mLogChat); childSetValue("log_show_history", mLogShowHistory); childSetValue("log_instant_messages_timestamp", mIMLogTimestamp); childSetValue("log_chat_timestamp", mLogChatTimestamp); childSetValue("log_chat_IM", mLogIMChat); childSetValue("log_date_timestamp",mLogTimestampDate); childSetAction("log_path_button", onClickLogPath, this); childSetCommitCallback("log_chat",onCommitLogging,this); childSetCommitCallback("log_instant_messages",onCommitLogging,this); return TRUE; }
void LLFloaterPay::give(S32 amount) { if(mCallback) { // if the amount is 0, that menas that we should use the // text field. if(amount == 0) { amount = atoi(childGetText("amount").c_str()); } sLastAmount = amount; // Try to pay an object. if (mObjectSelection.notNull()) { LLViewerObject* dest_object = gObjectList.findObject(mTargetUUID); if(dest_object) { LLViewerRegion* region = dest_object->getRegion(); if (region) { // Find the name of the root object LLSelectNode* node = mObjectSelection->getFirstRootNode(); std::string object_name; if (node) { object_name = node->mName; } S32 tx_type = TRANS_PAY_OBJECT; if(dest_object->isAvatar()) tx_type = TRANS_GIFT; mCallback(mTargetUUID, region, amount, FALSE, tx_type, object_name); mObjectSelection = NULL; // request the object owner in order to check if the owner needs to be unmuted LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_RequestObjectPropertiesFamily); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_ObjectData); msg->addU32Fast(_PREHASH_RequestFlags, OBJECT_PAY_REQUEST ); msg->addUUIDFast(_PREHASH_ObjectID, mTargetUUID); msg->sendReliable( region->getHost() ); } } } else { // just transfer the L$ mCallback(mTargetUUID, gAgent.getRegion(), amount, mTargetIsGroup, TRANS_GIFT, LLStringUtil::null); // check if the payee needs to be unmuted LLMuteList::getInstance()->autoRemove(mTargetUUID, LLMuteList::AR_MONEY); } } }
void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD& content) { // Check for out-of-date query if (query_id != mQueryID) return; LLScrollListCtrl* search_results = getChild<LLScrollListCtrl>("SearchResults"); LLSD agents = content["agents"]; if (agents.size() == 0) { LLStringUtil::format_map_t map; map["[TEXT]"] = childGetText("Edit"); LLSD item; item["id"] = LLUUID::null; item["columns"][0]["column"] = "name"; item["columns"][0]["value"] = getString("not_found", map); search_results->addElement(item); search_results->setEnabled(false); getChildView("ok_btn")->setEnabled(false); return; } // clear "Searching" label on first results search_results->deleteAllItems(); LLSD item; LLSD::array_const_iterator it = agents.beginArray(); for ( ; it != agents.endArray(); ++it) { const LLSD& row = *it; item["id"] = row["id"]; LLSD& columns = item["columns"]; columns[0]["column"] = "name"; columns[0]["value"] = row["display_name"]; columns[1]["column"] = "username"; columns[1]["value"] = row["username"]; search_results->addElement(item); // add the avatar name to our list LLAvatarName avatar_name; avatar_name.fromLLSD(row); sAvatarNameMap[row["id"].asUUID()] = avatar_name; } getChildView("ok_btn")->setEnabled(true); search_results->setEnabled(true); search_results->selectFirstItem(); onList(); search_results->setFocus(TRUE); }
LLSD LLFloaterReporter::gatherReport() { LLViewerRegion *regionp = gAgent.getRegion(); if (!regionp) return LLSD(); // *TODO handle this failure case more gracefully // reset flag in case the next report also contains this text mCopyrightWarningSeen = FALSE; std::ostringstream summary; if (!LLViewerLogin::getInstance()->isInProductionGrid()) { summary << "Preview "; } std::string category_name; LLComboBox* combo = getChild<LLComboBox>( "category_combo"); if (combo) { category_name = combo->getSelectedItemLabel(); // want label, not value } #if LL_WINDOWS const char* platform = "Win"; const char* short_platform = "O:W"; #elif LL_DARWIN const char* platform = "Mac"; const char* short_platform = "O:M"; #elif LL_LINUX const char* platform = "Lnx"; const char* short_platform = "O:L"; #elif LL_SOLARIS const char* platform = "Sol"; const char* short_platform = "O:S"; #else const char* platform = "???"; const char* short_platform = "O:?"; #endif if ( mReportType == BUG_REPORT) { summary << short_platform << " V" << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH << "." << LL_VIEWER_BUILD << " (" << regionp->getName() << ")" << "[" << category_name << "] " << "\"" << childGetValue("summary_edit").asString() << "\""; } else { summary << "" << " |" << regionp->getName() << "|" // region reporter is currently in. << " (" << childGetText("abuse_location_edit") << ")" // region abuse occured in (freeform text - no LLRegionPicker tool) << " [" << category_name << "] " // updated category << " {" << childGetText("abuser_name_edit") << "} " // name of abuse entered in report (chosen using LLAvatarPicker) << " \"" << childGetValue("summary_edit").asString() << "\""; // summary as entered }; std::ostringstream details; if (mReportType != BUG_REPORT) { details << "V" << LL_VERSION_MAJOR << "." // client version moved to body of email for abuse reports << LL_VERSION_MINOR << "." << LL_VERSION_PATCH << "." << LL_VIEWER_BUILD << std::endl << std::endl; } std::string object_name = childGetText("object_name"); std::string owner_name = childGetText("owner_name"); if (!object_name.empty() && !owner_name.empty()) { details << "Object: " << object_name << "\n"; details << "Owner: " << owner_name << "\n"; } if ( mReportType != BUG_REPORT ) { details << "Abuser name: " << childGetText("abuser_name_edit") << " \n"; details << "Abuser location: " << childGetText("abuse_location_edit") << " \n"; }; details << childGetValue("details_edit").asString(); std::string version_string; version_string = llformat( "%d.%d.%d %s %s %s %s", LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, platform, gSysCPU.getFamily().c_str(), gGLManager.mGLRenderer.c_str(), gGLManager.mDriverVersionVendorString.c_str()); // only send a screenshot ID if we're asked to and the email is // going to LL - Estate Owners cannot see the screenshot asset LLUUID screenshot_id = LLUUID::null; if (childGetValue("screen_check")) { if ( mReportType != BUG_REPORT ) { if ( gEmailToEstateOwner == FALSE ) { screenshot_id = childGetValue("screenshot"); } } else { screenshot_id = childGetValue("screenshot"); }; }; LLSD report = LLSD::emptyMap(); report["report-type"] = (U8) mReportType; report["category"] = childGetValue("category_combo"); report["position"] = mPosition.getValue(); report["check-flags"] = (U8)0; // this is not used report["screenshot-id"] = screenshot_id; report["object-id"] = mObjectID; report["abuser-id"] = mAbuserID; report["abuse-region-name"] = ""; report["abuse-region-id"] = LLUUID::null; report["summary"] = summary.str(); report["version-string"] = version_string; report["details"] = details.str(); return report; }
//----------------------------------------------------------------------------- // Member functions //----------------------------------------------------------------------------- LLFloaterReporter::LLFloaterReporter( const std::string& name, const LLRect& rect, const std::string& title, EReportType report_type) : LLFloater(name, rect, title), mReportType(report_type), mObjectID(), mScreenID(), mAbuserID(), mDeselectOnClose( FALSE ), mPicking( FALSE), mPosition(), mCopyrightWarningSeen( FALSE ), mResourceDatap(new LLResourceData()) { if (report_type == BUG_REPORT) { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_report_bug.xml"); } else { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_report_abuse.xml"); } childSetText("abuse_location_edit", gAgent.getSLURL() ); // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-1.0.0a if (rlv_handler_t::isEnabled()) { // Can't filter these since they get sent as part of the report so just hide them instead if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) { childSetVisible("abuse_location_edit", false); childSetVisible("pos_field", false); } if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { childSetVisible("owner_name", false); childSetVisible("abuser_name_edit", false); } } // [/RLVa:KB] LLButton* pick_btn = getChild<LLButton>("pick_btn"); if (pick_btn) { // XUI: Why aren't these in viewerart.ini? pick_btn->setImages( std::string("UIImgFaceUUID"), std::string("UIImgFaceSelectedUUID") ); childSetAction("pick_btn", onClickObjPicker, this); } if (report_type != BUG_REPORT) { // abuser name is selected from a list LLLineEditor* le = getChild<LLLineEditor>("abuser_name_edit"); le->setEnabled( FALSE ); } childSetAction("select_abuser", onClickSelectAbuser, this); childSetAction("send_btn", onClickSend, this); childSetAction("cancel_btn", onClickCancel, this); enableControls(TRUE); // convert the position to a string LLVector3d pos = gAgent.getPositionGlobal(); LLViewerRegion *regionp = gAgent.getRegion(); if (regionp) { pos -= regionp->getOriginGlobal(); } setPosBox(pos); gReporterInstances.addData(report_type, this); // Take a screenshot, but don't draw this floater. setVisible(FALSE); takeScreenshot(); setVisible(TRUE); // Default text to be blank childSetText("object_name", LLStringUtil::null); childSetText("owner_name", LLStringUtil::null); childSetFocus("summary_edit"); mDefaultSummary = childGetText("details_edit"); gDialogVisible = TRUE; // only request details for abuse reports (not BUG reports) if (report_type != BUG_REPORT) { // send a message and ask for information about this region - // result comes back in processRegionInfo(..) LLMessageSystem* msg = gMessageSystem; msg->newMessage("RequestRegionInfo"); msg->nextBlock("AgentData"); msg->addUUID("AgentID", gAgent.getID()); msg->addUUID("SessionID", gAgent.getSessionID()); gAgent.sendReliableMessage(); }; }
void SLFloaterMediaFilter::onCommitDomain() { std::string domain = childGetText("input_domain"); domain = LLViewerParcelMedia::extractDomain(domain); LLHost host; host.setHostByName(domain); std::string ip = host.getIPString(); bool match_ip = (childGetValue("match_ip") && ip != domain && domain.find('/') == std::string::npos); if (!domain.empty()) { LLViewerParcelMedia::sDeniedMedia.erase(domain); LLViewerParcelMedia::sAllowedMedia.erase(domain); for (S32 i = 0; i < (S32)LLViewerParcelMedia::sMediaFilterList.size(); i++) { if (LLViewerParcelMedia::sMediaFilterList[i]["domain"].asString() == domain) { LLViewerParcelMedia::sMediaFilterList.erase(i); } } if (match_ip) { LLViewerParcelMedia::sDeniedMedia.erase(ip); LLViewerParcelMedia::sAllowedMedia.erase(ip); for (S32 i = 0; i < (S32)LLViewerParcelMedia::sMediaFilterList.size(); i++) { if (LLViewerParcelMedia::sMediaFilterList[i]["domain"].asString() == ip) { LLViewerParcelMedia::sMediaFilterList.erase(i); } } } LLSD newmedia; newmedia["domain"] = domain; if (mIsWhitelist) { newmedia["action"] = "allow"; } else { newmedia["action"] = "deny"; } LLViewerParcelMedia::sMediaFilterList.append(newmedia); if (match_ip) { newmedia["domain"] = ip; LLViewerParcelMedia::sMediaFilterList.append(newmedia); } LLViewerParcelMedia::saveDomainFilterList(); } childEnable("clear_lists"); childEnable("show_ips"); childEnable("blacklist_list"); childEnable("whitelist_list"); childEnable("remove_whitelist"); childEnable("add_whitelist"); childEnable("remove_blacklist"); childEnable("add_blacklist"); childDisable("input_domain"); childDisable("commit_domain"); childSetText("add_text", std::string("New domain:")); childSetText("input_domain", std::string("")); setDirty(); }
LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect) : LLPanel(name, LLRect(), FALSE), // not mouse opaque mBalance(0), mHealth(100), mSquareMetersCredit(0), mSquareMetersCommitted(0) { // status bar can possible overlay menus? setMouseOpaque(FALSE); setIsChrome(TRUE); mBalanceTimer = new LLFrameTimer(); mHealthTimer = new LLFrameTimer(); LLUICtrlFactory::getInstance()->buildPanel(this,"panel_status_bar.xml"); // status bar can never get a tab setFocusRoot(FALSE); mTextParcelName = getChild<LLTextBox>("ParcelNameText" ); mTextBalance = getChild<LLTextBox>("BalanceText" ); mTextHealth = getChild<LLTextBox>("HealthText" ); mTextTime = getChild<LLTextBox>("TimeText" ); childSetAction("scriptout", onClickScriptDebug, this); childSetAction("health", onClickHealth, this); childSetAction("no_fly", onClickFly, this); childSetAction("buyland", onClickBuyLand, this ); childSetAction("no_build", onClickBuild, this ); childSetAction("no_scripts", onClickScripts, this ); childSetAction("restrictpush", onClickPush, this ); childSetAction("status_no_voice", onClickVoice, this ); childSetCommitCallback("search_editor", onCommitSearch, this); childSetAction("search_btn", onClickSearch, this); childSetVisible("search_editor", gSavedSettings.getBOOL("ShowSearchBar")); childSetVisible("search_btn", gSavedSettings.getBOOL("ShowSearchBar")); childSetVisible("menubar_search_bevel_bg", gSavedSettings.getBOOL("ShowSearchBar")); childSetAction("buycurrency", onClickBuyCurrency, this ); childSetActionTextbox("BalanceText", onClickBalance ); childSetActionTextbox("ParcelNameText", onClickParcelInfo ); // TODO: Disable buying currency when connected to non-SL grids // that don't support currency yet -- MC LLButton* buybtn = getChild<LLButton>("buycurrency"); buybtn->setLabelArg("[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); // Adding Net Stat Graph S32 x = getRect().getWidth() - 2; S32 y = 0; LLRect r; r.set( x-SIM_STAT_WIDTH, y+MENU_BAR_HEIGHT-1, x, y+1); mSGBandwidth = new LLStatGraph("BandwidthGraph", r); mSGBandwidth->setFollows(FOLLOWS_BOTTOM | FOLLOWS_RIGHT); mSGBandwidth->setStat(&LLViewerStats::getInstance()->mKBitStat); std::string text = childGetText("bandwidth_tooltip") + " "; LLUIString bandwidth_tooltip = text; // get the text from XML until this widget is XML driven mSGBandwidth->setLabel(bandwidth_tooltip.getString()); mSGBandwidth->setUnits("Kbps"); mSGBandwidth->setPrecision(0); mSGBandwidth->setMouseOpaque(FALSE); addChild(mSGBandwidth); x -= SIM_STAT_WIDTH + 2; r.set( x-SIM_STAT_WIDTH, y+MENU_BAR_HEIGHT-1, x, y+1); mSGPacketLoss = new LLStatGraph("PacketLossPercent", r); mSGPacketLoss->setFollows(FOLLOWS_BOTTOM | FOLLOWS_RIGHT); mSGPacketLoss->setStat(&LLViewerStats::getInstance()->mPacketsLostPercentStat); text = childGetText("packet_loss_tooltip") + " "; LLUIString packet_loss_tooltip = text; // get the text from XML until this widget is XML driven mSGPacketLoss->setLabel(packet_loss_tooltip.getString()); mSGPacketLoss->setUnits("%"); mSGPacketLoss->setMin(0.f); mSGPacketLoss->setMax(5.f); mSGPacketLoss->setThreshold(0, 0.5f); mSGPacketLoss->setThreshold(1, 1.f); mSGPacketLoss->setThreshold(2, 3.f); mSGPacketLoss->setPrecision(1); mSGPacketLoss->setMouseOpaque(FALSE); mSGPacketLoss->mPerSec = FALSE; addChild(mSGPacketLoss); childSetActionTextbox("stat_btn", onClickStatGraph); }
// virtual BOOL LLFloaterReporter::postBuild() { LLSLURL slurl; LLAgentUI::buildSLURL(slurl); childSetText("abuse_location_edit", slurl.getSLURLString()); enableControls(TRUE); // convert the position to a string LLVector3d pos = gAgent.getPositionGlobal(); LLViewerRegion *regionp = gAgent.getRegion(); if (regionp) { childSetText("sim_field", regionp->getName()); pos -= regionp->getOriginGlobal(); } setPosBox(pos); // Take a screenshot, but don't draw this floater. setVisible(FALSE); takeScreenshot(); setVisible(TRUE); // Default text to be blank childSetText("object_name", LLStringUtil::null); childSetText("owner_name", LLStringUtil::null); mOwnerName = LLStringUtil::null; childSetFocus("summary_edit"); mDefaultSummary = childGetText("details_edit"); // send a message and ask for information about this region - // result comes back in processRegionInfo(..) LLMessageSystem* msg = gMessageSystem; msg->newMessage("RequestRegionInfo"); msg->nextBlock("AgentData"); msg->addUUID("AgentID", gAgent.getID()); msg->addUUID("SessionID", gAgent.getSessionID()); gAgent.sendReliableMessage(); // abuser name is selected from a list LLUICtrl* le = getChild<LLUICtrl>("abuser_name_edit"); le->setEnabled( false ); setPosBox((LLVector3d)mPosition.getValue()); LLButton* pick_btn = getChild<LLButton>("pick_btn"); pick_btn->setImages(std::string("tool_face.tga"), std::string("tool_face_active.tga") ); childSetAction("pick_btn", onClickObjPicker, this); childSetAction("select_abuser", boost::bind(&LLFloaterReporter::onClickSelectAbuser, this)); childSetAction("send_btn", onClickSend, this); childSetAction("cancel_btn", onClickCancel, this); // grab the user's name std::string fullname; LLAgentUI::buildFullname(fullname); childSetText("reporter_field", fullname); center(); return TRUE; }
// Default constructor LLFloaterAbout::LLFloaterAbout() : LLFloater("floater_about", "FloaterAboutRect", "") { gUICtrlFactory->buildFloater(this, "floater_about.xml"); // Support for changing product name. LLString title("About "); title += LLAppViewer::instance()->getSecondLifeTitle(); setTitle(title); LLString support; // Version string LLString version = LLAppViewer::instance()->getSecondLifeTitle() + llformat(" %d.%d.%d.%d Netbook Edition v1.2 %s %s", LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD, __DATE__, __TIME__); //MK if (RRenabled) { version += "\n" + gAgent.mRRInterface.getVersion (); } //mk support.append(version); support.append("\n\n"); // Position LLViewerRegion* region = gAgent.getRegion(); if (region) { const LLVector3d &pos = gAgent.getPositionGlobal(); LLUIString pos_text = childGetText("you_are_at"); pos_text.setArg("[POSITION]", llformat("%.1f, %.1f, %.1f ", pos.mdV[VX], pos.mdV[VY], pos.mdV[VZ])); //MK if (RRenabled && gAgent.mRRInterface.mContainsShowloc) { pos_text = "(Position hidden)\n"; } //mk support.append(pos_text); LLString region_text = llformat("in %s located at ", gAgent.getRegion()->getName().c_str()); //MK if (RRenabled && gAgent.mRRInterface.mContainsShowloc) { region_text = "(Region hidden)\n"; } //mk support.append(region_text); //MK if (!RRenabled || !gAgent.mRRInterface.mContainsShowloc) { //mk char buffer[MAX_STRING]; /*Flawfinder: ignore*/ gAgent.getRegion()->getHost().getHostName(buffer, MAX_STRING); support.append(buffer); support.append(" ("); gAgent.getRegion()->getHost().getString(buffer, MAX_STRING); support.append(buffer); support.append(")\n"); support.append(gLastVersionChannel); support.append("\n\n"); //MK } else { support.append ("(Server info hidden)\n\n"); } //mk } //*NOTE: Do not translate text like GPU, Graphics Card, etc - // Most PC users that know what these mean will be used to the english versions, // and this info sometimes gets sent to support // CPU support.append("CPU: "); support.append( gSysCPU.getCPUString() ); support.append("\n"); U32 memory = gSysMemory.getPhysicalMemoryKB() / 1024; // Moved hack adjustment to Windows memory size into llsys.cpp LLString mem_text = llformat("Memory: %u MB\n", memory ); support.append(mem_text); support.append("OS Version: "); support.append( LLAppViewer::instance()->getOSInfo().getOSString().c_str() ); support.append("\n"); support.append("Graphics Card Vendor: "); support.append( (const char*) glGetString(GL_VENDOR) ); support.append("\n"); support.append("Graphics Card: "); support.append( (const char*) glGetString(GL_RENDERER) ); support.append("\n"); support.append("OpenGL Version: "); support.append( (const char*) glGetString(GL_VERSION) ); support.append("\n"); #if LL_LIBXUL_ENABLED support.append("LLMozLib Version: "); support.append( (const char*) LLMozLib::getInstance()->getVersion().c_str() ); support.append("\n"); #endif // LL_LIBXUL_ENABLED if (gViewerStats && gPacketsIn > 0) { LLString packet_loss = llformat("Packets Lost: %.0f/%.0f (%.1f%%)", gViewerStats->mPacketsLostStat.getCurrent(), F32(gPacketsIn), 100.f*gViewerStats->mPacketsLostStat.getCurrent() / F32(gPacketsIn) ); support.append(packet_loss); support.append("\n"); } // MD5 digest of executable support.append("Viewer Digest: "); char viewer_digest_string[UUID_STR_LENGTH]; /*Flawfinder: ignore*/ gViewerDigest.toString( viewer_digest_string ); support.append(viewer_digest_string); // Fix views childDisable("credits_editor"); LLTextEditor * support_widget = (LLTextEditor *) getChildByName("support_editor", true); if (support_widget) { support_widget->setEnabled( FALSE ); support_widget->setTakesFocus( TRUE ); support_widget->setText( support ); support_widget->setHandleEditKeysDirectly( TRUE ); } center(); sInstance = this; }
LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect) : LLPanel(name, LLRect(), FALSE), // not mouse opaque mBalance(0), mHealth(100), mSquareMetersCredit(0), mSquareMetersCommitted(0) { // status bar can possible overlay menus? mMouseOpaque = FALSE; setIsChrome(TRUE); mBalanceTimer = new LLFrameTimer(); mHealthTimer = new LLFrameTimer(); gUICtrlFactory->buildPanel(this,"panel_status_bar.xml"); // status bar can never get a tab setFocusRoot(FALSE); mBtnScriptOut = LLUICtrlFactory::getButtonByName( this, "scriptout" ); mBtnHealth = LLUICtrlFactory::getButtonByName( this, "health" ); mBtnFly = LLUICtrlFactory::getButtonByName( this, "fly" ); mBtnBuild = LLUICtrlFactory::getButtonByName( this, "build" ); mBtnScripts = LLUICtrlFactory::getButtonByName( this, "scripts" ); mBtnPush = LLUICtrlFactory::getButtonByName( this, "restrictpush" ); mBtnBuyLand = LLUICtrlFactory::getButtonByName( this, "buyland" ); mBtnBuyCurrency = LLUICtrlFactory::getButtonByName( this, "buycurrency" ); mTextParcelName = LLUICtrlFactory::getTextBoxByName( this, "ParcelNameText" ); mTextBalance = LLUICtrlFactory::getTextBoxByName( this, "BalanceText" ); mTextHealth = LLUICtrlFactory::getTextBoxByName( this, "HealthText" ); mTextTime = LLUICtrlFactory::getTextBoxByName( this, "TimeText" ); S32 x = mRect.getWidth() - 2; S32 y = 0; LLRect r; r.set( x-SIM_STAT_WIDTH, y+MENU_BAR_HEIGHT-1, x, y+1); mSGBandwidth = new LLStatGraph("BandwidthGraph", r); mSGBandwidth->setFollows(FOLLOWS_BOTTOM | FOLLOWS_RIGHT); mSGBandwidth->setStat(&gViewerStats->mKBitStat); LLString text = childGetText("bandwidth_tooltip") + " "; LLUIString bandwidth_tooltip = text; // get the text from XML until this widget is XML driven mSGBandwidth->setLabel(bandwidth_tooltip.getString().c_str()); mSGBandwidth->setUnits("Kbps"); mSGBandwidth->setPrecision(0); addChild(mSGBandwidth); x -= SIM_STAT_WIDTH + 2; r.set( x-SIM_STAT_WIDTH, y+MENU_BAR_HEIGHT-1, x, y+1); mSGPacketLoss = new LLStatGraph("PacketLossPercent", r); mSGPacketLoss->setFollows(FOLLOWS_BOTTOM | FOLLOWS_RIGHT); mSGPacketLoss->setStat(&gViewerStats->mPacketsLostPercentStat); text = childGetText("packet_loss_tooltip") + " "; LLUIString packet_loss_tooltip = text; // get the text from XML until this widget is XML driven mSGPacketLoss->setLabel(packet_loss_tooltip.getString().c_str()); mSGPacketLoss->setUnits("%"); mSGPacketLoss->setMin(0.f); mSGPacketLoss->setMax(5.f); mSGPacketLoss->setThreshold(0, 0.5f); mSGPacketLoss->setThreshold(1, 1.f); mSGPacketLoss->setThreshold(2, 3.f); mSGPacketLoss->setPrecision(1); mSGPacketLoss->mPerSec = FALSE; addChild(mSGPacketLoss); }
void LLPreviewNotecard::loadAsset() { // request the asset. const LLInventoryItem* item = getItem(); LLViewerTextEditor* editor = LLViewerUICtrlFactory::getViewerTextEditorByName(this, "Notecard Editor"); if (!editor) return; if(item) { if (gAgent.allowOperation(PERM_COPY, item->getPermissions(), GP_OBJECT_MANIPULATE) || gAgent.isGodlike()) { mAssetID = item->getAssetUUID(); if(mAssetID.isNull()) { editor->setText(LLString::null); editor->makePristine(); editor->setEnabled(TRUE); mAssetStatus = PREVIEW_ASSET_LOADED; } else { LLUUID* new_uuid = new LLUUID(mItemUUID); LLHost source_sim = LLHost::invalid; if (mObjectUUID.notNull()) { LLViewerObject *objectp = gObjectList.findObject(mObjectUUID); if (objectp && objectp->getRegion()) { source_sim = objectp->getRegion()->getHost(); } else { // The object that we're trying to look at disappeared, bail. llwarns << "Can't find object " << mObjectUUID << " associated with notecard." << llendl; mAssetID.setNull(); editor->setText(childGetText("no_object")); editor->makePristine(); editor->setEnabled(FALSE); mAssetStatus = PREVIEW_ASSET_LOADED; delete new_uuid; return; } } gAssetStorage->getInvItemAsset(source_sim, gAgent.getID(), gAgent.getSessionID(), item->getPermissions().getOwner(), mObjectUUID, item->getUUID(), item->getAssetUUID(), item->getType(), &onLoadComplete, (void*)new_uuid, TRUE); mAssetStatus = PREVIEW_ASSET_LOADING; } } else { mAssetID.setNull(); editor->setText(childGetText("not_allowed")); editor->makePristine(); editor->setEnabled(FALSE); mAssetStatus = PREVIEW_ASSET_LOADED; } if(!gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE)) { editor->setEnabled(FALSE); childSetVisible("lock", TRUE); } } else { editor->setText(LLString::null); editor->makePristine(); editor->setEnabled(TRUE); mAssetStatus = PREVIEW_ASSET_LOADED; } }
void LLFloaterTopObjects::onGetByOwnerName() { mFlags = STAT_FILTER_BY_OWNER; mFilter = childGetText("owner_name_editor"); onRefresh(); }
void LLFloaterTopObjects::onGetByObjectName() { mFlags = STAT_FILTER_BY_OBJECT; mFilter = childGetText("object_name_editor"); onRefresh(); }