[PC-BSD Commits] r7205 - pcbsd/current/CrashHandler

svn at pcbsd.org svn at pcbsd.org
Wed Jul 14 06:27:43 PDT 2010


Author: kris
Date: 2010-07-14 06:27:42 -0700 (Wed, 14 Jul 2010)
New Revision: 7205

Modified:
   pcbsd/current/CrashHandler/CrashHandler.pro
   pcbsd/current/CrashHandler/crashhandler.cpp
   pcbsd/current/CrashHandler/crashhandler.ui
   pcbsd/current/CrashHandler/details.cpp
   pcbsd/current/CrashHandler/details.ui
   pcbsd/current/CrashHandler/main.cpp
Log:

Updated crash-handler for 9/CURRENT, uses only QT4 based functionality, no kde4 dependancies, move it into
/usr/local/ PREFIX by default



Modified: pcbsd/current/CrashHandler/CrashHandler.pro
===================================================================
--- pcbsd/current/CrashHandler/CrashHandler.pro	2010-07-14 09:03:55 UTC (rev 7204)
+++ pcbsd/current/CrashHandler/CrashHandler.pro	2010-07-14 13:27:42 UTC (rev 7205)
@@ -3,8 +3,8 @@
 
 CONFIG	+= qt warn_on release
 
-TARGET=CrashHandler-bin
-DESTDIR=/usr/PCBSD/bin/
+TARGET=pbi-crashhandler-gui
+DESTDIR=/usr/local/bin/
 
 SOURCES	+= main.cpp crashhandler.cpp details.cpp
 
@@ -15,10 +15,6 @@
 
 RESOURCES = CrashHandler.qrc
 
-IMAGES	= large_icon.png \
-	small_icon.png \
-	save.png
-
 TRANSLATIONS = 	i18n/CrashHandler_en.ts \
 		i18n/CrashHandler_af.ts \
 		i18n/CrashHandler_ar.ts \
@@ -84,13 +80,11 @@
 		i18n/CrashHandler_zh_TW.ts \
 		i18n/CrashHandler_zu.ts 
 
-dotrans.path=/usr/local/kde4/share/apps/pcbsd/i18n/
-dotrans.extra=cd i18n && lrelease-qt4 *.ts && cp *.qm /usr/local/kde4/share/apps/pcbsd/i18n/
+dotrans.path=/usr/local/share/apps/pcbsd/i18n/
+dotrans.extra=cd i18n && lrelease-qt4 *.ts && cp *.qm /usr/local/share/apps/pcbsd/i18n/
 
 INSTALLS += dotrans
 
-INCLUDEPATH     += /usr/PCBSD/includes /usr/local/kde4/include
+INCLUDEPATH     += /usr/local/include
 
 QMAKE_LIBDIR = /usr/local/kde4/lib /usr/local/lib/qt4 /usr/local/lib
-
-QT +=qt3support

Modified: pcbsd/current/CrashHandler/crashhandler.cpp
===================================================================
--- pcbsd/current/CrashHandler/crashhandler.cpp	2010-07-14 09:03:55 UTC (rev 7204)
+++ pcbsd/current/CrashHandler/crashhandler.cpp	2010-07-14 13:27:42 UTC (rev 7205)
@@ -21,7 +21,7 @@
 
     //Read files
     QFile file(stdout);
