Skip to content
Snippets Groups Projects
Select Git revision
  • 7d1d15c8e552b71ce35fd1cb15c11be505327665
  • master default protected
2 results

README.rst

Blame
  • pulsatingscience.cpp 21.90 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 <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_permanentOrbits = ui.actionPermanent_orbits->isChecked();
        m_rotationAxesVisible = ui.actionRotationAxes->isChecked();
        m_pulseFlashesVisible = ui.actionPulseFlashes->isChecked();
        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_runShortcut = new QShortcut(ui.actionRun->shortcut(), this);
        m_runShortcut->setEnabled(false);
        m_pauseShortcut = new QShortcut(ui.actionPause->shortcut(), this);
        m_pauseShortcut->setEnabled(false);
        m_stopShortcut = new QShortcut(ui.actionStop->shortcut(), this);
        m_stopShortcut->setEnabled(false);
        m_permanentOrbitsShortcut = new QShortcut(ui.actionPermanent_orbits->shortcut(), this);
        m_permanentOrbitsShortcut->setEnabled(false);
        m_rotationAxesShortcut = new QShortcut(ui.actionRotationAxes->shortcut(), this);
        m_rotationAxesShortcut->setEnabled(false);
        m_pulseFlashesShortcut = new QShortcut(ui.actionPulseFlashes->shortcut(), this);
        m_pulseFlashesShortcut->setEnabled(false);
        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);