aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lldirpicker.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:11 -0500
committerJacek Antonelli2008-08-15 23:45:11 -0500
commit215f423cbe18fe9ca14a26caef918d303bad28ff (patch)
tree0743442b286216cc8e19aa487c26f4e9345ffd64 /linden/indra/newview/lldirpicker.cpp
parentSecond Life viewer sources 1.18.3.5-RC (diff)
downloadmeta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.zip
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.gz
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.bz2
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.xz
Second Life viewer sources 1.18.4.0-RC
Diffstat (limited to 'linden/indra/newview/lldirpicker.cpp')
-rw-r--r--linden/indra/newview/lldirpicker.cpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/linden/indra/newview/lldirpicker.cpp b/linden/indra/newview/lldirpicker.cpp
index fba3782..a63c687 100644
--- a/linden/indra/newview/lldirpicker.cpp
+++ b/linden/indra/newview/lldirpicker.cpp
@@ -2,6 +2,8 @@
2 * @file lldirpicker.cpp 2 * @file lldirpicker.cpp
3 * @brief OS-specific file picker 3 * @brief OS-specific file picker
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 7 * Copyright (c) 2001-2007, Linden Research, Inc.
6 * 8 *
7 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
@@ -24,6 +26,7 @@
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE. 28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
27 */ 30 */
28 31
29#include "llviewerprecompiledheaders.h" 32#include "llviewerprecompiledheaders.h"
@@ -37,6 +40,10 @@
37#include "lldir.h" 40#include "lldir.h"
38#include "llframetimer.h" 41#include "llframetimer.h"
39 42
43#if LL_LINUX
44# include "llfilepicker.h"
45#endif
46
40// 47//
41// Globals 48// Globals
42// 49//
@@ -257,6 +264,56 @@ void LLDirPicker::reset()
257 mDir = NULL; 264 mDir = NULL;
258} 265}
259 266
267#elif LL_LINUX
268
269LLDirPicker::LLDirPicker()
270{
271 mFilePicker = new LLFilePicker();
272 reset();
273}
274
275LLDirPicker::~LLDirPicker()
276{
277 delete mFilePicker;
278}
279
280
281void LLDirPicker::reset()
282{
283 if (mFilePicker)
284 mFilePicker->reset();
285}
286
287BOOL LLDirPicker::getDir(LLString* filename)
288{
289 reset();
290 if (mFilePicker)
291 {
292 GtkWindow* picker = mFilePicker->buildFilePicker(false, true,
293 "dirpicker");
294
295 if (picker)
296 {
297 gtk_window_set_title(GTK_WINDOW(picker), "Choose Directory");
298 gtk_widget_show_all(GTK_WIDGET(picker));
299 gtk_main();
300 return (NULL != mFilePicker->getFirstFile());
301 }
302 }
303 return FALSE;
304}
305
306LLString LLDirPicker::getDirName()
307{
308 if (mFilePicker)
309 {
310 const char* name = mFilePicker->getFirstFile();
311 if (name)
312 return name;
313 }
314 return "";
315}
316
260#else // not implemented 317#else // not implemented
261 318
262LLDirPicker::LLDirPicker() 319LLDirPicker::LLDirPicker()