Anonymous avatar Anonymous committed 4d6b06d

MAINT-1173 : Top Scripts: Break down usage by parcel. Follow-on code to add
per-parcel filtering. Reviewed by Kelly

Comments (0)

Files changed (4)

indra/llcommon/indra_constants.h

 	STAT_FILTER_BY_PARCEL	= 0x00000001,
 	STAT_FILTER_BY_OWNER	= 0x00000002,
 	STAT_FILTER_BY_OBJECT	= 0x00000004,
+	STAT_FILTER_BY_PARCEL_NAME	= 0x00000008,
 	STAT_REQUEST_LAST_ENTRY	= 0x80000000,
 };
 

indra/newview/llfloatertopobjects.cpp

 	mCommitCallbackRegistrar.add("TopObjects.Refresh",			boost::bind(&LLFloaterTopObjects::onRefresh, this));
 	mCommitCallbackRegistrar.add("TopObjects.GetByObjectName",	boost::bind(&LLFloaterTopObjects::onGetByObjectName, this));
 	mCommitCallbackRegistrar.add("TopObjects.GetByOwnerName",	boost::bind(&LLFloaterTopObjects::onGetByOwnerName, this));
+	mCommitCallbackRegistrar.add("TopObjects.GetByParcelName",	boost::bind(&LLFloaterTopObjects::onGetByParcelName, this));
 	mCommitCallbackRegistrar.add("TopObjects.CommitObjectsList",boost::bind(&LLFloaterTopObjects::onCommitObjectsList, this));
 }
 
 
 	setDefaultBtn("show_beacon_btn");
 
-	/*
-	LLLineEditor* line_editor = getChild<LLLineEditor>("owner_name_editor");
-	if (line_editor)
-	{
-		line_editor->setCommitOnFocusLost(FALSE);
-		line_editor->setCommitCallback(onGetByOwnerName, this);
-	}
-
-	line_editor = getChild<LLLineEditor>("object_name_editor");
-	if (line_editor)
-	{
-		line_editor->setCommitOnFocusLost(FALSE);
-		line_editor->setCommitCallback(onGetByObjectName, this);
-	}*/
-
 	mCurrentMode = STAT_REPORT_TOP_SCRIPTS;
 	mFlags = 0;
 	mFilter.clear();
 		
 		LLUIString format = getString("top_scripts_text");
 		format.setArg("[COUNT]", llformat("%d", total_count));
-		format.setArg("[TIME]", llformat("%0.1f", mtotalScore));
+		format.setArg("[TIME]", llformat("%0.3f", mtotalScore));
 		getChild<LLUICtrl>("title_text")->setValue(LLSD(format));
 	}
 	else
 	{
 		getChild<LLUICtrl>("object_name_editor")->setValue(sli->getColumn(1)->getValue().asString());
 		getChild<LLUICtrl>("owner_name_editor")->setValue(sli->getColumn(2)->getValue().asString());
+		getChild<LLUICtrl>("parcel_name_editor")->setValue(sli->getColumn(4)->getValue().asString());
 	}
 }
 
 	onRefresh();
 }
 
+
+void LLFloaterTopObjects::onGetByParcelName()
+{
+	mFlags  = STAT_FILTER_BY_PARCEL_NAME;
+	mFilter = getChild<LLUICtrl>("parcel_name_editor")->getValue().asString();
+	onRefresh();
+}
+
+
 void LLFloaterTopObjects::showBeacon()
 {
 	LLScrollListCtrl* list = getChild<LLScrollListCtrl>("objects_list");

indra/newview/llfloatertopobjects.h

 
 	void onGetByOwnerName();
 	void onGetByObjectName();
-
-//	static void onGetByOwnerNameClicked(void* data)  { onGetByOwnerName(NULL, data); };
-//	static void onGetByObjectNameClicked(void* data) { onGetByObjectName(NULL, data); };
+	void onGetByParcelName();
 
 	void showBeacon();
 

indra/newview/skins/default/xui/en/floater_top_objects.xml

 <floater
  legacy_header_height="18"
  can_resize="true"
- height="350"
+ height="372"
  layout="topleft"
  min_height="300"
  min_width="450"
       <button.commit_callback
           function="TopObjects.GetByOwnerName" />
     </button>
+    <text
+     type="string"
+     length="1"
+     follows="left|bottom"
+     height="20"
+     layout="topleft"
+     left="10"
+     top_pad="5"
+     name="parcel_name_text"
+     width="107">
+        Parcel:
+    </text>
+    <line_editor
+     follows="left|bottom|right"
+     height="20"
+     layout="topleft"
+     left_pad="3"
+     name="parcel_name_editor"
+     top_delta="-3"
+     width="568" />
+    <button
+     follows="bottom|right"
+     height="23"
+     label="Filter"
+     layout="topleft"
+     left_pad="5"
+     name="filter_parcel_btn"
+     top_delta="0"
+     width="100">
+      <button.commit_callback
+          function="TopObjects.GetByParcelName" />
+    </button>
     <button
      follows="bottom|right"
      height="22"
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.