You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.3 KiB
62 lines
1.3 KiB
/*! @file |
|
|
|
@id $Id$ |
|
*/ |
|
// 1 2 3 4 5 6 7 8 |
|
// 45678901234567890123456789012345678901234567890123456789012345678901234567890 |
|
|
|
#ifndef ERRORLOG_HXX |
|
#define ERRORLOG_HXX |
|
|
|
#include <qbrowserlib/log.hxx> |
|
#include <qbrowserlib/ui_errorlog.h> |
|
#include <QtGui/QDialog> |
|
|
|
//! @addtogroup qbrowserlib |
|
//! @{ |
|
|
|
namespace qbrowserlib { |
|
|
|
//! Collect and Show Errors |
|
/*! Singleton */ |
|
class ErrorLog: public QDialog, protected Ui::ErrorLog { |
|
Q_OBJECT; |
|
Q_SIGNALS: |
|
void reset(); |
|
public: |
|
//! Singleton |
|
static ErrorLog& instance(QWidget* p=0) { |
|
static ErrorLog* _instance(new ErrorLog(p)); |
|
return *_instance; |
|
} |
|
static void purge() { |
|
delete &instance(); |
|
} |
|
private: // singleton |
|
ErrorLog(const ErrorLog&); |
|
ErrorLog(QWidget* p): QDialog(p) { |
|
TRC; |
|
setupUi(this); |
|
} |
|
public: |
|
void append(QString text) { |
|
TRC; LOG<<text; |
|
_errors->append(text); |
|
} |
|
protected Q_SLOTS: |
|
void on__buttons_clicked(QAbstractButton* button) { |
|
TRC; |
|
switch (_buttons->buttonRole(button)) { |
|
case QDialogButtonBox::ResetRole: { |
|
_errors->clear(); |
|
reset(); |
|
} break; |
|
default:; |
|
} |
|
} |
|
}; |
|
} |
|
|
|
//! @} |
|
|
|
#endif
|
|
|