Skip to content

Commit 393cd81

Browse files
committed
Widget hooked up
1 parent 89f2f96 commit 393cd81

File tree

2 files changed

+38
-25
lines changed

2 files changed

+38
-25
lines changed

src/Interface/Application/MainWindowCollaborators.cc

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -161,43 +161,47 @@ void WidgetDisablingService::temporarilyEnableService()
161161

162162
NewUserWizard::NewUserWizard(QWidget* parent) : QWizard(parent)
163163
{
164+
setWindowTitle("SCIRun Tutorial");
165+
//setPixmap(WatermarkPixmap, QPixmap(":/general/Resources/scirun_5_0_alpha.png"));
166+
//setPixmap(BackgroundPixmap, QPixmap(":/general/Resources/scirun_5_0_alpha.png"));
167+
164168
addPage(createIntroPage());
165169
addPage(createPathSettingPage());
166-
167-
setWindowTitle("SCIRun Tutorial Wizard");
170+
addPage(createLicensePage());
168171
}
169172

170173
QWizardPage* NewUserWizard::createIntroPage()
171174
{
172175
auto page = new QWizardPage;
173176
page->setTitle("Introduction");
174177

175-
auto label = new QLabel("This wizard will help you set up SCIRun for the first time and learn the basic SCIRun operations and hotkeys. All of these settings are available at any time in the Preferences window.");
176-
label->setWordWrap(true);
177-
178-
auto layout = new QVBoxLayout;
179-
layout->addWidget(label);
180-
page->setLayout(layout);
178+
page->setSubTitle("This wizard will help you set up SCIRun for the first time and learn the basic SCIRun operations and hotkeys. All of these settings are available at any time in the Preferences window.");
181179

182180
return page;
183181
}
184182

185-
QWizardPage* NewUserWizard::createPathSettingPage()
183+
class PathSettingPage : public QWizardPage
186184
{
187-
auto page = new QWizardPage;
188-
page->setTitle("Configuring Paths");
189-
190-
auto label = new QLabel("Specify the location of SCIRun's data folder. This path is referenced in network files and modules using the code %SCIRUNDATADIR%.");
191-
label->setWordWrap(true);
185+
public:
186+
explicit PathSettingPage(QLineEdit* pathWidget)
187+
{
188+
registerField("dataPath*", pathWidget);
189+
}
190+
};
192191

193-
pathLabel_ = new QLabel("Data path:");
194192

195-
//page->registerField("className*", classNameLineEdit);
196193

194+
QWizardPage* NewUserWizard::createPathSettingPage()
195+
{
196+
pathWidget_ = new QLineEdit("");
197+
pathWidget_->setReadOnly(true);
198+
auto page = new PathSettingPage(pathWidget_);
199+
page->setTitle("Configuring Paths");
200+
page->setSubTitle("Specify the location of SCIRun's data folder. This path is referenced in network files and modules using the code %SCIRUNDATADIR%.");
201+
197202
auto layout = new QVBoxLayout;
198-
layout->addWidget(label);
199203

200-
layout->addWidget(pathLabel_);
204+
layout->addWidget(pathWidget_);
201205
auto button = new QPushButton("Set Path...");
202206
layout->addWidget(button);
203207
connect(button, SIGNAL(clicked()), SCIRunMainWindow::Instance(), SLOT(setDataDirectoryFromGUI()));
@@ -208,12 +212,22 @@ QWizardPage* NewUserWizard::createPathSettingPage()
208212
return page;
209213
}
210214

211-
QWizardPage* NewUserWizard::createConclusionPage()
215+
QWizardPage* NewUserWizard::createLicensePage()
212216
{
213-
return nullptr;
217+
auto page = new QWizardPage;
218+
page->setTitle("Applicable Licenses");
219+
QString licenseText(
220+
"<p><a href = \"https://github.com/SCIInstitute/SCIRun/blob/master/src/LICENSE.txt\">SCIRun License"
221+
"<p><a href = \"https://github.com/CIBC-Internal/teem/blob/master/LICENSE.txt\">Teem License</a>"
222+
);
223+
auto layout = new QVBoxLayout;
224+
auto licenseLabel = new QLabel(licenseText);
225+
layout->addWidget(licenseLabel);
226+
page->setLayout(layout);
227+
return page;
214228
}
215229

216230
void NewUserWizard::updatePathLabel(const QString& dir)
217231
{
218-
pathLabel_->setText("Data path: " + dir);
232+
pathWidget_->setText(dir);
219233
}

src/Interface/Application/MainWindowCollaborators.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#include <QNetworkRequest>
4141
#include <QNetworkReply>
4242
#include <QDir>
43-
#include <QLabel>
43+
#include <QLineEdit>
4444
#include <QMutex>
4545
#include <QWizard>
4646

@@ -179,14 +179,13 @@ namespace Gui {
179179
Q_OBJECT
180180
public:
181181
explicit NewUserWizard(QWidget* parent);
182-
183182
private Q_SLOTS:
184183
void updatePathLabel(const QString& dir);
185184
private:
186-
QLabel* pathLabel_;
187185
QWizardPage* createIntroPage();
188186
QWizardPage* createPathSettingPage();
189-
QWizardPage *createConclusionPage();
187+
QWizardPage* createLicensePage();
188+
QLineEdit* pathWidget_;
190189
};
191190
}
192191
}

0 commit comments

Comments
 (0)