StelGui.cpp   StelGui.cpp 
skipping to change at line 31 skipping to change at line 31
#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"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelIniParser.hpp" #include "StelIniParser.hpp"
#include "StelMainGraphicsView.hpp" #include "StelMainView.hpp"
#include "StelMainWindow.hpp"
#include "StelObjectMgr.hpp" #include "StelObjectMgr.hpp"
#include "LandscapeMgr.hpp" #include "LandscapeMgr.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 "StelShortcutMgr.hpp" #include "StelActionMgr.hpp"
#include "StelObjectType.hpp" #include "StelObjectType.hpp"
#include "StelObject.hpp" #include "StelObject.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 #ifndef DISABLE_SCRIPTING
#include "StelScriptMgr.hpp" #include "StelScriptMgr.hpp"
#endif #endif
#include "StelAppGraphicsWidget.hpp"
#include "ConfigurationDialog.hpp" #include "ConfigurationDialog.hpp"
#include "DateTimeDialog.hpp" #include "DateTimeDialog.hpp"
#include "HelpDialog.hpp" #include "HelpDialog.hpp"
#include "LocationDialog.hpp" #include "LocationDialog.hpp"
#include "SearchDialog.hpp" #include "SearchDialog.hpp"
#include "ViewDialog.hpp" #include "ViewDialog.hpp"
#include "ShortcutsDialog.hpp" #include "ShortcutsDialog.hpp"
#include <QDebug> #include <QDebug>
#include <QTimeLine> #include <QTimeLine>
#include <QFontDatabase> #include <QFontDatabase>
#include <QMouseEvent> #include <QMouseEvent>
#include <QAction> #include <QGuiApplication>
#include <QApplication>
#include <QFile> #include <QFile>
#include <QTextBrowser> #include <QTextBrowser>
#include <QGraphicsWidget> #include <QGraphicsWidget>
#include <QGraphicsGridLayout> #include <QGraphicsGridLayout>
#include <QClipboard> #include <QClipboard>
#include <QPalette> #include <QPalette>
#include <QColor> #include <QColor>
#include <QAction>
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)
StelGui::StelGui() : StelGui::StelGui()
topLevelGraphicsWidget(NULL), : topLevelGraphicsWidget(NULL)
locationDialog(0), , skyGui(NULL)
helpDialog(0), , buttonTimeRewind(NULL)
dateTimeDialog(0), , buttonTimeRealTimeSpeed(NULL)
searchDialog(0), , buttonTimeCurrent(NULL)
viewDialog(0), , buttonTimeForward(NULL)
shortcutsDialog(0), , buttonGotoSelectedObject(NULL)
configurationDialog(0), , locationDialog(0)
, helpDialog(0)
, dateTimeDialog(0)
, searchDialog(0)
, viewDialog(0)
, shortcutsDialog(0)
, configurationDialog(0)
#ifdef ENABLE_SCRIPT_CONSOLE #ifdef ENABLE_SCRIPT_CONSOLE
scriptConsole(0), , scriptConsole(0)
#endif #endif
initDone(false) , flagShowFlipButtons(false)
, flipVert(NULL)
, flipHoriz(NULL)
, flagShowNebulaBackgroundButton(false)
, btShowNebulaeBackground(NULL)
, initDone(false)
{ {
// QPixmapCache::setCacheLimit(30000); ? // QPixmapCache::setCacheLimit(30000); ?
flipHoriz = NULL;
flipVert = NULL;
btShowNebulaeBackground = NULL;
} }
StelGui::~StelGui() StelGui::~StelGui()
{ {
delete skyGui; delete skyGui;
skyGui = NULL; skyGui = NULL;
if (locationDialog) if (locationDialog)
{ {
delete locationDialog; delete locationDialog;
skipping to change at line 154 skipping to change at line 158
// configurationDialog is automatically deleted with its parent widg et. // configurationDialog is automatically deleted with its parent widg et.
#ifdef ENABLE_SCRIPT_CONSOLE #ifdef ENABLE_SCRIPT_CONSOLE
if (scriptConsole) if (scriptConsole)
{ {
delete scriptConsole; delete scriptConsole;
scriptConsole = 0; scriptConsole = 0;
} }
#endif #endif
} }
void StelGui::init(QGraphicsWidget* atopLevelGraphicsWidget, StelAppGraphic sWidget* astelAppGraphicsWidget) void StelGui::init(QGraphicsWidget *atopLevelGraphicsWidget)
{ {
qDebug() << "Creating GUI ..."; qDebug() << "Creating GUI ...";
StelGuiBase::init(atopLevelGraphicsWidget, astelAppGraphicsWidget); StelGuiBase::init(atopLevelGraphicsWidget);
skyGui = new SkyGui(atopLevelGraphicsWidget); skyGui = new SkyGui(atopLevelGraphicsWidget);
locationDialog = new LocationDialog(); locationDialog = new LocationDialog(atopLevelGraphicsWidget);
helpDialog = new HelpDialog(); helpDialog = new HelpDialog(atopLevelGraphicsWidget);
dateTimeDialog = new DateTimeDialog(); dateTimeDialog = new DateTimeDialog(atopLevelGraphicsWidget);
searchDialog = new SearchDialog(); searchDialog = new SearchDialog(atopLevelGraphicsWidget);
viewDialog = new ViewDialog(); viewDialog = new ViewDialog(atopLevelGraphicsWidget);
shortcutsDialog = new ShortcutsDialog(); shortcutsDialog = new ShortcutsDialog(atopLevelGraphicsWidget);
configurationDialog = new ConfigurationDialog(this); configurationDialog = new ConfigurationDialog(this, atopLevelGraphic
sWidget);
#ifdef ENABLE_SCRIPT_CONSOLE #ifdef ENABLE_SCRIPT_CONSOLE
scriptConsole = new ScriptConsole(); scriptConsole = new ScriptConsole();
#endif #endif
//////////////////////////////////////////////////////////////////// /// //////////////////////////////////////////////////////////////////// ///
// Create all the main actions of the program, associated with short cuts // Create all the main actions of the program, associated with short cuts
StelApp::getInstance().getStelShortcutManager()->loadShortcuts();
#ifdef ENABLE_SCRIPT_CONSOLE
StelApp::getInstance().getStelShortcutManager()->
addGuiAction("actionShow_ScriptConsole_Window_Global
", true, N_("Script console window"), "F12", "", N_("Windows"), true, false
, true);
#endif
//////////////////////////////////////////////////////////////////// /// //////////////////////////////////////////////////////////////////// ///
// Connect all the GUI actions signals with the Core of Stellarium // Connect all the GUI actions signals with the Core of Stellarium
connect(getGuiAction("actionQuit_Global"), SIGNAL(triggered()), this , SLOT(quit())); StelActionMgr* actionsMgr = StelApp::getInstance().getStelActionMana ger();
initConstellationMgr(); // XXX: this should probably go into the script manager.
initGrindLineMgr(); QString datetimeGroup = N_("Date and Time");
initLandscapeMgr(); QString windowsGroup = N_("Windows");
QString miscGroup = N_("Miscellaneous");
NebulaMgr* nmgr = GETSTELMODULE(NebulaMgr); actionsMgr->addAction("actionQuit_Global", miscGroup, N_("Quit"), th
connect(getGuiAction("actionShow_Nebulas"), SIGNAL(toggled(bool)), n is, "quit()", "Ctrl+Q");
mgr, SLOT(setFlagHints(bool))); actionsMgr->addAction("actionIncrease_Script_Speed", datetimeGroup,
getGuiAction("actionShow_Nebulas")->setChecked(nmgr->getFlagHints()) N_("Speed up the script execution rate"), this, "increaseScriptSpeed()");
; actionsMgr->addAction("actionDecrease_Script_Speed", datetimeGroup,
N_("Slow down the script execution rate"), this, "decreaseScriptSpeed()");
StelSkyLayerMgr* imgr = GETSTELMODULE(StelSkyLayerMgr); actionsMgr->addAction("actionSet_Real_Script_Speed", datetimeGroup,
connect(getGuiAction("actionShow_DSS"), SIGNAL(toggled(bool)), imgr, N_("Set the normal script execution rate"), this, "setRealScriptSpeed()");
SLOT(setFlagShow(bool))); actionsMgr->addAction("actionStop_Script", datetimeGroup, N_("Stop s
getGuiAction("actionShow_DSS")->setChecked(imgr->getFlagShow()); cript execution"), this, "stopScript()", "Ctrl+D, S");
actionsMgr->addAction("actionPause_Script", datetimeGroup, N_("Pause
StelCore* core = StelApp::getInstance().getCore(); script execution"), this, "pauseScript()", "Ctrl+D, P");
StelMovementMgr* mmgr = GETSTELMODULE(StelMovementMgr); actionsMgr->addAction("actionResume_Script", datetimeGroup, N_("Resu
connect(getGuiAction("actionIncrease_Script_Speed"), SIGNAL(triggere me script execution"), this, "resumeScript()", "Ctrl+D, R");
d()), this, SLOT(increaseScriptSpeed()));
connect(getGuiAction("actionDecrease_Script_Speed"), SIGNAL(triggere
d()), this, SLOT(decreaseScriptSpeed()));
connect(getGuiAction("actionSet_Real_Script_Speed"), SIGNAL(triggere
d()), this, SLOT(setRealScriptSpeed()));
connect(getGuiAction("actionStop_Script"), SIGNAL(triggered()), this
, SLOT(stopScript()));
connect(getGuiAction("actionPause_Script"), SIGNAL(triggered()), thi
s, SLOT(pauseScript()));
connect(getGuiAction("actionResume_Script"), SIGNAL(triggered()), th
is, SLOT(resumeScript()));
connect(getGuiAction("actionIncrease_Time_Speed"), SIGNAL(triggered(
)), core, SLOT(increaseTimeSpeed()));
connect(getGuiAction("actionDecrease_Time_Speed"), SIGNAL(triggered(
)), core, SLOT(decreaseTimeSpeed()));
connect(getGuiAction("actionIncrease_Time_Speed_Less"), SIGNAL(trigg
ered()), core, SLOT(increaseTimeSpeedLess()));
connect(getGuiAction("actionDecrease_Time_Speed_Less"), SIGNAL(trigg
ered()), core, SLOT(decreaseTimeSpeedLess()));
connect(getGuiAction("actionSet_Real_Time_Speed"), SIGNAL(triggered(
)), core, SLOT(toggleRealTimeSpeed()));
connect(getGuiAction("actionSet_Time_Rate_Zero"), SIGNAL(triggered()
), core, SLOT(setZeroTimeSpeed()));
connect(getGuiAction("actionReturn_To_Current_Time"), SIGNAL(trigger
ed()), core, SLOT(setTimeNow()));
connect(getGuiAction("actionSwitch_Equatorial_Mount"), SIGNAL(toggle
d(bool)), mmgr, SLOT(setEquatorialMount(bool)));
getGuiAction("actionSwitch_Equatorial_Mount")->setChecked(mmgr->getM
ountMode() != StelMovementMgr::MountAltAzimuthal);
connect(getGuiAction("actionAdd_Solar_Hour"), SIGNAL(triggered()), c
ore, SLOT(addHour()));
connect(getGuiAction("actionAdd_Solar_Day"), SIGNAL(triggered()), co
re, SLOT(addDay()));
connect(getGuiAction("actionAdd_Solar_Week"), SIGNAL(triggered()), c
ore, SLOT(addWeek()));
connect(getGuiAction("actionSubtract_Solar_Hour"), SIGNAL(triggered(
)), core, SLOT(subtractHour()));
connect(getGuiAction("actionSubtract_Solar_Day"), SIGNAL(triggered()
), core, SLOT(subtractDay()));
connect(getGuiAction("actionSubtract_Solar_Week"), SIGNAL(triggered(
)), core, SLOT(subtractWeek()));
connect(getGuiAction("actionAdd_Sidereal_Day"), SIGNAL(triggered()),
core, SLOT(addSiderealDay()));
connect(getGuiAction("actionAdd_Sidereal_Week"), SIGNAL(triggered())
, core, SLOT(addSiderealWeek()));
connect(getGuiAction("actionAdd_Sidereal_Month"), SIGNAL(triggered()
), core, SLOT(addSiderealMonth()));
connect(getGuiAction("actionAdd_Sidereal_Year"), SIGNAL(triggered())
, core, SLOT(addSiderealYear()));
connect(getGuiAction("actionAdd_Sidereal_Century"), SIGNAL(triggered
()), core, SLOT(addSiderealCentury()));
connect(getGuiAction("actionAdd_Synodic_Month"), SIGNAL(triggered())
, core, SLOT(addSynodicMonth()));
connect(getGuiAction("actionAdd_Draconic_Month"), SIGNAL(triggered()
), core, SLOT(addDraconicMonth()));
connect(getGuiAction("actionAdd_Draconic_Year"), SIGNAL(triggered())
, core, SLOT(addDraconicYear()));
connect(getGuiAction("actionAdd_Anomalistic_Month"), SIGNAL(triggere
d()), core, SLOT(addAnomalisticMonth()));
connect(getGuiAction("actionAdd_Tropical_Month"), SIGNAL(triggered()
), core, SLOT(addTropicalMonth()));
connect(getGuiAction("actionAdd_Tropical_Year"), SIGNAL(triggered())
, core, SLOT(addTropicalYear()));
connect(getGuiAction("actionAdd_Tropical_Century"), SIGNAL(triggered
()), core, SLOT(addTropicalCentury()));
connect(getGuiAction("actionSubtract_Sidereal_Day"), SIGNAL(triggere
d()), core, SLOT(subtractSiderealDay()));
connect(getGuiAction("actionSubtract_Sidereal_Week"), SIGNAL(trigger
ed()), core, SLOT(subtractSiderealWeek()));
connect(getGuiAction("actionSubtract_Sidereal_Month"), SIGNAL(trigge
red()), core, SLOT(subtractSiderealMonth()));
connect(getGuiAction("actionSubtract_Sidereal_Year"), SIGNAL(trigger
ed()), core, SLOT(subtractSiderealYear()));
connect(getGuiAction("actionSubtract_Sidereal_Century"), SIGNAL(trig
gered()), core, SLOT(subtractSiderealCentury()));
connect(getGuiAction("actionSubtract_Synodic_Month"), SIGNAL(trigger
ed()), core, SLOT(subtractSynodicMonth()));
connect(getGuiAction("actionSubtract_Draconic_Month"), SIGNAL(trigge
red()), core, SLOT(subtractDraconicMonth()));
connect(getGuiAction("actionSubtract_Draconic_Year"), SIGNAL(trigger
ed()), core, SLOT(subtractDraconicYear()));
connect(getGuiAction("actionSubtract_Anomalistic_Month"), SIGNAL(tri
ggered()), core, SLOT(subtractAnomalisticMonth()));
connect(getGuiAction("actionSubtract_Tropical_Month"), SIGNAL(trigge
red()), core, SLOT(subtractTropicalMonth()));
connect(getGuiAction("actionSubtract_Tropical_Year"), SIGNAL(trigger
ed()), core, SLOT(subtractTropicalYear()));
connect(getGuiAction("actionSubtract_Tropical_Century"), SIGNAL(trig
gered()), core, SLOT(subtractTropicalCentury()));
connect(getGuiAction("actionSet_Home_Planet_To_Selected"), SIGNAL(tr
iggered()), core, SLOT(moveObserverToSelected()));
connect(getGuiAction("actionGo_Home_Global"), SIGNAL(triggered()), c
ore, SLOT(returnToHome()));
// connect the actor after setting the nightmode.
// StelApp::init() already set flagNightMode for us, don't do it twi
ce!
getGuiAction("actionShow_Night_Mode")->setChecked(StelApp::getInstan
ce().getVisionModeNight());
connect(getGuiAction("actionShow_Night_Mode"), SIGNAL(toggled(bool))
, &StelApp::getInstance(), SLOT(setVisionModeNight(bool)));
connect(getGuiAction("actionGoto_Selected_Object"), SIGNAL(triggered
()), mmgr, SLOT(setFlagTracking()));
connect(getGuiAction("actionZoom_In_Auto"), SIGNAL(triggered()), mmg
r, SLOT(autoZoomIn()));
connect(getGuiAction("actionZoom_Out_Auto"), SIGNAL(triggered()), mm
gr, SLOT(autoZoomOut()));
connect(getGuiAction("actionSet_Tracking"), SIGNAL(toggled(bool)), m
mgr, SLOT(setFlagTracking(bool)));
getGuiAction("actionSet_Tracking")->setChecked(mmgr->getFlagTracking
());
connect(getGuiAction("actionSet_Full_Screen_Global"), SIGNAL(toggled
(bool)), &StelMainWindow::getInstance(), SLOT(setFullScreen(bool)));
getGuiAction("actionSet_Full_Screen_Global")->setChecked(StelMainWin
dow::getInstance().isFullScreen());
QAction* tempAction = getGuiAction("actionShow_Location_Window_Globa
l");
connect(tempAction, SIGNAL(toggled(bool)),
locationDialog, SLOT(setVisible(bool)));
connect(locationDialog, SIGNAL(visibleChanged(bool)),
tempAction, SLOT(setChecked(bool)));
#ifdef ENABLE_SCRIPT_CONSOLE #ifdef ENABLE_SCRIPT_CONSOLE
tempAction = getGuiAction("actionShow_ScriptConsole_Window_Global"); actionsMgr->addAction("actionShow_ScriptConsole_Window_Global", wind
connect(tempAction, SIGNAL(toggled(bool)), owsGroup, N_("Script console window"), scriptConsole, "visible", "F12", "",
scriptConsole, SLOT(setVisible(bool))); true);
connect(scriptConsole, SIGNAL(visibleChanged(bool)),
tempAction, SLOT(setChecked(bool)));
#endif #endif
tempAction = getGuiAction("actionShow_Configuration_Window_Global"); actionsMgr->addAction("actionShow_Help_Window_Global", windowsGroup,
connect(tempAction, SIGNAL(toggled(bool)), N_("Help window"), helpDialog, "visible", "F1", "", true);
configurationDialog, SLOT(setVisible(bool))); actionsMgr->addAction("actionShow_Configuration_Window_Global", wind
connect(configurationDialog, SIGNAL(visibleChanged(bool)), owsGroup, N_("Configuration window"), configurationDialog, "visible", "F2",
tempAction, SLOT(setChecked(bool))); "", true);
actionsMgr->addAction("actionShow_Search_Window_Global", windowsGrou
tempAction = getGuiAction("actionShow_SkyView_Window_Global"); p, N_("Search window"), searchDialog, "visible", "F3", "Ctrl+F", true);
connect(tempAction, SIGNAL(toggled(bool)), actionsMgr->addAction("actionShow_SkyView_Window_Global", windowsGro
viewDialog, SLOT(setVisible(bool))); up, N_("Sky and viewing options window"), viewDialog, "visible", "F4", "",
connect(viewDialog, SIGNAL(visibleChanged(bool)), true);
tempAction, SLOT(setChecked(bool))); actionsMgr->addAction("actionShow_DateTime_Window_Global", windowsGr
oup, N_("Date/time window"), dateTimeDialog, "visible", "F5", "", true);
tempAction = getGuiAction("actionShow_Help_Window_Global"); actionsMgr->addAction("actionShow_Location_Window_Global", windowsGr
connect(tempAction, SIGNAL(toggled(bool)), oup, N_("Location window"), locationDialog, "visible", "F6", "", true);
helpDialog, SLOT(setVisible(bool))); actionsMgr->addAction("actionShow_Shortcuts_Window_Global", windowsG
connect(helpDialog, SIGNAL(visibleChanged(bool)), roup, N_("Shortcuts window"), shortcutsDialog, "visible", "F7", "", true);
tempAction, SLOT(setChecked(bool))); actionsMgr->addAction("actionSave_Copy_Object_Information_Global", m
iscGroup, N_("Copy selected object information to clipboard"), this, "copyS
tempAction = getGuiAction("actionShow_DateTime_Window_Global"); electedObjectInfo()", "Ctrl+C", "", true);
connect(tempAction, SIGNAL(toggled(bool)), actionsMgr->addAction("actionToggle_GuiHidden_Global", miscGroup, N_
dateTimeDialog, SLOT(setVisible(bool))); ("Toggle visibility of GUI"), this, "visible", "Ctrl+T", "", true);
connect(dateTimeDialog, SIGNAL(visibleChanged(bool)),
tempAction, SLOT(setChecked(bool)));
tempAction = getGuiAction("actionShow_Search_Window_Global");
connect(tempAction, SIGNAL(toggled(bool)),
searchDialog, SLOT(setVisible(bool)));
connect(searchDialog, SIGNAL(visibleChanged(bool)),
tempAction, SLOT(setChecked(bool)));
tempAction = getGuiAction("actionShow_Shortcuts_Window_Global");
connect(tempAction, SIGNAL(toggled(bool)),
shortcutsDialog, SLOT(setVisible(bool)));
connect(shortcutsDialog, SIGNAL(visibleChanged(bool)),
tempAction, SLOT(setChecked(bool)));
connect(getGuiAction("actionSave_Screenshot_Global"), SIGNAL(trigger
ed()), &StelMainGraphicsView::getInstance(), SLOT(saveScreenShot()));
connect(getGuiAction("actionSave_Copy_Object_Information_Global"), S
IGNAL(triggered()), this, SLOT(copySelectedObjectInfo()));
getGuiAction("actionToggle_GuiHidden_Global")->setChecked(true);
connect(getGuiAction("actionToggle_GuiHidden_Global"), SIGNAL(toggle
d(bool)), this, SLOT(setGuiVisible(bool)));
connect(getGuiAction("actionHorizontal_Flip"), SIGNAL(toggled(bool))
, StelApp::getInstance().getCore(), SLOT(setFlipHorz(bool)));
getGuiAction("actionHorizontal_Flip")->setChecked(StelApp::getInstan
ce().getCore()->getFlipHorz());
connect(getGuiAction("actionVertical_Flip"), SIGNAL(toggled(bool)),
StelApp::getInstance().getCore(), SLOT(setFlipVert(bool)));
getGuiAction("actionVertical_Flip")->setChecked(StelApp::getInstance
().getCore()->getFlipVert());
StarMgr* smgr = GETSTELMODULE(StarMgr);
connect(getGuiAction("actionShow_Stars"), SIGNAL(toggled(bool)), smg
r, SLOT(setFlagStars(bool)));
getGuiAction("actionShow_Stars")->setChecked(smgr->getFlagStars());
connect(getGuiAction("actionShow_Stars_Labels"), SIGNAL(toggled(bool
)), smgr, SLOT(setFlagLabels(bool)));
getGuiAction("actionShow_Stars_Labels")->setChecked(smgr->getFlagLab
els());
SolarSystem* ssmgr = GETSTELMODULE(SolarSystem);
connect(getGuiAction("actionShow_Planets_Labels"), SIGNAL(toggled(bo
ol)), ssmgr, SLOT(setFlagLabels(bool)));
getGuiAction("actionShow_Planets_Labels")->setChecked(ssmgr->getFlag
Labels());
connect(getGuiAction("actionShow_Planets_Orbits"), SIGNAL(toggled(bo
ol)), ssmgr, SLOT(setFlagOrbits(bool)));
getGuiAction("actionShow_Planets_Orbits")->setChecked(ssmgr->getFlag
Orbits());
connect(getGuiAction("actionShow_Planets_Trails"), SIGNAL(toggled(bo
ol)), ssmgr, SLOT(setFlagTrails(bool)));
getGuiAction("actionShow_Planets_Trails")->setChecked(ssmgr->getFlag
Trails());
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(getGuiAction("actionAutoHideHorizontalButtonBar"), SIGNAL(to actionsMgr->addAction("actionAutoHideHorizontalButtonBar", miscGroup
ggled(bool)), this, SLOT(setAutoHideHorizontalButtonBar(bool))); , N_("Auto hide horizontal button bar"), this, "autoHideHorizontalButtonBar
getGuiAction("actionAutoHideHorizontalButtonBar")->setChecked(getAut ");
oHideHorizontalButtonBar()); actionsMgr->addAction("actionAutoHideVerticalButtonBar", miscGroup,
connect(getGuiAction("actionAutoHideVerticalButtonBar"), SIGNAL(togg N_("Auto hide vertical button bar"), this, "autoHideVerticalButtonBar");
led(bool)), this, SLOT(setAutoHideVerticalButtonBar(bool)));
getGuiAction("actionAutoHideVerticalButtonBar")->setChecked(getAutoH
ideVerticalButtonBar());
#ifndef DISABLE_SCRIPTING #ifndef DISABLE_SCRIPTING
StelScriptMgr& scriptMgr = StelMainGraphicsView::getInstance().getSc StelScriptMgr* scriptMgr = &StelApp::getInstance().getScriptMgr();
riptMgr(); connect(scriptMgr, SIGNAL(scriptRunning()), this, SLOT(scriptStarted
connect(&scriptMgr, SIGNAL(scriptRunning()), this, SLOT(scriptStarte ()));
d())); connect(scriptMgr, SIGNAL(scriptStopped()), this, SLOT(scriptStopped
connect(&scriptMgr, SIGNAL(scriptStopped()), this, SLOT(scriptStoppe ()));
d()));
#endif #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");
StelButton* b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiAction("actionShow_Location_Window_Global")); StelButton* b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, "actionShow_Location_Window_Global");
skyGui->winBar->addButton(b); skyGui->winBar->addButton(b);
pxmapOn = QPixmap(":/graphicGui/1-on-time.png"); pxmapOn = QPixmap(":/graphicGui/1-on-time.png");
pxmapOff = QPixmap(":/graphicGui/1-off-time.png"); pxmapOff = QPixmap(":/graphicGui/1-off-time.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiAction( "actionShow_DateTime_Window_Global")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, "actionShow_D ateTime_Window_Global");
skyGui->winBar->addButton(b); skyGui->winBar->addButton(b);
pxmapOn = QPixmap(":/graphicGui/5-on-labels.png"); pxmapOn = QPixmap(":/graphicGui/5-on-labels.png");
pxmapOff = QPixmap(":/graphicGui/5-off-labels.png"); pxmapOff = QPixmap(":/graphicGui/5-off-labels.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiAction( "actionShow_SkyView_Window_Global")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, "actionShow_S kyView_Window_Global");
skyGui->winBar->addButton(b); skyGui->winBar->addButton(b);
pxmapOn = QPixmap(":/graphicGui/6-on-search.png"); pxmapOn = QPixmap(":/graphicGui/6-on-search.png");
pxmapOff = QPixmap(":/graphicGui/6-off-search.png"); pxmapOff = QPixmap(":/graphicGui/6-off-search.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiAction( "actionShow_Search_Window_Global")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, "actionShow_S earch_Window_Global");
skyGui->winBar->addButton(b); skyGui->winBar->addButton(b);
pxmapOn = QPixmap(":/graphicGui/8-on-settings.png"); pxmapOn = QPixmap(":/graphicGui/8-on-settings.png");
pxmapOff = QPixmap(":/graphicGui/8-off-settings.png"); pxmapOff = QPixmap(":/graphicGui/8-off-settings.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiAction( "actionShow_Configuration_Window_Global")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, "actionShow_C onfiguration_Window_Global");
skyGui->winBar->addButton(b); skyGui->winBar->addButton(b);
pxmapOn = QPixmap(":/graphicGui/9-on-help.png"); pxmapOn = QPixmap(":/graphicGui/9-on-help.png");
pxmapOff = QPixmap(":/graphicGui/9-off-help.png"); pxmapOff = QPixmap(":/graphicGui/9-off-help.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiAction( "actionShow_Help_Window_Global")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, "actionShow_H elp_Window_Global");
skyGui->winBar->addButton(b); skyGui->winBar->addButton(b);
QPixmap pxmapGlow32x32(":/graphicGui/glow32x32.png"); QPixmap pxmapGlow32x32(":/graphicGui/glow32x32.png");
pxmapOn = QPixmap(":/graphicGui/btConstellationLines-on.png"); pxmapOn = QPixmap(":/graphicGui/btConstellationLines-on.png");
pxmapOff = QPixmap(":/graphicGui/btConstellationLines-off.png"); pxmapOff = QPixmap(":/graphicGui/btConstellationLines-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tion("actionShow_Constellation_Lines")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, "actionS how_Constellation_Lines");
skyGui->buttonBar->addButton(b, "010-constellationsGroup"); skyGui->buttonBar->addButton(b, "010-constellationsGroup");
pxmapOn = QPixmap(":/graphicGui/btConstellationLabels-on.png"); pxmapOn = QPixmap(":/graphicGui/btConstellationLabels-on.png");
pxmapOff = QPixmap(":/graphicGui/btConstellationLabels-off.png"); pxmapOff = QPixmap(":/graphicGui/btConstellationLabels-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tion("actionShow_Constellation_Labels")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, "actionS how_Constellation_Labels");
skyGui->buttonBar->addButton(b, "010-constellationsGroup"); skyGui->buttonBar->addButton(b, "010-constellationsGroup");
pxmapOn = QPixmap(":/graphicGui/btConstellationArt-on.png"); pxmapOn = QPixmap(":/graphicGui/btConstellationArt-on.png");
pxmapOff = QPixmap(":/graphicGui/btConstellationArt-off.png"); pxmapOff = QPixmap(":/graphicGui/btConstellationArt-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tion("actionShow_Constellation_Art")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, "actionS how_Constellation_Art");
skyGui->buttonBar->addButton(b, "010-constellationsGroup"); skyGui->buttonBar->addButton(b, "010-constellationsGroup");
pxmapOn = QPixmap(":/graphicGui/btEquatorialGrid-on.png"); pxmapOn = QPixmap(":/graphicGui/btEquatorialGrid-on.png");
pxmapOff = QPixmap(":/graphicGui/btEquatorialGrid-off.png"); pxmapOff = QPixmap(":/graphicGui/btEquatorialGrid-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tion("actionShow_Equatorial_Grid")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, "actionS how_Equatorial_Grid");
skyGui->buttonBar->addButton(b, "020-gridsGroup"); skyGui->buttonBar->addButton(b, "020-gridsGroup");
pxmapOn = QPixmap(":/graphicGui/btAzimuthalGrid-on.png"); pxmapOn = QPixmap(":/graphicGui/btAzimuthalGrid-on.png");
pxmapOff = QPixmap(":/graphicGui/btAzimuthalGrid-off.png"); pxmapOff = QPixmap(":/graphicGui/btAzimuthalGrid-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tion("actionShow_Azimuthal_Grid")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, "actionS how_Azimuthal_Grid");
skyGui->buttonBar->addButton(b, "020-gridsGroup"); skyGui->buttonBar->addButton(b, "020-gridsGroup");
pxmapOn = QPixmap(":/graphicGui/btGround-on.png"); pxmapOn = QPixmap(":/graphicGui/btGround-on.png");
pxmapOff = QPixmap(":/graphicGui/btGround-off.png"); pxmapOff = QPixmap(":/graphicGui/btGround-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tion("actionShow_Ground")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, "actionS how_Ground");
skyGui->buttonBar->addButton(b, "030-landscapeGroup"); skyGui->buttonBar->addButton(b, "030-landscapeGroup");
pxmapOn = QPixmap(":/graphicGui/btCardinalPoints-on.png"); pxmapOn = QPixmap(":/graphicGui/btCardinalPoints-on.png");
pxmapOff = QPixmap(":/graphicGui/btCardinalPoints-off.png"); pxmapOff = QPixmap(":/graphicGui/btCardinalPoints-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tion("actionShow_Cardinal_Points")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, "actionS how_Cardinal_Points");
skyGui->buttonBar->addButton(b, "030-landscapeGroup"); skyGui->buttonBar->addButton(b, "030-landscapeGroup");
pxmapOn = QPixmap(":/graphicGui/btAtmosphere-on.png"); pxmapOn = QPixmap(":/graphicGui/btAtmosphere-on.png");
pxmapOff = QPixmap(":/graphicGui/btAtmosphere-off.png"); pxmapOff = QPixmap(":/graphicGui/btAtmosphere-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tion("actionShow_Atmosphere")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, "actionS how_Atmosphere");
skyGui->buttonBar->addButton(b, "030-landscapeGroup"); skyGui->buttonBar->addButton(b, "030-landscapeGroup");
pxmapOn = QPixmap(":/graphicGui/btNebula-on.png"); pxmapOn = QPixmap(":/graphicGui/btNebula-on.png");
pxmapOff = QPixmap(":/graphicGui/btNebula-off.png"); pxmapOff = QPixmap(":/graphicGui/btNebula-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tion("actionShow_Nebulas")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, "actionS how_Nebulas");
skyGui->buttonBar->addButton(b, "040-nebulaeGroup"); skyGui->buttonBar->addButton(b, "040-nebulaeGroup");
pxmapOn = QPixmap(":/graphicGui/btPlanets-on.png"); pxmapOn = QPixmap(":/graphicGui/btPlanets-on.png");
pxmapOff = QPixmap(":/graphicGui/btPlanets-off.png"); pxmapOff = QPixmap(":/graphicGui/btPlanets-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tion("actionShow_Planets_Labels")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, "actionS how_Planets_Labels");
skyGui->buttonBar->addButton(b, "040-nebulaeGroup"); skyGui->buttonBar->addButton(b, "040-nebulaeGroup");
pxmapOn = QPixmap(":/graphicGui/btEquatorialMount-on.png"); pxmapOn = QPixmap(":/graphicGui/btEquatorialMount-on.png");
pxmapOff = QPixmap(":/graphicGui/btEquatorialMount-off.png"); pxmapOff = QPixmap(":/graphicGui/btEquatorialMount-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, "actionS
tion("actionSwitch_Equatorial_Mount")); witch_Equatorial_Mount");
b->setChecked(getGuiAction("actionSwitch_Equatorial_Mount")->isCheck
ed());
skyGui->buttonBar->addButton(b, "060-othersGroup"); skyGui->buttonBar->addButton(b, "060-othersGroup");
pxmapOn = QPixmap(":/graphicGui/btGotoSelectedObject-on.png"); pxmapOn = QPixmap(":/graphicGui/btGotoSelectedObject-on.png");
pxmapOff = QPixmap(":/graphicGui/btGotoSelectedObject-off.png"); pxmapOff = QPixmap(":/graphicGui/btGotoSelectedObject-off.png");
buttonGotoSelectedObject = new StelButton(NULL, pxmapOn, pxmapOff, p xmapGlow32x32, getGuiAction("actionGoto_Selected_Object")); buttonGotoSelectedObject = new StelButton(NULL, pxmapOn, pxmapOff, p xmapGlow32x32, "actionGoto_Selected_Object");
skyGui->buttonBar->addButton(buttonGotoSelectedObject, "060-othersGr oup"); skyGui->buttonBar->addButton(buttonGotoSelectedObject, "060-othersGr oup");
pxmapOn = QPixmap(":/graphicGui/btNightView-on.png"); pxmapOn = QPixmap(":/graphicGui/btNightView-on.png");
pxmapOff = QPixmap(":/graphicGui/btNightView-off.png"); pxmapOff = QPixmap(":/graphicGui/btNightView-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tion("actionShow_Night_Mode")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, "actionS how_Night_Mode");
skyGui->buttonBar->addButton(b, "060-othersGroup"); skyGui->buttonBar->addButton(b, "060-othersGroup");
pxmapOn = QPixmap(":/graphicGui/btFullScreen-on.png"); pxmapOn = QPixmap(":/graphicGui/btFullScreen-on.png");
pxmapOff = QPixmap(":/graphicGui/btFullScreen-off.png"); pxmapOff = QPixmap(":/graphicGui/btFullScreen-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tion("actionSet_Full_Screen_Global")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, "actionS et_Full_Screen_Global");
skyGui->buttonBar->addButton(b, "060-othersGroup"); skyGui->buttonBar->addButton(b, "060-othersGroup");
pxmapOn = QPixmap(":/graphicGui/btTimeRewind-on.png"); pxmapOn = QPixmap(":/graphicGui/btTimeRewind-on.png");
pxmapOff = QPixmap(":/graphicGui/btTimeRewind-off.png"); pxmapOff = QPixmap(":/graphicGui/btTimeRewind-off.png");
buttonTimeRewind = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow 32x32, getGuiAction("actionDecrease_Time_Speed")); buttonTimeRewind = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow 32x32, "actionDecrease_Time_Speed");
skyGui->buttonBar->addButton(buttonTimeRewind, "070-timeGroup"); skyGui->buttonBar->addButton(buttonTimeRewind, "070-timeGroup");
pxmapOn = QPixmap(":/graphicGui/btTimeRealtime-on.png"); pxmapOn = QPixmap(":/graphicGui/btTimeRealtime-on.png");
pxmapOff = QPixmap(":/graphicGui/btTimeRealtime-off.png"); pxmapOff = QPixmap(":/graphicGui/btTimeRealtime-off.png");
pxmapDefault = QPixmap(":/graphicGui/btTimePause-on.png"); pxmapDefault = QPixmap(":/graphicGui/btTimePause-on.png");
buttonTimeRealTimeSpeed = new StelButton(NULL, pxmapOn, pxmapOff, px mapDefault, pxmapGlow32x32, getGuiAction("actionSet_Real_Time_Speed")); buttonTimeRealTimeSpeed = new StelButton(NULL, pxmapOn, pxmapOff, px mapDefault, pxmapGlow32x32, "actionSet_Real_Time_Speed");
skyGui->buttonBar->addButton(buttonTimeRealTimeSpeed, "070-timeGroup "); skyGui->buttonBar->addButton(buttonTimeRealTimeSpeed, "070-timeGroup ");
pxmapOn = QPixmap(":/graphicGui/btTimeNow-on.png"); pxmapOn = QPixmap(":/graphicGui/btTimeNow-on.png");
pxmapOff = QPixmap(":/graphicGui/btTimeNow-off.png"); pxmapOff = QPixmap(":/graphicGui/btTimeNow-off.png");
buttonTimeCurrent = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlo w32x32, getGuiAction("actionReturn_To_Current_Time")); buttonTimeCurrent = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlo w32x32, "actionReturn_To_Current_Time");
skyGui->buttonBar->addButton(buttonTimeCurrent, "070-timeGroup"); skyGui->buttonBar->addButton(buttonTimeCurrent, "070-timeGroup");
pxmapOn = QPixmap(":/graphicGui/btTimeForward-on.png"); pxmapOn = QPixmap(":/graphicGui/btTimeForward-on.png");
pxmapOff = QPixmap(":/graphicGui/btTimeForward-off.png"); pxmapOff = QPixmap(":/graphicGui/btTimeForward-off.png");
buttonTimeForward = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlo w32x32, getGuiAction("actionIncrease_Time_Speed")); buttonTimeForward = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlo w32x32, "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/btQuit.png"); pxmapOn = QPixmap(":/graphicGui/btQuit.png");
b = new StelButton(NULL, pxmapOn, pxmapOn, pxmapGlow32x32, getGuiAct ion("actionQuit_Global")); b = new StelButton(NULL, pxmapOn, pxmapOn, pxmapGlow32x32, "actionQu it_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); atopLevelGraphicsWidget->setLayout(l);
setStelStyle(StelApp::getInstance().getCurrentStelStyle()); setStelStyle(StelApp::getInstance().getCurrentStelStyle());
skyGui->setGeometry(stelAppGraphicsWidget->geometry()); skyGui->setGeometry(atopLevelGraphicsWidget->geometry());
skyGui->updateBarsPos(); skyGui->updateBarsPos();
// The disabled text for checkboxes is embossed with the QPalette::L ight setting for the ColorGroup Disabled. // The disabled text for checkboxes is embossed with the QPalette::L ight setting for the ColorGroup Disabled.
// It doesn't appear to be possible to set this from the stylesheet. Instead we'll make it 100% transparent // It doesn't appear to be possible to set this from the stylesheet. Instead we'll make it 100% transparent
// and set the text color for disabled in the stylesheets. // and set the text color for disabled in the stylesheets.
QPalette p = QApplication::palette(); QPalette p = QGuiApplication::palette();
p.setColor(QPalette::Disabled, QPalette::Light, QColor(0,0,0,0)); p.setColor(QPalette::Disabled, QPalette::Light, QColor(0,0,0,0));
// And this is for the focus... apparently the focus indicator is t he inverted value for Active/Button. // And this is for the focus... apparently the focus indicator is t he inverted value for Active/Button.
p.setColor(QPalette::Active, QPalette::Button, QColor(255,255,255)); p.setColor(QPalette::Active, QPalette::Button, QColor(255,255,255));
QApplication::setPalette(p); QGuiApplication::setPalette(p);
// FIXME: Workaround for set UI language when app is started --AW // FIXME: Workaround for set UI language when app is started --AW
updateI18n(); updateI18n();
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)
;
getGuiAction("actionShow_Constellation_Lines")->setChecked(constella
tionMgr->getFlagLines());
connect(getGuiAction("actionShow_Constellation_Lines"),
SIGNAL(toggled(bool)),
constellationMgr,
SLOT(setFlagLines(bool)));
connect(constellationMgr,
SIGNAL(linesDisplayedChanged(const b
ool)),
this,
SLOT(linesDisplayedUpdated(const boo
l)));
getGuiAction("actionShow_Constellation_Art")->setChecked(constellati
onMgr->getFlagArt());
connect(getGuiAction("actionShow_Constellation_Art"),
SIGNAL(toggled(bool)),
constellationMgr,
SLOT(setFlagArt(bool)));
connect(constellationMgr,
SIGNAL(artDisplayedChanged(const boo
l)),
this,
SLOT(artDisplayedUpdated(const bool)
));
getGuiAction("actionShow_Constellation_Labels")->setChecked(constell
ationMgr->getFlagLabels());
connect(getGuiAction("actionShow_Constellation_Labels"),
SIGNAL(toggled(bool)),
constellationMgr,
SLOT(setFlagLabels(bool)));
connect(constellationMgr,
SIGNAL(namesDisplayedChanged(const b
ool)),
this,
SLOT(namesDisplayedUpdated(const boo
l)));
getGuiAction("actionShow_Constellation_Boundaries")->setChecked(cons
tellationMgr->getFlagBoundaries());
connect(getGuiAction("actionShow_Constellation_Boundaries"),
SIGNAL(toggled(bool)),
constellationMgr,
SLOT(setFlagBoundaries(bool)));
connect(constellationMgr,
SIGNAL(boundariesDisplayedChanged(co
nst bool)),
this,
SLOT(boundariesDisplayedUpdated(cons
t bool)));
}
void StelGui::initGrindLineMgr()
{
GridLinesMgr* gridLineManager = GETSTELMODULE(GridLinesMgr);
getGuiAction("actionShow_Equatorial_Grid")->setChecked(gridLineManag
er->getFlagEquatorGrid());
connect(getGuiAction("actionShow_Equatorial_Grid"),
SIGNAL(toggled(bool)),
gridLineManager,
SLOT(setFlagEquatorGrid(bool)));
connect(gridLineManager,
SIGNAL(equatorGridDisplayedChanged(c
onst bool)),
this,
SLOT(equatorGridDisplayedUpdated(con
st bool)));
getGuiAction("actionShow_Azimuthal_Grid")->setChecked(gridLineManage
r->getFlagAzimuthalGrid());
connect(getGuiAction("actionShow_Azimuthal_Grid"),
SIGNAL(toggled(bool)),
gridLineManager,
SLOT(setFlagAzimuthalGrid(bool)));
connect(gridLineManager,
SIGNAL(azimuthalGridDisplayedChanged
(const bool)),
this,
SLOT(azimuthalGridDisplayedUpdated(c
onst bool)));
getGuiAction("actionShow_Ecliptic_Line")->setChecked(gridLineManager
->getFlagEclipticLine());
connect(getGuiAction("actionShow_Ecliptic_Line"),
SIGNAL(toggled(bool)),
gridLineManager,
SLOT(setFlagEclipticLine(bool)));
connect(gridLineManager,
SIGNAL(eclipticLineDisplayedChanged(
const bool)),
this,
SLOT(eclipticLineDisplayedUpdated(co
nst bool)));
getGuiAction("actionShow_Equator_Line")->setChecked(gridLineManager-
>getFlagEquatorLine());
connect(getGuiAction("actionShow_Equator_Line"),
SIGNAL(toggled(bool)),
gridLineManager,
SLOT(setFlagEquatorLine(bool)));
connect(gridLineManager,
SIGNAL(equatorLineDisplayedChanged(c
onst bool)),
this,
SLOT(equatorLineDisplayedUpdated(con
st bool)));
getGuiAction("actionShow_Meridian_Line")->setChecked(gridLineManager
->getFlagMeridianLine());
connect(getGuiAction("actionShow_Meridian_Line"),
SIGNAL(toggled(bool)),
gridLineManager,
SLOT(setFlagMeridianLine(bool)));
connect(gridLineManager,
SIGNAL(meridianLineDisplayedChanged(
const bool)),
this,
SLOT(meridianLineDisplayedUpdated(co
nst bool)));
getGuiAction("actionShow_Horizon_Line")->setChecked(gridLineManager-
>getFlagHorizonLine());
connect(getGuiAction("actionShow_Horizon_Line"),
SIGNAL(toggled(bool)),
gridLineManager,
SLOT(setFlagHorizonLine(bool)));
connect(gridLineManager,
SIGNAL(horizonLineDisplayedChanged(c
onst bool)),
this,
SLOT(horizonLineDisplayedUpdated(con
st bool)));
getGuiAction("actionShow_Equatorial_J2000_Grid")->setChecked(gridLin
eManager->getFlagEquatorJ2000Grid());
connect(getGuiAction("actionShow_Equatorial_J2000_Grid"),
SIGNAL(toggled(bool)),
gridLineManager,
SLOT(setFlagEquatorJ2000Grid(bool)))
;
connect(gridLineManager,
SIGNAL(equatorJ2000GridDisplayedChan
ged(const bool)),
this,
SLOT(equatorJ2000GridDisplayedUpdate
d(const bool)));
getGuiAction("actionShow_Ecliptic_J2000_Grid")->setChecked(gridLineM
anager->getFlagEclipticJ2000Grid());
connect(getGuiAction("actionShow_Ecliptic_J2000_Grid"),
SIGNAL(toggled(bool)),
gridLineManager,
SLOT(setFlagEclipticJ2000Grid(bool))
);
connect(gridLineManager,
SIGNAL(eclipticJ2000GridDisplayedCha
nged(const bool)),
this,
SLOT(eclipticJ2000GridDisplayedUpdat
ed(const bool)));
getGuiAction("actionShow_Galactic_Grid")->setChecked(gridLineManager
->getFlagGalacticGrid());
connect(getGuiAction("actionShow_Galactic_Grid"),
SIGNAL(toggled(bool)),
gridLineManager,
SLOT(setFlagGalacticGrid(bool)));
connect(gridLineManager,
SIGNAL(galacticGridDisplayedChanged(
const bool)),
this,
SLOT(galacticGridDisplayedUpdated(co
nst bool)));
getGuiAction("actionShow_Galactic_Plane_Line")->setChecked(gridLineM
anager->getFlagGalacticPlaneLine());
connect(getGuiAction("actionShow_Galactic_Plane_Line"),
SIGNAL(toggled(bool)),
gridLineManager,
SLOT(setFlagGalacticPlaneLine(bool))
);
connect(gridLineManager,
SIGNAL(galacticPlaneLineDisplayedCha
nged(const bool)),
this,
SLOT(galacticPlaneLineDisplayedUpdat
ed(const bool)));
}
void StelGui::initLandscapeMgr()
{
LandscapeMgr* landscapeMgr = GETSTELMODULE(LandscapeMgr);
getGuiAction("actionShow_Ground")->setChecked(landscapeMgr->getFlagL
andscape());
connect(getGuiAction("actionShow_Ground"),
SIGNAL(toggled(bool)),
landscapeMgr,
SLOT(setFlagLandscape(bool)));
connect(landscapeMgr,
SIGNAL(landscapeDisplayedChanged(con
st bool)),
this,
SLOT(landscapeDisplayedUpdated(const
bool)));
getGuiAction("actionShow_Cardinal_Points")->setChecked(landscapeMgr-
>getFlagCardinalsPoints());
connect(getGuiAction("actionShow_Cardinal_Points"),
SIGNAL(toggled(bool)),
landscapeMgr,
SLOT(setFlagCardinalsPoints(bool)));
connect(landscapeMgr,
SIGNAL(cardinalsPointsDisplayedChang
ed(const bool)),
this,
SLOT(cardinalsPointsDisplayedUpdated
(const bool)));
getGuiAction("actionShow_Atmosphere")->setChecked(landscapeMgr->getF
lagAtmosphere());
connect(getGuiAction("actionShow_Atmosphere"),
SIGNAL(toggled(bool)),
landscapeMgr,
SLOT(setFlagAtmosphere(bool)));
connect(landscapeMgr,
SIGNAL(atmosphereDisplayedChanged(co
nst bool)),
this,
SLOT(atmosphereDisplayedUpdated(cons
t bool)));
getGuiAction("actionShow_Fog")->setChecked(landscapeMgr->getFlagFog(
));
connect(getGuiAction("actionShow_Fog"),
SIGNAL(toggled(bool)),
landscapeMgr,
SLOT(setFlagFog(bool)));
connect(landscapeMgr,
SIGNAL(fogDisplayedChanged(const boo
l)),
this,
SLOT(fogDisplayedUpdated(const bool)
));
}
void StelGui::quit() void StelGui::quit()
{ {
#ifndef DISABLE_SCRIPTING StelApp::getInstance().quit();
StelMainGraphicsView::getInstance().getScriptMgr().stopScript();
#endif
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 QString& section) void StelGui::setStelStyle(const QString& section)
skipping to change at line 758 skipping to change at line 429
htmlStyleFileName = ":/graphicGui/nightHtml.css"; htmlStyleFileName = ":/graphicGui/nightHtml.css";
} }
else if (section=="color") else if (section=="color")
{ {
qtStyleFileName = ":/graphicGui/normalStyle.css"; qtStyleFileName = ":/graphicGui/normalStyle.css";
htmlStyleFileName = ":/graphicGui/normalHtml.css"; htmlStyleFileName = ":/graphicGui/normalHtml.css";
} }
// Load Qt style sheet // Load Qt style sheet
QFile styleFile(qtStyleFileName); QFile styleFile(qtStyleFileName);
styleFile.open(QIODevice::ReadOnly); if(styleFile.open(QIODevice::ReadOnly))
currentStelStyle.qtStyleSheet = styleFile.readAll(); {
currentStelStyle.qtStyleSheet = styleFile.readAll();
styleFile.close();
}
QFile htmlStyleFile(htmlStyleFileName); QFile htmlStyleFile(htmlStyleFileName);
htmlStyleFile.open(QIODevice::ReadOnly); if(htmlStyleFile.open(QIODevice::ReadOnly))
currentStelStyle.htmlStyleSheet = htmlStyleFile.readAll(); {
currentStelStyle.htmlStyleSheet = htmlStyleFile.read
All();
htmlStyleFile.close();
}
} }
qApp->setStyleSheet(currentStelStyle.qtStyleSheet);
locationDialog->styleChanged(); locationDialog->styleChanged();
dateTimeDialog->styleChanged(); dateTimeDialog->styleChanged();
configurationDialog->styleChanged(); configurationDialog->styleChanged();
searchDialog->styleChanged(); searchDialog->styleChanged();
viewDialog->styleChanged(); viewDialog->styleChanged();
#ifdef ENABLE_SCRIPT_CONSOLE #ifdef ENABLE_SCRIPT_CONSOLE
scriptConsole->styleChanged(); scriptConsole->styleChanged();
#endif // ENABLE_SCRIPT_CONSOLE #endif // ENABLE_SCRIPT_CONSOLE
} }
void StelGui::updateI18n() void StelGui::updateI18n()
{ {
StelGuiBase::updateI18n(); // Translate all action texts
foreach (QObject* obj, StelMainView::getInstance().children())
{
QAction* a = qobject_cast<QAction*>(obj);
if (a)
{
const QString& englishText = a->property("englishTex
t").toString();
if (!englishText.isEmpty())
{
a->setText(q_(englishText));
}
}
}
} }
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)
skipping to change at line 819 skipping to change at line 507
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;
if (getGuiAction("actionShow_Stars")->isChecked() != flag) {
getGuiAction("actionShow_Stars")->setChecked(flag);
}
flag = GETSTELMODULE(NebulaMgr)->getFlagHints();
if (getGuiAction("actionShow_Nebulas")->isChecked() != flag)
getGuiAction("actionShow_Nebulas")->setChecked(flag);
// XXX: this should probably be removed, we can use property NOTIFY instead.
flag = GETSTELMODULE(StelSkyLayerMgr)->getFlagShow(); flag = GETSTELMODULE(StelSkyLayerMgr)->getFlagShow();
if (getGuiAction("actionShow_DSS")->isChecked() != flag) if (getAction("actionShow_DSS")->isChecked() != flag)
getGuiAction("actionShow_DSS")->setChecked(flag); getAction("actionShow_DSS")->setChecked(flag);
flag = mmgr->getMountMode() != StelMovementMgr::MountAltAzimuthal;
if (getGuiAction("actionSwitch_Equatorial_Mount")->isChecked() != fl
ag)
getGuiAction("actionSwitch_Equatorial_Mount")->setChecked(fl
ag);
SolarSystem* ssmgr = GETSTELMODULE(SolarSystem);
flag = ssmgr->getFlagLabels();
if (getGuiAction("actionShow_Planets_Labels")->isChecked() != flag)
getGuiAction("actionShow_Planets_Labels")->setChecked(flag);
flag = ssmgr->getFlagOrbits();
if (getGuiAction("actionShow_Planets_Orbits")->isChecked() != flag)
getGuiAction("actionShow_Planets_Orbits")->setChecked(flag);
flag = ssmgr->getFlagTrails();
if (getGuiAction("actionShow_Planets_Trails")->isChecked() != flag)
getGuiAction("actionShow_Planets_Trails")->setChecked(flag);
flag = StelApp::getInstance().getVisionModeNight(); flag = StelApp::getInstance().getVisionModeNight();
if (getGuiAction("actionShow_Night_Mode")->isChecked() != flag) if (getAction("actionShow_Night_Mode")->isChecked() != flag)
getGuiAction("actionShow_Night_Mode")->setChecked(flag); getAction("actionShow_Night_Mode")->setChecked(flag);
flag = StelMainWindow::getInstance().isFullScreen();
if (getGuiAction("actionSet_Full_Screen_Global")->isChecked() != fla flag = StelMainView::getInstance().isFullScreen();
g) if (getAction("actionSet_Full_Screen_Global")->isChecked() != flag)
getGuiAction("actionSet_Full_Screen_Global")->setChecked(fla getAction("actionSet_Full_Screen_Global")->setChecked(flag);
g);
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();
} }
dateTimeDialog->setDateTime(core->getJDay()); dateTimeDialog->setDateTime(core->getJDay());
} }
// Add a new progress bar in the lower right corner of the screen.
QProgressBar* StelGui::addProgressBar()
{
return skyGui->progressBarMgr->addProgressBar();
}
#ifndef DISABLE_SCRIPTING #ifndef DISABLE_SCRIPTING
void StelGui::setScriptKeys(bool b) void StelGui::setScriptKeys(bool b)
{ {
if (b) if (b)
{ {
getGuiAction("actionDecrease_Time_Speed")->setShortcut(QKeyS getAction("actionDecrease_Time_Speed")->setShortcut("");
equence()); getAction("actionIncrease_Time_Speed")->setShortcut("");
getGuiAction("actionIncrease_Time_Speed")->setShortcut(QKeyS getAction("actionSet_Real_Time_Speed")->setShortcut("");
equence()); getAction("actionDecrease_Script_Speed")->setShortcut("J");
getGuiAction("actionSet_Real_Time_Speed")->setShortcut(QKeyS getAction("actionIncrease_Script_Speed")->setShortcut("L");
equence()); getAction("actionSet_Real_Script_Speed")->setShortcut("K");
getGuiAction("actionDecrease_Script_Speed")->setShortcut(QKe
ySequence("J"));
getGuiAction("actionIncrease_Script_Speed")->setShortcut(QKe
ySequence("L"));
getGuiAction("actionSet_Real_Script_Speed")->setShortcut(QKe
ySequence("K"));
} }
else else
{ {
getGuiAction("actionDecrease_Script_Speed")->setShortcut(QKe getAction("actionDecrease_Script_Speed")->setShortcut("");
ySequence()); getAction("actionIncrease_Script_Speed")->setShortcut("");
getGuiAction("actionIncrease_Script_Speed")->setShortcut(QKe getAction("actionSet_Real_Script_Speed")->setShortcut("");
ySequence()); getAction("actionDecrease_Time_Speed")->setShortcut("J");
getGuiAction("actionSet_Real_Script_Speed")->setShortcut(QKe getAction("actionIncrease_Time_Speed")->setShortcut("L");
ySequence()); getAction("actionSet_Real_Time_Speed")->setShortcut("K");
getGuiAction("actionDecrease_Time_Speed")->setShortcut(QKeyS
equence("J"));
getGuiAction("actionIncrease_Time_Speed")->setShortcut(QKeyS
equence("L"));
getGuiAction("actionSet_Real_Time_Speed")->setShortcut(QKeyS
equence("K"));
} }
} }
void StelGui::increaseScriptSpeed() void StelGui::increaseScriptSpeed()
{ {
StelMainGraphicsView::getInstance().getScriptMgr().setScriptRate(Ste lMainGraphicsView::getInstance().getScriptMgr().getScriptRate()*2); StelApp::getInstance().getScriptMgr().setScriptRate(StelApp::getInst ance().getScriptMgr().getScriptRate()*2);
} }
void StelGui::decreaseScriptSpeed() void StelGui::decreaseScriptSpeed()
{ {
StelMainGraphicsView::getInstance().getScriptMgr().setScriptRate(Ste lMainGraphicsView::getInstance().getScriptMgr().getScriptRate()/2); StelApp::getInstance().getScriptMgr().setScriptRate(StelApp::getInst ance().getScriptMgr().getScriptRate()/2);
} }
void StelGui::setRealScriptSpeed() void StelGui::setRealScriptSpeed()
{ {
StelMainGraphicsView::getInstance().getScriptMgr().setScriptRate(1); StelApp::getInstance().getScriptMgr().setScriptRate(1);
} }
void StelGui::stopScript() void StelGui::stopScript()
{ {
StelMainGraphicsView::getInstance().getScriptMgr().stopScript(); StelApp::getInstance().getScriptMgr().stopScript();
} }
void StelGui::pauseScript() void StelGui::pauseScript()
{ {
StelMainGraphicsView::getInstance().getScriptMgr().pauseScript(); StelApp::getInstance().getScriptMgr().pauseScript();
} }
void StelGui::resumeScript() void StelGui::resumeScript()
{ {
StelMainGraphicsView::getInstance().getScriptMgr().resumeScript(); StelApp::getInstance().getScriptMgr().resumeScript();
} }
#endif #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,
QPixmap(":/graphicGui/b tFlipVertical-on.png"), QPixmap(":/graphicGui/b tFlipVertical-on.png"),
QPixmap(":/graphicGui/b tFlipVertical-off.png"), QPixmap(":/graphicGui/b tFlipVertical-off.png"),
pxmapGlow32x32, pxmapGlow32x32,
getGuiAction("actionVer tical_Flip")); "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,
QPixmap(":/graphicGui/ btFlipHorizontal-on.png"), QPixmap(":/graphicGui/ btFlipHorizontal-on.png"),
QPixmap(":/graphicGui/ btFlipHorizontal-off.png"), QPixmap(":/graphicGui/ btFlipHorizontal-off.png"),
pxmapGlow32x32, pxmapGlow32x32,
getGuiAction("actionHo rizontal_Flip")); "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("actionVertical_Flip");
getButtonBar()->hideButton("actionHorizontal_Flip"); getButtonBar()->hideButton("actionHorizontal_Flip");
} }
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, getGuiAction("actionShow_DSS")); btShowNebulaeBackground = new StelButton(NULL, QPixm ap(":/graphicGui/btDSS-on.png"), QPixmap(":/graphicGui/btDSS-off.png"), pxm apGlow32x32, "actionShow_DSS");
} }
getButtonBar()->addButton(btShowNebulaeBackground, "040-nebu laeGroup"); getButtonBar()->addButton(btShowNebulaeBackground, "040-nebu laeGroup");
} else { } else {
getButtonBar()->hideButton("actionShow_DSS"); getButtonBar()->hideButton("actionShow_DSS");
} }
flagShowNebulaBackgroundButton = b; flagShowNebulaBackgroundButton = b;
} }
void StelGui::setVisible(bool b) void StelGui::setVisible(bool b)
{ {
skipping to change at line 1078 skipping to change at line 741
{ {
setScriptKeys(false); setScriptKeys(false);
} }
#endif #endif
void StelGui::setGuiVisible(bool b) void StelGui::setGuiVisible(bool b)
{ {
setVisible(b); setVisible(b);
} }
QAction *StelGui::getGuiAction(const QString &actionName) StelAction* StelGui::getAction(const QString& actionName)
{ {
StelShortcutMgr* shortcutMgr = StelApp::getInstance().getStelShortcu return StelApp::getInstance().getStelActionManager()->findAction(act
tManager(); ionName);
return shortcutMgr->getGuiAction(actionName);
} }
/* ************************************************************************ ****************************************** */ /* ************************************************************************ ****************************************** */
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark Process changes from the ConstellationMgr #pragma mark Process changes from the ConstellationMgr
#endif #endif
/* ************************************************************************ ****************************************** */ /* ************************************************************************ ****************************************** */
void StelGui::artDisplayedUpdated(const bool displayed)
{
if (getGuiAction("actionShow_Constellation_Art")->isChecked() != dis
played) {
getGuiAction("actionShow_Constellation_Art")->setChecked(dis
played);
}
}
void StelGui::boundariesDisplayedUpdated(const bool displayed)
{
if (getGuiAction("actionShow_Constellation_Boundaries")->isChecked()
!= displayed) {
getGuiAction("actionShow_Constellation_Boundaries")->setChec
ked(displayed);
}
}
void StelGui::linesDisplayedUpdated(const bool displayed)
{
if (getGuiAction("actionShow_Constellation_Lines")->isChecked() != d
isplayed) {
getGuiAction("actionShow_Constellation_Lines")->setChecked(d
isplayed);
}
}
void StelGui::namesDisplayedUpdated(const bool displayed)
{
if (getGuiAction("actionShow_Constellation_Labels")->isChecked() !=
displayed) {
getGuiAction("actionShow_Constellation_Labels")->setChecked(
displayed);
}
}
/* ************************************************************************ ****************************************** */ /* ************************************************************************ ****************************************** */
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark Process changes from the GridLinesMgr #pragma mark Process changes from the GridLinesMgr
#endif #endif
/* ************************************************************************ ****************************************** */ /* ************************************************************************ ****************************************** */
void StelGui::azimuthalGridDisplayedUpdated(const bool displayed)
{
if (getGuiAction("actionShow_Azimuthal_Grid")->isChecked() != displa
yed) {
getGuiAction("actionShow_Azimuthal_Grid")->setChecked(displa
yed);
}
}
void StelGui::equatorGridDisplayedUpdated(const bool displayed)
{
if (getGuiAction("actionShow_Equatorial_Grid")->isChecked() != displ
ayed) {
getGuiAction("actionShow_Equatorial_Grid")->setChecked(displ
ayed);
}
}
void StelGui::equatorJ2000GridDisplayedUpdated(const bool displayed)
{
if (getGuiAction("actionShow_Equatorial_J2000_Grid")->isChecked() !=
displayed) {
getGuiAction("actionShow_Equatorial_J2000_Grid")->setChecked
(displayed);
}
}
void StelGui::eclipticJ2000GridDisplayedUpdated(const bool displayed)
{
if (getGuiAction("actionShow_Ecliptic_J2000_Grid")->isChecked() != d
isplayed) {
getGuiAction("actionShow_Ecliptic_J2000_Grid")->setChecked(d
isplayed);
}
}
void StelGui::galacticGridDisplayedUpdated(const bool displayed)
{
if (getGuiAction("actionShow_Galactic_Grid")->isChecked() != display
ed) {
getGuiAction("actionShow_Galactic_Grid")->setChecked(display
ed);
}
}
void StelGui::equatorLineDisplayedUpdated(const bool displayed)
{
if (getGuiAction("actionShow_Equator_Line")->isChecked() != displaye
d) {
getGuiAction("actionShow_Equator_Line")->setChecked(displaye
d);
}
}
void StelGui::eclipticLineDisplayedUpdated(const bool displayed)
{
if (getGuiAction("actionShow_Ecliptic_Line")->isChecked() != display
ed) {
getGuiAction("actionShow_Ecliptic_Line")->setChecked(display
ed);
}
}
void StelGui::meridianLineDisplayedUpdated(const bool displayed)
{
if (getGuiAction("actionShow_Meridian_Line")->isChecked() != display
ed) {
getGuiAction("actionShow_Meridian_Line")->setChecked(display
ed);
}
}
void StelGui::horizonLineDisplayedUpdated(const bool displayed)
{
if (getGuiAction("actionShow_Horizon_Line")->isChecked() != displaye
d) {
getGuiAction("actionShow_Horizon_Line")->setChecked(displaye
d);
}
}
void StelGui::galacticPlaneLineDisplayedUpdated(const bool displayed)
{
if (getGuiAction("actionShow_Galactic_Plane_Line")->isChecked() != d
isplayed) {
getGuiAction("actionShow_Galactic_Plane_Line")->setChecked(d
isplayed);
}
}
/* ************************************************************************ ****************************************** */ /* ************************************************************************ ****************************************** */
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark Process changes from the GridLinesMgr #pragma mark Process changes from the GridLinesMgr
#endif #endif
/* ************************************************************************ ****************************************** */ /* ************************************************************************ ****************************************** */
void StelGui::atmosphereDisplayedUpdated(const bool displayed)
{
if (getGuiAction("actionShow_Atmosphere")->isChecked() != displayed)
{
getGuiAction("actionShow_Atmosphere")->setChecked(displayed)
;
}
}
void StelGui::cardinalsPointsDisplayedUpdated(const bool displayed)
{
if (getGuiAction("actionShow_Cardinal_Points")->isChecked() != displ
ayed) {
getGuiAction("actionShow_Cardinal_Points")->setChecked(displ
ayed);
}
}
void StelGui::fogDisplayedUpdated(const bool displayed)
{
if (getGuiAction("actionShow_Fog")->isChecked() != displayed) {
getGuiAction("actionShow_Fog")->setChecked(displayed);
}
}
void StelGui::landscapeDisplayedUpdated(const bool displayed)
{
if (getGuiAction("actionShow_Ground")->isChecked() != displayed) {
getGuiAction("actionShow_Ground")->setChecked(displayed);
}
}
void StelGui::copySelectedObjectInfo(void) void StelGui::copySelectedObjectInfo(void)
{ {
QApplication::clipboard()->setText(skyGui->infoPanel->getSelectedTex t()); QGuiApplication::clipboard()->setText(skyGui->infoPanel->getSelected Text());
} }
 End of changes. 80 change blocks. 
803 lines changed or deleted 181 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/