From 089fc07d207c71ce1401e72f09c31ad8c45872e2 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:44:58 -0500 Subject: Second Life viewer sources 1.17.0.12 --- linden/doc/contributions.txt | 8 +- linden/indra/SConstruct | 88 +- linden/indra/indra_complete/indra_complete.sln | 1 - linden/indra/lib/python/indra/llmanifest.py | 9 + linden/indra/llaudio/llaudiodecodemgr.cpp | 4 +- linden/indra/llcharacter/llcharacter.cpp | 9 + linden/indra/llcharacter/llcharacter.h | 3 + linden/indra/llcharacter/llheadrotmotion.cpp | 1 + linden/indra/llcharacter/llmotioncontroller.cpp | 20 +- linden/indra/llcharacter/llmotioncontroller.h | 3 + linden/indra/llcommon/files.lst | 1 + linden/indra/llcommon/llcommon.vcproj | 6 + linden/indra/llcommon/llerror.cpp | 7 + linden/indra/llcommon/llevent.h | 2 +- linden/indra/llcommon/llframetimer.cpp | 6 + linden/indra/llcommon/llframetimer.h | 1 + linden/indra/llcommon/llmetrics.cpp | 165 + linden/indra/llcommon/llmetrics.h | 62 + linden/indra/llcommon/llprocessor.cpp | 2 +- linden/indra/llcommon/llsdutil.cpp | 13 + linden/indra/llcommon/llsdutil.h | 3 + linden/indra/llcommon/llthread.h | 3 +- linden/indra/llcommon/llversion.h | 4 +- linden/indra/llimage/llimageworker.cpp | 4 +- linden/indra/llimage/llimageworker.h | 3 +- linden/indra/llinventory/llnotecard.cpp | 6 - linden/indra/llinventory/llparcel.cpp | 17 + linden/indra/llinventory/llparcel.h | 44 +- linden/indra/llinventory/llparcelflags.h | 7 +- linden/indra/llinventory/llsaleinfo.cpp | 4 +- linden/indra/llinventory/lluserrelations.h | 2 +- linden/indra/llmath/lloctree.h | 1 - linden/indra/llmath/lltreenode.h | 1 - linden/indra/llmath/llvolume.cpp | 83 +- linden/indra/llmath/llvolume.h | 22 +- linden/indra/llmessage/llbuffer.h | 1 + linden/indra/llmessage/llcachename.cpp | 6 + linden/indra/llmessage/llcachename.h | 2 + linden/indra/llmessage/llcurl.cpp | 11 + linden/indra/llmessage/llcurl.h | 1 + linden/indra/llmessage/llhttpclient.cpp | 53 +- linden/indra/llmessage/llhttpclient.h | 8 +- linden/indra/llmessage/llhttpnode.h | 7 +- linden/indra/llmessage/llinstantmessage.cpp | 36 +- linden/indra/llmessage/llinstantmessage.h | 20 +- linden/indra/llmessage/llmessageconfig.cpp | 5 +- linden/indra/llmessage/llregionflags.h | 9 +- linden/indra/llmessage/message.cpp | 21 +- linden/indra/llrender/llvertexbuffer.cpp | 28 + linden/indra/llrender/llvertexbuffer.h | 28 + linden/indra/llui/llalertdialog.cpp | 9 +- linden/indra/llui/llbutton.cpp | 78 + linden/indra/llui/llbutton.h | 7 + linden/indra/llui/llfloater.cpp | 73 +- linden/indra/llui/llfloater.h | 10 +- linden/indra/llui/lllineeditor.cpp | 81 + linden/indra/llui/lllineeditor.h | 10 + linden/indra/llui/llmemberlistener.h | 1 - linden/indra/llui/llpanel.cpp | 17 +- linden/indra/llui/llpanel.h | 2 +- linden/indra/llui/llscrolllistctrl.cpp | 51 +- linden/indra/llui/llscrolllistctrl.h | 8 +- linden/indra/llui/lltabcontainer.cpp | 54 +- linden/indra/llui/lltabcontainer.h | 7 +- linden/indra/llui/lltexteditor.cpp | 57 +- linden/indra/llui/lltexteditor.h | 3 +- linden/indra/llui/llui.h | 91 + linden/indra/llui/lluictrlfactory.cpp | 11 +- linden/indra/llui/lluictrlfactory.h | 4 +- linden/indra/llui/llview.cpp | 20 +- linden/indra/llui/llview.h | 4 +- linden/indra/llvfs/lllfsthread.h | 3 +- linden/indra/llwindow/llwindow.cpp | 10 + linden/indra/llwindow/llwindow.h | 2 + linden/indra/llwindow/llwindowmacosx.cpp | 16 +- linden/indra/llwindow/llwindowmesaheadless.h | 1 + linden/indra/llwindow/llwindowsdl.cpp | 58 +- linden/indra/llwindow/llwindowwin32.cpp | 49 +- linden/indra/llxml/llxmlnode.cpp | 60 + linden/indra/llxml/llxmlnode.h | 6 +- linden/indra/lscript/lscript_compile/indra.l | 7 - linden/indra/mac_updater/mac_updater.cpp | 194 +- .../indra/newview/English.lproj/InfoPlist.strings | 4 +- linden/indra/newview/Info-SecondLife.plist | 2 +- .../installers/windows/installer_template.nsi | 361 +- .../windows/installer_template_multilang.nsi | 938 ----- linden/indra/newview/licenses-linux.txt | 33 + linden/indra/newview/linux_tools/wrapper.sh | 9 +- linden/indra/newview/llagent.cpp | 2 +- linden/indra/newview/llagent.h | 5 +- linden/indra/newview/llcallingcard.cpp | 1 + linden/indra/newview/llchatbar.cpp | 4 +- linden/indra/newview/llcontroldef.cpp | 10 +- linden/indra/newview/llcubemap.h | 2 +- linden/indra/newview/lldrawable.h | 2 +- linden/indra/newview/llflexibleobject.cpp | 12 +- linden/indra/newview/llfloateravatarinfo.cpp | 6 + linden/indra/newview/llfloateravatarinfo.h | 2 + linden/indra/newview/llfloaterbuy.cpp | 2 +- linden/indra/newview/llfloaterbuycontents.cpp | 2 +- linden/indra/newview/llfloatergesture.cpp | 1 - linden/indra/newview/llfloaterinspect.cpp | 28 + linden/indra/newview/llfloaterpreference.cpp | 36 +- linden/indra/newview/llfloaterpreference.h | 4 +- linden/indra/newview/llfolderview.cpp | 5 +- linden/indra/newview/llgroupmgr.cpp | 30 +- linden/indra/newview/llgroupnotify.cpp | 4 +- linden/indra/newview/llhudeffecttrail.cpp | 12 +- linden/indra/newview/llhudobject.h | 2 +- linden/indra/newview/llimpanel.cpp | 231 +- linden/indra/newview/llimpanel.h | 7 +- linden/indra/newview/llimview.cpp | 205 +- linden/indra/newview/llinventorybridge.cpp | 68 +- linden/indra/newview/llinventoryview.h | 4 +- linden/indra/newview/llmutelist.cpp | 7 +- linden/indra/newview/llnotify.cpp | 47 +- linden/indra/newview/llnotify.h | 7 + linden/indra/newview/lloverlaybar.cpp | 21 - linden/indra/newview/llpanelavatar.cpp | 39 +- linden/indra/newview/llpanelavatar.h | 8 + linden/indra/newview/llpanelclassified.cpp | 64 +- linden/indra/newview/llpanelclassified.h | 11 +- linden/indra/newview/llpanelgeneral.cpp | 2 - linden/indra/newview/llpanelgeneral.h | 1 - linden/indra/newview/llpanelgroup.cpp | 6 +- linden/indra/newview/llpanelgroupgeneral.cpp | 6 +- linden/indra/newview/llpanelgrouplandmoney.cpp | 4 +- linden/indra/newview/llpanelgroupnotices.cpp | 4 +- linden/indra/newview/llpanelgrouproles.cpp | 12 +- linden/indra/newview/llpanelgroupvoting.cpp | 8 +- linden/indra/newview/llpanelmsgs.cpp | 30 +- linden/indra/newview/llpanelmsgs.h | 6 +- linden/indra/newview/llpanelnetwork.cpp | 10 - linden/indra/newview/llpanelobject.cpp | 3 + linden/indra/newview/llpanelweb.cpp | 368 +- linden/indra/newview/llpanelweb.h | 54 +- linden/indra/newview/llpreview.cpp | 17 +- linden/indra/newview/llpreview.h | 5 +- linden/indra/newview/llpreviewanim.cpp | 10 +- linden/indra/newview/llpreviewgesture.cpp | 6 +- linden/indra/newview/llpreviewlandmark.cpp | 20 +- linden/indra/newview/llpreviewlandmark.h | 3 +- linden/indra/newview/llpreviewnotecard.cpp | 16 +- linden/indra/newview/llpreviewnotecard.h | 3 +- linden/indra/newview/llpreviewscript.cpp | 10 +- linden/indra/newview/llpreviewsound.cpp | 6 +- linden/indra/newview/llpreviewtexture.cpp | 4 +- linden/indra/newview/llselectmgr.cpp | 20 +- linden/indra/newview/llselectmgr.h | 7 +- linden/indra/newview/llspatialpartition.cpp | 2 +- linden/indra/newview/llspatialpartition.h | 7 +- linden/indra/newview/llstartup.cpp | 48 +- linden/indra/newview/lltexturefetch.cpp | 2 + linden/indra/newview/lltoolbrush.cpp | 3 +- linden/indra/newview/lltoolcomp.cpp | 9 +- linden/indra/newview/lltoolgrab.cpp | 6 +- linden/indra/newview/lltoolmgr.cpp | 3 + linden/indra/newview/lltoolselectland.cpp | 3 +- linden/indra/newview/llviewerinventory.h | 6 +- linden/indra/newview/llviewermenu.cpp | 381 +- linden/indra/newview/llviewermessage.cpp | 152 +- linden/indra/newview/llviewerobject.cpp | 10 +- linden/indra/newview/llviewerobject.h | 2 +- linden/indra/newview/llviewerparcelmgr.cpp | 17 +- linden/indra/newview/llviewerparcelmgr.h | 7 +- linden/indra/newview/llviewerpartsim.cpp | 6 +- linden/indra/newview/llviewerpartsim.h | 7 +- linden/indra/newview/llviewerpartsource.cpp | 13 +- linden/indra/newview/llviewerpartsource.h | 6 +- linden/indra/newview/llviewerregion.cpp | 4 +- linden/indra/newview/llviewertexteditor.cpp | 92 +- linden/indra/newview/llviewertexteditor.h | 4 +- linden/indra/newview/llviewerwindow.cpp | 13 +- linden/indra/newview/llvoavatar.cpp | 2 +- linden/indra/newview/llvoclouds.h | 3 +- linden/indra/newview/llvograss.h | 4 +- linden/indra/newview/llvoground.h | 3 +- linden/indra/newview/llvopartgroup.h | 4 +- linden/indra/newview/llvosky.cpp | 5 +- linden/indra/newview/llvosky.h | 5 +- linden/indra/newview/llvostars.h | 3 +- linden/indra/newview/llvosurfacepatch.h | 3 +- linden/indra/newview/llvotextbubble.h | 3 +- linden/indra/newview/llvotree.h | 4 +- linden/indra/newview/llvovolume.h | 4 +- linden/indra/newview/llvowater.h | 1 - linden/indra/newview/pipeline.cpp | 2 - linden/indra/newview/pipeline.h | 2 +- linden/indra/newview/postbuild.bat | 91 +- linden/indra/newview/releasenotes.txt | 53 +- linden/indra/newview/res/newViewRes.rc | 8 +- linden/indra/newview/secondlife-i686.supp | 175 + linden/indra/newview/skins/xui/en-us/alerts.xml | 94 +- .../newview/skins/xui/en-us/floater_about.xml | 6 +- .../skins/xui/en-us/floater_instant_message.xml | 4 - .../skins/xui/en-us/panel_preferences_general.xml | 8 +- .../skins/xui/en-us/panel_preferences_popups.xml | 57 +- .../skins/xui/en-us/panel_preferences_web.xml | 34 + .../skins/xui/en-us/panel_settings_msgbox.xml | 17 - linden/indra/newview/skins/xui/ko/alerts.xml | 2656 +++++++------ .../indra/newview/skins/xui/ko/floater_about.xml | 10 +- .../newview/skins/xui/ko/floater_about_land.xml | 215 +- .../skins/xui/ko/floater_animation_preview.xml | 79 +- .../indra/newview/skins/xui/ko/floater_auction.xml | 10 +- .../newview/skins/xui/ko/floater_avatar_picker.xml | 14 +- .../skins/xui/ko/floater_avatar_textures.xml | 26 +- .../newview/skins/xui/ko/floater_build_options.xml | 5 +- .../indra/newview/skins/xui/ko/floater_bumps.xml | 12 +- .../newview/skins/xui/ko/floater_buy_contents.xml | 4 +- .../newview/skins/xui/ko/floater_buy_currency.xml | 28 +- .../newview/skins/xui/ko/floater_buy_land.xml | 105 +- .../newview/skins/xui/ko/floater_buy_object.xml | 6 +- .../newview/skins/xui/ko/floater_chat_history.xml | 5 +- .../newview/skins/xui/ko/floater_clothing.xml | 4 +- .../newview/skins/xui/ko/floater_color_picker.xml | 14 +- .../newview/skins/xui/ko/floater_critical.xml | 4 +- .../newview/skins/xui/ko/floater_customize.xml | 374 +- .../newview/skins/xui/ko/floater_directory.xml | 167 +- .../indra/newview/skins/xui/ko/floater_friends.xml | 42 +- .../indra/newview/skins/xui/ko/floater_gesture.xml | 10 +- .../newview/skins/xui/ko/floater_god_tools.xml | 93 +- .../newview/skins/xui/ko/floater_group_info.xml | 133 +- .../indra/newview/skins/xui/ko/floater_groups.xml | 8 +- linden/indra/newview/skins/xui/ko/floater_html.xml | 22 +- .../newview/skins/xui/ko/floater_html_help.xml | 4 +- linden/indra/newview/skins/xui/ko/floater_im.xml | 25 +- .../newview/skins/xui/ko/floater_image_preview.xml | 15 +- .../indra/newview/skins/xui/ko/floater_import.xml | 2 +- .../indra/newview/skins/xui/ko/floater_inspect.xml | 14 + .../skins/xui/ko/floater_instant_message.xml | 23 +- .../newview/skins/xui/ko/floater_inventory.xml | 29 +- .../xui/ko/floater_inventory_item_properties.xml | 30 +- .../skins/xui/ko/floater_inventory_view_finder.xml | 12 +- .../newview/skins/xui/ko/floater_joystick.xml | 55 + .../newview/skins/xui/ko/floater_land_holdings.xml | 20 +- .../skins/xui/ko/floater_live_lsleditor.xml | 2 +- .../newview/skins/xui/ko/floater_lsl_guide.xml | 7 + linden/indra/newview/skins/xui/ko/floater_mute.xml | 13 +- .../indra/newview/skins/xui/ko/floater_new_im.xml | 2 +- .../skins/xui/ko/floater_new_outfit_dialog.xml | 23 +- .../newview/skins/xui/ko/floater_openobject.xml | 4 +- linden/indra/newview/skins/xui/ko/floater_pay.xml | 4 +- .../newview/skins/xui/ko/floater_pay_object.xml | 8 +- .../newview/skins/xui/ko/floater_postcard.xml | 16 +- .../newview/skins/xui/ko/floater_preferences.xml | 3 +- .../skins/xui/ko/floater_preview_animation.xml | 6 +- .../xui/ko/floater_preview_embedded_texture.xml | 7 +- .../xui/ko/floater_preview_existing_landmark.xml | 5 +- .../skins/xui/ko/floater_preview_gesture.xml | 18 +- .../skins/xui/ko/floater_preview_new_landmark.xml | 7 +- .../skins/xui/ko/floater_preview_notecard.xml | 2 +- .../ko/floater_preview_notecard_keep_discard.xml | 6 +- .../newview/skins/xui/ko/floater_preview_sound.xml | 7 +- .../skins/xui/ko/floater_preview_texture.xml | 4 +- .../ko/floater_preview_texture_keep_discard.xml | 6 +- .../skins/xui/ko/floater_price_for_listing.xml | 12 +- linden/indra/newview/skins/xui/ko/floater_rate.xml | 16 +- .../newview/skins/xui/ko/floater_report_abuse.xml | 44 +- .../newview/skins/xui/ko/floater_report_bug.xml | 35 +- .../newview/skins/xui/ko/floater_script_debug.xml | 2 +- .../skins/xui/ko/floater_script_ed_panel.xml | 13 +- .../newview/skins/xui/ko/floater_script_queue.xml | 2 +- .../newview/skins/xui/ko/floater_script_search.xml | 2 +- .../newview/skins/xui/ko/floater_sell_land.xml | 26 +- .../skins/xui/ko/floater_settings_debug.xml | 4 +- .../newview/skins/xui/ko/floater_snapshot.xml | 40 +- .../indra/newview/skins/xui/ko/floater_telehub.xml | 24 +- .../newview/skins/xui/ko/floater_texture_ctrl.xml | 6 +- .../indra/newview/skins/xui/ko/floater_tools.xml | 154 +- .../newview/skins/xui/ko/floater_top_objects.xml | 28 +- linden/indra/newview/skins/xui/ko/floater_tos.xml | 10 +- .../skins/xui/ko/floater_wearable_save_as.xml | 4 +- .../newview/skins/xui/ko/floater_world_map.xml | 53 +- .../indra/newview/skins/xui/ko/menu_inventory.xml | 43 +- .../indra/newview/skins/xui/ko/menu_pie_avatar.xml | 18 +- .../indra/newview/skins/xui/ko/menu_pie_object.xml | 23 +- .../indra/newview/skins/xui/ko/menu_pie_self.xml | 22 +- linden/indra/newview/skins/xui/ko/menu_viewer.xml | 200 +- .../newview/skins/xui/ko/need_to_translate.xml | 660 +++- .../indra/newview/skins/xui/ko/need_to_update.xml | 4028 +++++++++++++++++++- linden/indra/newview/skins/xui/ko/notify.xml | 360 +- linden/indra/newview/skins/xui/ko/panel_avatar.xml | 129 +- .../skins/xui/ko/panel_avatar_classified.xml | 10 +- .../newview/skins/xui/ko/panel_avatar_pick.xml | 8 +- .../indra/newview/skins/xui/ko/panel_chat_bar.xml | 12 +- .../newview/skins/xui/ko/panel_classified.xml | 2 +- linden/indra/newview/skins/xui/ko/panel_event.xml | 16 +- linden/indra/newview/skins/xui/ko/panel_group.xml | 6 +- .../newview/skins/xui/ko/panel_group_finder.xml | 2 +- .../newview/skins/xui/ko/panel_group_general.xml | 50 +- .../newview/skins/xui/ko/panel_group_invite.xml | 16 +- .../skins/xui/ko/panel_group_land_money.xml | 42 +- .../newview/skins/xui/ko/panel_group_notices.xml | 52 +- .../newview/skins/xui/ko/panel_group_roles.xml | 63 +- .../newview/skins/xui/ko/panel_group_voting.xml | 26 +- .../newview/skins/xui/ko/panel_land_covenant.xml | 24 +- linden/indra/newview/skins/xui/ko/panel_login.xml | 22 +- .../newview/skins/xui/ko/panel_media_remote.xml | 8 +- .../newview/skins/xui/ko/panel_music_remote.xml | 8 +- .../newview/skins/xui/ko/panel_overlaybar.xml | 14 +- linden/indra/newview/skins/xui/ko/panel_place.xml | 4 +- .../newview/skins/xui/ko/panel_place_small.xml | 4 +- .../skins/xui/ko/panel_preferences_audio.xml | 28 +- .../skins/xui/ko/panel_preferences_chat.xml | 30 +- .../skins/xui/ko/panel_preferences_general.xml | 92 +- .../skins/xui/ko/panel_preferences_graphics1.xml | 38 +- .../skins/xui/ko/panel_preferences_graphics2.xml | 28 +- .../skins/xui/ko/panel_preferences_graphics3.xml | 23 +- .../newview/skins/xui/ko/panel_preferences_im.xml | 22 +- .../skins/xui/ko/panel_preferences_input.xml | 15 +- .../skins/xui/ko/panel_preferences_network.xml | 29 +- .../skins/xui/ko/panel_preferences_popups.xml | 11 +- .../newview/skins/xui/ko/panel_region_covenant.xml | 34 +- .../newview/skins/xui/ko/panel_region_debug.xml | 27 +- .../newview/skins/xui/ko/panel_region_estate.xml | 54 +- .../newview/skins/xui/ko/panel_region_general.xml | 20 +- .../newview/skins/xui/ko/panel_region_terrain.xml | 12 +- .../newview/skins/xui/ko/panel_region_texture.xml | 49 +- .../newview/skins/xui/ko/panel_scrolling_param.xml | 4 +- .../newview/skins/xui/ko/panel_settings_chat.xml | 28 +- .../newview/skins/xui/ko/panel_settings_im.xml | 10 +- .../newview/skins/xui/ko/panel_settings_msgbox.xml | 9 +- .../skins/xui/ko/panel_settings_network.xml | 28 +- .../newview/skins/xui/ko/panel_settings_web.xml | 40 +- .../newview/skins/xui/ko/panel_status_bar.xml | 17 +- .../indra/newview/skins/xui/ko/panel_toolbar.xml | 24 +- .../indra/newview/skins/xui/ko/panel_top_pick.xml | 6 +- linden/indra/newview/skins/xui/ko/role_actions.xml | 166 +- linden/indra/newview/viewer.cpp | 81 +- linden/indra/newview/viewer_manifest.py | 4 + linden/indra/win_updater/updater.cpp | 10 - linden/libraries/include/llmozlib.h | 8 +- 332 files changed, 11879 insertions(+), 5972 deletions(-) create mode 100644 linden/indra/llcommon/llmetrics.cpp create mode 100644 linden/indra/llcommon/llmetrics.h delete mode 100644 linden/indra/newview/installers/windows/installer_template_multilang.nsi create mode 100644 linden/indra/newview/secondlife-i686.supp create mode 100644 linden/indra/newview/skins/xui/en-us/panel_preferences_web.xml delete mode 100644 linden/indra/newview/skins/xui/en-us/panel_settings_msgbox.xml create mode 100644 linden/indra/newview/skins/xui/ko/floater_inspect.xml create mode 100644 linden/indra/newview/skins/xui/ko/floater_joystick.xml create mode 100644 linden/indra/newview/skins/xui/ko/floater_lsl_guide.xml diff --git a/linden/doc/contributions.txt b/linden/doc/contributions.txt index dbb18f2..72e79f3 100644 --- a/linden/doc/contributions.txt +++ b/linden/doc/contributions.txt @@ -5,11 +5,12 @@ received from them. To see more about these contributions, visit http://jira.secondlife.com/ and enter the issue identifier. Alissa Sabre - VWR-81, VWR-83, VWR-414, VWR-415 +Blakar Ogre - VWR-881 blino Nakamura - VWR-17 bushing Spatula - VWR-424 -Drewan Keats - VWR-28 +Drewan Keats - VWR-28, VWR-412 Dylan Haskell - VWR-72 -Dzonatas Sol - VWR-198 +Dzonatas Sol - VWR-198, VWR-878 Eddy Stryker - VWR-15, VWR-23 Gigs Taggart - VWR-71, VWR-326 Ginko Bayliss - VWR-4 @@ -19,11 +20,14 @@ Jacek Antonelli - VWR-165, VWR-188 Joghert LeSabre - VWR-64 Kage Pixel - VWR-11 Kunnis Basiat - VWR-82 +Nicholaz Beresford - VWR-793, VWR-794, VWR-802, VWR-803, VWR-804, VWR-805, VWR-808, VWR-809, VWR-810, VWR-823, VWR-869, VWR-870, VWR-871, VWR-908, VWR-966 Paul Churchill - VWR-20 Paula Innis - VWR-30 Peekay Semyorka - VWR-7, VWR-19, VWR-49 SignpostMarv Martin - VWR-154, VWR-155 +Simon Nolan - VWR-409 SpacedOut Frye - VWR-57, VWR-94, VWR-121, VWR-123 Strife Onizuka - SVC-9, VWR-74, VWR-85, VWR-148 +Zi Ree - VWR-671, VWR-682 Zipherius Turas - VWR-76, VWR-77 diff --git a/linden/indra/SConstruct b/linden/indra/SConstruct index cbf2029..39b50bc 100644 --- a/linden/indra/SConstruct +++ b/linden/indra/SConstruct @@ -1,4 +1,4 @@ -################################################# +################################################# -*- python -*- # # SConstruct makefile for Second Life viewer # and servers. @@ -19,6 +19,7 @@ import os import sys import glob +import re platform = sys.platform if platform == 'linux2': @@ -28,18 +29,49 @@ if platform == 'linux2': # GET VERSION # ###################### -pipe = os.popen('grep LL_VERSION_MAJOR llcommon/llversion.h | sed \'s/.*=//; s/[^0-9]*//g\'') -version_major = pipe.read().rstrip('\n') -pipe.close() -pipe = os.popen('grep LL_VERSION_MINOR llcommon/llversion.h | sed \'s/.*=//; s/[^0-9]*//g\'') -version_minor = pipe.read().rstrip('\n') -pipe.close() -pipe = os.popen('grep LL_VERSION_PATCH llcommon/llversion.h | sed \'s/.*=//; s/[^0-9]*//g\'') -version_patch = pipe.read().rstrip('\n') -pipe.close() -pipe = os.popen('grep LL_VERSION_BUILD llcommon/llversion.h | sed \'s/.*=//; s/[^0-9]*//g\'') -version_build = pipe.read().rstrip('\n') -pipe.close() +def grep(filestr,searchstr): + try: + f = open( filestr, 'r' ) + except IOError: + print "No such file " + filestr + sys.exit(2) + r = re.compile( searchstr ) + for line in f.read().split('\n'): + if ( r.search(line) ): + f.close() + return line + f.close() + return None + +def get_version(llver): + re_vernum = re.compile("[0-9]+") + rstr = grep('llcommon/llversion.h', "LL_VERSION_" + llver) + if rstr == None: + print "No version information in llversion.h" + sys.exit(2) + version = re_vernum.findall( rstr )[1] + return version + +version_major = get_version("MAJOR") +version_minor = get_version("MINOR") +version_patch = get_version("PATCH") +version_build = get_version("BUILD") + +version = version_major + '.' + version_minor + '.' + version_patch + '.' + version_build + + +############### +# SYSTEM INFO # +############### + +# Debian Sarge has a broken glibc that leads to build failures on +# *non*-Sarge systems (because of prebuilt static libraries built on +# Sarge). + +try: + debian_sarge = open('/etc/debian_version').read().strip() == '3.1' +except: + debian_sarge = False ######################### # COMMAND LINE OPTIONS # @@ -90,7 +122,7 @@ for build_target in targets: system_str = arch + '-' + platform - print 'Building ' + build_target + ' ' + version_major + '.' + version_minor + '.' + version_patch + '.' + version_build + ' on ' + system_str + ' (' + buildtype + ')' + print 'Building ' + build_target + ' ' + version + ' on ' + system_str + ' (' + buildtype + ')' system_lib_dir = '../libraries/' + system_str if build_target == 'client': @@ -161,11 +193,15 @@ for build_target in targets: if build_target == 'server': # Server flags - flags += '-march=pentiumpro -D_GNU_SOURCE -ftemplate-depth-60 -DLL_MESA_HEADLESS=1 -DLL_MESA=1 ' - try: - server_cppflags = os.environ['SERVER_CPPFLAGS'] - except: - server_cppflags = '' + flags += '-D_GNU_SOURCE -ftemplate-depth-60 -DLL_MESA_HEADLESS=1 -DLL_MESA=1 ' + if arch == 'i686': + flags += '-march=pentiumpro ' + if debian_sarge: + def_server_cppflags = '' + else: + def_server_cppflags = '-DCTYPE_WORKAROUND' + server_cppflags = os.environ.get('SERVER_CPPFLAGS', + def_server_cppflags) flags += server_cppflags + ' ' else: # Viewer flags @@ -243,9 +279,15 @@ for build_target in targets: if enable_distcc: compiler = 'distcc ' + gcc_bin + lib_path = [lib_dir] + [system_lib_dir] + + mysql_lib_dir = '/usr/lib/mysql4/mysql' + if os.path.isdir(mysql_lib_dir): + lib_path.append(mysql_lib_dir) + base_env = Environment(CXX = compiler, CPPPATH = include_dirs, - LIBPATH = [lib_dir] + [system_lib_dir], + LIBPATH = lib_path, LINKFLAGS = system_link_flags + '--no-keep-memory --reduce-memory-overheads ' ) ### Environments for various build types ### @@ -418,8 +460,10 @@ for build_target in targets: external_libs = client_external_libs + common_external_libs + [ 'freetype', 'jpeg', 'SDL', 'GL', 'GLU', 'ogg', 'vorbisenc', 'vorbisfile', 'vorbis', 'db-4.2', 'openjpeg' ] - if arch != 'x86_64' and arch != 'x86_64cross' and enable_fmod: - external_libs += [ 'fmod-3.75' ] + if arch != 'x86_64' and arch != 'x86_64cross': + if enable_fmod: + external_libs += [ 'fmod-3.75' ] + external_libs += ['tcmalloc', 'stacktrace'] external_libs.remove('cares') diff --git a/linden/indra/indra_complete/indra_complete.sln b/linden/indra/indra_complete/indra_complete.sln index 5c5c0ca..80bb436 100644 --- a/linden/indra/indra_complete/indra_complete.sln +++ b/linden/indra/indra_complete/indra_complete.sln @@ -69,7 +69,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "newview", "..\newview\newvi {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9} {4C8D64D5-649F-481E-96BE-EF1E82A77ACB} = {4C8D64D5-649F-481E-96BE-EF1E82A77ACB} {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E} = {5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E} - {648685F3-8760-4CC5-BB2B-CAF9DECC25A4} = {648685F3-8760-4CC5-BB2B-CAF9DECC25A4} {D37774F4-253D-4760-BF64-372A943224A1} = {D37774F4-253D-4760-BF64-372A943224A1} EndProjectSection EndProject diff --git a/linden/indra/lib/python/indra/llmanifest.py b/linden/indra/lib/python/indra/llmanifest.py index c49e39a..e295cd7 100644 --- a/linden/indra/lib/python/indra/llmanifest.py +++ b/linden/indra/lib/python/indra/llmanifest.py @@ -85,6 +85,7 @@ def get_default_version(srctree): build = re.search("LL_VERSION_BUILD\s=\s([0-9]+)", contents).group(1) return major, minor, patch, build +DEFAULT_CHANNEL = 'Second Life Release' ARGUMENTS=[ dict(name='actions', @@ -113,6 +114,9 @@ ARGUMENTS=[ though it's not strictly a grid, 'firstlook' is also an acceptable value for this parameter.""", default=""), + dict(name='channel', + description="""The channel to use for updates.""", + default=DEFAULT_CHANNEL), dict(name='installer_name', description=""" The name of the file that the installer should be packaged up into. Only used on Linux at the moment.""", @@ -224,6 +228,11 @@ class LLManifest(object): self.src_prefix = [srctree] self.dst_prefix = [dsttree] self.created_paths = [] + + def default_grid(self): + return self.args.get('grid', None) == '' + def default_channel(self): + return self.args.get('channel', None) == DEFAULT_CHANNEL def construct(self): """ Meant to be overriden by LLManifest implementors with code that diff --git a/linden/indra/llaudio/llaudiodecodemgr.cpp b/linden/indra/llaudio/llaudiodecodemgr.cpp index 0dbc64f..ffd115a 100644 --- a/linden/indra/llaudio/llaudiodecodemgr.cpp +++ b/linden/indra/llaudio/llaudiodecodemgr.cpp @@ -73,7 +73,6 @@ public: }; LLVorbisDecodeState(const LLUUID &uuid, const LLString &out_filename); - virtual ~LLVorbisDecodeState(); BOOL initDecode(); BOOL decodeSection(); // Return TRUE if done. @@ -85,7 +84,10 @@ public: BOOL isValid() const { return mValid; } BOOL isDone() const { return mDone; } const LLUUID &getUUID() const { return mUUID; } + protected: + virtual ~LLVorbisDecodeState(); + BOOL mValid; BOOL mDone; LLAtomicS32 mBytesRead; diff --git a/linden/indra/llcharacter/llcharacter.cpp b/linden/indra/llcharacter/llcharacter.cpp index 90a3cc6..29872f7 100644 --- a/linden/indra/llcharacter/llcharacter.cpp +++ b/linden/indra/llcharacter/llcharacter.cpp @@ -190,6 +190,15 @@ void LLCharacter::updateMotion(BOOL force_update) //----------------------------------------------------------------------------- +// deactivateAllMotions() +//----------------------------------------------------------------------------- +void LLCharacter::deactivateAllMotions() +{ + mMotionController.deactivateAllMotions(); +} + + +//----------------------------------------------------------------------------- // flushAllMotions() //----------------------------------------------------------------------------- void LLCharacter::flushAllMotions() diff --git a/linden/indra/llcharacter/llcharacter.h b/linden/indra/llcharacter/llcharacter.h index 90824aa..666beb2 100644 --- a/linden/indra/llcharacter/llcharacter.h +++ b/linden/indra/llcharacter/llcharacter.h @@ -170,6 +170,9 @@ public: // no cached references to character joint data. This is // useful if a character wants to rebuild it's skeleton. virtual void flushAllMotions(); + + // Flush only wipes active animations. + virtual void deactivateAllMotions(); // dumps information for debugging virtual void dumpCharacter( LLJoint *joint = NULL ); diff --git a/linden/indra/llcharacter/llheadrotmotion.cpp b/linden/indra/llcharacter/llheadrotmotion.cpp index be0b55d..cfab048 100644 --- a/linden/indra/llcharacter/llheadrotmotion.cpp +++ b/linden/indra/llcharacter/llheadrotmotion.cpp @@ -431,6 +431,7 @@ BOOL LLEyeMotion::onUpdate(F32 time, U8* joint_mask) LLVector3 up; eye_look_at = *targetPos; + has_eye_target = TRUE; F32 lookAtDistance = eye_look_at.normVec(); left.setVec(skyward % eye_look_at); diff --git a/linden/indra/llcharacter/llmotioncontroller.cpp b/linden/indra/llcharacter/llmotioncontroller.cpp index 5545841..e2453c9 100644 --- a/linden/indra/llcharacter/llmotioncontroller.cpp +++ b/linden/indra/llcharacter/llmotioncontroller.cpp @@ -546,7 +546,6 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty { if (motionp->isStopped() && mTime > motionp->getStopTime() + motionp->getEaseOutDuration()) { - posep->setWeight(0.f); deactivateMotion(motionp); } continue; @@ -573,7 +572,6 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty } else { - posep->setWeight(0.f); deactivateMotion(motionp); continue; } @@ -824,6 +822,7 @@ BOOL LLMotionController::activateMotion(LLMotion *motion, F32 time) //----------------------------------------------------------------------------- BOOL LLMotionController::deactivateMotion(LLMotion *motion) { + motion->getPose()->setWeight(0.f); motion->deactivate(); mActiveMotions.remove(motion); @@ -855,6 +854,23 @@ LLMotion *LLMotionController::findMotion(const LLUUID& id) return mAllMotions[id]; } +//----------------------------------------------------------------------------- +// deactivateAllMotions() +//----------------------------------------------------------------------------- +void LLMotionController::deactivateAllMotions() +{ + //They must all die, precious. + for (std::map::iterator iter = mAllMotions.begin(); + iter != mAllMotions.end(); iter++) + { + LLMotion* motionp = iter->second; + if (motionp) motionp->deactivate(); + } + + // delete all motion instances + deleteAllMotions(); +} + //----------------------------------------------------------------------------- // flushAllMotions() diff --git a/linden/indra/llcharacter/llmotioncontroller.h b/linden/indra/llcharacter/llmotioncontroller.h index e4c7b3f..94149da 100644 --- a/linden/indra/llcharacter/llmotioncontroller.h +++ b/linden/indra/llcharacter/llmotioncontroller.h @@ -158,6 +158,9 @@ public: // releases all motion instances void flushAllMotions(); + //Flush is a liar. + void deactivateAllMotions(); + // pause and continue all motions void pause(); void unpause(); diff --git a/linden/indra/llcommon/files.lst b/linden/indra/llcommon/files.lst index 6a48752..0474cbb 100644 --- a/linden/indra/llcommon/files.lst +++ b/linden/indra/llcommon/files.lst @@ -18,6 +18,7 @@ llcommon/llliveappconfig.cpp llcommon/lllivefile.cpp llcommon/llmemory.cpp llcommon/llmemorystream.cpp +llcommon/llmetrics.cpp llcommon/llmortician.cpp llcommon/llprocessor.cpp llcommon/llqueuedthread.cpp diff --git a/linden/indra/llcommon/llcommon.vcproj b/linden/indra/llcommon/llcommon.vcproj index ca91e18..399dae3 100644 --- a/linden/indra/llcommon/llcommon.vcproj +++ b/linden/indra/llcommon/llcommon.vcproj @@ -215,6 +215,9 @@ RelativePath=".\llmemorystream.cpp"> + + + + #include @@ -397,6 +398,12 @@ namespace LLError shouldLogCallCounter(0) { } + ~Settings() + { + for_each(recorders.begin(), recorders.end(), + DeletePointer()); + } + static Settings*& getPtr(); }; diff --git a/linden/indra/llcommon/llevent.h b/linden/indra/llcommon/llevent.h index 18b0596..cab8817 100644 --- a/linden/indra/llcommon/llevent.h +++ b/linden/indra/llcommon/llevent.h @@ -88,12 +88,12 @@ public: class LLSimpleListener : public LLEventListener { public: - virtual ~LLSimpleListener(); void clearDispatchers(); virtual bool handleAttach(LLEventDispatcher *dispatcher); virtual bool handleDetach(LLEventDispatcher *dispatcher); protected: + ~LLSimpleListener(); std::vector mDispatchers; }; diff --git a/linden/indra/llcommon/llframetimer.cpp b/linden/indra/llcommon/llframetimer.cpp index 5ae4a6b..2b53e8c 100644 --- a/linden/indra/llcommon/llframetimer.cpp +++ b/linden/indra/llcommon/llframetimer.cpp @@ -70,6 +70,12 @@ void LLFrameTimer::reset() mExpiry = sFrameTime; } +void LLFrameTimer::resetWithExpiry(F32 expiration) +{ + reset(); + setTimerExpirySec(expiration); +} + // Don't combine pause/unpause with start/stop // Useage: // LLFrameTime foo; // starts automatically diff --git a/linden/indra/llcommon/llframetimer.h b/linden/indra/llcommon/llframetimer.h index 0366e09..de550e2 100644 --- a/linden/indra/llcommon/llframetimer.h +++ b/linden/indra/llcommon/llframetimer.h @@ -75,6 +75,7 @@ public: void start(); void stop(); void reset(); + void resetWithExpiry(F32 expiration); void pause(); void unpause(); void setTimerExpirySec(F32 expiration); diff --git a/linden/indra/llcommon/llmetrics.cpp b/linden/indra/llcommon/llmetrics.cpp new file mode 100644 index 0000000..583f840 --- /dev/null +++ b/linden/indra/llcommon/llmetrics.cpp @@ -0,0 +1,165 @@ +/** + * @file llmetrics.cpp + * @author Kelly + * @date 2007-05-25 + * @brief Metrics accumulation and associated functions + * + * Copyright (c) 2007-2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +#include "linden_common.h" +#include "llmetrics.h" + +#include "llsd.h" +#include "llsdserialize.h" +#include "llframetimer.h" + +class LLMetricsImpl +{ +public: + LLMetricsImpl() { } + ~LLMetricsImpl(); + + void recordEvent(const std::string& location, const std::string& mesg, bool success); + void printTotals(LLSD metadata); + void recordEventDetails(const std::string& location, + const std::string& mesg, + bool success, + LLSD stats); +private: + LLFrameTimer mLastPrintTimer; + LLSD mMetricsMap; +}; + +LLMetricsImpl::~LLMetricsImpl() +{ +} + +void LLMetricsImpl::recordEventDetails(const std::string& location, + const std::string& mesg, + bool success, + LLSD stats) +{ + recordEvent(location,mesg,success); + + LLSD metrics = LLSD::emptyMap(); + metrics["location"] = location; + metrics["stats"] = stats; + + llinfos << "LLMETRICS: " << LLSDOStreamer(metrics) << llendl; +} + +// Store this: +// [ {'location_1':{'mesg_1':{'success':i10, 'fail':i0}, +// 'mesg_2':{'success':i10, 'fail':i0}}, +// {'location_2',{'mesg_3':{'success':i10, 'fail':i0}} ] +void LLMetricsImpl::recordEvent(const std::string& location, const std::string& mesg, bool success) +{ + LLSD& stats = mMetricsMap[location][mesg]; + if (success) + { + stats["success"] = stats["success"].asInteger() + 1; + } + else + { + stats["fail"] = stats["fail"].asInteger() + 1; + } +} + +// Print this: +// { 'meta': +// { 'elapsed_time':r3600.000 } +// 'stats': +// [ {'location':'location_1', 'mesg':'mesg_1', 'success':i10, 'fail':i0}, +// {'location':'location_1', 'mesg':'mesg_2', 'success':i10, 'fail':i0}, +// {'location':'location_2', 'mesg':'mesg_3', 'success':i10, 'fail':i0} ] } +void LLMetricsImpl::printTotals(LLSD metadata) +{ + F32 elapsed_time = mLastPrintTimer.getElapsedTimeAndResetF32(); + metadata["elapsed_time"] = elapsed_time; + + LLSD out_sd = LLSD::emptyMap(); + out_sd["meta"] = metadata; + + LLSD stats = LLSD::emptyArray(); + + LLSD::map_const_iterator loc_it = mMetricsMap.beginMap(); + LLSD::map_const_iterator loc_end = mMetricsMap.endMap(); + for ( ; loc_it != loc_end; ++loc_it) + { + const std::string& location = (*loc_it).first; + + const LLSD& loc_map = (*loc_it).second; + LLSD::map_const_iterator mesg_it = loc_map.beginMap(); + LLSD::map_const_iterator mesg_end = loc_map.endMap(); + for ( ; mesg_it != mesg_end; ++mesg_it) + { + const std::string& mesg = (*mesg_it).first; + const LLSD& mesg_map = (*mesg_it).second; + + LLSD entry = LLSD::emptyMap(); + entry["location"] = location; + entry["mesg"] = mesg; + entry["success"] = mesg_map["success"]; + entry["fail"] = mesg_map["fail"]; + + stats.append(entry); + } + } + + out_sd["stats"] = stats; + + llinfos << "LLMETRICS: AGGREGATE: " << LLSDOStreamer(out_sd) << llendl; +} + +LLMetrics::LLMetrics() +{ + mImpl = new LLMetricsImpl(); +} + +LLMetrics::~LLMetrics() +{ + delete mImpl; + mImpl = NULL; +} + +void LLMetrics::recordEvent(const std::string& location, const std::string& mesg, bool success) +{ + if (mImpl) mImpl->recordEvent(location,mesg,success); +} + +void LLMetrics::printTotals(LLSD meta) +{ + if (mImpl) mImpl->printTotals(meta); +} + + +void LLMetrics::recordEventDetails(const std::string& location, + const std::string& mesg, + bool success, + LLSD stats) +{ + if (mImpl) mImpl->recordEventDetails(location,mesg,success,stats); +} + diff --git a/linden/indra/llcommon/llmetrics.h b/linden/indra/llcommon/llmetrics.h new file mode 100644 index 0000000..2c216c3 --- /dev/null +++ b/linden/indra/llcommon/llmetrics.h @@ -0,0 +1,62 @@ +/** + * @file llmetrics.h + * @author Kelly + * @date 2007-05-25 + * @brief Declaration of metrics accumulation and associated functions + * + * Copyright (c) 2007-2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +#ifndef LL_LLMETRICS_H +#define LL_LLMETRICS_H + +class LLMetricsImpl; +class LLSD; + +class LLMetrics +{ +public: + LLMetrics(); + virtual ~LLMetrics(); + + // Adds this event to aggregate totals and records details to syslog (llinfos) + virtual void recordEventDetails(const std::string& location, + const std::string& mesg, + bool success, + LLSD stats); + + // Adds this event to aggregate totals + virtual void recordEvent(const std::string& location, const std::string& mesg, bool success); + + // Prints aggregate totals and resets the counts. + virtual void printTotals(LLSD meta); + + +private: + + LLMetricsImpl* mImpl; +}; + +#endif + diff --git a/linden/indra/llcommon/llprocessor.cpp b/linden/indra/llcommon/llprocessor.cpp index d269e35..40dc00c 100644 --- a/linden/indra/llcommon/llprocessor.cpp +++ b/linden/indra/llcommon/llprocessor.cpp @@ -277,7 +277,7 @@ bool CProcessor::AnalyzeIntelProcessor() // Only override the brand if we have it in the lookup table. We should // already have a string here from GetCPUInfo(). JC - if (CPUInfo.uiBrandID < sizeof(INTEL_BRAND)) + if (CPUInfo.uiBrandID < (sizeof(INTEL_BRAND)/sizeof(INTEL_BRAND[0]))) { strcpy(CPUInfo.strBrandID, INTEL_BRAND[CPUInfo.uiBrandID]); diff --git a/linden/indra/llcommon/llsdutil.cpp b/linden/indra/llcommon/llsdutil.cpp index d30afc7..85718ba 100644 --- a/linden/indra/llcommon/llsdutil.cpp +++ b/linden/indra/llcommon/llsdutil.cpp @@ -285,3 +285,16 @@ char* ll_print_sd(const LLSD& sd) buffer[bufferSize - 1] = '\0'; return buffer; } + +char* ll_pretty_print_sd(const LLSD& sd) +{ + const U32 bufferSize = 10 * 1024; + static char buffer[bufferSize]; + std::ostringstream stream; + //stream.rdbuf()->pubsetbuf(buffer, bufferSize); + stream << LLSDOStreamer(sd, LLSDFormatter::OPTIONS_PRETTY); + stream << std::ends; + strncpy(buffer, stream.str().c_str(), bufferSize); + buffer[bufferSize - 1] = '\0'; + return buffer; +} \ No newline at end of file diff --git a/linden/indra/llcommon/llsdutil.h b/linden/indra/llcommon/llsdutil.h index 6344c50..38a7b83 100644 --- a/linden/indra/llcommon/llsdutil.h +++ b/linden/indra/llcommon/llsdutil.h @@ -85,4 +85,7 @@ LLSD ll_binary_from_string(const LLSD& sd); // Serializes sd to static buffer and returns pointer, useful for gdb debugging. char* ll_print_sd(const LLSD& sd); +// Serializes sd to static buffer and returns pointer, using "pretty printing" mode. +char* ll_pretty_print_sd(const LLSD& sd); + #endif // LL_LLSDUTIL_H diff --git a/linden/indra/llcommon/llthread.h b/linden/indra/llcommon/llthread.h index adb04a5..c863322 100644 --- a/linden/indra/llcommon/llthread.h +++ b/linden/indra/llcommon/llthread.h @@ -239,8 +239,9 @@ private: // Pure virtual class class LLResponder : public LLThreadSafeRefCount { -public: +protected: virtual ~LLResponder(); +public: virtual void completed(bool success) = 0; }; diff --git a/linden/indra/llcommon/llversion.h b/linden/indra/llcommon/llversion.h index f2ea20d..57b1512 100644 --- a/linden/indra/llcommon/llversion.h +++ b/linden/indra/llcommon/llversion.h @@ -30,8 +30,8 @@ #define LL_LLVERSION_H const S32 LL_VERSION_MAJOR = 1; -const S32 LL_VERSION_MINOR = 16; +const S32 LL_VERSION_MINOR = 17; const S32 LL_VERSION_PATCH = 0; -const S32 LL_VERSION_BUILD = 5; +const S32 LL_VERSION_BUILD = 12; #endif diff --git a/linden/indra/llimage/llimageworker.cpp b/linden/indra/llimage/llimageworker.cpp index c28f80c..c59eac2 100644 --- a/linden/indra/llimage/llimageworker.cpp +++ b/linden/indra/llimage/llimageworker.cpp @@ -50,7 +50,9 @@ void LLImageWorker::cleanupClass() //---------------------------------------------------------------------------- -LLImageWorker::LLImageWorker(LLImageFormatted* image, U32 priority, S32 discard, LLResponder* responder) +LLImageWorker::LLImageWorker(LLImageFormatted* image, U32 priority, + S32 discard, + LLPointer responder) : LLWorkerClass(sWorkerThread, "Image"), mFormattedImage(image), mDecodedType(-1), diff --git a/linden/indra/llimage/llimageworker.h b/linden/indra/llimage/llimageworker.h index 8026cbb..a84918d 100644 --- a/linden/indra/llimage/llimageworker.h +++ b/linden/indra/llimage/llimageworker.h @@ -41,7 +41,8 @@ public: // LLWorkerThread public: - LLImageWorker(LLImageFormatted* image, U32 priority, S32 discard, LLResponder* responder = NULL); + LLImageWorker(LLImageFormatted* image, U32 priority, S32 discard, + LLPointer responder); ~LLImageWorker(); // called from WORKER THREAD, returns TRUE if done diff --git a/linden/indra/llinventory/llnotecard.cpp b/linden/indra/llinventory/llnotecard.cpp index 47dd690..86eb5b2 100644 --- a/linden/indra/llinventory/llnotecard.cpp +++ b/linden/indra/llinventory/llnotecard.cpp @@ -104,12 +104,6 @@ bool LLNotecard::importEmbeddedItemsStream(std::istream& str) goto import_file_failed; } - if( (index < 0) ) - { - llwarns << "Invalid LLEmbeddedItems file format: invalid ext char index: " << index << llendl; - goto import_file_failed; - } - str >> std::ws >> "inv_item\t0\n"; if(str.fail()) { diff --git a/linden/indra/llinventory/llparcel.cpp b/linden/indra/llinventory/llparcel.cpp index 5b2052f..990e77d 100644 --- a/linden/indra/llinventory/llparcel.cpp +++ b/linden/indra/llinventory/llparcel.cpp @@ -316,6 +316,11 @@ void LLParcel::setLocalID(S32 local_id) mLocalID = local_id; } +void LLParcel::setAllParcelFlags(U32 flags) +{ + mParcelFlags = flags; +} + void LLParcel::setParcelFlag(U32 flag, BOOL b) { if (b) @@ -712,6 +717,16 @@ BOOL LLParcel::importStream(std::istream& input_stream) LLString::convertToU32(value, setting); setParcelFlag(PF_ALLOW_GROUP_SCRIPTS, setting); } + else if ("allow_voice_chat" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_ALLOW_VOICE_CHAT, setting); + } + else if ("use_estate_voice_chan" == keyword) + { + LLString::convertToU32(value, setting); + setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, setting); + } else if ("allow_scripts" == keyword) { LLString::convertToU32(value, setting); @@ -1104,6 +1119,8 @@ BOOL LLParcel::exportStream(std::ostream& output_stream) output_stream << "\t\t sound_local " << (getSoundLocal() ? 1 : 0) << "\n"; output_stream << "\t\t allow_scripts " << (getAllowOtherScripts() ? 1 : 0) << "\n"; output_stream << "\t\t allow_group_scripts " << (getAllowGroupScripts() ? 1 : 0) << "\n"; + output_stream << "\t\t allow_voice_chat " << (getVoiceEnabled() ? 1 : 0) << "\n"; + output_stream << "\t\t use_estate_voice_chan " << (getVoiceUseEstateChannel() ? 1 : 0) << "\n"; output_stream << "\t\t for_sale " << (getForSale() ? 1 : 0) << "\n"; output_stream << "\t\t sell_w_objects " << (getSellWithObjects() ? 1 : 0) << "\n"; output_stream << "\t\t draw_distance " << mDrawDistance << "\n"; diff --git a/linden/indra/llinventory/llparcel.h b/linden/indra/llinventory/llparcel.h index 3144eb9..371b802 100644 --- a/linden/indra/llinventory/llparcel.h +++ b/linden/indra/llinventory/llparcel.h @@ -167,21 +167,39 @@ public: // CREATORS LLParcel(); - LLParcel( const LLUUID &owner_id, - BOOL modify, BOOL terraform, BOOL damage, - time_t claim_date, S32 claim_price, S32 rent_price, S32 area, S32 sim_object_limit, F32 parcel_object_bonus, - BOOL is_group_owned = FALSE); + LLParcel( + const LLUUID &owner_id, + BOOL modify, + BOOL terraform, + BOOL damage, + time_t claim_date, + S32 claim_price, + S32 rent_price, + S32 area, + S32 sim_object_limit, + F32 parcel_object_bonus, + BOOL is_group_owned = FALSE); virtual ~LLParcel(); - void init( const LLUUID &owner_id, - BOOL modify, BOOL terraform, BOOL damage, - time_t claim_date, S32 claim_price, S32 rent_price, - S32 area, S32 sim_object_limit, F32 parcel_object_bonus, BOOL is_group_owned = FALSE); + void init( + const LLUUID &owner_id, + BOOL modify, + BOOL terraform, + BOOL damage, + time_t claim_date, + S32 claim_price, + S32 rent_price, + S32 area, + S32 sim_object_limit, + F32 parcel_object_bonus, + BOOL is_group_owned = FALSE); // TODO: make an actual copy constructor for this - void overrideParcelFlags(U32 flags); + void overrideParcelFlags(U32 flags); // if you specify an agent id here, the group id will be zeroed - void overrideOwner(const LLUUID& owner_id, BOOL is_group_owned = FALSE); + void overrideOwner( + const LLUUID& owner_id, + BOOL is_group_owned = FALSE); void overrideSaleTimerExpires(F32 secs_left) { mSaleTimerExpires.setTimerExpirySec(secs_left); } // MANIPULATORS @@ -211,7 +229,7 @@ public: void setAuctionID(U32 auction_id) { mAuctionID = auction_id;} - void setAllParcelFlags(U32 flags) { mParcelFlags = flags; } + void setAllParcelFlags(U32 flags); void setParcelFlag(U32 flag, BOOL b); void setArea(S32 area, S32 sim_object_limit); @@ -410,6 +428,10 @@ public: { return (mParcelFlags & PF_FOR_SALE) ? TRUE : FALSE; } BOOL getSoundLocal() const { return (mParcelFlags & PF_SOUND_LOCAL) ? TRUE : FALSE; } + BOOL getVoiceEnabled() const + { return (mParcelFlags & PF_ALLOW_VOICE_CHAT) ? TRUE : FALSE; } + BOOL getVoiceUseEstateChannel() const + { return (mParcelFlags & PF_USE_ESTATE_VOICE_CHAN) ? TRUE : FALSE; } BOOL getAllowPublish() const { return (mParcelFlags & PF_ALLOW_PUBLISH) ? TRUE : FALSE; } BOOL getMaturePublish() const diff --git a/linden/indra/llinventory/llparcelflags.h b/linden/indra/llinventory/llparcelflags.h index 17d9151..38d49fe 100644 --- a/linden/indra/llinventory/llparcelflags.h +++ b/linden/indra/llinventory/llparcelflags.h @@ -61,7 +61,8 @@ const U32 PF_ALLOW_GROUP_SCRIPTS = 1 << 25; // Allow scripts owned by group const U32 PF_CREATE_GROUP_OBJECTS = 1 << 26; // Allow object creation by group members or objects const U32 PF_ALLOW_ALL_OBJECT_ENTRY = 1 << 27; // Allow all objects to enter a parcel const U32 PF_ALLOW_GROUP_OBJECT_ENTRY = 1 << 28; // Only allow group (and owner) objects to enter the parcel - +const U32 PF_ALLOW_VOICE_CHAT = 1 << 29; // Allow residents to use voice chat on this parcel +const U32 PF_USE_ESTATE_VOICE_CHAN = 1 << 30; const U32 PF_RESERVED = 1 << 31; @@ -83,7 +84,9 @@ const U32 PF_DEFAULT = PF_ALLOW_FLY | PF_CREATE_GROUP_OBJECTS | PF_USE_BAN_LIST | PF_ALLOW_ALL_OBJECT_ENTRY - | PF_ALLOW_GROUP_OBJECT_ENTRY; + | PF_ALLOW_GROUP_OBJECT_ENTRY + | PF_ALLOW_VOICE_CHAT + | PF_USE_ESTATE_VOICE_CHAN; // Access list flags const U32 AL_ACCESS = (1 << 0); diff --git a/linden/indra/llinventory/llsaleinfo.cpp b/linden/indra/llinventory/llsaleinfo.cpp index 9364529..debb092 100644 --- a/linden/indra/llinventory/llsaleinfo.cpp +++ b/linden/indra/llinventory/llsaleinfo.cpp @@ -175,7 +175,7 @@ BOOL LLSaleInfo::importFile(FILE* fp, BOOL& has_perm_mask, U32& perm_mask) buffer, " %254s %254s", keyword, valuestr); - if(!keyword) + if(!keyword[0]) { continue; } @@ -231,7 +231,7 @@ BOOL LLSaleInfo::importLegacyStream(std::istream& input_stream, BOOL& has_perm_m buffer, " %254s %254s", keyword, valuestr); - if(!keyword) + if(!keyword[0]) { continue; } diff --git a/linden/indra/llinventory/lluserrelations.h b/linden/indra/llinventory/lluserrelations.h index 430dc43..3895533 100644 --- a/linden/indra/llinventory/lluserrelations.h +++ b/linden/indra/llinventory/lluserrelations.h @@ -38,7 +38,7 @@ * @class LLRelationship * * This class represents a relationship between two agents, where the - * related agent is stored and the other agent is the relationship is + * related agent is stored and the other agent in the relationship is * implicit by container ownership. * This is merely a cache of this information used by the sim * and viewer. diff --git a/linden/indra/llmath/lloctree.h b/linden/indra/llmath/lloctree.h index 81b9d8c..004b0a2 100644 --- a/linden/indra/llmath/lloctree.h +++ b/linden/indra/llmath/lloctree.h @@ -57,7 +57,6 @@ public: typedef LLTreeListener BaseType; typedef LLOctreeNode oct_node; - virtual ~LLOctreeListener() { }; virtual void handleChildAddition(const oct_node* parent, oct_node* child) = 0; virtual void handleChildRemoval(const oct_node* parent, const oct_node* child) = 0; }; diff --git a/linden/indra/llmath/lltreenode.h b/linden/indra/llmath/lltreenode.h index a42a156..a47795d 100644 --- a/linden/indra/llmath/lltreenode.h +++ b/linden/indra/llmath/lltreenode.h @@ -57,7 +57,6 @@ template class LLTreeListener: public LLRefCount { public: - virtual ~LLTreeListener() { }; virtual void handleInsertion(const LLTreeNode* node, T* data) = 0; virtual void handleRemoval(const LLTreeNode* node, T* data) = 0; virtual void handleDestruction(const LLTreeNode* node) = 0; diff --git a/linden/indra/llmath/llvolume.cpp b/linden/indra/llmath/llvolume.cpp index fb745b8..327f1bf 100644 --- a/linden/indra/llmath/llvolume.cpp +++ b/linden/indra/llmath/llvolume.cpp @@ -1829,13 +1829,16 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, U32 x = (U32) ((F32)s/(sizeS-1) * (F32) sculpt_width); U32 y = (U32) ((F32)t/(sizeT-1) * (F32) sculpt_height); - if (y == sculpt_height) // clamp to bottom row + if (y == sculpt_height) // stitch bottom + { y = sculpt_height - 1; + x = sculpt_width / 2; + } if (x == sculpt_width) // stitch sides x = 0; - if ((y == 0) || (y == sculpt_height-1)) // stitch top and bottom + if (y == 0) // stitch top x = sculpt_width / 2; U32 index = (x + y * sculpt_width) * sculpt_components; @@ -1847,63 +1850,69 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, last_index = index; } + if ((F32)vertex_change / sizeS / sizeT < 0.05) // less than 5% + data_is_empty = TRUE; } - - if ((F32)vertex_change / sizeS / sizeT < 0.05) // less than 5% - data_is_empty = TRUE; - - //generate vertex positions - // Run along the path. - S32 s = 0, t = 0; - S32 line = 0; - while (s < sizeS) + if (data_is_empty) // if empty, make a sphere { - t = 0; - // Run along the profile. - while (t < sizeT) - { - S32 i = t + line; - Point& pt = mMesh[i]; - - U32 x = (U32) ((F32)t/(sizeT-1) * (F32) sculpt_width); - U32 y = (U32) ((F32)s/(sizeS-1) * (F32) sculpt_height); + S32 line = 0; - if (y == sculpt_height) // clamp to bottom row - y = sculpt_height - 1; - - if (x == sculpt_width) // stitch sides - x = 0; + for (S32 s = 0; s < sizeS; s++) + { + for (S32 t = 0; t < sizeT; t++) + { + S32 i = t + line; + Point& pt = mMesh[i]; - if ((y == 0) || (y == sculpt_height-1)) // stitch top and bottom - x = sculpt_width / 2; - - if (data_is_empty) // if empty, make a sphere - { F32 u = (F32)s/(sizeS-1); F32 v = (F32)t/(sizeT-1); const F32 RADIUS = (F32) 0.3; - + pt.mPos.mV[0] = (F32)(sin(F_PI * v) * cos(2.0 * F_PI * u) * RADIUS); pt.mPos.mV[1] = (F32)(sin(F_PI * v) * sin(2.0 * F_PI * u) * RADIUS); pt.mPos.mV[2] = (F32)(cos(F_PI * v) * RADIUS); + } - - else + line += sizeT; + } + } + else + { + S32 line = 0; + for (S32 s = 0; s < sizeS; s++) + { + // Run along the profile. + for (S32 t = 0; t < sizeT; t++) { + S32 i = t + line; + Point& pt = mMesh[i]; + + U32 x = (U32) ((F32)t/(sizeT-1) * (F32) sculpt_width); + U32 y = (U32) ((F32)s/(sizeS-1) * (F32) sculpt_height); + + if (y == sculpt_height) // stitch bottom row + { + y = sculpt_height - 1; + x = sculpt_width / 2; + } + + if (x == sculpt_width) // stitch sides + x = 0; + + if (y == 0) // stitch top row + x = sculpt_width / 2; + U32 index = (x + y * sculpt_width) * sculpt_components; pt.mPos.mV[0] = sculpt_data[index ] / 256.f - 0.5f; pt.mPos.mV[1] = sculpt_data[index+1] / 256.f - 0.5f; pt.mPos.mV[2] = sculpt_data[index+2] / 256.f - 0.5f; } - - t++; + line += sizeT; } - line += sizeT; - s++; } for (S32 i = 0; i < (S32)mProfilep->mFaces.size(); i++) diff --git a/linden/indra/llmath/llvolume.h b/linden/indra/llmath/llvolume.h index a3e89ab..6ac07f5 100644 --- a/linden/indra/llmath/llvolume.h +++ b/linden/indra/llmath/llvolume.h @@ -635,12 +635,14 @@ protected: class LLProfile { public: - LLProfile(const LLProfileParams ¶ms) : mParams(params) + LLProfile(const LLProfileParams ¶ms) + : mParams(params), + mOpen(FALSE), + mConcave(FALSE), + mDirty(TRUE), + mTotalOut(0), + mTotal(2) { - mTotal = 2; - mTotalOut = 0; - mDirty = TRUE; - mConcave = FALSE; } ~LLProfile(); @@ -710,11 +712,13 @@ public: }; public: - LLPath(const LLPathParams ¶ms) : mParams(params) + LLPath(const LLPathParams ¶ms) + : mParams(params), + mOpen(FALSE), + mTotal(0), + mDirty(TRUE), + mStep(1) { - mOpen = FALSE; - mDirty = TRUE; - mStep = 1; } virtual ~LLPath(); diff --git a/linden/indra/llmessage/llbuffer.h b/linden/indra/llmessage/llbuffer.h index badbc9f..63f7bea 100644 --- a/linden/indra/llmessage/llbuffer.h +++ b/linden/indra/llmessage/llbuffer.h @@ -39,6 +39,7 @@ */ #include +#include /** * @class LLChannelDescriptors diff --git a/linden/indra/llmessage/llcachename.cpp b/linden/indra/llmessage/llcachename.cpp index 3df4b82..2a21b5a 100644 --- a/linden/indra/llmessage/llcachename.cpp +++ b/linden/indra/llmessage/llcachename.cpp @@ -643,6 +643,12 @@ void LLCacheName::dumpStats() << llendl; } +//static +LLString LLCacheName::getDefaultName() +{ + return LLString(CN_WAITING); +} + void LLCacheName::Impl::processPendingAsks() { sendRequest(_PREHASH_UUIDNameRequest, mAskNameQueue); diff --git a/linden/indra/llmessage/llcachename.h b/linden/indra/llmessage/llcachename.h index 7d606e6..d1a5cfe 100644 --- a/linden/indra/llmessage/llcachename.h +++ b/linden/indra/llmessage/llcachename.h @@ -101,6 +101,8 @@ public: void dump(); // Dumps the contents of the cache void dumpStats(); // Dumps the sizes of the cache and associated queues. + static LLString getDefaultName(); + private: class Impl; Impl& impl; diff --git a/linden/indra/llmessage/llcurl.cpp b/linden/indra/llmessage/llcurl.cpp index 9d883a7..5eaaab0 100644 --- a/linden/indra/llmessage/llcurl.cpp +++ b/linden/indra/llmessage/llcurl.cpp @@ -342,6 +342,12 @@ namespace } return sMainMulti; } + + void freeMulti() + { + delete sMainMulti; + sMainMulti = NULL; + } } void @@ -362,3 +368,8 @@ LLCurl::process() mainMulti()->process(); } +void LLCurl::cleanup() +{ + freeMulti(); + curl_global_cleanup(); +} diff --git a/linden/indra/llmessage/llcurl.h b/linden/indra/llmessage/llcurl.h index e188c38..2d7d5d8 100644 --- a/linden/indra/llmessage/llcurl.h +++ b/linden/indra/llmessage/llcurl.h @@ -128,6 +128,7 @@ public: static void getByteRange(const std::string& url, S32 offset, S32 length, ResponderPtr responder); static void process(); + static void cleanup(); }; namespace boost diff --git a/linden/indra/llmessage/llhttpclient.cpp b/linden/indra/llmessage/llhttpclient.cpp index 8cb8344..a1f8e29 100644 --- a/linden/indra/llmessage/llhttpclient.cpp +++ b/linden/indra/llmessage/llhttpclient.cpp @@ -70,6 +70,29 @@ void LLHTTPClient::Responder::result(const LLSD& content) { } +// virtual +void LLHTTPClient::Responder::completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) +{ + LLBufferStream istr(channels, buffer.get()); + LLSD content; + + if (200 <= status && status < 300) + { + LLSDSerialize::fromXML(content, istr); +/* + const S32 parseError = -1; + if(LLSDSerialize::fromXML(content, istr) == parseError) + { + mStatus = 498; + mReason = "Client Parse Error"; + } +*/ + } + + completed(status, reason, content); +} + // virtual void LLHTTPClient::Responder::completed(U32 status, const std::string& reason, const LLSD& content) { @@ -108,25 +131,9 @@ namespace virtual void complete(const LLChannelDescriptors& channels, const buffer_ptr_t& buffer) { - LLBufferStream istr(channels, buffer.get()); - LLSD content; - - if (200 <= mStatus && mStatus < 300) - { - LLSDSerialize::fromXML(content, istr); -/* - const S32 parseError = -1; - if(LLSDSerialize::fromXML(content, istr) == parseError) - { - mStatus = 498; - mReason = "Client Parse Error"; - } -*/ - } - if (mResponder.get()) { - mResponder->completed(mStatus, mReason, content); + mResponder->completedRaw(mStatus, mReason, channels, buffer); } } @@ -243,15 +250,18 @@ namespace LLPumpIO* theClientPump = NULL; } -static void request(const std::string& url, LLURLRequest::ERequestAction method, - Injector* body_injector, LLHTTPClient::ResponderPtr responder, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS) +static void request( + const std::string& url, + LLURLRequest::ERequestAction method, + Injector* body_injector, + LLHTTPClient::ResponderPtr responder, + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS) { if (!LLHTTPClient::hasPump()) { responder->completed(U32_MAX, "No pump", LLSD()); return; } - LLPumpIO::chain_t chain; LLURLRequest *req = new LLURLRequest(method, url); @@ -262,7 +272,8 @@ static void request(const std::string& url, LLURLRequest::ERequestAction method, } req->setCallback(new LLHTTPClientURLAdaptor(responder)); - if (method == LLURLRequest::HTTP_POST && gMessageSystem) { + if (method == LLURLRequest::HTTP_POST && gMessageSystem) + { req->addHeader(llformat("X-SecondLife-UDP-Listen-Port: %d", gMessageSystem->mPort).c_str()); } diff --git a/linden/indra/llmessage/llhttpclient.h b/linden/indra/llmessage/llhttpclient.h index c2dfb5d..88f8cbb 100644 --- a/linden/indra/llmessage/llhttpclient.h +++ b/linden/indra/llmessage/llhttpclient.h @@ -38,6 +38,8 @@ #include #include "llassettype.h" +#include "llbuffer.h" +#include "lliopipe.h" extern const F32 HTTP_REQUEST_EXPIRY_SECS; @@ -58,7 +60,11 @@ public: virtual void error(U32 status, const std::string& reason); // called with bad status codes virtual void result(const LLSD& content); - + + // Override point for clients that may want to use this class when the response is some other format besides LLSD + virtual void completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer); + virtual void completed(U32 status, const std::string& reason, const LLSD& content); /**< The default implemetnation calls either: diff --git a/linden/indra/llmessage/llhttpnode.h b/linden/indra/llmessage/llhttpnode.h index ae64a63..db82296 100644 --- a/linden/indra/llmessage/llhttpnode.h +++ b/linden/indra/llmessage/llhttpnode.h @@ -88,9 +88,10 @@ public: class Response : public LLRefCount { - public: + protected: virtual ~Response(); + public: virtual void result(const LLSD&) = 0; virtual void status(S32 code, const std::string& message) = 0; @@ -225,7 +226,6 @@ class LLSimpleResponse : public LLHTTPNode::Response { public: static LLPointer create(); - ~LLSimpleResponse(); void result(const LLSD& result); void status(S32 code, const std::string& message); @@ -235,6 +235,9 @@ public: S32 mCode; std::string mMessage; +protected: + ~LLSimpleResponse(); + private: LLSimpleResponse() {;} // Must be accessed through LLPointer. }; diff --git a/linden/indra/llmessage/llinstantmessage.cpp b/linden/indra/llmessage/llinstantmessage.cpp index 0ba7629..0a3a1e6 100644 --- a/linden/indra/llmessage/llinstantmessage.cpp +++ b/linden/indra/llmessage/llinstantmessage.cpp @@ -328,18 +328,46 @@ LLSD im_info_to_llsd(LLPointer im_info) param_message["parent_estate_id"] = (S32)im_info->mParentEstateID; param_message["region_id"] = im_info->mRegionID; param_message["position"] = ll_sd_from_vector3(im_info->mPosition); - if (im_info->mData) param_message["data"] = im_info->mData; + param_message["data"] = im_info->mData; + param_message["source"]= im_info->mSource; + param_message["ttl"] = im_info->mTTL; + LLSD param_agent; param_agent["agent_id"] = im_info->mFromID; LLSD params; - params.append(param_version); - params.append(param_message); - params.append(param_agent); + params["version_params"] = param_version; + params["message_params"] = param_message; + params["agent_params"] = param_agent; return params; } +LLPointer llsd_to_im_info(const LLSD& im_info_sd) +{ + LLSD param_message = im_info_sd["message_params"]; + LLSD param_agent = im_info_sd["agent_params"]; + + LLPointer im_info = new LLIMInfo( + param_message["from_id"].asUUID(), + param_message["from_group"].asBoolean(), + param_message["to_id"].asUUID(), + (EInstantMessage) param_message["type"].asInteger(), + param_message["from_name"].asString(), + param_message["message"].asString(), + param_message["id"].asUUID(), + (U32) param_message["parent_estate_id"].asInteger(), + im_info->mRegionID = param_message["region_id"].asUUID(), + ll_vector3_from_sd(param_message["position"]), + param_message["data"], + (U8) param_message["offline"].asInteger(), + (U32) param_message["timestamp"].asInteger(), + (EIMSource)param_message["source"].asInteger(), + param_message["ttl"].asInteger()); + + return im_info; +} + LLPointer LLIMInfo::clone() { return new LLIMInfo( diff --git a/linden/indra/llmessage/llinstantmessage.h b/linden/indra/llmessage/llinstantmessage.h index 0b2de19..45db037 100644 --- a/linden/indra/llmessage/llinstantmessage.h +++ b/linden/indra/llmessage/llinstantmessage.h @@ -94,13 +94,10 @@ enum EInstantMessage // communicate with each other. // - // Add users to a session. - IM_SESSION_ADD = 13, + // Invite users to a session. + IM_SESSION_INVITE = 13, - // IM sent automatically on call for help, - // sets up a way for each Helper reached to teleport to the - // helpee - IM_SESSION_911_SEND = 14, + IM_SESSION_P2P_INVITE = 14, // start a session with your gruop IM_SESSION_GROUP_START = 15, @@ -112,7 +109,7 @@ enum EInstantMessage IM_SESSION_SEND = 17, // leave a session - IM_SESSION_DROP = 18, + IM_SESSION_LEAVE = 18, // an instant message from an object - for differentiation on the // viewer, since you can't IM an object yet. @@ -141,14 +138,6 @@ enum EInstantMessage // bucket. IM_GOTO_URL = 28, - // IM for help from the GAURDIAN_ANGELS - // Binary bucket contains the name of the session. - IM_SESSION_911_START = 29, - - // IM for requesting to teleport to the creator - // of a livehelp session (assuming they are verified first) - IM_TELEPORT_911 = 30, - // a message generated by a script which we don't want to // be sent through e-mail. Similar to IM_FROM_TASK, but // it is shown as an alert on the viewer. @@ -288,6 +277,7 @@ public: S32 mTTL; }; +LLPointer llsd_to_im_info(const LLSD& im_info_sd); LLSD im_info_to_llsd(LLPointer im_info); void pack_instant_message( diff --git a/linden/indra/llmessage/llmessageconfig.cpp b/linden/indra/llmessage/llmessageconfig.cpp index a0566ea..687896b 100644 --- a/linden/indra/llmessage/llmessageconfig.cpp +++ b/linden/indra/llmessage/llmessageconfig.cpp @@ -112,9 +112,10 @@ void LLMessageConfigFile::loadServerDefaults(const LLSD& data) void LLMessageConfigFile::loadMessages(const LLSD& data) { - mMessages = data["messages"]; + LLPointer formatter = new LLSDXMLFormatter; std::ostringstream out; - LLSDXMLFormatter *formatter = new LLSDXMLFormatter; + + mMessages = data["messages"]; formatter->format(mMessages, out); lldebugs << "loading ... " << out.str() << " LLMessageConfigFile::loadMessages loaded " diff --git a/linden/indra/llmessage/llregionflags.h b/linden/indra/llmessage/llregionflags.h index fb9bf5b..8702277 100644 --- a/linden/indra/llmessage/llregionflags.h +++ b/linden/indra/llmessage/llregionflags.h @@ -56,7 +56,7 @@ const U32 REGION_FLAGS_BLOCK_LAND_RESELL = (1 << 7); // All content wiped once per night const U32 REGION_FLAGS_SANDBOX = (1 << 8); - +const U32 REGION_FLAGS_NULL_LAYER = (1 << 9); const U32 REGION_FLAGS_SKIP_AGENT_ACTION = (1 << 10); const U32 REGION_FLAGS_SKIP_UPDATE_INTEREST_LIST= (1 << 11); const U32 REGION_FLAGS_SKIP_COLLISIONS = (1 << 12); // Pin all non agent rigid bodies @@ -88,11 +88,14 @@ const U32 REGION_FLAGS_ALLOW_PARCEL_CHANGES = (1 << 26); const U32 REGION_FLAGS_ABUSE_EMAIL_TO_ESTATE_OWNER = (1 << 27); -const U32 REGION_FLAGS_NULL_LAYER = (1 << 9); +const U32 REGION_FLAGS_ALLOW_VOICE = (1 << 28); + const U32 REGION_FLAGS_DEFAULT = REGION_FLAGS_ALLOW_LANDMARK | REGION_FLAGS_ALLOW_SET_HOME | - REGION_FLAGS_ALLOW_PARCEL_CHANGES; + REGION_FLAGS_ALLOW_PARCEL_CHANGES | + REGION_FLAGS_ALLOW_VOICE; + const U32 REGION_FLAGS_PRELUDE_SET = REGION_FLAGS_RESET_HOME_ON_TELEPORT; const U32 REGION_FLAGS_PRELUDE_UNSET = REGION_FLAGS_ALLOW_LANDMARK diff --git a/linden/indra/llmessage/message.cpp b/linden/indra/llmessage/message.cpp index 29f232c..ab41cca 100644 --- a/linden/indra/llmessage/message.cpp +++ b/linden/indra/llmessage/message.cpp @@ -1344,12 +1344,17 @@ LLMessageSystem::~LLMessageSystem() end_net(); } - delete mMessageReader; + delete mTemplateMessageReader; + mTemplateMessageReader = NULL; mMessageReader = NULL; - delete mMessageBuilder; + delete mTemplateMessageBuilder; + mTemplateMessageBuilder = NULL; mMessageBuilder = NULL; + delete mLLSDMessageReader; + mLLSDMessageReader = NULL; + delete mPollInfop; mPollInfop = NULL; @@ -2942,17 +2947,19 @@ static LLHTTPNode& messageRootNode() } //static -void LLMessageSystem::dispatch(const std::string& msg_name, - const LLSD& message) +void LLMessageSystem::dispatch( + const std::string& msg_name, + const LLSD& message) { LLPointer responsep = LLSimpleResponse::create(); dispatch(msg_name, message, responsep); } //static -void LLMessageSystem::dispatch(const std::string& msg_name, - const LLSD& message, - LLHTTPNode::ResponsePtr responsep) +void LLMessageSystem::dispatch( + const std::string& msg_name, + const LLSD& message, + LLHTTPNode::ResponsePtr responsep) { if (msg_name.empty()) { diff --git a/linden/indra/llrender/llvertexbuffer.cpp b/linden/indra/llrender/llvertexbuffer.cpp index b94f593..45d706f 100644 --- a/linden/indra/llrender/llvertexbuffer.cpp +++ b/linden/indra/llrender/llvertexbuffer.cpp @@ -1,3 +1,31 @@ +/** + * @file llvertexbuffer.cpp + * @brief LLVertexBuffer implementation + * + * Copyright (c) 2003-2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + #include "linden_common.h" #include "llvertexbuffer.h" diff --git a/linden/indra/llrender/llvertexbuffer.h b/linden/indra/llrender/llvertexbuffer.h index b221d35..62c6124 100644 --- a/linden/indra/llrender/llvertexbuffer.h +++ b/linden/indra/llrender/llvertexbuffer.h @@ -1,3 +1,31 @@ +/** + * @file llvertexbuffer.h + * @brief LLVertexBuffer wrapper for OpengGL vertex buffer objects + * + * Copyright (c) 2003-2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + #ifndef LL_LLVERTEXBUFFER_H #define LL_LLVERTEXBUFFER_H diff --git a/linden/indra/llui/llalertdialog.cpp b/linden/indra/llui/llalertdialog.cpp index 547efae..8950fcd 100644 --- a/linden/indra/llui/llalertdialog.cpp +++ b/linden/indra/llui/llalertdialog.cpp @@ -783,10 +783,11 @@ bool LLAlertDialog::parseAlerts(const LLString& xml_filename, LLControlGroup* se // label= LLString name; child->getAttributeString("name", name); - if (name.empty()) - { - name = alert_name; - } + + //always set to alert_name for the sake of i18n + //if (name.empty()) + name = alert_name; + if (xml_template) { xml_template->mIgnorable = LLAlertDialog::IGNORE_USE_DEFAULT; diff --git a/linden/indra/llui/llbutton.cpp b/linden/indra/llui/llbutton.cpp index 1d44537..de8b82e 100644 --- a/linden/indra/llui/llbutton.cpp +++ b/linden/indra/llui/llbutton.cpp @@ -615,6 +615,56 @@ void LLButton::draw() gl_rect_2d(0, mRect.getHeight(), mRect.getWidth(), 0, LLColor4::pink1, FALSE); } + // draw overlay image + if (mImageOverlay.notNull()) + { + const S32 IMG_PAD = 4; + // get max width and height (discard level 0) + S32 overlay_width = mImageOverlay->getWidth(0); + S32 overlay_height = mImageOverlay->getHeight(0); + + F32 scale_factor = llmin((F32)mRect.getWidth() / (F32)overlay_width, (F32)mRect.getHeight() / (F32)overlay_height, 1.f); + overlay_width = llround((F32)overlay_width * scale_factor); + overlay_height = llround((F32)overlay_height * scale_factor); + + S32 center_x = getLocalRect().getCenterX(); + S32 center_y = getLocalRect().getCenterY(); + + switch(mImageOverlayAlignment) + { + case LLFontGL::LEFT: + gl_draw_scaled_image( + IMG_PAD, + center_y - (overlay_height / 2), + overlay_width, + overlay_height, + mImageOverlay, + LLColor4::white); + break; + case LLFontGL::HCENTER: + gl_draw_scaled_image( + center_x - (overlay_width / 2), + center_y - (overlay_height / 2), + overlay_width, + overlay_height, + mImageOverlay, + LLColor4::white); + break; + case LLFontGL::RIGHT: + gl_draw_scaled_image( + mRect.getWidth() - IMG_PAD - overlay_width, + center_y - (overlay_height / 2), + overlay_width, + overlay_height, + mImageOverlay, + LLColor4::white); + break; + default: + // draw nothing + break; + } + } + // Draw label if( !label.empty() ) { @@ -826,6 +876,21 @@ void LLButton::setHoverImages( const LLString& image_name, const LLString& selec setImageHoverSelected(selected_name); } +void LLButton::setImageOverlay(const LLString &image_name, LLFontGL::HAlign alignment) +{ + if (image_name.empty()) + { + mImageOverlay = NULL; + } + else + { + LLUUID overlay_image_id = LLUI::findAssetUUIDByName(image_name); + mImageOverlay = LLUI::sImageProvider->getUIImageByID(overlay_image_id); + mImageOverlayAlignment = alignment; + } +} + + void LLButton::onMouseCaptureLost() { mMouseDownTimer.stop(); @@ -998,6 +1063,18 @@ LLView* LLButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *fa LLString image_disabled; if (node->hasAttribute("image_disabled")) node->getAttributeString("image_disabled",image_disabled); + LLString image_overlay; + node->getAttributeString("image_overlay", image_overlay); + + LLFontGL::HAlign image_overlay_alignment = LLFontGL::HCENTER; + LLString image_overlay_alignment_string; + if (node->hasAttribute("image_overlay_alignment")) + { + node->getAttributeString("image_overlay_alignment", image_overlay_alignment_string); + image_overlay_alignment = LLFontGL::hAlignFromName(image_overlay_alignment_string); + } + + LLButton *button = new LLButton(name, LLRect(), image_unselected, @@ -1020,6 +1097,7 @@ LLView* LLButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *fa if(image_disabled != LLString::null) button->setImageDisabled(image_disabled); + if(image_overlay != LLString::null) button->setImageOverlay(image_overlay, image_overlay_alignment); if (node->hasAttribute("halign")) { diff --git a/linden/indra/llui/llbutton.h b/linden/indra/llui/llbutton.h index 44e8776..6e11779 100644 --- a/linden/indra/llui/llbutton.h +++ b/linden/indra/llui/llbutton.h @@ -142,6 +142,10 @@ public: void setDisabledSelectedLabelColor( const LLColor4& c ) { mDisabledSelectedLabelColor = c; } + void setImageOverlay(const LLString &image_name, LLFontGL::HAlign alignment = LLFontGL::HCENTER); + LLPointer getImageOverlay() { return mImageOverlay; } + + virtual void setValue(const LLSD& value ); virtual LLSD getValue() const; @@ -202,6 +206,9 @@ protected: F32 mHeldDownDelay; // seconds, after which held-down callbacks get called S32 mHeldDownFrameDelay; // frames, after which held-down callbacks get called + LLPointer mImageOverlay; + LLFontGL::HAlign mImageOverlayAlignment; + LLPointer mImageUnselected; LLUIString mUnselectedLabel; LLColor4 mUnselectedLabelColor; diff --git a/linden/indra/llui/llfloater.cpp b/linden/indra/llui/llfloater.cpp index df44a58..6ab182f 100644 --- a/linden/indra/llui/llfloater.cpp +++ b/linden/indra/llui/llfloater.cpp @@ -575,17 +575,20 @@ void LLFloater::close(bool app_quitting) cleanupHandles(); gFocusMgr.clearLastFocusForGroup(this); - // Do this early, so UI controls will commit before the - // window is taken down. - releaseFocus(); - - // give focus to dependee floater if it exists, and we had focus first - if (isDependent()) + if (hasFocus()) { - LLFloater* dependee = LLFloater::getFloaterByHandle(mDependeeHandle); - if (dependee && !dependee->isDead()) + // Do this early, so UI controls will commit before the + // window is taken down. + releaseFocus(); + + // give focus to dependee floater if it exists, and we had focus first + if (isDependent()) { - dependee->setFocus(TRUE); + LLFloater* dependee = LLFloater::getFloaterByHandle(mDependeeHandle); + if (dependee && !dependee->isDead()) + { + dependee->setFocus(TRUE); + } } } @@ -1170,6 +1173,28 @@ BOOL LLFloater::getEditModeEnabled() return sEditModeEnabled; } +//static +void LLFloater::show(LLFloater* floaterp) +{ + if (floaterp) floaterp->open(); +} + +//static +void LLFloater::hide(LLFloater* floaterp) +{ + if (floaterp) floaterp->close(); +} + +//static +BOOL LLFloater::visible(LLFloater* floaterp) +{ + if (floaterp) + { + return floaterp->isInVisibleChain(); + } + return FALSE; +} + // static void LLFloater::onClickMinimize(void *userdata) { @@ -2372,7 +2397,7 @@ void LLFloaterView::popVisibleAll(const skip_list_t& skip_list) LLMultiFloater::LLMultiFloater() : mTabContainer(NULL), mTabPos(LLTabContainerCommon::TOP), - mAutoResize(FALSE) + mAutoResize(TRUE) { } @@ -2380,7 +2405,7 @@ LLMultiFloater::LLMultiFloater() : LLMultiFloater::LLMultiFloater(LLTabContainerCommon::TabPosition tab_pos) : mTabContainer(NULL), mTabPos(tab_pos), - mAutoResize(FALSE) + mAutoResize(TRUE) { } @@ -2594,15 +2619,12 @@ void LLMultiFloater::addFloater(LLFloater* floaterp, BOOL select_added_floater, floaterp->setCanResize(FALSE); floaterp->setCanDrag(FALSE); - S32 new_width = llmax(mRect.getWidth(), floaterp->getRect().getWidth()); - S32 new_height = llmax(mRect.getHeight(), floaterp->getRect().getHeight() + LLFLOATER_HEADER_SIZE + TABCNTR_HEADER_HEIGHT); - - reshape(new_width, new_height); - //add the panel, add it to proper maps mTabContainer->addTabPanel(floaterp, floaterp->getTitle(), FALSE, onTabSelected, this, 0, FALSE, insertion_point); mFloaterDataMap[floaterp->getHandle()] = floater_data; + resizeToContents(); + if ( select_added_floater ) { mTabContainer->selectLastTab(); @@ -2676,10 +2698,7 @@ void LLMultiFloater::removeFloater(LLFloater* floaterp) floaterp->setBackgroundVisible(TRUE); floaterp->setHost(NULL); - if (mAutoResize) - { - resizeToContents(); - } + resizeToContents(); tabOpen((LLFloater*)mTabContainer->getCurrentPanel(), false); } @@ -2729,7 +2748,8 @@ BOOL LLMultiFloater::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) if (key == 'W') { LLFloater* floater = getActiveFloater(); - if (floater && floater->canClose()) + // is user closeable and is system closeable + if (floater && floater->canClose() && floater->isCloseable()) { floater->close(); } @@ -2848,10 +2868,17 @@ void LLMultiFloater::resizeToContents() S32 cur_height = mRect.getHeight(); - reshape(new_width, new_height); + if (mAutoResize) + { + reshape(new_width, new_height); + } + else + { + reshape(llmax(new_min_width, mRect.getWidth()), llmax(new_min_height, mRect.getHeight())); + } // make sure upper left corner doesn't move - translate(0, cur_height - new_height); + translate(0, cur_height - mRect.getHeight()); // Try to keep whole view onscreen, don't allow partial offscreen. gFloaterView->adjustToFitScreen(this, FALSE); diff --git a/linden/indra/llui/llfloater.h b/linden/indra/llui/llfloater.h index cd45762..8b610e3 100644 --- a/linden/indra/llui/llfloater.h +++ b/linden/indra/llui/llfloater.h @@ -212,6 +212,10 @@ public: static BOOL getEditModeEnabled(); static LLMultiFloater* getFloaterHost() {return sHostp; } + static void show(LLFloater* floaterp); + static void hide(LLFloater* floaterp); + static BOOL visible(LLFloater* floaterp); + static LLFloater* getFloaterByHandle(LLViewHandle handle); protected: @@ -279,7 +283,6 @@ protected: std::vector mMinimizedHiddenChildren; }; - ///////////////////////////////////////////////////////////// // LLFloaterView // Parent of all floating panels @@ -354,8 +357,8 @@ public: LLMultiFloater(); LLMultiFloater(LLTabContainerCommon::TabPosition tab_pos); LLMultiFloater(const LLString& name); - LLMultiFloater(const LLString& name, const LLRect& rect, LLTabContainer::TabPosition tab_pos = LLTabContainer::TOP, BOOL auto_resize = FALSE); - LLMultiFloater(const LLString& name, const LLString& rect_control, LLTabContainer::TabPosition tab_pos = LLTabContainer::TOP, BOOL auto_resize = FALSE); + LLMultiFloater(const LLString& name, const LLRect& rect, LLTabContainer::TabPosition tab_pos = LLTabContainer::TOP, BOOL auto_resize = TRUE); + LLMultiFloater(const LLString& name, const LLString& rect_control, LLTabContainer::TabPosition tab_pos = LLTabContainer::TOP, BOOL auto_resize = TRUE); virtual ~LLMultiFloater(); virtual BOOL postBuild(); @@ -416,3 +419,4 @@ extern LLFloaterView* gFloaterView; #endif // LL_FLOATER_H + diff --git a/linden/indra/llui/lllineeditor.cpp b/linden/indra/llui/lllineeditor.cpp index a2cd9af..44616b9 100644 --- a/linden/indra/llui/lllineeditor.cpp +++ b/linden/indra/llui/lllineeditor.cpp @@ -157,6 +157,14 @@ LLLineEditor::LLLineEditor(const LLString& name, const LLRect& rect, { llassert( max_length_bytes > 0 ); + // line history support: + // - initialize line history list + mLineHistory.insert( mLineHistory.end(), "" ); + // - disable line history by default + mHaveHistory = FALSE; + // - reset current history line pointer + mCurrentHistoryLine = 0; + if (font) { mGLFont = font; @@ -229,10 +237,33 @@ void LLLineEditor::onFocusLost() void LLLineEditor::onCommit() { + // put current line into the line history + updateHistory(); + LLUICtrl::onCommit(); selectAll(); } +// line history support +void LLLineEditor::updateHistory() +{ + // On history enabled line editors, remember committed line and + // reset current history line number. + // Be sure only to remember lines that are not empty and that are + // different from the last on the list. + if( mHaveHistory && mText.length() && ( mLineHistory.empty() || getText() != mLineHistory.back() ) ) + { + // discard possible empty line at the end of the history + // inserted by setText() + if( !mLineHistory.back().length() ) + { + mLineHistory.pop_back(); + } + mLineHistory.insert( mLineHistory.end(), getText() ); + mCurrentHistoryLine = mLineHistory.size() - 1; + } +} + void LLLineEditor::reshape(S32 width, S32 height, BOOL called_from_parent) { LLUICtrl::reshape(width, height, called_from_parent ); @@ -240,6 +271,10 @@ void LLLineEditor::reshape(S32 width, S32 height, BOOL called_from_parent) mMaxHPixels = mRect.getWidth() - 2 * (mBorderThickness + UI_LINEEDITOR_H_PAD) + 1 - mBorderRight; } +void LLLineEditor::setEnableLineHistory( BOOL enabled ) +{ + mHaveHistory = enabled; +} void LLLineEditor::setEnabled(BOOL enabled) { @@ -300,6 +335,13 @@ void LLLineEditor::setText(const LLString &new_text) deselect(); } setCursor(llmin((S32)mText.length(), getCursor())); + + // Newly set text goes always in the last line of history. + // Possible empty strings (as with chat line) will be deleted later. + mLineHistory.insert( mLineHistory.end(), new_text ); + // Set current history line to end of history. + mCurrentHistoryLine = mLineHistory.size() - 1; + mPrevText = mText; } @@ -1086,6 +1128,45 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) } break; + // handle ctrl-uparrow if we have a history enabled line editor. + case KEY_UP: + if( mHaveHistory && ( MASK_CONTROL & mask ) ) + { + if( mCurrentHistoryLine > 0 ) + { + mText.assign( mLineHistory[ --mCurrentHistoryLine ] ); + setCursor(llmin((S32)mText.length(), getCursor())); + } + else + { + reportBadKeystroke(); + } + handled = TRUE; + } + break; + + // handle ctrl-downarrow if we have a history enabled line editor + case KEY_DOWN: + if( mHaveHistory && ( MASK_CONTROL & mask ) ) + { + if( !mLineHistory.empty() && mCurrentHistoryLine < mLineHistory.size() - 1 ) + { + mText.assign( mLineHistory[ ++mCurrentHistoryLine ] ); + setCursor(llmin((S32)mText.length(), getCursor())); + } + else + { + reportBadKeystroke(); + } + handled = TRUE; + } + break; + + case KEY_RETURN: + // store sent line in history + updateHistory(); + break; + case KEY_ESCAPE: if (mRevertOnEsc && mText.getString() != mPrevText) { diff --git a/linden/indra/llui/lllineeditor.h b/linden/indra/llui/lllineeditor.h index 65c75ab..e715737 100644 --- a/linden/indra/llui/lllineeditor.h +++ b/linden/indra/llui/lllineeditor.h @@ -36,6 +36,7 @@ // Clipboard (cut, copy, and paste) // Horizontal scrolling to allow strings longer than widget size allows // Pre-validation (limit which keys can be used) +// Optional line history so previous entries can be recalled by CTRL UP/DOWN #ifndef LL_LLLINEEDITOR_H @@ -206,6 +207,10 @@ public: static BOOL postvalidateFloat(const LLString &str); + // line history support: + void setEnableLineHistory( BOOL enabled ); // switches line history on or off + void updateHistory(); // stores current line in history + protected: void removeChar(); void addChar(const llwchar c); @@ -224,6 +229,11 @@ protected: LLString mPrevText; // Saved string for 'ESC' revert LLUIString mLabel; // text label that is visible when no user text provided + // line history support: + BOOL mHaveHistory; // flag for enabled line history + std::vector mLineHistory; // line history storage + U32 mCurrentHistoryLine; // currently browsed history line + LLViewBorder* mBorder; const LLFontGL* mGLFont; S32 mMaxLengthChars; // Max number of characters diff --git a/linden/indra/llui/llmemberlistener.h b/linden/indra/llui/llmemberlistener.h index 92e7278..bc67519 100644 --- a/linden/indra/llui/llmemberlistener.h +++ b/linden/indra/llui/llmemberlistener.h @@ -37,7 +37,6 @@ class LLMemberListener : public LLSimpleListener { public: LLMemberListener() : mPtr(NULL), mRegisteredName("") { } - ~LLMemberListener() { } void registerListener(T *pointer, const LLString& register_name) { diff --git a/linden/indra/llui/llpanel.cpp b/linden/indra/llui/llpanel.cpp index f0b5b25..dfa3f8a 100644 --- a/linden/indra/llui/llpanel.cpp +++ b/linden/indra/llui/llpanel.cpp @@ -589,7 +589,7 @@ LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parentp, LLUICtrlFactory *fa return panelp; } -void LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) +BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { LLString name("panel"); node->getAttributeString("name", name); @@ -605,12 +605,23 @@ void LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *f LLString xml_filename; node->getAttributeString("filename", xml_filename); + + BOOL didPost; + if (!xml_filename.empty()) { - factory->buildPanel(this, xml_filename, NULL); + didPost = factory->buildPanel(this, xml_filename, NULL); + } else { + didPost = FALSE; } - postBuild(); + if (!didPost) + { + postBuild(); + didPost = TRUE; + } + + return didPost; } void LLPanel::setPanelParameters(LLXMLNodePtr node, LLView* parentp) diff --git a/linden/indra/llui/llpanel.h b/linden/indra/llui/llpanel.h index 9da942e..fea3eee 100644 --- a/linden/indra/llui/llpanel.h +++ b/linden/indra/llui/llpanel.h @@ -135,7 +135,7 @@ public: virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - void initPanelXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); + BOOL initPanelXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); void setPanelParameters(LLXMLNodePtr node, LLView *parentp); // ** Wrappers for setting child properties by name ** -TomY diff --git a/linden/indra/llui/llscrolllistctrl.cpp b/linden/indra/llui/llscrolllistctrl.cpp index 22987dc..fd98bd5 100644 --- a/linden/indra/llui/llscrolllistctrl.cpp +++ b/linden/indra/llui/llscrolllistctrl.cpp @@ -99,7 +99,7 @@ protected: // LLScrollListIcon // LLScrollListIcon::LLScrollListIcon(LLImageGL* icon, S32 width, LLUUID image_id) : -mIcon(icon), mImageUUID(image_id.asString()) +mIcon(icon), mColor(LLColor4::white), mImageUUID(image_id.asString()) { if (width) { @@ -115,6 +115,16 @@ LLScrollListIcon::~LLScrollListIcon() { } +void LLScrollListIcon::setColor(const LLColor4& color) +{ + mColor = color; +} + +void LLScrollListIcon::drawToWidth(S32 width, const LLColor4& color, const LLColor4& highlight_color) const +{ + gl_draw_image(0, 0, mIcon, mColor); +} + // // LLScrollListCheck // @@ -208,6 +218,15 @@ LLScrollListText::~LLScrollListText() delete mColor; } +void LLScrollListText::setColor(const LLColor4& color) +{ + if (!mColor) + { + mColor = new LLColor4(); + } + *mColor = color; +} + void LLScrollListText::setText(const LLString& text) { mText = text; @@ -2809,6 +2828,8 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p LLString fontname = (*itor)["font"].asString(); LLString fontstyle = (*itor)["font-style"].asString(); LLString type = (*itor)["type"].asString(); + BOOL has_color = (*itor).has("color"); + LLColor4 color = ((*itor)["color"]); const LLFontGL *font = gResMgr->getRes(fontname); if (!font) @@ -2821,21 +2842,41 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p { LLUUID image_id = value.asUUID(); LLImageGL* icon = LLUI::sImageProvider->getUIImageByID(image_id); - new_item->setColumn(index, new LLScrollListIcon(icon, width, image_id)); + LLScrollListIcon* cell = new LLScrollListIcon(icon, width, image_id); + if (has_color) + { + cell->setColor(color); + } + new_item->setColumn(index, cell); } else if (type == "checkbox") { LLCheckBoxCtrl* ctrl = new LLCheckBoxCtrl(value.asString(), LLRect(0, 0, width, width), "label"); - new_item->setColumn(index, new LLScrollListCheck(ctrl,width)); + LLScrollListCheck* cell = new LLScrollListCheck(ctrl,width); + if (has_color) + { + cell->setColor(color); + } + new_item->setColumn(index, cell); } else if (type == "separator") { - new_item->setColumn(index, new LLScrollListSeparator(width)); + LLScrollListSeparator* cell = new LLScrollListSeparator(width); + if (has_color) + { + cell->setColor(color); + } + new_item->setColumn(index, cell); } else { - new_item->setColumn(index, new LLScrollListText(value.asString(), font, width, font_style, font_alignment)); + LLScrollListText* cell = new LLScrollListText(value.asString(), font, width, font_style, font_alignment); + if (has_color) + { + cell->setColor(color); + } + new_item->setColumn(index, cell); if (columnp->mHeader && !value.asString().empty()) { columnp->mHeader->setHasResizableElement(TRUE); diff --git a/linden/indra/llui/llscrolllistctrl.h b/linden/indra/llui/llscrolllistctrl.h index eed07b8..429985b 100644 --- a/linden/indra/llui/llscrolllistctrl.h +++ b/linden/indra/llui/llscrolllistctrl.h @@ -63,6 +63,7 @@ public: virtual void setWidth(S32 width) = 0; virtual void highlightText(S32 offset, S32 num_chars) {} virtual BOOL isText() = 0; + virtual void setColor(const LLColor4&) = 0; virtual BOOL handleClick() { return FALSE; } virtual void setEnabled(BOOL enable) { } @@ -77,6 +78,7 @@ public: virtual S32 getWidth() const {return mWidth;} virtual S32 getHeight() const { return 5; }; virtual void setWidth(S32 width) {mWidth = width; } + virtual void setColor(const LLColor4&) {}; virtual BOOL isText() { return FALSE; } protected: @@ -97,6 +99,7 @@ public: virtual const BOOL getVisible() const { return mVisible; } virtual void highlightText(S32 offset, S32 num_chars) {mHighlightOffset = offset; mHighlightCount = num_chars;} void setText(const LLString& text); + virtual void setColor(const LLColor4&); virtual BOOL isText() { return TRUE; } private: @@ -120,18 +123,20 @@ class LLScrollListIcon : public LLScrollListCell public: LLScrollListIcon( LLImageGL* icon, S32 width = 0, LLUUID image_id = LLUUID::null); /*virtual*/ ~LLScrollListIcon(); - virtual void drawToWidth(S32 width, const LLColor4& color, const LLColor4& highlight_color) const { gl_draw_image(0, 0, mIcon); } + virtual void drawToWidth(S32 width, const LLColor4& color, const LLColor4& highlight_color) const; virtual S32 getWidth() const { return mWidth; } virtual S32 getHeight() const { return mIcon->getHeight(); } virtual const LLString& getText() const { return mImageUUID; } virtual const LLString& getTextLower() const { return mImageUUID; } virtual void setWidth(S32 width) { mWidth = width; } + virtual void setColor(const LLColor4&); virtual BOOL isText() { return FALSE; } private: LLPointer mIcon; LLString mImageUUID; S32 mWidth; + LLColor4 mColor; }; class LLScrollListCheck : public LLScrollListCell @@ -146,6 +151,7 @@ public: virtual BOOL handleClick(); virtual void setEnabled(BOOL enable) { if (mCheckBox) mCheckBox->setEnabled(enable); } + virtual void setColor(const LLColor4& color) {}; LLCheckBoxCtrl* getCheckBox() { return mCheckBox; } virtual BOOL isText() { return FALSE; } diff --git a/linden/indra/llui/lltabcontainer.cpp b/linden/indra/llui/lltabcontainer.cpp index 61cfde4..44940ae 100644 --- a/linden/indra/llui/lltabcontainer.cpp +++ b/linden/indra/llui/lltabcontainer.cpp @@ -77,7 +77,8 @@ LLTabContainerCommon::LLTabContainerCommon( mCallbackUserdata( callback_userdata ), mTitleBox(NULL), mTopBorderHeight(LLPANEL_BORDER_WIDTH), - mTabPosition(pos) + mTabPosition(pos), + mLockedTabCount(0) { setMouseOpaque(FALSE); } @@ -142,6 +143,13 @@ void LLTabContainerCommon::addPlaceholder(LLPanel* child, const LLString& label) addTabPanel(child, label, FALSE, NULL, NULL, 0, TRUE); } +void LLTabContainerCommon::lockTabs() +{ + // count current tabs and ensure no new tabs get + // inserted between them + mLockedTabCount = getTabCount(); +} + void LLTabContainerCommon::removeTabPanel(LLPanel* child) { BOOL has_focus = gFocusMgr.childHasKeyboardFocus(this); @@ -164,6 +172,10 @@ void LLTabContainerCommon::removeTabPanel(LLPanel* child) break; } } + + // make sure we don't have more locked tabs than we have tabs + mLockedTabCount = llmin(getTabCount(), mLockedTabCount); + if (mCurrentTabIdx >= (S32)mTabList.size()) { mCurrentTabIdx = mTabList.size()-1; @@ -526,6 +538,15 @@ void LLTabContainerCommon::setTabPanelFlashing(LLPanel* child, BOOL state ) } } +void LLTabContainerCommon::setTabImage(LLPanel* child, std::string img_name) +{ + LLTabTuple* tuple = getTabByPanel(child); + if( tuple ) + { + tuple->mButton->setImageOverlay(img_name, LLFontGL::RIGHT); + } +} + void LLTabContainerCommon::setTitle(const LLString& title) { if (mTitleBox) @@ -687,12 +708,12 @@ void LLTabContainerCommon::insertTuple(LLTabTuple * tuple, eInsertionPoint inser { case START: // insert the new tab in the front of the list - mTabList.insert(mTabList.begin(), tuple); + mTabList.insert(mTabList.begin() + mLockedTabCount, tuple); break; case RIGHT_OF_CURRENT: - // insert the new tab after the current tab + // insert the new tab after the current tab (but not before mLockedTabCount) { - tuple_list_t::iterator current_iter = mTabList.begin() + mCurrentTabIdx + 1; + tuple_list_t::iterator current_iter = mTabList.begin() + llmax(mLockedTabCount, mCurrentTabIdx + 1); mTabList.insert(current_iter, tuple); } break; @@ -1249,6 +1270,7 @@ void LLTabContainer::draw() for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) { LLTabTuple* tuple = *iter; + tuple->mButton->translate( left - tuple->mButton->getRect().mLeft, 0 ); left += tuple->mButton->getRect().getWidth(); @@ -1596,3 +1618,27 @@ BOOL LLTabContainer::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDrag return LLView::handleDragAndDrop(x, y, mask, drop, type, cargo_data, accept, tooltip); } + +void LLTabContainer::setTabImage(LLPanel* child, std::string image_name) +{ + LLTabTuple* tuple = getTabByPanel(child); + if( tuple ) + { + tuple->mButton->setImageOverlay(image_name, LLFontGL::RIGHT); + + const LLFontGL* fontp = gResMgr->getRes( LLFONT_SANSSERIF_SMALL ); + // remove current width from total tab strip width + mTotalTabWidth -= tuple->mButton->getRect().getWidth(); + + S32 image_overlay_width = tuple->mButton->getImageOverlay().notNull() ? + tuple->mButton->getImageOverlay()->getWidth(0) : + 0; + tuple->mButton->reshape(llclamp(fontp->getWidth(tuple->mButton->getLabelSelected()) + TAB_PADDING + image_overlay_width, mMinTabWidth, mMaxTabWidth), + tuple->mButton->getRect().getHeight()); + // add back in button width to total tab strip width + mTotalTabWidth += tuple->mButton->getRect().getWidth(); + + // tabs have changed size, might need to scroll to see current tab + updateMaxScrollPos(); + } +} \ No newline at end of file diff --git a/linden/indra/llui/lltabcontainer.h b/linden/indra/llui/lltabcontainer.h index 5fe6bc5..7d501d2 100644 --- a/linden/indra/llui/lltabcontainer.h +++ b/linden/indra/llui/lltabcontainer.h @@ -87,7 +87,8 @@ public: BOOL placeholder = FALSE, eInsertionPoint insertion_point = END) = 0; virtual void addPlaceholder(LLPanel* child, const LLString& label); - + virtual void lockTabs(); + virtual void enableTabButton(S32 which, BOOL enable); virtual void removeTabPanel( LLPanel* child ); @@ -113,6 +114,7 @@ public: BOOL getTabPanelFlashing(LLPanel* child); void setTabPanelFlashing(LLPanel* child, BOOL state); + virtual void setTabImage(LLPanel* child, std::string img_name); void setTitle( const LLString& title ); const LLString getPanelTitle(S32 index); @@ -180,6 +182,7 @@ protected: S32 mTopBorderHeight; TabPosition mTabPosition; + S32 mLockedTabCount; protected: void scrollPrev(); @@ -221,7 +224,7 @@ public: /*virtual*/ void removeTabPanel( LLPanel* child ); /*virtual*/ void setPanelTitle(S32 index, const LLString& title); - + /*virtual*/ void setTabImage(LLPanel* child, std::string img_name); /*virtual*/ void setRightTabBtnOffset( S32 offset ); /*virtual*/ void setMinTabWidth(S32 width); diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp index ba991c2..80205d3 100644 --- a/linden/indra/llui/lltexteditor.cpp +++ b/linden/indra/llui/lltexteditor.cpp @@ -309,6 +309,9 @@ LLTextEditor::LLTextEditor( { mSourceID.generate(); + // reset desired x cursor position + mDesiredXPixel = -1; + if (font) { mGLFont = font; @@ -348,7 +351,7 @@ LLTextEditor::LLTextEditor( mBorder = new LLViewBorder( "text ed border", LLRect(0, mRect.getHeight(), mRect.getWidth(), 0), LLViewBorder::BEVEL_IN, LLViewBorder::STYLE_LINE, UI_TEXTEDITOR_BORDER ); addChild( mBorder ); - setText(default_text); + appendText(default_text, FALSE, FALSE); mParseHTML=FALSE; mHTML=""; @@ -914,6 +917,8 @@ void LLTextEditor::setCursorPos(S32 offset) { mCursorPos = llclamp(offset, 0, (S32)getLength()); updateScrollFromCursor(); + // reset desired x cursor position + mDesiredXPixel = -1; } @@ -2645,7 +2650,8 @@ void LLTextEditor::drawSelectionBackground() { LLGLSNoTexture no_texture; const LLColor4& color = mReadOnly ? mReadOnlyBgColor : mWriteableBgColor; - glColor3f( 1.f - color.mV[0], 1.f - color.mV[1], 1.f - color.mV[2] ); + F32 alpha = hasFocus() ? 1.f : 0.5f; + glColor4f( 1.f - color.mV[0], 1.f - color.mV[1], 1.f - color.mV[2], alpha ); if( selection_left_y == selection_right_y ) { @@ -3098,6 +3104,9 @@ void LLTextEditor::changePage( S32 delta ) S32 line, offset; getLineAndOffset( mCursorPos, &line, &offset ); + // get desired x position to remember previous position + S32 desired_x_pixel = mDesiredXPixel; + // allow one line overlap S32 page_size = mScrollbar->getPageSize() - 1; if( delta == -1 ) @@ -3112,6 +3121,10 @@ void LLTextEditor::changePage( S32 delta ) setCursorPos(getPos( line + page_size, offset )); mScrollbar->setDocPos( mScrollbar->getDocPos() + page_size ); } + + // put desired position into remember-buffer after setCursorPos() + mDesiredXPixel = desired_x_pixel; + if (mOnScrollEndCallback && mOnScrollEndData && (mScrollbar->getDocPos() == mScrollbar->getDocPosMax())) { mOnScrollEndCallback(mOnScrollEndData); @@ -3127,9 +3140,13 @@ void LLTextEditor::changeLine( S32 delta ) S32 line_start = getLineStart(line); - S32 desired_x_pixel; - - desired_x_pixel = mGLFont->getWidth(mWText.c_str(), line_start, offset, mAllowEmbeddedItems ); + // set desired x position to remembered previous position + S32 desired_x_pixel = mDesiredXPixel; + // if remembered position was reset (thus -1), calculate new one here + if( desired_x_pixel == -1 ) + { + desired_x_pixel = mGLFont->getWidth(mWText.c_str(), line_start, offset, mAllowEmbeddedItems ); + } S32 new_line = 0; if( (delta < 0) && (line > 0 ) ) @@ -3165,6 +3182,9 @@ void LLTextEditor::changeLine( S32 delta ) mAllowEmbeddedItems); setCursorPos (getPos( new_line, new_offset )); + + // put desired position into remember-buffer after setCursorPos() + mDesiredXPixel = desired_x_pixel; unbindEmbeddedChars( mGLFont ); } @@ -3358,6 +3378,14 @@ void LLTextEditor::appendColoredText(const LLString &new_text, style.setVisible(true); style.setColor(color); style.setFontName(font_name); + appendStyledText(new_text, allow_undo, prepend_newline, &style); +} + +void LLTextEditor::appendStyledText(const LLString &new_text, + bool allow_undo, + bool prepend_newline, + const LLStyle* style) +{ if(mParseHTML) { @@ -3368,10 +3396,13 @@ void LLTextEditor::appendColoredText(const LLString &new_text, LLStyle html; html.setVisible(true); html.setColor(mLinkColor); - html.setFontName(font_name); + if (style) + { + html.setFontName(style->getFontString()); + } html.mUnderline = TRUE; - if (start > 0) appendText(text.substr(0,start),allow_undo, prepend_newline, &style); + if (start > 0) appendText(text.substr(0,start),allow_undo, prepend_newline, style); html.setLinkHREF(text.substr(start,end-start)); appendText(text.substr(start, end-start),allow_undo, prepend_newline, &html); if (end < (S32)text.length()) @@ -3384,22 +3415,14 @@ void LLTextEditor::appendColoredText(const LLString &new_text, break; } } - if (end < (S32)text.length()) appendText(text,allow_undo, prepend_newline, &style); + if (end < (S32)text.length()) appendText(text,allow_undo, prepend_newline, style); } else { - appendText(new_text, allow_undo, prepend_newline, &style); + appendText(new_text, allow_undo, prepend_newline, style); } } -void LLTextEditor::appendStyledText(const LLString &new_text, - bool allow_undo, - bool prepend_newline, - const LLStyle &style) -{ - appendText(new_text, allow_undo, prepend_newline, &style); -} - // Appends new text to end of document void LLTextEditor::appendText(const LLString &new_text, bool allow_undo, bool prepend_newline, const LLStyle* segment_style) diff --git a/linden/indra/llui/lltexteditor.h b/linden/indra/llui/lltexteditor.h index 32375be..ebe8ac3 100644 --- a/linden/indra/llui/lltexteditor.h +++ b/linden/indra/llui/lltexteditor.h @@ -159,7 +159,7 @@ public: // if styled text starts a line, you need to prepend a newline. void appendStyledText(const LLString &new_text, bool allow_undo, bool prepend_newline, - const LLStyle &style); + const LLStyle* style); // Removes text from the end of document // Does not change highlight or cursor position. @@ -359,6 +359,7 @@ protected: undo_stack_t mUndoStack; S32 mCursorPos; // I-beam is just after the mCursorPos-th character. + S32 mDesiredXPixel; // X pixel position where the user wants the cursor to be LLRect mTextRect; // The rect in which text is drawn. Excludes borders. // List of offsets and segment index of the start of each line. Always has at least one node (0). struct line_info diff --git a/linden/indra/llui/llui.h b/linden/indra/llui/llui.h index 6b8a86a..3085bd9 100644 --- a/linden/indra/llui/llui.h +++ b/linden/indra/llui/llui.h @@ -275,4 +275,95 @@ typedef enum e_widget_type WIDGET_TYPE_COUNT } EWidgetType; +// Manages generation of UI elements by LLSD, such that there is +// only one instance per uniquely identified LLSD parameter +// Class T is the instance type being managed, and INSTANCE_ADDAPTOR +// wraps an instance of the class with handlers for show/hide semantics, etc. +template +class LLUIInstanceMgr +{ +public: + LLUIInstanceMgr() + { + } + + virtual ~LLUIInstanceMgr() + { + } + + // default show and hide methods + static T* showInstance(const LLSD& seed) + { + T* instance = INSTANCE_ADAPTOR::getInstance(seed); + INSTANCE_ADAPTOR::show(instance); + return instance; + } + + static void hideInstance(const LLSD& seed) + { + T* instance = INSTANCE_ADAPTOR::getInstance(seed); + INSTANCE_ADAPTOR::hide(instance); + } + + static void toggleInstance(const LLSD& seed) + { + if (!INSTANCE_ADAPTOR::instanceVisible(seed)) + { + INSTANCE_ADAPTOR::showInstance(seed); + } + else + { + INSTANCE_ADAPTOR::hideInstance(seed); + } + } + + static BOOL instanceVisible(const LLSD& seed) + { + T* instance = INSTANCE_ADAPTOR::findInstance(seed); + return instance != NULL && INSTANCE_ADAPTOR::visible(instance); + } + + static T* getInstance(const LLSD& seed) + { + T* instance = INSTANCE_ADAPTOR::findInstance(seed); + if (instance == NULL) + { + instance = INSTANCE_ADAPTOR::createInstance(seed); + } + return instance; + } +}; + +// Creates a UI singleton by ignoring the identifying parameter +// and always generating the same instance via the LLUIInstanceMgr interface. +// Note that since UI elements can be destroyed by their hierarchy, this singleton +// pattern uses a static pointer to an instance that will be re-created as needed. +template +class LLUISingleton: public LLUIInstanceMgr +{ +public: + // default constructor assumes T is derived from LLUISingleton (a true singleton) + LLUISingleton() : LLUIInstanceMgr() { sInstance = (T*)this; } + ~LLUISingleton() { sInstance = NULL; } + + static T* findInstance(const LLSD& seed) + { + return sInstance; + } + + static T* createInstance(const LLSD& seed) + { + if (sInstance == NULL) + { + sInstance = new T(seed); + } + return sInstance; + } + +protected: + static T* sInstance; +}; + +template T* LLUISingleton::sInstance = NULL; + #endif diff --git a/linden/indra/llui/lluictrlfactory.cpp b/linden/indra/llui/lluictrlfactory.cpp index 475ef2e..79f7313 100644 --- a/linden/indra/llui/lluictrlfactory.cpp +++ b/linden/indra/llui/lluictrlfactory.cpp @@ -370,21 +370,22 @@ S32 LLUICtrlFactory::saveToXML(LLView* viewp, const LLString& filename) //----------------------------------------------------------------------------- // buildPanel() //----------------------------------------------------------------------------- -void LLUICtrlFactory::buildPanel(LLPanel* panelp, const LLString &filename, +BOOL LLUICtrlFactory::buildPanel(LLPanel* panelp, const LLString &filename, const LLCallbackMap::map_t* factory_map) { + BOOL didPost = FALSE; LLXMLNodePtr root; if (!LLUICtrlFactory::getLayeredXMLNode(filename, root)) { - return; + return didPost; } // root must be called panel if( !root->hasName("panel" ) ) { llwarns << "Root node should be named panel in : " << filename << llendl; - return; + return didPost; } if (factory_map) @@ -392,7 +393,7 @@ void LLUICtrlFactory::buildPanel(LLPanel* panelp, const LLString &filename, mFactoryStack.push_front(factory_map); } - panelp->initPanelXML(root, NULL, this); + didPost = panelp->initPanelXML(root, NULL, this); if (LLUI::sShowXUINames) { @@ -406,6 +407,8 @@ void LLUICtrlFactory::buildPanel(LLPanel* panelp, const LLString &filename, { mFactoryStack.pop_front(); } + + return didPost; } //----------------------------------------------------------------------------- diff --git a/linden/indra/llui/lluictrlfactory.h b/linden/indra/llui/lluictrlfactory.h index 18b0ba9..eaae754 100644 --- a/linden/indra/llui/lluictrlfactory.h +++ b/linden/indra/llui/lluictrlfactory.h @@ -80,8 +80,8 @@ public: void buildFloater(LLFloater* floaterp, const LLString &filename, const LLCallbackMap::map_t* factory_map = NULL, BOOL open = TRUE); - void buildPanel(LLPanel* panelp, const LLString &filename, - const LLCallbackMap::map_t* factory_map = NULL); + BOOL buildPanel(LLPanel* panelp, const LLString &filename, + const LLCallbackMap::map_t* factory_map = NULL); LLMenuGL *buildMenu(const LLString &filename, LLView* parentp); diff --git a/linden/indra/llui/llview.cpp b/linden/indra/llui/llview.cpp index d150e10..22d426a 100644 --- a/linden/indra/llui/llview.cpp +++ b/linden/indra/llui/llview.cpp @@ -194,8 +194,10 @@ LLView::~LLView() for (itor = mDispatchList.begin(); itor != mDispatchList.end(); ++itor) { (*itor).second->clearDispatchers(); - delete (*itor).second; } + + std::for_each(mFloaterControls.begin(), mFloaterControls.end(), + DeletePairedPointer()); } // virtual @@ -367,22 +369,25 @@ void LLView::addChildAtEnd(LLView* child, S32 tab_group) } // remove the specified child from the view, and set it's parent to NULL. -void LLView::removeChild( LLView* child ) +void LLView::removeChild(LLView* child, BOOL deleteIt) { if (child->mParentView == this) { mChildList.remove( child ); child->mParentView = NULL; + if (child->isCtrl()) + { + removeCtrl((LLUICtrl*)child); + } + if (deleteIt) + { + delete child; + } } else { llerrs << "LLView::removeChild called with non-child" << llendl; } - - if (child->isCtrl()) - { - removeCtrl((LLUICtrl*)child); - } } void LLView::addCtrlAtEnd(LLUICtrl* ctrl, S32 tab_group) @@ -2507,7 +2512,6 @@ void LLView::deregisterEventListener(LLString name) dispatch_list_t::iterator itor = mDispatchList.find(name); if (itor != mDispatchList.end()) { - delete itor->second; mDispatchList.erase(itor); } } diff --git a/linden/indra/llui/llview.h b/linden/indra/llui/llview.h index cb9a35c..c7664eb 100644 --- a/linden/indra/llui/llview.h +++ b/linden/indra/llui/llview.h @@ -241,7 +241,7 @@ public: void addChild(LLView* view, S32 tab_group = 0); void addChildAtEnd(LLView* view, S32 tab_group = 0); // remove the specified child from the view, and set it's parent to NULL. - void removeChild( LLView* view ); + void removeChild(LLView* view, BOOL deleteIt = FALSE); virtual void addCtrl( LLUICtrl* ctrl, S32 tab_group); virtual void addCtrlAtEnd( LLUICtrl* ctrl, S32 tab_group); @@ -484,7 +484,7 @@ protected: LLView* childrenHandleRightMouseDown(S32 x, S32 y, MASK mask); LLView* childrenHandleRightMouseUp(S32 x, S32 y, MASK mask); - typedef std::map dispatch_list_t; + typedef std::map > dispatch_list_t; dispatch_list_t mDispatchList; protected: diff --git a/linden/indra/llvfs/lllfsthread.h b/linden/indra/llvfs/lllfsthread.h index 48c5a5c..25b4c6b 100644 --- a/linden/indra/llvfs/lllfsthread.h +++ b/linden/indra/llvfs/lllfsthread.h @@ -58,8 +58,9 @@ public: class Responder : public LLThreadSafeRefCount { + protected: + ~Responder(); public: - virtual ~Responder(); virtual void completed(S32 bytes) = 0; }; diff --git a/linden/indra/llwindow/llwindow.cpp b/linden/indra/llwindow/llwindow.cpp index 134e606..cad1dc4 100644 --- a/linden/indra/llwindow/llwindow.cpp +++ b/linden/indra/llwindow/llwindow.cpp @@ -125,6 +125,16 @@ BOOL LLWindowCallbacks::handleRightMouseUp(LLWindow *window, const LLCoordGL pos return FALSE; } +BOOL LLWindowCallbacks::handleMiddleMouseDown(LLWindow *window, const LLCoordGL pos, MASK mask) +{ + return FALSE; +} + +BOOL LLWindowCallbacks::handleMiddleMouseUp(LLWindow *window, const LLCoordGL pos, MASK mask) +{ + return FALSE; +} + BOOL LLWindowCallbacks::handleActivate(LLWindow *window, BOOL activated) { return FALSE; diff --git a/linden/indra/llwindow/llwindow.h b/linden/indra/llwindow/llwindow.h index a52aff6..2bb49e9 100644 --- a/linden/indra/llwindow/llwindow.h +++ b/linden/indra/llwindow/llwindow.h @@ -96,6 +96,8 @@ public: virtual void handleQuit(LLWindow *window); virtual BOOL handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); virtual BOOL handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); + virtual BOOL handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); + virtual BOOL handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); virtual BOOL handleActivate(LLWindow *window, BOOL activated); virtual void handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask); virtual void handleScrollWheel(LLWindow *window, S32 clicks); diff --git a/linden/indra/llwindow/llwindowmacosx.cpp b/linden/indra/llwindow/llwindowmacosx.cpp index b2a1ccf..0c5d6ed 100644 --- a/linden/indra/llwindow/llwindowmacosx.cpp +++ b/linden/indra/llwindow/llwindowmacosx.cpp @@ -2177,6 +2177,10 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e case kEventMouseButtonSecondary: mCallbacks->handleRightMouseDown(this, outCoords, mask); break; + + case kEventMouseButtonTertiary: + mCallbacks->handleMiddleMouseDown(this, outCoords, mask); + break; } result = noErr; break; @@ -2199,6 +2203,10 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e case kEventMouseButtonSecondary: mCallbacks->handleRightMouseUp(this, outCoords, mask); break; + + case kEventMouseButtonTertiary: + mCallbacks->handleMiddleMouseUp(this, outCoords, mask); + break; } result = noErr; break; @@ -2231,7 +2239,13 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e case kEventClassWindow: switch(evtKind) - { + { + case kEventWindowActivated: + mCallbacks->handleFocus(this); + break; + case kEventWindowDeactivated: + mCallbacks->handleFocusLost(this); + break; case kEventWindowBoundsChanging: { Rect currentBounds; diff --git a/linden/indra/llwindow/llwindowmesaheadless.h b/linden/indra/llwindow/llwindowmesaheadless.h index 599db72..f0ad50e 100644 --- a/linden/indra/llwindow/llwindowmesaheadless.h +++ b/linden/indra/llwindow/llwindowmesaheadless.h @@ -32,6 +32,7 @@ #if LL_MESA_HEADLESS #include "llwindow.h" +#include "GL/glu.h" #include "GL/osmesa.h" class LLWindowMesaHeadless : public LLWindow diff --git a/linden/indra/llwindow/llwindowsdl.cpp b/linden/indra/llwindow/llwindowsdl.cpp index f7b4071..a1cdeb3 100644 --- a/linden/indra/llwindow/llwindowsdl.cpp +++ b/linden/indra/llwindow/llwindowsdl.cpp @@ -296,9 +296,9 @@ static SDL_Surface *Load_BMP_Resource(const char *basename) #if LL_X11 // This is an XFree86/XOrg-specific hack for detecting the amount of Video RAM // on this machine. It works by searching /var/log/var/log/Xorg.?.log or -// /var/log/XFree86.?.log for a ': VideoRAM: (%d+) kB' regex, where '?' is -// the X11 display number derived from $DISPLAY -static int x11_detect_VRAM_kb_fp(FILE *fp) +// /var/log/XFree86.?.log for a ': (VideoRAM|Memory): (%d+) kB' regex, where +// '?' is the X11 display number derived from $DISPLAY +static int x11_detect_VRAM_kb_fp(FILE *fp, const char *prefix_str) { const int line_buf_size = 1000; char line_buf[line_buf_size]; @@ -310,7 +310,7 @@ static int x11_detect_VRAM_kb_fp(FILE *fp) // favourite regex implementation - libboost_regex - is // quite a heavy and troublesome dependency for the client, so // it seems a shame to introduce it for such a simple task. - const char part1_template[] = ": VideoRAM: "; + const char *part1_template = prefix_str; const char part2_template[] = " kB"; char *part1 = strstr(line_buf, part1_template); if (part1) // found start of matching line @@ -325,7 +325,6 @@ static int x11_detect_VRAM_kb_fp(FILE *fp) int rtn = 0; for (; part1 < part2; ++part1) { - //lldebugs << "kB" << *part1 << llendl; if (*part1 < '0' || *part1 > '9') { // unexpected char, abort parse @@ -345,6 +344,7 @@ static int x11_detect_VRAM_kb_fp(FILE *fp) } return 0; // 'could not detect' } + static int x11_detect_VRAM_kb() { std::string x_log_location("/var/log/"); @@ -363,7 +363,7 @@ static int x11_detect_VRAM_kb() // *TODO: we could be smarter and see which of Xorg/XFree86 has the // freshest time-stamp. - // Try XOrg log first + // Try Xorg log first fname = x_log_location; fname += "Xorg."; fname += ('0' + display_num); @@ -371,12 +371,25 @@ static int x11_detect_VRAM_kb() fp = fopen(fname.c_str(), "r"); if (fp) { - rtn = x11_detect_VRAM_kb_fp(fp); + llinfos << "Looking in " << fname + << " for VRAM info..." << llendl; + rtn = x11_detect_VRAM_kb_fp(fp, ": VideoRAM: "); fclose(fp); + if (0 == rtn) + { + fp = fopen(fname.c_str(), "r"); + if (fp) + { + rtn = x11_detect_VRAM_kb_fp(fp, ": Memory: "); + fclose(fp); + } + } } - // Try old XFree86 log otherwise - if (rtn == 0) + else { + llinfos << "Could not open " << fname + << " - skipped." << llendl; + // Try old XFree86 log otherwise fname = x_log_location; fname += "XFree86."; fname += ('0' + display_num); @@ -384,8 +397,24 @@ static int x11_detect_VRAM_kb() fp = fopen(fname.c_str(), "r"); if (fp) { - rtn = x11_detect_VRAM_kb_fp(fp); + llinfos << "Looking in " << fname + << " for VRAM info..." << llendl; + rtn = x11_detect_VRAM_kb_fp(fp, ": VideoRAM: "); fclose(fp); + if (0 == rtn) + { + fp = fopen(fname.c_str(), "r"); + if (fp) + { + rtn = x11_detect_VRAM_kb_fp(fp, ": Memory: "); + fclose(fp); + } + } + } + else + { + llinfos << "Could not open " << fname + << " - skipped." << llendl; } } return rtn; @@ -2023,7 +2052,9 @@ void LLWindowSDL::gatherInput() } else if (event.button.button == SDL_BUTTON_MIDDLE) // middle - ; // Middle mouse isn't handled right now in Second Life ... mCallbacks->handleMiddleMouseDown(this, openGlCoord, mask); + { + mCallbacks->handleMiddleMouseDown(this, openGlCoord, mask); + } else if (event.button.button == 4) // mousewheel up...thanks to X11 for making SDL consider these "buttons". mCallbacks->handleScrollWheel(this, -1); else if (event.button.button == 5) // mousewheel down...thanks to X11 for making SDL consider these "buttons". @@ -2044,8 +2075,9 @@ void LLWindowSDL::gatherInput() else if (event.button.button == SDL_BUTTON_RIGHT) // right ... yes, it's 3, not 2, in SDL... mCallbacks->handleRightMouseUp(this, openGlCoord, mask); else if (event.button.button == SDL_BUTTON_MIDDLE) // middle - ; // UNUSED IN SECOND LIFE RIGHT NOW mCallbacks->handleMiddleMouseUp(this, openGlCoord, mask); - + { + mCallbacks->handleMiddleMouseUp(this, openGlCoord, mask); + } // don't handle mousewheel here... break; diff --git a/linden/indra/llwindow/llwindowwin32.cpp b/linden/indra/llwindow/llwindowwin32.cpp index 3c2e730..2cd1353 100644 --- a/linden/indra/llwindow/llwindowwin32.cpp +++ b/linden/indra/llwindow/llwindowwin32.cpp @@ -2072,7 +2072,54 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ break; case WM_MBUTTONDOWN: - // Handle middle button click +// case WM_MBUTTONDBLCLK: + { + // Because we move the cursor position in tllviewerhe app, we need to query + // to find out where the cursor at the time the event is handled. + // If we don't do this, many clicks could get buffered up, and if the + // first click changes the cursor position, all subsequent clicks + // will occur at the wrong location. JC + LLCoordWindow cursor_coord_window; + if (window_imp->mMousePositionModified) + { + window_imp->getCursorPosition(&cursor_coord_window); + window_imp->convertCoords(cursor_coord_window, &gl_coord); + } + else + { + window_imp->convertCoords(window_coord, &gl_coord); + } + MASK mask = gKeyboard->currentMask(TRUE); + if (window_imp->mCallbacks->handleMiddleMouseDown(window_imp, gl_coord, mask)) + { + return 0; + } + } + break; + + case WM_MBUTTONUP: + { + // Because we move the cursor position in tllviewerhe app, we need to query + // to find out where the cursor at the time the event is handled. + // If we don't do this, many clicks could get buffered up, and if the + // first click changes the cursor position, all subsequent clicks + // will occur at the wrong location. JC + LLCoordWindow cursor_coord_window; + if (window_imp->mMousePositionModified) + { + window_imp->getCursorPosition(&cursor_coord_window); + window_imp->convertCoords(cursor_coord_window, &gl_coord); + } + else + { + window_imp->convertCoords(window_coord, &gl_coord); + } + MASK mask = gKeyboard->currentMask(TRUE); + if (window_imp->mCallbacks->handleMiddleMouseUp(window_imp, gl_coord, mask)) + { + return 0; + } + } break; case WM_MOUSEWHEEL: diff --git a/linden/indra/llxml/llxmlnode.cpp b/linden/indra/llxml/llxmlnode.cpp index b83555a..26906a4 100644 --- a/linden/indra/llxml/llxmlnode.cpp +++ b/linden/indra/llxml/llxmlnode.cpp @@ -637,6 +637,66 @@ bool LLXMLNode::parseBuffer( return true; } +// static +bool LLXMLNode::parseStream( + std::istream& str, + LLXMLNodePtr& node, + LLXMLNode* defaults) +{ + // Init + XML_Parser my_parser = XML_ParserCreate(NULL); + XML_SetElementHandler(my_parser, StartXMLNode, EndXMLNode); + XML_SetCharacterDataHandler(my_parser, XMLData); + + // Create a root node + LLXMLNode *file_node_ptr = new LLXMLNode("XML", FALSE); + LLXMLNodePtr file_node = file_node_ptr; + + file_node->mParser = &my_parser; + + XML_SetUserData(my_parser, (void *)file_node_ptr); + + const int BUFSIZE = 1024; + U8* buffer = new U8[BUFSIZE]; + + while(str.good()) + { + str.read((char*)buffer, BUFSIZE); + int count = str.gcount(); + + if (XML_Parse(my_parser, (const char *)buffer, count, !str.good()) != XML_STATUS_OK) + { + llwarns << "Error parsing xml error code: " + << XML_ErrorString(XML_GetErrorCode(my_parser)) + << " on lne " << XML_GetCurrentLineNumber(my_parser) + << llendl; + break; + } + } + + delete [] buffer; + + // Deinit + XML_ParserFree(my_parser); + + if (!file_node->mChildren || file_node->mChildren->map.size() != 1) + { + llwarns << "Parse failure - wrong number of top-level nodes xml." + << llendl; + node = new LLXMLNode(); + return false; + } + + LLXMLNode *return_node = file_node->mChildren->map.begin()->second; + + return_node->setDefault(defaults); + return_node->updateDefault(); + + node = return_node; + return true; +} + + BOOL LLXMLNode::isFullyDefault() { if (mDefault.isNull()) diff --git a/linden/indra/llxml/llxmlnode.h b/linden/indra/llxml/llxmlnode.h index e876739..f95a53b 100644 --- a/linden/indra/llxml/llxmlnode.h +++ b/linden/indra/llxml/llxmlnode.h @@ -94,7 +94,7 @@ public: }; protected: - virtual ~LLXMLNode(); + ~LLXMLNode(); public: LLXMLNode(); @@ -117,6 +117,10 @@ public: U32 length, LLXMLNodePtr& node, LLXMLNode* defaults); + static bool parseStream( + std::istream& str, + LLXMLNodePtr& node, + LLXMLNode* defaults); static bool updateNode( LLXMLNodePtr& node, LLXMLNodePtr& update_node); diff --git a/linden/indra/lscript/lscript_compile/indra.l b/linden/indra/lscript/lscript_compile/indra.l index 7c9b3aa..6b4e67d 100644 --- a/linden/indra/lscript/lscript_compile/indra.l +++ b/linden/indra/lscript/lscript_compile/indra.l @@ -758,15 +758,8 @@ void comment() { char c; -#if LL_DARWIN while ((c = yyinput()) != '\n' && c != 0 && c != EOF) ; -#else - while ((c = yyinput()) != '\n' && c != 0) - ; -#endif - - } void count() diff --git a/linden/indra/mac_updater/mac_updater.cpp b/linden/indra/mac_updater/mac_updater.cpp index 58819a2..a30f024 100644 --- a/linden/indra/mac_updater/mac_updater.cpp +++ b/linden/indra/mac_updater/mac_updater.cpp @@ -537,8 +537,7 @@ bool isDirWritable(FSRef &dir) static void utf8str_to_HFSUniStr255(HFSUniStr255 *dest, const char* src) { - LLWString wstr = utf8str_to_wstring(src); - llutf16string utf16str = wstring_to_utf16str(wstr); + llutf16string utf16str = utf8str_to_utf16str(src); dest->length = utf16str.size(); if(dest->length > 255) @@ -550,6 +549,13 @@ static void utf8str_to_HFSUniStr255(HFSUniStr255 *dest, const char* src) memcpy(dest->unicode, utf16str.data(), sizeof(UniChar)* dest->length); /* Flawfinder: ignore */ } +static std::string HFSUniStr255_to_utf8str(const HFSUniStr255* src) +{ + llutf16string string16((U16*)&(src->unicode), src->length); + std::string result = utf16str_to_utf8str(string16); + return result; +} + int restoreObject(const char* aside, const char* target, const char* path, const char* object) { char source[PATH_MAX]; /* Flawfinder: ignore */ @@ -598,6 +604,123 @@ void filterFile(const char* filename) system(temp); /* Flawfinder: ignore */ } +static bool isFSRefViewerBundle(FSRef *targetRef) +{ + bool result = false; + CFURLRef targetURL = NULL; + CFBundleRef targetBundle = NULL; + CFStringRef targetBundleID = NULL; + + targetURL = CFURLCreateFromFSRef(NULL, targetRef); + + if(targetURL == NULL) + { + llinfos << "Error creating target URL." << llendl; + } + else + { + targetBundle = CFBundleCreate(NULL, targetURL); + } + + if(targetBundle == NULL) + { + llinfos << "Failed to create target bundle." << llendl; + } + else + { + targetBundleID = CFBundleGetIdentifier(targetBundle); + } + + if(targetBundleID == NULL) + { + llinfos << "Couldn't retrieve target bundle ID." << llendl; + } + else + { + if(CFStringCompare(targetBundleID, CFSTR("com.secondlife.indra.viewer"), 0) == kCFCompareEqualTo) + { + // This is the bundle we're looking for. + result = true; + } + else + { + llinfos << "Target bundle ID mismatch." << llendl; + } + } + + // Don't release targetBundleID -- since we don't retain it, it's released when targetBundle is released. + if(targetURL != NULL) + CFRelease(targetURL); + if(targetBundle != NULL) + CFRelease(targetBundle); + + return result; +} + +// Search through the directory specified by 'parent' for an item that appears to be a Second Life viewer. +static OSErr findAppBundleOnDiskImage(FSRef *parent, FSRef *app) +{ + FSIterator iterator; + bool found = false; + + OSErr err = FSOpenIterator( parent, kFSIterateFlat, &iterator ); + if(!err) + { + do + { + ItemCount actualObjects = 0; + Boolean containerChanged = false; + FSCatalogInfo info; + FSRef ref; + HFSUniStr255 unicodeName; + err = FSGetCatalogInfoBulk( + iterator, + 1, + &actualObjects, + &containerChanged, + kFSCatInfoNodeFlags, + &info, + &ref, + NULL, + &unicodeName ); + + if(actualObjects == 0) + break; + + if(!err) + { + // Call succeeded and not done with the iteration. + std::string name = HFSUniStr255_to_utf8str(&unicodeName); + + llinfos << "Considering \"" << name << "\"" << llendl; + + if(info.nodeFlags & kFSNodeIsDirectoryMask) + { + // This is a directory. See if it's a .app + if(name.find(".app") != std::string::npos) + { + // Looks promising. Check to see if it has the right bundle identifier. + if(isFSRefViewerBundle(&ref)) + { + // This is the one. Return it. + *app = ref; + found = true; + } + } + } + } + } + while(!err && !found); + + FSCloseIterator(iterator); + } + + if(!err && !found) + err = fnfErr; + + return err; +} + void *updatethreadproc(void*) { char tempDir[PATH_MAX] = ""; /* Flawfinder: ignore */ @@ -670,57 +793,15 @@ void *updatethreadproc(void*) // Sanity check: make sure the target is a bundle with the right identifier if(err == noErr) { - CFURLRef targetURL = NULL; - CFBundleRef targetBundle = NULL; - CFStringRef targetBundleID = NULL; - // Assume the worst... err = -1; - - targetURL = CFURLCreateFromFSRef(NULL, &targetRef); - if(targetURL == NULL) - { - llinfos << "Error creating target URL." << llendl; - } - else + if(isFSRefViewerBundle(&targetRef)) { - targetBundle = CFBundleCreate(NULL, targetURL); - } - - if(targetBundle == NULL) - { - llinfos << "Failed to create target bundle." << llendl; - } - else - { - targetBundleID = CFBundleGetIdentifier(targetBundle); - } - - if(targetBundleID == NULL) - { - llinfos << "Couldn't retrieve target bundle ID." << llendl; - } - else - { - if(CFStringCompare(targetBundleID, CFSTR("com.secondlife.indra.viewer"), 0) == kCFCompareEqualTo) - { - // This is the bundle we're looking for. - err = noErr; - replacingTarget = true; - } - else - { - llinfos << "Target bundle ID mismatch." << llendl; - } + // This is the bundle we're looking for. + err = noErr; + replacingTarget = true; } - - // Don't release targetBundleID -- since we don't retain it, it's released when targetBundle is released. - if(targetURL != NULL) - CFRelease(targetURL); - if(targetBundle != NULL) - CFRelease(targetBundle); - } // Make sure the target's parent directory is writable. @@ -943,13 +1024,24 @@ void *updatethreadproc(void*) // Get an FSRef to the new application on the disk image FSRef sourceRef; - snprintf(temp, sizeof(temp), "%s/mnt/Second Life.app", tempDir); + FSRef mountRef; + snprintf(temp, sizeof(temp), "%s/mnt", tempDir); - llinfos << "Source application is: " << temp << llendl; + llinfos << "Disk image mount point is: " << temp << llendl; - err = FSPathMakeRef((UInt8 *)temp, &sourceRef, NULL); + err = FSPathMakeRef((UInt8 *)temp, &mountRef, NULL); if(err != noErr) + { + llinfos << "Couldn't make FSRef to disk image mount point." << llendl; throw 0; + } + + err = findAppBundleOnDiskImage(&mountRef, &sourceRef); + if(err != noErr) + { + llinfos << "Couldn't find application bundle on mounted disk image." << llendl; + throw 0; + } FSRef asideRef; char aside[MAX_PATH]; /* Flawfinder: ignore */ diff --git a/linden/indra/newview/English.lproj/InfoPlist.strings b/linden/indra/newview/English.lproj/InfoPlist.strings index 8fae01f..9df6a82 100644 --- a/linden/indra/newview/English.lproj/InfoPlist.strings +++ b/linden/indra/newview/English.lproj/InfoPlist.strings @@ -1,5 +1,5 @@ /* Localized versions of Info.plist keys */ CFBundleName = "Second Life"; -CFBundleShortVersionString = "Second Life version 1.16.0.5"; -CFBundleGetInfoString = "Second Life version 1.16.0.5, Copyright 2004-2007 Linden Research, Inc."; +CFBundleShortVersionString = "Second Life version 1.17.0.12"; +CFBundleGetInfoString = "Second Life version 1.17.0.12, Copyright 2004-2007 Linden Research, Inc."; diff --git a/linden/indra/newview/Info-SecondLife.plist b/linden/indra/newview/Info-SecondLife.plist index 764b152..a02f664 100644 --- a/linden/indra/newview/Info-SecondLife.plist +++ b/linden/indra/newview/Info-SecondLife.plist @@ -32,7 +32,7 @@ CFBundleVersion - 1.16.0.5 + 1.17.0.12 CSResourcesFileMapped diff --git a/linden/indra/newview/installers/windows/installer_template.nsi b/linden/indra/newview/installers/windows/installer_template.nsi index 8ab7c4f..1b5226c 100644 --- a/linden/indra/newview/installers/windows/installer_template.nsi +++ b/linden/indra/newview/installers/windows/installer_template.nsi @@ -1,63 +1,70 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; @file viewer_manifest.py -;;; @author James Cook, Don Kjer -;;; @brief NSIS script for creating a Windows installer. -;;; This file has variables expanded by viewer_manifest.py -;;; to produce the complete nsi script file. -;;; For info, see http://www.nullsoft.com/free/nsis/ -;;; NSIS 2.02 or higher required -;;; -;;; Copyright (c) 2006-$CurrentYear$, Linden Research, Inc. -;;; $License$ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; Compiler flags -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; secondlife setup.nsi +;; Copyright 2004-2007, Linden Research, Inc. +;; For info, see http://www.nullsoft.com/free/nsis/ +;; +;; NSIS 2.22 or higher required +;; Author: James Cook, Don Kjer, Callum Prentice +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Detect NSIS compiler version !define "NSIS${NSIS_VERSION}" !ifdef "NSISv2.02" | "NSISv2.03" | "NSISv2.04" | "NSISv2.05" | "NSISv2.06" - ;;; before 2.07 defaulted lzma to solid (whole file) + ;; before 2.07 defaulted lzma to solid (whole file) SetCompressor lzma !else - ;;; after 2.07 required /solid for whole file compression + ;; after 2.07 required /solid for whole file compression SetCompressor /solid lzma !endif +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Compiler flags +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SetOverwrite on ; overwrite files SetCompress auto ; compress iff saves space -SetDatablockOptimize off ; only saves us 0.1%, not worth it -XPStyle on ; add an XP manifest to the installer +SetDatablockOptimize off ; only saves us 0.1%, not worth it +XPStyle on ; add an XP manifest to the installer -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Project flags -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %%VERSION%% -;;; Tweak for different servers/builds (this placeholder is replaced by viewer_manifest.py) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; - language files - one for each language (or flavor thereof) +;; (these files are in the same place as the nsi template but the python script generates a new nsi file in the +;; application directory so we have to add a path to these include files) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +#!include "installers\windows\lang_de.nsi" +!include "installers\windows\lang_en-us.nsi" +#!include "installers\windows\lang_ja.nsi" +!include "installers\windows\lang_ko.nsi" + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Tweak for different servers/builds (this placeholder is replaced by viewer_manifest.py) %%GRID_VARS%% Name ${INSTNAME} -SubCaption 0 " Setup" ; override "license agreement" text +SubCaption 0 $(LicenseSubTitleSetup) ; override "license agreement" text -BrandingText " " ; bottom of window text -Icon res\install_icon.ico ; our custom icon +BrandingText " " ; bottom of window text +Icon res\install_icon.ico ; our custom icon UninstallIcon res\uninstall_icon.ico ; our custom icon -WindowIcon on ; show our icon in left corner -BGGradient off ; no big background window -CRCCheck on ; make sure CRC is OK +WindowIcon on ; show our icon in left corner +BGGradient off ; no big background window +CRCCheck on ; make sure CRC is OK InstProgressFlags smooth colored ; new colored smooth look -ShowInstDetails nevershow ; no details, no "show" button -SetOverwrite on ; stomp files by default -AutoCloseWindow true ; after all files install, close window +ShowInstDetails nevershow ; no details, no "show" button +SetOverwrite on ; stomp files by default +AutoCloseWindow true ; after all files install, close window !ifdef UPDATE -LicenseText "This package will update Second Life to version ${VERSION_LONG}." "Next >" +LicenseText $(LicenseDescUpdate) $(LicenseDescNext) !else -LicenseText "This package will install Second Life on your computer." "Next >" +LicenseText $(LicenseDescSetup) $(LicenseDescNext) !endif LicenseData "releasenotes.txt" @@ -65,30 +72,30 @@ LicenseData "releasenotes.txt" InstallDir "$PROGRAMFILES\${INSTNAME}" InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" "" !ifdef UPDATE -DirText "Installation Directory" "Select the Second Life directory to update:" +DirText $(DirectoryChooseTitle) $(DirectoryChooseUpdate) !else -DirText "Installation Directory" "Select the directory to install Second Life in:" +DirText $(DirectoryChooseTitle) $(DirectoryChooseSetup) !endif -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Variables -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Var INSTPROG Var INSTEXE Var INSTFLAGS +Var LANGFLAGS Var INSTSHORTCUT -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Sections -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Section "" ; (default section) SetShellVarContext all ; install for all users (if you change this, change it in the uninstall as well) - ; Start with some default values. StrCpy $INSTFLAGS "${INSTFLAGS}" +StrCpy $INSTFLAGS "$INSTFLAGS $LANGFLAGS" StrCpy $INSTPROG "${INSTNAME}" StrCpy $INSTEXE "${INSTEXE}" StrCpy $INSTSHORTCUT "${SHORTCUT}" @@ -103,21 +110,22 @@ Call CheckIfAlreadyCurrent ; Make sure that we haven't already installed this v Call CloseSecondLife ; Make sure we're not running Call RemoveNSIS ; Check for old NSIS install to remove +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Don't remove cache files during a regular install, removing the inventory cache on upgrades results in lots of damage to the servers. ;Call RemoveCacheFiles ; Installing over removes potentially corrupted ; VFS and cache files. - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Files -;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; This placeholder is replaced by the complete list of all the files in the installer, by viewer_manifest.py %%INSTALL_FILES%% +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; If this is a silent update, we don't need to re-create these shortcuts or registry entries. IfSilent POST_INSTALL +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Shortcuts in start menu CreateDirectory "$SMPROGRAMS\$INSTSHORTCUT" SetOutPath "$INSTDIR" @@ -146,6 +154,7 @@ CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\SL Scripting Language Help.lnk" \ CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\Uninstall $INSTSHORTCUT.lnk" \ '"$INSTDIR\uninst.exe"' '/P="$INSTPROG"' +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Other shortcuts SetOutPath "$INSTDIR" CreateShortCut "$DESKTOP\$INSTSHORTCUT.lnk" "$INSTDIR\$INSTEXE" "$INSTFLAGS" @@ -164,6 +173,7 @@ CreateShortCut "$INSTDIR\$INSTSHORTCUT Museum Spanish.lnk" "$INSTDIR\$INSTEXE" " !endif +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Write registry WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "" "$INSTDIR" WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Version" "${VERSION_LONG}" @@ -173,6 +183,7 @@ WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Exe" WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "DisplayName" "$INSTPROG (remove only)" WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "UninstallString" '"$INSTDIR\uninst.exe" /P="$INSTPROG"' +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Write URL registry info WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}" "(default)" "URL:Second Life" WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}" "URL Protocol" "" @@ -192,10 +203,10 @@ WriteUninstaller "$INSTDIR\uninst.exe" ; end of default section SectionEnd -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; PostInstallExe ; This just runs any post installation scripts. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function PostInstallExe push $0 ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "PostInstallExe" @@ -204,11 +215,10 @@ push $0 pop $0 FunctionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; CheckStartupParameters ; Sets INSTFLAGS, INSTPROG, and INSTEXE. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function CheckStartupParams push $0 push $R0 @@ -237,7 +247,7 @@ push $R0 Goto FINISHED ABORT: - MessageBox MB_OK "Could not find the program '$INSTPROG'. Silent update failed." + MessageBox MB_OK $(CheckStartupParamsMB) Quit FINISHED: @@ -246,6 +256,9 @@ pop $R0 pop $0 FunctionEnd +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function un.CheckStartupParams push $0 push $R0 @@ -274,7 +287,7 @@ push $R0 Goto FINISHED ABORT: - MessageBox MB_OK "Could not find the program '$INSTPROG'. Silent update failed." + MessageBox MB_OK $(CheckStartupParamsMB) Quit FINISHED: @@ -283,26 +296,26 @@ pop $R0 pop $0 FunctionEnd -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; After install completes, offer readme file -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function .onInstSuccess MessageBox MB_YESNO \ - "Start Second Life now?" /SD IDYES IDNO NoReadme + $(InstSuccesssQuestion) /SD IDYES IDNO NoReadme ; Assumes SetOutPath $INSTDIR Exec '"$INSTDIR\$INSTEXE" $INSTFLAGS' NoReadme: FunctionEnd -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Remove old NSIS version. Modifies no variables. ; Does NOT delete the LindenWorld directory, or any ; user files in that directory. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function RemoveNSIS Push $0 ; Grab the installation directory of the old version - DetailPrint "Checking for old version..." + DetailPrint $(RemoveOldNSISVersion) ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "" ; If key doesn't exist, skip uninstall @@ -323,9 +336,9 @@ Function RemoveNSIS Pop $0 FunctionEnd -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Make sure we're not on Windows 98 / ME -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function CheckWindowsVersion DetailPrint "Checking Windows version..." Call GetWindowsVersion @@ -339,46 +352,49 @@ Function CheckWindowsVersion StrCmp $R0 "NT" win_ver_bad Return win_ver_bad: - MessageBox MB_YESNO 'Second Life only supports Windows XP, Windows 2000, and Mac OS X.$\n$\nAttempting to install on Windows $R0 can result in crashes and data loss.$\n$\nInstall anyway?' IDNO win_ver_abort + MessageBox MB_YESNO $(CheckWindowsVersionMB) IDNO win_ver_abort Return win_ver_abort: Quit FunctionEnd -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Make sure the user can install/uninstall -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function CheckIfAdministrator - DetailPrint "Checking for permission to install..." + DetailPrint $(CheckAdministratorInstDP) UserInfo::GetAccountType Pop $R0 StrCmp $R0 "Admin" is_admin - MessageBox MB_OK 'You appear to be using a "limited" account.$\nYou must be an "administrator" to install Second Life.' + MessageBox MB_OK $(CheckAdministratorInstMB) Quit is_admin: Return FunctionEnd +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function un.CheckIfAdministrator - DetailPrint "Checking for permission to uninstall..." + DetailPrint $(CheckAdministratorUnInstDP) UserInfo::GetAccountType Pop $R0 StrCmp $R0 "Admin" is_admin - MessageBox MB_OK 'You appear to be using a "limited" account.$\nYou must be an "administrator" to uninstall Second Life.' + MessageBox MB_OK $(CheckAdministratorUnInstMB) Quit is_admin: Return FunctionEnd -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Checks to see if the current version has already been installed (according to the registry). ; If it has, allow user to bail out of install process. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function CheckIfAlreadyCurrent Push $0 ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Version" StrCmp $0 ${VERSION_LONG} 0 DONE - MessageBox MB_OKCANCEL "It appears that Second Life ${VERSION_LONG} is already installed.$\n$\nWould you like to install it again?" /SD IDOK IDOK DONE + MessageBox MB_OKCANCEL $(CheckIfCurrentMB) /SD IDOK IDOK DONE Quit DONE: @@ -386,22 +402,21 @@ Function CheckIfAlreadyCurrent Return FunctionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Close the program, if running. Modifies no variables. ; Allows user to bail out of install process. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function CloseSecondLife Push $0 FindWindow $0 "Second Life" "" IntCmp $0 0 DONE - MessageBox MB_OKCANCEL "Second Life can't be installed while it is already running.$\n$\nFinish what you're doing then select OK to close Second Life and continue.$\nSelect CANCEL to cancel installation." IDOK CLOSE IDCANCEL CANCEL_INSTALL + MessageBox MB_OKCANCEL $(CloseSecondLifeInstMB) IDOK CLOSE IDCANCEL CANCEL_INSTALL CANCEL_INSTALL: Quit CLOSE: - DetailPrint "Waiting for Second Life to shut down..." + DetailPrint $(CloseSecondLifeInstDP) SendMessage $0 16 0 0 LOOP: @@ -416,59 +431,59 @@ Function CloseSecondLife FunctionEnd -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Delete files in Documents and Settings\\SecondLife\cache ; Delete files in Documents and Settings\All Users\SecondLife\cache -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Function RemoveCacheFiles - -; Delete files in Documents and Settings\\SecondLife -Push $0 -Push $1 -Push $2 - DetailPrint "Deleting cache files in Documents and Settings folder" - - StrCpy $0 0 ; Index number used to iterate via EnumRegKey - - LOOP: - EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0 - StrCmp $1 "" DONE ; no more users - - ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath" - StrCmp $2 "" CONTINUE 0 ; "ProfileImagePath" value is missing - - ; Required since ProfileImagePath is of type REG_EXPAND_SZ - ExpandEnvStrings $2 $2 - - ; When explicitly uninstalling, everything goes away - RMDir /r "$2\Application Data\SecondLife\cache" - - CONTINUE: - IntOp $0 $0 + 1 - Goto LOOP - DONE: -Pop $2 -Pop $1 -Pop $0 - -; Delete files in Documents and Settings\All Users\SecondLife -Push $0 - ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData" - StrCmp $0 "" +2 - RMDir /r "$0\SecondLife\cache" -Pop $0 - -; Delete filse in C:\Windows\Application Data\SecondLife -; If the user is running on a pre-NT system, Application Data lives here instead of -; in Documents and Settings. -RMDir /r "$WINDIR\Application Data\SecondLife\cache" - -FunctionEnd +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;Function RemoveCacheFiles +; +;; Delete files in Documents and Settings\\SecondLife +;Push $0 +;Push $1 +;Push $2 +; DetailPrint $(RemoveCacheFilesDP) +; +; StrCpy $0 0 ; Index number used to iterate via EnumRegKey +; +; LOOP: +; EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0 +; StrCmp $1 "" DONE ; no more users +; +; ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath" +; StrCmp $2 "" CONTINUE 0 ; "ProfileImagePath" value is missing +; +; ; Required since ProfileImagePath is of type REG_EXPAND_SZ +; ExpandEnvStrings $2 $2 +; +; ; When explicitly uninstalling, everything goes away +; RMDir /r "$2\Application Data\SecondLife\cache" +; +; CONTINUE: +; IntOp $0 $0 + 1 +; Goto LOOP +; DONE: +;Pop $2 +;Pop $1 +;Pop $0 +; +;; Delete files in Documents and Settings\All Users\SecondLife +;Push $0 +; ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData" +; StrCmp $0 "" +2 +; RMDir /r "$0\SecondLife\cache" +;Pop $0 +; +;; Delete filse in C:\Windows\Application Data\SecondLife +;; If the user is running on a pre-NT system, Application Data lives here instead of +;; in Documents and Settings. +;RMDir /r "$WINDIR\Application Data\SecondLife\cache" +; +;FunctionEnd -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Delete files in Documents and Settings\\SecondLife ; Delete files in Documents and Settings\All Users\SecondLife -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function un.DocumentsAndSettingsFolder ; Delete files in Documents and Settings\\SecondLife @@ -522,21 +537,21 @@ RMDir /r "$WINDIR\Application Data\SecondLife" FunctionEnd -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Close the program, if running. Modifies no variables. ; Allows user to bail out of uninstall process. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function un.CloseSecondLife Push $0 FindWindow $0 "Second Life" "" IntCmp $0 0 DONE - MessageBox MB_OKCANCEL "Second Life can't be uninstalled while it is already running.$\n$\nFinish what you're doing then select OK to close Second Life and continue.$\nSelect CANCEL to cancel installation." IDOK CLOSE IDCANCEL CANCEL_UNINSTALL + MessageBox MB_OKCANCEL $(CloseSecondLifeUnInstMB) IDOK CLOSE IDCANCEL CANCEL_UNINSTALL CANCEL_UNINSTALL: Quit CLOSE: - DetailPrint "Waiting for Second Life to shut down..." + DetailPrint $(CloseSecondLifeUnInstDP) SendMessage $0 16 0 0 LOOP: @@ -550,7 +565,7 @@ Function un.CloseSecondLife Return FunctionEnd -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Delete the installed files ;;; This deletes the uninstall executable, but it works ;;; because it is copied to temp directory before running @@ -558,7 +573,7 @@ FunctionEnd ;;; Note: You must list all files here, because we only ;;; want to delete our files, not things users left in the ;;; application directories. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function un.ProgramFiles ;; Remove mozilla file first so recursive directory deletion doesn't get hung up @@ -597,26 +612,26 @@ RMDir "$INSTDIR" IfFileExists "$INSTDIR" FOLDERFOUND NOFOLDER FOLDERFOUND: - MessageBox MB_YESNO "There are still files in your SecondLife program directory.$\n$\nThese are possibly files you created or moved to:$\n$INSTDIR$\n$\nDo you want to remove them?" IDNO NOFOLDER + MessageBox MB_YESNO $(DeleteProgramFilesMB) IDNO NOFOLDER RMDir /r "$INSTDIR" NOFOLDER: FunctionEnd -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Uninstall settings -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -UninstallText "This will uninstall Second Life ${VERSION_LONG} from your system." +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +UninstallText $(UninstallTextMsg) ShowUninstDetails show -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Uninstall section -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Section Uninstall ; Start with some default values. -StrCpy $INSTFLAGS "${INSTFLAGS}" +StrCpy $INSTFLAGS "" StrCpy $INSTPROG "${INSTNAME}" StrCpy $INSTEXE "${INSTEXE}" StrCpy $INSTSHORTCUT "${SHORTCUT}" @@ -629,9 +644,10 @@ SetShellVarContext all ; Make sure we're not running Call un.CloseSecondLife -; Clean up registry keys +; Clean up registry keys (these should all be !defines somewhere) DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" +DeleteRegKey HKEY_LOCAL_MACHINE "Software\Linden Research, Inc.\Installer Language" ; Clean up shortcuts Delete "$SMPROGRAMS\$INSTSHORTCUT\*.*" @@ -652,7 +668,7 @@ Call un.ProgramFiles SectionEnd ; end of uninstall section -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; (From the NSIS wiki, DK) ; GetParameterValue ; @@ -667,7 +683,7 @@ SectionEnd ; end of uninstall section ; or: ; foo.exe /S "/L=1033" /D="C:\Program Files\Foo" ; gpv "/L=" "1033" -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; !macro GetParameterValue SWITCH DEFAULT Push $0 @@ -770,7 +786,7 @@ Function un.GetProgramName !insertmacro GetParameterValue "/P=" "SecondLife" FunctionEnd -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; (From the NSIS documentation, JC) ; GetWindowsVersion ; @@ -787,8 +803,7 @@ FunctionEnd ; Call GetWindowsVersion ; Pop $R0 ; ; at this point $R0 is "NT 4.0" or whatnot -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function GetWindowsVersion Push $R0 @@ -860,3 +875,61 @@ Function GetWindowsVersion Exch $R0 FunctionEnd + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Note: to add new languages, add a language file include to the list +;; at the top of this file, add an entry to the menu and then add an +;; entry to the language ID selector below +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +Function .onInit + + ; read the language from registry (ok if not there) and set langauge menu + ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" "InstallerLanguage" + StrCpy $LANGUAGE $0 + + Push "" + Push ${LANG_ENGLISH} + Push English +# Push ${LANG_GERMAN} +# Push German +# Push ${LANG_JAPANESE} +# Push Japanese + Push ${LANG_KOREAN} + Push Korean + Push A ; A means auto count languages for the auto count to work the first empty push (Push "") must remain + LangDLL::LangDialog "Installer Language" "Please select the language of the installer" + Pop $LANGUAGE + StrCmp $LANGUAGE "cancel" 0 +2 + Abort + + ; save language in registry + WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" "InstallerLanguage" $LANGUAGE + + ; generate language ID that will be used as a command line arg + StrCmp $LANGUAGE "1042" 0 +3 + StrCpy $LANGFLAGS " -set SystemLanguage ko" + Goto EndOfFunc +# StrCmp $LANGUAGE "1041" 0 +3 +# StrCpy $LANGFLAGS " -set SystemLanguage ja" +# Goto EndOfFunc +# StrCmp $LANGUAGE "1031" 0 +3 +# StrCpy $LANGFLAGS " -set SystemLanguage de" +# Goto EndOfFunc + StrCmp $LANGUAGE "1033" 0 +3 + StrCpy $LANGFLAGS " -set SystemLanguage en-us" + Goto EndOfFunc + + EndOfFunc: + +FunctionEnd + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +Function un.onInit + + ; read language from registry and set for ininstaller + ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" "InstallerLanguage" + StrCpy $LANGUAGE $0 + +FunctionEnd + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; EOF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; \ No newline at end of file diff --git a/linden/indra/newview/installers/windows/installer_template_multilang.nsi b/linden/indra/newview/installers/windows/installer_template_multilang.nsi deleted file mode 100644 index b722a0f..0000000 --- a/linden/indra/newview/installers/windows/installer_template_multilang.nsi +++ /dev/null @@ -1,938 +0,0 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; secondlife setup.nsi -;; Copyright 2004-2007, Linden Research, Inc. -;; For info, see http://www.nullsoft.com/free/nsis/ -;; -;; NSIS 2.22 or higher required -;; Author: James Cook, Don Kjer, Callum Prentice -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; Detect NSIS compiler version -!define "NSIS${NSIS_VERSION}" -!ifdef "NSISv2.02" | "NSISv2.03" | "NSISv2.04" | "NSISv2.05" | "NSISv2.06" - ;; before 2.07 defaulted lzma to solid (whole file) - SetCompressor lzma -!else - ;; after 2.07 required /solid for whole file compression - SetCompressor /solid lzma -!endif - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Compiler flags -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -SetOverwrite on ; overwrite files -SetCompress auto ; compress iff saves space -SetDatablockOptimize off ; only saves us 0.1%, not worth it -XPStyle on ; add an XP manifest to the installer - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; Project flags -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -%%VERSION%% - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; - language files - one for each language (or flavor thereof) -;; (these files are in the same place as the nsi template but the python script generates a new nsi file in the -;; application directory so we have to add a path to these include files) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -!include "installers\windows\lang_de.nsi" -!include "installers\windows\lang_en-us.nsi" -!include "installers\windows\lang_ja.nsi" -!include "installers\windows\lang_ko.nsi" - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Tweak for different servers/builds (this placeholder is replaced by viewer_manifest.py) -%%GRID_VARS%% - -Name ${INSTNAME} - -SubCaption 0 $(LicenseSubTitleSetup) ; override "license agreement" text - -BrandingText " " ; bottom of window text -Icon res\install_icon.ico ; our custom icon -UninstallIcon res\uninstall_icon.ico ; our custom icon -WindowIcon on ; show our icon in left corner -BGGradient off ; no big background window -CRCCheck on ; make sure CRC is OK -InstProgressFlags smooth colored ; new colored smooth look -ShowInstDetails nevershow ; no details, no "show" button -SetOverwrite on ; stomp files by default -AutoCloseWindow true ; after all files install, close window - -!ifdef UPDATE -LicenseText $(LicenseDescUpdate) $(LicenseDescNext) -!else -LicenseText $(LicenseDescSetup) $(LicenseDescNext) -!endif - -LicenseData "releasenotes.txt" - -InstallDir "$PROGRAMFILES\${INSTNAME}" -InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" "" -!ifdef UPDATE -DirText $(DirectoryChooseTitle) $(DirectoryChooseUpdate) -!else -DirText $(DirectoryChooseTitle) $(DirectoryChooseSetup) -!endif - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; Variables -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Var INSTPROG -Var INSTEXE -Var INSTFLAGS -Var LANGFLAGS -Var INSTSHORTCUT - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; Sections -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Section "" ; (default section) - -SetShellVarContext all ; install for all users (if you change this, change it in the uninstall as well) - -; Start with some default values. -StrCpy $INSTFLAGS "${INSTFLAGS}" -StrCpy $INSTFLAGS "$INSTFLAGS $LANGFLAGS" -StrCpy $INSTPROG "${INSTNAME}" -StrCpy $INSTEXE "${INSTEXE}" -StrCpy $INSTSHORTCUT "${SHORTCUT}" - -IfSilent +2 -Goto NOT_SILENT - Call CheckStartupParams ; Figure out where, what and how to install. -NOT_SILENT: -Call CheckWindowsVersion ; warn if on Windows 98/ME -Call CheckIfAdministrator ; Make sure the user can install/uninstall -Call CheckIfAlreadyCurrent ; Make sure that we haven't already installed this version -Call CloseSecondLife ; Make sure we're not running -Call RemoveNSIS ; Check for old NSIS install to remove - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; Don't remove cache files during a regular install, removing the inventory cache on upgrades results in lots of damage to the servers. -;Call RemoveCacheFiles ; Installing over removes potentially corrupted - ; VFS and cache files. - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; Files -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; This placeholder is replaced by the complete list of all the files in the installer, by viewer_manifest.py -%%INSTALL_FILES%% - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; If this is a silent update, we don't need to re-create these shortcuts or registry entries. -IfSilent POST_INSTALL - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Shortcuts in start menu -CreateDirectory "$SMPROGRAMS\$INSTSHORTCUT" -SetOutPath "$INSTDIR" -CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\$INSTSHORTCUT.lnk" \ - "$INSTDIR\$INSTEXE" "$INSTFLAGS" - -!ifdef MUSEUM -CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\$INSTSHORTCUT Museum.lnk" \ - - "$INSTDIR\$INSTEXE" "$INSTFLAGS -simple" -CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\$INSTSHORTCUT Museum Spanish.lnk" \ - - "$INSTDIR\$INSTEXE" "$INSTFLAGS -simple -spanish" -!endif - -WriteINIStr "$SMPROGRAMS\$INSTSHORTCUT\SL Create Trial Account.url" \ - "InternetShortcut" "URL" \ - "http://www.secondlife.com/registration/" -WriteINIStr "$SMPROGRAMS\$INSTSHORTCUT\SL Your Account.url" \ - "InternetShortcut" "URL" \ - "http://www.secondlife.com/account/" -CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\SL Release Notes.lnk" \ - "$INSTDIR\releasenotes.txt" -CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\SL Scripting Language Help.lnk" \ - "$INSTDIR\lsl_guide.html" -CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\Uninstall $INSTSHORTCUT.lnk" \ - '"$INSTDIR\uninst.exe"' '/P="$INSTPROG"' - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Other shortcuts -SetOutPath "$INSTDIR" -CreateShortCut "$DESKTOP\$INSTSHORTCUT.lnk" "$INSTDIR\$INSTEXE" "$INSTFLAGS" -CreateShortCut "$INSTDIR\$INSTSHORTCUT.lnk" "$INSTDIR\$INSTEXE" "$INSTFLAGS" -CreateShortCut "$INSTDIR\Uninstall $INSTSHORTCUT.lnk" \ - '"$INSTDIR\uninst.exe"' '/P="$INSTPROG"' - -!ifdef MUSEUM -CreateShortCut "$DESKTOP\$INSTSHORTCUT Museum.lnk" "$INSTDIR\$INSTEXE" "$INSTFLAGS -simple" - -CreateShortCut "$DESKTOP\$INSTSHORTCUT Museum Spanish.lnk" "$INSTDIR\$INSTEXE" "$INSTFLAGS -simple -spanish" - -CreateShortCut "$INSTDIR\$INSTSHORTCUT Museum.lnk" "$INSTDIR\$INSTEXE" "$INSTFLAGS -simple" - -CreateShortCut "$INSTDIR\$INSTSHORTCUT Museum Spanish.lnk" "$INSTDIR\$INSTEXE" "$INSTFLAGS -simple -spanish" - -!endif - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Write registry -WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "" "$INSTDIR" -WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Version" "${VERSION_LONG}" -WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Flags" "$INSTFLAGS" -WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Shortcut" "$INSTSHORTCUT" -WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Exe" "$INSTEXE" -WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "DisplayName" "$INSTPROG (remove only)" -WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "UninstallString" '"$INSTDIR\uninst.exe" /P="$INSTPROG"' - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Write URL registry info -WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}" "(default)" "URL:Second Life" -WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}" "URL Protocol" "" -WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}\DefaultIcon" "" '"$INSTDIR\$INSTEXE"' -WriteRegExpandStr HKEY_CLASSES_ROOT "${URLNAME}\shell\open\command" "" '"$INSTDIR\$INSTEXE" $INSTFLAGS -url "%1"' - -Goto WRITE_UNINST - -POST_INSTALL: -; Run a post-executable script if necessary. -Call PostInstallExe - -WRITE_UNINST: -; write out uninstaller -WriteUninstaller "$INSTDIR\uninst.exe" - -; end of default section -SectionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; PostInstallExe -; This just runs any post installation scripts. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Function PostInstallExe -push $0 - ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "PostInstallExe" - ;MessageBox MB_OK '$0' - ExecWait '$0' -pop $0 -FunctionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; CheckStartupParameters -; Sets INSTFLAGS, INSTPROG, and INSTEXE. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Function CheckStartupParams -push $0 -push $R0 - - ; Look for a registry entry with info about where to update. - Call GetProgramName - pop $R0 - StrCpy $INSTPROG "$R0" - StrCpy $INSTEXE "$R0.exe" - - ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "" - ; If key doesn't exist, skip install - IfErrors ABORT - StrCpy $INSTDIR "$0" - - ; We now have a directory to install to. Get the startup parameters and shortcut as well. - ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Flags" - IfErrors +2 - StrCpy $INSTFLAGS "$0" - ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Shortcut" - IfErrors +2 - StrCpy $INSTSHORTCUT "$0" - ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Exe" - IfErrors +2 - StrCpy $INSTEXE "$0" - Goto FINISHED - -ABORT: - MessageBox MB_OK $(CheckStartupParamsMB) - Quit - -FINISHED: - ;MessageBox MB_OK "INSTPROG: $INSTPROG, INSTEXE: $INSTEXE, INSTFLAGS: $INSTFLAGS" -pop $R0 -pop $0 -FunctionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Function un.CheckStartupParams -push $0 -push $R0 - - ; Look for a registry entry with info about where to update. - Call un.GetProgramName - pop $R0 - StrCpy $INSTPROG "$R0" - StrCpy $INSTEXE "$R0.exe" - - ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "" - ; If key doesn't exist, skip install - IfErrors ABORT - StrCpy $INSTDIR "$0" - - ; We now have a directory to install to. Get the startup parameters and shortcut as well. - ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Flags" - IfErrors +2 - StrCpy $INSTFLAGS "$0" - ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Shortcut" - IfErrors +2 - StrCpy $INSTSHORTCUT "$0" - ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Exe" - IfErrors +2 - StrCpy $INSTEXE "$0" - Goto FINISHED - -ABORT: - MessageBox MB_OK $(CheckStartupParamsMB) - Quit - -FINISHED: - ;MessageBox MB_OK "INSTPROG: $INSTPROG, INSTEXE: $INSTEXE, INSTFLAGS: $INSTFLAGS" -pop $R0 -pop $0 -FunctionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; After install completes, offer readme file -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Function .onInstSuccess - MessageBox MB_YESNO \ - $(InstSuccesssQuestion) /SD IDYES IDNO NoReadme - ; Assumes SetOutPath $INSTDIR - Exec '"$INSTDIR\$INSTEXE" $INSTFLAGS' - NoReadme: -FunctionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Remove old NSIS version. Modifies no variables. -; Does NOT delete the LindenWorld directory, or any -; user files in that directory. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Function RemoveNSIS - Push $0 - ; Grab the installation directory of the old version - DetailPrint $(RemoveOldNSISVersion) - ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "" - - ; If key doesn't exist, skip uninstall - IfErrors NO_NSIS - - ; Clean up legacy beta shortcuts - Delete "$SMPROGRAMS\Second Life Beta.lnk" - Delete "$DESKTOP\Second Life Beta.lnk" - Delete "$SMPROGRAMS\Second Life.lnk" - - ; Clean up old newview.exe file - Delete "$INSTDIR\newview.exe" - - ; Intentionally don't delete the stuff in - ; Documents and Settings, so we keep the user's settings - - NO_NSIS: - Pop $0 -FunctionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Make sure we're not on Windows 98 / ME -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Function CheckWindowsVersion - DetailPrint "Checking Windows version..." - Call GetWindowsVersion - Pop $R0 - ; Just get first two characters, ignore 4.0 part of "NT 4.0" - StrCpy $R0 $R0 2 - ; Blacklist certain OS versions - StrCmp $R0 "95" win_ver_bad - StrCmp $R0 "98" win_ver_bad - StrCmp $R0 "ME" win_ver_bad - StrCmp $R0 "NT" win_ver_bad - Return -win_ver_bad: - MessageBox MB_YESNO $(CheckWindowsVersionMB) IDNO win_ver_abort - Return -win_ver_abort: - Quit -FunctionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Make sure the user can install/uninstall -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Function CheckIfAdministrator - DetailPrint $(CheckAdministratorInstDP) - UserInfo::GetAccountType - Pop $R0 - StrCmp $R0 "Admin" is_admin - MessageBox MB_OK $(CheckAdministratorInstMB) - Quit -is_admin: - Return -FunctionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Function un.CheckIfAdministrator - DetailPrint $(CheckAdministratorUnInstDP) - UserInfo::GetAccountType - Pop $R0 - StrCmp $R0 "Admin" is_admin - MessageBox MB_OK $(CheckAdministratorUnInstMB) - Quit -is_admin: - Return -FunctionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Checks to see if the current version has already been installed (according to the registry). -; If it has, allow user to bail out of install process. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Function CheckIfAlreadyCurrent - Push $0 - ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Version" - StrCmp $0 ${VERSION_LONG} 0 DONE - MessageBox MB_OKCANCEL $(CheckIfCurrentMB) /SD IDOK IDOK DONE - Quit - - DONE: - Pop $0 - Return -FunctionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Close the program, if running. Modifies no variables. -; Allows user to bail out of install process. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Function CloseSecondLife - Push $0 - FindWindow $0 "Second Life" "" - IntCmp $0 0 DONE - MessageBox MB_OKCANCEL $(CloseSecondLifeInstMB) IDOK CLOSE IDCANCEL CANCEL_INSTALL - - CANCEL_INSTALL: - Quit - - CLOSE: - DetailPrint $(CloseSecondLifeInstDP) - SendMessage $0 16 0 0 - - LOOP: - FindWindow $0 "Second Life" "" - IntCmp $0 0 DONE - Sleep 500 - Goto LOOP - - DONE: - Pop $0 - Return -FunctionEnd - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Delete files in Documents and Settings\\SecondLife\cache -; Delete files in Documents and Settings\All Users\SecondLife\cache -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;Function RemoveCacheFiles -; -;; Delete files in Documents and Settings\\SecondLife -;Push $0 -;Push $1 -;Push $2 -; DetailPrint $(RemoveCacheFilesDP) -; -; StrCpy $0 0 ; Index number used to iterate via EnumRegKey -; -; LOOP: -; EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0 -; StrCmp $1 "" DONE ; no more users -; -; ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath" -; StrCmp $2 "" CONTINUE 0 ; "ProfileImagePath" value is missing -; -; ; Required since ProfileImagePath is of type REG_EXPAND_SZ -; ExpandEnvStrings $2 $2 -; -; ; When explicitly uninstalling, everything goes away -; RMDir /r "$2\Application Data\SecondLife\cache" -; -; CONTINUE: -; IntOp $0 $0 + 1 -; Goto LOOP -; DONE: -;Pop $2 -;Pop $1 -;Pop $0 -; -;; Delete files in Documents and Settings\All Users\SecondLife -;Push $0 -; ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData" -; StrCmp $0 "" +2 -; RMDir /r "$0\SecondLife\cache" -;Pop $0 -; -;; Delete filse in C:\Windows\Application Data\SecondLife -;; If the user is running on a pre-NT system, Application Data lives here instead of -;; in Documents and Settings. -;RMDir /r "$WINDIR\Application Data\SecondLife\cache" -; -;FunctionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Delete files in Documents and Settings\\SecondLife -; Delete files in Documents and Settings\All Users\SecondLife -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;Function un.DocumentsAndSettingsFolder -; -;; Delete files in Documents and Settings\\SecondLife -;Push $0 -;Push $1 -;Push $2 -; -; DetailPrint "Deleting files in Documents and Settings folder" -; -; StrCpy $0 0 ; Index number used to iterate via EnumRegKey -; -; LOOP: -; EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0 -; StrCmp $1 "" DONE ; no more users -; -; ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath" -; StrCmp $2 "" CONTINUE 0 ; "ProfileImagePath" value is missing -; -; ; Required since ProfileImagePath is of type REG_EXPAND_SZ -; ExpandEnvStrings $2 $2 -; -; ; If uninstalling a normal install remove everything -; ; Otherwise (preview/dmz etc) just remove cache -; StrCmp $INSTFLAGS "" RM_ALL RM_CACHE -; RM_ALL: -; RMDir /r "$2\Application Data\SecondLife" -; GoTo CONTINUE -; RM_CACHE: -; RMDir /r "$2\Application Data\SecondLife\Cache" -; -; CONTINUE: -; IntOp $0 $0 + 1 -; Goto LOOP -; DONE: -; -;Pop $2 -;Pop $1 -;Pop $0 -; -;; Delete files in Documents and Settings\All Users\SecondLife -;Push $0 -; ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData" -; StrCmp $0 "" +2 -; RMDir /r "$0\SecondLife" -;Pop $0 -; -;; Delete filse in C:\Windows\Application Data\SecondLife -;; If the user is running on a pre-NT system, Application Data lives here instead of -;; in Documents and Settings. -;RMDir /r "$WINDIR\Application Data\SecondLife" -; -;FunctionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Close the program, if running. Modifies no variables. -; Allows user to bail out of uninstall process. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Function un.CloseSecondLife - Push $0 - FindWindow $0 "Second Life" "" - IntCmp $0 0 DONE - MessageBox MB_OKCANCEL $(CloseSecondLifeUnInstMB) IDOK CLOSE IDCANCEL CANCEL_UNINSTALL - - CANCEL_UNINSTALL: - Quit - - CLOSE: - DetailPrint $(CloseSecondLifeUnInstDP) - SendMessage $0 16 0 0 - - LOOP: - FindWindow $0 "Second Life" "" - IntCmp $0 0 DONE - Sleep 500 - Goto LOOP - - DONE: - Pop $0 - Return -FunctionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; Delete the installed files -;;; This deletes the uninstall executable, but it works -;;; because it is copied to temp directory before running -;;; -;;; Note: You must list all files here, because we only -;;; want to delete our files, not things users left in the -;;; application directories. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Function un.ProgramFiles - -;; Remove mozilla file first so recursive directory deletion doesn't get hung up -Delete "$INSTDIR\app_settings\mozilla\components" - -;; This placeholder is replaced by the complete list of files to uninstall by viewer_manifest.py -%%DELETE_FILES%% - -;; Optional/obsolete files. Delete won't fail if they don't exist. -Delete "$INSTDIR\dronesettings.ini" -Delete "$INSTDIR\message_template.msg" -Delete "$INSTDIR\newview.pdb" -Delete "$INSTDIR\newview.map" -Delete "$INSTDIR\SecondLife.pdb" -Delete "$INSTDIR\SecondLife.map" -Delete "$INSTDIR\comm.dat" -Delete "$INSTDIR\*.glsl" -Delete "$INSTDIR\motions\*.lla" -Delete "$INSTDIR\trial\*.html" -Delete "$INSTDIR\newview.exe" -;; Remove entire help directory -Delete "$INSTDIR\help\Advanced\*" -RMDir "$INSTDIR\help\Advanced" -Delete "$INSTDIR\help\basics\*" -RMDir "$INSTDIR\help\basics" -Delete "$INSTDIR\help\Concepts\*" -RMDir "$INSTDIR\help\Concepts" -Delete "$INSTDIR\help\welcome\*" -RMDir "$INSTDIR\help\welcome" -Delete "$INSTDIR\help\*" -RMDir "$INSTDIR\help" - -Delete "$INSTDIR\uninst.exe" -RMDir "$INSTDIR" - -IfFileExists "$INSTDIR" FOLDERFOUND NOFOLDER - -FOLDERFOUND: - MessageBox MB_YESNO $(DeleteProgramFilesMB) IDNO NOFOLDER - RMDir /r "$INSTDIR" - -NOFOLDER: - -FunctionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; Uninstall settings -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -UninstallText $(UninstallTextMsg) -ShowUninstDetails show - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; Uninstall section -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Section Uninstall - -; Start with some default values. -StrCpy $INSTFLAGS "" -StrCpy $INSTPROG "${INSTNAME}" -StrCpy $INSTEXE "${INSTEXE}" -StrCpy $INSTSHORTCUT "${SHORTCUT}" -Call un.CheckStartupParams ; Figure out where, what and how to uninstall. -Call un.CheckIfAdministrator ; Make sure the user can install/uninstall - -; uninstall for all users (if you change this, change it in the install as well) -SetShellVarContext all - -; Make sure we're not running -Call un.CloseSecondLife - -; Clean up registry keys -DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" -DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" - -; Clean up shortcuts -Delete "$SMPROGRAMS\$INSTSHORTCUT\*.*" -RMDir "$SMPROGRAMS\$INSTSHORTCUT" - -Delete "$DESKTOP\$INSTSHORTCUT.lnk" -Delete "$INSTDIR\$INSTSHORTCUT.lnk" -Delete "$INSTDIR\Uninstall $INSTSHORTCUT.lnk" - -; Clean up cache and log files. -; Leave them in-place for non AGNI installs. - -!ifdef UNINSTALL_SETTINGS -Call un.DocumentsAndSettingsFolder -!endif - -Call un.ProgramFiles - -SectionEnd ; end of uninstall section - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; (From the NSIS wiki, DK) -; GetParameterValue -; -; Usage: -; !insertmacro GetParameterValue "/L=" "1033" -; pop $R0 -; -; Returns on top of stack -; -; Example command lines: -; foo.exe /S /L=1033 /D=C:\Program Files\Foo -; or: -; foo.exe /S "/L=1033" /D="C:\Program Files\Foo" -; gpv "/L=" "1033" -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - !macro GetParameterValue SWITCH DEFAULT - Push $0 - Push $1 - Push $2 - Push $3 - Push $4 - - ;$CMDLINE='"My Setup\Setup.exe" /L=1033 /S' - Push "$CMDLINE" - Push '${SWITCH}"' - !insertmacro StrStr - Pop $0 - StrCmp "$0" "" gpv_notquoted - ;$0='/L="1033" /S' - StrLen $2 "$0" - Strlen $1 "${SWITCH}" - IntOp $1 $1 + 1 - StrCpy $0 "$0" $2 $1 - ;$0='1033" /S' - Push "$0" - Push '"' - !insertmacro StrStr - Pop $1 - StrLen $2 "$0" - StrLen $3 "$1" - IntOp $4 $2 - $3 - StrCpy $0 $0 $4 0 - Goto gpv_done - - gpv_notquoted: - Push "$CMDLINE" - Push "${SWITCH}" - !insertmacro StrStr - Pop $0 - StrCmp "$0" "" gpv_done - ;$0='/L="1033" /S' - StrLen $2 "$0" - Strlen $1 "${SWITCH}" - StrCpy $0 "$0" $2 $1 - ;$0=1033 /S' - Push "$0" - Push ' ' - !insertmacro StrStr - Pop $1 - StrLen $2 "$0" - StrLen $3 "$1" - IntOp $4 $2 - $3 - StrCpy $0 $0 $4 0 - Goto gpv_done - - gpv_done: - StrCmp "$0" "" 0 +2 - StrCpy $0 "${DEFAULT}" - - Pop $4 - Pop $3 - Pop $2 - Pop $1 - Exch $0 - !macroend - -; And I had to modify StrStr a tiny bit. -; Possible upgrade switch the goto's to use ${__LINE__} - -!macro STRSTR - Exch $R1 ; st=haystack,old$R1, $R1=needle - Exch ; st=old$R1,haystack - Exch $R2 ; st=old$R1,old$R2, $R2=haystack - Push $R3 - Push $R4 - Push $R5 - StrLen $R3 $R1 - StrCpy $R4 0 - ; $R1=needle - ; $R2=haystack - ; $R3=len(needle) - ; $R4=cnt - ; $R5=tmp - ; loop; - StrCpy $R5 $R2 $R3 $R4 - StrCmp $R5 $R1 +4 - StrCmp $R5 "" +3 - IntOp $R4 $R4 + 1 - Goto -4 - ; done; - StrCpy $R1 $R2 "" $R4 - Pop $R5 - Pop $R4 - Pop $R3 - Pop $R2 - Exch $R1 -!macroend - -Function GetProgramName - !insertmacro GetParameterValue "/P=" "SecondLife" -FunctionEnd - -Function un.GetProgramName - !insertmacro GetParameterValue "/P=" "SecondLife" -FunctionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; (From the NSIS documentation, JC) -; GetWindowsVersion -; -; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/ -; Updated by Joost Verburg -; -; Returns on top of stack -; -; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003) -; or -; '' (Unknown Windows Version) -; -; Usage: -; Call GetWindowsVersion -; Pop $R0 -; ; at this point $R0 is "NT 4.0" or whatnot -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Function GetWindowsVersion - - Push $R0 - Push $R1 - - ReadRegStr $R0 HKLM \ - "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion - - IfErrors 0 lbl_winnt - - ; we are not NT - ReadRegStr $R0 HKLM \ - "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber - - StrCpy $R1 $R0 1 - StrCmp $R1 '4' 0 lbl_error - - StrCpy $R1 $R0 3 - - StrCmp $R1 '4.0' lbl_win32_95 - StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98 - - lbl_win32_95: - StrCpy $R0 '95' - Goto lbl_done - - lbl_win32_98: - StrCpy $R0 '98' - Goto lbl_done - - lbl_win32_ME: - StrCpy $R0 'ME' - Goto lbl_done - - lbl_winnt: - - StrCpy $R1 $R0 1 - - StrCmp $R1 '3' lbl_winnt_x - StrCmp $R1 '4' lbl_winnt_x - - StrCpy $R1 $R0 3 - - StrCmp $R1 '5.0' lbl_winnt_2000 - StrCmp $R1 '5.1' lbl_winnt_XP - StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error - - lbl_winnt_x: - StrCpy $R0 "NT $R0" 6 - Goto lbl_done - - lbl_winnt_2000: - Strcpy $R0 '2000' - Goto lbl_done - - lbl_winnt_XP: - Strcpy $R0 'XP' - Goto lbl_done - - lbl_winnt_2003: - Strcpy $R0 '2003' - Goto lbl_done - - lbl_error: - Strcpy $R0 '' - lbl_done: - - Pop $R1 - Exch $R0 - -FunctionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -!define LANGUAGE_SELECTION_REGISTRY_ROOT "HKCU" -!define LANGUAGE_SELECTION_REGISTRY_KEY "Software\Linden Research, Inc." -!define LANGUAGE_SELECTION_REGISTRY_VALUENAME "Installer Language" - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Note: to add new languages, add an entry to the menu -;; and then add an entry to the language ID selector below -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Function .onInit - - ; read the language from registry (ok if not there) and set langauge menu - ReadRegStr $0 '${LANGUAGE_SELECTION_REGISTRY_ROOT}' '${LANGUAGE_SELECTION_REGISTRY_KEY}' '${LANGUAGE_SELECTION_REGISTRY_VALUENAME}' - StrCpy $LANGUAGE $0 - - Push "" - Push ${LANG_ENGLISH} - Push English - Push ${LANG_GERMAN} - Push German - Push ${LANG_JAPANESE} - Push Japanese - Push ${LANG_KOREAN} - Push Korean - Push A ; A means auto count languages for the auto count to work the first empty push (Push "") must remain - LangDLL::LangDialog "Installer Language" "Please select the language of the installer" - Pop $LANGUAGE - StrCmp $LANGUAGE "cancel" 0 +2 - Abort - - ; save language in registry - WriteRegStr '${LANGUAGE_SELECTION_REGISTRY_ROOT}' '${LANGUAGE_SELECTION_REGISTRY_KEY}' '${LANGUAGE_SELECTION_REGISTRY_VALUENAME}' $LANGUAGE - - ; generate language ID that will be used as a command line arg - StrCmp $LANGUAGE "1042" 0 +3 - StrCpy $LANGFLAGS " -set SystemLanguage ko" - Goto EndOfFunc - StrCmp $LANGUAGE "1041" 0 +3 - StrCpy $LANGFLAGS " -set SystemLanguage ja" - Goto EndOfFunc - StrCmp $LANGUAGE "1031" 0 +3 - StrCpy $LANGFLAGS " -set SystemLanguage de" - Goto EndOfFunc - StrCmp $LANGUAGE "1033" 0 +3 - StrCpy $LANGFLAGS " -set SystemLanguage en-us" - Goto EndOfFunc - - EndOfFunc: - -FunctionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Function un.onInit - - ; read language from registry and set for ininstaller - ReadRegStr $0 '${LANGUAGE_SELECTION_REGISTRY_ROOT}' '${LANGUAGE_SELECTION_REGISTRY_KEY}' '${LANGUAGE_SELECTION_REGISTRY_VALUENAME}' - StrCpy $LANGUAGE $0 - -FunctionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; EOF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; \ No newline at end of file diff --git a/linden/indra/newview/licenses-linux.txt b/linden/indra/newview/licenses-linux.txt index a0dc048..1892b81 100644 --- a/linden/indra/newview/licenses-linux.txt +++ b/linden/indra/newview/licenses-linux.txt @@ -514,3 +514,36 @@ jloup@gzip.org Mark Adler madler@alumni.caltech.edu + +================================= +tcmalloc/Google perftools license +================================= + +Copyright (c) 2005, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/linden/indra/newview/linux_tools/wrapper.sh b/linden/indra/newview/linux_tools/wrapper.sh index 5f128e8..048aaf6 100755 --- a/linden/indra/newview/linux_tools/wrapper.sh +++ b/linden/indra/newview/linux_tools/wrapper.sh @@ -33,6 +33,13 @@ export LL_GL_BASICEXT=x ## LL_GL_BLACKLIST which solves your problems. #export LL_GL_BLACKLIST=abcdefghijklmno +## - For advanced debugging cases, you can run the viewer under the +## control of another program, such as strace, gdb, or valgrind. If +## you're building your own viewer, bear in mind that the executable +## in the bin directory will be stripped: you should replace it with +## an unstripped binary before you run. +#export LL_WRAPPER='valgrind --log-file=secondlife.vg --leak-check=full --suppressions=/usr/lib/valgrind/glibc-2.5.supp --suppressions=secondlife-i686.supp' + ## - Avoids an often-buggy X feature that doesn't really benefit us anyway. export SDL_VIDEO_X11_DGAMOUSE=0 @@ -41,7 +48,7 @@ export SDL_VIDEO_X11_DGAMOUSE=0 RUN_PATH=`dirname "$0" || echo .` cd "${RUN_PATH}" -LD_LIBRARY_PATH="`pwd`"/lib:"`pwd`"/app_settings/mozilla-runtime-linux-i686:"${LD_LIBRARY_PATH}" bin/do-not-directly-run-secondlife-bin `cat gridargs.dat` $@ | cat +LD_LIBRARY_PATH="`pwd`"/lib:"`pwd`"/app_settings/mozilla-runtime-linux-i686:"${LD_LIBRARY_PATH}" $LL_WRAPPER bin/do-not-directly-run-secondlife-bin `cat gridargs.dat` $@ | cat echo echo '*********************************************************' diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp index ab51120..83b8c0c 100644 --- a/linden/indra/newview/llagent.cpp +++ b/linden/indra/newview/llagent.cpp @@ -4983,7 +4983,7 @@ BOOL LLAgent::allowOperation(PermissionBit op, const LLPermissions& perm, U64 group_proxy_power, U8 god_minimum) -{ + { // Check god level. if (getGodLevel() >= god_minimum) return TRUE; diff --git a/linden/indra/newview/llagent.h b/linden/indra/newview/llagent.h index af593e0..e375227 100644 --- a/linden/indra/newview/llagent.h +++ b/linden/indra/newview/llagent.h @@ -851,12 +851,12 @@ private: class createStandardWearablesAllDoneCallback : public LLRefCount { - public: + protected: ~createStandardWearablesAllDoneCallback(); }; class sendAgentWearablesUpdateCallback : public LLRefCount { - public: + protected: ~sendAgentWearablesUpdateCallback(); }; @@ -886,7 +886,6 @@ private: S32 index, LLWearable* wearable, U32 todo = CALL_NONE); - ~addWearableToAgentInventoryCallback() {}; virtual void fire(const LLUUID& inv_item); private: diff --git a/linden/indra/newview/llcallingcard.cpp b/linden/indra/newview/llcallingcard.cpp index 3e00f40..22a7f20 100644 --- a/linden/indra/newview/llcallingcard.cpp +++ b/linden/indra/newview/llcallingcard.cpp @@ -130,6 +130,7 @@ LLAvatarTracker::~LLAvatarTracker() { deleteTrackingData(); std::for_each(mObservers.begin(), mObservers.end(), DeletePointer()); + std::for_each(mBuddyInfo.begin(), mBuddyInfo.end(), DeletePairedPointer()); } void LLAvatarTracker::track(const LLUUID& avatar_id, const std::string& name) diff --git a/linden/indra/newview/llchatbar.cpp b/linden/indra/newview/llchatbar.cpp index a6feac7..539c935 100644 --- a/linden/indra/newview/llchatbar.cpp +++ b/linden/indra/newview/llchatbar.cpp @@ -118,8 +118,8 @@ LLChatBar::LLChatBar(const std::string& name, const LLRect& rect) mInputEditor->setRevertOnEsc( FALSE ); mInputEditor->setIgnoreTab(TRUE); mInputEditor->setPassDelete(TRUE); - mInputEditor->setMaxTextLength(1023); + mInputEditor->setEnableLineHistory(TRUE); } // Build the list of gestures @@ -446,6 +446,8 @@ void LLChatBar::sendChat( EChatType type ) if (!text.empty()) { + // store sent line in history, duplicates will get filtered + mInputEditor->updateHistory(); // Check if this is destined for another channel S32 channel = 0; stripChannelNumber(text, &channel); diff --git a/linden/indra/newview/llcontroldef.cpp b/linden/indra/newview/llcontroldef.cpp index 01d7edf..2b394e9 100644 --- a/linden/indra/newview/llcontroldef.cpp +++ b/linden/indra/newview/llcontroldef.cpp @@ -742,6 +742,9 @@ void declare_settings() // Threading gSavedSettings.declareBOOL("RunMultipleThreads", FALSE, "If TRUE keep background threads active during render"); + // Cooperative Multitasking + gSavedSettings.declareS32("BackgroundYieldTime", 40, "Amount of time to yield every frame to other applications when SL is not the foreground window (milliseconds)"); + // Camera control gSavedSettings.declareBOOL("AutoPilotLocksCamera", FALSE, "Keep camera position locked when avatar walks to selected position"); //gSavedSettings.declareBOOL("AvatarLooksAtCamera", TRUE, "[NOT USED]"); @@ -1143,10 +1146,12 @@ void declare_settings() // Time in seconds. gSavedSettings.declareF32("NotifyTipDuration", 4.f, "Length of time that notification tips stay on screen (seconds)"); - gSavedSettings.declareBOOL("NotifyMoneyChange", TRUE, "Pop up notifications for all L$ transactions"); + gSavedSettings.declareBOOL("ShowNewInventory", TRUE, - "Automatic Previews of new notecards/textures/landmarks"); + "Automatically views new notecards/textures/landmarks"); + gSavedSettings.declareBOOL("AutoAcceptNewInventory", FALSE, + "Automatically accept new notecards/textures/landmarks"); // Bitfield // 1 = by date @@ -1245,6 +1250,7 @@ void declare_settings() // CP: making this TRUE by default since there is no internal Web browser // now and other components may interrogate this setting gSavedSettings.declareBOOL("UseExternalBrowser", TRUE, "[NOT USED]"); + gSavedSettings.declareBOOL("CookiesEnabled", TRUE, "Accept cookies from Web sites?"); // browser home page gSavedSettings.declareString("BrowserHomePage", "http://www.secondlife.com", "[NOT USED]"); diff --git a/linden/indra/newview/llcubemap.h b/linden/indra/newview/llcubemap.h index d75d6e7..911248f 100644 --- a/linden/indra/newview/llcubemap.h +++ b/linden/indra/newview/llcubemap.h @@ -41,7 +41,6 @@ class LLCubeMap : public LLRefCount { public: LLCubeMap(); - ~LLCubeMap(); void init(const std::vector >& rawimages); void initGL(); void initRawData(const std::vector >& rawimages); @@ -66,6 +65,7 @@ public: void destroyGL(); protected: + ~LLCubeMap(); LLGLenum mTargets[6]; LLPointer mImages[6]; LLPointer mRawImages[6]; diff --git a/linden/indra/newview/lldrawable.h b/linden/indra/newview/lldrawable.h index 3bb5525..7429292 100644 --- a/linden/indra/newview/lldrawable.h +++ b/linden/indra/newview/lldrawable.h @@ -199,7 +199,7 @@ public: static void cleanupDeadDrawables(); protected: - virtual ~LLDrawable() { destroy(); } + ~LLDrawable() { destroy(); } void moveUpdatePipeline(BOOL moved); void updatePartition(); BOOL updateMoveDamped(); diff --git a/linden/indra/newview/llflexibleobject.cpp b/linden/indra/newview/llflexibleobject.cpp index d4080c5..0dce348 100644 --- a/linden/indra/newview/llflexibleobject.cpp +++ b/linden/indra/newview/llflexibleobject.cpp @@ -62,6 +62,7 @@ LLVolumeImplFlexible::LLVolumeImplFlexible(LLViewerObject* vo, LLFlexibleObjectD mInitializedRes = -1; mSimulateRes = 0; mFrameNum = 0; + mRenderRes = 1; }//----------------------------------------------- LLVector3 LLVolumeImplFlexible::getFramePosition() const @@ -253,7 +254,7 @@ BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F6 { if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE)) { - return TRUE; + return FALSE; // (we are not initialized or updated) } LLFastTimer ftm(LLFastTimer::FTM_FLEXIBLE_UPDATE); @@ -261,7 +262,7 @@ BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F6 if (mVO->mDrawable.isNull()) { // Don't do anything until we have a drawable - return TRUE; + return FALSE; // (we are not initialized or updated) } //flexible objects never go static @@ -346,8 +347,13 @@ void LLVolumeImplFlexible::doFlexibleUpdate() if (mSimulateRes == 0) { mVO->markForUpdate(TRUE); - doIdleUpdate(gAgent, *gWorldp, 0.0); + if (!doIdleUpdate(gAgent, *gWorldp, 0.0)) + { + return; // we did not get updated or initialized, proceeding without can be dangerous + } } + + llassert_always(mInitialized); S32 num_sections = 1 << mSimulateRes; diff --git a/linden/indra/newview/llfloateravatarinfo.cpp b/linden/indra/newview/llfloateravatarinfo.cpp index 2245d31..c4b8167 100644 --- a/linden/indra/newview/llfloateravatarinfo.cpp +++ b/linden/indra/newview/llfloateravatarinfo.cpp @@ -267,6 +267,12 @@ void LLFloaterAvatarInfo::draw() LLFloater::draw(); } +// virtual +BOOL LLFloaterAvatarInfo::canClose() +{ + return mPanelAvatarp && mPanelAvatarp->canClose(); +} + LLFloaterAvatarInfo* LLFloaterAvatarInfo::getInstance(const LLUUID &id) { return gAvatarInfoInstances.getIfThere(gAgentID); diff --git a/linden/indra/newview/llfloateravatarinfo.h b/linden/indra/newview/llfloateravatarinfo.h index 7ca6882..eedbfba 100644 --- a/linden/indra/newview/llfloateravatarinfo.h +++ b/linden/indra/newview/llfloateravatarinfo.h @@ -69,6 +69,8 @@ public: /*virtual*/ void draw(); + /*virtual*/ BOOL canClose(); + /*virtual*/ void loadAsset(); /*virtual*/ EAssetStatus getAssetStatus(); diff --git a/linden/indra/newview/llfloaterbuy.cpp b/linden/indra/newview/llfloaterbuy.cpp index be52084..4070ea7 100644 --- a/linden/indra/newview/llfloaterbuy.cpp +++ b/linden/indra/newview/llfloaterbuy.cpp @@ -59,7 +59,7 @@ LLFloaterBuy::LLFloaterBuy() childSetAction("cancel_btn", onClickCancel, this); childSetAction("buy_btn", onClickBuy, this); - setDefaultBtn("buy_btn"); + setDefaultBtn("cancel_btn"); // to avoid accidental buy (SL-43130) } LLFloaterBuy::~LLFloaterBuy() diff --git a/linden/indra/newview/llfloaterbuycontents.cpp b/linden/indra/newview/llfloaterbuycontents.cpp index 5e8d921..7288b8d 100644 --- a/linden/indra/newview/llfloaterbuycontents.cpp +++ b/linden/indra/newview/llfloaterbuycontents.cpp @@ -64,7 +64,7 @@ LLFloaterBuyContents::LLFloaterBuyContents() childDisable("buy_btn"); childDisable("wear_check"); - setDefaultBtn("buy_btn"); + setDefaultBtn("cancel_btn"); // to avoid accidental buy (SL-43130) } LLFloaterBuyContents::~LLFloaterBuyContents() diff --git a/linden/indra/newview/llfloatergesture.cpp b/linden/indra/newview/llfloatergesture.cpp index 5b191e4..9746787 100644 --- a/linden/indra/newview/llfloatergesture.cpp +++ b/linden/indra/newview/llfloatergesture.cpp @@ -352,7 +352,6 @@ public: { mTitle = title; } - ~GestureShowCallback() {} void fire(const LLUUID &inv_item) { LLPreviewGesture::show(mTitle.c_str(), inv_item, LLUUID::null); diff --git a/linden/indra/newview/llfloaterinspect.cpp b/linden/indra/newview/llfloaterinspect.cpp index 80da7b6..4899649 100644 --- a/linden/indra/newview/llfloaterinspect.cpp +++ b/linden/indra/newview/llfloaterinspect.cpp @@ -1,3 +1,31 @@ +/** + * @file llfloaterinspect.cpp + * @brief Floater for object inspection tool + * + * Copyright (c) 2002-2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + #include "llviewerprecompiledheaders.h" #include "llfloateravatarinfo.h" #include "llfloaterinspect.h" diff --git a/linden/indra/newview/llfloaterpreference.cpp b/linden/indra/newview/llfloaterpreference.cpp index 963c268..f7392c4 100644 --- a/linden/indra/newview/llfloaterpreference.cpp +++ b/linden/indra/newview/llfloaterpreference.cpp @@ -52,7 +52,7 @@ #include "llpanelgeneral.h" #include "llpanelinput.h" #include "llpanelmsgs.h" -//#include "llpanelweb.h" +#include "llpanelweb.h" #include "llprefschat.h" #include "llprefsim.h" #include "llresizehandle.h" @@ -63,7 +63,6 @@ #include "llviewernetwork.h" #include "llvieweruictrlfactory.h" #include "llviewerwindow.h" -//#include "viewer.h" #include "llkeyboard.h" #include "llscrollcontainer.h" @@ -119,6 +118,12 @@ LLPreferenceCore::LLPreferenceCore(LLTabContainerCommon* tab_container, LLButton mTabContainer->addTabPanel(mNetworkPanel, mNetworkPanel->getLabel(), FALSE, onTabChanged, mTabContainer); mNetworkPanel->setDefaultBtn(default_btn); + #if LL_LIBXUL_ENABLED + mWebPanel = new LLPanelWeb(); + mTabContainer->addTabPanel(mWebPanel, mWebPanel->getLabel(), FALSE, onTabChanged, mTabContainer); + mWebPanel->setDefaultBtn(default_btn); + #endif + mDisplayPanel = new LLPanelDisplay(); mTabContainer->addTabPanel(mDisplayPanel, mDisplayPanel->getLabel(), FALSE, onTabChanged, mTabContainer); mDisplayPanel->setDefaultBtn(default_btn); @@ -144,16 +149,10 @@ LLPreferenceCore::LLPreferenceCore(LLTabContainerCommon* tab_container, LLButton mPrefsIM->getPanel()->setDefaultBtn(default_btn); mMsgPanel = new LLPanelMsgs(); - gUICtrlFactory->buildPanel(mMsgPanel, "panel_settings_msgbox.xml"); mTabContainer->addTabPanel(mMsgPanel, mMsgPanel->getLabel(), FALSE, onTabChanged, mTabContainer); mMsgPanel->setDefaultBtn(default_btn); mTabContainer->selectTab(gSavedSettings.getS32("LastPrefTab")); - -// Web prefs removed from Loopy build -// mWebPanel = new LLPanelWeb(); -// gUICtrlFactory->buildPanel(mWebPanel, "panel_settings_web.xml"); -// addTabPanel(mWebPanel, "Web", FALSE, onTabChanged, this); } LLPreferenceCore::~LLPreferenceCore() @@ -208,11 +207,13 @@ LLPreferenceCore::~LLPreferenceCore() delete mMsgPanel; mMsgPanel = NULL; } - //if (mWebPanel) - //{ - // delete mWebPanel; - // mWebPanel = NULL; - //} + #if LL_LIBXUL_ENABLED + if (mWebPanel) + { + delete mWebPanel; + mWebPanel = NULL; + } + #endif } @@ -228,7 +229,9 @@ void LLPreferenceCore::apply() mPrefsChat->apply(); mPrefsIM->apply(); mMsgPanel->apply(); -// mWebPanel->apply(); + #if LL_LIBXUL_ENABLED + mWebPanel->apply(); + #endif } @@ -244,7 +247,9 @@ void LLPreferenceCore::cancel() mPrefsChat->cancel(); mPrefsIM->cancel(); mMsgPanel->cancel(); -// mWebPanel->cancel(); + #if LL_LIBXUL_ENABLED + mWebPanel->cancel(); + #endif } // static @@ -311,6 +316,7 @@ BOOL LLFloaterPreference::postBuild() LLFloaterPreference::~LLFloaterPreference() { sInstance = NULL; + delete mPreferenceCore; } diff --git a/linden/indra/newview/llfloaterpreference.h b/linden/indra/newview/llfloaterpreference.h index 7a6789f..1823069 100644 --- a/linden/indra/newview/llfloaterpreference.h +++ b/linden/indra/newview/llfloaterpreference.h @@ -46,11 +46,11 @@ class LLPanelDisplay3; class LLPanelAudioPrefs; class LLPanelDebug; class LLPanelNetwork; +class LLPanelWeb; class LLMessageSystem; class LLPrefsChat; class LLPrefsIM; class LLPanelMsgs; -//class LLPanelWeb; // Web prefs removed from Loopy build class LLScrollListCtrl; class LLPreferenceCore @@ -85,7 +85,7 @@ private: LLPrefsChat *mPrefsChat; LLPrefsIM *mPrefsIM; LLPanelMsgs *mMsgPanel; -// LLPanelWeb* mWebPanel; + LLPanelWeb *mWebPanel; }; // Floater to control preferences (display, audio, bandwidth, general. diff --git a/linden/indra/newview/llfolderview.cpp b/linden/indra/newview/llfolderview.cpp index ff0ad3f..bd5be8e 100644 --- a/linden/indra/newview/llfolderview.cpp +++ b/linden/indra/newview/llfolderview.cpp @@ -1921,7 +1921,7 @@ void LLFolderViewFolder::requestArrange(BOOL include_descendants) { mLastArrangeGeneration = -1; // flag all items up to root - if (mParentFolder && !mParentFolder->needsArrange()) + if (mParentFolder) { mParentFolder->requestArrange(); } @@ -4282,7 +4282,8 @@ void LLFolderView::idle(void* user_data) { self->scrollToShowItem(self->mSelectedItems.back()); // continue scrolling until animated layout change is done - if (!self->needsArrange() || !self->isInVisibleChain()) + if (self->getCompletedFilterGeneration() >= self->mFilter.getMinRequiredGeneration() && + (!self->needsArrange() || !self->isInVisibleChain())) { self->mNeedsScroll = FALSE; } diff --git a/linden/indra/newview/llgroupmgr.cpp b/linden/indra/newview/llgroupmgr.cpp index fbdcf81..8e49749 100644 --- a/linden/indra/newview/llgroupmgr.cpp +++ b/linden/indra/newview/llgroupmgr.cpp @@ -49,6 +49,7 @@ #include "llviewerwindow.h" #include "llfloaterdirectory.h" #include "llfloatergroupinfo.h" +#include "lluictrlfactory.h" LLGroupMgr sGroupMgr; // use local instance so that it gets cleaned up on application exit LLGroupMgr* gGroupMgr = &sGroupMgr; @@ -1729,21 +1730,28 @@ void LLGroupMgr::cancelGroupRoleChanges(const LLUUID& group_id) //static bool LLGroupMgr::parseRoleActions(const LLString& xml_filename) { - LLXmlTree xml_tree; - LLString xml_file = LLUI::locateSkin(xml_filename); - BOOL success = xml_tree.parseFile(xml_file, TRUE ); - LLXmlTreeNode* root = xml_tree.getRoot(); + LLXMLNodePtr root; + + BOOL success = LLUICtrlFactory::getLayeredXMLNode(xml_filename, root); + if (!success || !root || !root->hasName( "role_actions" )) { llerrs << "Problem reading UI role_actions file: " << xml_filename << llendl; return false; } - for (LLXmlTreeNode* action_set = root->getChildByName("action_set"); - action_set != NULL; action_set = root->getNextNamedChild()) + LLXMLNodeList role_list; + LLXMLNodeList::iterator role_iter; + + root->getChildren("action_set", role_list, false); + + for (role_iter = role_list.begin(); role_iter != role_list.end(); ++role_iter) { + LLXMLNodePtr action_set = role_iter->second; + LLRoleActionSet* role_action_set = new LLRoleActionSet(); LLRoleAction* role_action_data = new LLRoleAction(); + // name= LLString action_set_name; if (action_set->getAttributeString("name", action_set_name)) @@ -1774,9 +1782,15 @@ bool LLGroupMgr::parseRoleActions(const LLString& xml_filename) // power mask= U64 set_power_mask = 0; - for (LLXmlTreeNode* action = action_set->getChildByName("action"); - action != NULL; action = action_set->getNextNamedChild()) + LLXMLNodeList action_list; + LLXMLNodeList::iterator action_iter; + + action_set->getChildren("action", action_list, false); + + for (action_iter = action_list.begin(); action_iter != action_list.end(); ++action_iter) { + LLXMLNodePtr action = action_iter->second; + LLRoleAction* role_action = new LLRoleAction(); // name= diff --git a/linden/indra/newview/llgroupnotify.cpp b/linden/indra/newview/llgroupnotify.cpp index ef20138..aa84e3d 100644 --- a/linden/indra/newview/llgroupnotify.cpp +++ b/linden/indra/newview/llgroupnotify.cpp @@ -215,8 +215,8 @@ LLGroupNotifyBox::LLGroupNotifyBox(const char* subject, LLStyle headerstyle(true,LLColor4::black,"SansSerifBig"); LLStyle datestyle(true,LLColor4::black,"serif"); - text->appendStyledText(subject,false,false,headerstyle); - text->appendStyledText(time_buf,false,false,datestyle); + text->appendStyledText(subject,false,false,&headerstyle); + text->appendStyledText(time_buf,false,false,&datestyle); // Sadly, our LLTextEditor can't handle both styled and unstyled text // at the same time. Hence this space must be styled. JC text->appendColoredText(" ",false,false,LLColor4::grey4); diff --git a/linden/indra/newview/llhudeffecttrail.cpp b/linden/indra/newview/llhudeffecttrail.cpp index 79c05d7..7cfc3e1 100644 --- a/linden/indra/newview/llhudeffecttrail.cpp +++ b/linden/indra/newview/llhudeffecttrail.cpp @@ -188,7 +188,7 @@ void LLHUDEffectSpiral::triggerLocal() { if (show_beam) { - LLViewerPartSourceBeam *psb = new LLViewerPartSourceBeam; + LLPointer psb = new LLViewerPartSourceBeam; psb->setColor(color); psb->setSourceObject(mSourceObject); psb->setTargetObject(mTargetObject); @@ -203,7 +203,7 @@ void LLHUDEffectSpiral::triggerLocal() { if (show_beam) { - LLViewerPartSourceBeam *psb = new LLViewerPartSourceBeam; + LLPointer psb = new LLViewerPartSourceBeam; psb->setSourceObject(mSourceObject); psb->setTargetObject(NULL); psb->setColor(color); @@ -224,7 +224,7 @@ void LLHUDEffectSpiral::triggerLocal() { pos = gAgent.getPosAgentFromGlobal(mPositionGlobal); } - LLViewerPartSourceSpiral *pss = new LLViewerPartSourceSpiral(pos); + LLPointer pss = new LLViewerPartSourceSpiral(pos); if (!mSourceObject.isNull()) { pss->setSourceObject(mSourceObject); @@ -238,10 +238,10 @@ void LLHUDEffectSpiral::triggerLocal() } else { - LLViewerPartSource *ps = mPartSourcep; + LLPointer& ps = mPartSourcep; if (mPartSourcep->getType() == LLViewerPartSource::LL_PART_SOURCE_BEAM) { - LLViewerPartSourceBeam *psb = (LLViewerPartSourceBeam *)ps; + LLViewerPartSourceBeam *psb = (LLViewerPartSourceBeam *)ps.get(); psb->setSourceObject(mSourceObject); psb->setTargetObject(mTargetObject); psb->setColor(color); @@ -252,7 +252,7 @@ void LLHUDEffectSpiral::triggerLocal() } else { - LLViewerPartSourceSpiral *pss = (LLViewerPartSourceSpiral *)ps; + LLViewerPartSourceSpiral *pss = (LLViewerPartSourceSpiral *)ps.get(); pss->setSourceObject(mSourceObject); } } diff --git a/linden/indra/newview/llhudobject.h b/linden/indra/newview/llhudobject.h index bacffce..b3af006 100644 --- a/linden/indra/newview/llhudobject.h +++ b/linden/indra/newview/llhudobject.h @@ -94,7 +94,7 @@ protected: static void sortObjects(); LLHUDObject(const U8 type); - virtual ~LLHUDObject(); + ~LLHUDObject(); virtual void render() = 0; virtual void renderForSelect() {}; diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp index d95abf3..3c89131 100644 --- a/linden/indra/newview/llimpanel.cpp +++ b/linden/indra/newview/llimpanel.cpp @@ -33,6 +33,7 @@ #include "indra_constants.h" #include "llfocusmgr.h" #include "llfontgl.h" +#include "llhttpclient.h" #include "llrect.h" #include "llerror.h" #include "llstring.h" @@ -60,6 +61,7 @@ #include "llvieweruictrlfactory.h" #include "lllogchat.h" #include "llfloaterhtml.h" +#include "llviewerregion.h" #include "llweb.h" // @@ -113,8 +115,7 @@ bool send_start_session_messages(const LLUUID& temp_session_id, const LLDynamicArray& ids, EInstantMessage dialog) { - if ( (dialog == IM_SESSION_911_START) || - (dialog == IM_SESSION_GROUP_START) || + if ( (dialog == IM_SESSION_GROUP_START) || (dialog == IM_SESSION_CONFERENCE_START) ) { S32 count = ids.size(); @@ -129,7 +130,6 @@ bool send_start_session_messages(const LLUUID& temp_session_id, switch(dialog) { case IM_SESSION_GROUP_START: - case IM_SESSION_911_START: gMessageSystem->addBinaryDataFast(_PREHASH_BinaryBucket, EMPTY_BINARY_BUCKET, EMPTY_BINARY_BUCKET_SIZE); @@ -210,35 +210,58 @@ LLFloaterIMPanel::LLFloaterIMPanel(const std::string& name, mSessionInitialized(FALSE), mSessionInitRequested(FALSE) { - init(session_label); - mSessionInitialTargetIDs = ids; + init(session_label); } void LLFloaterIMPanel::init(const LLString& session_label) { gUICtrlFactory->buildFloater(this, - "floater_instant_message.xml", - NULL, - FALSE); - + "floater_instant_message.xml", + NULL, + FALSE); + setLabel(session_label); setTitle(session_label); mInputEditor->setMaxTextLength(1023); + // enable line history support for instant message bar + mInputEditor->setEnableLineHistory(TRUE); if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) { LLLogChat::loadHistory(session_label, - &chatFromLogFile, - (void *)this); + &chatFromLogFile, + (void *)this); } - if(IM_SESSION_911_START == mDialog) + if ( !mSessionInitialized ) { - LLTextBox* live_help_text = - LLUICtrlFactory::getTextBoxByName(this, "live_help_dialog"); - addHistoryLine(live_help_text->getText()); + if ( !send_start_session_messages( + mSessionUUID, + mOtherParticipantUUID, + mSessionInitialTargetIDs, + mDialog) ) + { + //we don't need to need to wait for any responses + //so we're already initialized + mSessionInitialized = TRUE; + } + else + { + //locally echo a little "starting session" message + LLUIString session_start = sSessionStartString; + + session_start.setArg("[NAME]", getTitle()); + mSessionStartMsgPos = + mHistoryEditor->getText().length(); + + bool log_to_file = false; + addHistoryLine( + session_start, + LLColor4::grey, + log_to_file); + } } } @@ -253,7 +276,6 @@ BOOL LLFloaterIMPanel::postBuild() requires("title_string", WIDGET_TYPE_TEXT_BOX); requires("typing_start_string", WIDGET_TYPE_TEXT_BOX); requires("session_start_string", WIDGET_TYPE_TEXT_BOX); - requires("teleport_btn", WIDGET_TYPE_BUTTON); if (checkRequirements()) { @@ -271,16 +293,10 @@ BOOL LLFloaterIMPanel::postBuild() LLButton* close_btn = LLUICtrlFactory::getButtonByName(this, "close_btn"); close_btn->setClickedCallback(&LLFloaterIMPanel::onClickClose, this); - LLButton* tp_btn = LLUICtrlFactory::getButtonByName(this, "teleport_btn"); - tp_btn->setClickedCallback(&LLFloaterIMPanel::onTeleport, this); - tp_btn->setVisible(FALSE); - tp_btn->setEnabled(FALSE); - mHistoryEditor = LLViewerUICtrlFactory::getViewerTextEditorByName(this, "im_history"); mHistoryEditor->setParseHTML(TRUE); - if (IM_SESSION_GROUP_START == mDialog - || IM_SESSION_911_START == mDialog) + if (IM_SESSION_GROUP_START == mDialog) { profile_btn->setEnabled(FALSE); } @@ -326,55 +342,55 @@ void LLFloaterIMPanel::draw() LLFloater::draw(); } +class LLSessionInviteResponder : public LLHTTPClient::Responder +{ +public: + LLSessionInviteResponder(const LLUUID& session_id) + { + mSessionID = session_id; + } + + void error(U32 statusNum, const std::string& reason) + { + llinfos << "Error inviting all agents to session" << llendl; -BOOL LLFloaterIMPanel::addParticipants(const LLDynamicArray& ids) + //throw something back to the viewer here? + } + +private: + LLUUID mSessionID; +}; + +BOOL LLFloaterIMPanel::inviteToSession(const LLDynamicArray& ids) { S32 count = ids.count(); if( isAddAllowed() && (count > 0) ) { - llinfos << "LLFloaterIMPanel::addParticipants() - adding participants" << llendl; - const S32 MAX_AGENTS = 50; - if(count > MAX_AGENTS) return FALSE; - - LLMessageSystem *msg = gMessageSystem; - msg->newMessageFast(_PREHASH_ImprovedInstantMessage); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_MessageBlock); - msg->addBOOLFast(_PREHASH_FromGroup, FALSE); - msg->addUUIDFast(_PREHASH_ToAgentID, mOtherParticipantUUID); - msg->addU8Fast(_PREHASH_Offline, IM_ONLINE); - msg->addU8Fast(_PREHASH_Dialog, IM_SESSION_ADD); - msg->addUUIDFast(_PREHASH_ID, mSessionUUID); - msg->addU32Fast(_PREHASH_Timestamp, NO_TIMESTAMP); // no timestamp necessary - std::string name; - gAgent.buildFullname(name); - msg->addStringFast(_PREHASH_FromAgentName, name); - msg->addStringFast(_PREHASH_Message, LLString::null); - msg->addU32Fast(_PREHASH_ParentEstateID, 0); - msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null); - msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent()); + llinfos << "LLFloaterIMPanel::inviteToSession() - adding participants" << llendl; - // *FIX: this could suffer from endian issues - S32 bucket_size = UUID_BYTES * count; - U8* bucket = new U8[bucket_size]; - U8* pos = bucket; - for(S32 i = 0; i < count; ++i) + std::string url = + gAgent.getRegion()->getCapability("ChatSessionRequest"); + + LLSD data; + data["params"] = LLSD::emptyArray(); + for (int i = 0; i < count; i++) { - memcpy(pos, &(ids.get(i)), UUID_BYTES); - pos += UUID_BYTES; + data["params"].append(ids.get(i)); } - msg->addBinaryDataFast(_PREHASH_BinaryBucket, - bucket, - bucket_size); - delete[] bucket; - gAgent.sendReliableMessage(); + + data["method"] = "invite"; + data["session-id"] = mSessionUUID; + LLHTTPClient::post( + url, + data, + new LLSessionInviteResponder(mSessionUUID)); + } else { - llinfos << "LLFloaterIMPanel::addParticipants() - no need to add agents for " + llinfos << "LLFloaterIMPanel::inviteToSession -" + << " no need to invite agents for " << mDialog << llendl; // successful add, because everyone that needed to get added // was added. @@ -530,7 +546,7 @@ BOOL LLFloaterIMPanel::dropCallingCard(LLInventoryItem* item, BOOL drop) { LLDynamicArray ids; ids.put(item->getCreatorUUID()); - addParticipants(ids); + inviteToSession(ids); } } else @@ -566,7 +582,7 @@ BOOL LLFloaterIMPanel::dropCategory(LLInventoryCategory* category, BOOL drop) { ids.put(items.get(i)->getCreatorUUID()); } - addParticipants(ids); + inviteToSession(ids); } } return rv; @@ -576,7 +592,7 @@ BOOL LLFloaterIMPanel::isAddAllowed() const { return ((IM_SESSION_CONFERENCE_START == mDialog) - || (IM_SESSION_ADD) ); + || (IM_SESSION_INVITE) ); } @@ -610,39 +626,6 @@ void LLFloaterIMPanel::onClickClose( void* userdata ) } } -void LLFloaterIMPanel::addTeleportButton() -{ - LLButton* btn = - LLViewerUICtrlFactory::getButtonByName(this, "teleport_btn"); - - if ( !btn->getEnabled() ) - { - //it's required, don't need to check for null here - // adjust the size of the editor to make room for the button - LLRect rect = mInputEditor->getRect(); - S32 editor_right = rect.mRight - btn->getRect().getWidth(); - rect.mRight = editor_right; - mInputEditor->reshape(rect.getWidth(), rect.getHeight(), FALSE); - mInputEditor->setRect(rect); - - btn->setVisible(TRUE); - btn->setEnabled(TRUE); - } -} - -// static -void LLFloaterIMPanel::onTeleport(void* userdata) -{ - LLFloaterIMPanel* self = (LLFloaterIMPanel*) userdata; - if(self) - { - send_simple_im(self->mSessionUUID, //to - "", - IM_TELEPORT_911, - self->mSessionUUID);//session - } -} - // static void LLFloaterIMPanel::onInputEditorFocusReceived( LLUICtrl* caller, void* userdata ) { @@ -690,7 +673,7 @@ void LLFloaterIMPanel::onClose(bool app_quitting) name.c_str(), "", IM_ONLINE, - IM_SESSION_DROP, + IM_SESSION_LEAVE, mSessionUUID); gAgent.sendReliableMessage(); } @@ -715,11 +698,7 @@ void deliver_message(const std::string& utf8_text, // which case it's probably an IM to everyone. U8 new_dialog = dialog; - if ( dialog == IM_SESSION_911_START ) - { - new_dialog = IM_SESSION_911_SEND; - } - else if ( dialog != IM_NOTHING_SPECIAL ) + if ( dialog != IM_NOTHING_SPECIAL ) { new_dialog = IM_SESSION_SEND; } @@ -755,49 +734,6 @@ void LLFloaterIMPanel::sendMsg() std::string utf8_text = wstring_to_utf8str(text); utf8_text = utf8str_truncate(utf8_text, MAX_MSG_BUF_SIZE - 1); - if ( !mSessionInitialized ) - { - //we send requests (if we need to) to initialize our session - if ( !mSessionInitRequested ) - { - mSessionInitRequested = TRUE; - if ( !send_start_session_messages(mSessionUUID, - mOtherParticipantUUID, - mSessionInitialTargetIDs, - mDialog) ) - { - //we don't need to need to wait for any responses - //so we don't need to disable - mSessionInitialized = TRUE; - } - else - { - //queue up the message to send once the session is - //initialized - mQueuedMsgsForInit.append(utf8_text); - - //locally echo a little "starting session" message - LLUIString session_start = sSessionStartString; - - session_start.setArg("[NAME]", getTitle()); - mSessionStartMsgPos = - mHistoryEditor->getText().length(); - - bool log_to_file = false; - addHistoryLine(session_start, - LLColor4::grey, - log_to_file); - - } - } - else - { - //queue up the message to send once the session is - //initialized - mQueuedMsgsForInit.append(utf8_text); - } - } - if ( mSessionInitialized ) { deliver_message(utf8_text, @@ -831,6 +767,10 @@ void LLFloaterIMPanel::sendMsg() addHistoryLine(history_echo); } } + else + { + mQueuedMsgsForInit.append(utf8_text); + } gViewerStats->incStat(LLViewerStats::ST_IM_COUNT); } @@ -969,3 +909,4 @@ void LLFloaterIMPanel::chatFromLogFile(LLString line, void* userdata) self->mHistoryEditor->appendColoredText(line, false, true, LLColor4::grey); } + diff --git a/linden/indra/newview/llimpanel.h b/linden/indra/newview/llimpanel.h index e760513..00b7033 100644 --- a/linden/indra/newview/llimpanel.h +++ b/linden/indra/newview/llimpanel.h @@ -71,7 +71,7 @@ public: // add target ids to the session. // Return TRUE if successful, otherwise FALSE. - BOOL addParticipants(const LLDynamicArray& agent_ids); + BOOL inviteToSession(const LLDynamicArray& agent_ids); void addHistoryLine(const std::string &utf8msg, const LLColor4& color = LLColor4::white, @@ -98,10 +98,7 @@ public: const LLUUID& getSessionID() const { return mSessionUUID; } const LLUUID& getOtherParticipantID() const { return mOtherParticipantUUID; } - - // HACK -- for enabling a teleport button for helpers - static void onTeleport(void* userdata); - void addTeleportButton(); + const EInstantMessage getDialogType() const { return mDialog; } void sessionInitReplyReceived(const LLUUID& im_session_id); diff --git a/linden/indra/newview/llimview.cpp b/linden/indra/newview/llimview.cpp index 02578d2..111852d 100644 --- a/linden/indra/newview/llimview.cpp +++ b/linden/indra/newview/llimview.cpp @@ -32,29 +32,37 @@ #include "llfontgl.h" #include "llrect.h" +#include "lldbstrings.h" #include "llerror.h" #include "llbutton.h" +#include "llsdutil.h" #include "llstring.h" #include "linked_lists.h" #include "llvieweruictrlfactory.h" #include "llagent.h" #include "llcallingcard.h" +#include "llchat.h" #include "llviewerwindow.h" #include "llresmgr.h" +#include "llfloaterchat.h" #include "llfloaternewim.h" +#include "llhttpclient.h" #include "llhttpnode.h" #include "llimpanel.h" #include "llresizebar.h" #include "lltabcontainer.h" #include "viewer.h" #include "llfloater.h" +#include "llmutelist.h" #include "llresizehandle.h" #include "llkeyboard.h" #include "llui.h" #include "llviewermenu.h" #include "llcallingcard.h" #include "lltoolbar.h" +#include "llviewermessage.h" +#include "llviewerregion.h" const EInstantMessage GROUP_DIALOG = IM_SESSION_GROUP_START; const EInstantMessage DEFAULT_DIALOG = IM_NOTHING_SPECIAL; @@ -149,11 +157,9 @@ BOOL LLFloaterIM::postBuild() sErrorStringsMap["no_user_911"] = childGetText("user_no_help"); - sEventStringsMap["add"] = childGetText("add_session_event");; + sEventStringsMap["add"] = childGetText("add_session_event"); sEventStringsMap["message"] = - childGetText("message_session_event");; - sEventStringsMap["teleport"] = - childGetText("teleport_session_event");; + childGetText("message_session_event"); sForceCloseSessionMap["removed"] = childGetText("removed_from_group"); @@ -377,10 +383,10 @@ void LLIMView::addMessage( //if we have recently requsted to be dropped from a session //but are still receiving messages from the session, don't make //a new floater -// if ( mSessionsDropRequested.has(session_id.asString()) ) -// { -// return ; -// } + if ( mSessionsDropRequested.has(session_id.asString()) ) + { + return ; + } const char* name = from; if(session_name && (strlen(session_name)>1)) @@ -543,10 +549,10 @@ void LLIMView::removeSession(const LLUUID& session_id) //mTabContainer->removeTabPanel(floater); } -// if ( session_id.notNull() ) -// { -// mSessionsDropRequested[session_id.asString()] = LLSD(); -// } + if ( session_id.notNull() && floater->getDialogType() != IM_NOTHING_SPECIAL ) + { + mSessionsDropRequested[session_id.asString()] = LLSD(); + } } void LLIMView::refresh() @@ -851,9 +857,10 @@ public: desc.source(__FILE__, __LINE__); } - virtual void post(ResponsePtr response, - const LLSD& context, - const LLSD& input) const + virtual void post( + ResponsePtr response, + const LLSD& context, + const LLSD& input) const { LLSD body; LLUUID temp_session_id; @@ -867,8 +874,9 @@ public: if ( success ) { session_id = body["session_id"].asUUID(); - gIMView->updateFloaterSessionID(temp_session_id, - session_id); + gIMView->updateFloaterSessionID( + temp_session_id, + session_id); } else { @@ -883,11 +891,11 @@ public: sErrorStringsMap[body["error"].asString()]; args["[RECIPIENT]"] = floater->getTitle(); - gViewerWindow->alertXml("IMSessionStartError", - args, - onConfirmForceCloseError, - floater); - + gViewerWindow->alertXml( + "IMSessionStartError", + args, + onConfirmForceCloseError, + floater); } } } @@ -990,18 +998,163 @@ public: } }; +class LLViewerChatterBoxSessionAgentListUpdates : public LLHTTPNode +{ +public: + virtual void post( + ResponsePtr responder, + const LLSD& context, + const LLSD& input) const + { + } +}; + +class LLViewerChatterBoxInvitation : public LLHTTPNode +{ +public: + virtual void post( + ResponsePtr responder, + const LLSD& context, + const LLSD& input) const + { + if ( input["body"].has("instantmessage") ) + { + LLSD message_params = + input["body"]["instantmessage"]["message_params"]; + + //this is just replicated code from process_improved_im + //and should really go in it's own function -jwolk + if (gNoRender) + { + return; + } + + char buffer[DB_IM_MSG_BUF_SIZE * 2]; /* Flawfinder: ignore */ + LLChat chat; + + std::string message = message_params["message"].asString(); + std::string name = message_params["from_name"].asString(); + LLUUID from_id = message_params["from_id"].asUUID(); + LLUUID session_id = message_params["id"].asUUID(); + std::vector bin_bucket = message_params["data"]["binary_bucket"].asBinary(); + U8 offline = (U8)message_params["offline"].asInteger(); + + time_t timestamp = + (time_t) message_params["timestamp"].asInteger(); + + BOOL is_busy = gAgent.getBusy(); + BOOL is_muted = gMuteListp->isMuted(from_id, name); + BOOL is_linden = gMuteListp->isLinden( + name.c_str()); + char separator_string[3]=": "; /* Flawfinder: ignore */ + int message_offset=0; + + //Handle IRC styled /me messages. + if (!strncmp(message.c_str(), "/me ", 4) || + !strncmp(message.c_str(), "/me'", 4)) + { + strcpy(separator_string,""); /* Flawfinder: ignore */ + message_offset = 3; + } + + chat.mMuted = is_muted && !is_linden; + chat.mFromID = from_id; + chat.mFromName = name; + if (!is_linden && is_busy) + { + return; + } + + // standard message, not from system + char saved[MAX_STRING]; /* Flawfinder: ignore */ + saved[0] = '\0'; + if(offline == IM_OFFLINE) + { + char time_buf[TIME_STR_LENGTH]; /* Flawfinder: ignore */ + snprintf(saved, /* Flawfinder: ignore */ + MAX_STRING, + "(Saved %s) ", + formatted_time(timestamp, time_buf)); + } + snprintf( + buffer, + sizeof(buffer), + "%s%s%s%s", + name.c_str(), + separator_string, + saved, + (message.c_str() + message_offset)); /*Flawfinder: ignore*/ + + BOOL is_this_agent = FALSE; + if(from_id == gAgentID) + { + from_id = LLUUID::null; + is_this_agent = TRUE; + } + gIMView->addMessage( + session_id, + from_id, + name.c_str(), + buffer, + (char*)&bin_bucket[0], + IM_SESSION_INVITE, + message_params["parent_estate_id"].asInteger(), + message_params["region_id"].asUUID(), + ll_vector3_from_sd(message_params["position"])); + + snprintf( + buffer, + sizeof(buffer), + "IM: %s%s%s%s", + name.c_str(), + separator_string, + saved, + (message.c_str()+message_offset)); /* Flawfinder: ignore */ + chat.mText = buffer; + LLFloaterChat::addChat(chat, TRUE, is_this_agent); + + //if we succesfully accepted the invitation + //send a message back down + + //TODO - When availble, have this response just be part + //of an automatic response system + std::string url = gAgent.getRegion()->getCapability( + "ChatSessionRequest"); + + if ( url != "" ) + { + LLSD data; + data["method"] = "accept invitation"; + data["session-id"] = input["body"]["session_id"]; + LLHTTPClient::post( + url, + data, + NULL); + } + } //end if invitation has instant message + } +}; + LLHTTPRegistration gHTTPRegistrationMessageImsessionstartreply( - "/message/IMSessionStartReply"); + "/message/ChatterBoxSessionStartReply"); LLHTTPRegistration gHTTPRegistrationMessageImsessioneventreply( - "/message/IMSessionEventReply"); + "/message/ChatterBoxSessionEventReply"); LLHTTPRegistration gHTTPRegistrationMessageForceCloseImSession( - "/message/ForceCloseIMSession"); + "/message/ForceCloseChatterBoxSession"); LLHTTPRegistration gHTTPRegistrationMessageImSessionDropReply( - "/message/IMSessionDropReply"); + "/message/ChatterBoxSessionLeaveReply"); + +LLHTTPRegistration + gHTTPRegistrationMessageChatterboxsessionagentlistupdates( + "/message/ChatterBoxSessionAgentListUpdates"); + +LLHTTPRegistration + gHTTPRegistrationMessageChatterBoxInvitation( + "/message/ChatterBoxInvitation"); diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp index a7b80ae..0d5c30e 100644 --- a/linden/indra/newview/llinventorybridge.cpp +++ b/linden/indra/newview/llinventorybridge.cpp @@ -822,7 +822,7 @@ LLString LLItemBridge::getLabelSuffix() const if(item) { // it's a bit confusing to put nocopy/nomod/etc on calling cards. - if(LLAssetType::AT_CALLINGCARD != item->getType() + if( LLAssetType::AT_CALLINGCARD != item->getType() && item->getPermissions().getOwner() == gAgent.getID()) { BOOL copy = item->getPermissions().allowCopyBy(gAgent.getID()); @@ -834,14 +834,32 @@ LLString LLItemBridge::getLabelSuffix() const const char* NO_MOD = " (no modify)"; const char* NO_XFER = " (no transfer)"; const char* scopy; - if(copy) scopy = EMPTY; - else scopy = NO_COPY; + if(copy) + { + scopy = EMPTY; + } + else + { + scopy = NO_COPY; + }; const char* smod; - if(mod) smod = EMPTY; - else smod = NO_MOD; + if(mod) + { + smod = EMPTY; + } + else + { + smod = NO_MOD; + }; const char* sxfer; - if(xfer) sxfer = EMPTY; - else sxfer = NO_XFER; + if(xfer) + { + sxfer = EMPTY; + } + else + { + sxfer = NO_XFER; + }; char buffer[MAX_STRING]; /*Flawfinder: ignore*/ snprintf( /* Flawfinder: ignore */ buffer, @@ -2510,14 +2528,14 @@ void LLLandmarkBridge::performAction(LLFolderView* folder, LLInventoryModel* mod else LLItemBridge::performAction(folder, model, action); } -void open_landmark(const LLUUID& item_id, +void open_landmark(LLViewerInventoryItem* inv_item, const LLString& title, BOOL show_keep_discard, const LLUUID& source_id, BOOL take_focus) { // See if we can bring an exiting preview to the front - if( !LLPreview::show( item_id, take_focus ) ) + if( !LLPreview::show( inv_item->getUUID(), take_focus ) ) { // There isn't one, so make a new preview S32 left, top; @@ -2525,11 +2543,12 @@ void open_landmark(const LLUUID& item_id, LLRect rect = gSavedSettings.getRect("PreviewLandmarkRect"); rect.translate( left - rect.mLeft, top - rect.mTop ); - LLPreviewLandmark* preview = new LLPreviewLandmark("preview landmark", + LLPreviewLandmark* preview = new LLPreviewLandmark(title, rect, title, - item_id, - show_keep_discard); + inv_item->getUUID(), + show_keep_discard, + inv_item); preview->setSourceID(source_id); if(take_focus) preview->setFocus(TRUE); // keep onscreen @@ -2542,7 +2561,7 @@ void LLLandmarkBridge::openItem() LLViewerInventoryItem* item = getItem(); if( item ) { - open_landmark(mUUID, LLString(" ") + getPrefix() + item->getName(), FALSE); + open_landmark(item, LLString(" ") + getPrefix() + item->getName(), FALSE); } } @@ -2769,14 +2788,15 @@ LLViewerImage* LLNotecardBridge::getIcon() const return get_item_icon(LLAssetType::AT_NOTECARD, LLInventoryType::IT_NOTECARD, 0, FALSE); } -void open_notecard(const LLUUID& item_id, +void open_notecard(LLViewerInventoryItem* inv_item, const LLString& title, + const LLUUID& object_id, BOOL show_keep_discard, const LLUUID& source_id, BOOL take_focus) { // See if we can bring an existing preview to the front - if(!LLPreview::show(item_id, take_focus)) + if(!LLPreview::show(inv_item->getUUID(), take_focus)) { // There isn't one, so make a new preview S32 left, top; @@ -2784,13 +2804,9 @@ void open_notecard(const LLUUID& item_id, LLRect rect = gSavedSettings.getRect("NotecardEditorRect"); rect.translate(left - rect.mLeft, top - rect.mTop); LLPreviewNotecard* preview; - preview = new LLPreviewNotecard("preview notecard", - rect, - title, - item_id, - LLUUID::null, - LLUUID::null, - show_keep_discard); + preview = new LLPreviewNotecard("preview notecard", rect, title, + inv_item->getUUID(), object_id, inv_item->getAssetUUID(), + show_keep_discard, inv_item); preview->setSourceID(source_id); if(take_focus) preview->setFocus(TRUE); // Force to be entirely onscreen. @@ -2809,23 +2825,22 @@ void open_notecard(const LLUUID& item_id, // { // // create new multipreview if it doesn't exist // LLMultiPreview* preview_hostp = new LLMultiPreview(existing_preview->getRect()); - // preview_hostp->addFloater(existing_preview); // } // // add this preview to existing host // preview_hostp->addFloater(preview); // } //} - } } + void LLNotecardBridge::openItem() { LLViewerInventoryItem* item = getItem(); if (item) { - open_notecard(mUUID, getPrefix() + item->getName(), FALSE); + open_notecard(item, getPrefix() + item->getName(), LLUUID::null, FALSE); } } @@ -3460,10 +3475,13 @@ public: * Do nothing. We only care about the destructor */ } + +protected: ~LLWearInventoryCategoryCallback() { wear_inventory_category_on_avatar(gInventory.getCategory(mCatID), mAppend); } + private: LLUUID mCatID; bool mAppend; diff --git a/linden/indra/newview/llinventoryview.h b/linden/indra/newview/llinventoryview.h index 7b29864..536370b 100644 --- a/linden/indra/newview/llinventoryview.h +++ b/linden/indra/newview/llinventoryview.h @@ -329,8 +329,8 @@ void wear_outfit_by_name(const char* name); void wear_inventory_category(LLInventoryCategory* category, bool copy, bool append); // These methods can open items without the inventory being visible -void open_notecard(const LLUUID& item_id, const LLString& title, BOOL show_keep_discard, const LLUUID& source_id = LLUUID::null, BOOL take_focus = TRUE); -void open_landmark(const LLUUID& item_id, const LLString& title, BOOL show_keep_discard, const LLUUID& source_id = LLUUID::null, BOOL take_focus = TRUE); +void open_notecard(LLViewerInventoryItem* inv_item, const LLString& title, const LLUUID& object_id, BOOL show_keep_discard, const LLUUID& source_id = LLUUID::null, BOOL take_focus = TRUE); +void open_landmark(LLViewerInventoryItem* inv_item, const LLString& title, BOOL show_keep_discard, const LLUUID& source_id = LLUUID::null, BOOL take_focus = TRUE); void open_texture(const LLUUID& item_id, const LLString& title, BOOL show_keep_discard, const LLUUID& source_id = LLUUID::null, BOOL take_focus = TRUE); LLUUID get_item_icon_uuid(LLAssetType::EType asset_type, diff --git a/linden/indra/newview/llmutelist.cpp b/linden/indra/newview/llmutelist.cpp index e62bf19..c2ca740 100644 --- a/linden/indra/newview/llmutelist.cpp +++ b/linden/indra/newview/llmutelist.cpp @@ -185,12 +185,7 @@ BOOL LLMuteList::isLinden(const LLString& name) const if (token_iter == tokens.end()) return FALSE; LLString last_name = *token_iter; - - if (last_name == "Linden") - { - return TRUE; - } - return FALSE; + return last_name == "Linden"; } diff --git a/linden/indra/newview/llnotify.cpp b/linden/indra/newview/llnotify.cpp index a84341d..e2626b4 100644 --- a/linden/indra/newview/llnotify.cpp +++ b/linden/indra/newview/llnotify.cpp @@ -89,6 +89,13 @@ void LLNotifyBox::showXml( const LLString& xml_desc, const LLString::format_map_ gNotifyBoxView->addChild(notify); } +LLPointer LLNotifyBox::sDefaultTemplate; + +void LLNotifyBox::cleanup() +{ + sDefaultTemplate = NULL; +} + //--------------------------------------------------------------------------- LLNotifyBox::LLNotifyBox(const LLString& xml_desc, const LLString::format_map_t& args, @@ -118,8 +125,12 @@ LLNotifyBox::LLNotifyBox(const LLString& xml_desc, const LLString::format_map_t& // get template - static LLNotifyBoxTemplate default_template; - LLNotifyBoxTemplate* xml_template; + if (!sDefaultTemplate) + { + sDefaultTemplate = new LLNotifyBoxTemplate; + } + + LLPointer xml_template; template_map_t::iterator iter = sNotifyTemplates.find(xml_desc); if (iter != sNotifyTemplates.end()) { @@ -128,8 +139,8 @@ LLNotifyBox::LLNotifyBox(const LLString& xml_desc, const LLString::format_map_t& else { LLString tmsg = "[Notification template not found:\n " + xml_desc + " ]"; - default_template.setMessage(tmsg); - xml_template = &default_template; + sDefaultTemplate->setMessage(tmsg); + xml_template = sDefaultTemplate; } // setup paramaters @@ -630,31 +641,24 @@ bool LLNotifyBox::parseNotify(const LLString& xml_filename) continue; } - LLNotifyBoxTemplate* xml_template = new LLNotifyBoxTemplate; + LLPointer xml_template = new LLNotifyBoxTemplate; // label= LLString notify_name; if (notify->getAttributeString("name", notify_name)) { - if (xml_template) - { - xml_template->mLabel = notify_name; - } + xml_template->mLabel = notify_name; } else { llwarns << "Unable to parse notify with no name" << llendl; - delete xml_template; continue; } // modal= BOOL tip; if (notify->getAttributeBOOL("tip", tip)) { - if (xml_template) - { - xml_template->mIsTip = tip; - } + xml_template->mIsTip = tip; } S32 btn_idx = 0; @@ -664,10 +668,7 @@ bool LLNotifyBox::parseNotify(const LLString& xml_filename) // if (child->hasName("message")) { - if (xml_template) - { - xml_template->mMessage = child->getTextContents(); - } + xml_template->mMessage = child->getTextContents(); } // - + When adding group members to the owner role - + When adding a new Classified @@ -716,6 +716,20 @@ There is no reimbursement for fees paid. Cancel + + + Save changes to classified [NAME]? + + + + + Delete pick [PICK]? @@ -2696,7 +2710,7 @@ Download to your Applications folder? Deeding this object will cause the group to: * Receive L$ paid into the object - + When deeding objects to groups @@ -3025,7 +3045,7 @@ Chat and instant messages will be hidden. Instant messages will get your Busy mode response. All teleportation and inventory offers will be declined. - + When setting busy mode @@ -4037,7 +4057,7 @@ will only work if a script is added with a money() event. Go to the Second Life web site to see your account history? - + When loading account history web page