Sfoglia il codice sorgente

Create Errors and Warnings window.

git-svn-id: file:///var/svn/tigccpp/trunk@608 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 18 anni fa
parent
commit
9ed8d19817
5 ha cambiato i file con 235 aggiunte e 11 eliminazioni
  1. 2 1
      ktigcc/KTIGCC.prj
  2. 185 0
      ktigcc/errorlist.ui
  3. 2 1
      ktigcc/ktigcc.pro
  4. 14 7
      ktigcc/mainform.ui
  5. 32 2
      ktigcc/mainform.ui.h

+ 2 - 1
ktigcc/KTIGCC.prj

@@ -90,7 +90,8 @@ module.source.files=\
 	tpr.cpp\
 	configure\
 	fedora/ktigcc.spec\
-	srcfilewin.ui
+	srcfilewin.ui\
+	errorlist.ui
 
 module.pixmap.name=.
 module.pixmap.type=

+ 185 - 0
ktigcc/errorlist.ui

@@ -0,0 +1,185 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>ErrorList</class>
+<widget class="QWidget">
+    <property name="name">
+        <cstring>ErrorList</cstring>
+    </property>
+    <property name="geometry">
+        <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>798</width>
+            <height>153</height>
+        </rect>
+    </property>
+    <property name="sizePolicy">
+        <sizepolicy>
+            <hsizetype>7</hsizetype>
+            <vsizetype>7</vsizetype>
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+        </sizepolicy>
+    </property>
+    <property name="caption">
+        <string>Errors and Warnings</string>
+    </property>
+    <vbox>
+        <property name="name">
+            <cstring>unnamed</cstring>
+        </property>
+        <property name="margin">
+            <number>0</number>
+        </property>
+        <widget class="QLayoutWidget">
+            <property name="name">
+                <cstring>layout1</cstring>
+            </property>
+            <hbox>
+                <property name="name">
+                    <cstring>unnamed</cstring>
+                </property>
+                <widget class="QLabel">
+                    <property name="name">
+                        <cstring>errorsLabel</cstring>
+                    </property>
+                    <property name="text">
+                        <string>Errors:</string>
+                    </property>
+                </widget>
+                <widget class="QLabel">
+                    <property name="name">
+                        <cstring>errorCount</cstring>
+                    </property>
+                    <property name="sizePolicy">
+                        <sizepolicy>
+                            <hsizetype>1</hsizetype>
+                            <vsizetype>5</vsizetype>
+                            <horstretch>0</horstretch>
+                            <verstretch>0</verstretch>
+                        </sizepolicy>
+                    </property>
+                    <property name="minimumSize">
+                        <size>
+                            <width>40</width>
+                            <height>0</height>
+                        </size>
+                    </property>
+                    <property name="text">
+                        <string>0</string>
+                    </property>
+                </widget>
+                <widget class="QLabel">
+                    <property name="name">
+                        <cstring>warningsLabel</cstring>
+                    </property>
+                    <property name="text">
+                        <string>Warnings:</string>
+                    </property>
+                </widget>
+                <widget class="QLabel">
+                    <property name="name">
+                        <cstring>warningCount</cstring>
+                    </property>
+                    <property name="sizePolicy">
+                        <sizepolicy>
+                            <hsizetype>1</hsizetype>
+                            <vsizetype>5</vsizetype>
+                            <horstretch>0</horstretch>
+                            <verstretch>0</verstretch>
+                        </sizepolicy>
+                    </property>
+                    <property name="minimumSize">
+                        <size>
+                            <width>40</width>
+                            <height>0</height>
+                        </size>
+                    </property>
+                    <property name="text">
+                        <string>0</string>
+                    </property>
+                </widget>
+                <spacer>
+                    <property name="name">
+                        <cstring>spacer2</cstring>
+                    </property>
+                    <property name="orientation">
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property name="sizeType">
+                        <enum>Expanding</enum>
+                    </property>
+                    <property name="sizeHint">
+                        <size>
+                            <width>121</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+            </hbox>
+        </widget>
+        <widget class="KListView">
+            <column>
+                <property name="text">
+                    <string>Message</string>
+                </property>
+                <property name="clickable">
+                    <bool>false</bool>
+                </property>
+                <property name="resizable">
+                    <bool>true</bool>
+                </property>
+            </column>
+            <column>
+                <property name="text">
+                    <string>File</string>
+                </property>
+                <property name="clickable">
+                    <bool>false</bool>
+                </property>
+                <property name="resizable">
+                    <bool>true</bool>
+                </property>
+            </column>
+            <column>
+                <property name="text">
+                    <string>Function</string>
+                </property>
+                <property name="clickable">
+                    <bool>false</bool>
+                </property>
+                <property name="resizable">
+                    <bool>true</bool>
+                </property>
+            </column>
+            <property name="name">
+                <cstring>errorListView</cstring>
+            </property>
+            <property name="paletteBackgroundColor">
+                <color>
+                    <red>255</red>
+                    <green>255</green>
+                    <blue>255</blue>
+                </color>
+            </property>
+            <property name="allColumnsShowFocus">
+                <bool>true</bool>
+            </property>
+            <property name="itemsMovable">
+                <bool>false</bool>
+            </property>
+            <property name="alternateBackground">
+                <color>
+                    <red>255</red>
+                    <green>255</green>
+                    <blue>255</blue>
+                </color>
+            </property>
+        </widget>
+    </vbox>
+</widget>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+    <includehint>klistview.h</includehint>
+</includehints>
+</UI>

