31 #include <QtGui/QPushButton>
32 #include <QtGui/QMessageBox>
33 #include <QtGui/QTextBrowser>
56 Ui_DemoTutorialDialogData(),
62 #ifdef BALL_VIEW_DEBUG
63 Log.
error() <<
"new DemoTutorialDialog " <<
this << std::endl;
73 connect(cancel_button, SIGNAL(clicked()),
this, SLOT(hide()));
78 #ifdef BALL_VIEW_DEBUG
79 Log.
error() <<
"deleting DemoTutorialDialog " <<
this << std::endl;
87 setWindowTitle(tr(
"BALLView Demo"));
91 next_button->setEnabled(
true);
97 if (LogView::getInstance(0) != 0) LogView::getInstance(0)->hide();
98 if (DatasetControl::getInstance(0) != 0) DatasetControl::getInstance(0)->hide();
99 #ifdef BALL_PYTHON_SUPPORT
100 if (PyWidget::getInstance(0) != 0) PyWidget::getInstance(0)->hide();
119 setWindowTitle(tr(
"BALLView Tutorial"));
123 next_button->setEnabled(
false);
127 Scene::getInstance(0)->show();
128 MolecularControl::getInstance(0)->show();
129 MolecularControl::getInstance(0)->setFloating(
false);
130 MolecularControl::getInstance(0)->applyPreferences();
131 DatasetControl::getInstance(0)->show();
132 DatasetControl::getInstance(0)->applyPreferences();
133 DatasetControl::getInstance(0)->setFloating(
false);
134 GeometricControl::getInstance(0)->show();
135 GeometricControl::getInstance(0)->applyPreferences();
136 GeometricControl::getInstance(0)->setFloating(
false);
138 LogView::getInstance(0)->hide();
151 int result = QMessageBox::question(
this, tr(
"Warning"),
152 tr(
"To start the tutorial, all loaded structures and molecules will be deleted."),
153 QMessageBox::Ok| QMessageBox::Cancel, QMessageBox::Ok);
154 if (result != QMessageBox::Ok)
return;
159 QUrl qurl = QUrl::fromLocalFile((
prefix_ +
"01.html").c_str());
160 text_browser->setSource(qurl);
169 if (!isVisible())
return;
188 if (!RTTI::isKindOf<FinishedSimulationMessage>(*message))
return;
193 if (msg == 0)
return;
201 RegularData3DDataset*
set =
dynamic_cast<RegularData3DDataset*
>(msg->
getDataset());
208 SceneMessage* msg = RTTI::castTo<SceneMessage>(*message);
214 else if (rmsg == 0 ||
226 next_button->setEnabled(
true);
233 if (
id.size() == 1)
id =
"0" + id;
237 QUrl qurl = QUrl::fromLocalFile(
id.c_str());
238 text_browser->setSource(qurl);
239 next_button->setEnabled(
false);
257 next_button->setEnabled(
true);
265 hv->setFloating(
true);
286 String file_name = path.
find(
"structures/bpti.pdb");
289 if (dialog == 0)
return;
297 String msg((
String)tr(
"Could not open bpti.pdb. Maybe the file was deleted?")+
"\n");
298 msg += (
String)tr(
"It should be found in") +
" " + file_name;
300 QMessageBox::critical(0, tr(
"Error while starting BALLView Demo"), msg.c_str(),
301 QMessageBox::Ok, Qt::NoButton, Qt::NoButton);
337 Mesh* mesh =
dynamic_cast<Mesh*
>(go);
393 list<Composite*> composites;
394 composites.push_back(*
getMainControl()->getCompositeManager().getComposites().begin());
395 MolecularControl::getInstance(0)->highlight(composites);
451 if (grids.empty())
return;
488 if (!RTTI::isKindOf<SceneMessage>(*message))
return;
499 if (!RTTI::isKindOf<DatasetMessage>(*message))
return;
527 if (!RTTI::isKindOf<DatasetMessage>(*message))
return;
589 String description =
"Shortcut|Help|Demo";
593 description =
"Shortcut|Help|Tutorial";
601 bool busy = main_control.
isBusy();