31 #include <QDesktopServices>
32 #include <QMessageBox>
45 using namespace Controller;
47 using namespace Data_Structure;
51 QObject(parent), executor(executor), showingStartable(false)
53 QObject::connect(&propertyAdderView,
54 SIGNAL(create(std::string, std::string)),
73 if (application.get() ==
nullptr)
77 showingStartable =
true;
78 currentApplication = application;
81 executor->loadAndSetCachedProperties(
84 view->setVisible(
true);
92 if (application.get() ==
nullptr)
96 showingStartable =
false;
103 view->setVisible(
true);
110 if (scenario.get() ==
nullptr)
114 showingStartable =
true;
116 currentScenario = scenario;
118 scenario->reloadGlobalConf();
119 view->setVisible(
true);
126 if (package.get() ==
nullptr)
130 showingStartable =
false;
139 if (showingStartable)
141 std::string url =
"file://";
142 if (currentApplication.get() !=
nullptr)
144 url.append(currentApplication->getConfigPath());
146 else if (currentScenario.get() !=
nullptr)
148 url.append(currentScenario->getGlobalConfigPath());
150 QDesktopServices::openUrl(QUrl(url.c_str()));
157 if (showingStartable)
159 if (currentApplication.get() !=
nullptr)
161 currentApplication->addProperty(name,
value);
162 currentApplication->save();
165 else if (currentScenario.get() !=
nullptr)
167 currentScenario->getGlobalConfig()->defineOptionalProperty<std::string>(
168 name,
"::NOT_DEFINED::",
"Custom Property");
169 currentScenario->getGlobalConfig()->getProperties()->setProperty(name,
value);
170 currentScenario->save();
179 if (showingStartable)
181 if (currentApplication.get() !=
nullptr)
183 executor->startApplication(currentApplication);
185 else if (currentScenario.get() !=
nullptr)
189 startScenario(currentScenario);
191 catch (IceGrid::ServerStartException& ex)
193 showWarningDialog(
"Ice had an launching error. Please make sure your remote launch "
194 "settings are correct");
201 DetailedApplicationController::startScenario(
ScenarioPtr scenario)
248 if (showingStartable)
250 if (currentApplication.get() !=
nullptr)
252 executor->stopApplication(currentApplication);
254 else if (currentScenario.get() !=
nullptr)
256 executor->stopScenario(currentScenario);
264 if (showingStartable)
266 if (currentApplication.get() !=
nullptr)
268 currentApplication->save();
269 executor->restartApplication(currentApplication);
271 else if (currentScenario.get() !=
nullptr)
273 currentScenario->save();
276 executor->restartScenario(currentScenario);
278 catch (IceGrid::ServerStartException& ex)
280 showWarningDialog(
"Ice had an launching error. Please make sure your remote launch "
281 "settings are correct");
295 propertyAdderView.exec();
299 DetailedApplicationController::showWarningDialog(QString
message)
309 this->iceAdmin = iceAdmin;