diff --git a/src/plugins/coreplugin/core.qrc b/src/plugins/coreplugin/core.qrc index bd8f3ad11f4..7ffa12b5710 100644 --- a/src/plugins/coreplugin/core.qrc +++ b/src/plugins/coreplugin/core.qrc @@ -1,34 +1,5 @@ - html/images/bg_site_header_dark_grey.png - html/images/body_bg_circles_bottom_right.png - html/images/body_bg_gradient.png - html/images/btn_feedback.png - html/images/btn_feedback_hover.png - html/images/btn_getting_started.png - html/images/btn_getting_started_hover.png - html/images/btn_restore_session.png - html/images/btn_restore_session_hover.png - html/images/feedback-bar-background.png - html/images/feedback-text.png - html/images/list_bullet_arrow.png - html/images/mode_Project.png - html/images/nokia_logo.png - html/images/product_logo.png - html/images/qt_logo.png - html/images/rc_bottom_left.png - html/images/rc_bottom_mid.png - html/images/rc_bottom_right.png - html/images/rc_mid_left.png - html/images/rc_mid_mid.png - html/images/rc_mid_right.png - html/images/rc_top_left.png - html/images/rc_top_mid.png - html/images/rc_top_right.png - html/qt.css - html/recent_projects.html - html/recent_sessions.html - html/welcome.html images/clean_pane_small.png images/clear.png images/closebutton.png @@ -73,5 +44,19 @@ images/unlocked.png images/extension.png images/darkclosebutton.png + images/welcomemode/btn_feedback.png + images/welcomemode/btn_feedback_hover.png + images/welcomemode/btn_getting_started.png + images/welcomemode/btn_getting_started_hover.png + images/welcomemode/btn_restore_session.png + images/welcomemode/btn_restore_session_hover.png + images/welcomemode/feedback-bar-background.png + images/welcomemode/feedback-text.png + images/welcomemode/list_bullet_arrow.png + images/welcomemode/mode_project.png + images/welcomemode/nokia_logo.png + images/welcomemode/product_logo.png + images/welcomemode/qt_logo.png + images/welcomemode/rc_combined.png diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index e99f5b796b8..512ceb01b78 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -38,10 +38,6 @@ #include #include -#if !defined(QT_NO_WEBKIT) -#include -#include -#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); diff --git a/src/plugins/coreplugin/coreplugin.pro b/src/plugins/coreplugin/coreplugin.pro index c3606c1f1bd..57fac677d04 100644 --- a/src/plugins/coreplugin/coreplugin.pro +++ b/src/plugins/coreplugin/coreplugin.pro @@ -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 diff --git a/src/plugins/coreplugin/html/images/bg_site_header_dark_grey.png b/src/plugins/coreplugin/html/images/bg_site_header_dark_grey.png deleted file mode 100644 index 044c695a4dc..00000000000 Binary files a/src/plugins/coreplugin/html/images/bg_site_header_dark_grey.png and /dev/null differ diff --git a/src/plugins/coreplugin/html/images/body_bg_circles_bottom_right.png b/src/plugins/coreplugin/html/images/body_bg_circles_bottom_right.png deleted file mode 100644 index 543e35071ff..00000000000 Binary files a/src/plugins/coreplugin/html/images/body_bg_circles_bottom_right.png and /dev/null differ diff --git a/src/plugins/coreplugin/html/images/body_bg_gradient.png b/src/plugins/coreplugin/html/images/body_bg_gradient.png deleted file mode 100644 index ebaa078c3e2..00000000000 Binary files a/src/plugins/coreplugin/html/images/body_bg_gradient.png and /dev/null differ diff --git a/src/plugins/coreplugin/html/images/product_logo_mirror.png b/src/plugins/coreplugin/html/images/product_logo_mirror.png deleted file mode 100644 index d7aa9d1992f..00000000000 Binary files a/src/plugins/coreplugin/html/images/product_logo_mirror.png and /dev/null differ diff --git a/src/plugins/coreplugin/html/images/rc_bottom_left.png b/src/plugins/coreplugin/html/images/rc_bottom_left.png deleted file mode 100644 index 106f92f4627..00000000000 Binary files a/src/plugins/coreplugin/html/images/rc_bottom_left.png and /dev/null differ diff --git a/src/plugins/coreplugin/html/images/rc_bottom_mid.png b/src/plugins/coreplugin/html/images/rc_bottom_mid.png deleted file mode 100644 index 7c01362073c..00000000000 Binary files a/src/plugins/coreplugin/html/images/rc_bottom_mid.png and /dev/null differ diff --git a/src/plugins/coreplugin/html/images/rc_bottom_right.png b/src/plugins/coreplugin/html/images/rc_bottom_right.png deleted file mode 100644 index eed56c4f5c0..00000000000 Binary files a/src/plugins/coreplugin/html/images/rc_bottom_right.png and /dev/null differ diff --git a/src/plugins/coreplugin/html/images/rc_mid_left.png b/src/plugins/coreplugin/html/images/rc_mid_left.png deleted file mode 100644 index d6dd8de8cf2..00000000000 Binary files a/src/plugins/coreplugin/html/images/rc_mid_left.png and /dev/null differ diff --git a/src/plugins/coreplugin/html/images/rc_mid_mid.png b/src/plugins/coreplugin/html/images/rc_mid_mid.png deleted file mode 100644 index 26040bdd975..00000000000 Binary files a/src/plugins/coreplugin/html/images/rc_mid_mid.png and /dev/null differ diff --git a/src/plugins/coreplugin/html/images/rc_mid_right.png b/src/plugins/coreplugin/html/images/rc_mid_right.png deleted file mode 100644 index 2714b81f17f..00000000000 Binary files a/src/plugins/coreplugin/html/images/rc_mid_right.png and /dev/null differ diff --git a/src/plugins/coreplugin/html/images/rc_top_left.png b/src/plugins/coreplugin/html/images/rc_top_left.png deleted file mode 100644 index ffed637a15f..00000000000 Binary files a/src/plugins/coreplugin/html/images/rc_top_left.png and /dev/null differ diff --git a/src/plugins/coreplugin/html/images/rc_top_mid.png b/src/plugins/coreplugin/html/images/rc_top_mid.png deleted file mode 100644 index 10f5abd31c1..00000000000 Binary files a/src/plugins/coreplugin/html/images/rc_top_mid.png and /dev/null differ diff --git a/src/plugins/coreplugin/html/images/rc_top_right.png b/src/plugins/coreplugin/html/images/rc_top_right.png deleted file mode 100644 index 830bb46c5d0..00000000000 Binary files a/src/plugins/coreplugin/html/images/rc_top_right.png and /dev/null differ diff --git a/src/plugins/coreplugin/html/qt.css b/src/plugins/coreplugin/html/qt.css deleted file mode 100644 index 9e4fb05b8cd..00000000000 --- a/src/plugins/coreplugin/html/qt.css +++ /dev/null @@ -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) - - }; - - diff --git a/src/plugins/coreplugin/html/recent_projects.html b/src/plugins/coreplugin/html/recent_projects.html deleted file mode 100644 index db1bab8bcff..00000000000 --- a/src/plugins/coreplugin/html/recent_projects.html +++ /dev/null @@ -1,41 +0,0 @@ -
-
- -
-
-
-
-
- - -
- -
- -
- -
-
-

