diff --git a/src/plugins/projectexplorer/outputformatter.cpp b/src/plugins/projectexplorer/outputformatter.cpp index 3127772c1327880263cc3ac193990514e73cb7d2..5ddfa51f13551299505cadfcb3ff8884107d9efb 100644 --- a/src/plugins/projectexplorer/outputformatter.cpp +++ b/src/plugins/projectexplorer/outputformatter.cpp @@ -63,6 +63,8 @@ void OutputFormatter::setPlainTextEdit(QPlainTextEdit *plainText) void OutputFormatter::appendApplicationOutput(const QString &text, bool onStdErr) { + gotoEnd(); + if (onStdErr) setFormat(StdErrFormat); else @@ -73,6 +75,8 @@ void OutputFormatter::appendApplicationOutput(const QString &text, bool onStdErr void OutputFormatter::appendMessage(const QString &text, bool isError) { + gotoEnd(); + if (isError) setFormat(ErrorMessageFormat); else @@ -121,3 +125,8 @@ void OutputFormatter::setFormat(Format theFormat) const if (m_formats) plainTextEdit()->setCurrentCharFormat(m_formats[theFormat]); } + +void OutputFormatter::gotoEnd() const +{ + plainTextEdit()->moveCursor(QTextCursor::End); +} diff --git a/src/plugins/projectexplorer/outputformatter.h b/src/plugins/projectexplorer/outputformatter.h index 38ed672b9b753e7e3ed5e9e0bd1f7fd228f167f6..3c8ff1ecd6ace1dec10fe42d768c51aec4a038ea 100644 --- a/src/plugins/projectexplorer/outputformatter.h +++ b/src/plugins/projectexplorer/outputformatter.h @@ -72,6 +72,8 @@ protected: void initFormats(); void setFormat(Format theFormat) const; + void gotoEnd() const; + private: QPlainTextEdit *m_plainTextEdit; QTextCharFormat *m_formats; diff --git a/src/plugins/projectexplorer/projectwelcomepagewidget.cpp b/src/plugins/projectexplorer/projectwelcomepagewidget.cpp index 569f92bf80d2972c62ca9d3478cce923ada8f8a9..a9feb8f2b2d2cb9883c2c695fd06e1198054248a 100644 --- a/src/plugins/projectexplorer/projectwelcomepagewidget.cpp +++ b/src/plugins/projectexplorer/projectwelcomepagewidget.cpp @@ -44,7 +44,8 @@ #include <QtCore/QDebug> -#define MAX_RECENT_ITEMS 6 +#define MAX_RECENT_PROJECT_ITEMS 6 +#define MAX_RECENT_SESSION_ITEMS 10 using namespace ProjectExplorer::Internal; @@ -105,7 +106,7 @@ void ProjectWelcomePageWidget::updateWelcomePage(const WelcomePageData &welcomeP if (welcomePageData.sessionList.count() > 0) { int items = 0; foreach (const QString &s, welcomePageData.sessionList) { - if (++items > MAX_RECENT_ITEMS) + if (++items > MAX_RECENT_SESSION_ITEMS) break; QString str = s; if (welcomePageData.activeSession.isEmpty()) { @@ -128,7 +129,7 @@ void ProjectWelcomePageWidget::updateWelcomePage(const WelcomePageData &welcomeP int items = 0; QFontMetrics fm = fontMetrics(); foreach (const QStringPair &it, welcomePageData.projectList) { - if (++items > MAX_RECENT_ITEMS) + if (++items > MAX_RECENT_PROJECT_ITEMS) break; const QFileInfo fi(it.first); QString label = "<b>" + it.second + diff --git a/src/plugins/projectexplorer/projectwelcomepagewidget.ui b/src/plugins/projectexplorer/projectwelcomepagewidget.ui index f6e12a20785bd450e3f300fa4b39df44b549d36a..83d58c58f6e11e9dfda1eef288ccd57305a71979 100644 --- a/src/plugins/projectexplorer/projectwelcomepagewidget.ui +++ b/src/plugins/projectexplorer/projectwelcomepagewidget.ui @@ -49,7 +49,7 @@ </sizepolicy> </property> <property name="text"> - <string>Resume Session</string> + <string>Recent Sessions</string> </property> <property name="alignment"> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> diff --git a/src/plugins/qmlprojectmanager/qmloutputformatter.cpp b/src/plugins/qmlprojectmanager/qmloutputformatter.cpp index 4671512211593a310b705db8588f23eeac3f87dd..0b4eaf6dc697caec71018c6110ab42b38fb19e8d 100644 --- a/src/plugins/qmlprojectmanager/qmloutputformatter.cpp +++ b/src/plugins/qmlprojectmanager/qmloutputformatter.cpp @@ -46,6 +46,8 @@ QmlOutputFormatter::QmlOutputFormatter(QObject *parent) void QmlOutputFormatter::appendApplicationOutput(const QString &text, bool onStdErr) { + gotoEnd(); + if (onStdErr) setFormat(StdErrFormat); else