summaryrefslogtreecommitdiffstats
path: root/tools/qml/loggerwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/qml/loggerwidget.cpp')
-rw-r--r--tools/qml/loggerwidget.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/qml/loggerwidget.cpp b/tools/qml/loggerwidget.cpp
index 4c21b34..3f2337a 100644
--- a/tools/qml/loggerwidget.cpp
+++ b/tools/qml/loggerwidget.cpp
@@ -45,6 +45,8 @@
#include <QActionGroup>
#include <QMenu>
#include <QPlainTextEdit>
+#include <QLabel>
+#include <QVBoxLayout>
#ifdef Q_WS_MAEMO_5
# include <QScrollArea>
# include <QVBoxLayout>
@@ -64,6 +66,19 @@ LoggerWidget::LoggerWidget(QWidget *parent) :
m_plainTextEdit = new QPlainTextEdit();
+#if defined(Q_OS_SYMBIAN)
+ QAction* clearAction = new QAction(tr("Clear"), this);
+ clearAction->setSoftKeyRole(QAction::PositiveSoftKey);
+ connect(clearAction, SIGNAL(triggered()), m_plainTextEdit, SLOT(clear()));
+ addAction(clearAction);
+
+ m_plainTextEdit->setReadOnly(true);
+ QAction* backAction = new QAction( tr("Back"), this );
+ backAction->setSoftKeyRole( QAction::NegativeSoftKey );
+ connect(backAction, SIGNAL(triggered()), this, SLOT(hide()));
+ addAction( backAction );
+#endif
+
#ifdef Q_WS_MAEMO_5
new TextEditAutoResizer(m_plainTextEdit);
setAttribute(Qt::WA_Maemo5StackedWindow);
@@ -74,6 +89,15 @@ LoggerWidget::LoggerWidget(QWidget *parent) :
#else
setCentralWidget(m_plainTextEdit);
#endif
+
+ m_noWarningsLabel = new QLabel(m_plainTextEdit);
+ m_noWarningsLabel->setText(tr("(No warnings)"));
+ m_noWarningsLabel->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
+ QVBoxLayout *layout = new QVBoxLayout;
+ layout->addWidget(m_noWarningsLabel);
+ m_plainTextEdit->setLayout(layout);
+ connect(m_plainTextEdit, SIGNAL(textChanged()), this, SLOT(updateNoWarningsLabel()));
+
readSettings();
setupPreferencesMenu();
}
@@ -198,4 +222,9 @@ void LoggerWidget::setupPreferencesMenu()
}
}
+void LoggerWidget::updateNoWarningsLabel()
+{
+ m_noWarningsLabel->setVisible(m_plainTextEdit->toPlainText().length() == 0);
+}
+
QT_END_NAMESPACE