summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Molkentin <daniel.molkentin@nokia.com>2009-06-12 15:02:55 +0200
committerDaniel Molkentin <daniel.molkentin@nokia.com>2009-06-12 15:11:41 +0200
commit7d6d3e2b948f611e9958602d79094ff7968205fd (patch)
tree1685e4f343211ed371f1541bf0d54148d16753a7 /src
parentde333ba02d6ed12c91ae7df9d02a201170942252 (diff)
downloadqt-creator-7d6d3e2b948f611e9958602d79094ff7968205fd.tar.gz
welcome mode: always show default session, gui fixes
Reviewed-By: Thorbjorn Lindeijer
Diffstat (limited to 'src')
-rw-r--r--src/plugins/coreplugin/welcomemode.cpp49
-rw-r--r--src/plugins/coreplugin/welcomemode_p.h1
2 files changed, 26 insertions, 24 deletions
diff --git a/src/plugins/coreplugin/welcomemode.cpp b/src/plugins/coreplugin/welcomemode.cpp
index 14f9ca8108..3d47a15acc 100644
--- a/src/plugins/coreplugin/welcomemode.cpp
+++ b/src/plugins/coreplugin/welcomemode.cpp
@@ -123,8 +123,8 @@ WelcomeMode::WelcomeMode() :
m_d->rssFetcher = new RSSFetcher(7, this);
m_d->m_welcomePage = new QWidget(m_d->m_widget);
m_d->ui.setupUi(m_d->m_welcomePage);
- m_d->ui.projTitleLabel->setText(titleLabel(tr("Projects")));
- m_d->ui.recentSessionsTitleLabel->setText(titleLabel(tr("Sessions")));
+ m_d->ui.projTitleLabel->setText(titleLabel(tr("Open Recent Project")));
+ m_d->ui.recentSessionsTitleLabel->setText(titleLabel(tr("Resume Session")));
m_d->ui.tutorialsTitleLabel->setText(titleLabel(tr("Tutorials")));
m_d->ui.demoTitleLabel->setText(titleLabel(tr("Explore Qt Examples")));
m_d->ui.didYouKnowTitleLabel->setText(titleLabel(tr("Did you know?")));
@@ -252,37 +252,33 @@ void WelcomeMode::updateWelcomePage(const WelcomePageData &welcomePageData)
m_d->lastData = welcomePageData;
m_d->m_widget->setUpdatesEnabled(false);
- if (!welcomePageData.previousSession.isEmpty() || !welcomePageData.projectList.isEmpty()) {
- m_d->ui.sessTreeWidget->clear();
- m_d->ui.projTreeWidget->clear();
-
- if (welcomePageData.sessionList.count() > 1) {
- foreach (const QString &s, welcomePageData.sessionList) {
- QString str = s;
- if (s == welcomePageData.previousSession)
- str = tr("%1 (last session)").arg(s);
- m_d->ui.sessTreeWidget->addItem(str, s);
- }
- m_d->ui.sessTreeWidget->updateGeometry();
- m_d->ui.sessTreeWidget->show();
- } else {
- m_d->ui.sessTreeWidget->hide();
+ m_d->ui.sessTreeWidget->clear();
+ m_d->ui.projTreeWidget->clear();
+
+ if (welcomePageData.sessionList.count() > 0) {
+ foreach (const QString &s, welcomePageData.sessionList) {
+ QString str = s;
+ if (s == welcomePageData.previousSession)
+ str = tr("%1 (last session)").arg(s);
+ m_d->ui.sessTreeWidget->addItem(str, s);
}
+ m_d->ui.sessTreeWidget->updateGeometry();
+ m_d->ui.sessTreeWidget->show();
+ } else {
+ m_d->ui.sessTreeWidget->hide();
+ }
- typedef QPair<QString, QString> QStringPair;
+ typedef QPair<QString, QString> QStringPair;
+ if (welcomePageData.projectList.count() > 0) {
foreach (const QStringPair &it, welcomePageData.projectList) {
QTreeWidgetItem *item = m_d->ui.projTreeWidget->addItem(it.second, it.first);
const QFileInfo fi(it.first);
item->setToolTip(1, QDir::toNativeSeparators(fi.absolutePath()));
}
- m_d->ui.projTreeWidget->updateGeometry();
-
- m_d->ui.recentSessionsFrame->show();
- m_d->ui.recentProjectsFrame->show();
} else {
- m_d->ui.recentSessionsFrame->hide();
- m_d->ui.recentProjectsFrame->hide();
+ m_d->ui.projTreeWidget->hide();
}
+ m_d->ui.projTreeWidget->updateGeometry();
m_d->m_widget->setUpdatesEnabled(true);
}
@@ -497,6 +493,11 @@ WelcomeModeTreeWidget::WelcomeModeTreeWidget(QWidget *parent) :
SLOT(slotItemClicked(QTreeWidgetItem *)));
}
+QSize WelcomeModeTreeWidget::minimumSizeHint() const
+{
+ return QSize();
+}
+
QSize WelcomeModeTreeWidget::sizeHint() const
{
return QSize(QTreeWidget::sizeHint().width(), 30 * topLevelItemCount());
diff --git a/src/plugins/coreplugin/welcomemode_p.h b/src/plugins/coreplugin/welcomemode_p.h
index 8693229893..89f8902760 100644
--- a/src/plugins/coreplugin/welcomemode_p.h
+++ b/src/plugins/coreplugin/welcomemode_p.h
@@ -75,6 +75,7 @@ signals:
void activated(const QString &data);
protected:
+ virtual QSize minimumSizeHint() const;
virtual QSize sizeHint() const;
private slots: