LindenUserDir fixes.

Patch from 2010-10-20/22. Didn't apply cleanly so I redid it
manually and tested/checked it. There was only one difference
with imprudence: for some reason Singularity tries to see
if the "teleport history" floater is visible while initializing
the menu's, something that imprudence doesn't do. For the rest
the patch is basically the same. Nevertheless, I left all code
exactly as it was in Singularity (the only thing that this
commit changes is the intend of the original patch: in debug
mode, fail with an assertion when LindenUserDir is called while
it is not initialized; and then fix everything to make it work
again.

Original commit message:

The LindenUserDir (~/.imprudence/first_last/) cannot be initialized
before the user logged in. However, several singletons (that only can be
initialized once) depend on this directory for initialization. Therefore
we have to take care not to instantiate those singletons until after the
user logged in.

With regard to webit, this fixes the browser_profile (cache and cookies)
directory that the builtin browser uses.
This commit is contained in:
Aleric Inglewood
2011-05-04 17:54:57 +02:00
parent ccaa494e85
commit ab5915c16c
13 changed files with 85 additions and 57 deletions

View File

@@ -1912,7 +1912,8 @@ void LLViewerWindow::initWorldUI()
S32 width = mRootView->getRect().getWidth();
LLRect full_window(0, height, width, 0);
if ( gBottomPanel == NULL ) // Don't re-enter if objects are alreay created
// Don't re-enter if objects are alreay created
if (gBottomPanel == NULL)
{
// panel containing chatbar, toolbar, and overlay, over floaters
gBottomPanel = new LLBottomPanel(mRootView->getRect());
@@ -1925,6 +1926,57 @@ void LLViewerWindow::initWorldUI()
gIMMgr = LLIMMgr::getInstance();
//
// Tools for building
//
init_menus();
// Toolbox floater
gFloaterTools = new LLFloaterTools();
gFloaterTools->setVisible(FALSE);
}
if ( gHUDView == NULL )
{
LLRect hud_rect = full_window;
hud_rect.mBottom += 50;
if (gMenuBarView)
{
hud_rect.mTop -= gMenuBarView->getRect().getHeight();
}
gHUDView = new LLHUDView(hud_rect);
// put behind everything else in the UI
mRootView->addChildAtEnd(gHUDView);
}
}
// initWorldUI that wasn't before logging in. Some of this may require the access the 'LindenUserDir'.
void LLViewerWindow::initWorldUI_postLogin()
{
S32 height = mRootView->getRect().getHeight();
S32 width = mRootView->getRect().getWidth();
LLRect full_window(0, height, width, 0);
// Don't re-enter if objects are alreay created.
if (!gStatusBar)
{
// Status bar
S32 menu_bar_height = gMenuBarView->getRect().getHeight();
LLRect root_rect = getRootView()->getRect();
LLRect status_rect(0, root_rect.getHeight(), root_rect.getWidth(), root_rect.getHeight() - menu_bar_height);
gStatusBar = new LLStatusBar(std::string("status"), status_rect);
gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_TOP);
gStatusBar->reshape(root_rect.getWidth(), gStatusBar->getRect().getHeight(), TRUE);
gStatusBar->translate(0, root_rect.getHeight() - gStatusBar->getRect().getHeight());
// sync bg color with menu bar
gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor() );
getRootView()->addChild(gStatusBar);
// Menu holder appears on top to get first pass at all mouse events
getRootView()->sendChildToFront(gMenuHolder);
if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") )
{
LLFloaterChat::getInstance(LLSD())->loadHistory();
@@ -1950,47 +2002,7 @@ void LLViewerWindow::initWorldUI()
gFloaterTeleportHistory = new LLFloaterTeleportHistory();
gFloaterTeleportHistory->setVisible(FALSE);
//
// Tools for building
//
// Toolbox floater
init_menus();
gFloaterTools = new LLFloaterTools();
gFloaterTools->setVisible(FALSE);
// Status bar
S32 menu_bar_height = gMenuBarView->getRect().getHeight();
LLRect root_rect = getRootView()->getRect();
LLRect status_rect(0, root_rect.getHeight(), root_rect.getWidth(), root_rect.getHeight() - menu_bar_height);
gStatusBar = new LLStatusBar(std::string("status"), status_rect);
gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_TOP);
gStatusBar->reshape(root_rect.getWidth(), gStatusBar->getRect().getHeight(), TRUE);
gStatusBar->translate(0, root_rect.getHeight() - gStatusBar->getRect().getHeight());
// sync bg color with menu bar
gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor() );
LLFloaterChatterBox::createInstance(LLSD());
getRootView()->addChild(gStatusBar);
// menu holder appears on top to get first pass at all mouse events
getRootView()->sendChildToFront(gMenuHolder);
}
if ( gHUDView == NULL )
{
LLRect hud_rect = full_window;
hud_rect.mBottom += 50;
if (gMenuBarView)
{
hud_rect.mTop -= gMenuBarView->getRect().getHeight();
}
gHUDView = new LLHUDView(hud_rect);
// put behind everything else in the UI
mRootView->addChildAtEnd(gHUDView);
}
}