Commit c0e08c4f authored by Oliver Bock's avatar Oliver Bock

Added IYA2009 demo mode

parent 9736c7b4
......@@ -36,6 +36,7 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
m_statusBarVisible = ui.actionStatus_bar->isChecked();
m_animControlVisible = true;
m_animControlFloating = ui.dockAnimControl->isFloating();
m_hiddenDemoModeActivated = false;
// register alternate shortcuts (will be enabled when menu is hidden)
m_runShortcut = new QShortcut(ui.actionRun->shortcut(), this);
......@@ -53,6 +54,9 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
m_fullscreenShortcut = new QShortcut(ui.actionFullscreen->shortcut(), this);
m_fullscreenShortcut->setEnabled(false);
// register "hidden" demo mode shortcut for IYA2009 exhibition
m_hiddenShortcut = new QShortcut(Qt::CTRL + Qt::SHIFT + Qt::ALT + Qt::Key_D, this);
// establish object communications
connect(ui.pushRun, SIGNAL(clicked()),
ui.pulsarGlWidget, SLOT(runAnimation()));
......@@ -95,6 +99,9 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
connect(ui.pulsarGlWidget, SIGNAL(pulseProfileUpdated(const QVector<double>&)),
ui.pulseScopeWidget, SLOT(drawCurve(const QVector<double>&)), Qt::DirectConnection);
connect(m_hiddenShortcut, SIGNAL(activated()),
this, SLOT(toggleHiddenDemoMode()));
}
PulsatingScience::~PulsatingScience()
......@@ -133,6 +140,21 @@ PulsatingScience::~PulsatingScience()
m_fullscreenShortcut->disconnect();
delete m_fullscreenShortcut;
}
if(m_hiddenShortcut) {
m_hiddenShortcut->disconnect();
delete m_hiddenShortcut;
}
}
void PulsatingScience::closeEvent(QCloseEvent *event)
{
if(m_hiddenDemoModeActivated) {
event->ignore();
}
else {
event->accept();
}
}
void PulsatingScience::on_pushRun_clicked()
......@@ -402,3 +424,19 @@ void PulsatingScience::updatePulsarSemiMajorAxisValue(double value)
ui.lcdPulsarSemiMajorAxis->display(QString::number(value, 'f', 1));
}
}
void PulsatingScience::toggleHiddenDemoMode()
{
if(m_hiddenDemoModeActivated) {
menuBarToggled();
window()->setWindowState(windowState() & ~Qt::WindowFullScreen);
ui.dockAnimControl->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
m_hiddenDemoModeActivated = false;
}
else {
menuBarToggled();
window()->setWindowState(windowState() | Qt::WindowFullScreen);
ui.dockAnimControl->setFeatures(QDockWidget::NoDockWidgetFeatures);
m_hiddenDemoModeActivated = true;
}
}
......@@ -27,6 +27,7 @@
#include "ui_pulsatingscience.h"
class PulsatingScience : public QMainWindow
{
Q_OBJECT
......@@ -35,6 +36,8 @@ public:
PulsatingScience(QWidget *parent = 0);
~PulsatingScience();
void closeEvent(QCloseEvent *event);
public slots:
void on_pushRun_clicked();
void on_pushPause_clicked();
......@@ -64,6 +67,7 @@ public slots:
void on_actionAbout_activated();
void updatePulsarSemiMajorAxisValue(double value);
void toggleHiddenDemoMode();
private:
Ui::PulsatingScienceClass ui;
......@@ -75,6 +79,7 @@ private:
QShortcut *m_rotationAxesShortcut;
QShortcut *m_menuBarShortcut;
QShortcut *m_fullscreenShortcut;
QShortcut *m_hiddenShortcut;
bool m_permanentOrbits;
bool m_rotationAxesVisible;
......@@ -82,6 +87,7 @@ private:
bool m_statusBarVisible;
bool m_animControlVisible;
bool m_animControlFloating;
bool m_hiddenDemoModeActivated;
};
#endif // PULSATINGSCIENCE_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment