瀏覽代碼

Implement Browse button for the post-build command line in the Project Options dialog. (I somehow forgot that when I finished the dialog.)
Remove double quotes around post-build substitutions for TIGCC IDE compatibility.


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

kevinkofler 18 年之前
父節點
當前提交
87a09efc06
共有 3 個文件被更改,包括 27 次插入1 次删除
  1. 7 0
      ktigcc/mainform.ui.h
  2. 8 1
      ktigcc/projectoptions.ui
  3. 12 0
      ktigcc/projectoptions.ui.h

+ 7 - 0
ktigcc/mainform.ui.h

@@ -3953,6 +3953,13 @@ void MainForm::linkProject()
     // Post-build processing.
     statusBar()->message("Calling User-Defined Program...");
     QString postBuild=settings.post_build;
+    // Remove double quotes for TIGCC IDE compatibility. Single quotes will be
+    // added instead.
+    postBuild.replace("\"($TI89FILE)\"","($TI89FILE)",FALSE);
+    postBuild.replace("\"($TI89TIFILE)\"","($TI89TIFILE)",FALSE);
+    postBuild.replace("\"($TI92PLUSFILE)\"","($TI92PLUSFILE)",FALSE);
+    postBuild.replace("\"($V200FILE)\"","($V200FILE)",FALSE);
+    postBuild.replace("\"($TI92FILE)\"","($TI92FILE)",FALSE);
     postBuild.replace("($TI89FILE)",
       KProcess::quote(libopts.use_ti89?projectBaseName+(
         settings.archive?".a":settings.flash_os?"-89.tib":settings.pack?".89y":

+ 8 - 1
ktigcc/projectoptions.ui

@@ -1407,7 +1407,7 @@
                                     </spacer>
                                     <widget class="KPushButton">
                                         <property name="name">
-                                            <cstring>Browse</cstring>
+                                            <cstring>browseButton</cstring>
                                         </property>
                                         <property name="text">
                                             <string>&amp;Browse...</string>
@@ -1634,6 +1634,12 @@
         <receiver>ProjectOptions</receiver>
         <slot>ProgramOptionsFunc()</slot>
     </connection>
+    <connection>
+        <sender>browseButton</sender>
+        <signal>clicked()</signal>
+        <receiver>ProjectOptions</receiver>
+        <slot>browseButton_clicked()</slot>
+    </connection>
 </connections>
 <includes>
     <include location="local" impldecl="in implementation">projectoptions.ui.h</include>
@@ -1645,6 +1651,7 @@
     <slot>CheckOncalcNames()</slot>
     <slot>UpdateVisibilities()</slot>
     <slot>ProgramOptionsFunc()</slot>
+    <slot>browseButton_clicked()</slot>
 </slots>
 <functions>
     <function access="private" specifier="non virtual">init()</function>

+ 12 - 0
ktigcc/projectoptions.ui.h

@@ -33,6 +33,8 @@
 
 #include <qaccel.h>
 #include <kmessagebox.h>
+#include <kfiledialog.h>
+#include <kprocess.h>
 #include "ktigcc.h"
 #include "tpr.h"
 #include "programoptions.h"
@@ -252,3 +254,13 @@ void ProjectOptions::ProgramOptionsFunc()
 {
   programoptions->exec();
 }
+
+
+void ProjectOptions::browseButton_clicked()
+{
+  QString ret=KFileDialog::getOpenFileName("/usr/bin",
+    "application/x-executable application/x-executable-script",this,
+    "Choose executable");
+  if (!ret.isEmpty())
+    CallAfterBuilding->setText(KProcess::quote(ret)+" \"($TI89File)\" \"($TI92PlusFile)\" \"($V200File)\"");
+}