StelGui.cpp   StelGui.cpp 
/* /*
* Stellarium * Stellarium
* Copyright (C) 2008 Fabien Chereau * Copyright (C) 2008 Fabien Chereau
* Copyright (C) 2012 Timothy Reaves
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "StelGui.hpp" #include "StelGui.hpp"
#include "StelGuiItems.hpp" #include "StelGuiItems.hpp"
#include "SkyGui.hpp" #include "SkyGui.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelProjector.hpp" #include "StelProjector.hpp"
#include "StelMovementMgr.hpp" #include "StelMovementMgr.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
skipping to change at line 50 skipping to change at line 51
#include "StelObject.hpp" #include "StelObject.hpp"
#include "StelProjector.hpp" #include "StelProjector.hpp"
#include "SolarSystem.hpp" #include "SolarSystem.hpp"
#include "StelSkyLayerMgr.hpp" #include "StelSkyLayerMgr.hpp"
#include "StelStyle.hpp" #include "StelStyle.hpp"
#include "StelSkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include "MeteorMgr.hpp" #include "MeteorMgr.hpp"
#ifdef ENABLE_SCRIPT_CONSOLE #ifdef ENABLE_SCRIPT_CONSOLE
#include "ScriptConsole.hpp" #include "ScriptConsole.hpp"
#endif #endif
#ifndef DISABLE_SCRIPTING
#include "StelScriptMgr.hpp" #include "StelScriptMgr.hpp"
#endif
#include "StelAppGraphicsWidget.hpp" #include "StelAppGraphicsWidget.hpp"
#include <QDebug> #include <QDebug>
#include <QTimeLine> #include <QTimeLine>
#include <QFontDatabase> #include <QFontDatabase>
#include <QMouseEvent> #include <QMouseEvent>
#include <QAction> #include <QAction>
#include <QApplication> #include <QApplication>
#include <QFile> #include <QFile>
#include <QTextBrowser> #include <QTextBrowser>
#include <QGraphicsWidget> #include <QGraphicsWidget>
#include <QGraphicsGridLayout> #include <QGraphicsGridLayout>
#include <QClipboard>
StelGuiBase* StelStandardGuiPluginInterface::getStelGuiBase() const StelGuiBase* StelStandardGuiPluginInterface::getStelGuiBase() const
{ {
// Allow to load the resources when used as a static plugin // Allow to load the resources when used as a static plugin
Q_INIT_RESOURCE(guiRes); Q_INIT_RESOURCE(guiRes);
return new StelGui(); return new StelGui();
} }
Q_EXPORT_PLUGIN2(StelGui, StelStandardGuiPluginInterface) Q_EXPORT_PLUGIN2(StelGui, StelStandardGuiPluginInterface)
skipping to change at line 108 skipping to change at line 112
QString group = N_("Display Options"); QString group = N_("Display Options");
addGuiActions("actionShow_Constellation_Lines", N_("Constellation li nes"), "C", group, true, false); addGuiActions("actionShow_Constellation_Lines", N_("Constellation li nes"), "C", group, true, false);
addGuiActions("actionShow_Constellation_Art", N_("Constellation art" ), "R", group, true, false); addGuiActions("actionShow_Constellation_Art", N_("Constellation art" ), "R", group, true, false);
addGuiActions("actionShow_Constellation_Labels", N_("Constellation l abels"), "V", group, true, false); addGuiActions("actionShow_Constellation_Labels", N_("Constellation l abels"), "V", group, true, false);
addGuiActions("actionShow_Constellation_Boundaries", N_("Constellati on boundaries"), "B", group, true, false); addGuiActions("actionShow_Constellation_Boundaries", N_("Constellati on boundaries"), "B", group, true, false);
addGuiActions("actionShow_Azimuthal_Grid", N_("Azimuthal grid"), "Z" , group, true, false); addGuiActions("actionShow_Azimuthal_Grid", N_("Azimuthal grid"), "Z" , group, true, false);
addGuiActions("actionShow_Equatorial_Grid", N_("Equatorial grid"), " E", group, true, false); addGuiActions("actionShow_Equatorial_Grid", N_("Equatorial grid"), " E", group, true, false);
addGuiActions("actionShow_Equatorial_J2000_Grid", N_("Equatorial J20 00 grid"), "", group, true, false); addGuiActions("actionShow_Equatorial_J2000_Grid", N_("Equatorial J20 00 grid"), "", group, true, false);
addGuiActions("actionShow_Galactic_Grid", N_("Galactic grid"), "", g roup, true, false); addGuiActions("actionShow_Galactic_Grid", N_("Galactic grid"), "", g roup, true, false);
addGuiActions("actionShow_Galactic_Plane_Line", N_("Galactic plane") , "", group, true, false);
addGuiActions("actionShow_Ecliptic_Line", N_("Ecliptic line"), ",", group, true, false); addGuiActions("actionShow_Ecliptic_Line", N_("Ecliptic line"), ",", group, true, false);
addGuiActions("actionShow_Equator_Line", N_("Equator line"), ".", gr oup, true, false); addGuiActions("actionShow_Equator_Line", N_("Equator line"), ".", gr oup, true, false);
addGuiActions("actionShow_Meridian_Line", N_("Meridian line"), ";", group, true, false); addGuiActions("actionShow_Meridian_Line", N_("Meridian line"), ";", group, true, false);
addGuiActions("actionShow_Horizon_Line", N_("Horizon line"), "", gro up, true, false); addGuiActions("actionShow_Horizon_Line", N_("Horizon line"), "", gro up, true, false);
addGuiActions("actionShow_Cardinal_Points", N_("Cardinal points"), " Q", group, true, false); addGuiActions("actionShow_Cardinal_Points", N_("Cardinal points"), " Q", group, true, false);
addGuiActions("actionShow_Ground", N_("Ground"), "G", group, true, f alse); addGuiActions("actionShow_Ground", N_("Ground"), "G", group, true, f alse);
addGuiActions("actionShow_Atmosphere", N_("Atmosphere"), "A", group, true, false); addGuiActions("actionShow_Atmosphere", N_("Atmosphere"), "A", group, true, false);
addGuiActions("actionShow_Fog", N_("Fog"), "F", group, true, false); addGuiActions("actionShow_Fog", N_("Fog"), "F", group, true, false);
addGuiActions("actionShow_Nebulas", N_("Nebulas"), "N", group, true, false); addGuiActions("actionShow_Nebulas", N_("Nebulas"), "N", group, true, false);
addGuiActions("actionShow_DSS", N_("Nebulas background images"), "", group, true, false); addGuiActions("actionShow_DSS", N_("Nebulas background images"), "", group, true, false);
addGuiActions("actionShow_Stars", N_("Stars"), "S", group, true, fal se); addGuiActions("actionShow_Stars", N_("Stars"), "S", group, true, fal se);
addGuiActions("actionShow_Planets_Labels", N_("Planets labels"), "P" , group, true, false); addGuiActions("actionShow_Planets_Labels", N_("Planet labels"), "P", group, true, false);
addGuiActions("actionShow_Planets_Orbits", N_("Planet orbits"), "O", group, true, false); addGuiActions("actionShow_Planets_Orbits", N_("Planet orbits"), "O", group, true, false);
addGuiActions("actionShow_Planets_Trails", N_("Planet trails"), "Shi ft+T", group, true, false); addGuiActions("actionShow_Planets_Trails", N_("Planet trails"), "Shi ft+T", group, true, false);
addGuiActions("actionShow_Night_Mode", N_("Night mode"), "", group, true, false); addGuiActions("actionShow_Night_Mode", N_("Night mode"), "", group, true, false);
addGuiActions("actionSet_Full_Screen_Global", N_("Full-screen mode") , "F11", group, true, false); addGuiActions("actionSet_Full_Screen_Global", N_("Full-screen mode") , "F11", group, true, false);
addGuiActions("actionHorizontal_Flip", N_("Flip scene horizontally") , "Ctrl+Shift+H", group, true, false); addGuiActions("actionHorizontal_Flip", N_("Flip scene horizontally") , "Ctrl+Shift+H", group, true, false);
addGuiActions("actionVertical_Flip", N_("Flip scene vertically"), "C trl+Shift+V", group, true, false); addGuiActions("actionVertical_Flip", N_("Flip scene vertically"), "C trl+Shift+V", group, true, false);
group = N_("Windows"); group = N_("Windows");
addGuiActions("actionShow_Help_Window_Global", N_("Help window"), "F 1", group, true, false); addGuiActions("actionShow_Help_Window_Global", N_("Help window"), "F 1", group, true, false);
skipping to change at line 174 skipping to change at line 179
addGuiActions("actionGoto_Selected_Object", N_("Center on selected o bject"), "Space", group, false, false); addGuiActions("actionGoto_Selected_Object", N_("Center on selected o bject"), "Space", group, false, false);
addGuiActions("actionSet_Tracking", N_("Track object"), "T", group, true, false); addGuiActions("actionSet_Tracking", N_("Track object"), "T", group, true, false);
addGuiActions("actionZoom_In_Auto", N_("Zoom in on selected object") , "/", group, false, false); addGuiActions("actionZoom_In_Auto", N_("Zoom in on selected object") , "/", group, false, false);
addGuiActions("actionZoom_Out_Auto", N_("Zoom out"), "\\", group, fa lse, false); addGuiActions("actionZoom_Out_Auto", N_("Zoom out"), "\\", group, fa lse, false);
addGuiActions("actionSet_Home_Planet_To_Selected", N_("Set home plan et to selected planet"), "Ctrl+G", group, false, false); addGuiActions("actionSet_Home_Planet_To_Selected", N_("Set home plan et to selected planet"), "Ctrl+G", group, false, false);
group = N_("Miscellaneous"); group = N_("Miscellaneous");
addGuiActions("actionSwitch_Equatorial_Mount", N_("Switch between eq uatorial and azimuthal mount"), "Ctrl+M", group, true, false); addGuiActions("actionSwitch_Equatorial_Mount", N_("Switch between eq uatorial and azimuthal mount"), "Ctrl+M", group, true, false);
addGuiActions("actionQuit_Global", N_("Quit"), "Ctrl+Q", group, fals e, false); addGuiActions("actionQuit_Global", N_("Quit"), "Ctrl+Q", group, fals e, false);
addGuiActions("actionSave_Screenshot_Global", N_("Save screenshot"), "Ctrl+S", group, false, false); addGuiActions("actionSave_Screenshot_Global", N_("Save screenshot"), "Ctrl+S", group, false, false);
addGuiActions("action_Reload_Style", "Reload style", "Ctrl+R", "Debu g", false, false); addGuiActions("actionSave_Copy_Object_Information_Global", N_("Copy selected object information to clipboard"), "Ctrl+C", group, false, false);
addGuiActions("actionAutoHideHorizontalButtonBar", N_("Auto hide hor izontal button bar"), "", group, true, false); addGuiActions("actionAutoHideHorizontalButtonBar", N_("Auto hide hor izontal button bar"), "", group, true, false);
addGuiActions("actionAutoHideVerticalButtonBar", N_("Auto hide verti cal button bar"), "", group, true, false); addGuiActions("actionAutoHideVerticalButtonBar", N_("Auto hide verti cal button bar"), "", group, true, false);
addGuiActions("actionToggle_GuiHidden_Global", N_("Toggle visibility of GUI"), "Ctrl+T", group, true, false); addGuiActions("actionToggle_GuiHidden_Global", N_("Toggle visibility of GUI"), "Ctrl+T", group, true, false);
//////////////////////////////////////////////////////////////////// /// //////////////////////////////////////////////////////////////////// ///
// Connect all the GUI actions signals with the Core of Stellarium // Connect all the GUI actions signals with the Core of Stellarium
connect(getGuiActions("actionQuit_Global"), SIGNAL(triggered()), thi s, SLOT(quit())); connect(getGuiActions("actionQuit_Global"), SIGNAL(triggered()), thi s, SLOT(quit()));
// Debug initConstellationMgr();
connect(getGuiActions("action_Reload_Style"), SIGNAL(triggered()), t initGrindLineMgr();
his, SLOT(reloadStyle())); initLandscapeMgr();
ConstellationMgr* cmgr = GETSTELMODULE(ConstellationMgr);
connect(getGuiActions("actionShow_Constellation_Lines"), SIGNAL(togg
led(bool)), cmgr, SLOT(setFlagLines(bool)));
getGuiActions("actionShow_Constellation_Lines")->setChecked(cmgr->ge
tFlagLines());
connect(getGuiActions("actionShow_Constellation_Art"), SIGNAL(toggle
d(bool)), cmgr, SLOT(setFlagArt(bool)));
getGuiActions("actionShow_Constellation_Art")->setChecked(cmgr->getF
lagArt());
connect(getGuiActions("actionShow_Constellation_Labels"), SIGNAL(tog
gled(bool)), cmgr, SLOT(setFlagLabels(bool)));
getGuiActions("actionShow_Constellation_Labels")->setChecked(cmgr->g
etFlagLabels());
connect(getGuiActions("actionShow_Constellation_Boundaries"), SIGNAL
(toggled(bool)), cmgr, SLOT(setFlagBoundaries(bool)));
getGuiActions("actionShow_Constellation_Boundaries")->setChecked(cmg
r->getFlagBoundaries());
GridLinesMgr* gmgr = GETSTELMODULE(GridLinesMgr);
connect(getGuiActions("actionShow_Equatorial_Grid"), SIGNAL(toggled(
bool)), gmgr, SLOT(setFlagEquatorGrid(bool)));
getGuiActions("actionShow_Equatorial_Grid")->setChecked(gmgr->getFla
gEquatorGrid());
connect(getGuiActions("actionShow_Azimuthal_Grid"), SIGNAL(toggled(b
ool)), gmgr, SLOT(setFlagAzimuthalGrid(bool)));
getGuiActions("actionShow_Azimuthal_Grid")->setChecked(gmgr->getFlag
AzimuthalGrid());
connect(getGuiActions("actionShow_Ecliptic_Line"), SIGNAL(toggled(bo
ol)), gmgr, SLOT(setFlagEclipticLine(bool)));
getGuiActions("actionShow_Ecliptic_Line")->setChecked(gmgr->getFlagE
clipticLine());
connect(getGuiActions("actionShow_Equator_Line"), SIGNAL(toggled(boo
l)), gmgr, SLOT(setFlagEquatorLine(bool)));
getGuiActions("actionShow_Equator_Line")->setChecked(gmgr->getFlagEq
uatorLine());
connect(getGuiActions("actionShow_Meridian_Line"), SIGNAL(toggled(bo
ol)), gmgr, SLOT(setFlagMeridianLine(bool)));
getGuiActions("actionShow_Meridian_Line")->setChecked(gmgr->getFlagM
eridianLine());
connect(getGuiActions("actionShow_Horizon_Line"), SIGNAL(toggled(boo
l)), gmgr, SLOT(setFlagHorizonLine(bool)));
getGuiActions("actionShow_Horizon_Line")->setChecked(gmgr->getFlagHo
rizonLine());
connect(getGuiActions("actionShow_Equatorial_J2000_Grid"), SIGNAL(to
ggled(bool)), gmgr, SLOT(setFlagEquatorJ2000Grid(bool)));
getGuiActions("actionShow_Equatorial_J2000_Grid")->setChecked(gmgr->
getFlagEquatorJ2000Grid());
connect(getGuiActions("actionShow_Galactic_Grid"), SIGNAL(toggled(bo
ol)), gmgr, SLOT(setFlagGalacticGrid(bool)));
getGuiActions("actionShow_Galactic_Grid")->setChecked(gmgr->getFlagG
alacticGrid());
LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr);
connect(getGuiActions("actionShow_Ground"), SIGNAL(toggled(bool)), l
mgr, SLOT(setFlagLandscape(bool)));
getGuiActions("actionShow_Ground")->setChecked(lmgr->getFlagLandscap
e());
connect(getGuiActions("actionShow_Cardinal_Points"), SIGNAL(toggled(
bool)), lmgr, SLOT(setFlagCardinalsPoints(bool)));
getGuiActions("actionShow_Cardinal_Points")->setChecked(lmgr->getFla
gCardinalsPoints());
connect(getGuiActions("actionShow_Atmosphere"), SIGNAL(toggled(bool)
), lmgr, SLOT(setFlagAtmosphere(bool)));
getGuiActions("actionShow_Atmosphere")->setChecked(lmgr->getFlagAtmo
sphere());
connect(getGuiActions("actionShow_Fog"), SIGNAL(toggled(bool)), lmgr
, SLOT(setFlagFog(bool)));
getGuiActions("actionShow_Fog")->setChecked(lmgr->getFlagFog());
NebulaMgr* nmgr = GETSTELMODULE(NebulaMgr); NebulaMgr* nmgr = GETSTELMODULE(NebulaMgr);
connect(getGuiActions("actionShow_Nebulas"), SIGNAL(toggled(bool)), nmgr, SLOT(setFlagHints(bool))); connect(getGuiActions("actionShow_Nebulas"), SIGNAL(toggled(bool)), nmgr, SLOT(setFlagHints(bool)));
getGuiActions("actionShow_Nebulas")->setChecked(nmgr->getFlagHints() ); getGuiActions("actionShow_Nebulas")->setChecked(nmgr->getFlagHints() );
StelSkyLayerMgr* imgr = GETSTELMODULE(StelSkyLayerMgr); StelSkyLayerMgr* imgr = GETSTELMODULE(StelSkyLayerMgr);
connect(getGuiActions("actionShow_DSS"), SIGNAL(toggled(bool)), imgr , SLOT(setFlagShow(bool))); connect(getGuiActions("actionShow_DSS"), SIGNAL(toggled(bool)), imgr , SLOT(setFlagShow(bool)));
getGuiActions("actionShow_DSS")->setChecked(imgr->getFlagShow()); getGuiActions("actionShow_DSS")->setChecked(imgr->getFlagShow());
StelCore* core = StelApp::getInstance().getCore(); StelCore* core = StelApp::getInstance().getCore();
skipping to change at line 297 skipping to change at line 265
connect(getGuiActions("actionShow_Help_Window_Global"), SIGNAL(toggl ed(bool)), &helpDialog, SLOT(setVisible(bool))); connect(getGuiActions("actionShow_Help_Window_Global"), SIGNAL(toggl ed(bool)), &helpDialog, SLOT(setVisible(bool)));
connect(&helpDialog, SIGNAL(visibleChanged(bool)), getGuiActions("ac tionShow_Help_Window_Global"), SLOT(setChecked(bool))); connect(&helpDialog, SIGNAL(visibleChanged(bool)), getGuiActions("ac tionShow_Help_Window_Global"), SLOT(setChecked(bool)));
connect(getGuiActions("actionShow_DateTime_Window_Global"), SIGNAL(t oggled(bool)), &dateTimeDialog, SLOT(setVisible(bool))); connect(getGuiActions("actionShow_DateTime_Window_Global"), SIGNAL(t oggled(bool)), &dateTimeDialog, SLOT(setVisible(bool)));
connect(&dateTimeDialog, SIGNAL(visibleChanged(bool)), getGuiActions ("actionShow_DateTime_Window_Global"), SLOT(setChecked(bool))); connect(&dateTimeDialog, SIGNAL(visibleChanged(bool)), getGuiActions ("actionShow_DateTime_Window_Global"), SLOT(setChecked(bool)));
connect(getGuiActions("actionShow_Search_Window_Global"), SIGNAL(tog gled(bool)), &searchDialog, SLOT(setVisible(bool))); connect(getGuiActions("actionShow_Search_Window_Global"), SIGNAL(tog gled(bool)), &searchDialog, SLOT(setVisible(bool)));
connect(&searchDialog, SIGNAL(visibleChanged(bool)), getGuiActions(" actionShow_Search_Window_Global"), SLOT(setChecked(bool))); connect(&searchDialog, SIGNAL(visibleChanged(bool)), getGuiActions(" actionShow_Search_Window_Global"), SLOT(setChecked(bool)));
connect(getGuiActions("actionSave_Screenshot_Global"), SIGNAL(trigge red()), &StelMainGraphicsView::getInstance(), SLOT(saveScreenShot())); connect(getGuiActions("actionSave_Screenshot_Global"), SIGNAL(trigge red()), &StelMainGraphicsView::getInstance(), SLOT(saveScreenShot()));
connect(getGuiActions("actionSave_Copy_Object_Information_Global"), SIGNAL(triggered()), this, SLOT(copySelectedObjectInfo()));
getGuiActions("actionToggle_GuiHidden_Global")->setChecked(true); getGuiActions("actionToggle_GuiHidden_Global")->setChecked(true);
connect(getGuiActions("actionToggle_GuiHidden_Global"), SIGNAL(toggl ed(bool)), this, SLOT(setGuiVisible(bool))); connect(getGuiActions("actionToggle_GuiHidden_Global"), SIGNAL(toggl ed(bool)), this, SLOT(setGuiVisible(bool)));
connect(getGuiActions("actionHorizontal_Flip"), SIGNAL(toggled(bool) ), StelApp::getInstance().getCore(), SLOT(setFlipHorz(bool))); connect(getGuiActions("actionHorizontal_Flip"), SIGNAL(toggled(bool) ), StelApp::getInstance().getCore(), SLOT(setFlipHorz(bool)));
getGuiActions("actionHorizontal_Flip")->setChecked(StelApp::getInsta nce().getCore()->getFlipHorz()); getGuiActions("actionHorizontal_Flip")->setChecked(StelApp::getInsta nce().getCore()->getFlipHorz());
connect(getGuiActions("actionVertical_Flip"), SIGNAL(toggled(bool)), StelApp::getInstance().getCore(), SLOT(setFlipVert(bool))); connect(getGuiActions("actionVertical_Flip"), SIGNAL(toggled(bool)), StelApp::getInstance().getCore(), SLOT(setFlipVert(bool)));
getGuiActions("actionVertical_Flip")->setChecked(StelApp::getInstanc e().getCore()->getFlipVert()); getGuiActions("actionVertical_Flip")->setChecked(StelApp::getInstanc e().getCore()->getFlipVert());
StarMgr* smgr = GETSTELMODULE(StarMgr); StarMgr* smgr = GETSTELMODULE(StarMgr);
skipping to change at line 329 skipping to change at line 298
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
Q_ASSERT(conf); Q_ASSERT(conf);
setAutoHideHorizontalButtonBar(conf->value("gui/auto_hide_horizontal _toolbar", true).toBool()); setAutoHideHorizontalButtonBar(conf->value("gui/auto_hide_horizontal _toolbar", true).toBool());
setAutoHideVerticalButtonBar(conf->value("gui/auto_hide_vertical_too lbar", true).toBool()); setAutoHideVerticalButtonBar(conf->value("gui/auto_hide_vertical_too lbar", true).toBool());
connect(getGuiActions("actionAutoHideHorizontalButtonBar"), SIGNAL(t oggled(bool)), this, SLOT(setAutoHideHorizontalButtonBar(bool))); connect(getGuiActions("actionAutoHideHorizontalButtonBar"), SIGNAL(t oggled(bool)), this, SLOT(setAutoHideHorizontalButtonBar(bool)));
getGuiActions("actionAutoHideHorizontalButtonBar")->setChecked(getAu toHideHorizontalButtonBar()); getGuiActions("actionAutoHideHorizontalButtonBar")->setChecked(getAu toHideHorizontalButtonBar());
connect(getGuiActions("actionAutoHideVerticalButtonBar"), SIGNAL(tog gled(bool)), this, SLOT(setAutoHideVerticalButtonBar(bool))); connect(getGuiActions("actionAutoHideVerticalButtonBar"), SIGNAL(tog gled(bool)), this, SLOT(setAutoHideVerticalButtonBar(bool)));
getGuiActions("actionAutoHideVerticalButtonBar")->setChecked(getAuto HideVerticalButtonBar()); getGuiActions("actionAutoHideVerticalButtonBar")->setChecked(getAuto HideVerticalButtonBar());
#ifndef DISABLE_SCRIPTING
StelScriptMgr& scriptMgr = StelMainGraphicsView::getInstance().getSc riptMgr(); StelScriptMgr& scriptMgr = StelMainGraphicsView::getInstance().getSc riptMgr();
connect(&scriptMgr, SIGNAL(scriptRunning()), this, SLOT(scriptStarte d())); connect(&scriptMgr, SIGNAL(scriptRunning()), this, SLOT(scriptStarte d()));
connect(&scriptMgr, SIGNAL(scriptStopped()), this, SLOT(scriptStoppe d())); connect(&scriptMgr, SIGNAL(scriptStopped()), this, SLOT(scriptStoppe d()));
#endif
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
//// QGraphicsView based GUI //// QGraphicsView based GUI
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Add everything // Add everything
QPixmap pxmapDefault; QPixmap pxmapDefault;
QPixmap pxmapGlow(":/graphicGui/glow.png"); QPixmap pxmapGlow(":/graphicGui/glow.png");
QPixmap pxmapOn(":/graphicGui/2-on-location.png"); QPixmap pxmapOn(":/graphicGui/2-on-location.png");
QPixmap pxmapOff(":/graphicGui/2-off-location.png"); QPixmap pxmapOff(":/graphicGui/2-off-location.png");
skipping to change at line 494 skipping to change at line 465
skyGui->setGeometry(stelAppGraphicsWidget->geometry()); skyGui->setGeometry(stelAppGraphicsWidget->geometry());
skyGui->updateBarsPos(); skyGui->updateBarsPos();
StelApp *app = &StelApp::getInstance(); StelApp *app = &StelApp::getInstance();
connect(app, SIGNAL(languageChanged()), this, SLOT(updateI18n())); connect(app, SIGNAL(languageChanged()), this, SLOT(updateI18n()));
connect(app, SIGNAL(colorSchemeChanged(const QString&)), this, SLOT( setStelStyle(const QString&))); connect(app, SIGNAL(colorSchemeChanged(const QString&)), this, SLOT( setStelStyle(const QString&)));
initDone = true; initDone = true;
} }
void StelGui::initConstellationMgr()
{
ConstellationMgr* constellationMgr = GETSTELMODULE(ConstellationMgr)
;
getGuiActions("actionShow_Constellation_Lines")->setChecked(constell
ationMgr->getFlagLines());
connect(getGuiActions("actionShow_Constellation_Lines"),
SIGNAL(toggled(bool)),
constellationMgr,
SLOT(setFlagLines(bool)));
connect(constellationMgr,
SIGNAL(linesDisplayedChanged(const bool)),
this,
SLOT(linesDisplayedUpdated(const bool)));
getGuiActions("actionShow_Constellation_Art")->setChecked(constellat
ionMgr->getFlagArt());
connect(getGuiActions("actionShow_Constellation_Art"),
SIGNAL(toggled(bool)),
constellationMgr,
SLOT(setFlagArt(bool)));
connect(constellationMgr,
SIGNAL(artDisplayedChanged(const bool)),
this,
SLOT(artDisplayedUpdated(const bool)));
getGuiActions("actionShow_Constellation_Labels")->setChecked(constel
lationMgr->getFlagLabels());
connect(getGuiActions("actionShow_Constellation_Labels"),
SIGNAL(toggled(bool)),
constellationMgr,
SLOT(setFlagLabels(bool)));
connect(constellationMgr,
SIGNAL(namesDisplayedChanged(const bool)),
this,
SLOT(namesDisplayedUpdated(const bool)));
getGuiActions("actionShow_Constellation_Boundaries")->setChecked(con
stellationMgr->getFlagBoundaries());
connect(getGuiActions("actionShow_Constellation_Boundaries"),
SIGNAL(toggled(bool)),
constellationMgr,
SLOT(setFlagBoundaries(bool)));
connect(constellationMgr,
SIGNAL(boundariesDisplayedChanged(const bool)),
this,
SLOT(boundariesDisplayedUpdated(const bool)));
}
void StelGui::initGrindLineMgr()
{
GridLinesMgr* gridLineManager = GETSTELMODULE(GridLinesMgr);
getGuiActions("actionShow_Equatorial_Grid")->setChecked(gridLineMana
ger->getFlagEquatorGrid());
connect(getGuiActions("actionShow_Equatorial_Grid"),
SIGNAL(toggled(bool)),
gridLineManager,
SLOT(setFlagEquatorGrid(bool)));
connect(gridLineManager,
SIGNAL(equatorGridDisplayedChanged(const bool)),
this,
SLOT(equatorGridDisplayedUpdated(const bool)));
getGuiActions("actionShow_Azimuthal_Grid")->setChecked(gridLineManag
er->getFlagAzimuthalGrid());
connect(getGuiActions("actionShow_Azimuthal_Grid"),
SIGNAL(toggled(bool)),
gridLineManager,
SLOT(setFlagAzimuthalGrid(bool)));
connect(gridLineManager,
SIGNAL(azimuthalGridDisplayedChanged(const bool)),
this,
SLOT(azimuthalGridDisplayedUpdated(const bool)));
getGuiActions("actionShow_Ecliptic_Line")->setChecked(gridLineManage
r->getFlagEclipticLine());
connect(getGuiActions("actionShow_Ecliptic_Line"),
SIGNAL(toggled(bool)),
gridLineManager,
SLOT(setFlagEclipticLine(bool)));
connect(gridLineManager,
SIGNAL(eclipticLineDisplayedChanged(const bool)),
this,
SLOT(eclipticLineDisplayedUpdated(const bool)));
getGuiActions("actionShow_Equator_Line")->setChecked(gridLineManager
->getFlagEquatorLine());
connect(getGuiActions("actionShow_Equator_Line"),
SIGNAL(toggled(bool)),
gridLineManager,
SLOT(setFlagEquatorLine(bool)));
connect(gridLineManager,
SIGNAL(equatorLineDisplayedChanged(const bool)),
this,
SLOT(equatorLineDisplayedUpdated(const bool)));
getGuiActions("actionShow_Meridian_Line")->setChecked(gridLineManage
r->getFlagMeridianLine());
connect(getGuiActions("actionShow_Meridian_Line"),
SIGNAL(toggled(bool)),
gridLineManager,
SLOT(setFlagMeridianLine(bool)));
connect(gridLineManager,
SIGNAL(meridianLineDisplayedChanged(const bool)),
this,
SLOT(meridianLineDisplayedUpdated(const bool)));
getGuiActions("actionShow_Horizon_Line")->setChecked(gridLineManager
->getFlagHorizonLine());
connect(getGuiActions("actionShow_Horizon_Line"),
SIGNAL(toggled(bool)),
gridLineManager,
SLOT(setFlagHorizonLine(bool)));
connect(gridLineManager,
SIGNAL(horizonLineDisplayedChanged(const bool)),
this,
SLOT(horizonLineDisplayedUpdated(const bool)));
getGuiActions("actionShow_Equatorial_J2000_Grid")->setChecked(gridLi
neManager->getFlagEquatorJ2000Grid());
connect(getGuiActions("actionShow_Equatorial_J2000_Grid"),
SIGNAL(toggled(bool)),
gridLineManager,
SLOT(setFlagEquatorJ2000Grid(bool)));
connect(gridLineManager,
SIGNAL(equatorJ2000GridDisplayedChanged(const bool))
,
this,
SLOT(equatorJ2000GridDisplayedUpdated(const bool)));
getGuiActions("actionShow_Galactic_Grid")->setChecked(gridLineManage
r->getFlagGalacticGrid());
connect(getGuiActions("actionShow_Galactic_Grid"),
SIGNAL(toggled(bool)),
gridLineManager,
SLOT(setFlagGalacticGrid(bool)));
connect(gridLineManager,
SIGNAL(galacticGridDisplayedChanged(const bool)),
this,
SLOT(galacticGridDisplayedUpdated(const bool)));
getGuiActions("actionShow_Galactic_Plane_Line")->setChecked(gridLine
Manager->getFlagGalacticPlaneLine());
connect(getGuiActions("actionShow_Galactic_Plane_Line"),
SIGNAL(toggled(bool)),
gridLineManager,
SLOT(setFlagGalacticPlaneLine(bool)));
connect(gridLineManager,
SIGNAL(galacticPlaneLineDisplayedChanged(const bool)
),
this,
SLOT(galacticPlaneLineDisplayedUpdated(const bool)))
;
}
void StelGui::initLandscapeMgr()
{
LandscapeMgr* landscapeMgr = GETSTELMODULE(LandscapeMgr);
getGuiActions("actionShow_Ground")->setChecked(landscapeMgr->getFlag
Landscape());
connect(getGuiActions("actionShow_Ground"),
SIGNAL(toggled(bool)),
landscapeMgr,
SLOT(setFlagLandscape(bool)));
connect(landscapeMgr,
SIGNAL(landscapeDisplayedChanged(const bool)),
this,
SLOT(landscapeDisplayedUpdated(const bool)));
getGuiActions("actionShow_Cardinal_Points")->setChecked(landscapeMgr
->getFlagCardinalsPoints());
connect(getGuiActions("actionShow_Cardinal_Points"),
SIGNAL(toggled(bool)),
landscapeMgr,
SLOT(setFlagCardinalsPoints(bool)));
connect(landscapeMgr,
SIGNAL(cardinalsPointsDisplayedChanged(const bool)),
this,
SLOT(cardinalsPointsDisplayedUpdated(const bool)));
getGuiActions("actionShow_Atmosphere")->setChecked(landscapeMgr->get
FlagAtmosphere());
connect(getGuiActions("actionShow_Atmosphere"),
SIGNAL(toggled(bool)),
landscapeMgr,
SLOT(setFlagAtmosphere(bool)));
connect(landscapeMgr,
SIGNAL(atmosphereDisplayedChanged(const bool)),
this,
SLOT(atmosphereDisplayedUpdated(const bool)));
getGuiActions("actionShow_Fog")->setChecked(landscapeMgr->getFlagFog
());
connect(getGuiActions("actionShow_Fog"),
SIGNAL(toggled(bool)),
landscapeMgr,
SLOT(setFlagFog(bool)));
connect(landscapeMgr,
SIGNAL(fogDisplayedChanged(const bool)),
this,
SLOT(fogDisplayedUpdated(const bool)));
}
void StelGui::quit() void StelGui::quit()
{ {
#ifndef DISABLE_SCRIPTING
StelMainGraphicsView::getInstance().getScriptMgr().stopScript(); StelMainGraphicsView::getInstance().getScriptMgr().stopScript();
#endif
QCoreApplication::exit(); QCoreApplication::exit();
} }
//! Reload the current Qt Style Sheet (Debug only) //! Reload the current Qt Style Sheet (Debug only)
void StelGui::reloadStyle() void StelGui::reloadStyle()
{ {
setStelStyle(StelApp::getInstance().getCurrentStelStyle()); setStelStyle(StelApp::getInstance().getCurrentStelStyle());
} }
//! Load color scheme from the given ini file and section name //! Load color scheme from the given ini file and section name
skipping to change at line 557 skipping to change at line 713
} }
void StelGui::updateI18n() void StelGui::updateI18n()
{ {
StelGuiBase::updateI18n(); StelGuiBase::updateI18n();
} }
void StelGui::update() void StelGui::update()
{ {
StelCore* core = StelApp::getInstance().getCore(); StelCore* core = StelApp::getInstance().getCore();
if (core->getTimeRate()<-0.99*StelCore::JD_SECOND) if (core->getTimeRate()<-0.99*StelCore::JD_SECOND) {
{
if (buttonTimeRewind->isChecked()==false) if (buttonTimeRewind->isChecked()==false)
buttonTimeRewind->setChecked(true); buttonTimeRewind->setChecked(true);
} } else {
else
{
if (buttonTimeRewind->isChecked()==true) if (buttonTimeRewind->isChecked()==true)
buttonTimeRewind->setChecked(false); buttonTimeRewind->setChecked(false);
} }
if (core->getTimeRate()>1.01*StelCore::JD_SECOND) if (core->getTimeRate()>1.01*StelCore::JD_SECOND) {
{ if (buttonTimeForward->isChecked()==false) {
if (buttonTimeForward->isChecked()==false)
buttonTimeForward->setChecked(true); buttonTimeForward->setChecked(true);
} }
else } else {
{
if (buttonTimeForward->isChecked()==true) if (buttonTimeForward->isChecked()==true)
buttonTimeForward->setChecked(false); buttonTimeForward->setChecked(false);
} }
if (core->getTimeRate() == 0) { if (core->getTimeRate() == 0) {
if (buttonTimeRealTimeSpeed->isChecked() != StelButton::Butt onStateNoChange) if (buttonTimeRealTimeSpeed->isChecked() != StelButton::Butt onStateNoChange)
buttonTimeRealTimeSpeed->setChecked(StelButton::Butt onStateNoChange); buttonTimeRealTimeSpeed->setChecked(StelButton::Butt onStateNoChange);
} else if (core->getRealTimeSpeed()) { } else if (core->getRealTimeSpeed()) {
if (buttonTimeRealTimeSpeed->isChecked() != StelButton::Butt onStateOn) if (buttonTimeRealTimeSpeed->isChecked() != StelButton::Butt onStateOn)
buttonTimeRealTimeSpeed->setChecked(StelButton::Butt onStateOn); buttonTimeRealTimeSpeed->setChecked(StelButton::Butt onStateOn);
} else if (buttonTimeRealTimeSpeed->isChecked() != StelButton::Butto nStateOff) { } else if (buttonTimeRealTimeSpeed->isChecked() != StelButton::Butto nStateOff) {
buttonTimeRealTimeSpeed->setChecked(StelButton::ButtonStateO ff); buttonTimeRealTimeSpeed->setChecked(StelButton::ButtonStateO ff);
} }
const bool isTimeNow=core->getIsTimeNow(); const bool isTimeNow=core->getIsTimeNow();
if (buttonTimeCurrent->isChecked()!=isTimeNow) if (buttonTimeCurrent->isChecked()!=isTimeNow) {
buttonTimeCurrent->setChecked(isTimeNow); buttonTimeCurrent->setChecked(isTimeNow);
}
StelMovementMgr* mmgr = GETSTELMODULE(StelMovementMgr); StelMovementMgr* mmgr = GETSTELMODULE(StelMovementMgr);
const bool b = mmgr->getFlagTracking(); const bool b = mmgr->getFlagTracking();
if (buttonGotoSelectedObject->isChecked()!=b) if (buttonGotoSelectedObject->isChecked()!=b) {
buttonGotoSelectedObject->setChecked(b); buttonGotoSelectedObject->setChecked(b);
}
bool flag = GETSTELMODULE(StarMgr)->getFlagStars(); bool flag = GETSTELMODULE(StarMgr)->getFlagStars();
if (getGuiActions("actionShow_Stars")->isChecked() != flag) if (getGuiActions("actionShow_Stars")->isChecked() != flag) {
getGuiActions("actionShow_Stars")->setChecked(flag); getGuiActions("actionShow_Stars")->setChecked(flag);
ConstellationMgr* cmgr = GETSTELMODULE(ConstellationMgr); }
flag = cmgr->getFlagLines();
if (getGuiActions("actionShow_Constellation_Lines")->isChecked() !=
flag)
getGuiActions("actionShow_Constellation_Lines")->setChecked(
flag);
flag = cmgr->getFlagArt();
if (getGuiActions("actionShow_Constellation_Art")->isChecked() != fl
ag)
getGuiActions("actionShow_Constellation_Art")->setChecked(fl
ag);
flag = cmgr->getFlagLabels();
if (getGuiActions("actionShow_Constellation_Labels")->isChecked() !=
flag)
getGuiActions("actionShow_Constellation_Labels")->setChecked
(flag);
flag = cmgr->getFlagBoundaries();
if (getGuiActions("actionShow_Constellation_Boundaries")->isChecked(
) != flag)
getGuiActions("actionShow_Constellation_Boundaries")->setChe
cked(flag);
GridLinesMgr* gmgr = GETSTELMODULE(GridLinesMgr);
flag = gmgr->getFlagEquatorGrid();
if (getGuiActions("actionShow_Equatorial_Grid")->isChecked() != flag
)
getGuiActions("actionShow_Equatorial_Grid")->setChecked(flag
);
flag = gmgr->getFlagAzimuthalGrid();
if (getGuiActions("actionShow_Azimuthal_Grid")->isChecked() != flag)
getGuiActions("actionShow_Azimuthal_Grid")->setChecked(flag)
;
flag = gmgr->getFlagEclipticLine();
if (getGuiActions("actionShow_Ecliptic_Line")->isChecked() != flag)
getGuiActions("actionShow_Ecliptic_Line")->setChecked(flag);
flag = gmgr->getFlagEquatorLine();
if (getGuiActions("actionShow_Equator_Line")->isChecked() != flag)
getGuiActions("actionShow_Equator_Line")->setChecked(flag);
flag = gmgr->getFlagMeridianLine();
if (getGuiActions("actionShow_Meridian_Line")->isChecked() != flag)
getGuiActions("actionShow_Meridian_Line")->setChecked(flag);
flag = gmgr->getFlagHorizonLine();
if (getGuiActions("actionShow_Horizon_Line")->isChecked() != flag)
getGuiActions("actionShow_Horizon_Line")->setChecked(flag);
flag = gmgr->getFlagEquatorJ2000Grid();
if (getGuiActions("actionShow_Equatorial_J2000_Grid")->isChecked() !
= flag)
getGuiActions("actionShow_Equatorial_J2000_Grid")->setChecke
d(flag);
flag = gmgr->getFlagGalacticGrid();
if (getGuiActions("actionShow_Galactic_Grid")->isChecked() != flag)
getGuiActions("actionShow_Galactic_Grid")->setChecked(flag);
LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr);
flag = lmgr->getFlagLandscape();
if (getGuiActions("actionShow_Ground")->isChecked() != flag)
getGuiActions("actionShow_Ground")->setChecked(flag);
flag = lmgr->getFlagCardinalsPoints();
if (getGuiActions("actionShow_Cardinal_Points")->isChecked() != flag
)
getGuiActions("actionShow_Cardinal_Points")->setChecked(flag
);
flag = lmgr->getFlagAtmosphere();
if (getGuiActions("actionShow_Atmosphere")->isChecked() != flag)
getGuiActions("actionShow_Atmosphere")->setChecked(flag);
flag = lmgr->getFlagFog();
if (getGuiActions("actionShow_Fog")->isChecked() != flag)
getGuiActions("actionShow_Fog")->setChecked(flag);
flag = GETSTELMODULE(NebulaMgr)->getFlagHints(); flag = GETSTELMODULE(NebulaMgr)->getFlagHints();
if (getGuiActions("actionShow_Nebulas")->isChecked() != flag) if (getGuiActions("actionShow_Nebulas")->isChecked() != flag)
getGuiActions("actionShow_Nebulas")->setChecked(flag); getGuiActions("actionShow_Nebulas")->setChecked(flag);
flag = GETSTELMODULE(StelSkyLayerMgr)->getFlagShow(); flag = GETSTELMODULE(StelSkyLayerMgr)->getFlagShow();
if (getGuiActions("actionShow_DSS")->isChecked() != flag) if (getGuiActions("actionShow_DSS")->isChecked() != flag)
getGuiActions("actionShow_DSS")->setChecked(flag); getGuiActions("actionShow_DSS")->setChecked(flag);
flag = mmgr->getMountMode() != StelMovementMgr::MountAltAzimuthal; flag = mmgr->getMountMode() != StelMovementMgr::MountAltAzimuthal;
if (getGuiActions("actionSwitch_Equatorial_Mount")->isChecked() != f lag) if (getGuiActions("actionSwitch_Equatorial_Mount")->isChecked() != f lag)
getGuiActions("actionSwitch_Equatorial_Mount")->setChecked(f lag); getGuiActions("actionSwitch_Equatorial_Mount")->setChecked(f lag);
SolarSystem* ssmgr = GETSTELMODULE(SolarSystem); SolarSystem* ssmgr = GETSTELMODULE(SolarSystem);
flag = ssmgr->getFlagLabels(); flag = ssmgr->getFlagLabels();
if (getGuiActions("actionShow_Planets_Labels")->isChecked() != flag) if (getGuiActions("actionShow_Planets_Labels")->isChecked() != flag)
getGuiActions("actionShow_Planets_Labels")->setChecked(flag) ; getGuiActions("actionShow_Planets_Labels")->setChecked(flag) ;
flag = ssmgr->getFlagOrbits(); flag = ssmgr->getFlagOrbits();
if (getGuiActions("actionShow_Planets_Orbits")->isChecked() != flag) if (getGuiActions("actionShow_Planets_Orbits")->isChecked() != flag)
getGuiActions("actionShow_Planets_Orbits")->setChecked(flag) ; getGuiActions("actionShow_Planets_Orbits")->setChecked(flag) ;
flag = ssmgr->getFlagTrails(); flag = ssmgr->getFlagTrails();
if (getGuiActions("actionShow_Planets_Trails")->isChecked() != flag) if (getGuiActions("actionShow_Planets_Trails")->isChecked() != flag)
getGuiActions("actionShow_Planets_Trails")->setChecked(flag) ; getGuiActions("actionShow_Planets_Trails")->setChecked(flag) ;
skipping to change at line 683 skipping to change at line 790
skyGui->infoPanel->setTextFromObjects(GETSTELMODULE(StelObjectMgr)-> getSelectedObject()); skyGui->infoPanel->setTextFromObjects(GETSTELMODULE(StelObjectMgr)-> getSelectedObject());
// Check if the progressbar window changed, if yes update the whole view // Check if the progressbar window changed, if yes update the whole view
if (savedProgressBarSize!=skyGui->progressBarMgr->boundingRect().siz e()) if (savedProgressBarSize!=skyGui->progressBarMgr->boundingRect().siz e())
{ {
savedProgressBarSize=skyGui->progressBarMgr->boundingRect(). size(); savedProgressBarSize=skyGui->progressBarMgr->boundingRect(). size();
skyGui->updateBarsPos(); skyGui->updateBarsPos();
} }
if (dateTimeDialog.visible()) dateTimeDialog.setDateTime(core->getJDay());
dateTimeDialog.setDateTime(core->getJDay());
} }
// Add a new progress bar in the lower right corner of the screen. // Add a new progress bar in the lower right corner of the screen.
QProgressBar* StelGui::addProgressBar() QProgressBar* StelGui::addProgressBar()
{ {
return skyGui->progressBarMgr->addProgressBar(); return skyGui->progressBarMgr->addProgressBar();
} }
#ifndef DISABLE_SCRIPTING
void StelGui::setScriptKeys(bool b) void StelGui::setScriptKeys(bool b)
{ {
if (b) if (b)
{ {
getGuiActions("actionDecrease_Time_Speed")->setShortcut(QKey Sequence()); getGuiActions("actionDecrease_Time_Speed")->setShortcut(QKey Sequence());
getGuiActions("actionIncrease_Time_Speed")->setShortcut(QKey Sequence()); getGuiActions("actionIncrease_Time_Speed")->setShortcut(QKey Sequence());
getGuiActions("actionSet_Real_Time_Speed")->setShortcut(QKey Sequence()); getGuiActions("actionSet_Real_Time_Speed")->setShortcut(QKey Sequence());
getGuiActions("actionDecrease_Script_Speed")->setShortcut(QK eySequence("J")); getGuiActions("actionDecrease_Script_Speed")->setShortcut(QK eySequence("J"));
getGuiActions("actionIncrease_Script_Speed")->setShortcut(QK eySequence("L")); getGuiActions("actionIncrease_Script_Speed")->setShortcut(QK eySequence("L"));
getGuiActions("actionSet_Real_Script_Speed")->setShortcut(QK eySequence("K")); getGuiActions("actionSet_Real_Script_Speed")->setShortcut(QK eySequence("K"));
skipping to change at line 729 skipping to change at line 836
void StelGui::decreaseScriptSpeed() void StelGui::decreaseScriptSpeed()
{ {
StelMainGraphicsView::getInstance().getScriptMgr().setScriptRate(Ste lMainGraphicsView::getInstance().getScriptMgr().getScriptRate()/2); StelMainGraphicsView::getInstance().getScriptMgr().setScriptRate(Ste lMainGraphicsView::getInstance().getScriptMgr().getScriptRate()/2);
} }
void StelGui::setRealScriptSpeed() void StelGui::setRealScriptSpeed()
{ {
StelMainGraphicsView::getInstance().getScriptMgr().setScriptRate(1); StelMainGraphicsView::getInstance().getScriptMgr().setScriptRate(1);
} }
#endif
void StelGui::setFlagShowFlipButtons(bool b) void StelGui::setFlagShowFlipButtons(bool b)
{ {
if (b==true) if (b==true) {
{ if (flipVert==NULL) {
if (flipVert==NULL)
{
// Create the vertical flip button // Create the vertical flip button
QPixmap pxmapGlow32x32(":/graphicGui/glow32x32.png") ; QPixmap pxmapGlow32x32(":/graphicGui/glow32x32.png") ;
flipVert = new StelButton(NULL, flipVert = new StelButton(NULL,
QP ixmap(":/graphicGui/btFlipVertical-on.png"), QP ixmap(":/graphicGui/btFlipVertical-on.png"),
QP ixmap(":/graphicGui/btFlipVertical-off.png"), QP ixmap(":/graphicGui/btFlipVertical-off.png"),
px mapGlow32x32, px mapGlow32x32,
ge tGuiActions("actionVertical_Flip")); ge tGuiActions("actionVertical_Flip"));
} }
if (flipHoriz==NULL) if (flipHoriz==NULL) {
{
QPixmap pxmapGlow32x32(":/graphicGui/glow32x32.png") ; QPixmap pxmapGlow32x32(":/graphicGui/glow32x32.png") ;
flipHoriz = new StelButton(NULL, flipHoriz = new StelButton(NULL,
Q Pixmap(":/graphicGui/btFlipHorizontal-on.png"), Q Pixmap(":/graphicGui/btFlipHorizontal-on.png"),
Q Pixmap(":/graphicGui/btFlipHorizontal-off.png"), Q Pixmap(":/graphicGui/btFlipHorizontal-off.png"),
p xmapGlow32x32, p xmapGlow32x32,
g etGuiActions("actionHorizontal_Flip")); g etGuiActions("actionHorizontal_Flip"));
} }
getButtonBar()->addButton(flipVert, "060-othersGroup", "acti onQuit_Global"); getButtonBar()->addButton(flipVert, "060-othersGroup", "acti onQuit_Global");
getButtonBar()->addButton(flipHoriz, "060-othersGroup", "act ionVertical_Flip"); getButtonBar()->addButton(flipHoriz, "060-othersGroup", "act ionVertical_Flip");
} } else {
else getButtonBar()->hideButton("actionVertical_Flip");
{ getButtonBar()->hideButton("actionHorizontal_Flip");
bool b = getButtonBar()->hideButton("actionVertical_Flip")==
flipVert;
Q_ASSERT(b);
b = getButtonBar()->hideButton("actionHorizontal_Flip")==fli
pHoriz;
Q_ASSERT(b);
} }
flagShowFlipButtons = b; flagShowFlipButtons = b;
if (initDone) if (initDone) {
{
skyGui->updateBarsPos(); skyGui->updateBarsPos();
} }
} }
// Define whether the button toggling nebulae backround images should be vi sible // Define whether the button toggling nebulae backround images should be vi sible
void StelGui::setFlagShowNebulaBackgroundButton(bool b) void StelGui::setFlagShowNebulaBackgroundButton(bool b)
{ {
if (b==true) if (b==true) {
{ if (btShowNebulaeBackground==NULL) {
if (btShowNebulaeBackground==NULL)
{
// Create the nebulae background button // Create the nebulae background button
QPixmap pxmapGlow32x32(":/graphicGui/glow32x32.png") ; QPixmap pxmapGlow32x32(":/graphicGui/glow32x32.png") ;
btShowNebulaeBackground = new StelButton(NULL, QPixm ap(":/graphicGui/btDSS-on.png"), QPixmap(":/graphicGui/btDSS-off.png"), pxm apGlow32x32, getGuiActions("actionShow_DSS")); btShowNebulaeBackground = new StelButton(NULL, QPixm ap(":/graphicGui/btDSS-on.png"), QPixmap(":/graphicGui/btDSS-off.png"), pxm apGlow32x32, getGuiActions("actionShow_DSS"));
} }
getButtonBar()->addButton(btShowNebulaeBackground, "040-nebu laeGroup"); getButtonBar()->addButton(btShowNebulaeBackground, "040-nebu laeGroup");
} } else {
else getButtonBar()->hideButton("actionShow_DSS");
{
bool bb;
bb = (getButtonBar()->hideButton("actionShow_DSS")==btShowNe
bulaeBackground);
Q_ASSERT(bb);
} }
flagShowNebulaBackgroundButton = b; flagShowNebulaBackgroundButton = b;
} }
void StelGui::setVisible(bool b) void StelGui::setVisible(bool b)
{ {
skyGui->setVisible(b); skyGui->setVisible(b);
} }
bool StelGui::getVisible() const bool StelGui::getVisible() const
skipping to change at line 825 skipping to change at line 919
void StelGui::setInfoTextFilters(const StelObject::InfoStringGroup& aflags) void StelGui::setInfoTextFilters(const StelObject::InfoStringGroup& aflags)
{ {
skyGui->infoPanel->setInfoTextFilters(aflags); skyGui->infoPanel->setInfoTextFilters(aflags);
} }
const StelObject::InfoStringGroup& StelGui::getInfoTextFilters() const const StelObject::InfoStringGroup& StelGui::getInfoTextFilters() const
{ {
return skyGui->infoPanel->getInfoTextFilters(); return skyGui->infoPanel->getInfoTextFilters();
} }
BottomStelBar* StelGui::getButtonBar() {return skyGui->buttonBar;} BottomStelBar* StelGui::getButtonBar() const
{
return skyGui->buttonBar;
}
LeftStelBar* StelGui::getWindowsButtonBar() {return skyGui->winBar;} LeftStelBar* StelGui::getWindowsButtonBar() const
{
return skyGui->winBar;
}
bool StelGui::getAutoHideHorizontalButtonBar() const {return skyGui->autoHi SkyGui* StelGui::getSkyGui() const
deHorizontalButtonBar;} {
return skyGui;
}
void StelGui::setAutoHideHorizontalButtonBar(bool b) {skyGui->autoHideHoriz bool StelGui::getAutoHideHorizontalButtonBar() const
ontalButtonBar=b;} {
return skyGui->autoHideHorizontalButtonBar;
}
void StelGui::setAutoHideHorizontalButtonBar(bool b)
{
skyGui->autoHideHorizontalButtonBar=b;
}
bool StelGui::getAutoHideVerticalButtonBar() const {return skyGui->autoHide bool StelGui::getAutoHideVerticalButtonBar() const
VerticalButtonBar;} {
return skyGui->autoHideVerticalButtonBar;
}
void StelGui::setAutoHideVerticalButtonBar(bool b) {skyGui->autoHideVertica void StelGui::setAutoHideVerticalButtonBar(bool b)
lButtonBar=b;} {
skyGui->autoHideVerticalButtonBar=b;
}
bool StelGui::getFlagShowFlipButtons() const
{
return flagShowFlipButtons;
}
bool StelGui::getFlagShowNebulaBackgroundButton() const
{
return flagShowNebulaBackgroundButton;
}
bool StelGui::initComplete(void) const
{
return initDone;
}
void StelGui::forceRefreshGui() void StelGui::forceRefreshGui()
{ {
skyGui->updateBarsPos(); skyGui->updateBarsPos();
} }
#ifndef DISABLE_SCRIPTING
void StelGui::scriptStarted() void StelGui::scriptStarted()
{ {
setScriptKeys(true); setScriptKeys(true);
} }
void StelGui::scriptStopped() void StelGui::scriptStopped()
{ {
setScriptKeys(false); setScriptKeys(false);
} }
#endif
void StelGui::setGuiVisible(bool b) void StelGui::setGuiVisible(bool b)
{ {
setVisible(b); setVisible(b);
} }
QAction* StelGui::addGuiActions(const QString& actionName, const QString& t ext, const QString& shortCut, const QString& helpGroup, bool checkable, boo l autoRepeat) QAction* StelGui::addGuiActions(const QString& actionName, const QString& t ext, const QString& shortCut, const QString& helpGroup, bool checkable, boo l autoRepeat)
{ {
if (!shortCut.isEmpty()) if (!shortCut.isEmpty())
helpDialog.setKey(helpGroup, "", shortCut, text); helpDialog.setKey(helpGroup, "", shortCut, text);
return StelGuiBase::addGuiActions(actionName, text, shortCut, helpGr oup, checkable, autoRepeat); return StelGuiBase::addGuiActions(actionName, text, shortCut, helpGr oup, checkable, autoRepeat);
} }
/* ************************************************************************
****************************************** */
#if 0
#pragma mark -
#pragma mark Process changes from the ConstellationMgr
#endif
/* ************************************************************************
****************************************** */
void StelGui::artDisplayedUpdated(const bool displayed)
{
if (getGuiActions("actionShow_Constellation_Art")->isChecked() != di
splayed) {
getGuiActions("actionShow_Constellation_Art")->setChecked(di
splayed);
}
}
void StelGui::boundariesDisplayedUpdated(const bool displayed)
{
if (getGuiActions("actionShow_Constellation_Boundaries")->isChecked(
) != displayed) {
getGuiActions("actionShow_Constellation_Boundaries")->setChe
cked(displayed);
}
}
void StelGui::linesDisplayedUpdated(const bool displayed)
{
if (getGuiActions("actionShow_Constellation_Lines")->isChecked() !=
displayed) {
getGuiActions("actionShow_Constellation_Lines")->setChecked(
displayed);
}
}
void StelGui::namesDisplayedUpdated(const bool displayed)
{
if (getGuiActions("actionShow_Constellation_Labels")->isChecked() !=
displayed) {
getGuiActions("actionShow_Constellation_Labels")->setChecked
(displayed);
}
}
/* ************************************************************************
****************************************** */
#if 0
#pragma mark -
#pragma mark Process changes from the GridLinesMgr
#endif
/* ************************************************************************
****************************************** */
void StelGui::azimuthalGridDisplayedUpdated(const bool displayed)
{
if (getGuiActions("actionShow_Azimuthal_Grid")->isChecked() != displ
ayed) {
getGuiActions("actionShow_Azimuthal_Grid")->setChecked(displ
ayed);
}
}
void StelGui::equatorGridDisplayedUpdated(const bool displayed)
{
if (getGuiActions("actionShow_Equatorial_Grid")->isChecked() != disp
layed) {
getGuiActions("actionShow_Equatorial_Grid")->setChecked(disp
layed);
}
}
void StelGui::equatorJ2000GridDisplayedUpdated(const bool displayed)
{
if (getGuiActions("actionShow_Equatorial_J2000_Grid")->isChecked() !
= displayed) {
getGuiActions("actionShow_Equatorial_J2000_Grid")->setChecke
d(displayed);
}
}
void StelGui::galacticGridDisplayedUpdated(const bool displayed)
{
if (getGuiActions("actionShow_Galactic_Grid")->isChecked() != displa
yed) {
getGuiActions("actionShow_Galactic_Grid")->setChecked(displa
yed);
}
}
void StelGui::equatorLineDisplayedUpdated(const bool displayed)
{
if (getGuiActions("actionShow_Equator_Line")->isChecked() != display
ed) {
getGuiActions("actionShow_Equator_Line")->setChecked(display
ed);
}
}
void StelGui::eclipticLineDisplayedUpdated(const bool displayed)
{
if (getGuiActions("actionShow_Ecliptic_Line")->isChecked() != displa
yed) {
getGuiActions("actionShow_Ecliptic_Line")->setChecked(displa
yed);
}
}
void StelGui::meridianLineDisplayedUpdated(const bool displayed)
{
if (getGuiActions("actionShow_Meridian_Line")->isChecked() != displa
yed) {
getGuiActions("actionShow_Meridian_Line")->setChecked(displa
yed);
}
}
void StelGui::horizonLineDisplayedUpdated(const bool displayed)
{
if (getGuiActions("actionShow_Horizon_Line")->isChecked() != display
ed) {
getGuiActions("actionShow_Horizon_Line")->setChecked(display
ed);
}
}
void StelGui::galacticPlaneLineDisplayedUpdated(const bool displayed)
{
if (getGuiActions("actionShow_Galactic_Plane_Line")->isChecked() !=
displayed) {
getGuiActions("actionShow_Galactic_Plane_Line")->setChecked(
displayed);
}
}
/* ************************************************************************
****************************************** */
#if 0
#pragma mark -
#pragma mark Process changes from the GridLinesMgr
#endif
/* ************************************************************************
****************************************** */
void StelGui::atmosphereDisplayedUpdated(const bool displayed)
{
if (getGuiActions("actionShow_Atmosphere")->isChecked() != displayed
) {
getGuiActions("actionShow_Atmosphere")->setChecked(displayed
);
}
}
void StelGui::cardinalsPointsDisplayedUpdated(const bool displayed)
{
if (getGuiActions("actionShow_Cardinal_Points")->isChecked() != disp
layed) {
getGuiActions("actionShow_Cardinal_Points")->setChecked(disp
layed);
}
}
void StelGui::fogDisplayedUpdated(const bool displayed)
{
if (getGuiActions("actionShow_Fog")->isChecked() != displayed) {
getGuiActions("actionShow_Fog")->setChecked(displayed);
}
}
void StelGui::landscapeDisplayedUpdated(const bool displayed)
{
if (getGuiActions("actionShow_Ground")->isChecked() != displayed) {
getGuiActions("actionShow_Ground")->setChecked(displayed);
}
}
void StelGui::copySelectedObjectInfo(void)
{
QApplication::clipboard()->setText(skyGui->infoPanel->getSelectedTex
t());
}
 End of changes. 46 change blocks. 
195 lines changed or deleted 296 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/