diff options
Diffstat (limited to 'linden/indra/newview/floatergridmanager.h')
-rw-r--r-- | linden/indra/newview/floatergridmanager.h | 100 |
1 files changed, 49 insertions, 51 deletions
diff --git a/linden/indra/newview/floatergridmanager.h b/linden/indra/newview/floatergridmanager.h index 55517f5..985a905 100644 --- a/linden/indra/newview/floatergridmanager.h +++ b/linden/indra/newview/floatergridmanager.h | |||
@@ -1,22 +1,39 @@ | |||
1 | /* | 1 | /** |
2 | * floatergridmanager.h | 2 | * @file floatergridmanager.h |
3 | * This is Meerkats grid manager. | 3 | * @brief UI for managing grid information |
4 | * -Patrick Sapinski (Monday, August 17, 2009) | 4 | * |
5 | * | 5 | * $LicenseInfo:firstyear=2011&license=viewergpl$ |
6 | * Modified by McCabe Maxsted for Imprudence | 6 | * |
7 | */ | 7 | * Copyright (c) 2011, McCabe Maxsted |
8 | * based on Meerkat's grid manager by Patrick Sapinski | ||
9 | * | ||
10 | * Imprudence Viewer Source Code | ||
11 | * The source code in this file ("Source Code") is provided to you | ||
12 | * under the terms of the GNU General Public License, version 2.0 | ||
13 | * ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in | ||
14 | * this distribution, or online at | ||
15 | * http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
16 | * | ||
17 | * There are special exceptions to the terms and conditions of the GPL as | ||
18 | * it is applied to this Source Code. View the full text of the exception | ||
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | ||
22 | * By copying, modifying or distributing this software, you acknowledge | ||
23 | * that you have read and understood your obligations described above, | ||
24 | * and agree to abide by those obligations. | ||
25 | * | ||
26 | * ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO | ||
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
28 | * COMPLETENESS OR PERFORMANCE. | ||
29 | * $/LicenseInfo$ | ||
30 | */ | ||
8 | 31 | ||
9 | #ifndef PL_floaterlogin_H | 32 | #ifndef PL_floaterlogin_H |
10 | #define PL_floaterlogin_H | 33 | #define PL_floaterlogin_H |
11 | 34 | ||
12 | #define LOGIN_OPTION_CONNECT 0 | ||
13 | #define LOGIN_OPTION_QUIT 1 | ||
14 | |||
15 | #include "llfloater.h" | 35 | #include "llfloater.h" |
16 | 36 | ||
17 | class LoginController; | ||
18 | class AuthenticationModel; | ||
19 | |||
20 | class FloaterGridManager : public LLFloater, public LLFloaterSingleton<FloaterGridManager> | 37 | class FloaterGridManager : public LLFloater, public LLFloaterSingleton<FloaterGridManager> |
21 | { | 38 | { |
22 | public: | 39 | public: |
@@ -27,57 +44,40 @@ public: | |||
27 | 44 | ||
28 | static void refreshGrids(); | 45 | static void refreshGrids(); |
29 | void apply(); | 46 | void apply(); |
30 | //void setDefault(); | ||
31 | void cancel(); | 47 | void cancel(); |
32 | 48 | ||
33 | void clearInfo(); | ||
34 | |||
35 | virtual void draw(); | 49 | virtual void draw(); |
36 | 50 | ||
37 | void refresh(); | 51 | void refresh(); |
38 | 52 | ||
39 | // new-style login methods | 53 | // clears either the loginuri fetched info or all the info in the grid manager |
40 | virtual std::string& getPassword(); | 54 | void clearGridInfo(bool clear_all); |
41 | virtual void setPassword(std::string &password); | ||
42 | virtual bool isSamePassword(std::string &password); | ||
43 | static void getFields(std::string &loginname, std::string &password, | ||
44 | BOOL &remember); | ||
45 | static void setFields(const std::string &loginname, const std::string &password, | ||
46 | BOOL remember); | ||
47 | 55 | ||
48 | // LLLoginPanel compatibility | 56 | //static void getLocation(std::string &location); |
49 | /*static void setAlwaysRefresh(bool refresh); | 57 | //void refreshLocation(bool force_visible) |
50 | static void refreshLocation(bool force_visible); | ||
51 | virtual void setFocus(BOOL b); | ||
52 | static void giveFocus();*/ | ||
53 | static void getLocation(std::string &location); | ||
54 | static BOOL isGridComboDirty(); | 58 | static BOOL isGridComboDirty(); |
55 | //static void addServer(const std::string& server, S32 domain_name); | 59 | |
56 | static void hashPassword(const std::string& password, std::string& hashedPassword); | ||
57 | protected: | ||
58 | static bool sIsInitialLogin; | ||
59 | static std::string sGrid; | ||
60 | private: | 60 | private: |
61 | enum State | 61 | |
62 | enum EGridState | ||
62 | { | 63 | { |
63 | NORMAL, | 64 | GRID_STATE_NORMAL, |
64 | ADD_NEW, | 65 | GRID_STATE_NEW, |
65 | ADD_COPY | 66 | GRID_STATE_COPY |
66 | }; | 67 | }; |
67 | 68 | ||
68 | State mState; | 69 | void setGridState(EGridState state) { mState = state; } |
69 | void setState(const State& state) { mState = state; } | 70 | EGridState getGridState() { return mState; } |
70 | State getState() { return mState; } | 71 | EGridState mState; |
71 | |||
72 | std::string mCurGrid; | 72 | std::string mCurGrid; |
73 | void setCurGrid(const std::string& grid) { mCurGrid = grid; } | ||
74 | std::string getCurGrid() { return mCurGrid; } | ||
75 | 73 | ||
76 | std::string mIncomingPassword; | 74 | void setCurGrid(std::string grid) { mCurGrid = grid; } |
77 | std::string mMungedPassword; | 75 | std::string getCurGrid() { return mCurGrid; } |
78 | 76 | ||
79 | void applyChanges(); | 77 | void applyChanges(); |
80 | bool createNewGrid(); | 78 | void createNewGrid(); |
79 | void setupNewGridEntry(); | ||
80 | void setupCopyGridEntry(); | ||
81 | void update(); | 81 | void update(); |
82 | void retrieveGridInfo(); | 82 | void retrieveGridInfo(); |
83 | 83 | ||
@@ -87,13 +87,11 @@ private: | |||
87 | static void onClickCopy(void* data); | 87 | static void onClickCopy(void* data); |
88 | static void onClickOk(void* data); | 88 | static void onClickOk(void* data); |
89 | static void onClickApply(void* data); | 89 | static void onClickApply(void* data); |
90 | static void onClickDefault(void* data); | ||
91 | static void onClickGridInfo(void* data); | 90 | static void onClickGridInfo(void* data); |
92 | static void onClickCancel(void* data); | 91 | static void onClickCancel(void* data); |
93 | static void onClickClear(void* data); | 92 | static void onClickClear(void* data); |
94 | 93 | ||
95 | static LoginController* sController; | 94 | static bool newGridCreationCallback(const LLSD& notification, const LLSD& response); |
96 | static AuthenticationModel* sModel; | ||
97 | }; | 95 | }; |
98 | 96 | ||
99 | #endif // PL_floaterlogin_H | 97 | #endif // PL_floaterlogin_H |