Select Git revision
pulsatingscience.cpp
-
Oliver Bock authoredOliver Bock authored
pulsatingscience.cpp 12.77 KiB
/******************************************************************************
* Copyright (C) 2008 by Oliver Bock *
* oliver.bock[AT]aei.mpg.de *
* *
* This file is part of PulsatingScience. *
* *
* PulsatingScience is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published *
* by the Free Software Foundation, version 3 of the License. *
* *
* PulsatingScience is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with PulsatingScience. If not, see <http://www.gnu.org/licenses/>. *
* *
******************************************************************************/
#include "pulsatingscience.h"
#include "plotdata.h"
#include <QSettings>
#ifdef __APPLE__
#include "/System/Library/Frameworks/Carbon.framework/Versions/A/Headers/Carbon.h"
#endif
PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
{
ui.setupUi(this);
QAction* animControl = ui.dockAnimControl->toggleViewAction();
animControl->setStatusTip(tr("Toggle the animation control visibility"));
animControl->setShortcut(QKeySequence(tr("Alt+A")));
ui.menuView->addAction(animControl);
#ifdef __APPLE__
ui.actionMenu_bar->setEnabled(false);
#endif
// inital status (based on GUI)
m_menuBarVisible = ui.actionMenu_bar->isChecked();
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_menuBarShortcut = new QShortcut(ui.actionMenu_bar->shortcut(), this);
m_menuBarShortcut->setEnabled(false);
m_fullscreenShortcut = new QShortcut(ui.actionFullscreen->shortcut(), this);
m_fullscreenShortcut->setEnabled(false);
m_fullscreenESCShortcut = new QShortcut(QKeySequence(Qt::Key_Escape), this);
m_fullscreenESCShortcut->setEnabled(false);
// register "hidden" demo mode shortcut for IYA2009 exhibition
m_hiddenShortcut = new QShortcut(QKeySequence(Qt::SHIFT + Qt::ALT + Qt::Key_D), this);
// establish object communications
connect(ui.pulsarGlWidget, SIGNAL(pulseProfileUpdated(const PlotData&)),
ui.pulseScopeWidget, SLOT(plot(const PlotData&)));
connect(m_hiddenShortcut, SIGNAL(activated()),
this, SLOT(toggleHiddenDemoMode()));
// prepare inactivity timer
m_inactivityTimer = new QTimer(this);