summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2009-08-15 17:02:25 +0000
committerDominik Wenger <domonoky@googlemail.com>2009-08-15 17:02:25 +0000
commit426bfa8d037e458bd58a4c2dca82cbddae2a2f66 (patch)
treeae7250597cec8a9a1dcbd680e044204ca331cc27
parent2402aecbb5eeb82c5920f9d837cd287581c11c05 (diff)
downloadrockbox-426bfa8d037e458bd58a4c2dca82cbddae2a2f66.tar.gz
rockbox-426bfa8d037e458bd58a4c2dca82cbddae2a2f66.tar.bz2
rockbox-426bfa8d037e458bd58a4c2dca82cbddae2a2f66.zip
rbutil: add a errorlog function into rbutil and the possibility to save a log if a error happens. (thanks to bluebrother for the trace functionality)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22329 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--rbutil/rbutilqt/main.cpp4
-rw-r--r--rbutil/rbutilqt/progressloggerfrm.ui67
-rw-r--r--rbutil/rbutilqt/progressloggergui.cpp53
-rw-r--r--rbutil/rbutilqt/progressloggergui.h1
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp12
-rw-r--r--rbutil/rbutilqt/rbutilqt.h3
-rw-r--r--rbutil/rbutilqt/rbutilqt.pro12
-rw-r--r--rbutil/rbutilqt/rbutilqtfrm.ui139
-rw-r--r--rbutil/rbutilqt/sysinfo.cpp11
-rw-r--r--rbutil/rbutilqt/sysinfo.h3
-rw-r--r--rbutil/rbutilqt/systrace.cpp65
-rw-r--r--rbutil/rbutilqt/systrace.h47
-rw-r--r--rbutil/rbutilqt/systracefrm.ui77
13 files changed, 400 insertions, 94 deletions
diff --git a/rbutil/rbutilqt/main.cpp b/rbutil/rbutilqt/main.cpp
index 0b720d60f6..086dc65ea6 100644
--- a/rbutil/rbutilqt/main.cpp
+++ b/rbutil/rbutilqt/main.cpp
@@ -20,13 +20,17 @@
#include <QtGui>
#include "rbutilqt.h"
+#include "systrace.h"
#ifdef STATIC
#include <QtPlugin>
Q_IMPORT_PLUGIN(qtaccessiblewidgets)
#endif
+
+
int main( int argc, char ** argv ) {
+ qInstallMsgHandler(SysTrace::debug);
QApplication app( argc, argv );
#if defined(Q_OS_MAC)
QDir dir(QApplication::applicationDirPath());
diff --git a/rbutil/rbutilqt/progressloggerfrm.ui b/rbutil/rbutilqt/progressloggerfrm.ui
index 5e8dea6932..a46e537a18 100644
--- a/rbutil/rbutilqt/progressloggerfrm.ui
+++ b/rbutil/rbutilqt/progressloggerfrm.ui
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>ProgressLoggerFrm</class>
- <widget class="QDialog" name="ProgressLoggerFrm" >
- <property name="geometry" >
+ <widget class="QDialog" name="ProgressLoggerFrm">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -9,52 +10,62 @@
<height>302</height>
</rect>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Progress</string>
</property>
- <layout class="QGridLayout" >
- <item row="0" column="0" colspan="2" >
- <widget class="QLabel" name="labelHeader" >
- <property name="text" >
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="labelHeader">
+ <property name="text">
<string>Progress</string>
</property>
- <property name="wordWrap" >
+ <property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
- <item row="1" column="0" colspan="2" >
- <widget class="QListWidget" name="listProgress" >
- <property name="focusPolicy" >
+ <item row="1" column="0" colspan="3">
+ <widget class="QListWidget" name="listProgress">
+ <property name="focusPolicy">
<enum>Qt::TabFocus</enum>
</property>
- <property name="accessibleName" >
+ <property name="accessibleName">
<string>progresswindow</string>
</property>
- <property name="tabKeyNavigation" >
+ <property name="tabKeyNavigation">
<bool>true</bool>
</property>
- <property name="selectionBehavior" >
+ <property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
- <property name="wordWrap" >
+ <property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
- <item row="2" column="0" colspan="2" >
- <widget class="QProgressBar" name="progressBar" >
- <property name="value" >
+ <item row="2" column="0" colspan="3">
+ <widget class="QProgressBar" name="progressBar">
+ <property name="value">
<number>0</number>
</property>
</widget>
</item>
- <item row="3" column="0" >
+ <item row="3" column="0">
+ <widget class="QPushButton" name="saveLog">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Save Log</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" stdset="0" >
+ <property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
@@ -62,13 +73,13 @@
</property>
</spacer>
</item>
- <item row="3" column="1" >
- <widget class="QPushButton" name="buttonAbort" >
- <property name="text" >
+ <item row="3" column="2">
+ <widget class="QPushButton" name="buttonAbort">
+ <property name="text">
<string>&amp;Abort</string>
</property>
- <property name="icon" >
- <iconset resource="rbutilqt.qrc" >
+ <property name="icon">
+ <iconset resource="rbutilqt.qrc">
<normaloff>:/icons/process-stop.png</normaloff>:/icons/process-stop.png</iconset>
</property>
</widget>
@@ -76,7 +87,7 @@
</layout>
</widget>
<resources>
- <include location="rbutilqt.qrc" />
+ <include location="rbutilqt.qrc"/>
</resources>
<connections/>
</ui>
diff --git a/rbutil/rbutilqt/progressloggergui.cpp b/rbutil/rbutilqt/progressloggergui.cpp
index a6405a9619..de2be96165 100644
--- a/rbutil/rbutilqt/progressloggergui.cpp
+++ b/rbutil/rbutilqt/progressloggergui.cpp
@@ -19,12 +19,17 @@
#include "progressloggergui.h"
+#include "sysinfo.h"
+#include "systrace.h"
+
ProgressLoggerGui::ProgressLoggerGui(QWidget* parent): ProgressloggerInterface(parent)
{
downloadProgress = new QDialog(parent);
downloadProgress->setModal(true);
dp.setupUi(downloadProgress);
dp.listProgress->setAlternatingRowColors(true);
+ dp.saveLog->hide();
+ connect(dp.saveLog,SIGNAL(clicked()),this,SLOT(saveErrorLog()));
setRunning();
}
@@ -52,6 +57,7 @@ void ProgressLoggerGui::addItem(const QString &text, int flag)
break;
case LOGERROR:
item->setIcon(QIcon(":/icons/dialog-error.png"));
+ dp.saveLog->show();
break;
}
@@ -134,4 +140,51 @@ void ProgressLoggerGui::show()
downloadProgress->show();
}
+void ProgressLoggerGui::saveErrorLog()
+{
+ QString filename = QFileDialog::getSaveFileName(downloadProgress, tr("Save system trace log"),
+ QDir::homePath(), "*.log");
+
+ QFile file(filename);
+ file.open(QIODevice::WriteOnly);
+
+ //Logger texts
+ QString loggerTexts = "\n*********************************************\n"
+ "*************** Logger *******************\n"
+ "*********************************************\n";
+ file.write(loggerTexts.toUtf8(), loggerTexts.size());
+
+
+ int i=0;
+ loggerTexts = "";
+ while(dp.listProgress->item(i) != NULL)
+ {
+ loggerTexts.append(dp.listProgress->item(i)->text());
+ loggerTexts.append("\n");
+ i++;
+ }
+ file.write(loggerTexts.toUtf8(), loggerTexts.size());
+
+ //systeminfo
+ QString info = "\n*********************************************\n"
+ "************ SYSTEMINFO *******************\n"
+ "*********************************************\n";
+
+ file.write(info.toUtf8(), info.size());
+ info = Sysinfo::getInfo();
+ info.replace(QRegExp("(<[^>]+>)+"),"\n");
+ file.write(info.toUtf8(), info.size());
+
+ // trace
+ QString trace = "\n*********************************************\n"
+ "*********** TRACE **************************\n"
+ "*********************************************\n";
+ file.write(trace.toUtf8(), trace.size());
+ trace = SysTrace::getTrace();
+ file.write(trace.toUtf8(), trace.size());
+
+ file.close();
+}
+
+
diff --git a/rbutil/rbutilqt/progressloggergui.h b/rbutil/rbutilqt/progressloggergui.h
index c5e8c449ce..a0c24d6a26 100644
--- a/rbutil/rbutilqt/progressloggergui.h
+++ b/rbutil/rbutilqt/progressloggergui.h
@@ -51,6 +51,7 @@ public slots:
virtual void setRunning();
virtual void setFinished();
+ void saveErrorLog();
private:
Ui::ProgressLoggerFrm dp;
QDialog *downloadProgress;
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index af79f2edef..f2630e41ff 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -34,6 +34,7 @@
#include "rbzip.h"
#include "sysinfo.h"
#include "system.h"
+#include "systrace.h"
#include "rbsettings.h"
#include "progressloggerinterface.h"
@@ -124,6 +125,7 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
connect(ui.actionRemove_bootloader, SIGNAL(triggered()), this, SLOT(uninstallBootloader()));
connect(ui.actionUninstall_Rockbox, SIGNAL(triggered()), this, SLOT(uninstall()));
connect(ui.action_System_Info, SIGNAL(triggered()), this, SLOT(sysinfo()));
+ connect(ui.action_Trace, SIGNAL(triggered()), this, SLOT(trace()));
#if !defined(STATIC)
ui.actionInstall_Rockbox_Utility_on_player->setEnabled(false);
@@ -134,10 +136,16 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
}
+void RbUtilQt::trace(void)
+{
+ SysTrace wnd(this);
+ wnd.exec();
+}
+
void RbUtilQt::sysinfo(void)
{
- Sysinfo *info = new Sysinfo(this);
- info->show();
+ Sysinfo info(this);
+ info.exec();
}
void RbUtilQt::updateTabs(int count)
diff --git a/rbutil/rbutilqt/rbutilqt.h b/rbutil/rbutilqt/rbutilqt.h
index 10bef6e8b8..b5368c9ae3 100644
--- a/rbutil/rbutilqt/rbutilqt.h
+++ b/rbutil/rbutilqt/rbutilqt.h
@@ -41,7 +41,7 @@ class RbUtilQt : public QMainWindow
private:
Ui::RbUtilQtFrm ui;
-
+
void initDeviceNames(void);
QString deviceName(QString);
QString platform;
@@ -67,6 +67,7 @@ class RbUtilQt : public QMainWindow
void about(void);
void help(void);
void sysinfo(void);
+ void trace(void);
void configDialog(void);
void updateDevice(void);
void updateSettings(void);
diff --git a/rbutil/rbutilqt/rbutilqt.pro b/rbutil/rbutilqt/rbutilqt.pro
index 97f717f6de..cf7f944824 100644
--- a/rbutil/rbutilqt/rbutilqt.pro
+++ b/rbutil/rbutilqt/rbutilqt.pro
@@ -42,7 +42,7 @@ QMAKE_EXTRA_TARGETS += lrelease
PRE_TARGETDEPS += lrelease
}
-#custum rules for libucl.a
+#custom rules for libucl.a
!mac {
libucl.commands = @$(MAKE) -C ../../tools/ucl/src libucl.a
}
@@ -52,7 +52,7 @@ libucl.commands = @$(MAKE) -C ../../tools/ucl/src libucl-universal
QMAKE_EXTRA_TARGETS += libucl
PRE_TARGETDEPS += libucl
-#custum rules for libmkamsboot.a
+#custom rules for libmkamsboot.a
!mac {
libmkamsboot.commands = @$(MAKE) -C ../mkamsboot libmkamsboot.a
}
@@ -96,6 +96,7 @@ SOURCES += rbutilqt.cpp \
base/rbzip.cpp \
base/system.cpp \
sysinfo.cpp \
+ systrace.cpp \
base/bootloaderinstallbase.cpp \
base/bootloaderinstallmi4.cpp \
base/bootloaderinstallhex.cpp \
@@ -150,6 +151,7 @@ HEADERS += rbutilqt.h \
base/rbzip.h \
sysinfo.h \
base/system.h \
+ systrace.h \
base/bootloaderinstallbase.h \
base/bootloaderinstallmi4.h \
base/bootloaderinstallhex.h \
@@ -174,7 +176,8 @@ dbg {
}
!dbg {
CONFIG += release thread qt
- DEFINES += QT_NO_DEBUG_OUTPUT
+ DEFINES -= QT_NO_DEBUG_OUTPUT
+ DEFINES += NODEBUG
message("release")
}
@@ -191,7 +194,8 @@ FORMS += rbutilqtfrm.ui \
uninstallfrm.ui \
previewfrm.ui \
createvoicefrm.ui \
- sysinfofrm.ui
+ sysinfofrm.ui \
+ systracefrm.ui
RESOURCES += rbutilqt.qrc
win32 {
diff --git a/rbutil/rbutilqt/rbutilqtfrm.ui b/rbutil/rbutilqt/rbutilqtfrm.ui
index ba94259557..013da62500 100644
--- a/rbutil/rbutilqt/rbutilqtfrm.ui
+++ b/rbutil/rbutilqt/rbutilqtfrm.ui
@@ -13,7 +13,8 @@
<string>Rockbox Utility</string>
</property>
<property name="windowIcon" >
- <iconset resource="rbutilqt.qrc" >:/icons/rockbox-1.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/rockbox-1.png</normaloff>:/icons/rockbox-1.png</iconset>
</property>
<widget class="QWidget" name="centralwidget" >
<layout class="QGridLayout" >
@@ -22,16 +23,7 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
- <number>0</number>
- </property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
+ <property name="margin" >
<number>0</number>
</property>
<item>
@@ -39,7 +31,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
@@ -62,7 +54,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
@@ -103,7 +95,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
@@ -117,7 +109,8 @@
<string>&amp;Change</string>
</property>
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/edit-find.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/edit-find.png</normaloff>:/icons/edit-find.png</iconset>
</property>
</widget>
</item>
@@ -143,7 +136,8 @@
<string>Complete Installation</string>
</property>
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/bootloader_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/bootloader_btn.png</normaloff>:/icons/bootloader_btn.png</iconset>
</property>
<property name="iconSize" >
<size>
@@ -172,7 +166,8 @@
<string>Minimal Installation</string>
</property>
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/rbinstall_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/rbinstall_btn.png</normaloff>:/icons/rbinstall_btn.png</iconset>
</property>
<property name="iconSize" >
<size>
@@ -200,7 +195,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>91</height>
@@ -213,7 +208,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>81</height>
@@ -237,7 +232,8 @@
<string>Install Bootloader</string>
</property>
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/bootloader_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/bootloader_btn.png</normaloff>:/icons/bootloader_btn.png</iconset>
</property>
<property name="iconSize" >
<size>
@@ -266,7 +262,8 @@
<string>Install Rockbox</string>
</property>
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/rbinstall_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/rbinstall_btn.png</normaloff>:/icons/rbinstall_btn.png</iconset>
</property>
<property name="iconSize" >
<size>
@@ -297,7 +294,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>91</height>
@@ -310,7 +307,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>81</height>
@@ -334,7 +331,8 @@
<string>Install Fonts package</string>
</property>
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/font_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/font_btn.png</normaloff>:/icons/font_btn.png</iconset>
</property>
<property name="iconSize" >
<size>
@@ -360,7 +358,8 @@
<string>Install themes</string>
</property>
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/themes_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/themes_btn.png</normaloff>:/icons/themes_btn.png</iconset>
</property>
<property name="iconSize" >
<size>
@@ -386,7 +385,8 @@
<string>Install game files</string>
</property>
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/doom_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/doom_btn.png</normaloff>:/icons/doom_btn.png</iconset>
</property>
<property name="iconSize" >
<size>
@@ -411,7 +411,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
@@ -424,7 +424,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
@@ -448,7 +448,8 @@
<string>Install Voice files</string>
</property>
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/talkfile_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/talkfile_btn.png</normaloff>:/icons/talkfile_btn.png</iconset>
</property>
<property name="iconSize" >
<size>
@@ -474,7 +475,8 @@
<string>Install Talk files</string>
</property>
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/talkfile_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/talkfile_btn.png</normaloff>:/icons/talkfile_btn.png</iconset>
</property>
<property name="iconSize" >
<size>
@@ -496,7 +498,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>51</height>
@@ -509,7 +511,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>51</height>
@@ -523,7 +525,8 @@
<string>Create Voice files</string>
</property>
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/talkfile_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/talkfile_btn.png</normaloff>:/icons/talkfile_btn.png</iconset>
</property>
<property name="iconSize" >
<size>
@@ -560,7 +563,8 @@
<string>Uninstall Bootloader</string>
</property>
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/rembootloader_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/rembootloader_btn.png</normaloff>:/icons/rembootloader_btn.png</iconset>
</property>
<property name="iconSize" >
<size>
@@ -586,7 +590,8 @@
<string>Uninstall Rockbox</string>
</property>
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/remrb_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/remrb_btn.png</normaloff>:/icons/remrb_btn.png</iconset>
</property>
<property name="iconSize" >
<size>
@@ -617,7 +622,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
@@ -630,7 +635,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
@@ -663,7 +668,7 @@
<bool>true</bool>
</property>
<property name="textInteractionFlags" >
- <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::NoTextInteraction</set>
+ <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse</set>
</property>
</widget>
</item>
@@ -676,7 +681,7 @@
<bool>true</bool>
</property>
<property name="textInteractionFlags" >
- <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::NoTextInteraction</set>
+ <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse</set>
</property>
</widget>
</item>
@@ -712,7 +717,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
@@ -735,7 +740,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
@@ -784,7 +789,7 @@
<x>0</x>
<y>0</y>
<width>650</width>
- <height>28</height>
+ <height>31</height>
</rect>
</property>
<widget class="QMenu" name="menu_File" >
@@ -800,10 +805,17 @@
<property name="title" >
<string>Abou&amp;t</string>
</property>
+ <widget class="QMenu" name="menu_Troubleshoot" >
+ <property name="title" >
+ <string>&amp;Troubleshoot</string>
+ </property>
+ <addaction name="action_System_Info" />
+ <addaction name="action_Trace" />
+ </widget>
<addaction name="action_About" />
<addaction name="actionAbout_Qt" />
<addaction name="separator" />
- <addaction name="action_System_Info" />
+ <addaction name="menu_Troubleshoot" />
<addaction name="action_Help" />
</widget>
<widget class="QMenu" name="menuA_ctions" >
@@ -903,7 +915,8 @@
</action>
<action name="actionComplete_Installation" >
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/bootloader_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/bootloader_btn.png</normaloff>:/icons/bootloader_btn.png</iconset>
</property>
<property name="text" >
<string>&amp;Complete Installation</string>
@@ -911,7 +924,8 @@
</action>
<action name="actionSmall_Installation" >
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/rbinstall_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/rbinstall_btn.png</normaloff>:/icons/rbinstall_btn.png</iconset>
</property>
<property name="text" >
<string>&amp;Minimal Installation</string>
@@ -919,7 +933,8 @@
</action>
<action name="actionInstall_Bootloader" >
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/bootloader_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/bootloader_btn.png</normaloff>:/icons/bootloader_btn.png</iconset>
</property>
<property name="text" >
<string>Install &amp;Bootloader</string>
@@ -927,7 +942,8 @@
</action>
<action name="actionInstall_Rockbox" >
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/rbinstall_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/rbinstall_btn.png</normaloff>:/icons/rbinstall_btn.png</iconset>
</property>
<property name="text" >
<string>Install &amp;Rockbox</string>
@@ -935,7 +951,8 @@
</action>
<action name="actionFonts_Package" >
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/font_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/font_btn.png</normaloff>:/icons/font_btn.png</iconset>
</property>
<property name="text" >
<string>Install &amp;Fonts Package</string>
@@ -943,7 +960,8 @@
</action>
<action name="actionInstall_Themes" >
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/themes_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/themes_btn.png</normaloff>:/icons/themes_btn.png</iconset>
</property>
<property name="text" >
<string>Install &amp;Themes</string>
@@ -951,7 +969,8 @@
</action>
<action name="actionInstall_Game_Files" >
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/doom_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/doom_btn.png</normaloff>:/icons/doom_btn.png</iconset>
</property>
<property name="text" >
<string>Install &amp;Game Files</string>
@@ -959,7 +978,8 @@
</action>
<action name="actionInstall_Voice_File" >
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/talkfile_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/talkfile_btn.png</normaloff>:/icons/talkfile_btn.png</iconset>
</property>
<property name="text" >
<string>&amp;Install Voice File</string>
@@ -967,7 +987,8 @@
</action>
<action name="actionCreate_Talk_Files" >
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/talkfile_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/talkfile_btn.png</normaloff>:/icons/talkfile_btn.png</iconset>
</property>
<property name="text" >
<string>Create &amp;Talk Files</string>
@@ -975,7 +996,8 @@
</action>
<action name="actionRemove_bootloader" >
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/rembootloader_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/rembootloader_btn.png</normaloff>:/icons/rembootloader_btn.png</iconset>
</property>
<property name="text" >
<string>Remove &amp;bootloader</string>
@@ -983,7 +1005,8 @@
</action>
<action name="actionUninstall_Rockbox" >
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/remrb_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/remrb_btn.png</normaloff>:/icons/remrb_btn.png</iconset>
</property>
<property name="text" >
<string>Uninstall &amp;Rockbox</string>
@@ -1011,7 +1034,8 @@
</action>
<action name="actionCreate_Voice_File" >
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/talkfile_btn.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/talkfile_btn.png</normaloff>:/icons/talkfile_btn.png</iconset>
</property>
<property name="text" >
<string>Create &amp;Voice File</string>
@@ -1025,6 +1049,11 @@
<string>&amp;System Info</string>
</property>
</action>
+ <action name="action_Trace" >
+ <property name="text" >
+ <string>System &amp;Trace</string>
+ </property>
+ </action>
</widget>
<tabstops>
<tabstop>tabWidget</tabstop>
diff --git a/rbutil/rbutilqt/sysinfo.cpp b/rbutil/rbutilqt/sysinfo.cpp
index ca34b4b063..65818df068 100644
--- a/rbutil/rbutilqt/sysinfo.cpp
+++ b/rbutil/rbutilqt/sysinfo.cpp
@@ -28,8 +28,7 @@
Sysinfo::Sysinfo(QWidget *parent) : QDialog(parent)
{
ui.setupUi(this);
- this->setModal(true);
-
+
updateSysinfo();
connect(ui.buttonOk, SIGNAL(clicked()), this, SLOT(close()));
connect(ui.buttonRefresh, SIGNAL(clicked()), this, SLOT(updateSysinfo()));
@@ -37,6 +36,11 @@ Sysinfo::Sysinfo(QWidget *parent) : QDialog(parent)
void Sysinfo::updateSysinfo(void)
{
+ ui.textBrowser->setHtml(getInfo());
+}
+
+QString Sysinfo::getInfo()
+{
QString info;
info += tr("<b>OS</b><br/>") + System::osVersionString() + "<hr/>";
info += tr("<b>Username</b><br/>%1<hr/>").arg(System::userName());
@@ -67,6 +71,7 @@ void Sysinfo::updateSysinfo(void)
}
info += "<hr/>";
- ui.textBrowser->setHtml(info);
+ return info;
}
+
diff --git a/rbutil/rbutilqt/sysinfo.h b/rbutil/rbutilqt/sysinfo.h
index 86a86f0e21..5195113643 100644
--- a/rbutil/rbutilqt/sysinfo.h
+++ b/rbutil/rbutilqt/sysinfo.h
@@ -31,7 +31,8 @@ class Sysinfo : public QDialog
public:
Sysinfo(QWidget *parent = 0);
-
+
+ static QString getInfo();
private:
Ui::SysinfoFrm ui;
diff --git a/rbutil/rbutilqt/systrace.cpp b/rbutil/rbutilqt/systrace.cpp
new file mode 100644
index 0000000000..b8f4fb8434
--- /dev/null
+++ b/rbutil/rbutilqt/systrace.cpp
@@ -0,0 +1,65 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ *
+ * Copyright (C) 2007 by Dominik Riebeling
+ * $Id$
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+#include <QtGui>
+#include "systrace.h"
+#include "ui_systracefrm.h"
+
+
+QString SysTrace::debugbuffer;
+
+SysTrace::SysTrace(QWidget *parent) : QDialog(parent)
+{
+ ui.setupUi(this);
+ ui.textTrace->setReadOnly(true);
+ refresh();
+
+ connect(ui.buttonClose, SIGNAL(clicked()), this, SLOT(close()));
+ connect(ui.buttonSave, SIGNAL(clicked()), this, SLOT(save()));
+ connect(ui.buttonRefresh, SIGNAL(clicked()), this, SLOT(refresh()));
+}
+
+void SysTrace::refresh(void)
+{
+ int pos = ui.textTrace->verticalScrollBar()->value();
+ ui.textTrace->setHtml("<pre>" + debugbuffer + "</pre>");
+ ui.textTrace->verticalScrollBar()->setValue(pos);
+}
+
+void SysTrace::save(void)
+{
+ QString fp = QFileDialog::getSaveFileName(this, tr("Save system trace log"),
+ QDir::homePath(), "*.log");
+
+ QFile fh(fp);
+ fh.open(QIODevice::WriteOnly);
+ fh.write(debugbuffer.toUtf8(), debugbuffer.size());
+ fh.close();
+}
+
+void SysTrace::debug(QtMsgType type, const char* msg)
+{
+ debugbuffer.append(msg);
+ debugbuffer.append("\n");
+#if !defined(NODEBUG)
+ fprintf(stderr, "%s\n", msg);
+#endif
+
+}
+
diff --git a/rbutil/rbutilqt/systrace.h b/rbutil/rbutilqt/systrace.h
new file mode 100644
index 0000000000..a8253ce9e6
--- /dev/null
+++ b/rbutil/rbutilqt/systrace.h
@@ -0,0 +1,47 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ *
+ * Copyright (C) 2007 by Dominik Riebeling
+ * $Id$
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+#ifndef SYSTRACE_H
+#define SYSTRACE_H
+
+#include <QtGui>
+#include "ui_systracefrm.h"
+
+class SysTrace : public QDialog
+{
+ Q_OBJECT
+ public:
+ SysTrace(QWidget *parent);
+ static void debug(QtMsgType type, const char* msg);
+
+ static QString getTrace() {return debugbuffer;}
+ private:
+ Ui::SysTraceFrm ui;
+ static QString debugbuffer;
+
+ private slots:
+ void save(void);
+ void refresh(void);
+
+};
+
+#endif
+
diff --git a/rbutil/rbutilqt/systracefrm.ui b/rbutil/rbutilqt/systracefrm.ui
new file mode 100644
index 0000000000..450ab993e1
--- /dev/null
+++ b/rbutil/rbutilqt/systracefrm.ui
@@ -0,0 +1,77 @@
+<ui version="4.0" >
+ <class>SysTraceFrm</class>
+ <widget class="QDialog" name="SysTraceFrm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>550</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>System Trace</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="1" colspan="4" >
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>System State trace</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" colspan="5" >
+ <widget class="QTextEdit" name="textTrace" />
+ </item>
+ <item row="2" column="1" colspan="2" >
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>487</width>
+ <height>26</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="4" >
+ <widget class="QPushButton" name="buttonClose" >
+ <property name="text" >
+ <string>&amp;Close</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/process-stop.png</normaloff>:/icons/process-stop.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="3" >
+ <widget class="QPushButton" name="buttonSave" >
+ <property name="text" >
+ <string>&amp;Save</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QPushButton" name="buttonRefresh" >
+ <property name="text" >
+ <string>&amp;Refresh</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/view-refresh.png</normaloff>:/icons/view-refresh.png</iconset>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="rbutilqt.qrc" />
+ </resources>
+ <connections/>
+</ui>