aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qt4projectmanager/qt-s60/s60publishingresultspageovi.cpp
diff options
context:
space:
mode:
authorPawel Polanski <pawel.3.polanski@nokia.com>2011-05-24 16:25:06 +0200
committerDaniel Teske <daniel.teske@nokia.com>2011-05-25 16:44:53 +0200
commit16eefb3a882a85d866260e46bba9d87252f922d0 (patch)
treee5e8367f8b9f63dca1e3a5430a9eb2f833f78b63 /src/plugins/qt4projectmanager/qt-s60/s60publishingresultspageovi.cpp
parent32b457994bf7c980c77c9a7c0d5176941e100c3f (diff)
Publis to Ovi: Implementing PublishStep with wipe function
Make Publish to Ovi no so "hardcoded" and base it upon custom steps. Now the code is recleaned and rebuild after freeze Change-Id: I555136d58f728d563eb7dabcb48f314ce4a19003 Reviewed-on: http://codereview.qt.nokia.com/92 Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Diffstat (limited to 'src/plugins/qt4projectmanager/qt-s60/s60publishingresultspageovi.cpp')
-rw-r--r--src/plugins/qt4projectmanager/qt-s60/s60publishingresultspageovi.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/plugins/qt4projectmanager/qt-s60/s60publishingresultspageovi.cpp b/src/plugins/qt4projectmanager/qt-s60/s60publishingresultspageovi.cpp
index 9e305e0bd8..ea96c4f7b7 100644
--- a/src/plugins/qt4projectmanager/qt-s60/s60publishingresultspageovi.cpp
+++ b/src/plugins/qt4projectmanager/qt-s60/s60publishingresultspageovi.cpp
@@ -35,6 +35,7 @@
#include <QtGui/QDesktopServices>
#include <QtGui/QAbstractButton>
+#include <QtGui/QScrollBar>
#include <QtCore/QProcess>
namespace Qt4ProjectManager {
@@ -75,11 +76,30 @@ void S60PublishingResultsPageOvi::packageCreationFinished()
void S60PublishingResultsPageOvi::updateResultsPage(const QString& status, QColor c)
{
+ const bool atBottom = isScrollbarAtBottom();
QTextCursor cur(ui->resultsTextBrowser->document());
QTextCharFormat tcf = cur.charFormat();
tcf.setForeground(c);
cur.movePosition(QTextCursor::End);
cur.insertText(status, tcf);
+ if (atBottom)
+ scrollToBottom();
+}
+
+bool S60PublishingResultsPageOvi::isScrollbarAtBottom() const
+{
+ QScrollBar *scrollBar = ui->resultsTextBrowser->verticalScrollBar();
+ return scrollBar->value() == scrollBar->maximum();
+}
+
+void S60PublishingResultsPageOvi::scrollToBottom()
+{
+ QScrollBar *scrollBar = ui->resultsTextBrowser->verticalScrollBar();
+ scrollBar->setValue(scrollBar->maximum());
+ // QPlainTextEdit destroys the first calls value in case of multiline
+ // text, so make sure that the scroll bar actually gets the value set.
+ // Is a noop if the first call succeeded.
+ scrollBar->setValue(scrollBar->maximum());
}
void S60PublishingResultsPageOvi::openFileLocation()