Files
SingularityViewer/indra/plugins/filepicker/legacy.cpp
Aleric Inglewood 5f72cbb103 Add support for flushing messages from plugin to viewer.
Actually flush messages before terminating a plugin (upon
the shutdown message) and flush messages in the file- and
dirpicker before opening the blocking dialog. Flush debug
messages too (deeper into the code, just prior to the actual
blocking call).

Also, fix the context folder map to be a thread-safe
singleton and *attempt* to add support for default folders
to windows and Mac. The latter might even not compile yet
and definitely have to be tested (and fixed):
Opening a DirPicker in preferences --> Network and Set
the directory location of the cache. It should open a
Dialog window where you are already in the folder that
is the current cache directory setting (you can click
Cancel after verifying that this worked).
And, start to upload an image, select a file is some
directory (other than what it starts in). You can omit
the actual upload by clicking cancel in the preview.
Then upload again and now it should start in the same
folder as that you were just in. Possibly you need to
first open a file picker elsewhere with a different context
though, or windows might choose to open in the last
folder anyway while the code doesn't really work. Uploading
a sound before the second texture upload should do the
trick.
2011-05-12 18:22:51 +02:00

113 lines
3.2 KiB
C++

/**
* @file legacy.cpp
* @brief Helper stubs to keep the picker files as much as possible equal to their original.
*
* Copyright (c) 2011, Aleric Inglewood.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* 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.
*
* CHANGELOG
* and additional copyright holders.
*
* 11/05/2011
* - Initial version, written by Aleric Inglewood @ SL
*/
#include "basic_plugin_base.h" // For PLS_INFOS etc.
#include "legacy.h"
// Translation map.
translation_map_type translation_map;
namespace translation
{
std::string getString(char const* key)
{
translation_map_type::iterator iter = translation_map.find(key);
return (iter != translation_map.end()) ? iter->second : key;
}
void add(std::string const& key, std::string const& translation)
{
PLS_DEBUGS << "Adding translation \"" << key << "\" --> \"" << translation << "\"" << PLS_ENDL;
translation_map[key] = translation;
}
}
#if LL_GTK
namespace LLWindowSDL {
bool ll_try_gtk_init(void)
{
static BOOL done_gtk_diag = FALSE;
static BOOL gtk_is_good = FALSE;
static BOOL done_setlocale = FALSE;
static BOOL tried_gtk_init = FALSE;
if (!done_setlocale)
{
PLS_INFOS << "Starting GTK Initialization." << PLS_ENDL;
//maybe_lock_display();
gtk_disable_setlocale();
//maybe_unlock_display();
done_setlocale = TRUE;
}
if (!tried_gtk_init)
{
tried_gtk_init = TRUE;
if (!g_thread_supported ()) g_thread_init (NULL);
//maybe_lock_display();
gtk_is_good = gtk_init_check(NULL, NULL);
//maybe_unlock_display();
if (!gtk_is_good)
PLS_WARNS << "GTK Initialization failed." << PLS_ENDL;
}
if (gtk_is_good && !done_gtk_diag)
{
PLS_INFOS << "GTK Initialized." << PLS_ENDL;
PLS_INFOS << "- Compiled against GTK version "
<< GTK_MAJOR_VERSION << "."
<< GTK_MINOR_VERSION << "."
<< GTK_MICRO_VERSION << PLS_ENDL;
PLS_INFOS << "- Running against GTK version "
<< gtk_major_version << "."
<< gtk_minor_version << "."
<< gtk_micro_version << PLS_ENDL;
//maybe_lock_display();
const gchar* gtk_warning = gtk_check_version(
GTK_MAJOR_VERSION,
GTK_MINOR_VERSION,
GTK_MICRO_VERSION);
//maybe_unlock_display();
if (gtk_warning)
{
PLS_WARNS << "- GTK COMPATIBILITY WARNING: " << gtk_warning << PLS_ENDL;
gtk_is_good = FALSE;
}
else
{
PLS_INFOS << "- GTK version is good." << PLS_ENDL;
}
done_gtk_diag = TRUE;
}
return gtk_is_good;
}
}
#endif