Sfoglia il codice sorgente

Changed Alt key shortcuts for Project Options controls to be more consistent with the original TIGCC while still keeping the OK and Cancel buttons with their Qt-set defaults of &OK and &Cancel.

git-svn-id: file:///var/svn/tigccpp/trunk@500 9552661e-59e3-4036-b4f2-dbe53926924f
joeyadams 18 anni fa
parent
commit
e1769e5de9
2 ha cambiato i file con 65 aggiunte e 51 eliminazioni
  1. 40 37
      ktigcc/projectoptions.ui
  2. 25 14
      ktigcc/projectoptions.ui.h

+ 40 - 37
ktigcc/projectoptions.ui

@@ -215,7 +215,7 @@
                                             </size>
                                         </property>
                                         <property name="text">
-                                            <string>&lt;u&gt;O&lt;/u&gt;n-calc variable name:</string>
+                                            <string>On-calc &lt;u&gt;v&lt;/u&gt;ariable name:</string>
                                         </property>
                                         <property name="textFormat">
                                             <enum>RichText</enum>
@@ -509,10 +509,10 @@
                                             </size>
                                         </property>
                                         <property name="text">
-                                            <string>Co&amp;mpress program (*.??y)</string>
+                                            <string>Compre&amp;ss program (*.??y)</string>
                                         </property>
                                         <property name="accel">
-                                            <string>Alt+M</string>
+                                            <string>Alt+S</string>
                                         </property>
                                     </widget>
                                 </hbox>
@@ -570,7 +570,7 @@
                                             </size>
                                         </property>
                                         <property name="text">
-                                            <string>On-&lt;u&gt;c&lt;/u&gt;alc variable name:</string>
+                                            <string>On-calc var&lt;u&gt;i&lt;/u&gt;able name:</string>
                                         </property>
                                         <property name="textFormat">
                                             <enum>RichText</enum>
@@ -611,7 +611,15 @@
                             </widget>
                             <widget class="QRadioButton">
                                 <property name="name">
-                                    <cstring>FargoProgram</cstring>
+                                    <cstring>FlashOperatingSystem</cstring>
+                                </property>
+                                <property name="sizePolicy">
+                                    <sizepolicy>
+                                        <hsizetype>5</hsizetype>
+                                        <vsizetype>1</vsizetype>
+                                        <horstretch>0</horstretch>
+                                        <verstretch>0</verstretch>
+                                    </sizepolicy>
                                 </property>
                                 <property name="minimumSize">
                                     <size>
@@ -626,26 +634,15 @@
                                     </size>
                                 </property>
                                 <property name="text">
-                                    <string>&amp;Fargo Program (*.92p)  (experimental)</string>
+                                    <string>Flash Operating S&amp;ystem  (experimental)</string>
                                 </property>
                                 <property name="accel">
-                                    <string>Alt+F</string>
-                                </property>
-                                <property name="checked">
-                                    <bool>false</bool>
+                                    <string>Alt+Y</string>
                                 </property>
                             </widget>
                             <widget class="QRadioButton">
                                 <property name="name">
-                                    <cstring>FlashOperatingSystem</cstring>
-                                </property>
-                                <property name="sizePolicy">
-                                    <sizepolicy>
-                                        <hsizetype>5</hsizetype>
-                                        <vsizetype>1</vsizetype>
-                                        <horstretch>0</horstretch>
-                                        <verstretch>0</verstretch>
-                                    </sizepolicy>
+                                    <cstring>FargoProgram</cstring>
                                 </property>
                                 <property name="minimumSize">
                                     <size>
@@ -660,10 +657,13 @@
                                     </size>
                                 </property>
                                 <property name="text">
-                                    <string>Flash Operating S&amp;ystem  (experimental)</string>
+                                    <string>Far&amp;go Program (*.92p)  (experimental)</string>
                                 </property>
                                 <property name="accel">
-                                    <string>Alt+Y</string>
+                                    <string>Alt+G</string>
+                                </property>
+                                <property name="checked">
+                                    <bool>false</bool>
                                 </property>
                             </widget>
                             <widget class="QRadioButton">
@@ -691,10 +691,10 @@
                                     </size>
                                 </property>
                                 <property name="text">
-                                    <string>F&amp;unction Archive (*.a)</string>
+                                    <string>&amp;Function Archive (*.a)</string>
                                 </property>
                                 <property name="accel">
-                                    <string>Alt+U</string>
+                                    <string>Alt+F</string>
                                 </property>
                                 <property name="buttonGroupId">
                                     <number>1</number>
@@ -709,7 +709,7 @@
                     <cstring>Widget9</cstring>
                 </property>
                 <attribute name="title">
-                    <string>Comp&amp;ilation</string>
+                    <string>Co&amp;mpilation</string>
                 </attribute>
                 <vbox>
                     <property name="name">
@@ -860,10 +860,10 @@
                             <cstring>GenerateDebugInformation</cstring>
                         </property>
                         <property name="text">
-                            <string>&amp;Generate debug information</string>
+                            <string>Generate &amp;debug information</string>
                         </property>
                         <property name="accel">
-                            <string>Alt+G</string>
+                            <string>Alt+D</string>
                         </property>
                     </widget>
                     <widget class="QLayoutWidget">
@@ -979,7 +979,7 @@
         </widget>
         <widget class="QLayoutWidget">
             <property name="name">
-                <cstring>layout12</cstring>
+                <cstring>layout11</cstring>
             </property>
             <hbox>
                 <property name="name">
@@ -997,7 +997,7 @@
                     </property>
                     <property name="sizeHint">
                         <size>
-                            <width>380</width>
+                            <width>240</width>
                             <height>30</height>
                         </size>
                     </property>
@@ -1009,7 +1009,7 @@
                     <property name="sizePolicy">
                         <sizepolicy>
                             <hsizetype>5</hsizetype>
