@@ -96,8 +96,8 @@ SCIRunMainWindow::SCIRunMainWindow() : firstTimePythonShown_(true)
9696
9797 gridLayout_5->addWidget (networkEditor_, 0 , 0 , 1 , 1 );
9898
99- QWidgetAction* moduleSearchAction = new QWidgetAction (this );
100- moduleSearchAction->setDefaultWidget (new QLineEdit (this ));
99+ QWidgetAction* moduleSearchAction = new QWidgetAction (this );
100+ moduleSearchAction->setDefaultWidget (new QLineEdit (this ));
101101
102102#if 0
103103 {
@@ -130,9 +130,9 @@ SCIRunMainWindow::SCIRunMainWindow() : firstTimePythonShown_(true)
130130 // setUnifiedTitleAndToolBarOnMac(true);
131131
132132 QToolBar* executeBar = addToolBar (tr (" &Execute" ));
133- executeBar->addAction (actionExecute_All_);
133+ executeBar->addAction (actionExecute_All_);
134134
135- networkProgressBar_.reset (new NetworkExecutionProgressBar (this ));
135+ networkProgressBar_.reset (new NetworkExecutionProgressBar (this ));
136136 executeBar->addActions (networkProgressBar_->actions ());
137137 executeBar->setStyleSheet (styleSheet ());
138138 executeBar->setAutoFillBackground (true );
@@ -141,7 +141,7 @@ SCIRunMainWindow::SCIRunMainWindow() : firstTimePythonShown_(true)
141141
142142 connect (actionExecute_All_, SIGNAL (triggered ()), dialogErrorControl_.get (), SLOT (resetCounter ()));
143143
144- scrollAreaWidgetContents_->addAction (actionExecute_All_);
144+ scrollAreaWidgetContents_->addAction (actionExecute_All_);
145145 auto sep = new QAction (this );
146146 sep->setSeparator (true );
147147 scrollAreaWidgetContents_->addAction (sep);
@@ -1095,70 +1095,76 @@ QString SCIRunMainWindow::dataDirectory() const
10951095 return scirunDataLineEdit_->text ();
10961096}
10971097
1098+ void SCIRunMainWindow::setDataDirectoryFromGUI ()
1099+ {
1100+ QString dir = QFileDialog::getExistingDirectory (this , tr (" Choose Data Directory" ), " ." );
1101+ setDataDirectory (dir);
1102+ }
1103+
10981104bool SCIRunMainWindow::newInterface () const
10991105{
11001106 return Core::Application::Instance ().parameters ()->entireCommandLine ().find (" --experimentalGUI" ) != std::string::npos;
11011107}
11021108
11031109namespace {
11041110
1105- void addElementDataToMap (QXmlStreamReader& xml, QMap<QString, QString>& map)
1111+ void addElementDataToMap (QXmlStreamReader& xml, QMap<QString, QString>& map)
11061112 {
1107- if (xml.tokenType () != QXmlStreamReader::StartElement)
1113+ if (xml.tokenType () != QXmlStreamReader::StartElement)
11081114 {
11091115 std::cout << " didn't find start" << std::endl;
11101116 return ;
11111117 }
11121118 QString elementName = xml.name ().toString ();
11131119 xml.readNext ();
1114- if (xml.tokenType () != QXmlStreamReader::Characters)
1120+ if (xml.tokenType () != QXmlStreamReader::Characters)
11151121 {
11161122 std::cout << " not char data" << std::endl;
11171123 return ;
11181124 }
11191125 map.insert (elementName, xml.text ().toString ());
11201126 }
11211127
1122- void addItemDataToMap (QXmlStreamReader& xml, QMap<QString, QString>& map)
1128+ void addItemDataToMap (QXmlStreamReader& xml, QMap<QString, QString>& map)
11231129 {
1124- if (xml.tokenType () != QXmlStreamReader::StartElement)
1130+ if (xml.tokenType () != QXmlStreamReader::StartElement)
11251131 {
11261132 std::cout << " didn't find start 2" << std::endl;
11271133 return ;
11281134 }
11291135 xml.readNext ();
1130- if (xml.tokenType () != QXmlStreamReader::Characters)
1136+ if (xml.tokenType () != QXmlStreamReader::Characters)
11311137 {
11321138 std::cout << " not char data 2" << std::endl;
11331139 return ;
11341140 }
11351141 QXmlStreamAttributes attributes = xml.attributes ();
1136- if (attributes.hasAttribute (" key" ) && attributes.hasAttribute (" value" ))
1142+ if (attributes.hasAttribute (" key" ) && attributes.hasAttribute (" value" ))
11371143 {
11381144 map[attributes.value (" key" ).toString ()] = attributes.value (" value" ).toString ();
11391145 }
11401146 else
11411147 std::cout << 333 << std::endl;
11421148 }
11431149
1144- QMap<QString, QString> parseStyle (QXmlStreamReader& xml)
1150+ QMap<QString, QString> parseStyle (QXmlStreamReader& xml)
11451151 {
11461152 QMap<QString, QString> style;
1147- if (xml.tokenType () != QXmlStreamReader::StartElement && xml.name () == " style" )
1153+ if (xml.tokenType () != QXmlStreamReader::StartElement && xml.name () == " style" )
11481154 {
11491155 std::cout << " didn't find style" << std::endl;
11501156 return style;
11511157 }
1152-
1158+
11531159 xml.readNext ();
1154-
1155- while (!(xml.tokenType () == QXmlStreamReader::EndElement && xml.name () == " style" ))
1160+
1161+ while (!(xml.tokenType () == QXmlStreamReader::EndElement && xml.name () == " style" ))
11561162 {
1157- if (xml.tokenType () == QXmlStreamReader::StartElement)
1163+ if (xml.tokenType () == QXmlStreamReader::StartElement)
11581164 {
1159- if (xml.name () == " template" )
1165+ if (xml.name () == " template" )
11601166 addElementDataToMap (xml, style);
1161- if (xml.name () == " item" )
1167+ if (xml.name () == " item" )
11621168 addItemDataToMap (xml, style);
11631169 }
11641170 else
@@ -1174,13 +1180,13 @@ void SCIRunMainWindow::parseStyleXML()
11741180{
11751181 std::cout << " parsing style xml" << std::endl;
11761182 QFile file (" ./styleSheetDetails.xml" );
1177- if (!file.open (QIODevice::ReadOnly | QIODevice::Text))
1183+ if (!file.open (QIODevice::ReadOnly | QIODevice::Text))
11781184 {
11791185 QMessageBox::critical (this , " SCIRun" , " Couldn't open styleSheetDetails.xml" , QMessageBox::Ok);
11801186 return ;
11811187 }
11821188 QXmlStreamReader xml (&file);
1183- while (!xml.atEnd () && !xml.hasError ())
1189+ while (!xml.atEnd () && !xml.hasError ())
11841190 {
11851191 QXmlStreamReader::TokenType token = xml.readNext ();
11861192 if (token == QXmlStreamReader::StartDocument) {
@@ -1193,7 +1199,7 @@ void SCIRunMainWindow::parseStyleXML()
11931199 std::cout << " found: " << xml.name ().toString ().toStdString () << std::endl;
11941200 if (xml.name () == " style" ) {
11951201 QXmlStreamAttributes attributes = xml.attributes ();
1196- if (attributes.hasAttribute (" widgetType" ))
1202+ if (attributes.hasAttribute (" widgetType" ))
11971203 {
11981204 styleSheetDetails_[attributes.value (" widgetType" ).toString ()] = parseStyle (xml);
11991205 }
@@ -1203,7 +1209,7 @@ void SCIRunMainWindow::parseStyleXML()
12031209 }
12041210 }
12051211
1206- if (xml.hasError ())
1212+ if (xml.hasError ())
12071213 {
12081214 QMessageBox::critical (this , " SCIRun" , xml.errorString (), QMessageBox::Ok);
12091215 }
@@ -1224,12 +1230,6 @@ void SCIRunMainWindow::printStyleSheet() const
12241230 }
12251231}
12261232
1227- void SCIRunMainWindow::setDataDirectoryFromGUI ()
1228- {
1229- QString dir = QFileDialog::getExistingDirectory (this , tr (" Choose Data Directory" ), " ." );
1230- setDataDirectory (dir);
1231- }
1232-
12331233void SCIRunMainWindow::setFocusOnFilterLine ()
12341234{
12351235 moduleFilterLineEdit_->setFocus (Qt::ShortcutFocusReason);
0 commit comments