diff options
author | Jacek Antonelli | 2008-08-15 23:44:56 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:56 -0500 |
commit | c07901e29ed545bbb02e3bddf148fe1104b94e9f (patch) | |
tree | f1ada64ce834acd7d92a425efb96c4b86bcf16b1 /linden/indra/newview/llfloaterhtml.cpp | |
parent | Second Life viewer sources 1.15.0.2 (diff) | |
download | meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.zip meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.tar.gz meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.tar.bz2 meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.tar.xz |
Second Life viewer sources 1.15.1.3
Diffstat (limited to 'linden/indra/newview/llfloaterhtml.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterhtml.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/linden/indra/newview/llfloaterhtml.cpp b/linden/indra/newview/llfloaterhtml.cpp index 519a031..0c5bdcd 100644 --- a/linden/indra/newview/llfloaterhtml.cpp +++ b/linden/indra/newview/llfloaterhtml.cpp | |||
@@ -49,8 +49,12 @@ LLFloaterHtml* LLFloaterHtml::getInstance() | |||
49 | //////////////////////////////////////////////////////////////////////////////// | 49 | //////////////////////////////////////////////////////////////////////////////// |
50 | // | 50 | // |
51 | LLFloaterHtml::LLFloaterHtml() | 51 | LLFloaterHtml::LLFloaterHtml() |
52 | : LLFloater( "HTML Floater" ), | 52 | : LLFloater( "HTML Floater" ) |
53 | |||
54 | #if LL_LIBXUL_ENABLED | ||
55 | , | ||
53 | mWebBrowser( 0 ) | 56 | mWebBrowser( 0 ) |
57 | #endif // LL_LIBXUL_ENABLED | ||
54 | { | 58 | { |
55 | // create floater from its XML definition | 59 | // create floater from its XML definition |
56 | gUICtrlFactory->buildFloater( this, "floater_html.xml" ); | 60 | gUICtrlFactory->buildFloater( this, "floater_html.xml" ); |
@@ -60,6 +64,7 @@ LLFloaterHtml::LLFloaterHtml() | |||
60 | reshape( rect.getWidth(), rect.getHeight(), FALSE ); | 64 | reshape( rect.getWidth(), rect.getHeight(), FALSE ); |
61 | setRect( rect ); | 65 | setRect( rect ); |
62 | 66 | ||
67 | #if LL_LIBXUL_ENABLED | ||
63 | mWebBrowser = LLViewerUICtrlFactory::getWebBrowserByName(this, "html_floater_browser" ); | 68 | mWebBrowser = LLViewerUICtrlFactory::getWebBrowserByName(this, "html_floater_browser" ); |
64 | if ( mWebBrowser ) | 69 | if ( mWebBrowser ) |
65 | { | 70 | { |
@@ -72,7 +77,8 @@ LLFloaterHtml::LLFloaterHtml() | |||
72 | // don't automatically open secondlife links since we want to catch | 77 | // don't automatically open secondlife links since we want to catch |
73 | // special ones that do other stuff (like open F1 Help) | 78 | // special ones that do other stuff (like open F1 Help) |
74 | mWebBrowser->setOpenSecondLifeLinksInMap( false ); | 79 | mWebBrowser->setOpenSecondLifeLinksInMap( false ); |
75 | }; | 80 | } |
81 | #endif // LL_LIBXUL_ENABLED | ||
76 | 82 | ||
77 | childSetAction("close_btn", onClickClose, this); | 83 | childSetAction("close_btn", onClickClose, this); |
78 | setDefaultBtn("close_btn"); | 84 | setDefaultBtn("close_btn"); |
@@ -82,9 +88,11 @@ LLFloaterHtml::LLFloaterHtml() | |||
82 | // | 88 | // |
83 | LLFloaterHtml::~LLFloaterHtml() | 89 | LLFloaterHtml::~LLFloaterHtml() |
84 | { | 90 | { |
91 | #if LL_LIBXUL_ENABLED | ||
85 | // stop observing browser events | 92 | // stop observing browser events |
86 | if ( mWebBrowser ) | 93 | if ( mWebBrowser ) |
87 | mWebBrowser->remObserver( this ); | 94 | mWebBrowser->remObserver( this ); |
95 | #endif // LL_LIBXUL_ENABLED | ||
88 | 96 | ||
89 | // save position of floater | 97 | // save position of floater |
90 | gSavedSettings.setRect( "HtmlFloaterRect", mRect ); | 98 | gSavedSettings.setRect( "HtmlFloaterRect", mRect ); |
@@ -103,9 +111,11 @@ void LLFloaterHtml::show( LLString content_id ) | |||
103 | // set the title | 111 | // set the title |
104 | setTitle( childGetValue( title_str ).asString() ); | 112 | setTitle( childGetValue( title_str ).asString() ); |
105 | 113 | ||
114 | #if LL_LIBXUL_ENABLED | ||
106 | // navigate to the URL | 115 | // navigate to the URL |
107 | if ( mWebBrowser ) | 116 | if ( mWebBrowser ) |
108 | mWebBrowser->navigateTo( childGetValue( url_str ).asString() ); | 117 | mWebBrowser->navigateTo( childGetValue( url_str ).asString() ); |
118 | #endif // LL_LIBXUL_ENABLED | ||
109 | 119 | ||
110 | // make floater appear | 120 | // make floater appear |
111 | setVisibleAndFrontmost(); | 121 | setVisibleAndFrontmost(); |
@@ -131,6 +141,7 @@ void LLFloaterHtml::onClickClose( void* data ) | |||
131 | // | 141 | // |
132 | void LLFloaterHtml::onClickLinkSecondLife( const EventType& eventIn ) | 142 | void LLFloaterHtml::onClickLinkSecondLife( const EventType& eventIn ) |
133 | { | 143 | { |
144 | #if LL_LIBXUL_ENABLED | ||
134 | const std::string protocol( "secondlife://app." ); | 145 | const std::string protocol( "secondlife://app." ); |
135 | 146 | ||
136 | // special 'app' secondlife link (using a different protocol - one that isn't registered in the browser) causes bad | 147 | // special 'app' secondlife link (using a different protocol - one that isn't registered in the browser) causes bad |
@@ -144,11 +155,12 @@ void LLFloaterHtml::onClickLinkSecondLife( const EventType& eventIn ) | |||
144 | if ( LLString::compareInsensitive( cmd.c_str() , "floater.html.help" ) == 0 ) | 155 | if ( LLString::compareInsensitive( cmd.c_str() , "floater.html.help" ) == 0 ) |
145 | { | 156 | { |
146 | gViewerHtmlHelp.show(); | 157 | gViewerHtmlHelp.show(); |
147 | }; | 158 | } |
148 | } | 159 | } |
149 | else | 160 | else |
150 | // regular secondlife link - just open the map as normal | 161 | // regular secondlife link - just open the map as normal |
151 | { | 162 | { |
152 | mWebBrowser->openMapAtlocation( eventIn.getStringValue() ); | 163 | mWebBrowser->openMapAtlocation( eventIn.getStringValue() ); |
153 | }; | 164 | } |
154 | }; \ No newline at end of file | 165 | #endif // LL_LIBXUL_ENABLED |
166 | }; | ||