aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.txt105
-rw-r--r--linden/indra/llcommon/llstring.h1
-rw-r--r--linden/indra/llvfs/lldir.cpp12
-rw-r--r--linden/indra/llvfs/lldir.h4
-rw-r--r--linden/indra/newview/CMakeLists.txt13
-rw-r--r--linden/indra/newview/app_settings/default_grids.xml37
-rw-r--r--linden/indra/newview/app_settings/settings.xml33
-rw-r--r--linden/indra/newview/floaterlogin.cpp724
-rw-r--r--linden/indra/newview/floaterlogin.h90
-rw-r--r--linden/indra/newview/hippoGridManager.cpp598
-rw-r--r--linden/indra/newview/hippoGridManager.h175
-rw-r--r--linden/indra/newview/hippoLimits.cpp54
-rw-r--r--linden/indra/newview/hippoLimits.h33
-rw-r--r--linden/indra/newview/hippoRestRequest.cpp54
-rw-r--r--linden/indra/newview/hippoRestRequest.h16
-rw-r--r--linden/indra/newview/hippoUpdate.cpp92
-rw-r--r--linden/indra/newview/hippoUpdate.h12
-rw-r--r--linden/indra/newview/llagent.cpp12
-rw-r--r--linden/indra/newview/llappviewer.cpp164
-rw-r--r--linden/indra/newview/llappviewer.h20
-rw-r--r--linden/indra/newview/llappviewerlinux.h3
-rw-r--r--linden/indra/newview/llcallingcard.cpp12
-rw-r--r--linden/indra/newview/llcallingcard.h2
-rw-r--r--linden/indra/newview/llchatbar.cpp1
-rw-r--r--linden/indra/newview/lldrawable.h1
-rw-r--r--linden/indra/newview/llfloaterworldmap.cpp157
-rw-r--r--linden/indra/newview/llfloaterworldmap.h7
-rw-r--r--linden/indra/newview/llinventorymodel.cpp2
-rw-r--r--linden/indra/newview/llinventorymodel.h6
-rw-r--r--linden/indra/newview/llinventoryview.cpp1
-rw-r--r--linden/indra/newview/llpanellogin.cpp169
-rw-r--r--linden/indra/newview/llpanellogin.h8
-rw-r--r--linden/indra/newview/llprefsim.cpp4
-rw-r--r--linden/indra/newview/llprogressview.cpp2
-rw-r--r--linden/indra/newview/llstartup.cpp220
-rw-r--r--linden/indra/newview/llstartup.h9
-rw-r--r--linden/indra/newview/lluserauth.cpp53
-rw-r--r--linden/indra/newview/llviewerjointattachment.h4
-rw-r--r--linden/indra/newview/llviewermenu.cpp5
-rw-r--r--linden/indra/newview/llviewermenufile.cpp15
-rw-r--r--linden/indra/newview/llviewermessage.cpp2
-rw-r--r--linden/indra/newview/llviewermessage.h2
-rw-r--r--linden/indra/newview/llviewernetwork.cpp201
-rw-r--r--linden/indra/newview/llviewernetwork.h63
-rw-r--r--linden/indra/newview/llviewerobject.h1
-rw-r--r--linden/indra/newview/llviewerobjectlist.h1
-rw-r--r--linden/indra/newview/llviewerwindow.cpp88
-rw-r--r--linden/indra/newview/llvoavatar.cpp13
-rw-r--r--linden/indra/newview/llwearablelist.cpp10
-rw-r--r--linden/indra/newview/llworld.cpp1
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/alerts.xml17
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_login.xml263
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_world_map.xml98
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml4
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_login.xml4
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_preferences_network.xml25
-rwxr-xr-xlinden/indra/newview/viewer_manifest.py42
57 files changed, 3218 insertions, 547 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index bb88684..cd7c841 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,3 +1,108 @@
12009-09-09 Jacek Antonelli <jacek.antonelli@gmail.com>
2
3 * Updated Grid Manager from Meerkat's SVN (as of r215).
4
5 modified: linden/indra/llvfs/lldir.cpp
6 modified: linden/indra/llvfs/lldir.h
7 modified: linden/indra/newview/CMakeLists.txt
8 modified: linden/indra/newview/app_settings/default_grids.xml
9 deleted: linden/indra/newview/authentication_controller.cpp
10 deleted: linden/indra/newview/authentication_controller.h
11 deleted: linden/indra/newview/authentication_floater.cpp
12 deleted: linden/indra/newview/authentication_floater.h
13 deleted: linden/indra/newview/authentication_model.cpp
14 deleted: linden/indra/newview/authentication_model.h
15 deleted: linden/indra/newview/controllerlogin.cpp
16 deleted: linden/indra/newview/controllerlogin.h
17 deleted: linden/indra/newview/controllerpasswords.cpp
18 deleted: linden/indra/newview/controllerpasswords.h
19 modified: linden/indra/newview/floaterlogin.cpp
20 modified: linden/indra/newview/floaterlogin.h
21 modified: linden/indra/newview/hippoGridManager.cpp
22 modified: linden/indra/newview/hippoGridManager.h
23 modified: linden/indra/newview/llfloaterworldmap.cpp
24 modified: linden/indra/newview/llpanellogin.cpp
25 modified: linden/indra/newview/llprefsim.cpp
26 modified: linden/indra/newview/llstartup.cpp
27 deleted: linden/indra/newview/prefpanelpasswords.cpp
28 deleted: linden/indra/newview/prefpanelpasswords.h
29 modified: linden/indra/newview/skins/default/xui/en-us/floater_login.xml
30
31
32
33 * Merged in Grid Manager, etc. (thanks Armin).
34
35 modified: linden/indra/llcommon/llstring.h
36 modified: linden/indra/newview/CMakeLists.txt
37 new file: linden/indra/newview/app_settings/default_grids.xml
38 modified: linden/indra/newview/app_settings/settings.xml
39 new file: linden/indra/newview/authentication_controller.cpp
40 new file: linden/indra/newview/authentication_controller.h
41 new file: linden/indra/newview/authentication_floater.cpp
42 new file: linden/indra/newview/authentication_floater.h
43 new file: linden/indra/newview/authentication_model.cpp
44 new file: linden/indra/newview/authentication_model.h
45 new file: linden/indra/newview/controllerlogin.cpp
46 new file: linden/indra/newview/controllerlogin.h
47 new file: linden/indra/newview/controllerpasswords.cpp
48 new file: linden/indra/newview/controllerpasswords.h
49 new file: linden/indra/newview/floaterlogin.cpp
50 new file: linden/indra/newview/floaterlogin.h
51 new file: linden/indra/newview/hippoGridManager.cpp
52 new file: linden/indra/newview/hippoGridManager.h
53 new file: linden/indra/newview/hippoLimits.cpp
54 new file: linden/indra/newview/hippoLimits.h
55 new file: linden/indra/newview/hippoRestRequest.cpp
56 new file: linden/indra/newview/hippoRestRequest.h
57 new file: linden/indra/newview/hippoUpdate.cpp
58 new file: linden/indra/newview/hippoUpdate.h
59 modified: linden/indra/newview/llagent.cpp
60 modified: linden/indra/newview/llappviewer.cpp
61 modified: linden/indra/newview/llappviewer.h
62 modified: linden/indra/newview/llappviewerlinux.h
63 modified: linden/indra/newview/llcallingcard.cpp
64 modified: linden/indra/newview/llcallingcard.h
65 modified: linden/indra/newview/llchatbar.cpp
66 modified: linden/indra/newview/lldrawable.h
67 modified: linden/indra/newview/llfloaterworldmap.cpp
68 modified: linden/indra/newview/llfloaterworldmap.h
69 modified: linden/indra/newview/llinventorymodel.cpp
70 modified: linden/indra/newview/llinventorymodel.h
71 modified: linden/indra/newview/llinventoryview.cpp
72 modified: linden/indra/newview/llpanellogin.cpp
73 modified: linden/indra/newview/llpanellogin.h
74 modified: linden/indra/newview/llprogressview.cpp
75 modified: linden/indra/newview/llstartup.cpp
76 modified: linden/indra/newview/llstartup.h
77 modified: linden/indra/newview/lluserauth.cpp
78 modified: linden/indra/newview/llviewerjointattachment.h
79 modified: linden/indra/newview/llviewermenu.cpp
80 modified: linden/indra/newview/llviewermenufile.cpp
81 modified: linden/indra/newview/llviewermessage.cpp
82 modified: linden/indra/newview/llviewermessage.h
83 modified: linden/indra/newview/llviewernetwork.cpp
84 modified: linden/indra/newview/llviewernetwork.h
85 modified: linden/indra/newview/llviewerobject.h
86 modified: linden/indra/newview/llviewerwindow.cpp
87 modified: linden/indra/newview/llvoavatar.cpp
88 modified: linden/indra/newview/llwearablelist.cpp
89 modified: linden/indra/newview/llworld.cpp
90 new file: linden/indra/newview/prefpanelpasswords.cpp
91 new file: linden/indra/newview/prefpanelpasswords.h
92 modified: linden/indra/newview/skins/default/xui/en-us/alerts.xml
93 new file: linden/indra/newview/skins/default/xui/en-us/floater_login.xml
94 modified: linden/indra/newview/skins/default/xui/en-us/floater_world_map.xml
95 modified: linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml
96 modified: linden/indra/newview/skins/default/xui/en-us/panel_login.xml
97 modified: linden/indra/newview/skins/default/xui/en-us/panel_preferences_network.xml
98
99
100 * Commented out Linux tarball building.
101 It's a waste of time to package after every compile.
102
103 modified: linden/indra/newview/viewer_manifest.py
104
105
12009-09-08 McCabe Maxsted <hakushakukun@gmail.com> 1062009-09-08 McCabe Maxsted <hakushakukun@gmail.com>
2 107
3 * Created my own version of Emerald's chat channel tool. 108 * Created my own version of Emerald's chat channel tool.
diff --git a/linden/indra/llcommon/llstring.h b/linden/indra/llcommon/llstring.h
index 720b163..93bd89a 100644
--- a/linden/indra/llcommon/llstring.h
+++ b/linden/indra/llcommon/llstring.h
@@ -36,6 +36,7 @@
36#include <wctype.h> 36#include <wctype.h>
37#include <wchar.h> 37#include <wchar.h>
38#endif 38#endif
39#include "linden_common.h"
39 40
40const char LL_UNKNOWN_CHAR = '?'; 41const char LL_UNKNOWN_CHAR = '?';
41 42
diff --git a/linden/indra/llvfs/lldir.cpp b/linden/indra/llvfs/lldir.cpp
index 1dc00dd..c9af311 100644
--- a/linden/indra/llvfs/lldir.cpp
+++ b/linden/indra/llvfs/lldir.cpp
@@ -520,19 +520,23 @@ std::string LLDir::getForbiddenFileChars()
520 return "\\/:*?\"<>|"; 520 return "\\/:*?\"<>|";
521} 521}
522 522
523void LLDir::setLindenUserDir(const std::string &first, const std::string &last) 523void LLDir::setLindenUserDir(const std::string &grid, const std::string &first, const std::string &last)
524{ 524{
525 // if both first and last aren't set, assume we're grabbing the cached dir 525 // if both first and last aren't set, assume we're grabbing the cached dir
526 if (!first.empty() && !last.empty()) 526 if (!first.empty() && !last.empty())
527 { 527 {
528 // some platforms have case-sensitive filesystems, so be 528 // some platforms have case-sensitive filesystems, so be
529 // utterly consistent with our firstname/lastname case. 529 // utterly consistent with our firstname/lastname case.
530 std::string gridlower(grid);
531 LLStringUtil::toLower(gridlower);
530 std::string firstlower(first); 532 std::string firstlower(first);
531 LLStringUtil::toLower(firstlower); 533 LLStringUtil::toLower(firstlower);
532 std::string lastlower(last); 534 std::string lastlower(last);
533 LLStringUtil::toLower(lastlower); 535 LLStringUtil::toLower(lastlower);
534 mLindenUserDir = getOSUserAppDir(); 536 mLindenUserDir = getOSUserAppDir();
535 mLindenUserDir += mDirDelimiter; 537 mLindenUserDir += mDirDelimiter;
538 mLindenUserDir += gridlower;
539 mLindenUserDir += "-";
536 mLindenUserDir += firstlower; 540 mLindenUserDir += firstlower;
537 mLindenUserDir += "_"; 541 mLindenUserDir += "_";
538 mLindenUserDir += lastlower; 542 mLindenUserDir += lastlower;
@@ -557,19 +561,23 @@ void LLDir::setChatLogsDir(const std::string &path)
557 } 561 }
558} 562}
559 563
560void LLDir::setPerAccountChatLogsDir(const std::string &first, const std::string &last) 564void LLDir::setPerAccountChatLogsDir(const std::string &grid, const std::string &first, const std::string &last)
561{ 565{
562 // if both first and last aren't set, assume we're grabbing the cached dir 566 // if both first and last aren't set, assume we're grabbing the cached dir
563 if (!first.empty() && !last.empty()) 567 if (!first.empty() && !last.empty())
564 { 568 {
565 // some platforms have case-sensitive filesystems, so be 569 // some platforms have case-sensitive filesystems, so be
566 // utterly consistent with our firstname/lastname case. 570 // utterly consistent with our firstname/lastname case.
571 std::string gridlower(grid);
572 LLStringUtil::toLower(gridlower);
567 std::string firstlower(first); 573 std::string firstlower(first);
568 LLStringUtil::toLower(firstlower); 574 LLStringUtil::toLower(firstlower);
569 std::string lastlower(last); 575 std::string lastlower(last);
570 LLStringUtil::toLower(lastlower); 576 LLStringUtil::toLower(lastlower);
571 mPerAccountChatLogsDir = getChatLogsDir(); 577 mPerAccountChatLogsDir = getChatLogsDir();
572 mPerAccountChatLogsDir += mDirDelimiter; 578 mPerAccountChatLogsDir += mDirDelimiter;
579 mPerAccountChatLogsDir += gridlower;
580 mPerAccountChatLogsDir += "-";
573 mPerAccountChatLogsDir += firstlower; 581 mPerAccountChatLogsDir += firstlower;
574 mPerAccountChatLogsDir += "_"; 582 mPerAccountChatLogsDir += "_";
575 mPerAccountChatLogsDir += lastlower; 583 mPerAccountChatLogsDir += lastlower;
diff --git a/linden/indra/llvfs/lldir.h b/linden/indra/llvfs/lldir.h
index b041afc..4ab5d85 100644
--- a/linden/indra/llvfs/lldir.h
+++ b/linden/indra/llvfs/lldir.h
@@ -119,8 +119,8 @@ class LLDir
119 static std::string getForbiddenFileChars(); 119 static std::string getForbiddenFileChars();
120 120
121 virtual void setChatLogsDir(const std::string &path); // Set the chat logs dir to this user's dir 121 virtual void setChatLogsDir(const std::string &path); // Set the chat logs dir to this user's dir
122 virtual void setPerAccountChatLogsDir(const std::string &first, const std::string &last); // Set the per user chat log directory. 122 virtual void setPerAccountChatLogsDir(const std::string &grid, const std::string &first, const std::string &last); // Set the per user chat log directory.
123 virtual void setLindenUserDir(const std::string &first, const std::string &last); // Set the linden user dir to this user's dir 123 virtual void setLindenUserDir(const std::string &grid, const std::string &first, const std::string &last); // Set the linden user dir to this user's dir
124 virtual void setSkinFolder(const std::string &skin_folder); 124 virtual void setSkinFolder(const std::string &skin_folder);
125 virtual bool setCacheDir(const std::string &path); 125 virtual bool setCacheDir(const std::string &path);
126 126
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index f224652..0a4ee82 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -61,7 +61,11 @@ include_directories(
61 ) 61 )
62 62
63set(viewer_SOURCE_FILES 63set(viewer_SOURCE_FILES
64 jcfloater_animation_list.cpp 64 floaterlogin.cpp
65 hippoGridManager.cpp
66 hippoLimits.cpp
67 hippoRestRequest.cpp
68 jcfloater_animation_list.cpp
65 llagent.cpp 69 llagent.cpp
66 llagentdata.cpp 70 llagentdata.cpp
67 llagentlanguage.cpp 71 llagentlanguage.cpp
@@ -461,8 +465,11 @@ endif (LINUX)
461set(viewer_HEADER_FILES 465set(viewer_HEADER_FILES
462 CMakeLists.txt 466 CMakeLists.txt
463 ViewerInstall.cmake 467 ViewerInstall.cmake
464 468 floaterlogin.h
465 jcfloater_animation_list.h 469 hippoGridManager.h
470 hippoLimits.h
471 hippoRestRequest.h
472 jcfloater_animation_list.h
466 llagent.h 473 llagent.h
467 llagentdata.h 474 llagentdata.h
468 llagentlanguage.h 475 llagentlanguage.h
diff --git a/linden/indra/newview/app_settings/default_grids.xml b/linden/indra/newview/app_settings/default_grids.xml
new file mode 100644
index 0000000..05d8bed
--- /dev/null
+++ b/linden/indra/newview/app_settings/default_grids.xml
@@ -0,0 +1,37 @@
1<llsd>
2 <array>
3
4 <!--
5 This file contains fallback settings only.
6 The actual list of grids is loaded from a web server.
7 -->
8
9 <map>
10 <key>default_grids_version</key><string>0</string>
11 </map>
12
13 <!-- Second Life -->
14 <map>
15 <key>gridnick</key><string>secondlife</string>
16 <key>gridname</key><string>Second Life</string>
17 <key>platform</key><string>SecondLife</string>
18 <key>loginuri</key><string>https://login.agni.lindenlab.com/cgi-bin/login.cgi</string>
19 <key>loginpage</key><string>http://secondlife.com/app/login/</string>
20 <key>helperuri</key><string>https://secondlife.com/helpers/</string>
21 <key>website</key><string>http://secondlife.com/</string>
22 <key>support</key><string>http://secondlife.com/support/</string>
23 <key>register</key><string>http://secondlife.com/registration/</string>
24 <key>password</key><string>http://secondlife.com/account/request.php</string>
25 </map>
26
27 <!-- Local Host -->
28 <map>
29 <key>gridnick</key><string>local</string>
30 <key>gridname</key><string>Local Host</string>
31 <key>platform</key><string>OpenSim</string>
32 <key>loginuri</key><string>http://127.0.0.1:9000/</string>
33 <key>helperuri</key><string>http://127.0.0.1:9000/</string>
34 </map>
35
36 </array>
37</llsd>
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index 154fd5f..79ea136 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -10646,5 +10646,38 @@
10646 <key>Value</key> 10646 <key>Value</key>
10647 <integer>0</integer> 10647 <integer>0</integer>
10648 </map> 10648 </map>
10649 <key>DefaultGrid</key>
10650 <map>
10651 <key>Comment</key>
10652 <string>Nickname of the default grid</string>
10653 <key>Persist</key>
10654 <integer>1</integer>
10655 <key>Type</key>
10656 <string>String</string>
10657 <key>Value</key>
10658 <string>secondlife</string>
10659 </map>
10660 <key>KeepAppearance</key>
10661 <map>
10662 <key>Comment</key>
10663 <string>Keep appearance across grid teleport</string>
10664 <key>Persist</key>
10665 <integer>1</integer>
10666 <key>Type</key>
10667 <string>Boolean</string>
10668 <key>Value</key>
10669 <string>0</string>
10670 </map>
10671 <key>CheckForGridUpdates</key>
10672 <map>
10673 <key>Comment</key>
10674 <string>Check for grid info updates on the web server</string>
10675 <key>Persist</key>
10676 <integer>1</integer>
10677 <key>Type</key>
10678 <string>Boolean</string>
10679 <key>Value</key>
10680 <integer>1</integer>
10681 </map>
10649 </map> 10682 </map>
10650</llsd> 10683</llsd>
diff --git a/linden/indra/newview/floaterlogin.cpp b/linden/indra/newview/floaterlogin.cpp
new file mode 100644
index 0000000..6519962
--- /dev/null
+++ b/linden/indra/newview/floaterlogin.cpp
@@ -0,0 +1,724 @@
1/*
2 * floaterlogin.cpp (floatergridmanager.cpp pls)
3 * This is Meerkats grid manager, and I accidentally finished it with the wrong name :)
4 * -Patrick Sapinski (Monday, August 17, 2009)
5 */
6
7#include "llviewerprecompiledheaders.h"
8
9#include <boost/algorithm/string.hpp>
10#include "llviewercontrol.h"
11#include "llviewerbuild.h"
12#include "llcombobox.h"
13#include "llscrolllistctrl.h"
14#include "llmd5.h"
15#include "llurlsimstring.h"
16#include "lluictrlfactory.h"
17#include "floaterlogin.h"
18#include "hippoGridManager.h"
19#include "llviewernetwork.h"
20#include "llpanellogin.h"
21
22#define PASSWORD_FILLER "123456789!123456"
23
24LoginFloater* LoginFloater::sInstance = NULL;
25LoginController* LoginFloater::sController = NULL;
26bool LoginFloater::sIsInitialLogin;
27std::string LoginFloater::sGrid;
28
29LoginFloater::LoginFloater()
30: LLFloater("floater_login")
31{
32
33 mState = NORMAL;
34 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_login.xml");
35
36
37 llwarns << "LoginFloater called" << llendl;
38
39
40 // configure the floater interface for non-initial login
41 setCanMinimize(!sIsInitialLogin);
42 setCanClose(!sIsInitialLogin);
43 setCanDrag(!sIsInitialLogin);
44 childSetVisible("server_combo", sIsInitialLogin);
45
46 if(!sIsInitialLogin)
47 {
48 LLButton* quit_btn = getChild<LLButton>("quit_btn");
49 quit_btn->setLabel(std::string("Cancel"));
50 setTitle(std::string("Grid Manager"));
51 }
52
53 center();
54 LLLineEditor* edit = getChild<LLLineEditor>("avatar_password_edit");
55 if (edit) edit->setDrawAsterixes(TRUE);
56 LLComboBox* combo = getChild<LLComboBox>("start_location_combo");
57 combo->setAllowTextEntry(TRUE, 128, FALSE);
58
59 BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation");
60 std::string sim_string = LLURLSimString::sInstance.mSimString;
61 if (!sim_string.empty())
62 {
63 // Replace "<Type region name>" with this region name
64 combo->remove(2);
65 combo->add( sim_string );
66 combo->setTextEntry(sim_string);
67 combo->setCurrentByIndex( 2 );
68 }
69 else if (login_last)
70 {
71 combo->setCurrentByIndex( 1 );
72 }
73 else
74 {
75 combo->setCurrentByIndex( 0 );
76 }
77}
78
79
80LoginFloater::~LoginFloater()
81{
82 LoginFloater::sController = NULL;
83 LoginFloater::sInstance = NULL;
84}
85
86void LoginFloater::close()
87{
88 if(sInstance)
89 {
90 delete sInstance;
91 sInstance = NULL;
92 }
93}
94
95BOOL LoginFloater::postBuild()
96{
97 requires<LLScrollListCtrl>("grid_selector");
98 requires<LLLineEditor>("gridnick");
99 requires<LLLineEditor>("gridname");
100 requires<LLLineEditor>("loginuri");
101 requires<LLLineEditor>("loginpage");
102 requires<LLLineEditor>("helperuri");
103 requires<LLLineEditor>("website");
104 requires<LLLineEditor>("support");
105 requires<LLLineEditor>("register");
106 requires<LLLineEditor>("password");
107 requires<LLLineEditor>("first_name");
108 requires<LLLineEditor>("last_name");
109 requires<LLLineEditor>("avatar_password");
110 //requires<LLLineEditor>("search");
111 requires<LLButton>("btn_delete");
112 requires<LLButton>("btn_add");
113 requires<LLButton>("btn_copy");
114 requires<LLButton>("set_default");
115 requires<LLButton>("btn_gridinfo");
116 requires<LLButton>("btn_help_render_compat");
117 if (!checkRequirements()) return false;
118 LLLineEditor* password_edit = getChild<LLLineEditor>("avatar_password");
119 if (password_edit) password_edit->setDrawAsterixes(TRUE);
120
121 childSetAction("btn_delete", onClickDelete, this);
122 childSetAction("btn_add", onClickAdd, this);
123 childSetAction("btn_copy", onClickCopy, this);
124 childSetAction("btn_ok", onClickOk, this);
125 childSetAction("btn_apply", onClickApply, this);
126 childSetAction("set_default", onClickDefault, this);
127 childSetAction("btn_cancel", onClickCancel, this);
128//KOW childSetAction("set_default", onClickDefault, this);
129 childSetAction("btn_gridinfo", onClickGridInfo, this);
130//KOW childSetAction("btn_help_render_compat", onClickHelpRenderCompat, this);
131
132 childSetCommitCallback("grid_selector", onSelectGrid, this);
133//KOW childSetCommitCallback("platform", onSelectPlatform, this);
134
135 // !!!### server_choice_combo->setFocusLostCallback(onServerComboLostFocus);
136
137//KOW update();
138 return TRUE;
139}
140
141void LoginFloater::refresh_grids()
142{
143 const std::string &defaultGrid = gHippoGridManager->getDefaultGridNick();
144 LLScrollListCtrl *grids = sInstance->getChild<LLScrollListCtrl>("grid_selector");
145 S32 selectIndex = -1, i = 0;
146 grids->deleteAllItems();
147 if (defaultGrid != "") {
148 LLSD value;
149 value["id"] = defaultGrid;
150 value["columns"][0]["column"] = "grid";
151 value["columns"][0]["value"] = defaultGrid;
152 grids->addElement(value);
153 selectIndex = i++;
154 }
155
156 HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid();
157 for (it = gHippoGridManager->beginGrid(); it != end; ++it) {
158 const std::string &grid = it->second->getGridNick();
159 if (grid != defaultGrid) {
160 LLSD value;
161 value["id"] = grid;
162 value["columns"][0]["column"] = "grid";
163 value["columns"][0]["value"] = grid;
164 grids->addElement(value);
165
166 if (grid == sInstance->mCurGrid) selectIndex = i;
167 i++;
168 }
169 }
170 if ((sInstance->mState == ADD_NEW) || (sInstance->mState == ADD_COPY)) {
171 grids->addElement("<new>");
172 selectIndex = i++;
173 }
174 if (selectIndex >= 0) {
175 //grids->setCurrentByIndex(selectIndex);
176 } else {
177 //grids->setLabel(LLStringExplicit("")); // LLComboBox::removeall() does not clear the label
178 }
179
180 sInstance->childSetTextArg("default_grid", "[DEFAULT]", (defaultGrid != "")? defaultGrid: " ");
181
182 sInstance->childSetEnabled("btn_delete", (selectIndex >= 0));
183 sInstance->childSetEnabled("btn_copy", (sInstance->mState == NORMAL) && (selectIndex >= 0));
184 sInstance->childSetEnabled("set_default", (sInstance->mState == NORMAL) && (selectIndex > 0));
185 sInstance->childSetEnabled("gridnick", (sInstance->mState == ADD_NEW) || (sInstance->mState == ADD_COPY));
186
187 if (sInstance->mState == NORMAL) {
188 HippoGridInfo *gridInfo = gHippoGridManager->getGrid(sInstance->mCurGrid);
189 if (gridInfo) {
190 sInstance->childSetText("gridnick", gridInfo->getGridNick());
191 //sInstance->childSetText("grid_name", gridInfo->getGridName());
192 sInstance->childSetText("loginuri", gridInfo->getLoginUri());
193 sInstance->childSetText("loginpage", gridInfo->getLoginPage());
194 sInstance->childSetText("helperuri", gridInfo->getHelperUri());
195 sInstance->childSetText("website", gridInfo->getWebSite());
196 sInstance->childSetText("support", gridInfo->getSupportUrl());
197 sInstance->childSetText("register", gridInfo->getRegisterUrl());
198 sInstance->childSetText("password", gridInfo->getPasswordUrl());
199 sInstance->childSetText("first_name", gridInfo->getFirstName());
200 sInstance->childSetText("last_name", gridInfo->getLastName());
201 if(gridInfo->getAvatarPassword().length() == 32)
202 sInstance->childSetText("avatar_password", std::string(PASSWORD_FILLER));
203 else if(gridInfo->getPasswordUrl().empty())
204 sInstance->childSetText("avatar_password", std::string(""));
205/*
206 if (gridInfo->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE) {
207 //childSetEnabled("search", false);
208 //childSetText("search", LLStringExplicit(""));
209 childSetEnabled("render_compat", false);
210 childSetValue("render_compat", false);
211 } else {
212 //childSetEnabled("search", true);
213 //childSetText("search", gridInfo->getSearchUrl());
214 childSetEnabled("render_compat", true);
215 childSetValue("render_compat", gridInfo->isRenderCompat());
216 }
217 */
218 } else {
219 std::string empty = "";
220 sInstance->childSetText("gridnick", empty);
221 sInstance->childSetText("gridname", empty);
222 sInstance->childSetText("loginuri", empty);
223 sInstance->childSetText("loginpage", empty);
224 sInstance->childSetText("helperuri", empty);
225 sInstance->childSetText("website", empty);
226 sInstance->childSetText("first_name", empty);
227 sInstance->childSetText("last_name", empty);
228 sInstance->childSetText("avatar_password", empty);
229 }
230 } else if (sInstance->mState == ADD_NEW) {
231 llwarns << "ADD_NEW" << llendl;
232 std::string required = "<required>";
233 std::string empty = "";
234 sInstance->childSetText("gridnick", required);
235 sInstance->childSetText("gridname", empty);
236 sInstance->childSetText("loginuri", required);
237 sInstance->childSetText("loginpage", empty);
238 sInstance->childSetText("helperuri", empty);
239 sInstance->childSetText("website", empty);
240 sInstance->childSetText("support", empty);
241 sInstance->childSetText("register", empty);
242 sInstance->childSetText("password", empty);
243 sInstance->childSetText("first_name", empty);
244 sInstance->childSetText("last_name", empty);
245 sInstance->childSetText("avatar_password", empty);
246 //childSetEnabled("search", true);
247 //childSetText("search", empty);
248 } else if (sInstance->mState == ADD_COPY) {
249 llwarns << "ADD_COPY" << llendl;
250 sInstance->childSetText("gridnick", LLStringExplicit("<required>"));
251 } else {
252 llwarns << "Illegal state " << sInstance->mState << '.' << llendl;
253 }
254 return;
255}
256
257void LoginFloater::update()
258{
259 mState = NORMAL;
260 mCurGrid = gHippoGridManager->getCurrentGridNick();
261 refresh_grids();
262 //KOW gHippoLimits->setLimits();
263}
264
265void LoginFloater::applyChanges()
266{
267 HippoGridInfo *gridInfo = gHippoGridManager->getGrid(mCurGrid);
268 if (gridInfo)
269 {
270 if (gridInfo->getGridNick() == childGetValue("gridnick").asString())
271 {
272 gridInfo->setGridName(childGetValue("gridname"));
273 gridInfo->setLoginUri(childGetValue("loginuri"));
274 gridInfo->setLoginPage(childGetValue("loginpage"));
275 gridInfo->setHelperUri(childGetValue("helperuri"));
276 gridInfo->setWebSite(childGetValue("website"));
277 gridInfo->setSupportUrl(childGetValue("support"));
278 gridInfo->setRegisterUrl(childGetValue("register"));
279 gridInfo->setPasswordUrl(childGetValue("password"));
280 gridInfo->setFirstName(childGetValue("first_name"));
281 gridInfo->setLastName(childGetValue("last_name"));
282 //gridInfo->setSearchUrl(childGetValue("search"));
283 gridInfo->setRenderCompat(childGetValue("render_compat"));
284
285 if(childGetValue("avatar_password").asString().empty())
286 gridInfo->setAvatarPassword(std::string(""));
287 else if(childGetValue("avatar_password").asString() != std::string(PASSWORD_FILLER))
288 {
289 // store account authentication data
290 std::string auth_password = childGetValue("avatar_password");
291 std::string hashed_password;
292 hashPassword(auth_password, hashed_password);
293 gridInfo->setAvatarPassword(hashed_password);
294 }
295 //this bug was a feature -Patrick Sapinski (Friday, August 21, 2009)
296 //LLPanelLogin::setFields(gridInfo->getFirstName(), gridInfo->getLastName(),
297 // gridInfo->getAvatarPassword(), true);
298 }
299 else
300 {
301 llwarns << "Grid nickname mismatch, ignoring changes." << llendl;
302 }
303 }
304}
305
306
307bool LoginFloater::createNewGrid()
308{
309 // check nickname
310 std::string gridnick = childGetValue("gridnick");
311 if (gridnick == "<required>") gridnick = "";
312 HippoGridInfo::cleanUpGridNick(gridnick);
313 childSetValue("gridnick", (gridnick != "")? gridnick: "<required>");
314 if (gridnick == "") {
315 //KOW gViewerWindow->alertXml("GridsNoNick");
316 return false;
317 }
318 if (gHippoGridManager->getGrid(gridnick)) {
319 LLStringUtil::format_map_t args;
320 args["[NAME]"] = gridnick;
321 //KOW gViewerWindow->alertXml("GridExists", args);
322 return false;
323 }
324
325 // check login URI
326 std::string loginuri = childGetValue("loginuri");
327 if ((loginuri == "") || (loginuri == "<required>")) {
328 LLStringUtil::format_map_t args;
329 args["[NAME]"] = gridnick;
330 //KOW gViewerWindow->alertXml("GridsNoLoginUri", args);
331 return false;
332 }
333
334 // create new grid
335 HippoGridInfo *grid = new HippoGridInfo(gridnick);
336 grid->setGridName(childGetValue("gridname"));
337 grid->setLoginUri(loginuri);
338 grid->setLoginPage(childGetValue("loginpage"));
339 grid->setHelperUri(childGetValue("helperuri"));
340 grid->setWebSite(childGetValue("website"));
341 grid->setSupportUrl(childGetValue("support"));
342 grid->setRegisterUrl(childGetValue("register"));
343 grid->setPasswordUrl(childGetValue("password"));
344 grid->setFirstName(childGetValue("first_name"));
345 grid->setLastName(childGetValue("last_name"));
346 //grid->setSearchUrl(childGetValue("search"));
347 grid->setRenderCompat(childGetValue("render_compat"));
348 gHippoGridManager->addGrid(grid);
349
350 if(childGetValue("avatar_password").asString().empty())
351 grid->setAvatarPassword(std::string(""));
352 else
353 {
354 std::string hashed_password;
355 hashPassword(childGetValue("avatar_password"), hashed_password);
356 grid->setAvatarPassword(hashed_password);
357 }
358
359 mCurGrid = gridnick;
360 return true;
361}
362
363void LoginFloater::retrieveGridInfo()
364{
365 std::string loginuri = childGetValue("loginuri");
366 if ((loginuri == "") || (loginuri == "<required>")) {
367 //KOW gViewerWindow->alertXml("GridInfoNoLoginUri");
368 return;
369 }
370
371 HippoGridInfo *grid = 0;
372 bool cleanupGrid = false;
373 if (mState == NORMAL) {
374 grid = gHippoGridManager->getGrid(mCurGrid);
375 } else if ((mState == ADD_NEW) || (mState == ADD_COPY)) {
376 grid = new HippoGridInfo("");
377 cleanupGrid = true;
378 } else {
379 llerrs << "Illegal state " << mState << '.' << llendl;
380 return;
381 }
382 if (!grid) {
383 llerrs << "Internal error retrieving grid info." << llendl;
384 return;
385 }
386
387 grid->setLoginUri(loginuri);
388 if (grid->retrieveGridInfo()) {
389 if (grid->getGridNick() != "") childSetText("gridnick", grid->getGridNick());
390 if (grid->getGridName() != "") childSetText("gridname", grid->getGridName());
391 if (grid->getLoginUri() != "") childSetText("loginuri", grid->getLoginUri());
392 if (grid->getLoginPage() != "") childSetText("loginpage", grid->getLoginPage());
393 if (grid->getHelperUri() != "") childSetText("helperuri", grid->getHelperUri());
394 if (grid->getWebSite() != "") childSetText("website", grid->getWebSite());
395 if (grid->getSupportUrl() != "") childSetText("support", grid->getSupportUrl());
396 if (grid->getRegisterUrl() != "") childSetText("register", grid->getRegisterUrl());
397 if (grid->getPasswordUrl() != "") childSetText("password", grid->getPasswordUrl());
398 //if (grid->getSearchUrl() != "") childSetText("search", grid->getSearchUrl());
399 } else {
400 //KOW gViewerWindow->alertXml("GridInfoError");
401 }
402
403 if (cleanupGrid) delete grid;
404}
405
406void LoginFloater::apply()
407{
408 if (mState == NORMAL) {
409 applyChanges();
410 } else if ((mState == ADD_NEW) || (mState == ADD_COPY)) {
411 if (!createNewGrid()) return;
412 } else {
413 llwarns << "Illegal state " << mState << '.' << llendl;
414 return;
415 }
416 //gHippoGridManager->setCurrentGrid(mCurGrid);
417 //gHippoGridManager->setDefaultGrid(mCurGrid);
418 //LLPanelLogin::refreshLoginPage();
419 gHippoGridManager->saveFile();
420 LLPanelLogin::addServer(LLViewerLogin::getInstance()->getGridLabel());
421}
422
423void LoginFloater::setDefault()
424{
425 if (mState == NORMAL) {
426 applyChanges();
427 } else if ((mState == ADD_NEW) || (mState == ADD_COPY)) {
428 if (!createNewGrid()) return;
429 } else {
430 llwarns << "Illegal state " << mState << '.' << llendl;
431 return;
432 }
433 gHippoGridManager->setCurrentGrid(mCurGrid);
434 gHippoGridManager->setDefaultGrid(mCurGrid);
435 gHippoGridManager->saveFile();
436 LLPanelLogin::addServer(LLViewerLogin::getInstance()->getGridLabel());
437}
438
439void LoginFloater::cancel()
440{
441 gHippoGridManager->discardAndReload();
442 update();
443}
444
445void LoginFloater::onSelectGrid(LLUICtrl* ctrl, void *data)
446{
447 LoginFloater* self = (LoginFloater*)data;
448 if (self->mState == NORMAL) {
449 self->applyChanges();
450 } else if ((self->mState == ADD_NEW) || (self->mState == ADD_COPY)) {
451 if (self->createNewGrid()) {
452 self->mState = NORMAL;
453 } else {
454 //LLScrollListCtrl *grids = self->getChild<LLScrollListCtrl>("grid_selector");
455 //grids->setCurrentByIndex(grids->getItemCount() - 1);
456 return;
457 }
458 } else {
459 llwarns << "Illegal state " << self->mState << '.' << llendl;
460 return;
461 }
462 self->mCurGrid = ctrl->getValue().asString();
463 self->refresh_grids();
464}
465
466//static
467void LoginFloater::onClickDelete(void *data)
468{
469 llwarns << "onclickdelete" << llendl;
470 LoginFloater* self = (LoginFloater*)data;
471 if (self->mState == NORMAL)
472 gHippoGridManager->deleteGrid(self->mCurGrid);
473 self->update();
474}
475
476//static
477void LoginFloater::onClickAdd(void *data)
478{
479 llwarns << "add" << llendl;
480 LoginFloater* self = (LoginFloater*)data;
481 self->mState = ADD_NEW;
482 self->refresh_grids();
483}
484
485
486//static
487void LoginFloater::onClickCopy(void *data)
488{
489 llwarns << "copy" << llendl;
490 LoginFloater* self = (LoginFloater*)data;
491 self->mState = ADD_COPY;
492 self->refresh_grids();
493}
494
495// static
496void LoginFloater::onClickOk(void* data)
497{
498 if(NULL==sInstance)
499 return;
500
501 sInstance->apply();
502 sInstance->close();
503}
504
505//static
506void LoginFloater::onClickApply(void *data)
507{
508 if(NULL==sInstance)
509 return;
510
511 sInstance->apply();
512 refresh_grids();
513}
514
515//static
516void LoginFloater::onClickDefault(void *data)
517{
518 sInstance->setDefault();
519 sInstance->refresh_grids();
520}
521
522//static
523void LoginFloater::onClickGridInfo(void *data)
524{
525 //HippoPanelGrids* self = (HippoPanelGrids*)data;
526 sInstance->retrieveGridInfo();
527}
528
529//static
530void LoginFloater::onClickCancel(void *data)
531{
532 sInstance->cancel();
533}
534
535void LoginFloater::setAlwaysRefresh(bool refresh)
536{
537 // wargames 2: dead code, LLPanelLogin compatibility
538 return;
539}
540
541void LoginFloater::refreshLocation( bool force_visible )
542{
543
544 llwarns << "refreshLocation called" << llendl;
545
546 if (!sInstance) return;
547
548 LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo");
549
550 if (LLURLSimString::parse())
551 {
552 combo->setCurrentByIndex( 3 ); // BUG? Maybe 2?
553 combo->setTextEntry(LLURLSimString::sInstance.mSimString);
554 }
555 else
556 {
557 BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation");
558 combo->setCurrentByIndex( login_last ? 1 : 0 );
559 }
560
561 BOOL show_start = TRUE;
562
563 if ( ! force_visible )
564 show_start = gSavedSettings.getBOOL("ShowStartLocation");
565
566 sInstance->childSetVisible("start_location_combo", show_start);
567 sInstance->childSetVisible("start_location_text", show_start);
568 sInstance->childSetVisible("server_combo", TRUE);
569}
570
571void LoginFloater::newShow(const std::string &grid, bool initialLogin)
572{
573
574 llwarns << "newShow called" << llendl;
575 if(NULL==sInstance)
576 {
577 LoginFloater::sGrid = grid;
578 LoginFloater::sIsInitialLogin = initialLogin;
579 sInstance = new LoginFloater();
580
581 llwarns << "sInstance assigned. sInstance=" << sInstance << llendl;
582 }
583
584 llwarns << "newshow called" << llendl;
585 sInstance->mCurGrid = gHippoGridManager->getCurrentGridNick();
586 refresh_grids();
587
588 sInstance->open(); /*Flawfinder: ignore*/
589 // we're important
590 //sInstance->setFrontmost(TRUE);
591 //sInstance->setFocus(TRUE);
592
593}
594
595void LoginFloater::show(const LLRect &rect, BOOL show_server,
596 void (*callback)(S32 option, void* user_data),
597 void* callback_data)
598{
599 // we don't need a grid passed in because this is old-style login
600 std::string grid = "";
601 newShow(grid, TRUE);
602}
603
604void LoginFloater::setFocus(BOOL b)
605{
606 if(b != hasFocus())
607 {
608 if(b)
609 {
610 LoginFloater::giveFocus();
611 }
612 else
613 {
614 LLPanel::setFocus(b);
615 }
616 }
617}
618
619void LoginFloater::giveFocus()
620{
621 LLScrollListCtrl *combo = NULL;
622
623 if(NULL==sInstance)
624 {
625 llwarns << "giveFocus has no LoginFloater instance. sInstance=" << sInstance << llendl;
626 return;
627 }
628
629 // for our combo box approach, selecting the combo box is almost always
630 // the right thing to do on the floater receiving focus
631 combo = sInstance->getChild<LLScrollListCtrl>("grid_selector");
632 combo->setFocus(TRUE);
633}
634
635BOOL LoginFloater::isGridComboDirty()
636{
637 BOOL user_picked = FALSE;
638 if (!sInstance)
639 {
640 llwarns << "Attempted getServer with no login view shown" << llendl;
641 }
642 else
643 {
644 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
645 user_picked = combo->isDirty();
646 }
647 return user_picked;
648}
649
650void LoginFloater::getLocation(std::string &location)
651{
652 if (!sInstance)
653 {
654 llwarns << "Attempted getLocation with no login view shown" << llendl;
655 return;
656 }
657
658 LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo");
659 location = combo->getValue().asString();
660}
661
662std::string& LoginFloater::getPassword()
663{
664 return mMungedPassword;
665}
666
667void LoginFloater::setPassword(std::string &password)
668{
669 mMungedPassword = password;
670}
671
672bool LoginFloater::isSamePassword(std::string &password)
673{
674 return mMungedPassword == password;
675}
676
677void LoginFloater::addServer(const std::string& server, S32 domain_name)
678{
679 if (!sInstance)
680 {
681 llwarns << "Attempted addServer with no login view shown" << llendl;
682 return;
683 }
684
685 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
686 combo->add(server, LLSD(domain_name) );
687 combo->setCurrentByIndex(0);
688}
689
690void LoginFloater::cancel_old()
691{
692 if(NULL==sInstance)
693 return;
694
695 if(sInstance->sIsInitialLogin)
696 {
697 // send a callback that indicates we're quitting or closing
698 if(sInstance->mCallback)
699 sInstance->mCallback(LOGIN_OPTION_QUIT, sInstance->mCallbackData);
700 return;
701 }
702
703 sInstance->close();
704}
705
706void LoginFloater::hashPassword(const std::string& password, std::string& hashedPassword)
707{
708 // Max "actual" password length is 16 characters.
709 // Hex digests are always 32 characters.
710 if (password.length() == 32)
711 {
712 hashedPassword = password;
713 }
714 else
715 {
716 // this is a normal text password
717 LLMD5 pass((unsigned char *)password.c_str());
718 char munged_password[MD5HEX_STR_SIZE];
719 pass.hex_digest(munged_password);
720 hashedPassword = munged_password;
721 }
722
723}
724
diff --git a/linden/indra/newview/floaterlogin.h b/linden/indra/newview/floaterlogin.h
new file mode 100644
index 0000000..cdb60b0
--- /dev/null
+++ b/linden/indra/newview/floaterlogin.h
@@ -0,0 +1,90 @@
1/*
2 * floaterlogin.h (floatergridmanager.h pls)
3 * This is Meerkats grid manager, and I accidentally finished it with the wrong name :)
4 * -Patrick Sapinski (Monday, August 17, 2009)
5 */
6
7#ifndef PL_floaterlogin_H
8#define PL_floaterlogin_H
9
10#define LOGIN_OPTION_CONNECT 0
11#define LOGIN_OPTION_QUIT 1
12
13#include "llfloater.h"
14
15class LoginController;
16class AuthenticationModel;
17
18class LoginFloater : public LLFloater
19{
20public:
21 LoginFloater();
22 virtual ~LoginFloater();
23
24 virtual BOOL postBuild();
25
26 static void refresh_grids();
27 void apply();
28 void setDefault();
29 void cancel();
30
31 // new-style login methods
32 static void newShow(const std::string &grid, bool initialLogin);
33 virtual std::string& getPassword();
34 virtual void setPassword(std::string &password);
35 virtual bool isSamePassword(std::string &password);
36 static void getFields(std::string &loginname, std::string &password,
37 BOOL &remember);
38 static void setFields(const std::string &loginname, const std::string &password,
39 BOOL remember);
40
41 // LLLoginPanel compatibility
42 //TODO: Make this not suck
43 static void show(const LLRect &rect, BOOL show_server,
44 void (*callback)(S32 option, void *user_data),
45 void *callback_data);
46 static void close();
47 static void setAlwaysRefresh(bool refresh);
48 static void refreshLocation(bool force_visible);
49 virtual void setFocus(BOOL b);
50 static void giveFocus();
51 static void getLocation(std::string &location);
52 static BOOL isGridComboDirty();
53 static void addServer(const std::string& server, S32 domain_name);
54 static void cancel_old();
55 static void hashPassword(const std::string& password, std::string& hashedPassword);
56protected:
57 static bool sIsInitialLogin;
58 static std::string sGrid;
59private:
60 enum State { NORMAL, ADD_NEW, ADD_COPY };
61 State mState;
62 std::string mCurGrid;
63
64 std::string mIncomingPassword;
65 std::string mMungedPassword;
66
67 void applyChanges();
68 bool createNewGrid();
69 void update();
70 void retrieveGridInfo();
71
72 static void onSelectGrid(LLUICtrl *ctrl, void *data);
73 static void onClickDelete(void *data);
74 static void onClickAdd(void *data);
75 static void onClickCopy(void *data);
76 static void onClickOk(void *data);
77 static void onClickApply(void *data);
78 static void onClickDefault(void *data);
79 static void onClickGridInfo(void *data);
80 static void onClickCancel(void *data);
81
82 static LoginFloater *sInstance;
83 static LoginController *sController;
84 static AuthenticationModel *sModel;
85
86 void (*mCallback)(S32 option, void *userdata);
87 void *mCallbackData;
88};
89
90#endif // PL_floaterlogin_H
diff --git a/linden/indra/newview/hippoGridManager.cpp b/linden/indra/newview/hippoGridManager.cpp
new file mode 100644
index 0000000..56d585c
--- /dev/null
+++ b/linden/indra/newview/hippoGridManager.cpp
@@ -0,0 +1,598 @@
1
2
3#include "hippoGridManager.h"
4
5#include <cctype>
6
7#include <stdtypes.h>
8#include <lldir.h>
9#include <lleconomy.h>
10#include <llerror.h>
11#include <llfile.h>
12#include <llhttpclient.h>
13#include <llsdserialize.h>
14#include "llviewercontrol.h"
15#include "llweb.h"
16
17#include "hippoRestRequest.h"
18
19
20// ********************************************************************
21// Global Variables
22
23HippoGridManager *gHippoGridManager = 0;
24
25HippoGridInfo HippoGridInfo::FALLBACK_GRIDINFO("");
26
27
28
29// ********************************************************************
30// ********************************************************************
31// HippoGridInfo
32// ********************************************************************
33// ********************************************************************
34
35
36// ********************************************************************
37// Initialize
38
39HippoGridInfo::HippoGridInfo(const std::string &gridNick) :
40 mPlatform(PLATFORM_OTHER),
41 mGridNick(gridNick),
42 mRenderCompat(true),
43 mCurrencySymbol("OS$"),
44 mRealCurrencySymbol("US$"),
45 mDirectoryFee(30)
46{
47 cleanUpGridNick(mGridNick);
48}
49
50
51void HippoGridInfo::setPlatform(Platform platform)
52{
53 mPlatform = platform;
54 mCurrencySymbol = (mPlatform == PLATFORM_SECONDLIFE)? "L$": "OS$";
55}
56
57
58void HippoGridInfo::setPlatform(const std::string &platform)
59{
60 std::string tmp = platform;
61 for (unsigned i=0; i<platform.size(); i++)
62 tmp[i] = tolower(tmp[i]);
63
64 if (tmp == "opensim") {
65 setPlatform(PLATFORM_OPENSIM);
66 } else if (tmp == "secondlife") {
67 setPlatform(PLATFORM_SECONDLIFE);
68 } else {
69 setPlatform(PLATFORM_OTHER);
70 llwarns << "Unknown platform '" << platform << "'." << llendl;
71 }
72}
73
74
75// ********************************************************************
76// Grid Info
77
78std::string HippoGridInfo::getSearchUrl(SearchType ty) const
79{
80 if ((mPlatform == PLATFORM_SECONDLIFE) || mSearchUrl.empty()) {
81 // Second Life defaults
82 if (ty == SEARCH_ALL_EMPTY) {
83 return gSavedSettings.getString("SearchURLDefault");
84 } else if (ty == SEARCH_ALL_QUERY) {
85 return gSavedSettings.getString("SearchURLQuery");
86 } else if (ty == SEARCH_ALL_TEMPLATE) {
87 return gSavedSettings.getString("SearchURLSuffix2");
88 } else {
89 llinfos << "Illegal search URL type " << ty << llendl;
90 return "";
91 }
92 } else {
93 // OpenSim and other
94 if (ty == SEARCH_ALL_EMPTY) {
95 return (mSearchUrl + "panel=All&");
96 } else if (ty == SEARCH_ALL_QUERY) {
97 return (mSearchUrl + "q=[QUERY]&s=[COLLECTION]&");
98 } else if (ty == SEARCH_ALL_TEMPLATE) {
99 return "lang=[LANG]&m=[MATURE]&t=[TEEN]&region=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]";
100 } else {
101 llinfos << "Illegal search URL type " << ty << llendl;
102 return "";
103 }
104 }
105}
106
107
108//static
109void HippoGridInfo::onXmlElementStart(void *userData, const XML_Char *name, const XML_Char **atts)
110{
111 HippoGridInfo *self = (HippoGridInfo*)userData;
112 if (strcasecmp(name, "gridnick") == 0)
113 self->mXmlState = XML_GRIDNICK;
114 else if (strcasecmp(name, "gridname") == 0)
115 self->mXmlState = XML_GRIDNAME;
116 else if (strcasecmp(name, "platform") == 0)
117 self->mXmlState = XML_PLATFORM;
118 else if ((strcasecmp(name, "login") == 0) || (strcasecmp(name, "loginuri") == 0))
119 self->mXmlState = XML_LOGINURI;
120 else if ((strcasecmp(name, "welcome") == 0) || (strcasecmp(name, "loginpage") == 0))
121 self->mXmlState = XML_LOGINPAGE;
122 else if ((strcasecmp(name, "economy") == 0) || (strcasecmp(name, "helperuri") == 0))
123 self->mXmlState = XML_HELPERURI;
124 else if ((strcasecmp(name, "about") == 0) || (strcasecmp(name, "website") == 0))
125 self->mXmlState = XML_WEBSITE;
126 else if ((strcasecmp(name, "help") == 0) || (strcasecmp(name, "support") == 0))
127 self->mXmlState = XML_SUPPORT;
128 else if ((strcasecmp(name, "register") == 0) || (strcasecmp(name, "account") == 0))
129 self->mXmlState = XML_REGISTER;
130 else if (strcasecmp(name, "password") == 0)
131 self->mXmlState = XML_PASSWORD;
132 //else if (strcasecmp(name, "search") == 0)
133 //self->mXmlState = XML_SEARCH;
134}
135
136//static
137void HippoGridInfo::onXmlElementEnd(void *userData, const XML_Char *name)
138{
139 HippoGridInfo *self = (HippoGridInfo*)userData;
140 self->mXmlState = XML_VOID;
141}
142
143//static
144void HippoGridInfo::onXmlCharacterData(void *userData, const XML_Char *s, int len)
145{
146 HippoGridInfo *self = (HippoGridInfo*)userData;
147 switch (self->mXmlState) {
148
149 case XML_GRIDNICK:
150 if (self->mGridNick == "") self->mGridNick.assign(s, len);
151 cleanUpGridNick(self->mGridNick);
152 break;
153
154 case XML_PLATFORM: {
155 std::string platform(s, len);
156 self->setPlatform(platform);
157 break;
158 }
159
160 case XML_LOGINURI:
161 self->mLoginUri.assign(s, len);
162 cleanUpUri(self->mLoginUri);
163 break;
164
165 case XML_HELPERURI:
166 self->mHelperUri.assign(s, len);
167 cleanUpUri(self->mHelperUri);
168 break;
169
170 case XML_SEARCH:
171 //self->mSearchUrl.assign(s, len);
172 //cleanUpQueryUrl(mSearchUrl);
173 break;
174
175 case XML_GRIDNAME: self->mGridName.assign(s, len); break;
176 case XML_LOGINPAGE: self->mLoginPage.assign(s, len); break;
177 case XML_WEBSITE: self->mWebSite.assign(s, len); break;
178 case XML_SUPPORT: self->mSupportUrl.assign(s, len); break;
179 case XML_REGISTER: self->mRegisterUrl.assign(s, len); break;
180 case XML_PASSWORD: self->mPasswordUrl.assign(s, len); break;
181
182 case XML_VOID: break;
183 }
184}
185
186
187bool HippoGridInfo::retrieveGridInfo()
188{
189 if (mLoginUri == "") return false;
190
191 std::string reply;
192 int result = HippoRestRequest::getBlocking(mLoginUri + "get_grid_info", &reply);
193 if (result != 200) return false;
194
195 llinfos << "Received: " << reply << llendl;
196
197 bool success = true;
198 XML_Parser parser = XML_ParserCreate(0);
199 XML_SetUserData(parser, this);
200 XML_SetElementHandler(parser, onXmlElementStart, onXmlElementEnd);
201 XML_SetCharacterDataHandler(parser, onXmlCharacterData);
202 mXmlState = XML_VOID;
203 if (!XML_Parse(parser, reply.data(), reply.size(), TRUE)) {
204 llwarns << "XML Parse Error: " << XML_ErrorString(XML_GetErrorCode(parser)) << llendl;
205 success = false;
206 }
207 XML_ParserFree(parser);
208
209 return success;
210}
211
212
213std::string HippoGridInfo::getUploadFee() const
214{
215 std::string fee;
216 formatFee(fee, LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(), true);
217 return fee;
218}
219
220std::string HippoGridInfo::getGroupCreationFee() const
221{
222 std::string fee;
223 formatFee(fee, LLGlobalEconomy::Singleton::getInstance()->getPriceGroupCreate(), false);
224 return fee;
225}
226
227std::string HippoGridInfo::getDirectoryFee() const
228{
229 std::string fee;
230 formatFee(fee, mDirectoryFee, true);
231 if (fee != "free") fee += "/week";
232 return fee;
233}
234
235void HippoGridInfo::formatFee(std::string &fee, int cost, bool showFree) const
236{
237 if (showFree && (cost == 0)) {
238 fee = "free";
239 } else {
240 fee = llformat("%s%d", getCurrencySymbol().c_str(), cost);
241 }
242}
243
244
245// ********************************************************************
246// Static Helpers
247
248// static
249const char *HippoGridInfo::getPlatformString(Platform platform)
250{
251 static const char *platformStrings[PLATFORM_LAST] = {
252 "Other", "OpenSim", "SecondLife"
253 };
254
255 if ((platform < PLATFORM_OTHER) || (platform >= PLATFORM_LAST))
256 platform = PLATFORM_OTHER;
257 return platformStrings[platform];
258}
259
260
261// static
262void HippoGridInfo::cleanUpGridNick(std::string &gridnick)
263{
264 std::string tmp;
265 int size = gridnick.size();
266 for (int i=0; i<size; i++) {
267 char c = gridnick[i];
268 if ((c == '_') || isalnum(c)) {
269 tmp += tolower(c);
270 } else if (isspace(c)) {
271 tmp += "_";
272 }
273 }
274 gridnick = tmp;
275}
276
277// static
278void HippoGridInfo::cleanUpUri(std::string &uri)
279{
280 std::string::size_type n = uri.rfind('/');
281 if ((n == std::string::npos) || (n < 10))
282 uri += '/';
283}
284
285
286void HippoGridInfo::initFallback()
287{
288 FALLBACK_GRIDINFO.mGridNick = "secondlife";
289 FALLBACK_GRIDINFO.setPlatform(PLATFORM_SECONDLIFE);
290 FALLBACK_GRIDINFO.setGridName("Second Life");
291 FALLBACK_GRIDINFO.setLoginUri("https://login.agni.lindenlab.com/cgi-bin/login.cgi");
292 FALLBACK_GRIDINFO.setLoginPage("http://secondlife.com/app/login/");
293 FALLBACK_GRIDINFO.setHelperUri("https://secondlife.com/helpers/");
294 FALLBACK_GRIDINFO.setWebSite("http://secondlife.com/");
295}
296
297
298
299// ********************************************************************
300// ********************************************************************
301// HippoGridManager
302// ********************************************************************
303// ********************************************************************
304
305
306// ********************************************************************
307// Initialize
308
309HippoGridManager::HippoGridManager() :
310 mConnectedGrid(0),
311 mDefaultGridsVersion(0)
312{
313}
314
315HippoGridManager::~HippoGridManager()
316{
317 cleanup();
318}
319
320
321void HippoGridManager::cleanup()
322{
323 std::map<std::string, HippoGridInfo*>::iterator it, end = mGridInfo.end();
324 for (it=mGridInfo.begin(); it != end; ++it) {
325 delete it->second;
326 }
327 mGridInfo.clear();
328}
329
330
331void HippoGridManager::init()
332{
333 HippoGridInfo::initFallback();
334 loadFromFile();
335
336 // !!!### gSavedSettings.getControl("CmdLineLoginURI");
337 // !!!### gSavedSettings.getString("CmdLineLoginPage");
338 // !!!### gSavedSettings.getString("CmdLineHelperURI");
339 // !!!### LLString::compareInsensitive(gGridInfo[grid_index].mLabel, grid_name.c_str()))
340}
341
342
343void HippoGridManager::discardAndReload()
344{
345 cleanup();
346 loadFromFile();
347}
348
349
350// ********************************************************************
351// Public Access
352
353HippoGridInfo *HippoGridManager::getGrid(const std::string &grid) const
354{
355 std::map<std::string, HippoGridInfo*>::const_iterator it;
356 it = mGridInfo.find(grid);
357 if (it != mGridInfo.end()) {
358 return it->second;
359 } else {
360 return 0;
361 }
362}
363
364
365HippoGridInfo *HippoGridManager::getCurrentGrid() const
366{
367 HippoGridInfo *grid = getGrid(mCurrentGrid);
368 if (grid) {
369 return grid;
370 } else {
371 return &HippoGridInfo::FALLBACK_GRIDINFO;
372 }
373}
374
375
376void HippoGridManager::addGrid(HippoGridInfo *grid)
377{
378 if (!grid) return;
379 const std::string &nick = grid->getGridNick();
380 if (nick == "") {
381 llwarns << "Ignoring to try adding grid with empty nick." << llendl;
382 delete grid;
383 return;
384 }
385 if (mGridInfo.find(nick) != mGridInfo.end()) {
386 llwarns << "Ignoring to try adding existing grid " << nick << '.' << llendl;
387 delete grid;
388 return;
389 }
390 mGridInfo[nick] = grid;
391}
392
393
394void HippoGridManager::deleteGrid(const std::string &grid)
395{
396 GridIterator it = mGridInfo.find(grid);
397 if (it == mGridInfo.end()) {
398 llwarns << "Trying to delete non-existing grid " << grid << '.' << llendl;
399 return;
400 }
401 mGridInfo.erase(it);
402 llinfos << "Number of grids now: " << mGridInfo.size() << llendl;
403 if (mGridInfo.empty()) llinfos << "Grid info map is empty." << llendl;
404 if (grid == mDefaultGrid)
405 setDefaultGrid(""); // sets first grid, if map not empty
406 if (grid == mCurrentGrid)
407 mCurrentGrid = mDefaultGrid;
408}
409
410
411void HippoGridManager::setDefaultGrid(const std::string &grid)
412{
413 GridIterator it = mGridInfo.find(grid);
414 if (it != mGridInfo.end()) {
415 mDefaultGrid = grid;
416 } else if (mGridInfo.find("secondlife") != mGridInfo.end()) {
417 mDefaultGrid = "secondlife";
418 } else if (!mGridInfo.empty()) {
419 mDefaultGrid = mGridInfo.begin()->first;
420 } else {
421 mDefaultGrid = "";
422 }
423}
424
425
426void HippoGridManager::setCurrentGrid(const std::string &grid)
427{
428 GridIterator it = mGridInfo.find(grid);
429 if (it != mGridInfo.end()) {
430 mCurrentGrid = grid;
431 } else if (!mGridInfo.empty()) {
432 llwarns << "Unknown grid '" << grid << "'. Setting to default grid." << llendl;
433 mCurrentGrid = mDefaultGrid;
434 }
435}
436
437
438// ********************************************************************
439// Persistent Store
440
441void HippoGridManager::loadFromFile()
442{
443 mDefaultGridsVersion = 0;
444 // load user grid info
445 parseFile(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grid_info.xml"), false);
446 // merge default grid info, if newer. Force load, if list of grids is empty.
447 parseFile(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "default_grids.xml"), !mGridInfo.empty());
448 // merge grid info from web site, if newer. Force load, if list of grids is empty.
449 if (gSavedSettings.getBOOL("CheckForGridUpdates"))
450 parseUrl("http://meerkatviewer.org/scripts/grids.php", !mGridInfo.empty());
451
452 setDefaultGrid(gSavedSettings.getString("DefaultGrid"));
453 setCurrentGrid(gSavedSettings.getString("DefaultGrid"));
454}
455
456
457void HippoGridManager::parseUrl(const char *url, bool mergeIfNewer)
458{
459 llinfos << "Loading grid info from '" << url << "'." << llendl;
460
461 // query update server
462 std::string escaped_url = LLWeb::escapeURL(url);
463 LLSD response = LLHTTPClient::blockingGet(url);
464
465 // check response, return on error
466 S32 status = response["status"].asInteger();
467 if ((status != 200) || !response["body"].isArray()) {
468 llinfos << "GridInfo Update failed (" << status << "): "
469 << (response["body"].isString()? response["body"].asString(): "<unknown error>")
470 << llendl;
471 return;
472 }
473
474 LLSD gridInfo = response["body"];
475 parseData(gridInfo, mergeIfNewer);
476}
477
478void HippoGridManager::parseFile(const std::string &fileName, bool mergeIfNewer)
479{
480 llifstream infile;
481 infile.open(fileName.c_str());
482 if(!infile.is_open()) {
483 llwarns << "Cannot find grid info file " << fileName << " to load." << llendl;
484 return;
485 }
486
487 LLSD gridInfo;
488 if (LLSDSerialize::fromXML(gridInfo, infile) <= 0) {
489 llwarns << "Unable to parse grid info file " << fileName << '.' << llendl;
490 return;
491 }
492
493 llinfos << "Loading grid info file " << fileName << '.' << llendl;
494 parseData(gridInfo, mergeIfNewer);
495}
496
497
498void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer)
499{
500 if (mergeIfNewer) {
501 LLSD::array_const_iterator it, end = gridInfo.endArray();
502 for (it = gridInfo.beginArray(); it != end; ++it) {
503 LLSD gridMap = *it;
504 if (gridMap.has("default_grids_version")) {
505 int version = gridMap["default_grids_version"];
506 if (version <= mDefaultGridsVersion) return;
507 else break;
508 }
509 }
510 if (it == end) {
511 llwarns << "Grid data has no version number." << llendl;
512 return;
513 }
514 }
515
516 llinfos << "Loading grid data." << llendl;
517
518 LLSD::array_const_iterator it, end = gridInfo.endArray();
519 for (it = gridInfo.beginArray(); it != end; ++it) {
520 LLSD gridMap = *it;
521 if (gridMap.has("default_grids_version")) {
522 mDefaultGridsVersion = gridMap["default_grids_version"];
523 } else if (gridMap.has("gridnick") && gridMap.has("loginuri")) {
524 std::string gridnick = gridMap["gridnick"];
525 HippoGridInfo *grid;
526 GridIterator it = mGridInfo.find(gridnick);
527 bool newGrid = (it == mGridInfo.end());
528 if (newGrid) {
529 // create new grid info
530 grid = new HippoGridInfo(gridnick);
531 } else {
532 // update existing grid info
533 grid = it->second;
534 }
535 grid->setLoginUri(gridMap["loginuri"]);
536 if (gridMap.has("platform")) grid->setPlatform(gridMap["platform"]);
537 if (gridMap.has("gridname")) grid->setGridName(gridMap["gridname"]);
538 if (gridMap.has("loginpage")) grid->setLoginPage(gridMap["loginpage"]);
539 if (gridMap.has("helperuri")) grid->setHelperUri(gridMap["helperuri"]);
540 if (gridMap.has("website")) grid->setWebSite(gridMap["website"]);
541 if (gridMap.has("support")) grid->setSupportUrl(gridMap["support"]);
542 if (gridMap.has("register")) grid->setRegisterUrl(gridMap["register"]);
543 if (gridMap.has("password")) grid->setPasswordUrl(gridMap["password"]);
544 //if (gridMap.has("search")) grid->setSearchUrl(gridMap["search"]);
545 if (gridMap.has("render_compat")) grid->setRenderCompat(gridMap["render_compat"]);
546 if (gridMap.has("firstname")) grid->setFirstName(gridMap["firstname"]);
547 if (gridMap.has("lastname")) grid->setLastName(gridMap["lastname"]);
548 if (gridMap.has("avatarpassword")) grid->setAvatarPassword(gridMap["avatarpassword"]);
549 if (newGrid) addGrid(grid);
550 }
551 }
552}
553
554
555void HippoGridManager::saveFile()
556{
557 // save default grid to client settings
558 gSavedSettings.setString("DefaultGrid", mDefaultGrid);
559
560 // build LLSD
561 LLSD gridInfo;
562 gridInfo[0]["default_grids_version"] = mDefaultGridsVersion;
563
564 // add grids
565 S32 i = 1;
566 GridIterator it, end = mGridInfo.end();
567 for (it = mGridInfo.begin(); it != end; ++it, i++) {
568 HippoGridInfo *grid = it->second;
569 gridInfo[i]["gridnick"] = grid->getGridNick();
570 gridInfo[i]["platform"] = HippoGridInfo::getPlatformString(grid->getPlatform());
571 gridInfo[i]["gridname"] = grid->getGridName();
572 gridInfo[i]["loginuri"] = grid->getLoginUri();
573 gridInfo[i]["loginpage"] = grid->getLoginPage();
574 gridInfo[i]["helperuri"] = grid->getHelperUri();
575 gridInfo[i]["website"] = grid->getWebSite();
576 gridInfo[i]["support"] = grid->getSupportUrl();
577 gridInfo[i]["register"] = grid->getRegisterUrl();
578 gridInfo[i]["password"] = grid->getPasswordUrl();
579 gridInfo[i]["firstname"] = grid->getFirstName();
580 gridInfo[i]["lastname"] = grid->getLastName();
581 gridInfo[i]["avatarpassword"] = grid->getAvatarPassword();
582
583 //gridInfo[i]["search"] = grid->getSearchUrl();
584 gridInfo[i]["render_compat"] = grid->isRenderCompat();
585 }
586
587 // write client grid info file
588 std::string fileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grid_info.xml");
589 llofstream file;
590 file.open(fileName.c_str());
591 if (file.is_open()) {
592 LLSDSerialize::toPrettyXML(gridInfo, file);
593 file.close();
594 llinfos << "Saved grids to " << fileName << llendl;
595 } else {
596 llerrs << "Unable to open grid info file: " << fileName << llendl;
597 }
598}
diff --git a/linden/indra/newview/hippoGridManager.h b/linden/indra/newview/hippoGridManager.h
new file mode 100644
index 0000000..9925495
--- /dev/null
+++ b/linden/indra/newview/hippoGridManager.h
@@ -0,0 +1,175 @@
1#ifndef __HIPPO_GRID_MANAGER_H__
2#define __HIPPO_GRID_MANAGER_H__
3
4
5#include <map>
6#include <string>
7
8#ifndef XML_STATIC
9#define XML_STATIC
10#endif
11
12#ifdef LL_STANDALONE
13#include <expat.h>
14#else
15#include "expat/expat.h"
16#endif
17
18class LLSD;
19
20
21class HippoGridInfo
22{
23public:
24 enum Platform {
25 PLATFORM_OTHER = 0,
26 PLATFORM_OPENSIM,
27 PLATFORM_SECONDLIFE,
28 PLATFORM_LAST
29 };
30 enum SearchType {
31 SEARCH_ALL_EMPTY,
32 SEARCH_ALL_QUERY,
33 SEARCH_ALL_TEMPLATE
34 };
35
36 explicit HippoGridInfo(const std::string &gridNick);
37
38 Platform getPlatform() const { return mPlatform; }
39 const std::string &getGridNick() const { return mGridNick; }
40 const std::string &getGridName() const { return mGridName; }
41 const std::string &getLoginUri() const { return mLoginUri; }
42 const std::string &getLoginPage() const { return mLoginPage; }
43 const std::string &getHelperUri() const { return mHelperUri; }
44 const std::string &getWebSite() const { return mWebSite; }
45 const std::string &getSupportUrl() const { return mSupportUrl; }
46 const std::string &getRegisterUrl() const { return mRegisterUrl; }
47 const std::string &getPasswordUrl() const { return mPasswordUrl; }
48 const std::string &getSearchUrl() const { return mSearchUrl; }
49 const std::string &getFirstName() const { return mFirstName; }
50 const std::string &getLastName() const { return mLastName; }
51 const std::string &getAvatarPassword() const { return mAvatarPassword; }
52 std::string getSearchUrl(SearchType ty) const;
53 bool isRenderCompat() const { return mRenderCompat; }
54
55 const std::string &getCurrencySymbol() const { return mCurrencySymbol; }
56 const std::string &getRealCurrencySymbol() const { return mRealCurrencySymbol; }
57 std::string getUploadFee() const;
58 std::string getGroupCreationFee() const;
59 std::string getDirectoryFee() const;
60
61 bool isOpenSimulator() const { return (mPlatform == PLATFORM_OPENSIM ); }
62 bool isSecondLife() const { return (mPlatform == PLATFORM_SECONDLIFE); }
63
64 void setPlatform (const std::string &platform);
65 void setPlatform (Platform platform);
66 void setGridName (const std::string &gridName) { mGridName = gridName; }
67 void setLoginUri (const std::string &loginUri) { mLoginUri = loginUri; cleanUpUri(mLoginUri); }
68 void setLoginPage(const std::string &loginPage) { mLoginPage = loginPage; }
69 void setHelperUri(const std::string &helperUri) { mHelperUri = helperUri; cleanUpUri(mHelperUri); }
70 void setWebSite (const std::string &website) { mWebSite = website; }
71 void setSupportUrl(const std::string &url) { mSupportUrl = url; }
72 void setRegisterUrl(const std::string &url) { mRegisterUrl = url; }
73 void setPasswordUrl(const std::string &url) { mPasswordUrl = url; }
74 void setSearchUrl(const std::string &url) { mSearchUrl = url; }
75 void setRenderCompat(bool compat) { mRenderCompat = compat; }
76 void setFirstName(const std::string &firstName) { mFirstName = firstName; } //aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
77 void setLastName(const std::string &lastName) { mLastName = lastName; }
78 void setAvatarPassword(const std::string &avatarPassword) { mAvatarPassword = avatarPassword; }
79
80 void setCurrencySymbol(const std::string &sym) { mCurrencySymbol = sym.substr(0, 3); }
81 void setRealCurrencySymbol(const std::string &sym) { mRealCurrencySymbol = sym.substr(0, 3); }
82 void setDirectoryFee(int fee) { mDirectoryFee = fee; }
83
84 bool retrieveGridInfo();
85
86 static const char *getPlatformString(Platform platform);
87 static void cleanUpGridNick(std::string &gridnick);
88
89 static HippoGridInfo FALLBACK_GRIDINFO;
90 static void initFallback();
91
92private:
93 Platform mPlatform;
94 std::string mGridNick;
95 std::string mGridName;
96 std::string mLoginUri;
97 std::string mLoginPage;
98 std::string mHelperUri;
99 std::string mWebSite;
100 std::string mSupportUrl;
101 std::string mRegisterUrl;
102 std::string mPasswordUrl;
103 std::string mSearchUrl;
104 std::string mFirstName;
105 std::string mLastName;
106 std::string mAvatarPassword;
107 bool mRenderCompat;
108
109 std::string mCurrencySymbol;
110 std::string mRealCurrencySymbol;
111 int mDirectoryFee;
112
113 // for parsing grid info XML
114 enum XmlState {
115 XML_VOID, XML_GRIDNICK, XML_PLATFORM, XML_GRIDNAME,
116 XML_LOGINURI, XML_LOGINPAGE, XML_HELPERURI,
117 XML_WEBSITE, XML_SUPPORT, XML_REGISTER, XML_PASSWORD, XML_SEARCH
118 };
119 XmlState mXmlState;
120
121 static void cleanUpUri(std::string &uri);
122 void formatFee(std::string &fee, int cost, bool showFree) const;
123
124 static void onXmlElementStart(void *userData, const XML_Char *name, const XML_Char **atts);
125 static void onXmlElementEnd(void *userData, const XML_Char *name);
126 static void onXmlCharacterData(void *userData, const XML_Char *s, int len);
127};
128
129
130class HippoGridManager
131{
132public:
133 HippoGridManager();
134 ~HippoGridManager();
135
136 void init();
137 void saveFile();
138 void discardAndReload();
139
140 HippoGridInfo *getGrid(const std::string &grid) const;
141 HippoGridInfo *getConnectedGrid() const { return (mConnectedGrid)? mConnectedGrid: getCurrentGrid(); }
142 HippoGridInfo *getCurrentGrid() const;
143 const std::string &getDefaultGridNick() const { return mDefaultGrid; }
144 const std::string &getCurrentGridNick() const { return mCurrentGrid; }
145
146 void setDefaultGrid(const std::string &grid);
147 void setCurrentGrid(const std::string &grid);
148 void setCurrentGridAsConnected() { mConnectedGrid = getCurrentGrid(); }
149
150 void addGrid(HippoGridInfo *grid);
151 void deleteGrid(const std::string &grid);
152
153 typedef std::map<std::string, HippoGridInfo*>::iterator GridIterator;
154 GridIterator beginGrid() { return mGridInfo.begin(); }
155 GridIterator endGrid() { return mGridInfo.end(); }
156
157private:
158 std::map<std::string, HippoGridInfo*> mGridInfo;
159 std::string mDefaultGrid;
160 std::string mCurrentGrid;
161 HippoGridInfo *mConnectedGrid;
162 int mDefaultGridsVersion;
163
164 void cleanup();
165 void loadFromFile();
166 void parseFile(const std::string &fileName, bool mergeIfNewer);
167 void parseUrl(const char *url, bool mergeIfNewer);
168 void parseData(LLSD &gridInfo, bool mergeIfNewer);
169};
170
171
172extern HippoGridManager *gHippoGridManager;
173
174
175#endif
diff --git a/linden/indra/newview/hippoLimits.cpp b/linden/indra/newview/hippoLimits.cpp
new file mode 100644
index 0000000..d5deb9f
--- /dev/null
+++ b/linden/indra/newview/hippoLimits.cpp
@@ -0,0 +1,54 @@
1
2
3#include "hippoLimits.h"
4
5#include "hippoGridManager.h"
6
7#include <llerror.h>
8
9
10HippoLimits *gHippoLimits = 0;
11
12
13HippoLimits::HippoLimits()
14{
15 setLimits();
16}
17
18
19void HippoLimits::setLimits()
20{
21 if (gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE) {
22 setSecondLifeLimits();
23 } else {
24 setOpenSimLimits();
25 }
26}
27
28
29void HippoLimits::setOpenSimLimits()
30{
31 mMaxAgentGroups = 100;
32 mMaxPrimScale = 256.0f;
33 mMaxHeight = 10000.0f;
34 if (gHippoGridManager->getConnectedGrid()->isRenderCompat()) {
35 llinfos << "Using rendering compatible OpenSim limits." << llendl;
36 mMinHoleSize = 0.05f;
37 mMaxHollow = 0.95f;
38 } else {
39 llinfos << "Using Hippo OpenSim limits." << llendl;
40 mMinHoleSize = 0.01f;
41 mMaxHollow = 0.99f;
42 }
43}
44
45void HippoLimits::setSecondLifeLimits()
46{
47 llinfos << "Using Second Life limits." << llendl;
48 mMaxAgentGroups = 25;
49 mMaxPrimScale = 10.0f;
50 mMaxHeight = 4096.0f;
51 mMinHoleSize = 0.05f;
52 mMaxHollow = 0.95f;
53}
54
diff --git a/linden/indra/newview/hippoLimits.h b/linden/indra/newview/hippoLimits.h
new file mode 100644
index 0000000..900480b
--- /dev/null
+++ b/linden/indra/newview/hippoLimits.h
@@ -0,0 +1,33 @@
1#ifndef __HIPPO_LIMITS_H__
2#define __HIPPO_LIMITS_H__
3
4
5class HippoLimits
6{
7public:
8 HippoLimits();
9
10 int getMaxAgentGroups() const { return mMaxAgentGroups; }
11 float getMaxHeight() const { return mMaxHeight; }
12 float getMinHoleSize() const { return mMinHoleSize; }
13 float getMaxHollow() const { return mMaxHollow; }
14 float getMaxPrimScale() const { return mMaxPrimScale; }
15
16 void setLimits();
17
18private:
19 int mMaxAgentGroups;
20 float mMaxHeight;
21 float mMinHoleSize;
22 float mMaxHollow;
23 float mMaxPrimScale;
24
25 void setOpenSimLimits();
26 void setSecondLifeLimits();
27};
28
29
30extern HippoLimits *gHippoLimits;
31
32
33#endif
diff --git a/linden/indra/newview/hippoRestRequest.cpp b/linden/indra/newview/hippoRestRequest.cpp
new file mode 100644
index 0000000..cf518de
--- /dev/null
+++ b/linden/indra/newview/hippoRestRequest.cpp
@@ -0,0 +1,54 @@
1
2
3#include "hippoRestRequest.h"
4
5#ifndef CURL_STATICLIB
6#define CURL_STATICLIB 1
7#endif
8#include <curl/curl.h>
9
10#include <stdtypes.h>
11#include <llerror.h>
12
13
14static size_t curlWrite(void *ptr, size_t size, size_t nmemb, void *userData)
15{
16 std::string *result = (std::string*)userData;
17 size_t bytes = (size * nmemb);
18 result->append((char*)ptr, bytes);
19 return nmemb;
20}
21
22
23//static
24int HippoRestRequest::getBlocking(const std::string &url, std::string *result)
25{
26 llinfos << "Requesting: " << url << llendl;
27
28 char curlErrorBuffer[CURL_ERROR_SIZE];
29 CURL* curlp = curl_easy_init();
30
31 curl_easy_setopt(curlp, CURLOPT_NOSIGNAL, 1); // don't use SIGALRM for timeouts
32 curl_easy_setopt(curlp, CURLOPT_TIMEOUT, 5); // seconds
33
34 curl_easy_setopt(curlp, CURLOPT_WRITEFUNCTION, curlWrite);
35 curl_easy_setopt(curlp, CURLOPT_WRITEDATA, result);
36 curl_easy_setopt(curlp, CURLOPT_URL, url.c_str());
37 curl_easy_setopt(curlp, CURLOPT_ERRORBUFFER, curlErrorBuffer);
38 curl_easy_setopt(curlp, CURLOPT_FAILONERROR, 1);
39
40 *result = "";
41 S32 curlSuccess = curl_easy_perform(curlp);
42 S32 httpStatus = 499;
43 curl_easy_getinfo(curlp, CURLINFO_RESPONSE_CODE, &httpStatus);
44
45 if (curlSuccess != 0) {
46 llwarns << "CURL ERROR (HTTP Status " << httpStatus << "): " << curlErrorBuffer << llendl;
47 } else if (httpStatus != 200) {
48 llwarns << "HTTP Error " << httpStatus << ", but no Curl error." << llendl;
49 }
50
51 curl_easy_cleanup(curlp);
52 return httpStatus;
53}
54
diff --git a/linden/indra/newview/hippoRestRequest.h b/linden/indra/newview/hippoRestRequest.h
new file mode 100644
index 0000000..1dcb4a0
--- /dev/null
+++ b/linden/indra/newview/hippoRestRequest.h
@@ -0,0 +1,16 @@
1#ifndef __HIPPO_REST_REQTUEST_H__
2#define __HIPPO_REST_REQTUEST_H__
3
4
5#include <string>
6
7
8class HippoRestRequest
9{
10 public:
11 static int getBlocking(const std::string &url, std::string *result);
12
13};
14
15
16#endif
diff --git a/linden/indra/newview/hippoUpdate.cpp b/linden/indra/newview/hippoUpdate.cpp
new file mode 100644
index 0000000..872ca30
--- /dev/null
+++ b/linden/indra/newview/hippoUpdate.cpp
@@ -0,0 +1,92 @@
1
2#include "hippoUpdate.h"
3
4#include <cstdio>
5#include <list>
6#include <vector>
7
8#include <stdtypes.h>
9#include <llhttpclient.h>
10#include <llmemory.h>
11#include <llversionviewer.h>
12#include "llviewercontrol.h"
13#include "llviewernetwork.h"
14#include "llweb.h"
15#include <llwindow.h>
16
17
18std::string gHippoChannel;
19
20
21// static
22bool HippoUpdate::checkUpdate()
23{
24 llinfos << "Hippo Update Check..." << llendl;
25
26 // get channel name
27 gHippoChannel = gSavedSettings.getString("ChannelName");
28
29 // get mac address
30 char macAddress[18];
31 sprintf(macAddress, "%02x:%02x:%02x:%02x:%02x:%02x",
32 gMACAddress[0], gMACAddress[1], gMACAddress[2], gMACAddress[3], gMACAddress[4], gMACAddress[5]);
33
34 // build URL for update check
35 char url[1000];
36 snprintf(url, 1000,
37/* "http://update.mjm.game-host.org/os/viewer.php?"
38 "product=%s&channel=%s&"
39 "version_major=%d&version_minor=%d&version_patch=%d&version_base=%s&"
40 "platform=%s&mac=%s",
41 LL_PRODUCT, LL_CHANNEL_CSTR,
42 LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VERSION_BASE,
43 LL_PLATFORM*/"", macAddress);
44
45 // query update server
46 std::string escaped_url = LLWeb::escapeURL(url);
47 LLSD response = LLHTTPClient::blockingGet(escaped_url.c_str());
48
49 // check response, return on error
50 S32 status = response["status"].asInteger();
51 if ((status != 200) || !response["body"].isMap()) {
52 llinfos << "Hippo Update failed (" << status << "): "
53 << (response["body"].isString()? response["body"].asString(): "<unknown error>")
54 << llendl;
55 return true;
56 }
57
58 // get data from response
59 LLSD data = response["body"];
60 std::string webpage = (data.has("webpage") && data["webpage"].isString())? data["webpage"].asString(): "";
61 std::string message = (data.has("message") && data["message"].isString())? data["message"].asString(): "";
62 std::string yourVersion = (data.has("yourVersion") && data["yourVersion"].isString())? data["yourVersion"].asString(): "";
63 std::string curVersion = (data.has("curVersion") && data["curVersion"].isString())? data["curVersion"].asString(): "";
64 bool update = (data.has("update") && data["update"].isBoolean())? data["update"].asBoolean(): false;
65 bool mandatory = (data.has("mandatory") && data["mandatory"].isBoolean())? data["mandatory"].asBoolean(): false;
66
67 // log and return, if no update available
68 llinfos << "Your version is " << yourVersion << ", current version is " << curVersion << '.' << llendl;
69 if (!update) return true;
70 llinfos << "Update is " << (mandatory? "mandatory.": "optional.") << llendl;
71
72 // show update dialog
73 char msg[1000];
74 snprintf(msg, 1000,
75 "There is a new viewer version available.\n"
76 "\n"
77 "Your version: %s\n"
78 "Current version: %s\n"
79 "%s\n"
80 "Do you want to visit the web site?",
81 yourVersion.c_str(), curVersion.c_str(),
82 mandatory? "\nThis is a mandatory update.\n": "");
83 S32 button = OSMessageBox(msg, "Hippo OpenSim Viewer Update", OSMB_YESNO);
84 if (button == OSBTN_YES) {
85 llinfos << "Taking user to " << webpage << llendl;
86 LLWeb::loadURLExternal(webpage);
87 // exit the viewer
88 return false;
89 }
90
91 return !mandatory;
92}
diff --git a/linden/indra/newview/hippoUpdate.h b/linden/indra/newview/hippoUpdate.h
new file mode 100644
index 0000000..559c8b3
--- /dev/null
+++ b/linden/indra/newview/hippoUpdate.h
@@ -0,0 +1,12 @@
1#ifndef __HIPPO_UPDATE_H__
2#define __HIPPO_UPDATE_H__
3
4
5class HippoUpdate
6{
7 public:
8 static bool checkUpdate();
9};
10
11
12#endif
diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp
index d73ddb6..edcb82c 100644
--- a/linden/indra/newview/llagent.cpp
+++ b/linden/indra/newview/llagent.cpp
@@ -467,6 +467,10 @@ void LLAgent::init()
467//----------------------------------------------------------------------------- 467//-----------------------------------------------------------------------------
468void LLAgent::cleanup() 468void LLAgent::cleanup()
469{ 469{
470 mInitialized = FALSE;
471 mWearablesLoaded = FALSE;
472 mShowAvatar = TRUE;
473
470 setSitCamera(LLUUID::null); 474 setSitCamera(LLUUID::null);
471 mAvatarObject = NULL; 475 mAvatarObject = NULL;
472 mLookAt = NULL; 476 mLookAt = NULL;
@@ -6674,11 +6678,19 @@ BOOL LLAgent::isWearingItem( const LLUUID& item_id )
6674// static 6678// static
6675void LLAgent::processAgentInitialWearablesUpdate( LLMessageSystem* mesgsys, void** user_data ) 6679void LLAgent::processAgentInitialWearablesUpdate( LLMessageSystem* mesgsys, void** user_data )
6676{ 6680{
6681 if (gNoRender)
6682 {
6683 return;
6684 }
6685
6677 // We should only receive this message a single time. Ignore subsequent AgentWearablesUpdates 6686 // We should only receive this message a single time. Ignore subsequent AgentWearablesUpdates
6678 // that may result from AgentWearablesRequest having been sent more than once. 6687 // that may result from AgentWearablesRequest having been sent more than once.
6688 // If we do this, then relogging won't work. - Gigs
6689 /*
6679 static bool first = true; 6690 static bool first = true;
6680 if (!first) return; 6691 if (!first) return;
6681 first = false; 6692 first = false;
6693 */
6682 6694
6683 LLUUID agent_id; 6695 LLUUID agent_id;
6684 gMessageSystem->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); 6696 gMessageSystem->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp
index ab4d8a9..52aa1eb 100644
--- a/linden/indra/newview/llappviewer.cpp
+++ b/linden/indra/newview/llappviewer.cpp
@@ -125,6 +125,7 @@
125#include "llvectorperfoptions.h" 125#include "llvectorperfoptions.h"
126#include "llurlsimstring.h" 126#include "llurlsimstring.h"
127#include "llwatchdog.h" 127#include "llwatchdog.h"
128#include "llcallingcard.h"
128 129
129// Included so that constants/settings might be initialized 130// Included so that constants/settings might be initialized
130// in save_settings_to_globals() 131// in save_settings_to_globals()
@@ -164,6 +165,10 @@
164 165
165#include "llcommandlineparser.h" 166#include "llcommandlineparser.h"
166 167
168#include "hippoGridManager.h"
169#include "hippoLimits.h"
170#include "hippoUpdate.h"
171
167// annoying detail to determine whether font prefs are over-ridden 172// annoying detail to determine whether font prefs are over-ridden
168#if LL_LINUX 173#if LL_LINUX
169# define LL_DYNAMIC_FONT_DISCOVERY 1 174# define LL_DYNAMIC_FONT_DISCOVERY 1
@@ -192,22 +197,35 @@
192 197
193//---------------------------------------------------------------------------- 198//----------------------------------------------------------------------------
194// viewer.cpp - these are only used in viewer, should be easily moved. 199// viewer.cpp - these are only used in viewer, should be easily moved.
200extern void disable_win_error_reporting();
195 201
196#if LL_DARWIN 202#if LL_DARWIN
203#include <Carbon/Carbon.h>
197extern void init_apple_menu(const char* product); 204extern void init_apple_menu(const char* product);
205extern OSErr AEGURLHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn);
206extern OSErr AEQuitHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn);
207extern OSStatus simpleDialogHandler(EventHandlerCallRef handler, EventRef event, void *userdata);
208#include <boost/tokenizer.hpp>
198#endif // LL_DARWIN 209#endif // LL_DARWIN
199 210
211
200extern BOOL gRandomizeFramerate; 212extern BOOL gRandomizeFramerate;
201extern BOOL gPeriodicSlowFrame; 213extern BOOL gPeriodicSlowFrame;
202extern BOOL gDebugGL; 214extern BOOL gDebugGL;
203 215
204//////////////////////////////////////////////////////////// 216////////////////////////////////////////////////////////////
205// All from the last globals push... 217// All from the last globals push...
218
219
206const F32 DEFAULT_AFK_TIMEOUT = 5.f * 60.f; // time with no input before user flagged as Away From Keyboard 220const F32 DEFAULT_AFK_TIMEOUT = 5.f * 60.f; // time with no input before user flagged as Away From Keyboard
207 221
208F32 gSimLastTime; // Used in LLAppViewer::init and send_stats() 222F32 gSimLastTime; // Used in LLAppViewer::init and send_stats()
209F32 gSimFrames; 223F32 gSimFrames;
210 224
225std::string gDisabledMessage; // Set in LLAppViewer::initConfiguration used in idle_startup
226
227BOOL gHideLinks = FALSE; // Set in LLAppViewer::initConfiguration, used externally
228
211BOOL gAllowIdleAFK = TRUE; 229BOOL gAllowIdleAFK = TRUE;
212BOOL gAllowTapTapHoldRun = TRUE; 230BOOL gAllowTapTapHoldRun = TRUE;
213BOOL gShowObjectUpdates = FALSE; 231BOOL gShowObjectUpdates = FALSE;
@@ -233,7 +251,7 @@ F32 gFPSClamped = 10.f; // Pretend we start at target rate.
233F32 gFrameDTClamped = 0.f; // Time between adjacent checks to network for packets 251F32 gFrameDTClamped = 0.f; // Time between adjacent checks to network for packets
234U64 gStartTime = 0; // gStartTime is "private", used only to calculate gFrameTimeSeconds 252U64 gStartTime = 0; // gStartTime is "private", used only to calculate gFrameTimeSeconds
235U32 gFrameStalls = 0; 253U32 gFrameStalls = 0;
236const F64 FRAME_STALL_THRESHOLD = 1.0; 254const F64 FRAME_STALL_THRESHOLD = 5.0;
237 255
238LLTimer gRenderStartTime; 256LLTimer gRenderStartTime;
239LLFrameTimer gForegroundTime; 257LLFrameTimer gForegroundTime;
@@ -302,7 +320,8 @@ std::string gLoginPage;
302std::vector<std::string> gLoginURIs; 320std::vector<std::string> gLoginURIs;
303static std::string gHelperURI; 321static std::string gHelperURI;
304 322
305LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = NULL ; 323//FIXME
324//LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = NULL ;
306 325
307void idle_afk_check() 326void idle_afk_check()
308{ 327{
@@ -453,7 +472,7 @@ static void settings_modify()
453 gSavedSettings.setBOOL("VectorizeSkin", FALSE); 472 gSavedSettings.setBOOL("VectorizeSkin", FALSE);
454#endif 473#endif
455} 474}
456 475/*
457void LLAppViewer::initGridChoice() 476void LLAppViewer::initGridChoice()
458{ 477{
459 // Load up the initial grid choice from: 478 // Load up the initial grid choice from:
@@ -470,7 +489,7 @@ void LLAppViewer::initGridChoice()
470 if(grid_choice.empty()) 489 if(grid_choice.empty())
471 { 490 {
472 S32 server = gSavedSettings.getS32("ServerChoice"); 491 S32 server = gSavedSettings.getS32("ServerChoice");
473 server = llclamp(server, 0, (S32)GRID_INFO_COUNT - 1); 492 //server = llclamp(server, 0, (S32)GRID_INFO_COUNT - 1);
474 if(server == GRID_INFO_OTHER) 493 if(server == GRID_INFO_OTHER)
475 { 494 {
476 std::string custom_server = gSavedSettings.getString("CustomServer"); 495 std::string custom_server = gSavedSettings.getString("CustomServer");
@@ -478,11 +497,12 @@ void LLAppViewer::initGridChoice()
478 } 497 }
479 else if(server != (S32)GRID_INFO_NONE) 498 else if(server != (S32)GRID_INFO_NONE)
480 { 499 {
481 LLViewerLogin::getInstance()->setGridChoice((EGridInfo)server); 500 llwarns << "setgridchoice = " << server << llendl;
501 LLViewerLogin::getInstance()->setGridChoice(server);
482 } 502 }
483 } 503 }
484} 504}
485 505*/
486//virtual 506//virtual
487bool LLAppViewer::initSLURLHandler() 507bool LLAppViewer::initSLURLHandler()
488{ 508{
@@ -521,6 +541,7 @@ LLAppViewer::LLAppViewer() :
521 mSecondInstance(false), 541 mSecondInstance(false),
522 mSavedFinalSnapshot(false), 542 mSavedFinalSnapshot(false),
523 mQuitRequested(false), 543 mQuitRequested(false),
544 mLogoutRequested(false),
524 mLogoutRequestSent(false), 545 mLogoutRequestSent(false),
525 mYieldTime(-1), 546 mYieldTime(-1),
526 mMainloopTimeout(NULL), 547 mMainloopTimeout(NULL),
@@ -662,7 +683,6 @@ bool LLAppViewer::init()
662 ui_audio_callback, 683 ui_audio_callback,
663 &LLUI::sGLScaleFactor); 684 &LLUI::sGLScaleFactor);
664 LLWeb::initClass(); // do this after LLUI 685 LLWeb::initClass(); // do this after LLUI
665
666 LLTextEditor::setURLCallbacks(&LLWeb::loadURL, 686 LLTextEditor::setURLCallbacks(&LLWeb::loadURL,
667 &LLURLDispatcher::dispatchFromTextEditor, 687 &LLURLDispatcher::dispatchFromTextEditor,
668 &LLURLDispatcher::dispatchFromTextEditor); 688 &LLURLDispatcher::dispatchFromTextEditor);
@@ -683,6 +703,7 @@ bool LLAppViewer::init()
683 // load MIME type -> media impl mappings 703 // load MIME type -> media impl mappings
684 LLMIMETypes::parseMIMETypes( std::string("mime_types.xml") ); 704 LLMIMETypes::parseMIMETypes( std::string("mime_types.xml") );
685 705
706
686 // Copy settings to globals. *TODO: Remove or move to appropriage class initializers 707 // Copy settings to globals. *TODO: Remove or move to appropriage class initializers
687 settings_to_globals(); 708 settings_to_globals();
688 // Setup settings listeners 709 // Setup settings listeners
@@ -1117,12 +1138,21 @@ bool LLAppViewer::cleanup()
1117 // to ensure shutdown order 1138 // to ensure shutdown order
1118 LLMortician::setZealous(TRUE); 1139 LLMortician::setZealous(TRUE);
1119 1140
1141 if (mQuitRequested)
1120 LLVoiceClient::terminate(); 1142 LLVoiceClient::terminate();
1121 1143
1122 disconnectViewer(); 1144 disconnectViewer();
1123 1145
1124 llinfos << "Viewer disconnected" << llendflush; 1146 llinfos << "Viewer disconnected" << llendflush;
1125 1147
1148
1149
1150
1151
1152 //this deletes all your buddies
1153 LLAvatarTracker::instance().reset();
1154
1155 if (mQuitRequested)
1126 display_cleanup(); 1156 display_cleanup();
1127 1157
1128 release_start_screen(); // just in case 1158 release_start_screen(); // just in case
@@ -1137,6 +1167,13 @@ bool LLAppViewer::cleanup()
1137 1167
1138 LLKeyframeDataCache::clear(); 1168 LLKeyframeDataCache::clear();
1139 1169
1170 //clear all the chat off the screen
1171 gConsole->clear();
1172
1173 if (!mQuitRequested) //if we are doing a soft cleanup, bail here
1174 {
1175 return true;
1176 }
1140 // End TransferManager before deleting systems it depends on (Audio, VFS, AssetStorage) 1177 // End TransferManager before deleting systems it depends on (Audio, VFS, AssetStorage)
1141#if 0 // this seems to get us stuck in an infinite loop... 1178#if 0 // this seems to get us stuck in an infinite loop...
1142 gTransferManager.cleanup(); 1179 gTransferManager.cleanup();
@@ -1242,6 +1279,9 @@ bool LLAppViewer::cleanup()
1242 // viewer UI relies on keyboard so keep it aound until viewer UI isa gone 1279 // viewer UI relies on keyboard so keep it aound until viewer UI isa gone
1243 delete gKeyboard; 1280 delete gKeyboard;
1244 gKeyboard = NULL; 1281 gKeyboard = NULL;
1282 // Clean up selection managers after UI is destroyed, as UI
1283 // may be observing them.
1284 LLSelectMgr::cleanupGlobals();
1245 1285
1246 LLViewerObject::cleanupVOClasses(); 1286 LLViewerObject::cleanupVOClasses();
1247 1287
@@ -1251,6 +1291,7 @@ bool LLAppViewer::cleanup()
1251 1291
1252 LLTracker::cleanupInstance(); 1292 LLTracker::cleanupInstance();
1253 1293
1294
1254 // *FIX: This is handled in LLAppViewerWin32::cleanup(). 1295 // *FIX: This is handled in LLAppViewerWin32::cleanup().
1255 // I'm keeping the comment to remember its order in cleanup, 1296 // I'm keeping the comment to remember its order in cleanup,
1256 // in case of unforseen dependency. 1297 // in case of unforseen dependency.
@@ -1319,6 +1360,7 @@ bool LLAppViewer::cleanup()
1319 // save mute list. gMuteList used to also be deleted here too. 1360 // save mute list. gMuteList used to also be deleted here too.
1320 LLMuteList::getInstance()->cache(gAgent.getID()); 1361 LLMuteList::getInstance()->cache(gAgent.getID());
1321 1362
1363
1322 if (mPurgeOnExit) 1364 if (mPurgeOnExit)
1323 { 1365 {
1324 llinfos << "Purging all cache files on exit" << llendflush; 1366 llinfos << "Purging all cache files on exit" << llendflush;
@@ -1819,7 +1861,14 @@ bool LLAppViewer::initConfiguration()
1819 } 1861 }
1820 } 1862 }
1821 1863
1822 initGridChoice(); 1864 //init Hippo grid manager
1865 if (!gHippoGridManager) {
1866 gHippoGridManager = new HippoGridManager();
1867 gHippoGridManager->init();
1868 }
1869
1870
1871 //initGridChoice();
1823 1872
1824 // If we have specified crash on startup, set the global so we'll trigger the crash at the right time 1873 // If we have specified crash on startup, set the global so we'll trigger the crash at the right time
1825 if(clp.hasOption("crashonstartup")) 1874 if(clp.hasOption("crashonstartup"))
@@ -1836,7 +1885,6 @@ bool LLAppViewer::initConfiguration()
1836 // achieve this. For now... 1885 // achieve this. For now...
1837 1886
1838 // *NOTE:Mani The command line parser parses tokens and is 1887 // *NOTE:Mani The command line parser parses tokens and is
1839 // setup to bail after parsing the '--url' option or the
1840 // first option specified without a '--option' flag (or 1888 // first option specified without a '--option' flag (or
1841 // any other option that uses the 'last_option' setting - 1889 // any other option that uses the 'last_option' setting -
1842 // see LLControlGroupCLP::configure()) 1890 // see LLControlGroupCLP::configure())
@@ -1894,6 +1942,22 @@ bool LLAppViewer::initConfiguration()
1894 // llerrs << "Failed to parse skin definition." << llendl; 1942 // llerrs << "Failed to parse skin definition." << llendl;
1895 // } 1943 // }
1896 1944
1945 // LLXmlTreeNode* rootp = skin_def_tree.getRoot();
1946 // LLXmlTreeNode* disabled_message_node = rootp->getChildByName("disabled_message");
1947 // if (disabled_message_node)
1948 // {
1949 // gDisabledMessage = disabled_message_node->getContents();
1950 // }
1951
1952 // static LLStdStringHandle hide_links_string = LLXmlTree::addAttributeString("hide_links");
1953 // rootp->getFastAttributeBOOL(hide_links_string, gHideLinks);
1954
1955 // // Legacy string. This flag really meant we didn't want to expose references to "Second Life".
1956 // // Just set gHideLinks instead.
1957 // static LLStdStringHandle silent_string = LLXmlTree::addAttributeString("silent_update");
1958 // BOOL silent_update;
1959 // rootp->getFastAttributeBOOL(silent_string, silent_update);
1960 // gHideLinks = (gHideLinks || silent_update);
1897 //} 1961 //}
1898 1962
1899#if LL_DARWIN 1963#if LL_DARWIN
@@ -2315,7 +2379,7 @@ void LLAppViewer::handleViewerCrash()
2315 gDebugInfo["ViewerExePath"] = gDirUtilp->getExecutablePathAndName(); 2379 gDebugInfo["ViewerExePath"] = gDirUtilp->getExecutablePathAndName();
2316 gDebugInfo["CurrentPath"] = gDirUtilp->getCurPath(); 2380 gDebugInfo["CurrentPath"] = gDirUtilp->getCurPath();
2317 gDebugInfo["SessionLength"] = F32(LLFrameTimer::getElapsedSeconds()); 2381 gDebugInfo["SessionLength"] = F32(LLFrameTimer::getElapsedSeconds());
2318 gDebugInfo["StartupState"] = LLStartUp::getStartupStateString(); 2382//FIXME gDebugInfo["StartupState"] = LLStartUp::getStartupStateString();
2319 gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer) getCurrentRSS() >> 10; 2383 gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer) getCurrentRSS() >> 10;
2320 2384
2321 if(gLogoutInProgress) 2385 if(gLogoutInProgress)
@@ -2542,28 +2606,55 @@ void LLAppViewer::removeMarkerFile(bool leave_logout_marker)
2542 } 2606 }
2543} 2607}
2544 2608
2609
2610//this gets called after we get a packet back from the
2611//server saying we are logged out, or if the packet times
2612//out
2545void LLAppViewer::forceQuit() 2613void LLAppViewer::forceQuit()
2546{ 2614{
2615
2616 LL_INFOS("forceQuit") << "Destroying the entire world" << LL_ENDL;
2617 if (mQuitRequested)
2547 LLApp::setQuitting(); 2618 LLApp::setQuitting();
2619 else
2620 {
2621 if (mLogoutRequested) //we just finished a logout request
2622 {
2623 //LLStartUp::setStartupState( STATE_LOGIN_SHOW );
2624 LLStartUp::resetLogin();
2625 cleanup();
2626 mLogoutRequested=false;
2627 mLogoutRequestSent=false;
2628 }
2629 }
2548} 2630}
2549 2631
2550void LLAppViewer::requestQuit() 2632void LLAppViewer::requestLogout(bool quit_after)
2551{ 2633{
2552 llinfos << "requestQuit" << llendl; 2634
2635 mLogoutRequested=true;
2636 if(quit_after)
2637 mQuitRequested=true;
2638 else
2639 mQuitRequested=false;
2640
2641 llinfos << "requestLogout" << llendl;
2553 2642
2554 LLViewerRegion* region = gAgent.getRegion(); 2643 LLViewerRegion* region = gAgent.getRegion();
2555 2644
2556 if( (LLStartUp::getStartupState() < STATE_STARTED) || !region ) 2645 if( (LLStartUp::getStartupState() >= STATE_STARTED) && region )
2557 { 2646 {
2558 // Quit immediately
2559 forceQuit();
2560 return;
2561 }
2562
2563 LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); 2647 LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE);
2564 effectp->setPositionGlobal(gAgent.getPositionGlobal()); 2648 effectp->setPositionGlobal(gAgent.getPositionGlobal());
2565 effectp->setColor(LLColor4U(gAgent.getEffectColor())); 2649 effectp->setColor(LLColor4U(gAgent.getEffectColor()));
2566 LLHUDManager::getInstance()->sendEffects(); 2650 LLHUDManager::getInstance()->sendEffects();
2651 send_stats();
2652 }
2653 else
2654 {
2655 mQuitRequested=true;
2656 LLAppViewer::instance()->forceQuit();
2657 }
2567 2658
2568 // Attempt to close all floaters that might be 2659 // Attempt to close all floaters that might be
2569 // editing things. 2660 // editing things.
@@ -2573,17 +2664,14 @@ void LLAppViewer::requestQuit()
2573 gFloaterView->closeAllChildren(true); 2664 gFloaterView->closeAllChildren(true);
2574 } 2665 }
2575 2666
2576 send_stats();
2577
2578 gLogoutTimer.reset(); 2667 gLogoutTimer.reset();
2579 mQuitRequested = true;
2580} 2668}
2581 2669
2582static void finish_quit(S32 option, void *userdata) 2670static void finish_quit(S32 option, void *userdata)
2583{ 2671{
2584 if (option == 0) 2672 if (option == 0)
2585 { 2673 {
2586 LLAppViewer::instance()->requestQuit(); 2674 LLAppViewer::instance()->requestLogout(true);
2587 } 2675 }
2588} 2676}
2589 2677
@@ -2592,6 +2680,12 @@ void LLAppViewer::userQuit()
2592 gViewerWindow->alertXml("ConfirmQuit", finish_quit, NULL); 2680 gViewerWindow->alertXml("ConfirmQuit", finish_quit, NULL);
2593} 2681}
2594 2682
2683//static
2684void LLAppViewer::userLogout(void *userdata)
2685{
2686 LLAppViewer::instance()->requestLogout(false);
2687}
2688
2595static void finish_early_exit(S32 option, void* userdata) 2689static void finish_early_exit(S32 option, void* userdata)
2596{ 2690{
2597 LLAppViewer::instance()->forceQuit(); 2691 LLAppViewer::instance()->forceQuit();
@@ -2619,6 +2713,7 @@ void LLAppViewer::abortQuit()
2619{ 2713{
2620 llinfos << "abortQuit()" << llendl; 2714 llinfos << "abortQuit()" << llendl;
2621 mQuitRequested = false; 2715 mQuitRequested = false;
2716 mLogoutRequested = false;
2622} 2717}
2623 2718
2624bool LLAppViewer::initCache() 2719bool LLAppViewer::initCache()
@@ -2895,7 +2990,7 @@ void finish_forced_disconnect(S32 /* option */, void* /* userdata */)
2895 2990
2896void LLAppViewer::forceDisconnect(const std::string& mesg) 2991void LLAppViewer::forceDisconnect(const std::string& mesg)
2897{ 2992{
2898 if (gDoDisconnect) 2993 if (gDoDisconnect||mQuitRequested||mLogoutRequested)
2899 { 2994 {
2900 // Already popped up one of these dialogs, don't 2995 // Already popped up one of these dialogs, don't
2901 // do this again. 2996 // do this again.
@@ -3203,9 +3298,12 @@ void LLAppViewer::idle()
3203 // Check for away from keyboard, kick idle agents. 3298 // Check for away from keyboard, kick idle agents.
3204 idle_afk_check(); 3299 idle_afk_check();
3205 3300
3301 if (!gDisconnected) //check again
3302 {
3206 // Update statistics for this frame 3303 // Update statistics for this frame
3207 update_statistics(gFrameCount); 3304 update_statistics(gFrameCount);
3208 } 3305 }
3306 }
3209 3307
3210 //////////////////////////////////////// 3308 ////////////////////////////////////////
3211 // 3309 //
@@ -3406,7 +3504,7 @@ void LLAppViewer::idle()
3406 // Handle shutdown process, for example, 3504 // Handle shutdown process, for example,
3407 // wait for floaters to close, send quit message, 3505 // wait for floaters to close, send quit message,
3408 // forcibly quit if it has taken too long 3506 // forcibly quit if it has taken too long
3409 if (mQuitRequested) 3507 if (mQuitRequested || mLogoutRequested)
3410 { 3508 {
3411 idleShutdown(); 3509 idleShutdown();
3412 } 3510 }
@@ -3506,12 +3604,12 @@ void LLAppViewer::sendLogoutRequest()
3506 if (mLogoutMarkerFile) 3604 if (mLogoutMarkerFile)
3507 { 3605 {
3508 llinfos << "Created logout marker file " << mLogoutMarkerFileName << llendl; 3606 llinfos << "Created logout marker file " << mLogoutMarkerFileName << llendl;
3509 apr_file_close(mLogoutMarkerFile);
3510 } 3607 }
3511 else 3608 else
3512 { 3609 {
3513 llwarns << "Cannot create logout marker file " << mLogoutMarkerFileName << llendl; 3610 llwarns << "Cannot create logout marker file " << mLogoutMarkerFileName << llendl;
3514 } 3611 }
3612 apr_file_close(mLogoutMarkerFile);
3515 } 3613 }
3516} 3614}
3517 3615
@@ -3528,6 +3626,9 @@ static F32 CheckMessagesMaxTime = CHECK_MESSAGES_DEFAULT_MAX_TIME;
3528 3626
3529void LLAppViewer::idleNetwork() 3627void LLAppViewer::idleNetwork()
3530{ 3628{
3629 if (gDisconnected)
3630 return;
3631
3531 pingMainloopTimeout("idleNetwork"); 3632 pingMainloopTimeout("idleNetwork");
3532 3633
3533 gObjectList.mNumNewObjects = 0; 3634 gObjectList.mNumNewObjects = 0;
@@ -3614,7 +3715,11 @@ void LLAppViewer::idleNetwork()
3614 3715
3615 gObjectList.mNumNewObjectsStat.addValue(gObjectList.mNumNewObjects); 3716 gObjectList.mNumNewObjectsStat.addValue(gObjectList.mNumNewObjects);
3616 3717
3718 if (gDisconnected)
3719 return;
3720
3617 // Retransmit unacknowledged packets. 3721 // Retransmit unacknowledged packets.
3722 if (gXferManager)
3618 gXferManager->retransmitUnackedPackets(); 3723 gXferManager->retransmitUnackedPackets();
3619 gAssetStorage->checkForTimeouts(); 3724 gAssetStorage->checkForTimeouts();
3620 3725
@@ -3624,7 +3729,7 @@ void LLAppViewer::idleNetwork()
3624 // Check that the circuit between the viewer and the agent's current 3729 // Check that the circuit between the viewer and the agent's current
3625 // region is still alive 3730 // region is still alive
3626 LLViewerRegion *agent_region = gAgent.getRegion(); 3731 LLViewerRegion *agent_region = gAgent.getRegion();
3627 if (agent_region) 3732 if ((agent_region)&&(LLStartUp::getStartupState() == STATE_STARTED))
3628 { 3733 {
3629 LLUUID this_region_id = agent_region->getRegionID(); 3734 LLUUID this_region_id = agent_region->getRegionID();
3630 bool this_region_alive = agent_region->isAlive(); 3735 bool this_region_alive = agent_region->isAlive();
@@ -3644,6 +3749,9 @@ void LLAppViewer::disconnectViewer()
3644 { 3749 {
3645 return; 3750 return;
3646 } 3751 }
3752
3753 //set this true now, to prevent things from trying to access the network we are destroying
3754 gDisconnected = TRUE;
3647 // 3755 //
3648 // Cleanup after quitting. 3756 // Cleanup after quitting.
3649 // 3757 //
@@ -3693,8 +3801,8 @@ void LLAppViewer::disconnectViewer()
3693 // Now we just ask the LLWorld singleton to cleanly shut down. 3801 // Now we just ask the LLWorld singleton to cleanly shut down.
3694 LLWorld::getInstance()->destroyClass(); 3802 LLWorld::getInstance()->destroyClass();
3695 3803
3696 cleanup_xfer_manager(); 3804 if (mQuitRequested)
3697 gDisconnected = TRUE; 3805 cleanup_xfer_manager();
3698} 3806}
3699 3807
3700void LLAppViewer::forceErrorLLError() 3808void LLAppViewer::forceErrorLLError()
diff --git a/linden/indra/newview/llappviewer.h b/linden/indra/newview/llappviewer.h
index 3be5de7..8d8e30f 100644
--- a/linden/indra/newview/llappviewer.h
+++ b/linden/indra/newview/llappviewer.h
@@ -61,13 +61,15 @@ public:
61 61
62 // Application control 62 // Application control
63 void forceQuit(); // Puts the viewer into 'shutting down without error' mode. 63 void forceQuit(); // Puts the viewer into 'shutting down without error' mode.
64 void requestQuit(); // Request a quit. A kinder, gentler quit. 64 void requestLogout(bool quit_after); // Request a logout, optionally quitting after
65 void userQuit(); // The users asks to quit. Confirm, then requestQuit() 65 void userQuit(); // The users asks to quit. Confirm, then requestQuit()
66 static void userLogout(void *userdata); //graceful logout without quit
66 void earlyExit(const std::string& msg); // Display an error dialog and forcibly quit. 67 void earlyExit(const std::string& msg); // Display an error dialog and forcibly quit.
67 void forceExit(S32 arg); // exit() immediately (after some cleanup). 68 void forceExit(S32 arg); // exit() immediately (after some cleanup).
68 void abortQuit(); // Called to abort a quit request. 69 void abortQuit(); // Called to abort a quit request.
69 70
70 bool quitRequested() { return mQuitRequested; } 71 bool quitRequested() { return mQuitRequested; }
72 bool logoutRequested() { return mLogoutRequested; }
71 bool logoutRequestSent() { return mLogoutRequestSent; } 73 bool logoutRequestSent() { return mLogoutRequestSent; }
72 74
73 void writeDebugInfo(); 75 void writeDebugInfo();
@@ -157,11 +159,12 @@ protected:
157 159
158 virtual std::string generateSerialNumber() = 0; // Platforms specific classes generate this. 160 virtual std::string generateSerialNumber() = 0; // Platforms specific classes generate this.
159 161
162
160private: 163private:
161 164
162 bool initThreads(); // Initialize viewer threads, return false on failure. 165 bool initThreads(); // Initialize viewer threads, return false on failure.
163 bool initConfiguration(); // Initialize settings from the command line/config file. 166 bool initConfiguration(); // Initialize settings from the command line/config file.
164 void initGridChoice(); 167 //void initGridChoice();
165 168
166 bool initCache(); // Initialize local client cache. 169 bool initCache(); // Initialize local client cache.
167 void purgeCache(); // Clear the local cache. 170 void purgeCache(); // Clear the local cache.
@@ -211,6 +214,7 @@ private:
211 bool mSavedFinalSnapshot; 214 bool mSavedFinalSnapshot;
212 215
213 bool mQuitRequested; // User wants to quit, may have modified documents open. 216 bool mQuitRequested; // User wants to quit, may have modified documents open.
217 bool mLogoutRequested; // User wants to log out, but not quit
214 bool mLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim. 218 bool mLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim.
215 S32 mYieldTime; 219 S32 mYieldTime;
216 LLSD mSettingsFileList; 220 LLSD mSettingsFileList;
@@ -220,15 +224,6 @@ private:
220 // for tracking viewer<->region circuit death 224 // for tracking viewer<->region circuit death
221 bool mAgentRegionLastAlive; 225 bool mAgentRegionLastAlive;
222 LLUUID mAgentRegionLastID; 226 LLUUID mAgentRegionLastID;
223
224public:
225 //some information for updater
226 typedef struct
227 {
228 std::string mUpdateExePath;
229 std::ostringstream mParams;
230 }LLUpdaterInfo ;
231 static LLUpdaterInfo *sUpdaterInfo ;
232}; 227};
233 228
234// consts from viewer.h 229// consts from viewer.h
@@ -239,6 +234,9 @@ const S32 AGENT_UPDATES_PER_SECOND = 10;
239// 234//
240// "// llstartup" indicates that llstartup is the only client for this global. 235// "// llstartup" indicates that llstartup is the only client for this global.
241 236
237
238extern std::string gDisabledMessage; // llstartup
239extern BOOL gHideLinks; // used by llpanellogin, lllfloaterbuycurrency, llstartup
242extern LLSD gDebugInfo; 240extern LLSD gDebugInfo;
243 241
244extern BOOL gAllowIdleAFK; 242extern BOOL gAllowIdleAFK;
diff --git a/linden/indra/newview/llappviewerlinux.h b/linden/indra/newview/llappviewerlinux.h
index b464e48..2f5c13b 100644
--- a/linden/indra/newview/llappviewerlinux.h
+++ b/linden/indra/newview/llappviewerlinux.h
@@ -61,9 +61,10 @@ public:
61 61
62protected: 62protected:
63 virtual bool beingDebugged(); 63 virtual bool beingDebugged();
64 64
65 virtual bool restoreErrorTrap(); 65 virtual bool restoreErrorTrap();
66 virtual void handleCrashReporting(bool reportFreeze); 66 virtual void handleCrashReporting(bool reportFreeze);
67
67 virtual void handleSyncCrashTrace(); 68 virtual void handleSyncCrashTrace();
68 69
69 virtual bool initLogging(); 70 virtual bool initLogging();
diff --git a/linden/indra/newview/llcallingcard.cpp b/linden/indra/newview/llcallingcard.cpp
index 1d353fa..ccecef9 100644
--- a/linden/indra/newview/llcallingcard.cpp
+++ b/linden/indra/newview/llcallingcard.cpp
@@ -136,8 +136,20 @@ LLAvatarTracker::~LLAvatarTracker()
136 deleteTrackingData(); 136 deleteTrackingData();
137 std::for_each(mObservers.begin(), mObservers.end(), DeletePointer()); 137 std::for_each(mObservers.begin(), mObservers.end(), DeletePointer());
138 std::for_each(mBuddyInfo.begin(), mBuddyInfo.end(), DeletePairedPointer()); 138 std::for_each(mBuddyInfo.begin(), mBuddyInfo.end(), DeletePairedPointer());
139 mObservers.erase(mObservers.begin(), mObservers.end());
140 mBuddyInfo.erase(mBuddyInfo.begin(), mBuddyInfo.end());
139} 141}
140 142
143
144void LLAvatarTracker::reset()
145{
146 std::for_each(mBuddyInfo.begin(), mBuddyInfo.end(), DeletePairedPointer());
147 mBuddyInfo.erase(mBuddyInfo.begin(), mBuddyInfo.end());
148 mModifyMask |= LLFriendObserver::REMOVE;
149 notifyObservers();
150}
151
152
141void LLAvatarTracker::track(const LLUUID& avatar_id, const std::string& name) 153void LLAvatarTracker::track(const LLUUID& avatar_id, const std::string& name)
142{ 154{
143 deleteTrackingData(); 155 deleteTrackingData();
diff --git a/linden/indra/newview/llcallingcard.h b/linden/indra/newview/llcallingcard.h
index cbcb237..21eea2b 100644
--- a/linden/indra/newview/llcallingcard.h
+++ b/linden/indra/newview/llcallingcard.h
@@ -85,7 +85,7 @@ class LLAvatarTracker
85{ 85{
86public: 86public:
87 static LLAvatarTracker& instance() { return sInstance; } 87 static LLAvatarTracker& instance() { return sInstance; }
88 88 void reset();
89 void track(const LLUUID& avatar_id, const std::string& name); 89 void track(const LLUUID& avatar_id, const std::string& name);
90 void untrack(const LLUUID& avatar_id); 90 void untrack(const LLUUID& avatar_id);
91 bool isTrackedAgentValid() { return mTrackedAgentValid; } 91 bool isTrackedAgentValid() { return mTrackedAgentValid; }
diff --git a/linden/indra/newview/llchatbar.cpp b/linden/indra/newview/llchatbar.cpp
index 1b1284d..7aab713 100644
--- a/linden/indra/newview/llchatbar.cpp
+++ b/linden/indra/newview/llchatbar.cpp
@@ -120,6 +120,7 @@ LLChatBar::LLChatBar()
120 120
121LLChatBar::~LLChatBar() 121LLChatBar::~LLChatBar()
122{ 122{
123 gGestureManager.removeObserver(mObserver);
123 delete mObserver; 124 delete mObserver;
124 mObserver = NULL; 125 mObserver = NULL;
125 // LLView destructor cleans up children 126 // LLView destructor cleans up children
diff --git a/linden/indra/newview/lldrawable.h b/linden/indra/newview/lldrawable.h
index 15ad2e1..8f18be0 100644
--- a/linden/indra/newview/lldrawable.h
+++ b/linden/indra/newview/lldrawable.h
@@ -49,6 +49,7 @@
49#include "llviewerobject.h" 49#include "llviewerobject.h"
50#include "llrect.h" 50#include "llrect.h"
51#include "llappviewer.h" // for gFrameTimeSeconds 51#include "llappviewer.h" // for gFrameTimeSeconds
52#include "llimagej2c.h"
52 53
53class LLCamera; 54class LLCamera;
54class LLDrawPool; 55class LLDrawPool;
diff --git a/linden/indra/newview/llfloaterworldmap.cpp b/linden/indra/newview/llfloaterworldmap.cpp
index a31dde5..5399867 100644
--- a/linden/indra/newview/llfloaterworldmap.cpp
+++ b/linden/indra/newview/llfloaterworldmap.cpp
@@ -68,6 +68,12 @@
68#include "llappviewer.h" 68#include "llappviewer.h"
69#include "llmapimagetype.h" 69#include "llmapimagetype.h"
70#include "llweb.h" 70#include "llweb.h"
71#include "floaterlogin.h"
72#include "llstartup.h"
73#include "hippoGridManager.h"
74#include "floaterlogin.h"
75#include "llpanellogin.h"
76
71 77
72#include "llglheaders.h" 78#include "llglheaders.h"
73 79
@@ -237,6 +243,10 @@ BOOL LLFloaterWorldMap::postBuild()
237 landmark_combo->setTextEntryCallback( onComboTextEntry ); 243 landmark_combo->setTextEntryCallback( onComboTextEntry );
238 } 244 }
239 245
246 childSetCommitCallback("grid_combo", onSelectServer, this);
247
248 childSetAction("Grid Manager", onGridManager, this);
249
240 childSetAction("Go Home", onGoHome, this); 250 childSetAction("Go Home", onGoHome, this);
241 251
242 childSetAction("Teleport", onClickTeleportBtn, this); 252 childSetAction("Teleport", onClickTeleportBtn, this);
@@ -334,6 +344,8 @@ void LLFloaterWorldMap::show(void*, BOOL center_on_target)
334 344
335 // If nothing is being tracked, set flag so the user position will be found 345 // If nothing is being tracked, set flag so the user position will be found
336 gFloaterWorldMap->mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING ); 346 gFloaterWorldMap->mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING );
347
348 LLFloaterWorldMap::addServer(gHippoGridManager->getDefaultGridNick());
337 } 349 }
338 350
339 if (center_on_target) 351 if (center_on_target)
@@ -378,6 +390,48 @@ void LLFloaterWorldMap::hide(void*)
378} 390}
379 391
380 392
393// static
394void LLFloaterWorldMap::addServer(const std::string& server)
395{
396 const std::string &defaultGrid = gHippoGridManager->getDefaultGridNick();
397
398 LLCtrlListInterface *grids = gFloaterWorldMap->childGetListInterface("grid_combo");
399 if (!grids) return;
400
401 // Delete all but the "None" entry
402 S32 list_size = grids->getItemCount();
403 while (list_size > 1)
404 {
405 grids->selectNthItem(1);
406 grids->operateOnSelection(LLCtrlListInterface::OP_DELETE);
407 --list_size;
408 }
409
410
411 //LLComboBox *grids = gFloaterWorldMap->getChild<LLComboBox>("grid_combo");
412 S32 selectIndex = -1, i = 0;
413 //grids->removeall();
414 if (defaultGrid != "") {
415 grids->addSimpleElement(defaultGrid);
416 selectIndex = i++;
417 }
418 HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid();
419 for (it = gHippoGridManager->beginGrid(); it != end; ++it) {
420 const std::string &grid = it->second->getGridNick();
421 if (grid != defaultGrid) {
422 grids->addSimpleElement(grid);
423 //if (grid == mCurGrid) selectIndex = i;
424 i++;
425 }
426 }
427 grids->selectFirstItem();
428 //grids->setCurrentByIndex(0);
429
430 //LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
431 //combo->add(server, LLSD(domain_name) );
432 //combo->setCurrentByIndex(0);
433}
434
381// virtual 435// virtual
382void LLFloaterWorldMap::setVisible( BOOL visible ) 436void LLFloaterWorldMap::setVisible( BOOL visible )
383{ 437{
@@ -450,7 +504,10 @@ void LLFloaterWorldMap::draw()
450 childSetEnabled("Go Home", enable_go_home); 504 childSetEnabled("Go Home", enable_go_home);
451 505
452 updateLocation(); 506 updateLocation();
453 507
508 LLComboBox *grid_combo = getChild<LLComboBox>("grid_combo");
509 std::string current_grid = gHippoGridManager->getConnectedGrid()->getGridNick();
510
454 LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); 511 LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus();
455 if (LLTracker::TRACKING_AVATAR == tracking_status) 512 if (LLTracker::TRACKING_AVATAR == tracking_status)
456 { 513 {
@@ -496,7 +553,19 @@ void LLFloaterWorldMap::draw()
496 centerOnTarget(TRUE); 553 centerOnTarget(TRUE);
497 } 554 }
498 555
499 childSetEnabled("Teleport", (BOOL)tracking_status); 556 //GRID MANAGER
557 if (grid_combo->getSelectedValue().asString() != "None")
558 {
559 childSetEnabled("Teleport", TRUE);
560 childSetColor("grid_icon", gTrackColor);
561 }
562 else
563 {
564 childSetEnabled("Teleport", (BOOL)tracking_status);
565 childSetColor("grid_icon", gDisabledTrackColor);
566 }
567 //END GRID MANAGER
568
500// childSetEnabled("Clear", (BOOL)tracking_status); 569// childSetEnabled("Clear", (BOOL)tracking_status);
501 childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->mIsTrackingUnknownLocation); 570 childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->mIsTrackingUnknownLocation);
502 childSetEnabled("copy_slurl", (mSLURL.size() > 0) ); 571 childSetEnabled("copy_slurl", (mSLURL.size() > 0) );
@@ -769,7 +838,7 @@ void LLFloaterWorldMap::updateLocation()
769void LLFloaterWorldMap::trackURL(const std::string& region_name, S32 x_coord, S32 y_coord, S32 z_coord) 838void LLFloaterWorldMap::trackURL(const std::string& region_name, S32 x_coord, S32 y_coord, S32 z_coord)
770{ 839{
771 LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromName(region_name); 840 LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromName(region_name);
772 z_coord = llclamp(z_coord, 0, 4096); 841 z_coord = llclamp(z_coord, 0, 1000);
773 if (sim_info) 842 if (sim_info)
774 { 843 {
775 LLVector3 local_pos; 844 LLVector3 local_pos;
@@ -979,6 +1048,18 @@ void LLFloaterWorldMap::clearLocationSelection(BOOL clear_ui)
979} 1048}
980 1049
981 1050
1051void LLFloaterWorldMap::clearGridSelection(BOOL clear_ui)
1052{
1053 if (clear_ui || !childHasKeyboardFocus("grid_combo"))
1054 {
1055 LLCtrlListInterface *list = childGetListInterface("grid_combo");
1056 if (list)
1057 {
1058 list->selectByValue( "None" );
1059 }
1060 }
1061}
1062
982void LLFloaterWorldMap::clearLandmarkSelection(BOOL clear_ui) 1063void LLFloaterWorldMap::clearLandmarkSelection(BOOL clear_ui)
983{ 1064{
984 if (clear_ui || !childHasKeyboardFocus("landmark combo")) 1065 if (clear_ui || !childHasKeyboardFocus("landmark combo"))
@@ -1076,9 +1157,18 @@ void LLFloaterWorldMap::onPanBtn( void* userdata )
1076} 1157}
1077 1158
1078// static 1159// static
1160void LLFloaterWorldMap::onGridManager(void*)
1161{
1162 LoginFloater::newShow(std::string("Test"), false);
1163 //gAgent.teleportHome();
1164 //gFloaterWorldMap->close();
1165}
1166
1167// static
1079void LLFloaterWorldMap::onGoHome(void*) 1168void LLFloaterWorldMap::onGoHome(void*)
1080{ 1169{
1081 gAgent.teleportHomeConfirm(); 1170 gAgent.teleportHomeConfirm();
1171 gFloaterWorldMap->close();
1082} 1172}
1083 1173
1084 1174
@@ -1161,6 +1251,9 @@ void LLFloaterWorldMap::onLandmarkComboCommit( LLUICtrl* ctrl, void* userdata )
1161 item_id.setNull(); 1251 item_id.setNull();
1162 } 1252 }
1163 } 1253 }
1254 //GRID MANAGER HAX
1255 self->clearGridSelection(TRUE);
1256 //END GRID MANAGER HAX
1164 1257
1165 self->trackLandmark( item_id); 1258 self->trackLandmark( item_id);
1166 onShowTargetBtn(self); 1259 onShowTargetBtn(self);
@@ -1212,6 +1305,10 @@ void LLFloaterWorldMap::onAvatarComboCommit( LLUICtrl* ctrl, void* userdata )
1212 const LLUUID& new_avatar_id = list->getCurrentID(); 1305 const LLUUID& new_avatar_id = list->getCurrentID();
1213 if (new_avatar_id.notNull()) 1306 if (new_avatar_id.notNull())
1214 { 1307 {
1308 //GRID MANAGER HAX
1309 self->clearGridSelection(TRUE);
1310 //END GRID MANAGER HAX
1311
1215 std::string name; 1312 std::string name;
1216 LLComboBox* combo = gFloaterWorldMap->getChild<LLComboBox>("friend combo"); 1313 LLComboBox* combo = gFloaterWorldMap->getChild<LLComboBox>("friend combo");
1217 if (combo) name = combo->getSimple(); 1314 if (combo) name = combo->getSimple();
@@ -1293,6 +1390,10 @@ void LLFloaterWorldMap::onClearBtn(void* data)
1293 LLWorldMap::getInstance()->mIsTrackingUnknownLocation = FALSE; 1390 LLWorldMap::getInstance()->mIsTrackingUnknownLocation = FALSE;
1294 self->mSLURL = ""; // Clear the SLURL since it's invalid 1391 self->mSLURL = ""; // Clear the SLURL since it's invalid
1295 self->mSetToUserPosition = TRUE; // Revert back to the current user position 1392 self->mSetToUserPosition = TRUE; // Revert back to the current user position
1393 //KOW TODO clear grid combo red ring, clear grid combo.
1394 //GRID MANAGER HAX
1395 self->clearGridSelection(TRUE);
1396 //END GRID MANAGER HAX
1296} 1397}
1297 1398
1298// static 1399// static
@@ -1402,6 +1503,39 @@ void LLFloaterWorldMap::fly()
1402// protected 1503// protected
1403void LLFloaterWorldMap::teleport() 1504void LLFloaterWorldMap::teleport()
1404{ 1505{
1506 //BEGIN CROSS GRIP TP//
1507 LLComboBox *grid_combo = getChild<LLComboBox>("grid_combo");
1508 std::string current_grid = gHippoGridManager->getConnectedGrid()->getGridNick();
1509
1510 // BUG: the client crashes if fed an invalid grid through this interface, which shouldn't happen
1511 if(//grid_combo && grid_combo->getSelectedValue().asString() != current_grid || gSavedSettings.getBOOL("CmdLineLoginURI") &&
1512 grid_combo->getSelectedValue().asString() != "None" &&
1513 !grid_combo->getSelectedValue().asString().empty())
1514 {
1515 HippoGridInfo *gridInfo = gHippoGridManager->getGrid(grid_combo->getSelectedValue().asString());
1516 //DEBUG
1517
1518 llwarns << "tp button current grid = " << grid_combo->getSelectedValue().asString() << llendl;
1519 std::string firstName = gridInfo->getFirstName();
1520 std::string lastName = gridInfo->getLastName();
1521 std::string loginPassword = gridInfo->getAvatarPassword();
1522
1523 if(!firstName.empty() && !lastName.empty())
1524 {
1525 gLoginHandler.mFirstName = firstName;
1526 gLoginHandler.mLastName = lastName;
1527 gLoginHandler.mPassword = loginPassword;
1528 }
1529
1530 gHippoGridManager->setCurrentGrid(gridInfo->getGridNick());
1531 //gHippoGridManager->setDefaultGrid(gridInfo->getGridNick());
1532 //this doesn't work :( gSavedSettings.setBOOL("CmdLineLoginURI", FALSE);
1533 LLStartUp::setShouldAutoLogin(true);
1534 LLAppViewer::instance()->requestLogout(false);
1535 return;
1536 }
1537 //END CROSS GRID TP//
1538
1405 BOOL teleport_home = FALSE; 1539 BOOL teleport_home = FALSE;
1406 LLVector3d pos_global; 1540 LLVector3d pos_global;
1407 LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); 1541 LLAvatarTracker& av_tracker = LLAvatarTracker::instance();
@@ -1692,3 +1826,20 @@ void LLFloaterWorldMap::onCommitSearchResult(LLUICtrl*, void* userdata)
1692 1826
1693 onShowTargetBtn(self); 1827 onShowTargetBtn(self);
1694} 1828}
1829
1830// static
1831void LLFloaterWorldMap::onSelectServer(LLUICtrl* ctrl, void* userdata)
1832{
1833 //GRID MANAGER COMBO BOX CLICKED//
1834 llwarns << "onSelectServer called" << llendl;
1835 //snip from onClearBtn (bless this mess)
1836 LLFloaterWorldMap* self = (LLFloaterWorldMap*) userdata;
1837 self->mTrackedStatus = LLTracker::TRACKING_NOTHING;
1838 LLTracker::stopTracking((void *)(intptr_t)TRUE);
1839 //LLTracker::stopTracking(NULL);
1840 LLWorldMap::getInstance()->mIsTrackingUnknownLocation = FALSE;
1841 self->mSLURL = ""; // Clear the SLURL since it's invalid
1842 self->mSetToUserPosition = TRUE; // Revert back to the current user position
1843
1844 self->setDefaultBtn("Teleport");
1845}
diff --git a/linden/indra/newview/llfloaterworldmap.h b/linden/indra/newview/llfloaterworldmap.h
index 568d3cc..2f444b9 100644
--- a/linden/indra/newview/llfloaterworldmap.h
+++ b/linden/indra/newview/llfloaterworldmap.h
@@ -67,6 +67,8 @@ public:
67 static void toggle(void*); 67 static void toggle(void*);
68 static void hide(void*); 68 static void hide(void*);
69 69
70 static void addServer(const std::string& server);
71
70 /*virtual*/ void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE ); 72 /*virtual*/ void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE );
71 /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); 73 /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
72 /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); 74 /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
@@ -100,6 +102,7 @@ public:
100 void clearLocationSelection(BOOL clear_ui = FALSE); 102 void clearLocationSelection(BOOL clear_ui = FALSE);
101 void clearAvatarSelection(BOOL clear_ui = FALSE); 103 void clearAvatarSelection(BOOL clear_ui = FALSE);
102 void clearLandmarkSelection(BOOL clear_ui = FALSE); 104 void clearLandmarkSelection(BOOL clear_ui = FALSE);
105 void clearGridSelection(BOOL clear_ui = FALSE);
103 106
104 // Adjust the maximally zoomed out limit of the zoom slider so you can 107 // Adjust the maximally zoomed out limit of the zoom slider so you can
105 // see the whole world, plus a little. 108 // see the whole world, plus a little.
@@ -114,8 +117,9 @@ public:
114protected: 117protected:
115 static void onPanBtn( void* userdata ); 118 static void onPanBtn( void* userdata );
116 119
117 static void onGoHome(void* data); 120 static void onGridManager(void* data);
118 121
122 static void onGoHome(void* data);
119 static void onLandmarkComboPrearrange( LLUICtrl* ctrl, void* data ); 123 static void onLandmarkComboPrearrange( LLUICtrl* ctrl, void* data );
120 static void onLandmarkComboCommit( LLUICtrl* ctrl, void* data ); 124 static void onLandmarkComboCommit( LLUICtrl* ctrl, void* data );
121 125
@@ -157,6 +161,7 @@ protected:
157 static void onLocationCommit( void* userdata ); 161 static void onLocationCommit( void* userdata );
158 static void onCommitLocation( LLUICtrl* ctrl, void* userdata ); 162 static void onCommitLocation( LLUICtrl* ctrl, void* userdata );
159 static void onCommitSearchResult( LLUICtrl* ctrl, void* userdata ); 163 static void onCommitSearchResult( LLUICtrl* ctrl, void* userdata );
164 static void onSelectServer(LLUICtrl*, void* userdata);
160 165
161 void cacheLandmarkPosition(); 166 void cacheLandmarkPosition();
162 167
diff --git a/linden/indra/newview/llinventorymodel.cpp b/linden/indra/newview/llinventorymodel.cpp
index e662058..490000f 100644
--- a/linden/indra/newview/llinventorymodel.cpp
+++ b/linden/indra/newview/llinventorymodel.cpp
@@ -1499,7 +1499,7 @@ void LLInventoryModel::stopBackgroundFetch()
1499//static 1499//static
1500void LLInventoryModel::backgroundFetch(void*) 1500void LLInventoryModel::backgroundFetch(void*)
1501{ 1501{
1502 if (sBackgroundFetchActive && gAgent.getRegion()) 1502 if (sBackgroundFetchActive)
1503 { 1503 {
1504 //If we'll be using the capability, we'll be sending batches and the background thing isn't as important. 1504 //If we'll be using the capability, we'll be sending batches and the background thing isn't as important.
1505 std::string url = gAgent.getRegion()->getCapability("WebFetchInventoryDescendents"); 1505 std::string url = gAgent.getRegion()->getCapability("WebFetchInventoryDescendents");
diff --git a/linden/indra/newview/llinventorymodel.h b/linden/indra/newview/llinventorymodel.h
index 7c7d231..e95d246 100644
--- a/linden/indra/newview/llinventorymodel.h
+++ b/linden/indra/newview/llinventorymodel.h
@@ -323,6 +323,8 @@ public:
323 // relations. 323 // relations.
324 void buildParentChildMap(); 324 void buildParentChildMap();
325 325
326 // Empty the entire contents
327 void empty();
326 // 328 //
327 // Category accounting. 329 // Category accounting.
328 // 330 //
@@ -374,6 +376,7 @@ public:
374 static bool isEverythingFetched(); 376 static bool isEverythingFetched();
375 static void backgroundFetch(void*); // background fetch idle function 377 static void backgroundFetch(void*); // background fetch idle function
376 static void incrBulkFetch(S16 fetching) { sBulkFetchCount+=fetching; if (sBulkFetchCount<0) sBulkFetchCount=0; } 378 static void incrBulkFetch(S16 fetching) { sBulkFetchCount+=fetching; if (sBulkFetchCount<0) sBulkFetchCount=0; }
379
377protected: 380protected:
378 381
379 // Internal methods which add inventory and make sure that all of 382 // Internal methods which add inventory and make sure that all of
@@ -387,8 +390,7 @@ protected:
387 // preferred type. Returns LLUUID::null if not found 390 // preferred type. Returns LLUUID::null if not found
388 LLUUID findCatUUID(LLAssetType::EType preferred_type); 391 LLUUID findCatUUID(LLAssetType::EType preferred_type);
389 392
390 // Empty the entire contents 393
391 void empty();
392 394
393 // Given the current state of the inventory items, figure out the 395 // Given the current state of the inventory items, figure out the
394 // clone information. *FIX: This is sub-optimal, since we can 396 // clone information. *FIX: This is sub-optimal, since we can
diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp
index 8e8e894..65df653 100644
--- a/linden/indra/newview/llinventoryview.cpp
+++ b/linden/indra/newview/llinventoryview.cpp
@@ -958,6 +958,7 @@ void LLInventoryView::cleanup()
958 { 958 {
959 sActiveViews.get(i)->destroy(); 959 sActiveViews.get(i)->destroy();
960 } 960 }
961 gInventory.empty();
961} 962}
962 963
963void LLInventoryView::toggleFindOptions() 964void LLInventoryView::toggleFindOptions()
diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp
index 325fcbc..026b0b2 100644
--- a/linden/indra/newview/llpanellogin.cpp
+++ b/linden/indra/newview/llpanellogin.cpp
@@ -34,6 +34,9 @@
34#include "llpanellogin.h" 34#include "llpanellogin.h"
35#include "llpanelgeneral.h" 35#include "llpanelgeneral.h"
36 36
37#include "hippoGridManager.h"
38#include "floaterlogin.h"
39
37#include "indra_constants.h" // for key and mask constants 40#include "indra_constants.h" // for key and mask constants
38#include "llfontgl.h" 41#include "llfontgl.h"
39#include "llmd5.h" 42#include "llmd5.h"
@@ -63,12 +66,15 @@
63#include "llviewernetwork.h" 66#include "llviewernetwork.h"
64#include "llviewerwindow.h" // to link into child list 67#include "llviewerwindow.h" // to link into child list
65#include "llnotify.h" 68#include "llnotify.h"
69#include "llappviewer.h" // for gHideLinks
66#include "llurlsimstring.h" 70#include "llurlsimstring.h"
67#include "lluictrlfactory.h" 71#include "lluictrlfactory.h"
68#include "llhttpclient.h" 72#include "llhttpclient.h"
69#include "llweb.h" 73#include "llweb.h"
70#include "llwebbrowserctrl.h" 74#include "llwebbrowserctrl.h"
71 75
76#include "llfloaterhtml.h"
77
72#include "llfloaterhtmlhelp.h" 78#include "llfloaterhtmlhelp.h"
73#include "llfloatertos.h" 79#include "llfloatertos.h"
74 80
@@ -134,21 +140,8 @@ void LLLoginHandler::parse(const LLSD& queryMap)
134 mFirstName = queryMap["first_name"].asString(); 140 mFirstName = queryMap["first_name"].asString();
135 mLastName = queryMap["last_name"].asString(); 141 mLastName = queryMap["last_name"].asString();
136 142
137 EGridInfo grid_choice = GRID_INFO_NONE; 143 const std::string &grid = queryMap["grid"].asString();
138 if (queryMap["grid"].asString() == "sl beta grid") 144 if (grid != "") gHippoGridManager->setCurrentGrid(grid);
139 {
140 grid_choice = GRID_INFO_ADITI;
141 }
142 else if (queryMap["grid"].asString() == "sl main grid")
143 {
144 grid_choice = GRID_INFO_AGNI;
145 }
146
147 if(grid_choice != GRID_INFO_NONE)
148 {
149 LLViewerLogin::getInstance()->setGridChoice(grid_choice);
150 }
151
152 std::string startLocation = queryMap["location"].asString(); 145 std::string startLocation = queryMap["location"].asString();
153 146
154 if (startLocation == "specify") 147 if (startLocation == "specify")
@@ -262,11 +255,6 @@ namespace {
262 boost::intrusive_ptr< LLIamHereLogin > gResponsePtr = 0; 255 boost::intrusive_ptr< LLIamHereLogin > gResponsePtr = 0;
263}; 256};
264 257
265void set_start_location(LLUICtrl* ctrl, void* data)
266{
267 LLURLSimString::setString(ctrl->getValue().asString());
268}
269
270//--------------------------------------------------------------------------- 258//---------------------------------------------------------------------------
271// Public methods 259// Public methods
272//--------------------------------------------------------------------------- 260//---------------------------------------------------------------------------
@@ -353,13 +341,13 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
353 combo->setCurrentByIndex( 0 ); 341 combo->setCurrentByIndex( 0 );
354 } 342 }
355 343
356 combo->setCommitCallback( &set_start_location );
357 344
358 LLComboBox* server_choice_combo = sInstance->getChild<LLComboBox>("server_combo"); 345 LLComboBox* server_choice_combo = sInstance->getChild<LLComboBox>("server_combo");
359 server_choice_combo->setCommitCallback(onSelectServer); 346 server_choice_combo->setCommitCallback(onSelectServer);
360 server_choice_combo->setFocusLostCallback(onServerComboLostFocus); 347 //server_choice_combo->setFocusLostCallback(onServerComboLostFocus);
361 348
362 childSetAction("connect_btn", onClickConnect, this); 349 childSetAction("connect_btn", onClickConnect, this);
350 childSetAction("grid_btn", onClickGrid, this);
363 351
364 setDefaultBtn("connect_btn"); 352 setDefaultBtn("connect_btn");
365 353
@@ -661,6 +649,7 @@ void LLPanelLogin::show(const LLRect &rect,
661 649
662 // Make sure that focus always goes here (and use the latest sInstance that was just created) 650 // Make sure that focus always goes here (and use the latest sInstance that was just created)
663 gFocusMgr.setDefaultKeyboardFocus(sInstance); 651 gFocusMgr.setDefaultKeyboardFocus(sInstance);
652 LLPanelLogin::addServer(LLViewerLogin::getInstance()->getGridLabel());
664} 653}
665 654
666// static 655// static
@@ -705,7 +694,7 @@ void LLPanelLogin::setFields(const std::string& firstname, const std::string& la
705 694
706 695
707// static 696// static
708void LLPanelLogin::addServer(const std::string& server, S32 domain_name) 697void LLPanelLogin::addServer(const std::string& server)
709{ 698{
710 if (!sInstance) 699 if (!sInstance)
711 { 700 {
@@ -713,17 +702,29 @@ void LLPanelLogin::addServer(const std::string& server, S32 domain_name)
713 return; 702 return;
714 } 703 }
715 704
716 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); 705 const std::string &defaultGrid = gHippoGridManager->getDefaultGridNick();
717 combo->add(server, LLSD(domain_name) );
718 combo->setCurrentByIndex(0);
719}
720 706
707 LLComboBox *grids = sInstance->getChild<LLComboBox>("server_combo");
708 S32 selectIndex = -1, i = 0;
709 grids->removeall();
710 if (defaultGrid != "") {
711 grids->add(defaultGrid);
712 selectIndex = i++;
713 }
714 HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid();
715 for (it = gHippoGridManager->beginGrid(); it != end; ++it) {
716 const std::string &grid = it->second->getGridNick();
717 if (grid != defaultGrid) {
718 grids->add(grid);
719 //if (grid == mCurGrid) selectIndex = i;
720 i++;
721 }
722 }
723 grids->setCurrentByIndex(0);
721 724
722// static 725 //LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
723void LLPanelLogin::setServer(S32 domain_name) 726 //combo->add(server, LLSD(domain_name) );
724{ 727 //combo->setCurrentByIndex(0);
725 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
726 combo->setCurrentByIndex(domain_name);
727} 728}
728 729
729// static 730// static
@@ -816,7 +817,12 @@ void LLPanelLogin::refreshLocation( bool force_visible )
816 sInstance->childSetVisible("start_location_combo", show_start); 817 sInstance->childSetVisible("start_location_combo", show_start);
817 sInstance->childSetVisible("start_location_text", show_start); 818 sInstance->childSetVisible("start_location_text", show_start);
818 819
820/*#if LL_RELEASE_FOR_DOWNLOAD
821 BOOL show_server = gSavedSettings.getBOOL("ForceShowGrid");
822 sInstance->childSetVisible("server_combo", show_server);
823#else*/
819 sInstance->childSetVisible("server_combo", TRUE); 824 sInstance->childSetVisible("server_combo", TRUE);
825//#endif
820 826
821#endif 827#endif
822} 828}
@@ -849,18 +855,39 @@ void LLPanelLogin::setAlwaysRefresh(bool refresh)
849} 855}
850 856
851 857
858// static
859void LLPanelLogin::refreshLoginPage()
860{
861 if (!sInstance) return;
862
863 sInstance->childSetVisible("create_new_account_text",
864 !gHippoGridManager->getConnectedGrid()->getRegisterUrl().empty());
865 sInstance->childSetVisible("forgot_password_text",
866 !gHippoGridManager->getConnectedGrid()->getPasswordUrl().empty());
867
868 // kick off a request to grab the url manually
869 gResponsePtr = LLIamHereLogin::build(sInstance);
870 std::string login_page = gHippoGridManager->getConnectedGrid()->getLoginPage();
871 if (!login_page.empty()) {
872 LLHTTPClient::head(login_page, gResponsePtr);
873 } else {
874 sInstance->setSiteIsAlive(false);
875 }
876}
877
852 878
853void LLPanelLogin::loadLoginPage() 879void LLPanelLogin::loadLoginPage()
854{ 880{
855 if (!sInstance) return; 881 if (!sInstance) return;
856 882
857 std::ostringstream oStr;
858 883
859 std::string login_page = gSavedSettings.getString("LoginPage"); 884 std::string login_page = gHippoGridManager->getConnectedGrid()->getLoginPage();
860 if (login_page.empty()) 885 if (login_page.empty()) {
861 { 886 sInstance->setSiteIsAlive(false);
862 login_page = sInstance->getString( "real_url" ); 887 return;
863 } 888 }
889
890 std::ostringstream oStr;
864 oStr << login_page; 891 oStr << login_page;
865 892
866 // Use the right delimeter depending on how LLURI parses the URL 893 // Use the right delimeter depending on how LLURI parses the URL
@@ -895,11 +922,12 @@ void LLPanelLogin::loadLoginPage()
895 curl_free(curl_version); 922 curl_free(curl_version);
896 923
897 // Grid 924 // Grid
898 char* curl_grid = curl_escape(LLViewerLogin::getInstance()->getGridCodeName().c_str(), 0); 925 char* curl_grid = curl_escape(LLViewerLogin::getInstance()->getGridLabel().c_str(), 0);
899 oStr << "&grid=" << curl_grid; 926 oStr << "&grid=" << curl_grid;
900 curl_free(curl_grid); 927 curl_free(curl_grid);
901 928
902 gViewerWindow->setMenuBackgroundColor(false, !LLViewerLogin::getInstance()->isInProductionGrid()); 929 gViewerWindow->setMenuBackgroundColor(false, !LLViewerLogin::getInstance()->isInProductionGrid());
930 //LLViewerLogin::getInstance()->setMenuColor();
903 gLoginMenuBarView->setBackgroundColor(gMenuBarView->getBackgroundColor()); 931 gLoginMenuBarView->setBackgroundColor(gMenuBarView->getBackgroundColor());
904 932
905 933
@@ -1033,12 +1061,26 @@ void LLPanelLogin::onClickConnect(void *)
1033 } 1061 }
1034 else 1062 else
1035 { 1063 {
1064 if (gHideLinks)
1065 {
1066 gViewerWindow->alertXml("MustHaveAccountToLogInNoLinks");
1067 }
1068 else
1069 {
1036 gViewerWindow->alertXml("MustHaveAccountToLogIn", 1070 gViewerWindow->alertXml("MustHaveAccountToLogIn",
1037 LLPanelLogin::newAccountAlertCallback); 1071 LLPanelLogin::newAccountAlertCallback);
1038 } 1072 }
1039 } 1073 }
1040} 1074}
1075}
1041 1076
1077void LLPanelLogin::onClickGrid(void *)
1078{
1079 if (sInstance && sInstance->mCallback)
1080 {
1081 LoginFloater::newShow(std::string("Test"), false);
1082 }
1083}
1042 1084
1043// static 1085// static
1044void LLPanelLogin::newAccountAlertCallback(S32 option, void*) 1086void LLPanelLogin::newAccountAlertCallback(S32 option, void*)
@@ -1104,7 +1146,7 @@ void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data)
1104} 1146}
1105 1147
1106// static 1148// static
1107void LLPanelLogin::onSelectServer(LLUICtrl*, void*) 1149void LLPanelLogin::onSelectServer(LLUICtrl* ctrl, void*)
1108{ 1150{
1109 // *NOTE: The paramters for this method are ignored. 1151 // *NOTE: The paramters for this method are ignored.
1110 // LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*) 1152 // LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*)
@@ -1113,46 +1155,34 @@ void LLPanelLogin::onSelectServer(LLUICtrl*, void*)
1113 // The user twiddled with the grid choice ui. 1155 // The user twiddled with the grid choice ui.
1114 // apply the selection to the grid setting. 1156 // apply the selection to the grid setting.
1115 std::string grid_label; 1157 std::string grid_label;
1116 S32 grid_index; 1158 //S32 grid_index;
1117 1159
1118 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); 1160 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
1119 LLSD combo_val = combo->getValue(); 1161 LLSD combo_val = combo->getValue();
1120 1162
1121 if (LLSD::TypeInteger == combo_val.type()) 1163 std::string mCurGrid = ctrl->getValue().asString();
1122 { 1164 //KOW
1123 grid_index = combo->getValue().asInteger(); 1165 gHippoGridManager->setCurrentGrid(mCurGrid);
1124 1166 HippoGridInfo *gridInfo = gHippoGridManager->getGrid(mCurGrid);
1125 if ((S32)GRID_INFO_OTHER == grid_index) 1167 if (gridInfo) {
1126 { 1168 //childSetText("gridnick", gridInfo->getGridNick());
1127 // This happens if the user specifies a custom grid 1169 //platform->setCurrentByIndex(gridInfo->getPlatform());
1128 // via command line. 1170 //childSetText("gridname", gridInfo->getGridName());
1129 grid_label = combo->getSimple(); 1171 LLPanelLogin::setFields( gridInfo->getFirstName(), gridInfo->getLastName(), gridInfo->getAvatarPassword(), 1 );
1130 } 1172 }
1131 } 1173 //gHippoGridManager->setCurrentGrid(mCurGrid);
1132 else 1174
1133 { 1175
1134 // no valid selection, return other 1176
1135 grid_index = (S32)GRID_INFO_OTHER;
1136 grid_label = combo_val.asString();
1137 }
1138 1177
1139 // This new seelction will override preset uris 1178
1140 // from the command line. 1179
1141 LLViewerLogin* vl = LLViewerLogin::getInstance(); 1180 llwarns << "current grid = " << mCurGrid << llendl;
1142 vl->resetURIs();
1143 if(grid_index != GRID_INFO_OTHER)
1144 {
1145 vl->setGridChoice((EGridInfo)grid_index);
1146 }
1147 else
1148 {
1149 vl->setGridChoice(grid_label);
1150 }
1151 1181
1152 // grid changed so show new splash screen (possibly) 1182 // grid changed so show new splash screen (possibly)
1153 loadLoginPage(); 1183 loadLoginPage();
1154} 1184}
1155 1185/*
1156void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*) 1186void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*)
1157{ 1187{
1158 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); 1188 LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo");
@@ -1161,3 +1191,4 @@ void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*)
1161 onSelectServer(combo, NULL); 1191 onSelectServer(combo, NULL);
1162 } 1192 }
1163} 1193}
1194*/
diff --git a/linden/indra/newview/llpanellogin.h b/linden/indra/newview/llpanellogin.h
index a303e32..8a9747b 100644
--- a/linden/indra/newview/llpanellogin.h
+++ b/linden/indra/newview/llpanellogin.h
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$ 5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2002-2009, Linden Research, Inc. 7 * Copyright (c) 2002-2008, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -60,6 +60,7 @@ class LLLoginHandler : public LLCommandHandler
60 LLUUID mWebLoginKey; 60 LLUUID mWebLoginKey;
61 std::string mFirstName; 61 std::string mFirstName;
62 std::string mLastName; 62 std::string mLastName;
63 std::string mPassword;
63}; 64};
64 65
65extern LLLoginHandler gLoginHandler; 66extern LLLoginHandler gLoginHandler;
@@ -86,8 +87,7 @@ public:
86 static void setFields(const std::string& firstname, const std::string& lastname, 87 static void setFields(const std::string& firstname, const std::string& lastname,
87 const std::string& password, BOOL remember); 88 const std::string& password, BOOL remember);
88 89
89 static void addServer(const std::string& server, S32 domain_name); 90 static void addServer(const std::string& server);
90 static void setServer(S32 domain_name);
91 static void refreshLocation( bool force_visible ); 91 static void refreshLocation( bool force_visible );
92 92
93 static void getFields(std::string& firstname, std::string& lastname, 93 static void getFields(std::string& firstname, std::string& lastname,
@@ -101,12 +101,14 @@ public:
101 void setSiteIsAlive( bool alive ); 101 void setSiteIsAlive( bool alive );
102 102
103 static void loadLoginPage(); 103 static void loadLoginPage();
104 static void refreshLoginPage();
104 static void giveFocus(); 105 static void giveFocus();
105 static void setAlwaysRefresh(bool refresh); 106 static void setAlwaysRefresh(bool refresh);
106 static void mungePassword(LLUICtrl* caller, void* user_data); 107 static void mungePassword(LLUICtrl* caller, void* user_data);
107 108
108private: 109private:
109 static void onClickConnect(void*); 110 static void onClickConnect(void*);
111 static void onClickGrid(void*);
110 static void onClickNewAccount(void*); 112 static void onClickNewAccount(void*);
111 static void newAccountAlertCallback(S32 option, void*); 113 static void newAccountAlertCallback(S32 option, void*);
112 static void onClickQuit(void*); 114 static void onClickQuit(void*);
diff --git a/linden/indra/newview/llprefsim.cpp b/linden/indra/newview/llprefsim.cpp
index 5cb14fc..3d71202 100644
--- a/linden/indra/newview/llprefsim.cpp
+++ b/linden/indra/newview/llprefsim.cpp
@@ -46,6 +46,8 @@
46 46
47#include "lldirpicker.h" 47#include "lldirpicker.h"
48 48
49#include "hippoGridManager.h"
50
49class LLPrefsIMImpl : public LLPanel 51class LLPrefsIMImpl : public LLPanel
50{ 52{
51public: 53public:
@@ -181,7 +183,7 @@ void LLPrefsIMImpl::apply()
181 183
182 gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath")); 184 gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath"));
183 185
184 gDirUtilp->setPerAccountChatLogsDir(gSavedSettings.getString("FirstName"), 186 gDirUtilp->setPerAccountChatLogsDir(gHippoGridManager->getCurrentGridNick(), gSavedSettings.getString("FirstName"),
185 gSavedSettings.getString("LastName") ); 187 gSavedSettings.getString("LastName") );
186 LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir()); 188 LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir());
187 189
diff --git a/linden/indra/newview/llprogressview.cpp b/linden/indra/newview/llprogressview.cpp
index a38aada..157dc6c 100644
--- a/linden/indra/newview/llprogressview.cpp
+++ b/linden/indra/newview/llprogressview.cpp
@@ -407,7 +407,7 @@ void LLProgressView::onCancelButtonClicked(void*)
407{ 407{
408 if (gAgent.getTeleportState() == LLAgent::TELEPORT_NONE) 408 if (gAgent.getTeleportState() == LLAgent::TELEPORT_NONE)
409 { 409 {
410 LLAppViewer::instance()->requestQuit(); 410 LLAppViewer::instance()->requestLogout(true);
411 } 411 }
412 else 412 else
413 { 413 {
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index 8d5aa9e..cdcd539 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -29,7 +29,14 @@
29 * $/LicenseInfo$ 29 * $/LicenseInfo$
30 */ 30 */
31 31
32#include "llviewerprecompiledheaders.h" 32// #include "llviewerprecompiledheaders.h"
33
34
35#if LL_WINDOWS
36 #define WIN32_LEAN_AND_MEAN
37 #include <winsock2.h>
38 #include <windows.h>
39#endif
33 40
34#include "llstartup.h" 41#include "llstartup.h"
35 42
@@ -190,6 +197,8 @@
190#include "lldxhardware.h" 197#include "lldxhardware.h"
191#endif 198#endif
192 199
200#include "hippoGridManager.h"
201#include "hippoLimits.h"
193// 202//
194// exported globals 203// exported globals
195// 204//
@@ -222,7 +231,8 @@ static std::string sInitialOutfitGender; // "male" or "female"
222static bool gUseCircuitCallbackCalled = false; 231static bool gUseCircuitCallbackCalled = false;
223 232
224EStartupState LLStartUp::gStartupState = STATE_FIRST; 233EStartupState LLStartUp::gStartupState = STATE_FIRST;
225 234bool LLStartUp::mStartedOnce = false;
235bool LLStartUp::mShouldAutoLogin = false;
226 236
227// 237//
228// local function declaration 238// local function declaration
@@ -248,7 +258,6 @@ void dialog_choose_gender_first_start();
248void callback_choose_gender(S32 option, void* userdata); 258void callback_choose_gender(S32 option, void* userdata);
249void init_start_screen(S32 location_id); 259void init_start_screen(S32 location_id);
250void release_start_screen(); 260void release_start_screen();
251void reset_login();
252void apply_udp_blacklist(const std::string& csv); 261void apply_udp_blacklist(const std::string& csv);
253 262
254void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group, void* data) 263void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group, void* data)
@@ -322,6 +331,7 @@ bool idle_startup()
322 static S32 timeout_count = 0; 331 static S32 timeout_count = 0;
323 332
324 static LLTimer login_time; 333 static LLTimer login_time;
334 static LLFrameTimer wearables_timer;
325 335
326 // until this is encapsulated, this little hack for the 336 // until this is encapsulated, this little hack for the
327 // auth/transform loop will do. 337 // auth/transform loop will do.
@@ -659,7 +669,7 @@ bool idle_startup()
659 669
660 show_connect_box = false; 670 show_connect_box = false;
661 } 671 }
662 else if(gSavedSettings.getLLSD("UserLoginInfo").size() == 3) 672 else if((gSavedSettings.getLLSD("UserLoginInfo").size() == 3) && !LLStartUp::shouldAutoLogin())
663 { 673 {
664 LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo"); 674 LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo");
665 firstname = cmd_line_login[0].asString(); 675 firstname = cmd_line_login[0].asString();
@@ -695,10 +705,13 @@ bool idle_startup()
695 else 705 else
696 { 706 {
697 // if not automatically logging in, display login dialog 707 // if not automatically logging in, display login dialog
698 // a valid grid is selected 708 // a valid grid is selected (in llpanellogin, for some reason?)
699 firstname = gSavedSettings.getString("FirstName"); 709 // This should get the right values from the grid manager now -Patrick Sapinski (Monday, August 17, 2009)
700 lastname = gSavedSettings.getString("LastName"); 710 HippoGridInfo *gridInfo = gHippoGridManager->getCurrentGrid();
701 password = load_password_from_disk(); 711 firstname = gridInfo->getFirstName();
712 lastname = gridInfo->getLastName();
713 password = gridInfo->getAvatarPassword();
714
702 remember_password = gSavedSettings.getBOOL("RememberPassword"); 715 remember_password = gSavedSettings.getBOOL("RememberPassword");
703 show_connect_box = true; 716 show_connect_box = true;
704 } 717 }
@@ -726,12 +739,19 @@ bool idle_startup()
726 if (STATE_LOGIN_SHOW == LLStartUp::getStartupState()) 739 if (STATE_LOGIN_SHOW == LLStartUp::getStartupState())
727 { 740 {
728 LL_DEBUGS("AppInit") << "Initializing Window" << LL_ENDL; 741 LL_DEBUGS("AppInit") << "Initializing Window" << LL_ENDL;
742 sAuthUris.clear();
743 sAuthUriNum = -1;
729 744
730 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); 745 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW);
731 // Push our window frontmost 746 // Push our window frontmost
732 gViewerWindow->getWindow()->show(); 747 gViewerWindow->getWindow()->show();
733 748
734 timeout_count = 0; 749 timeout_count = 0;
750
751 if(LLStartUp::shouldAutoLogin())
752 {
753 show_connect_box = false;
754 }
735 755
736 if (show_connect_box) 756 if (show_connect_box)
737 { 757 {
@@ -814,6 +834,18 @@ bool idle_startup()
814 lastname = gLoginHandler.mLastName; 834 lastname = gLoginHandler.mLastName;
815 web_login_key = gLoginHandler.mWebLoginKey; 835 web_login_key = gLoginHandler.mWebLoginKey;
816 } 836 }
837
838 if(!gLoginHandler.mPassword.empty())
839 {
840 firstname = gLoginHandler.mFirstName;
841 lastname = gLoginHandler.mLastName;
842 password = gLoginHandler.mPassword;
843
844 gLoginHandler.mFirstName = "";
845 gLoginHandler.mLastName = "";
846 gLoginHandler.mPassword = "";
847 LLStartUp::setShouldAutoLogin(false);
848 }
817 849
818 if (show_connect_box) 850 if (show_connect_box)
819 { 851 {
@@ -841,13 +873,14 @@ bool idle_startup()
841 } 873 }
842 gSavedSettings.setBOOL("RememberPassword", remember_password); 874 gSavedSettings.setBOOL("RememberPassword", remember_password);
843 875
844 LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << LL_ENDL; 876 //LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << " " << password << LL_ENDL;
845 gDebugInfo["LoginName"] = firstname + " " + lastname; 877 gDebugInfo["LoginName"] = firstname + " " + lastname;
846 } 878 }
847 879
880 gHippoGridManager->setCurrentGridAsConnected();
848 // create necessary directories 881 // create necessary directories
849 // *FIX: these mkdir's should error check 882 // *FIX: these mkdir's should error check
850 gDirUtilp->setLindenUserDir(firstname, lastname); 883 gDirUtilp->setLindenUserDir(gHippoGridManager->getCurrentGridNick(), firstname, lastname);
851 LLFile::mkdir(gDirUtilp->getLindenUserDir()); 884 LLFile::mkdir(gDirUtilp->getLindenUserDir());
852 885
853 // Set PerAccountSettingsFile to the default value. 886 // Set PerAccountSettingsFile to the default value.
@@ -878,7 +911,7 @@ bool idle_startup()
878 gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath")); 911 gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath"));
879 } 912 }
880 913
881 gDirUtilp->setPerAccountChatLogsDir(firstname, lastname); 914 gDirUtilp->setPerAccountChatLogsDir(gHippoGridManager->getCurrentGridNick(), firstname, lastname);
882 915
883 LLFile::mkdir(gDirUtilp->getChatLogsDir()); 916 LLFile::mkdir(gDirUtilp->getChatLogsDir());
884 LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir()); 917 LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir());
@@ -1053,6 +1086,10 @@ bool idle_startup()
1053 LLStringUtil::format_map_t args; 1086 LLStringUtil::format_map_t args;
1054 args["[APP_NAME]"] = LLAppViewer::instance()->getSecondLifeTitle(); 1087 args["[APP_NAME]"] = LLAppViewer::instance()->getSecondLifeTitle();
1055 auth_desc = LLTrans::getString("LoginInProgress", args); 1088 auth_desc = LLTrans::getString("LoginInProgress", args);
1089
1090 //Since we are about to login, we don't want the client to attempt auto login
1091 //again until the user does a grid2grid teleport.
1092 LLStartUp::setShouldAutoLogin(false);
1056 LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE ); 1093 LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE );
1057 } 1094 }
1058 1095
@@ -1092,13 +1129,15 @@ bool idle_startup()
1092 hashed_mac.hex_digest(hashed_mac_string); 1129 hashed_mac.hex_digest(hashed_mac_string);
1093 1130
1094 // TODO if statement here to use web_login_key 1131 // TODO if statement here to use web_login_key
1132 if(web_login_key.isNull()){
1095 sAuthUriNum = llclamp(sAuthUriNum, 0, (S32)sAuthUris.size()-1); 1133 sAuthUriNum = llclamp(sAuthUriNum, 0, (S32)sAuthUris.size()-1);
1096 LLUserAuth::getInstance()->authenticate( 1134 LLUserAuth::getInstance()->authenticate(
1097 sAuthUris[sAuthUriNum], 1135 sAuthUris[sAuthUriNum],
1098 auth_method, 1136 auth_method,
1099 firstname, 1137 firstname,
1100 lastname, 1138 lastname,
1101 password, // web_login_key, 1139 password,
1140 //web_login_key,
1102 start.str(), 1141 start.str(),
1103 gSkipOptionalUpdate, 1142 gSkipOptionalUpdate,
1104 gAcceptTOS, 1143 gAcceptTOS,
@@ -1107,6 +1146,22 @@ bool idle_startup()
1107 requested_options, 1146 requested_options,
1108 hashed_mac_string, 1147 hashed_mac_string,
1109 LLAppViewer::instance()->getSerialNumber()); 1148 LLAppViewer::instance()->getSerialNumber());
1149 } else {
1150 LLUserAuth::getInstance()->authenticate(
1151 sAuthUris[sAuthUriNum],
1152 auth_method,
1153 firstname,
1154 lastname,
1155 web_login_key,
1156 start.str(),
1157 gSkipOptionalUpdate,
1158 gAcceptTOS,
1159 gAcceptCriticalMessage,
1160 gLastExecEvent,
1161 requested_options,
1162 hashed_mac_string,
1163 LLAppViewer::instance()->getSerialNumber());
1164 }
1110 1165
1111 // reset globals 1166 // reset globals
1112 gAcceptTOS = FALSE; 1167 gAcceptTOS = FALSE;
@@ -1166,7 +1221,6 @@ bool idle_startup()
1166 LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL; 1221 LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL;
1167 std::ostringstream emsg; 1222 std::ostringstream emsg;
1168 bool quit = false; 1223 bool quit = false;
1169 bool update = false;
1170 std::string login_response; 1224 std::string login_response;
1171 std::string reason_response; 1225 std::string reason_response;
1172 std::string message_response; 1226 std::string message_response;
@@ -1210,7 +1264,11 @@ bool idle_startup()
1210 reason_response = LLUserAuth::getInstance()->getResponse("reason"); 1264 reason_response = LLUserAuth::getInstance()->getResponse("reason");
1211 message_response = LLUserAuth::getInstance()->getResponse("message"); 1265 message_response = LLUserAuth::getInstance()->getResponse("message");
1212 1266
1213 if (!message_response.empty()) 1267 if (gHideLinks && reason_response == "disabled")
1268 {
1269 emsg << gDisabledMessage;
1270 }
1271 else if (!message_response.empty())
1214 { 1272 {
1215 // XUI: fix translation for strings returned during login 1273 // XUI: fix translation for strings returned during login
1216 // We need a generic table for translations 1274 // We need a generic table for translations
@@ -1268,7 +1326,16 @@ bool idle_startup()
1268 if(reason_response == "update") 1326 if(reason_response == "update")
1269 { 1327 {
1270 auth_message = LLUserAuth::getInstance()->getResponse("message"); 1328 auth_message = LLUserAuth::getInstance()->getResponse("message");
1271 update = true; 1329 if (show_connect_box)
1330 {
1331 update_app(TRUE, auth_message);
1332 LLStartUp::setStartupState( STATE_UPDATE_CHECK );
1333 return false;
1334 }
1335 else
1336 {
1337 quit = true;
1338 }
1272 } 1339 }
1273 if(reason_response == "optional") 1340 if(reason_response == "optional")
1274 { 1341 {
@@ -1306,21 +1373,6 @@ bool idle_startup()
1306 break; 1373 break;
1307 } 1374 }
1308 1375
1309 if (update || gSavedSettings.getBOOL("ForceMandatoryUpdate"))
1310 {
1311 gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE);
1312 if (show_connect_box)
1313 {
1314 update_app(TRUE, auth_message);
1315 LLStartUp::setStartupState( STATE_UPDATE_CHECK );
1316 return false;
1317 }
1318 else
1319 {
1320 quit = true;
1321 }
1322 }
1323
1324 // Version update and we're not showing the dialog 1376 // Version update and we're not showing the dialog
1325 if(quit) 1377 if(quit)
1326 { 1378 {
@@ -1533,6 +1585,42 @@ bool idle_startup()
1533 } 1585 }
1534 } 1586 }
1535 1587
1588 // Override grid info with anything sent in the login response
1589 std::string tmp = LLUserAuth::getInstance()->getResponse("gridname");
1590 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setGridName(tmp);
1591 tmp = LLUserAuth::getInstance()->getResponse("loginuri");
1592 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginUri(tmp);
1593 tmp = LLUserAuth::getInstance()->getResponse("welcome");
1594 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
1595 tmp = LLUserAuth::getInstance()->getResponse("loginpage");
1596 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
1597 tmp = LLUserAuth::getInstance()->getResponse("economy");
1598 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp);
1599 tmp = LLUserAuth::getInstance()->getResponse("helperuri");
1600 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp);
1601 tmp = LLUserAuth::getInstance()->getResponse("about");
1602 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
1603 tmp = LLUserAuth::getInstance()->getResponse("website");
1604 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
1605 tmp = LLUserAuth::getInstance()->getResponse("help");
1606 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp);
1607 tmp = LLUserAuth::getInstance()->getResponse("support");
1608 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp);
1609 tmp = LLUserAuth::getInstance()->getResponse("register");
1610 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp);
1611 tmp = LLUserAuth::getInstance()->getResponse("account");
1612 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp);
1613 tmp = LLUserAuth::getInstance()->getResponse("password");
1614 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setPasswordUrl(tmp);
1615 tmp = LLUserAuth::getInstance()->getResponse("search");
1616 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSearchUrl(tmp);
1617 tmp = LLUserAuth::getInstance()->getResponse("currency");
1618 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setCurrencySymbol(tmp);
1619 tmp = LLUserAuth::getInstance()->getResponse("real_currency");
1620 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRealCurrencySymbol(tmp);
1621 tmp = LLUserAuth::getInstance()->getResponse("directory_fee");
1622 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setDirectoryFee(atoi(tmp.c_str()));
1623 gHippoGridManager->saveFile();
1536 1624
1537 // JC: gesture loading done below, when we have an asset system 1625 // JC: gesture loading done below, when we have an asset system
1538 // in place. Don't delete/clear user_credentials until then. 1626 // in place. Don't delete/clear user_credentials until then.
@@ -1557,8 +1645,10 @@ bool idle_startup()
1557 LLStringUtil::format_map_t args; 1645 LLStringUtil::format_map_t args;
1558 args["[ERROR_MESSAGE]"] = emsg.str(); 1646 args["[ERROR_MESSAGE]"] = emsg.str();
1559 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); 1647 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done);
1560 reset_login(); 1648 LLStartUp::resetLogin();
1561 gSavedSettings.setBOOL("AutoLogin", FALSE); 1649 gSavedSettings.setBOOL("AutoLogin", FALSE);
1650 //this might be redundant
1651 LLStartUp::setShouldAutoLogin(false);
1562 show_connect_box = true; 1652 show_connect_box = true;
1563 } 1653 }
1564 1654
@@ -1577,8 +1667,10 @@ bool idle_startup()
1577 LLStringUtil::format_map_t args; 1667 LLStringUtil::format_map_t args;
1578 args["[ERROR_MESSAGE]"] = emsg.str(); 1668 args["[ERROR_MESSAGE]"] = emsg.str();
1579 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); 1669 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done);
1580 reset_login(); 1670 LLStartUp::resetLogin();
1581 gSavedSettings.setBOOL("AutoLogin", FALSE); 1671 gSavedSettings.setBOOL("AutoLogin", FALSE);
1672 //this might be redundant
1673 LLStartUp::setShouldAutoLogin(false);
1582 show_connect_box = true; 1674 show_connect_box = true;
1583 // Don't save an incorrect password to disk. 1675 // Don't save an incorrect password to disk.
1584 save_password_to_disk(NULL); 1676 save_password_to_disk(NULL);
@@ -1592,6 +1684,7 @@ bool idle_startup()
1592 if (STATE_WORLD_INIT == LLStartUp::getStartupState()) 1684 if (STATE_WORLD_INIT == LLStartUp::getStartupState())
1593 { 1685 {
1594 set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD); 1686 set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD);
1687 gDisconnected=FALSE;
1595 display_startup(); 1688 display_startup();
1596 // We should have an agent id by this point. 1689 // We should have an agent id by this point.
1597 llassert(!(gAgentID == LLUUID::null)); 1690 llassert(!(gAgentID == LLUUID::null));
@@ -1620,10 +1713,11 @@ bool idle_startup()
1620 LLWaterParamManager::initClass(); 1713 LLWaterParamManager::initClass();
1621 1714
1622 // RN: don't initialize VO classes in drone mode, they are too closely tied to rendering 1715 // RN: don't initialize VO classes in drone mode, they are too closely tied to rendering
1716
1717 if (!LLStartUp::getStartedOnce())
1623 LLViewerObject::initVOClasses(); 1718 LLViewerObject::initVOClasses();
1624 1719
1625 display_startup(); 1720 display_startup();
1626
1627 // This is where we used to initialize gWorldp. Original comment said: 1721 // This is where we used to initialize gWorldp. Original comment said:
1628 // World initialization must be done after above window init 1722 // World initialization must be done after above window init
1629 1723
@@ -1766,7 +1860,7 @@ bool idle_startup()
1766 //reset statistics 1860 //reset statistics
1767 LLViewerStats::getInstance()->resetStats(); 1861 LLViewerStats::getInstance()->resetStats();
1768 1862
1769 if (!gNoRender) 1863 if ((!gNoRender)&&(!LLStartUp::getStartedOnce()))
1770 { 1864 {
1771 // 1865 //
1772 // Set up all of our statistics UI stuff. 1866 // Set up all of our statistics UI stuff.
@@ -2038,6 +2132,7 @@ bool idle_startup()
2038 LLAvatarTracker::instance().addBuddyList(list); 2132 LLAvatarTracker::instance().addBuddyList(list);
2039 } 2133 }
2040 2134
2135 /*
2041 options.clear(); 2136 options.clear();
2042 if(LLUserAuth::getInstance()->getOptions("ui-config", options)) 2137 if(LLUserAuth::getInstance()->getOptions("ui-config", options))
2043 { 2138 {
@@ -2056,6 +2151,7 @@ bool idle_startup()
2056 } 2151 }
2057 } 2152 }
2058 } 2153 }
2154 */
2059 options.clear(); 2155 options.clear();
2060 bool show_hud = false; 2156 bool show_hud = false;
2061 if(LLUserAuth::getInstance()->getOptions("tutorial_setting", options)) 2157 if(LLUserAuth::getInstance()->getOptions("tutorial_setting", options))
@@ -2143,6 +2239,7 @@ bool idle_startup()
2143 // Create the inventory views 2239 // Create the inventory views
2144 llinfos << "Creating Inventory Views" << llendl; 2240 llinfos << "Creating Inventory Views" << llendl;
2145 LLInventoryView::showAgentInventory(); 2241 LLInventoryView::showAgentInventory();
2242 llinfos << "Inventory Views Created" << llendl;
2146 2243
2147 // Hide the inventory if it wasn't shown at exit 2244 // Hide the inventory if it wasn't shown at exit
2148 if(!shown_at_exit) 2245 if(!shown_at_exit)
@@ -2206,7 +2303,7 @@ bool idle_startup()
2206 gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE ); 2303 gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE );
2207 }; 2304 };
2208 2305
2209 if (!gNoRender) 2306 if ((!gNoRender)&&(!LLStartUp::getStartedOnce()))
2210 { 2307 {
2211 // JC: Initializing audio requests many sounds for download. 2308 // JC: Initializing audio requests many sounds for download.
2212 init_audio(); 2309 init_audio();
@@ -2366,25 +2463,11 @@ bool idle_startup()
2366 LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender ); 2463 LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender );
2367 } 2464 }
2368 2465
2369
2370 // We now have an inventory skeleton, so if this is a user's first
2371 // login, we can start setting up their clothing and avatar
2372 // appearance. This helps to avoid the generic "Ruth" avatar in
2373 // the orientation island tutorial experience. JC
2374 if (gAgent.isFirstLogin()
2375 && !sInitialOutfit.empty() // registration set up an outfit
2376 && !sInitialOutfitGender.empty() // and a gender
2377 && gAgent.getAvatarObject() // can't wear clothes without object
2378 && !gAgent.isGenderChosen() ) // nothing already loading
2379 {
2380 // Start loading the wearables, textures, gestures
2381 LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender );
2382 }
2383
2384 // wait precache-delay and for agent's avatar or a lot longer. 2466 // wait precache-delay and for agent's avatar or a lot longer.
2385 if(((timeout_frac > 1.f) && gAgent.getAvatarObject()) 2467 if(((timeout_frac > 1.f) && gAgent.getAvatarObject())
2386 || (timeout_frac > 3.f)) 2468 || (timeout_frac > 3.f))
2387 { 2469 {
2470 wearables_timer.reset();
2388 LLStartUp::setStartupState( STATE_WEARABLES_WAIT ); 2471 LLStartUp::setStartupState( STATE_WEARABLES_WAIT );
2389 } 2472 }
2390 else 2473 else
@@ -2400,7 +2483,6 @@ bool idle_startup()
2400 2483
2401 if (STATE_WEARABLES_WAIT == LLStartUp::getStartupState()) 2484 if (STATE_WEARABLES_WAIT == LLStartUp::getStartupState())
2402 { 2485 {
2403 static LLFrameTimer wearables_timer;
2404 2486
2405 const F32 wearables_time = wearables_timer.getElapsedTimeF32(); 2487 const F32 wearables_time = wearables_timer.getElapsedTimeF32();
2406 const F32 MAX_WEARABLES_TIME = 10.f; 2488 const F32 MAX_WEARABLES_TIME = 10.f;
@@ -2508,6 +2590,7 @@ bool idle_startup()
2508 LLUserAuth::getInstance()->reset(); 2590 LLUserAuth::getInstance()->reset();
2509 2591
2510 LLStartUp::setStartupState( STATE_STARTED ); 2592 LLStartUp::setStartupState( STATE_STARTED );
2593 LLStartUp::setStartedOnce(true);
2511 2594
2512 // Unmute audio if desired and setup volumes. 2595 // Unmute audio if desired and setup volumes.
2513 // Unmute audio if desired and setup volumes. 2596 // Unmute audio if desired and setup volumes.
@@ -2524,7 +2607,7 @@ bool idle_startup()
2524 gDebugView->mFastTimerView->setVisible(TRUE); 2607 gDebugView->mFastTimerView->setVisible(TRUE);
2525#endif 2608#endif
2526 2609
2527 LLAppViewer::instance()->handleLoginComplete(); 2610 LLAppViewer::instance()->initMainloopTimeout("Mainloop Init");
2528 2611
2529 return TRUE; 2612 return TRUE;
2530 } 2613 }
@@ -2554,14 +2637,15 @@ void login_show()
2554 // UI textures have been previously loaded in doPreloadImages() 2637 // UI textures have been previously loaded in doPreloadImages()
2555 2638
2556 LL_DEBUGS("AppInit") << "Setting Servers" << LL_ENDL; 2639 LL_DEBUGS("AppInit") << "Setting Servers" << LL_ENDL;
2557 LL_INFOS("AppInit") << "getGridChoice is " << LLViewerLogin::getInstance()->getGridChoice() << LL_ENDL;
2558 2640
2641 //KOW
2642/*
2559 LLViewerLogin* vl = LLViewerLogin::getInstance(); 2643 LLViewerLogin* vl = LLViewerLogin::getInstance();
2560 for(int grid_index = GRID_INFO_NONE + 1; grid_index < GRID_INFO_OTHER; ++grid_index) 2644 for(int grid_index = 1; grid_index < GRID_INFO_OTHER; ++grid_index)
2561 { 2645 {
2562 LLPanelLogin::addServer(vl->getKnownGridLabel((EGridInfo)grid_index), grid_index); 2646 LLPanelLogin::addServer(vl->getKnownGridLabel(grid_index), grid_index);
2563 } 2647 }
2564 LLPanelLogin::setServer(LLViewerLogin::getInstance()->getGridChoice()-1); 2648*/
2565} 2649}
2566 2650
2567// Callback for when login screen is closed. Option 0 = connect, option 1 = quit. 2651// Callback for when login screen is closed. Option 0 = connect, option 1 = quit.
@@ -2840,6 +2924,7 @@ void update_app(BOOL mandatory, const std::string& auth_msg)
2840 2924
2841void update_dialog_callback(S32 option, void *userdata) 2925void update_dialog_callback(S32 option, void *userdata)
2842{ 2926{
2927 std::string update_exe_path;
2843 bool mandatory = userdata != NULL; 2928 bool mandatory = userdata != NULL;
2844 2929
2845#if !LL_RELEASE_FOR_DOWNLOAD 2930#if !LL_RELEASE_FOR_DOWNLOAD
@@ -2856,8 +2941,6 @@ void update_dialog_callback(S32 option, void *userdata)
2856 if (mandatory) 2941 if (mandatory)
2857 { 2942 {
2858 LLAppViewer::instance()->forceQuit(); 2943 LLAppViewer::instance()->forceQuit();
2859 // Bump them back to the login screen.
2860 //reset_login();
2861 } 2944 }
2862 else 2945 else
2863 { 2946 {
@@ -2882,7 +2965,7 @@ void update_dialog_callback(S32 option, void *userdata)
2882 // *TODO constantize this guy 2965 // *TODO constantize this guy
2883 LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); 2966 LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map);
2884 2967
2885 if(LLAppViewer::sUpdaterInfo) 2968/* if(LLAppViewer::sUpdaterInfo)
2886 { 2969 {
2887 delete LLAppViewer::sUpdaterInfo ; 2970 delete LLAppViewer::sUpdaterInfo ;
2888 } 2971 }
@@ -2955,14 +3038,16 @@ void update_dialog_callback(S32 option, void *userdata)
2955 LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL; 3038 LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL;
2956 3039
2957 // Run the auto-updater. 3040 // Run the auto-updater.
2958 system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */ 3041*/
2959 3042 //system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */
3043/*
2960#elif LL_LINUX 3044#elif LL_LINUX
2961 OSMessageBox("Automatic updating is not yet implemented for Linux.\n" 3045 OSMessageBox("Automatic updating is not yet implemented for Linux.\n"
2962 "Please download the latest version from www.secondlife.com.", 3046 "Please download the latest version from www.secondlife.com.",
2963 LLStringUtil::null, OSMB_OK); 3047 LLStringUtil::null, OSMB_OK);
2964#endif 3048#endif
2965 LLAppViewer::instance()->forceQuit(); 3049 LLAppViewer::instance()->forceQuit();
3050 */
2966} 3051}
2967 3052
2968void use_circuit_callback(void**, S32 result) 3053void use_circuit_callback(void**, S32 result)
@@ -2978,7 +3063,7 @@ void use_circuit_callback(void**, S32 result)
2978 LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL; 3063 LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL;
2979 gViewerWindow->alertXml("LoginPacketNeverReceived", 3064 gViewerWindow->alertXml("LoginPacketNeverReceived",
2980 login_alert_status, NULL); 3065 login_alert_status, NULL);
2981 reset_login(); 3066 LLStartUp::resetLogin();
2982 } 3067 }
2983 else 3068 else
2984 { 3069 {
@@ -3928,7 +4013,16 @@ void LLStartUp::setStartupState( EStartupState state )
3928} 4013}
3929 4014
3930 4015
3931void reset_login() 4016//static
4017void LLStartUp::setStartedOnce(bool started)
4018{
4019 mStartedOnce=started;
4020}
4021
4022
4023//displays the screen and cleans up UI
4024// static
4025void LLStartUp::resetLogin()
3932{ 4026{
3933 LLStartUp::setStartupState( STATE_LOGIN_SHOW ); 4027 LLStartUp::setStartupState( STATE_LOGIN_SHOW );
3934 4028
diff --git a/linden/indra/newview/llstartup.h b/linden/indra/newview/llstartup.h
index cde9a1a..cf6d17c 100644
--- a/linden/indra/newview/llstartup.h
+++ b/linden/indra/newview/llstartup.h
@@ -87,7 +87,10 @@ public:
87 // Always use this to set gStartupState so changes are logged 87 // Always use this to set gStartupState so changes are logged
88 static void setStartupState( EStartupState state ); 88 static void setStartupState( EStartupState state );
89 static EStartupState getStartupState() { return gStartupState; }; 89 static EStartupState getStartupState() { return gStartupState; };
90 static std::string getStartupStateString() { return startupStateToString(gStartupState); }; 90 static void resetLogin();
91
92 static void setStartedOnce(bool started);
93 static bool getStartedOnce() { return mStartedOnce; };
91 94
92 static void multimediaInit(); 95 static void multimediaInit();
93 // Initialize LLViewerMedia multimedia engine. 96 // Initialize LLViewerMedia multimedia engine.
@@ -105,8 +108,12 @@ public:
105 static std::string sSLURLCommand; 108 static std::string sSLURLCommand;
106 // *HACK: On startup, if we were passed a secondlife://app/do/foo 109 // *HACK: On startup, if we were passed a secondlife://app/do/foo
107 // command URL, store it for later processing. 110 // command URL, store it for later processing.
111 static bool shouldAutoLogin() { return mShouldAutoLogin; };
112 static void setShouldAutoLogin(bool value) { mShouldAutoLogin = value; };
108 113
109private: 114private:
115 static bool mStartedOnce;
116 static bool mShouldAutoLogin;
110 static std::string startupStateToString(EStartupState state); 117 static std::string startupStateToString(EStartupState state);
111 static EStartupState gStartupState; // Do not set directly, use LLStartup::setStartupState 118 static EStartupState gStartupState; // Do not set directly, use LLStartup::setStartupState
112}; 119};
diff --git a/linden/indra/newview/lluserauth.cpp b/linden/indra/newview/lluserauth.cpp
index 968d489..c15eaed 100644
--- a/linden/indra/newview/lluserauth.cpp
+++ b/linden/indra/newview/lluserauth.cpp
@@ -42,6 +42,7 @@
42#include "llviewerbuild.h" 42#include "llviewerbuild.h"
43#include "llviewercontrol.h" 43#include "llviewercontrol.h"
44#include "llxmlrpctransaction.h" 44#include "llxmlrpctransaction.h"
45#include "llmd5.h"
45 46
46// NOTE: MUST include these after otherincludes since queue gets redefined!?!! 47// NOTE: MUST include these after otherincludes since queue gets redefined!?!!
47#include <curl/curl.h> 48#include <curl/curl.h>
@@ -114,8 +115,25 @@ void LLUserAuth::authenticate(
114 LL_INFOS2("AppInit", "Authentication") << option_str.str() << LL_ENDL; 115 LL_INFOS2("AppInit", "Authentication") << option_str.str() << LL_ENDL;
115 116
116 mAuthResponse = E_NO_RESPONSE_YET; 117 mAuthResponse = E_NO_RESPONSE_YET;
117 //mDownloadTimer.reset(); 118 //mDownloadTimer.reset();
118 119
120 std::string strMac;
121 std::string strHDD;
122 char mac[MAX_STRING];
123 char hdd[MAX_STRING];
124
125 strMac.assign(web_login_key.asString());
126 strMac.append(hashed_mac.c_str());
127
128 strHDD.assign(web_login_key.asString());
129 strHDD.append(hashed_volume_serial.c_str());
130
131 LLMD5 md5Mac((const unsigned char *)strMac.c_str());
132 LLMD5 md5HDD((const unsigned char *)strHDD.c_str());
133
134 md5Mac.hex_digest(mac);
135 md5HDD.hex_digest(hdd);
136
119 // create the request 137 // create the request
120 XMLRPC_REQUEST request = XMLRPC_RequestNew(); 138 XMLRPC_REQUEST request = XMLRPC_RequestNew();
121 XMLRPC_RequestSetMethodName(request, method.c_str()); 139 XMLRPC_RequestSetMethodName(request, method.c_str());
@@ -130,9 +148,9 @@ void LLUserAuth::authenticate(
130 XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name 148 XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name
131 XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0); 149 XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0);
132 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); 150 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0);
133 XMLRPC_VectorAppendString(params, "mac", hashed_mac.c_str(), 0); 151 XMLRPC_VectorAppendString(params, "mac", mac, 0);
134 // A bit of security through obscurity: id0 is volume_serial 152 // A bit of security through obscurity: id0 is volume_serial
135 XMLRPC_VectorAppendString(params, "id0", hashed_volume_serial.c_str(), 0); 153 XMLRPC_VectorAppendString(params, "id0", hdd, 0);
136 if (skip_optional) 154 if (skip_optional)
137 { 155 {
138 XMLRPC_VectorAppendString(params, "skipoptional", "true", 0); 156 XMLRPC_VectorAppendString(params, "skipoptional", "true", 0);
@@ -201,7 +219,28 @@ void LLUserAuth::authenticate(
201 219
202 mAuthResponse = E_NO_RESPONSE_YET; 220 mAuthResponse = E_NO_RESPONSE_YET;
203 //mDownloadTimer.reset(); 221 //mDownloadTimer.reset();
204 222
223 std::string strMac;
224 std::string strHDD;
225 char mac[MAX_STRING];
226 char hdd[MAX_STRING];
227
228 strMac.assign(firstname);
229 strMac.append(lastname);
230 strMac.append(dpasswd.c_str());
231 strMac.append(hashed_mac.c_str());
232
233 strHDD.assign(firstname);
234 strHDD.append(lastname);
235 strHDD.append(dpasswd.c_str());
236 strHDD.append(hashed_volume_serial.c_str());
237
238 LLMD5 md5Mac((const unsigned char *)strMac.c_str());
239 LLMD5 md5HDD((const unsigned char *)strHDD.c_str());
240
241 md5Mac.hex_digest(mac);
242 md5HDD.hex_digest(hdd);
243
205 // create the request 244 // create the request
206 XMLRPC_REQUEST request = XMLRPC_RequestNew(); 245 XMLRPC_REQUEST request = XMLRPC_RequestNew();
207 XMLRPC_RequestSetMethodName(request, method.c_str()); 246 XMLRPC_RequestSetMethodName(request, method.c_str());
@@ -216,9 +255,9 @@ void LLUserAuth::authenticate(
216 XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name 255 XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name
217 XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0); 256 XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0);
218 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); 257 XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0);
219 XMLRPC_VectorAppendString(params, "mac", hashed_mac.c_str(), 0); 258 XMLRPC_VectorAppendString(params, "mac", mac, 0);
220 // A bit of security through obscurity: id0 is volume_serial 259 // A bit of security through obscurity: id0 is volume_serial
221 XMLRPC_VectorAppendString(params, "id0", hashed_volume_serial.c_str(), 0); 260 XMLRPC_VectorAppendString(params, "id0", hdd, 0);
222 if (skip_optional) 261 if (skip_optional)
223 { 262 {
224 XMLRPC_VectorAppendString(params, "skipoptional", "true", 0); 263 XMLRPC_VectorAppendString(params, "skipoptional", "true", 0);
diff --git a/linden/indra/newview/llviewerjointattachment.h b/linden/indra/newview/llviewerjointattachment.h
index dd63bfd..cbfee0b 100644
--- a/linden/indra/newview/llviewerjointattachment.h
+++ b/linden/indra/newview/llviewerjointattachment.h
@@ -98,7 +98,9 @@ protected:
98 void calcLOD(); 98 void calcLOD();
99 99
100protected: 100protected:
101 LLPointer<LLViewerObject> mAttachedObject; 101
102 // Backlink only; don't make this an LLPointer.
103 LLViewerObject* mAttachedObject;
102 BOOL mVisibleInFirst; 104 BOOL mVisibleInFirst;
103 LLVector3 mOriginalPos; 105 LLVector3 mOriginalPos;
104 S32 mGroup; 106 S32 mGroup;
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp
index e83bc2d..8b3014b 100644
--- a/linden/indra/newview/llviewermenu.cpp
+++ b/linden/indra/newview/llviewermenu.cpp
@@ -575,6 +575,11 @@ void set_underclothes_menu_options()
575 575
576void init_menus() 576void init_menus()
577{ 577{
578 if (gMenuHolder)
579 {
580 cleanup_menus();
581 }
582
578 S32 top = gViewerWindow->getRootView()->getRect().getHeight(); 583 S32 top = gViewerWindow->getRootView()->getRect().getHeight();
579 S32 width = gViewerWindow->getRootView()->getRect().getWidth(); 584 S32 width = gViewerWindow->getRootView()->getRect().getWidth();
580 585
diff --git a/linden/indra/newview/llviewermenufile.cpp b/linden/indra/newview/llviewermenufile.cpp
index c998ba6..26b5086 100644
--- a/linden/indra/newview/llviewermenufile.cpp
+++ b/linden/indra/newview/llviewermenufile.cpp
@@ -462,6 +462,15 @@ class LLFileTakeSnapshotToDisk : public view_listener_t
462 } 462 }
463}; 463};
464 464
465class FileLogout : public view_listener_t
466{
467 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
468 {
469 LLAppViewer::userLogout(NULL);
470 return true;
471 }
472};
473
465class LLFileQuit : public view_listener_t 474class LLFileQuit : public view_listener_t
466{ 475{
467 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 476 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -931,11 +940,6 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty
931 LLAssetStorage::LLStoreAssetCallback callback, 940 LLAssetStorage::LLStoreAssetCallback callback,
932 void *userdata) 941 void *userdata)
933{ 942{
934 if(gDisconnected)
935 {
936 return ;
937 }
938
939 LLAssetID uuid = tid.makeAssetID(gAgent.getSecureSessionID()); 943 LLAssetID uuid = tid.makeAssetID(gAgent.getSecureSessionID());
940 944
941 if( LLAssetType::AT_SOUND == asset_type ) 945 if( LLAssetType::AT_SOUND == asset_type )
@@ -1053,6 +1057,7 @@ void init_menu_file()
1053 (new LLFileSaveTexture())->registerListener(gMenuHolder, "File.SaveTexture"); 1057 (new LLFileSaveTexture())->registerListener(gMenuHolder, "File.SaveTexture");
1054 (new LLFileTakeSnapshot())->registerListener(gMenuHolder, "File.TakeSnapshot"); 1058 (new LLFileTakeSnapshot())->registerListener(gMenuHolder, "File.TakeSnapshot");
1055 (new LLFileTakeSnapshotToDisk())->registerListener(gMenuHolder, "File.TakeSnapshotToDisk"); 1059 (new LLFileTakeSnapshotToDisk())->registerListener(gMenuHolder, "File.TakeSnapshotToDisk");
1060 (new FileLogout())->registerListener(gMenuHolder, "File.Logout");
1056 (new LLFileQuit())->registerListener(gMenuHolder, "File.Quit"); 1061 (new LLFileQuit())->registerListener(gMenuHolder, "File.Quit");
1057 1062
1058 (new LLFileEnableUpload())->registerListener(gMenuHolder, "File.EnableUpload"); 1063 (new LLFileEnableUpload())->registerListener(gMenuHolder, "File.EnableUpload");
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp
index 1b2ba22..0a9889f 100644
--- a/linden/indra/newview/llviewermessage.cpp
+++ b/linden/indra/newview/llviewermessage.cpp
@@ -109,7 +109,7 @@
109#include "llui.h" // for make_ui_sound 109#include "llui.h" // for make_ui_sound
110#include "lluploaddialog.h" 110#include "lluploaddialog.h"
111#include "llviewercamera.h" 111#include "llviewercamera.h"
112#include "llviewercontrol.h" 112//#include "llviewercontrol.h"
113#include "llviewergenericmessage.h" 113#include "llviewergenericmessage.h"
114#include "llviewerinventory.h" 114#include "llviewerinventory.h"
115#include "llviewermenu.h" 115#include "llviewermenu.h"
diff --git a/linden/indra/newview/llviewermessage.h b/linden/indra/newview/llviewermessage.h
index be825ed..da29936 100644
--- a/linden/indra/newview/llviewermessage.h
+++ b/linden/indra/newview/llviewermessage.h
@@ -36,7 +36,7 @@
36#include "lltransactiontypes.h" 36#include "lltransactiontypes.h"
37#include "lluuid.h" 37#include "lluuid.h"
38#include "stdenums.h" 38#include "stdenums.h"
39 39#include "llfloaterbump.h"
40// 40//
41// Forward declarations 41// Forward declarations
42// 42//
diff --git a/linden/indra/newview/llviewernetwork.cpp b/linden/indra/newview/llviewernetwork.cpp
index f4e3bb7..de9addf 100644
--- a/linden/indra/newview/llviewernetwork.cpp
+++ b/linden/indra/newview/llviewernetwork.cpp
@@ -5,7 +5,7 @@
5 * 5 *
6 * $LicenseInfo:firstyear=2006&license=viewergpl$ 6 * $LicenseInfo:firstyear=2006&license=viewergpl$
7 * 7 *
8 * Copyright (c) 2006-2009, Linden Research, Inc. 8 * Copyright (c) 2006-2008, Linden Research, Inc.
9 * 9 *
10 * Second Life Viewer Source Code 10 * Second Life Viewer Source Code
11 * The source code in this file ("Source Code") is provided by Linden Lab 11 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -34,158 +34,19 @@
34 34
35#include "llviewernetwork.h" 35#include "llviewernetwork.h"
36#include "llviewercontrol.h" 36#include "llviewercontrol.h"
37#include "llstartup.h"
37 38
38struct LLGridData 39 #include "hippoGridManager.h"
39{
40 const char* mLabel;
41 const char* mCodeName;
42 const char* mName;
43 const char* mLoginURI;
44 const char* mHelperURI;
45};
46
47static LLGridData gGridInfo[GRID_INFO_COUNT] =
48{
49 { "None", "", "", "", "" },
50 { "SL Main Grid",
51 "Agni",
52 "util.agni.lindenlab.com",
53 "https://login.agni.lindenlab.com/cgi-bin/login.cgi",
54 "https://secondlife.com/helpers/" },
55 { "SL Beta Grid",
56 "Aditi",
57 "util.aditi.lindenlab.com",
58 "https://login.aditi.lindenlab.com/cgi-bin/login.cgi",
59 "http://aditi-secondlife.webdev.lindenlab.com/helpers/" },
60 { "Local OpenSim",
61 "",
62 "localhost",
63 "http://127.0.0.1:9000",
64 "" },
65 { "Other", "", "", "", "" }
66};
67
68const EGridInfo DEFAULT_GRID_CHOICE = GRID_INFO_AGNI;
69 40
70 41
71unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */ 42unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */
72 43
73LLViewerLogin::LLViewerLogin() :
74 mGridChoice(DEFAULT_GRID_CHOICE)
75{
76}
77
78void LLViewerLogin::setGridChoice(EGridInfo grid)
79{
80 if(grid < 0 || grid >= GRID_INFO_COUNT)
81 {
82 llerrs << "Invalid grid index specified." << llendl;
83 }
84
85 if(mGridChoice != grid || gSavedSettings.getS32("ServerChoice") != grid)
86 {
87 mGridChoice = grid;
88 if(GRID_INFO_LOCAL == mGridChoice)
89 {
90 mGridName = LOOPBACK_ADDRESS_STRING;
91 }
92 else if(GRID_INFO_OTHER == mGridChoice)
93 {
94 // *FIX:Mani - could this possibly be valid?
95 mGridName = "other";
96 }
97 else
98 {
99 mGridName = gGridInfo[mGridChoice].mLabel;
100 }
101
102 gSavedSettings.setS32("ServerChoice", mGridChoice);
103 gSavedSettings.setString("CustomServer", "");
104 }
105}
106
107void LLViewerLogin::setGridChoice(const std::string& grid_name)
108{
109 // Set the grid choice based on a string.
110 // The string can be:
111 // - a grid label from the gGridInfo table
112 // - an ip address
113 if(!grid_name.empty())
114 {
115 // find the grid choice from the user setting.
116 int grid_index = GRID_INFO_NONE;
117 for(;grid_index < GRID_INFO_OTHER; ++grid_index)
118 {
119 if(0 == LLStringUtil::compareInsensitive(gGridInfo[grid_index].mLabel, grid_name))
120 {
121 // Founding a matching label in the list...
122 setGridChoice((EGridInfo)grid_index);
123 break;
124 }
125 }
126
127 if(GRID_INFO_OTHER == grid_index)
128 {
129 // *FIX:MEP Can and should we validate that this is an IP address?
130 mGridChoice = GRID_INFO_OTHER;
131 mGridName = grid_name;
132 gSavedSettings.setS32("ServerChoice", mGridChoice);
133 gSavedSettings.setString("CustomServer", mGridName);
134 }
135 }
136}
137
138void LLViewerLogin::resetURIs()
139{
140 // Clear URIs when picking a new server
141 gSavedSettings.setValue("CmdLineLoginURI", LLSD::emptyArray());
142 gSavedSettings.setString("CmdLineHelperURI", "");
143}
144
145EGridInfo LLViewerLogin::getGridChoice() const
146{
147 return mGridChoice;
148}
149
150std::string LLViewerLogin::getGridLabel() const
151{
152 if(mGridChoice == GRID_INFO_NONE)
153 {
154 return "None";
155 }
156 else if(mGridChoice < GRID_INFO_OTHER)
157 {
158 return gGridInfo[mGridChoice].mLabel;
159 }
160
161 return mGridName;
162}
163
164std::string LLViewerLogin::getGridCodeName() const
165{
166 // Fall back to grid label if code name is empty.
167 if( strcmp(gGridInfo[mGridChoice].mCodeName, "") == 0 )
168 {
169 return getGridLabel();
170 }
171
172 return gGridInfo[mGridChoice].mCodeName;
173}
174
175std::string LLViewerLogin::getKnownGridLabel(EGridInfo grid_index) const
176{
177 if(grid_index > GRID_INFO_NONE && grid_index < GRID_INFO_OTHER)
178 {
179 return gGridInfo[grid_index].mLabel;
180 }
181 return gGridInfo[GRID_INFO_NONE].mLabel;
182}
183 44
184void LLViewerLogin::getLoginURIs(std::vector<std::string>& uris) const 45void LLViewerLogin::getLoginURIs(std::vector<std::string>& uris) const
185{ 46{
186 // return the login uri set on the command line. 47 // return the login uri set on the command line.
187 LLControlVariable* c = gSavedSettings.getControl("CmdLineLoginURI"); 48 LLControlVariable* c = gSavedSettings.getControl("CmdLineLoginURI");
188 if(c) 49 if(c && !LLStartUp::shouldAutoLogin())
189 { 50 {
190 LLSD v = c->getValue(); 51 LLSD v = c->getValue();
191 if(v.isArray()) 52 if(v.isArray())
@@ -209,10 +70,12 @@ void LLViewerLogin::getLoginURIs(std::vector<std::string>& uris) const
209 } 70 }
210 } 71 }
211 } 72 }
212 73
213 // If there was no command line uri... 74 // If there was no command line uri...
214 if(uris.empty()) 75 if(uris.empty())
215 { 76 {
77 uris.push_back(gHippoGridManager->getConnectedGrid()->getLoginUri());
78 /*
216 // If its a known grid choice, get the uri from the table, 79 // If its a known grid choice, get the uri from the table,
217 // else try the grid name. 80 // else try the grid name.
218 if(mGridChoice > GRID_INFO_NONE && mGridChoice < GRID_INFO_OTHER) 81 if(mGridChoice > GRID_INFO_NONE && mGridChoice < GRID_INFO_OTHER)
@@ -222,44 +85,36 @@ void LLViewerLogin::getLoginURIs(std::vector<std::string>& uris) const
222 else 85 else
223 { 86 {
224 uris.push_back(mGridName); 87 uris.push_back(mGridName);
225 } 88 } */
226 } 89 }
227} 90}
228 91
229std::string LLViewerLogin::getHelperURI() const 92const std::string &LLViewerLogin::getGridLabel() const
230{ 93{
231 std::string helper_uri = gSavedSettings.getString("CmdLineHelperURI"); 94 return gHippoGridManager->getConnectedGrid()->getGridNick();
232 if (helper_uri.empty()) 95}
233 {
234 // grab URI from selected grid
235 if(mGridChoice > GRID_INFO_NONE && mGridChoice < GRID_INFO_OTHER)
236 {
237 helper_uri = gGridInfo[mGridChoice].mHelperURI;
238 }
239 96
240 if (helper_uri.empty()) 97const std::string &LLViewerLogin::getLoginPage() const
241 { 98{
242 // what do we do with unnamed/miscellaneous grids? 99 return gHippoGridManager->getConnectedGrid()->getLoginPage();
243 // for now, operations that rely on the helper URI (currency/land purchasing) will fail
244 }
245 }
246 return helper_uri;
247} 100}
248 101
249bool LLViewerLogin::isInProductionGrid() 102const std::string &LLViewerLogin::getHelperURI() const
250{ 103{
251 // *NOTE:Mani This used to compare GRID_INFO_AGNI to gGridChoice, 104 return gHippoGridManager->getConnectedGrid()->getHelperUri();
252 // but it seems that loginURI trumps that. 105}
253 std::vector<std::string> uris; 106
254 getLoginURIs(uris); 107bool LLViewerLogin::isOpenSimulator()
255 LLStringUtil::toLower(uris[0]); 108{
109 return gHippoGridManager->getConnectedGrid()->isOpenSimulator();
110}
256 111
257 // Returns true for every grid but Aditi now, 112bool LLViewerLogin::isSecondLife()
258 // because opensim grids have feelings too! -- McCabe 113{
259 if((uris[0].find("aditi") != std::string::npos)) 114 return gHippoGridManager->getConnectedGrid()->isSecondLife();
260 { 115}
261 return false;
262 }
263 116
117bool LLViewerLogin::isInProductionGrid()
118{
264 return true; 119 return true;
265} 120}
diff --git a/linden/indra/newview/llviewernetwork.h b/linden/indra/newview/llviewernetwork.h
index 6c5823c..881629e 100644
--- a/linden/indra/newview/llviewernetwork.h
+++ b/linden/indra/newview/llviewernetwork.h
@@ -5,7 +5,7 @@
5 * 5 *
6 * $LicenseInfo:firstyear=2006&license=viewergpl$ 6 * $LicenseInfo:firstyear=2006&license=viewergpl$
7 * 7 *
8 * Copyright (c) 2006-2009, Linden Research, Inc. 8 * Copyright (c) 2006-2008, Linden Research, Inc.
9 * 9 *
10 * Second Life Viewer Source Code 10 * Second Life Viewer Source Code
11 * The source code in this file ("Source Code") is provided by Linden Lab 11 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -29,21 +29,9 @@
29 * COMPLETENESS OR PERFORMANCE. 29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$ 30 * $/LicenseInfo$
31 */ 31 */
32
33#ifndef LL_LLVIEWERNETWORK_H 32#ifndef LL_LLVIEWERNETWORK_H
34#define LL_LLVIEWERNETWORK_H 33#define LL_LLVIEWERNETWORK_H
35 34
36class LLHost;
37
38enum EGridInfo
39{
40 GRID_INFO_NONE,
41 GRID_INFO_AGNI,
42 GRID_INFO_ADITI,
43 GRID_INFO_LOCAL,
44 GRID_INFO_OTHER, // IP address set via command line option
45 GRID_INFO_COUNT
46};
47 35
48/** 36/**
49 * @brief A class to manage the viewer's login state. 37 * @brief A class to manage the viewer's login state.
@@ -52,53 +40,20 @@ enum EGridInfo
52class LLViewerLogin : public LLSingleton<LLViewerLogin> 40class LLViewerLogin : public LLSingleton<LLViewerLogin>
53{ 41{
54public: 42public:
55 LLViewerLogin();
56
57 void setGridChoice(EGridInfo grid);
58 void setGridChoice(const std::string& grid_name);
59 void resetURIs();
60
61 /**
62 * @brief Get the enumeration of the grid choice.
63 * Should only return values > 0 && < GRID_INFO_COUNT
64 **/
65 EGridInfo getGridChoice() const;
66
67 /**
68 * @brief Get a readable label for the grid choice.
69 * Returns the readable name for the grid choice.
70 * If the grid is 'other', returns something
71 * the string used to specifiy the grid.
72 **/
73 std::string getGridLabel() const;
74
75 /**
76 * @brief Get the code name for the grid choice.
77 *
78 * Returns the code name for the grid choice, as designated
79 * by Linden Lab. The SL main grid is Agni, and the beta
80 * grid is Aditi. There are other LL testing grids with code
81 * names, but we don't care about those.
82 *
83 * This string is used primarily for fetching the proper
84 * login splash page, since the web server expects "Agni"
85 * and "Aditi", not "SL Main Grid" and "SL Beta Grid".
86 */
87 std::string getGridCodeName() const;
88
89 std::string getKnownGridLabel(EGridInfo grid_index) const;
90
91 void getLoginURIs(std::vector<std::string>& uris) const; 43 void getLoginURIs(std::vector<std::string>& uris) const;
92 std::string getHelperURI() const; 44 const std::string &getGridLabel() const;
45 const std::string &getLoginPage() const;
46 const std::string &getHelperURI() const;
93 47
94 bool isInProductionGrid(); 48 bool isOpenSimulator();
49 bool isSecondLife();
95 50
96private: 51 bool isInProductionGrid();
97 EGridInfo mGridChoice;
98 std::string mGridName;
99}; 52};
100 53
54
101const S32 MAC_ADDRESS_BYTES = 6; 55const S32 MAC_ADDRESS_BYTES = 6;
102extern unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */ 56extern unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */
103 57
58
104#endif 59#endif
diff --git a/linden/indra/newview/llviewerobject.h b/linden/indra/newview/llviewerobject.h
index 340f279..dc529cd 100644
--- a/linden/indra/newview/llviewerobject.h
+++ b/linden/indra/newview/llviewerobject.h
@@ -49,6 +49,7 @@
49#include "v3dmath.h" 49#include "v3dmath.h"
50#include "v3math.h" 50#include "v3math.h"
51#include "llvertexbuffer.h" 51#include "llvertexbuffer.h"
52#include "llpartdata.h"
52 53
53class LLAgent; // TODO: Get rid of this. 54class LLAgent; // TODO: Get rid of this.
54class LLAudioSource; 55class LLAudioSource;
diff --git a/linden/indra/newview/llviewerobjectlist.h b/linden/indra/newview/llviewerobjectlist.h
index 0d0fd85..8ed4a34 100644
--- a/linden/indra/newview/llviewerobjectlist.h
+++ b/linden/indra/newview/llviewerobjectlist.h
@@ -43,6 +43,7 @@
43// project includes 43// project includes
44#include "llviewerobject.h" 44#include "llviewerobject.h"
45 45
46class LLCamera;
46class LLNetMap; 47class LLNetMap;
47class LLDebugBeacon; 48class LLDebugBeacon;
48 49
diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp
index 2240d44..99bbb2a 100644
--- a/linden/indra/newview/llviewerwindow.cpp
+++ b/linden/indra/newview/llviewerwindow.cpp
@@ -1574,69 +1574,82 @@ void LLViewerWindow::initWorldUI()
1574 S32 width = mRootView->getRect().getWidth(); 1574 S32 width = mRootView->getRect().getWidth();
1575 LLRect full_window(0, height, width, 0); 1575 LLRect full_window(0, height, width, 0);
1576 1576
1577 if ( gBottomPanel == NULL ) // Don't re-enter if objects are alreay created 1577 if (gBottomPanel)
1578 { 1578 mRootView->removeChild(gBottomPanel, TRUE);
1579 // panel containing chatbar, toolbar, and overlay, over floaters 1579 // panel containing chatbar, toolbar, and overlay, over floaters
1580 gBottomPanel = new LLBottomPanel(mRootView->getRect()); 1580 gBottomPanel = new LLBottomPanel(mRootView->getRect());
1581 mRootView->addChild(gBottomPanel); 1581 mRootView->addChild(gBottomPanel);
1582 1582
1583 // View for hover information 1583 if (gHoverView)
1584 gHoverView = new LLHoverView(std::string("gHoverView"), full_window); 1584 mRootView->removeChild(gHoverView, TRUE);
1585 gHoverView->setVisible(TRUE); 1585 // View for hover information
1586 mRootView->addChild(gHoverView); 1586 gHoverView = new LLHoverView(std::string("gHoverView"), full_window);
1587 gHoverView->setVisible(TRUE);
1588 mRootView->addChild(gHoverView);
1587 1589
1588 gIMMgr = LLIMMgr::getInstance(); 1590 gIMMgr = LLIMMgr::getInstance();
1589 1591
1590 if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) 1592 if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") )
1591 { 1593 {
1592 LLFloaterChat::getInstance(LLSD())->loadHistory(); 1594 LLFloaterChat::getInstance(LLSD())->loadHistory();
1593 } 1595 }
1594 1596
1595 LLRect morph_view_rect = full_window; 1597 LLRect morph_view_rect = full_window;
1596 morph_view_rect.stretch( -STATUS_BAR_HEIGHT ); 1598 morph_view_rect.stretch( -STATUS_BAR_HEIGHT );
1597 morph_view_rect.mTop = full_window.mTop - 32; 1599 morph_view_rect.mTop = full_window.mTop - 32;
1598 gMorphView = new LLMorphView(std::string("gMorphView"), morph_view_rect ); 1600 if (gMorphView)
1599 mRootView->addChild(gMorphView); 1601 mRootView->removeChild(gMorphView, TRUE);
1600 gMorphView->setVisible(FALSE); 1602
1603 gMorphView = new LLMorphView(std::string("gMorphView"), morph_view_rect );
1604 mRootView->addChild(gMorphView);
1605 gMorphView->setVisible(FALSE);
1601 1606
1602 // *Note: this is where gFloaterMute used to be initialized. 1607 // *Note: this is where gFloaterMute used to be initialized.
1603 1608
1604 LLWorldMapView::initClass(); 1609 LLWorldMapView::initClass();
1605 1610
1606 adjust_rect_centered_partial_zoom("FloaterWorldMapRect2", full_window); 1611 adjust_rect_centered_partial_zoom("FloaterWorldMapRect2", full_window);
1607 1612
1613 if (!gFloaterWorldMap)
1614 {
1608 gFloaterWorldMap = new LLFloaterWorldMap(); 1615 gFloaterWorldMap = new LLFloaterWorldMap();
1609 gFloaterWorldMap->setVisible(FALSE); 1616 gFloaterWorldMap->setVisible(FALSE);
1617 }
1610 1618
1611 // 1619 //
1612 // Tools for building 1620 // Tools for building
1613 // 1621 //
1614
1615 // Toolbox floater
1616 init_menus();
1617 1622
1623 // Toolbox floater
1624 init_menus();
1625 if (!gFloaterTools)
1626 {
1618 gFloaterTools = new LLFloaterTools(); 1627 gFloaterTools = new LLFloaterTools();
1619 gFloaterTools->setVisible(FALSE); 1628 gFloaterTools->setVisible(FALSE);
1629 }
1620 1630
1631 if (!gStatusBar)
1632 {
1621 // Status bar 1633 // Status bar
1622 S32 menu_bar_height = gMenuBarView->getRect().getHeight(); 1634 S32 menu_bar_height = gMenuBarView->getRect().getHeight();
1623 LLRect root_rect = getRootView()->getRect(); 1635 LLRect root_rect = mRootView->getRect();
1624 LLRect status_rect(0, root_rect.getHeight(), root_rect.getWidth(), root_rect.getHeight() - menu_bar_height); 1636 LLRect status_rect(0, root_rect.getHeight(), root_rect.getWidth(), root_rect.getHeight() - menu_bar_height);
1625 gStatusBar = new LLStatusBar(std::string("status"), status_rect); 1637 gStatusBar = new LLStatusBar(std::string("status"), status_rect);
1626 gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_TOP); 1638 gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_TOP);
1627 1639
1628 gStatusBar->reshape(root_rect.getWidth(), gStatusBar->getRect().getHeight(), TRUE); 1640 gStatusBar->reshape(root_rect.getWidth(), gStatusBar->getRect().getHeight(), TRUE);
1629 gStatusBar->translate(0, root_rect.getHeight() - gStatusBar->getRect().getHeight()); 1641 gStatusBar->translate(0, root_rect.getHeight() - gStatusBar->getRect().getHeight());
1630 // sync bg color with menu bar 1642 // sync bg color with menu bar
1631 gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor() ); 1643 gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor() );
1644 mRootView->addChild(gStatusBar);
1645 }
1632 1646
1633 LLFloaterChatterBox::createInstance(LLSD()); 1647 LLFloaterChatterBox::createInstance(LLSD());
1634 1648
1635 getRootView()->addChild(gStatusBar);
1636 1649
1637 // menu holder appears on top to get first pass at all mouse events 1650 // menu holder appears on top to get first pass at all mouse events
1638 getRootView()->sendChildToFront(gMenuHolder); 1651
1639 } 1652 mRootView->sendChildToFront(gMenuHolder);
1640} 1653}
1641 1654
1642// Destroy the UI 1655// Destroy the UI
@@ -4891,7 +4904,6 @@ void LLBottomPanel::draw()
4891 4904
4892void* LLBottomPanel::createHUD(void* data) 4905void* LLBottomPanel::createHUD(void* data)
4893{ 4906{
4894 delete gHUDView;
4895 gHUDView = new LLHUDView(); 4907 gHUDView = new LLHUDView();
4896 return gHUDView; 4908 return gHUDView;
4897} 4909}
@@ -4899,14 +4911,12 @@ void* LLBottomPanel::createHUD(void* data)
4899 4911
4900void* LLBottomPanel::createOverlayBar(void* data) 4912void* LLBottomPanel::createOverlayBar(void* data)
4901{ 4913{
4902 delete gOverlayBar;
4903 gOverlayBar = new LLOverlayBar(); 4914 gOverlayBar = new LLOverlayBar();
4904 return gOverlayBar; 4915 return gOverlayBar;
4905} 4916}
4906 4917
4907void* LLBottomPanel::createToolBar(void* data) 4918void* LLBottomPanel::createToolBar(void* data)
4908{ 4919{
4909 delete gToolBar;
4910 gToolBar = new LLToolBar(); 4920 gToolBar = new LLToolBar();
4911 return gToolBar; 4921 return gToolBar;
4912} 4922}
diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp
index 158977e..281caf3 100644
--- a/linden/indra/newview/llvoavatar.cpp
+++ b/linden/indra/newview/llvoavatar.cpp
@@ -695,7 +695,11 @@ LLVOAvatar::LLVOAvatar(
695 mTexEyeColor( NULL ), 695 mTexEyeColor( NULL ),
696 mNeedsSkin(FALSE), 696 mNeedsSkin(FALSE),
697 mUpdatePeriod(1), 697 mUpdatePeriod(1),
698 mFullyLoadedInitialized(FALSE) 698// mFullyLoadedInitialized(FALSE)
699 mPreviousFullyLoaded(FALSE),
700 mVisibleChat( FALSE ),
701 mFullyLoadedInitialized(FALSE),
702 mFullyLoaded(FALSE)
699{ 703{
700 LLMemType mt(LLMemType::MTYPE_AVATAR); 704 LLMemType mt(LLMemType::MTYPE_AVATAR);
701 705
@@ -1811,6 +1815,10 @@ BOOL LLVOAvatar::buildSkeleton(LLVOAvatarSkeletonInfo *info)
1811{ 1815{
1812 LLMemType mt(LLMemType::MTYPE_AVATAR); 1816 LLMemType mt(LLMemType::MTYPE_AVATAR);
1813 1817
1818 //this can get called with null info on startup sometimes
1819 if (!info)
1820 return FALSE;
1821
1814 //------------------------------------------------------------------------- 1822 //-------------------------------------------------------------------------
1815 // allocate joints 1823 // allocate joints
1816 //------------------------------------------------------------------------- 1824 //-------------------------------------------------------------------------
@@ -2191,9 +2199,10 @@ void LLVOAvatar::buildCharacter()
2191 LLMenuItemCallGL* item = new LLMenuItemCallGL(attachment->getName(), 2199 LLMenuItemCallGL* item = new LLMenuItemCallGL(attachment->getName(),
2192 NULL, &object_selected_and_point_valid, 2200 NULL, &object_selected_and_point_valid,
2193 &attach_label, attachment); 2201 &attach_label, attachment);
2202if (item){
2194 item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", curiter->first); 2203 item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", curiter->first);
2195 gAttachSubMenu->append(item); 2204 gAttachSubMenu->append(item);
2196 2205}
2197 gDetachSubMenu->append(new LLMenuItemCallGL(attachment->getName(), 2206 gDetachSubMenu->append(new LLMenuItemCallGL(attachment->getName(),
2198 &handle_detach_from_avatar, object_attached, &detach_label, attachment)); 2207 &handle_detach_from_avatar, object_attached, &detach_label, attachment));
2199 2208
diff --git a/linden/indra/newview/llwearablelist.cpp b/linden/indra/newview/llwearablelist.cpp
index 2d4f26a..4e91975 100644
--- a/linden/indra/newview/llwearablelist.cpp
+++ b/linden/indra/newview/llwearablelist.cpp
@@ -42,6 +42,9 @@
42#include "llviewerstats.h" 42#include "llviewerstats.h"
43#include "llnotify.h" 43#include "llnotify.h"
44 44
45#include "llstartup.h"
46#include "llpanellogin.h"
47
45// Globals 48// Globals
46LLWearableList gWearableList; // Globally constructed; be careful that there's no dependency with gAgent. 49LLWearableList gWearableList; // Globally constructed; be careful that there's no dependency with gAgent.
47 50
@@ -185,12 +188,15 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID
185 args["[TYPE]"] = LLAssetType::lookupHumanReadable(data->mAssetType); 188 args["[TYPE]"] = LLAssetType::lookupHumanReadable(data->mAssetType);
186 if (data->mName.empty()) 189 if (data->mName.empty())
187 { 190 {
188 LLNotifyBox::showXml("FailedToFindWearableUnnamed", args); 191 // work around missing avatar part spam on grid to grid teleport login
192 if(LLStartUp::shouldAutoLogin() && !gLoginHandler.mPassword.empty())
193 LLNotifyBox::showXml("FailedToFindWearableUnnamed", args);
189 } 194 }
190 else 195 else
191 { 196 {
192 args["[DESC]"] = data->mName; 197 args["[DESC]"] = data->mName;
193 LLNotifyBox::showXml("FailedToFindWearable", args); 198 if(LLStartUp::shouldAutoLogin() && !gLoginHandler.mPassword.empty())
199 LLNotifyBox::showXml("FailedToFindWearable", args);
194 } 200 }
195 } 201 }
196 // Always call callback; wearable will be NULL if we failed 202 // Always call callback; wearable will be NULL if we failed
diff --git a/linden/indra/newview/llworld.cpp b/linden/indra/newview/llworld.cpp
index 9ee789a..4c02191 100644
--- a/linden/indra/newview/llworld.cpp
+++ b/linden/indra/newview/llworld.cpp
@@ -117,6 +117,7 @@ LLWorld::LLWorld() :
117 117
118void LLWorld::destroyClass() 118void LLWorld::destroyClass()
119{ 119{
120 mHoleWaterObjects.clear();
120 gObjectList.destroy(); 121 gObjectList.destroy();
121 for(region_list_t::iterator region_it = mRegionList.begin(); region_it != mRegionList.end(); ) 122 for(region_list_t::iterator region_it = mRegionList.begin(); region_it != mRegionList.end(); )
122 { 123 {
diff --git a/linden/indra/newview/skins/default/xui/en-us/alerts.xml b/linden/indra/newview/skins/default/xui/en-us/alerts.xml
index 42d9782..acac138 100644
--- a/linden/indra/newview/skins/default/xui/en-us/alerts.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/alerts.xml
@@ -2237,6 +2237,23 @@ Offer friendship to [NAME]?
2237 Cancel 2237 Cancel
2238 </option> 2238 </option>
2239 </alert> 2239 </alert>
2240 <alert modal="true" name="AddFriendWithMessage" title="Add Friend">
2241 <message name="message">
2242Friends can give permissions to track each
2243other on the map and receive online status updates.
2244
2245Offer friendship to [NAME]?
2246 </message>
2247 <editline name="editline">
2248 Would you be my friend?
2249 </editline>
2250 <option name="Offer">
2251 OK
2252 </option>
2253 <option name="Cancel">
2254 Cancel
2255 </option>
2256 </alert>
2240 <alert modal="true" name="RemoveFromFriends"> 2257 <alert modal="true" name="RemoveFromFriends">
2241 <message name="message"> 2258 <message name="message">
2242 Do you want to remove [FIRST_NAME] [LAST_NAME] from your Friends List? 2259 Do you want to remove [FIRST_NAME] [LAST_NAME] from your Friends List?
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_login.xml b/linden/indra/newview/skins/default/xui/en-us/floater_login.xml
new file mode 100644
index 0000000..4c2146b
--- /dev/null
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_login.xml
@@ -0,0 +1,263 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater can_close="false" can_drag_on_left="false" can_minimize="false"
3 can_resize="true" height="400" min_height="400" min_width="600"
4 name="floater_login" title="plasticwuzhere" width="600">
5
6 <!-- Grid Selector -->
7 <text type="string" length="1" enabled="true" name="grid_selector_label"
8 height="10" width="100" left="5" top="-20"
9 h_pad="0" v_pad="0" halign="left"
10 font="SansSerif"
11 follows="left|top" bg_visible="false" border_visible="false" mouse_opaque="true"
12 drop_shadow_visible="true" border_drop_shadow_visible="false">
13 Select a grid:
14 </text>
15
16 <scroll_list background_visible="true" bottom_delta="25" draw_border="true"
17 draw_stripes="false"
18 follows="top|left|bottom" height="340" left="5" multi_select="false"
19 name="grid_selector" width="170">
20 <column label="" name="grid" width="200" />
21 </scroll_list>
22
23 <!-- Grid Selector Buttons -->
24 <button label="Add" label_selected="Delete" enabled="true" name="btn_add"
25 height="18" width="55" left="5" bottom_delta="-20"
26 halign="center"
27 follows="left|bottom" scale_image="true"
28 font="SansSerifSmall" mouse_opaque="true" />
29 <button label="Copy" label_selected="Add" enabled="true" name="btn_copy"
30 height="18" width="55" left_delta="58" bottom_delta="0"
31 halign="center"
32 follows="left|bottom" scale_image="true"
33 font="SansSerifSmall" mouse_opaque="true" />
34 <button label="Delete" label_selected="Copy" enabled="true" name="btn_delete"
35 height="18" width="55" left_delta="58" bottom_delta="0"
36 halign="center"
37 follows="left|bottom" scale_image="true"
38 font="SansSerifSmall" mouse_opaque="true" />
39
40 <!-- Grid Details -->
41 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
42 top="-25" drop_shadow_visible="true" follows="left|top"
43 font="SansSerif" h_pad="0" halign="left" height="16"
44 left_delta="60" mouse_opaque="true" name="gridnick_text" v_pad="0" width="120">
45 Grid Name:
46 </text>
47 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom="360"
48 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true"
49 height="20" left_delta="90" max_length="40" mouse_opaque="true"
50 name="gridnick" select_all_on_focus_received="true" width="200" />
51
52 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
53 bottom_delta="-23" drop_shadow_visible="true" follows="left|top"
54 font="SansSerif" h_pad="0" halign="left" height="16"
55 left_delta="-90" mouse_opaque="true" name="first_name_text" v_pad="0" width="100">
56 First Name:
57 </text>
58 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
59 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true"
60 height="20" left_delta="90" max_length="45" mouse_opaque="true"
61 name="first_name" select_all_on_focus_received="true" width="200" />
62
63 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
64 bottom_delta="-23" drop_shadow_visible="true" follows="left|top"
65 font="SansSerif" h_pad="0" halign="left" height="16"
66 left_delta="-90" mouse_opaque="true" name="last_name_text" v_pad="0" width="100">
67 Last Name:
68 </text>
69 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
70 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true"
71 height="20" left_delta="90" max_length="45" mouse_opaque="true"
72 name="last_name" select_all_on_focus_received="true" width="200" />
73
74 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
75 bottom_delta="-23" drop_shadow_visible="true" follows="left|top"
76 font="SansSerif" h_pad="0" halign="left" height="16"
77 left_delta="-90" mouse_opaque="true" name="avatar_password_text" v_pad="0" width="120">
78 Password:
79 </text>
80 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
81 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true"
82 height="20" left_delta="90" max_length="16" mouse_opaque="true"
83 name="avatar_password" select_all_on_focus_received="true" width="200" />
84
85
86 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
87 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
88 font="SansSerif" h_pad="0" halign="left" height="16"
89 left_delta="-90" mouse_opaque="true" name="start_location_text" v_pad="0"
90 width="95">
91 Start Location:
92 </text>
93 <combo_box allow_text_entry="true" bottom_delta="0" follows="left|top|right" height="18"
94 left_delta="90" max_chars="128" mouse_opaque="true"
95 name="start_location_combo" width="180">
96 <combo_item name="MyHome" value="My Home">
97 My Home
98 </combo_item>
99 <combo_item name="MyLastLocation" value="My Last Location">
100 My Last Location
101 </combo_item>
102 <combo_item name="Typeregionname" value="&lt;Type region name&gt;">
103 &lt;Type region name&gt;
104 </combo_item>
105 </combo_box>
106
107 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
108 bottom_delta="-23" drop_shadow_visible="true" follows="left|top"
109 font="SansSerif" h_pad="0" halign="left" height="16"
110 left_delta="-90" mouse_opaque="true" name="loginuri_text" v_pad="0" width="120">
111 Login URI:
112 </text>
113 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
114 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true"
115 height="20" left_delta="90" max_length="255" mouse_opaque="true"
116 name="loginuri" select_all_on_focus_received="true" width="320" />
117
118 <button label="Get Grid Info" label_selected="Get Grid Info" enabled="true" name="btn_gridinfo"
119 height="18" width="100" bottom_delta="-22"
120 halign="center"
121 follows="left|top" scale_image="true"
122 font="SansSerifSmall" mouse_opaque="true" />
123
124 <text_editor type="string" length="1" allow_html="false" bg_readonly_color="0 0 0 0" bottom_delta="-62"
125 embedded_items="false" enabled="false" follows="left|top"
126 font="SansSerifSmall" height="65" hide_border="true" hide_scrollbar="true"
127 left="190" max_length="65535" mouse_opaque="true"
128 name="protip1" tab_stop="false" width="420" word_wrap="true">
129 Tip: Store information for alternate accounts by using the "Copy" button to create multiple profiles for the same grid.
130 </text_editor>
131
132 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
133 bottom_delta="10" drop_shadow_visible="true" follows="left|top"
134 font="SansSerif" h_pad="0" halign="left" height="16"
135 left="182" mouse_opaque="true" name="loginpage_text" v_pad="0" width="120">
136 Optional Fields
137 </text>
138 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
139 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
140 font="SansSerif" h_pad="0" halign="left" height="16"
141 left_delta="0" mouse_opaque="true" name="loginpage_text" v_pad="0" width="120">
142 Login Page:
143 </text>
144 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
145 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
146 height="20" left_delta="90" max_length="255" mouse_opaque="true"
147 name="loginpage" select_all_on_focus_received="true" width="320" />
148
149 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
150 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
151 font="SansSerif" h_pad="0" halign="left" height="16"
152 left_delta="-90" mouse_opaque="true" name="helperuri_text" v_pad="0" width="120">
153 Helper URI:
154 </text>
155 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
156 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
157 height="20" left_delta="90" max_length="255" mouse_opaque="true"
158 name="helperuri" select_all_on_focus_received="true" width="320" />
159
160 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
161 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
162 font="SansSerif" h_pad="0" halign="left" height="16"
163 left_delta="-90" mouse_opaque="true" name="website_text" v_pad="0" width="120">
164 Website:
165 </text>
166 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
167 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
168 height="20" left_delta="90" max_length="255" mouse_opaque="true"
169 name="website" select_all_on_focus_received="true" width="320" />
170
171 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
172 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
173 font="SansSerif" h_pad="0" halign="left" height="16"
174 left_delta="-90" mouse_opaque="true" name="support_text" v_pad="0" width="120">
175 Support URL:
176 </text>
177 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
178 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
179 height="20" left_delta="90" max_length="255" mouse_opaque="true"
180 name="support" select_all_on_focus_received="true" width="320" />
181
182 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
183 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
184 font="SansSerif" h_pad="0" halign="left" height="16"
185 left_delta="-90" mouse_opaque="true" name="register_text" v_pad="0" width="120">
186 Account URL:
187 </text>
188 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
189 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
190 height="20" left_delta="90" max_length="255" mouse_opaque="true"
191 name="register" select_all_on_focus_received="true" width="320" />
192
193 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
194 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
195 font="SansSerif" h_pad="0" halign="left" height="16"
196 left_delta="-90" mouse_opaque="true" name="password_text" v_pad="0" width="120">
197 Password URL:
198 </text>
199 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
200 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
201 height="20" left_delta="90" max_length="255" mouse_opaque="true"
202 name="password" select_all_on_focus_received="true" width="320" />
203
204 <view_border bevel_style="none" border_thickness="1" bottom_delta="-4" follows="top|left" height="155" left_delta="-93" name="OptionalPrefsBorder" width="417" />
205
206 <!-- Combo box for multi avatar grid manager avatar name
207 <combo_box allow_text_entry="true" bevel_style="in" border_style="line" border_thickness="1"
208 bottom_delta="0" follows="left|top" font="SansSerif" handle_edit_keys_directly="true"
209 height="20" left="290" max_length="45" mouse_opaque="true"
210 name="name_combo" select_all_on_focus_received="true" width="185" />
211 -->
212 <!-- Buttons for mutli avatar grid manager
213 <button bottom="159" follows="top|right" font="SansSerif" halign="center"
214 height="20" label="New" label_selected="New"
215 left="480" mouse_opaque="true" name="new_btn" scale_image="TRUE"
216 width="70" />
217 -->
218 <!--
219 <button bottom="134" follows="top|right" font="SansSerif" halign="center"
220 height="20" label="Remove" label_selected="Remove"
221 left="480" mouse_opaque="true" name="remove_btn" scale_image="TRUE"
222 width="70" />
223-->
224
225 <!-- Checkbox for selecting a global avatar (for when combo box avatar selector works)
226 <check_box bottom="85" follows="left|top" font="SansSerifSmall" height="16"
227 initial_value="false" label="Global Avatar"
228 left_delta="0" mouse_opaque="true" name="global_check" width="138" />
229
230 <check_box bottom="10" follows="left|bottom" font="SansSerifSmall" height="16"
231 initial_value="false" label="Remember password"
232 left_delta="165" mouse_opaque="true" name="remember_check" width="138" />
233
234 <check_box bottom="10" follows="left|bottom" font="SansSerifSmall" height="16"
235 initial_value="false" label="secret level"
236 left_delta="165" mouse_opaque="true" name="gawd_mode" width="138" />
237 -->
238
239 <!-- Cancel/Connect Buttons -->
240
241 <button bottom="-44" follows="right|top" font="SansSerif" halign="center"
242 height="24" label="Set as Default" label_selected="Set as Default"
243 left="470" mouse_opaque="true" name="set_default" scale_image="TRUE"
244 width="110" />
245 <!-- <button bottom="28" follows="right|bottom" font="SansSerif" halign="center"
246 height="24" label="Connect" label_selected="Connect"
247 left="280" mouse_opaque="true" name="connect_btn" scale_image="TRUE"
248 width="100" /> -->
249 <button bottom="8" follows="right|bottom" font="SansSerif" halign="center"
250 height="24" label="Ok" label_selected="Apply" left="280"
251 mouse_opaque="true" name="btn_ok" scale_image="TRUE" width="100" />
252 <button bottom="8" follows="right|bottom" font="SansSerif" halign="center"
253 height="24" label="Apply" label_selected="Apply" left="385"
254 mouse_opaque="true" name="btn_apply" scale_image="TRUE" width="100" />
255 <button bottom="8" follows="right|bottom" font="SansSerif" halign="center"
256 height="24" label="Undo" label_selected="Undo" left="490"
257 mouse_opaque="true" name="btn_cancel" scale_image="TRUE" width="100" />
258 <!--
259 <combo_box allow_text_entry="true" bottom="32" follows="left|bottom" height="18"
260 left_delta="135" max_chars="40" mouse_opaque="true"
261 name="server_combo" width="200" />
262 -->
263</floater> \ No newline at end of file
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_world_map.xml b/linden/indra/newview/skins/default/xui/en-us/floater_world_map.xml
index 059e8fb..d2ebbe6 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_world_map.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_world_map.xml
@@ -9,121 +9,150 @@
9 <panel bottom="-680" follows="left|top|right|bottom" height="664" label="Terrain" 9 <panel bottom="-680" follows="left|top|right|bottom" height="664" label="Terrain"
10 left="1" mouse_opaque="true" name="terrain_mapview" width="993" /> 10 left="1" mouse_opaque="true" name="terrain_mapview" width="993" />
11 </tab_container> 11 </tab_container>
12 <icon bottom="-158" color="1, 1, 0.25, 1" follows="top|right" height="16" 12
13 <icon bottom="-56" color="0.5, 0, 0, 1" follows="top|right" height="16"
14 image_name="map_track_16.tga" left="1013" mouse_opaque="true"
15 name="grid_icon" width="16" />
16 <combo_box allow_text_entry="false" bottom_delta="0" follows="top|right" height="20"
17 label="Grids" left_delta="20" max_chars="60" mouse_opaque="true"
18 name="grid_combo" tool_tip="Grid Selection" width="202">
19 <combo_item name="none_selected" value="None">
20 Grids
21 </combo_item>
22 </combo_box>
23 <!--
24 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
25 bottom="-81" drop_shadow_visible="true" follows="top|right"
26 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="0"
27 mouse_opaque="true" name="appearance_label" v_pad="0" width="145">
28 Keep Appearance
29 </text>
30 <check_box bottom="-81" control_name="KeepAppearance" follows="top|right"
31 font="SansSerifSmall" height="16" initial_value="false" label=""
32 left_delta="96" mouse_opaque="true" name="appearance_chk" width="55" />
33 -->
34 <button bottom="-78" follows="top|right" font="SansSerifSmall" halign="center"
35 height="16" label="Grid Manager" label_selected="Grid Manager" left_delta="117"
36 mouse_opaque="true" name="Grid Manager" tool_tip="Edit your grid list"
37 width="88" />
38
39 <icon bottom="-187" color="1, 1, 0.25, 1" follows="top|right" height="16"
13 image_name="legend.tga" left="1013" mouse_opaque="true" name="square" 40 image_name="legend.tga" left="1013" mouse_opaque="true" name="square"
14 width="16" /> 41 width="16" />
15 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 42 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
16 bottom="-156" drop_shadow_visible="true" follows="top|right" 43 bottom="-188" drop_shadow_visible="true" follows="top|right"
17 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 44 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
18 mouse_opaque="true" name="land_for_sale_label" v_pad="0" width="145"> 45 mouse_opaque="true" name="land_for_sale_label" v_pad="0" width="145">
19 Land For Sale 46 Land For Sale
20 </text> 47 </text>
21 <icon bottom="-158" color="0.5, 0.25, 1, 1" follows="top|right" height="16" 48 <icon bottom="-187" color="0.5, 0.25, 1, 1" follows="top|right" height="16"
22 image_name="legend.tga" left="1123" mouse_opaque="true" name="square2" 49 image_name="legend.tga" left="1123" mouse_opaque="true" name="square2"
23 width="16" /> 50 width="16" />
24 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 51 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
25 bottom="-156" drop_shadow_visible="true" follows="top|right" 52 bottom="-188" drop_shadow_visible="true" follows="top|right"
26 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 53 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
27 mouse_opaque="true" name="auction_label" v_pad="0" width="145"> 54 mouse_opaque="true" name="auction_label" v_pad="0" width="145">
28 Auction 55 Auction
29 </text> 56 </text>
30 <icon bottom="-56" color="1, 1, 1, 1" follows="top|right" height="16" 57
58 <icon bottom="-101" color="1, 1, 1, 1" follows="top|right" height="16"
31 image_name="map_avatar_16.tga" left="1013" mouse_opaque="true" name="self" 59 image_name="map_avatar_16.tga" left="1013" mouse_opaque="true" name="self"
32 width="16" /> 60 width="16" />
33 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 61 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
34 bottom="-56" drop_shadow_visible="true" follows="top|right" 62 bottom="-101" drop_shadow_visible="true" follows="top|right"
35 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 63 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
36 mouse_opaque="true" name="you_label" v_pad="0" width="145"> 64 mouse_opaque="true" name="you_label" v_pad="0" width="145">
37 You 65 You
38 </text> 66 </text>
39 <icon bottom="-56" color="1, 1, 1, 1" follows="top|right" height="16" 67 <icon bottom="-101" color="1, 1, 1, 1" follows="top|right" height="16"
40 image_name="map_home.tga" left="1073" mouse_opaque="true" name="home" 68 image_name="map_home.tga" left="1073" mouse_opaque="true" name="home"
41 width="16" /> 69 width="16" />
42 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 70 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
43 bottom="-56" drop_shadow_visible="true" follows="top|right" 71 bottom="-101" drop_shadow_visible="true" follows="top|right"
44 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 72 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
45 mouse_opaque="true" name="home_label" v_pad="0" width="145"> 73 mouse_opaque="true" name="home_label" v_pad="0" width="145">
46 Home 74 Home
47 </text> 75 </text>
48 <button bottom="-56" follows="top|right" font="SansSerifSmall" halign="center" 76 <button bottom="-101" follows="top|right" font="SansSerifSmall" halign="center"
49 height="16" label="Go Home" label_selected="Go Home" left_delta="57" 77 height="16" label="Go Home" label_selected="Go Home" left_delta="57"
50 mouse_opaque="true" name="Go Home" tool_tip="Teleport to your home" 78 mouse_opaque="true" name="Go Home" tool_tip="Teleport to your home"
51 width="88" /> 79 width="88" />
52 <icon bottom="-82" color="0, 1, 0, 1" follows="top|right" height="8" 80 <icon bottom="-122" color="0, 1, 0, 1" follows="top|right" height="8"
53 image_name="map_avatar_8.tga" left="1017" mouse_opaque="true" name="person" 81 image_name="map_avatar_8.tga" left="1017" mouse_opaque="true" name="person"
54 width="8" /> 82 width="8" />
55 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 83 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
56 bottom="-86" drop_shadow_visible="true" follows="top|right" 84 bottom="-126" drop_shadow_visible="true" follows="top|right"
57 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="16" 85 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="16"
58 mouse_opaque="true" name="person_label" v_pad="0" width="145"> 86 mouse_opaque="true" name="person_label" v_pad="0" width="145">
59 Person 87 Person
60 </text> 88 </text>
61 <check_box bottom="-86" control_name="MapShowPeople" follows="top|right" 89 <check_box bottom="-126" control_name="MapShowPeople" follows="top|right"
62 font="SansSerifSmall" height="16" initial_value="false" label=" " 90 font="SansSerifSmall" height="16" initial_value="false" label=" "
63 left_delta="70" mouse_opaque="true" name="people_chk" width="55" /> 91 left_delta="70" mouse_opaque="true" name="people_chk" width="55" />
64 <icon bottom="-106" color="1, 1, 1, 1" follows="top|right" height="16" 92 <icon bottom="-146" color="1, 1, 1, 1" follows="top|right" height="16"
65 image_name="map_infohub.tga" left="1013" mouse_opaque="true" name="infohub" 93 image_name="map_infohub.tga" left="1013" mouse_opaque="true" name="infohub"
66 width="16" /> 94 width="16" />
67 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 95 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
68 bottom="-106" drop_shadow_visible="true" follows="top|right" 96 bottom="-146" drop_shadow_visible="true" follows="top|right"
69 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 97 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
70 mouse_opaque="true" name="infohub_label" v_pad="0" width="145"> 98 mouse_opaque="true" name="infohub_label" v_pad="0" width="145">
71 Infohub 99 Infohub
72 </text> 100 </text>
73 <check_box bottom="-106" control_name="MapShowInfohubs" follows="top|right" 101 <check_box bottom="-146" control_name="MapShowInfohubs" follows="top|right"
74 font="SansSerifSmall" height="16" initial_value="false" label="" 102 font="SansSerifSmall" height="16" initial_value="false" label=""
75 left_delta="70" mouse_opaque="true" name="infohub_chk" width="55" /> 103 left_delta="70" mouse_opaque="true" name="infohub_chk" width="55" />
76 <icon bottom="-126" color="1, 1, 1, 1" follows="top|right" height="16" 104 <icon bottom="-166" color="1, 1, 1, 1" follows="top|right" height="16"
77 image_name="map_telehub.tga" left="1013" mouse_opaque="true" name="telehub" 105 image_name="map_telehub.tga" left="1013" mouse_opaque="true" name="telehub"
78 width="16" /> 106 width="16" />
79 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 107 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
80 bottom="-126" drop_shadow_visible="true" follows="top|right" 108 bottom="-166" drop_shadow_visible="true" follows="top|right"
81 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 109 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
82 mouse_opaque="true" name="telehub_label" v_pad="0" width="145"> 110 mouse_opaque="true" name="telehub_label" v_pad="0" width="145">
83 Telehub 111 Telehub
84 </text> 112 </text>
85 <check_box bottom="-126" control_name="MapShowTelehubs" follows="top|right" 113 <check_box bottom="-166" control_name="MapShowTelehubs" follows="top|right"
86 font="SansSerifSmall" height="16" initial_value="false" label="" 114 font="SansSerifSmall" height="16" initial_value="false" label=""
87 left_delta="70" mouse_opaque="true" name="telehubchk" width="55" /> 115 left_delta="70" mouse_opaque="true" name="telehubchk" width="55" />
88 <icon bottom="-86" color="1, 1, 1, 1" follows="top|right" height="16" 116 <icon bottom="-126" color="1, 1, 1, 1" follows="top|right" height="16"
89 image_name="icon_for_sale.tga" left="1123" mouse_opaque="true" 117 image_name="icon_for_sale.tga" left="1123" mouse_opaque="true"
90 name="landforsale" width="16" /> 118 name="landforsale" width="16" />
91 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 119 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
92 bottom="-86" drop_shadow_visible="true" follows="top|right" 120 bottom="-126" drop_shadow_visible="true" follows="top|right"
93 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 121 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
94 mouse_opaque="true" name="land_for_sale_label2" v_pad="0" width="145"> 122 mouse_opaque="true" name="land_for_sale_label2" v_pad="0" width="145">
95 Land For Sale 123 Land For Sale
96 </text> 124 </text>
97 <check_box bottom="-86" control_name="MapShowLandForSale" follows="top|right" 125 <check_box bottom="-126" control_name="MapShowLandForSale" follows="top|right"
98 font="SansSerifSmall" height="16" initial_value="false" label="" 126 font="SansSerifSmall" height="16" initial_value="false" label=""
99 left_delta="80" mouse_opaque="true" name="land_for_sale_chk" width="55" /> 127 left_delta="80" mouse_opaque="true" name="land_for_sale_chk" width="55" />
100 <icon bottom="-106" color="1, 1, 1, 1" follows="top|right" height="16" 128 <icon bottom="-146" color="1, 1, 1, 1" follows="top|right" height="16"
101 image_name="map_event.tga" left="1123" mouse_opaque="true" name="event" 129 image_name="map_event.tga" left="1123" mouse_opaque="true" name="event"
102 width="16" /> 130 width="16" />
103 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 131 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
104 bottom="-106" drop_shadow_visible="true" follows="top|right" 132 bottom="-146" drop_shadow_visible="true" follows="top|right"
105 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 133 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
106 mouse_opaque="true" name="events_label" v_pad="0" width="145"> 134 mouse_opaque="true" name="events_label" v_pad="0" width="145">
107 Events 135 Events
108 </text> 136 </text>
109 <check_box bottom="-106" control_name="MapShowEvents" follows="top|right" 137 <check_box bottom="-146" control_name="MapShowEvents" follows="top|right"
110 font="SansSerifSmall" height="16" initial_value="false" label="" 138 font="SansSerifSmall" height="16" initial_value="false" label=""
111 left_delta="80" mouse_opaque="true" name="event_chk" width="55" /> 139 left_delta="80" mouse_opaque="true" name="event_chk" width="55" />
112 <icon bottom="-126" color="1, 1, 1, 1" follows="top|right" height="16" 140 <icon bottom="-166" color="1, 1, 1, 1" follows="top|right" height="16"
113 image_name="map_event_mature.tga" left="1123" mouse_opaque="true" 141 image_name="map_event_mature.tga" left="1123" mouse_opaque="true"
114 name="events_mature_icon" width="16" /> 142 name="events_mature_icon" width="16" />
115 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 143 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
116 bottom="-126" drop_shadow_visible="true" follows="top|right" 144 bottom="-166" drop_shadow_visible="true" follows="top|right"
117 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 145 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
118 mouse_opaque="true" name="events_mature_label" v_pad="0" width="145"> 146 mouse_opaque="true" name="events_mature_label" v_pad="0" width="145">
119 Events (M) 147 Events (M)
120 </text> 148 </text>
121 <check_box bottom="-126" control_name="ShowMatureEvents" follows="top|right" 149 <check_box bottom="-166" control_name="ShowMatureEvents" follows="top|right"
122 font="SansSerifSmall" height="16" initial_value="true" label="" 150 font="SansSerifSmall" height="16" initial_value="true" label=""
123 left_delta="80" mouse_opaque="true" name="event_mature_chk" width="55" /> 151 left_delta="80" mouse_opaque="true" name="event_mature_chk" width="55" />
124 <icon bottom="-181" color="0.5, 0, 0, 1" follows="top|right" height="16" 152
125 image_name="map_track_16.tga" left="1013" mouse_opaque="true" 153 <icon bottom="-216" color="0.5, 0, 0, 1" follows="top|right" height="16"
126 name="avatar_icon" width="16" /> 154 image_name="map_track_16.tga" left="1013" mouse_opaque="true"
155 name="avatar_icon" width="16" />
127 <combo_box allow_text_entry="true" bottom_delta="0" follows="top|right" height="20" 156 <combo_box allow_text_entry="true" bottom_delta="0" follows="top|right" height="20"
128 label="Online Friends" left_delta="20" max_chars="60" mouse_opaque="true" 157 label="Online Friends" left_delta="20" max_chars="60" mouse_opaque="true"
129 name="friend combo" tool_tip="Friend to Show on Map" width="202"> 158 name="friend combo" tool_tip="Friend to Show on Map" width="202">
@@ -131,6 +160,7 @@
131 Online Friends 160 Online Friends
132 </combo_item> 161 </combo_item>
133 </combo_box> 162 </combo_box>
163
134 <icon bottom_delta="-25" color="0.5, 0, 0, 1" follows="top|right" height="16" 164 <icon bottom_delta="-25" color="0.5, 0, 0, 1" follows="top|right" height="16"
135 image_name="map_track_16.tga" left="1013" mouse_opaque="true" 165 image_name="map_track_16.tga" left="1013" mouse_opaque="true"
136 name="landmark_icon" width="16" /> 166 name="landmark_icon" width="16" />
@@ -141,6 +171,7 @@
141 Landmarks 171 Landmarks
142 </combo_item> 172 </combo_item>
143 </combo_box> 173 </combo_box>
174
144 <icon bottom_delta="-25" color="0.5, 0, 0, 1" follows="top|right" height="16" 175 <icon bottom_delta="-25" color="0.5, 0, 0, 1" follows="top|right" height="16"
145 image_name="map_track_16.tga" left="1013" mouse_opaque="true" 176 image_name="map_track_16.tga" left="1013" mouse_opaque="true"
146 name="location_icon" width="16" /> 177 name="location_icon" width="16" />
@@ -156,9 +187,10 @@
156 mouse_opaque="true" name="search_label" v_pad="0" width="222"> 187 mouse_opaque="true" name="search_label" v_pad="0" width="222">
157 Search Results: 188 Search Results:
158 </text> 189 </text>
159 <scroll_list background_visible="true" bottom_delta="-306" draw_border="true" 190
191 <scroll_list background_visible="true" bottom_delta="-266" draw_border="true"
160 draw_stripes="false" 192 draw_stripes="false"
161 follows="top|right|bottom" height="300" left="1013" multi_select="false" 193 follows="top|right|bottom" height="261" left="1013" multi_select="false"
162 name="search_results" width="222"> 194 name="search_results" width="222">
163 <column label="" name="icon" width="16" /> 195 <column label="" name="icon" width="16" />
164 <column label="" name="sim_name" width="206" /> 196 <column label="" name="sim_name" width="206" />
@@ -178,7 +210,7 @@
178 mouse_opaque="true" name="spin y" 210 mouse_opaque="true" name="spin y"
179 tool_tip="Y coordinate of location to show on map" width="66" /> 211 tool_tip="Y coordinate of location to show on map" width="66" />
180 <spinner bottom_delta="0" decimal_digits="0" follows="bottom|right" height="16" 212 <spinner bottom_delta="0" decimal_digits="0" follows="bottom|right" height="16"
181 increment="1" initial_val="0" left_delta="68" max_val="4096" min_val="0" 213 increment="1" initial_val="0" left_delta="68" max_val="16384" min_val="0"
182 mouse_opaque="true" name="spin z" 214 mouse_opaque="true" name="spin z"
183 tool_tip="Z coordinate of location to show on map" width="66" /> 215 tool_tip="Z coordinate of location to show on map" width="66" />
184 <button bottom="-625" follows="right|bottom" font="SansSerif" halign="center" 216 <button bottom="-625" follows="right|bottom" font="SansSerif" halign="center"
diff --git a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml
index 81c49e7..a251f95 100644
--- a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml
@@ -72,6 +72,10 @@
72 userdata="" /> 72 userdata="" />
73 </menu_item_call> 73 </menu_item_call>
74 <menu_item_separator /> 74 <menu_item_separator />
75 <menu_item_call name="Logout" label="Logout"
76 shortcut="control|alt|Q">
77 <on_click function="File.Logout" userdata="" />
78 </menu_item_call>
75 <menu_item_call name="Quit" label="Quit" 79 <menu_item_call name="Quit" label="Quit"
76 shortcut="control|Q"> 80 shortcut="control|Q">
77 <on_click function="File.Quit" userdata="" /> 81 <on_click function="File.Quit" userdata="" />
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_login.xml b/linden/indra/newview/skins/default/xui/en-us/panel_login.xml
index 2122ee7..ed89977 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_login.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_login.xml
@@ -71,6 +71,10 @@
71 <combo_box allow_text_entry="true" bottom="32" follows="left|bottom" height="18" 71 <combo_box allow_text_entry="true" bottom="32" follows="left|bottom" height="18"
72 left_delta="135" max_chars="20" mouse_opaque="true" 72 left_delta="135" max_chars="20" mouse_opaque="true"
73 name="server_combo" width="120" /> 73 name="server_combo" width="120" />
74 <button bottom="28" follows="left|bottom" font="SansSerif" halign="center"
75 height="24" label="Grid Manager" label_selected="Connect"
76 left_delta="195" mouse_opaque="true" name="grid_btn" scale_image="TRUE"
77 width="120" />
74 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 78 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
75 bottom="45" drop_shadow_visible="true" follows="right|bottom" 79 bottom="45" drop_shadow_visible="true" follows="right|bottom"
76 font="SansSerifSmall" font-style="UNDERLINE" h_pad="0" halign="right" height="16" 80 font="SansSerifSmall" font-style="UNDERLINE" h_pad="0" halign="right" height="16"
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_network.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_network.xml
index 48da432..c5237cc 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_network.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_network.xml
@@ -8,10 +8,10 @@
8 mouse_opaque="false" name="text_box" v_pad="0" width="200"> 8 mouse_opaque="false" name="text_box" v_pad="0" width="200">
9 Maximum Bandwidth: 9 Maximum Bandwidth:
10 </text> 10 </text>
11 <slider bottom_delta="-25" can_edit_text="true" 11 <slider bottom_delta="-25" can_edit_text="true" control_name="ThrottleBandwidthKBPS"
12 decimal_digits="0" enabled="true" follows="left|top" height="15" 12 decimal_digits="0" enabled="true" follows="left|top" height="15"
13 increment="10" initial_val="50" left_delta="0" max_val="1500" min_val="50" 13 increment="100" initial_val="1500" left_delta="0" max_val="5000" min_val="100"
14 mouse_opaque="true" name="max_bandwidth" show_text="true" value="500" 14 mouse_opaque="true" name="max_bandwidth" show_text="true" value="1500"
15 width="180" /> 15 width="180" />
16 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 16 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
17 bottom_delta="4" drop_shadow_visible="true" enabled="true" 17 bottom_delta="4" drop_shadow_visible="true" enabled="true"
@@ -25,22 +25,15 @@
25 follows="left|top" font="SansSerifSmall" h_pad="0" halign="left" 25 follows="left|top" font="SansSerifSmall" h_pad="0" halign="left"
26 height="10" left="12" mouse_opaque="false" name="cache_size_label_l" 26 height="10" left="12" mouse_opaque="false" name="cache_size_label_l"
27 v_pad="0" width="200"> 27 v_pad="0" width="200">
28 Disk Cache Size: 28 Disk Cache Size (MB):
29 </text> 29 </text>
30 <slider bottom_delta="-25" can_edit_text="true" 30 <slider bottom_delta="-25" can_edit_text="true" control_name="CacheSize"
31 decimal_digits="0" enabled="true" follows="left|top" height="15" 31 decimal_digits="0" enabled="true" follows="left|top" height="15"
32 increment="10" initial_val="50" left_delta="0" max_val="1000" min_val="10" 32 increment="10" initial_val="50" left_delta="0" max_val="1000" min_val="10"
33 mouse_opaque="true" name="cache_size" show_text="true" width="180" /> 33 mouse_opaque="true" name="cache_size" show_text="true" width="180" />
34 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
35 bottom_delta="4" drop_shadow_visible="true" enabled="true"
36 follows="left|top" font="SansSerifSmall" h_pad="0" halign="left"
37 height="10" left_delta="186" mouse_opaque="false" name="text_box5"
38 v_pad="0" width="40">
39 MB
40 </text>
41 <button bottom="-55" bottom_delta="-4" enabled="true" follows="left|bottom" 34 <button bottom="-55" bottom_delta="-4" enabled="true" follows="left|bottom"
42 font="SansSerif" halign="center" height="22" label="Clear Cache" left="340" 35 font="SansSerif" halign="center" height="22" label="Clear Cache" left="340"
43 left_delta="30" mouse_opaque="true" name="clear_cache" scale_image="true" 36 left_delta="186" mouse_opaque="true" name="clear_cache" scale_image="true"
44 width="100" /> 37 width="100" />
45 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 38 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
46 bottom="-70" bottom_delta="-17" drop_shadow_visible="true" enabled="true" 39 bottom="-70" bottom_delta="-17" drop_shadow_visible="true" enabled="true"
@@ -51,7 +44,7 @@
51 </text> 44 </text>
52 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="-28" 45 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="-28"
53 enabled="false" follows="left|top" font="SansSerif" 46 enabled="false" follows="left|top" font="SansSerif"
54 handle_edit_keys_directly="true" height="20" left_delta="7" 47 handle_edit_keys_directly="true" height="20" left_delta="0"
55 max_length="4096" mouse_opaque="true" name="cache_location" 48 max_length="4096" mouse_opaque="true" name="cache_location"
56 select_all_on_focus_received="false" width="470" word_wrap="false" /> 49 select_all_on_focus_received="false" width="470" word_wrap="false" />
57 <button bottom_delta="-25" enabled="true" follows="left|top" font="SansSerif" 50 <button bottom_delta="-25" enabled="true" follows="left|top" font="SansSerif"
@@ -61,12 +54,12 @@
61 font="SansSerif" halign="center" height="22" label="Reset" 54 font="SansSerif" halign="center" height="22" label="Reset"
62 label_selected="Set" left_delta="103" mouse_opaque="true" 55 label_selected="Set" left_delta="103" mouse_opaque="true"
63 name="reset_cache" scale_image="true" width="100" /> 56 name="reset_cache" scale_image="true" width="100" />
64 <check_box bottom="-173" bottom_delta="-35" 57 <check_box bottom="-173" bottom_delta="-25" control_name="ConnectionPortEnabled"
65 enabled="true" follows="left|top" font="SansSerifSmall" height="16" 58 enabled="true" follows="left|top" font="SansSerifSmall" height="16"
66 initial_value="false" label="Custom Port Connection" left="12" 59 initial_value="false" label="Custom Port Connection" left="12"
67 mouse_opaque="true" name="connection_port_enabled" radio_style="false" 60 mouse_opaque="true" name="connection_port_enabled" radio_style="false"
68 width="256" /> 61 width="256" />
69 <spinner bottom="-193" bottom_delta="-20" 62 <spinner bottom="-193" bottom_delta="-20" control_name="ConnectionPort"
70 decimal_digits="0" enabled="true" follows="left|top" height="16" 63 decimal_digits="0" enabled="true" follows="left|top" height="16"
71 increment="1" initial_val="13000" label="Port Number:" label_width="75" 64 increment="1" initial_val="13000" label="Port Number:" label_width="75"
72 left_delta="20" max_val="13050" min_val="13000" mouse_opaque="true" 65 left_delta="20" max_val="13050" min_val="13000" mouse_opaque="true"
diff --git a/linden/indra/newview/viewer_manifest.py b/linden/indra/newview/viewer_manifest.py
index 5da0256..6ae5b80 100755
--- a/linden/indra/newview/viewer_manifest.py
+++ b/linden/indra/newview/viewer_manifest.py
@@ -746,26 +746,28 @@ class LinuxManifest(ViewerManifest):
746 746
747 self.package_file = installer_name + '.tar.bz2' 747 self.package_file = installer_name + '.tar.bz2'
748 748
749 if("package" in self.args['actions'] or 749 # Disabled for now. It's a waste of time to package every compile.
750 "unpacked" in self.args['actions']): 750
751 751 # if("package" in self.args['actions'] or
752 # temporarily move directory tree so that it has the right 752 # "unpacked" in self.args['actions']):
753 # name in the tarfile 753 #
754 self.run_command("mv %(dst)s %(inst)s" % { 754 # # temporarily move directory tree so that it has the right
755 'dst': self.get_dst_prefix(), 755 # # name in the tarfile
756 'inst': self.build_path_of(installer_name)}) 756 # self.run_command("mv %(dst)s %(inst)s" % {
757 try: 757 # 'dst': self.get_dst_prefix(),
758 # --numeric-owner hides the username of the builder for 758 # 'inst': self.build_path_of(installer_name)})
759 # security etc. 759 # try:
760 self.run_command('tar -C %(dir)s --numeric-owner -cjf ' 760 # # --numeric-owner hides the username of the builder for
761 '%(inst_path)s.tar.bz2 %(inst_name)s' % { 761 # # security etc.
762 'dir': self.get_build_prefix(), 762 # self.run_command('tar -C %(dir)s --numeric-owner -cjf '
763 'inst_name': installer_name, 763 # '%(inst_path)s.tar.bz2 %(inst_name)s' % {
764 'inst_path':self.build_path_of(installer_name)}) 764 # 'dir': self.get_build_prefix(),
765 finally: 765 # 'inst_name': installer_name,
766 self.run_command("mv %(inst)s %(dst)s" % { 766 # 'inst_path':self.build_path_of(installer_name)})
767 'dst': self.get_dst_prefix(), 767 # finally:
768 'inst': self.build_path_of(installer_name)}) 768 # self.run_command("mv %(inst)s %(dst)s" % {
769 # 'dst': self.get_dst_prefix(),
770 # 'inst': self.build_path_of(installer_name)})
769 771
770 772
771class Linux_i686Manifest(LinuxManifest): 773class Linux_i686Manifest(LinuxManifest):