Skip to content

Commit bb9adf3

Browse files
authored
Fix map search bug causing duplicate requests properly (#4037, #4040)
1 parent 2c0e90a commit bb9adf3

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

indra/newview/llfloaterworldmap.cpp

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,12 @@ bool LLFloaterWorldMap::postBuild()
406406
F32 slider_zoom = mMapView->getZoom();
407407
mZoomSlider->setValue(slider_zoom);
408408

409+
mTrackCtrlsPanel = getChild<LLPanel>("layout_panel_4");
410+
mSearchButton = getChild<LLButton>("DoSearch");
411+
409412
getChild<LLPanel>("expand_btn_panel")->setMouseDownCallback(boost::bind(&LLFloaterWorldMap::onExpandCollapseBtn, this));
410413

411-
setDefaultBtn(NULL);
414+
mTrackCtrlsPanel->setDefaultBtn(nullptr);
412415

413416
onChangeMaturity();
414417

@@ -728,7 +731,7 @@ void LLFloaterWorldMap::trackAvatar( const LLUUID& avatar_id, const std::string&
728731
{
729732
LLTracker::stopTracking(false);
730733
}
731-
setDefaultBtn("Teleport");
734+
mTrackCtrlsPanel->setDefaultBtn(mTeleportButton);
732735
}
733736

734737
void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id )
@@ -773,7 +776,7 @@ void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id )
773776
{
774777
LLTracker::stopTracking(false);
775778
}
776-
setDefaultBtn("Teleport");
779+
mTrackCtrlsPanel->setDefaultBtn(mTeleportButton);
777780
}
778781

779782

@@ -782,15 +785,15 @@ void LLFloaterWorldMap::trackEvent(const LLItemInfo &event_info)
782785
mShowParcelInfo = false;
783786
mTrackedStatus = LLTracker::TRACKING_LOCATION;
784787
LLTracker::trackLocation(event_info.getGlobalPosition(), event_info.getName(), event_info.getToolTip(), LLTracker::LOCATION_EVENT);
785-
setDefaultBtn("Teleport");
788+
mTrackCtrlsPanel->setDefaultBtn(mTeleportButton);
786789
}
787790

788791
void LLFloaterWorldMap::trackGenericItem(const LLItemInfo &item)
789792
{
790793
mShowParcelInfo = false;
791794
mTrackedStatus = LLTracker::TRACKING_LOCATION;
792795
LLTracker::trackLocation(item.getGlobalPosition(), item.getName(), item.getToolTip(), LLTracker::LOCATION_ITEM);
793-
setDefaultBtn("Teleport");
796+
mTrackCtrlsPanel->setDefaultBtn(mTeleportButton);
794797
}
795798

796799
void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global)
@@ -804,7 +807,7 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global)
804807
S32 world_x = S32(pos_global.mdV[0] / 256);
805808
S32 world_y = S32(pos_global.mdV[1] / 256);
806809
LLWorldMapMessage::getInstance()->sendMapBlockRequest(world_x, world_y, world_x, world_y, true);
807-
setDefaultBtn("");
810+
mTrackCtrlsPanel->setDefaultBtn(nullptr);
808811

809812
// clicked on a non-region - turn off coord display
810813
enableTeleportCoordsDisplay( false );
@@ -818,7 +821,7 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global)
818821
LLTracker::stopTracking(false);
819822
LLWorldMap::getInstance()->setTracking(pos_global);
820823
LLWorldMap::getInstance()->setTrackingInvalid();
821-
setDefaultBtn("");
824+
mTrackCtrlsPanel->setDefaultBtn(nullptr);
822825

823826
// clicked on a down region - turn off coord display
824827
enableTeleportCoordsDisplay( false );
@@ -849,7 +852,7 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global)
849852
// we have a valid region - turn on coord display
850853
enableTeleportCoordsDisplay( true );
851854

852-
setDefaultBtn("Teleport");
855+
mTrackCtrlsPanel->setDefaultBtn(mTeleportButton);
853856
}
854857

855858
// enable/disable teleport destination coordinates
@@ -964,7 +967,7 @@ void LLFloaterWorldMap::trackURL(const std::string& region_name, S32 x_coord, S3
964967
local_pos.mV[VZ] = (F32)z_coord;
965968
LLVector3d global_pos = sim_info->getGlobalPos(local_pos);
966969
trackLocation(global_pos);
967-
setDefaultBtn("Teleport");
970+
mTrackCtrlsPanel->setDefaultBtn(mTeleportButton);
968971
}
969972
else
970973
{
@@ -1375,11 +1378,11 @@ void LLFloaterWorldMap::updateSearchEnabled()
13751378
if (childHasKeyboardFocus("location") &&
13761379
mLocationEditor->getValue().asString().length() > 0)
13771380
{
1378-
setDefaultBtn("DoSearch");
1381+
mTrackCtrlsPanel->setDefaultBtn(mSearchButton);
13791382
}
13801383
else
13811384
{
1382-
setDefaultBtn(NULL);
1385+
mTrackCtrlsPanel->setDefaultBtn(nullptr);
13831386
}
13841387
}
13851388

@@ -1800,7 +1803,7 @@ void LLFloaterWorldMap::onCommitSearchResult()
18001803

18011804
mLocationEditor->setValue(sim_name);
18021805
trackLocation(pos_global);
1803-
setDefaultBtn("Teleport");
1806+
mTrackCtrlsPanel->setDefaultBtn(mTeleportButton);
18041807
break;
18051808
}
18061809
}

indra/newview/llfloaterworldmap.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ class LLFloaterWorldMap : public LLFloater
226226
LLButton* mShowDestinationButton = nullptr;
227227
LLButton* mCopySlurlButton = nullptr;
228228
LLButton* mGoHomeButton = nullptr;
229+
LLButton* mSearchButton = nullptr;
229230

230231
LLCheckBoxCtrl* mPeopleCheck = nullptr;
231232
LLCheckBoxCtrl* mInfohubCheck = nullptr;
@@ -245,6 +246,8 @@ class LLFloaterWorldMap : public LLFloater
245246

246247
LLSliderCtrl* mZoomSlider = nullptr;
247248

249+
LLPanel* mTrackCtrlsPanel = nullptr;
250+
248251
boost::signals2::connection mTeleportFinishConnection;
249252
};
250253

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -532,20 +532,17 @@
532532
width="16" />
533533
<search_editor
534534
follows="top|right"
535-
search_button_visible="false"
535+
search_button_visible="false"
536536
height="22"
537-
text_readonly_color="DkGray"
537+
text_readonly_color="DkGray"
538538
label="Regions by Name"
539539
layout="topleft"
540540
top_delta="-2"
541541
left_pad="7"
542542
name="location"
543543
select_on_focus="true"
544544
tool_tip="Type the name of a region"
545-
width="152">
546-
<search_editor.commit_callback
547-
function="WMap.Location" />
548-
</search_editor>
545+
width="152"/>
549546
<button
550547
follows="top|right"
551548
height="23"
@@ -556,7 +553,7 @@
556553
name="DoSearch"
557554
tool_tip="Search for region"
558555
width="62">
559-
<button.mouse_down_callback
556+
<button.commit_callback
560557
function="WMap.Location" />
561558
</button>
562559
<button

0 commit comments

Comments
 (0)