aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelclassified.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llpanelclassified.cpp')
-rw-r--r--linden/indra/newview/llpanelclassified.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/linden/indra/newview/llpanelclassified.cpp b/linden/indra/newview/llpanelclassified.cpp
index 45c4e38..7908ccc 100644
--- a/linden/indra/newview/llpanelclassified.cpp
+++ b/linden/indra/newview/llpanelclassified.cpp
@@ -60,7 +60,7 @@
60#include "lltexturectrl.h" 60#include "lltexturectrl.h"
61#include "lluiconstants.h" 61#include "lluiconstants.h"
62#include "llurldispatcher.h" // for classified HTML detail click teleports 62#include "llurldispatcher.h" // for classified HTML detail click teleports
63#include "llvieweruictrlfactory.h" 63#include "lluictrlfactory.h"
64#include "llviewerparcelmgr.h" 64#include "llviewerparcelmgr.h"
65#include "llviewerwindow.h" 65#include "llviewerwindow.h"
66#include "llworldmap.h" 66#include "llworldmap.h"
@@ -184,11 +184,11 @@ LLPanelClassified::LLPanelClassified(bool in_finder, bool from_search)
184 std::string classified_def_file; 184 std::string classified_def_file;
185 if (mInFinder) 185 if (mInFinder)
186 { 186 {
187 gUICtrlFactory->buildPanel(this, "panel_classified.xml"); 187 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_classified.xml");
188 } 188 }
189 else 189 else
190 { 190 {
191 gUICtrlFactory->buildPanel(this, "panel_avatar_classified.xml"); 191 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_classified.xml");
192 } 192 }
193 193
194 // Register dispatcher 194 // Register dispatcher
@@ -223,12 +223,12 @@ void LLPanelClassified::reset()
223 223
224BOOL LLPanelClassified::postBuild() 224BOOL LLPanelClassified::postBuild()
225{ 225{
226 mSnapshotCtrl = LLViewerUICtrlFactory::getTexturePickerByName(this, "snapshot_ctrl"); 226 mSnapshotCtrl = getChild<LLTextureCtrl>("snapshot_ctrl");
227 mSnapshotCtrl->setCommitCallback(onCommitAny); 227 mSnapshotCtrl->setCommitCallback(onCommitAny);
228 mSnapshotCtrl->setCallbackUserData(this); 228 mSnapshotCtrl->setCallbackUserData(this);
229 mSnapshotSize = mSnapshotCtrl->getRect(); 229 mSnapshotSize = mSnapshotCtrl->getRect();
230 230
231 mNameEditor = LLViewerUICtrlFactory::getLineEditorByName(this, "given_name_editor"); 231 mNameEditor = getChild<LLLineEditor>("given_name_editor");
232 mNameEditor->setMaxTextLength(DB_PARCEL_NAME_LEN); 232 mNameEditor->setMaxTextLength(DB_PARCEL_NAME_LEN);
233 mNameEditor->setCommitOnFocusLost(TRUE); 233 mNameEditor->setCommitOnFocusLost(TRUE);
234 mNameEditor->setFocusReceivedCallback(focusReceived, this); 234 mNameEditor->setFocusReceivedCallback(focusReceived, this);
@@ -236,35 +236,35 @@ BOOL LLPanelClassified::postBuild()
236 mNameEditor->setCallbackUserData(this); 236 mNameEditor->setCallbackUserData(this);
237 mNameEditor->setPrevalidate( LLLineEditor::prevalidateASCII ); 237 mNameEditor->setPrevalidate( LLLineEditor::prevalidateASCII );
238 238
239 mDescEditor = LLUICtrlFactory::getTextEditorByName(this, "desc_editor"); 239 mDescEditor = getChild<LLTextEditor>("desc_editor");
240 mDescEditor->setCommitOnFocusLost(TRUE); 240 mDescEditor->setCommitOnFocusLost(TRUE);
241 mDescEditor->setFocusReceivedCallback(focusReceived, this); 241 mDescEditor->setFocusReceivedCallback(focusReceived, this);
242 mDescEditor->setCommitCallback(onCommitAny); 242 mDescEditor->setCommitCallback(onCommitAny);
243 mDescEditor->setCallbackUserData(this); 243 mDescEditor->setCallbackUserData(this);
244 mDescEditor->setTabsToNextField(TRUE); 244 mDescEditor->setTabsToNextField(TRUE);
245 245
246 mLocationEditor = LLViewerUICtrlFactory::getLineEditorByName(this, "location_editor"); 246 mLocationEditor = getChild<LLLineEditor>("location_editor");
247 247
248 mSetBtn = LLViewerUICtrlFactory::getButtonByName(this, "set_location_btn"); 248 mSetBtn = getChild<LLButton>( "set_location_btn");
249 mSetBtn->setClickedCallback(onClickSet); 249 mSetBtn->setClickedCallback(onClickSet);
250 mSetBtn->setCallbackUserData(this); 250 mSetBtn->setCallbackUserData(this);
251 251
252 mTeleportBtn = LLViewerUICtrlFactory::getButtonByName(this, "classified_teleport_btn"); 252 mTeleportBtn = getChild<LLButton>( "classified_teleport_btn");
253 mTeleportBtn->setClickedCallback(onClickTeleport); 253 mTeleportBtn->setClickedCallback(onClickTeleport);
254 mTeleportBtn->setCallbackUserData(this); 254 mTeleportBtn->setCallbackUserData(this);
255 255
256 mMapBtn = LLViewerUICtrlFactory::getButtonByName(this, "classified_map_btn"); 256 mMapBtn = getChild<LLButton>( "classified_map_btn");
257 mMapBtn->setClickedCallback(onClickMap); 257 mMapBtn->setClickedCallback(onClickMap);
258 mMapBtn->setCallbackUserData(this); 258 mMapBtn->setCallbackUserData(this);
259 259
260 if(mInFinder) 260 if(mInFinder)
261 { 261 {
262 mProfileBtn = LLViewerUICtrlFactory::getButtonByName(this, "classified_profile_btn"); 262 mProfileBtn = getChild<LLButton>( "classified_profile_btn");
263 mProfileBtn->setClickedCallback(onClickProfile); 263 mProfileBtn->setClickedCallback(onClickProfile);
264 mProfileBtn->setCallbackUserData(this); 264 mProfileBtn->setCallbackUserData(this);
265 } 265 }
266 266
267 mCategoryCombo = LLViewerUICtrlFactory::getComboBoxByName(this, "classified_category_combo"); 267 mCategoryCombo = getChild<LLComboBox>( "classified_category_combo");
268 LLClassifiedInfo::cat_map::iterator iter; 268 LLClassifiedInfo::cat_map::iterator iter;
269 for (iter = LLClassifiedInfo::sCategories.begin(); 269 for (iter = LLClassifiedInfo::sCategories.begin();
270 iter != LLClassifiedInfo::sCategories.end(); 270 iter != LLClassifiedInfo::sCategories.end();
@@ -276,7 +276,7 @@ BOOL LLPanelClassified::postBuild()
276 mCategoryCombo->setCommitCallback(onCommitAny); 276 mCategoryCombo->setCommitCallback(onCommitAny);
277 mCategoryCombo->setCallbackUserData(this); 277 mCategoryCombo->setCallbackUserData(this);
278 278
279 mMatureCheck = LLViewerUICtrlFactory::getCheckBoxByName(this, "classified_mature_check"); 279 mMatureCheck = getChild<LLCheckBoxCtrl>( "classified_mature_check");
280 mMatureCheck->setCommitCallback(onCommitAny); 280 mMatureCheck->setCommitCallback(onCommitAny);
281 mMatureCheck->setCallbackUserData(this); 281 mMatureCheck->setCallbackUserData(this);
282 if (gAgent.isTeen()) 282 if (gAgent.isTeen())
@@ -287,18 +287,18 @@ BOOL LLPanelClassified::postBuild()
287 287
288 if (!mInFinder) 288 if (!mInFinder)
289 { 289 {
290 mAutoRenewCheck = LLUICtrlFactory::getCheckBoxByName(this, "auto_renew_check"); 290 mAutoRenewCheck = getChild<LLCheckBoxCtrl>( "auto_renew_check");
291 mAutoRenewCheck->setCommitCallback(onCommitAny); 291 mAutoRenewCheck->setCommitCallback(onCommitAny);
292 mAutoRenewCheck->setCallbackUserData(this); 292 mAutoRenewCheck->setCallbackUserData(this);
293 } 293 }
294 294
295 mUpdateBtn = LLUICtrlFactory::getButtonByName(this, "classified_update_btn"); 295 mUpdateBtn = getChild<LLButton>("classified_update_btn");
296 mUpdateBtn->setClickedCallback(onClickUpdate); 296 mUpdateBtn->setClickedCallback(onClickUpdate);
297 mUpdateBtn->setCallbackUserData(this); 297 mUpdateBtn->setCallbackUserData(this);
298 298
299 if (!mInFinder) 299 if (!mInFinder)
300 { 300 {
301 mClickThroughText = LLUICtrlFactory::getTextBoxByName(this, "click_through_text"); 301 mClickThroughText = getChild<LLTextBox>("click_through_text");
302 } 302 }
303 303
304 return TRUE; 304 return TRUE;
@@ -351,10 +351,10 @@ void LLPanelClassified::saveCallback(S32 option, void* data)
351 LLView* view = self; 351 LLView* view = self;
352 while (view) 352 while (view)
353 { 353 {
354 if (view->getWidgetType() == WIDGET_TYPE_FLOATER) 354 LLFloater* floaterp = dynamic_cast<LLFloater*>(view);
355 if (floaterp)
355 { 356 {
356 LLFloater* f = (LLFloater*)view; 357 floaterp->close();
357 f->close();
358 break; 358 break;
359 } 359 }
360 view = view->getParent(); 360 view = view->getParent();
@@ -393,7 +393,7 @@ void LLPanelClassified::initNewClassified()
393 mPaidFor = FALSE; 393 mPaidFor = FALSE;
394 394
395 // Try to fill in the current parcel 395 // Try to fill in the current parcel
396 LLParcel* parcel = gParcelMgr->getAgentParcel(); 396 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
397 if (parcel) 397 if (parcel)
398 { 398 {
399 mNameEditor->setText(parcel->getName()); 399 mNameEditor->setText(parcel->getName());
@@ -674,17 +674,16 @@ void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void **
674 self->mUpdateBtn->setLabel(self->getString("update_txt")); 674 self->mUpdateBtn->setLabel(self->getString("update_txt"));
675 675
676 self->resetDirty(); 676 self->resetDirty();
677
678 self->resetDirty();
677 } 679 }
678} 680}
679 681
680void LLPanelClassified::draw() 682void LLPanelClassified::draw()
681{ 683{
682 if (getVisible()) 684 refresh();
683 {
684 refresh();
685 685
686 LLPanel::draw(); 686 LLPanel::draw();
687 }
688} 687}
689 688
690 689
@@ -709,12 +708,13 @@ void LLPanelClassified::refresh()
709 if(godlike) 708 if(godlike)
710 { 709 {
711 //make it smaller, so text is more legible 710 //make it smaller, so text is more legible
712 mSnapshotCtrl->setRect(LLRect(20, 375, 320, 175)); 711 mSnapshotCtrl->setOrigin(20, 175);
713 712 mSnapshotCtrl->reshape(300, 200);
714 } 713 }
715 else 714 else
716 { 715 {
717 mSnapshotCtrl->setRect(mSnapshotSize); 716 mSnapshotCtrl->setOrigin(mSnapshotSize.mLeft, mSnapshotSize.mBottom);
717 mSnapshotCtrl->reshape(mSnapshotSize.getWidth(), mSnapshotSize.getHeight());
718 //normal 718 //normal
719 } 719 }
720 mNameEditor->setEnabled(godlike); 720 mNameEditor->setEnabled(godlike);
@@ -1004,7 +1004,7 @@ LLFloaterPriceForListing::~LLFloaterPriceForListing()
1004//virtual 1004//virtual
1005BOOL LLFloaterPriceForListing::postBuild() 1005BOOL LLFloaterPriceForListing::postBuild()
1006{ 1006{
1007 LLLineEditor* edit = LLUICtrlFactory::getLineEditorByName(this, "price_edit"); 1007 LLLineEditor* edit = getChild<LLLineEditor>("price_edit");
1008 if (edit) 1008 if (edit)
1009 { 1009 {
1010 edit->setPrevalidate(LLLineEditor::prevalidateNonNegativeS32); 1010 edit->setPrevalidate(LLLineEditor::prevalidateNonNegativeS32);
@@ -1028,7 +1028,7 @@ void LLFloaterPriceForListing::show( void (*callback)(S32, LLString, void*), voi
1028 LLFloaterPriceForListing *self = new LLFloaterPriceForListing(); 1028 LLFloaterPriceForListing *self = new LLFloaterPriceForListing();
1029 1029
1030 // Builds and adds to gFloaterView 1030 // Builds and adds to gFloaterView
1031 gUICtrlFactory->buildFloater(self, "floater_price_for_listing.xml"); 1031 LLUICtrlFactory::getInstance()->buildFloater(self, "floater_price_for_listing.xml");
1032 self->center(); 1032 self->center();
1033 1033
1034 self->mCallback = callback; 1034 self->mCallback = callback;