aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2009-08-29 17:44:38 -0500
committerJacek Antonelli2009-08-29 22:49:51 -0500
commit6a5aab98892df74f60743f5b789959c9593d6647 (patch)
tree62da18f8540879ed01e12eeb0ce49375474272e4 /linden/indra/newview/llappviewer.cpp
parentMerge branch 'mac-openal-url' into next (diff)
parentConverted 1.23 XUI files to unix line endings. (diff)
downloadmeta-impy-6a5aab98892df74f60743f5b789959c9593d6647.zip
meta-impy-6a5aab98892df74f60743f5b789959c9593d6647.tar.gz
meta-impy-6a5aab98892df74f60743f5b789959c9593d6647.tar.bz2
meta-impy-6a5aab98892df74f60743f5b789959c9593d6647.tar.xz
Merged SL 1.23.4 into Imprudence.
Conflicts: linden/doc/contributions.txt linden/indra/CMakeLists.txt linden/indra/cmake/APR.cmake linden/indra/cmake/CopyWinLibs.cmake linden/indra/cmake/OPENAL.cmake linden/indra/develop.py linden/indra/llaudio/audioengine.cpp linden/indra/llcommon/indra_constants.h linden/indra/llcommon/llversionviewer.h linden/indra/llcrashlogger/llcrashlogger.cpp linden/indra/llmedia/llmediaimplgstreamer.cpp linden/indra/llmedia/llmediaimplgstreamer.h linden/indra/llmedia/llmediaimplgstreamer_syms.cpp linden/indra/llmedia/llmediaimplgstreamer_syms.h linden/indra/llmedia/llmediaimplgstreamer_syms_raw.inc linden/indra/llmedia/llmediamanager.cpp linden/indra/llmessage/llassetstorage.cpp linden/indra/llui/lltexteditor.cpp linden/indra/llvfs/lldir.cpp linden/indra/newview/CMakeLists.txt linden/indra/newview/English.lproj/InfoPlist.strings linden/indra/newview/Info-Imprudence.plist linden/indra/newview/app_settings/logcontrol.xml linden/indra/newview/app_settings/settings.xml linden/indra/newview/installers/windows/installer_template.nsi linden/indra/newview/llagent.cpp linden/indra/newview/llappviewer.cpp linden/indra/newview/llcallingcard.cpp linden/indra/newview/llfilepicker.cpp linden/indra/newview/llfloateractivespeakers.cpp linden/indra/newview/llfloateravatarpicker.cpp linden/indra/newview/llfloaterbulkpermission.cpp linden/indra/newview/llfloaterbulkpermission.h linden/indra/newview/llfloaterchat.cpp linden/indra/newview/llfloatergodtools.cpp linden/indra/newview/llfloaterhtmlhelp.cpp linden/indra/newview/llfloatertools.cpp linden/indra/newview/llfloatertools.h linden/indra/newview/llfloatertopobjects.cpp linden/indra/newview/llinventorybridge.cpp linden/indra/newview/llinventoryview.cpp linden/indra/newview/llnetmap.cpp linden/indra/newview/llnetmap.h linden/indra/newview/llpanelland.cpp linden/indra/newview/llpanellogin.cpp linden/indra/newview/llpanelobject.cpp linden/indra/newview/llprefsim.cpp linden/indra/newview/lltexturecache.cpp linden/indra/newview/lltoolbrush.cpp linden/indra/newview/llvieweraudio.cpp linden/indra/newview/llviewermenu.cpp linden/indra/newview/llviewermessage.cpp linden/indra/newview/llviewerparcelmedia.cpp linden/indra/newview/llvoavatar.cpp linden/indra/newview/llwebbrowserctrl.cpp linden/indra/newview/llworldmapview.cpp linden/indra/newview/pipeline.cpp linden/indra/newview/res/viewerRes.rc linden/indra/newview/skins/default/colors_base.xml linden/indra/newview/skins/default/xui/de/floater_active_speakers.xml linden/indra/newview/skins/default/xui/de/floater_instant_message_ad_hoc.xml linden/indra/newview/skins/default/xui/de/floater_instant_message_group.xml linden/indra/newview/skins/default/xui/de/floater_joystick.xml linden/indra/newview/skins/default/xui/de/floater_mute_object.xml linden/indra/newview/skins/default/xui/de/floater_sim_release_message.xml linden/indra/newview/skins/default/xui/de/panel_media_controls.xml linden/indra/newview/skins/default/xui/de/panel_preferences_voice.xml linden/indra/newview/skins/default/xui/de/strings.xml linden/indra/newview/skins/default/xui/de/teleport_strings.xml linden/indra/newview/skins/default/xui/en-us/alerts.xml linden/indra/newview/skins/default/xui/en-us/floater_about_land.xml linden/indra/newview/skins/default/xui/en-us/floater_avatar_picker.xml linden/indra/newview/skins/default/xui/en-us/floater_beacons.xml linden/indra/newview/skins/default/xui/en-us/floater_bulk_perms.xml linden/indra/newview/skins/default/xui/en-us/floater_buy_land.xml linden/indra/newview/skins/default/xui/en-us/floater_chatterbox.xml linden/indra/newview/skins/default/xui/en-us/floater_inventory_view_finder.xml linden/indra/newview/skins/default/xui/en-us/floater_media_browser.xml linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml linden/indra/newview/skins/default/xui/en-us/floater_tools.xml linden/indra/newview/skins/default/xui/en-us/menu_login.xml linden/indra/newview/skins/default/xui/en-us/menu_mini_map.xml linden/indra/newview/skins/default/xui/en-us/menu_pie_attachment.xml linden/indra/newview/skins/default/xui/en-us/menu_pie_avatar.xml linden/indra/newview/skins/default/xui/en-us/menu_pie_object.xml linden/indra/newview/skins/default/xui/en-us/menu_pie_self.xml linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml linden/indra/newview/skins/default/xui/en-us/notify.xml linden/indra/newview/skins/default/xui/en-us/panel_bars.xml linden/indra/newview/skins/default/xui/en-us/panel_groups.xml linden/indra/newview/skins/default/xui/en-us/panel_media_controls.xml linden/indra/newview/skins/default/xui/en-us/panel_mini_map.xml linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml linden/indra/newview/skins/default/xui/en-us/panel_preferences_input.xml linden/indra/newview/skins/default/xui/en-us/panel_preferences_voice.xml linden/indra/newview/skins/default/xui/en-us/strings.xml linden/indra/newview/skins/default/xui/es/alerts.xml linden/indra/newview/skins/default/xui/es/floater_about.xml linden/indra/newview/skins/default/xui/es/floater_about_land.xml linden/indra/newview/skins/default/xui/es/floater_animation_preview.xml linden/indra/newview/skins/default/xui/es/floater_auction.xml linden/indra/newview/skins/default/xui/es/floater_avatar_picker.xml linden/indra/newview/skins/default/xui/es/floater_avatar_textures.xml linden/indra/newview/skins/default/xui/es/floater_build_options.xml linden/indra/newview/skins/default/xui/es/floater_bumps.xml linden/indra/newview/skins/default/xui/es/floater_buy_contents.xml linden/indra/newview/skins/default/xui/es/floater_buy_currency.xml linden/indra/newview/skins/default/xui/es/floater_buy_land.xml linden/indra/newview/skins/default/xui/es/floater_buy_object.xml linden/indra/newview/skins/default/xui/es/floater_chat_history.xml linden/indra/newview/skins/default/xui/es/floater_choose_group.xml linden/indra/newview/skins/default/xui/es/floater_clothing.xml linden/indra/newview/skins/default/xui/es/floater_color_picker.xml linden/indra/newview/skins/default/xui/es/floater_critical.xml linden/indra/newview/skins/default/xui/es/floater_customize.xml linden/indra/newview/skins/default/xui/es/floater_directory.xml linden/indra/newview/skins/default/xui/es/floater_gesture.xml linden/indra/newview/skins/default/xui/es/floater_group_info.xml linden/indra/newview/skins/default/xui/es/floater_html.xml linden/indra/newview/skins/default/xui/es/floater_im.xml linden/indra/newview/skins/default/xui/es/floater_image_preview.xml linden/indra/newview/skins/default/xui/es/floater_import.xml linden/indra/newview/skins/default/xui/es/floater_instant_message.xml linden/indra/newview/skins/default/xui/es/floater_inventory.xml linden/indra/newview/skins/default/xui/es/floater_inventory_item_properties.xml linden/indra/newview/skins/default/xui/es/floater_inventory_view_finder.xml linden/indra/newview/skins/default/xui/es/floater_land_holdings.xml linden/indra/newview/skins/default/xui/es/floater_live_lsleditor.xml linden/indra/newview/skins/default/xui/es/floater_moveview.xml linden/indra/newview/skins/default/xui/es/floater_mute.xml linden/indra/newview/skins/default/xui/es/floater_name_description.xml linden/indra/newview/skins/default/xui/es/floater_new_im.xml linden/indra/newview/skins/default/xui/es/floater_new_outfit_dialog.xml linden/indra/newview/skins/default/xui/es/floater_openobject.xml linden/indra/newview/skins/default/xui/es/floater_pay.xml linden/indra/newview/skins/default/xui/es/floater_pay_object.xml linden/indra/newview/skins/default/xui/es/floater_postcard.xml linden/indra/newview/skins/default/xui/es/floater_preferences.xml linden/indra/newview/skins/default/xui/es/floater_preview_animation.xml linden/indra/newview/skins/default/xui/es/floater_preview_embedded_texture.xml linden/indra/newview/skins/default/xui/es/floater_preview_gesture.xml linden/indra/newview/skins/default/xui/es/floater_preview_notecard.xml linden/indra/newview/skins/default/xui/es/floater_preview_notecard_keep_discard.xml linden/indra/newview/skins/default/xui/es/floater_preview_sound.xml linden/indra/newview/skins/default/xui/es/floater_preview_texture.xml linden/indra/newview/skins/default/xui/es/floater_preview_texture_keep_discard.xml linden/indra/newview/skins/default/xui/es/floater_price_for_listing.xml linden/indra/newview/skins/default/xui/es/floater_profile.xml linden/indra/newview/skins/default/xui/es/floater_report_abuse.xml linden/indra/newview/skins/default/xui/es/floater_script_debug.xml linden/indra/newview/skins/default/xui/es/floater_script_ed_panel.xml linden/indra/newview/skins/default/xui/es/floater_script_preview.xml linden/indra/newview/skins/default/xui/es/floater_script_queue.xml linden/indra/newview/skins/default/xui/es/floater_script_search.xml linden/indra/newview/skins/default/xui/es/floater_sell_land.xml linden/indra/newview/skins/default/xui/es/floater_settings_debug.xml linden/indra/newview/skins/default/xui/es/floater_snapshot.xml linden/indra/newview/skins/default/xui/es/floater_sound_preview.xml linden/indra/newview/skins/default/xui/es/floater_telehub.xml linden/indra/newview/skins/default/xui/es/floater_texture_ctrl.xml linden/indra/newview/skins/default/xui/es/floater_tools.xml linden/indra/newview/skins/default/xui/es/floater_top_objects.xml linden/indra/newview/skins/default/xui/es/floater_tos.xml linden/indra/newview/skins/default/xui/es/floater_wearable_save_as.xml linden/indra/newview/skins/default/xui/es/floater_world_map.xml linden/indra/newview/skins/default/xui/es/menu_inventory.xml linden/indra/newview/skins/default/xui/es/menu_pie_attachment.xml linden/indra/newview/skins/default/xui/es/menu_pie_avatar.xml linden/indra/newview/skins/default/xui/es/menu_pie_land.xml linden/indra/newview/skins/default/xui/es/menu_pie_object.xml linden/indra/newview/skins/default/xui/es/menu_pie_self.xml linden/indra/newview/skins/default/xui/es/menu_viewer.xml linden/indra/newview/skins/default/xui/es/notify.xml linden/indra/newview/skins/default/xui/es/panel_avatar.xml linden/indra/newview/skins/default/xui/es/panel_avatar_classified.xml linden/indra/newview/skins/default/xui/es/panel_avatar_pick.xml linden/indra/newview/skins/default/xui/es/panel_chat_bar.xml linden/indra/newview/skins/default/xui/es/panel_classified.xml linden/indra/newview/skins/default/xui/es/panel_event.xml linden/indra/newview/skins/default/xui/es/panel_group.xml linden/indra/newview/skins/default/xui/es/panel_group_finder.xml linden/indra/newview/skins/default/xui/es/panel_group_general.xml linden/indra/newview/skins/default/xui/es/panel_group_invite.xml linden/indra/newview/skins/default/xui/es/panel_group_land_money.xml linden/indra/newview/skins/default/xui/es/panel_group_notices.xml linden/indra/newview/skins/default/xui/es/panel_group_roles.xml linden/indra/newview/skins/default/xui/es/panel_group_voting.xml linden/indra/newview/skins/default/xui/es/panel_land_covenant.xml linden/indra/newview/skins/default/xui/es/panel_login.xml linden/indra/newview/skins/default/xui/es/panel_overlaybar.xml linden/indra/newview/skins/default/xui/es/panel_place.xml linden/indra/newview/skins/default/xui/es/panel_place_small.xml linden/indra/newview/skins/default/xui/es/panel_preferences_audio.xml linden/indra/newview/skins/default/xui/es/panel_preferences_chat.xml linden/indra/newview/skins/default/xui/es/panel_preferences_general.xml linden/indra/newview/skins/default/xui/es/panel_preferences_graphics1.xml linden/indra/newview/skins/default/xui/es/panel_preferences_im.xml linden/indra/newview/skins/default/xui/es/panel_preferences_input.xml linden/indra/newview/skins/default/xui/es/panel_preferences_network.xml linden/indra/newview/skins/default/xui/es/panel_preferences_popups.xml linden/indra/newview/skins/default/xui/es/panel_region_covenant.xml linden/indra/newview/skins/default/xui/es/panel_region_debug.xml linden/indra/newview/skins/default/xui/es/panel_region_estate.xml linden/indra/newview/skins/default/xui/es/panel_region_general.xml linden/indra/newview/skins/default/xui/es/panel_region_terrain.xml linden/indra/newview/skins/default/xui/es/panel_region_texture.xml linden/indra/newview/skins/default/xui/es/panel_scrolling_param.xml linden/indra/newview/skins/default/xui/es/panel_status_bar.xml linden/indra/newview/skins/default/xui/es/panel_toolbar.xml linden/indra/newview/skins/default/xui/es/panel_top_pick.xml linden/indra/newview/skins/default/xui/fr/alerts.xml linden/indra/newview/skins/default/xui/fr/floater_about.xml linden/indra/newview/skins/default/xui/fr/floater_about_land.xml linden/indra/newview/skins/default/xui/fr/floater_avatar_picker.xml linden/indra/newview/skins/default/xui/fr/floater_avatar_textures.xml linden/indra/newview/skins/default/xui/fr/floater_beacons.xml linden/indra/newview/skins/default/xui/fr/floater_buy_contents.xml linden/indra/newview/skins/default/xui/fr/floater_buy_currency.xml linden/indra/newview/skins/default/xui/fr/floater_buy_land.xml linden/indra/newview/skins/default/xui/fr/floater_chat_history.xml linden/indra/newview/skins/default/xui/fr/floater_clothing.xml linden/indra/newview/skins/default/xui/fr/floater_customize.xml linden/indra/newview/skins/default/xui/fr/floater_directory.xml linden/indra/newview/skins/default/xui/fr/floater_god_tools.xml linden/indra/newview/skins/default/xui/fr/floater_group_info.xml linden/indra/newview/skins/default/xui/fr/floater_html.xml linden/indra/newview/skins/default/xui/fr/floater_im.xml linden/indra/newview/skins/default/xui/fr/floater_instant_message.xml linden/indra/newview/skins/default/xui/fr/floater_instant_message_group.xml linden/indra/newview/skins/default/xui/fr/floater_inventory.xml linden/indra/newview/skins/default/xui/fr/floater_inventory_view_finder.xml linden/indra/newview/skins/default/xui/fr/floater_joystick.xml linden/indra/newview/skins/default/xui/fr/floater_land_holdings.xml linden/indra/newview/skins/default/xui/fr/floater_live_lsleditor.xml linden/indra/newview/skins/default/xui/fr/floater_media_browser.xml linden/indra/newview/skins/default/xui/fr/floater_mem_leaking.xml linden/indra/newview/skins/default/xui/fr/floater_name_description.xml linden/indra/newview/skins/default/xui/fr/floater_preview_gesture.xml linden/indra/newview/skins/default/xui/fr/floater_profile.xml linden/indra/newview/skins/default/xui/fr/floater_report_abuse.xml linden/indra/newview/skins/default/xui/fr/floater_script_search.xml linden/indra/newview/skins/default/xui/fr/floater_sell_land.xml linden/indra/newview/skins/default/xui/fr/floater_snapshot.xml linden/indra/newview/skins/default/xui/fr/floater_sound_preview.xml linden/indra/newview/skins/default/xui/fr/floater_tools.xml linden/indra/newview/skins/default/xui/fr/floater_top_objects.xml linden/indra/newview/skins/default/xui/fr/floater_world_map.xml linden/indra/newview/skins/default/xui/fr/menu_inventory.xml linden/indra/newview/skins/default/xui/fr/menu_login.xml linden/indra/newview/skins/default/xui/fr/menu_pie_attachment.xml linden/indra/newview/skins/default/xui/fr/menu_pie_avatar.xml linden/indra/newview/skins/default/xui/fr/menu_pie_object.xml linden/indra/newview/skins/default/xui/fr/menu_viewer.xml linden/indra/newview/skins/default/xui/fr/notify.xml linden/indra/newview/skins/default/xui/fr/panel_audio.xml linden/indra/newview/skins/default/xui/fr/panel_avatar.xml linden/indra/newview/skins/default/xui/fr/panel_avatar_classified.xml linden/indra/newview/skins/default/xui/fr/panel_classified.xml linden/indra/newview/skins/default/xui/fr/panel_event.xml linden/indra/newview/skins/default/xui/fr/panel_friends.xml linden/indra/newview/skins/default/xui/fr/panel_group_general.xml linden/indra/newview/skins/default/xui/fr/panel_group_invite.xml linden/indra/newview/skins/default/xui/fr/panel_group_land_money.xml linden/indra/newview/skins/default/xui/fr/panel_group_roles.xml linden/indra/newview/skins/default/xui/fr/panel_login.xml linden/indra/newview/skins/default/xui/fr/panel_media_controls.xml linden/indra/newview/skins/default/xui/fr/panel_media_remote_expanded.xml linden/indra/newview/skins/default/xui/fr/panel_overlaybar.xml linden/indra/newview/skins/default/xui/fr/panel_place.xml linden/indra/newview/skins/default/xui/fr/panel_place_small.xml linden/indra/newview/skins/default/xui/fr/panel_preferences_audio.xml linden/indra/newview/skins/default/xui/fr/panel_preferences_general.xml linden/indra/newview/skins/default/xui/fr/panel_preferences_im.xml linden/indra/newview/skins/default/xui/fr/panel_preferences_input.xml linden/indra/newview/skins/default/xui/fr/panel_preferences_network.xml linden/indra/newview/skins/default/xui/fr/panel_preferences_voice.xml linden/indra/newview/skins/default/xui/fr/panel_region_covenant.xml linden/indra/newview/skins/default/xui/fr/panel_region_debug.xml linden/indra/newview/skins/default/xui/fr/panel_region_general.xml linden/indra/newview/skins/default/xui/fr/panel_voice_controls.xml linden/indra/newview/skins/default/xui/fr/role_actions.xml linden/indra/newview/skins/default/xui/fr/strings.xml linden/indra/newview/skins/default/xui/fr/teleport_strings.xml linden/indra/newview/skins/default/xui/ja/floater_active_speakers.xml linden/indra/newview/skins/default/xui/ja/floater_html.xml linden/indra/newview/skins/default/xui/ja/floater_instant_message_ad_hoc.xml linden/indra/newview/skins/default/xui/ja/floater_instant_message_group.xml linden/indra/newview/skins/default/xui/ja/floater_joystick.xml linden/indra/newview/skins/default/xui/ja/floater_media_browser.xml linden/indra/newview/skins/default/xui/ja/floater_windlight_options.xml linden/indra/newview/skins/default/xui/ja/menu_login.xml linden/indra/newview/skins/default/xui/ja/panel_friends.xml linden/indra/newview/skins/default/xui/ja/panel_media_controls.xml linden/indra/newview/skins/default/xui/ja/panel_media_remote_expanded.xml linden/indra/newview/skins/default/xui/ja/panel_preferences_voice.xml linden/indra/newview/skins/default/xui/ja/panel_speaker_controls.xml linden/indra/newview/skins/default/xui/ja/strings.xml linden/indra/newview/skins/default/xui/ja/teleport_strings.xml linden/indra/newview/skins/default/xui/ko/panel_media_controls.xml linden/indra/newview/skins/default/xui/pt/alerts.xml linden/indra/newview/skins/default/xui/pt/floater_about.xml linden/indra/newview/skins/default/xui/pt/floater_about_land.xml linden/indra/newview/skins/default/xui/pt/floater_active_speakers.xml linden/indra/newview/skins/default/xui/pt/floater_animation_preview.xml linden/indra/newview/skins/default/xui/pt/floater_auction.xml linden/indra/newview/skins/default/xui/pt/floater_avatar_picker.xml linden/indra/newview/skins/default/xui/pt/floater_avatar_textures.xml linden/indra/newview/skins/default/xui/pt/floater_beacons.xml linden/indra/newview/skins/default/xui/pt/floater_build_options.xml linden/indra/newview/skins/default/xui/pt/floater_bumps.xml linden/indra/newview/skins/default/xui/pt/floater_buy_contents.xml linden/indra/newview/skins/default/xui/pt/floater_buy_currency.xml linden/indra/newview/skins/default/xui/pt/floater_buy_land.xml linden/indra/newview/skins/default/xui/pt/floater_buy_object.xml linden/indra/newview/skins/default/xui/pt/floater_chat_history.xml linden/indra/newview/skins/default/xui/pt/floater_clothing.xml linden/indra/newview/skins/default/xui/pt/floater_color_picker.xml linden/indra/newview/skins/default/xui/pt/floater_critical.xml linden/indra/newview/skins/default/xui/pt/floater_customize.xml linden/indra/newview/skins/default/xui/pt/floater_day_cycle_options.xml linden/indra/newview/skins/default/xui/pt/floater_directory.xml linden/indra/newview/skins/default/xui/pt/floater_env_settings.xml linden/indra/newview/skins/default/xui/pt/floater_gesture.xml linden/indra/newview/skins/default/xui/pt/floater_god_tools.xml linden/indra/newview/skins/default/xui/pt/floater_group_info.xml linden/indra/newview/skins/default/xui/pt/floater_im.xml linden/indra/newview/skins/default/xui/pt/floater_image_preview.xml linden/indra/newview/skins/default/xui/pt/floater_inspect.xml linden/indra/newview/skins/default/xui/pt/floater_instant_message.xml linden/indra/newview/skins/default/xui/pt/floater_instant_message_ad_hoc.xml linden/indra/newview/skins/default/xui/pt/floater_instant_message_group.xml linden/indra/newview/skins/default/xui/pt/floater_inventory.xml linden/indra/newview/skins/default/xui/pt/floater_inventory_item_properties.xml linden/indra/newview/skins/default/xui/pt/floater_inventory_view_finder.xml linden/indra/newview/skins/default/xui/pt/floater_joystick.xml linden/indra/newview/skins/default/xui/pt/floater_lagmeter.xml linden/indra/newview/skins/default/xui/pt/floater_land_holdings.xml linden/indra/newview/skins/default/xui/pt/floater_landmark_ctrl.xml linden/indra/newview/skins/default/xui/pt/floater_live_lsleditor.xml linden/indra/newview/skins/default/xui/pt/floater_lsl_guide.xml linden/indra/newview/skins/default/xui/pt/floater_media_browser.xml linden/indra/newview/skins/default/xui/pt/floater_moveview.xml linden/indra/newview/skins/default/xui/pt/floater_mute.xml linden/indra/newview/skins/default/xui/pt/floater_mute_object.xml linden/indra/newview/skins/default/xui/pt/floater_name_description.xml linden/indra/newview/skins/default/xui/pt/floater_new_outfit_dialog.xml linden/indra/newview/skins/default/xui/pt/floater_openobject.xml linden/indra/newview/skins/default/xui/pt/floater_pay.xml linden/indra/newview/skins/default/xui/pt/floater_postcard.xml linden/indra/newview/skins/default/xui/pt/floater_preferences.xml linden/indra/newview/skins/default/xui/pt/floater_preview_animation.xml linden/indra/newview/skins/default/xui/pt/floater_preview_classified.xml linden/indra/newview/skins/default/xui/pt/floater_preview_event.xml linden/indra/newview/skins/default/xui/pt/floater_preview_gesture.xml linden/indra/newview/skins/default/xui/pt/floater_preview_notecard_keep_discard.xml linden/indra/newview/skins/default/xui/pt/floater_preview_sound.xml linden/indra/newview/skins/default/xui/pt/floater_preview_url.xml linden/indra/newview/skins/default/xui/pt/floater_price_for_listing.xml linden/indra/newview/skins/default/xui/pt/floater_profile.xml linden/indra/newview/skins/default/xui/pt/floater_report_abuse.xml linden/indra/newview/skins/default/xui/pt/floater_script_debug.xml linden/indra/newview/skins/default/xui/pt/floater_script_queue.xml linden/indra/newview/skins/default/xui/pt/floater_script_search.xml linden/indra/newview/skins/default/xui/pt/floater_sell_land.xml linden/indra/newview/skins/default/xui/pt/floater_settings_debug.xml linden/indra/newview/skins/default/xui/pt/floater_sim_release_message.xml linden/indra/newview/skins/default/xui/pt/floater_snapshot.xml linden/indra/newview/skins/default/xui/pt/floater_sound_preview.xml linden/indra/newview/skins/default/xui/pt/floater_telehub.xml linden/indra/newview/skins/default/xui/pt/floater_texture_ctrl.xml linden/indra/newview/skins/default/xui/pt/floater_tools.xml linden/indra/newview/skins/default/xui/pt/floater_top_objects.xml linden/indra/newview/skins/default/xui/pt/floater_tos.xml linden/indra/newview/skins/default/xui/pt/floater_url_entry.xml linden/indra/newview/skins/default/xui/pt/floater_water.xml linden/indra/newview/skins/default/xui/pt/floater_wearable_save_as.xml linden/indra/newview/skins/default/xui/pt/floater_windlight_options.xml linden/indra/newview/skins/default/xui/pt/floater_world_map.xml linden/indra/newview/skins/default/xui/pt/menu_inventory.xml linden/indra/newview/skins/default/xui/pt/menu_pie_attachment.xml linden/indra/newview/skins/default/xui/pt/menu_pie_avatar.xml linden/indra/newview/skins/default/xui/pt/menu_pie_land.xml linden/indra/newview/skins/default/xui/pt/menu_pie_object.xml linden/indra/newview/skins/default/xui/pt/menu_viewer.xml linden/indra/newview/skins/default/xui/pt/notify.xml linden/indra/newview/skins/default/xui/pt/panel_account_details.xml linden/indra/newview/skins/default/xui/pt/panel_account_planning.xml linden/indra/newview/skins/default/xui/pt/panel_account_transactions.xml linden/indra/newview/skins/default/xui/pt/panel_audio_device.xml linden/indra/newview/skins/default/xui/pt/panel_avatar.xml linden/indra/newview/skins/default/xui/pt/panel_avatar_classified.xml linden/indra/newview/skins/default/xui/pt/panel_avatar_pick.xml linden/indra/newview/skins/default/xui/pt/panel_chat_bar.xml linden/indra/newview/skins/default/xui/pt/panel_classified.xml linden/indra/newview/skins/default/xui/pt/panel_event.xml linden/indra/newview/skins/default/xui/pt/panel_friends.xml linden/indra/newview/skins/default/xui/pt/panel_group.xml linden/indra/newview/skins/default/xui/pt/panel_group_finder.xml linden/indra/newview/skins/default/xui/pt/panel_group_general.xml linden/indra/newview/skins/default/xui/pt/panel_group_invite.xml linden/indra/newview/skins/default/xui/pt/panel_group_land_money.xml linden/indra/newview/skins/default/xui/pt/panel_group_notices.xml linden/indra/newview/skins/default/xui/pt/panel_group_roles.xml linden/indra/newview/skins/default/xui/pt/panel_group_voting.xml linden/indra/newview/skins/default/xui/pt/panel_land_covenant.xml linden/indra/newview/skins/default/xui/pt/panel_login.xml linden/indra/newview/skins/default/xui/pt/panel_overlaybar.xml linden/indra/newview/skins/default/xui/pt/panel_place.xml linden/indra/newview/skins/default/xui/pt/panel_place_small.xml linden/indra/newview/skins/default/xui/pt/panel_preferences_audio.xml linden/indra/newview/skins/default/xui/pt/panel_preferences_chat.xml linden/indra/newview/skins/default/xui/pt/panel_preferences_general.xml linden/indra/newview/skins/default/xui/pt/panel_preferences_graphics1.xml linden/indra/newview/skins/default/xui/pt/panel_preferences_im.xml linden/indra/newview/skins/default/xui/pt/panel_preferences_input.xml linden/indra/newview/skins/default/xui/pt/panel_preferences_network.xml linden/indra/newview/skins/default/xui/pt/panel_preferences_popups.xml linden/indra/newview/skins/default/xui/pt/panel_preferences_voice.xml linden/indra/newview/skins/default/xui/pt/panel_preferences_web.xml linden/indra/newview/skins/default/xui/pt/panel_region_covenant.xml linden/indra/newview/skins/default/xui/pt/panel_region_debug.xml linden/indra/newview/skins/default/xui/pt/panel_region_estate.xml linden/indra/newview/skins/default/xui/pt/panel_region_general.xml linden/indra/newview/skins/default/xui/pt/panel_region_terrain.xml linden/indra/newview/skins/default/xui/pt/panel_region_texture.xml linden/indra/newview/skins/default/xui/pt/panel_scrolling_param.xml linden/indra/newview/skins/default/xui/pt/panel_speaker_controls.xml linden/indra/newview/skins/default/xui/pt/panel_status_bar.xml linden/indra/newview/skins/default/xui/pt/panel_toolbar.xml linden/indra/newview/skins/default/xui/pt/panel_top_pick.xml linden/indra/newview/skins/default/xui/pt/panel_voice_controls.xml linden/indra/newview/skins/default/xui/pt/panel_voice_enable.xml linden/indra/newview/skins/default/xui/pt/panel_voice_options.xml linden/indra/newview/skins/default/xui/pt/strings.xml linden/indra/newview/skins/default/xui/pt/teleport_strings.xml linden/indra/newview/skins/default/xui/zh/floater_env_settings.xml linden/indra/newview/skins/default/xui/zh/floater_instant_message_ad_hoc.xml linden/indra/newview/skins/default/xui/zh/floater_lagmeter.xml linden/indra/newview/skins/default/xui/zh/floater_landmark_ctrl.xml linden/indra/newview/skins/default/xui/zh/floater_post_process.xml linden/indra/newview/skins/default/xui/zh/floater_settings_debug.xml linden/indra/newview/skins/default/xui/zh/floater_windlight_options.xml linden/indra/newview/skins/default/xui/zh/menu_pie_attachment.xml linden/indra/newview/skins/default/xui/zh/menu_pie_avatar.xml linden/indra/newview/skins/default/xui/zh/menu_pie_land.xml linden/indra/newview/skins/default/xui/zh/menu_pie_object.xml linden/indra/newview/skins/default/xui/zh/menu_viewer.xml linden/indra/newview/skins/default/xui/zh/panel_avatar.xml linden/indra/newview/skins/default/xui/zh/panel_friends.xml linden/indra/newview/skins/default/xui/zh/panel_group_general.xml linden/indra/newview/skins/default/xui/zh/panel_group_invite.xml linden/indra/newview/skins/default/xui/zh/panel_group_land_money.xml linden/indra/newview/skins/default/xui/zh/panel_group_notices.xml linden/indra/newview/skins/default/xui/zh/panel_group_roles.xml linden/indra/newview/skins/default/xui/zh/panel_preferences_audio.xml linden/indra/newview/skins/default/xui/zh/panel_preferences_im.xml linden/indra/newview/skins/default/xui/zh/panel_region_covenant.xml linden/indra/newview/skins/default/xui/zh/panel_speaker_controls.xml linden/indra/newview/skins/default/xui/zh/panel_voice_options.xml linden/indra/newview/skins/default/xui/zh/strings.xml linden/indra/newview/skins/silver/colors_base.xml linden/indra/newview/skins/silver/xui/en-us/floater_about_land.xml linden/indra/newview/skins/silver/xui/en-us/floater_directory.xml linden/indra/newview/skins/silver/xui/en-us/floater_tools.xml linden/indra/newview/skins/silver/xui/en-us/panel_media_controls.xml linden/indra/newview/viewer_manifest.py linden/install.xml
Diffstat (limited to 'linden/indra/newview/llappviewer.cpp')
-rw-r--r--linden/indra/newview/llappviewer.cpp716
1 files changed, 427 insertions, 289 deletions
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp
index 4d53c88..58c1c2b 100644
--- a/linden/indra/newview/llappviewer.cpp
+++ b/linden/indra/newview/llappviewer.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -103,6 +104,7 @@
103#include "llviewermenu.h" 104#include "llviewermenu.h"
104#include "llselectmgr.h" 105#include "llselectmgr.h"
105#include "lltrans.h" 106#include "lltrans.h"
107#include "lluitrans.h"
106#include "lltracker.h" 108#include "lltracker.h"
107#include "llviewerparcelmgr.h" 109#include "llviewerparcelmgr.h"
108#include "llworldmapview.h" 110#include "llworldmapview.h"
@@ -158,19 +160,12 @@
158#include "llimview.h" 160#include "llimview.h"
159#include "llviewerthrottle.h" 161#include "llviewerthrottle.h"
160#include "llparcel.h" 162#include "llparcel.h"
161// 163
162 164
163#include "llinventoryview.h" 165#include "llinventoryview.h"
164 166
165#include "llcommandlineparser.h" 167#include "llcommandlineparser.h"
166 168
167// annoying detail to determine whether font prefs are over-ridden
168#if LL_LINUX
169# define LL_DYNAMIC_FONT_DISCOVERY 1
170#else
171# define LL_DYNAMIC_FONT_DISCOVERY 0
172#endif
173
174// *FIX: These extern globals should be cleaned up. 169// *FIX: These extern globals should be cleaned up.
175// The globals either represent state/config/resource-storage of either 170// The globals either represent state/config/resource-storage of either
176// this app, or another 'component' of the viewer. App globals should be 171// this app, or another 'component' of the viewer. App globals should be
@@ -287,6 +282,9 @@ const std::string LOGOUT_MARKER_FILE_NAME("Imprudence.logout_marker");
287static BOOL gDoDisconnect = FALSE; 282static BOOL gDoDisconnect = FALSE;
288static std::string gLaunchFileOnQuit; 283static std::string gLaunchFileOnQuit;
289 284
285// Used on Win32 for other apps to identify our window (eg, win_setup)
286const char* const VIEWER_WINDOW_CLASSNAME = "Imprudence";
287
290//---------------------------------------------------------------------------- 288//----------------------------------------------------------------------------
291// File scope definitons 289// File scope definitons
292const char *VFS_DATA_FILE_BASE = "data.db2.x."; 290const char *VFS_DATA_FILE_BASE = "data.db2.x.";
@@ -294,9 +292,6 @@ const char *VFS_INDEX_FILE_BASE = "index.db2.x.";
294 292
295static std::string gSecondLife; 293static std::string gSecondLife;
296static std::string gWindowTitle; 294static std::string gWindowTitle;
297#ifdef LL_WINDOWS
298 static char sWindowClass[] = "Imprudence";
299#endif
300 295
301std::string gLoginPage; 296std::string gLoginPage;
302std::vector<std::string> gLoginURIs; 297std::vector<std::string> gLoginURIs;
@@ -415,7 +410,7 @@ static void settings_modify()
415 LLRenderTarget::sUseFBO = gSavedSettings.getBOOL("RenderUseFBO"); 410 LLRenderTarget::sUseFBO = gSavedSettings.getBOOL("RenderUseFBO");
416 LLVOAvatar::sUseImpostors = gSavedSettings.getBOOL("RenderUseImpostors"); 411 LLVOAvatar::sUseImpostors = gSavedSettings.getBOOL("RenderUseImpostors");
417 LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor"); 412 LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor");
418 LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //sqaure lod factor to get exponential range of [1,4] 413 LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //square lod factor to get exponential range of [1,4]
419 gDebugGL = gSavedSettings.getBOOL("RenderDebugGL"); 414 gDebugGL = gSavedSettings.getBOOL("RenderDebugGL");
420 gDebugPipeline = gSavedSettings.getBOOL("RenderDebugPipeline"); 415 gDebugPipeline = gSavedSettings.getBOOL("RenderDebugPipeline");
421 416
@@ -513,7 +508,7 @@ LLWorkerThread* LLAppViewer::sImageDecodeThread = NULL;
513LLTextureFetch* LLAppViewer::sTextureFetch = NULL; 508LLTextureFetch* LLAppViewer::sTextureFetch = NULL;
514 509
515LLAppViewer::LLAppViewer() : 510LLAppViewer::LLAppViewer() :
516 mMarkerFile(NULL), 511 mMarkerFile(),
517 mReportedCrash(false), 512 mReportedCrash(false),
518 mNumSessions(0), 513 mNumSessions(0),
519 mPurgeCache(false), 514 mPurgeCache(false),
@@ -608,25 +603,6 @@ bool LLAppViewer::init()
608 ///////////////////////////////////////////////// 603 /////////////////////////////////////////////////
609 // OS-specific login dialogs 604 // OS-specific login dialogs
610 ///////////////////////////////////////////////// 605 /////////////////////////////////////////////////
611#if LL_WINDOWS
612 /*
613 // Display initial login screen, comes up quickly. JC
614 {
615 LLSplashScreen::hide();
616
617 INT_PTR result = DialogBox(hInstance, L"CONNECTBOX", NULL, login_dialog_func);
618 if (result < 0)
619 {
620 llwarns << "Connect dialog box failed, returned " << result << llendl;
621 return 1;
622 }
623 // success, result contains which button user clicked
624 llinfos << "Connect dialog box clicked " << result << llendl;
625
626 LLSplashScreen::show();
627 }
628 */
629#endif
630 606
631 //test_cached_control(); 607 //test_cached_control();
632 608
@@ -657,6 +633,7 @@ bool LLAppViewer::init()
657 633
658 // Widget construction depends on LLUI being initialized 634 // Widget construction depends on LLUI being initialized
659 LLUI::initClass(&gSavedSettings, 635 LLUI::initClass(&gSavedSettings,
636 &gSavedSettings,
660 &gColors, 637 &gColors,
661 LLUIImageList::getInstance(), 638 LLUIImageList::getInstance(),
662 ui_audio_callback, 639 ui_audio_callback,
@@ -668,7 +645,7 @@ bool LLAppViewer::init()
668 &LLURLDispatcher::dispatchFromTextEditor); 645 &LLURLDispatcher::dispatchFromTextEditor);
669 646
670 LLUICtrlFactory::getInstance()->setupPaths(); // update paths with correct language set 647 LLUICtrlFactory::getInstance()->setupPaths(); // update paths with correct language set
671 648
672 ///////////////////////////////////////////////// 649 /////////////////////////////////////////////////
673 // 650 //
674 // Load settings files 651 // Load settings files
@@ -741,7 +718,10 @@ bool LLAppViewer::init()
741 // 718 //
742 initWindow(); 719 initWindow();
743 720
744#if LL_LCD_COMPILE 721 // call all self-registered classes
722 LLInitClassList::instance().fireCallbacks();
723
724 #if LL_LCD_COMPILE
745 // start up an LCD window on a logitech keyboard, if there is one 725 // start up an LCD window on a logitech keyboard, if there is one
746 HINSTANCE hInstance = GetModuleHandle(NULL); 726 HINSTANCE hInstance = GetModuleHandle(NULL);
747 gLcdScreen = new LLLCD(hInstance); 727 gLcdScreen = new LLLCD(hInstance);
@@ -767,64 +747,67 @@ bool LLAppViewer::init()
767 // If we don't have the right GL requirements, exit. 747 // If we don't have the right GL requirements, exit.
768 if (!gGLManager.mHasRequirements && !gNoRender) 748 if (!gGLManager.mHasRequirements && !gNoRender)
769 { 749 {
770 // can't use an alert here since we're existing and 750 // can't use an alert here since we're exiting and
771 // all hell breaks lose. 751 // all hell breaks lose.
772 OSMessageBox( 752 OSMessageBox(
773 LLAlertDialog::getTemplateMessage("UnsupportedGLRequirements"), 753 LLNotifications::instance().getGlobalString("UnsupportedGLRequirements"),
774 LLStringUtil::null, 754 LLStringUtil::null,
775 OSMB_OK); 755 OSMB_OK);
776 return 0; 756 return 0;
777 } 757 }
778 758
779 759 // alert the user if they are using unsupported hardware
780 bool unsupported = false; 760 if(!gSavedSettings.getBOOL("AlertedUnsupportedHardware"))
781 LLStringUtil::format_map_t args;
782 std::string minSpecs;
783
784 // get cpu data from xml
785 std::stringstream minCPUString(LLAlertDialog::getTemplateMessage("UnsupportedCPUAmount"));
786 S32 minCPU = 0;
787 minCPUString >> minCPU;
788
789 // get RAM data from XML
790 std::stringstream minRAMString(LLAlertDialog::getTemplateMessage("UnsupportedRAMAmount"));
791 U64 minRAM = 0;
792 minRAMString >> minRAM;
793 minRAM = minRAM * 1024 * 1024;
794
795 if(!LLFeatureManager::getInstance()->isGPUSupported() && LLFeatureManager::getInstance()->getGPUClass() != GPU_CLASS_UNKNOWN)
796 {
797 minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedGPU");
798 minSpecs += "\n";
799 unsupported = true;
800 }
801 if(gSysCPU.getMhz() < minCPU)
802 {
803 minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedCPU");
804 minSpecs += "\n";
805 unsupported = true;
806 }
807 if(gSysMemory.getPhysicalMemoryClamped() < minRAM)
808 {
809 minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedRAM");
810 minSpecs += "\n";
811 unsupported = true;
812 }
813
814 if (LLFeatureManager::getInstance()->getGPUClass() == GPU_CLASS_UNKNOWN)
815 { 761 {
816 gViewerWindow->alertXml("UnknownGPU"); 762 bool unsupported = false;
817 } 763 LLSD args;
764 std::string minSpecs;
818 765
819 if(unsupported) 766 // get cpu data from xml
820 { 767 std::stringstream minCPUString(LLNotifications::instance().getGlobalString("UnsupportedCPUAmount"));
821 if(!gSavedSettings.controlExists("WarnUnsupportedHardware") 768 S32 minCPU = 0;
822 || gSavedSettings.getBOOL("WarnUnsupportedHardware")) 769 minCPUString >> minCPU;
770
771 // get RAM data from XML
772 std::stringstream minRAMString(LLNotifications::instance().getGlobalString("UnsupportedRAMAmount"));
773 U64 minRAM = 0;
774 minRAMString >> minRAM;
775 minRAM = minRAM * 1024 * 1024;
776
777 if(!LLFeatureManager::getInstance()->isGPUSupported() && LLFeatureManager::getInstance()->getGPUClass() != GPU_CLASS_UNKNOWN)
778 {
779 minSpecs += LLNotifications::instance().getGlobalString("UnsupportedGPU");
780 minSpecs += "\n";
781 unsupported = true;
782 }
783 if(gSysCPU.getMhz() < minCPU)
823 { 784 {
824 args["MINSPECS"] = minSpecs; 785 minSpecs += LLNotifications::instance().getGlobalString("UnsupportedCPU");
825 gViewerWindow->alertXml("UnsupportedHardware", args ); 786 minSpecs += "\n";
787 unsupported = true;
826 } 788 }
789 if(gSysMemory.getPhysicalMemoryClamped() < minRAM)
790 {
791 minSpecs += LLNotifications::instance().getGlobalString("UnsupportedRAM");
792 minSpecs += "\n";
793 unsupported = true;
794 }
795
796 if (LLFeatureManager::getInstance()->getGPUClass() == GPU_CLASS_UNKNOWN)
797 {
798 LLNotifications::instance().add("UnknownGPU");
799 }
800
801 if(unsupported)
802 {
803 if(!gSavedSettings.controlExists("WarnUnsupportedHardware")
804 || gSavedSettings.getBOOL("WarnUnsupportedHardware"))
805 {
806 args["MINSPECS"] = minSpecs;
807 LLNotifications::instance().add("UnsupportedHardware", args );
808 }
827 809
810 }
828 } 811 }
829 812
830 // save the graphics card 813 // save the graphics card
@@ -873,7 +856,6 @@ bool LLAppViewer::mainLoop()
873 try 856 try
874 { 857 {
875 LLFastTimer t(LLFastTimer::FTM_FRAME); 858 LLFastTimer t(LLFastTimer::FTM_FRAME);
876
877 pingMainloopTimeout("Main:MiscNativeWindowEvents"); 859 pingMainloopTimeout("Main:MiscNativeWindowEvents");
878 860
879 { 861 {
@@ -1078,6 +1060,9 @@ bool LLAppViewer::mainLoop()
1078 } 1060 }
1079 else 1061 else
1080 { 1062 {
1063 //output possible call stacks to log file.
1064 LLError::LLCallStacks::print() ;
1065
1081 llerrs << "Bad memory allocation in LLAppViewer::mainLoop()!" << llendl ; 1066 llerrs << "Bad memory allocation in LLAppViewer::mainLoop()!" << llendl ;
1082 } 1067 }
1083 } 1068 }
@@ -1113,6 +1098,16 @@ bool LLAppViewer::mainLoop()
1113 1098
1114bool LLAppViewer::cleanup() 1099bool LLAppViewer::cleanup()
1115{ 1100{
1101 //----------------------------------------------
1102 //this test code will be removed after the test
1103 //test manual call stack tracer
1104 if(gSavedSettings.getBOOL("QAMode"))
1105 {
1106 LLError::LLCallStacks::print() ;
1107 }
1108 //end of the test code
1109 //----------------------------------------------
1110
1116 //flag all elements as needing to be destroyed immediately 1111 //flag all elements as needing to be destroyed immediately
1117 // to ensure shutdown order 1112 // to ensure shutdown order
1118 LLMortician::setZealous(TRUE); 1113 LLMortician::setZealous(TRUE);
@@ -1132,6 +1127,9 @@ bool LLAppViewer::cleanup()
1132 llinfos << "Cleaning Up" << llendflush; 1127 llinfos << "Cleaning Up" << llendflush;
1133 1128
1134 // Must clean up texture references before viewer window is destroyed. 1129 // Must clean up texture references before viewer window is destroyed.
1130 LLHUDManager::getInstance()->updateEffects();
1131 LLHUDObject::updateAll();
1132 LLHUDManager::getInstance()->cleanupEffects();
1135 LLHUDObject::cleanupHUDObjects(); 1133 LLHUDObject::cleanupHUDObjects();
1136 llinfos << "HUD Objects cleaned up" << llendflush; 1134 llinfos << "HUD Objects cleaned up" << llendflush;
1137 1135
@@ -1158,8 +1156,6 @@ bool LLAppViewer::cleanup()
1158 1156
1159 // Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be deleted. 1157 // Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be deleted.
1160 1158
1161 LLNotifyBox::cleanup();
1162
1163 LLWorldMap::getInstance()->reset(); // release any images 1159 LLWorldMap::getInstance()->reset(); // release any images
1164 1160
1165 LLCalc::cleanUp(); 1161 LLCalc::cleanUp();
@@ -1172,8 +1168,8 @@ bool LLAppViewer::cleanup()
1172 if (gAudiop->getDriverName(want_longname) == "FMOD") 1168 if (gAudiop->getDriverName(want_longname) == "FMOD")
1173 { 1169 {
1174 // This hack exists because fmod likes to occasionally 1170 // This hack exists because fmod likes to occasionally
1175 // hang forever when shutting down, for no apparent 1171 // crash or hang forever when shutting down, for no
1176 // reason. 1172 // apparent reason.
1177 llwarns << "Hack, skipping FMOD audio engine cleanup" << llendflush; 1173 llwarns << "Hack, skipping FMOD audio engine cleanup" << llendflush;
1178 } 1174 }
1179 else 1175 else
@@ -1293,6 +1289,13 @@ bool LLAppViewer::cleanup()
1293 LLVFile::cleanupClass(); 1289 LLVFile::cleanupClass();
1294 llinfos << "VFS cleaned up" << llendflush; 1290 llinfos << "VFS cleaned up" << llendflush;
1295 1291
1292 // Quitting with "Remember Password" turned off should always stomp your
1293 // saved password, whether or not you successfully logged in. JC
1294 if (!gSavedSettings.getBOOL("RememberPassword"))
1295 {
1296 LLStartUp::deletePasswordFromDisk();
1297 }
1298
1296 // Store the time of our current logoff 1299 // Store the time of our current logoff
1297 gSavedPerAccountSettings.setU32("LastLogoff", time_corrected()); 1300 gSavedPerAccountSettings.setU32("LastLogoff", time_corrected());
1298 1301
@@ -1507,46 +1510,78 @@ bool LLAppViewer::initLogging()
1507 return true; 1510 return true;
1508} 1511}
1509 1512
1510bool LLAppViewer::loadSettingsFromDirectory(ELLPath path_index, bool set_defaults) 1513bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key,
1514 bool set_defaults)
1511{ 1515{
1512 for(LLSD::map_iterator itr = mSettingsFileList.beginMap(); itr != mSettingsFileList.endMap(); ++itr) 1516 // Find and vet the location key.
1517 if(!mSettingsLocationList.has(location_key))
1518 {
1519 llerrs << "Requested unknown location: " << location_key << llendl;
1520 return false;
1521 }
1522
1523 LLSD location = mSettingsLocationList.get(location_key);
1524
1525 if(!location.has("PathIndex"))
1526 {
1527 llerrs << "Settings location is missing PathIndex value. Settings cannot be loaded." << llendl;
1528 return false;
1529 }
1530 ELLPath path_index = (ELLPath)(location.get("PathIndex").asInteger());
1531 if(path_index <= LL_PATH_NONE || path_index >= LL_PATH_LAST)
1513 { 1532 {
1514 std::string settings_name = (*itr).first; 1533 llerrs << "Out of range path index in app_settings/settings_files.xml" << llendl;
1515 std::string settings_file = mSettingsFileList[settings_name].asString(); 1534 return false;
1535 }
1516 1536
1517 std::string full_settings_path = gDirUtilp->getExpandedFilename(path_index, settings_file); 1537 // Iterate through the locations list of files.
1538 LLSD files = location.get("Files");
1539 for(LLSD::map_iterator itr = files.beginMap(); itr != files.endMap(); ++itr)
1540 {
1541 std::string settings_group = (*itr).first;
1542 llinfos << "Attempting to load settings for the group " << settings_group
1543 << " - from location " << location_key << llendl;
1518 1544
1519 if(settings_name == sGlobalSettingsName 1545 if(gSettings.find(settings_group) == gSettings.end())
1520 && path_index == LL_PATH_USER_SETTINGS)
1521 { 1546 {
1522 // The non-persistent setting, ClientSettingsFile, specifies a 1547 llwarns << "No matching settings group for name " << settings_group << llendl;
1523 // custom name to use for the global settings file. 1548 continue;
1524 // Only apply this setting if this method is setting the 'Global' 1549 }
1525 // settings from the user_settings path. 1550
1526 std::string custom_path; 1551 LLSD file = (*itr).second;
1527 if(gSettings[sGlobalSettingsName]->controlExists("ClientSettingsFile")) 1552
1528 { 1553 std::string full_settings_path;
1529 custom_path = 1554 if(file.has("NameFromSetting"))
1530 gSettings[sGlobalSettingsName]->getString("ClientSettingsFile"); 1555 {
1531 } 1556 std::string custom_name_setting = file.get("NameFromSetting");
1532 if(!custom_path.empty()) 1557 // *NOTE: Regardless of the group currently being lodaed,
1558 // this setting is always read from the Global settings.
1559 if(gSettings[sGlobalSettingsName]->controlExists(custom_name_setting))
1533 { 1560 {
1534 full_settings_path = custom_path; 1561 std::string file_name =
1562 gSettings[sGlobalSettingsName]->getString(custom_name_setting);
1563 full_settings_path = file_name;
1535 } 1564 }
1536 } 1565 }
1537 1566
1538 if(gSettings.find(settings_name) == gSettings.end()) 1567 if(full_settings_path.empty())
1539 { 1568 {
1540 llwarns << "Cannot load " << settings_file << " - No matching settings group for name " << settings_name << llendl; 1569 std::string file_name = file.get("Name");
1541 continue; 1570 full_settings_path = gDirUtilp->getExpandedFilename(path_index, file_name);
1542 } 1571 }
1543 if(!gSettings[settings_name]->loadFromFile(full_settings_path, set_defaults)) 1572
1573 int requirement = 0;
1574 if(file.has("Requirement"))
1544 { 1575 {
1545 // If attempting to load the default global settings (app_settings/settings.xml) 1576 requirement = file.get("Requirement").asInteger();
1546 // fails, the app should error and quit. 1577 }
1547 if(path_index == LL_PATH_APP_SETTINGS && settings_name == sGlobalSettingsName) 1578
1579 if(!gSettings[settings_group]->loadFromFile(full_settings_path, set_defaults))
1580 {
1581 if(requirement == 1)
1548 { 1582 {
1549 llwarns << "Error: Cannot load default settings from: " << full_settings_path << llendl; 1583 llwarns << "Error: Cannot load required settings file from: "
1584 << full_settings_path << llendl;
1550 return false; 1585 return false;
1551 } 1586 }
1552 else 1587 else
@@ -1559,14 +1594,24 @@ bool LLAppViewer::loadSettingsFromDirectory(ELLPath path_index, bool set_default
1559 llinfos << "Loaded settings file " << full_settings_path << llendl; 1594 llinfos << "Loaded settings file " << full_settings_path << llendl;
1560 } 1595 }
1561 } 1596 }
1597
1562 return true; 1598 return true;
1563} 1599}
1564 1600
1565std::string LLAppViewer::getSettingsFileName(const std::string& file) 1601std::string LLAppViewer::getSettingsFilename(const std::string& location_key,
1602 const std::string& file)
1566{ 1603{
1567 if(mSettingsFileList.has(file)) 1604 if(mSettingsLocationList.has(location_key))
1568 { 1605 {
1569 return mSettingsFileList[file].asString(); 1606 LLSD location = mSettingsLocationList.get(location_key);
1607 if(location.has("Files"))
1608 {
1609 LLSD files = location.get("Files");
1610 if(files.has(file) && files[file].has("Name"))
1611 {
1612 return files.get(file).get("Name").asString();
1613 }
1614 }
1570 } 1615 }
1571 return std::string(); 1616 return std::string();
1572} 1617}
@@ -1587,8 +1632,8 @@ bool LLAppViewer::initConfiguration()
1587 llerrs << "Cannot load default configuration file " << settings_file_list << llendl; 1632 llerrs << "Cannot load default configuration file " << settings_file_list << llendl;
1588 } 1633 }
1589 1634
1590 mSettingsFileList = settings_control.getLLSD("Files"); 1635 mSettingsLocationList = settings_control.getLLSD("Locations");
1591 1636
1592 // The settings and command line parsing have a fragile 1637 // The settings and command line parsing have a fragile
1593 // order-of-operation: 1638 // order-of-operation:
1594 // - load defaults from app_settings 1639 // - load defaults from app_settings
@@ -1601,11 +1646,11 @@ bool LLAppViewer::initConfiguration()
1601 1646
1602 // - load defaults 1647 // - load defaults
1603 bool set_defaults = true; 1648 bool set_defaults = true;
1604 if(!loadSettingsFromDirectory(LL_PATH_APP_SETTINGS, set_defaults)) 1649 if(!loadSettingsFromDirectory("Default", set_defaults))
1605 { 1650 {
1606 std::ostringstream msg; 1651 std::ostringstream msg;
1607 msg << "Second Life could not load its default settings file. \n" 1652 msg << "Second Life could not load its default settings file. \n"
1608 << "The installation may be corrupted. \n"; 1653 << "The installation may be corrupted. \n";
1609 1654
1610 OSMessageBox( 1655 OSMessageBox(
1611 msg.str(), 1656 msg.str(),
@@ -1617,16 +1662,11 @@ bool LLAppViewer::initConfiguration()
1617 1662
1618 // - set procedural settings 1663 // - set procedural settings
1619 gSavedSettings.setString("ClientSettingsFile", 1664 gSavedSettings.setString("ClientSettingsFile",
1665 // gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("Default", "Global")));
1620 gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings_imprudence.xml")); 1666 gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings_imprudence.xml"));
1621 1667
1622 gSavedSettings.setString("VersionChannelName", IMP_VIEWER_NAME); 1668 gSavedSettings.setString("VersionChannelName", IMP_VIEWER_NAME);
1623 1669
1624#if !LL_DYNAMIC_FONT_DISCOVERY
1625 // static font discovery - user settings can override.
1626 gSavedSettings.setString("FontSansSerifFallback",
1627 LLWindow::getFontListSans());
1628#endif
1629
1630 //*FIX:Mani - Set default to disabling watchdog mainloop 1670 //*FIX:Mani - Set default to disabling watchdog mainloop
1631 // timeout for mac and linux. There is no call stack info 1671 // timeout for mac and linux. There is no call stack info
1632 // on these platform to help debug. 1672 // on these platform to help debug.
@@ -1665,25 +1705,6 @@ bool LLAppViewer::initConfiguration()
1665 LLFirstUse::addConfigVariable("FirstVoice"); 1705 LLFirstUse::addConfigVariable("FirstVoice");
1666 LLFirstUse::addConfigVariable("FirstMedia"); 1706 LLFirstUse::addConfigVariable("FirstMedia");
1667 1707
1668 //////
1669 // *FIX:Mani - Find a way to remove the gUICtrlFactory and
1670 // LLAlertDialog::parseAlerts dependecies on the being loaded
1671 // *before* the user settings. Having to do this init here
1672 // seems odd.
1673
1674 // This is where gUICtrlFactory used to be instantiated with a new LLUICtrlFactory
1675 // which needed to happen before calling parseAlerts below.
1676 // TODO: That method is still dependant upon the base LLUICtrlFactory constructor being called
1677 // which registers some callbacks so I'm leaving in a call to getInstance here to cause that to
1678 // still happen. This needs to be cleaned up later when the base and derived classes
1679 // are planned to be combined. -MG
1680 LLUICtrlFactory::getInstance();
1681
1682
1683 // Pre-load alerts.xml to define the warnings settings (always loads from skins/xui/en-us/)
1684 // Do this *before* loading the settings file
1685 LLAlertDialog::parseAlerts("alerts.xml", &gSavedSettings, TRUE);
1686
1687 // - read command line settings. 1708 // - read command line settings.
1688 LLControlGroupCLP clp; 1709 LLControlGroupCLP clp;
1689 std::string cmd_line_config = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, 1710 std::string cmd_line_config = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,
@@ -1726,22 +1747,13 @@ bool LLAppViewer::initConfiguration()
1726 } 1747 }
1727 1748
1728 // - load overrides from user_settings 1749 // - load overrides from user_settings
1729 loadSettingsFromDirectory(LL_PATH_USER_SETTINGS); 1750 loadSettingsFromDirectory("User");
1730
1731#if LL_DYNAMIC_FONT_DISCOVERY
1732 // Linux does *dynamic* font discovery which is preferable to
1733 // whatever got written-out into the config file last time. This
1734 // does remove the ability of the user to hand-define the fallbacks
1735 // though, so from a config-management point of view this is hacky.
1736 gSavedSettings.setString("FontSansSerifFallback",
1737 LLWindow::getFontListSans());
1738#endif
1739 1751
1740 // - apply command line settings 1752 // - apply command line settings
1741 clp.notify(); 1753 clp.notify();
1742 1754
1743 // Handle initialization from settings. 1755 // Handle initialization from settings.
1744 // Start up the debugging console before handling other options. 1756 // Start up the debugging console before handling other options.
1745 if (gSavedSettings.getBOOL("ShowConsoleWindow")) 1757 if (gSavedSettings.getBOOL("ShowConsoleWindow"))
1746 { 1758 {
1747 initConsole(); 1759 initConsole();
@@ -1992,38 +2004,9 @@ bool LLAppViewer::initConfiguration()
1992 } 2004 }
1993 2005
1994 initMarkerFile(); 2006 initMarkerFile();
1995 2007
1996#if LL_SEND_CRASH_REPORTS 2008 checkForCrash();
1997 if (gLastExecEvent == LAST_EXEC_FROZE) 2009 }
1998 {
1999 llinfos << "Last execution froze, requesting to send crash report." << llendl;
2000 //
2001 // Pop up a freeze or crash warning dialog
2002 //
2003 std::ostringstream msg;
2004 msg << gSecondLife
2005 << " appears to have frozen or crashed on the previous run.\n"
2006 << "Would you like to send a crash report?";
2007 std::string alert;
2008 alert = gSecondLife;
2009 alert += " Alert";
2010 S32 choice = OSMessageBox(msg.str(),
2011 alert,
2012 OSMB_YESNO);
2013 if (OSBTN_YES == choice)
2014 {
2015 llinfos << "Sending crash report." << llendl;
2016
2017 bool report_freeze = true;
2018 handleCrashReporting(report_freeze);
2019 }
2020 else
2021 {
2022 llinfos << "Not sending crash report." << llendl;
2023 }
2024 }
2025#endif // #if LL_SEND_CRASH_REPORTS
2026 }
2027 else 2010 else
2028 { 2011 {
2029 mSecondInstance = anotherInstanceRunning(); 2012 mSecondInstance = anotherInstanceRunning();
@@ -2041,6 +2024,11 @@ bool LLAppViewer::initConfiguration()
2041 } 2024 }
2042 2025
2043 initMarkerFile(); 2026 initMarkerFile();
2027
2028 if(!mSecondInstance)
2029 {
2030 checkForCrash();
2031 }
2044 } 2032 }
2045 2033
2046 // need to do this here - need to have initialized global settings first 2034 // need to do this here - need to have initialized global settings first
@@ -2055,6 +2043,66 @@ bool LLAppViewer::initConfiguration()
2055 return true; // Config was successful. 2043 return true; // Config was successful.
2056} 2044}
2057 2045
2046
2047void LLAppViewer::checkForCrash(void)
2048{
2049
2050#if LL_SEND_CRASH_REPORTS
2051 //*NOTE:Mani The current state of the crash handler has the MacOSX
2052 // sending all crash reports as freezes, in order to let
2053 // the MacOSX CrashRepoter generate stacks before spawning the
2054 // SL crash logger.
2055 // The Linux and Windows clients generate their own stacks and
2056 // spawn the SL crash logger immediately. This may change in the future.
2057#if LL_DARWIN
2058 if(gLastExecEvent != LAST_EXEC_NORMAL)
2059#else
2060 if (gLastExecEvent == LAST_EXEC_FROZE)
2061#endif
2062 {
2063 llinfos << "Last execution froze, requesting to send crash report." << llendl;
2064 //
2065 // Pop up a freeze or crash warning dialog
2066 //
2067 S32 choice;
2068 if(gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING) == CRASH_BEHAVIOR_ASK)
2069 {
2070 std::ostringstream msg;
2071 msg << gSecondLife
2072 << " appears to have frozen or crashed on the previous run.\n"
2073 << "Would you like to send a crash report?";
2074 std::string alert;
2075 alert = gSecondLife;
2076 alert += " Alert";
2077 choice = OSMessageBox(msg.str(),
2078 alert,
2079 OSMB_YESNO);
2080 }
2081 else if(gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING) == CRASH_BEHAVIOR_NEVER_SEND)
2082 {
2083 choice = OSBTN_NO;
2084 }
2085 else
2086 {
2087 choice = OSBTN_YES;
2088 }
2089
2090 if (OSBTN_YES == choice)
2091 {
2092 llinfos << "Sending crash report." << llendl;
2093
2094 bool report_freeze = true;
2095 handleCrashReporting(report_freeze);
2096 }
2097 else
2098 {
2099 llinfos << "Not sending crash report." << llendl;
2100 }
2101 }
2102#endif // LL_SEND_CRASH_REPORTS
2103
2104}
2105
2058bool LLAppViewer::initWindow() 2106bool LLAppViewer::initWindow()
2059{ 2107{
2060 LL_INFOS("AppInit") << "Initializing window..." << LL_ENDL; 2108 LL_INFOS("AppInit") << "Initializing window..." << LL_ENDL;
@@ -2067,7 +2115,8 @@ bool LLAppViewer::initWindow()
2067 2115
2068 // always start windowed 2116 // always start windowed
2069 BOOL ignorePixelDepth = gSavedSettings.getBOOL("IgnorePixelDepth"); 2117 BOOL ignorePixelDepth = gSavedSettings.getBOOL("IgnorePixelDepth");
2070 gViewerWindow = new LLViewerWindow(gWindowTitle, gWindowTitle, 2118 gViewerWindow = new LLViewerWindow(gWindowTitle,
2119 VIEWER_WINDOW_CLASSNAME,
2071 gSavedSettings.getS32("WindowX"), gSavedSettings.getS32("WindowY"), 2120 gSavedSettings.getS32("WindowX"), gSavedSettings.getS32("WindowY"),
2072 gSavedSettings.getS32("WindowWidth"), gSavedSettings.getS32("WindowHeight"), 2121 gSavedSettings.getS32("WindowWidth"), gSavedSettings.getS32("WindowHeight"),
2073 FALSE, ignorePixelDepth); 2122 FALSE, ignorePixelDepth);
@@ -2110,9 +2159,8 @@ bool LLAppViewer::initWindow()
2110 2159
2111 LLUI::sWindow = gViewerWindow->getWindow(); 2160 LLUI::sWindow = gViewerWindow->getWindow();
2112 2161
2113 LLAlertDialog::parseAlerts("alerts.xml");
2114 LLNotifyBox::parseNotify("notify.xml");
2115 LLTrans::parseStrings("strings.xml"); 2162 LLTrans::parseStrings("strings.xml");
2163 LLUITrans::parseStrings("ui_strings.xml");
2116 2164
2117 // Show watch cursor 2165 // Show watch cursor
2118 gViewerWindow->setCursor(UI_CURSOR_WAIT); 2166 gViewerWindow->setCursor(UI_CURSOR_WAIT);
@@ -2121,7 +2169,7 @@ bool LLAppViewer::initWindow()
2121 gViewerWindow->initBase(); 2169 gViewerWindow->initBase();
2122 2170
2123 // show viewer window 2171 // show viewer window
2124 gViewerWindow->mWindow->show(); 2172 //gViewerWindow->mWindow->show();
2125 2173
2126 2174
2127 return true; 2175 return true;
@@ -2159,7 +2207,6 @@ void LLAppViewer::cleanupSavedSettings()
2159 if (gDebugView) 2207 if (gDebugView)
2160 { 2208 {
2161 gSavedSettings.setBOOL("ShowDebugConsole", gDebugView->mDebugConsolep->getVisible()); 2209 gSavedSettings.setBOOL("ShowDebugConsole", gDebugView->mDebugConsolep->getVisible());
2162 gSavedSettings.setBOOL("ShowDebugStats", gDebugView->mFloaterStatsp->getVisible());
2163 } 2210 }
2164 } 2211 }
2165 2212
@@ -2268,6 +2315,9 @@ void LLAppViewer::handleViewerCrash()
2268{ 2315{
2269 llinfos << "Handle viewer crash entry." << llendl; 2316 llinfos << "Handle viewer crash entry." << llendl;
2270 2317
2318 //print out recorded call stacks if there are any.
2319 LLError::LLCallStacks::print();
2320
2271 LLAppViewer* pApp = LLAppViewer::instance(); 2321 LLAppViewer* pApp = LLAppViewer::instance();
2272 if (pApp->beingDebugged()) 2322 if (pApp->beingDebugged())
2273 { 2323 {
@@ -2317,6 +2367,8 @@ void LLAppViewer::handleViewerCrash()
2317 gDebugInfo["SessionLength"] = F32(LLFrameTimer::getElapsedSeconds()); 2367 gDebugInfo["SessionLength"] = F32(LLFrameTimer::getElapsedSeconds());
2318 gDebugInfo["StartupState"] = LLStartUp::getStartupStateString(); 2368 gDebugInfo["StartupState"] = LLStartUp::getStartupStateString();
2319 gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer) getCurrentRSS() >> 10; 2369 gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer) getCurrentRSS() >> 10;
2370 gDebugInfo["FirstLogin"] = (LLSD::Boolean) gAgent.isFirstLogin();
2371 gDebugInfo["FirstRunThisInstall"] = gSavedSettings.getBOOL("FirstRunThisInstall");
2320 2372
2321 if(gLogoutInProgress) 2373 if(gLogoutInProgress)
2322 { 2374 {
@@ -2356,16 +2408,17 @@ void LLAppViewer::handleViewerCrash()
2356 if(gLLErrorActivated) crash_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,LLERROR_MARKER_FILE_NAME); 2408 if(gLLErrorActivated) crash_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,LLERROR_MARKER_FILE_NAME);
2357 else crash_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,ERROR_MARKER_FILE_NAME); 2409 else crash_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,ERROR_MARKER_FILE_NAME);
2358 llinfos << "Creating crash marker file " << crash_file_name << llendl; 2410 llinfos << "Creating crash marker file " << crash_file_name << llendl;
2359 apr_file_t* crash_file = ll_apr_file_open(crash_file_name, LL_APR_W); 2411
2360 if (crash_file) 2412 LLAPRFile crash_file ;
2413 crash_file.open(crash_file_name, LL_APR_W);
2414 if (crash_file.getFileHandle())
2361 { 2415 {
2362 LL_INFOS("MarkerFile") << "Created crash marker file " << crash_file_name << LL_ENDL; 2416 LL_INFOS("MarkerFile") << "Created crash marker file " << crash_file_name << LL_ENDL;
2363 } 2417 }
2364 else 2418 else
2365 { 2419 {
2366 LL_WARNS("MarkerFile") << "Cannot create error marker file " << crash_file_name << LL_ENDL; 2420 LL_WARNS("MarkerFile") << "Cannot create error marker file " << crash_file_name << LL_ENDL;
2367 } 2421 }
2368 apr_file_close(crash_file);
2369 } 2422 }
2370 2423
2371 if (gMessageSystem && gDirUtilp) 2424 if (gMessageSystem && gDirUtilp)
@@ -2394,6 +2447,10 @@ void LLAppViewer::handleViewerCrash()
2394 2447
2395 LLError::logToFile(""); 2448 LLError::logToFile("");
2396 2449
2450// On Mac, we send the report on the next run, since we need macs crash report
2451// for a stack trace, so we have to let it the app fail.
2452#if !LL_DARWIN
2453
2397 // Remove the marker file, since otherwise we'll spawn a process that'll keep it locked 2454 // Remove the marker file, since otherwise we'll spawn a process that'll keep it locked
2398 if(gDebugInfo["LastExecEvent"].asInteger() == LAST_EXEC_LOGOUT_CRASH) 2455 if(gDebugInfo["LastExecEvent"].asInteger() == LAST_EXEC_LOGOUT_CRASH)
2399 { 2456 {
@@ -2407,6 +2464,8 @@ void LLAppViewer::handleViewerCrash()
2407 // Call to pure virtual, handled by platform specific llappviewer instance. 2464 // Call to pure virtual, handled by platform specific llappviewer instance.
2408 pApp->handleCrashReporting(); 2465 pApp->handleCrashReporting();
2409 2466
2467#endif //!LL_DARWIN
2468
2410 return; 2469 return;
2411} 2470}
2412 2471
@@ -2419,13 +2478,13 @@ bool LLAppViewer::anotherInstanceRunning()
2419 LL_DEBUGS("MarkerFile") << "Checking marker file for lock..." << LL_ENDL; 2478 LL_DEBUGS("MarkerFile") << "Checking marker file for lock..." << LL_ENDL;
2420 2479
2421 //Freeze case checks 2480 //Freeze case checks
2422 apr_file_t* fMarker = ll_apr_file_open(marker_file, LL_APR_RB); 2481 if (LLAPRFile::isExist(marker_file, NULL, LL_APR_RB))
2423 if (fMarker != NULL)
2424 { 2482 {
2425 // File exists, try opening with write permissions 2483 // File exists, try opening with write permissions
2426 apr_file_close(fMarker); 2484 LLAPRFile outfile ;
2427 fMarker = ll_apr_file_open(marker_file, LL_APR_WB); 2485 outfile.open(marker_file, LL_APR_WB);
2428 if (fMarker == NULL) 2486 apr_file_t* fMarker = outfile.getFileHandle() ;
2487 if (!fMarker)
2429 { 2488 {
2430 // Another instance is running. Skip the rest of these operations. 2489 // Another instance is running. Skip the rest of these operations.
2431 LL_INFOS("MarkerFile") << "Marker file is locked." << LL_ENDL; 2490 LL_INFOS("MarkerFile") << "Marker file is locked." << LL_ENDL;
@@ -2433,12 +2492,10 @@ bool LLAppViewer::anotherInstanceRunning()
2433 } 2492 }
2434 if (apr_file_lock(fMarker, APR_FLOCK_NONBLOCK | APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) //flock(fileno(fMarker), LOCK_EX | LOCK_NB) == -1) 2493 if (apr_file_lock(fMarker, APR_FLOCK_NONBLOCK | APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) //flock(fileno(fMarker), LOCK_EX | LOCK_NB) == -1)
2435 { 2494 {
2436 apr_file_close(fMarker);
2437 LL_INFOS("MarkerFile") << "Marker file is locked." << LL_ENDL; 2495 LL_INFOS("MarkerFile") << "Marker file is locked." << LL_ENDL;
2438 return true; 2496 return true;
2439 } 2497 }
2440 // No other instances; we'll lock this file now & delete on quit. 2498 // No other instances; we'll lock this file now & delete on quit.
2441 apr_file_close(fMarker);
2442 } 2499 }
2443 LL_DEBUGS("MarkerFile") << "Marker file isn't locked." << LL_ENDL; 2500 LL_DEBUGS("MarkerFile") << "Marker file isn't locked." << LL_ENDL;
2444 return false; 2501 return false;
@@ -2464,51 +2521,46 @@ void LLAppViewer::initMarkerFile()
2464 std::string llerror_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, LLERROR_MARKER_FILE_NAME); 2521 std::string llerror_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, LLERROR_MARKER_FILE_NAME);
2465 std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME); 2522 std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME);
2466 2523
2467 apr_file_t* fMarker = ll_apr_file_open(logout_marker_file, LL_APR_RB); 2524
2468 if(fMarker != NULL) 2525 if (LLAPRFile::isExist(mMarkerFileName, NULL, LL_APR_RB) && !anotherInstanceRunning())
2526 {
2527 gLastExecEvent = LAST_EXEC_FROZE;
2528 LL_INFOS("MarkerFile") << "Exec marker found: program froze on previous execution" << LL_ENDL;
2529 }
2530
2531 if(LLAPRFile::isExist(logout_marker_file, NULL, LL_APR_RB))
2469 { 2532 {
2470 apr_file_close(fMarker);
2471 LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << LAST_EXEC_LLERROR_CRASH << LL_ENDL; 2533 LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << LAST_EXEC_LLERROR_CRASH << LL_ENDL;
2472 gLastExecEvent = LAST_EXEC_LOGOUT_FROZE; 2534 gLastExecEvent = LAST_EXEC_LOGOUT_FROZE;
2473 } 2535 }
2474 fMarker = ll_apr_file_open(llerror_marker_file, LL_APR_RB); 2536 if(LLAPRFile::isExist(llerror_marker_file, NULL, LL_APR_RB))
2475 if(fMarker != NULL)
2476 { 2537 {
2477 apr_file_close(fMarker);
2478 llinfos << "Last exec LLError crashed, setting LastExecEvent to " << LAST_EXEC_LLERROR_CRASH << llendl; 2538 llinfos << "Last exec LLError crashed, setting LastExecEvent to " << LAST_EXEC_LLERROR_CRASH << llendl;
2479 if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH; 2539 if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH;
2480 else gLastExecEvent = LAST_EXEC_LLERROR_CRASH; 2540 else gLastExecEvent = LAST_EXEC_LLERROR_CRASH;
2481 } 2541 }
2482 fMarker = ll_apr_file_open(error_marker_file, LL_APR_RB); 2542 if(LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB))
2483 if(fMarker != NULL)
2484 { 2543 {
2485 apr_file_close(fMarker);
2486 LL_INFOS("MarkerFile") << "Last exec crashed, setting LastExecEvent to " << LAST_EXEC_OTHER_CRASH << LL_ENDL; 2544 LL_INFOS("MarkerFile") << "Last exec crashed, setting LastExecEvent to " << LAST_EXEC_OTHER_CRASH << LL_ENDL;
2487 if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH; 2545 if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH;
2488 else gLastExecEvent = LAST_EXEC_OTHER_CRASH; 2546 else gLastExecEvent = LAST_EXEC_OTHER_CRASH;
2489 } 2547 }
2490
2491 ll_apr_file_remove(logout_marker_file);
2492 ll_apr_file_remove(llerror_marker_file);
2493 ll_apr_file_remove(error_marker_file);
2494 2548
2495 //Freeze case checks 2549 LLAPRFile::remove(logout_marker_file);
2550 LLAPRFile::remove(llerror_marker_file);
2551 LLAPRFile::remove(error_marker_file);
2552
2553 // No new markers if another instance is running.
2496 if(anotherInstanceRunning()) 2554 if(anotherInstanceRunning())
2497 { 2555 {
2498 return; 2556 return;
2499 } 2557 }
2500 2558
2501 fMarker = ll_apr_file_open(mMarkerFileName, LL_APR_RB);
2502 if (fMarker != NULL)
2503 {
2504 apr_file_close(fMarker);
2505 gLastExecEvent = LAST_EXEC_FROZE;
2506 LL_INFOS("MarkerFile") << "Exec marker found: program froze on previous execution" << LL_ENDL;
2507 }
2508
2509 // Create the marker file for this execution & lock it 2559 // Create the marker file for this execution & lock it
2510 mMarkerFile = ll_apr_file_open(mMarkerFileName, LL_APR_W); 2560 apr_status_t s;
2511 if (mMarkerFile) 2561 s = mMarkerFile.open(mMarkerFileName, LL_APR_W, gAPRPoolp);
2562
2563 if (s == APR_SUCCESS && mMarkerFile.getFileHandle())
2512 { 2564 {
2513 LL_DEBUGS("MarkerFile") << "Marker file created." << LL_ENDL; 2565 LL_DEBUGS("MarkerFile") << "Marker file created." << LL_ENDL;
2514 } 2566 }
@@ -2517,9 +2569,9 @@ void LLAppViewer::initMarkerFile()
2517 LL_INFOS("MarkerFile") << "Failed to create marker file." << LL_ENDL; 2569 LL_INFOS("MarkerFile") << "Failed to create marker file." << LL_ENDL;
2518 return; 2570 return;
2519 } 2571 }
2520 if (apr_file_lock(mMarkerFile, APR_FLOCK_NONBLOCK | APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) 2572 if (apr_file_lock(mMarkerFile.getFileHandle(), APR_FLOCK_NONBLOCK | APR_FLOCK_EXCLUSIVE) != APR_SUCCESS)
2521 { 2573 {
2522 apr_file_close(mMarkerFile); 2574 mMarkerFile.close() ;
2523 LL_INFOS("MarkerFile") << "Marker file cannot be locked." << LL_ENDL; 2575 LL_INFOS("MarkerFile") << "Marker file cannot be locked." << LL_ENDL;
2524 return; 2576 return;
2525 } 2577 }
@@ -2530,14 +2582,14 @@ void LLAppViewer::initMarkerFile()
2530void LLAppViewer::removeMarkerFile(bool leave_logout_marker) 2582void LLAppViewer::removeMarkerFile(bool leave_logout_marker)
2531{ 2583{
2532 LL_DEBUGS("MarkerFile") << "removeMarkerFile()" << LL_ENDL; 2584 LL_DEBUGS("MarkerFile") << "removeMarkerFile()" << LL_ENDL;
2533 if (mMarkerFile != NULL) 2585 if (mMarkerFile.getFileHandle())
2534 { 2586 {
2535 ll_apr_file_remove( mMarkerFileName ); 2587 mMarkerFile.close() ;
2536 mMarkerFile = NULL; 2588 LLAPRFile::remove( mMarkerFileName );
2537 } 2589 }
2538 if (mLogoutMarkerFile != NULL && !leave_logout_marker) 2590 if (mLogoutMarkerFile != NULL && !leave_logout_marker)
2539 { 2591 {
2540 ll_apr_file_remove( mLogoutMarkerFileName ); 2592 LLAPRFile::remove( mLogoutMarkerFileName );
2541 mLogoutMarkerFile = NULL; 2593 mLogoutMarkerFile = NULL;
2542 } 2594 }
2543} 2595}
@@ -2564,6 +2616,7 @@ void LLAppViewer::requestQuit()
2564 effectp->setPositionGlobal(gAgent.getPositionGlobal()); 2616 effectp->setPositionGlobal(gAgent.getPositionGlobal());
2565 effectp->setColor(LLColor4U(gAgent.getEffectColor())); 2617 effectp->setColor(LLColor4U(gAgent.getEffectColor()));
2566 LLHUDManager::getInstance()->sendEffects(); 2618 LLHUDManager::getInstance()->sendEffects();
2619 effectp->markDead() ;//remove it.
2567 2620
2568 // Attempt to close all floaters that might be 2621 // Attempt to close all floaters that might be
2569 // editing things. 2622 // editing things.
@@ -2579,32 +2632,34 @@ void LLAppViewer::requestQuit()
2579 mQuitRequested = true; 2632 mQuitRequested = true;
2580} 2633}
2581 2634
2582static void finish_quit(S32 option, void *userdata) 2635static bool finish_quit(const LLSD& notification, const LLSD& response)
2583{ 2636{
2637 S32 option = LLNotification::getSelectedOption(notification, response);
2638
2584 if (option == 0) 2639 if (option == 0)
2585 { 2640 {
2586 LLAppViewer::instance()->requestQuit(); 2641 LLAppViewer::instance()->requestQuit();
2587 } 2642 }
2643 return false;
2588} 2644}
2645static LLNotificationFunctorRegistration finish_quit_reg("ConfirmQuit", finish_quit);
2589 2646
2590void LLAppViewer::userQuit() 2647void LLAppViewer::userQuit()
2591{ 2648{
2592 gViewerWindow->alertXml("ConfirmQuit", finish_quit, NULL); 2649 LLNotifications::instance().add("ConfirmQuit");
2593} 2650}
2594 2651
2595static void finish_early_exit(S32 option, void* userdata) 2652static bool finish_early_exit(const LLSD& notification, const LLSD& response)
2596{ 2653{
2597 LLAppViewer::instance()->forceQuit(); 2654 LLAppViewer::instance()->forceQuit();
2655 return false;
2598} 2656}
2599 2657
2600void LLAppViewer::earlyExit(const std::string& msg) 2658void LLAppViewer::earlyExit(const std::string& name, const LLSD& substitutions)
2601{ 2659{
2602 llwarns << "app_early_exit: " << msg << llendl; 2660 llwarns << "app_early_exit: " << name << llendl;
2603 gDoDisconnect = TRUE; 2661 gDoDisconnect = TRUE;
2604// LLStringUtil::format_map_t args; 2662 LLNotifications::instance().add(name, substitutions, LLSD(), finish_early_exit);
2605// args["[MESSAGE]"] = mesg;
2606// gViewerWindow->alertXml("AppEarlyExit", args, finish_early_exit);
2607 LLAlertDialog::showCritical(msg, finish_early_exit, NULL);
2608} 2663}
2609 2664
2610void LLAppViewer::forceExit(S32 arg) 2665void LLAppViewer::forceExit(S32 arg)
@@ -2621,6 +2676,75 @@ void LLAppViewer::abortQuit()
2621 mQuitRequested = false; 2676 mQuitRequested = false;
2622} 2677}
2623 2678
2679void LLAppViewer::migrateCacheDirectory()
2680{
2681#if LL_WINDOWS || LL_DARWIN
2682 // NOTE: (Nyx) as of 1.21, cache for mac is moving to /library/caches/SecondLife from
2683 // /library/application support/SecondLife/cache This should clear/delete the old dir.
2684
2685 // As of 1.23 the Windows cache moved from
2686 // C:\Documents and Settings\James\Application Support\SecondLife\cache
2687 // to
2688 // C:\Documents and Settings\James\Local Settings\Application Support\SecondLife
2689 //
2690 // The Windows Vista equivalent is from
2691 // C:\Users\James\AppData\Roaming\SecondLife\cache
2692 // to
2693 // C:\Users\James\AppData\Local\SecondLife
2694 //
2695 // Note the absence of \cache on the second path. James.
2696
2697 // Only do this once per fresh install of this version.
2698 if (gSavedSettings.getBOOL("MigrateCacheDirectory"))
2699 {
2700 gSavedSettings.setBOOL("MigrateCacheDirectory", FALSE);
2701
2702 std::string delimiter = gDirUtilp->getDirDelimiter();
2703 std::string old_cache_dir = gDirUtilp->getOSUserAppDir() + delimiter + "cache";
2704 std::string new_cache_dir = gDirUtilp->getCacheDir(true);
2705
2706 if (gDirUtilp->fileExists(old_cache_dir))
2707 {
2708 llinfos << "Migrating cache from " << old_cache_dir << " to " << new_cache_dir << llendl;
2709
2710 // Migrate inventory cache to avoid pain to inventory database after mass update
2711 S32 file_count = 0;
2712 std::string file_name;
2713 std::string mask = delimiter + "*.*";
2714 while (gDirUtilp->getNextFileInDir(old_cache_dir, mask, file_name, false))
2715 {
2716 if (file_name == "." || file_name == "..") continue;
2717 std::string source_path = old_cache_dir + delimiter + file_name;
2718 std::string dest_path = new_cache_dir + delimiter + file_name;
2719 if (!LLFile::rename(source_path, dest_path))
2720 {
2721 file_count++;
2722 }
2723 }
2724 llinfos << "Moved " << file_count << " files" << llendl;
2725
2726 // Nuke the old cache
2727 gDirUtilp->setCacheDir(old_cache_dir);
2728 purgeCache();
2729 gDirUtilp->setCacheDir(new_cache_dir);
2730
2731#if LL_DARWIN
2732 // Clean up Mac files not deleted by removing *.*
2733 std::string ds_store = old_cache_dir + "/.DS_Store";
2734 if (gDirUtilp->fileExists(ds_store))
2735 {
2736 LLFile::remove(ds_store);
2737 }
2738#endif
2739 if (LLFile::rmdir(old_cache_dir) != 0)
2740 {
2741 llwarns << "could not delete old cache directory " << old_cache_dir << llendl;
2742 }
2743 }
2744 }
2745#endif // LL_WINDOWS || LL_DARWIN
2746}
2747
2624bool LLAppViewer::initCache() 2748bool LLAppViewer::initCache()
2625{ 2749{
2626 mPurgeCache = false; 2750 mPurgeCache = false;
@@ -2642,37 +2766,8 @@ bool LLAppViewer::initCache()
2642 } 2766 }
2643 } 2767 }
2644 2768
2645 // Delete old cache directory 2769 // We have moved the location of the cache directory over time.
2646#ifdef LL_DARWIN 2770 migrateCacheDirectory();
2647 if (LL_VERSION_MAJOR >= 1 && LL_VERSION_MINOR >= 21)
2648 {
2649 if (gLastRunVersion != gCurrentVersion)
2650 {
2651 // NOTE: (Nyx) as of 1.21, cache for mac is moving to /library/caches/SecondLife from
2652 // /library/application support/SecondLife/cache This should clear/delete the old dir.
2653 std::string cache_dir = gDirUtilp->getOSUserAppDir();
2654 std::string new_cache_dir = gDirUtilp->getOSCacheDir();
2655 cache_dir = cache_dir + "/cache";
2656 new_cache_dir = new_cache_dir + "/" + gSecondLife;
2657 if (gDirUtilp->fileExists(cache_dir))
2658 {
2659 gDirUtilp->setCacheDir(cache_dir);
2660 purgeCache();
2661 gDirUtilp->setCacheDir(new_cache_dir);
2662
2663 std::string ds_store = cache_dir + "/.DS_Store";
2664 if (gDirUtilp->fileExists(ds_store.c_str()))
2665 {
2666 LLFile::remove(ds_store.c_str());
2667 }
2668 if (LLFile::remove(cache_dir.c_str()) != 0)
2669 {
2670 llwarns << "could not delete old cache directory" << llendl;
2671 }
2672 }
2673 }
2674 }
2675#endif
2676 2771
2677 // Setup and verify the cache location 2772 // Setup and verify the cache location
2678 std::string cache_location = gSavedSettings.getString("CacheLocation"); 2773 std::string cache_location = gSavedSettings.getString("CacheLocation");
@@ -2878,18 +2973,22 @@ const std::string& LLAppViewer::getWindowTitle() const
2878} 2973}
2879 2974
2880// Callback from a dialog indicating user was logged out. 2975// Callback from a dialog indicating user was logged out.
2881void finish_disconnect(S32 option, void* userdata) 2976bool finish_disconnect(const LLSD& notification, const LLSD& response)
2882{ 2977{
2978 S32 option = LLNotification::getSelectedOption(notification, response);
2979
2883 if (1 == option) 2980 if (1 == option)
2884 { 2981 {
2885 LLAppViewer::instance()->forceQuit(); 2982 LLAppViewer::instance()->forceQuit();
2886 } 2983 }
2984 return false;
2887} 2985}
2888 2986
2889// Callback from an early disconnect dialog, force an exit 2987// Callback from an early disconnect dialog, force an exit
2890void finish_forced_disconnect(S32 /* option */, void* /* userdata */) 2988bool finish_forced_disconnect(const LLSD& notification, const LLSD& response)
2891{ 2989{
2892 LLAppViewer::instance()->forceQuit(); 2990 LLAppViewer::instance()->forceQuit();
2991 return false;
2893} 2992}
2894 2993
2895 2994
@@ -2909,19 +3008,19 @@ void LLAppViewer::forceDisconnect(const std::string& mesg)
2909 big_reason = mesg; 3008 big_reason = mesg;
2910 } 3009 }
2911 3010
2912 LLStringUtil::format_map_t args; 3011 LLSD args;
2913 gDoDisconnect = TRUE; 3012 gDoDisconnect = TRUE;
2914 3013
2915 if (LLStartUp::getStartupState() < STATE_STARTED) 3014 if (LLStartUp::getStartupState() < STATE_STARTED)
2916 { 3015 {
2917 // Tell users what happened 3016 // Tell users what happened
2918 args["[ERROR_MESSAGE]"] = big_reason; 3017 args["ERROR_MESSAGE"] = big_reason;
2919 gViewerWindow->alertXml("ErrorMessage", args, finish_forced_disconnect); 3018 LLNotifications::instance().add("ErrorMessage", args, LLSD(), &finish_forced_disconnect);
2920 } 3019 }
2921 else 3020 else
2922 { 3021 {
2923 args["[MESSAGE]"] = big_reason; 3022 args["MESSAGE"] = big_reason;
2924 gViewerWindow->alertXml("YouHaveBeenLoggedOut", args, finish_disconnect ); 3023 LLNotifications::instance().add("YouHaveBeenLoggedOut", args, LLSD(), &finish_disconnect );
2925 } 3024 }
2926} 3025}
2927 3026
@@ -3190,6 +3289,7 @@ void LLAppViewer::idle()
3190 // 3289 //
3191 3290
3192 gFrameStats.start(LLFrameStats::IDLE_NETWORK); 3291 gFrameStats.start(LLFrameStats::IDLE_NETWORK);
3292 stop_glerror();
3193 idleNetwork(); 3293 idleNetwork();
3194 stop_glerror(); 3294 stop_glerror();
3195 3295
@@ -3497,7 +3597,10 @@ void LLAppViewer::sendLogoutRequest()
3497 //Set internal status variables and marker files 3597 //Set internal status variables and marker files
3498 gLogoutInProgress = TRUE; 3598 gLogoutInProgress = TRUE;
3499 mLogoutMarkerFileName = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,LOGOUT_MARKER_FILE_NAME); 3599 mLogoutMarkerFileName = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,LOGOUT_MARKER_FILE_NAME);
3500 mLogoutMarkerFile = ll_apr_file_open(mLogoutMarkerFileName, LL_APR_W); 3600
3601 LLAPRFile outfile ;
3602 outfile.open(mLogoutMarkerFileName, LL_APR_W);
3603 mLogoutMarkerFile = outfile.getFileHandle() ;
3501 if (mLogoutMarkerFile) 3604 if (mLogoutMarkerFile)
3502 { 3605 {
3503 llinfos << "Created logout marker file " << mLogoutMarkerFileName << llendl; 3606 llinfos << "Created logout marker file " << mLogoutMarkerFileName << llendl;
@@ -3506,7 +3609,7 @@ void LLAppViewer::sendLogoutRequest()
3506 else 3609 else
3507 { 3610 {
3508 llwarns << "Cannot create logout marker file " << mLogoutMarkerFileName << llendl; 3611 llwarns << "Cannot create logout marker file " << mLogoutMarkerFileName << llendl;
3509 } 3612 }
3510 } 3613 }
3511} 3614}
3512 3615
@@ -3524,6 +3627,8 @@ static F32 CheckMessagesMaxTime = CHECK_MESSAGES_DEFAULT_MAX_TIME;
3524void LLAppViewer::idleNetwork() 3627void LLAppViewer::idleNetwork()
3525{ 3628{
3526 pingMainloopTimeout("idleNetwork"); 3629 pingMainloopTimeout("idleNetwork");
3630 LLError::LLCallStacks::clear() ;
3631 llpushcallstacks ;
3527 3632
3528 gObjectList.mNumNewObjects = 0; 3633 gObjectList.mNumNewObjects = 0;
3529 S32 total_decoded = 0; 3634 S32 total_decoded = 0;
@@ -3534,7 +3639,7 @@ void LLAppViewer::idleNetwork()
3534 3639
3535 // deal with any queued name requests and replies. 3640 // deal with any queued name requests and replies.
3536 gCacheName->processPending(); 3641 gCacheName->processPending();
3537 3642 llpushcallstacks ;
3538 LLTimer check_message_timer; 3643 LLTimer check_message_timer;
3539 // Read all available packets from network 3644 // Read all available packets from network
3540 stop_glerror(); 3645 stop_glerror();
@@ -3606,16 +3711,16 @@ void LLAppViewer::idleNetwork()
3606 gPrintMessagesThisFrame = FALSE; 3711 gPrintMessagesThisFrame = FALSE;
3607 } 3712 }
3608 } 3713 }
3609 3714 llpushcallstacks ;
3610 gObjectList.mNumNewObjectsStat.addValue(gObjectList.mNumNewObjects); 3715 gObjectList.mNumNewObjectsStat.addValue(gObjectList.mNumNewObjects);
3611 3716
3612 // Retransmit unacknowledged packets. 3717 // Retransmit unacknowledged packets.
3613 gXferManager->retransmitUnackedPackets(); 3718 gXferManager->retransmitUnackedPackets();
3614 gAssetStorage->checkForTimeouts(); 3719 gAssetStorage->checkForTimeouts();
3615 3720 llpushcallstacks ;
3616 gViewerThrottle.updateDynamicThrottle(); 3721 gViewerThrottle.updateDynamicThrottle();
3617 3722
3618 3723 llpushcallstacks ;
3619 // Check that the circuit between the viewer and the agent's current 3724 // Check that the circuit between the viewer and the agent's current
3620 // region is still alive 3725 // region is still alive
3621 LLViewerRegion *agent_region = gAgent.getRegion(); 3726 LLViewerRegion *agent_region = gAgent.getRegion();
@@ -3631,6 +3736,7 @@ void LLAppViewer::idleNetwork()
3631 mAgentRegionLastID = this_region_id; 3736 mAgentRegionLastID = this_region_id;
3632 mAgentRegionLastAlive = this_region_alive; 3737 mAgentRegionLastAlive = this_region_alive;
3633 } 3738 }
3739 llpushcallstacks ;
3634} 3740}
3635 3741
3636void LLAppViewer::disconnectViewer() 3742void LLAppViewer::disconnectViewer()
@@ -3659,6 +3765,35 @@ void LLAppViewer::disconnectViewer()
3659 { 3765 {
3660 gFloaterView->restoreAll(); 3766 gFloaterView->restoreAll();
3661 } 3767 }
3768
3769
3770 std::list<LLFloater*> floaters_to_close;
3771 for(LLView::child_list_const_iter_t it = gFloaterView->getChildList()->begin();
3772 it != gFloaterView->getChildList()->end();
3773 ++it)
3774 {
3775 // The following names are defined in the
3776 // floater_image_preview.xml
3777 // floater_sound_preview.xml
3778 // floater_animation_preview.xml
3779 // files.
3780 LLFloater* fl = static_cast<LLFloater*>(*it);
3781 if(fl
3782 && (fl->getName() == "Image Preview"
3783 || fl->getName() == "Sound Preview"
3784 || fl->getName() == "Animation Preview"
3785 ))
3786 {
3787 floaters_to_close.push_back(fl);
3788 }
3789 }
3790
3791 while(!floaters_to_close.empty())
3792 {
3793 LLFloater* fl = floaters_to_close.front();
3794 floaters_to_close.pop_front();
3795 fl->close();
3796 }
3662 } 3797 }
3663 3798
3664 if (LLSelectMgr::getInstance()) 3799 if (LLSelectMgr::getInstance())
@@ -3688,6 +3823,9 @@ void LLAppViewer::disconnectViewer()
3688 // Now we just ask the LLWorld singleton to cleanly shut down. 3823 // Now we just ask the LLWorld singleton to cleanly shut down.
3689 LLWorld::getInstance()->destroyClass(); 3824 LLWorld::getInstance()->destroyClass();
3690 3825
3826 // call all self-registered classes
3827 LLDestroyClassList::instance().fireCallbacks();
3828
3691 cleanup_xfer_manager(); 3829 cleanup_xfer_manager();
3692 gDisconnected = TRUE; 3830 gDisconnected = TRUE;
3693} 3831}