-                            <vsizetype>5</vsizetype>
+                            <vsizetype>4</vsizetype>
                             <horstretch>0</horstretch>
                             <verstretch>0</verstretch>
                         </sizepolicy>
@@ -1024,7 +1024,10 @@
                         <string>&amp;OK</string>
                     </property>
                     <property name="accel">
-                        <string></string>
+                        <string>Alt+O</string>
+                    </property>
+                    <property name="autoRepeat">
+                        <bool>false</bool>
                     </property>
                     <property name="autoDefault">
                         <bool>true</bool>
@@ -1055,7 +1058,7 @@
                         <string>&amp;Cancel</string>
                     </property>
                     <property name="accel">
-                        <string></string>
+                        <string>Alt+C</string>
                     </property>
                     <property name="autoDefault">
                         <bool>true</bool>
@@ -1072,12 +1075,6 @@
         <receiver>ProjectOptions</receiver>
         <slot>reject()</slot>
     </connection>
-    <connection>
-        <sender>buttonOk</sender>
-        <signal>clicked()</signal>
-        <receiver>ProjectOptions</receiver>
-        <slot>accept()</slot>
-    </connection>
     <connection>
         <sender>RegularProgram</sender>
         <signal>toggled(bool)</signal>
@@ -1120,6 +1117,12 @@
         <receiver>ProjectOptions</receiver>
         <slot>UpdateVisibilities()</slot>
     </connection>
+    <connection>
+        <sender>buttonOk</sender>
+        <signal>clicked()</signal>
+        <receiver>ProjectOptions</receiver>
+        <slot>accept()</slot>
+    </connection>
 </connections>
 <includes>
     <include location="local" impldecl="in implementation">projectoptions.ui.h</include>

+ 25 - 14
ktigcc/projectoptions.ui.h

@@ -20,9 +20,12 @@ extern tprSettings settings;
 #define UnwrapLabel(theQLabel) ((theQLabel)->setAlignment((theQLabel)->alignment()&~WordBreak))
 //Qt automatically sets RichText labels to have word wrap, which makes labels with underlines in them look bad.  This simply undoes the wrapping.
 
-//accelerators that need to be destroyed at the end
-QAccel *altO;
-QAccel *altC;
+//manually created accelerators
+QAccel *AOncalcVariableName_1;
+QAccel *AOncalcVariableName_2;
+QAccel *AGCCSwitches;
+QAccel *AAsSwitches;
+QAccel *AA68kSwitches;
 
 void ProjectOptions::init()
 {
@@ -30,7 +33,9 @@ void ProjectOptions::init()
   //Qt automatically sets QLabels to wrapped when they are RichText.  This undoes this change.
   UnwrapLabel(LOncalcVariableName_1);
   UnwrapLabel(LOncalcVariableName_2);
-  
+  UnwrapLabel(LGCCSwitches);
+  UnwrapLabel(LAsSwitches);
+  UnwrapLabel(LA68kSwitches);
   //Toggle controls to match settings.
   //Tab: General
   OncalcVariableName_1->setText(settings.data_var);
@@ -78,16 +83,24 @@ void ProjectOptions::init()
   CheckOncalcNames();
   UpdateVisibilities();
   //Create accelerators for text boxes manually
-  altO=new QAccel(PO_TabWidget->page(0));
-  altO->connectItem(altO->insertItem(ALT+Key_O),OncalcVariableName_1,SLOT(setFocus()));
-  altC=new QAccel(PO_TabWidget->page(0));
-  altC->connectItem(altC->insertItem(ALT+Key_C),OncalcVariableName_2,SLOT(setFocus()));
+  QAccel *accel; //for temporarily holding the accelerator pointer
+  #define MakeAccelerator(destaccelptr,thewidget,thepage,thekey) destaccelptr=accel=new QAccel(PO_TabWidget->page(thepage)); \
+    accel->connectItem(accel->insertItem(thekey),thewidget,SLOT(setFocus()));
+  MakeAccelerator(AOncalcVariableName_1,OncalcVariableName_1,0,ALT+Key_V);
+  MakeAccelerator(AOncalcVariableName_2,OncalcVariableName_2,0,ALT+Key_I);
+  MakeAccelerator(AGCCSwitches,GCCSwitches,1,ALT+Key_G);
+  MakeAccelerator(AAsSwitches,AsSwitches,1,ALT+Key_S);
+  MakeAccelerator(AA68kSwitches,A68kSwitches,1,ALT+Key_A);
+  #undef MakeAccelerator
 }
 
 void ProjectOptions::destroy()
 {
-  delete(altO);
-  delete(altC);
+  delete(AOncalcVariableName_1);
+  delete(AOncalcVariableName_2);
+  delete(AGCCSwitches);
+  delete(AAsSwitches);
+  delete(AA68kSwitches);
   if (result()!=QDialog::Accepted)
     return;
   //Save settings
@@ -127,6 +140,8 @@ void ProjectOptions::destroy()
 void ProjectOptions::RegularProgramToggle()
 {
   int state;
+  buttonOk->setAccel(0);
+  buttonOk->setText("OK");
   state=RegularProgram->isOn()?TRUE:FALSE;
   if (!state)
   {
@@ -173,13 +188,9 @@ void ProjectOptions::CheckOncalcNames()
   Boolean edvon=OncalcVariableName_1->isEnabled();
   Boolean compon=OncalcVariableName_2->isEnabled();
   if ((edvon&&edvname.isEmpty()) || (compon&&compname.isEmpty()) || (edvon&&compon&&!edvname.compare(compname)))
-  {
     buttonOk->setEnabled(FALSE);
-  }
   else
-  {
     buttonOk->setEnabled(TRUE);
-  }
 }