+2005-01-02 Kayvan A. Sylvan <kayvan@sylvan.com>
+
+ * configure.m4: add \cygwin_path_fix_needed to lyrxc.defaults.
+
2005-01-12 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* reLyX/configure.ac: make sure the prefix is correctly quoted.
fi
#### Adjust PATH for Win32 (Cygwin)
+use_cygwin_path_fix=''
case `uname -s` in
CYGWIN*)
tmpfname="/tmp/x$$.ltx";
echo "configure: cygwin detected; path correction"
srcdir=`cygpath -w "${srcdir}" | tr '\\\\' /`
echo "srcdir=${srcdir}"
+ use_cygwin_path_fix='true'
else
echo "configure: cygwin detected; path correction is not needed"
+ use_cygwin_path_fix='false'
fi
;;
esac
\\font_encoding "$chk_fontenc"
EOF
+if [ "x$use_cygwin_path_fix" != "x" ]
+then
+ echo "\\cygwin_path_fix_needed $use_cygwin_path_fix" >> $outfile
+fi
+
######## X FONTS
# create a fonts.dir file to make X fonts available to LyX
echo "checking for TeX fonts"
+2005-01-13 Angus Leeming <leeming@lyx.org>
+
+ * lyxrc.C (read): use LyXRC::cygwin_path_fix to set the value of
+ os::cygwin_path_fix.
+ (write): output LyXRC::cygwin_path_fix as necessary.
+
+2005-01-02 Kayvan Sylvan <kayvan@sylvan.com>
+
+ * lyxrc.h:
+ * lyxrc.C (read): Added RC_CYGWIN_PATH_FIX, cygwin_path_fix.
+
2005-01-12 Angus Leeming <leeming@lyx.org>
* lyx_main.C (init): set the PATH variable to include the
+2005-01-13 Angus Leeming <leeming@lyx.org>
+
+ * Makefile.dialogs: add QPrefCygwinPathModule.ui.
+
+ * ui/QPrefCygwinPathModule.ui: new file. Defines a pane containing
+ only a check box "Use Cygwin paths".
+
+ * QPrefs.C (apply, update_contents): code to get/set the value
+ of the Cygwin check box. Compiled only under Cygwin.
+
+ * QPrefsDialog.[Ch]: code to add teh Cygwin paths module to the
+ dialog.
+
2005-01-10 Angus Leeming <leeming@lyx.org>
* lyx_gui.C: use support/package.h to provide the paths to the
QPrefColorsModule.ui \
QPrefConvertersModule.ui \
QPrefCopiersModule.ui \
+ QPrefCygwinPathModule.ui \
QPrefDateModule.ui \
QPrefDisplayModule.ui \
QPrefFileformatsModule.ui \
#include "ui/QPrefLatexModule.h"
#include "ui/QPrefScreenFontsModule.h"
#include "ui/QPrefColorsModule.h"
+#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+#include "ui/QPrefCygwinPathModule.h"
+#endif
#include "ui/QPrefDisplayModule.h"
#include "ui/QPrefPathsModule.h"
#include "ui/QPrefSpellcheckerModule.h"
rc.date_insert_format = fromqstr(datemod->DateED->text());
+#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+ QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
+ rc.cygwin_path_fix = cygwinmod->pathCB->isChecked();
+#endif
QPrefLatexModule * latexmod(dialog_->latexModule);
datemod->DateED->setText(toqstr(rc.date_insert_format));
+#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+ QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
+ cygwinmod->pathCB->setChecked(rc.cygwin_path_fix);
+#endif
QPrefLatexModule * latexmod(dialog_->latexModule);
#include "ui/QPrefLatexModule.h"
#include "ui/QPrefScreenFontsModule.h"
#include "ui/QPrefColorsModule.h"
+#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+#include "ui/QPrefCygwinPathModule.h"
+#endif
#include "ui/QPrefDisplayModule.h"
#include "ui/QPrefPathsModule.h"
#include "ui/QPrefSpellcheckerModule.h"
latexModule = new QPrefLatexModule(this);
screenfontsModule = new QPrefScreenFontsModule(this);
colorsModule = new QPrefColorsModule(this);
+#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+ cygwinpathModule = new QPrefCygwinPathModule(this);
+#endif
displayModule = new QPrefDisplayModule(this);
pathsModule = new QPrefPathsModule(this);
spellcheckerModule = new QPrefSpellcheckerModule(this);
prefsPS->addPanel(asciiModule, _("ASCII"), op);
prefsPS->addPanel(dateModule, _("Date format"), op);
prefsPS->addPanel(latexModule, _("LaTeX"), op);
+#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+ prefsPS->addPanel(cygwinpathModule, _("Paths"), op);
+#endif
prefsPS->addPanel(printerModule, _("Printer"), op);
prefsPS->addPanel(identityModule, _("Identity"));
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__)
+ connect(cygwinpathModule->pathCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
+#endif
connect(latexModule->latexEncodingED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(latexModule->latexChecktexED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(latexModule->latexBibtexED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
class QPrefLatexModule;
class QPrefScreenFontsModule;
class QPrefColorsModule;
+class QPrefCygwinPathModule;
class QPrefDisplayModule;
class QPrefPathsModule;
class QPrefSpellcheckerModule;
QPrefLatexModule * latexModule;
QPrefScreenFontsModule * screenfontsModule;
QPrefColorsModule * colorsModule;
+#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+ QPrefCygwinPathModule * cygwinpathModule;
+#endif
QPrefDisplayModule * displayModule;
QPrefPathsModule * pathsModule;
QPrefSpellcheckerModule * spellcheckerModule;
--- /dev/null
+<!DOCTYPE UI><UI>
+<class>QPrefCygwinPathModule</class>
+<include location="global">config.h</include>
+<include location="local">qt_helpers.h</include>
+<widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>QPrefCygwinPathModule</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>275</width>
+ <height>91</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>Cygwin Paths</string>
+ </property>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer1</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>pathCB</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>10</x>
+ <y>10</y>
+ <width>260</width>
+ <height>26</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&Use Cygwin-style paths</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string></string>
+ </property>
+ <property>
+ <name>whatsThis</name>
+ <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>
+ </property>
+ </widget>
+</widget>
+</UI>
+2005-01-13 Angus Leeming <leeming@lyx.org>
+
+ * FormPreferences.C: code to get/set the value
+ of the Cygwin check box. Compiled only under Cygwin.
+
+ * forms/form_preferences.fd: add a Cygwin paths check box to the
+ Outputs->Misc tab.
+
2005-01-13 Angus Leeming <leeming@lyx.org>
* FormPreferences.C: use getString, a safe wrapper around fl_get_input.
rc.index_command = getString(dialog_->input_index);
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);
+#endif
}
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__)
+#else
+ setEnabled(dialog_->check_cygwin_path, false);
+#endif
+
fl_addto_choice(dialog_->choice_default_papersize,
_(" default | US letter | US legal "
"| US executive | A3 | A4 | A5 | B5 ").c_str());
setPrehandler(dialog_->input_index);
setPrehandler(dialog_->input_paperoption);
setPrehandler(dialog_->check_autoreset_classopt);
+#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+ setPrehandler(dialog_->check_cygwin_path);
+#endif
}
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.");
+#endif
return string();
}
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);
+#endif
}
=============== FORM ===============
Name: form_preferences_outputs_misc
Width: 455
-Height: 400
-Number of Objects: 12
+Height: 435
+Number of Objects: 13
--------------------
class: FL_BOX
type: FLAT_BOX
-box: 0 0 455 400
+box: 0 0 455 435
boxtype: FL_FLAT_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
--------------------
class: FL_FRAME
type: ENGRAVED_FRAME
-box: 10 10 435 165
+box: 10 15 435 190
boxtype: FL_NO_BOX
colors: FL_BLACK FL_COL1
alignment: FL_ALIGN_CENTER
--------------------
class: FL_LABELFRAME
type: ENGRAVED_FRAME
-box: 10 190 435 200
+box: 10 220 435 200
boxtype: FL_NO_BOX
colors: FL_BLACK FL_COL1
alignment: FL_ALIGN_TOP_LEFT
--------------------
class: FL_INPUT
type: NORMAL_INPUT
-box: 145 205 285 30
+box: 145 235 285 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
--------------------
class: FL_INPUT
type: NORMAL_INPUT
-box: 145 240 285 30
+box: 145 270 285 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
--------------------
class: FL_INPUT
type: NORMAL_INPUT
-box: 145 275 285 30
+box: 145 305 285 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
--------------------
class: FL_CHECKBUTTON
type: PUSH_BUTTON
-box: 20 140 30 30
+box: 400 140 30 30
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
-alignment: FL_ALIGN_CENTER
+alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE
style: FL_NORMAL_STYLE
-size: FL_DEFAULT_SIZE
+size: FL_NORMAL_SIZE
lcol: FL_BLACK
label: Autoreset Class Options on change|#u
shortcut:
--------------------
class: FL_INPUT
type: NORMAL_INPUT
-box: 145 310 285 30
+box: 145 340 285 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
--------------------
class: FL_INPUT
type: NORMAL_INPUT
-box: 145 345 285 30
+box: 145 375 285 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
callback: C_FormDialogView_InputCB
argument: 0
+--------------------
+class: FL_CHECKBUTTON
+type: PUSH_BUTTON
+box: 400 170 30 30
+boxtype: FL_NO_BOX
+colors: FL_COL1 FL_YELLOW
+alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Use Cygwin Paths|#s
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: check_cygwin_path
+callback: C_FormDialogView_InputCB
+argument: 0
+
==============================
create_the_forms
#include "graphics/GraphicsTypes.h"
+#include "support/convert.h"
#include "support/filetools.h"
#include "support/lstrings.h"
-#include "support/convert.h"
+#include "support/os.h"
#include "support/userinfo.h"
using lyx::support::ascii_lowercase;
using lyx::support::LibFileSearch;
using lyx::support::token;
+namespace os = lyx::support::os;
+
using std::cout;
using std::endl;
{ "\\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 },
language_command_local = "\\foreignlanguage{$$lang}{";
default_language = "english";
show_banner = true;
-
- //
+ cygwin_path_fix = false;
date_insert_format = "%A, %e %B %Y";
cursor_follows_scrollbar = false;
dialogs_iconify_with_main = false;
}
break;
+ case RC_CYGWIN_PATH_FIX:
+ if (lexrc.next()) {
+ cygwin_path_fix = lexrc.getBool();
+ os::cygwin_path_fix(cygwin_path_fix);
+ }
+ break;
+
case RC_KBMAP_PRIMARY:
if (lexrc.next()) {
string const kmap(lexrc.getString());
use_kbmap != system_lyxrc.use_kbmap) {
os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
}
+
+ case RC_CYGWIN_PATH_FIX:
+ if (ignore_system_lyxrc ||
+ cygwin_path_fix != system_lyxrc.cygwin_path_fix) {
+ os << "\\cygwin_path_fix_needed "
+ << convert<string>(cygwin_path_fix) << '\n';
+ }
case RC_KBMAP_PRIMARY:
if (ignore_system_lyxrc ||
primary_kbmap != system_lyxrc.primary_kbmap) {
RC_USER_NAME,
RC_USER_EMAIL,
RC_INDEX_COMMAND,
+ RC_CYGWIN_PATH_FIX,
RC_LAST
};
std::string user_name;
/// user email
std::string user_email;
+ ///
+ bool cygwin_path_fix;
};
+2005-01-02 Kayvan Sylvan <kayvan@sylvan.com>
+
+ * os_win32.C (external_path): Check the new cygwin_path_fix_ bool
+ before translating external paths to Win32 paths.
+
+2005-01-13 Angus Leeming <leeming@lyx.org>
+
+ * os.h, os_os2.C, os_unix.C, os_win32.C (cygwin_path_fix): new
+ function flagging whether LyX should output native Win32 paths
+ or cygwin paths. Obviously operative only under Cygwin.
+
2005-01-13 Angus Leeming <leeming@lyx.org>
* package.C.in: use "%n$s" rather than "%n%" for n=1,2,3... when
* Makefile.am: remove path_defines.{C.in,h}. Add package.{C.in,h}.
- * filetools.C[Ch] (GetEnvPath): remove.
+ * filetools.[Ch] (GetEnvPath): remove.
(getEnvPath): replacement. Returns a vector<string> of paths.
* filetools.C:
*/
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.
+ */
+void cygwin_path_fix(bool use_cygwin_paths);
+
} // namespace os
} // namespace support
} // namespace lyx
return ';';
}
+
+void cygwin_path_fix(bool)
+{}
+
} // namespace os
} // namespace support
} // namespace lyx
return UNIX;
}
+
char path_separator()
{
return ':';
}
+
+void cygwin_path_fix(bool)
+{}
+
} // namespace os
} // namespace support
} // namespace lyx
}
+#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+namespace {
+
+bool cygwin_path_fix_ = false;
+
+} // namespace anon
+#endif
+
+
string external_path(string const & p)
{
string dos_path;
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
// Translate from cygwin path syntax to dos path syntax
- if (is_absolute_path(p)) {
+ if (cygwin_path_fix_ && is_absolute_path(p)) {
char dp[PATH_MAX];
cygwin_conv_to_full_win32_path(p.c_str(), dp);
dos_path = !dp ? "" : dp;
#endif
}
+
char path_separator()
{
#if defined (_WIN32)
#endif
}
+
+void cygwin_path_fix(bool use_cygwin_paths)
+{
+#if defined (_WIN32)
+ // Silence warning.
+ (void)use_cygwin_paths;
+#else // Cygwin
+ use_cygwin_paths_ = use_cygwin_paths;
+#endif
+}
+
} // namespace os
} // namespace support
} // namespace lyx