Sync with Alchemy to go from keys.ini to keys.xml

This commit is contained in:
Inusaito Sayori
2015-07-22 01:53:42 -04:00
parent 4c0038a8ec
commit 1a6e99a9e3
7 changed files with 915 additions and 816 deletions

View File

@@ -592,13 +592,32 @@ public:
void load_default_bindings(bool zqsd)
{
gViewerKeyboard.unloadBindings();
const std::string keys(zqsd ? "keysZQSD.ini" : "keys.ini");
if (!gViewerKeyboard.loadBindings(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, keys)))
const std::string key_bindings_file(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, zqsd ? "keysZQSD.xml" : "keys.xml"));
if (!gDirUtilp->fileExists(key_bindings_file) || !gViewerKeyboard.loadBindingsXML(key_bindings_file))
{
LL_ERRS("InitInfo") << "Unable to open " << keys << LL_ENDL;
const std::string key_bindings_file(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, zqsd ? "keysZQSD.ini" : "keys.ini"));
if (!gViewerKeyboard.loadBindings(key_bindings_file))
{
LL_ERRS("InitInfo") << "Unable to open " << key_bindings_file << LL_ENDL;
}
}
// Load Custom bindings (override defaults)
gViewerKeyboard.loadBindings(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"custom_keys.ini"));
std::string custom_keys(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "custom_keys.xml"));
if (!gDirUtilp->fileExists(custom_keys) || !gViewerKeyboard.loadBindingsXML(custom_keys))
{
custom_keys = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "custom_keys.ini");
if (gDirUtilp->fileExists(custom_keys))
gViewerKeyboard.loadBindings(custom_keys);
}
}
namespace {
// With Xcode 6, _exit() is too magical to use with boost::bind(), so provide
// this little helper function.
void fast_exit(int rc)
{
_exit(rc);
}
}
bool LLAppViewer::init()
@@ -645,7 +664,6 @@ bool LLAppViewer::init()
//
// OK to write stuff to logs now, we've now crash reported if necessary
//
init_default_trans_args();
if (!initConfiguration())