StelGui.cpp   StelGui.cpp 
skipping to change at line 33 skipping to change at line 33
#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"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelMainGraphicsView.hpp" #include "StelMainGraphicsView.hpp"
#include "StelMainWindow.hpp" #include "StelMainWindow.hpp"
#include "StelObjectMgr.hpp" #include "StelObjectMgr.hpp"
#include "LandscapeMgr.hpp" #include "LandscapeMgr.hpp"
#include "TelescopeMgr.hpp"
#include "StarMgr.hpp" #include "StarMgr.hpp"
#include "ConstellationMgr.hpp" #include "ConstellationMgr.hpp"
#include "GridLinesMgr.hpp" #include "GridLinesMgr.hpp"
#include "NebulaMgr.hpp" #include "NebulaMgr.hpp"
#include "StelLocaleMgr.hpp" #include "StelLocaleMgr.hpp"
#include "StelNavigator.hpp" #include "StelNavigator.hpp"
#include "StelObjectType.hpp" #include "StelObjectType.hpp"
#include "StelObject.hpp" #include "StelObject.hpp"
#include "StelProjector.hpp" #include "StelProjector.hpp"
#include "SolarSystem.hpp" #include "SolarSystem.hpp"
skipping to change at line 67 skipping to change at line 66
#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>
StelGuiBase* StelStandardGuiPluginInterface::getStelGuiBase() const StelGuiBase* StelStandardGuiPluginInterface::getStelGuiBase() const
{ {
// Allow to load the resources when used as a static plugin
Q_INIT_RESOURCE(guiRes);
return new StelGui(); return new StelGui();
} }
Q_EXPORT_PLUGIN2(StelGui, StelStandardGuiPluginInterface) Q_EXPORT_PLUGIN2(StelGui, StelStandardGuiPluginInterface)
StelGui::StelGui() : topLevelGraphicsWidget(NULL), configurationDialog(NULL ), initDone(false) StelGui::StelGui() : topLevelGraphicsWidget(NULL), configurationDialog(NULL ), initDone(false)
{ {
// QPixmapCache::setCacheLimit(30000); ? // QPixmapCache::setCacheLimit(30000); ?
flipHoriz = NULL; flipHoriz = NULL;
flipVert = NULL; flipVert = NULL;
btShowNebulaeBackground = NULL; btShowNebulaeBackground = NULL;
} }
StelGui::~StelGui() StelGui::~StelGui()
{ {
delete skyGui;
skyGui = NULL;
} }
void StelGui::init(QGraphicsWidget* atopLevelGraphicsWidget, StelAppGraphic sWidget* astelAppGraphicsWidget) void StelGui::init(QGraphicsWidget* atopLevelGraphicsWidget, StelAppGraphic sWidget* astelAppGraphicsWidget)
{ {
qDebug() << "Creating GUI ..."; qDebug() << "Creating GUI ...";
StelGuiBase::init(atopLevelGraphicsWidget, astelAppGraphicsWidget); StelGuiBase::init(atopLevelGraphicsWidget, astelAppGraphicsWidget);
skyGui = new SkyGui(); skyGui = new SkyGui(atopLevelGraphicsWidget);
configurationDialog = new ConfigurationDialog(this); configurationDialog = new ConfigurationDialog(this);
//////////////////////////////////////////////////////////////////// /// //////////////////////////////////////////////////////////////////// ///
// Create all the main actions of the program, associated with short cuts // Create all the main actions of the program, associated with short cuts
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);
skipping to change at line 118 skipping to change at line 122
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_("Planets 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_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);
addGuiActions("actionShow_Configuration_Window_Global", N_("Configur ation window"), "F2", group, true, false); addGuiActions("actionShow_Configuration_Window_Global", N_("Configur ation window"), "F2", group, true, false);
addGuiActions("actionShow_Search_Window_Global", N_("Search window") , "F3, Ctrl+F", group, true, false); addGuiActions("actionShow_Search_Window_Global", N_("Search window") , "F3, Ctrl+F", group, true, false);
skipping to change at line 164 skipping to change at line 169
addGuiActions("actionAdd_Sidereal_Week", N_("Add 1 sidereal week"), "Alt+]", group, false, true); addGuiActions("actionAdd_Sidereal_Week", N_("Add 1 sidereal week"), "Alt+]", group, false, true);
addGuiActions("actionSubtract_Sidereal_Week", N_("Subtract 1 siderea l week"), "Alt+[", group, false, true); addGuiActions("actionSubtract_Sidereal_Week", N_("Subtract 1 siderea l week"), "Alt+[", group, false, true);
group = N_("Movement and Selection"); group = N_("Movement and Selection");
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_("Telescope Control");
addGuiActions("actionMove_Telescope_To_Selection_0", N_("Move telesc
ope #0 to selected object"), "Ctrl+0", group, false, false);
addGuiActions("actionMove_Telescope_To_Selection_1", N_("Move telesc
ope #1 to selected object"), "Ctrl+1", group, false, false);
addGuiActions("actionMove_Telescope_To_Selection_2", N_("Move telesc
ope #2 to selected object"), "Ctrl+2", group, false, false);
addGuiActions("actionMove_Telescope_To_Selection_3", N_("Move telesc
ope #3 to selected object"), "Ctrl+3", group, false, false);
addGuiActions("actionMove_Telescope_To_Selection_4", N_("Move telesc
ope #4 to selected object"), "Ctrl+4", group, false, false);
addGuiActions("actionMove_Telescope_To_Selection_5", N_("Move telesc
ope #5 to selected object"), "Ctrl+5", group, false, false);
addGuiActions("actionMove_Telescope_To_Selection_6", N_("Move telesc
ope #6 to selected object"), "Ctrl+6", group, false, false);
addGuiActions("actionMove_Telescope_To_Selection_7", N_("Move telesc
ope #7 to selected object"), "Ctrl+7", group, false, false);
addGuiActions("actionMove_Telescope_To_Selection_8", N_("Move telesc
ope #8 to selected object"), "Ctrl+8", group, false, false);
addGuiActions("actionMove_Telescope_To_Selection_9", N_("Move telesc
ope #9 to selected object"), "Ctrl+9", 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("action_Reload_Style", "Reload style", "Ctrl+R", "Debu g", 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()), qAp p, SLOT(quit())); connect(getGuiActions("actionQuit_Global"), SIGNAL(triggered()), thi s, SLOT(quit()));
// Debug // Debug
connect(getGuiActions("action_Reload_Style"), SIGNAL(triggered()), t his, SLOT(reloadStyle())); connect(getGuiActions("action_Reload_Style"), SIGNAL(triggered()), t his, SLOT(reloadStyle()));
ConstellationMgr* cmgr = GETSTELMODULE(ConstellationMgr); ConstellationMgr* cmgr = GETSTELMODULE(ConstellationMgr);
connect(getGuiActions("actionShow_Constellation_Lines"), SIGNAL(togg led(bool)), cmgr, SLOT(setFlagLines(bool))); connect(getGuiActions("actionShow_Constellation_Lines"), SIGNAL(togg led(bool)), cmgr, SLOT(setFlagLines(bool)));
getGuiActions("actionShow_Constellation_Lines")->setChecked(cmgr->ge tFlagLines()); getGuiActions("actionShow_Constellation_Lines")->setChecked(cmgr->ge tFlagLines());
connect(getGuiActions("actionShow_Constellation_Art"), SIGNAL(toggle d(bool)), cmgr, SLOT(setFlagArt(bool))); connect(getGuiActions("actionShow_Constellation_Art"), SIGNAL(toggle d(bool)), cmgr, SLOT(setFlagArt(bool)));
getGuiActions("actionShow_Constellation_Art")->setChecked(cmgr->getF lagArt()); getGuiActions("actionShow_Constellation_Art")->setChecked(cmgr->getF lagArt());
connect(getGuiActions("actionShow_Constellation_Labels"), SIGNAL(tog gled(bool)), cmgr, SLOT(setFlagLabels(bool))); connect(getGuiActions("actionShow_Constellation_Labels"), SIGNAL(tog gled(bool)), cmgr, SLOT(setFlagLabels(bool)));
skipping to change at line 212 skipping to change at line 205
GridLinesMgr* gmgr = GETSTELMODULE(GridLinesMgr); GridLinesMgr* gmgr = GETSTELMODULE(GridLinesMgr);
connect(getGuiActions("actionShow_Equatorial_Grid"), SIGNAL(toggled( bool)), gmgr, SLOT(setFlagEquatorGrid(bool))); connect(getGuiActions("actionShow_Equatorial_Grid"), SIGNAL(toggled( bool)), gmgr, SLOT(setFlagEquatorGrid(bool)));
getGuiActions("actionShow_Equatorial_Grid")->setChecked(gmgr->getFla gEquatorGrid()); getGuiActions("actionShow_Equatorial_Grid")->setChecked(gmgr->getFla gEquatorGrid());
connect(getGuiActions("actionShow_Azimuthal_Grid"), SIGNAL(toggled(b ool)), gmgr, SLOT(setFlagAzimuthalGrid(bool))); connect(getGuiActions("actionShow_Azimuthal_Grid"), SIGNAL(toggled(b ool)), gmgr, SLOT(setFlagAzimuthalGrid(bool)));
getGuiActions("actionShow_Azimuthal_Grid")->setChecked(gmgr->getFlag AzimuthalGrid()); getGuiActions("actionShow_Azimuthal_Grid")->setChecked(gmgr->getFlag AzimuthalGrid());
connect(getGuiActions("actionShow_Ecliptic_Line"), SIGNAL(toggled(bo ol)), gmgr, SLOT(setFlagEclipticLine(bool))); connect(getGuiActions("actionShow_Ecliptic_Line"), SIGNAL(toggled(bo ol)), gmgr, SLOT(setFlagEclipticLine(bool)));
getGuiActions("actionShow_Ecliptic_Line")->setChecked(gmgr->getFlagE clipticLine()); getGuiActions("actionShow_Ecliptic_Line")->setChecked(gmgr->getFlagE clipticLine());
connect(getGuiActions("actionShow_Equator_Line"), SIGNAL(toggled(boo l)), gmgr, SLOT(setFlagEquatorLine(bool))); connect(getGuiActions("actionShow_Equator_Line"), SIGNAL(toggled(boo l)), gmgr, SLOT(setFlagEquatorLine(bool)));
getGuiActions("actionShow_Equator_Line")->setChecked(gmgr->getFlagEq uatorLine()); 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_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); LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr);
connect(getGuiActions("actionShow_Ground"), SIGNAL(toggled(bool)), l mgr, SLOT(setFlagLandscape(bool))); connect(getGuiActions("actionShow_Ground"), SIGNAL(toggled(bool)), l mgr, SLOT(setFlagLandscape(bool)));
getGuiActions("actionShow_Ground")->setChecked(lmgr->getFlagLandscap e()); getGuiActions("actionShow_Ground")->setChecked(lmgr->getFlagLandscap e());
connect(getGuiActions("actionShow_Cardinal_Points"), SIGNAL(toggled( bool)), lmgr, SLOT(setFlagCardinalsPoints(bool))); connect(getGuiActions("actionShow_Cardinal_Points"), SIGNAL(toggled( bool)), lmgr, SLOT(setFlagCardinalsPoints(bool)));
getGuiActions("actionShow_Cardinal_Points")->setChecked(lmgr->getFla gCardinalsPoints()); getGuiActions("actionShow_Cardinal_Points")->setChecked(lmgr->getFla gCardinalsPoints());
connect(getGuiActions("actionShow_Atmosphere"), SIGNAL(toggled(bool) ), lmgr, SLOT(setFlagAtmosphere(bool))); connect(getGuiActions("actionShow_Atmosphere"), SIGNAL(toggled(bool) ), lmgr, SLOT(setFlagAtmosphere(bool)));
getGuiActions("actionShow_Atmosphere")->setChecked(lmgr->getFlagAtmo sphere()); getGuiActions("actionShow_Atmosphere")->setChecked(lmgr->getFlagAtmo sphere());
connect(getGuiActions("actionShow_Fog"), SIGNAL(toggled(bool)), lmgr , SLOT(setFlagFog(bool))); connect(getGuiActions("actionShow_Fog"), SIGNAL(toggled(bool)), lmgr , SLOT(setFlagFog(bool)));
getGuiActions("actionShow_Fog")->setChecked(lmgr->getFlagFog()); getGuiActions("actionShow_Fog")->setChecked(lmgr->getFlagFog());
skipping to change at line 257 skipping to change at line 256
connect(getGuiActions("actionAdd_Solar_Week"), SIGNAL(triggered()), nav, SLOT(addWeek())); connect(getGuiActions("actionAdd_Solar_Week"), SIGNAL(triggered()), nav, SLOT(addWeek()));
connect(getGuiActions("actionSubtract_Solar_Hour"), SIGNAL(triggered ()), nav, SLOT(subtractHour())); connect(getGuiActions("actionSubtract_Solar_Hour"), SIGNAL(triggered ()), nav, SLOT(subtractHour()));
connect(getGuiActions("actionSubtract_Solar_Day"), SIGNAL(triggered( )), nav, SLOT(subtractDay())); connect(getGuiActions("actionSubtract_Solar_Day"), SIGNAL(triggered( )), nav, SLOT(subtractDay()));
connect(getGuiActions("actionSubtract_Solar_Week"), SIGNAL(triggered ()), nav, SLOT(subtractWeek())); connect(getGuiActions("actionSubtract_Solar_Week"), SIGNAL(triggered ()), nav, SLOT(subtractWeek()));
connect(getGuiActions("actionAdd_Sidereal_Day"), SIGNAL(triggered()) , nav, SLOT(addSiderealDay())); connect(getGuiActions("actionAdd_Sidereal_Day"), SIGNAL(triggered()) , nav, SLOT(addSiderealDay()));
connect(getGuiActions("actionAdd_Sidereal_Week"), SIGNAL(triggered() ), nav, SLOT(addSiderealWeek())); connect(getGuiActions("actionAdd_Sidereal_Week"), SIGNAL(triggered() ), nav, SLOT(addSiderealWeek()));
connect(getGuiActions("actionSubtract_Sidereal_Day"), SIGNAL(trigger ed()), nav, SLOT(subtractSiderealDay())); connect(getGuiActions("actionSubtract_Sidereal_Day"), SIGNAL(trigger ed()), nav, SLOT(subtractSiderealDay()));
connect(getGuiActions("actionSubtract_Sidereal_Week"), SIGNAL(trigge red()), nav, SLOT(subtractSiderealWeek())); connect(getGuiActions("actionSubtract_Sidereal_Week"), SIGNAL(trigge red()), nav, SLOT(subtractSiderealWeek()));
connect(getGuiActions("actionSet_Home_Planet_To_Selected"), SIGNAL(t riggered()), nav, SLOT(moveObserverToSelected())); connect(getGuiActions("actionSet_Home_Planet_To_Selected"), SIGNAL(t riggered()), nav, SLOT(moveObserverToSelected()));
TelescopeMgr* tmgr = GETSTELMODULE(TelescopeMgr); // connect the actor after setting the nightmode.
connect(getGuiActions("actionMove_Telescope_To_Selection_0"), SIGNAL // StelApp::init() already set flagNightMode for us, don't do it twi
(triggered()), tmgr, SLOT(moveTelescopeToSelected())); ce!
connect(getGuiActions("actionMove_Telescope_To_Selection_1"), SIGNAL
(triggered()), tmgr, SLOT(moveTelescopeToSelected()));
connect(getGuiActions("actionMove_Telescope_To_Selection_2"), SIGNAL
(triggered()), tmgr, SLOT(moveTelescopeToSelected()));
connect(getGuiActions("actionMove_Telescope_To_Selection_3"), SIGNAL
(triggered()), tmgr, SLOT(moveTelescopeToSelected()));
connect(getGuiActions("actionMove_Telescope_To_Selection_4"), SIGNAL
(triggered()), tmgr, SLOT(moveTelescopeToSelected()));
connect(getGuiActions("actionMove_Telescope_To_Selection_5"), SIGNAL
(triggered()), tmgr, SLOT(moveTelescopeToSelected()));
connect(getGuiActions("actionMove_Telescope_To_Selection_6"), SIGNAL
(triggered()), tmgr, SLOT(moveTelescopeToSelected()));
connect(getGuiActions("actionMove_Telescope_To_Selection_7"), SIGNAL
(triggered()), tmgr, SLOT(moveTelescopeToSelected()));
connect(getGuiActions("actionMove_Telescope_To_Selection_8"), SIGNAL
(triggered()), tmgr, SLOT(moveTelescopeToSelected()));
connect(getGuiActions("actionMove_Telescope_To_Selection_9"), SIGNAL
(triggered()), tmgr, SLOT(moveTelescopeToSelected()));
connect(getGuiActions("actionShow_Night_Mode"), SIGNAL(toggled(bool)
), &StelApp::getInstance(), SLOT(setVisionModeNight(bool)));
getGuiActions("actionShow_Night_Mode")->setChecked(StelApp::getInsta nce().getVisionModeNight()); getGuiActions("actionShow_Night_Mode")->setChecked(StelApp::getInsta nce().getVisionModeNight());
connect(getGuiActions("actionShow_Night_Mode"), SIGNAL(toggled(bool) ), &StelApp::getInstance(), SLOT(setVisionModeNight(bool)));
connect(getGuiActions("actionGoto_Selected_Object"), SIGNAL(triggere d()), mmgr, SLOT(setFlagTracking())); connect(getGuiActions("actionGoto_Selected_Object"), SIGNAL(triggere d()), mmgr, SLOT(setFlagTracking()));
connect(getGuiActions("actionZoom_In_Auto"), SIGNAL(triggered()), mm gr, SLOT(autoZoomIn())); connect(getGuiActions("actionZoom_In_Auto"), SIGNAL(triggered()), mm gr, SLOT(autoZoomIn()));
connect(getGuiActions("actionZoom_Out_Auto"), SIGNAL(triggered()), m mgr, SLOT(autoZoomOut())); connect(getGuiActions("actionZoom_Out_Auto"), SIGNAL(triggered()), m mgr, SLOT(autoZoomOut()));
connect(getGuiActions("actionSet_Tracking"), SIGNAL(toggled(bool)), mmgr, SLOT(setFlagTracking(bool))); connect(getGuiActions("actionSet_Tracking"), SIGNAL(toggled(bool)), mmgr, SLOT(setFlagTracking(bool)));
getGuiActions("actionSet_Tracking")->setChecked(mmgr->getFlagTrackin g()); getGuiActions("actionSet_Tracking")->setChecked(mmgr->getFlagTrackin g());
connect(getGuiActions("actionSet_Full_Screen_Global"), SIGNAL(toggle d(bool)), &StelMainWindow::getInstance(), SLOT(setFullScreen(bool))); connect(getGuiActions("actionSet_Full_Screen_Global"), SIGNAL(toggle d(bool)), &StelMainWindow::getInstance(), SLOT(setFullScreen(bool)));
getGuiActions("actionSet_Full_Screen_Global")->setChecked(StelMainWi ndow::getInstance().isFullScreen()); getGuiActions("actionSet_Full_Screen_Global")->setChecked(StelMainWi ndow::getInstance().isFullScreen());
skipping to change at line 322 skipping to change at line 311
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);
connect(getGuiActions("actionShow_Stars"), SIGNAL(toggled(bool)), sm gr, SLOT(setFlagStars(bool))); connect(getGuiActions("actionShow_Stars"), SIGNAL(toggled(bool)), sm gr, SLOT(setFlagStars(bool)));
getGuiActions("actionShow_Stars")->setChecked(smgr->getFlagStars()); getGuiActions("actionShow_Stars")->setChecked(smgr->getFlagStars());
SolarSystem* ssmgr = GETSTELMODULE(SolarSystem); SolarSystem* ssmgr = GETSTELMODULE(SolarSystem);
connect(getGuiActions("actionShow_Planets_Labels"), SIGNAL(toggled(b ool)), ssmgr, SLOT(setFlagLabels(bool))); connect(getGuiActions("actionShow_Planets_Labels"), SIGNAL(toggled(b ool)), ssmgr, SLOT(setFlagLabels(bool)));
getGuiActions("actionShow_Planets_Labels")->setChecked(ssmgr->getFla gLabels()); getGuiActions("actionShow_Planets_Labels")->setChecked(ssmgr->getFla gLabels());
connect(getGuiActions("actionShow_Meridian_Line"), SIGNAL(toggled(bo connect(getGuiActions("actionShow_Planets_Orbits"), SIGNAL(toggled(b
ol)), gmgr, SLOT(setFlagMeridianLine(bool))); ool)), ssmgr, SLOT(setFlagOrbits(bool)));
getGuiActions("actionShow_Meridian_Line")->setChecked(gmgr->getFlagM getGuiActions("actionShow_Planets_Orbits")->setChecked(ssmgr->getFla
eridianLine()); gOrbits());
connect(getGuiActions("actionShow_Equatorial_J2000_Grid"), SIGNAL(to connect(getGuiActions("actionShow_Planets_Trails"), SIGNAL(toggled(b
ggled(bool)), gmgr, SLOT(setFlagEquatorJ2000Grid(bool))); ool)), ssmgr, SLOT(setFlagTrails(bool)));
getGuiActions("actionShow_Equatorial_J2000_Grid")->setChecked(gmgr-> getGuiActions("actionShow_Planets_Trails")->setChecked(ssmgr->getFla
getFlagEquatorJ2000Grid()); gTrails());
connect(getGuiActions("actionShow_Galactic_Grid"), SIGNAL(toggled(bo
ol)), gmgr, SLOT(setFlagGalacticGrid(bool)));
getGuiActions("actionShow_Galactic_Grid")->setChecked(gmgr->getFlagG
alacticGrid());
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());
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()));
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
//// QGraphicsView based GUI //// QGraphicsView based GUI
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Add everything // Add everything
QPixmap pxmapDefault; QPixmap pxmapDefault;
QPixmap pxmapGlow(":/graphicGui/gui/glow.png"); QPixmap pxmapGlow(":/graphicGui/glow.png");
QPixmap pxmapOn(":/graphicGui/gui/2-on-location.png"); QPixmap pxmapOn(":/graphicGui/2-on-location.png");
QPixmap pxmapOff(":/graphicGui/gui/2-off-location.png"); QPixmap pxmapOff(":/graphicGui/2-off-location.png");
StelButton* b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions("actionShow_Location_Window_Global")); StelButton* b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions("actionShow_Location_Window_Global"));
skyGui->winBar->addButton(b); skyGui->winBar->addButton(b);
pxmapOn = QPixmap(":/graphicGui/gui/1-on-time.png"); pxmapOn = QPixmap(":/graphicGui/1-on-time.png");
pxmapOff = QPixmap(":/graphicGui/gui/1-off-time.png"); pxmapOff = QPixmap(":/graphicGui/1-off-time.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions ("actionShow_DateTime_Window_Global")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions ("actionShow_DateTime_Window_Global"));
skyGui->winBar->addButton(b); skyGui->winBar->addButton(b);
pxmapOn = QPixmap(":/graphicGui/gui/5-on-labels.png"); pxmapOn = QPixmap(":/graphicGui/5-on-labels.png");
pxmapOff = QPixmap(":/graphicGui/gui/5-off-labels.png"); pxmapOff = QPixmap(":/graphicGui/5-off-labels.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions ("actionShow_SkyView_Window_Global")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions ("actionShow_SkyView_Window_Global"));
skyGui->winBar->addButton(b); skyGui->winBar->addButton(b);
pxmapOn = QPixmap(":/graphicGui/gui/6-on-search.png"); pxmapOn = QPixmap(":/graphicGui/6-on-search.png");
pxmapOff = QPixmap(":/graphicGui/gui/6-off-search.png"); pxmapOff = QPixmap(":/graphicGui/6-off-search.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions ("actionShow_Search_Window_Global")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions ("actionShow_Search_Window_Global"));
skyGui->winBar->addButton(b); skyGui->winBar->addButton(b);
pxmapOn = QPixmap(":/graphicGui/gui/8-on-settings.png"); pxmapOn = QPixmap(":/graphicGui/8-on-settings.png");
pxmapOff = QPixmap(":/graphicGui/gui/8-off-settings.png"); pxmapOff = QPixmap(":/graphicGui/8-off-settings.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions ("actionShow_Configuration_Window_Global")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions ("actionShow_Configuration_Window_Global"));
skyGui->winBar->addButton(b); skyGui->winBar->addButton(b);
pxmapOn = QPixmap(":/graphicGui/gui/9-on-help.png"); pxmapOn = QPixmap(":/graphicGui/9-on-help.png");
pxmapOff = QPixmap(":/graphicGui/gui/9-off-help.png"); pxmapOff = QPixmap(":/graphicGui/9-off-help.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions ("actionShow_Help_Window_Global")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions ("actionShow_Help_Window_Global"));
skyGui->winBar->addButton(b); skyGui->winBar->addButton(b);
QPixmap pxmapGlow32x32(":/graphicGui/gui/glow32x32.png"); QPixmap pxmapGlow32x32(":/graphicGui/glow32x32.png");
pxmapOn = QPixmap(":/graphicGui/gui/btConstellationLines-on.png"); pxmapOn = QPixmap(":/graphicGui/btConstellationLines-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btConstellationLines-off.png"); pxmapOff = QPixmap(":/graphicGui/btConstellationLines-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Constellation_Lines")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Constellation_Lines"));
skyGui->buttonBar->addButton(b, "010-constellationsGroup"); skyGui->buttonBar->addButton(b, "010-constellationsGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btConstellationLabels-on.png"); pxmapOn = QPixmap(":/graphicGui/btConstellationLabels-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btConstellationLabels-off.png") pxmapOff = QPixmap(":/graphicGui/btConstellationLabels-off.png");
;
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Constellation_Labels")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Constellation_Labels"));
skyGui->buttonBar->addButton(b, "010-constellationsGroup"); skyGui->buttonBar->addButton(b, "010-constellationsGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btConstellationArt-on.png"); pxmapOn = QPixmap(":/graphicGui/btConstellationArt-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btConstellationArt-off.png"); pxmapOff = QPixmap(":/graphicGui/btConstellationArt-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Constellation_Art")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Constellation_Art"));
skyGui->buttonBar->addButton(b, "010-constellationsGroup"); skyGui->buttonBar->addButton(b, "010-constellationsGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btEquatorialGrid-on.png"); pxmapOn = QPixmap(":/graphicGui/btEquatorialGrid-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btEquatorialGrid-off.png"); pxmapOff = QPixmap(":/graphicGui/btEquatorialGrid-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Equatorial_Grid")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Equatorial_Grid"));
skyGui->buttonBar->addButton(b, "020-gridsGroup"); skyGui->buttonBar->addButton(b, "020-gridsGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btAzimuthalGrid-on.png"); pxmapOn = QPixmap(":/graphicGui/btAzimuthalGrid-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btAzimuthalGrid-off.png"); pxmapOff = QPixmap(":/graphicGui/btAzimuthalGrid-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Azimuthal_Grid")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Azimuthal_Grid"));
skyGui->buttonBar->addButton(b, "020-gridsGroup"); skyGui->buttonBar->addButton(b, "020-gridsGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btGround-on.png"); pxmapOn = QPixmap(":/graphicGui/btGround-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btGround-off.png"); pxmapOff = QPixmap(":/graphicGui/btGround-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Ground")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Ground"));
skyGui->buttonBar->addButton(b, "030-landscapeGroup"); skyGui->buttonBar->addButton(b, "030-landscapeGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btCardinalPoints-on.png"); pxmapOn = QPixmap(":/graphicGui/btCardinalPoints-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btCardinalPoints-off.png"); pxmapOff = QPixmap(":/graphicGui/btCardinalPoints-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Cardinal_Points")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Cardinal_Points"));
skyGui->buttonBar->addButton(b, "030-landscapeGroup"); skyGui->buttonBar->addButton(b, "030-landscapeGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btAtmosphere-on.png"); pxmapOn = QPixmap(":/graphicGui/btAtmosphere-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btAtmosphere-off.png"); pxmapOff = QPixmap(":/graphicGui/btAtmosphere-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Atmosphere")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Atmosphere"));
skyGui->buttonBar->addButton(b, "030-landscapeGroup"); skyGui->buttonBar->addButton(b, "030-landscapeGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btNebula-on.png"); pxmapOn = QPixmap(":/graphicGui/btNebula-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btNebula-off.png"); pxmapOff = QPixmap(":/graphicGui/btNebula-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Nebulas")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Nebulas"));
skyGui->buttonBar->addButton(b, "040-nebulaeGroup"); skyGui->buttonBar->addButton(b, "040-nebulaeGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btPlanets-on.png"); pxmapOn = QPixmap(":/graphicGui/btPlanets-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btPlanets-off.png"); pxmapOff = QPixmap(":/graphicGui/btPlanets-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Planets_Labels")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Planets_Labels"));
skyGui->buttonBar->addButton(b, "040-nebulaeGroup"); skyGui->buttonBar->addButton(b, "040-nebulaeGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btEquatorialMount-on.png"); pxmapOn = QPixmap(":/graphicGui/btEquatorialMount-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btEquatorialMount-off.png"); pxmapOff = QPixmap(":/graphicGui/btEquatorialMount-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionSwitch_Equatorial_Mount")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionSwitch_Equatorial_Mount"));
b->setChecked(getGuiActions("actionSwitch_Equatorial_Mount")->isChec ked()); b->setChecked(getGuiActions("actionSwitch_Equatorial_Mount")->isChec ked());
skyGui->buttonBar->addButton(b, "060-othersGroup"); skyGui->buttonBar->addButton(b, "060-othersGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btGotoSelectedObject-on.png"); pxmapOn = QPixmap(":/graphicGui/btGotoSelectedObject-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btGotoSelectedObject-off.png"); pxmapOff = QPixmap(":/graphicGui/btGotoSelectedObject-off.png");
buttonGotoSelectedObject = new StelButton(NULL, pxmapOn, pxmapOff, p xmapGlow32x32, getGuiActions("actionGoto_Selected_Object")); buttonGotoSelectedObject = new StelButton(NULL, pxmapOn, pxmapOff, p xmapGlow32x32, getGuiActions("actionGoto_Selected_Object"));
skyGui->buttonBar->addButton(buttonGotoSelectedObject, "060-othersGr oup"); skyGui->buttonBar->addButton(buttonGotoSelectedObject, "060-othersGr oup");
pxmapOn = QPixmap(":/graphicGui/gui/btNightView-on.png"); pxmapOn = QPixmap(":/graphicGui/btNightView-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btNightView-off.png"); pxmapOff = QPixmap(":/graphicGui/btNightView-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Night_Mode")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Night_Mode"));
skyGui->buttonBar->addButton(b, "060-othersGroup"); skyGui->buttonBar->addButton(b, "060-othersGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btFullScreen-on.png"); pxmapOn = QPixmap(":/graphicGui/btFullScreen-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btFullScreen-off.png"); pxmapOff = QPixmap(":/graphicGui/btFullScreen-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionSet_Full_Screen_Global")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionSet_Full_Screen_Global"));
skyGui->buttonBar->addButton(b, "060-othersGroup"); skyGui->buttonBar->addButton(b, "060-othersGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btTimeRewind-on.png"); pxmapOn = QPixmap(":/graphicGui/btTimeRewind-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btTimeRewind-off.png"); pxmapOff = QPixmap(":/graphicGui/btTimeRewind-off.png");
buttonTimeRewind = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow 32x32, getGuiActions("actionDecrease_Time_Speed")); buttonTimeRewind = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow 32x32, getGuiActions("actionDecrease_Time_Speed"));
skyGui->buttonBar->addButton(buttonTimeRewind, "070-timeGroup"); skyGui->buttonBar->addButton(buttonTimeRewind, "070-timeGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btTimeRealtime-on.png"); pxmapOn = QPixmap(":/graphicGui/btTimeRealtime-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btTimeRealtime-off.png"); pxmapOff = QPixmap(":/graphicGui/btTimeRealtime-off.png");
pxmapDefault = QPixmap(":/graphicGui/gui/btTimePause-on.png"); pxmapDefault = QPixmap(":/graphicGui/btTimePause-on.png");
buttonTimeRealTimeSpeed = new StelButton(NULL, pxmapOn, pxmapOff, px mapDefault, pxmapGlow32x32, getGuiActions("actionSet_Real_Time_Speed")); buttonTimeRealTimeSpeed = new StelButton(NULL, pxmapOn, pxmapOff, px mapDefault, pxmapGlow32x32, getGuiActions("actionSet_Real_Time_Speed"));
skyGui->buttonBar->addButton(buttonTimeRealTimeSpeed, "070-timeGroup "); skyGui->buttonBar->addButton(buttonTimeRealTimeSpeed, "070-timeGroup ");
pxmapOn = QPixmap(":/graphicGui/gui/btTimeNow-on.png"); pxmapOn = QPixmap(":/graphicGui/btTimeNow-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btTimeNow-off.png"); pxmapOff = QPixmap(":/graphicGui/btTimeNow-off.png");
buttonTimeCurrent = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlo w32x32, getGuiActions("actionReturn_To_Current_Time")); buttonTimeCurrent = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlo w32x32, getGuiActions("actionReturn_To_Current_Time"));
skyGui->buttonBar->addButton(buttonTimeCurrent, "070-timeGroup"); skyGui->buttonBar->addButton(buttonTimeCurrent, "070-timeGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btTimeForward-on.png"); pxmapOn = QPixmap(":/graphicGui/btTimeForward-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btTimeForward-off.png"); pxmapOff = QPixmap(":/graphicGui/btTimeForward-off.png");
buttonTimeForward = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlo w32x32, getGuiActions("actionIncrease_Time_Speed")); buttonTimeForward = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlo w32x32, getGuiActions("actionIncrease_Time_Speed"));
skyGui->buttonBar->addButton(buttonTimeForward, "070-timeGroup"); skyGui->buttonBar->addButton(buttonTimeForward, "070-timeGroup");
skyGui->buttonBar->setGroupMargin("070-timeGroup", 32, 0); skyGui->buttonBar->setGroupMargin("070-timeGroup", 32, 0);
pxmapOn = QPixmap(":/graphicGui/gui/btQuit.png"); pxmapOn = QPixmap(":/graphicGui/btQuit.png");
b = new StelButton(NULL, pxmapOn, pxmapOn, pxmapGlow32x32, getGuiAct ions("actionQuit_Global")); b = new StelButton(NULL, pxmapOn, pxmapOn, pxmapGlow32x32, getGuiAct ions("actionQuit_Global"));
skyGui->buttonBar->addButton(b, "080-quitGroup"); skyGui->buttonBar->addButton(b, "080-quitGroup");
// add the flip buttons if requested in the config // add the flip buttons if requested in the config
setFlagShowFlipButtons(conf->value("gui/flag_show_flip_buttons", fal se).toBool()); setFlagShowFlipButtons(conf->value("gui/flag_show_flip_buttons", fal se).toBool());
setFlagShowNebulaBackgroundButton(conf->value("gui/flag_show_nebulae _background_button", false).toBool()); setFlagShowNebulaBackgroundButton(conf->value("gui/flag_show_nebulae _background_button", false).toBool());
//////////////////////////////////////////////////////////////////// /// //////////////////////////////////////////////////////////////////// ///
// Create the main base widget // Create the main base widget
skyGui->init(this); skyGui->init(this);
QGraphicsGridLayout* l = new QGraphicsGridLayout(); QGraphicsGridLayout* l = new QGraphicsGridLayout();
l->setContentsMargins(0,0,0,0); l->setContentsMargins(0,0,0,0);
l->setSpacing(0); l->setSpacing(0);
l->addItem(skyGui, 0, 0); l->addItem(skyGui, 0, 0);
stelAppGraphicsWidget->setLayout(l); stelAppGraphicsWidget->setLayout(l);
skyGui->setGeometry(stelAppGraphicsWidget->geometry()); skyGui->setGeometry(stelAppGraphicsWidget->geometry());
skyGui->updateBarsPos(); skyGui->updateBarsPos();
setStelStyle(*StelApp::getInstance().getCurrentStelStyle()); setStelStyle(StelApp::getInstance().getCurrentStelStyle());
initDone = true; initDone = true;
} }
void StelGui::quit()
{
StelMainGraphicsView::getInstance().getScriptMgr().stopScript();
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
void StelGui::setStelStyle(const StelStyle& style) void StelGui::setStelStyle(const QString& section)
{ {
qApp->setStyleSheet(style.qtStyleSheet); if (currentStelStyle.confSectionName!=section)
{
// Load the style sheets
currentStelStyle.confSectionName = section;
QString qtStyleFileName;
QString htmlStyleFileName;
if (section=="night_color")
{
qtStyleFileName = ":/graphicGui/nightStyle.css";
htmlStyleFileName = ":/graphicGui/nightHtml.css";
}
else if (section=="color")
{
qtStyleFileName = ":/graphicGui/normalStyle.css";
htmlStyleFileName = ":/graphicGui/normalHtml.css";
}
skyGui->setStelStyle(style); // Load Qt style sheet
QFile styleFile(qtStyleFileName);
styleFile.open(QIODevice::ReadOnly);
currentStelStyle.qtStyleSheet = styleFile.readAll();
QFile htmlStyleFile(htmlStyleFileName);
htmlStyleFile.open(QIODevice::ReadOnly);
currentStelStyle.htmlStyleSheet = htmlStyleFile.readAll();
}
qApp->setStyleSheet(currentStelStyle.qtStyleSheet);
skyGui->setStelStyle(currentStelStyle);
locationDialog.styleChanged(); locationDialog.styleChanged();
dateTimeDialog.styleChanged(); dateTimeDialog.styleChanged();
configurationDialog->styleChanged(); configurationDialog->styleChanged();
searchDialog.styleChanged(); searchDialog.styleChanged();
viewDialog.styleChanged(); viewDialog.styleChanged();
#ifdef ENABLE_SCRIPT_CONSOLE
scriptConsole.styleChanged();
#endif // ENABLE_SCRIPT_CONSOLE
} }
void StelGui::updateI18n() void StelGui::updateI18n()
{ {
StelGuiBase::updateI18n(); StelGuiBase::updateI18n();
// Update the dialogs // Update the dialogs
configurationDialog->languageChanged(); configurationDialog->languageChanged();
dateTimeDialog.languageChanged(); dateTimeDialog.languageChanged();
helpDialog.languageChanged(); helpDialog.languageChanged();
skipping to change at line 574 skipping to change at line 597
buttonTimeRealTimeSpeed->setChecked(StelButton::ButtonStateO ff); buttonTimeRealTimeSpeed->setChecked(StelButton::ButtonStateO ff);
} }
const bool isTimeNow=nav->getIsTimeNow(); const bool isTimeNow=nav->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);
StarMgr* smgr = GETSTELMODULE(StarMgr); bool flag = GETSTELMODULE(StarMgr)->getFlagStars();
if (getGuiActions("actionShow_Stars")->isChecked()!=smgr->getFlagSta if (getGuiActions("actionShow_Stars")->isChecked() != flag)
rs()) getGuiActions("actionShow_Stars")->setChecked(flag);
getGuiActions("actionShow_Stars")->setChecked(smgr->getFlagS ConstellationMgr* cmgr = GETSTELMODULE(ConstellationMgr);
tars()); 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->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();
if (getGuiActions("actionShow_Nebulas")->isChecked() != flag)
getGuiActions("actionShow_Nebulas")->setChecked(flag);
flag = GETSTELMODULE(StelSkyLayerMgr)->getFlagShow();
if (getGuiActions("actionShow_DSS")->isChecked() != flag)
getGuiActions("actionShow_DSS")->setChecked(flag);
flag = mmgr->getMountMode() != StelMovementMgr::MountAltAzimuthal;
if (getGuiActions("actionSwitch_Equatorial_Mount")->isChecked() != f
lag)
getGuiActions("actionSwitch_Equatorial_Mount")->setChecked(f
lag);
SolarSystem* ssmgr = GETSTELMODULE(SolarSystem);
flag = ssmgr->getFlagLabels();
if (getGuiActions("actionShow_Planets_Labels")->isChecked() != flag)
getGuiActions("actionShow_Planets_Labels")->setChecked(flag)
;
flag = ssmgr->getFlagOrbits();
if (getGuiActions("actionShow_Planets_Orbits")->isChecked() != flag)
getGuiActions("actionShow_Planets_Orbits")->setChecked(flag)
;
flag = ssmgr->getFlagTrails();
if (getGuiActions("actionShow_Planets_Trails")->isChecked() != flag)
getGuiActions("actionShow_Planets_Trails")->setChecked(flag)
;
flag = StelApp::getInstance().getVisionModeNight();
if (getGuiActions("actionShow_Night_Mode")->isChecked() != flag)
getGuiActions("actionShow_Night_Mode")->setChecked(flag);
flag = StelMainWindow::getInstance().isFullScreen();
if (getGuiActions("actionSet_Full_Screen_Global")->isChecked() != fl
ag)
getGuiActions("actionSet_Full_Screen_Global")->setChecked(fl
ag);
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(nav->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();
} }
void StelGui::setScriptKeys(bool b) void StelGui::setScriptKeys(bool b)
{ {
skipping to change at line 638 skipping to change at line 737
StelMainGraphicsView::getInstance().getScriptMgr().setScriptRate(1); StelMainGraphicsView::getInstance().getScriptMgr().setScriptRate(1);
} }
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/gui/glow32x32.p ng"); QPixmap pxmapGlow32x32(":/graphicGui/glow32x32.png") ;
flipVert = new StelButton(NULL, flipVert = new StelButton(NULL,
QP QP
ixmap(":/graphicGui/gui/btFlipVertical-on.png"), ixmap(":/graphicGui/btFlipVertical-on.png"),
QP QP
ixmap(":/graphicGui/gui/btFlipVertical-off.png"), 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/gui/glow32x32.p ng"); QPixmap pxmapGlow32x32(":/graphicGui/glow32x32.png") ;
flipHoriz = new StelButton(NULL, flipHoriz = new StelButton(NULL,
Q Q
Pixmap(":/graphicGui/gui/btFlipHorizontal-on.png"), Pixmap(":/graphicGui/btFlipHorizontal-on.png"),
Q Q
Pixmap(":/graphicGui/gui/btFlipHorizontal-off.png"), 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
{ {
bool b = getButtonBar()->hideButton("actionVertical_Flip")== flipVert; bool b = getButtonBar()->hideButton("actionVertical_Flip")== flipVert;
Q_ASSERT(b); Q_ASSERT(b);
skipping to change at line 675 skipping to change at line 774
} }
// 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/gui/glow32x32.p QPixmap pxmapGlow32x32(":/graphicGui/glow32x32.png")
ng"); ;
btShowNebulaeBackground = new StelButton(NULL, QPixm btShowNebulaeBackground = new StelButton(NULL, QPixm
ap(":/graphicGui/gui/btDSS-on.png"), QPixmap(":/graphicGui/gui/btDSS-off.pn ap(":/graphicGui/btDSS-on.png"), QPixmap(":/graphicGui/btDSS-off.png"), pxm
g"), pxmapGlow32x32, getGuiActions("actionShow_DSS")); apGlow32x32, getGuiActions("actionShow_DSS"));
} }
getButtonBar()->addButton(btShowNebulaeBackground, "040-nebu laeGroup"); getButtonBar()->addButton(btShowNebulaeBackground, "040-nebu laeGroup");
} }
else else
{ {
bool bb; bool bb;
bb = (getButtonBar()->hideButton("actionShow_DSS")==btShowNe bulaeBackground); bb = (getButtonBar()->hideButton("actionShow_DSS")==btShowNe bulaeBackground);
Q_ASSERT(bb); Q_ASSERT(bb);
} }
flagShowNebulaBackgroundButton = b; flagShowNebulaBackgroundButton = b;
 End of changes. 52 change blocks. 
140 lines changed or deleted 242 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/