+ 2 - 1
ktigcc/ktigcc.pro

@@ -18,7 +18,8 @@ FORMS	= srcfilewin.ui \
 	projectoptions.ui \
 	programoptions.ui \
 	preferencesdlg.ui \
-	mainform.ui
+	mainform.ui \
+	errorlist.ui
 
 IMAGES	= images/00 \
 	images/01 \

+ 14 - 7
ktigcc/mainform.ui

@@ -41,6 +41,13 @@
                 <property name="name">
                     <cstring>fileTree</cstring>
                 </property>
+                <property name="paletteBackgroundColor">
+                    <color>
+                        <red>255</red>
+                        <green>255</green>
+                        <blue>255</blue>
+                    </color>
+                </property>
                 <property name="acceptDrops">
                     <bool>true</bool>
                 </property>
@@ -140,7 +147,7 @@
         <action name="projectMakeAction"/>
         <action name="projectBuildAction"/>
         <separator/>
-        <action name="projectErrorsWarningsAction"/>
+        <action name="projectErrorsAndWarningsAction"/>
         <action name="projectProgramOutputAction"/>
         <separator/>
         <action name="projectOptionsAction"/>
@@ -917,7 +924,7 @@
     </action>
     <action>
         <property name="name">
-            <cstring>projectErrorsWarningsAction</cstring>
+            <cstring>projectErrorsAndWarningsAction</cstring>
         </property>
         <property name="toggleAction">
             <bool>true</bool>
@@ -1497,10 +1504,10 @@
         <slot>projectCompile()</slot>
     </connection>
     <connection>
-        <sender>projectErrorsWarningsAction</sender>
-        <signal>activated()</signal>
+        <sender>projectErrorsAndWarningsAction</sender>
+        <signal>toggled(bool)</signal>
         <receiver>MainForm</receiver>
-        <slot>projectErrorsAndWarnings()</slot>
+        <slot>projectErrorsAndWarnings(bool)</slot>
     </connection>
     <connection>
         <sender>projectMakeAction</sender>
@@ -1578,7 +1585,7 @@
     <slot>projectCompile()</slot>
     <slot>projectMake()</slot>
     <slot>projectBuild()</slot>
-    <slot>projectErrorsAndWarnings()</slot>
+    <slot>projectErrorsAndWarnings( bool on )</slot>
     <slot>projectProgramOutput()</slot>
     <slot>projectOptions()</slot>
     <slot>debugRun()</slot>
@@ -1624,6 +1631,7 @@
     <function access="private" specifier="non virtual" returnType="QListViewItem *">openFile( QListViewItem * category, QListViewItem * parent, const QString &amp; fileCaption, const QString &amp; fileName )</function>
     <function access="private" specifier="static" returnType="QListViewItem *">createFolder( QListViewItem * parent, const QString &amp; name )</function>
     <function specifier="non virtual" returnType="void *">createView( const QString &amp; fileName, const QString &amp; fileText, QListViewItem * category )</function>
