StelGui.cpp   StelGui.cpp 
skipping to change at line 77 skipping to change at line 77
#include <QMouseEvent> #include <QMouseEvent>
#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>
#include <QKeySequence>
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)
skipping to change at line 103 skipping to change at line 104
#ifdef ENABLE_SCRIPT_CONSOLE #ifdef ENABLE_SCRIPT_CONSOLE
, scriptConsole(0) , scriptConsole(0)
#endif #endif
, astroCalcDialog(0) , astroCalcDialog(0)
, flagShowFlipButtons(false) , flagShowFlipButtons(false)
, flipVert(NULL) , flipVert(NULL)
, flipHoriz(NULL) , flipHoriz(NULL)
, flagShowNebulaBackgroundButton(false) , flagShowNebulaBackgroundButton(false)
, btShowNebulaeBackground(NULL) , btShowNebulaeBackground(NULL)
, initDone(false) , initDone(false)
#ifndef DISABLE_SCRIPTING
// We use a QStringList to save the user-configured buttons while
script is running, and restore them later.
, scriptSaveSpeedbuttons()
#endif
{ {
// 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 529 skipping to change at line 535
savedProgressBarSize=skyGui->progressBarMgr->boundingRect(). size(); savedProgressBarSize=skyGui->progressBarMgr->boundingRect(). size();
forceRefreshGui(); forceRefreshGui();
} }
dateTimeDialog->setDateTime(core->getJD()); dateTimeDialog->setDateTime(core->getJD());
} }
#ifndef DISABLE_SCRIPTING #ifndef DISABLE_SCRIPTING
void StelGui::setScriptKeys(bool b) void StelGui::setScriptKeys(bool b)
{ {
// Allows use of buttons from conf! Bug LP:1530567 -- GZ
// The swap of keys happens first immediately after program start by
execution of startup.ssc
// Allow different script keys if you properly configure them!
QSettings* conf = StelApp::getInstance().getSettings();
Q_ASSERT(conf);
if (b) if (b)
{ {
scriptSaveSpeedbuttons.clear();
scriptSaveSpeedbuttons << getAction("actionDecrease_Time_Spe
ed")->getShortcut().toString(QKeySequence::PortableText)
<< getAction("actionIncrease_Time_Spe
ed")->getShortcut().toString(QKeySequence::PortableText)
<< getAction("actionSet_Real_Time_Spe
ed")->getShortcut().toString(QKeySequence::PortableText);
// During script execution we disable normal time control.
// If script keys have not been configured, take those time
control keys.
getAction("actionDecrease_Time_Speed")->setShortcut(""); getAction("actionDecrease_Time_Speed")->setShortcut("");
getAction("actionIncrease_Time_Speed")->setShortcut(""); getAction("actionIncrease_Time_Speed")->setShortcut("");
getAction("actionSet_Real_Time_Speed")->setShortcut(""); getAction("actionSet_Real_Time_Speed")->setShortcut("");
getAction("actionDecrease_Script_Speed")->setShortcut("J"); QString str;
getAction("actionIncrease_Script_Speed")->setShortcut("L"); str=conf->value("shortcuts/actionDecrease_Script_Speed",scri
getAction("actionSet_Real_Script_Speed")->setShortcut("K"); ptSaveSpeedbuttons.at(0)).toString();
getAction("actionDecrease_Script_Speed")->setShortcut(str);
str=conf->value("shortcuts/actionIncrease_Script_Speed",scri
ptSaveSpeedbuttons.at(1)).toString();
getAction("actionIncrease_Script_Speed")->setShortcut(str);
str=conf->value("shortcuts/actionSet_Real_Script_Speed",scri
ptSaveSpeedbuttons.at(2)).toString();
getAction("actionSet_Real_Script_Speed")->setShortcut(str);
} }
else else
{ {
getAction("actionDecrease_Script_Speed")->setShortcut(""); if (scriptSaveSpeedbuttons.length()<3)
getAction("actionIncrease_Script_Speed")->setShortcut(""); {
getAction("actionSet_Real_Script_Speed")->setShortcut(""); scriptSaveSpeedbuttons.clear();
getAction("actionDecrease_Time_Speed")->setShortcut("J"); scriptSaveSpeedbuttons << "J" << "L" << "K";
getAction("actionIncrease_Time_Speed")->setShortcut("L"); qWarning() << "StelGui: Saved speed buttons reset to
getAction("actionSet_Real_Time_Speed")->setShortcut("K"); J/K/L";
qWarning() << " This is very odd, should not
happen.";
}
// It is only safe to clear the script speed keys if they ar
e the same as the regular speed keys
// i.e. if they had been set before running the script.
if (getAction("actionDecrease_Script_Speed")->getShortcut().
toString() == scriptSaveSpeedbuttons.at(0))
getAction("actionDecrease_Script_Speed")->setShortcu
t("");
if (getAction("actionIncrease_Script_Speed")->getShortcut().
toString() == scriptSaveSpeedbuttons.at(1))
getAction("actionIncrease_Script_Speed")->setShortcu
t("");
if (getAction("actionSet_Real_Script_Speed")->getShortcut().
toString() == scriptSaveSpeedbuttons.at(2))
getAction("actionSet_Real_Script_Speed")->setShortcu
t("");
getAction("actionDecrease_Time_Speed")->setShortcut(scriptSa
veSpeedbuttons.at(0));
getAction("actionIncrease_Time_Speed")->setShortcut(scriptSa
veSpeedbuttons.at(1));
getAction("actionSet_Real_Time_Speed")->setShortcut(scriptSa
veSpeedbuttons.at(2));
} }
} }
void StelGui::increaseScriptSpeed() void StelGui::increaseScriptSpeed()
{ {
StelApp::getInstance().getScriptMgr().setScriptRate(StelApp::getInst ance().getScriptMgr().getScriptRate()*2); StelApp::getInstance().getScriptMgr().setScriptRate(StelApp::getInst ance().getScriptMgr().getScriptRate()*2);
} }
void StelGui::decreaseScriptSpeed() void StelGui::decreaseScriptSpeed()
{ {
skipping to change at line 651 skipping to change at line 687
bool StelGui::getVisible() const bool StelGui::getVisible() const
{ {
return skyGui->isVisible(); return skyGui->isVisible();
} }
bool StelGui::isCurrentlyUsed() const bool StelGui::isCurrentlyUsed() const
{ {
return skyGui->buttonBar->isUnderMouse() || skyGui->winBar->isUnderM ouse(); return skyGui->buttonBar->isUnderMouse() || skyGui->winBar->isUnderM ouse();
} }
void setScriptKeys() //void setScriptKeys()
{ //{
} //}
void setNormalKeys() //void setNormalKeys()
{ //{
} //}
void StelGui::setInfoTextFilters(const StelObject::InfoStringGroup& aflags) void StelGui::setInfoTextFilters(const StelObject::InfoStringGroup& aflags)
{ {
skyGui->infoPanel->setInfoTextFilters(aflags); skyGui->infoPanel->setInfoTextFilters(aflags);
} }
const StelObject::InfoStringGroup& StelGui::getInfoTextFilters() const const StelObject::InfoStringGroup& StelGui::getInfoTextFilters() const
{ {
return skyGui->infoPanel->getInfoTextFilters(); return skyGui->infoPanel->getInfoTextFilters();
} }
 End of changes. 7 change blocks. 
16 lines changed or deleted 73 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/