diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llfloaterhtml.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/linden/indra/newview/llfloaterhtml.cpp b/linden/indra/newview/llfloaterhtml.cpp index 596202a..2ad9307 100644 --- a/linden/indra/newview/llfloaterhtml.cpp +++ b/linden/indra/newview/llfloaterhtml.cpp | |||
@@ -34,7 +34,7 @@ | |||
34 | #include "llfloaterhtml.h" | 34 | #include "llfloaterhtml.h" |
35 | 35 | ||
36 | // viewer includes | 36 | // viewer includes |
37 | #include "llvieweruictrlfactory.h" | 37 | #include "lluictrlfactory.h" |
38 | #include "llviewercontrol.h" | 38 | #include "llviewercontrol.h" |
39 | #include "lllineeditor.h" | 39 | #include "lllineeditor.h" |
40 | #include "llviewerwindow.h" | 40 | #include "llviewerwindow.h" |
@@ -49,7 +49,7 @@ LLFloaterHtml* LLFloaterHtml::sInstance = 0; | |||
49 | LLFloaterHtml* LLFloaterHtml::getInstance() | 49 | LLFloaterHtml* LLFloaterHtml::getInstance() |
50 | { | 50 | { |
51 | if ( ! sInstance ) | 51 | if ( ! sInstance ) |
52 | sInstance = new LLFloaterHtml; | 52 | sInstance = new LLFloaterHtml(); |
53 | 53 | ||
54 | return sInstance; | 54 | return sInstance; |
55 | } | 55 | } |
@@ -62,8 +62,7 @@ LLFloaterHtml::LLFloaterHtml() | |||
62 | , | 62 | , |
63 | mWebBrowser( 0 ) | 63 | mWebBrowser( 0 ) |
64 | { | 64 | { |
65 | // create floater from its XML definition | 65 | LLUICtrlFactory::getInstance()->buildFloater( this, "floater_html.xml" ); |
66 | gUICtrlFactory->buildFloater( this, "floater_html.xml" ); | ||
67 | 66 | ||
68 | childSetAction("back_btn", onClickBack, this); | 67 | childSetAction("back_btn", onClickBack, this); |
69 | childSetAction("home_btn", onClickHome, this); | 68 | childSetAction("home_btn", onClickHome, this); |
@@ -73,11 +72,11 @@ LLFloaterHtml::LLFloaterHtml() | |||
73 | childSetAction("go_btn", onClickGo, this ); | 72 | childSetAction("go_btn", onClickGo, this ); |
74 | 73 | ||
75 | // reposition floater from saved settings | 74 | // reposition floater from saved settings |
76 | LLRect rect = gSavedSettings.getRect( "HtmlFloaterRect" ); | 75 | LLRect rect = gSavedSettings.getRect( "FloaterHtmlRect" ); |
77 | reshape( rect.getWidth(), rect.getHeight(), FALSE ); | 76 | reshape( rect.getWidth(), rect.getHeight(), FALSE ); |
78 | setRect( rect ); | 77 | setRect( rect ); |
79 | 78 | ||
80 | mWebBrowser = LLViewerUICtrlFactory::getWebBrowserByName(this, "html_floater_browser" ); | 79 | mWebBrowser = getChild<LLWebBrowserCtrl>("html_floater_browser" ); |
81 | if ( mWebBrowser ) | 80 | if ( mWebBrowser ) |
82 | { | 81 | { |
83 | // open links in internal browser | 82 | // open links in internal browser |
@@ -90,7 +89,7 @@ LLFloaterHtml::LLFloaterHtml() | |||
90 | LLFloaterHtml::~LLFloaterHtml() | 89 | LLFloaterHtml::~LLFloaterHtml() |
91 | { | 90 | { |
92 | // save position of floater | 91 | // save position of floater |
93 | gSavedSettings.setRect( "HtmlFloaterRect", getRect() ); | 92 | gSavedSettings.setRect( "FloaterHtmlRect", getRect() ); |
94 | 93 | ||
95 | sInstance = 0; | 94 | sInstance = 0; |
96 | } | 95 | } |
@@ -114,7 +113,7 @@ void LLFloaterHtml::draw() | |||
114 | 113 | ||
115 | //////////////////////////////////////////////////////////////////////////////// | 114 | //////////////////////////////////////////////////////////////////////////////// |
116 | // | 115 | // |
117 | void LLFloaterHtml::show( LLString content_id, bool open_app_slurls, bool open_link_external ) | 116 | void LLFloaterHtml::show( LLString content_id, bool open_link_external, bool open_app_slurls ) |
118 | { | 117 | { |
119 | // calculate the XML labels we'll need (if only XML folders worked) | 118 | // calculate the XML labels we'll need (if only XML folders worked) |
120 | LLString title_str = content_id + "_title"; | 119 | LLString title_str = content_id + "_title"; |
@@ -122,12 +121,13 @@ void LLFloaterHtml::show( LLString content_id, bool open_app_slurls, bool open_l | |||
122 | 121 | ||
123 | std::string title = getString( title_str ); | 122 | std::string title = getString( title_str ); |
124 | std::string url = getString( url_str ); | 123 | std::string url = getString( url_str ); |
125 | show( url, title, open_app_slurls, open_link_external ); | 124 | |
125 | show( url, title, open_link_external, open_app_slurls ); | ||
126 | } | 126 | } |
127 | 127 | ||
128 | //////////////////////////////////////////////////////////////////////////////// | 128 | //////////////////////////////////////////////////////////////////////////////// |
129 | // | 129 | // |
130 | void LLFloaterHtml::show( std::string start_url, std::string title, bool open_app_slurls, bool open_link_external ) | 130 | void LLFloaterHtml::show( std::string start_url, std::string title, bool open_link_external, bool open_app_slurls ) |
131 | { | 131 | { |
132 | // set the title | 132 | // set the title |
133 | setTitle( title ); | 133 | setTitle( title ); |
@@ -149,6 +149,8 @@ void LLFloaterHtml::show( std::string start_url, std::string title, bool open_ap | |||
149 | void LLFloaterHtml::onClose( bool app_quitting ) | 149 | void LLFloaterHtml::onClose( bool app_quitting ) |
150 | { | 150 | { |
151 | setVisible( false ); | 151 | setVisible( false ); |
152 | // HACK for fast XML iteration replace with: | ||
153 | // destroy(); | ||
152 | } | 154 | } |
153 | 155 | ||
154 | //////////////////////////////////////////////////////////////////////////////// | 156 | //////////////////////////////////////////////////////////////////////////////// |
@@ -156,8 +158,7 @@ void LLFloaterHtml::onClose( bool app_quitting ) | |||
156 | void LLFloaterHtml::onClickClose( void* data ) | 158 | void LLFloaterHtml::onClickClose( void* data ) |
157 | { | 159 | { |
158 | LLFloaterHtml* self = ( LLFloaterHtml* )data; | 160 | LLFloaterHtml* self = ( LLFloaterHtml* )data; |
159 | 161 | self->close(); | |
160 | self->setVisible( false ); | ||
161 | } | 162 | } |
162 | 163 | ||
163 | //////////////////////////////////////////////////////////////////////////////// | 164 | //////////////////////////////////////////////////////////////////////////////// |
@@ -243,4 +244,3 @@ void LLFloaterHtml::onClickGo( void* data ) | |||
243 | } | 244 | } |
244 | } | 245 | } |
245 | } | 246 | } |
246 | |||