Recent Projects

-
    - - -
-
- -
- -
- - -
-
-
-
-
-
-
diff --git a/src/plugins/coreplugin/html/recent_sessions.html b/src/plugins/coreplugin/html/recent_sessions.html deleted file mode 100644 index d2f6f2a5967..00000000000 --- a/src/plugins/coreplugin/html/recent_sessions.html +++ /dev/null @@ -1,43 +0,0 @@ -
-
- -
-
-
-
-
- - -
- -
- -
- -
-
-

Recent Sessions

-
    - - -
- -   -
-
- -
- -
- - -
-
-
-
-
-
-
diff --git a/src/plugins/coreplugin/html/welcome.html b/src/plugins/coreplugin/html/welcome.html deleted file mode 100644 index 0e5be285775..00000000000 --- a/src/plugins/coreplugin/html/welcome.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - Nokia, Qt Software - - - - - - - - -
- - - - - -
- -
- -
-

Welcome

-

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 Getting Started to - begin developing with Qt Creator.

-
- -   -
- -
-
-
- - -
- - - - - - -
- -
- - -
- - - -
- - - diff --git a/src/plugins/coreplugin/html/images/btn_feedback.png b/src/plugins/coreplugin/images/welcomemode/btn_feedback.png similarity index 100% rename from src/plugins/coreplugin/html/images/btn_feedback.png rename to src/plugins/coreplugin/images/welcomemode/btn_feedback.png diff --git a/src/plugins/coreplugin/html/images/btn_feedback_hover.png b/src/plugins/coreplugin/images/welcomemode/btn_feedback_hover.png similarity index 100% rename from src/plugins/coreplugin/html/images/btn_feedback_hover.png rename to src/plugins/coreplugin/images/welcomemode/btn_feedback_hover.png diff --git a/src/plugins/coreplugin/html/images/btn_getting_started.png b/src/plugins/coreplugin/images/welcomemode/btn_getting_started.png similarity index 100% rename from src/plugins/coreplugin/html/images/btn_getting_started.png rename to src/plugins/coreplugin/images/welcomemode/btn_getting_started.png diff --git a/src/plugins/coreplugin/html/images/btn_getting_started_hover.png b/src/plugins/coreplugin/images/welcomemode/btn_getting_started_hover.png similarity index 100% rename from src/plugins/coreplugin/html/images/btn_getting_started_hover.png rename to src/plugins/coreplugin/images/welcomemode/btn_getting_started_hover.png diff --git a/src/plugins/coreplugin/html/images/btn_restore_session.png b/src/plugins/coreplugin/images/welcomemode/btn_restore_session.png similarity index 100% rename from src/plugins/coreplugin/html/images/btn_restore_session.png rename to src/plugins/coreplugin/images/welcomemode/btn_restore_session.png diff --git a/src/plugins/coreplugin/html/images/btn_restore_session_hover.png b/src/plugins/coreplugin/images/welcomemode/btn_restore_session_hover.png similarity index 100% rename from src/plugins/coreplugin/html/images/btn_restore_session_hover.png rename to src/plugins/coreplugin/images/welcomemode/btn_restore_session_hover.png diff --git a/src/plugins/coreplugin/html/images/feedback-bar-background.png b/src/plugins/coreplugin/images/welcomemode/feedback-bar-background.png similarity index 100% rename from src/plugins/coreplugin/html/images/feedback-bar-background.png rename to src/plugins/coreplugin/images/welcomemode/feedback-bar-background.png diff --git a/src/plugins/coreplugin/html/images/feedback-text.png b/src/plugins/coreplugin/images/welcomemode/feedback-text.png similarity index 100% rename from src/plugins/coreplugin/html/images/feedback-text.png rename to src/plugins/coreplugin/images/welcomemode/feedback-text.png diff --git a/src/plugins/coreplugin/html/images/list_bullet_arrow.png b/src/plugins/coreplugin/images/welcomemode/list_bullet_arrow.png similarity index 100% rename from src/plugins/coreplugin/html/images/list_bullet_arrow.png rename to src/plugins/coreplugin/images/welcomemode/list_bullet_arrow.png diff --git a/src/plugins/coreplugin/html/images/mode_Project.png b/src/plugins/coreplugin/images/welcomemode/mode_project.png similarity index 100% rename from src/plugins/coreplugin/html/images/mode_Project.png rename to src/plugins/coreplugin/images/welcomemode/mode_project.png diff --git a/src/plugins/coreplugin/html/images/nokia_logo.png b/src/plugins/coreplugin/images/welcomemode/nokia_logo.png similarity index 100% rename from src/plugins/coreplugin/html/images/nokia_logo.png rename to src/plugins/coreplugin/images/welcomemode/nokia_logo.png diff --git a/src/plugins/coreplugin/html/images/product_logo.png b/src/plugins/coreplugin/images/welcomemode/product_logo.png similarity index 100% rename from src/plugins/coreplugin/html/images/product_logo.png rename to src/plugins/coreplugin/images/welcomemode/product_logo.png diff --git a/src/plugins/coreplugin/html/images/qt_logo.png b/src/plugins/coreplugin/images/welcomemode/qt_logo.png similarity index 100% rename from src/plugins/coreplugin/html/images/qt_logo.png rename to src/plugins/coreplugin/images/welcomemode/qt_logo.png diff --git a/src/plugins/coreplugin/images/welcomemode/rc_combined.png b/src/plugins/coreplugin/images/welcomemode/rc_combined.png new file mode 100644 index 00000000000..c395794ca3f Binary files /dev/null and b/src/plugins/coreplugin/images/welcomemode/rc_combined.png differ diff --git a/src/plugins/coreplugin/welcomemode.cpp b/src/plugins/coreplugin/welcomemode.cpp index 6c56736f0a4..adf3e933f3d 100644 --- a/src/plugins/coreplugin/welcomemode.cpp +++ b/src/plugins/coreplugin/welcomemode.cpp @@ -32,83 +32,35 @@ #include "uniqueidmanager.h" #include "modemanager.h" -#if !defined(QT_NO_WEBKIT) -#include -#include -#include -#else -#include -#endif #include #include +#include #include -#include -#include +#include #include #include +#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", - "
" - "



Welcome

Qt Creator is an intuitive, modern cross platform IDE that enables " - "developers to create graphically appealing applications for desktop, " - "embedded, and mobile devices. " - "

(This startup page lacks features due to disabled WebKit support)" - "

"); - -#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,78 +152,138 @@ QList 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("
  • %2%3

  • ").arg(s, s, last); + str = tr("%1 (last session)").arg(s); + m_d->ui.sessTreeWidget->addItem(str, s); } - sessionHtml.replace(QLatin1String(""), sessions); + m_d->ui.sessTreeWidget->updateGeometry(); + m_d->ui.sessTreeWidget->show(); + } else { + m_d->ui.sessTreeWidget->hide(); } - html.replace(QLatin1String(""), sessionHtml); - QString projectHtml = m_d->m_projectHtmlTemplate; - { - QString projects; - QTextStream str(&projects); - - QList >::const_iterator it, end; - end = welcomePageData.projectList.constEnd(); - for( it = welcomePageData.projectList.constBegin(); it != end; ++it) { - const QFileInfo fi((*it).first); - str << "
  • " << (*it).second << "

  • \n"; - } - projectHtml.replace(QLatin1String(""), projects); + typedef QPair 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())); } - html.replace(QLatin1String(""), projectHtml); + 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_webview->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); - m_d->m_webview->setHtml(html, m_d->m_baseUrl); -#endif + 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); - } - } else { - QDesktopServices::openUrl(url); + 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(); } } +// --- 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 } // namespace Core diff --git a/src/plugins/coreplugin/welcomemode.h b/src/plugins/coreplugin/welcomemode.h index 5b4228b8b8b..52e009acca5 100644 --- a/src/plugins/coreplugin/welcomemode.h +++ b/src/plugins/coreplugin/welcomemode.h @@ -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; }; diff --git a/src/plugins/coreplugin/welcomemode.ui b/src/plugins/coreplugin/welcomemode.ui new file mode 100644 index 00000000000..41686e7fb85 --- /dev/null +++ b/src/plugins/coreplugin/welcomemode.ui @@ -0,0 +1,821 @@ + + + welcomePage + + + + 0 + 0 + 777 + 922 + + + + + 0 + + + 0 + + + + + #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; +} + + + + + 0 + + + 0 + + + + + 0 + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 50 + + + + + + + + 0 + + + + + + 0 + 0 + + + + + + + :/core/images/welcomemode/product_logo.png + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + + 360 + 0 + + + + <style> +h1 { + font-size: 2em; + font-weight: normal; + color: #4d4d4d; + margin-top: 0px; + margin-bottom: 20px; +} + +p { + margin-top: 0px; + margin-bottom: 7px; +} +</style> + +<p>&nbsp;</p> +<h1>Welcome</h1> +<!-- QTextDocument does not support line-height, so wrap the lines manually ... --> +<p>Qt Creator is an intuitive, modern cross platform IDE that</p> <p>enables developers to create graphically appealing applications</p> +<p>for desktop, embedded, and mobile devices. Click on <strong>Getting</strong></p> +<p><strong>Started</strong> to begin developing with Qt Creator.</p> +<hr style="margin-top:15px"/> + + + + true + + + + + + + + + + + Qt::Horizontal + + + + 1 + 1 + + + + + + + + + 133 + 29 + + + + * { + background-image: url(":/core/images/welcomemode/btn_getting_started.png"); +} + +*:hover { + background-image: url(:/core/images/welcomemode/btn_getting_started_hover.png) +} + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 1 + 50 + + + + + + + + 0 + + + + + + + + 0 + 0 + + + + + 270 + 130 + + + + + 270 + 16777215 + + + + #recentSessionsFrame { +border-image: url(:/core/images/welcomemode/rc_combined.png) 8 8 8 8 stretch stretch; +border-width: 8 8 8 8; +} + + + + + 4 + + + 4 + + + 12 + + + 2 + + + 11 + + + + + :/core/images/welcomemode/mode_project.png + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + <style> +h2 { + font-size: 18px; + font-weight: normal; + color: #7c92a1; + margin-bottom: 0px; +} +</style> + +<h2>Recent Sessions</h2> +<hr/> + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + Qt::Horizontal + + + + 1 + 1 + + + + + + + + + 0 + 0 + + + + + 137 + 27 + + + + * { + background-image: url(":/core/images/welcomemode/btn_restore_session.png"); +} + +*:hover { + background-image: url(:/core/images/welcomemode/btn_restore_session_hover.png) +} + + + + + + + + + 0 + 0 + + + + Qt::NoFocus + + + QFrame::NoFrame + + + QAbstractItemView::NoSelection + + + QAbstractItemView::ScrollPerPixel + + + false + + + true + + + true + + + 2 + + + false + + + 24 + + + 0 + + + + 1 + + + + + 2 + + + + + + + + Qt::Vertical + + + + 5 + 1 + + + + + + + + + + + Qt::Vertical + + + + 100 + 0 + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 20 + 10 + + + + + + + + + + + 0 + 0 + + + + + 270 + 16777215 + + + + + 4 + + + 4 + + + 12 + + + 2 + + + 11 + + + -1 + + + + + :/core/images/welcomemode/mode_project.png + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + <style> +h2 { + font-size: 18px; + font-weight: normal; + color: #7c92a1; + margin-bottom: 0px; +} +</style> + +<h2>Recent Projects</h2> +<hr/> + + + + 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 + + + + 100 + 0 + + + + + + + + + + + + + + Qt::Horizontal + + + + 1 + 10 + + + + + + + + Qt::Horizontal + + + + 1 + 10 + + + + + + + + QLayout::SetDefaultConstraint + + + 15 + + + 15 + + + 12 + + + 0 + + + + + + + + :/core/images/welcomemode/qt_logo.png + + + + + + + Qt::Horizontal + + + + 100 + 1 + + + + + + + + + + + :/core/images/welcomemode/nokia_logo.png + + + + + + + Qt::Vertical + + + QSizePolicy::Ignored + + + + 1 + 1 + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 100 + 12 + + + + + + + + + + + + 0 + 0 + + + + + 0 + 31 + + + + false + + + #bottomWidget { +background-image: url(:/core/images/welcomemode/feedback-bar-background.png); +} + + + + + 10 + + + 0 + + + 0 + + + 0 + + + 6 + + + 0 + + + + + + + + :/core/images/welcomemode/feedback-text.png + + + + + + + + 0 + 0 + + + + + 102 + 26 + + + + * { + background-image: url(":/core/images/welcomemode/btn_feedback.png"); +} + +*:hover { + background-image: url(:/core/images/welcomemode/btn_feedback_hover.png) +} + + + + + + + + Qt::Horizontal + + + + 1 + 1 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 1 + 1 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 1 + 0 + + + + + + + + + + + + Core::Internal::WelcomeModeButton + QLabel +
    welcomemode_p.h
    +
    + + Core::Internal::WelcomeModeTreeWidget + QTreeWidget +
    welcomemode_p.h
    +
    +
    + + + + +
    diff --git a/src/plugins/coreplugin/welcomemode_p.h b/src/plugins/coreplugin/welcomemode_p.h new file mode 100644 index 00000000000..ad8bcecab71 --- /dev/null +++ b/src/plugins/coreplugin/welcomemode_p.h @@ -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 +#include +#include + +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 diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 093eacdf442..9250e2ebd0a 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -68,6 +68,11 @@ #include #include +#ifndef QT_NO_WEBKIT +#include +#include +#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(m_core->modeManager()->mode(Core::Constants::MODE_WELCOME))) { - connect(welcomeMode, SIGNAL(requestHelp(QString)), this, SLOT(openGettingStarted())); + connect(welcomeMode, SIGNAL(requestHelp()), this, SLOT(openGettingStarted())); } }