aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
Diffstat (limited to 'linden')
-rw-r--r--linden/indra/newview/hippoGridManager.cpp211
-rw-r--r--linden/indra/newview/hippoGridManager.h91
2 files changed, 254 insertions, 48 deletions
diff --git a/linden/indra/newview/hippoGridManager.cpp b/linden/indra/newview/hippoGridManager.cpp
index 2143a40..ffac92d 100644
--- a/linden/indra/newview/hippoGridManager.cpp
+++ b/linden/indra/newview/hippoGridManager.cpp
@@ -48,6 +48,109 @@ HippoGridInfo::HippoGridInfo(const std::string &gridNick) :
48} 48}
49 49
50 50
51// ********************************************************************
52// Getters
53
54HippoGridInfo::Platform HippoGridInfo::getPlatform()
55{
56 return mPlatform;
57}
58
59bool HippoGridInfo::isOpenSimulator() const
60{
61 return (mPlatform == HippoGridInfo::PLATFORM_OPENSIM);
62}
63
64bool HippoGridInfo::isSecondLife() const
65{
66 return (mPlatform == HippoGridInfo::PLATFORM_SECONDLIFE);
67}
68
69const std::string& HippoGridInfo::getGridNick() const
70{
71 return mGridNick;
72}
73
74const std::string& HippoGridInfo::getGridName() const
75{
76 return mGridName;
77}
78
79const std::string& HippoGridInfo::getLoginUri() const
80{
81 return mLoginUri;
82}
83
84const std::string& HippoGridInfo::getLoginPage() const
85{
86 return mLoginPage;
87}
88
89const std::string& HippoGridInfo::getHelperUri() const
90{
91 return mHelperUri;
92}
93
94const std::string& HippoGridInfo::getWebSite() const
95{
96 return mWebSite;
97}
98
99const std::string& HippoGridInfo::getSupportUrl() const
100{
101 return mSupportUrl;
102}
103
104const std::string& HippoGridInfo::getRegisterUrl() const
105{
106 return mRegisterUrl;
107}
108
109const std::string& HippoGridInfo::getPasswordUrl() const
110{
111 return mPasswordUrl;
112}
113
114const std::string& HippoGridInfo::getSearchUrl() const
115{
116 return mSearchUrl;
117}
118
119const std::string& HippoGridInfo::getFirstName() const
120{
121 return mFirstName;
122}
123
124const std::string& HippoGridInfo::getLastName() const
125{
126 return mLastName;
127}
128
129const std::string& HippoGridInfo::getAvatarPassword() const
130{
131 return mAvatarPassword;
132}
133
134bool HippoGridInfo::isRenderCompat() const
135{
136 return mRenderCompat;
137}
138
139const std::string& HippoGridInfo::getCurrencySymbol() const
140{
141 return mCurrencySymbol;
142}
143
144const std::string& HippoGridInfo::getRealCurrencySymbol() const
145{
146 return mRealCurrencySymbol;
147}
148
149
150
151// ********************************************************************
152// Setters
153
51void HippoGridInfo::setPlatform(Platform platform) 154void HippoGridInfo::setPlatform(Platform platform)
52{ 155{
53 mPlatform = platform; 156 mPlatform = platform;
@@ -71,6 +174,89 @@ void HippoGridInfo::setPlatform(const std::string &platform)
71 } 174 }
72} 175}
73 176
177void HippoGridInfo::setGridName(const std::string &gridName)
178{
179 mGridName = gridName;
180}
181
182void HippoGridInfo::setLoginUri(const std::string &loginUri)
183{
184 mLoginUri = loginUri;
185 cleanUpUri(mLoginUri);
186}
187
188void HippoGridInfo::setLoginPage(const std::string &loginPage)
189{
190 mLoginPage = loginPage;
191}
192
193void HippoGridInfo::setHelperUri(const std::string &helperUri)
194{
195 mHelperUri = helperUri;
196 cleanUpUri(mHelperUri);
197}
198
199void HippoGridInfo::setWebSite(const std::string &website)
200{
201 mWebSite = website;
202}
203
204void HippoGridInfo::setSupportUrl(const std::string &url)
205{
206 mSupportUrl = url;
207}
208
209void HippoGridInfo::setRegisterUrl(const std::string &url)
210{
211 mRegisterUrl = url;
212}
213
214void HippoGridInfo::setPasswordUrl(const std::string &url)
215{
216 mPasswordUrl = url;
217}
218
219void HippoGridInfo::setSearchUrl(const std::string &url)
220{
221 mSearchUrl = url;
222}
223
224void HippoGridInfo::setFirstName(const std::string &firstName)
225{
226 mFirstName = firstName;
227}
228
229void HippoGridInfo::setLastName(const std::string &lastName)
230{
231 mLastName = lastName;
232}
233
234void HippoGridInfo::setAvatarPassword(const std::string &avatarPassword)
235{
236 mAvatarPassword = avatarPassword;
237}
238
239void HippoGridInfo::setRenderCompat(bool compat)
240{
241 mRenderCompat = compat;
242}
243
244void HippoGridInfo::setCurrencySymbol(const std::string &sym)
245{
246 mCurrencySymbol = sym.substr(0, 3);
247}
248
249void HippoGridInfo::setRealCurrencySymbol(const std::string &sym)
250{
251 mRealCurrencySymbol = sym.substr(0, 3);
252}
253
254void HippoGridInfo::setDirectoryFee(int fee)
255{
256 mDirectoryFee = fee;
257}
258
259
74 260
75// ******************************************************************** 261// ********************************************************************
76// Grid Info 262// Grid Info
@@ -355,7 +541,7 @@ void HippoGridManager::discardAndReload()
355// ******************************************************************** 541// ********************************************************************
356// Public Access 542// Public Access
357 543
358HippoGridInfo *HippoGridManager::getGrid(const std::string &grid) const 544HippoGridInfo* HippoGridManager::getGrid(const std::string &grid) const
359{ 545{
360 std::map<std::string, HippoGridInfo*>::const_iterator it; 546 std::map<std::string, HippoGridInfo*>::const_iterator it;
361 it = mGridInfo.find(grid); 547 it = mGridInfo.find(grid);
@@ -367,7 +553,13 @@ HippoGridInfo *HippoGridManager::getGrid(const std::string &grid) const
367} 553}
368 554
369 555
370HippoGridInfo *HippoGridManager::getCurrentGrid() const 556HippoGridInfo* HippoGridManager::getConnectedGrid() const
557{
558 return (mConnectedGrid)? mConnectedGrid: getCurrentGrid();
559}
560
561
562HippoGridInfo* HippoGridManager::getCurrentGrid() const
371{ 563{
372 HippoGridInfo *grid = getGrid(mCurrentGrid); 564 HippoGridInfo *grid = getGrid(mCurrentGrid);
373 if (grid) { 565 if (grid) {
@@ -377,6 +569,21 @@ HippoGridInfo *HippoGridManager::getCurrentGrid() const
377 } 569 }
378} 570}
379 571
572const std::string& HippoGridManager::getDefaultGridNick() const
573{
574 return mDefaultGrid;
575}
576
577const std::string& HippoGridManager::getCurrentGridNick() const
578{
579 return mCurrentGrid;
580}
581
582void HippoGridManager::setCurrentGridAsConnected()
583{
584 mConnectedGrid = getCurrentGrid();
585}
586
380 587
381void HippoGridManager::addGrid(HippoGridInfo *grid) 588void HippoGridManager::addGrid(HippoGridInfo *grid)
382{ 589{
diff --git a/linden/indra/newview/hippoGridManager.h b/linden/indra/newview/hippoGridManager.h
index cd90ac1..de69e5b 100644
--- a/linden/indra/newview/hippoGridManager.h
+++ b/linden/indra/newview/hippoGridManager.h
@@ -35,51 +35,50 @@ public:
35 35
36 explicit HippoGridInfo(const std::string &gridNick); 36 explicit HippoGridInfo(const std::string &gridNick);
37 37
38 Platform getPlatform() const { return mPlatform; } 38 Platform getPlatform();
39 const std::string &getGridNick() const { return mGridNick; } 39 bool isOpenSimulator() const;
40 const std::string &getGridName() const { return mGridName; } 40 bool isSecondLife() const;
41 const std::string &getLoginUri() const { return mLoginUri; } 41 const std::string& getGridNick() const;
42 const std::string &getLoginPage() const { return mLoginPage; } 42 const std::string& getGridName() const;
43 const std::string &getHelperUri() const { return mHelperUri; } 43 const std::string& getLoginUri() const;
44 const std::string &getWebSite() const { return mWebSite; } 44 const std::string& getLoginPage() const;
45 const std::string &getSupportUrl() const { return mSupportUrl; } 45 const std::string& getHelperUri() const;
46 const std::string &getRegisterUrl() const { return mRegisterUrl; } 46 const std::string& getWebSite() const;
47 const std::string &getPasswordUrl() const { return mPasswordUrl; } 47 const std::string& getSupportUrl() const;
48 const std::string &getSearchUrl() const { return mSearchUrl; } 48 const std::string& getRegisterUrl() const;
49 const std::string &getFirstName() const { return mFirstName; } 49 const std::string& getPasswordUrl() const;
50 const std::string &getLastName() const { return mLastName; } 50 const std::string& getSearchUrl() const;
51 const std::string &getAvatarPassword() const { return mAvatarPassword; } 51 const std::string& getFirstName() const;
52 const std::string& getLastName() const;
53 const std::string& getAvatarPassword() const;
52 std::string getSearchUrl(SearchType ty) const; 54 std::string getSearchUrl(SearchType ty) const;
53 bool isRenderCompat() const { return mRenderCompat; } 55 bool isRenderCompat() const;
54 56
55 const std::string &getCurrencySymbol() const { return mCurrencySymbol; } 57 const std::string& getCurrencySymbol() const;
56 const std::string &getRealCurrencySymbol() const { return mRealCurrencySymbol; } 58 const std::string& getRealCurrencySymbol() const;
57 std::string getUploadFee() const; 59 std::string getUploadFee() const;
58 std::string getGroupCreationFee() const; 60 std::string getGroupCreationFee() const;
59 std::string getDirectoryFee() const; 61 std::string getDirectoryFee() const;
60
61 bool isOpenSimulator() const { return (mPlatform == PLATFORM_OPENSIM ); }
62 bool isSecondLife() const { return (mPlatform == PLATFORM_SECONDLIFE); }
63 62
64 void setPlatform (const std::string &platform); 63 void setPlatform (const std::string &platform);
65 void setPlatform (Platform platform); 64 void setPlatform (Platform platform);
66 void setGridName (const std::string &gridName) { mGridName = gridName; } 65 void setGridName (const std::string &gridName);
67 void setLoginUri (const std::string &loginUri) { mLoginUri = loginUri; cleanUpUri(mLoginUri); } 66 void setLoginUri (const std::string &loginUri);
68 void setLoginPage(const std::string &loginPage) { mLoginPage = loginPage; } 67 void setLoginPage(const std::string &loginPage);
69 void setHelperUri(const std::string &helperUri) { mHelperUri = helperUri; cleanUpUri(mHelperUri); } 68 void setHelperUri(const std::string &helperUri);
70 void setWebSite (const std::string &website) { mWebSite = website; } 69 void setWebSite (const std::string &website);
71 void setSupportUrl(const std::string &url) { mSupportUrl = url; } 70 void setSupportUrl(const std::string &url);
72 void setRegisterUrl(const std::string &url) { mRegisterUrl = url; } 71 void setRegisterUrl(const std::string &url);
73 void setPasswordUrl(const std::string &url) { mPasswordUrl = url; } 72 void setPasswordUrl(const std::string &url);
74 void setSearchUrl(const std::string &url) { mSearchUrl = url; } 73 void setSearchUrl(const std::string &url);
75 void setRenderCompat(bool compat) { mRenderCompat = compat; } 74 void setRenderCompat(bool compat);
76 void setFirstName(const std::string &firstName) { mFirstName = firstName; } //aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 75 void setFirstName(const std::string &firstName);
77 void setLastName(const std::string &lastName) { mLastName = lastName; } 76 void setLastName(const std::string &lastName);
78 void setAvatarPassword(const std::string &avatarPassword) { mAvatarPassword = avatarPassword; } 77 void setAvatarPassword(const std::string &avatarPassword);
79 78
80 void setCurrencySymbol(const std::string &sym) { mCurrencySymbol = sym.substr(0, 3); } 79 void setCurrencySymbol(const std::string &sym);
81 void setRealCurrencySymbol(const std::string &sym) { mRealCurrencySymbol = sym.substr(0, 3); } 80 void setRealCurrencySymbol(const std::string &sym);
82 void setDirectoryFee(int fee) { mDirectoryFee = fee; } 81 void setDirectoryFee(int fee);
83 82
84 bool retrieveGridInfo(); 83 bool retrieveGridInfo();
85 84
@@ -137,15 +136,15 @@ public:
137 void saveFile(); 136 void saveFile();
138 void discardAndReload(); 137 void discardAndReload();
139 138
140 HippoGridInfo *getGrid(const std::string &grid) const; 139 HippoGridInfo* getGrid(const std::string &grid) const;
141 HippoGridInfo *getConnectedGrid() const { return (mConnectedGrid)? mConnectedGrid: getCurrentGrid(); } 140 HippoGridInfo* getConnectedGrid() const;
142 HippoGridInfo *getCurrentGrid() const; 141 HippoGridInfo* getCurrentGrid() const;
143 const std::string &getDefaultGridNick() const { return mDefaultGrid; } 142 const std::string& getDefaultGridNick() const;
144 const std::string &getCurrentGridNick() const { return mCurrentGrid; } 143 const std::string& getCurrentGridNick() const;
145 144
146 void setDefaultGrid(const std::string &grid); 145 void setDefaultGrid(const std::string &grid);
147 void setCurrentGrid(const std::string &grid); 146 void setCurrentGrid(const std::string &grid);
148 void setCurrentGridAsConnected() { mConnectedGrid = getCurrentGrid(); } 147 void setCurrentGridAsConnected();
149 148
150 void addGrid(HippoGridInfo *grid); 149 void addGrid(HippoGridInfo *grid);
151 void deleteGrid(const std::string &grid); 150 void deleteGrid(const std::string &grid);