Renaming:

cygwin_path_fix		->	windows_style_tex_paths
	cygwin_path_fix_needed	->	tex_expects_windows_paths
	check_cygwin_path	->	check_windows_style_tex_paths
	use_cygwin_paths	->	use_windows_paths
	RC_CYGWIN_PATH_FIX	->	RC_TEX_EXPECTS_WINDOWS_PATHS

	* src/frontends/qt4/ui/QPrefCygwinPathUi.ui
	* src/frontends/qt3/ui/QPrefCygwinPathModule.ui
	  Updated checkbutton label and description

	* src/frontends/qt4/QPrefsDialog.C
	  (PrefCygwinPath): cygwin_path_fix -> windows_style_tex_paths
	  (QPrefsDialog): Enable checkbutton for native WIN32 builds

	* src/frontends/xforms/forms/form_preferences.fd
	  Updated label and name of checkbutton

	* src/frontends/xforms/FormPreferences.C
	  (apply): cygwin_path_fix -> windows_style_tex_paths
	           check_cygwin_path -> check_windows_style_tex_paths
	  (build): Enable checkbutton for native WIN32 builds
	  (update): Ditto
	  (feedback): Updated description

	* src/frontends/qt3/QPrefs.C
	* src/frontends/qt3/QPrefsDialog.C
	* src/frontends/qt3/QPrefsDialog.h
	  Renaming as above, enabled checkbutton for native WIN32 builds

	* src/support/os_unix.C
	* src/support/os.h
	* src/support/os_win32.C
	  Renaming cygwin_path_fix -> windows_style_tex_paths
	* src/support/os_cygwin.C
	  Ditto
	  (external_path, external_path_list): always return windows
	  style paths, not depending on the checkbutton status

	* src/lyxrc.C
	* src/lyxrc.h
	* src/lyxfunc.C
	* src/lyx_main.C
	  Renaming

	* lib/configure.py
	  Renaming, more meaningful diagnostics




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14242 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2006-06-27 10:51:24 +00:00
parent f6cf605786
commit 44a5cfc89c
18 changed files with 102 additions and 102 deletions

View File

