Skip to content

Commit

Permalink
Added psi-always-enabled-history-dlg patch for Mac OS X.
Browse files Browse the repository at this point in the history
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
drizt committed Feb 19, 2013
1 parent d0e8808 commit d0fe732
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions patches/mac/3050-psi-always-enabled-history-dlg.diff
@@ -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]")+" &lt;"+ TextUtil::plain2rich(d->pa->nick()) +"&gt; " + msg + "</span>";
else
msg = "<span style='color:"+received_color+"'>" + me->timeStamp().toString("[dd.MM.yyyy hh:mm:ss]") + " &lt;" + TextUtil::plain2rich(from) + "&gt; " + 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()

0 comments on commit d0fe732

Please sign in to comment.