StelGui.cpp   StelGui.cpp 
skipping to change at line 77 skipping to change at line 77
#include <QGuiApplication> #include <QGuiApplication>
#include <QFile> #include <QFile>
#include <QTextBrowser> #include <QTextBrowser>
#include <QGraphicsWidget> #include <QGraphicsWidget>
#include <QGraphicsGridLayout> #include <QGraphicsGridLayout>
#include <QClipboard> #include <QClipboard>
#include <QPalette> #include <QPalette>
#include <QColor> #include <QColor>
#include <QAction> #include <QAction>
StelGuiBase* StelStandardGuiPluginInterface::getStelGuiBase() const
{
// Allow to load the resources when used as a static plugin
Q_INIT_RESOURCE(guiRes);
return new StelGui();
}
StelGui::StelGui() StelGui::StelGui()
: topLevelGraphicsWidget(NULL) : topLevelGraphicsWidget(NULL)
, skyGui(NULL) , skyGui(NULL)
, buttonTimeRewind(NULL) , buttonTimeRewind(NULL)
, buttonTimeRealTimeSpeed(NULL) , buttonTimeRealTimeSpeed(NULL)
, buttonTimeCurrent(NULL) , buttonTimeCurrent(NULL)
, buttonTimeForward(NULL) , buttonTimeForward(NULL)
, buttonGotoSelectedObject(NULL) , buttonGotoSelectedObject(NULL)
, locationDialog(0) , locationDialog(0)
, helpDialog(0) , helpDialog(0)
skipping to change at line 109 skipping to change at line 101
, configurationDialog(0) , configurationDialog(0)
#ifdef ENABLE_SCRIPT_CONSOLE #ifdef ENABLE_SCRIPT_CONSOLE
, scriptConsole(0) , scriptConsole(0)
#endif #endif
, flagShowFlipButtons(false) , flagShowFlipButtons(false)
, flipVert(NULL) , flipVert(NULL)
, flipHoriz(NULL) , flipHoriz(NULL)
, flagShowNebulaBackgroundButton(false) , flagShowNebulaBackgroundButton(false)
, btShowNebulaeBackground(NULL) , btShowNebulaeBackground(NULL)
, initDone(false) , initDone(false)
, flagShowDecimalDegrees(false)
{ {
// QPixmapCache::setCacheLimit(30000); ? // QPixmapCache::setCacheLimit(30000); ?
} }
StelGui::~StelGui() StelGui::~StelGui()
{ {
delete skyGui; delete skyGui;
skyGui = NULL; skyGui = NULL;
if (locationDialog) if (locationDialog)
skipping to change at line 207 skipping to change at line 198
#endif #endif
actionsMgr->addAction("actionShow_Help_Window_Global", windowsGroup, N_("Help window"), helpDialog, "visible", "F1", "", true); actionsMgr->addAction("actionShow_Help_Window_Global", windowsGroup, N_("Help window"), helpDialog, "visible", "F1", "", true);
actionsMgr->addAction("actionShow_Configuration_Window_Global", wind owsGroup, N_("Configuration window"), configurationDialog, "visible", "F2", "", true); actionsMgr->addAction("actionShow_Configuration_Window_Global", wind owsGroup, N_("Configuration window"), configurationDialog, "visible", "F2", "", true);
actionsMgr->addAction("actionShow_Search_Window_Global", windowsGrou p, N_("Search window"), searchDialog, "visible", "F3", "Ctrl+F", true); actionsMgr->addAction("actionShow_Search_Window_Global", windowsGrou p, N_("Search window"), searchDialog, "visible", "F3", "Ctrl+F", true);
actionsMgr->addAction("actionShow_SkyView_Window_Global", windowsGro up, N_("Sky and viewing options window"), viewDialog, "visible", "F4", "", true); actionsMgr->addAction("actionShow_SkyView_Window_Global", windowsGro up, N_("Sky and viewing options window"), viewDialog, "visible", "F4", "", true);
actionsMgr->addAction("actionShow_DateTime_Window_Global", windowsGr oup, N_("Date/time window"), dateTimeDialog, "visible", "F5", "", true); actionsMgr->addAction("actionShow_DateTime_Window_Global", windowsGr oup, N_("Date/time window"), dateTimeDialog, "visible", "F5", "", true);
actionsMgr->addAction("actionShow_Location_Window_Global", windowsGr oup, N_("Location window"), locationDialog, "visible", "F6", "", true); actionsMgr->addAction("actionShow_Location_Window_Global", windowsGr oup, N_("Location window"), locationDialog, "visible", "F6", "", true);
actionsMgr->addAction("actionShow_Shortcuts_Window_Global", windowsG roup, N_("Shortcuts window"), shortcutsDialog, "visible", "F7", "", true); actionsMgr->addAction("actionShow_Shortcuts_Window_Global", windowsG roup, N_("Shortcuts window"), shortcutsDialog, "visible", "F7", "", true);
actionsMgr->addAction("actionSave_Copy_Object_Information_Global", m iscGroup, N_("Copy selected object information to clipboard"), this, "copyS electedObjectInfo()", "Ctrl+C", "", true); actionsMgr->addAction("actionSave_Copy_Object_Information_Global", m iscGroup, N_("Copy selected object information to clipboard"), this, "copyS electedObjectInfo()", "Ctrl+C", "", true);
actionsMgr->addAction("actionToggle_GuiHidden_Global", miscGroup, N_ ("Toggle visibility of GUI"), this, "visible", "Ctrl+T", "", true);
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
Q_ASSERT(conf); Q_ASSERT(conf);
setAutoHideHorizontalButtonBar(conf->value("gui/auto_hide_horizontal _toolbar", true).toBool()); setAutoHideHorizontalButtonBar(conf->value("gui/auto_hide_horizontal _toolbar", true).toBool());
setAutoHideVerticalButtonBar(conf->value("gui/auto_hide_vertical_too lbar", true).toBool()); setAutoHideVerticalButtonBar(conf->value("gui/auto_hide_vertical_too lbar", true).toBool());
actionsMgr->addAction("actionAutoHideHorizontalButtonBar", miscGroup , N_("Auto hide horizontal button bar"), this, "autoHideHorizontalButtonBar "); actionsMgr->addAction("actionAutoHideHorizontalButtonBar", miscGroup , N_("Auto hide horizontal button bar"), this, "autoHideHorizontalButtonBar ");
actionsMgr->addAction("actionAutoHideVerticalButtonBar", miscGroup, N_("Auto hide vertical button bar"), this, "autoHideVerticalButtonBar"); actionsMgr->addAction("actionAutoHideVerticalButtonBar", miscGroup, N_("Auto hide vertical button bar"), this, "autoHideVerticalButtonBar");
setGuiVisible(conf->value("gui/flag_show_gui", true).toBool());
actionsMgr->addAction("actionToggle_GuiHidden_Global", miscGroup, N_
("Toggle visibility of GUI"), this, "visible", "Ctrl+T", "", true);
#ifndef DISABLE_SCRIPTING #ifndef DISABLE_SCRIPTING
StelScriptMgr* scriptMgr = &StelApp::getInstance().getScriptMgr(); StelScriptMgr* scriptMgr = &StelApp::getInstance().getScriptMgr();
connect(scriptMgr, SIGNAL(scriptRunning()), this, SLOT(scriptStarted ())); connect(scriptMgr, SIGNAL(scriptRunning()), this, SLOT(scriptStarted ()));
connect(scriptMgr, SIGNAL(scriptStopped()), this, SLOT(scriptStopped ())); connect(scriptMgr, SIGNAL(scriptStopped()), this, SLOT(scriptStopped ()));
#endif #endif
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
//// QGraphicsView based GUI //// QGraphicsView based GUI
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
skipping to change at line 362 skipping to change at line 355
skyGui->buttonBar->setGroupMargin("070-timeGroup", 32, 0); skyGui->buttonBar->setGroupMargin("070-timeGroup", 32, 0);
pxmapOn = QPixmap(":/graphicGui/btQuit.png"); pxmapOn = QPixmap(":/graphicGui/btQuit.png");
b = new StelButton(NULL, pxmapOn, pxmapOn, pxmapGlow32x32, "actionQu it_Global"); b = new StelButton(NULL, pxmapOn, pxmapOn, pxmapGlow32x32, "actionQu it_Global");
skyGui->buttonBar->addButton(b, "080-quitGroup"); skyGui->buttonBar->addButton(b, "080-quitGroup");
// add the flip buttons if requested in the config // add the flip buttons if requested in the config
setFlagShowFlipButtons(conf->value("gui/flag_show_flip_buttons", fal se).toBool()); setFlagShowFlipButtons(conf->value("gui/flag_show_flip_buttons", fal se).toBool());
setFlagShowNebulaBackgroundButton(conf->value("gui/flag_show_nebulae _background_button", false).toBool()); setFlagShowNebulaBackgroundButton(conf->value("gui/flag_show_nebulae _background_button", false).toBool());
setFlagShowDecimalDegrees(conf->value("gui/flag_show_decimal_degrees
", false).toBool());
//////////////////////////////////////////////////////////////////// /// //////////////////////////////////////////////////////////////////// ///
// Create the main base widget // Create the main base widget
skyGui->init(this); skyGui->init(this);
QGraphicsGridLayout* l = new QGraphicsGridLayout(); QGraphicsGridLayout* l = new QGraphicsGridLayout();
l->setContentsMargins(0,0,0,0); l->setContentsMargins(0,0,0,0);
l->setSpacing(0); l->setSpacing(0);
l->addItem(skyGui, 0, 0); l->addItem(skyGui, 0, 0);
atopLevelGraphicsWidget->setLayout(l); atopLevelGraphicsWidget->setLayout(l);
setStelStyle(StelApp::getInstance().getCurrentStelStyle()); setStelStyle(StelApp::getInstance().getCurrentStelStyle());
skipping to change at line 531 skipping to change at line 522
flag = StelMainView::getInstance().isFullScreen(); flag = StelMainView::getInstance().isFullScreen();
if (getAction("actionSet_Full_Screen_Global")->isChecked() != flag) if (getAction("actionSet_Full_Screen_Global")->isChecked() != flag)
getAction("actionSet_Full_Screen_Global")->setChecked(flag); getAction("actionSet_Full_Screen_Global")->setChecked(flag);
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(); forceRefreshGui();
} }
dateTimeDialog->setDateTime(core->getJDay()); dateTimeDialog->setDateTime(core->getJDay());
} }
#ifndef DISABLE_SCRIPTING #ifndef DISABLE_SCRIPTING
void StelGui::setScriptKeys(bool b) void StelGui::setScriptKeys(bool b)
{ {
if (b) if (b)
{ {
skipping to change at line 597 skipping to change at line 588
StelApp::getInstance().getScriptMgr().resumeScript(); StelApp::getInstance().getScriptMgr().resumeScript();
} }
#endif #endif
void StelGui::setFlagShowFlipButtons(bool b) void StelGui::setFlagShowFlipButtons(bool b)
{ {
if (b==true) { if (b==true) {
if (flipVert==NULL) { if (flipVert==NULL) {
// Create the vertical flip button // Create the vertical flip button
QPixmap pxmapGlow32x32(":/graphicGui/glow32x32.png") ; QPixmap pxmapGlow32x32(":/graphicGui/glow32x32.png") ;
flipVert = new StelButton(NULL, QPixmap pxmapOn(":/graphicGui/btFlipVertical-on.png"
);
QPixmap(":/graphicGui/b QPixmap pxmapOff(":/graphicGui/btFlipVertical-off.pn
tFlipVertical-on.png"), g");
flipVert = new StelButton(NULL, pxmapOn, pxmapOff, p
QPixmap(":/graphicGui/b xmapGlow32x32, "actionVertical_Flip");
tFlipVertical-off.png"),
pxmapGlow32x32,
"actionVertical_Flip");
} }
if (flipHoriz==NULL) { if (flipHoriz==NULL) {
QPixmap pxmapGlow32x32(":/graphicGui/glow32x32.png") ; QPixmap pxmapGlow32x32(":/graphicGui/glow32x32.png") ;
flipHoriz = new StelButton(NULL, QPixmap pxmapOn(":/graphicGui/btFlipHorizontal-on.pn
g");
QPixmap(":/graphicGui/ QPixmap pxmapOff(":/graphicGui/btFlipHorizontal-off.
btFlipHorizontal-on.png"), png");
flipHoriz = new StelButton(NULL, pxmapOn, pxmapOff,
QPixmap(":/graphicGui/ pxmapGlow32x32, "actionHorizontal_Flip");
btFlipHorizontal-off.png"),
pxmapGlow32x32,
"actionHorizontal_Flip
");
} }
getButtonBar()->addButton(flipVert, "060-othersGroup", "acti onQuit_Global"); getButtonBar()->addButton(flipVert, "060-othersGroup", "acti onQuit_Global");
getButtonBar()->addButton(flipHoriz, "060-othersGroup", "act ionVertical_Flip"); getButtonBar()->addButton(flipHoriz, "060-othersGroup", "act ionVertical_Flip");
} else { } else {
getButtonBar()->hideButton("actionVertical_Flip"); getButtonBar()->hideButton("actionVertical_Flip");
getButtonBar()->hideButton("actionHorizontal_Flip"); getButtonBar()->hideButton("actionHorizontal_Flip");
} }
flagShowFlipButtons = b; flagShowFlipButtons = b;
if (initDone) { if (initDone) {
skyGui->updateBarsPos(); skyGui->updateBarsPos();
} }
} }
// Define whether the button toggling nebulae backround images should be vi sible // Define whether the button toggling nebulae backround images should be vi sible
void StelGui::setFlagShowNebulaBackgroundButton(bool b) void StelGui::setFlagShowNebulaBackgroundButton(bool b)
{ {
if (b==true) { if (b==true) {
if (btShowNebulaeBackground==NULL) { if (btShowNebulaeBackground==NULL) {
// Create the nebulae background button // Create the nebulae background button
QPixmap pxmapGlow32x32(":/graphicGui/glow32x32.png") ; QPixmap pxmapGlow32x32(":/graphicGui/glow32x32.png") ;
btShowNebulaeBackground = new StelButton(NULL, QPixm QPixmap pxmapOn(":/graphicGui/btDSS-on.png");
ap(":/graphicGui/btDSS-on.png"), QPixmap(":/graphicGui/btDSS-off.png"), pxm QPixmap pxmapOff(":/graphicGui/btDSS-off.png");
apGlow32x32, "actionShow_DSS"); btShowNebulaeBackground = new StelButton(NULL, pxmap
On, pxmapOff, pxmapGlow32x32, "actionShow_DSS");
} }
getButtonBar()->addButton(btShowNebulaeBackground, "040-nebu laeGroup"); getButtonBar()->addButton(btShowNebulaeBackground, "040-nebu laeGroup");
} else { } else {
getButtonBar()->hideButton("actionShow_DSS"); getButtonBar()->hideButton("actionShow_DSS");
} }
flagShowNebulaBackgroundButton = b; flagShowNebulaBackgroundButton = b;
} }
void StelGui::setFlagShowDecimalDegrees(bool b) void StelGui::setFlagShowDecimalDegrees(bool b)
{ {
flagShowDecimalDegrees=b; StelApp::getInstance().setFlagShowDecimalDegrees(b);
if (searchDialog->visible())
{
// Update format of input fields if Search Dialog is open
searchDialog->populateCoordinateAxis();
}
} }
void StelGui::setVisible(bool b) void StelGui::setVisible(bool b)
{ {
skyGui->setVisible(b); skyGui->setVisible(b);
} }
bool StelGui::getVisible() const bool StelGui::getVisible() const
{ {
return skyGui->isVisible(); return skyGui->isVisible();
skipping to change at line 722 skipping to change at line 716
bool StelGui::getFlagShowFlipButtons() const bool StelGui::getFlagShowFlipButtons() const
{ {
return flagShowFlipButtons; return flagShowFlipButtons;
} }
bool StelGui::getFlagShowNebulaBackgroundButton() const bool StelGui::getFlagShowNebulaBackgroundButton() const
{ {
return flagShowNebulaBackgroundButton; return flagShowNebulaBackgroundButton;
} }
bool StelGui::getFlagShowDecimalDegrees() const
{
return flagShowDecimalDegrees;
}
bool StelGui::initComplete(void) const bool StelGui::initComplete(void) const
{ {
return initDone; return initDone;
} }
void StelGui::forceRefreshGui() void StelGui::forceRefreshGui()
{ {
skyGui->updateBarsPos(); skyGui->updateBarsPos();
} }
 End of changes. 11 change blocks. 
46 lines changed or deleted 27 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/