Browse Source

Also create the Functions popup menu for out-of-project source files.
Also disable Find/Functions for out-of-project plain text files.


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

kevinkofler 18 years ago
parent
commit
418fcf1c39
4 changed files with 27 additions and 3 deletions
  1. 1 1
      ktigcc/mainform.ui.h
  2. 3 2
      ktigcc/srcfile.h
  3. 2 0
      ktigcc/srcfilewin.ui
  4. 21 0
      ktigcc/srcfilewin.ui.h

+ 1 - 1
ktigcc/mainform.ui.h

@@ -1882,7 +1882,7 @@ bool MainForm::openProject(const QString &fileName)
                    (type==2)?"GNU Assembler 68k":
                    (type==3)?"Motorola Assembler 68k":
                    (type==1)?"C":
-                    "None",category,(type==1),(type>1));
+                    "None",category,(type==1),(type>1),category==txtFilesListItem);
     return FALSE;
   }
 }

+ 3 - 2
ktigcc/srcfile.h

@@ -38,9 +38,9 @@ class KDirWatch;
 
 struct SourceFile : public SourceFileWindow {
   SourceFile(MainForm *mainfrm, const QString &fn, const QString &ft,
-             const QString &hlm, void *cat, bool isc, bool isasm) :
+             const QString &hlm, void *cat, bool isc, bool isasm, bool istxt) :
     SourceFileWindow(), mainForm(mainfrm), fileName(fn), fileText(ft),
-    hlMode(hlm), category(cat), isCFile(isc), isASMFile(isasm)
+    hlMode(hlm), category(cat), isCFile(isc), isASMFile(isasm), isTextFile(istxt)
   {
     initBase(); // We can do this only after initializing the variables here.
     show();
@@ -53,6 +53,7 @@ struct SourceFile : public SourceFileWindow {
   void *category;
   bool isCFile;
   bool isASMFile;
+  bool isTextFile;
   LineStartList lineStartList;
 
   KReplaceWithSelectionS *kreplace;

+ 2 - 0
ktigcc/srcfilewin.ui

@@ -655,6 +655,8 @@
     <slot>current_view_charactersInteractivelyInserted( int line, int col, const QString &amp; characters )</slot>
     <slot>clipboard_dataChanged()</slot>
     <slot>KDirWatch_dirty( const QString &amp; fileName )</slot>
+    <slot>findFunctionsPopup_aboutToShow()</slot>
+    <slot>findFunctionsPopup_activated(int id)</slot>
 </slots>
 <functions>
     <function>initBase()</function>

+ 21 - 0
ktigcc/srcfilewin.ui.h

@@ -41,6 +41,7 @@
 #include <qaccel.h>
 #include <qeventloop.h>
 #include <qlayout.h>
+#include <qtoolbutton.h>
 #include <kparts/factory.h>
 #include <klibloader.h>
 #include <kate/document.h>
@@ -247,6 +248,16 @@ void SourceFileWindow::initBase()
     // stop compilation: "stop"
     // force-quit compiler: "button_cancel"
   }
+  QToolButton *findFunctionsButton=static_cast<QToolButton *>(toolBar
+    ->child("findFunctionsAction_action_button","QToolButton",FALSE));
+  QPopupMenu *findFunctionsPopup=new QPopupMenu(findFunctionsButton);
+  connect(findFunctionsPopup,SIGNAL(aboutToShow()),
+          this,SLOT(findFunctionsPopup_aboutToShow()));
+  connect(findFunctionsPopup,SIGNAL(activated(int)),
+          this,SLOT(findFunctionsPopup_activated(int)));
+  findFunctionsButton->setPopupDelay(0);
+  findFunctionsButton->setPopup(findFunctionsPopup);
+  if (THIS->isTextFile) findFunctionsAction->setEnabled(FALSE);
 }
 
 void SourceFileWindow::destroy()
@@ -930,6 +941,16 @@ void SourceFileWindow::findFunctions()
   
 }
 
+void SourceFileWindow::findFunctionsPopup_aboutToShow()
+{
+
+}
+
+void SourceFileWindow::findFunctionsPopup_activated(int id)
+{
+
+}
+
 void SourceFileWindow::findOpenFileAtCursor()
 {