summaryrefslogtreecommitdiff
path: root/indra/newview/lldirpicker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lldirpicker.cpp')
-rw-r--r--indra/newview/lldirpicker.cpp81
1 files changed, 41 insertions, 40 deletions
diff --git a/indra/newview/lldirpicker.cpp b/indra/newview/lldirpicker.cpp
index 367293929d..53101f0ce2 100644
--- a/indra/newview/lldirpicker.cpp
+++ b/indra/newview/lldirpicker.cpp
@@ -2,30 +2,25 @@
* @file lldirpicker.cpp
* @brief OS-specific file picker
*
- * $LicenseInfo:firstyear=2001&license=viewergpl$
- *
- * Copyright (c) 2001-2007, Linden Research, Inc.
- *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab. Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlife.com/developers/opensource/gplv2
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
*
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at http://secondlife.com/developers/opensource/flossexception
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -38,8 +33,10 @@
#include "llkeyboard.h"
#include "lldir.h"
#include "llframetimer.h"
+#include "lltrans.h"
+#include "llwindow.h" // beforeDialog()
-#if LL_LINUX
+#if LL_LINUX || LL_SOLARIS
# include "llfilepicker.h"
#endif
@@ -58,7 +55,9 @@ LLDirPicker LLDirPicker::sInstance;
//
#if LL_WINDOWS
-LLDirPicker::LLDirPicker()
+LLDirPicker::LLDirPicker() :
+ mFileName(NULL),
+ mLocked(false)
{
}
@@ -67,7 +66,7 @@ LLDirPicker::~LLDirPicker()
// nothing
}
-BOOL LLDirPicker::getDir(LLString* filename)
+BOOL LLDirPicker::getDir(std::string* filename)
{
if( mLocked )
{
@@ -114,7 +113,7 @@ BOOL LLDirPicker::getDir(LLString* filename)
return success;
}
-LLString LLDirPicker::getDirName()
+std::string LLDirPicker::getDirName()
{
return mDir;
}
@@ -122,7 +121,9 @@ LLString LLDirPicker::getDirName()
/////////////////////////////////////////////DARWIN
#elif LL_DARWIN
-LLDirPicker::LLDirPicker()
+LLDirPicker::LLDirPicker() :
+ mFileName(NULL),
+ mLocked(false)
{
reset();
@@ -225,7 +226,7 @@ OSStatus LLDirPicker::doNavChooseDialog()
return error;
}
-BOOL LLDirPicker::getDir(LLString* filename)
+BOOL LLDirPicker::getDir(std::string* filename)
{
if( mLocked ) return FALSE;
BOOL success = FALSE;
@@ -252,20 +253,22 @@ BOOL LLDirPicker::getDir(LLString* filename)
return success;
}
-LLString LLDirPicker::getDirName()
+std::string LLDirPicker::getDirName()
{
return mDir;
}
void LLDirPicker::reset()
{
- mLocked = FALSE;
- mDir = NULL;
+ mLocked = false;
+ mDir.clear();
}
-#elif LL_LINUX
+#elif LL_LINUX || LL_SOLARIS
-LLDirPicker::LLDirPicker()
+LLDirPicker::LLDirPicker() :
+ mFileName(NULL),
+ mLocked(false)
{
mFilePicker = new LLFilePicker();
reset();
@@ -283,7 +286,7 @@ void LLDirPicker::reset()
mFilePicker->reset();
}
-BOOL LLDirPicker::getDir(LLString* filename)
+BOOL LLDirPicker::getDir(std::string* filename)
{
reset();
if (mFilePicker)
@@ -293,22 +296,20 @@ BOOL LLDirPicker::getDir(LLString* filename)
if (picker)
{
- gtk_window_set_title(GTK_WINDOW(picker), "Choose Directory");
+ gtk_window_set_title(GTK_WINDOW(picker), LLTrans::getString("choose_the_directory").c_str());
gtk_widget_show_all(GTK_WIDGET(picker));
gtk_main();
- return (NULL != mFilePicker->getFirstFile());
+ return (!mFilePicker->getFirstFile().empty());
}
}
return FALSE;
}
-LLString LLDirPicker::getDirName()
+std::string LLDirPicker::getDirName()
{
if (mFilePicker)
{
- const char* name = mFilePicker->getFirstFile();
- if (name)
- return name;
+ return mFilePicker->getFirstFile();
}
return "";
}
@@ -329,12 +330,12 @@ void LLDirPicker::reset()
{
}
-BOOL LLDirPicker::getDir(LLString* filename)
+BOOL LLDirPicker::getDir(std::string* filename)
{
return FALSE;
}
-LLString LLDirPicker::getDirName()
+std::string LLDirPicker::getDirName()
{
return "";
}