fully-fledged webkit-free welcome mode

pros:
- the non-webkit version is not castrated any more
- i18n should become simpler
  - but need to make the buttons non-labels for optimal results
- if we introduce delayed loading of the help plugin, we would get
  webkit loading out of the startup's critical path alltogether

cons:
- the page might be a bit harder to modify for some
This commit is contained in:
Oswald Buddenhagen
2009-04-22 18:17:50 +02:00
parent b4245ac15c
commit f48f23c89d
39 changed files with 1071 additions and 708 deletions

View File

@@ -1,34 +1,5 @@
<RCC>
<qresource prefix="/core" >
<file>html/images/bg_site_header_dark_grey.png</file>
<file>html/images/body_bg_circles_bottom_right.png</file>
<file>html/images/body_bg_gradient.png</file>
<file>html/images/btn_feedback.png</file>
<file>html/images/btn_feedback_hover.png</file>
<file>html/images/btn_getting_started.png</file>
<file>html/images/btn_getting_started_hover.png</file>
<file>html/images/btn_restore_session.png</file>
<file>html/images/btn_restore_session_hover.png</file>
<file>html/images/feedback-bar-background.png</file>
<file>html/images/feedback-text.png</file>
<file>html/images/list_bullet_arrow.png</file>
<file>html/images/mode_Project.png</file>
<file>html/images/nokia_logo.png</file>
<file>html/images/product_logo.png</file>
<file>html/images/qt_logo.png</file>
<file>html/images/rc_bottom_left.png</file>
<file>html/images/rc_bottom_mid.png</file>
<file>html/images/rc_bottom_right.png</file>
<file>html/images/rc_mid_left.png</file>
<file>html/images/rc_mid_mid.png</file>
<file>html/images/rc_mid_right.png</file>
<file>html/images/rc_top_left.png</file>
<file>html/images/rc_top_mid.png</file>
<file>html/images/rc_top_right.png</file>
<file>html/qt.css</file>
<file>html/recent_projects.html</file>
<file>html/recent_sessions.html</file>
<file>html/welcome.html</file>
<file>images/clean_pane_small.png</file>
<file>images/clear.png</file>
<file>images/closebutton.png</file>
@@ -73,5 +44,19 @@
<file>images/unlocked.png</file>
<file>images/extension.png</file>
<file>images/darkclosebutton.png</file>
<file>images/welcomemode/btn_feedback.png</file>
<file>images/welcomemode/btn_feedback_hover.png</file>
<file>images/welcomemode/btn_getting_started.png</file>
<file>images/welcomemode/btn_getting_started_hover.png</file>
<file>images/welcomemode/btn_restore_session.png</file>
<file>images/welcomemode/btn_restore_session_hover.png</file>
<file>images/welcomemode/feedback-bar-background.png</file>
<file>images/welcomemode/feedback-text.png</file>
<file>images/welcomemode/list_bullet_arrow.png</file>
<file>images/welcomemode/mode_project.png</file>
<file>images/welcomemode/nokia_logo.png</file>
<file>images/welcomemode/product_logo.png</file>
<file>images/welcomemode/qt_logo.png</file>
<file>images/welcomemode/rc_combined.png</file>
</qresource>
</RCC>

View File

