Skip to content
Snippets Groups Projects
Commit 22a00c93 authored by Darl Cat's avatar Darl Cat
Browse files

Initial port of integrated search from Alchemy classic

The following file is placeholder from the port and broken:
indra/newview/skins/default/xui/en/panel_profile_legacy_sidetray.xml

Featuring work by:
Cinder <cinder@sdf.org>
Rye Mutt <rye@alchemyviewer.org>
parent 0bacc2f6
No related tags found
No related merge requests found
Showing
with 2506 additions and 66 deletions
......@@ -113,11 +113,11 @@ include_directories(SYSTEM
)
set(viewer_SOURCE_FILES
alcinematicmode.cpp
alaoengine.cpp
alaoset.cpp
alavataractions.cpp
alchatcommand.cpp
alcinematicmode.cpp
alcontrolcache.cpp
alfloaterao.cpp
alfloaterparticleeditor.cpp
......@@ -132,7 +132,6 @@ set(viewer_SOURCE_FILES
alviewermenu.cpp
groupchatlistener.cpp
llaccountingcostmanager.cpp
llaisapi.cpp
llagent.cpp
llagentaccess.cpp
llagentbenefits.cpp
......@@ -144,6 +143,7 @@ set(viewer_SOURCE_FILES
llagentpilot.cpp
llagentui.cpp
llagentwearables.cpp
llaisapi.cpp
llanimstatelabels.cpp
llappcorehttp.cpp
llappearancemgr.cpp
......@@ -156,9 +156,9 @@ set(viewer_SOURCE_FILES
llavatariconctrl.cpp
llavatarlist.cpp
llavatarlistitem.cpp
llavatarpropertiesprocessor.cpp
llavatarrenderinfoaccountant.cpp
llavatarrendernotifier.cpp
llavatarpropertiesprocessor.cpp
llblockedlistitem.cpp
llblocklist.cpp
llbox.cpp
......@@ -196,8 +196,8 @@ set(viewer_SOURCE_FILES
lldeferredsounds.cpp
lldelayedgestureerror.cpp
lldirpicker.cpp
lldonotdisturbnotificationstorage.cpp
lldndbutton.cpp
lldonotdisturbnotificationstorage.cpp
lldrawable.cpp
lldrawpool.cpp
lldrawpoolalpha.cpp
......@@ -230,7 +230,6 @@ set(viewer_SOURCE_FILES
llflexibleobject.cpp
llfloaterabout.cpp
llfloaterassetrecovery.cpp
llfloaterbvhpreview.cpp
llfloaterauction.cpp
llfloaterautoreplacesettings.cpp
llfloateravatar.cpp
......@@ -248,6 +247,7 @@ set(viewer_SOURCE_FILES
llfloaterbuycurrency.cpp
llfloaterbuycurrencyhtml.cpp
llfloaterbuyland.cpp
llfloaterbvhpreview.cpp
llfloatercamera.cpp
llfloatercamerapresets.cpp
llfloaterchatalerts.cpp
......@@ -257,6 +257,7 @@ set(viewer_SOURCE_FILES
llfloaterconversationpreview.cpp
llfloaterdeleteprefpreset.cpp
llfloaterdestinations.cpp
llfloaterdirectory.cpp
llfloaterdisplayname.cpp
llfloatereditenvironmentbase.cpp
llfloatereditextdaycycle.cpp
......@@ -280,9 +281,12 @@ set(viewer_SOURCE_FILES
llfloaterhoverheight.cpp
llfloaterhud.cpp
llfloaterimagepreview.cpp
llfloaterimsessiontab.cpp
llfloaterimsession.cpp
llfloaterimcontainer.cpp
llfloaterimnearbychat.cpp
llfloaterimnearbychathandler.cpp
llfloaterimnearbychatlistener.cpp
llfloaterimsession.cpp
llfloaterimsessiontab.cpp
llfloaterinspect.cpp
llfloaterjoystick.cpp
llfloaterlagmeter.cpp
......@@ -290,21 +294,21 @@ set(viewer_SOURCE_FILES
llfloaterlandholdings.cpp
llfloaterlinkreplace.cpp
llfloaterloadprefpreset.cpp
llfloatermarketplacelistings.cpp
llfloatermap.cpp
llfloatermarketplacelistings.cpp
llfloatermediasettings.cpp
llfloatermemleak.cpp
llfloatermodelpreview.cpp
llfloatermodeluploadbase.cpp
llfloatermyscripts.cpp
llfloatermyenvironment.cpp
llfloatermyscripts.cpp
llfloaternamedesc.cpp
llfloaternotificationsconsole.cpp
llfloaternotificationstabbed.cpp
llfloateroutfitphotopreview.cpp
llfloateroutfitsnapshot.cpp
llfloaterobjectweights.cpp
llfloateropenobject.cpp
llfloateroutfitphotopreview.cpp
llfloateroutfitsnapshot.cpp
llfloaterpathfindingcharacters.cpp
llfloaterpathfindingconsole.cpp
llfloaterpathfindinglinksets.cpp
......@@ -312,15 +316,15 @@ set(viewer_SOURCE_FILES
llfloaterpay.cpp
llfloaterperms.cpp
llfloaterpostprocess.cpp
llfloaterprofile.cpp
llfloaterpreference.cpp
llfloaterpreferenceviewadvanced.cpp
llfloaterpreviewtrash.cpp
llfloaterprofile.cpp
llfloaterproperties.cpp
llfloaterregiondebugconsole.cpp
llfloaterregioninfo.cpp
llfloaterreporter.cpp
llfloaterregionrestarting.cpp
llfloaterreporter.cpp
llfloatersavecamerapreset.cpp
llfloatersaveprefpreset.cpp
llfloatersceneloadstats.cpp
......@@ -352,10 +356,10 @@ set(viewer_SOURCE_FILES
llfloaterwhitelistentry.cpp
llfloaterwindowsize.cpp
llfloaterworldmap.cpp
llflyoutcombobtn.cpp
llfolderviewmodelinventory.cpp
llfollowcam.cpp
llfriendcard.cpp
llflyoutcombobtn.cpp
llgesturelistener.cpp
llgesturemgr.cpp
llgiveinventory.cpp
......@@ -363,17 +367,17 @@ set(viewer_SOURCE_FILES
llgroupactions.cpp
llgroupiconctrl.cpp
llgrouplist.cpp
llgroupoptions.cpp
llgroupmgr.cpp
llgroupoptions.cpp
llhasheduniqueid.cpp
llhints.cpp
llhttpretrypolicy.cpp
llhudeffect.cpp
llhudeffectbeam.cpp
llhudeffectblob.cpp
llhudeffectlookat.cpp
llhudeffectpointat.cpp
llhudeffecttrail.cpp
llhudeffectblob.cpp
llhudicon.cpp
llhudmanager.cpp
llhudnametag.cpp
......@@ -437,9 +441,6 @@ set(viewer_SOURCE_FILES
llnameeditor.cpp
llnamelistctrl.cpp
llnavigationbar.cpp
llfloaterimnearbychat.cpp
llfloaterimnearbychathandler.cpp
llfloaterimnearbychatlistener.cpp
llnetmap.cpp
llnotificationalerthandler.cpp
llnotificationgrouphandler.cpp
......@@ -453,8 +454,8 @@ set(viewer_SOURCE_FILES
llnotificationstorage.cpp
llnotificationtiphandler.cpp
lloutfitgallery.cpp
lloutfitslist.cpp
lloutfitobserver.cpp
lloutfitslist.cpp
lloutputmonitorctrl.cpp
llpanelappearancetab.cpp
llpanelavatar.cpp
......@@ -466,6 +467,7 @@ set(viewer_SOURCE_FILES
llpaneleditwater.cpp
llpaneleditwearable.cpp
llpanelenvironment.cpp
llpaneleventinfo.cpp
llpanelexperiencelisteditor.cpp
llpanelexperiencelog.cpp
llpanelexperiencepicker.cpp
......@@ -473,9 +475,9 @@ set(viewer_SOURCE_FILES
llpanelface.cpp
llpanelgenerictip.cpp
llpanelgroup.cpp
llpanelgroupcreate.cpp
llpanelgroupbulk.cpp
llpanelgroupbulkban.cpp
llpanelgroupcreate.cpp
llpanelgroupexperiences.cpp
llpanelgroupgeneral.cpp
llpanelgroupinvite.cpp
......@@ -516,6 +518,14 @@ set(viewer_SOURCE_FILES
llpanelprofile.cpp
llpanelprofileclassifieds.cpp
llpanelprofilepicks.cpp
llpanelpulldown.cpp
llpanelsearchbase.cpp
llpanelsearchclassifieds.cpp
llpanelsearchevents.cpp
llpanelsearchgroups.cpp
llpanelsearchlandsales.cpp
llpanelsearchpeople.cpp
llpanelsearchplaces.cpp
llpanelsnapshot.cpp
llpanelsnapshotinventory.cpp
llpanelsnapshotlocal.cpp
......@@ -524,10 +534,9 @@ set(viewer_SOURCE_FILES
llpanelsnapshotprofile.cpp
llpanelteleporthistory.cpp
llpaneltiptoast.cpp
llpanelvoiceeffect.cpp
llpaneltopinfobar.cpp
llpanelpulldown.cpp
llpanelvoicedevicesettings.cpp
llpanelvoiceeffect.cpp
llpanelvolume.cpp
llpanelvolumepulldown.cpp
llpanelwearing.cpp
......@@ -549,9 +558,9 @@ set(viewer_SOURCE_FILES
llphysicsmotion.cpp
llphysicsshapebuilderutil.cpp
llpipelinelistener.cpp
llplacesfolderview.cpp
llplacesinventorybridge.cpp
llplacesinventorypanel.cpp
llplacesfolderview.cpp
llpopupview.cpp
llpostcard.cpp
llpresetsmanager.cpp
......@@ -629,8 +638,8 @@ set(viewer_SOURCE_FILES
lltoastimpanel.cpp
lltoastnotifypanel.cpp
lltoastpanel.cpp
lltoastscripttextbox.cpp
lltoastscriptquestion.cpp
lltoastscripttextbox.cpp
lltool.cpp
lltoolbarview.cpp
lltoolbrush.cpp
......@@ -686,15 +695,15 @@ set(viewer_SOURCE_FILES
llviewerhelp.cpp
llviewerhelputil.cpp
llviewerhome.cpp
llviewerinput.cpp
llviewerinventory.cpp
llviewerjoint.cpp
llviewerjointattachment.cpp
llviewerjointmesh.cpp
llviewerjoystick.cpp
llviewerinput.cpp
llviewerlayer.cpp
llviewermedia.cpp
llviewermedia_streamingaudio.cpp
llviewermedia.cpp
llviewermediafocus.cpp
llviewermenu.cpp
llviewermenufile.cpp
......@@ -723,7 +732,7 @@ set(viewer_SOURCE_FILES
llviewerwearable.cpp
llviewerwindow.cpp
llviewerwindowlistener.cpp
llvisualeffect.cpp
llvisualeffect.cpp
llvlcomposition.cpp
llvlmanager.cpp
llvoavatar.cpp
......@@ -755,16 +764,16 @@ set(viewer_SOURCE_FILES
llworld.cpp
llworldmap.cpp
llworldmapmessage.cpp
llworldmipmap.cpp
llworldmapview.cpp
llworldmipmap.cpp
llxmlrpclistener.cpp
llxmlrpctransaction.cpp
noise.cpp
pipeline.cpp
rlvactions.cpp
rlvenvironment.cpp
rlvcommon.cpp
rlveffects.cpp
rlvenvironment.cpp
rlvextensions.cpp
rlvfloaters.cpp
rlvhandler.cpp
......@@ -780,11 +789,11 @@ set(VIEWER_BINARY_NAME "alchemy-bin" CACHE STRING
set(viewer_HEADER_FILES
CMakeLists.txt
ViewerInstall.cmake
alcinematicmode.h
alaoengine.h
alaoset.h
alavataractions.h
alchatcommand.h
alcinematicmode.h
alcontrolcache.h
alfloaterao.h
alfloaterparticleeditor.h
......@@ -800,7 +809,6 @@ set(viewer_HEADER_FILES
groupchatlistener.h
llaccountingcost.h
llaccountingcostmanager.h
llaisapi.h
llagent.h
llagentaccess.h
llagentbenefits.h
......@@ -812,6 +820,7 @@ set(viewer_HEADER_FILES
llagentpilot.h
llagentui.h
llagentwearables.h
llaisapi.h
llanimstatelabels.h
llappcorehttp.h
llappearance.h
......@@ -865,15 +874,15 @@ set(viewer_HEADER_FILES
lldeferredsounds.h
lldelayedgestureerror.h
lldirpicker.h
lldonotdisturbnotificationstorage.h
lldndbutton.h
lldonotdisturbnotificationstorage.h
lldrawable.h
lldrawpool.h
lldrawpoolalpha.h
lldrawpoolavatar.h
lldrawpoolbump.h
lldrawpoolmaterials.h
lldrawpoolground.h
lldrawpoolmaterials.h
lldrawpoolsimple.h
lldrawpoolsky.h
lldrawpoolterrain.h
......@@ -899,7 +908,6 @@ set(viewer_HEADER_FILES
llflexibleobject.h
llfloaterabout.h
llfloaterassetrecovery.h
llfloaterbvhpreview.h
llfloaterauction.h
llfloaterautoreplacesettings.h
llfloateravatar.h
......@@ -917,8 +925,9 @@ set(viewer_HEADER_FILES
llfloaterbuycurrency.h
llfloaterbuycurrencyhtml.h
llfloaterbuyland.h
llfloatercamerapresets.h
llfloaterbvhpreview.h
llfloatercamera.h
llfloatercamerapresets.h
llfloaterchatalerts.h
llfloaterchatvoicevolume.h
llfloatercolorpicker.h
......@@ -926,6 +935,7 @@ set(viewer_HEADER_FILES
llfloaterconversationpreview.h
llfloaterdeleteprefpreset.h
llfloaterdestinations.h
llfloaterdirectory.h
llfloaterdisplayname.h
llfloatereditenvironmentbase.h
llfloatereditextdaycycle.h
......@@ -949,12 +959,12 @@ set(viewer_HEADER_FILES
llfloaterhoverheight.h
llfloaterhud.h
llfloaterimagepreview.h
llfloaterimcontainer.h
llfloaterimnearbychat.h
llfloaterimnearbychathandler.h
llfloaterimnearbychatlistener.h
llfloaterimsessiontab.h
llfloaterimsession.h
llfloaterimcontainer.h
llfloaterimsessiontab.h
llfloaterinspect.h
llfloaterjoystick.h
llfloaterlagmeter.h
......@@ -968,15 +978,15 @@ set(viewer_HEADER_FILES
llfloatermemleak.h
llfloatermodelpreview.h
llfloatermodeluploadbase.h
llfloatermyscripts.h
llfloatermyenvironment.h
llfloatermyscripts.h
llfloaternamedesc.h
llfloaternotificationsconsole.h
llfloaternotificationstabbed.h
llfloateroutfitphotopreview.h
llfloateroutfitsnapshot.h
llfloaterobjectweights.h
llfloateropenobject.h
llfloateroutfitphotopreview.h
llfloateroutfitsnapshot.h
llfloaterpathfindingcharacters.h
llfloaterpathfindingconsole.h
llfloaterpathfindinglinksets.h
......@@ -984,15 +994,15 @@ set(viewer_HEADER_FILES
llfloaterpay.h
llfloaterperms.h
llfloaterpostprocess.h
llfloaterprofile.h
llfloaterpreference.h
llfloaterpreferenceviewadvanced.h
llfloaterpreviewtrash.h
llfloaterprofile.h
llfloaterproperties.h
llfloaterregiondebugconsole.h
llfloaterregioninfo.h
llfloaterreporter.h
llfloaterregionrestarting.h
llfloaterreporter.h
llfloatersavecamerapreset.h
llfloatersaveprefpreset.h
llfloatersceneloadstats.h
......@@ -1024,27 +1034,27 @@ set(viewer_HEADER_FILES
llfloaterwhitelistentry.h
llfloaterwindowsize.h
llfloaterworldmap.h
llflyoutcombobtn.h
llfolderviewmodelinventory.h
llfollowcam.h
llfriendcard.h
llflyoutcombobtn.h
llgesturelistener.h
llgesturemgr.h
llgiveinventory.h
llgroupactions.h
llgroupiconctrl.h
llgrouplist.h
llgroupoptions.h
llgroupmgr.h
llgroupoptions.h
llhasheduniqueid.h
llhints.h
llhttpretrypolicy.h
llhudeffect.h
llhudeffectbeam.h
llhudeffectblob.h
llhudeffectlookat.h
llhudeffectpointat.h
llhudeffecttrail.h
llhudeffectblob.h
llhudicon.h
llhudmanager.h
llhudnametag.h
......@@ -1114,8 +1124,8 @@ set(viewer_HEADER_FILES
llnotificationmanager.h
llnotificationstorage.h
lloutfitgallery.h
lloutfitslist.h
lloutfitobserver.h
lloutfitslist.h
lloutputmonitorctrl.h
llpanelappearancetab.h
llpanelavatar.h
......@@ -1127,6 +1137,7 @@ set(viewer_HEADER_FILES
llpaneleditwater.h
llpaneleditwearable.h
llpanelenvironment.h
llpaneleventinfo.h
llpanelexperiencelisteditor.h
llpanelexperiencelog.h
llpanelexperiencepicker.h
......@@ -1134,10 +1145,10 @@ set(viewer_HEADER_FILES
llpanelface.h
llpanelgenerictip.h
llpanelgroup.h
llpanelgroupcreate.h
llpanelgroupbulk.h
llpanelgroupbulkimpl.h
llpanelgroupbulkban.h
llpanelgroupbulkimpl.h
llpanelgroupcreate.h
llpanelgroupexperiences.h
llpanelgroupgeneral.h
llpanelgroupinvite.h
......@@ -1178,13 +1189,20 @@ set(viewer_HEADER_FILES
llpanelprofile.h
llpanelprofileclassifieds.h
llpanelprofilepicks.h
llpanelpulldown.h
llpanelsearchbase.h
llpanelsearchclassifieds.h
llpanelsearchevents.h
llpanelsearchgroups.h
llpanelsearchlandsales.h
llpanelsearchpeople.h
llpanelsearchplaces.h
llpanelsnapshot.h
llpanelteleporthistory.h
llpaneltiptoast.h
llpanelpulldown.h
llpaneltopinfobar.h
llpanelvoicedevicesettings.h
llpanelvoiceeffect.h
llpaneltopinfobar.h
llpanelvolume.h
llpanelvolumepulldown.h
llpanelwearing.h
......@@ -1206,9 +1224,9 @@ set(viewer_HEADER_FILES
llphysicsmotion.h
llphysicsshapebuilderutil.h
llpipelinelistener.h
llplacesfolderview.h
llplacesinventorybridge.h
llplacesinventorypanel.h
llplacesfolderview.h
llpopupview.h
llpostcard.h
llpresetsmanager.h
......@@ -1290,8 +1308,8 @@ set(viewer_HEADER_FILES
lltoastimpanel.h
lltoastnotifypanel.h
lltoastpanel.h
lltoastscripttextbox.h
lltoastscriptquestion.h
lltoastscripttextbox.h
lltool.h
lltoolbarview.h
lltoolbrush.h
......@@ -1316,8 +1334,8 @@ set(viewer_HEADER_FILES
lltransientdockablefloater.h
lltransientfloatermgr.h
lltranslate.h
lluiconstants.h
lluiavatar.h
lluiconstants.h
lluilistener.h
lluploaddialog.h
lluploadfloaterobservers.h
......@@ -1348,15 +1366,15 @@ set(viewer_HEADER_FILES
llviewergesture.h
llviewerhelp.h
llviewerhome.h
llviewerinput.h
llviewerinventory.h
llviewerjoint.h
llviewerjointattachment.h
llviewerjointmesh.h
llviewerjoystick.h
llviewerinput.h
llviewerlayer.h
llviewermedia.h
llviewermedia_streamingaudio.h
llviewermedia.h
llviewermediafocus.h
llviewermediaobserver.h
llviewermenu.h
......@@ -1387,7 +1405,7 @@ set(viewer_HEADER_FILES
llviewerwearable.h
llviewerwindow.h
llviewerwindowlistener.h
llvisualeffect.h
llvisualeffect.h
llvlcomposition.h
llvlmanager.h
llvoavatar.h
......@@ -1418,8 +1436,8 @@ set(viewer_HEADER_FILES
llworld.h
llworldmap.h
llworldmapmessage.h
llworldmipmap.h
llworldmapview.h
llworldmipmap.h
llxmlrpclistener.h
llxmlrpctransaction.h
macmain.h
......
......@@ -255,6 +255,28 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>AlchemyFindLandSort</key>
<map>
<key>Comment</key>
<string>Controls the sort order for land you are searching for ("Name", "Price", "PPM", "Area")</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>Name</string>
</map>
<key>AlchemyFindLandSortAscending</key>
<map>
<key>Comment</key>
<string>Controls whether the sort order for land you are searching for is displayed in ascending or descending order</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<string>0</string>
</map>
<key>AlchemyHudTextFadeDistance</key>
<map>
<key>Comment</key>
......
......@@ -163,11 +163,12 @@ bool LLEventNotifier::handleResponse(U32 eventId, const LLSD& notification, cons
return true;
}
bool LLEventNotifier::add(U32 eventId, F64 eventEpoch, const std::string& eventDateStr, const std::string &eventName)
bool LLEventNotifier::add(const LLEventStruct& event)
{
LLEventNotification *new_enp = new LLEventNotification(eventId, eventEpoch, eventDateStr, eventName);
if (mNewEventSignal(event)) return false;
LLEventNotification *new_enp = new LLEventNotification(event.eventId, event.eventEpoch, event.eventDateStr, event.eventName);
LL_INFOS() << "Add event " << eventName << " id " << eventId << " date " << eventDateStr << LL_ENDL;
LL_INFOS() << "Add event " << event.eventName << " id " << event.eventId << " date " << event.eventDateStr << LL_ENDL;
if(!new_enp->isValid())
{
delete new_enp;
......@@ -208,7 +209,18 @@ void LLEventNotifier::processEventInfoReply(LLMessageSystem *msg, void **)
msg->getString("EventData", "Date", eventd_date);
msg->getU32("EventData", "DateUTC", event_time_utc);
gEventNotifier.add(event_id, (F64)event_time_utc, eventd_date, event_name);
LLEventStruct event(event_id, (F64)event_time_utc, eventd_date, event_name);
msg->getString("EventData", "Creator", event.creator);
msg->getString("EventData", "Category", event.category);
msg->getString("EventData", "Desc", event.desc);
msg->getU32("EventData", "Duration", event.duration);
msg->getU32("EventData", "Cover", event.cover);
msg->getU32("EventData", "Amount", event.amount);
msg->getString("EventData", "SimName", event.simName);
msg->getVector3d("EventData", "GlobalPos", event.globalPos);
msg->getU32("EventData", "EventFlags", event.flags);
gEventNotifier.add(event);
}
......@@ -219,7 +231,8 @@ void LLEventNotifier::load(const LLSD& event_options)
{
LLSD response = *resp_it;
add(response["event_id"].asInteger(), response["event_date_ut"], response["event_date"].asString(), response["event_name"].asString());
LLEventStruct event(response["event_id"].asInteger(), response["event_date_ut"], response["event_date"].asString(), response["event_name"].asString());
add(event);
}
}
......
......@@ -33,6 +33,24 @@
class LLEventNotification;
class LLMessageSystem;
typedef struct event_st{
U32 eventId;
F64 eventEpoch;
std::string eventDateStr;
std::string eventName;
std::string creator;
std::string category;
std::string desc;
U32 duration;
U32 cover;
U32 amount;
std::string simName;
LLVector3d globalPos;
U32 flags;
event_st(U32 id, F64 epoch, const std::string& date_str, const std::string& name)
: eventId(id), eventEpoch(epoch), eventDateStr(date_str), eventName(name){}
event_st(){}
} LLEventStruct;
class LLEventNotifier
{
......@@ -41,7 +59,7 @@ class LLEventNotifier
virtual ~LLEventNotifier();
void update(); // Notify the user of the event if it's coming up
bool add(U32 eventId, F64 eventEpoch, const std::string& eventDateStr, const std::string &eventName);
bool add(const LLEventStruct& event);
void add(U32 eventId);
......@@ -54,7 +72,14 @@ class LLEventNotifier
typedef std::map<U32, LLEventNotification *> en_map;
bool handleResponse(U32 eventId, const LLSD& notification, const LLSD& response);
static void processEventInfoReply(LLMessageSystem *msg, void **);
static void processEventInfoReply(LLMessageSystem *msg, void **);
typedef boost::signals2::signal<bool(LLEventStruct event)> new_event_signal_t;
new_event_signal_t mNewEventSignal;
boost::signals2::connection setNewEventCallback(const new_event_signal_t::slot_type& cb)
{
return mNewEventSignal.connect(cb);
};
protected:
en_map mEventNotifications;
......
This diff is collapsed.
/*
* @file llfloaterdirectory.h
* @brief Legacy search facility definitions
*
* Copyright (c) 2014, Cinder Roxley <cinder@sdf.org>
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
#ifndef LL_FLOATERDIRECTORY_H
#define LL_FLOATERDIRECTORY_H
#include "llfloater.h"
class LLUICtrl;
class LLPanel;
class LLScrollListCtrl;
class LLTextBase;
class LLRemoteParcelInfoObserver;
static const size_t MIN_SEARCH_STRING_SIZE = 3;
typedef enum {
SE_UNDEFINED = 0,
SE_PEOPLE,
SE_GROUPS,
SE_PLACES,
SE_LANDSALES,
SE_EVENTS,
SE_CLASSIFIEDS
} ESearch;
typedef struct dir_query
{
public:
dir_query()
: type(SE_UNDEFINED), text(LLStringUtil::null), scope(0),
category_int(0), category_char(0x0), price(0), area(0), results_per_page(100) {}
ESearch type;
std::string text;
U32 scope;
U32 category_int;
S8 category_char;
S32 price;
S32 area;
U32 results_per_page;
} LLDirQuery;
class LLFloaterDirectory : public LLFloater
{
friend class LLPanelSearchClassifieds;
friend class LLPanelSearchEvents;
friend class LLPanelSearchGroups;
friend class LLPanelSearchLandSales;
friend class LLPanelSearchPeople;
friend class LLPanelSearchPlaces;
public:
LLFloaterDirectory(const LLSD& key);
BOOL postBuild();
static void processSearchPeopleReply(LLMessageSystem* msg, void**);
static void processSearchGroupsReply(LLMessageSystem* msg, void**);
static void processSearchPlacesReply(LLMessageSystem* msg, void**);
static void processSearchClassifiedsReply(LLMessageSystem* msg, void**);
static void processSearchLandReply(LLMessageSystem* msg, void**);
static void processSearchEventsReply(LLMessageSystem* msg, void**);
protected:
void setProgress(bool working);
void queryDirectory(const LLDirQuery& query, bool new_search = false);
void setResultsComment(const std::string& message);
private:
~LLFloaterDirectory();
void onCommitSelection();
void choosePage(const LLSD& userdata);
void paginate();
void showDetailPanel(const std::string& panel_name);
void rebuildResultList();
ESearch mCurrentResultType;
LLDirQuery mCurrentQuery;
S32 mResultStart;
S32 mNumResultsReceived;
LLUUID mQueryID;
LLPanel* mDetailPeople;
LLScrollListCtrl* mResultList;
LLTextBase* mResultsStatus;
LLRemoteParcelInfoObserver* mRemoteParcelObserver;
};
#endif // LL_FLOATERDIRECTORY_H
......@@ -82,6 +82,8 @@ static LLDispatchClassifiedClickThrough sClassifiedClickThrough;
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
static LLPanelInjector<LLPanelClassifiedInfo> t_classified_info("panel_classified_info");
LLPanelClassifiedInfo::LLPanelClassifiedInfo()
: LLPanel()
, mInfoLoaded(false)
......@@ -151,7 +153,7 @@ void LLPanelClassifiedInfo::onOpen(const LLSD& key)
LLUUID avatar_id = key["classified_creator_id"];
if(avatar_id.isNull())
{
return;
//return;
}
if(getAvatarId().notNull())
......
/*
* @file llpaneleventinfo.cpp
* @brief Event info panel
*
* Copyright (c) 2014, Cinder Roxley <cinder@sdf.org>
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
#include "llviewerprecompiledheaders.h"
#include "llpaneleventinfo.h"
#include "llbutton.h"
#include "lleventflags.h"
#include "lliconctrl.h"
#include "llfloaterreg.h"
#include "llresmgr.h"
#include "llslurl.h"
#include "lltrans.h"
#include "llagent.h"
#include "llfloaterworldmap.h"
#include "llviewercontrol.h"
static LLPanelInjector<LLPanelEventInfo> t_event_info("panel_event_info");
LLPanelEventInfo::LLPanelEventInfo()
: LLPanel()
, mEvent()
, mEventID(0)
{
mEventNotifierConnection = gEventNotifier.setNewEventCallback(boost::bind(&LLPanelEventInfo::processEventReply, this, _1));
}
LLPanelEventInfo::~LLPanelEventInfo()
{
if (mEventNotifierConnection.connected())
{
mEventNotifierConnection.disconnect();
}
}
BOOL LLPanelEventInfo::postBuild()
{
childSetAction("teleport_btn", boost::bind(&LLPanelEventInfo::onBtnTeleport, this));
childSetAction("show_on_map_btn", boost::bind(&LLPanelEventInfo::onBtnMap, this));
childSetAction("remind_btn", boost::bind(&LLPanelEventInfo::onBtnRemind, this));
return TRUE;
}
void LLPanelEventInfo::onOpen(const LLSD& key)
{
U32 id(key.asInteger());
setEventID(id);
gEventNotifier.add(getEventID());
}
// *TODO: localize this bitch.
std::string LLPanelEventInfo::formatFromMinutes(U32 time)
{
U32 hours = time / 60;
U32 minutes = time % 60;
std::ostringstream output;
if (hours)
output << hours << " " << getString("hours") << " ";
if (minutes)
output << minutes << " " << getString("minutes");
return output.str();
}
bool LLPanelEventInfo::processEventReply(const LLEventStruct& event)
{
if (event.eventId != getEventID()) return false; // no
mEvent = event;
getChild<LLUICtrl>("name")->setValue(mEvent.eventName);
getChild<LLUICtrl>("desc")->setValue(mEvent.desc);
getChild<LLUICtrl>("duration")->setValue(formatFromMinutes(mEvent.duration));
getChild<LLUICtrl>("host")->setValue(LLSLURL("agent", LLUUID(mEvent.creator), "inspect").getSLURLString());
getChild<LLUICtrl>("time")->setValue(mEvent.eventDateStr);
// *TODO: Prettier
//std::string time;
//LLStringUtil::formatDatetime(time, "%a %d %b %Y %H:%M", "slt", mEvent.eventEpoch);
//getChild<LLUICtrl>("time")->setValue(time);
// *TODO: Add translation strings
//getChild<LLUICtrl>("category")->setValue(LLTrans::getString(mEvent.category));
getChild<LLUICtrl>("category")->setValue(mEvent.category);
getChild<LLUICtrl>("cover")->setValue(mEvent.cover
? LLResMgr::getInstance()->getMonetaryString(mEvent.amount)
: getString("free"));
bool mature = (mEvent.flags & EVENT_FLAG_MATURE);
getChild<LLUICtrl>("content_type")->setValue(getString(mature ? "type_mature" : "type_pg"));
getChild<LLIconCtrl>("content_type_moderate")->setVisible(mature);
getChild<LLIconCtrl>("content_type_general")->setVisible(!mature);
getChild<LLUICtrl>("location")->setValue(LLSLURL(mEvent.simName, mEvent.globalPos).getSLURLString());
getChild<LLButton>("remind_btn")->setLabel(getString(gEventNotifier.hasNotification(mEvent.eventId)
? "no_reminder"
: "reminder"));
return true;
}
void LLPanelEventInfo::onBtnTeleport()
{
if (!mEvent.globalPos.isExactlyZero())
{
gAgent.teleportViaLocation(mEvent.globalPos);
LLFloaterWorldMap* worldmap = LLFloaterWorldMap::getInstance();
if (worldmap)
worldmap->trackLocation(mEvent.globalPos);
}
}
void LLPanelEventInfo::onBtnMap()
{
LLFloaterWorldMap* worldmap = LLFloaterWorldMap::getInstance();
if (!mEvent.globalPos.isExactlyZero() && worldmap)
{
worldmap->trackLocation(mEvent.globalPos);
LLFloaterReg::showInstance("world_map", "center");
}
}
void LLPanelEventInfo::onBtnRemind()
{
if (gEventNotifier.hasNotification(mEvent.eventId))
{
gEventNotifier.remove(mEvent.eventId);
getChild<LLButton>("remind_btn")->setLabel(getString("reminder"));
}
else
{
gEventNotifier.add(mEvent.eventId);
getChild<LLButton>("remind_btn")->setLabel(getString("no_reminder"));
}
}
/*
* @file llpaneleventinfo.cpp
* @brief Event info panel
*
* Copyright (c) 2014, Cinder Roxley <cinder@sdf.org>
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
#ifndef LL_PANELEVENTINFO_H
#define LL_PANELEVENTINFO_H
#include "llpanel.h"
#include "lleventnotifier.h"
class LLPanelEventInfo : public LLPanel
{
public:
LLPanelEventInfo();
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
private:
~LLPanelEventInfo();
bool processEventReply(const LLEventStruct& event);
std::string formatFromMinutes(U32 time);
void setEventID(U32 id) { mEventID = id; }
U32 getEventID() const { return mEventID; }
void onBtnTeleport();
void onBtnMap();
void onBtnRemind();
LLEventStruct mEvent;
U32 mEventID;
boost::signals2::connection mEventNotifierConnection;
};
#endif // LL_PANELEVENTINFO_H
/*
* @file llpanelsearchbase.cpp
* @brief Search panel base class
*
* Copyright (c) 2014, Cinder Roxley <cinder@sdf.org>
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
#include "llviewerprecompiledheaders.h"
#include "llpanelsearchbase.h"
#include "llfloaterdirectory.h"
LLPanelSearch::LLPanelSearch()
: LLPanel()
{
}
void LLPanelSearch::setSearchFloater(LLFloaterDirectory* floater)
{
mFloater = floater;
}
/*
* @file llpanelsearchbase.h
* @brief Search panel base class
*
* Copyright (c) 2014, Cinder Roxley <cinder@sdf.org>
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
#ifndef LL_PANELSEARCHBASE_H
#define LL_PANELSEARCHBASE_H
#include "llpanel.h"
class LLUICtrl;
class LLFloaterDirectory;
class LLPanelSearch : public LLPanel
{
public:
LLPanelSearch();
/* virtual */ BOOL postBuild() { return FALSE; }
void setSearchFloater(LLFloaterDirectory* floater);
protected:
virtual ~LLPanelSearch() {};
LLFloaterDirectory* mFloater;
private:
virtual void onCommitSearch(LLUICtrl* ctrl) {}
virtual void search() {}
};
#endif // LL_PANELSEARCHBASE_H
/*
* @file llpanelsearchclassifieds.cpp
* @brief Groups search panel
*
* Copyright (c) 2014, Cinder Roxley <cinder@sdf.org>
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
#include "llviewerprecompiledheaders.h"
#include "llpanelsearchclassifieds.h"
#include "llfloaterdirectory.h"
#include "llfloaterreg.h"
#include "llqueryflags.h"
#include "lltrans.h"
#include "llagent.h"
#include "llclassifiedflags.h"
#include "llclassifiedinfo.h"
#include "llcombobox.h"
#include "llnotificationsutil.h"
#include "llparcel.h"
#include "llsearcheditor.h"
#include "llsearchhistory.h"
static LLPanelInjector<LLPanelSearchClassifieds> t_panel_search_classifieds("panel_search_classifieds");
LLPanelSearchClassifieds::LLPanelSearchClassifieds()
: LLPanelSearch()
{
mCommitCallbackRegistrar.add("Search.query", boost::bind(&LLPanelSearchClassifieds::onCommitSearch, this, _1));
}
BOOL LLPanelSearchClassifieds::postBuild()
{
mClassifiedsCategory = getChild<LLComboBox>("classifieds_category");
mClassifiedsCategory->add("All categories", LLSD("any"));
mClassifiedsCategory->addSeparator();
LLClassifiedInfo::cat_map::iterator iter;
for (iter = LLClassifiedInfo::sCategories.begin();
iter != LLClassifiedInfo::sCategories.end();
++iter)
{
mClassifiedsCategory->add(LLTrans::getString(iter->second));
}
mSearchEditor = getChild<LLSearchEditor>("search_bar");
//mSearchEditor->setKeystrokeCallback(boost::bind(&LLPanelSearchClassifieds::onCommitSearch, this, _1));
return TRUE;
}
void LLPanelSearchClassifieds::onCommitSearch(LLUICtrl* ctrl)
{
LLSearchEditor* pSearchEditor = dynamic_cast<LLSearchEditor*>(ctrl);
if (pSearchEditor)
{
std::string text = pSearchEditor->getText();
LLStringUtil::trim(text);
if (text.length() <= MIN_SEARCH_STRING_SIZE)
LLSearchHistory::getInstance()->addEntry(text);
}
search();
}
void LLPanelSearchClassifieds::search()
{
LLDirQuery query;
query.type = SE_CLASSIFIEDS;
query.results_per_page = 100;
query.text = mSearchEditor->getText();
LLStringUtil::trim(query.text);
query.category_int = mClassifiedsCategory->getValue().asInteger();
static LLUICachedControl<bool> inc_pg("ShowPGClassifieds", 1);
static LLUICachedControl<bool> inc_mature("ShowMatureClassifieds", 0);
static LLUICachedControl<bool> inc_adult("ShowAdultClassifieds", 0);
if (!(inc_pg || inc_mature || inc_adult))
{
LLNotificationsUtil::add("NoContentToSearch");
return;
}
query.scope = pack_classified_flags_request(/*auto_renew*/ FALSE, inc_pg, inc_mature, inc_adult);
mFloater->queryDirectory(query, true);
}
/*
* @file llpanelsearchclassifieds.h
* @brief Groups search panel
*
* Copyright (c) 2014, Cinder Roxley <cinder@sdf.org>
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
#ifndef LL_PANELSEARCHCLASSIFIEDS_H
#define LL_PANELSEARCHCLASSIFIEDS_H
#include "llpanelsearchbase.h"
class LLComboBox;
class LLSearchEditor;
class LLPanelSearchClassifieds : public LLPanelSearch
{
public:
LLPanelSearchClassifieds();
/*virtual*/ BOOL postBuild();
private:
/*virtual*/ void onCommitSearch(LLUICtrl* ctrl);
/*virtual*/ void search();
LLSearchEditor* mSearchEditor;
LLComboBox* mClassifiedsCategory;
};
#endif // LL_PANELSEARCHCLASSIFIEDS_H
/*
* @file llpanelsearchevents.cpp
* @brief Events search panel
*
* Copyright (c) 2014, Cinder Roxley <cinder@sdf.org>
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
#include "llviewerprecompiledheaders.h"
#include "llpanelsearchevents.h"
#include "llfloaterdirectory.h"
#include "llfloaterreg.h"
#include "llqueryflags.h"
#include "llagent.h"
#include "llcombobox.h"
#include "llnotificationsutil.h"
#include "llparcel.h"
#include "llsearcheditor.h"
#include "llsearchhistory.h"
static LLPanelInjector<LLPanelSearchEvents> t_panel_search_events("panel_search_events");
LLPanelSearchEvents::LLPanelSearchEvents()
: LLPanelSearch()
, mDate(0)
{
mCommitCallbackRegistrar.add("Search.query", boost::bind(&LLPanelSearchEvents::onCommitSearch, this, _1));
mCommitCallbackRegistrar.add("Search.AddDay", boost::bind(&LLPanelSearchEvents::addDay, this));
mCommitCallbackRegistrar.add("Search.MinusDay", boost::bind(&LLPanelSearchEvents::minusDay, this));
}
BOOL LLPanelSearchEvents::postBuild()
{
mSearchEditor = getChild<LLSearchEditor>("search_bar");
//mSearchEditor->setKeystrokeCallback(boost::bind(&LLPanelSearchEvents::onCommitSearch, this, _1));
setDate(0);
return TRUE;
}
void LLPanelSearchEvents::onCommitSearch(LLUICtrl* ctrl)
{
LLSearchEditor* pSearchEditor = dynamic_cast<LLSearchEditor*>(ctrl);
if (pSearchEditor)
{
std::string text = pSearchEditor->getText();
LLStringUtil::trim(text);
if (text.length() <= MIN_SEARCH_STRING_SIZE)
LLSearchHistory::getInstance()->addEntry(text);
}
search();
}
void LLPanelSearchEvents::search()
{
LLDirQuery query;
query.type = SE_EVENTS;
query.results_per_page = 200;
std::string text = mSearchEditor->getText();
LLStringUtil::trim(text);
static LLUICachedControl<bool> inc_pg("ShowPGEvents", 1);
static LLUICachedControl<bool> inc_mature("ShowMatureEvents", 0);
static LLUICachedControl<bool> inc_adult("ShowAdultEvents", 0);
if (!(inc_pg || inc_mature || inc_adult))
{
LLNotificationsUtil::add("NoContentToSearch");
return;
}
query.scope = DFQ_DATE_EVENTS;
if (inc_pg)
query.scope |= DFQ_INC_PG;
if (inc_mature && gAgent.canAccessMature())
query.scope |= DFQ_INC_MATURE;
if (inc_adult && gAgent.canAccessAdult())
query.scope |= DFQ_INC_ADULT;
std::ostringstream string;
string << (childGetValue("events_search_mode").asString() == "current" ? "u" : llformat("%d",mDate)) << "|"
<< getChild<LLComboBox>("events_category")->getSelectedValue().asInteger() << "|"
<< text;
query.text = string.str();
mFloater->queryDirectory(query, true);
}
void LLPanelSearchEvents::setDate(S32 day)
{
mDate = day;
struct tm* internal_time;
time_t utc = time_corrected();
utc += day * 24 * 60 * 60;
internal_time = utc_to_pacific_time(utc, is_daylight_savings());
const std::string date = llformat("%d/%d", 1 + internal_time->tm_mon, internal_time->tm_mday);
childSetValue("events_date", date);
}
void LLPanelSearchEvents::addDay()
{
setDate(++mDate);
if (childGetValue("events_search_mode").asString() == "date")
search();
}
void LLPanelSearchEvents::minusDay()
{
setDate(--mDate);
if (childGetValue("events_search_mode").asString() == "date")
search();
}
/*
* @file llpanelsearchevents.h
* @brief Events search panel
*
* Copyright (c) 2014, Cinder Roxley <cinder@sdf.org>
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
#ifndef LL_PANELSEARCHEVENTS_H
#define LL_PANELSEARCHEVENTS_H
#include "llpanelsearchbase.h"
class LLComboBox;
class LLSearchEditor;
class LLPanelSearchEvents : public LLPanelSearch
{
public:
LLPanelSearchEvents();
/*virtual*/ BOOL postBuild();
private:
/*virtual*/ void onCommitSearch(LLUICtrl* ctrl);
/*virtual*/ void search();
void setDate(S32 day);
void addDay();
void minusDay();
S32 mDate;
LLSearchEditor* mSearchEditor;
};
#endif // LL_PANELSEARCHEVENTS_H
/*
* @file llpanelsearchgroups.cpp
* @brief Groups search panel
*
* Copyright (c) 2014, Cinder Roxley <cinder@sdf.org>
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
#include "llviewerprecompiledheaders.h"
#include "llpanelsearchgroups.h"
#include "llfloaterdirectory.h"
#include "llfloaterreg.h"
#include "llqueryflags.h"
#include "llagent.h"
#include "llnotificationsutil.h"
#include "llsearcheditor.h"
#include "llsearchhistory.h"
static LLPanelInjector<LLPanelSearchGroups> t_panel_search_groups("panel_search_groups");
LLPanelSearchGroups::LLPanelSearchGroups()
: LLPanelSearch()
{
mCommitCallbackRegistrar.add("Search.query", boost::bind(&LLPanelSearchGroups::onCommitSearch, this, _1));
}
BOOL LLPanelSearchGroups::postBuild()
{
mSearchEditor = getChild<LLSearchEditor>("search_bar");
//mSearchEditor->setKeystrokeCallback(boost::bind(&LLPanelSearchGroups::onCommitSearch, this, _1));
return TRUE;
}
void LLPanelSearchGroups::onCommitSearch(LLUICtrl* ctrl)
{
LLSearchEditor* pSearchEditor = dynamic_cast<LLSearchEditor*>(ctrl);
if (pSearchEditor)
{
std::string text = pSearchEditor->getText();
LLStringUtil::trim(text);
if (text.length() <= MIN_SEARCH_STRING_SIZE)
LLSearchHistory::getInstance()->addEntry(text);
}
search();
}
void LLPanelSearchGroups::search()
{
LLDirQuery query;
query.type = SE_GROUPS;
query.results_per_page = 100;
query.text = mSearchEditor->getText();
LLStringUtil::trim(query.text);
static LLUICachedControl<bool> inc_pg("ShowPGGroups", 1);
static LLUICachedControl<bool> inc_mature("ShowMatureGroups", 0);
static LLUICachedControl<bool> inc_adult("ShowAdultGroups", 0);
if (!(inc_pg || inc_mature || inc_adult))
{
LLNotificationsUtil::add("NoContentToSearch");
return;
}
if (inc_pg)
query.scope |= DFQ_INC_PG;
if (inc_mature && gAgent.canAccessMature())
query.scope |= DFQ_INC_MATURE;
if (inc_adult && gAgent.canAccessAdult())
query.scope |= DFQ_INC_ADULT;
query.scope |= DFQ_GROUPS;
mFloater->queryDirectory(query, true);
}
/*
* @file llpanelsearchgroups.h
* @brief Groups search panel
*
* Copyright (c) 2014, Cinder Roxley <cinder@sdf.org>
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
#ifndef LL_PANELSEARCHGROUPS_H
#define LL_PANELSEARCHGROUPS_H
#include "llpanelsearchbase.h"
class LLSearchEditor;
class LLPanelSearchGroups : public LLPanelSearch
{
public:
LLPanelSearchGroups();
/*virtual*/ BOOL postBuild();
private:
/*virtual*/ void onCommitSearch(LLUICtrl* ctrl);
/*virtual*/ void search();
LLSearchEditor* mSearchEditor;
};
#endif // LL_PANELSEARCHGROUPS_H
/*
* @file llpanelsearchlandsales.cpp
* @brief Groups search panel
*
* Copyright (c) 2014, Cinder Roxley <cinder@sdf.org>
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
#include "llviewerprecompiledheaders.h"
#include "llpanelsearchlandsales.h"
#include "llfloaterdirectory.h"
#include "llfloaterreg.h"
#include "llqueryflags.h"
#include "llagent.h"
#include "llnotificationsutil.h"
#include "llsearcheditor.h"
#include "llsearchhistory.h"
#include "llviewercontrol.h"
static LLPanelInjector<LLPanelSearchLandSales> t_panel_search_land_sales("panel_search_landsales");
LLPanelSearchLandSales::LLPanelSearchLandSales()
: LLPanelSearch()
{
mCommitCallbackRegistrar.add("Search.query", boost::bind(&LLPanelSearchLandSales::onCommitSearch, this, _1));
}
BOOL LLPanelSearchLandSales::postBuild()
{
return TRUE;
}
void LLPanelSearchLandSales::onCommitSearch(LLUICtrl* ctrl)
{
search();
}
void LLPanelSearchLandSales::search()
{
LLDirQuery query;
query.type = SE_LANDSALES;
query.results_per_page = 100;
static LLUICachedControl<bool> inc_pg("ShowPGLand", 1);
static LLUICachedControl<bool> inc_mature("ShowMatureLand", 0);
static LLUICachedControl<bool> inc_adult("ShowAdultLand", 0);
static LLUICachedControl<bool> limit_price("FindLandPrice", 1);
static LLUICachedControl<bool> limit_area("FindLandArea", 1);
if (!(inc_pg || inc_mature || inc_adult))
{
LLNotificationsUtil::add("NoContentToSearch");
return;
}
const std::string& type = gSavedSettings.getString("FindLandType");
if (type == "All")
query.category_int = ST_ALL;
else if (type == "Auction")
query.category_int = ST_AUCTION;
else if (type == "Mainland")
query.category_int = ST_MAINLAND;
else if (type == "Estate")
query.category_int = ST_ESTATE;
if (gAgent.wantsPGOnly())
query.scope |= DFQ_PG_SIMS_ONLY;
if (inc_pg)
query.scope |= DFQ_INC_PG;
if (inc_mature && gAgent.canAccessMature())
query.scope |= DFQ_INC_MATURE;
if (inc_adult && gAgent.canAccessAdult())
query.scope |= DFQ_INC_ADULT;
const std::string& sort = gSavedSettings.getString("AlchemyFindLandSort");
if (sort == "Name")
query.scope |= DFQ_NAME_SORT;
else if (sort == "Price")
query.scope |= DFQ_PRICE_SORT;
else if (sort == "PPM")
query.scope |= DFQ_PER_METER_SORT;
else if (sort == "Area")
query.scope |= DFQ_AREA_SORT;
if (gSavedSettings.getBOOL("AlchemyFindLandSortAscending"))
query.scope |= DFQ_SORT_ASC;
if (limit_price)
query.scope |= DFQ_LIMIT_BY_PRICE;
if (limit_area)
query.scope |= DFQ_LIMIT_BY_AREA;
query.price = childGetValue("edit_price").asInteger();
query.area = childGetValue("edit_area").asInteger();
mFloater->queryDirectory(query, true);
}
/*
* @file llpanelsearchlandsales.h
* @brief Land sale search panel
*
* Copyright (c) 2014, Cinder Roxley <cinder@sdf.org>
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
#ifndef LL_PANELSEARCHLANDSALES_H
#define LL_PANELSEARCHLANDSALES_H
#include "llpanelsearchbase.h"
class LLPanelSearchLandSales : public LLPanelSearch
{
public:
LLPanelSearchLandSales();
/*virtual*/ BOOL postBuild();
private:
/*virtual*/ void search();
/*virtual*/ void onCommitSearch(LLUICtrl* ctrl);
};
#endif // LL_PANELSEARCHLANDSALES_H
/*
* @file llpanelsearchpeople.cpp
* @brief People search panel
*
* Copyright (c) 2014, Cinder Roxley <cinder@sdf.org>
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
#include "llviewerprecompiledheaders.h"
#include "llpanelsearchpeople.h"
#include "llfloaterdirectory.h"
#include "llfloaterreg.h"
#include "llagent.h"
#include "llsearcheditor.h"
#include "llsearchhistory.h"
static LLPanelInjector<LLPanelSearchPeople> t_panel_search_people("panel_search_people");
LLPanelSearchPeople::LLPanelSearchPeople()
: LLPanelSearch()
{
mCommitCallbackRegistrar.add("Search.query", boost::bind(&LLPanelSearchPeople::onCommitSearch, this, _1));
}
BOOL LLPanelSearchPeople::postBuild()
{
mSearchEditor = getChild<LLSearchEditor>("search_bar");
//mSearchEditor->setKeystrokeCallback(boost::bind(&LLPanelSearchPeople::onCommitSearch, this, _1));
return TRUE;
}
void LLPanelSearchPeople::onCommitSearch(LLUICtrl* ctrl)
{
LLSearchEditor* pSearchEditor = dynamic_cast<LLSearchEditor*>(ctrl);
if (pSearchEditor)
{
std::string text = pSearchEditor->getText();
LLStringUtil::trim(text);
if (text.length() <= MIN_SEARCH_STRING_SIZE)
LLSearchHistory::getInstance()->addEntry(text);
}
search();
}
bool isNotAlphaNum(char c)
{
return !std::isalnum(c);
}
void LLPanelSearchPeople::search()
{
LLDirQuery query;
query.type = SE_PEOPLE;
query.results_per_page = 100;
query.text = mSearchEditor->getText();
std::replace_if(query.text.begin(), query.text.end(), isNotAlphaNum, ' ');
LLStringUtil::trim(query.text);
mFloater->queryDirectory(query, true);
if (query.text.length() < MIN_SEARCH_STRING_SIZE)
mFloater->setResultsComment(getString("SeachFilteredOnShortWordsEmpty"));
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment