]> git.lyx.org Git - features.git/commitdiff
The Cygwin path fix.
authorAngus Leeming <leeming@lyx.org>
Fri, 14 Jan 2005 15:53:30 +0000 (15:53 +0000)
committerAngus Leeming <leeming@lyx.org>
Fri, 14 Jan 2005 15:53:30 +0000 (15:53 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9478 a592a061-630c-0410-9148-cb99ea01b6c8

19 files changed:
lib/ChangeLog
lib/configure.m4
src/ChangeLog
src/frontends/qt2/ChangeLog
src/frontends/qt2/Makefile.dialogs
src/frontends/qt2/QPrefs.C
src/frontends/qt2/QPrefsDialog.C
src/frontends/qt2/QPrefsDialog.h
src/frontends/qt2/ui/QPrefCygwinPathModule.ui [new file with mode: 0644]
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/forms/form_preferences.fd
src/lyxrc.C
src/lyxrc.h
src/support/ChangeLog
src/support/os.h
src/support/os_os2.C
src/support/os_unix.C
src/support/os_win32.C

index 22a8e1f68f1a6a42e0e6850ebfd199a8030a2985..d0f03768eebe4d1faef9aeaf23c05d4617c3ac7e 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 20a2799aa0b3fa4a95b9e4827909b3abf01a3ea3..0f34a7f385cbc4e0b3a5293b65597dcde661feb3 100644 (file)
@@ -174,6 +174,7 @@ if test ! -r "${srcdir}"/chkconfig.ltx ; then
 fi
 
 #### Adjust PATH for Win32 (Cygwin)
+use_cygwin_path_fix=''
 case `uname -s` in
    CYGWIN*)
      tmpfname="/tmp/x$$.ltx";
@@ -188,8 +189,10 @@ case `uname -s` in
        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
@@ -659,6 +662,11 @@ $rc_entries
 \\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"
index 62389552911fd950828e0100acb72eb724b0744c..d4a60b771bca47c44147ea88bad46985743b201c 100644 (file)
@@ -1,3 +1,14 @@
+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
index 3e13694d477866ee370f6891368f0c8886554680..645ec2c657614d14a3ce2e38f016feb50871f3e0 100644 (file)
@@ -1,3 +1,16 @@
+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
index d16c829f6bc993a77ae0fd49eea065b9383d718d..6fc0c196ccd998d49bf4facdf25ec56adf8dcd25 100644 (file)
@@ -41,6 +41,7 @@ UIFILES = \
        QPrefColorsModule.ui \
        QPrefConvertersModule.ui \
        QPrefCopiersModule.ui \
+       QPrefCygwinPathModule.ui \
        QPrefDateModule.ui \
        QPrefDisplayModule.ui \
        QPrefFileformatsModule.ui \
index 39a469eca0fdd12ebb32a5d188d8aa3822172379..52120b67adbf53f1b967ab89a0d08155f53e2415 100644 (file)
@@ -23,6 +23,9 @@
 #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"
@@ -185,6 +188,10 @@ void QPrefs::apply()
 
        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);
 
@@ -505,6 +512,10 @@ void QPrefs::update_contents()
 
        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);
 
index 83722d708d4e43b44a03db40880bb855bac99c28..1a6496fa2276a549cc591f4c427abcc9adabd169 100644 (file)
@@ -25,6 +25,9 @@
 #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"
@@ -74,6 +77,9 @@ QPrefsDialog::QPrefsDialog(QPrefs * form)
        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);
@@ -103,6 +109,9 @@ QPrefsDialog::QPrefsDialog(QPrefs * form)
        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"));
@@ -222,6 +231,9 @@ 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__)
+       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()));
index 1ea10d57a93c78749f31d3e6a254140c118c9456..9e1a223d3455e50e482b919c88603301623328eb 100644 (file)
@@ -25,6 +25,7 @@ class QPrefKeyboardModule;
 class QPrefLatexModule;
 class QPrefScreenFontsModule;
 class QPrefColorsModule;
+class QPrefCygwinPathModule;
 class QPrefDisplayModule;
 class QPrefPathsModule;
 class QPrefSpellcheckerModule;
@@ -105,6 +106,9 @@ private:
        QPrefLatexModule * latexModule;
        QPrefScreenFontsModule * screenfontsModule;
        QPrefColorsModule * colorsModule;
+#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+       QPrefCygwinPathModule * cygwinpathModule;       
+#endif 
        QPrefDisplayModule * displayModule;
        QPrefPathsModule * pathsModule;
        QPrefSpellcheckerModule * spellcheckerModule;