@@ -38,10 +38,6 @@
#include <extensionsystem/pluginmanager.h>
#include <QtCore/QtPlugin>
#if !defined(QT_NO_WEBKIT)
#include <QtGui/QApplication>
#include <QtWebKit/QWebSettings>
#endif
using namespace Core::Internal;
@@ -72,12 +68,6 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
Q_UNUSED(arguments);
const bool success = m_mainWindow->init(errorMessage);
if (success) {
#if !defined(QT_NO_WEBKIT)
QWebSettings *webSettings = QWebSettings::globalSettings();
const QFont applicationFont = QApplication::font();
webSettings->setFontFamily(QWebSettings::StandardFont, applicationFont.family());
//webSettings->setFontSize(QWebSettings::DefaultFontSize, applicationFont.pointSize());
#endif
m_welcomeMode = new WelcomeMode;
addObject(m_welcomeMode);

View File

@@ -75,6 +75,7 @@ SOURCES += mainwindow.cpp \
icore.cpp
HEADERS += mainwindow.h \
welcomemode.h \
welcomemode_p.h \
editmode.h \
tabpositionindicator.h \
fancyactionbar.h \
@@ -155,14 +156,11 @@ FORMS += dialogs/newdialog.ui \
dialogs/saveitemsdialog.ui \
dialogs/openwithdialog.ui \
editormanager/openeditorsview.ui \
generalsettings.ui
generalsettings.ui \
welcomemode.ui
RESOURCES += core.qrc \
fancyactionbar.qrc
contains(QT_CONFIG, webkit) {
QT += webkit
}
linux-* {
images.files = images/qtcreator_logo_*.png
images.path = /share/pixmaps

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

View File

@@ -1,378 +0,0 @@
/**************************************
Nokia, QT Software CSS - IDE Startseite
**************************************/
/**************************************
Reset
**************************************/
* {
vertical-align: baseline;
font-weight: inherit;
font-family: inherit;
font-style: inherit;
padding: 0;
margin: 0;
}
/*image link*/
a.img_link:link {text-decoration:none;}
a.img_link:visited {text-decoration:none}
a.img_link:active {text-decoration:none}
a.img_link:hover {text-decoration:none}
/*regular link*/
a:link {color:#5e5e5e; text-decoration:none;}
a:visited {color:#5e5e5e; text-decoration:none}
a:active {color:#5e5e5e; text-decoration:none}
a:hover {color:#5e5e5e; text-decoration:underline}
p{
font-size:9pt;
}
strong{
font-weight: bold;
}
em {
font-style: italic;
}
ul{
list-style-type: none;
margin:0px 0px;
padding:15px 0px;
}
li {
background:url(images/list_bullet_arrow.png) top left no-repeat;
font-size:9pt;
padding:1px 0px 0px 22px;
margin:0px 0px 15px 0px;
}
li:last-child{
margin:0px;
}
img {
border: 0 none;
}
/*Welcome Headline*/
h1{
font-size:2em;
font-weight:normal;
padding-bottom:22px;
color:#4d4d4d;
}
/*Headlines Recent...*/
h2{
font-size:18px;
font-weight:normal;
color:#7c92a1;
border-bottom:1px solid #a6b5c1;
padding:5px 0px 10px 0px;
}
.clear_float{
clear:both;
}
.clear_left{
clear:left;
}
.clear_right{
clear:right;
}
/**************************************
HTML / BODY
**************************************/
html, body {
font-family: Arial, Trebuchet, Lucida, sans-serif;
color: #5e5e5e;
background:#d7d7d7 url(images/body_bg_gradient.png) top left repeat-x;
height:100%;
}
/*Platzierung der Circles unten rechts*/
.global_container {
position:relative;
width:100%;
min-height:100%;
min-width:550px;
}
.footer {
position:relative;
list-style-type:none;
margin:0;
padding:0;
width:100%;
height:55px;
margin-top:-86px;
}
.feedback-bar {
position:relative;
list-style-type:none;
margin:0;
padding:0;
height: 31px;
width: 100%;
margin-top: 0px;
background-image: url(images/feedback-bar-background.png);
}
a.btn_feedback {
background-image:url(images/btn_feedback.png);
width:102px;
height:26px;
display:block;
float:left;
}
a.btn_feedback:hover {
background-image:url(images/btn_feedback_hover.png)
}
.left-logo {
float:left;
background:none;
margin:0;
padding:0;
padding-left: 15px;
content:url(images/qt_logo.png);
}
.right-logo {
float:right;
background:none;
margin: 0;
margin-right: 15px;
margin-top: 25px;
padding:0;
content:url(images/nokia_logo.png);
}
/**************************************
Site Header
**************************************/
.site_header{
height:21px;
background:#686868 url(images/bg_site_header_dark_grey.png) top left repeat-x;
}
.site_header p{
padding:3px 10px;
color:#fff;
}
/**************************************
Content
**************************************/
.content_container{
margin:0px auto;
/*CUSTOMIZE WIDTH*/
width:600px;
}
/**************************************
Layout TOP - Logo und Welcome Text
**************************************/
.layout_top{
padding-top:50px;
min-height:250px;
}
/*Product Logo*/
.layout_top .product_logo{
float:left;
width:210px;
}
.layout_top .product_logo img{
}
/*Welcome Text*/
.layout_top .welcome_text{
margin-left:210px;
padding-top:20px;
padding-bottom:30px;
}
.layout_top .welcome_text p{
font-size:9pt;
line-height:180%;
}
.layout_top .welcome_text .get_started_container{
border-top:1px solid #a8a8a8;
margin-top:20px;
padding:10px 0px;
}
/*Getting started Button inlusive CSS HOVER*/
a.btn_getting_started{
float:right;
display:block;
background-image:url(images/btn_getting_started.png);
width:133px;
height:29px;
}
a.btn_getting_started:hover{
background-image:url(images/btn_getting_started_hover.png)
};
/**************************************
Layout BOTTOM - Recent Projects und Recent Sessions
**************************************/
/*ROUNDED CORNER BOX - fluid layout compatible*/
.rc_box{}
.rc_box .top{height:8px;}
.rc_box .top .left{float:left; height:8px; width:8px; background:url(images/rc_top_left.png) top left no-repeat;}
.rc_box .top .mid{margin-left:8px; margin-right:8px; height:8px; background:url(images/rc_top_mid.png) top left repeat-x;}
.rc_box .top .right{float:right; height:8px; width:8px; background:url(images/rc_top_right.png) top left no-repeat;}
.rc_box .mid{}
.rc_box .mid .mid{padding:0px 20px 0px 10px; min-height:203px; background:#e6e6e6 url(images/rc_mid_mid.png) top left repeat-x; border-left:1px solid #a6b5c1; border-right:1px solid #a6b5c1;}
.rc_box .icon{
width:35px;
float:left;
padding-top:3px;
}
.rc_box .box_content{
margin-left:35px;
}
.rc_box .bottom{height:8px;}
.rc_box .bottom .left{float:left; height:8px; width:8px; background:url(images/rc_bottom_left.png) top left no-repeat;}
.rc_box .bottom .mid{margin-left:8px; margin-right:8px; height:8px; background:url(images/rc_bottom_mid.png) top left repeat-x;}
.rc_box .bottom .right{float:right; height:8px; width:8px; background:url(images/rc_bottom_right.png) top left no-repeat;}
/*Layout Bottom*/
.layout_bottom{ padding:10px 0px 50px 0px; }
/*Recent Projects*/
.layout_bottom .rec_proj_container{
margin-left:50%;
}
.layout_bottom .rec_proj_container .rec_proj_box{
margin-left:10px;
}
/*Recent Sessions*/
.layout_bottom .rec_sess_container{
width:50%;
float:left;
}
.layout_bottom .rec_sess_container .rec_sess_box{
margin-right:10px;
}
/*Restore Session Button inlusive CSS HOVER*/
a.restore_session{
float:right;
display:block;
background-image:url(images/btn_restore_session.png);
width:137px;
height:27px;
}
a.restore_session:hover{
background-image:url(images/btn_restore_session_hover.png)
};

View File

@@ -1,41 +0,0 @@
<div class="rc_box rec_proj_container">
<div class="rec_proj_box">
<!-- top -->
<div class="top">
<div class="left"></div>
<div class="right"></div>
<div class="mid"></div>
</div>
<!-- mid -->
<div class="mid">
<div class="mid">
<div class="icon">
<img src="images/mode_Project.png"></img>
</div>
<div class="box_content">
<h2>Recent Projects</h2>
<ul>
<!-- RECENT PROJECTS LIST -->
<!--<li><p><a href="#">Project 1</a></p></li>
<li><p><a href="#">Project 2</a></p></li>
<li><p><a href="#">Project 3</a></p></li>
<li><p><a href="#">Project 4</a></p></li>
<li><p><a href="#">Project 5</a></p></li>-->
</ul>
</div>
</div>
</div>
<!-- bottom -->
<div class="bottom">
<div class="left"></div>
<div class="right"></div>
<div class="mid"></div>
</div>
</div>
</div>

View File

@@ -1,43 +0,0 @@
<div class="rc_box rec_sess_container">
<div class="rec_sess_box">
<!-- top -->
<div class="top">
<div class="left"></div>
<div class="right"></div>
<div class="mid"></div>
</div>
<!-- mid -->
<div class="mid">
<div class="mid">
<div class="icon">
<img src="images/mode_Project.png"></img>
</div>
<div class="box_content">
<h2>Recent Sessions</h2>
<ul>
<!-- RECENT SESSIONS LIST -->
<!--<li><p><a href="#">Session 1</a></p></li>
<li><p><a href="#">Session 2</a></p></li>
<li><p><a href="#">Session 3</a></p></li>
<li><p><a href="#">Session 4</a></p></li>-->
</ul>
<a class="restore_session img_link" href="gh-session:LAST_SESSION">&nbsp;</a>
<div class="clear_right"></div>
</div>
</div>
</div>
<!-- bottom -->
<div class="bottom">
<div class="left"></div>
<div class="right"></div>
<div class="mid"></div>
</div>
</div>
</div>

View File

@@ -1,78 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Nokia, Qt Software</title>
<!--<meta name="expires" content="0">-->
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="qt.css">
<script type="text/javascript">
var preloadImg01 = new Image();
preloadImg01.src = "images/btn_getting_started_hover.png";
var preloadImg02 = new Image();
preloadImg02.src = "images/btn_restore_session_hover.png";
var preloadImg03 = new Image();
preloadImg03.src = "images/btn_feedback_hover.png";
</script>
</head>
<body>
<div class="global_container">
<!-- Obere dunkelgraue Zeile "Welcome" -->
<!-- <div class="site_header">
<p>Welcome</p>
</div>
-->
<!-- Content START -->
<!-- Zentrierung des Contents -->
<div class="content_container">
<!-- TOP - Logo und Welcome Text -->
<div class="layout_top">
<div class="product_logo">
<img src="images/product_logo.png" alt="product_logo"></img>
</div>
<div class="welcome_text">
<h1>Welcome</h1>
<p>Qt Creator is an intuitive, modern cross platform IDE that enables
developers to create graphically appealing applications for desktop,
embedded, and mobile devices. Click on <strong>Getting Started</strong> to
begin developing with Qt Creator.</p>
<div class="get_started_container">
<a class="btn_getting_started img_link" href="gh:getting-started">&nbsp;</a>
<div class="clear_right"></div>
</div>
</div>
</div>
<!-- BOTTOM - Recent Projects und Recent Sessions -->
<div class="layout_bottom">
<!-- RECENT SESSIONS -->
<!-- RECENT PROJECTS -->
<!-- clear floating of sessions and projects -->
<div class="clear_left"></div>
</div>
<!-- Layout Bottom END -->
</div>
<!-- Content END -->
</div>
<ul class="footer">
<li class="right-logo"/>
<li class="left-logo"/>
</ul>
<ul class="feedback-bar">
<img src="images/feedback-text.png" alt="Help us make Qt Creator better" style="margin-left: 10px; margin-top: 3px; float: left;"/>
<a class="btn_feedback img_link" href="http://www.qtsoftware.com/forms/feedback-forms/qt-creator-user-feedback/view" style="margin-top: 3px; margin-left: 4px;">&nbsp;</a>
</ul>
</body>

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 245 B

After

Width:  |  Height:  |  Size: 245 B

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 280 B

After

Width:  |  Height:  |  Size: 280 B

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 B

View File

@@ -32,83 +32,35 @@
#include "uniqueidmanager.h"
#include "modemanager.h"
#if !defined(QT_NO_WEBKIT)
#include <QtWebKit/QWebView>
#include <QtGui/QApplication>
#include <QtCore/QFileInfo>
#else
#include <QtGui/QLabel>
#endif
#include <QtGui/QToolBar>
#include <QtGui/QDesktopServices>
#include <QtGui/QMouseEvent>
#include <QtCore/QDir>
#include <QtCore/QFile>
#include <QtCore/QTextStream>
#include <QtCore/QFileInfo>
#include <QtCore/QDebug>
#include <QtCore/QUrl>
#include "ui_welcomemode.h"
namespace Core {
namespace Internal {
static QString readFile(const QString &name)
{
QFile f(name);
if (!f.open(QIODevice::ReadOnly)) {
qWarning("Unable to open %s: %s", name.toUtf8().constData(), f.errorString().toUtf8().constData());
return QString();
}
QTextStream ts(&f);
return ts.readAll();
}
struct WelcomeModePrivate
{
WelcomeModePrivate();
QWidget *m_widget;
#if !defined(QT_NO_WEBKIT)
QWebView *m_webview;
#else
QLabel *m_label;
#endif
QWidget *m_welcomePage;
Ui::welcomePage ui;
WelcomeMode::WelcomePageData lastData;
const QString m_htmlTemplate;
const QString m_sessionHtmlTemplate;
const QString m_projectHtmlTemplate;
const QUrl m_baseUrl;
};
WelcomeModePrivate::WelcomeModePrivate() :
m_widget(new QWidget),
#if !defined(QT_NO_WEBKIT)
m_webview(new QWebView),
#else
m_label(new QLabel),
#endif
m_htmlTemplate(readFile(QLatin1String(":/core/html/welcome.html"))),
m_sessionHtmlTemplate(readFile(QLatin1String(":/core/html/recent_sessions.html"))),
m_projectHtmlTemplate(readFile(QLatin1String(":/core/html/recent_projects.html"))),
m_baseUrl(QUrl(QLatin1String("qrc:/core/html/welcome.html")))
WelcomeModePrivate::WelcomeModePrivate()
{
#if !defined(QT_NO_WEBKIT)
m_webview->setContextMenuPolicy(Qt::NoContextMenu);
#endif
}
#if defined(QT_NO_WEBKIT)
const char LABEL[] = QT_TRANSLATE_NOOP("Core::Internal::WelcomeMode",
"<center><table><tr><td><img src=\":/core/html/images/product_logo.png\"/></td><td width=300>"
"<h2><br/><br/>Welcome</h2><p> Qt Creator is an intuitive, modern cross platform IDE that enables "
"developers to create graphically appealing applications for desktop, "
"embedded, and mobile devices. "
"<p><font color=\"red\">(This startup page lacks features due to disabled WebKit support)</font>"
"</td></tr></table>");
#endif
// --- WelcomePageData
bool WelcomeMode::WelcomePageData::operator==(const WelcomePageData &rhs) const
@@ -140,27 +92,25 @@ QDebug operator<<(QDebug dgb, const WelcomeMode::WelcomePageData &d)
WelcomeMode::WelcomeMode() :
m_d(new WelcomeModePrivate)
{
m_d->m_widget = new QWidget;
QVBoxLayout *l = new QVBoxLayout(m_d->m_widget);
l->setMargin(0);
l->setSpacing(0);
l->addWidget(new QToolBar(m_d->m_widget));
#if !defined(QT_NO_WEBKIT)
connect(m_d->m_webview, SIGNAL(linkClicked(QUrl)), this, SLOT(linkClicked(QUrl)));
WelcomePageData welcomePageData;
updateWelcomePage(welcomePageData);
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);
m_d->ui.projTreeWidget->viewport()->setAutoFillBackground(false);
l->addWidget(m_d->m_welcomePage);
l->addWidget(m_d->m_webview);
m_d->m_webview->setAcceptDrops(false);
m_d->m_webview->settings()->setAttribute(QWebSettings::PluginsEnabled, false);
m_d->m_webview->settings()->setAttribute(QWebSettings::JavaEnabled, false);
updateWelcomePage(WelcomePageData());
#else
m_d->m_label->setWordWrap(true);
m_d->m_label->setAlignment(Qt::AlignCenter);
m_d->m_label->setText(tr(LABEL));
l->addWidget(m_d->m_label);
#endif
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)));
connect(m_d->ui.projTreeWidget, SIGNAL(activated(QString)), SLOT(slotProjectClicked(QString)));
}
WelcomeMode::~WelcomeMode()
@@ -202,77 +152,137 @@ QList<int> WelcomeMode::context() const
void WelcomeMode::updateWelcomePage(const WelcomePageData &welcomePageData)
{
// should really only modify the DOM tree
#if defined(QT_NO_WEBKIT)
Q_UNUSED(welcomePageData);
#else
// Update only if data are modified
if (welcomePageData == m_d->lastData)
return;
m_d->lastData = welcomePageData;
QString html = m_d->m_htmlTemplate;
m_d->m_widget->setUpdatesEnabled(false);
if (!welcomePageData.previousSession.isEmpty() || !welcomePageData.projectList.isEmpty()) {
QString sessionHtml = m_d->m_sessionHtmlTemplate;
sessionHtml.replace(QLatin1String("LAST_SESSION"), welcomePageData.previousSession);
m_d->ui.sessTreeWidget->clear();
m_d->ui.projTreeWidget->clear();
if (welcomePageData.sessionList.count() > 1) {
QString sessions;
foreach (QString s, welcomePageData.sessionList) {
QString last;
foreach (const QString &s, welcomePageData.sessionList) {
QString str = s;
if (s == welcomePageData.previousSession)
last = tr(" (last session)");
sessions += QString::fromLatin1("<li><p><a href=\"gh-session:%1\">%2%3</a></p></li>").arg(s, s, last);
str = tr("%1 (last session)").arg(s);
m_d->ui.sessTreeWidget->addItem(str, s);
}
sessionHtml.replace(QLatin1String("<!-- RECENT SESSIONS LIST -->"), sessions);
}
html.replace(QLatin1String("<!-- RECENT SESSIONS -->"), sessionHtml);
QString projectHtml = m_d->m_projectHtmlTemplate;
{
QString projects;
QTextStream str(&projects);
QList<QPair<QString, QString> >::const_iterator it, end;
end = welcomePageData.projectList.constEnd();
for( it = welcomePageData.projectList.constBegin(); it != end; ++it) {
const QFileInfo fi((*it).first);
str << "<li><p><a href=\"gh-project:" << (*it).first << "\" title=\""
<< QDir::toNativeSeparators(fi.absolutePath()) << "\">" << (*it).second << "</a></p></li>\n";
}
projectHtml.replace(QLatin1String("<!-- RECENT PROJECTS LIST -->"), projects);
}
html.replace(QLatin1String("<!-- RECENT PROJECTS -->"), projectHtml);
m_d->ui.sessTreeWidget->updateGeometry();
m_d->ui.sessTreeWidget->show();
} else {
m_d->ui.sessTreeWidget->hide();
}
m_d->m_webview->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
m_d->m_webview->setHtml(html, m_d->m_baseUrl);
#endif
typedef QPair<QString, QString> QStringPair;
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->m_widget->setUpdatesEnabled(true);
}
void WelcomeMode::linkClicked(const QUrl &url)
void WelcomeMode::activateEditMode()
{
QString scheme = url.scheme();
Core::ModeManager *modeManager = ModeManager::instance();
if (scheme.startsWith(QLatin1String("gh"))) {
QString s = url.toString(QUrl::RemoveScheme);
if (scheme == QLatin1String("gh")) {
emit requestHelp(s);
} else if (scheme == QLatin1String("gh-project")) {
emit requestProject(s);
if (modeManager->currentMode() == this)
modeManager->activateMode(Core::Constants::MODE_EDIT);
} else if (scheme == QLatin1String("gh-session")) {
emit requestSession(s);
if (modeManager->currentMode() == this)
modeManager->activateMode(Core::Constants::MODE_EDIT);
}
void WelcomeMode::slotSessionClicked(const QString &data)
{
emit requestSession(data);
activateEditMode();
}
void WelcomeMode::slotProjectClicked(const QString &data)
{
emit requestProject(data);
activateEditMode();
}
void WelcomeMode::slotRestoreLastSession()
{
emit requestSession(m_d->lastData.previousSession);
activateEditMode();
}
void WelcomeMode::slotFeedback()
{
QDesktopServices::openUrl(QUrl(QLatin1String(
"http://www.qtsoftware.com/forms/feedback-forms/qt-creator-user-feedback/view")));
}
// --- WelcomeModeButton
WelcomeModeButton::WelcomeModeButton(QWidget *parent) :
QLabel(parent),
m_isPressed(false)
{
setCursor(QCursor(Qt::PointingHandCursor));
}
void WelcomeModeButton::mousePressEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton)
m_isPressed = true;
}
void WelcomeModeButton::mouseReleaseEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton && m_isPressed) {
m_isPressed = false;
if (rect().contains(event->pos()))
emit clicked();
}
} else {
QDesktopServices::openUrl(url);
}
}
// --- WelcomeModeTreeWidget
WelcomeModeTreeWidget::WelcomeModeTreeWidget(QWidget *parent) :
QTreeWidget(parent),
m_bullet(QLatin1String(":/core/images/welcomemode/list_bullet_arrow.png"))
{
connect(this, SIGNAL(itemClicked(QTreeWidgetItem *, int)),
SLOT(slotItemClicked(QTreeWidgetItem *)));
}
QSize WelcomeModeTreeWidget::sizeHint() const
{
return QSize(QTreeWidget::sizeHint().width(), 30 * topLevelItemCount());
}
QTreeWidgetItem *WelcomeModeTreeWidget::addItem(const QString &label, const QString &data)
{
QTreeWidgetItem *item = new QTreeWidgetItem(this);
item->setIcon(0, m_bullet);
item->setSizeHint(0, QSize(24, 30));
QWidget *lbl = new QLabel(label);
lbl->setCursor(QCursor(Qt::PointingHandCursor));
lbl->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
QBoxLayout *lay = new QVBoxLayout;
lay->setContentsMargins(3, 2, 0, 0);
lay->addWidget(lbl);
QWidget *wdg = new QWidget;
wdg->setLayout(lay);
setItemWidget(item, 1, wdg);
item->setData(0, Qt::UserRole, data);
return item;
}
void WelcomeModeTreeWidget::slotItemClicked(QTreeWidgetItem *item)
{
emit activated(item->data(0, Qt::UserRole).toString());
}
} // namespace Internal

View File

@@ -78,12 +78,17 @@ public:
signals:
void requestProject(const QString &project);
void requestSession(const QString &session);
void requestHelp(const QString &help);
void requestHelp();
private slots:
void linkClicked(const QUrl &url);
void slotFeedback();
void slotRestoreLastSession();
void slotSessionClicked(const QString &data);
void slotProjectClicked(const QString &data);
private:
void activateEditMode();
WelcomeModePrivate *m_d;
};

View File

@@ -0,0 +1,821 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>welcomePage</class>
<widget class="QWidget" name="welcomePage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>777</width>
<height>922</height>
</rect>
</property>
<layout class="QVBoxLayout" name="topLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QWidget" name="gradientWidget" native="true">
<property name="styleSheet">
<string notr="true">#gradientWidget {
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));
}
*, * *, * * *, * * * *, * * * * * {
font-family: Arial, Trebuchet, Lucida, sans-serif;
font-size: 9pt;
color: #5e5e5e;
}
#recentSessionsFrame, #recentProjectsFrame {
border-image: url(:/core/images/welcomemode/rc_combined.png) 8 8 8 8 stretch stretch;
border-width: 8 8 8 8;
}
</string>
</property>
<layout class="QGridLayout" name="gradientLayout">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="1">
<layout class="QVBoxLayout" name="contentsLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<spacer name="topSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>50</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="welcomeLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="logoLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="core.qrc">:/core/images/welcomemode/product_logo.png</pixmap>
</property>
</widget>
</item>
<item>
<spacer name="logoSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="welcomeLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>360</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>&lt;style&gt;
h1 {
font-size: 2em;
font-weight: normal;
color: #4d4d4d;
margin-top: 0px;
margin-bottom: 20px;
}
p {
margin-top: 0px;
margin-bottom: 7px;
}
&lt;/style&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Welcome&lt;/h1&gt;
&lt;!-- QTextDocument does not support line-height, so wrap the lines manually ... --&gt;
&lt;p&gt;Qt Creator is an intuitive, modern cross platform IDE that&lt;/p&gt; &lt;p&gt;enables developers to create graphically appealing applications&lt;/p&gt;
&lt;p&gt;for desktop, embedded, and mobile devices. Click on &lt;strong&gt;Getting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Started&lt;/strong&gt; to begin developing with Qt Creator.&lt;/p&gt;
&lt;hr style=&quot;margin-top:15px&quot;/&gt;
</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="gettingStartedLayout">
<item>
<spacer name="gettingStartedSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="Core::Internal::WelcomeModeButton" name="gettingStartedButton">
<property name="minimumSize">
<size>
<width>133</width>
<height>29</height>
</size>
</property>
<property name="styleSheet">
<string>* {
background-image: url(&quot;:/core/images/welcomemode/btn_getting_started.png&quot;);
}
*:hover {
background-image: url(:/core/images/welcomemode/btn_getting_started_hover.png)
}
</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="middelSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>50</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="recentListsLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="recentSessionsLayout">
<item>
<widget class="QFrame" name="recentSessionsFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>270</width>
<height>130</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>270</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string>#recentSessionsFrame {
border-image: url(:/core/images/welcomemode/rc_combined.png) 8 8 8 8 stretch stretch;
border-width: 8 8 8 8;
}
</string>
</property>
<layout class="QGridLayout" name="recentSessionsFrameLayout">
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>12</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<property name="horizontalSpacing">
<number>11</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="iconLabel">
<property name="pixmap">
<pixmap resource="core.qrc">:/core/images/welcomemode/mode_project.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QLabel" name="titleLabel">
<property name="text">
<string notr="true">&lt;style&gt;
h2 {
font-size: 18px;
font-weight: normal;
color: #7c92a1;
margin-bottom: 0px;
}
&lt;/style&gt;
&lt;h2&gt;Recent Sessions&lt;/h2&gt;
&lt;hr/&gt;
</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="restoreButtonSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="2">
<widget class="Core::Internal::WelcomeModeButton" name="restoreSessionButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>137</width>
<height>27</height>
</size>
</property>
<property name="styleSheet">
<string>* {
background-image: url(&quot;:/core/images/welcomemode/btn_restore_session.png&quot;);
}
*:hover {
background-image: url(:/core/images/welcomemode/btn_restore_session_hover.png)
}
</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="Core::Internal::WelcomeModeTreeWidget" name="sessTreeWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::NoSelection</enum>
</property>
<property name="verticalScrollMode">
<enum>QAbstractItemView::ScrollPerPixel</enum>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="uniformRowHeights">
<bool>true</bool>
</property>
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
<property name="columnCount">
<number>2</number>
</property>
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
<attribute name="headerDefaultSectionSize">
<number>24</number>
</attribute>
<attribute name="headerMinimumSectionSize">
<number>0</number>
</attribute>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
<column>
<property name="text">
<string notr="true">2</string>
</property>
</column>
</widget>
</item>
<item row="2" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="sessionsSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="recentListsSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="recentProjectsLayout">
<item>
<widget class="QFrame" name="recentProjectsFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>270</width>
<height>16777215</height>
</size>
</property>
<layout class="QGridLayout" name="recentProjectsFrameLayout">
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>12</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<property name="horizontalSpacing">
<number>11</number>
</property>
<property name="verticalSpacing">
<number>-1</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="projIconLabel">
<property name="pixmap">
<pixmap resource="core.qrc">:/core/images/welcomemode/mode_project.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="projTitleLabel">
<property name="text">
<string notr="true">&lt;style&gt;
h2 {
font-size: 18px;
font-weight: normal;
color: #7c92a1;
margin-bottom: 0px;
}
&lt;/style&gt;
&lt;h2&gt;Recent Projects&lt;/h2&gt;
&lt;hr/&gt;
</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Core::Internal::WelcomeModeTreeWidget" name="projTreeWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::NoSelection</enum>
</property>
<property name="verticalScrollMode">
<enum>QAbstractItemView::ScrollPerPixel</enum>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="uniformRowHeights">
<bool>true</bool>
</property>
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
<property name="columnCount">
<number>2</number>
</property>
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
<attribute name="headerDefaultSectionSize">
<number>24</number>
</attribute>
<attribute name="headerMinimumSectionSize">
<number>0</number>
</attribute>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
<column>
<property name="text">
<string notr="true">2</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="projectsSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
<item row="0" column="0">
<spacer name="leftSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<spacer name="rightSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0" colspan="3">
<layout class="QGridLayout" name="logosLayout">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<property name="leftMargin">
<number>15</number>
</property>
<property name="rightMargin">
<number>15</number>
</property>
<property name="bottomMargin">
<number>12</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0" rowspan="2">
<widget class="QLabel" name="qtLogoLabel">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="core.qrc">:/core/images/welcomemode/qt_logo.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1" rowspan="2">
<spacer name="logosSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>100</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="3">
<widget class="QLabel" name="nokiaLogoLabel">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="core.qrc">:/core/images/welcomemode/nokia_logo.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Ignored</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="1">
<spacer name="bottomSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>100</width>
<height>12</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="bottomWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>31</height>
</size>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string>#bottomWidget {
background-image: url(:/core/images/welcomemode/feedback-bar-background.png);
}
</string>
</property>
<layout class="QGridLayout" name="bottomLayout">
<property name="leftMargin">
<number>10</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="0" column="0" rowspan="3">
<widget class="QLabel" name="feedbackLabel">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="core.qrc">:/core/images/welcomemode/feedback-text.png</pixmap>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Core::Internal::WelcomeModeButton" name="feedbackButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>102</width>
<height>26</height>
</size>
</property>
<property name="styleSheet">
<string>* {
background-image: url(&quot;:/core/images/welcomemode/btn_feedback.png&quot;);
}
*:hover {
background-image: url(:/core/images/welcomemode/btn_feedback_hover.png)
}
</string>
</property>
</widget>
</item>
<item row="1" column="2">
<spacer name="feedbackSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<spacer name="bottomTopSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1">
<spacer name="bottomBottomSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Core::Internal::WelcomeModeButton</class>
<extends>QLabel</extends>
<header>welcomemode_p.h</header>
</customwidget>
<customwidget>
<class>Core::Internal::WelcomeModeTreeWidget</class>
<extends>QTreeWidget</extends>
<header>welcomemode_p.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="core.qrc"/>
</resources>
<connections/>
</ui>

