Skip to content

Commit 8143dcf

Browse files
committed
Basic wizard is done
1 parent d85247e commit 8143dcf

File tree

6 files changed

+103
-43
lines changed

6 files changed

+103
-43
lines changed

src/Interface/Application/ConnectionStyleWizardPage.ui

Lines changed: 51 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,27 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>630</width>
10-
<height>221</height>
9+
<width>648</width>
10+
<height>272</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
1414
<string/>
1515
</property>
1616
<property name="title">
17-
<string>Connection style</string>
17+
<string>Connection drawing style</string>
1818
</property>
1919
<property name="subTitle">
20-
<string>Choose a connection draw style:</string>
20+
<string/>
2121
</property>
2222
<layout class="QGridLayout" name="gridLayout_2">
2323
<item row="0" column="0">
24-
<widget class="QRadioButton" name="manhattanRadioButton_">
24+
<widget class="QLabel" name="label">
2525
<property name="text">
2626
<string>Manhattan</string>
2727
</property>
2828
</widget>
2929
</item>
30-
<item row="0" column="1">
31-
<widget class="QRadioButton" name="euclideanRadioButton_">
32-
<property name="text">
33-
<string>Euclidean</string>
34-
</property>
35-
</widget>
36-
</item>
37-
<item row="0" column="2">
38-
<widget class="QRadioButton" name="cubicRadioButton_">
39-
<property name="text">
40-
<string>Cubic</string>
41-
</property>
42-
</widget>
43-
</item>
4430
<item row="1" column="0">
4531
<widget class="QLabel" name="manhattanLabel_">
4632
<property name="sizePolicy">
@@ -98,6 +84,52 @@
9884
</property>
9985
</widget>
10086
</item>
87+
<item row="0" column="1">
88+
<widget class="QLabel" name="label_2">
89+
<property name="text">
90+
<string>Euclidean</string>
91+
</property>
92+
</widget>
93+
</item>
94+
<item row="0" column="2">
95+
<widget class="QLabel" name="label_3">
96+
<property name="text">
97+
<string>Cubic</string>
98+
</property>
99+
</widget>
100+
</item>
101+
<item row="2" column="1">
102+
<widget class="QComboBox" name="connectionComboBox_">
103+
<property name="currentIndex">
104+
<number>-1</number>
105+
</property>
106+
<item>
107+
<property name="text">
108+
<string>Manhattan</string>
109+
</property>
110+
</item>
111+
<item>
112+
<property name="text">
113+
<string>Euclidean</string>
114+
</property>
115+
</item>
116+
<item>
117+
<property name="text">
118+
<string>Cubic</string>
119+
</property>
120+
</item>
121+
</widget>
122+
</item>
123+
<item row="2" column="0">
124+
<widget class="QLabel" name="label_4">
125+
<property name="text">
126+
<string>Choose style:</string>
127+
</property>
128+
<property name="alignment">
129+
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
130+
</property>
131+
</widget>
132+
</item>
101133
</layout>
102134
</widget>
103135
<resources/>

src/Interface/Application/MainWindowCollaborators.cc

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ NewUserWizard::NewUserWizard(QWidget* parent) : QWizard(parent)
172172
addPage(createPathSettingPage());
173173
addPage(createConnectionChoicePage());
174174
addPage(createLicensePage());
175+
addPage(createDocPage());
175176
}
176177

177178
QWizardPage* NewUserWizard::createIntroPage()
@@ -201,7 +202,7 @@ QWizardPage* NewUserWizard::createPathSettingPage()
201202
page->setTitle("Configuring Paths");
202203
page->setSubTitle("Specify the location of SCIRun's data folder. This path is referenced in network files and modules using the code %SCIRUNDATADIR%.");
203204
auto downloadLabel = new QLabel("The data can be downloaded from <a href=\"http://www.sci.utah.edu/download/scirun/\">sci.utah.edu</a>");
204-
205+
downloadLabel->setOpenExternalLinks(true);
205206
auto layout = new QVBoxLayout;
206207
layout->addWidget(downloadLabel);
207208

@@ -221,42 +222,62 @@ QWizardPage* NewUserWizard::createLicensePage()
221222
auto page = new QWizardPage;
222223
page->setTitle("Applicable Licenses");
223224
QString licenseText(
224-
"<p><a href = \"https://github.com/SCIInstitute/SCIRun/blob/master/src/LICENSE.txt\">SCIRun License</a>"
225-
"<p><a href = \"https://github.com/CIBC-Internal/teem/blob/master/LICENSE.txt\">Teem License</a>"
225+
"<p><a href = \"https://raw.githubusercontent.com/SCIInstitute/SCIRun/master/src/LICENSE.txt\">SCIRun License</a>"
226+
"<p><a href = \"https://raw.githubusercontent.com/CIBC-Internal/teem/master/LICENSE.txt\">Teem License</a>"
226227
#if WITH_TETGEN
227228
"<p><a href = \"http://wias-berlin.de/software/tetgen/1.5/FAQ-license.html\">Tetgen License</a>"
228229
#endif
229230
);
230231
auto layout = new QVBoxLayout;
231232
auto licenseLabel = new QLabel(licenseText);
233+
licenseLabel->setStyleSheet("QLabel { background-color : lightgray; color : blue; }");
234+
licenseLabel->setAlignment(Qt::AlignCenter);
235+
licenseLabel->setOpenExternalLinks(true);
232236
layout->addWidget(licenseLabel);
233237
page->setLayout(layout);
234238
return page;
235239
}
236240

