1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Dominik Wenger 2009-08-15 17:02:25 +00:00
parent 2402aecbb5
commit 426bfa8d03
13 changed files with 400 additions and 94 deletions

View file

@ -20,13 +20,17 @@
#include <QtGui> #include <QtGui>
#include "rbutilqt.h" #include "rbutilqt.h"
#include "systrace.h"
#ifdef STATIC #ifdef STATIC
#include <QtPlugin> #include <QtPlugin>
Q_IMPORT_PLUGIN(qtaccessiblewidgets) Q_IMPORT_PLUGIN(qtaccessiblewidgets)
#endif #endif
int main( int argc, char ** argv ) { int main( int argc, char ** argv ) {
qInstallMsgHandler(SysTrace::debug);
QApplication app( argc, argv ); QApplication app( argc, argv );
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)
QDir dir(QApplication::applicationDirPath()); QDir dir(QApplication::applicationDirPath());

View file

@ -1,7 +1,8 @@
<ui version="4.0" > <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ProgressLoggerFrm</class> <class>ProgressLoggerFrm</class>
<widget class="QDialog" name="ProgressLoggerFrm" > <widget class="QDialog" name="ProgressLoggerFrm">
<property name="geometry" > <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
@ -9,52 +10,62 @@
<height>302</height> <height>302</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle">
<string>Progress</string> <string>Progress</string>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2" > <item row="0" column="0">
<widget class="QLabel" name="labelHeader" > <widget class="QLabel" name="labelHeader">
<property name="text" > <property name="text">
<string>Progress</string> <string>Progress</string>
</property> </property>
<property name="wordWrap" > <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0" colspan="2" > <item row="1" column="0" colspan="3">
<widget class="QListWidget" name="listProgress" > <widget class="QListWidget" name="listProgress">
<property name="focusPolicy" > <property name="focusPolicy">
<enum>Qt::TabFocus</enum> <enum>Qt::TabFocus</enum>
</property> </property>
<property name="accessibleName" > <property name="accessibleName">
<string>progresswindow</string> <string>progresswindow</string>
</property> </property>
<property name="tabKeyNavigation" > <property name="tabKeyNavigation">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="selectionBehavior" > <property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum> <enum>QAbstractItemView::SelectRows</enum>
</property> </property>
<property name="wordWrap" > <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0" colspan="2" > <item row="2" column="0" colspan="3">
<widget class="QProgressBar" name="progressBar" > <widget class="QProgressBar" name="progressBar">
<property name="value" > <property name="value">
<number>0</number> <number>0</number>
</property> </property>
</widget> </widget>
</item> </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> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0" > <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
@ -62,13 +73,13 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="3" column="1" > <item row="3" column="2">
<widget class="QPushButton" name="buttonAbort" > <widget class="QPushButton" name="buttonAbort">
<property name="text" > <property name="text">
<string>&amp;Abort</string> <string>&amp;Abort</string>
</property> </property>
<property name="icon" > <property name="icon">
<iconset resource="rbutilqt.qrc" > <iconset resource="rbutilqt.qrc">
<normaloff>:/icons/process-stop.png</normaloff>:/icons/process-stop.png</iconset> <normaloff>:/icons/process-stop.png</normaloff>:/icons/process-stop.png</iconset>
</property> </property>
</widget> </widget>
@ -76,7 +87,7 @@
</layout> </layout>
</widget> </widget>
<resources> <resources>
<include location="rbutilqt.qrc" /> <include location="rbutilqt.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>

View file

@ -19,12 +19,17 @@
#include "progressloggergui.h" #include "progressloggergui.h"
#include "sysinfo.h"
#include "systrace.h"
ProgressLoggerGui::ProgressLoggerGui(QWidget* parent): ProgressloggerInterface(parent) ProgressLoggerGui::ProgressLoggerGui(QWidget* parent): ProgressloggerInterface(parent)
{ {
downloadProgress = new QDialog(parent); downloadProgress = new QDialog(parent);
downloadProgress->setModal(true); downloadProgress->setModal(true);
dp.setupUi(downloadProgress); dp.setupUi(downloadProgress);
dp.listProgress->setAlternatingRowColors(true); dp.listProgress->setAlternatingRowColors(true);
dp.saveLog->hide();
connect(dp.saveLog,SIGNAL(clicked()),this,SLOT(saveErrorLog()));
setRunning(); setRunning();
} }
@ -52,6 +57,7 @@ void ProgressLoggerGui::addItem(const QString &text, int flag)
break; break;
case LOGERROR: case LOGERROR:
item->setIcon(QIcon(":/icons/dialog-error.png")); item->setIcon(QIcon(":/icons/dialog-error.png"));
dp.saveLog->show();
break; break;
} }
@ -134,4 +140,51 @@ void ProgressLoggerGui::show()
downloadProgress->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();
}