-    if ( file.open( IO_ReadOnly ) ) {
+    if ( file.open( QIODevice::ReadOnly ) ) {
 	QTextStream stream( &file );
 	stream.setCodec("UTF-8");
 	QString line;
@@ -36,7 +36,7 @@
 	stdoutTxt = "Error: Unable to open " + stderr + "!";
     }
     QFile file2(stderr);
-    if ( file2.open( IO_ReadOnly ) ) {
+    if ( file2.open( QIODevice::ReadOnly ) ) {
 	QTextStream stream( &file2 );
 	stream.setCodec("UTF-8");
 	QString line;

Modified: pcbsd/current/CrashHandler/crashhandler.ui
===================================================================
--- pcbsd/current/CrashHandler/crashhandler.ui	2010-07-14 09:03:55 UTC (rev 7204)
+++ pcbsd/current/CrashHandler/crashhandler.ui	2010-07-14 13:27:42 UTC (rev 7205)
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>CrashHandler</class>
- <widget class="QDialog" name="CrashHandler" >
-  <property name="geometry" >
+ <widget class="QDialog" name="CrashHandler">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
@@ -9,124 +10,103 @@
     <height>126</height>
    </rect>
   </property>
-  <property name="minimumSize" >
+  <property name="minimumSize">
    <size>
     <width>495</width>
     <height>126</height>
    </size>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string>PC-BSD Crash Handler</string>
   </property>
-  <property name="windowIcon" >
-   <iconset resource="CrashHandler.qrc" >
+  <property name="windowIcon">
+   <iconset resource="CrashHandler.qrc">
     <normaloff>:/small_icon.png</normaloff>:/small_icon.png</iconset>
   </property>
-  <layout class="QGridLayout" name="gridLayout_2" >
-   <item row="0" column="0" >
-    <layout class="QHBoxLayout" name="horizontalLayout" >
+  <layout class="QGridLayout" name="gridLayout_2">
+   <item row="0" column="0">
+    <layout class="QHBoxLayout" name="horizontalLayout">
      <item>
-      <widget class="QLabel" name="icon" >
-       <property name="sizePolicy" >
-        <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+      <widget class="QLabel" name="icon">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
-       <property name="maximumSize" >
+       <property name="maximumSize">
         <size>
          <width>64</width>
          <height>64</height>
         </size>
        </property>
-       <property name="frameShape" >
+       <property name="frameShape">
         <enum>QFrame::NoFrame</enum>
        </property>
-       <property name="frameShadow" >
+       <property name="frameShadow">
         <enum>QFrame::Plain</enum>
        </property>
-       <property name="pixmap" >
-        <pixmap resource="CrashHandler.qrc" >:/large_icon.png</pixmap>
+       <property name="pixmap">
+        <pixmap resource="CrashHandler.qrc">:/large_icon.png</pixmap>
        </property>
-       <property name="scaledContents" >
+       <property name="scaledContents">
         <bool>true</bool>
        </property>
-       <property name="wordWrap" >
+       <property name="wordWrap">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
-      <widget class="QLabel" name="text" >
-       <property name="sizePolicy" >
-        <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+      <widget class="QLabel" name="text">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
-       <property name="minimumSize" >
+       <property name="minimumSize">
         <size>
          <width>417</width>
          <height>71</height>
         </size>
        </property>
-       <property name="frameShape" >
+       <property name="frameShape">
         <enum>QFrame::NoFrame</enum>
        </property>
-       <property name="frameShadow" >
+       <property name="frameShadow">
         <enum>QFrame::Plain</enum>
        </property>
-       <property name="text" >
-        <string></string>
+       <property name="text">
+        <string/>
        </property>
-       <property name="alignment" >
+       <property name="alignment">
         <set>Qt::AlignVCenter</set>
        </property>
-       <property name="wordWrap" >
+       <property name="wordWrap">
         <bool>true</bool>
        </property>
       </widget>
      </item>
     </layout>
    </item>
-   <item row="1" column="0" >
-    <widget class="Q3Frame" name="buttonFrame" >
-     <property name="enabled" >
-      <bool>true</bool>
+   <item row="1" column="0">
+    <widget class="QGroupBox" name="groupBox">
+     <property name="title">
+      <string/>
      </property>
-     <property name="sizePolicy" >
-      <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="maximumSize" >
-      <size>
-       <width>32767</width>
-       <height>32767</height>
-      </size>
-     </property>
-     <property name="frameShape" >
-      <enum>QFrame::NoFrame</enum>
-     </property>
-     <property name="frameShadow" >
-      <enum>QFrame::Raised</enum>
-     </property>
-     <property name="lineWidth" >
-      <number>0</number>
-     </property>
-     <layout class="QGridLayout" name="gridLayout" >
-      <item row="0" column="0" >
-       <layout class="QHBoxLayout" name="horizontalLayout_2" >
+     <layout class="QGridLayout" name="gridLayout">
+      <item row="0" column="0">
+       <layout class="QHBoxLayout" name="horizontalLayout_2">
         <item>
-         <spacer name="spacer3" >
-          <property name="orientation" >
+         <spacer name="spacer3">
+          <property name="orientation">
            <enum>Qt::Horizontal</enum>
           </property>
-          <property name="sizeType" >
+          <property name="sizeType">
            <enum>QSizePolicy::Expanding</enum>
           </property>
-          <property name="sizeHint" stdset="0" >
+          <property name="sizeHint" stdset="0">
            <size>
             <width>366</width>
             <height>31</height>
@@ -135,36 +115,36 @@
          </spacer>
         </item>
         <item>
-         <widget class="QPushButton" name="detailsBut" >
-          <property name="minimumSize" >
+         <widget class="QPushButton" name="detailsBut">
+          <property name="minimumSize">
            <size>
             <width>100</width>
             <height>0</height>
            </size>
           </property>
-          <property name="text" >
+          <property name="text">
            <string>&amp;Details...</string>
           </property>
-          <property name="shortcut" >
+          <property name="shortcut">
            <string>Alt+D</string>
           </property>
          </widget>
         </item>
         <item>
-         <widget class="QPushButton" name="closeBut" >
-          <property name="minimumSize" >
+         <widget class="QPushButton" name="closeBut">
+          <property name="minimumSize">
            <size>
             <width>100</width>
             <height>0</height>
            </size>
           </property>
-          <property name="text" >
+          <property name="text">
            <string>&amp;Close</string>
           </property>
-          <property name="shortcut" >
+          <property name="shortcut">
            <string>Alt+C</string>
           </property>
-          <property name="default" >
+          <property name="default">
            <bool>true</bool>
           </property>
          </widget>
@@ -176,51 +156,42 @@
    </item>
   </layout>
  </widget>
- <layoutdefault spacing="6" margin="11" />
- <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
- <customwidgets>
-  <customwidget>
-   <class>Q3Frame</class>
-   <extends>QFrame</extends>
-   <header>Qt3Support/Q3Frame</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
+ <layoutdefault spacing="6" margin="11"/>
  <includes>
-  <include location="global" >details.h</include>
-  <include location="global" >qfile.h</include>
+  <include location="global">details.h</include>
+  <include location="global">qfile.h</include>
  </includes>
  <resources>
-  <include location="CrashHandler.qrc" />
+  <include location="CrashHandler.qrc"/>
  </resources>
  <connections>
   <connection>
-   <sender>closeBut</sender>
+   <sender>detailsBut</sender>
    <signal>clicked()</signal>
    <receiver>CrashHandler</receiver>
-   <slot>close()</slot>
+   <slot>showDetails()</slot>
    <hints>
-    <hint type="sourcelabel" >
+    <hint type="sourcelabel">
      <x>20</x>
      <y>20</y>
     </hint>
-    <hint type="destinationlabel" >
+    <hint type="destinationlabel">
      <x>20</x>
      <y>20</y>
     </hint>
    </hints>
   </connection>
   <connection>
-   <sender>detailsBut</sender>
+   <sender>closeBut</sender>
    <signal>clicked()</signal>
    <receiver>CrashHandler</receiver>
-   <slot>showDetails()</slot>
+   <slot>close()</slot>
    <hints>
-    <hint type="sourcelabel" >
+    <hint type="sourcelabel">
      <x>20</x>
      <y>20</y>
     </hint>
-    <hint type="destinationlabel" >
+    <hint type="destinationlabel">
      <x>20</x>
      <y>20</y>
     </hint>

Modified: pcbsd/current/CrashHandler/details.cpp
===================================================================
--- pcbsd/current/CrashHandler/details.cpp	2010-07-14 09:03:55 UTC (rev 7204)
+++ pcbsd/current/CrashHandler/details.cpp	2010-07-14 13:27:42 UTC (rev 7205)
@@ -23,7 +23,9 @@
 
 void Details::saveOutput()
 {
-    QString saveLocation = QFileDialog::getSaveFileName("/home", QString::null, this, tr("Save file..."), tr("Save file..."));
+    QString saveLocation = QFileDialog::getSaveFileName(this, tr("Save File"),
+                            "/home",
+                            tr("Diagnostic Text (*.txt)"));
     
     if (saveLocation == "") {
 	return;
@@ -38,15 +40,15 @@
     
     //Write the file
     QFile file(saveLocation);
-    if ( file.open( IO_WriteOnly ) ) {
+    if ( file.open( QIODevice::WriteOnly ) ) {
 	QTextStream stream( &file );
 	stream.setCodec("UTF-8");
 	stream << "Output logged from stdout\n";
 	stream << "=========================\n\n";
-	stream << stdoutBox->text() << "\n\n";
+	stream << stdoutBox->toPlainText() << "\n\n";
 	stream << "Output logged from stderr\n";
 	stream << "=========================\n\n";
-	stream << stderrBox->text();
+	stream << stderrBox->toPlainText();
 	file.close();
     }
 }

Modified: pcbsd/current/CrashHandler/details.ui
===================================================================
--- pcbsd/current/CrashHandler/details.ui	2010-07-14 09:03:55 UTC (rev 7204)
+++ pcbsd/current/CrashHandler/details.ui	2010-07-14 13:27:42 UTC (rev 7205)
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>Details</class>
- <widget class="QDialog" name="Details" >
-  <property name="geometry" >
+ <widget class="QDialog" name="Details">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
@@ -9,68 +10,72 @@
     <height>528</height>
    </rect>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string>Crash Details...</string>
   </property>
-  <property name="modal" >
+  <property name="windowIcon">
+   <iconset resource="CrashHandler.qrc">
+    <normaloff>:/save.png</normaloff>:/save.png</iconset>
+  </property>
+  <property name="modal">
    <bool>true</bool>
   </property>
-  <layout class="QGridLayout" name="gridLayout" >
-   <item row="0" column="0" >
-    <widget class="QLabel" name="stdoutLbl" >
-     <property name="frameShape" >
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0">
+    <widget class="QLabel" name="stdoutLbl">
+     <property name="frameShape">
       <enum>QFrame::NoFrame</enum>
      </property>
-     <property name="frameShadow" >
+     <property name="frameShadow">
       <enum>QFrame::Plain</enum>
      </property>
-     <property name="text" >
+     <property name="text">
       <string>Captured from Stdout:</string>
      </property>
-     <property name="wordWrap" >
+     <property name="wordWrap">
       <bool>false</bool>
      </property>
     </widget>
    </item>
-   <item row="1" column="0" colspan="3" >
-    <widget class="Q3TextEdit" name="stdoutBox" >
-     <property name="enabled" >
+   <item row="1" column="0" colspan="3">
+    <widget class="QTextEdit" name="stdoutBox">
+     <property name="enabled">
       <bool>true</bool>
      </property>
     </widget>
    </item>
-   <item row="2" column="0" >
-    <widget class="QLabel" name="stderrLbl" >
-     <property name="frameShape" >
+   <item row="2" column="0">
+    <widget class="QLabel" name="stderrLbl">
+     <property name="frameShape">
       <enum>QFrame::NoFrame</enum>
      </property>
-     <property name="frameShadow" >
+     <property name="frameShadow">
       <enum>QFrame::Plain</enum>
      </property>
-     <property name="text" >
+     <property name="text">
       <string>Captured from Stderr:</string>
      </property>
-     <property name="wordWrap" >
+     <property name="wordWrap">
       <bool>false</bool>
      </property>
     </widget>
    </item>
-   <item row="3" column="0" colspan="3" >
-    <widget class="Q3TextEdit" name="stderrBox" >
-     <property name="enabled" >
+   <item row="3" column="0" colspan="3">
+    <widget class="QTextEdit" name="stderrBox">
+     <property name="enabled">
       <bool>true</bool>
      </property>
     </widget>
    </item>
-   <item row="4" column="0" >
-    <spacer name="spacer3" >
-     <property name="orientation" >
+   <item row="4" column="0">
+    <spacer name="spacer3">
+     <property name="orientation">
       <enum>Qt::Horizontal</enum>
      </property>
-     <property name="sizeType" >
+     <property name="sizeType">
       <enum>QSizePolicy::Expanding</enum>
      </property>
-     <property name="sizeHint" stdset="0" >
+     <property name="sizeHint" stdset="0">
       <size>
        <width>481</width>
        <height>30</height>
@@ -78,44 +83,36 @@
      </property>
     </spacer>
    </item>
-   <item row="4" column="1" >
-    <widget class="QPushButton" name="saveBut" >
-     <property name="text" >
+   <item row="4" column="1">
+    <widget class="QPushButton" name="saveBut">
+     <property name="text">
       <string>&amp;Save</string>
      </property>
-     <property name="icon" >
-      <iconset resource="CrashHandler.qrc" >
+     <property name="icon">
+      <iconset resource="CrashHandler.qrc">
        <normaloff>:/save.png</normaloff>:/save.png</iconset>
      </property>
-     <property name="shortcut" >
+     <property name="shortcut">
       <string>Alt+S</string>
      </property>
     </widget>
    </item>
-   <item row="4" column="2" >
-    <widget class="QPushButton" name="closeBut" >
-     <property name="text" >
+   <item row="4" column="2">
+    <widget class="QPushButton" name="closeBut">
+     <property name="text">
       <string>&amp;Close</string>
      </property>
-     <property name="shortcut" >
+     <property name="shortcut">
       <string>Alt+C</string>
      </property>
-     <property name="default" >
+     <property name="default">
       <bool>true</bool>
      </property>
     </widget>
    </item>
   </layout>
  </widget>
- <layoutdefault spacing="6" margin="11" />
- <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
- <customwidgets>
-  <customwidget>
-   <class>Q3TextEdit</class>
-   <extends>Q3Frame</extends>
-   <header>q3textedit.h</header>
-  </customwidget>
- </customwidgets>
+ <layoutdefault spacing="6" margin="11"/>
  <tabstops>
   <tabstop>stdoutBox</tabstop>
   <tabstop>stderrBox</tabstop>
@@ -123,12 +120,11 @@
   <tabstop>closeBut</tabstop>
  </tabstops>
  <includes>
-  <include location="global" >q3filedialog.h</include>
-  <include location="global" >qfile.h</include>
-  <include location="global" >qmessagebox.h</include>
+  <include location="global">qfile.h</include>
+  <include location="global">qmessagebox.h</include>
  </includes>
  <resources>
-  <include location="CrashHandler.qrc" />
+  <include location="CrashHandler.qrc"/>
  </resources>
  <connections>
   <connection>
@@ -137,11 +133,11 @@
    <receiver>Details</receiver>
    <slot>close()</slot>
    <hints>
-    <hint type="sourcelabel" >
+    <hint type="sourcelabel">
      <x>20</x>
      <y>20</y>
     </hint>
-    <hint type="destinationlabel" >
+    <hint type="destinationlabel">
      <x>20</x>
      <y>20</y>
     </hint>
@@ -153,11 +149,11 @@
    <receiver>Details</receiver>
    <slot>saveOutput()</slot>
    <hints>
-    <hint type="sourcelabel" >
+    <hint type="sourcelabel">
      <x>20</x>
      <y>20</y>
     </hint>
-    <hint type="destinationlabel" >
+    <hint type="destinationlabel">
      <x>20</x>
      <y>20</y>
     </hint>

Modified: pcbsd/current/CrashHandler/main.cpp
===================================================================
--- pcbsd/current/CrashHandler/main.cpp	2010-07-14 09:03:55 UTC (rev 7204)
+++ pcbsd/current/CrashHandler/main.cpp	2010-07-14 13:27:42 UTC (rev 7205)
@@ -13,9 +13,9 @@
     QTranslator translator;
     QLocale mylocale;
     QString langCode = mylocale.name();
-    if ( ! QFile::exists("/usr/local/kde4/share/apps/pcbsd/i18n/CrashHandler_" + langCode + ".qm" ) )
+    if ( ! QFile::exists("/usr/local/share/apps/pcbsd/i18n/CrashHandler_" + langCode + ".qm" ) )
       langCode.truncate(langCode.indexOf("_"));
-    translator.load( QString("CrashHandler_") + langCode, "/usr/local/kde4/share/apps/pcbsd/i18n/" );
+    translator.load( QString("CrashHandler_") + langCode, "/usr/local/share/apps/pcbsd/i18n/" );
     a.installTranslator( &translator );
     qDebug() << "Locale:" << langCode;
     



More information about the Commits mailing list