diff --git a/src/plugins/coreplugin/rssfetcher.cpp b/src/plugins/coreplugin/rssfetcher.cpp index 8fe57641c36..f9005b9887d 100644 --- a/src/plugins/coreplugin/rssfetcher.cpp +++ b/src/plugins/coreplugin/rssfetcher.cpp @@ -74,18 +74,17 @@ void RSSFetcher::parseXml() while (!m_xml.atEnd()) { m_xml.readNext(); if (m_xml.isStartElement()) { - if (m_xml.name() == "item") - m_linkString = m_xml.attributes().value("rss:about").toString(); + if (m_xml.name() == "item") { + m_titleString.clear(); + m_linkString.clear(); + } m_currentTag = m_xml.name().toString(); } else if (m_xml.isEndElement()) { if (m_xml.name() == "item") { m_items++; if (m_items > m_maxItems) return; - emit newsItemReady(m_titleString, m_linkString); - m_titleString.clear(); - m_linkString.clear(); } } else if (m_xml.isCharacters() && !m_xml.isWhitespace()) { diff --git a/src/plugins/coreplugin/welcomemode.cpp b/src/plugins/coreplugin/welcomemode.cpp index 1c39a466777..a03241d2dbc 100644 --- a/src/plugins/coreplugin/welcomemode.cpp +++ b/src/plugins/coreplugin/welcomemode.cpp @@ -38,12 +38,15 @@ #include #include +#include #include #include #include #include #include +#include + #include "ui_welcomemode.h" namespace Core { @@ -101,7 +104,8 @@ WelcomeMode::WelcomeMode() : l->setMargin(0); l->setSpacing(0); l->addWidget(new QToolBar(m_d->m_widget)); - m_d->rssFetcher = new RSSFetcher(6, this); + // limit to 7 items to avoid scrollbars + 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.sessTreeWidget->viewport()->setAutoFillBackground(false); @@ -109,6 +113,7 @@ WelcomeMode::WelcomeMode() : m_d->ui.newsTreeWidget->viewport()->setAutoFillBackground(false); m_d->ui.sitesTreeWidget->viewport()->setAutoFillBackground(false); m_d->ui.tutorialTreeWidget->viewport()->setAutoFillBackground(false); + m_d->ui.didYouKnowTextBrowser->viewport()->setAutoFillBackground(false); l->addWidget(m_d->m_welcomePage); updateWelcomePage(WelcomePageData()); @@ -120,7 +125,6 @@ WelcomeMode::WelcomeMode() : connect(m_d->btnGrp, SIGNAL(buttonClicked(int)), m_d->ui.stackedWidget, SLOT(setCurrentIndex(int))); - connect(m_d->ui.gettingStartedButton, SIGNAL(clicked()), SIGNAL(requestHelp())); connect(m_d->ui.feedbackButton, SIGNAL(clicked()), SLOT(slotFeedback())); connect(m_d->ui.restoreSessionButton, SIGNAL(clicked()), SLOT(slotRestoreLastSession())); connect(m_d->ui.sessTreeWidget, SIGNAL(activated(QString)), SLOT(slotSessionClicked(QString))); @@ -141,9 +145,9 @@ WelcomeMode::WelcomeMode() : m_d->ui.sitesTreeWidget->addItem(tr("Qt Centre"), QLatin1String("http://www.qtcentre.org")); m_d->ui.sitesTreeWidget->addItem(tr("Qt/S60 at Forum Nokia"), QLatin1String("http://discussion.forum.nokia.com/forum/forumdisplay.php?f=196")); - m_d->ui.tutorialTreeWidget->addItem(tr("Using Qt Creator"), + m_d->ui.tutorialTreeWidget->addItem(tr("Qt Creator - A quick tour"), QString("qthelp://com.nokia.qtcreator.%1%2/doc/index.html").arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR)); - m_d->ui.tutorialTreeWidget->addItem(tr("Understanding Widgets"), + m_d->ui.tutorialTreeWidget->addItem(tr("Understanding widgets"), QLatin1String("qthelp://com.trolltech.qt/qdoc/widgets-tutorial.html")); m_d->ui.tutorialTreeWidget->addItem(tr("Creating an address book"), QLatin1String("qthelp://com.trolltech.qt/qdoc/tutorials-addressbook.html")); @@ -152,6 +156,7 @@ WelcomeMode::WelcomeMode() : m_d->ui.tutorialTreeWidget->addItem(tr("Writing test cases"), QLatin1String("qthelp://com.trolltech.qt/qdoc/qtestlib-tutorial.html")); + m_d->ui.didYouKnowTextBrowser->setText(getTipOfTheDay()); QSettings *settings = ICore::instance()->settings(); int id = settings->value("General/WelcomeTab", 0).toInt(); m_d->btnGrp->button(id)->setChecked(true); @@ -210,7 +215,8 @@ void WelcomeMode::updateWelcomePage(const WelcomePageData &welcomePageData) m_d->ui.projTreeWidget->clear(); if (welcomePageData.sessionList.count() > 1) { - foreach (const QString &s, welcomePageData.sessionList) { + // limit list to 7 displayed entries to avoid a scrollbar + foreach (const QString &s, welcomePageData.sessionList.mid(0, 6)) { QString str = s; if (s == welcomePageData.previousSession) str = tr("%1 (last session)").arg(s); @@ -223,7 +229,8 @@ void WelcomeMode::updateWelcomePage(const WelcomePageData &welcomePageData) } typedef QPair QStringPair; - foreach (const QStringPair &it, welcomePageData.projectList) { + // limit list to 8 displayed entries to avoid a scrollbar + foreach (const QStringPair &it, welcomePageData.projectList.mid(0, 7)) { QTreeWidgetItem *item = m_d->ui.projTreeWidget->addItem(it.second, it.first); const QFileInfo fi(it.first); item->setToolTip(1, QDir::toNativeSeparators(fi.absolutePath())); @@ -275,6 +282,27 @@ void WelcomeMode::slotFeedback() "http://www.qtsoftware.com/forms/feedback-forms/qt-creator-user-feedback/view"))); } +QString WelcomeMode::getTipOfTheDay() +{ + static QStringList tips; + if (tips.isEmpty()) { + tips.append(tr("You can switch between Qt Creator's modes using Ctrl+number:" + "
  1. - Welcome
  2. - Edit
  3. - Debug
  4. - Projects
  5. - Help
  6. " + "
  7. - Output
")); + tips.append(tr("You can show and hide the side bar using Alt+0.")); + tips.append(tr("You can fine tune the Find function by selecting "Whole Words" " + "or "Case Sensitive". Simply click on the icons on the right end of the line edit.")); + tips.append(tr("If you add a external libraries, Qt Creator will automatically offer syntax highlighting " + "and code completion.")); + } + + srand(QDateTime::currentDateTime().toTime_t()); + return tips.at(rand()%tips.count()); +} + + + // --- WelcomeModeButton WelcomeModeButton::WelcomeModeButton(QWidget *parent) : diff --git a/src/plugins/coreplugin/welcomemode.h b/src/plugins/coreplugin/welcomemode.h index f2bba8c0f78..ecdf2cbe50b 100644 --- a/src/plugins/coreplugin/welcomemode.h +++ b/src/plugins/coreplugin/welcomemode.h @@ -79,7 +79,6 @@ signals: void requestProject(const QString &project); void requestSession(const QString &session); void openHelpPage(const QString&); - void requestHelp(); private slots: void slotFeedback(); @@ -90,6 +89,7 @@ private slots: private: void activateEditMode(); + QString getTipOfTheDay(); WelcomeModePrivate *m_d; }; diff --git a/src/plugins/coreplugin/welcomemode.ui b/src/plugins/coreplugin/welcomemode.ui index ba2c5619d32..f477411bbde 100644 --- a/src/plugins/coreplugin/welcomemode.ui +++ b/src/plugins/coreplugin/welcomemode.ui @@ -15,14 +15,11 @@ background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(247, 247, 247, 255), stop:1 rgba(215, 215, 215, 255)); } - - - 0 - + 0 - + #gradientWidget { @@ -30,21 +27,15 @@ background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 } - - 0 - - - 0 - - + Qt::Vertical - 17 - 57 + 0 + 0 @@ -56,13 +47,13 @@ background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 - 11 - 20 + 0 + 0 - + @@ -219,341 +210,341 @@ background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 - 1 + 2 - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 20 - 326 - - - - - - - - - 0 - 0 - - - - - 400 - 16777215 - - - - - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + + 30 + 20 + 270 + 290 + + + + + 0 + 0 + + + + + 400 + 16777215 + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> <p style=" margin-top:16px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:x-large; color:#555555;">Tutorials</span></p> <hr /></body></html> - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - 0 - 0 - - - - Qt::NoFocus - - - QFrame::NoFrame - - - QAbstractItemView::NoSelection - - - QAbstractItemView::ScrollPerPixel - - - false - - - true - - - true - - - 2 - - - false - - - 24 - - - 0 - - - - 1 - - - - - 2 - - - - - - - - - - - Qt::Vertical - - - - 20 - 192 - - - - - - - - - - - :/core/images/qtcreator_logo_128.png - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - * { - border-image: url(:/core/images/welcomemode/btn_27.png) 7; - border-width: 7; - padding: -2px 0; - font-size: 12px; - font-family: lucida sans, dejavu sans, sans serif; - color: black; -} - -*:hover { - border-image: url(:/core/images/welcomemode/btn_27_hover.png) 7; - color: white; -} - - - - <qt>Getting Started &gt;&gt; - - - - + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + + 0 + 0 + + + + Qt::NoFocus + + + QFrame::NoFrame + + + QAbstractItemView::NoSelection + + + QAbstractItemView::ScrollPerPixel + + + false + + + true + + + true + + + 2 + + + false + + + 24 + + + 0 + + + + 1 + + + + + 2 + + + + + + + + + + 350 + 119 + 274 + 191 + + + + + 0 + 0 + + + + + 400 + 16777215 + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:16px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:x-large; color:#555555;">Did you know?</span></p> +<hr /></body></html> + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + true + + + + + + + + + 350 + 20 + 271 + 83 + + + + + 0 + 0 + + + + + 400 + 16777215 + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:16px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:x-large; color:#555555;">Explore Demos and Examples</span></p> +<hr /></body></html> + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + false + + + + 0 + 0 + + + + + + + + false + + + Open + + + + + - - - - - Qt::Vertical - - - - 578 - 34 - - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 19 - 20 - - - - - - - - - 0 - 0 - - - - - 270 - 130 - - - - - 270 - 16777215 - - - - - - - - - - :/core/images/welcomemode/mode_project.png - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + + 30 + 20 + 270 + 291 + + + + + 0 + 0 + + + + + 270 + 130 + + + + + 270 + 16777215 + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> <p style=" margin-top:16px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:x-large; color:#555555;">Sessions</span></p> <hr /></body></html> - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - 0 - 0 - - - - Qt::NoFocus - - - QFrame::NoFrame - - - QAbstractItemView::NoSelection - - - QAbstractItemView::ScrollPerPixel - - - false - - - true - - - true - - - 2 - - - false - - - 24 - - - 0 - - - - 1 - - - - - 2 - - - - - - - - Qt::Horizontal - - - - 58 - 20 - - - - - - - - - 0 - 0 - - - - * { + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + + 0 + 0 + + + + Qt::NoFocus + + + QFrame::NoFrame + + + QAbstractItemView::NoSelection + + + QAbstractItemView::ScrollPerPixel + + + false + + + true + + + true + + + 2 + + + false + + + 24 + + + 0 + + + + 1 + + + + + 2 + + + + + + + + + 0 + 0 + + + + * { border-image: url(:/core/images/welcomemode/btn_26.png) 7; border-width: 7; padding: -2px 0; @@ -567,418 +558,359 @@ p, li { white-space: pre-wrap; } color: white; } - - - <qt>Restore Last Session &gt;&gt; - - - - - - - - - - Qt::Horizontal - - - - 26 - 20 - - - - - - - - - 0 - 0 - - - - - 270 - 16777215 - - - - - - - - - - :/core/images/welcomemode/mode_project.png - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + <qt>Restore Last Session &gt;&gt; + + + + + + + Qt::Horizontal + + + + 89 + 22 + + + + + + + + + + 350 + 20 + 270 + 291 + + + + + 0 + 0 + + + + + 270 + 16777215 + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> <p style=" margin-top:16px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:x-large; color:#555555;">Projects</span></p> <hr /></body></html> - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - 0 - 0 - - - - Qt::NoFocus - - - QFrame::NoFrame - - - QAbstractItemView::NoSelection - - - QAbstractItemView::ScrollPerPixel - - - false - - - true - - - true - - - 2 - - - false - - - 24 - - - 0 - - - - 1 - - - - - 2 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - Qt::Vertical - - - - 578 - 34 - - - - - + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + + 0 + 0 + + + + Qt::NoFocus + + + QFrame::NoFrame + + + QAbstractItemView::NoSelection + + + QAbstractItemView::ScrollPerPixel + + + false + + + true + + + true + + + 2 + + + false + + + 24 + + + 0 + + + + 1 + + + + + 2 + + + + + + - - - - - Qt::Vertical - - - - 20 - 35 - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 19 - 228 - - - - - - - - - - - - - 0 - 0 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + + 30 + 20 + 330 + 291 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 0 + 0 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:16px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:x-large; color:#555555;">Qt Community News</span></p> +<p style=" margin-top:16px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:x-large; color:#555555;">News from the Qt Labs</span></p> <hr /></body></html> - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - 280 - 0 - - - - Qt::NoFocus - - - QFrame::NoFrame - - - QAbstractItemView::NoSelection - - - QAbstractItemView::ScrollPerPixel - - - false - - - true - - - true - - - 2 - - - false - - - 24 - - - 0 - - - - 1 - - - - - 2 - - - - - - - - - - Qt::Horizontal - - - - 156 - 20 - - - - - - - - - - - 0 - 0 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + + 280 + 0 + + + + Qt::NoFocus + + + QFrame::NoFrame + + + QAbstractItemView::NoSelection + + + QAbstractItemView::ScrollPerPixel + + + false + + + true + + + true + + + 2 + + + false + + + 24 + + + 0 + + + + 1 + + + + + 2 + + + + + + + + + + 400 + 20 + 220 + 290 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 0 + 0 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> <p style=" margin-top:16px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:x-large; color:#555555;">Qt Websites</span></p> <hr /></body></html> - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - 0 - 0 - - - - Qt::NoFocus - - - QFrame::NoFrame - - - QAbstractItemView::NoSelection - - - QAbstractItemView::ScrollPerPixel - - - false - - - true - - - true - - - 2 - - - false - - - 24 - - - 0 - - - - 1 - - - - - 2 - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 19 - 0 - - - - - - - - - - Qt::Vertical - - - - 20 - 34 - - - - - - - - - - Qt::Horizontal - - - - 633 - 20 - - - - - - + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + + 0 + 0 + + + + Qt::NoFocus + + + QFrame::NoFrame + + + QAbstractItemView::NoSelection + + + QAbstractItemView::ScrollPerPixel + + + false + + + true + + + true + + + 2 + + + false + + + 24 + + + 0 + + - Help us make Qt Creator even better + 1 - - - - - - * { + + + + 2 + + + + + + + + + + + + + 15 + + + 17 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Help us make Qt Creator even better + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 6 + 0 + + + + + + + + * { border-image: url(:/core/images/welcomemode/btn_26.png) 7; border-width: 7; padding: -2px 2px; @@ -991,30 +923,26 @@ p, li { white-space: pre-wrap; } color: white; } - - - <qt>Feedback&nbsp;&nbsp;<img src=":/core/images/welcomemode/feedback_arrow.png" /> - - - - - - - - + + + <qt>Feedback&nbsp;&nbsp;<img src=":/core/images/welcomemode/feedback_arrow.png" /> + + + + - - + + Qt::Horizontal - 10 - 20 + 0 + 0 @@ -1026,8 +954,8 @@ p, li { white-space: pre-wrap; } - 17 - 57 + 0 + 0 @@ -1049,8 +977,6 @@ p, li { white-space: pre-wrap; }
welcomemode_p.h
- - - +