diff --git a/src/frontends/qt2/ui/QPrefCygwinPathModule.ui b/src/frontends/qt2/ui/QPrefCygwinPathModule.ui
new file mode 100644 (file)
index 0000000..8e8139e
--- /dev/null
@@ -0,0 +1,78 @@
+<!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>&amp;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>
index 41f69ccc9881456209c55288cf2a9d013e82d6d1..3ffbd9a7f074b31dc431a9a224c903f4b993ef6e 100644 (file)
@@ -1,3 +1,11 @@
+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.
index fa8e8c751deca2a9c532eb834f97209263160c58..02ffb2bb5e0747088ec9952e74f85f0c1fc9f45f 100644 (file)
@@ -2072,6 +2072,10 @@ void FormPreferences::OutputsMisc::apply(LyXRC & rc) const
        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
 }
 
 
@@ -2089,6 +2093,11 @@ 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__)
+#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());
@@ -2103,6 +2112,9 @@ 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);
+#endif
 }
 
 
@@ -2127,6 +2139,14 @@ 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.");
+#endif
        return string();
 }
 
@@ -2151,7 +2171,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);
+#endif
 }
 
 
index 5bd7a3eb32c57153fb52c9b34fa7cde65457f43c..5c567b36b8e3311174905c12266e600a1cdebcc9 100644 (file)
@@ -2880,13 +2880,13 @@ argument:
 =============== 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
@@ -2904,7 +2904,7 @@ argument:
 --------------------
 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
@@ -2980,7 +2980,7 @@ argument: 0
 --------------------
 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
@@ -2998,7 +2998,7 @@ argument:
 --------------------
 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
@@ -3016,7 +3016,7 @@ argument: 0
 --------------------
 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
@@ -3034,7 +3034,7 @@ argument: 0
 --------------------
 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
@@ -3052,12 +3052,12 @@ argument: 0
 --------------------
 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: 
@@ -3070,7 +3070,7 @@ argument: 0
 --------------------
 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
@@ -3088,7 +3088,7 @@ argument: 0
 --------------------
 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
@@ -3103,5 +3103,23 @@ name: input_index
 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
index 18ab6b005260eafd4d204c90da7fb44250ac3876..9ffa6c8efafe6161f7364a2009607d2444d00c69 100644 (file)
 
 #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;
@@ -45,6 +46,8 @@ using lyx::support::GetEnv;
 using lyx::support::LibFileSearch;
 using lyx::support::token;
 
+namespace os = lyx::support::os;
+
 using std::cout;
 using std::endl;
 
@@ -76,6 +79,7 @@ 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 },
@@ -264,8 +268,7 @@ void LyXRC::setDefaults() {
        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;
@@ -388,6 +391,13 @@ int LyXRC::read(LyXLex & lexrc)
                        }
                        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());
@@ -1296,6 +1306,13 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc) const
                    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) {
index 187d61eb35a1f9041fdcbce72694ffb0ee5a4e11..8eee3fe871c317e3a7593a4cb95e883108f1b8bf 100644 (file)
@@ -133,6 +133,7 @@ enum LyXRCTags {
        RC_USER_NAME,
        RC_USER_EMAIL,
        RC_INDEX_COMMAND,
+       RC_CYGWIN_PATH_FIX,
        RC_LAST
 };
 
@@ -374,6 +375,8 @@ public:
        std::string user_name;
        /// user email
        std::string user_email;
+       ///
+       bool cygwin_path_fix;
 };
 
 
index 71b308818f29761731dcbc9aca8e98818770c230..dfed66dc6b78fd0bfd75f993da1a72714e29a95e 100644 (file)
@@ -1,3 +1,14 @@
+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
@@ -39,7 +50,7 @@
 
        * 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:
index ca4bd675ec9b3031ab644365bfe2e48e15f6780c..f9517dcc3982b50f71f752d42fb743d7a06f37b1 100644 (file)
@@ -60,6 +60,12 @@ 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.
+ */
+void cygwin_path_fix(bool use_cygwin_paths);
+
 } // namespace os
 } // namespace support
 } // namespace lyx
index aba74d9168a4c8b6ebc72188ef56b79d68a35694..e49b3317f6d857bad4b6fced2a1df602154d4fa5 100644 (file)
@@ -208,6 +208,10 @@ char path_separator()
        return ';';
 }
 
+
+void cygwin_path_fix(bool)
+{}
+
 } // namespace os
 } // namespace support
 } // namespace lyx
index d2a3e07c36d4dd1c0a19fec5dc90ab9c3247155f..28235773133e77f33720950e0d7e651b420f485f 100644 (file)
@@ -87,11 +87,16 @@ shell_type shell()
        return UNIX;
 }
 
+
 char path_separator()
 {
        return ':';
 }
 
+
+void cygwin_path_fix(bool)
+{}
+
 } // namespace os
 } // namespace support
 } // namespace lyx
index 28b0ca104ee36d622faf213bdcce55960eadaa9b..94f1b1f329f1db98ab0f0f595f65beb2a9ab867c 100644 (file)
@@ -72,13 +72,22 @@ string::size_type common_path(string const & p1, string const & p2)
 }
 
 
+#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;
@@ -163,6 +172,7 @@ shell_type shell()
 #endif
 }
 
+
 char path_separator()
 {
 #if defined (_WIN32)
@@ -172,6 +182,17 @@ char path_separator()
 #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