@ -78,38 +78,38 @@ def createDirectories():
sys.exit(1)
def checkCygwinPath(srcdir):
''' Adjust PATH for Win32 (Cygwin) '''
cygwin_path_fix = ''
if os.name == 'nt':
cygwin_path_fix = 'true'
elif sys.platform == 'cygwin':
def checkTeXPaths():
''' Determine the path-style needed by the TeX engine on Win32 (Cygwin) '''
windows_style_tex_paths = ''
if os.name == 'nt' or sys.platform == 'cygwin':
from tempfile import mkstemp
fd, tmpfname = mkstemp(suffix='.ltx', dir='/tmp')
fd, tmpfname = mkstemp(suffix='.ltx')
# a wrapper file
wfd, wtmpfname = mkstemp(suffix='.ltx')
if os.name == 'nt':
inpname = tmpfname.replace('\\', '/')
wtmpfname = wtmpfname.replace('\\', '/')
else:
inpname = cmdOutput('cygpath -m ' + tmpfname)
wtmpfname = cmdOutput('cygpath -m ' + wtmpfname)
os.write(fd, r'''
\documentstyle{article}
\begin{document}\end{document}
''')
os.close(fd)
inpname = cmdOutput('cygpath -m ' + tmpfname)
# a wrapper file
wfd, wtmpfname = mkstemp(suffix='.ltx', dir='/tmp')
wtmpfname = cmdOutput('cygpath -m ' + wtmpfname)
os.write(wfd, r'\input{' + inpname + '}' )
os.write(wfd, r'\input{' + inpname.replace('~', '\\string~') + '}' )
os.close(wfd)
if cmdOutput('latex ' + wtmpfname).find('Error') != -1:
print "configure: cygwin detected; path correction is not needed"
cygwin_path_fix = 'false'
print "configure: TeX engine needs posix-style paths in latex files"
windows_style_tex_paths = 'false'
else:
print "configure: cygwin detected; path correction"
srcdir = cmdOutput('cygpath -m ' + srcdir)
print "srcdir = ", srcdir
cygwin_path_fix = 'true'
print "configure: TeX engine needs windows-style paths in latex files"
windows_style_tex_paths = 'true'
tmpbname,ext = os.path.splitext(os.path.basename(tmpfname))
wtmpbname,ext = os.path.splitext(os.path.basename(wtmpfname))
removeFiles( [ tmpfname, wtmpfname, tmpbname + '.log', \
tmpbname + '.aux', wtmpbname + '.log', wtmpbname + '.aux' ] )
return cygwin_path_fix
return windows_style_tex_paths
## Searching some useful programs
@ -700,7 +700,7 @@ Options:
sys.exit(1)
setEnviron()
createDirectories()
cygwin_path_fix = checkCygwinPath(srcdir)
windows_style_tex_paths = checkTeXPaths()
## Write the first part of outfile
writeToFile(outfile, '''# This file has been automatically generated by LyX' lib/configure.py
# script. It contains default settings that have been determined by
@ -716,9 +716,9 @@ Options:
(chk_linuxdoc, bool_linuxdoc, linuxdoc_cmd) = checkLinuxDoc()
(chk_docbook, bool_docbook, docbook_cmd) = checkDocBook()
checkTeXAllowSpaces()
if windows_style_tex_paths != '':
addToRC(r'\tex_expects_windows_paths %s' % windows_style_tex_paths)
checkOtherEntries()
if cygwin_path_fix != '':
addToRC(r'\cygwin_path_fix_needed %s' % cygwin_path_fix)
# --without-latex-config can disable lyx_check_config
checkLatexConfig( lyx_check_config and LATEX != '', bool_docbook, bool_linuxdoc)
createLaTeXConfig()

View File

@ -22,6 +22,7 @@ src/frontends/LyXView.C
src/frontends/controllers/ControlAboutlyx.C
src/frontends/controllers/ControlBibtex.C
src/frontends/controllers/ControlBox.C
src/frontends/controllers/ControlDocument.C
src/frontends/controllers/ControlExternal.C
src/frontends/controllers/ControlGraphics.C
src/frontends/controllers/ControlInclude.C
@ -122,6 +123,7 @@ src/frontends/qt4/Alert_pimpl.C
src/frontends/qt4/BulletsModule.C
src/frontends/qt4/Dialogs.C
src/frontends/qt4/FileDialog.C
src/frontends/qt4/GuiView.C
src/frontends/qt4/QAbout.C
src/frontends/qt4/QBibitem.C
src/frontends/qt4/QBibtex.C
@ -161,7 +163,6 @@ src/frontends/qt4/QURL.C
src/frontends/qt4/QVSpace.C
src/frontends/qt4/QWrap.C
src/frontends/qt4/Qt2BC.h
src/frontends/qt4/QtView.C
src/frontends/qt4/floatplacement.C
src/frontends/qt4/validators.C
src/frontends/xforms/Alert_pimpl.C
@ -273,6 +274,7 @@ src/rowpainter.C
src/support/filefilterlist.C
src/support/package.C.in
src/support/userinfo.C
src/tex-strings.C
src/text.C
src/text2.C
src/text3.C

View File

@ -23,7 +23,7 @@
#include "ui/QPrefLatexModule.h"
#include "ui/QPrefScreenFontsModule.h"
#include "ui/QPrefColorsModule.h"
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
#if defined(__CYGWIN__) || defined(_WIN32)
#include "ui/QPrefCygwinPathModule.h"
#endif
#include "ui/QPrefDisplayModule.h"
@ -204,9 +204,9 @@ void QPrefs::apply()
rc.date_insert_format = fromqstr(datemod->DateED->text());
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
#if defined(__CYGWIN__) || defined(_WIN32)
QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
rc.cygwin_path_fix = !cygwinmod->pathCB->isChecked();
rc.windows_style_tex_paths = cygwinmod->pathCB->isChecked();
#endif
QPrefLatexModule * latexmod(dialog_->latexModule);
@ -548,9 +548,9 @@ void QPrefs::update_contents()
datemod->DateED->setText(toqstr(rc.date_insert_format));
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
#if defined(__CYGWIN__) || defined(_WIN32)
QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
cygwinmod->pathCB->setChecked(!rc.cygwin_path_fix);
cygwinmod->pathCB->setChecked(rc.windows_style_tex_paths);
#endif
QPrefLatexModule * latexmod(dialog_->latexModule);

View File

@ -27,7 +27,7 @@
#include "ui/QPrefLatexModule.h"
#include "ui/QPrefScreenFontsModule.h"
#include "ui/QPrefColorsModule.h"
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
#if defined(__CYGWIN__) || defined(_WIN32)
#include "ui/QPrefCygwinPathModule.h"
#endif
#include "ui/QPrefDisplayModule.h"
@ -79,7 +79,7 @@ QPrefsDialog::QPrefsDialog(QPrefs * form)
latexModule = new QPrefLatexModule(this);
screenfontsModule = new QPrefScreenFontsModule(this);
colorsModule = new QPrefColorsModule(this);
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
#if defined(__CYGWIN__) || defined(_WIN32)
cygwinpathModule = new QPrefCygwinPathModule(this);
#endif
displayModule = new QPrefDisplayModule(this);
@ -111,7 +111,7 @@ QPrefsDialog::QPrefsDialog(QPrefs * form)
prefsPS->addPanel(asciiModule, _("Plain text"), op);
prefsPS->addPanel(dateModule, _("Date format"), op);
prefsPS->addPanel(latexModule, _("LaTeX"), op);
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
#if defined(__CYGWIN__) || defined(_WIN32)
prefsPS->addPanel(cygwinpathModule, _("Paths"), op);
#endif
prefsPS->addPanel(printerModule, _("Printer"), op);
@ -243,7 +243,7 @@ QPrefsDialog::QPrefsDialog(QPrefs * form)
connect(asciiModule->asciiLinelengthSB, SIGNAL(valueChanged(int)), this, SLOT(change_adaptor()));
connect(asciiModule->asciiRoffED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(dateModule->DateED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
#if defined(__CYGWIN__) || defined(_WIN32)
connect(cygwinpathModule->pathCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
#endif
connect(latexModule->latexEncodingED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));

View File

@ -110,7 +110,7 @@ private:
QPrefLatexModule * latexModule;
QPrefScreenFontsModule * screenfontsModule;
QPrefColorsModule * colorsModule;
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
#if defined(__CYGWIN__) || defined(_WIN32)
QPrefCygwinPathModule * cygwinpathModule;
#endif
QPrefDisplayModule * displayModule;

View File

@ -31,13 +31,13 @@
</rect>
</property>
<property name="text">
<string>&amp;Use Cygwin-style paths</string>
<string>&amp;Use Windows-style paths in LaTeX files</string>
</property>
<property name="toolTip" stdset="0">
<string></string>
</property>
<property name="whatsThis" stdset="0">
<string>Select if LyX should output Cygwin-style paths rather than Windows-style paths. Useful if you're using the Cygwin teTeX rather than a native Windows MikTeX. Note, however, that you'll need to write shell script wrappers for all your converters.</string>
<string>Select if LyX should output Windows-style paths rather than Posix-style paths to LaTeX files. Useful if you're using the native Windows MikTeX rather than the Cygwin teTeX.</string>
</property>
</widget>
<spacer>

View File

@ -576,13 +576,13 @@ PrefCygwinPath::PrefCygwinPath(QWidget * parent)
void PrefCygwinPath::apply(LyXRC & rc) const
{
rc.cygwin_path_fix = pathCB->isChecked();
rc.windows_style_tex_paths = pathCB->isChecked();
}
void PrefCygwinPath::update(LyXRC const & rc)
{
pathCB->setChecked(rc.cygwin_path_fix);
pathCB->setChecked(rc.windows_style_tex_paths);
}
@ -1801,7 +1801,7 @@ QPrefsDialog::QPrefsDialog(QPrefs * form)
add(new PrefScreenFonts(form_));
add(new PrefColors(form_));
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
#if defined(__CYGWIN__) || defined(_WIN32)
add(new PrefCygwinPath);
#endif

View File

@ -31,10 +31,10 @@
<string/>
</property>
<property name="whatsThis" >
<string>Select if LyX should output Cygwin-style paths rather than Windows-style paths. Useful if you're using the Cygwin teTeX rather than a native Windows MikTeX. Note, however, that you'll need to write shell script wrappers for all your converters.</string>
<string>Select if LyX should output Windows-style paths rather than Posix-style paths to LaTeX files. Useful if you're using the native Windows MikTeX rather than the Cygwin teTeX.</string>
</property>
<property name="text" >
<string>&amp;Use Cygwin-style paths</string>
<string>&amp;Use Windows-style paths in LaTeX files</string>
</property>
</widget>
</widget>

View File

@ -2085,8 +2085,9 @@ void FormPreferences::OutputsMisc::apply(LyXRC & rc) const
rc.view_dvi_paper_option = getString(dialog_->input_paperoption);
rc.auto_reset_options = fl_get_button(dialog_->check_autoreset_classopt);
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
rc.cygwin_path_fix = fl_get_button(dialog_->check_cygwin_path);
#if defined(__CYGWIN__) || defined(_WIN32)
rc.windows_style_tex_paths =
fl_get_button(dialog_->check_windows_style_tex_paths);
#endif
}
@ -2105,9 +2106,9 @@ void FormPreferences::OutputsMisc::build()
fl_set_input_return(dialog_->input_index, FL_RETURN_CHANGED);
fl_set_input_return(dialog_->input_paperoption, FL_RETURN_CHANGED);
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
#if defined(__CYGWIN__) || defined(_WIN32)
#else
setEnabled(dialog_->check_cygwin_path, false);
setEnabled(dialog_->check_windows_style_tex_paths, false);
#endif
fl_addto_choice(dialog_->choice_default_papersize,
@ -2124,8 +2125,8 @@ void FormPreferences::OutputsMisc::build()
setPrehandler(dialog_->input_index);
setPrehandler(dialog_->input_paperoption);
setPrehandler(dialog_->check_autoreset_classopt);
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
setPrehandler(dialog_->check_cygwin_path);
#if defined(__CYGWIN__) || defined(_WIN32)
setPrehandler(dialog_->check_windows_style_tex_paths);
#endif
}
@ -2151,13 +2152,12 @@ FormPreferences::OutputsMisc::feedback(FL_OBJECT const * const ob) const
return LyXRC::getDescription(LyXRC::RC_VIEWDVI_PAPEROPTION);
if (ob == dialog_->check_autoreset_classopt)
return LyXRC::getDescription(LyXRC::RC_AUTORESET_OPTIONS);
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
if (ob == dialog_->check_cygwin_path)
return _("Select if LyX should output Cygwin-style paths "
"rather than Windows-style paths. Useful if you're "
"using the Cygwin teTeX rather than a native Windows "
"MikTeX. Note, however, that you'll need to write "
"shell script wrappers for all your converters.");
#if defined(__CYGWIN__) || defined(_WIN32)
if (ob == dialog_->check_windows_style_tex_paths)
return _("Select if LyX should output Windows-style paths "
"rather than Posix-style paths to LaTeX files. "
"Useful if you're using the native Windows MikTeX "
"rather than the Cygwin teTeX.");
#endif
return string();
}
@ -2183,8 +2183,9 @@ void FormPreferences::OutputsMisc::update(LyXRC const & rc)
rc.view_dvi_paper_option.c_str());
fl_set_button(dialog_->check_autoreset_classopt,
rc.auto_reset_options);
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
fl_set_button(dialog_->check_cygwin_path, rc.cygwin_path_fix);
#if defined(__CYGWIN__) || defined(_WIN32)
fl_set_button(dialog_->check_windows_style_tex_paths,
rc.windows_style_tex_paths);
#endif
}

View File

@ -3149,11 +3149,11 @@ alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
label: Use Cygwin Paths|#s
label: Use Windows Paths for LaTeX|#s
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: check_cygwin_path
name: check_windows_style_tex_paths
callback: C_FormDialogView_InputCB
argument: 0

View File

@ -545,7 +545,7 @@ void LyX::init()
if (lyxerr.debugging(Debug::LYXRC))
lyxrc.print();
os::cygwin_path_fix(lyxrc.cygwin_path_fix);
os::windows_style_tex_paths(lyxrc.windows_style_tex_paths);
if (!lyxrc.path_prefix.empty())
prependEnvPath("PATH", lyxrc.path_prefix);

View File

@ -1990,11 +1990,6 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
case LyXRC::RC_CUSTOM_EXPORT_COMMAND:
case LyXRC::RC_CUSTOM_EXPORT_FORMAT:
case LyXRC::RC_CYGWIN_PATH_FIX:
if (lyxrc_orig.cygwin_path_fix != lyxrc_new.cygwin_path_fix) {
namespace os = lyx::support::os;
os::cygwin_path_fix(lyxrc_new.cygwin_path_fix);
}
case LyXRC::RC_DATE_INSERT_FORMAT:
case LyXRC::RC_DEFAULT_LANGUAGE:
case LyXRC::RC_DEFAULT_PAPERSIZE:
@ -2080,6 +2075,11 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
case LyXRC::RC_TEMPDIRPATH:
case LyXRC::RC_TEMPLATEPATH:
case LyXRC::RC_TEX_ALLOWS_SPACES:
case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
namespace os = lyx::support::os;
os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
}
case LyXRC::RC_UIFILE:
case LyXRC::RC_USER_EMAIL:
case LyXRC::RC_USER_NAME:

View File

@ -81,7 +81,6 @@ keyword_item lyxrcTags[] = {
{ "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
{ "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
{ "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
{ "\\cygwin_path_fix_needed", LyXRC::RC_CYGWIN_PATH_FIX },
{ "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
{ "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
{ "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
@ -163,6 +162,7 @@ keyword_item lyxrcTags[] = {
{ "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
{ "\\template_path", LyXRC::RC_TEMPLATEPATH },
{ "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
{ "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
{ "\\ui_file", LyXRC::RC_UIFILE },
{ "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
{ "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
@ -280,7 +280,7 @@ void LyXRC::setDefaults() {
language_command_local = "\\foreignlanguage{$$lang}{";
default_language = "english";
show_banner = true;
cygwin_path_fix = false;
windows_style_tex_paths = false;
tex_allows_spaces = false;
date_insert_format = "%A, %e %B %Y";
cursor_follows_scrollbar = false;
@ -398,9 +398,9 @@ int LyXRC::read(LyXLex & lexrc)
}
break;
case RC_CYGWIN_PATH_FIX:
case RC_TEX_EXPECTS_WINDOWS_PATHS:
if (lexrc.next()) {
cygwin_path_fix = lexrc.getBool();
windows_style_tex_paths = lexrc.getBool();
}
break;
@ -1374,11 +1374,11 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc) const
index_command != system_lyxrc.index_command) {
os << "\\index_command \"" << index_command << "\"\n";
}
case RC_CYGWIN_PATH_FIX:
case RC_TEX_EXPECTS_WINDOWS_PATHS:
if (ignore_system_lyxrc ||
cygwin_path_fix != system_lyxrc.cygwin_path_fix) {
os << "\\cygwin_path_fix_needed "
<< convert<string>(cygwin_path_fix) << '\n';
windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
os << "\\tex_expects_windows_paths "
<< convert<string>(windows_style_tex_paths) << '\n';
}
case RC_TEX_ALLOWS_SPACES:
if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
@ -2203,9 +2203,6 @@ string const LyXRC::getDescription(LyXRCTags tag)
case RC_CUSTOM_EXPORT_FORMAT:
break;
case RC_CYGWIN_PATH_FIX:
break;
case RC_DATE_INSERT_FORMAT:
//xgettext:no-c-format
str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
@ -2490,6 +2487,9 @@ string const LyXRC::getDescription(LyXRCTags tag)
case RC_TEX_ALLOWS_SPACES:
break;
case RC_TEX_EXPECTS_WINDOWS_PATHS:
break;
case RC_UIFILE:
str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
break;

View File

@ -51,7 +51,6 @@ public:
RC_CURSOR_FOLLOWS_SCROLLBAR,
RC_CUSTOM_EXPORT_COMMAND,
RC_CUSTOM_EXPORT_FORMAT,
RC_CYGWIN_PATH_FIX,
RC_DATE_INSERT_FORMAT,
RC_DEFAULT_LANGUAGE,
RC_DEFAULT_PAPERSIZE,
@ -128,6 +127,7 @@ public:
RC_TEMPDIRPATH,
RC_TEMPLATEPATH,
RC_TEX_ALLOWS_SPACES,
RC_TEX_EXPECTS_WINDOWS_PATHS,
RC_UIFILE,
RC_USER_EMAIL,
RC_USER_NAME,
@ -389,8 +389,8 @@ public:
std::string user_name;
/// user email
std::string user_email;
///
bool cygwin_path_fix;
/// True if the TeX engine cannot handle posix paths
bool windows_style_tex_paths;
/// True if the TeX engine can handle file names containing spaces
bool tex_allows_spaces;
/** Prepend paths to the PATH environment variable.

View File

@ -74,11 +74,11 @@ char const * popen_read_mode();
*/
char path_separator();
/** If @c use_cygwin_paths is true, LyX will output cygwin style paths
* rather than native Win32 ones. Obviously, this option is used only
* under Cygwin.
/** If @c use_windows_paths is true, LyX will output Windows-style paths to
* latex files rather than posix ones. Obviously, this option is used only
* under Windows.
*/
void cygwin_path_fix(bool use_cygwin_paths);
void windows_style_tex_paths(bool use_windows_paths);
enum auto_open_mode {
VIEW,

View File

@ -39,7 +39,7 @@ namespace os {
namespace {
bool cygwin_path_fix_ = false;
bool windows_style_tex_paths_ = false;
// In both is_posix_path() and is_windows_path() it is assumed that
// a valid posix or pseudo-windows path is passed. They simply tell
@ -186,8 +186,7 @@ string::size_type common_path(string const & p1, string const & p2)
string external_path(string const & p)
{
return convert_path(p, cygwin_path_fix_ ? PathStyle(windows)
: PathStyle(posix));
return convert_path(p, PathStyle(windows));
}
@ -199,8 +198,7 @@ string internal_path(string const & p)
string external_path_list(string const & p)
{
return convert_path_list(p, cygwin_path_fix_ ? PathStyle(windows)
: PathStyle(posix));
return convert_path_list(p, PathStyle(windows));
}
@ -213,13 +211,13 @@ string internal_path_list(string const & p)
string latex_path(string const & p)
{
// We may need a posix style path or a windows style path (depending
// on cygwin_path_fix_), but we use always forward slashes, since it
// gets written into a .tex file.
// on windows_style_tex_paths_), but we use always forward slashes,
// since it gets written into a .tex file.
if (cygwin_path_fix_ && is_absolute_path(p)) {
if (windows_style_tex_paths_ && is_absolute_path(p)) {
string dos_path = convert_path(p, PathStyle(windows));
lyxerr[Debug::LATEX]
<< "<Cygwin path correction> ["
<< "<Path correction for LaTeX> ["
<< p << "]->>["
<< dos_path << ']' << endl;
return dos_path;
@ -268,9 +266,9 @@ char path_separator()
}
void cygwin_path_fix(bool use_cygwin_paths)
void windows_style_tex_paths(bool use_windows_paths)
{
cygwin_path_fix_ = use_cygwin_paths;
windows_style_tex_paths_ = use_windows_paths;
}
@ -295,8 +293,7 @@ bool autoOpenFile(string const & filename, auto_open_mode const mode)
{
// reference: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc
// /platform/shell/reference/functions/shellexecute.asp
string const win_path =
os::convert_path(filename, os::PathStyle(os::windows));
string const win_path = convert_path(filename, PathStyle(windows));
char const * action = (mode == VIEW) ? "open" : "edit";
return reinterpret_cast<int>(ShellExecute(NULL, action,
win_path.c_str(), NULL, NULL, 1)) > 32;

View File

@ -116,7 +116,7 @@ char path_separator()
}
void cygwin_path_fix(bool)
void windows_style_tex_paths(bool)
{}
bool canAutoOpenFile(string const & ext, auto_open_mode const mode)

View File

@ -76,7 +76,7 @@ namespace os {
namespace {
bool cygwin_path_fix_ = false;
bool windows_style_tex_paths_ = true;
string cygdrive = "/cygdrive";
@ -260,15 +260,15 @@ string internal_path_list(string const & p)
string latex_path(string const & p)
{
// We may need a posix style path or a windows style path (depending
// on cygwin_path_fix_), but we use always forward slashes, since it
// gets written into a .tex file.
// on windows_style_tex_paths_), but we use always forward slashes,
// since it gets written into a .tex file.
if (cygwin_path_fix_ && is_absolute_path(p)) {
if (!windows_style_tex_paths_ && is_absolute_path(p)) {
string const drive = p.substr(0, 2);
string const cygprefix = cygdrive + "/" + drive.substr(0, 1);
string const cygpath = subst(subst(p, '\\', '/'), drive, cygprefix);
lyxerr[Debug::LATEX]
<< "<Cygwin path correction> ["
<< "<Path correction for LaTeX> ["
<< p << "]->>["
<< cygpath << ']' << endl;
return cygpath;
@ -322,9 +322,9 @@ char path_separator()
}
void cygwin_path_fix(bool use_cygwin_paths)
void windows_style_tex_paths(bool use_windows_paths)
{
cygwin_path_fix_ = !use_cygwin_paths;
windows_style_tex_paths_ = use_windows_paths;
}