summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAL <26797547+Al12rs@users.noreply.github.com>2020-02-26 19:20:56 +0100
committerAL <26797547+Al12rs@users.noreply.github.com>2020-02-26 19:20:56 +0100
commit60437644e455284d36c8e20dfdf1bae268e9f378 (patch)
tree2dfa5acfc195c6e57e60f7314aa5e143f416b3c4
parent0a6c7dce971cbc2ba9c7472521170a58dc43ae84 (diff)
Enabled icons for all log level line.
Added new icon for Debug level. Moved icons after timestamp.
-rw-r--r--src/loglist.cpp12
-rw-r--r--src/resources.qrc1
-rw-r--r--src/resources/log-debug.pngbin0 -> 1039 bytes
3 files changed, 8 insertions, 5 deletions
diff --git a/src/loglist.cpp b/src/loglist.cpp
index 28aae0ff..31f1817f 100644
--- a/src/loglist.cpp
+++ b/src/loglist.cpp
@@ -117,7 +117,7 @@ QVariant LogModel::data(const QModelIndex& index, int role) const
const auto& e = m_entries[row];
if (role == Qt::DisplayRole) {
- if (index.column() == 1) {
+ if (index.column() == 0) {
const auto ms = duration_cast<milliseconds>(e.time.time_since_epoch());
const auto s = duration_cast<seconds>(ms);
@@ -132,7 +132,7 @@ QVariant LogModel::data(const QModelIndex& index, int role) const
}
if (role == Qt::DecorationRole) {
- if (index.column() == 0) {
+ if (index.column() == 1) {
switch (e.level) {
case log::Warning:
return QIcon(":/MO/gui/warning");
@@ -140,8 +140,10 @@ QVariant LogModel::data(const QModelIndex& index, int role) const
case log::Error:
return QIcon(":/MO/gui/problem");
- case log::Debug: // fall-through
+ case log::Debug:
+ return QIcon(":/MO/gui/debug");
case log::Info:
+ return QIcon(":/MO/gui/information");
default:
return {};
}
@@ -163,8 +165,8 @@ LogList::LogList(QWidget* parent)
setModel(&LogModel::instance());
header()->setMinimumSectionSize(0);
- header()->resizeSection(0, 20);
- header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
+ header()->resizeSection(1, 20);
+ header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
setAutoScroll(true);
scrollToBottom();
diff --git a/src/resources.qrc b/src/resources.qrc
index 5b143b45..f9b64f6f 100644
--- a/src/resources.qrc
+++ b/src/resources.qrc
@@ -33,6 +33,7 @@
<file alias="emblem_backup">resources/symbol-backup.png</file>
<file alias="icon_tools">resources/applications-accessories.png</file>
<file alias="problem">resources/emblem-unreadable.png</file>
+ <file alias="debug">resources/log-debug.png</file>
<file>resources/internet-web-browser.png</file>
<file alias="update">resources/system-software-update.png</file>
<file alias="help">resources/help-browser_32.png</file>
diff --git a/src/resources/log-debug.png b/src/resources/log-debug.png
new file mode 100644
index 00000000..05ba742c
--- /dev/null
+++ b/src/resources/log-debug.png
Binary files differ