24 #ifdef BALL_PYTHON_SUPPORT
34 #include "ui_aboutDialog.h"
51 Mainframe::Mainframe(
QWidget* parent,
const char* name)
54 save_project_action_(0),
59 qApp->setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
63 #ifdef BALL_VIEW_DEBUG
64 Log.
error() <<
"new Mainframe " <<
this << std::endl;
70 setWindowTitle(tr(
"BALLView"));
79 #ifdef BALL_PYTHON_SUPPORT
94 String description =
"Shortcut|Display|Toggle_Fullscreen";
112 addDockWidget(Qt::LeftDockWidgetArea,
new GeometricControl(
this, ((
String)tr(
"Representations")).c_str()));
113 addDockWidget(Qt::TopDockWidgetArea,
new DatasetControl(
this, ((
String)tr(
"Datasets")).c_str()));
123 DatasetControl::getInstance(0)->hide();
132 addDockWidget(Qt::BottomDockWidgetArea,
new LogView(
this, ((
String)tr(
"Logs")).c_str()));
133 addDockWidget(Qt::BottomDockWidgetArea,
new FileObserver(
this, ((
String)tr(
"FileObserver")).c_str()));
139 setAcceptDrops(
true);
143 #ifdef BALL_PYTHON_SUPPORT
152 description =
"Shortcut|File|Open|Project";
157 description =
"Shortcut|File|Save_Project";
165 description =
"Shortcut|Help|About";
168 setMenuHint(action, (
String)tr(
"Show informations on this version of BALLView"));
171 description =
"Shortcut|MolecularMechanics|Abort_Calculation";
185 description =
"Shortcut|Edit|Invert_Selection";
190 description =
"Shortcut|Edit|Clear_Selection";
196 qApp->installEventFilter(
this);
203 #ifdef BALL_PYTHON_SUPPORT
211 if (
event->type() != QEvent::KeyPress)
return false;
213 QKeyEvent* e = dynamic_cast<QKeyEvent*>(
event);
215 QPoint point = QCursor::pos();
216 QWidget* widget = qApp->widgetAt(point);
218 qApp->focusWidget() !=
scene_)
224 if (e->key() == Qt::Key_Delete &&
225 RTTI::isKindOf<QTreeWidget>(sender))
231 if (e->key() == Qt::Key_Enter)
240 MolecularStructure::getInstance(0)->centerCamera();
245 if (e->key() == Qt::Key_Alt ||
246 e->key() == Qt::Key_Control)
293 tb =
new QToolBar(
"Main Toolbar",
this);
294 tb->setObjectName(
"Main Toolbar");
295 tb->setIconSize(QSize(22,22));
296 addToolBar(Qt::TopToolBarArea, tb);
305 menu->addSeparator();
306 menu->addAction(tb->toggleViewAction());
312 MolecularFileDialog::getInstance(0)->addToolBarEntries(tb);
313 DownloadPDBFile::getInstance(0)->addToolBarEntries(tb);
314 DownloadElectronDensity::getInstance(0)->addToolBarEntries(tb);
315 PubChemDialog::getInstance(0)->addToolBarEntries(tb);
316 UndoManagerDialog::getInstance(0)->addToolBarEntries(tb);
333 DisplayProperties::getInstance(0)->addToolBarEntries(tb);
334 MolecularStructure::getInstance(0)->addToolBarEntries(tb);
353 Ui_AboutDialog
about;
355 QString version = QString(tr(
"QT ")) + qVersion() +
"(mt)";
356 about.qt_version_label->setText(version);
357 QFont font =
about.BALLView_version_label->font();
358 about.BALLView_version_label->setText(QString(
"BALLView ") + BALL_RELEASE_STRING);
359 font.setPixelSize(18);
360 about.BALLView_version_label->setFont(font);
361 about.BALL_version_label->setText(__DATE__);
365 String logo_path = p.
find(
"graphics/logo.png");
368 about.BALLView_logo_label->setPixmap(QPixmap(logo_path.
c_str()));
375 if(evt->type() == QEvent::WindowStateChange) {