StelGui.cpp   StelGui.cpp 
skipping to change at line 24 skipping to change at line 24
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#include "StelGui.hpp" #include "StelGui.hpp"
#include "StelGuiItems.hpp" #include "StelGuiItems.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "Projector.hpp" #include "StelProjector.hpp"
#include "MovementMgr.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 "Navigator.hpp" #include "StelNavigator.hpp"
#include "StelObjectType.hpp" #include "StelObjectType.hpp"
#include "StelObject.hpp" #include "StelObject.hpp"
#include "Projector.hpp" #include "StelProjector.hpp"
#include "SolarSystem.hpp" #include "SolarSystem.hpp"
#include "SkyBackground.hpp" #include "StelSkyImageMgr.hpp"
#include "StelStyle.hpp" #include "StelStyle.hpp"
#include "SkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include "MeteorMgr.hpp" #include "MeteorMgr.hpp"
#include "DownloadPopup.hpp"
#include "StelDownloadMgr.hpp"
#include <QDebug> #include <QDebug>
#include <QTimeLine> #include <QTimeLine>
#include <QFontDatabase> #include <QFontDatabase>
#include <QMouseEvent> #include <QMouseEvent>
#include <QAction> #include <QAction>
#include <QApplication> #include <QApplication>
#include <QFile> #include <QFile>
#include <QTextDocument> #include <QTextDocument>
#include <QTextBrowser> #include <QTextBrowser>
skipping to change at line 95 skipping to change at line 98
document()->clear(); document()->clear();
} }
else else
{ {
// just print details of the first item for now // just print details of the first item for now
QString s = selected[0]->getInfoString(StelApp::getInstance( ).getCore(), infoTextFilters); QString s = selected[0]->getInfoString(StelApp::getInstance( ).getCore(), infoTextFilters);
setHtml(s); setHtml(s);
} }
} }
StelGui::StelGui() StelGui::StelGui() : initDone(false)
{ {
// QPixmapCache::setCacheLimit(30000); ? // QPixmapCache::setCacheLimit(30000); ?
setObjectName("StelGui"); setObjectName("StelGui");
winBar = NULL; winBar = NULL;
buttonBar = NULL; buttonBar = NULL;
infoPanel = NULL; infoPanel = NULL;
buttonBarPath = NULL; buttonBarPath = NULL;
lastButtonbarWidth = 0; lastButtonbarWidth = 0;
autoHidebts = NULL; autoHidebts = NULL;
autoHideHorizontalButtonBar = true; autoHideHorizontalButtonBar = true;
autoHideVerticalButtonBar = true; autoHideVerticalButtonBar = true;
animLeftBarTimeLine = new QTimeLine(200, this); animLeftBarTimeLine = new QTimeLine(200, this);
animLeftBarTimeLine->setCurveShape(QTimeLine::EaseInOutCurve); animLeftBarTimeLine->setCurveShape(QTimeLine::EaseInOutCurve);
connect(animLeftBarTimeLine, SIGNAL(valueChanged(qreal)), this, SLOT (updateBarsPos())); connect(animLeftBarTimeLine, SIGNAL(valueChanged(qreal)), this, SLOT (updateBarsPos()));
animBottomBarTimeLine = new QTimeLine(200, this); animBottomBarTimeLine = new QTimeLine(200, this);
animBottomBarTimeLine->setCurveShape(QTimeLine::EaseInOutCurve); animBottomBarTimeLine->setCurveShape(QTimeLine::EaseInOutCurve);
connect(animBottomBarTimeLine, SIGNAL(valueChanged(qreal)), this, SL OT(updateBarsPos())); connect(animBottomBarTimeLine, SIGNAL(valueChanged(qreal)), this, SL OT(updateBarsPos()));
flipHoriz = NULL; flipHoriz = NULL;
flipVert = NULL; flipVert = NULL;
btShowNebulaeBackground = NULL;
} }
StelGui::~StelGui() StelGui::~StelGui()
{ {
infoPanel->deleteLater();
} }
/************************************************************************* /*************************************************************************
Reimplementation of the getCallOrder method Reimplementation of the getCallOrder method
*************************************************************************/ *************************************************************************/
double StelGui::getCallOrder(StelModuleActionName actionName) const double StelGui::getCallOrder(StelModuleActionName actionName) const
{ {
if (actionName==StelModule::ActionDraw) if (actionName==StelModule::ActionDraw)
return 100000; return 100000;
if (actionName==StelModule::ActionHandleMouseMoves) if (actionName==StelModule::ActionHandleMouseMoves)
skipping to change at line 149 skipping to change at line 155
qDebug() << "Creating GUI ..."; qDebug() << "Creating GUI ...";
//////////////////////////////////////////////////////////////////// /// //////////////////////////////////////////////////////////////////// ///
// 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, "viewing/flag_constellation_drawing"); addGuiActions("actionShow_Constellation_Lines", N_("Constellation li nes"), "C", group, true, false, "viewing/flag_constellation_drawing");
addGuiActions("actionShow_Constellation_Art", N_("Constellation art" ), "R", group, true, false, "viewing/flag_constellation_art"); addGuiActions("actionShow_Constellation_Art", N_("Constellation art" ), "R", group, true, false, "viewing/flag_constellation_art");
addGuiActions("actionShow_Constellation_Labels", N_("Constellation l abels"), "V", group, true, false, "viewing/flag_constellation_name"); addGuiActions("actionShow_Constellation_Labels", N_("Constellation l abels"), "V", group, true, false, "viewing/flag_constellation_name");
addGuiActions("actionShow_Constellation_Boundaries", N_("Constellati on boundaries"), "B", group, true, false, "viewing/flag_constellation_bound aries"); addGuiActions("actionShow_Constellation_Boundaries", N_("Constellati on boundaries"), "B", group, true, false, "viewing/flag_constellation_bound aries");
addGuiActions("actionShow_Azimutal_Grid", N_("Azimutal grid"), "Z", group, true, false, "viewing/flag_azimutal_grid"); addGuiActions("actionShow_Azimuthal_Grid", N_("Azimuthal grid"), "Z" , group, true, false, "viewing/flag_azimuthal_grid");
addGuiActions("actionShow_Equatorial_Grid", N_("Equatorial grid"), " E", group, true, false, "viewing/flag_equatorial_grid"); addGuiActions("actionShow_Equatorial_Grid", N_("Equatorial grid"), " E", group, true, false, "viewing/flag_equatorial_grid");
addGuiActions("actionShow_Equatorial_J2000_Grid", N_("Equatorial J20 00 grid"), "", group, true, false, "viewing/flag_equatorial_J2000_grid"); addGuiActions("actionShow_Equatorial_J2000_Grid", N_("Equatorial J20 00 grid"), "", group, true, false, "viewing/flag_equatorial_J2000_grid");
addGuiActions("actionShow_Ecliptic_Line", N_("Ecliptic line"), ",", group, true, false, "viewing/flag_ecliptic_line"); addGuiActions("actionShow_Ecliptic_Line", N_("Ecliptic line"), ",", group, true, false, "viewing/flag_ecliptic_line");
addGuiActions("actionShow_Equator_Line", N_("Equator line"), ".", gr oup, true, false, "viewing/flag_equator_line"); addGuiActions("actionShow_Equator_Line", N_("Equator line"), ".", gr oup, true, false, "viewing/flag_equator_line");
addGuiActions("actionShow_Meridian_Line", N_("Meridian line"), "", g roup, true, false, "viewing/flag_meridian_line"); addGuiActions("actionShow_Meridian_Line", N_("Meridian line"), "", g roup, true, false, "viewing/flag_meridian_line");
addGuiActions("actionShow_Cardinal_Points", N_("Cardinal points"), " Q", group, true, false, "viewing/flag_cardinal_points"); addGuiActions("actionShow_Cardinal_Points", N_("Cardinal points"), " Q", group, true, false, "viewing/flag_cardinal_points");
addGuiActions("actionShow_Ground", N_("Ground"), "G", group, true, f alse, "landscape/flag_landscape"); addGuiActions("actionShow_Ground", N_("Ground"), "G", group, true, f alse, "landscape/flag_landscape");
addGuiActions("actionShow_Atmosphere", N_("Atmosphere"), "A", group, true, false, "landscape/flag_atmosphere"); addGuiActions("actionShow_Atmosphere", N_("Atmosphere"), "A", group, true, false, "landscape/flag_atmosphere");
addGuiActions("actionShow_Fog", N_("Fog"), "F", group, true, false, "landscape/flag_fog"); addGuiActions("actionShow_Fog", N_("Fog"), "F", group, true, false, "landscape/flag_fog");
addGuiActions("actionShow_Nebulas", N_("Nebulas"), "N", group, true, false, "astro/flag_nebula_name"); addGuiActions("actionShow_Nebulas", N_("Nebulas"), "N", group, true, false, "astro/flag_nebula_name");
// addGuiActions("actionShow_DSS", N_("DSS"), "", group, true, false); addGuiActions("actionShow_DSS", N_("Nebulas background images"), "", group, true, false);
addGuiActions("actionShow_Stars", N_("Stars"), "S", group, true, fal se, "astro/flag_stars"); addGuiActions("actionShow_Stars", N_("Stars"), "S", group, true, fal se, "astro/flag_stars");
addGuiActions("actionShow_Planets_Hints", N_("Planets hints"), "P", group, true, false, "astro/flag_planets_hints"); addGuiActions("actionShow_Planets_Labels", N_("Planets labels"), "P" , group, true, false, "astro/flag_planets_labels");
addGuiActions("actionShow_Night_Mode", N_("Night mode"), "", group, true, false, "viewing/flag_night"); addGuiActions("actionShow_Night_Mode", N_("Night mode"), "", group, true, false, "viewing/flag_night");
addGuiActions("actionSet_Full_Screen", N_("Full-screen mode"), "F11" , group, true, false); // TODO: move persistence here? (currently elsewhere ) addGuiActions("actionSet_Full_Screen_Global", N_("Full-screen mode") , "F11", group, true, false); // TODO: move persistence here? (currently el sewhere)
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", N_("Help window"), "F1", gro addGuiActions("actionShow_Help_Window_Global", N_("Help window"), "F
up, true, false); 1", group, true, false);
addGuiActions("actionShow_Configuration_Window", N_("Configuration w addGuiActions("actionShow_Configuration_Window_Global", N_("Configur
indow"), "F2", group, true, false); ation window"), "F2", group, true, false);
addGuiActions("actionShow_Search_Window", N_("Search window"), "F3, addGuiActions("actionShow_Search_Window_Global", N_("Search window")
Ctrl+F", group, true, false); , "F3, Ctrl+F", group, true, false);
addGuiActions("actionShow_SkyView_Window", N_("Sky and viewing optio addGuiActions("actionShow_SkyView_Window_Global", N_("Sky and viewin
ns window"), "F4", group, true, false); g options window"), "F4", group, true, false);
addGuiActions("actionShow_DateTime_Window", N_("Date/time window"), addGuiActions("actionShow_DateTime_Window_Global", N_("Date/time win
"F5", group, true, false); dow"), "F5", group, true, false);
addGuiActions("actionShow_Location_Window", N_("Location window"), " addGuiActions("actionShow_Location_Window_Global", N_("Location wind
F6", group, true, false); ow"), "F6", group, true, false);
group = N_("Date and Time"); group = N_("Date and Time");
addGuiActions("actionDecrease_Time_Speed", N_("Decrease time speed") , "J", group, false, false); addGuiActions("actionDecrease_Time_Speed", N_("Decrease time speed") , "J", group, false, false);
addGuiActions("actionIncrease_Time_Speed", N_("Increase time speed") , "L", group, false, false); addGuiActions("actionIncrease_Time_Speed", N_("Increase time speed") , "L", group, false, false);
addGuiActions("actionSet_Real_Time_Speed", N_("Set normal time rate" ), "K", group, false, false); addGuiActions("actionSet_Real_Time_Speed", N_("Set normal time rate" ), "K", group, false, false);
addGuiActions("actionSet_Time_Rate_Zero", N_("Set time rate to zero" ), "7", group, false, false);
addGuiActions("actionReturn_To_Current_Time", N_("Set time to now"), "8", group, false, false); addGuiActions("actionReturn_To_Current_Time", N_("Set time to now"), "8", group, false, false);
addGuiActions("actionAdd_Solar_Hour", N_("Add 1 solar hour"), "Ctrl+ =", group, false, true); addGuiActions("actionAdd_Solar_Hour", N_("Add 1 solar hour"), "Ctrl+ =", group, false, true);
addGuiActions("actionSubtract_Solar_Hour", N_("Subtract 1 solar hour "), "Ctrl+-", group, false, true); addGuiActions("actionSubtract_Solar_Hour", N_("Subtract 1 solar hour "), "Ctrl+-", group, false, true);
addGuiActions("actionAdd_Solar_Day", N_("Add 1 solar day"), "=", gro up, false, true); addGuiActions("actionAdd_Solar_Day", N_("Add 1 solar day"), "=", gro up, false, true);
addGuiActions("actionSubtract_Solar_Day", N_("Subtract 1 solar day") , "-", group, false, true); addGuiActions("actionSubtract_Solar_Day", N_("Subtract 1 solar day") , "-", group, false, true);
addGuiActions("actionAdd_Solar_Week", N_("Add 1 solar week"), "]", g roup, false, true); addGuiActions("actionAdd_Solar_Week", N_("Add 1 solar week"), "]", g roup, false, true);
addGuiActions("actionSubtract_Solar_Week", N_("Subtract 1 solar week "), "[", group, false, true); addGuiActions("actionSubtract_Solar_Week", N_("Subtract 1 solar week "), "[", group, false, true);
addGuiActions("actionAdd_Sidereal_Day", N_("Add 1 sidereal day"), "A lt+=", group, false, true); addGuiActions("actionAdd_Sidereal_Day", N_("Add 1 sidereal day"), "A lt+=", group, false, true);
addGuiActions("actionSubtract_Sidereal_Day", N_("Subtract 1 sidereal day"), "Alt+-", group, false, true); addGuiActions("actionSubtract_Sidereal_Day", N_("Subtract 1 sidereal day"), "Alt+-", group, false, true);
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", N_("Quit"), "Ctrl+Q", group, false, fals addGuiActions("actionQuit_Global", N_("Quit"), "Ctrl+Q", group, fals
e); e, false);
addGuiActions("actionSave_Screenshot", N_("Save screenshot"), "Ctrl+ addGuiActions("actionSave_Screenshot_Global", N_("Save screenshot"),
S", group, false, false); "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 toolbars"), "Ctrl+T", group, true, false);
//QMetaObject::connectSlotsByName(Form); //QMetaObject::connectSlotsByName(Form);
//////////////////////////////////////////////////////////////////// /// //////////////////////////////////////////////////////////////////// ///
// Connect all the GUI actions signals with the Core of Stellarium // Connect all the GUI actions signals with the Core of Stellarium
QObject::connect(getGuiActions("actionQuit"), SIGNAL(triggered()), t his, SLOT(quitStellarium())); connect(getGuiActions("actionQuit_Global"), SIGNAL(triggered()), thi s, SLOT(quitStellarium()));
// Debug // Debug
QObject::connect(getGuiActions("action_Reload_Style"), SIGNAL(trigge red()), this, SLOT(reloadStyle())); connect(getGuiActions("action_Reload_Style"), SIGNAL(triggered()), t his, SLOT(reloadStyle()));
QObject* module = GETSTELMODULE("ConstellationMgr"); QObject* module = GETSTELMODULE("ConstellationMgr");
ConstellationMgr* cmgr = (ConstellationMgr*)module; ConstellationMgr* cmgr = (ConstellationMgr*)module;
QObject::connect(getGuiActions("actionShow_Constellation_Lines"), SI GNAL(toggled(bool)), module, SLOT(setFlagLines(bool))); connect(getGuiActions("actionShow_Constellation_Lines"), SIGNAL(togg led(bool)), module, SLOT(setFlagLines(bool)));
getGuiActions("actionShow_Constellation_Lines")->setChecked(cmgr->ge tFlagLines()); getGuiActions("actionShow_Constellation_Lines")->setChecked(cmgr->ge tFlagLines());
QObject::connect(getGuiActions("actionShow_Constellation_Art"), SIGN AL(toggled(bool)), module, SLOT(setFlagArt(bool))); connect(getGuiActions("actionShow_Constellation_Art"), SIGNAL(toggle d(bool)), module, SLOT(setFlagArt(bool)));
getGuiActions("actionShow_Constellation_Art")->setChecked(cmgr->getF lagArt()); getGuiActions("actionShow_Constellation_Art")->setChecked(cmgr->getF lagArt());
QObject::connect(getGuiActions("actionShow_Constellation_Labels"), S IGNAL(toggled(bool)), module, SLOT(setFlagLabels(bool))); connect(getGuiActions("actionShow_Constellation_Labels"), SIGNAL(tog gled(bool)), module, SLOT(setFlagLabels(bool)));
getGuiActions("actionShow_Constellation_Labels")->setChecked(cmgr->g etFlagLabels()); getGuiActions("actionShow_Constellation_Labels")->setChecked(cmgr->g etFlagLabels());
QObject::connect(getGuiActions("actionShow_Constellation_Boundaries" ), SIGNAL(toggled(bool)), module, SLOT(setFlagBoundaries(bool))); connect(getGuiActions("actionShow_Constellation_Boundaries"), SIGNAL (toggled(bool)), module, SLOT(setFlagBoundaries(bool)));
getGuiActions("actionShow_Constellation_Boundaries")->setChecked(cmg r->getFlagBoundaries()); getGuiActions("actionShow_Constellation_Boundaries")->setChecked(cmg r->getFlagBoundaries());
module = GETSTELMODULE("GridLinesMgr"); module = GETSTELMODULE("GridLinesMgr");
GridLinesMgr* gmgr = (GridLinesMgr*)module; GridLinesMgr* gmgr = (GridLinesMgr*)module;
QObject::connect(getGuiActions("actionShow_Equatorial_Grid"), SIGNAL (toggled(bool)), module, SLOT(setFlagEquatorGrid(bool))); connect(getGuiActions("actionShow_Equatorial_Grid"), SIGNAL(toggled( bool)), module, SLOT(setFlagEquatorGrid(bool)));
getGuiActions("actionShow_Equatorial_Grid")->setChecked(gmgr->getFla gEquatorGrid()); getGuiActions("actionShow_Equatorial_Grid")->setChecked(gmgr->getFla gEquatorGrid());
QObject::connect(getGuiActions("actionShow_Azimutal_Grid"), SIGNAL(t connect(getGuiActions("actionShow_Azimuthal_Grid"), SIGNAL(toggled(b
oggled(bool)), module, SLOT(setFlagAzimutalGrid(bool))); ool)), module, SLOT(setFlagAzimuthalGrid(bool)));
getGuiActions("actionShow_Azimutal_Grid")->setChecked(gmgr->getFlagA getGuiActions("actionShow_Azimuthal_Grid")->setChecked(gmgr->getFlag
zimutalGrid()); AzimuthalGrid());
QObject::connect(getGuiActions("actionShow_Ecliptic_Line"), SIGNAL(t connect(getGuiActions("actionShow_Ecliptic_Line"), SIGNAL(toggled(bo
oggled(bool)), module, SLOT(setFlagEclipticLine(bool))); ol)), module, SLOT(setFlagEclipticLine(bool)));
getGuiActions("actionShow_Ecliptic_Line")->setChecked(gmgr->getFlagE clipticLine()); getGuiActions("actionShow_Ecliptic_Line")->setChecked(gmgr->getFlagE clipticLine());
QObject::connect(getGuiActions("actionShow_Equator_Line"), SIGNAL(to ggled(bool)), module, SLOT(setFlagEquatorLine(bool))); connect(getGuiActions("actionShow_Equator_Line"), SIGNAL(toggled(boo l)), module, SLOT(setFlagEquatorLine(bool)));
getGuiActions("actionShow_Equator_Line")->setChecked(gmgr->getFlagEq uatorLine()); getGuiActions("actionShow_Equator_Line")->setChecked(gmgr->getFlagEq uatorLine());
module = GETSTELMODULE("LandscapeMgr"); module = GETSTELMODULE("LandscapeMgr");
LandscapeMgr* lmgr = (LandscapeMgr*)module; LandscapeMgr* lmgr = (LandscapeMgr*)module;
QObject::connect(getGuiActions("actionShow_Ground"), SIGNAL(toggled( bool)), module, SLOT(setFlagLandscape(bool))); connect(getGuiActions("actionShow_Ground"), SIGNAL(toggled(bool)), m odule, SLOT(setFlagLandscape(bool)));
getGuiActions("actionShow_Ground")->setChecked(lmgr->getFlagLandscap e()); getGuiActions("actionShow_Ground")->setChecked(lmgr->getFlagLandscap e());
QObject::connect(getGuiActions("actionShow_Cardinal_Points"), SIGNAL (toggled(bool)), module, SLOT(setFlagCardinalsPoints(bool))); connect(getGuiActions("actionShow_Cardinal_Points"), SIGNAL(toggled( bool)), module, SLOT(setFlagCardinalsPoints(bool)));
getGuiActions("actionShow_Cardinal_Points")->setChecked(lmgr->getFla gCardinalsPoints()); getGuiActions("actionShow_Cardinal_Points")->setChecked(lmgr->getFla gCardinalsPoints());
QObject::connect(getGuiActions("actionShow_Atmosphere"), SIGNAL(togg led(bool)), module, SLOT(setFlagAtmosphere(bool))); connect(getGuiActions("actionShow_Atmosphere"), SIGNAL(toggled(bool) ), module, SLOT(setFlagAtmosphere(bool)));
getGuiActions("actionShow_Atmosphere")->setChecked(lmgr->getFlagAtmo sphere()); getGuiActions("actionShow_Atmosphere")->setChecked(lmgr->getFlagAtmo sphere());
QObject::connect(getGuiActions("actionShow_Fog"), SIGNAL(toggled(boo l)), module, SLOT(setFlagFog(bool))); connect(getGuiActions("actionShow_Fog"), SIGNAL(toggled(bool)), modu le, SLOT(setFlagFog(bool)));
getGuiActions("actionShow_Fog")->setChecked(lmgr->getFlagFog()); getGuiActions("actionShow_Fog")->setChecked(lmgr->getFlagFog());
module = GETSTELMODULE("NebulaMgr"); module = GETSTELMODULE("NebulaMgr");
NebulaMgr* nmgr = (NebulaMgr*)module; NebulaMgr* nmgr = (NebulaMgr*)module;
QObject::connect(getGuiActions("actionShow_Nebulas"), SIGNAL(toggled (bool)), module, SLOT(setFlagHints(bool))); connect(getGuiActions("actionShow_Nebulas"), SIGNAL(toggled(bool)), module, SLOT(setFlagHints(bool)));
getGuiActions("actionShow_Nebulas")->setChecked(nmgr->getFlagHints() ); getGuiActions("actionShow_Nebulas")->setChecked(nmgr->getFlagHints() );
// module = GETSTELMODULE("SkyBackground"); StelSkyImageMgr* bmgr = &StelApp::getInstance().getSkyImageMgr();
// SkyBackground* bmgr = (SkyBackground*)module; connect(getGuiActions("actionShow_DSS"), SIGNAL(toggled(bool)), bmgr
// QObject::connect(getGuiActions("actionShow_DSS"), SIGNAL(toggled(boo , SLOT(setFlagShow(bool)));
l)), module, SLOT(setFlagShow(bool))); getGuiActions("actionShow_DSS")->setChecked(bmgr->getFlagShow());
// getGuiActions("actionShow_DSS")->setChecked(bmgr->getFlagShow());
module = (QObject*)StelApp::getInstance().getCore()->getNavigator();
module = (QObject*)StelApp::getInstance().getCore()->getNavigation() connect(getGuiActions("actionIncrease_Time_Speed"), SIGNAL(triggered
; ()), module, SLOT(increaseTimeSpeed()));
QObject::connect(getGuiActions("actionIncrease_Time_Speed"), SIGNAL( connect(getGuiActions("actionDecrease_Time_Speed"), SIGNAL(triggered
triggered()), module, SLOT(increaseTimeSpeed())); ()), module, SLOT(decreaseTimeSpeed()));
QObject::connect(getGuiActions("actionDecrease_Time_Speed"), SIGNAL( connect(getGuiActions("actionSet_Real_Time_Speed"), SIGNAL(triggered
triggered()), module, SLOT(decreaseTimeSpeed())); ()), module, SLOT(setRealTimeSpeed()));
QObject::connect(getGuiActions("actionSet_Real_Time_Speed"), SIGNAL( connect(getGuiActions("actionSet_Time_Rate_Zero"), SIGNAL(triggered(
triggered()), module, SLOT(setRealTimeSpeed())); )), module, SLOT(setZeroTimeSpeed()));
QObject::connect(getGuiActions("actionReturn_To_Current_Time"), SIGN connect(getGuiActions("actionReturn_To_Current_Time"), SIGNAL(trigge
AL(triggered()), module, SLOT(setTimeNow())); red()), module, SLOT(setTimeNow()));
QObject::connect(getGuiActions("actionSwitch_Equatorial_Mount"), SIG connect(getGuiActions("actionSwitch_Equatorial_Mount"), SIGNAL(toggl
NAL(toggled(bool)), module, SLOT(setEquatorialMount(bool))); ed(bool)), module, SLOT(setEquatorialMount(bool)));
QObject::connect(getGuiActions("actionAdd_Solar_Hour"), SIGNAL(trigg getGuiActions("actionSwitch_Equatorial_Mount")->setChecked(StelApp::
ered()), module, SLOT(addHour())); getInstance().getCore()->getNavigator()->getMountMode() != StelNavigator::M
QObject::connect(getGuiActions("actionAdd_Solar_Day"), SIGNAL(trigge ountAltAzimuthal);
red()), module, SLOT(addDay())); connect(getGuiActions("actionAdd_Solar_Hour"), SIGNAL(triggered()),
QObject::connect(getGuiActions("actionAdd_Solar_Week"), SIGNAL(trigg module, SLOT(addHour()));
ered()), module, SLOT(addWeek())); connect(getGuiActions("actionAdd_Solar_Day"), SIGNAL(triggered()), m
QObject::connect(getGuiActions("actionSubtract_Solar_Hour"), SIGNAL( odule, SLOT(addDay()));
triggered()), module, SLOT(subtractHour())); connect(getGuiActions("actionAdd_Solar_Week"), SIGNAL(triggered()),
QObject::connect(getGuiActions("actionSubtract_Solar_Day"), SIGNAL(t module, SLOT(addWeek()));
riggered()), module, SLOT(subtractDay())); connect(getGuiActions("actionSubtract_Solar_Hour"), SIGNAL(triggered
QObject::connect(getGuiActions("actionSubtract_Solar_Week"), SIGNAL( ()), module, SLOT(subtractHour()));
triggered()), module, SLOT(subtractWeek())); connect(getGuiActions("actionSubtract_Solar_Day"), SIGNAL(triggered(
QObject::connect(getGuiActions("actionAdd_Sidereal_Day"), SIGNAL(tri )), module, SLOT(subtractDay()));
ggered()), module, SLOT(addSiderealDay())); connect(getGuiActions("actionSubtract_Solar_Week"), SIGNAL(triggered
QObject::connect(getGuiActions("actionAdd_Sidereal_Week"), SIGNAL(tr ()), module, SLOT(subtractWeek()));
iggered()), module, SLOT(addSiderealWeek())); connect(getGuiActions("actionAdd_Sidereal_Day"), SIGNAL(triggered())
QObject::connect(getGuiActions("actionSubtract_Sidereal_Day"), SIGNA , module, SLOT(addSiderealDay()));
L(triggered()), module, SLOT(subtractSiderealDay())); connect(getGuiActions("actionAdd_Sidereal_Week"), SIGNAL(triggered()
QObject::connect(getGuiActions("actionSubtract_Sidereal_Week"), SIGN ), module, SLOT(addSiderealWeek()));
AL(triggered()), module, SLOT(subtractSiderealWeek())); connect(getGuiActions("actionSubtract_Sidereal_Day"), SIGNAL(trigger
QObject::connect(getGuiActions("actionSet_Home_Planet_To_Selected"), ed()), module, SLOT(subtractSiderealDay()));
SIGNAL(triggered()), module, SLOT(moveObserverToSelected())); connect(getGuiActions("actionSubtract_Sidereal_Week"), SIGNAL(trigge
red()), module, SLOT(subtractSiderealWeek()));
connect(getGuiActions("actionSet_Home_Planet_To_Selected"), SIGNAL(t
riggered()), module, SLOT(moveObserverToSelected()));
module = GETSTELMODULE("TelescopeMgr");
connect(getGuiActions("actionMove_Telescope_To_Selection_0"), SIGNAL
(triggered()), module, SLOT(moveTelescopeToSelected()));
connect(getGuiActions("actionMove_Telescope_To_Selection_1"), SIGNAL
(triggered()), module, SLOT(moveTelescopeToSelected()));
connect(getGuiActions("actionMove_Telescope_To_Selection_2"), SIGNAL
(triggered()), module, SLOT(moveTelescopeToSelected()));
connect(getGuiActions("actionMove_Telescope_To_Selection_3"), SIGNAL
(triggered()), module, SLOT(moveTelescopeToSelected()));
connect(getGuiActions("actionMove_Telescope_To_Selection_4"), SIGNAL
(triggered()), module, SLOT(moveTelescopeToSelected()));
connect(getGuiActions("actionMove_Telescope_To_Selection_5"), SIGNAL
(triggered()), module, SLOT(moveTelescopeToSelected()));
connect(getGuiActions("actionMove_Telescope_To_Selection_6"), SIGNAL
(triggered()), module, SLOT(moveTelescopeToSelected()));
connect(getGuiActions("actionMove_Telescope_To_Selection_7"), SIGNAL
(triggered()), module, SLOT(moveTelescopeToSelected()));
connect(getGuiActions("actionMove_Telescope_To_Selection_8"), SIGNAL
(triggered()), module, SLOT(moveTelescopeToSelected()));
connect(getGuiActions("actionMove_Telescope_To_Selection_9"), SIGNAL
(triggered()), module, SLOT(moveTelescopeToSelected()));
module = &StelApp::getInstance(); module = &StelApp::getInstance();
QObject::connect(getGuiActions("actionShow_Night_Mode"), SIGNAL(togg led(bool)), module, SLOT(setVisionModeNight(bool))); connect(getGuiActions("actionShow_Night_Mode"), SIGNAL(toggled(bool) ), module, SLOT(setVisionModeNight(bool)));
getGuiActions("actionShow_Night_Mode")->setChecked(StelApp::getInsta nce().getVisionModeNight()); getGuiActions("actionShow_Night_Mode")->setChecked(StelApp::getInsta nce().getVisionModeNight());
module = GETSTELMODULE("MovementMgr"); module = GETSTELMODULE("StelMovementMgr");
QObject::connect(getGuiActions("actionGoto_Selected_Object"), SIGNAL connect(getGuiActions("actionGoto_Selected_Object"), SIGNAL(triggere
(triggered()), module, SLOT(setFlagTracking())); d()), module, SLOT(setFlagTracking()));
QObject::connect(getGuiActions("actionZoom_In_Auto"), SIGNAL(trigger connect(getGuiActions("actionZoom_In_Auto"), SIGNAL(triggered()), mo
ed()), module, SLOT(autoZoomIn())); dule, SLOT(autoZoomIn()));
QObject::connect(getGuiActions("actionZoom_Out_Auto"), SIGNAL(trigge connect(getGuiActions("actionZoom_Out_Auto"), SIGNAL(triggered()), m
red()), module, SLOT(autoZoomOut())); odule, SLOT(autoZoomOut()));
QObject::connect(getGuiActions("actionSet_Tracking"), SIGNAL(toggled connect(getGuiActions("actionSet_Tracking"), SIGNAL(toggled(bool)),
(bool)), module, SLOT(setFlagTracking(bool))); module, SLOT(setFlagTracking(bool)));
MovementMgr* mmgr = (MovementMgr*)module; StelMovementMgr* mmgr = (StelMovementMgr*)module;
getGuiActions("actionSet_Tracking")->setChecked(mmgr->getFlagTrackin g()); getGuiActions("actionSet_Tracking")->setChecked(mmgr->getFlagTrackin g());
QObject::connect(getGuiActions("actionSet_Full_Screen"), SIGNAL(togg connect(getGuiActions("actionSet_Full_Screen_Global"), SIGNAL(toggle
led(bool)), &StelMainWindow::getInstance(), SLOT(setFullScreen(bool))); d(bool)), &StelMainWindow::getInstance(), SLOT(setFullScreen(bool)));
getGuiActions("actionSet_Full_Screen")->setChecked(StelMainWindow::g getGuiActions("actionSet_Full_Screen_Global")->setChecked(StelMainWi
etInstance().isFullScreen()); ndow::getInstance().isFullScreen());
QObject::connect(getGuiActions("actionShow_Location_Window"), SIGNAL connect(getGuiActions("actionShow_Location_Window_Global"), SIGNAL(t
(toggled(bool)), &locationDialog, SLOT(setVisible(bool))); oggled(bool)), &locationDialog, SLOT(setVisible(bool)));
QObject::connect(&locationDialog, SIGNAL(visibleChanged(bool)), getG connect(&locationDialog, SIGNAL(visibleChanged(bool)), getGuiActions
uiActions("actionShow_Location_Window"), SLOT(setChecked(bool))); ("actionShow_Location_Window_Global"), SLOT(setChecked(bool)));
QObject::connect(getGuiActions("actionShow_Configuration_Window"), S connect(getGuiActions("actionShow_Configuration_Window_Global"), SIG
IGNAL(toggled(bool)), &configurationDialog, SLOT(setVisible(bool))); NAL(toggled(bool)), &configurationDialog, SLOT(setVisible(bool)));
QObject::connect(&configurationDialog, SIGNAL(visibleChanged(bool)), connect(&configurationDialog, SIGNAL(visibleChanged(bool)), getGuiAc
getGuiActions("actionShow_Configuration_Window"), SLOT(setChecked(bool))); tions("actionShow_Configuration_Window_Global"), SLOT(setChecked(bool)));
QObject::connect(getGuiActions("actionShow_SkyView_Window"), SIGNAL( connect(getGuiActions("actionShow_SkyView_Window_Global"), SIGNAL(to
toggled(bool)), &viewDialog, SLOT(setVisible(bool))); ggled(bool)), &viewDialog, SLOT(setVisible(bool)));
QObject::connect(&viewDialog, SIGNAL(visibleChanged(bool)), getGuiAc connect(&viewDialog, SIGNAL(visibleChanged(bool)), getGuiActions("ac
tions("actionShow_SkyView_Window"), SLOT(setChecked(bool))); tionShow_SkyView_Window_Global"), SLOT(setChecked(bool)));
QObject::connect(getGuiActions("actionShow_Help_Window"), SIGNAL(tog connect(getGuiActions("actionShow_Help_Window_Global"), SIGNAL(toggl
gled(bool)), &helpDialog, SLOT(setVisible(bool))); ed(bool)), &helpDialog, SLOT(setVisible(bool)));
QObject::connect(&helpDialog, SIGNAL(visibleChanged(bool)), getGuiAc connect(&helpDialog, SIGNAL(visibleChanged(bool)), getGuiActions("ac
tions("actionShow_Help_Window"), SLOT(setChecked(bool))); tionShow_Help_Window_Global"), SLOT(setChecked(bool)));
QObject::connect(getGuiActions("actionShow_DateTime_Window"), SIGNAL connect(getGuiActions("actionShow_DateTime_Window_Global"), SIGNAL(t
(toggled(bool)), &dateTimeDialog, SLOT(setVisible(bool))); oggled(bool)), &dateTimeDialog, SLOT(setVisible(bool)));
QObject::connect(&dateTimeDialog, SIGNAL(visibleChanged(bool)), getG connect(&dateTimeDialog, SIGNAL(visibleChanged(bool)), getGuiActions
uiActions("actionShow_DateTime_Window"), SLOT(setChecked(bool))); ("actionShow_DateTime_Window_Global"), SLOT(setChecked(bool)));
QObject::connect(getGuiActions("actionShow_Search_Window"), SIGNAL(t connect(getGuiActions("actionShow_Search_Window_Global"), SIGNAL(tog
oggled(bool)), &searchDialog, SLOT(setVisible(bool))); gled(bool)), &searchDialog, SLOT(setVisible(bool)));
QObject::connect(&searchDialog, SIGNAL(visibleChanged(bool)), getGui connect(&searchDialog, SIGNAL(visibleChanged(bool)), getGuiActions("
Actions("actionShow_Search_Window"), SLOT(setChecked(bool))); actionShow_Search_Window_Global"), SLOT(setChecked(bool)));
QObject::connect(getGuiActions("actionSave_Screenshot"), SIGNAL(trig connect(getGuiActions("actionSave_Screenshot_Global"), SIGNAL(trigge
gered()), &StelMainGraphicsView::getInstance(), SLOT(saveScreenShot())); red()), &StelMainGraphicsView::getInstance(), SLOT(saveScreenShot()));
getGuiActions("actionToggle_GuiHidden_Global")->setChecked(false);
connect(getGuiActions("actionToggle_GuiHidden_Global"), SIGNAL(trigg
ered()), this, SLOT(toggleHideGui()));
const Projector* proj = StelApp::getInstance().getCore()->getProject connect(getGuiActions("actionHorizontal_Flip"), SIGNAL(toggled(bool)
ion(); ), StelApp::getInstance().getCore(), SLOT(setFlipHorz(bool)));
QObject::connect(getGuiActions("actionHorizontal_Flip"), SIGNAL(togg getGuiActions("actionHorizontal_Flip")->setChecked(StelApp::getInsta
led(bool)), proj, SLOT(setFlipHorz(bool))); nce().getCore()->getFlipHorz());
getGuiActions("actionHorizontal_Flip")->setChecked(proj->getFlipHorz connect(getGuiActions("actionVertical_Flip"), SIGNAL(toggled(bool)),
()); StelApp::getInstance().getCore(), SLOT(setFlipVert(bool)));
QObject::connect(getGuiActions("actionVertical_Flip"), SIGNAL(toggle getGuiActions("actionVertical_Flip")->setChecked(StelApp::getInstanc
d(bool)), proj, SLOT(setFlipVert(bool))); e().getCore()->getFlipVert());
getGuiActions("actionVertical_Flip")->setChecked(proj->getFlipVert()
);
StarMgr* smgr = (StarMgr*)GETSTELMODULE("StarMgr"); StarMgr* smgr = (StarMgr*)GETSTELMODULE("StarMgr");
QObject::connect(getGuiActions("actionShow_Stars"), SIGNAL(toggled(b ool)), smgr, 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 = (SolarSystem*)GETSTELMODULE("SolarSystem"); SolarSystem* ssmgr = (SolarSystem*)GETSTELMODULE("SolarSystem");
QObject::connect(getGuiActions("actionShow_Planets_Hints"), SIGNAL(t connect(getGuiActions("actionShow_Planets_Labels"), SIGNAL(toggled(b
oggled(bool)), ssmgr, SLOT(setFlagHints(bool))); ool)), ssmgr, SLOT(setFlagLabels(bool)));
getGuiActions("actionShow_Planets_Hints")->setChecked(ssmgr->getFlag getGuiActions("actionShow_Planets_Labels")->setChecked(ssmgr->getFla
Hints()); gLabels());
QObject::connect(getGuiActions("actionShow_Meridian_Line"), SIGNAL(t oggled(bool)), gmgr, SLOT(setFlagMeridianLine(bool))); connect(getGuiActions("actionShow_Meridian_Line"), SIGNAL(toggled(bo ol)), gmgr, SLOT(setFlagMeridianLine(bool)));
getGuiActions("actionShow_Meridian_Line")->setChecked(gmgr->getFlagM eridianLine()); getGuiActions("actionShow_Meridian_Line")->setChecked(gmgr->getFlagM eridianLine());
QObject::connect(getGuiActions("actionShow_Equatorial_J2000_Grid"), SIGNAL(toggled(bool)), gmgr, SLOT(setFlagEquatorJ2000Grid(bool))); connect(getGuiActions("actionShow_Equatorial_J2000_Grid"), SIGNAL(to ggled(bool)), gmgr, SLOT(setFlagEquatorJ2000Grid(bool)));
getGuiActions("actionShow_Equatorial_J2000_Grid")->setChecked(gmgr-> getFlagEquatorJ2000Grid()); getGuiActions("actionShow_Equatorial_J2000_Grid")->setChecked(gmgr-> getFlagEquatorJ2000Grid());
QObject::connect(getGuiActions("actionAutoHideHorizontalButtonBar"), QSettings* conf = StelApp::getInstance().getSettings();
SIGNAL(toggled(bool)), this, SLOT(setAutoHideHorizontalButtonBar(bool))); Q_ASSERT(conf);
setAutoHideHorizontalButtonBar(conf->value("gui/auto_hide_horizontal
_toolbar", true).toBool());
setAutoHideVerticalButtonBar(conf->value("gui/auto_hide_vertical_too
lbar", true).toBool());
connect(getGuiActions("actionAutoHideHorizontalButtonBar"), SIGNAL(t
oggled(bool)), this, SLOT(setAutoHideHorizontalButtonBar(bool)));
getGuiActions("actionAutoHideHorizontalButtonBar")->setChecked(getAu toHideHorizontalButtonBar()); getGuiActions("actionAutoHideHorizontalButtonBar")->setChecked(getAu toHideHorizontalButtonBar());
QObject::connect(getGuiActions("actionAutoHideVerticalButtonBar"), S IGNAL(toggled(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());
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
//// QGraphicsView based GUI //// QGraphicsView based GUI
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Construct the Windows buttons bar // Construct the Windows buttons bar
winBar = new LeftStelBar(NULL); winBar = new LeftStelBar(NULL);
QPixmap pxmapGlow(":/graphicGui/gui/glow.png"); QPixmap pxmapGlow(":/graphicGui/gui/glow.png");
QPixmap pxmapOn(":/graphicGui/gui/2-on-location.png"); QPixmap pxmapOn(":/graphicGui/gui/2-on-location.png");
QPixmap pxmapOff(":/graphicGui/gui/2-off-location.png"); QPixmap pxmapOff(":/graphicGui/gui/2-off-location.png");
StelButton* b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions("actionShow_Location_Window")); StelButton* b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions("actionShow_Location_Window_Global"));
winBar->addButton(b); winBar->addButton(b);
pxmapOn = QPixmap(":/graphicGui/gui/1-on-time.png"); pxmapOn = QPixmap(":/graphicGui/gui/1-on-time.png");
pxmapOff = QPixmap(":/graphicGui/gui/1-off-time.png"); pxmapOff = QPixmap(":/graphicGui/gui/1-off-time.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions ("actionShow_DateTime_Window")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions ("actionShow_DateTime_Window_Global"));
winBar->addButton(b); winBar->addButton(b);
pxmapOn = QPixmap(":/graphicGui/gui/5-on-labels.png"); pxmapOn = QPixmap(":/graphicGui/gui/5-on-labels.png");
pxmapOff = QPixmap(":/graphicGui/gui/5-off-labels.png"); pxmapOff = QPixmap(":/graphicGui/gui/5-off-labels.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions ("actionShow_SkyView_Window")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions ("actionShow_SkyView_Window_Global"));
winBar->addButton(b); winBar->addButton(b);
pxmapOn = QPixmap(":/graphicGui/gui/6-on-search.png"); pxmapOn = QPixmap(":/graphicGui/gui/6-on-search.png");
pxmapOff = QPixmap(":/graphicGui/gui/6-off-search.png"); pxmapOff = QPixmap(":/graphicGui/gui/6-off-search.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions ("actionShow_Search_Window")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions ("actionShow_Search_Window_Global"));
winBar->addButton(b); winBar->addButton(b);
pxmapOn = QPixmap(":/graphicGui/gui/8-on-settings.png"); pxmapOn = QPixmap(":/graphicGui/gui/8-on-settings.png");
pxmapOff = QPixmap(":/graphicGui/gui/8-off-settings.png"); pxmapOff = QPixmap(":/graphicGui/gui/8-off-settings.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions ("actionShow_Configuration_Window")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions ("actionShow_Configuration_Window_Global"));
winBar->addButton(b); winBar->addButton(b);
pxmapOn = QPixmap(":/graphicGui/gui/9-on-help.png"); pxmapOn = QPixmap(":/graphicGui/gui/9-on-help.png");
pxmapOff = QPixmap(":/graphicGui/gui/9-off-help.png"); pxmapOff = QPixmap(":/graphicGui/gui/9-off-help.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions ("actionShow_Help_Window")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow, getGuiActions ("actionShow_Help_Window_Global"));
winBar->addButton(b); winBar->addButton(b);
// Construct the bottom buttons bar // Construct the bottom buttons bar
buttonBar = new BottomStelBar(NULL, QPixmap(":/graphicGui/gui/btbg-l eft.png"), QPixmap(":/graphicGui/gui/btbg-right.png"), buttonBar = new BottomStelBar(NULL, QPixmap(":/graphicGui/gui/btbg-l eft.png"), QPixmap(":/graphicGui/gui/btbg-right.png"),
QPixmap(":/graphicGui/gui/btbg-middle.png"), QPixmap (":/graphicGui/gui/btbg-single.png")); QPixmap(":/graphicGui/gui/btbg-middle.png"), QPixmap (":/graphicGui/gui/btbg-single.png"));
infoPanel = new InfoPanel(NULL); infoPanel = new InfoPanel(NULL);
QPixmap pxmapGlow32x32(":/graphicGui/gui/glow32x32.png"); QPixmap pxmapGlow32x32(":/graphicGui/gui/glow32x32.png");
skipping to change at line 407 skipping to change at line 445
pxmapOn = QPixmap(":/graphicGui/gui/btConstellationArt-on.png"); pxmapOn = QPixmap(":/graphicGui/gui/btConstellationArt-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btConstellationArt-off.png"); pxmapOff = QPixmap(":/graphicGui/gui/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"));
buttonBar->addButton(b, "010-constellationsGroup"); buttonBar->addButton(b, "010-constellationsGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btEquatorialGrid-on.png"); pxmapOn = QPixmap(":/graphicGui/gui/btEquatorialGrid-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btEquatorialGrid-off.png"); pxmapOff = QPixmap(":/graphicGui/gui/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"));
buttonBar->addButton(b, "020-gridsGroup"); buttonBar->addButton(b, "020-gridsGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btAzimutalGrid-on.png"); pxmapOn = QPixmap(":/graphicGui/gui/btAzimuthalGrid-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btAzimutalGrid-off.png"); pxmapOff = QPixmap(":/graphicGui/gui/btAzimuthalGrid-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc
tions("actionShow_Azimutal_Grid")); tions("actionShow_Azimuthal_Grid"));
buttonBar->addButton(b, "020-gridsGroup"); buttonBar->addButton(b, "020-gridsGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btGround-on.png"); pxmapOn = QPixmap(":/graphicGui/gui/btGround-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btGround-off.png"); pxmapOff = QPixmap(":/graphicGui/gui/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"));
buttonBar->addButton(b, "030-landscapeGroup"); buttonBar->addButton(b, "030-landscapeGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btCardinalPoints-on.png"); pxmapOn = QPixmap(":/graphicGui/gui/btCardinalPoints-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btCardinalPoints-off.png"); pxmapOff = QPixmap(":/graphicGui/gui/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"));
skipping to change at line 434 skipping to change at line 472
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Atmosphere")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Atmosphere"));
buttonBar->addButton(b, "030-landscapeGroup"); buttonBar->addButton(b, "030-landscapeGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btNebula-on.png"); pxmapOn = QPixmap(":/graphicGui/gui/btNebula-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btNebula-off.png"); pxmapOff = QPixmap(":/graphicGui/gui/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"));
buttonBar->addButton(b, "040-nebulaeGroup"); buttonBar->addButton(b, "040-nebulaeGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btPlanets-on.png"); pxmapOn = QPixmap(":/graphicGui/gui/btPlanets-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btPlanets-off.png"); pxmapOff = QPixmap(":/graphicGui/gui/btPlanets-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Planets_Hints")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionShow_Planets_Labels"));
buttonBar->addButton(b, "040-nebulaeGroup"); buttonBar->addButton(b, "040-nebulaeGroup");
// pxmapOn = QPixmap(":/graphicGui/gui/btDSS-on.png");
// pxmapOff = QPixmap(":/graphicGui/gui/btDSS-off.png");
// b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc
tions("actionShow_DSS"));
// buttonBar->addButton(b, "040-nebulaeGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btEquatorialMount-on.png"); pxmapOn = QPixmap(":/graphicGui/gui/btEquatorialMount-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btEquatorialMount-off.png"); pxmapOff = QPixmap(":/graphicGui/gui/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());
buttonBar->addButton(b, "060-othersGroup"); buttonBar->addButton(b, "060-othersGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btGotoSelectedObject-on.png"); pxmapOn = QPixmap(":/graphicGui/gui/btGotoSelectedObject-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btGotoSelectedObject-off.png"); pxmapOff = QPixmap(":/graphicGui/gui/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"));
buttonBar->addButton(buttonGotoSelectedObject, "060-othersGroup"); buttonBar->addButton(buttonGotoSelectedObject, "060-othersGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btNightView-on.png"); pxmapOn = QPixmap(":/graphicGui/gui/btNightView-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btNightView-off.png"); pxmapOff = QPixmap(":/graphicGui/gui/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"));
buttonBar->addButton(b, "060-othersGroup"); buttonBar->addButton(b, "060-othersGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btFullScreen-on.png"); pxmapOn = QPixmap(":/graphicGui/gui/btFullScreen-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btFullScreen-off.png"); pxmapOff = QPixmap(":/graphicGui/gui/btFullScreen-off.png");
b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionSet_Full_Screen")); b = new StelButton(NULL, pxmapOn, pxmapOff, pxmapGlow32x32, getGuiAc tions("actionSet_Full_Screen_Global"));
buttonBar->addButton(b, "060-othersGroup"); buttonBar->addButton(b, "060-othersGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btQuit.png"); pxmapOn = QPixmap(":/graphicGui/gui/btQuit.png");
b = new StelButton(NULL, pxmapOn, pxmapOn, pxmapGlow32x32, getGuiAct ions("actionQuit")); b = new StelButton(NULL, pxmapOn, pxmapOn, pxmapGlow32x32, getGuiAct ions("actionQuit_Global"));
buttonBar->addButton(b, "060-othersGroup"); buttonBar->addButton(b, "060-othersGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btTimeRewind-on.png"); pxmapOn = QPixmap(":/graphicGui/gui/btTimeRewind-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btTimeRewind-off.png"); pxmapOff = QPixmap(":/graphicGui/gui/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"));
buttonBar->addButton(buttonTimeRewind, "070-timeGroup"); buttonBar->addButton(buttonTimeRewind, "070-timeGroup");
pxmapOn = QPixmap(":/graphicGui/gui/btTimeRealtime-on.png"); pxmapOn = QPixmap(":/graphicGui/gui/btTimeRealtime-on.png");
pxmapOff = QPixmap(":/graphicGui/gui/btTimeRealtime-off.png"); pxmapOff = QPixmap(":/graphicGui/gui/btTimeRealtime-off.png");
buttonTimeRealTimeSpeed = new StelButton(NULL, pxmapOn, pxmapOff, px mapGlow32x32, getGuiActions("actionSet_Real_Time_Speed")); buttonTimeRealTimeSpeed = new StelButton(NULL, pxmapOn, pxmapOff, px mapGlow32x32, getGuiActions("actionSet_Real_Time_Speed"));
skipping to change at line 521 skipping to change at line 555
pxmapOn = QPixmap(":/graphicGui/gui/VerticalAutoHideOn.png"); pxmapOn = QPixmap(":/graphicGui/gui/VerticalAutoHideOn.png");
pxmapOff = QPixmap(":/graphicGui/gui/VerticalAutoHideOff.png"); pxmapOff = QPixmap(":/graphicGui/gui/VerticalAutoHideOff.png");
btVertAutoHide = new StelButton(autoHidebts, pxmapOn, pxmapOff, QPix map(), getGuiActions("actionAutoHideVerticalButtonBar"), true); btVertAutoHide = new StelButton(autoHidebts, pxmapOn, pxmapOff, QPix map(), getGuiActions("actionAutoHideVerticalButtonBar"), true);
btVertAutoHide->setChecked(getAutoHideVerticalButtonBar()); btVertAutoHide->setChecked(getAutoHideVerticalButtonBar());
btHorizAutoHide->setPos(1,btVertAutoHide->pixmap().height()-btHorizA utoHide->pixmap().height()+1); btHorizAutoHide->setPos(1,btVertAutoHide->pixmap().height()-btHorizA utoHide->pixmap().height()+1);
btVertAutoHide->setPos(0,0); btVertAutoHide->setPos(0,0);
btVertAutoHide->setZValue(1000); btVertAutoHide->setZValue(1000);
scene->addItem(autoHidebts); scene->addItem(autoHidebts);
// Re-adjust position
setStelStyle(*StelApp::getInstance().getCurrentStelStyle()); setStelStyle(*StelApp::getInstance().getCurrentStelStyle());
// Readjust position
updateBarsPos(); updateBarsPos();
infoPanel->setPos(8,8); infoPanel->setPos(8,8);
// If auto hide is off, show the relevant toolbars
if (!getAutoHideHorizontalButtonBar())
{
animBottomBarTimeLine->setDirection(QTimeLine::Forward);
animBottomBarTimeLine->start();
}
if (!getAutoHideVerticalButtonBar())
{
animLeftBarTimeLine->setDirection(QTimeLine::Forward);
animLeftBarTimeLine->start();
}
// add the flip buttons if requested in the config // add the flip buttons if requested in the config
QSettings* conf = StelApp::getInstance().getSettings();
Q_ASSERT(conf);
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());
initDone = true;
} }
//! 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 StelStyle& style)
skipping to change at line 609 skipping to change at line 656
configurationDialog.languageChanged(); configurationDialog.languageChanged();
dateTimeDialog.languageChanged(); dateTimeDialog.languageChanged();
helpDialog.languageChanged(); helpDialog.languageChanged();
locationDialog.languageChanged(); locationDialog.languageChanged();
searchDialog.languageChanged(); searchDialog.languageChanged();
viewDialog.languageChanged(); viewDialog.languageChanged();
} }
void StelGui::update(double deltaTime) void StelGui::update(double deltaTime)
{ {
Navigator* nav = StelApp::getInstance().getCore()->getNavigation(); StelNavigator* nav = StelApp::getInstance().getCore()->getNavigator(
if (nav->getTimeSpeed()<-0.99*JD_SECOND) );
if (nav->getTimeRate()<-0.99*JD_SECOND)
{ {
if (buttonTimeRewind->isChecked()==false) if (buttonTimeRewind->isChecked()==false)
buttonTimeRewind->setChecked(true); buttonTimeRewind->setChecked(true);
} }
else else
{ {
if (buttonTimeRewind->isChecked()==true) if (buttonTimeRewind->isChecked()==true)
buttonTimeRewind->setChecked(false); buttonTimeRewind->setChecked(false);
} }
if (nav->getTimeSpeed()>1.01*JD_SECOND) if (nav->getTimeRate()>1.01*JD_SECOND)
{ {
if (buttonTimeForward->isChecked()==false) if (buttonTimeForward->isChecked()==false)
buttonTimeForward->setChecked(true); buttonTimeForward->setChecked(true);
} }
else else
{ {
if (buttonTimeRewind->isChecked()==true) if (buttonTimeRewind->isChecked()==true)
buttonTimeRewind->setChecked(false); buttonTimeRewind->setChecked(false);
} }
if (buttonTimeRealTimeSpeed->isChecked()!=nav->getRealTimeSpeed()) if (buttonTimeRealTimeSpeed->isChecked()!=nav->getRealTimeSpeed())
{ {
if (buttonTimeRealTimeSpeed->isChecked()!=nav->getRealTimeSp eed()) if (buttonTimeRealTimeSpeed->isChecked()!=nav->getRealTimeSp eed())
buttonTimeRealTimeSpeed->setChecked(nav->getRealTime Speed()); buttonTimeRealTimeSpeed->setChecked(nav->getRealTime Speed());
} }
const bool isTimeNow=nav->getIsTimeNow(); const bool isTimeNow=nav->getIsTimeNow();
if (buttonTimeCurrent->isChecked()!=isTimeNow) if (buttonTimeCurrent->isChecked()!=isTimeNow)
buttonTimeCurrent->setChecked(isTimeNow); buttonTimeCurrent->setChecked(isTimeNow);
MovementMgr* mmgr = (MovementMgr*)GETSTELMODULE("MovementMgr"); StelMovementMgr* mmgr = (StelMovementMgr*)GETSTELMODULE("StelMovemen tMgr");
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 = (StarMgr*)GETSTELMODULE("StarMgr"); StarMgr* smgr = (StarMgr*)GETSTELMODULE("StarMgr");
if (getGuiActions("actionShow_Stars")->isChecked()!=smgr->getFlagSta rs()) if (getGuiActions("actionShow_Stars")->isChecked()!=smgr->getFlagSta rs())
getGuiActions("actionShow_Stars")->setChecked(smgr->getFlagS tars()); getGuiActions("actionShow_Stars")->setChecked(smgr->getFlagS tars());
infoPanel->setTextFromObjects(StelApp::getInstance().getStelObjectMg r().getSelectedObject()); infoPanel->setTextFromObjects(StelApp::getInstance().getStelObjectMg r().getSelectedObject());
} }
skipping to change at line 660 skipping to change at line 707
bool StelGui::handleMouseMoves(int x, int y, Qt::MouseButtons b) bool StelGui::handleMouseMoves(int x, int y, Qt::MouseButtons b)
{ {
double maxX = winBar->boundingRect().width()+2.*buttonBarPath->getRo undSize(); double maxX = winBar->boundingRect().width()+2.*buttonBarPath->getRo undSize();
double maxY = winBar->boundingRect().height()+buttonBar->boundingRec t().height()+2.*buttonBarPath->getRoundSize(); double maxY = winBar->boundingRect().height()+buttonBar->boundingRec t().height()+2.*buttonBarPath->getRoundSize();
double minX = 0; double minX = 0;
if (x<=maxX && y<=maxY && b==Qt::NoButton && animLeftBarTimeLine->st ate()==QTimeLine::NotRunning && winBar->pos().x()<minX) if (x<=maxX && y<=maxY && b==Qt::NoButton && animLeftBarTimeLine->st ate()==QTimeLine::NotRunning && winBar->pos().x()<minX)
{ {
animLeftBarTimeLine->setDirection(QTimeLine::Forward); animLeftBarTimeLine->setDirection(QTimeLine::Forward);
animLeftBarTimeLine->start(); animLeftBarTimeLine->start();
} }
if (autoHideVerticalButtonBar && (x>maxX || y>maxY) && animLeftBarTi meLine->state()==QTimeLine::NotRunning && winBar->pos().x()>=minX) if (autoHideVerticalButtonBar && (x>maxX+30 || y>maxY+30) && animLef tBarTimeLine->state()==QTimeLine::NotRunning && winBar->pos().x()>=minX)
{ {
animLeftBarTimeLine->setDirection(QTimeLine::Backward); animLeftBarTimeLine->setDirection(QTimeLine::Backward);
animLeftBarTimeLine->start(); animLeftBarTimeLine->start();
} }
maxX = winBar->boundingRect().width()+buttonBar->boundingRect().widt h()+2.*buttonBarPath->getRoundSize(); maxX = winBar->boundingRect().width()+buttonBar->boundingRect().widt h()+2.*buttonBarPath->getRoundSize();
maxY = buttonBar->boundingRect().height()+2.*buttonBarPath->getRound Size(); maxY = buttonBar->boundingRect().height()+2.*buttonBarPath->getRound Size();
if (x<=maxX && y<=maxY && b==Qt::NoButton && animBottomBarTimeLine-> state()==QTimeLine::NotRunning && animBottomBarTimeLine->currentValue()<1.) if (x<=maxX && y<=maxY && b==Qt::NoButton && animBottomBarTimeLine-> state()==QTimeLine::NotRunning && animBottomBarTimeLine->currentValue()<1.)
{ {
animBottomBarTimeLine->setDirection(QTimeLine::Forward); animBottomBarTimeLine->setDirection(QTimeLine::Forward);
animBottomBarTimeLine->start(); animBottomBarTimeLine->start();
} }
if (autoHideHorizontalButtonBar && (x>maxX || y>maxY) && animBottomB arTimeLine->state()==QTimeLine::NotRunning && animBottomBarTimeLine->curren tValue()>=0.9999999) if (autoHideHorizontalButtonBar && (x>maxX+30 || y>maxY+30) && animB ottomBarTimeLine->state()==QTimeLine::NotRunning && animBottomBarTimeLine-> currentValue()>=0.9999999)
{ {
animBottomBarTimeLine->setDirection(QTimeLine::Backward); animBottomBarTimeLine->setDirection(QTimeLine::Backward);
animBottomBarTimeLine->start(); animBottomBarTimeLine->start();
} }
return false; return false;
} }
// Note: "text" and "helpGroup" must be in English -- this method and the h elp // Note: "text" and "helpGroup" must be in English -- this method and the h elp
// dialog take care of translating them. Of course, they still have to be // dialog take care of translating them. Of course, they still have to be
skipping to change at line 784 skipping to change at line 831
double opacity = qMax(animLeftBarTimeLine->currentValue(), animBotto mBarTimeLine->currentValue()); double opacity = qMax(animLeftBarTimeLine->currentValue(), animBotto mBarTimeLine->currentValue());
autoHidebts->setOpacity(opacity); autoHidebts->setOpacity(opacity);
} }
void StelGui::retranslateUi(QWidget *Form) void StelGui::retranslateUi(QWidget *Form)
{ {
Form->setWindowTitle(QApplication::translate("Form", "Stellarium", 0 , QApplication::UnicodeUTF8)); Form->setWindowTitle(QApplication::translate("Form", "Stellarium", 0 , QApplication::UnicodeUTF8));
} // retranslateUi } // retranslateUi
// 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::addProgessBar() QProgressBar* StelGui::addProgressBar()
{ {
return progressBarMgr->addProgressBar(); return progressBarMgr->addProgressBar();
} }
void StelGui::quitStellarium() void StelGui::quitStellarium()
{ {
if(StelApp::getInstance().getDownloadMgr().blockQuit())
{
downloadPopup.setVisible(true);
downloadPopup.setText(QString("Stellarium is still downloadi
ng the star "
"catalog %1. Would you like to cancel the download a
nd quit "
"Stellarium? (You can always restart the download at
a later time.)")
.arg(StelApp::getInstance().getDownloadMgr().name())
);
connect(&downloadPopup, SIGNAL(cancelClicked()), this, SLOT(
cancelDownloadAndQuit()));
connect(&downloadPopup, SIGNAL(continueClicked()), this, SLO
T(dontQuit()));
}
else
QCoreApplication::exit();
}
void StelGui::cancelDownloadAndQuit()
{
StelApp::getInstance().getDownloadMgr().abort();
QCoreApplication::exit(); QCoreApplication::exit();
} }
void StelGui::dontQuit()
{
downloadPopup.setVisible(false);
}
QPixmap StelGui::makeRed(const QPixmap& p) QPixmap StelGui::makeRed(const QPixmap& p)
{ {
QImage im = p.toImage().convertToFormat(QImage::Format_ARGB32); QImage im = p.toImage().convertToFormat(QImage::Format_ARGB32);
Q_ASSERT(im.format()==QImage::Format_ARGB32); Q_ASSERT(im.format()==QImage::Format_ARGB32);
QRgb* bits = (QRgb*)im.bits(); QRgb* bits = (QRgb*)im.bits();
const QRgb* stop = bits+im.width()*im.height(); const QRgb* stop = bits+im.width()*im.height();
do do
{ {
*bits = qRgba(qRed(*bits), (int)(0.2*qGreen(*bits)), (int)(0 .2*qBlue(*bits)), qAlpha(*bits)); *bits = qRgba(qRed(*bits), (int)(0.2*qGreen(*bits)), (int)(0 .2*qBlue(*bits)), qAlpha(*bits));
++bits; ++bits;
skipping to change at line 833 skipping to change at line 903
} }
if (flipHoriz==NULL) if (flipHoriz==NULL)
{ {
QPixmap pxmapGlow32x32(":/graphicGui/gui/glow32x32.p ng"); QPixmap pxmapGlow32x32(":/graphicGui/gui/glow32x32.p ng");
flipHoriz = new StelButton(NULL, flipHoriz = new StelButton(NULL,
QPixmap(":/graphicGui/gui /btFlipHorizontal-on.png"), QPixmap(":/graphicGui/gui /btFlipHorizontal-on.png"),
QPixmap(":/graphicGui/gui /btFlipHorizontal-off.png"), QPixmap(":/graphicGui/gui /btFlipHorizontal-off.png"),
pxmapGlow32x32, pxmapGlow32x32,
getGuiActions("actionHori zontal_Flip")); getGuiActions("actionHori zontal_Flip"));
} }
getButtonBar()->addButton(flipVert, "060-othersGroup", "acti onQuit"); 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
{ {
Q_ASSERT(getButtonBar()->hideButton("actionVertical_Flip")== bool b = getButtonBar()->hideButton("actionVertical_Flip")==
flipVert); flipVert;
Q_ASSERT(getButtonBar()->hideButton("actionHorizontal_Flip") Q_ASSERT(b);
==flipHoriz); b = getButtonBar()->hideButton("actionHorizontal_Flip")==fli
pHoriz;
Q_ASSERT(b);
} }
flagShowFlipButtons = b; flagShowFlipButtons = b;
} }
// Define whether the button toggling nebulae backround images should be vi
sible
void StelGui::setFlagShowNebulaBackgroundButton(bool b)
{
if (b==true)
{
if (btShowNebulaeBackground==NULL)
{
// Create the nebulae background button
QPixmap pxmapGlow32x32(":/graphicGui/gui/glow32x32.p
ng");
btShowNebulaeBackground = new StelButton(NULL, QPixm
ap(":/graphicGui/gui/btDSS-on.png"), QPixmap(":/graphicGui/gui/btDSS-off.pn
g"), pxmapGlow32x32, getGuiActions("actionShow_DSS"));
}
getButtonBar()->addButton(btShowNebulaeBackground, "040-nebu
laeGroup");
}
else
{
bool bb;
bb = (getButtonBar()->hideButton("actionShow_DSS")==btShowNe
bulaeBackground);
Q_ASSERT(bb);
}
flagShowNebulaBackgroundButton = b;
}
void StelGui::setHideGui(bool b)
{
buttonBar->setVisible(!b);
winBar->setVisible(!b);
autoHidebts->setVisible(!b);
buttonBarPath->setVisible(!b);
}
bool StelGui::getHideGui(void)
{
return getGuiActions("actionToggle_GuiHidden_Global")->isChecked();
}
 End of changes. 80 change blocks. 
182 lines changed or deleted 285 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/