24#ifdef BALL_PYTHON_SUPPORT
34#include "ui_aboutDialog.h"
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) {
const char * bucky_64x64_xpm[]
BALL_EXPORT LogStream Log
@ MODEL_STICK
defines the property for the model: Stick
LogStream & error(int n=0)
virtual void registerThis()
const char * c_str() const BALL_NOEXCEPT
static PluginManager & instance()
void registerHandler(PluginHandler *h)
String find(const String &name)
void setTransparency(int value)
void setSurfaceDrawingPrecision(float value)
void selectMode(int index)
void setDrawingPrecision(int value)
void selectColoringMethod(int index)
void selectModel(int index)
Size getNumberOfComposites() const
CompositeIterator begin()
static IconLoader & instance()
const QIcon & getIcon(const String &name)
QAction * stop_simulation_action_
void stopSimulation()
Stop a currently running calculation.
void setStatusbarText(const String &text, bool important=false, bool beep=false)
void quickSave()
Create a BALLView project file with the name quick.bvp in the users home dir.
QAction * clear_selection_action_
QAction * fullscreen_action_
void saveBALLViewProjectFile()
QAction * complement_selection_action_
virtual void restoreWindows()
Restore the positions the main window and of all DockWindow's from the INIFile assigned to this insta...
virtual QMenu * initPopupMenu(int ID, UIOperationMode::OperationMode mode=UIOperationMode::MODE_ALL)
std::list< Composite * > & getMolecularControlSelection()
Get the selection (highlighted items) of the MolecularControl (not the selection with checkboxes)
virtual bool event(QEvent *e)
Interface to QT events, e.g. to communicate with other threads.
void insertPopupMenuSeparator(int ID, UIOperationMode::OperationMode mode=UIOperationMode::MODE_ALL)
void setMenuHint(QAction *id, const String &hint)
Set a hint for a menu entry.
QAction * preferences_action_
RepresentationManager & getRepresentationManager()
std::list< Composite * > control_selection_
virtual void deleteClicked()
void loadBALLViewProjectFile()
void complementSelection()
Preferences * getPreferences()
@ FILE_OPEN
File menu sub menu open.
@ TOOLS_PYTHON
Python submenu in Tools.
@ MOLECULARMECHANICS
Simulations menu.
@ MACRO
Macros e.g. for Testing.
@ DISPLAY_VIEWPOINT
Display Viewpoint submenu.
virtual void checkMenus()
QAction * insertMenuEntry(Position parent_id, const String &name, const QObject *receiver=0, const char *slot=0, const String &description="", QKeySequence accel=QKeySequence(), UIOperationMode::OperationMode minimal_mode=UIOperationMode::MODE_ALL)
void setLoggingFilename(const String &string)
CompositeManager composite_manager_
static UIOperationMode & instance()
virtual bool registerController(DatasetController *con)
virtual void keyPressEvent(QKeyEvent *e)
Catch key events.
virtual void addToolBarEntries(QToolBar *tb)
static bool stereoBufferSupportTest()
void setupPluginHandlers_()
bool eventFilter(QObject *, QEvent *e)
Catch key events.
void changeEvent(QEvent *evt)
Mainframe(QWidget *parent=0, const char *name=0)
QAction * save_project_action_
void reset()
remove all loaded Molecules and Representations, reset Coloring options