aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview
diff options
context:
space:
mode:
authorAleric Inglewood2010-10-20 18:31:42 +0200
committerAleric Inglewood2010-10-20 18:31:42 +0200
commit2f4e17af336c9a399a0274b7836f40fc7ff56e21 (patch)
tree1c5c9d83bab4a602b58b439ffccd758ebca54836 /linden/indra/newview
parentUpdate WebKit Version in About floater. (diff)
downloadmeta-impy-2f4e17af336c9a399a0274b7836f40fc7ff56e21.zip
meta-impy-2f4e17af336c9a399a0274b7836f40fc7ff56e21.tar.gz
meta-impy-2f4e17af336c9a399a0274b7836f40fc7ff56e21.tar.bz2
meta-impy-2f4e17af336c9a399a0274b7836f40fc7ff56e21.tar.xz
LindenUserDir fixes.
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.
Diffstat (limited to 'linden/indra/newview')
-rw-r--r--linden/indra/newview/llappviewer.cpp20
-rw-r--r--linden/indra/newview/llimview.cpp2
-rw-r--r--linden/indra/newview/llmutelist.cpp2
-rw-r--r--linden/indra/newview/llstartup.cpp6
-rw-r--r--linden/indra/newview/llurlhistory.cpp2
-rw-r--r--linden/indra/newview/llviewermedia.cpp2
-rw-r--r--linden/indra/newview/llviewerwindow.cpp70
-rw-r--r--linden/indra/newview/llviewerwindow.h1
8 files changed, 61 insertions, 44 deletions
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp
index 9fad9f1..1d45575 100644
--- a/linden/indra/newview/llappviewer.cpp
+++ b/linden/indra/newview/llappviewer.cpp
@@ -1205,7 +1205,10 @@ bool LLAppViewer::cleanup()
1205 1205
1206 //reset balance for not playing the UI-Sound 1206 //reset balance for not playing the UI-Sound
1207 //when relogging into another account 1207 //when relogging into another account
1208 gStatusBar->clearBalance(); 1208 if (gStatusBar)
1209 {
1210 gStatusBar->clearBalance();
1211 }
1209 1212
1210 if (mQuitRequested) 1213 if (mQuitRequested)
1211 { 1214 {
@@ -3282,12 +3285,15 @@ void LLAppViewer::saveFinalSnapshot()
3282 gSavedSettings.setBOOL("ShowParcelOwners", FALSE); 3285 gSavedSettings.setBOOL("ShowParcelOwners", FALSE);
3283 idle(); 3286 idle();
3284 3287
3285 std::string snap_filename = gDirUtilp->getLindenUserDir(); 3288 std::string snap_filename = gDirUtilp->getLindenUserDir(true);
3286 snap_filename += gDirUtilp->getDirDelimiter(); 3289 if (!snap_filename.empty())
3287 snap_filename += SCREEN_LAST_FILENAME; 3290 {
3288 // use full pixel dimensions of viewer window (not post-scale dimensions) 3291 snap_filename += gDirUtilp->getDirDelimiter();
3289 gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight(), FALSE, TRUE); 3292 snap_filename += SCREEN_LAST_FILENAME;
3290 mSavedFinalSnapshot = TRUE; 3293 // use full pixel dimensions of viewer window (not post-scale dimensions)
3294 gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight(), FALSE, TRUE);
3295 mSavedFinalSnapshot = TRUE;
3296 }
3291 } 3297 }
3292} 3298}
3293 3299
diff --git a/linden/indra/newview/llimview.cpp b/linden/indra/newview/llimview.cpp
index a6eaeb3..0b71030 100644
--- a/linden/indra/newview/llimview.cpp
+++ b/linden/indra/newview/llimview.cpp
@@ -1360,7 +1360,7 @@ void LLIMMgr::saveIgnoreGroup()
1360{ 1360{
1361 // llinfos << "saving ignore_groups.xml" << llendl; 1361 // llinfos << "saving ignore_groups.xml" << llendl;
1362 1362
1363 std::string user_dir = gDirUtilp->getLindenUserDir(); 1363 std::string user_dir = gDirUtilp->getLindenUserDir(true);
1364 if (!user_dir.empty()) 1364 if (!user_dir.empty())
1365 { 1365 {
1366 std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "ignore_groups.xml"); 1366 std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "ignore_groups.xml");
diff --git a/linden/indra/newview/llmutelist.cpp b/linden/indra/newview/llmutelist.cpp
index 0e03509..fff5558 100644
--- a/linden/indra/newview/llmutelist.cpp
+++ b/linden/indra/newview/llmutelist.cpp
@@ -265,7 +265,7 @@ LLMuteList::~LLMuteList()
265 // If we quit from the login screen we will not have an SL account 265 // If we quit from the login screen we will not have an SL account
266 // name. Don't try to save, otherwise we'll dump a file in 266 // name. Don't try to save, otherwise we'll dump a file in
267 // C:\Program Files\SecondLife\ JC 267 // C:\Program Files\SecondLife\ JC
268 std::string user_dir = gDirUtilp->getLindenUserDir(); 268 std::string user_dir = gDirUtilp->getLindenUserDir(true);
269 if (!user_dir.empty()) 269 if (!user_dir.empty())
270 { 270 {
271 std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "volume_settings.xml"); 271 std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "volume_settings.xml");
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index 7bd5fff..fad3df2 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -839,7 +839,7 @@ bool idle_startup()
839 LLToolMgr::getInstance()->initTools(); 839 LLToolMgr::getInstance()->initTools();
840 840
841 // Quickly get something onscreen to look at. 841 // Quickly get something onscreen to look at.
842 gViewerWindow->initWorldUI(); 842 gViewerWindow->pre_initWorldUI();
843 } 843 }
844 844
845 gViewerWindow->setNormalControlsVisible( FALSE ); 845 gViewerWindow->setNormalControlsVisible( FALSE );
@@ -1823,6 +1823,10 @@ bool idle_startup()
1823 { 1823 {
1824 LL_DEBUGS("AppInitStartupState") << "STATE_WORLD_INIT" << LL_ENDL; 1824 LL_DEBUGS("AppInitStartupState") << "STATE_WORLD_INIT" << LL_ENDL;
1825 set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD); 1825 set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD);
1826
1827 // Initialize the rest of the world.
1828 gViewerWindow->initWorldUI();
1829
1826 gDisconnected=FALSE; 1830 gDisconnected=FALSE;
1827 display_startup(); 1831 display_startup();
1828 // We should have an agent id by this point. 1832 // We should have an agent id by this point.
diff --git a/linden/indra/newview/llurlhistory.cpp b/linden/indra/newview/llurlhistory.cpp
index fbd14bc..b187f3b 100644
--- a/linden/indra/newview/llurlhistory.cpp
+++ b/linden/indra/newview/llurlhistory.cpp
@@ -74,7 +74,7 @@ bool LLURLHistory::loadFile(const std::string& filename)
74// static 74// static
75bool LLURLHistory::saveFile(const std::string& filename) 75bool LLURLHistory::saveFile(const std::string& filename)
76{ 76{
77 std::string temp_str = gDirUtilp->getLindenUserDir(); 77 std::string temp_str = gDirUtilp->getLindenUserDir(true);
78 if( temp_str.empty() ) 78 if( temp_str.empty() )
79 { 79 {
80 llwarns << "Can't save " << filename 80 llwarns << "Can't save " << filename
diff --git a/linden/indra/newview/llviewermedia.cpp b/linden/indra/newview/llviewermedia.cpp
index 57c2111..5c01b25 100644
--- a/linden/indra/newview/llviewermedia.cpp
+++ b/linden/indra/newview/llviewermedia.cpp
@@ -471,7 +471,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
471 // at the login page displaying login Web page or Web browser test via Develop menu. 471 // at the login page displaying login Web page or Web browser test via Develop menu.
472 // In this case we just use whatever gDirUtilp->getOSUserAppDir() gives us (this 472 // In this case we just use whatever gDirUtilp->getOSUserAppDir() gives us (this
473 // is what we always used before this change) 473 // is what we always used before this change)
474 std::string linden_user_dir = gDirUtilp->getLindenUserDir(); 474 std::string linden_user_dir = gDirUtilp->getLindenUserDir(true);
475 if ( ! linden_user_dir.empty() ) 475 if ( ! linden_user_dir.empty() )
476 { 476 {
477 // gDirUtilp->getLindenUserDir() is whole path, not just Linden name 477 // gDirUtilp->getLindenUserDir() is whole path, not just Linden name
diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp
index 5cd730a..07fef53 100644
--- a/linden/indra/newview/llviewerwindow.cpp
+++ b/linden/indra/newview/llviewerwindow.cpp
@@ -1652,7 +1652,7 @@ void LLViewerWindow::adjustControlRectanglesForFirstUse(const LLRect& window)
1652 adjust_rect_top_center("FloaterCameraRect3", window); 1652 adjust_rect_top_center("FloaterCameraRect3", window);
1653} 1653}
1654 1654
1655void LLViewerWindow::initWorldUI() 1655void LLViewerWindow::pre_initWorldUI()
1656{ 1656{
1657 pre_init_menus(); 1657 pre_init_menus();
1658 1658
@@ -1672,9 +1672,45 @@ void LLViewerWindow::initWorldUI()
1672 gHoverView = new LLHoverView(std::string("gHoverView"), full_window); 1672 gHoverView = new LLHoverView(std::string("gHoverView"), full_window);
1673 gHoverView->setVisible(TRUE); 1673 gHoverView->setVisible(TRUE);
1674 mRootView->addChild(gHoverView); 1674 mRootView->addChild(gHoverView);
1675 1675
1676 gIMMgr = LLIMMgr::getInstance(); 1676 gIMMgr = LLIMMgr::getInstance();
1677 1677
1678 // Make sure we only create menus once per session -- MC
1679 if (!gMenuHolder)
1680 {
1681 init_menus();
1682 }
1683
1684 if (!gFloaterTools)
1685 {
1686 gFloaterTools = new LLFloaterTools();
1687 gFloaterTools->setVisible(FALSE);
1688 }
1689
1690 // menu holder appears on top to get first pass at all mouse events
1691
1692 mRootView->sendChildToFront(gMenuHolder);
1693
1694 if ( gHUDView == NULL )
1695 {
1696 LLRect hud_rect = full_window;
1697 hud_rect.mBottom += 50;
1698 if (gMenuBarView)
1699 {
1700 hud_rect.mTop -= gMenuBarView->getRect().getHeight();
1701 }
1702 gHUDView = new LLHUDView(hud_rect);
1703 // put behind everything else in the UI
1704 mRootView->addChildAtEnd(gHUDView);
1705 }
1706}
1707
1708void LLViewerWindow::initWorldUI()
1709{
1710 S32 height = mRootView->getRect().getHeight();
1711 S32 width = mRootView->getRect().getWidth();
1712 LLRect full_window(0, height, width, 0);
1713
1678 if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) 1714 if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") )
1679 { 1715 {
1680 LLFloaterChat::getInstance(LLSD())->loadHistory(); 1716 LLFloaterChat::getInstance(LLSD())->loadHistory();
@@ -1715,18 +1751,6 @@ void LLViewerWindow::initWorldUI()
1715 1751
1716 // Toolbox floater 1752 // Toolbox floater
1717 1753
1718 // Make sure we only create menus once per session -- MC
1719 if (!gMenuHolder)
1720 {
1721 init_menus();
1722 }
1723
1724 if (!gFloaterTools)
1725 {
1726 gFloaterTools = new LLFloaterTools();
1727 gFloaterTools->setVisible(FALSE);
1728 }
1729
1730 if (!gStatusBar) 1754 if (!gStatusBar)
1731 { 1755 {
1732 // Status bar 1756 // Status bar
@@ -1744,24 +1768,6 @@ void LLViewerWindow::initWorldUI()
1744 } 1768 }
1745 1769
1746 LLFloaterChatterBox::createInstance(LLSD()); 1770 LLFloaterChatterBox::createInstance(LLSD());
1747
1748
1749 // menu holder appears on top to get first pass at all mouse events
1750
1751 mRootView->sendChildToFront(gMenuHolder);
1752
1753 if ( gHUDView == NULL )
1754 {
1755 LLRect hud_rect = full_window;
1756 hud_rect.mBottom += 50;
1757 if (gMenuBarView)
1758 {
1759 hud_rect.mTop -= gMenuBarView->getRect().getHeight();
1760 }
1761 gHUDView = new LLHUDView(hud_rect);
1762 // put behind everything else in the UI
1763 mRootView->addChildAtEnd(gHUDView);
1764 }
1765} 1771}
1766 1772
1767// Destroy the UI 1773// Destroy the UI
diff --git a/linden/indra/newview/llviewerwindow.h b/linden/indra/newview/llviewerwindow.h
index 85cdc52..ee8f3fe 100644
--- a/linden/indra/newview/llviewerwindow.h
+++ b/linden/indra/newview/llviewerwindow.h
@@ -143,6 +143,7 @@ public:
143 void initBase(); 143 void initBase();
144 void adjustRectanglesForFirstUse(const LLRect& window); 144 void adjustRectanglesForFirstUse(const LLRect& window);
145 void adjustControlRectanglesForFirstUse(const LLRect& window); 145 void adjustControlRectanglesForFirstUse(const LLRect& window);
146 void pre_initWorldUI();
146 void initWorldUI(); 147 void initWorldUI();
147 148
148 // 149 //