[kde-doc-english] [trojita] src: GUI: Flash red on search failure
Jan Kundrát
jkt at flaska.net
Fri Jan 11 00:35:02 UTC 2013
Git commit dc964b5fac057c67cf73e8fd8e197f8992955763 by Jan Kundrát, on behalf of Thomas Lübking.
Committed on 09/01/2013 at 00:03.
Pushed by jkt into branch 'master'.
GUI: Flash red on search failure
This tells me there's been in error when typing something stupid like eg.
":=subjet 12345"
Ported-by: Jan Kundrát <jkt at flaska.net>
M +14 -0 src/Gui/MessageListWidget.cpp
M +2 -0 src/Gui/MessageListWidget.h
M +1 -0 src/Gui/Window.cpp
M +1 -0 src/Imap/Model/ThreadingMsgListModel.cpp
M +3 -0 src/Imap/Model/ThreadingMsgListModel.h
http://commits.kde.org/trojita/dc964b5fac057c67cf73e8fd8e197f8992955763
diff --git a/src/Gui/MessageListWidget.cpp b/src/Gui/MessageListWidget.cpp
index 4788fe3..8391978 100644
--- a/src/Gui/MessageListWidget.cpp
+++ b/src/Gui/MessageListWidget.cpp
@@ -142,6 +142,20 @@ void MessageListWidget::slotAutoEnableDisableSearch()
m_searchOptions->setEnabled(isEnabled);
}
+void MessageListWidget::slotSortingFailed()
+{
+ QPalette pal = m_quickSearchText->palette();
+ pal.setColor(m_quickSearchText->backgroundRole(), Qt::red);
+ pal.setColor(m_quickSearchText->foregroundRole(), Qt::white);
+ m_quickSearchText->setPalette(pal);
+ QTimer::singleShot(500, this, SLOT(slotResetSortingFailed()));
+}
+
+void MessageListWidget::slotResetSortingFailed()
+{
+ m_quickSearchText->setPalette(QPalette());
+}
+
void MessageListWidget::slotConditionalSearchReset()
{
if (m_quickSearchText->text().isEmpty())
diff --git a/src/Gui/MessageListWidget.h b/src/Gui/MessageListWidget.h
index 1e49543..15d3c80 100644
--- a/src/Gui/MessageListWidget.h
+++ b/src/Gui/MessageListWidget.h
@@ -53,11 +53,13 @@ signals:
protected slots:
void slotApplySearch();
void slotAutoEnableDisableSearch();
+ void slotSortingFailed();
private slots:
void slotComplexSearchInput(QAction*);
void slotConditionalSearchReset();
void slotDeActivateSimpleSearch();
+ void slotResetSortingFailed();
void slotUpdateSearchCursor();
private:
diff --git a/src/Gui/Window.cpp b/src/Gui/Window.cpp
index 6dc8254..75c6e51 100644
--- a/src/Gui/Window.cpp
+++ b/src/Gui/Window.cpp
@@ -586,6 +586,7 @@ void MainWindow::setupModels()
threadingMsgListModel = new Imap::Mailbox::ThreadingMsgListModel(this);
threadingMsgListModel->setObjectName(QLatin1String("threadingMsgListModel"));
threadingMsgListModel->setSourceModel(msgListModel);
+ connect(threadingMsgListModel, SIGNAL(sortingFailed()), msgListWidget, SLOT(slotSortingFailed()));
prettyMsgListModel = new Imap::Mailbox::PrettyMsgListModel(this);
prettyMsgListModel->setSourceModel(threadingMsgListModel);
prettyMsgListModel->setObjectName(QLatin1String("prettyMsgListModel"));
diff --git a/src/Imap/Model/ThreadingMsgListModel.cpp b/src/Imap/Model/ThreadingMsgListModel.cpp
index 7fd2272..12470f7 100644
--- a/src/Imap/Model/ThreadingMsgListModel.cpp
+++ b/src/Imap/Model/ThreadingMsgListModel.cpp
@@ -817,6 +817,7 @@ void ThreadingMsgListModel::slotSortingFailed()
m_sortReverse = false;
calculateNullSort();
applySort();
+ emit sortingFailed();
}
void ThreadingMsgListModel::slotSortingIncrementalUpdate(const Responses::ESearch::IncrementalContextData_t &updates)
diff --git a/src/Imap/Model/ThreadingMsgListModel.h b/src/Imap/Model/ThreadingMsgListModel.h
index 202c1b7..c3e88c7 100644
--- a/src/Imap/Model/ThreadingMsgListModel.h
+++ b/src/Imap/Model/ThreadingMsgListModel.h
@@ -182,6 +182,9 @@ public slots:
void slotIncrementalThreadingAvailable(const Responses::ESearch::IncrementalThreadingData_t &data);
void slotIncrementalThreadingFailed();
+signals:
+ void sortingFailed();
+
private:
/** @short Display messages without any threading at all, as a liner list */
void updateNoThreading();
More information about the kde-doc-english
mailing list