From e085b89db33622230a578c6581031697b5f91d4e Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Wed, 14 Jul 2010 00:02:08 -0700 Subject: Fixed #186: View > Web Browser broken --- linden/indra/newview/llfloaterhtmlhelp.cpp | 36 ++++++++---------------------- linden/indra/newview/llfloaterhtmlhelp.h | 6 +---- linden/indra/newview/llviewermenu.cpp | 2 +- 3 files changed, 11 insertions(+), 33 deletions(-) (limited to 'linden') diff --git a/linden/indra/newview/llfloaterhtmlhelp.cpp b/linden/indra/newview/llfloaterhtmlhelp.cpp index ff69394..5caf7b1 100644 --- a/linden/indra/newview/llfloaterhtmlhelp.cpp +++ b/linden/indra/newview/llfloaterhtmlhelp.cpp @@ -95,6 +95,15 @@ BOOL LLFloaterMediaBrowser::postBuild() childSetAction("set_home", onClickSetHome, this); buildURLHistory(); + + //Show home url if new session, last visited if not + std::string last_url = gSavedSettings.getString("BrowserLastVisited"); + if (last_url.empty()) + { + last_url = gSavedSettings.getString("BrowserHome"); + } + openMedia(last_url); + return TRUE; } @@ -158,33 +167,6 @@ void LLFloaterMediaBrowser::onLocationChange( const EventType& eventIn ) gSavedSettings.setString("BrowserLastVisited", truncated_url); } -LLFloaterMediaBrowser* LLFloaterMediaBrowser::showInstance(const LLSD& media_url) -{ - LLFloaterMediaBrowser* floaterp = LLUISingleton >::showInstance(media_url); - - floaterp->openMedia(media_url.asString()); - return floaterp; -} - -//static -void LLFloaterMediaBrowser::toggle() -{ - LLFloaterMediaBrowser* self = LLFloaterMediaBrowser::getInstance(); - - if(self->getVisible()) - { - self->close(); - } - else - { - //Show home url if new session, last visited if not - std::string last_url = gSavedSettings.getString("BrowserLastVisited"); - if(last_url.empty()) - last_url = gSavedSettings.getString("BrowserHome"); - showInstance(last_url); - } -} - //static void LLFloaterMediaBrowser::helpF1() { diff --git a/linden/indra/newview/llfloaterhtmlhelp.h b/linden/indra/newview/llfloaterhtmlhelp.h index fa04f06..83f15cd 100644 --- a/linden/indra/newview/llfloaterhtmlhelp.h +++ b/linden/indra/newview/llfloaterhtmlhelp.h @@ -50,9 +50,8 @@ public: class LLComboBox; class LLWebBrowserCtrl; -class LLFloaterMediaBrowser : public LLFloater, public LLUISingleton >, public LLWebBrowserCtrlObserver +class LLFloaterMediaBrowser : public LLFloater, public LLFloaterSingleton, public LLWebBrowserCtrlObserver { - friend class LLUISingleton >; public: LLFloaterMediaBrowser(const LLSD& media_data); @@ -65,9 +64,6 @@ public: void openMedia(const std::string& media_url); void buildURLHistory(); - static LLFloaterMediaBrowser* showInstance(const LLSD& id); - - static void toggle(); static void helpF1(); private: diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index ee2f2bc..a95c3c6 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -5937,7 +5937,7 @@ class LLShowFloater : public view_listener_t } else if (floater_name == "inworld browser") { - LLFloaterMediaBrowser::toggle(); + LLFloaterMediaBrowser::toggleInstance(LLSD()); } else if (floater_name == "beacons") { -- cgit v1.1