StelGui.cpp   StelGui.cpp 
skipping to change at line 56 skipping to change at line 56
#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 "StelAppGraphicsWidget.hpp"
#include "ConfigurationDialog.hpp"
#include "DateTimeDialog.hpp"
#include "HelpDialog.hpp"
#include "LocationDialog.hpp"
#include "SearchDialog.hpp"
#include "ViewDialog.hpp"
#include <QDebug> #include <QDebug>
#include <QTimeLine> #include <QTimeLine>
#include <QFontDatabase> #include <QFontDatabase>
#include <QMouseEvent> #include <QMouseEvent>
#include <QAction> #include <QAction>
#include <QApplication> #include <QApplication>
#include <QFile> #include <QFile>
#include <QTextBrowser> #include <QTextBrowser>
#include <QGraphicsWidget> #include <QGraphicsWidget>
#include <QGraphicsGridLayout> #include <QGraphicsGridLayout>
#include <QClipboard> #include <QClipboard>
#include <QPalette>
#include <QColor>
StelGuiBase* StelStandardGuiPluginInterface::getStelGuiBase() const StelGuiBase* StelStandardGuiPluginInterface::getStelGuiBase() const
{ {
// Allow to load the resources when used as a static plugin // Allow to load the resources when used as a static plugin
Q_INIT_RESOURCE(guiRes); Q_INIT_RESOURCE(guiRes);
return new StelGui(); return new StelGui();
} }
Q_EXPORT_PLUGIN2(StelGui, StelStandardGuiPluginInterface) Q_EXPORT_PLUGIN2(StelGui, StelStandardGuiPluginInterface)
StelGui::StelGui() : topLevelGraphicsWidget(NULL), configurationDialog(NULL StelGui::StelGui() :
), initDone(false) topLevelGraphicsWidget(NULL),
locationDialog(0),
helpDialog(0),
dateTimeDialog(0),
searchDialog(0),
viewDialog(0),
configurationDialog(0),
#ifdef ENABLE_SCRIPT_CONSOLE
scriptConsole(0),
#endif
initDone(false)
{ {
// QPixmapCache::setCacheLimit(30000); ? // QPixmapCache::setCacheLimit(30000); ?
flipHoriz = NULL; flipHoriz = NULL;
flipVert = NULL; flipVert = NULL;
btShowNebulaeBackground = NULL; btShowNebulaeBackground = NULL;
} }
StelGui::~StelGui() StelGui::~StelGui()
{ {
delete skyGui; delete skyGui;
skyGui = NULL; skyGui = NULL;
if (locationDialog)
{
delete locationDialog;
locationDialog = 0;
}
if (helpDialog)
{
delete helpDialog;
helpDialog = 0;
}
if (dateTimeDialog)
{
delete dateTimeDialog;
dateTimeDialog = 0;
}
if (searchDialog)
{
delete searchDialog;
searchDialog = 0;
}
if (viewDialog)
{
delete viewDialog;
viewDialog = 0;
}
// configurationDialog is automatically deleted with its parent widg
et.
#ifdef ENABLE_SCRIPT_CONSOLE
if (scriptConsole)
{
delete scriptConsole;
scriptConsole = 0;
}
#endif
} }
void StelGui::init(QGraphicsWidget* atopLevelGraphicsWidget, StelAppGraphic sWidget* astelAppGraphicsWidget) void StelGui::init(QGraphicsWidget* atopLevelGraphicsWidget, StelAppGraphic sWidget* astelAppGraphicsWidget)
{ {
qDebug() << "Creating GUI ..."; qDebug() << "Creating GUI ...";
StelGuiBase::init(atopLevelGraphicsWidget, astelAppGraphicsWidget); StelGuiBase::init(atopLevelGraphicsWidget, astelAppGraphicsWidget);
skyGui = new SkyGui(atopLevelGraphicsWidget); skyGui = new SkyGui(atopLevelGraphicsWidget);
locationDialog = new LocationDialog();
helpDialog = new HelpDialog();
dateTimeDialog = new DateTimeDialog();
searchDialog = new SearchDialog();
viewDialog = new ViewDialog();
configurationDialog = new ConfigurationDialog(this); configurationDialog = new ConfigurationDialog(this);
#ifdef ENABLE_SCRIPT_CONSOLE
scriptConsole = new ScriptConsole();
#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
QString group = N_("Display Options"); QString group = N_("Display Options");
addGuiActions("actionShow_Constellation_Lines", N_("Constellation li nes"), "C", group, true, false); addGuiActions("actionShow_Constellation_Lines", N_("Constellation li nes"), "C", group, true, false);
addGuiActions("actionShow_Constellation_Art", N_("Constellation art" ), "R", group, true, false); addGuiActions("actionShow_Constellation_Art", N_("Constellation art" ), "R", group, true, false);
addGuiActions("actionShow_Constellation_Labels", N_("Constellation l abels"), "V", group, true, false); addGuiActions("actionShow_Constellation_Labels", N_("Constellation l abels"), "V", group, true, false);
addGuiActions("actionShow_Constellation_Boundaries", N_("Constellati on boundaries"), "B", group, true, false); addGuiActions("actionShow_Constellation_Boundaries", N_("Constellati on boundaries"), "B", group, true, false);
addGuiActions("actionShow_Azimuthal_Grid", N_("Azimuthal grid"), "Z" , group, true, false); addGuiActions("actionShow_Azimuthal_Grid", N_("Azimuthal grid"), "Z" , group, true, false);
skipping to change at line 127 skipping to change at line 189
addGuiActions("actionShow_Horizon_Line", N_("Horizon line"), "", gro up, true, false); addGuiActions("actionShow_Horizon_Line", N_("Horizon line"), "", gro up, true, false);
addGuiActions("actionShow_Cardinal_Points", N_("Cardinal points"), " Q", group, true, false); addGuiActions("actionShow_Cardinal_Points", N_("Cardinal points"), " Q", group, true, false);
addGuiActions("actionShow_Ground", N_("Ground"), "G", group, true, f alse); addGuiActions("actionShow_Ground", N_("Ground"), "G", group, true, f alse);
addGuiActions("actionShow_Atmosphere", N_("Atmosphere"), "A", group, true, false); addGuiActions("actionShow_Atmosphere", N_("Atmosphere"), "A", group, true, false);
addGuiActions("actionShow_Fog", N_("Fog"), "F", group, true, false); addGuiActions("actionShow_Fog", N_("Fog"), "F", group, true, false);
addGuiActions("actionShow_Nebulas", N_("Nebulas"), "N", group, true, false); addGuiActions("actionShow_Nebulas", N_("Nebulas"), "N", group, true, false);
addGuiActions("actionShow_DSS", N_("Nebulas background images"), "", group, true, false); addGuiActions("actionShow_DSS", N_("Nebulas background images"), "", group, true, false);
addGuiActions("actionShow_Stars", N_("Stars"), "S", group, true, fal se); addGuiActions("actionShow_Stars", N_("Stars"), "S", group, true, fal se);
addGuiActions("actionShow_Stars_Labels", N_("Stars labels"), "Alt+S" , group, true, false);
addGuiActions("actionShow_Planets_Labels", N_("Planet labels"), "P", group, true, false); addGuiActions("actionShow_Planets_Labels", N_("Planet labels"), "P", group, true, false);
addGuiActions("actionShow_Planets_Orbits", N_("Planet orbits"), "O", group, true, false); addGuiActions("actionShow_Planets_Orbits", N_("Planet orbits"), "O", group, true, false);
addGuiActions("actionShow_Planets_Trails", N_("Planet trails"), "Shi ft+T", group, true, false); addGuiActions("actionShow_Planets_Trails", N_("Planet trails"), "Shi ft+T", group, true, false);
addGuiActions("actionShow_Night_Mode", N_("Night mode"), "", group, true, false); addGuiActions("actionShow_Night_Mode", N_("Night vision mode"), "Ctr l+N", group, true, false);
addGuiActions("actionSet_Full_Screen_Global", N_("Full-screen mode") , "F11", group, true, false, true); addGuiActions("actionSet_Full_Screen_Global", N_("Full-screen mode") , "F11", group, true, false, true);
addGuiActions("actionHorizontal_Flip", N_("Flip scene horizontally") , "Ctrl+Shift+H", group, true, false); addGuiActions("actionHorizontal_Flip", N_("Flip scene horizontally") , "Ctrl+Shift+H", group, true, false);
addGuiActions("actionVertical_Flip", N_("Flip scene vertically"), "C trl+Shift+V", group, true, false); addGuiActions("actionVertical_Flip", N_("Flip scene vertically"), "C trl+Shift+V", group, true, false);
group = N_("Windows"); group = N_("Windows");
addGuiActions("actionShow_Help_Window_Global", N_("Help window"), "F 1", group, true, false, true); addGuiActions("actionShow_Help_Window_Global", N_("Help window"), "F 1", group, true, false, true);
addGuiActions("actionShow_Configuration_Window_Global", N_("Configur ation window"), "F2", group, true, false, true); addGuiActions("actionShow_Configuration_Window_Global", N_("Configur ation window"), "F2", group, true, false, true);
addGuiActions("actionShow_Search_Window_Global", N_("Search window") , "F3, Ctrl+F", group, true, false, true); addGuiActions("actionShow_Search_Window_Global", N_("Search window") , "F3, Ctrl+F", group, true, false, true);
addGuiActions("actionShow_SkyView_Window_Global", N_("Sky and viewin g options window"), "F4", group, true, false, true); addGuiActions("actionShow_SkyView_Window_Global", N_("Sky and viewin g options window"), "F4", group, true, false, true);
addGuiActions("actionShow_DateTime_Window_Global", N_("Date/time win dow"), "F5", group, true, false, true); addGuiActions("actionShow_DateTime_Window_Global", N_("Date/time win dow"), "F5", group, true, false, true);
addGuiActions("actionShow_Location_Window_Global", N_("Location wind ow"), "F6", group, true, false, true); addGuiActions("actionShow_Location_Window_Global", N_("Location wind ow"), "F6", group, true, false, true);
#ifdef ENABLE_SCRIPT_CONSOLE #ifdef ENABLE_SCRIPT_CONSOLE
addGuiActions("actionShow_ScriptConsole_Window_Global", N_("Script c onsole window"), "F12", group, true, false, true); addGuiActions("actionShow_ScriptConsole_Window_Global", N_("Script c onsole window"), "F12", group, true, false, true);
#endif #endif
group = N_("Date and Time"); group = N_("Date and Time");
addGuiActions("actionDecrease_Script_Speed", N_("Slow down the scrip t execution rate"), "", group, false, false); addGuiActions("actionDecrease_Script_Speed", N_("Slow down the scrip t execution rate"), "", group, false, false);
addGuiActions("actionIncrease_Script_Speed", N_("Speed up the script execution rate"), "", group, false, false); addGuiActions("actionIncrease_Script_Speed", N_("Speed up the script execution rate"), "", group, false, false);
addGuiActions("actionSet_Real_Script_Speed", N_("Set the normal scri pt execution rate"), "", group, false, false); addGuiActions("actionSet_Real_Script_Speed", N_("Set the normal scri pt execution rate"), "", group, false, false);
addGuiActions("actionStop_Script", N_("Stop script execution"), "",
group, false, false);
addGuiActions("actionPause_Script", N_("Pause script execution"), ""
, group, false, false);
addGuiActions("actionResume_Script", N_("Resume script execution"),
"", group, false, false);
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("actionDecrease_Time_Speed_Less", N_("Decrease time sp eed (a little)"), "Shift+J", group, false, false); addGuiActions("actionDecrease_Time_Speed_Less", N_("Decrease time sp eed (a little)"), "Shift+J", group, false, false);
addGuiActions("actionIncrease_Time_Speed_Less", N_("Increase time sp eed (a little)"), "Shift+L", group, false, false); addGuiActions("actionIncrease_Time_Speed_Less", N_("Increase time sp eed (a little)"), "Shift+L", group, false, false);
addGuiActions("actionSet_Time_Rate_Zero", N_("Set time rate to zero" ), "7", 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);
skipping to change at line 185 skipping to change at line 251
addGuiActions("actionSet_Tracking", N_("Track object"), "T", group, true, false); addGuiActions("actionSet_Tracking", N_("Track object"), "T", group, true, false);
addGuiActions("actionZoom_In_Auto", N_("Zoom in on selected object") , "/", group, false, false); addGuiActions("actionZoom_In_Auto", N_("Zoom in on selected object") , "/", group, false, false);
addGuiActions("actionZoom_Out_Auto", N_("Zoom out"), "\\", group, fa lse, false); addGuiActions("actionZoom_Out_Auto", N_("Zoom out"), "\\", group, fa lse, false);
addGuiActions("actionSet_Home_Planet_To_Selected", N_("Set home plan et to selected planet"), "Ctrl+G", group, false, false); addGuiActions("actionSet_Home_Planet_To_Selected", N_("Set home plan et to selected planet"), "Ctrl+G", group, false, false);
group = N_("Miscellaneous"); group = N_("Miscellaneous");
addGuiActions("actionSwitch_Equatorial_Mount", N_("Switch between eq uatorial and azimuthal mount"), "Ctrl+M", group, true, false); addGuiActions("actionSwitch_Equatorial_Mount", N_("Switch between eq uatorial and azimuthal mount"), "Ctrl+M", group, true, false);
addGuiActions("actionQuit_Global", N_("Quit"), "Ctrl+Q", group, fals e, false, true); addGuiActions("actionQuit_Global", N_("Quit"), "Ctrl+Q", group, fals e, false, true);
addGuiActions("actionSave_Screenshot_Global", N_("Save screenshot"), "Ctrl+S", group, false, false, true); addGuiActions("actionSave_Screenshot_Global", N_("Save screenshot"), "Ctrl+S", group, false, false, true);
addGuiActions("actionSave_Copy_Object_Information_Global", N_("Copy selected object information to clipboard"), "Ctrl+C", group, false, false, true); addGuiActions("actionSave_Copy_Object_Information_Global", N_("Copy selected object information to clipboard"), "Ctrl+C", group, false, false, true);
addGuiActions("actionGo_Home_Global", N_("Go to home"), "Ctrl+H", gr oup, false, false, true);
addGuiActions("actionAutoHideHorizontalButtonBar", N_("Auto hide hor izontal button bar"), "", group, true, false); addGuiActions("actionAutoHideHorizontalButtonBar", N_("Auto hide hor izontal button bar"), "", group, true, false);
addGuiActions("actionAutoHideVerticalButtonBar", N_("Auto hide verti cal button bar"), "", group, true, false); addGuiActions("actionAutoHideVerticalButtonBar", N_("Auto hide verti cal button bar"), "", group, true, false);
addGuiActions("actionToggle_GuiHidden_Global", N_("Toggle visibility of GUI"), "Ctrl+T", group, true, false, true); addGuiActions("actionToggle_GuiHidden_Global", N_("Toggle visibility of GUI"), "Ctrl+T", group, true, false, true);
//////////////////////////////////////////////////////////////////// /// //////////////////////////////////////////////////////////////////// ///
// Connect all the GUI actions signals with the Core of Stellarium // Connect all the GUI actions signals with the Core of Stellarium
connect(getGuiActions("actionQuit_Global"), SIGNAL(triggered()), thi s, SLOT(quit())); connect(getGuiActions("actionQuit_Global"), SIGNAL(triggered()), thi s, SLOT(quit()));
initConstellationMgr(); initConstellationMgr();
skipping to change at line 211 skipping to change at line 278
StelSkyLayerMgr* imgr = GETSTELMODULE(StelSkyLayerMgr); StelSkyLayerMgr* imgr = GETSTELMODULE(StelSkyLayerMgr);
connect(getGuiActions("actionShow_DSS"), SIGNAL(toggled(bool)), imgr , SLOT(setFlagShow(bool))); connect(getGuiActions("actionShow_DSS"), SIGNAL(toggled(bool)), imgr , SLOT(setFlagShow(bool)));
getGuiActions("actionShow_DSS")->setChecked(imgr->getFlagShow()); getGuiActions("actionShow_DSS")->setChecked(imgr->getFlagShow());
StelCore* core = StelApp::getInstance().getCore(); StelCore* core = StelApp::getInstance().getCore();
StelMovementMgr* mmgr = GETSTELMODULE(StelMovementMgr); StelMovementMgr* mmgr = GETSTELMODULE(StelMovementMgr);
connect(getGuiActions("actionIncrease_Script_Speed"), SIGNAL(trigger ed()), this, SLOT(increaseScriptSpeed())); connect(getGuiActions("actionIncrease_Script_Speed"), SIGNAL(trigger ed()), this, SLOT(increaseScriptSpeed()));
connect(getGuiActions("actionDecrease_Script_Speed"), SIGNAL(trigger ed()), this, SLOT(decreaseScriptSpeed())); connect(getGuiActions("actionDecrease_Script_Speed"), SIGNAL(trigger ed()), this, SLOT(decreaseScriptSpeed()));
connect(getGuiActions("actionSet_Real_Script_Speed"), SIGNAL(trigger ed()), this, SLOT(setRealScriptSpeed())); connect(getGuiActions("actionSet_Real_Script_Speed"), SIGNAL(trigger ed()), this, SLOT(setRealScriptSpeed()));
connect(getGuiActions("actionStop_Script"), SIGNAL(triggered()), thi
s, SLOT(stopScript()));
connect(getGuiActions("actionPause_Script"), SIGNAL(triggered()), th
is, SLOT(pauseScript()));
connect(getGuiActions("actionResume_Script"), SIGNAL(triggered()), t
his, SLOT(resumeScript()));
connect(getGuiActions("actionIncrease_Time_Speed"), SIGNAL(triggered ()), core, SLOT(increaseTimeSpeed())); connect(getGuiActions("actionIncrease_Time_Speed"), SIGNAL(triggered ()), core, SLOT(increaseTimeSpeed()));
connect(getGuiActions("actionDecrease_Time_Speed"), SIGNAL(triggered ()), core, SLOT(decreaseTimeSpeed())); connect(getGuiActions("actionDecrease_Time_Speed"), SIGNAL(triggered ()), core, SLOT(decreaseTimeSpeed()));
connect(getGuiActions("actionIncrease_Time_Speed_Less"), SIGNAL(trig gered()), core, SLOT(increaseTimeSpeedLess())); connect(getGuiActions("actionIncrease_Time_Speed_Less"), SIGNAL(trig gered()), core, SLOT(increaseTimeSpeedLess()));
connect(getGuiActions("actionDecrease_Time_Speed_Less"), SIGNAL(trig gered()), core, SLOT(decreaseTimeSpeedLess())); connect(getGuiActions("actionDecrease_Time_Speed_Less"), SIGNAL(trig gered()), core, SLOT(decreaseTimeSpeedLess()));
connect(getGuiActions("actionSet_Real_Time_Speed"), SIGNAL(triggered ()), core, SLOT(toggleRealTimeSpeed())); connect(getGuiActions("actionSet_Real_Time_Speed"), SIGNAL(triggered ()), core, SLOT(toggleRealTimeSpeed()));
connect(getGuiActions("actionSet_Time_Rate_Zero"), SIGNAL(triggered( )), core, SLOT(setZeroTimeSpeed())); connect(getGuiActions("actionSet_Time_Rate_Zero"), SIGNAL(triggered( )), core, SLOT(setZeroTimeSpeed()));
connect(getGuiActions("actionReturn_To_Current_Time"), SIGNAL(trigge red()), core, SLOT(setTimeNow())); connect(getGuiActions("actionReturn_To_Current_Time"), SIGNAL(trigge red()), core, SLOT(setTimeNow()));
connect(getGuiActions("actionSwitch_Equatorial_Mount"), SIGNAL(toggl ed(bool)), mmgr, SLOT(setEquatorialMount(bool))); connect(getGuiActions("actionSwitch_Equatorial_Mount"), SIGNAL(toggl ed(bool)), mmgr, SLOT(setEquatorialMount(bool)));
getGuiActions("actionSwitch_Equatorial_Mount")->setChecked(mmgr->get MountMode() != StelMovementMgr::MountAltAzimuthal); getGuiActions("actionSwitch_Equatorial_Mount")->setChecked(mmgr->get MountMode() != StelMovementMgr::MountAltAzimuthal);
connect(getGuiActions("actionAdd_Solar_Hour"), SIGNAL(triggered()), core, SLOT(addHour())); connect(getGuiActions("actionAdd_Solar_Hour"), SIGNAL(triggered()), core, SLOT(addHour()));
skipping to change at line 235 skipping to change at line 305
connect(getGuiActions("actionSubtract_Solar_Week"), SIGNAL(triggered ()), core, SLOT(subtractWeek())); connect(getGuiActions("actionSubtract_Solar_Week"), SIGNAL(triggered ()), core, SLOT(subtractWeek()));
connect(getGuiActions("actionAdd_Sidereal_Day"), SIGNAL(triggered()) , core, SLOT(addSiderealDay())); connect(getGuiActions("actionAdd_Sidereal_Day"), SIGNAL(triggered()) , core, SLOT(addSiderealDay()));
connect(getGuiActions("actionAdd_Sidereal_Week"), SIGNAL(triggered() ), core, SLOT(addSiderealWeek())); connect(getGuiActions("actionAdd_Sidereal_Week"), SIGNAL(triggered() ), core, SLOT(addSiderealWeek()));
connect(getGuiActions("actionAdd_Sidereal_Month"), SIGNAL(triggered( )), core, SLOT(addSiderealMonth())); connect(getGuiActions("actionAdd_Sidereal_Month"), SIGNAL(triggered( )), core, SLOT(addSiderealMonth()));
connect(getGuiActions("actionAdd_Sidereal_Year"), SIGNAL(triggered() ), core, SLOT(addSiderealYear())); connect(getGuiActions("actionAdd_Sidereal_Year"), SIGNAL(triggered() ), core, SLOT(addSiderealYear()));
connect(getGuiActions("actionSubtract_Sidereal_Day"), SIGNAL(trigger ed()), core, SLOT(subtractSiderealDay())); connect(getGuiActions("actionSubtract_Sidereal_Day"), SIGNAL(trigger ed()), core, SLOT(subtractSiderealDay()));
connect(getGuiActions("actionSubtract_Sidereal_Week"), SIGNAL(trigge red()), core, SLOT(subtractSiderealWeek())); connect(getGuiActions("actionSubtract_Sidereal_Week"), SIGNAL(trigge red()), core, SLOT(subtractSiderealWeek()));
connect(getGuiActions("actionSubtract_Sidereal_Month"), SIGNAL(trigg ered()), core, SLOT(subtractSiderealMonth())); connect(getGuiActions("actionSubtract_Sidereal_Month"), SIGNAL(trigg ered()), core, SLOT(subtractSiderealMonth()));
connect(getGuiActions("actionSubtract_Sidereal_Year"), SIGNAL(trigge red()), core, SLOT(subtractSiderealYear())); connect(getGuiActions("actionSubtract_Sidereal_Year"), SIGNAL(trigge red()), core, SLOT(subtractSiderealYear()));
connect(getGuiActions("actionSet_Home_Planet_To_Selected"), SIGNAL(t riggered()), core, SLOT(moveObserverToSelected())); connect(getGuiActions("actionSet_Home_Planet_To_Selected"), SIGNAL(t riggered()), core, SLOT(moveObserverToSelected()));
connect(getGuiActions("actionGo_Home_Global"), SIGNAL(triggered()), core, SLOT(returnToHome()));
// connect the actor after setting the nightmode. // connect the actor after setting the nightmode.
// StelApp::init() already set flagNightMode for us, don't do it twi ce! // StelApp::init() already set flagNightMode for us, don't do it twi ce!
getGuiActions("actionShow_Night_Mode")->setChecked(StelApp::getInsta nce().getVisionModeNight()); getGuiActions("actionShow_Night_Mode")->setChecked(StelApp::getInsta nce().getVisionModeNight());
connect(getGuiActions("actionShow_Night_Mode"), SIGNAL(toggled(bool) ), &StelApp::getInstance(), SLOT(setVisionModeNight(bool))); connect(getGuiActions("actionShow_Night_Mode"), SIGNAL(toggled(bool) ), &StelApp::getInstance(), SLOT(setVisionModeNight(bool)));
connect(getGuiActions("actionGoto_Selected_Object"), SIGNAL(triggere d()), mmgr, SLOT(setFlagTracking())); connect(getGuiActions("actionGoto_Selected_Object"), SIGNAL(triggere d()), mmgr, SLOT(setFlagTracking()));
connect(getGuiActions("actionZoom_In_Auto"), SIGNAL(triggered()), mm gr, SLOT(autoZoomIn())); connect(getGuiActions("actionZoom_In_Auto"), SIGNAL(triggered()), mm gr, SLOT(autoZoomIn()));
connect(getGuiActions("actionZoom_Out_Auto"), SIGNAL(triggered()), m mgr, SLOT(autoZoomOut())); connect(getGuiActions("actionZoom_Out_Auto"), SIGNAL(triggered()), m mgr, SLOT(autoZoomOut()));
connect(getGuiActions("actionSet_Tracking"), SIGNAL(toggled(bool)), mmgr, SLOT(setFlagTracking(bool))); connect(getGuiActions("actionSet_Tracking"), SIGNAL(toggled(bool)), mmgr, SLOT(setFlagTracking(bool)));
getGuiActions("actionSet_Tracking")->setChecked(mmgr->getFlagTrackin g()); getGuiActions("actionSet_Tracking")->setChecked(mmgr->getFlagTrackin g());
connect(getGuiActions("actionSet_Full_Screen_Global"), SIGNAL(toggle d(bool)), &StelMainWindow::getInstance(), SLOT(setFullScreen(bool))); connect(getGuiActions("actionSet_Full_Screen_Global"), SIGNAL(toggle d(bool)), &StelMainWindow::getInstance(), SLOT(setFullScreen(bool)));
getGuiActions("actionSet_Full_Screen_Global")->setChecked(StelMainWi ndow::getInstance().isFullScreen()); getGuiActions("actionSet_Full_Screen_Global")->setChecked(StelMainWi ndow::getInstance().isFullScreen());
connect(getGuiActions("actionShow_Location_Window_Global"), SIGNAL(t QAction* tempAction = getGuiActions("actionShow_Location_Window_Glob
oggled(bool)), &locationDialog, SLOT(setVisible(bool))); al");
connect(&locationDialog, SIGNAL(visibleChanged(bool)), getGuiActions connect(tempAction, SIGNAL(toggled(bool)),
("actionShow_Location_Window_Global"), SLOT(setChecked(bool))); locationDialog, SLOT(setVisible(bool)));
connect(locationDialog, SIGNAL(visibleChanged(bool)),
tempAction, SLOT(setChecked(bool)));
#ifdef ENABLE_SCRIPT_CONSOLE #ifdef ENABLE_SCRIPT_CONSOLE
connect(getGuiActions("actionShow_ScriptConsole_Window_Global"), SIG tempAction = getGuiActions("actionShow_ScriptConsole_Window_Global")
NAL(toggled(bool)), &scriptConsole, SLOT(setVisible(bool))); ;
connect(&scriptConsole, SIGNAL(visibleChanged(bool)), getGuiActions( connect(tempAction, SIGNAL(toggled(bool)),
"actionShow_ScriptConsole_Window_Global"), SLOT(setChecked(bool))); scriptConsole, SLOT(setVisible(bool)));
connect(scriptConsole, SIGNAL(visibleChanged(bool)),
tempAction, SLOT(setChecked(bool)));
#endif #endif
connect(getGuiActions("actionShow_Configuration_Window_Global"), SIG tempAction = getGuiActions("actionShow_Configuration_Window_Global")
NAL(toggled(bool)), configurationDialog, SLOT(setVisible(bool))); ;
connect(configurationDialog, SIGNAL(visibleChanged(bool)), getGuiAct connect(tempAction, SIGNAL(toggled(bool)),
ions("actionShow_Configuration_Window_Global"), SLOT(setChecked(bool))); configurationDialog, SLOT(setVisible(bool)));
connect(configurationDialog, SIGNAL(visibleChanged(bool)),
connect(getGuiActions("actionShow_SkyView_Window_Global"), SIGNAL(to tempAction, SLOT(setChecked(bool)));
ggled(bool)), &viewDialog, SLOT(setVisible(bool)));
connect(&viewDialog, SIGNAL(visibleChanged(bool)), getGuiActions("ac tempAction = getGuiActions("actionShow_SkyView_Window_Global");
tionShow_SkyView_Window_Global"), SLOT(setChecked(bool))); connect(tempAction, SIGNAL(toggled(bool)),
viewDialog, SLOT(setVisible(bool)));
connect(getGuiActions("actionShow_Help_Window_Global"), SIGNAL(toggl connect(viewDialog, SIGNAL(visibleChanged(bool)),
ed(bool)), &helpDialog, SLOT(setVisible(bool))); tempAction, SLOT(setChecked(bool)));
connect(&helpDialog, SIGNAL(visibleChanged(bool)), getGuiActions("ac
tionShow_Help_Window_Global"), SLOT(setChecked(bool))); tempAction = getGuiActions("actionShow_Help_Window_Global");
connect(tempAction, SIGNAL(toggled(bool)),
connect(getGuiActions("actionShow_DateTime_Window_Global"), SIGNAL(t helpDialog, SLOT(setVisible(bool)));
oggled(bool)), &dateTimeDialog, SLOT(setVisible(bool))); connect(helpDialog, SIGNAL(visibleChanged(bool)),
connect(&dateTimeDialog, SIGNAL(visibleChanged(bool)), getGuiActions tempAction, SLOT(setChecked(bool)));
("actionShow_DateTime_Window_Global"), SLOT(setChecked(bool)));
tempAction = getGuiActions("actionShow_DateTime_Window_Global");
connect(getGuiActions("actionShow_Search_Window_Global"), SIGNAL(tog connect(tempAction, SIGNAL(toggled(bool)),
gled(bool)), &searchDialog, SLOT(setVisible(bool))); dateTimeDialog, SLOT(setVisible(bool)));
connect(&searchDialog, SIGNAL(visibleChanged(bool)), getGuiActions(" connect(dateTimeDialog, SIGNAL(visibleChanged(bool)),
actionShow_Search_Window_Global"), SLOT(setChecked(bool))); tempAction, SLOT(setChecked(bool)));
tempAction = getGuiActions("actionShow_Search_Window_Global");
connect(tempAction, SIGNAL(toggled(bool)),
searchDialog, SLOT(setVisible(bool)));
connect(searchDialog, SIGNAL(visibleChanged(bool)),
tempAction, SLOT(setChecked(bool)));
connect(getGuiActions("actionSave_Screenshot_Global"), SIGNAL(trigge red()), &StelMainGraphicsView::getInstance(), SLOT(saveScreenShot())); connect(getGuiActions("actionSave_Screenshot_Global"), SIGNAL(trigge red()), &StelMainGraphicsView::getInstance(), SLOT(saveScreenShot()));
connect(getGuiActions("actionSave_Copy_Object_Information_Global"), SIGNAL(triggered()), this, SLOT(copySelectedObjectInfo())); connect(getGuiActions("actionSave_Copy_Object_Information_Global"), SIGNAL(triggered()), this, SLOT(copySelectedObjectInfo()));
getGuiActions("actionToggle_GuiHidden_Global")->setChecked(true); getGuiActions("actionToggle_GuiHidden_Global")->setChecked(true);
connect(getGuiActions("actionToggle_GuiHidden_Global"), SIGNAL(toggl ed(bool)), this, SLOT(setGuiVisible(bool))); connect(getGuiActions("actionToggle_GuiHidden_Global"), SIGNAL(toggl ed(bool)), this, SLOT(setGuiVisible(bool)));
connect(getGuiActions("actionHorizontal_Flip"), SIGNAL(toggled(bool) ), StelApp::getInstance().getCore(), SLOT(setFlipHorz(bool))); connect(getGuiActions("actionHorizontal_Flip"), SIGNAL(toggled(bool) ), StelApp::getInstance().getCore(), SLOT(setFlipHorz(bool)));
getGuiActions("actionHorizontal_Flip")->setChecked(StelApp::getInsta nce().getCore()->getFlipHorz()); getGuiActions("actionHorizontal_Flip")->setChecked(StelApp::getInsta nce().getCore()->getFlipHorz());
connect(getGuiActions("actionVertical_Flip"), SIGNAL(toggled(bool)), StelApp::getInstance().getCore(), SLOT(setFlipVert(bool))); connect(getGuiActions("actionVertical_Flip"), SIGNAL(toggled(bool)), StelApp::getInstance().getCore(), SLOT(setFlipVert(bool)));
getGuiActions("actionVertical_Flip")->setChecked(StelApp::getInstanc e().getCore()->getFlipVert()); getGuiActions("actionVertical_Flip")->setChecked(StelApp::getInstanc e().getCore()->getFlipVert());
StarMgr* smgr = GETSTELMODULE(StarMgr); StarMgr* smgr = GETSTELMODULE(StarMgr);
connect(getGuiActions("actionShow_Stars"), SIGNAL(toggled(bool)), sm gr, SLOT(setFlagStars(bool))); connect(getGuiActions("actionShow_Stars"), SIGNAL(toggled(bool)), sm gr, SLOT(setFlagStars(bool)));
getGuiActions("actionShow_Stars")->setChecked(smgr->getFlagStars()); getGuiActions("actionShow_Stars")->setChecked(smgr->getFlagStars());
connect(getGuiActions("actionShow_Stars_Labels"), SIGNAL(toggled(boo
l)), smgr, SLOT(setFlagLabels(bool)));
getGuiActions("actionShow_Stars_Labels")->setChecked(smgr->getFlagLa
bels());
SolarSystem* ssmgr = GETSTELMODULE(SolarSystem); SolarSystem* ssmgr = GETSTELMODULE(SolarSystem);
connect(getGuiActions("actionShow_Planets_Labels"), SIGNAL(toggled(b ool)), ssmgr, SLOT(setFlagLabels(bool))); connect(getGuiActions("actionShow_Planets_Labels"), SIGNAL(toggled(b ool)), ssmgr, SLOT(setFlagLabels(bool)));
getGuiActions("actionShow_Planets_Labels")->setChecked(ssmgr->getFla gLabels()); getGuiActions("actionShow_Planets_Labels")->setChecked(ssmgr->getFla gLabels());
connect(getGuiActions("actionShow_Planets_Orbits"), SIGNAL(toggled(b ool)), ssmgr, SLOT(setFlagOrbits(bool))); connect(getGuiActions("actionShow_Planets_Orbits"), SIGNAL(toggled(b ool)), ssmgr, SLOT(setFlagOrbits(bool)));
getGuiActions("actionShow_Planets_Orbits")->setChecked(ssmgr->getFla gOrbits()); getGuiActions("actionShow_Planets_Orbits")->setChecked(ssmgr->getFla gOrbits());
connect(getGuiActions("actionShow_Planets_Trails"), SIGNAL(toggled(b ool)), ssmgr, SLOT(setFlagTrails(bool))); connect(getGuiActions("actionShow_Planets_Trails"), SIGNAL(toggled(b ool)), ssmgr, SLOT(setFlagTrails(bool)));
getGuiActions("actionShow_Planets_Trails")->setChecked(ssmgr->getFla gTrails()); getGuiActions("actionShow_Planets_Trails")->setChecked(ssmgr->getFla gTrails());
skipping to change at line 468 skipping to change at line 563
l->setContentsMargins(0,0,0,0); l->setContentsMargins(0,0,0,0);
l->setSpacing(0); l->setSpacing(0);
l->addItem(skyGui, 0, 0); l->addItem(skyGui, 0, 0);
stelAppGraphicsWidget->setLayout(l); stelAppGraphicsWidget->setLayout(l);
setStelStyle(StelApp::getInstance().getCurrentStelStyle()); setStelStyle(StelApp::getInstance().getCurrentStelStyle());
skyGui->setGeometry(stelAppGraphicsWidget->geometry()); skyGui->setGeometry(stelAppGraphicsWidget->geometry());
skyGui->updateBarsPos(); skyGui->updateBarsPos();
// 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
// and set the text color for disabled in the stylesheets.
QPalette p = QApplication::palette();
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.
p.setColor(QPalette::Active, QPalette::Button, QColor(255,255,255));
QApplication::setPalette(p);
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() void StelGui::initConstellationMgr()
{ {
ConstellationMgr* constellationMgr = GETSTELMODULE(ConstellationMgr) ; ConstellationMgr* constellationMgr = GETSTELMODULE(ConstellationMgr) ;
getGuiActions("actionShow_Constellation_Lines")->setChecked(constell ationMgr->getFlagLines()); getGuiActions("actionShow_Constellation_Lines")->setChecked(constell ationMgr->getFlagLines());
skipping to change at line 714 skipping to change at line 819
QFile styleFile(qtStyleFileName); QFile styleFile(qtStyleFileName);
styleFile.open(QIODevice::ReadOnly); styleFile.open(QIODevice::ReadOnly);
currentStelStyle.qtStyleSheet = styleFile.readAll(); currentStelStyle.qtStyleSheet = styleFile.readAll();
QFile htmlStyleFile(htmlStyleFileName); QFile htmlStyleFile(htmlStyleFileName);
htmlStyleFile.open(QIODevice::ReadOnly); htmlStyleFile.open(QIODevice::ReadOnly);
currentStelStyle.htmlStyleSheet = htmlStyleFile.readAll(); currentStelStyle.htmlStyleSheet = htmlStyleFile.readAll();
} }
qApp->setStyleSheet(currentStelStyle.qtStyleSheet); 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(); StelGuiBase::updateI18n();
} }
void StelGui::update() void StelGui::update()
{ {
skipping to change at line 809 skipping to change at line 914
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. // Add a new progress bar in the lower right corner of the screen.
QProgressBar* StelGui::addProgressBar() QProgressBar* StelGui::addProgressBar()
{ {
return skyGui->progressBarMgr->addProgressBar(); return skyGui->progressBarMgr->addProgressBar();
} }
#ifndef DISABLE_SCRIPTING #ifndef DISABLE_SCRIPTING
void StelGui::setScriptKeys(bool b) void StelGui::setScriptKeys(bool b)
{ {
if (b) if (b)
{ {
getGuiActions("actionDecrease_Time_Speed")->setShortcut(QKey Sequence()); getGuiActions("actionDecrease_Time_Speed")->setShortcut(QKey Sequence());
getGuiActions("actionIncrease_Time_Speed")->setShortcut(QKey Sequence()); getGuiActions("actionIncrease_Time_Speed")->setShortcut(QKey Sequence());
getGuiActions("actionSet_Real_Time_Speed")->setShortcut(QKey Sequence()); getGuiActions("actionSet_Real_Time_Speed")->setShortcut(QKey Sequence());
getGuiActions("actionDecrease_Script_Speed")->setShortcut(QK eySequence("J")); getGuiActions("actionDecrease_Script_Speed")->setShortcut(QK eySequence("J"));
getGuiActions("actionIncrease_Script_Speed")->setShortcut(QK eySequence("L")); getGuiActions("actionIncrease_Script_Speed")->setShortcut(QK eySequence("L"));
getGuiActions("actionSet_Real_Script_Speed")->setShortcut(QK eySequence("K")); getGuiActions("actionSet_Real_Script_Speed")->setShortcut(QK eySequence("K"));
getGuiActions("actionStop_Script")->setShortcut(QKeySequence
("4"));
getGuiActions("actionPause_Script")->setShortcut(QKeySequenc
e("5"));
getGuiActions("actionResume_Script")->setShortcut(QKeySequen
ce("6"));
} }
else else
{ {
getGuiActions("actionDecrease_Script_Speed")->setShortcut(QK eySequence()); getGuiActions("actionDecrease_Script_Speed")->setShortcut(QK eySequence());
getGuiActions("actionIncrease_Script_Speed")->setShortcut(QK eySequence()); getGuiActions("actionIncrease_Script_Speed")->setShortcut(QK eySequence());
getGuiActions("actionSet_Real_Script_Speed")->setShortcut(QK eySequence()); getGuiActions("actionSet_Real_Script_Speed")->setShortcut(QK eySequence());
getGuiActions("actionDecrease_Time_Speed")->setShortcut(QKey Sequence("J")); getGuiActions("actionDecrease_Time_Speed")->setShortcut(QKey Sequence("J"));
getGuiActions("actionIncrease_Time_Speed")->setShortcut(QKey Sequence("L")); getGuiActions("actionIncrease_Time_Speed")->setShortcut(QKey Sequence("L"));
getGuiActions("actionSet_Real_Time_Speed")->setShortcut(QKey Sequence("K")); getGuiActions("actionSet_Real_Time_Speed")->setShortcut(QKey Sequence("K"));
} }
skipping to change at line 855 skipping to change at line 964
void StelGui::decreaseScriptSpeed() void StelGui::decreaseScriptSpeed()
{ {
StelMainGraphicsView::getInstance().getScriptMgr().setScriptRate(Ste lMainGraphicsView::getInstance().getScriptMgr().getScriptRate()/2); StelMainGraphicsView::getInstance().getScriptMgr().setScriptRate(Ste lMainGraphicsView::getInstance().getScriptMgr().getScriptRate()/2);
} }
void StelGui::setRealScriptSpeed() void StelGui::setRealScriptSpeed()
{ {
StelMainGraphicsView::getInstance().getScriptMgr().setScriptRate(1); StelMainGraphicsView::getInstance().getScriptMgr().setScriptRate(1);
} }
void StelGui::stopScript()
{
StelMainGraphicsView::getInstance().getScriptMgr().stopScript();
}
void StelGui::pauseScript()
{
StelMainGraphicsView::getInstance().getScriptMgr().pauseScript();
}
void StelGui::resumeScript()
{
StelMainGraphicsView::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,
QP ixmap(":/graphicGui/btFlipVertical-on.png"), QP ixmap(":/graphicGui/btFlipVertical-on.png"),
skipping to change at line 1013 skipping to change at line 1137
#endif #endif
void StelGui::setGuiVisible(bool b) void StelGui::setGuiVisible(bool b)
{ {
setVisible(b); setVisible(b);
} }
QAction* StelGui::addGuiActions(const QString& actionName, const QString& t ext, const QString& shortCut, const QString& helpGroup, bool checkable, boo l autoRepeat, bool global) QAction* StelGui::addGuiActions(const QString& actionName, const QString& t ext, const QString& shortCut, const QString& helpGroup, bool checkable, boo l autoRepeat, bool global)
{ {
if (!shortCut.isEmpty()) if (!shortCut.isEmpty())
helpDialog.setKey(helpGroup, "", shortCut, text); helpDialog->setKey(helpGroup, "", shortCut, text);
return StelGuiBase::addGuiActions(actionName, text, shortCut, helpGr oup, checkable, autoRepeat, global); return StelGuiBase::addGuiActions(actionName, text, shortCut, helpGr oup, checkable, autoRepeat, global);
} }
/* ************************************************************************ ****************************************** */ /* ************************************************************************ ****************************************** */
#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) void StelGui::artDisplayedUpdated(const bool displayed)
 End of changes. 24 change blocks. 
42 lines changed or deleted 169 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/