View file

@ -51,6 +51,7 @@ public slots:
virtual void setRunning(); virtual void setRunning();
virtual void setFinished(); virtual void setFinished();
void saveErrorLog();
private: private:
Ui::ProgressLoggerFrm dp; Ui::ProgressLoggerFrm dp;
QDialog *downloadProgress; QDialog *downloadProgress;

View file

@ -34,6 +34,7 @@
#include "rbzip.h" #include "rbzip.h"
#include "sysinfo.h" #include "sysinfo.h"
#include "system.h" #include "system.h"
#include "systrace.h"
#include "rbsettings.h" #include "rbsettings.h"
#include "progressloggerinterface.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.actionRemove_bootloader, SIGNAL(triggered()), this, SLOT(uninstallBootloader()));
connect(ui.actionUninstall_Rockbox, SIGNAL(triggered()), this, SLOT(uninstall())); connect(ui.actionUninstall_Rockbox, SIGNAL(triggered()), this, SLOT(uninstall()));
connect(ui.action_System_Info, SIGNAL(triggered()), this, SLOT(sysinfo())); connect(ui.action_System_Info, SIGNAL(triggered()), this, SLOT(sysinfo()));
connect(ui.action_Trace, SIGNAL(triggered()), this, SLOT(trace()));
#if !defined(STATIC) #if !defined(STATIC)
ui.actionInstall_Rockbox_Utility_on_player->setEnabled(false); 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) void RbUtilQt::sysinfo(void)
{ {
Sysinfo *info = new Sysinfo(this); Sysinfo info(this);
info->show(); info.exec();
} }
void RbUtilQt::updateTabs(int count) void RbUtilQt::updateTabs(int count)

View file

@ -67,6 +67,7 @@ class RbUtilQt : public QMainWindow
void about(void); void about(void);
void help(void); void help(void);
void sysinfo(void); void sysinfo(void);
void trace(void);
void configDialog(void); void configDialog(void);
void updateDevice(void); void updateDevice(void);
void updateSettings(void); void updateSettings(void);

View file

