Commit 8c4d7bce authored by whitlocb's avatar whitlocb

Move translations into resources directory.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@18019 18c085ea-50e0-402c-830e-de6fd14e8384
parent 5a295f90
......@@ -69,7 +69,7 @@
# Copy necessary bin files & directories to the build dir.
#----------------------------------------------------------------------------
SET(VISIT_BIN_DIRECTORIES movietemplates shaders translations)
SET(VISIT_BIN_DIRECTORIES movietemplates shaders)
SET(VISIT_BIN_FILES
Doxyfile
......@@ -178,7 +178,7 @@ ELSE (NOT WIN32)
ENDIF(NOT WIN32)
INSTALL(DIRECTORY movietemplates translations
INSTALL(DIRECTORY movietemplates
DESTINATION ${VISIT_INSTALLED_VERSION_BIN}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
......
......@@ -424,7 +424,7 @@ GetSystemVisItHostsDirectory()
}
// ****************************************************************************
// Method: GetSystemVisItResourcesDirectory
// Method: GetVisItResourcesDirectory
//
// Purpose:
// Get the installation directory's resources subdirectory.
......@@ -439,47 +439,27 @@ GetSystemVisItHostsDirectory()
// Creation: Fri Apr 27 17:31:12 PDT 2012
//
// Modifications:
// Brad Whitlock, Mon Apr 30 11:27:32 PDT 2012
// Base the directory name off of the architecture directory so it can be
// peer to bin and lib.
//
//
// ****************************************************************************
std::string
GetSystemVisItResourcesDirectory()
GetVisItResourcesDirectory(VisItResourceDirectoryType t)
{
std::string retval(GetVisItArchitectureDirectory());
retval += VISIT_SLASH_STRING;
retval += "resources";
return retval;
}
// ****************************************************************************
// Method: GetSystemVisItColorTableDirectory
//
// Purpose:
// Get the installation directory's resources subdirectory.
//
// Arguments:
//
// Returns:
//
// Note:
//
// Programmer: Brad Whitlock
// Creation: Fri Apr 27 17:31:12 PDT 2012
//
// Modifications:
//
// ****************************************************************************
if(t != VISIT_RESOURCES)
{
retval += VISIT_SLASH_STRING;
if(t == VISIT_RESOURCES_COLORTABLES)
retval += "colortables";
else if(t == VISIT_RESOURCES_TRANSLATIONS)
retval += "translations";
else if(t == VISIT_RESOURCES_MOVIETEMPLATES)
retval += "movietemplates";
}
std::string
GetSystemVisItColorTableDirectory()
{
std::string retval(GetSystemVisItResourcesDirectory());
retval += VISIT_SLASH_STRING;
retval += "colortables";
return retval;
}
......
......@@ -66,8 +66,14 @@ std::string MISC_API GetSystemVisItRCFile();
std::string MISC_API GetAndMakeUserVisItHostsDirectory();
std::string MISC_API GetSystemVisItHostsDirectory();
std::string MISC_API GetSystemVisItResourcesDirectory();
std::string MISC_API GetSystemVisItColorTableDirectory();
typedef enum {
VISIT_RESOURCES,
VISIT_RESOURCES_COLORTABLES,
VISIT_RESOURCES_TRANSLATIONS,
VISIT_RESOURCES_MOVIETEMPLATES
} VisItResourceDirectoryType;
std::string MISC_API GetVisItResourcesDirectory(VisItResourceDirectoryType t);
int MISC_API ConfigStateGetRunCount(ConfigStateEnum &code);
void MISC_API ConfigStateIncrementRunCount(ConfigStateEnum &code);
......
......@@ -156,7 +156,8 @@ ColorTableManager::ImportColorTables(ColorTableAttributes *cta)
// Read the user's home VisIt directory and import all of the color tables.
//
ctAtts = cta;
bool r1 = ReadAndProcessDirectory(GetSystemVisItColorTableDirectory(), ImportHelper,
std::string ctdir(GetVisItResourcesDirectory(VISIT_RESOURCES_COLORTABLES));
bool r1 = ReadAndProcessDirectory(ctdir, ImportHelper,
(void*)this, false);
bool r2 = ReadAndProcessDirectory(GetUserVisItDirectory(), ImportHelper,
(void*)this, false);
......
......@@ -616,6 +616,9 @@ GUI_LogQtMessages(QtMsgType type, const char *msg)
// Brad Whitlock, Fri Aug 6 16:54:29 PDT 2010
// Added Selections to windowNames.
//
// Brad Whitlock, Tue May 1 10:06:12 PDT 2012
// Call GetVisItResourcesDirectory to get the translations directory.
//
// ****************************************************************************
QvisGUIApplication::QvisGUIApplication(int &argc, char **argv) :
......@@ -762,13 +765,7 @@ QvisGUIApplication::QvisGUIApplication(int &argc, char **argv) :
// Make VisIt translation aware.
QTranslator *translator = new QTranslator(0);
#if defined(_WIN32)
QString transPath(GetVisItArchitectureDirectory().c_str());
transPath += "\\translations\\";
#else
QString transPath(GetVisItArchitectureDirectory().c_str());
transPath += "/bin/translations/";
#endif
QString transPath(GetVisItResourcesDirectory(VISIT_RESOURCES_TRANSLATIONS).c_str());
if(applicationLocale == "default")
applicationLocale = QLocale::system().name();
QString transFile(QString("visit_") + applicationLocale);
......
......@@ -44,5 +44,18 @@
#
#*****************************************************************************
ADD_SUBDIRECTORY(colortables)
# Treat "hosts" specially.
ADD_SUBDIRECTORY(hosts)
# Install these directories in their entirety to the installed "resources"
# directory.
INSTALL(DIRECTORY colortables translations
DESTINATION ${VISIT_INSTALLED_VERSION_RESOURCES}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
WORLD_READ
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
PATTERN ".svn" EXCLUDE
)
#*****************************************************************************
#
# Copyright (c) 2000 - 2012, Lawrence Livermore National Security, LLC
# Produced at the Lawrence Livermore National Laboratory
# LLNL-CODE-442911
# All rights reserved.
#
# This file is part of VisIt. For details, see https://visit.llnl.gov/. The
# full copyright notice is contained in the file COPYRIGHT located at the root
# of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the disclaimer below.
# - Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the disclaimer (as noted below) in the
# documentation and/or other materials provided with the distribution.
# - Neither the name of the LLNS/LLNL nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
# LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
# DAMAGE.
#
#
#
# Modifications:
#
#*****************************************************************************
## find all color table files to install using a glob
FILE(GLOB CT_FILES1 "${CMAKE_CURRENT_SOURCE_DIR}/*.ct")
SET(CT_FILES ${CT_FILES1} "${CMAKE_CURRENT_SOURCE_DIR}/License_BrewerColortables.txt")
# Install the color table files
INSTALL(FILES ${CT_FILES}
DESTINATION ${VISIT_INSTALLED_VERSION_RESOURCES}/colortables
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ
)
......@@ -472,6 +472,9 @@ ViewerSubject::Connect(int *argc, char ***argv)
// Brad Whitlock, Thu Apr 22 16:53:34 PST 2010
// Use a signal to schedule HeavyInitialization.
//
// Brad Whitlock, Tue May 1 10:06:12 PDT 2012
// Call GetVisItResourcesDirectory to get the translations directory.
//
// ****************************************************************************
void
......@@ -481,13 +484,7 @@ ViewerSubject::Initialize()
// Make VisIt translation aware.
QTranslator *translator = new QTranslator(0);
#if defined(_WIN32)
QString transPath(GetVisItArchitectureDirectory().c_str());
transPath += "\\translations\\";
#else
QString transPath(GetVisItArchitectureDirectory().c_str());
transPath += "/bin/translations/";
#endif
QString transPath(GetVisItResourcesDirectory(VISIT_RESOURCES_TRANSLATIONS).c_str());
QString applicationLocale(GetViewerProperties()->GetApplicationLocale().c_str());
if(applicationLocale == "default")
applicationLocale = QLocale::system().name();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment