diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.pro b/src/plugins/qt4projectmanager/qt4projectmanager.pro index f50840f50fab42e09c4e1dc9267b42057f57df4a..f0406b0ad63b076c1675acf05f47b946ee73377f 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.pro +++ b/src/plugins/qt4projectmanager/qt4projectmanager.pro @@ -139,7 +139,6 @@ FORMS += makestep.ui \ qt4projectconfigwidget.ui \ librarydetailswidget.ui \ wizards/testwizardpage.ui \ - wizards/targetsetuppage.ui \ wizards/html5appwizardsourcespage.ui \ wizards/mobilelibrarywizardoptionpage.ui \ wizards/mobileappwizardgenericoptionspage.ui \ diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.qbs b/src/plugins/qt4projectmanager/qt4projectmanager.qbs index 0d83c6f9515bc42bd9f74f5bad519e24e7266c77..16843041484e4e644e2ea297596ea7b9be7af8a8 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.qbs +++ b/src/plugins/qt4projectmanager/qt4projectmanager.qbs @@ -137,7 +137,6 @@ QtcPlugin { "qt-desktop/simulatorqtversion.h", "qt-desktop/simulatorqtversionfactory.cpp", "qt-desktop/simulatorqtversionfactory.h", - "wizards/targetsetuppage.ui", "wizards/testwizardpage.ui", "wizards/wizards.qrc", "wizards/abstractmobileapp.cpp", diff --git a/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp b/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp index ff26061205e9b78eeff576d3c82e4a1548750f98..fdb185466d4d92112d35b518e5997961781917c8 100644 --- a/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp +++ b/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp @@ -49,13 +49,103 @@ #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include -using namespace Qt4ProjectManager; +namespace Qt4ProjectManager { +namespace Internal { static const Core::Id QT_IS_TEMPORARY("Qt4PM.TempQt"); static const Core::Id PROFILE_IS_TEMPORARY("Qt4PM.TempProfile"); static const Core::Id TEMPORARY_OF_PROJECTS("Qt4PM.TempProject"); +class TargetSetupPageUi +{ +public: + QWidget *centralWidget; + QWidget *scrollAreaWidget; + QScrollArea *scrollArea; + QLabel *descriptionLabel; + + void setupUi(QWidget *q) + { + QWidget *setupTargetPage = new QWidget(q); + + descriptionLabel = new QLabel(setupTargetPage); + descriptionLabel->setWordWrap(true); + descriptionLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); + descriptionLabel->setText(TargetSetupPage::tr("Qt Creator can set up the following targets:")); + +#ifdef Q_OS_MAC + QString hint = TargetSetupPage::tr( + "

" + "No valid targets found.

" + "

Please add a target in " + "Qt Creator > Preferences > Build & Run" + " or via the maintenance tool of the SDK.

"); +#else + QString hint = TargetSetupPage::tr( + "

" + "No valid targets found.

" + "

Please add a target in " + "Tools > Options > Build & Run" + " or via the maintenance tool of the SDK.

"); +#endif + + QLabel *noValidProfileLabel = new QLabel(setupTargetPage); + noValidProfileLabel->setWordWrap(true); + noValidProfileLabel->setText(hint); + noValidProfileLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); + + centralWidget = new QWidget(setupTargetPage); + QSizePolicy policy(QSizePolicy::Preferred, QSizePolicy::Fixed); + policy.setHorizontalStretch(0); + policy.setVerticalStretch(0); + policy.setHeightForWidth(centralWidget->sizePolicy().hasHeightForWidth()); + centralWidget->setSizePolicy(policy); + + scrollAreaWidget = new QWidget(setupTargetPage); + scrollArea = new QScrollArea(scrollAreaWidget); + scrollArea->setWidgetResizable(true); + + QWidget *scrollAreaWidgetContents; + scrollAreaWidgetContents = new QWidget(); + scrollAreaWidgetContents->setGeometry(QRect(0, 0, 230, 81)); + scrollArea->setWidget(scrollAreaWidgetContents); + + QVBoxLayout *verticalLayout = new QVBoxLayout(scrollAreaWidget); + verticalLayout->setSpacing(0); + verticalLayout->setContentsMargins(0, 0, 0, 0); + verticalLayout->addWidget(scrollArea); + + QVBoxLayout *verticalLayout_2 = new QVBoxLayout(setupTargetPage); + verticalLayout_2->addWidget(descriptionLabel); + verticalLayout_2->addWidget(noValidProfileLabel); + verticalLayout_2->addWidget(centralWidget); + verticalLayout_2->addWidget(scrollAreaWidget); + + QVBoxLayout *verticalLayout_3 = new QVBoxLayout(q); + verticalLayout_3->setContentsMargins(0, 0, 0, -1); + verticalLayout_3->addWidget(setupTargetPage); + + QObject::connect(noValidProfileLabel, SIGNAL(linkActivated(QString)), + q, SIGNAL(noteTextLinkActivated())); + QObject::connect(descriptionLabel, SIGNAL(linkActivated(QString)), + q, SIGNAL(noteTextLinkActivated())); + } +}; + +} // namespace Internal + +using namespace Internal; + TargetSetupPage::TargetSetupPage(QWidget *parent) : QWizardPage(parent), m_requiredMatcher(0), @@ -64,13 +154,20 @@ TargetSetupPage::TargetSetupPage(QWidget *parent) : m_importSearch(false), m_ignoreUpdates(false), m_firstWidget(0), - m_ui(new Internal::Ui::TargetSetupPage), + m_ui(new TargetSetupPageUi), m_importWidget(new Internal::ImportWidget(this)), m_spacer(new QSpacerItem(0,0, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding)) { setObjectName(QLatin1String("TargetSetupPage")); + setWindowTitle(tr("Set up Targets for Your Project")); m_ui->setupUi(this); + QSizePolicy policy(QSizePolicy::Preferred, QSizePolicy::Preferred); + policy.setHorizontalStretch(0); + policy.setVerticalStretch(0); + policy.setHeightForWidth(sizePolicy().hasHeightForWidth()); + setSizePolicy(policy); + QWidget *centralWidget = new QWidget(this); m_ui->scrollArea->setWidget(centralWidget); centralWidget->setLayout(new QVBoxLayout); @@ -82,9 +179,6 @@ TargetSetupPage::TargetSetupPage(QWidget *parent) : setTitle(tr("Target Setup")); - connect(m_ui->descriptionLabel, SIGNAL(linkActivated(QString)), - this, SIGNAL(noteTextLinkActivated())); - ProjectExplorer::ProfileManager *sm = ProjectExplorer::ProfileManager::instance(); connect(sm, SIGNAL(profileAdded(ProjectExplorer::Profile*)), this, SLOT(handleProfileAddition(ProjectExplorer::Profile*))); @@ -589,3 +683,5 @@ void TargetSetupPage::setUseScrollArea(bool b) m_ui->scrollAreaWidget->setVisible(b); m_ui->centralWidget->setVisible(!b); } + +} // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/wizards/targetsetuppage.h b/src/plugins/qt4projectmanager/wizards/targetsetuppage.h index 08c18b13188ff18e40ba3eeea7632527d43db2a8..a8b719e97115fb23917846230660b9df0217716e 100644 --- a/src/plugins/qt4projectmanager/wizards/targetsetuppage.h +++ b/src/plugins/qt4projectmanager/wizards/targetsetuppage.h @@ -46,10 +46,7 @@ class Qt4Project; namespace Internal { class ImportWidget; - -namespace Ui { -class TargetSetupPage; -} // namespace Ui +class TargetSetupPageUi; } // namespace Internal /// \internal @@ -122,7 +119,7 @@ private: QMap m_widgets; Qt4TargetSetupWidget *m_firstWidget; - Internal::Ui::TargetSetupPage *m_ui; + Internal::TargetSetupPageUi *m_ui; Internal::ImportWidget *m_importWidget; QSpacerItem *m_spacer; diff --git a/src/plugins/qt4projectmanager/wizards/targetsetuppage.ui b/src/plugins/qt4projectmanager/wizards/targetsetuppage.ui deleted file mode 100644 index fa36001aee2fd3fb8b6cd53a1da28f4624a9d997..0000000000000000000000000000000000000000 --- a/src/plugins/qt4projectmanager/wizards/targetsetuppage.ui +++ /dev/null @@ -1,110 +0,0 @@ - - - Qt4ProjectManager::Internal::TargetSetupPage - - - - 0 - 0 - 256 - 297 - - - - - 0 - 0 - - - - Set up Targets for Your Project - - - - 0 - - - 0 - - - 0 - - - - - - - - - 0 - 0 - - - - Qt Creator can set up the following targets: - - - true - - - Qt::LinksAccessibleByMouse - - - - - - - <html><head/><body><p><span style=" font-weight:600;">No valid targets found.</span></p><p>Please add a target in <a href="buildandrun"><span style=" text-decoration: underline; color:#0000ff;">Tools &gt; Options &gt; Build &amp; Run</span></a> (<a href="buildandrun"><span style=" text-decoration: underline; color:#0000ff;">Qt Creator &gt; Preferences &gt; Build &amp; Run</span></a> on Mac OS) or via the maintenance tool of the SDK.</p></body></html> - - - true - - - - - - - - 0 - 0 - - - - - - - - - 0 - - - 0 - - - - - true - - - - - 0 - 0 - 230 - 81 - - - - - - - - - - - - - - - -