Przeglądaj źródła

Set accelerators for label - edit box pairs properly.
Fix duplicate accelerator.


git-svn-id: file:///var/svn/tigccpp/trunk@511 9552661e-59e3-4036-b4f2-dbe53926924f

kevinkofler 18 lat temu
rodzic
commit
bb24058340
3 zmienionych plików z 32 dodań i 56 usunięć
  1. 4 4
      ktigcc/programoptions.ui
  2. 28 13
      ktigcc/projectoptions.ui
  3. 0 39
      ktigcc/projectoptions.ui.h

+ 4 - 4
ktigcc/programoptions.ui

@@ -1078,10 +1078,10 @@
                                             <cstring>BSSMlink</cstring>
                                         </property>
                                         <property name="text">
-                                            <string>&amp;Mlink (small calls, medium stub)</string>
+                                            <string>M&amp;link (small calls, medium stub)</string>
                                         </property>
                                         <property name="accel">
-                                            <string>Alt+M</string>
+                                            <string>Alt+L</string>
                                         </property>
                                     </widget>
                                 </vbox>
@@ -1165,10 +1165,10 @@
                                             <cstring>BSSDataMlink</cstring>
                                         </property>
                                         <property name="text">
-                                            <string>M&amp;link (small calls, medium stub)</string>
+                                            <string>Ml&amp;ink (small calls, medium stub)</string>
                                         </property>
                                         <property name="accel">
-                                            <string>Alt+L</string>
+                                            <string>Alt+I</string>
                                         </property>
                                     </widget>
                                 </vbox>

+ 28 - 13
ktigcc/projectoptions.ui

@@ -212,14 +212,14 @@
                                             </size>
                                         </property>
                                         <property name="text">
-                                            <string>On-calc &lt;u&gt;v&lt;/u&gt;ariable name:</string>
-                                        </property>
-                                        <property name="textFormat">
-                                            <enum>RichText</enum>
+                                            <string>On-calc &amp;variable name:</string>
                                         </property>
                                         <property name="alignment">
                                             <set>AlignVCenter</set>
                                         </property>
+                                        <property name="buddy" stdset="0">
+                                            <cstring>OncalcVariableName_1</cstring>
+                                        </property>
                                     </widget>
                                     <widget class="KLineEdit">
                                         <property name="name">
@@ -567,14 +567,14 @@
                                             </size>
                                         </property>
                                         <property name="text">
-                                            <string>On-calc var&lt;u&gt;i&lt;/u&gt;able name:</string>
-                                        </property>
-                                        <property name="textFormat">
-                                            <enum>RichText</enum>
+                                            <string>On-calc var&amp;iable name:</string>
                                         </property>
                                         <property name="alignment">
                                             <set>AlignVCenter</set>
                                         </property>
+                                        <property name="buddy" stdset="0">
+                                            <cstring>OncalcVariableName_2</cstring>
+                                        </property>
                                     </widget>
                                     <widget class="KLineEdit">
                                         <property name="name">
@@ -752,11 +752,14 @@
                                             </sizepolicy>
                                         </property>
                                         <property name="text">
-                                            <string>&lt;u&gt;G&lt;/u&gt;CC Switches:</string>
+                                            <string>&amp;GCC Switches:</string>
                                         </property>
                                         <property name="alignment">
                                             <set>AlignVCenter</set>
                                         </property>
+                                        <property name="buddy" stdset="0">
+                                            <cstring>GCCSwitches</cstring>
+                                        </property>
                                     </widget>
                                     <widget class="KLineEdit">
                                         <property name="name">
@@ -786,11 +789,14 @@
                                             <cstring>LAsSwitches</cstring>
                                         </property>
                                         <property name="text">
-                                            <string>A&lt;u&gt;s&lt;/u&gt; Switches:</string>
+                                            <string>A&amp;s Switches:</string>
                                         </property>
                                         <property name="alignment">
                                             <set>AlignVCenter</set>
                                         </property>
+                                        <property name="buddy" stdset="0">
+                                            <cstring>AsSwitches</cstring>
+                                        </property>
                                     </widget>
                                     <widget class="KLineEdit">
                                         <property name="name">
@@ -820,11 +826,14 @@
                                             <cstring>LA68kSwitches</cstring>
                                         </property>
                                         <property name="text">
-                                            <string>&lt;u&gt;A&lt;/u&gt;68k Switches:</string>
+                                            <string>&amp;A68k Switches:</string>
                                         </property>
                                         <property name="alignment">
                                             <set>AlignVCenter</set>
                                         </property>
+                                        <property name="buddy" stdset="0">
+                                            <cstring>A68kSwitches</cstring>
+                                        </property>
                                     </widget>
                                     <widget class="KLineEdit">
                                         <property name="name">
@@ -1364,11 +1373,14 @@
                                             </sizepolicy>
                                         </property>
                                         <property name="text">
-                                            <string>Call &lt;u&gt;a&lt;/u&gt;fter building:</string>
+                                            <string>Call &amp;after building:</string>
                                         </property>
                                         <property name="alignment">
                                             <set>AlignVCenter</set>
                                         </property>
+                                        <property name="buddy" stdset="0">
+                                            <cstring>CallAfterBuilding</cstring>
+                                        </property>
                                     </widget>
                                     <spacer>
                                         <property name="name">
@@ -1431,7 +1443,10 @@
                                     </sizepolicy>
                                 </property>
                                 <property name="text">
-                                    <string>Pa&lt;u&gt;r&lt;/u&gt;ameters:</string>
+                                    <string>Pa&amp;rameters:</string>
+                                </property>
+                                <property name="buddy" stdset="0">
+                                    <cstring>Parameters</cstring>
                                 </property>
                             </widget>
                             <widget class="KLineEdit">

+ 0 - 39
ktigcc/projectoptions.ui.h

@@ -42,28 +42,8 @@ extern tprSettings settings;
 ProgramOptions *programoptions;
 //the program options subdialog is created at initialization of a ProjectOptions and remains existant until the ProjectOptions is destroyed.
 
-#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.
-
-//manually created accelerators
-QAccel *AOncalcVariableName_1;
-QAccel *AOncalcVariableName_2;
-QAccel *AGCCSwitches;
-QAccel *AAsSwitches;
-QAccel *AA68kSwitches;
-QAccel *ACallAfterBuilding;
-QAccel *AParameters;
-
 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);
-  UnwrapLabel(LCallAfterBuilding);
-  UnwrapLabel(LParameters);
   //Toggle controls to match settings.
   ImportSettings();
   //Create the Program Options dialog and toggle its controls
@@ -72,29 +52,10 @@ void ProjectOptions::init()
   //Update stuff
   CheckOncalcNames();
   UpdateVisibilities();
-  //Create accelerators for text boxes manually
-  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);
-  MakeAccelerator(ACallAfterBuilding,CallAfterBuilding,3,ALT+Key_A);
-  MakeAccelerator(AParameters,Parameters,3,ALT+Key_R);
-  #undef MakeAccelerator
 }
 
 void ProjectOptions::destroy()
 {
-  delete(AOncalcVariableName_1);
-  delete(AOncalcVariableName_2);
-  delete(AGCCSwitches);
-  delete(AAsSwitches);
-  delete(AA68kSwitches);
-  delete(ACallAfterBuilding);
-  delete(AParameters);
   delete(programoptions);
   if (result()!=QDialog::Accepted)
     return;