diff options
author | Jacek Antonelli | 2008-08-15 23:45:35 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:35 -0500 |
commit | 7a29b2d1cd471767b58ea30f53900cd2c5a9637c (patch) | |
tree | a2f7b5eb90ec41f903f2558e57d47f5ebd913a8f /linden/indra/newview/llpanellandmedia.cpp | |
parent | Second Life viewer sources 1.19.1.0 (diff) | |
download | meta-impy-7a29b2d1cd471767b58ea30f53900cd2c5a9637c.zip meta-impy-7a29b2d1cd471767b58ea30f53900cd2c5a9637c.tar.gz meta-impy-7a29b2d1cd471767b58ea30f53900cd2c5a9637c.tar.bz2 meta-impy-7a29b2d1cd471767b58ea30f53900cd2c5a9637c.tar.xz |
Second Life viewer sources 1.19.1.1
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llpanellandmedia.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/linden/indra/newview/llpanellandmedia.cpp b/linden/indra/newview/llpanellandmedia.cpp index c8f79b5..cb8e8c5 100644 --- a/linden/indra/newview/llpanellandmedia.cpp +++ b/linden/indra/newview/llpanellandmedia.cpp | |||
@@ -124,7 +124,6 @@ BOOL LLPanelLandMedia::postBuild() | |||
124 | mMediaTypeCombo = LLUICtrlFactory::getComboBoxByName(this, "media type"); | 124 | mMediaTypeCombo = LLUICtrlFactory::getComboBoxByName(this, "media type"); |
125 | childSetCommitCallback("media type", onCommitType, this); | 125 | childSetCommitCallback("media type", onCommitType, this); |
126 | populateMIMECombo(); | 126 | populateMIMECombo(); |
127 | mMediaTypeCombo->sortByName(); | ||
128 | 127 | ||
129 | mMediaWidthCtrl = LLUICtrlFactory::getSpinnerByName(this, "media_size_width"); | 128 | mMediaWidthCtrl = LLUICtrlFactory::getSpinnerByName(this, "media_size_width"); |
130 | childSetCommitCallback("media_size_width", onCommitAny, this); | 129 | childSetCommitCallback("media_size_width", onCommitAny, this); |
@@ -275,14 +274,28 @@ void LLPanelLandMedia::refresh() | |||
275 | 274 | ||
276 | void LLPanelLandMedia::populateMIMECombo() | 275 | void LLPanelLandMedia::populateMIMECombo() |
277 | { | 276 | { |
277 | LLString default_mime_type = "none/none"; | ||
278 | LLString default_label; | ||
278 | LLMIMETypes::mime_widget_set_map_t::const_iterator it; | 279 | LLMIMETypes::mime_widget_set_map_t::const_iterator it; |
279 | for (it = LLMIMETypes::sWidgetMap.begin(); it != LLMIMETypes::sWidgetMap.end(); ++it) | 280 | for (it = LLMIMETypes::sWidgetMap.begin(); it != LLMIMETypes::sWidgetMap.end(); ++it) |
280 | { | 281 | { |
281 | const LLString& mime_type = it->first; | 282 | const LLString& mime_type = it->first; |
282 | const LLMIMETypes::LLMIMEWidgetSet& info = it->second; | 283 | const LLMIMETypes::LLMIMEWidgetSet& info = it->second; |
283 | mMediaTypeCombo->add(info.mLabel, mime_type); | 284 | if (info.mDefaultMimeType == default_mime_type) |
285 | { | ||
286 | // Add this label at the end to make UI look cleaner | ||
287 | default_label = info.mLabel; | ||
288 | } | ||
289 | else | ||
290 | { | ||
291 | mMediaTypeCombo->add(info.mLabel, mime_type); | ||
292 | } | ||
284 | } | 293 | } |
294 | // *TODO: The sort order is based on std::map key, which is | ||
295 | // ASCII-sorted and is wrong in other languages. TRANSLATE | ||
296 | mMediaTypeCombo->add( default_label, default_mime_type, ADD_BOTTOM ); | ||
285 | } | 297 | } |
298 | |||
286 | void LLPanelLandMedia::setMediaType(const LLString& mime_type) | 299 | void LLPanelLandMedia::setMediaType(const LLString& mime_type) |
287 | { | 300 | { |
288 | LLParcel *parcel = mParcel->getParcel(); | 301 | LLParcel *parcel = mParcel->getParcel(); |
@@ -298,7 +311,11 @@ void LLPanelLandMedia::setMediaURL(const LLString& media_url) | |||
298 | { | 311 | { |
299 | mMediaURLEdit->setText(media_url); | 312 | mMediaURLEdit->setText(media_url); |
300 | mMediaURLEdit->onCommit(); | 313 | mMediaURLEdit->onCommit(); |
314 | } | ||
301 | 315 | ||
316 | LLString LLPanelLandMedia::getMediaURL() | ||
317 | { | ||
318 | return mMediaURLEdit->getText(); | ||
302 | } | 319 | } |
303 | 320 | ||
304 | // static | 321 | // static |
@@ -314,8 +331,9 @@ void LLPanelLandMedia::onCommitType(LLUICtrl *ctrl, void *userdata) | |||
314 | onCommitAny(ctrl, userdata); | 331 | onCommitAny(ctrl, userdata); |
315 | 332 | ||
316 | } | 333 | } |
334 | |||
317 | // static | 335 | // static |
318 | void LLPanelLandMedia::onCommitAny(LLUICtrl *ctrl, void *userdata) | 336 | void LLPanelLandMedia::onCommitAny(LLUICtrl*, void *userdata) |
319 | { | 337 | { |
320 | LLPanelLandMedia *self = (LLPanelLandMedia *)userdata; | 338 | LLPanelLandMedia *self = (LLPanelLandMedia *)userdata; |
321 | 339 | ||