Commit 73f5f712 authored by hjk's avatar hjk Committed by Tobias Hunger

Improve "Configure Project" target settings hint

Make "Configure Project" help text link to options dialog depend
on the actual architecture instead of listing all possibilities.
Also, make the link work.

Task-number: QTCREATORBUG-7810
Change-Id: I78360cdc5b1a836b46dad5c31bdf7335d83e846e
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent f3e92100
......@@ -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 \
......
......@@ -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",
......
......@@ -49,13 +49,103 @@
#include <QLabel>
#include <QMessageBox>
#include <QVariant>
#include <QAction>
#include <QApplication>
#include <QButtonGroup>
#include <QHeaderView>
#include <QLabel>
#include <QScrollArea>
#include <QVBoxLayout>
#include <QWidget>
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(
"<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;\">"
"Qt Creator &gt; Preferences &gt; Build &amp; Run</span></a>"
" or via the maintenance tool of the SDK.</p></body></html>");
#else
QString hint = TargetSetupPage::tr(
"<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>"
" or via the maintenance tool of the SDK.</p></body></html>");
#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
......@@ -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<Core::Id, Qt4TargetSetupWidget *> m_widgets;
Qt4TargetSetupWidget *m_firstWidget;
Internal::Ui::TargetSetupPage *m_ui;
Internal::TargetSetupPageUi *m_ui;
Internal::ImportWidget *m_importWidget;
QSpacerItem *m_spacer;
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Qt4ProjectManager::Internal::TargetSetupPage</class>
<widget class="QWidget" name="Qt4ProjectManager::Internal::TargetSetupPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>256</width>
<height>297</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Set up Targets for Your Project</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<item>
<widget class="QWidget" name="setupTargetPage" native="true">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="descriptionLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Qt Creator can set up the following targets:</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="noValidProfileLabel">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;No valid targets found.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Please add a target in &lt;a href=&quot;buildandrun&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run&lt;/span&gt;&lt;/a&gt; (&lt;a href=&quot;buildandrun&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Qt Creator &amp;gt; Preferences &amp;gt; Build &amp;amp; Run&lt;/span&gt;&lt;/a&gt; on Mac OS) or via the maintenance tool of the SDK.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="centralWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="scrollAreaWidget" native="true">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>230</width>
<height>81</height>
</rect>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment