Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added psi-always-enabled-history-dlg patch for Mac OS X.
On Mac OS X history dialog don't get keyboard events after it was disabled. The patch just disables setEnabled for history dialog.
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
diff --git a/src/historydlg.cpp b/src/historydlg.cpp | ||
index a3631ad..0a1145a 100644 | ||
--- a/src/historydlg.cpp | ||
+++ b/src/historydlg.cpp | ||
@@ -256,7 +256,7 @@ void HistoryDlg::highlightBlocks(const QString text) | ||
QTextCursor cur = ui_.msgLog->textCursor(); | ||
cur.clearSelection(); | ||
cur.movePosition(QTextCursor::Start); | ||
- ui_.msgLog->setTextCursor(cur); | ||
+ ui_.msgLog->setTextCursor(cur); | ||
|
||
if (text.isEmpty()) { | ||
getLatest(); | ||
@@ -266,7 +266,7 @@ void HistoryDlg::highlightBlocks(const QString text) | ||
QList<QTextEdit::ExtraSelection> extras; | ||
QTextEdit::ExtraSelection highlight; | ||
highlight.format.setBackground(Qt::yellow); | ||
- highlight.cursor = ui_.msgLog->textCursor(); | ||
+ highlight.cursor = ui_.msgLog->textCursor(); | ||
|
||
bool found = ui_.msgLog->find(text); | ||
while (found) | ||
@@ -586,7 +586,7 @@ void HistoryDlg::displayResult(const EDBResult r, int direction, int max) | ||
msg = "<span style='color:"+sent_color+"'>" + me->timeStamp().toString("[dd.MM.yyyy hh:mm:ss]")+" <"+ TextUtil::plain2rich(d->pa->nick()) +"> " + msg + "</span>"; | ||
else | ||
msg = "<span style='color:"+received_color+"'>" + me->timeStamp().toString("[dd.MM.yyyy hh:mm:ss]") + " <" + TextUtil::plain2rich(from) + "> " + msg + "</span>"; | ||
- | ||
+ | ||
ui_.msgLog->appendText(msg); | ||
|
||
} | ||
@@ -615,15 +615,23 @@ void HistoryDlg::startRequest() | ||
if(!ui_.busy->isActive()) { | ||
ui_.busy->start(); | ||
} | ||
+ | ||
+ // Workaround. On MAC OS X this dialog doesn't get keyboard events | ||
+ // after it was disabled. It's mean you can do only one searching | ||
+ // without reopening this dialog. | ||
+#ifndef Q_OS_MAC | ||
setEnabled(false); | ||
+#endif | ||
} | ||
|
||
void HistoryDlg::stopRequest() | ||
{ | ||
if(ui_.busy->isActive()) { | ||
- ui_.busy->stop(); | ||
+ ui_.busy->stop(); | ||
} | ||
+#ifndef Q_OS_MAC | ||
setEnabled(true); | ||
+#endif | ||
} | ||
|
||
EDBHandle* HistoryDlg::getEDBHandle() |