aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <[email protected]>2016-06-25 00:26:17 +0200
committerJean-Baptiste Mardelle <[email protected]>2016-06-25 00:26:17 +0200
commit76c44ccb04687ec7093c0b6daca61c5d9ccf4643 (patch)
treebdeaaf41c81062c5f1efe555e1e49a73f504e75c
parent033ccb4bdb33f278a8920c813fc64a00e018fa74 (diff)
Use clickable text instead of button to display error log in bin message
-rw-r--r--src/bin/bin.cpp16
-rw-r--r--src/bin/bin.h2
2 files changed, 9 insertions, 9 deletions
diff --git a/src/bin/bin.cpp b/src/bin/bin.cpp
index de70716..c6ce2d8 100644
--- a/src/bin/bin.cpp
+++ b/src/bin/bin.cpp
@@ -465,13 +465,11 @@ Bin::Bin(QWidget* parent) :
// Info widget for failed jobs, other errors
m_infoMessage = new BinMessageWidget;
m_layout->addWidget(m_infoMessage);
- m_infoMessage->setCloseButtonVisible(true);
+ m_infoMessage->setCloseButtonVisible(false);
+ connect(m_infoMessage, SIGNAL(linkActivated(const QString &)), this, SLOT(slotShowJobLog()));
connect(m_infoMessage, SIGNAL(messageClosing()), this, SLOT(slotResetInfoMessage()));
//m_infoMessage->setWordWrap(true);
m_infoMessage->hide();
- m_logAction = new QAction(i18n("Show Log"), this);
- m_logAction->setCheckable(false);
- connect(m_logAction, SIGNAL(triggered()), this, SLOT(slotShowJobLog()));
connect(this, SIGNAL(requesteInvalidRemoval(QString,QUrl,QString)), this, SLOT(slotQueryRemoval(QString,QUrl,QString)));
connect(this, &Bin::refreshAudioThumbs, this, &Bin::doRefreshAudioThumbs);
connect(this, SIGNAL(displayBinMessage(QString,KMessageWidget::MessageType)), this, SLOT(doDisplayMessage(QString,KMessageWidget::MessageType)));
@@ -2023,7 +2021,11 @@ void Bin::slotUpdateJobStatus(const QString&id, int jobType, int status, const Q
if (status == JobCrashed) {
QList<QAction *> actions = m_infoMessage->actions();
if (m_infoMessage->isHidden()) {
- m_infoMessage->setText(label);
+ if (!details.isEmpty()) {
+ m_infoMessage->setText(label + QStringLiteral(" <a href=\"#\">") + i18n("Show log") + QStringLiteral("</a>"));
+ } else {
+ m_infoMessage->setText(label);
+ }
m_infoMessage->setWordWrap(m_infoMessage->text().length() > 35);
m_infoMessage->setMessageType(KMessageWidget::Warning);
}
@@ -2040,8 +2042,8 @@ void Bin::slotUpdateJobStatus(const QString&id, int jobType, int status, const Q
}
if (!details.isEmpty()) {
m_errorLog.append(details);
- if (!actions.contains(m_logAction)) m_infoMessage->addAction(m_logAction);
}
+ m_infoMessage->setCloseButtonVisible(true);
m_infoMessage->animatedShow();
}
}
@@ -2061,7 +2063,7 @@ void Bin::doDisplayMessage(const QString &text, KMessageWidget::MessageType type
m_infoMessage->addAction(action);
connect(action, SIGNAL(triggered(bool)), this, SLOT(slotMessageActionTriggered()));
}
- //m_infoMessage->setCloseButtonVisible(actions.isEmpty());
+ m_infoMessage->setCloseButtonVisible(actions.isEmpty());
m_infoMessage->setMessageType(type);
if (m_infoMessage->isHidden()) {
m_infoMessage->animatedShow();
diff --git a/src/bin/bin.h b/src/bin/bin.h
index a7db1ed..b5dd303 100644
--- a/src/bin/bin.h
+++ b/src/bin/bin.h
@@ -696,8 +696,6 @@ private:
SmallJobLabel *m_infoLabel;
/** @brief The info widget for failed jobs. */
BinMessageWidget *m_infoMessage;
- /** @brief The action that will trigger the log dialog. */
- QAction *m_logAction;
QStringList m_errorLog;
InvalidDialog *m_invalidClipDialog;
/** @brief Set to true if widget just gained focus (means we have to update effect stack . */