@ -42,7 +42,7 @@ QMAKE_EXTRA_TARGETS += lrelease
PRE_TARGETDEPS += lrelease PRE_TARGETDEPS += lrelease
} }
#custum rules for libucl.a #custom rules for libucl.a
!mac { !mac {
libucl.commands = @$(MAKE) -C ../../tools/ucl/src libucl.a 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 QMAKE_EXTRA_TARGETS += libucl
PRE_TARGETDEPS += libucl PRE_TARGETDEPS += libucl
#custum rules for libmkamsboot.a #custom rules for libmkamsboot.a
!mac { !mac {
libmkamsboot.commands = @$(MAKE) -C ../mkamsboot libmkamsboot.a libmkamsboot.commands = @$(MAKE) -C ../mkamsboot libmkamsboot.a
} }
@ -96,6 +96,7 @@ SOURCES += rbutilqt.cpp \
base/rbzip.cpp \ base/rbzip.cpp \
base/system.cpp \ base/system.cpp \
sysinfo.cpp \ sysinfo.cpp \
systrace.cpp \
base/bootloaderinstallbase.cpp \ base/bootloaderinstallbase.cpp \
base/bootloaderinstallmi4.cpp \ base/bootloaderinstallmi4.cpp \
base/bootloaderinstallhex.cpp \ base/bootloaderinstallhex.cpp \
@ -150,6 +151,7 @@ HEADERS += rbutilqt.h \
base/rbzip.h \ base/rbzip.h \
sysinfo.h \ sysinfo.h \
base/system.h \ base/system.h \
systrace.h \
base/bootloaderinstallbase.h \ base/bootloaderinstallbase.h \
base/bootloaderinstallmi4.h \ base/bootloaderinstallmi4.h \
base/bootloaderinstallhex.h \ base/bootloaderinstallhex.h \
@ -174,7 +176,8 @@ dbg {
} }
!dbg { !dbg {
CONFIG += release thread qt CONFIG += release thread qt
DEFINES += QT_NO_DEBUG_OUTPUT DEFINES -= QT_NO_DEBUG_OUTPUT
DEFINES += NODEBUG
message("release") message("release")
} }
@ -191,7 +194,8 @@ FORMS += rbutilqtfrm.ui \
uninstallfrm.ui \ uninstallfrm.ui \
previewfrm.ui \ previewfrm.ui \
createvoicefrm.ui \ createvoicefrm.ui \
sysinfofrm.ui sysinfofrm.ui \
systracefrm.ui
RESOURCES += rbutilqt.qrc RESOURCES += rbutilqt.qrc
win32 { win32 {

View file

@ -13,7 +13,8 @@
<string>Rockbox Utility</string> <string>Rockbox Utility</string>
</property> </property>
<property name="windowIcon" > <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> </property>
<widget class="QWidget" name="centralwidget" > <widget class="QWidget" name="centralwidget" >
<layout class="QGridLayout" > <layout class="QGridLayout" >
@ -22,16 +23,7 @@
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<property name="leftMargin" > <property name="margin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
@ -39,7 +31,7 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0" >
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
@ -62,7 +54,7 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0" >
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
@ -103,7 +95,7 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0" >
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
@ -117,7 +109,8 @@
<string>&amp;Change</string> <string>&amp;Change</string>
</property> </property>
<property name="icon" > <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> </property>
</widget> </widget>
</item> </item>
@ -143,7 +136,8 @@
<string>Complete Installation</string> <string>Complete Installation</string>
</property> </property>
<property name="icon" > <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>
<property name="iconSize" > <property name="iconSize" >
<size> <size>
@ -172,7 +166,8 @@
<string>Minimal Installation</string> <string>Minimal Installation</string>
</property> </property>
<property name="icon" > <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>
<property name="iconSize" > <property name="iconSize" >
<size> <size>
@ -200,7 +195,7 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0" >
<size> <size>
<width>20</width> <width>20</width>
<height>91</height> <height>91</height>
@ -213,7 +208,7 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0" >
<size> <size>
<width>20</width> <width>20</width>
<height>81</height> <height>81</height>
@ -237,7 +232,8 @@
<string>Install Bootloader</string> <string>Install Bootloader</string>
</property> </property>
<property name="icon" > <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>
<property name="iconSize" > <property name="iconSize" >
<size> <size>
@ -266,7 +262,8 @@
<string>Install Rockbox</string> <string>Install Rockbox</string>
</property> </property>
<property name="icon" > <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>
<property name="iconSize" > <property name="iconSize" >
<size> <size>
@ -297,7 +294,7 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0" >
<size> <size>
<width>20</width> <width>20</width>
<height>91</height> <height>91</height>
@ -310,7 +307,7 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0" >
<size> <size>
<width>20</width> <width>20</width>
<height>81</height> <height>81</height>
@ -334,7 +331,8 @@
<string>Install Fonts package</string> <string>Install Fonts package</string>
</property> </property>
<property name="icon" > <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>
<property name="iconSize" > <property name="iconSize" >
<size> <size>
@ -360,7 +358,8 @@
<string>Install themes</string> <string>Install themes</string>
</property> </property>
<property name="icon" > <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>
<property name="iconSize" > <property name="iconSize" >
<size> <size>
@ -386,7 +385,8 @@
<string>Install game files</string> <string>Install game files</string>
</property> </property>
<property name="icon" > <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>
<property name="iconSize" > <property name="iconSize" >
<size> <size>
@ -411,7 +411,7 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0" >
<size> <size>
<width>20</width> <width>20</width>
<height>40</height> <height>40</height>
@ -424,7 +424,7 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0" >
<size> <size>
<width>20</width> <width>20</width>
<height>40</height> <height>40</height>
@ -448,7 +448,8 @@
<string>Install Voice files</string> <string>Install Voice files</string>
</property> </property>
<property name="icon" > <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>
<property name="iconSize" > <property name="iconSize" >
<size> <size>
@ -474,7 +475,8 @@
<string>Install Talk files</string> <string>Install Talk files</string>
</property> </property>
<property name="icon" > <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>
<property name="iconSize" > <property name="iconSize" >
<size> <size>
@ -496,7 +498,7 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0" >
<size> <size>
<width>20</width> <width>20</width>
<height>51</height> <height>51</height>
@ -509,7 +511,7 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0" >
<size> <size>
<width>20</width> <width>20</width>
<height>51</height> <height>51</height>
@ -523,7 +525,8 @@
<string>Create Voice files</string> <string>Create Voice files</string>
</property> </property>
<property name="icon" > <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>
<property name="iconSize" > <property name="iconSize" >
<size> <size>
@ -560,7 +563,8 @@
<string>Uninstall Bootloader</string> <string>Uninstall Bootloader</string>
</property> </property>
<property name="icon" > <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>
<property name="iconSize" > <property name="iconSize" >
<size> <size>
@ -586,7 +590,8 @@
<string>Uninstall Rockbox</string> <string>Uninstall Rockbox</string>
</property> </property>
<property name="icon" > <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>
<property name="iconSize" > <property name="iconSize" >
<size> <size>
@ -617,7 +622,7 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0" >
<size> <size>
<width>20</width> <width>20</width>
<height>40</height> <height>40</height>
@ -630,7 +635,7 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0" >
<size> <size>
<width>20</width> <width>20</width>
<height>40</height> <height>40</height>
@ -663,7 +668,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="textInteractionFlags" > <property name="textInteractionFlags" >
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::NoTextInteraction</set> <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse</set>
</property> </property>
</widget> </widget>
</item> </item>
@ -676,7 +681,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="textInteractionFlags" > <property name="textInteractionFlags" >
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::NoTextInteraction</set> <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse</set>
</property> </property>
</widget> </widget>
</item> </item>
@ -712,7 +717,7 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0" >
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
@ -735,7 +740,7 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0" >
<size> <size>
<width>20</width> <width>20</width>
<height>40</height> <height>40</height>
@ -784,7 +789,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>650</width> <width>650</width>
<height>28</height> <height>31</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menu_File" > <widget class="QMenu" name="menu_File" >
@ -800,10 +805,17 @@
<property name="title" > <property name="title" >
<string>Abou&amp;t</string> <string>Abou&amp;t</string>
</property> </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="action_About" />
<addaction name="actionAbout_Qt" /> <addaction name="actionAbout_Qt" />
<addaction name="separator" /> <addaction name="separator" />
<addaction name="action_System_Info" /> <addaction name="menu_Troubleshoot" />
<addaction name="action_Help" /> <addaction name="action_Help" />
</widget> </widget>
<widget class="QMenu" name="menuA_ctions" > <widget class="QMenu" name="menuA_ctions" >
@ -903,7 +915,8 @@
</action> </action>
<action name="actionComplete_Installation" > <action name="actionComplete_Installation" >
<property name="icon" > <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>
<property name="text" > <property name="text" >
<string>&amp;Complete Installation</string> <string>&amp;Complete Installation</string>
@ -911,7 +924,8 @@
</action> </action>
<action name="actionSmall_Installation" > <action name="actionSmall_Installation" >
<property name="icon" > <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>
<property name="text" > <property name="text" >
<string>&amp;Minimal Installation</string> <string>&amp;Minimal Installation</string>
@ -919,7 +933,8 @@
</action> </action>
<action name="actionInstall_Bootloader" > <action name="actionInstall_Bootloader" >
<property name="icon" > <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>
<property name="text" > <property name="text" >
<string>Install &amp;Bootloader</string> <string>Install &amp;Bootloader</string>
@ -927,7 +942,8 @@
</action> </action>
<action name="actionInstall_Rockbox" > <action name="actionInstall_Rockbox" >
<property name="icon" > <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>
<property name="text" > <property name="text" >
<string>Install &amp;Rockbox</string> <string>Install &amp;Rockbox</string>
@ -935,7 +951,8 @@
</action> </action>
<action name="actionFonts_Package" > <action name="actionFonts_Package" >
<property name="icon" > <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>
<property name="text" > <property name="text" >
<string>Install &amp;Fonts Package</string> <string>Install &amp;Fonts Package</string>
@ -943,7 +960,8 @@
</action> </action>
<action name="actionInstall_Themes" > <action name="actionInstall_Themes" >
<property name="icon" > <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>
<property name="text" > <property name="text" >
<string>Install &amp;Themes</string> <string>Install &amp;Themes</string>
@ -951,7 +969,8 @@
</action> </action>
<action name="actionInstall_Game_Files" > <action name="actionInstall_Game_Files" >
<property name="icon" > <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>
<property name="text" > <property name="text" >
<string>Install &amp;Game Files</string> <string>Install &amp;Game Files</string>
@ -959,7 +978,8 @@
</action> </action>
<action name="actionInstall_Voice_File" > <action name="actionInstall_Voice_File" >
<property name="icon" > <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>
<property name="text" > <property name="text" >
<string>&amp;Install Voice File</string> <string>&amp;Install Voice File</string>
@ -967,7 +987,8 @@
</action> </action>
<action name="actionCreate_Talk_Files" > <action name="actionCreate_Talk_Files" >
<property name="icon" > <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>
<property name="text" > <property name="text" >
<string>Create &amp;Talk Files</string> <string>Create &amp;Talk Files</string>
@ -975,7 +996,8 @@
</action> </action>
<action name="actionRemove_bootloader" > <action name="actionRemove_bootloader" >
<property name="icon" > <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>
<property name="text" > <property name="text" >
<string>Remove &amp;bootloader</string> <string>Remove &amp;bootloader</string>
@ -983,7 +1005,8 @@
</action> </action>
<action name="actionUninstall_Rockbox" > <action name="actionUninstall_Rockbox" >
<property name="icon" > <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>
<property name="text" > <property name="text" >
<string>Uninstall &amp;Rockbox</string> <string>Uninstall &amp;Rockbox</string>
@ -1011,7 +1034,8 @@
</action> </action>
<action name="actionCreate_Voice_File" > <action name="actionCreate_Voice_File" >
<property name="icon" > <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>
<property name="text" > <property name="text" >
<string>Create &amp;Voice File</string> <string>Create &amp;Voice File</string>
@ -1025,6 +1049,11 @@
<string>&amp;System Info</string> <string>&amp;System Info</string>
</property> </property>
</action> </action>
<action name="action_Trace" >
<property name="text" >
<string>System &amp;Trace</string>
</property>
</action>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>tabWidget</tabstop> <tabstop>tabWidget</tabstop>

View file

@ -28,7 +28,6 @@
Sysinfo::Sysinfo(QWidget *parent) : QDialog(parent) Sysinfo::Sysinfo(QWidget *parent) : QDialog(parent)
{ {
ui.setupUi(this); ui.setupUi(this);
this->setModal(true);
updateSysinfo(); updateSysinfo();
connect(ui.buttonOk, SIGNAL(clicked()), this, SLOT(close())); connect(ui.buttonOk, SIGNAL(clicked()), this, SLOT(close()));
@ -36,6 +35,11 @@ Sysinfo::Sysinfo(QWidget *parent) : QDialog(parent)
} }
void Sysinfo::updateSysinfo(void) void Sysinfo::updateSysinfo(void)
{
ui.textBrowser->setHtml(getInfo());
}
QString Sysinfo::getInfo()
{ {
QString info; QString info;
info += tr("<b>OS</b><br/>") + System::osVersionString() + "<hr/>"; info += tr("<b>OS</b><br/>") + System::osVersionString() + "<hr/>";
@ -67,6 +71,7 @@ void Sysinfo::updateSysinfo(void)
} }
info += "<hr/>"; info += "<hr/>";
ui.textBrowser->setHtml(info); return info;
} }

View file

@ -32,6 +32,7 @@ class Sysinfo : public QDialog
public: public:
Sysinfo(QWidget *parent = 0); Sysinfo(QWidget *parent = 0);
static QString getInfo();
private: private:
Ui::SysinfoFrm ui; Ui::SysinfoFrm ui;

View file

@ -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
}

View file

@ -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

View file

@ -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>