+    <function>adoptSourceFile( void * srcFile )</function>
     <function access="private" specifier="non virtual">fileOpen_addList( QListViewItem * category, void * fileListV, void * dir, const QString &amp; open_file )</function>
     <function access="private" specifier="non virtual" returnType="bool">openProject( const QString &amp; fileName )</function>
     <function specifier="non virtual" returnType="int">fileSavePrompt( QListViewItem * fileItem )</function>
@@ -1645,7 +1653,6 @@
     <function access="private" specifier="non virtual">updateRightStatusLabel()</function>
     <function access="private" specifier="non virtual">current_view_newLineHook()</function>
     <function access="protected">closeEvent( QCloseEvent * e )</function>
-    <function>adoptSourceFile(void *srcFile)</function>
 </functions>
 <pixmapinproject/>
 <layoutdefaults spacing="0" margin="0"/>

+ 32 - 2
ktigcc/mainform.ui.h

@@ -40,6 +40,7 @@
 #include <qclipboard.h>
 #include <qaccel.h>
 #include <qeventloop.h>
+#include <qdockwindow.h>
 #include <kparts/factory.h>
 #include <klibloader.h>
 #include <kate/document.h>
@@ -68,6 +69,7 @@
 #include "tpr.h"
 #include "preferences.h"
 #include "projectoptions.h"
+#include "errorlist.h"
 
 using std::puts;
 using std::exit;
@@ -343,6 +345,8 @@ static QLabel *charsStatusLabel;
 static QLabel *rightStatusLabel;
 static KHelpMenu *khelpmenu;
 static QPopupMenu *te_popup;
+static QDockWindow *errorListDock;
+static ErrorList *errorList;
 QAssistantClient *assistant;
 static int fileCount=0, hFileCount=0, cFileCount=0, sFileCount=0, asmFileCount=0, qllFileCount=0, oFileCount=0, aFileCount=0, txtFileCount=0, othFileCount=0;
 tprSettings settings; //static is turned off here so ProjectOptions can access it.
@@ -783,6 +787,20 @@ void MainForm::init()
     toolsConfigureAction->setIconSet(LOAD_ICON("configure"));
     debugResetAction->setIconSet(LOAD_ICON("player_stop"));
   }
+  errorListDock=new QDockWindow(QDockWindow::InDock,this);
+  errorListDock->setResizeEnabled(TRUE);
+  errorListDock->setCloseMode(QDockWindow::Always);
+  addToolBar(errorListDock,Qt::DockBottom);
+  errorList=new ErrorList(errorListDock);
+  errorListDock->setWidget(errorList);
+  errorList->show();
+  errorListDock->setCaption("Errors and Warnings");
+  errorListDock->hide();
+  setDockEnabled(errorListDock,Qt::DockTop,FALSE);
+  setDockEnabled(errorListDock,Qt::DockLeft,FALSE);
+  setDockEnabled(errorListDock,Qt::DockRight,FALSE);
+  connect(errorListDock,SIGNAL(visibilityChanged(bool)),
+          this,SLOT(projectErrorsAndWarnings(bool)));
 }
 
 void MainForm::destroy()
@@ -802,6 +820,8 @@ void MainForm::destroy()
   delete rootListItem;
   delete khelpmenu;
   delete assistant;
+  delete errorList;
+  delete errorListDock;
 }
 
 void MainForm::te_popup_aboutToShow()
@@ -2672,9 +2692,19 @@ void MainForm::projectBuild()
   
 }
 
-void MainForm::projectErrorsAndWarnings()
+void MainForm::projectErrorsAndWarnings(bool on)
 {
-  
+  static bool lock=FALSE;
+  if (!lock) {
+    lock=TRUE;
+    if (!projectErrorsAndWarningsAction->isEnabled()) on=FALSE;
+    projectErrorsAndWarningsAction->setOn(on);
+    if (on)
+      errorListDock->show();
+    else
+      errorListDock->hide();
+    lock=FALSE;
+  }
 }
 
 void MainForm::projectProgramOutput()