llpaneldirgroups.cpp

Go to the documentation of this file.
00001 
00032 #include "llviewerprecompiledheaders.h"
00033 
00034 #include "llpaneldirgroups.h"
00035 
00036 // linden library includes
00037 #include "llagent.h"
00038 //#include "llfontgl.h"
00039 #include "message.h"
00040 #include "llqueryflags.h"
00041 #include "llviewercontrol.h"
00042 
00043 // viewer project includes
00044 
00045 LLPanelDirGroups::LLPanelDirGroups(const std::string& name, LLFloaterDirectory* floater)
00046         :       LLPanelDirBrowser(name, floater)
00047 {
00048         mMinSearchChars = 3;
00049 }
00050 
00051 
00052 BOOL LLPanelDirGroups::postBuild()
00053 {
00054         LLPanelDirBrowser::postBuild();
00055 
00056         childSetKeystrokeCallback("name", &LLPanelDirBrowser::onKeystrokeName, this);
00057 
00058         childSetAction("Search", &LLPanelDirBrowser::onClickSearchCore, this);
00059         childDisable("Search");
00060         setDefaultBtn( "Search" );
00061 
00062         return TRUE;
00063 }
00064 
00065 LLPanelDirGroups::~LLPanelDirGroups()
00066 {
00067         // Children all cleaned up by default view destructor.
00068 }
00069 
00070 // virtual
00071 void LLPanelDirGroups::draw()
00072 {
00073         // You only have a choice if you are mature
00074         childSetVisible("incmature", !gAgent.isTeen());
00075         childSetValue("incmature", gSavedSettings.getBOOL("ShowMatureGroups"));
00076         
00077         LLPanelDirBrowser::draw();
00078 }
00079 
00080 
00081 // virtual
00082 void LLPanelDirGroups::performQuery()
00083 {
00084         if (childGetValue("name").asString().length() < mMinSearchChars)
00085         {
00086                 return;
00087         }
00088 
00089         setupNewSearch();
00090 
00091         // groups
00092         U32 scope = DFQ_GROUPS;
00093 
00094         // Check group mature filter.
00095         if ( !gSavedSettings.getBOOL("ShowMatureGroups") 
00096                                    || gAgent.isTeen() )
00097         {
00098                 scope |= DFQ_FILTER_MATURE;
00099         }
00100 
00101         mCurrentSortColumn = "score";
00102         mCurrentSortAscending = FALSE;
00103 
00104         // send the message
00105         sendDirFindQuery(
00106                 gMessageSystem,
00107                 mSearchID,
00108                 childGetValue("name").asString(),
00109                 scope,
00110                 mSearchStart);
00111 }

Generated on Thu Jul 1 06:08:56 2010 for Second Life Viewer by  doxygen 1.4.7