241+
QWizardPage* NewUserWizard::createDocPage()
242+
{
243+
auto page = new QWizardPage;
244+
page->setTitle("Documentation");
245+
page->setSubTitle("For more information on SCIRun 5 functionality, documentation can be found at: ");
246+
auto layout = new QVBoxLayout;
247+
auto docLabel = new QLabel(
248+
"<p><a href = \"https://github.com/SCIInstitute/SCIRun/wiki\">New SCIRun Wiki</a>"
249+
"<p><a href = \"http://scirundocwiki.sci.utah.edu/SCIRunDocs/index.php5/CIBC:Documentation:SCIRun:Reference\">Old SCIRun Wiki</a>"
250+
"<p><a href = \"http://sciinstitute.github.io/scirun.pages/\">SCIRun Doc Home Page</a>"
251+
"<p><a href = \"mailto:[email protected]\">SCIRun Users mailing list</a>"
252+
);
253+
docLabel->setStyleSheet("QLabel { background-color : lightgray; color : blue; }");
254+
docLabel->setAlignment(Qt::AlignCenter);
255+
docLabel->setOpenExternalLinks(true);
256+
layout->addWidget(docLabel);
257+
page->setLayout(layout);
258+
return page;
259+
}
260+
237261
void NewUserWizard::updatePathLabel(const QString& dir)
238262
{
239263
pathWidget_->setText(dir);
240264
}
241265

242-
243266
class ConnectionStyleWizardPage : public QWizardPage, public Ui::ConnectionStyleWizardPage
244267
{
245268
public:
246269
ConnectionStyleWizardPage()
247270
{
248271
setupUi(this);
249272
manhattanLabel_->setPixmap(QPixmap(":/general/Resources/manhattan.png"));
250-
registerField("useManhattan*", manhattanRadioButton_);
251273
euclideanLabel_->setPixmap(QPixmap(":/general/Resources/euclidean.png"));
252-
registerField("useEuclidean*", euclideanRadioButton_);
253274
cubicLabel_->setPixmap(QPixmap(":/general/Resources/cubic.png"));
254-
registerField("useCubic*", cubicRadioButton_);
275+
registerField("connectionChoice*", connectionComboBox_);
276+
connect(connectionComboBox_, SIGNAL(currentIndexChanged(int)), SCIRunMainWindow::Instance(), SLOT(setConnectionPipelineType(int)));
255277
}
256278
};
257279

258280
QWizardPage* NewUserWizard::createConnectionChoicePage()
259281
{
260-
auto page = new ConnectionStyleWizardPage;
261-
return page;
262-
}
282+
return new ConnectionStyleWizardPage;
283+
}

src/Interface/Application/MainWindowCollaborators.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ namespace Gui {
186186
QWizardPage* createPathSettingPage();
187187
QWizardPage* createLicensePage();
188188
QWizardPage* createConnectionChoicePage();
189+
QWizardPage* createDocPage();
189190
QLineEdit* pathWidget_;
190191
};
191192
}

src/Interface/Application/SCIRunMainWindow.cc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,23 @@ void SCIRunMainWindow::makePipesManhattan()
866866
networkEditor_->setConnectionPipelineType(MANHATTAN);
867867
}
868868

869+
void SCIRunMainWindow::setConnectionPipelineType(int type)
870+
{
871+
networkEditor_->setConnectionPipelineType(type);
872+
switch (type)
873+
{
874+
case MANHATTAN:
875+
prefsWindow_->manhattanPipesRadioButton_->setChecked(true);
876+
break;
877+
case CUBIC:
878+
prefsWindow_->cubicPipesRadioButton_->setChecked(true);
879+
break;
880+
case EUCLIDEAN:
881+
prefsWindow_->euclideanPipesRadioButton_->setChecked(true);
882+
break;
883+
}
884+
}
885+
869886
void SCIRunMainWindow::chooseBackgroundColor()
870887
{
871888
auto brush = networkEditor_->background();

src/Interface/Application/SCIRunMainWindow.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public Q_SLOTS:
9898
void executeAll();
9999
void showZoomStatusMessage(int zoomLevel);
100100
void setDataDirectoryFromGUI();
101+
void setConnectionPipelineType(int type);
101102
protected:
102103
virtual void closeEvent(QCloseEvent* event) override;
103104
virtual void keyPressEvent(QKeyEvent *event) override;

src/Interface/Application/Settings.cc

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ namespace
6464
}
6565
return qsl;
6666
}
67-
67+
6868
QMap<QString, QString> toStrMap(const QMap<QString, QVariant>& m)
6969
{
7070
QMap<QString, QString> ss;
@@ -145,20 +145,8 @@ void SCIRunMainWindow::readSettings()
145145
if (settings.contains(pipeTypeKey))
146146
{
147147
int pipeType = settings.value(pipeTypeKey).toInt();
148-
networkEditor_->setConnectionPipelineType(pipeType);
148+
setConnectionPipelineType(pipeType);
149149
GuiLogger::Instance().logInfo("Setting read: connection pipe style = " + QString::number(pipeType));
150-
switch (pipeType)
151-
{
152-
case MANHATTAN:
153-
prefsWindow_->manhattanPipesRadioButton_->setChecked(true);
154-
break;
155-
case CUBIC:
156-
prefsWindow_->cubicPipesRadioButton_->setChecked(true);
157-
break;
158-
case EUCLIDEAN:
159-
prefsWindow_->euclideanPipesRadioButton_->setChecked(true);
160-
break;
161-
}
162150
}
163151

164152
const auto snapTo = qname(prefs.modulesSnapToGrid);

0 commit comments

Comments
 (0)