View File

@@ -0,0 +1,82 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
**************************************************************************/
#ifndef WELCOMEMODE_P_H
#define WELCOMEMODE_P_H
#include <QtGui/QIcon>
#include <QtGui/QLabel>
#include <QtGui/QTreeWidget>
namespace Core {
namespace Internal {
class WelcomeModeButton : public QLabel
{
Q_OBJECT
public:
WelcomeModeButton(QWidget *parent = 0);
signals:
void clicked();
protected:
virtual void mousePressEvent(QMouseEvent *event);
virtual void mouseReleaseEvent(QMouseEvent *event);
private:
bool m_isPressed;
};
class WelcomeModeTreeWidget : public QTreeWidget
{
Q_OBJECT
public:
WelcomeModeTreeWidget(QWidget *parent = 0);
QTreeWidgetItem *addItem(const QString &label, const QString &data);
signals:
void activated(const QString &data);
protected:
virtual QSize sizeHint() const;
private slots:
void slotItemClicked(QTreeWidgetItem *item);
private:
QIcon m_bullet;
};
}
}
#endif // WELCOMEMODE_P_H

View File

@@ -68,6 +68,11 @@
#include <QtGui/QComboBox>
#include <QtHelp/QHelpEngine>
#ifndef QT_NO_WEBKIT
#include <QtGui/QApplication>
#include <QtWebKit/QWebSettings>
#endif
using namespace Help;
using namespace Help::Internal;
@@ -139,6 +144,13 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
qApp->installTranslator(qtr);
}
#ifndef QT_NO_WEBKIT
QWebSettings *webSettings = QWebSettings::globalSettings();
const QFont applicationFont = QApplication::font();
webSettings->setFontFamily(QWebSettings::StandardFont, applicationFont.family());
//webSettings->setFontSize(QWebSettings::DefaultFontSize, applicationFont.pointSize());
#endif
// FIXME shouldn't the help engine create the directory if it doesn't exist?
QFileInfo fi(m_core->settings()->fileName());
QDir directory(fi.absolutePath()+"/qtcreator");
@@ -510,7 +522,7 @@ void HelpPlugin::extensionsInitialized()
m_bookmarkManager->setupBookmarkModels();
if (Core::Internal::WelcomeMode *welcomeMode = qobject_cast<Core::Internal::WelcomeMode*>(m_core->modeManager()->mode(Core::Constants::MODE_WELCOME))) {
connect(welcomeMode, SIGNAL(requestHelp(QString)), this, SLOT(openGettingStarted()));
connect(welcomeMode, SIGNAL(requestHelp()), this, SLOT(openGettingStarted()));
}
}