Commits

Yevgen Muntyan committed 2eb3c58

Assume GAP 4.5 by default; added an option to support GAP 4.4

  • Participants
  • Parent commits d54ced7

Comments (0)

Files changed (6)

 
 QString GapOptions::defaultRootDir()
 {
-    QString val = QCoreApplication::applicationDirPath() + "/gap4r4";
+    QString val = QCoreApplication::applicationDirPath() + "/gap4r5";
     if (QFileInfo(val).isDir())
         return val;
     else
     QString val;
 
 #ifdef Q_OS_WIN32
-    val = QCoreApplication::applicationDirPath() + "/gap4r4/bin/gapw95.exe";
+    val = QCoreApplication::applicationDirPath() + "/gap4r5/bin/gapw95.exe";
 #else
-    val = QCoreApplication::applicationDirPath() + "/gap4r4/bin/gap.sh";
+    val = QCoreApplication::applicationDirPath() + "/gap4r5/bin/gap.sh";
 #endif
 
     if (QFileInfo(val).exists())
     if (val.isEmpty())
     {
 #ifdef Q_OS_WIN32
-        val = "c:/gap4r4/bin/gapw95.exe";
+        val = "c:/gap4r5/bin/gapw95.exe";
 #else
         val = "gap";
 #endif
     prefix << cmd_base << flags;
 
 #ifdef Q_OS_WIN32
-    if (cmd_base.endsWith("gapw95.exe", Qt::CaseInsensitive))
+    QString root = GapOptions().rootDir();
+
+    if (!root.isEmpty())
     {
-        QString root = GapOptions().rootDir();
-
-        if (!root.isEmpty())
-        {
-            root = filenameToCommandLine(root);
-            prefix << "-l" << filenameToCommandLine(root);
-        }
-        else
-        {
-            qCritical("%s: oops", Q_FUNC_INFO);
-        }
+        root = filenameToCommandLine(root);
+        prefix << "-l" << filenameToCommandLine(root);
+    }
+    else
+    {
+        qCritical("%s: oops", Q_FUNC_INFO);
     }
 #endif
 
     flags << "-n";
     if (!(proc_flags & GapProcess::EnableBreakLoop))
         flags << "-T";
+    if (!prefsValue(Prefs::Gap44))
+        flags << "-E";
 
     return make_command_line(cmd_base, flags, workspace);
 }

ggap/prefs-advanced.ui

-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>AdvancedPrefsDialog</class>
- <widget class="QDialog" name="AdvancedPrefsDialog" >
-  <property name="geometry" >
+ <widget class="QDialog" name="AdvancedPrefsDialog">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <height>211</height>
    </rect>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string>GGAP Preferences</string>
   </property>
-  <layout class="QVBoxLayout" name="verticalLayout" >
+  <layout class="QVBoxLayout" name="verticalLayout">
    <item>
-    <layout class="QGridLayout" name="gridLayout" >
-     <item row="1" column="0" >
-      <spacer name="horizontalSpacer" >
-       <property name="orientation" >
+    <layout class="QGridLayout" name="gridLayout">
+     <item row="1" column="0">
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
         <enum>Qt::Horizontal</enum>
        </property>
-       <property name="sizeType" >
+       <property name="sizeType">
         <enum>QSizePolicy::Fixed</enum>
        </property>
-       <property name="sizeHint" stdset="0" >
+       <property name="sizeHint" stdset="0">
         <size>
          <width>12</width>
          <height>0</height>
        </property>
       </spacer>
      </item>
-     <item row="1" column="1" >
-      <widget class="QLabel" name="label" >
-       <property name="sizePolicy" >
-        <sizepolicy vsizetype="Preferred" hsizetype="Minimum" >
+     <item row="1" column="1">
+      <widget class="QLabel" name="label">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
-       <property name="text" >
+       <property name="text">
         <string>&amp;Files to watch:</string>
        </property>
-       <property name="buddy" >
+       <property name="buddy">
         <cstring>entryFiles</cstring>
        </property>
       </widget>
      </item>
-     <item row="1" column="2" >
-      <widget class="QLineEdit" name="entryFiles" >
-       <property name="readOnly" >
+     <item row="1" column="2">
+      <widget class="QLineEdit" name="entryFiles">
+       <property name="readOnly">
         <bool>false</bool>
        </property>
       </widget>
      </item>
-     <item row="1" column="3" >
-      <widget class="QPushButton" name="buttonFiles" >
-       <property name="sizePolicy" >
-        <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+     <item row="1" column="3">
+      <widget class="QPushButton" name="buttonFiles">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
-       <property name="text" >
+       <property name="text">
         <string>Edit...</string>
        </property>
       </widget>
      </item>
-     <item row="1" column="4" >
-      <spacer name="horizontalSpacer_2" >
-       <property name="orientation" >
+     <item row="1" column="4">
+      <spacer name="horizontalSpacer_2">
+       <property name="orientation">
         <enum>Qt::Horizontal</enum>
        </property>
-       <property name="sizeType" >
+       <property name="sizeType">
         <enum>QSizePolicy::Fixed</enum>
        </property>
-       <property name="sizeHint" stdset="0" >
+       <property name="sizeHint" stdset="0">
         <size>
          <width>12</width>
          <height>0</height>
        </property>
       </spacer>
      </item>
-     <item row="3" column="1" colspan="2" >
-      <widget class="QCheckBox" name="checkEnableTerminalMode" >
-       <property name="text" >
+     <item row="3" column="1" colspan="2">
+      <widget class="QCheckBox" name="checkEnableTerminalMode">
+       <property name="text">
         <string>Enable &amp;terminal mode</string>
        </property>
       </widget>
      </item>
-     <item row="6" column="1" >
-      <widget class="QLabel" name="label_4" >
-       <property name="sizePolicy" >
-        <sizepolicy vsizetype="Preferred" hsizetype="Minimum" >
+     <item row="6" column="1">
+      <widget class="QLabel" name="label_4">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
-       <property name="text" >
+       <property name="text">
         <string>Default file format:</string>
        </property>
-       <property name="alignment" >
+       <property name="alignment">
         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
        </property>
-       <property name="buddy" >
+       <property name="buddy">
         <cstring>radioWorkspace</cstring>
        </property>
       </widget>
      </item>
-     <item row="6" column="2" >
-      <widget class="QRadioButton" name="radioWorkspace" >
-       <property name="sizePolicy" >
-        <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+     <item row="6" column="2">
+      <widget class="QRadioButton" name="radioWorkspace">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
-       <property name="text" >
+       <property name="text">
         <string>Work&amp;space</string>
        </property>
-       <property name="checked" >
+       <property name="checked">
         <bool>true</bool>
        </property>
       </widget>
      </item>
-     <item row="7" column="2" >
-      <widget class="QRadioButton" name="radioWorksheet" >
-       <property name="sizePolicy" >
-        <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+     <item row="7" column="2">
+      <widget class="QRadioButton" name="radioWorksheet">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
-       <property name="text" >
+       <property name="text">
         <string>Works&amp;heet</string>
        </property>
       </widget>
      </item>
-     <item row="5" column="2" >
-      <spacer name="verticalSpacer_3" >
-       <property name="orientation" >
+     <item row="5" column="2">
+      <spacer name="verticalSpacer_3">
+       <property name="orientation">
         <enum>Qt::Vertical</enum>
        </property>
-       <property name="sizeType" >
+       <property name="sizeType">
         <enum>QSizePolicy::Fixed</enum>
        </property>
-       <property name="sizeHint" stdset="0" >
+       <property name="sizeHint" stdset="0">
         <size>
          <width>0</width>
          <height>6</height>
        </property>
       </spacer>
      </item>
-     <item row="0" column="1" colspan="2" >
-      <widget class="QCheckBox" name="checkSaveWorkspace" >
-       <property name="text" >
+     <item row="0" column="1" colspan="2">
+      <widget class="QCheckBox" name="checkSaveWorkspace">
+       <property name="text">
         <string>Sa&amp;ve workspace for faster startup</string>
        </property>
       </widget>
      </item>
-     <item row="2" column="2" >
-      <spacer name="verticalSpacer_2" >
-       <property name="orientation" >
+     <item row="2" column="2">
+      <spacer name="verticalSpacer_2">
+       <property name="orientation">
         <enum>Qt::Vertical</enum>
        </property>
-       <property name="sizeType" >
+       <property name="sizeType">
         <enum>QSizePolicy::Fixed</enum>
        </property>
-       <property name="sizeHint" stdset="0" >
+       <property name="sizeHint" stdset="0">
         <size>
          <width>0</width>
          <height>6</height>
        </property>
       </spacer>
      </item>
+     <item row="8" column="1" colspan="2">
+      <widget class="QCheckBox" name="checkGap44">
+       <property name="text">
+        <string>GAP &amp;4.4 mode</string>
+       </property>
+      </widget>
+     </item>
     </layout>
    </item>
    <item>
-    <spacer name="verticalSpacer" >
-     <property name="orientation" >
+    <spacer name="verticalSpacer">
+     <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
-     <property name="sizeHint" stdset="0" >
+     <property name="sizeHint" stdset="0">
       <size>
        <width>20</width>
        <height>40</height>
     </spacer>
    </item>
    <item>
-    <widget class="Line" name="line" >
-     <property name="orientation" >
+    <widget class="Line" name="line">
+     <property name="orientation">
       <enum>Qt::Horizontal</enum>
      </property>
     </widget>
    </item>
    <item>
-    <widget class="QDialogButtonBox" name="buttonBox" >
-     <property name="orientation" >
+    <widget class="QDialogButtonBox" name="buttonBox">
+     <property name="orientation">
       <enum>Qt::Horizontal</enum>
      </property>
-     <property name="standardButtons" >
+     <property name="standardButtons">
       <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
      </property>
     </widget>
    <receiver>AdvancedPrefsDialog</receiver>
    <slot>accept()</slot>
    <hints>
-    <hint type="sourcelabel" >
+    <hint type="sourcelabel">
      <x>248</x>
      <y>254</y>
     </hint>
-    <hint type="destinationlabel" >
+    <hint type="destinationlabel">
      <x>157</x>
      <y>274</y>
     </hint>
    <receiver>AdvancedPrefsDialog</receiver>
    <slot>reject()</slot>
    <hints>
-    <hint type="sourcelabel" >
+    <hint type="sourcelabel">
      <x>316</x>
      <y>260</y>
     </hint>
-    <hint type="destinationlabel" >
+    <hint type="destinationlabel">
      <x>286</x>
      <y>274</y>
     </hint>
             return PrefsKey("gap/use-default", true);
         case Prefs::EnableTerminalMode:
             return PrefsKey("gap/enable-terminal-mode", false);
+        case Prefs::Gap44:
+            return PrefsKey("gap/gap44", false);
     }
 
     m_return_val_if_reached(PrefsKey(QString()));
     enum BoolKey {
         SaveWorkspace       = 0x101,
         UseDefaultGap       = 0x102,
-        EnableTerminalMode  = 0x103
+        EnableTerminalMode  = 0x103,
+        Gap44               = 0x104
     };
 
     enum StringKey {

ggap/prefsdialog-p.h

         entryFiles->setText(files.join("; "));
 
         checkEnableTerminalMode->setChecked(prefsValue(Prefs::EnableTerminalMode));
+        checkGap44->setChecked(prefsValue(Prefs::Gap44));
 
         if (prefsValue(Prefs::DefaultFileFormat) == "workspace")
             radioWorkspace->setChecked(true);
         setPrefsValue(Prefs::WatchGapFiles, files);
 
         setPrefsValue(Prefs::EnableTerminalMode, checkEnableTerminalMode->isChecked());
+        setPrefsValue(Prefs::Gap44, checkGap44->isChecked());
 
         if (radioWorkspace->isChecked())
             setPrefsValue(Prefs::DefaultFileFormat, "workspace");

ggap/worksheet.cpp

 #include <moo/uri.h>
 #include <QtGui>
 #include <string.h>
+#include <windows.h>
 
 using namespace ggap;
 
     GapCommand cmd = makeGapCommand(workspace, flags);
     if (cmd.isValid())
     {
+#ifdef Q_OS_WIN32
+        static bool setCygwin = false;
+        if (!setCygwin && !prefsValue(Prefs::Gap44))
+        {
+            setCygwin = true;
+            SetEnvironmentVariableA("CYGWIN", "nodosfilewarning");
+        }
+#endif
+
         cmd.working_dir = working_dir;
         forkCommand(cmd, flags);
     }