ConfigurationDialog.cpp   ConfigurationDialog.cpp 
skipping to change at line 25 skipping to change at line 25
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* 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., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "Dialog.hpp" #include "Dialog.hpp"
#include "ConfigurationDialog.hpp" #include "ConfigurationDialog.hpp"
#include "CustomDeltaTEquationDialog.hpp" #include "CustomDeltaTEquationDialog.hpp"
#include "StelMainGraphicsView.hpp" #include "StelMainView.hpp"
#include "StelMainWindow.hpp"
#include "ui_configurationDialog.h" #include "ui_configurationDialog.h"
#include "StelAppGraphicsWidget.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelLocaleMgr.hpp" #include "StelLocaleMgr.hpp"
#include "StelProjector.hpp" #include "StelProjector.hpp"
#include "StelObjectMgr.hpp" #include "StelObjectMgr.hpp"
#include "StelActionMgr.hpp"
#include "StelProgressController.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelMovementMgr.hpp" #include "StelMovementMgr.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelSkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include "StelGui.hpp" #include "StelGui.hpp"
#include "StelGuiItems.hpp" #include "StelGuiItems.hpp"
#include "StelLocation.hpp" #include "StelLocation.hpp"
#include "LandscapeMgr.hpp" #include "LandscapeMgr.hpp"
#include "StelSkyCultureMgr.hpp" #include "StelSkyCultureMgr.hpp"
skipping to change at line 68 skipping to change at line 68
#include "StelJsonParser.hpp" #include "StelJsonParser.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include <QSettings> #include <QSettings>
#include <QDebug> #include <QDebug>
#include <QFile> #include <QFile>
#include <QFileDialog> #include <QFileDialog>
#include <QComboBox> #include <QComboBox>
#include <QDir> #include <QDir>
ConfigurationDialog::ConfigurationDialog(StelGui* agui) : StelDialog(agui), ConfigurationDialog::ConfigurationDialog(StelGui* agui, QObject* parent)
starCatalogDownloadReply(NULL), currentDownloadFile(NULL), progressBar(NUL : StelDialog(parent)
L), gui(agui) , nextStarCatalogToDownloadIndex(0)
, starCatalogsCount(0)
, starCatalogDownloadReply(NULL)
, currentDownloadFile(NULL)
, progressBar(NULL)
, gui(agui)
{ {
ui = new Ui_configurationDialogForm; ui = new Ui_configurationDialogForm;
customDeltaTEquationDialog = NULL; customDeltaTEquationDialog = NULL;
hasDownloadedStarCatalog = false; hasDownloadedStarCatalog = false;
isDownloadingStarCatalog = false; isDownloadingStarCatalog = false;
savedProjectionType = StelApp::getInstance().getCore()->getCurrentPr ojectionType(); savedProjectionType = StelApp::getInstance().getCore()->getCurrentPr ojectionType();
} }
ConfigurationDialog::~ConfigurationDialog() ConfigurationDialog::~ConfigurationDialog()
{ {
skipping to change at line 119 skipping to change at line 126
populateDeltaTAlgorithmsList(); populateDeltaTAlgorithmsList();
} }
} }
void ConfigurationDialog::styleChanged() void ConfigurationDialog::styleChanged()
{ {
// Nothing for now // Nothing for now
} }
void ConfigurationDialog::updateIconsColor()
{
QPixmap pixmap(50, 50);
QStringList icons;
icons << "main" << "info" << "navigation" << "tools" << "scripts" <<
"plugins";
bool redIcon = false;
if (StelApp::getInstance().getVisionModeNight())
redIcon = true;
foreach(const QString &iconName, icons)
{
pixmap.load(":/graphicGui/tabicon-" + iconName +".png");
if (redIcon)
pixmap = StelButton::makeRed(pixmap);
ui->stackListWidget->item(icons.indexOf(iconName))->setIcon(
QIcon(pixmap));
}
}
void ConfigurationDialog::createDialogContent() void ConfigurationDialog::createDialogContent()
{ {
const StelProjectorP proj = StelApp::getInstance().getCore()->getPro jection(StelCore::FrameJ2000); const StelProjectorP proj = StelApp::getInstance().getCore()->getPro jection(StelCore::FrameJ2000);
StelCore* core = StelApp::getInstance().getCore(); StelCore* core = StelApp::getInstance().getCore();
StelMovementMgr* mvmgr = GETSTELMODULE(StelMovementMgr); StelMovementMgr* mvmgr = GETSTELMODULE(StelMovementMgr);
ui->setupUi(dialog); ui->setupUi(dialog);
connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SL OT(retranslate())); connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SL OT(retranslate()));
connect(&StelApp::getInstance(), SIGNAL(colorSchemeChanged(QString)) , this, SLOT(updateIconsColor()));
// Set the main tab activated by default // Set the main tab activated by default
ui->configurationStackedWidget->setCurrentIndex(0); ui->configurationStackedWidget->setCurrentIndex(0);
updateIconsColor();
ui->stackListWidget->setCurrentRow(0); ui->stackListWidget->setCurrentRow(0);
connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ; connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ;
// Main tab // Main tab
// Fill the language list widget from the available list // Fill the language list widget from the available list
QString appLang = StelApp::getInstance().getLocaleMgr().getAppLangua ge();
QComboBox* cb = ui->programLanguageComboBox; QComboBox* cb = ui->programLanguageComboBox;
cb->clear(); cb->clear();
cb->addItems(StelTranslator::globalTranslator.getAvailableLanguagesN amesNative(StelFileMgr::getLocaleDir())); cb->addItems(StelTranslator::globalTranslator->getAvailableLanguages NamesNative(StelFileMgr::getLocaleDir()));
cb->model()->sort(0); cb->model()->sort(0);
QString l2 = StelTranslator::iso639_1CodeToNativeName(appLang); updateCurrentLanguage();
int lt = cb->findText(l2, Qt::MatchExactly); connect(cb->lineEdit(), SIGNAL(editingFinished()), this, SLOT(update
if (lt == -1 && appLang.contains('_')) CurrentLanguage()));
{
l2 = appLang.left(appLang.indexOf('_'));
l2=StelTranslator::iso639_1CodeToNativeName(l2);
lt = cb->findText(l2, Qt::MatchExactly);
}
if (lt!=-1)
cb->setCurrentIndex(lt);
connect(cb, SIGNAL(currentIndexChanged(const QString&)), this, SLOT( selectLanguage(const QString&))); connect(cb, SIGNAL(currentIndexChanged(const QString&)), this, SLOT( selectLanguage(const QString&)));
ui->groupBoxUpdates->setChecked(StelApp::getInstance().getSettings()
->value("main/check_updates_enabled", true).toBool());
connect(ui->groupBoxUpdates, SIGNAL(toggled(bool)), this, SLOT(setUp
datesFlag(bool)));
connect(ui->getStarsButton, SIGNAL(clicked()), this, SLOT(downloadSt ars())); connect(ui->getStarsButton, SIGNAL(clicked()), this, SLOT(downloadSt ars()));
connect(ui->downloadCancelButton, SIGNAL(clicked()), this, SLOT(canc elDownload())); connect(ui->downloadCancelButton, SIGNAL(clicked()), this, SLOT(canc elDownload()));
connect(ui->downloadRetryButton, SIGNAL(clicked()), this, SLOT(downl oadStars())); connect(ui->downloadRetryButton, SIGNAL(clicked()), this, SLOT(downl oadStars()));
resetStarCatalogControls(); resetStarCatalogControls();
// Selected object info // Selected object info
if (gui->getInfoTextFilters() == StelObject::InfoStringGroup(0)) if (gui->getInfoTextFilters() == StelObject::InfoStringGroup(0))
{ {
ui->noSelectedInfoRadio->setChecked(true); ui->noSelectedInfoRadio->setChecked(true);
} }
skipping to change at line 248 skipping to change at line 228
// Use Espenak & Meeus (2006) as default // Use Espenak & Meeus (2006) as default
idx = ui->deltaTAlgorithmComboBox->findData(QVariant("Espena kMeeus"), Qt::UserRole, Qt::MatchCaseSensitive); idx = ui->deltaTAlgorithmComboBox->findData(QVariant("Espena kMeeus"), Qt::UserRole, Qt::MatchCaseSensitive);
} }
ui->deltaTAlgorithmComboBox->setCurrentIndex(idx); ui->deltaTAlgorithmComboBox->setCurrentIndex(idx);
connect(ui->deltaTAlgorithmComboBox, SIGNAL(currentIndexChanged(int) ), this, SLOT(setDeltaTAlgorithm(int))); connect(ui->deltaTAlgorithmComboBox, SIGNAL(currentIndexChanged(int) ), this, SLOT(setDeltaTAlgorithm(int)));
connect(ui->pushButtonCustomDeltaTEquationDialog, SIGNAL(clicked()), this, SLOT(showCustomDeltaTEquationDialog())); connect(ui->pushButtonCustomDeltaTEquationDialog, SIGNAL(clicked()), this, SLOT(showCustomDeltaTEquationDialog()));
// Tools tab // Tools tab
ConstellationMgr* cmgr = GETSTELMODULE(ConstellationMgr); ConstellationMgr* cmgr = GETSTELMODULE(ConstellationMgr);
Q_ASSERT(cmgr); Q_ASSERT(cmgr);
ui->sphericMirrorCheckbox->setChecked(StelMainGraphicsView::getInsta // XXX: to reintroduce.
nce().getStelAppGraphicsWidget()->getViewportEffect() == "sphericMirrorDist // ui->sphericMirrorCheckbox->setChecked(StelMainView::getInstance()
orter"); .getStelAppGraphicsWidget()->getViewportEffect() == "sphericMirrorDistorter
");
connect(ui->sphericMirrorCheckbox, SIGNAL(toggled(bool)), this, SLOT (setSphericMirror(bool))); connect(ui->sphericMirrorCheckbox, SIGNAL(toggled(bool)), this, SLOT (setSphericMirror(bool)));
ui->gravityLabelCheckbox->setChecked(proj->getFlagGravityLabels()); ui->gravityLabelCheckbox->setChecked(proj->getFlagGravityLabels());
connect(ui->gravityLabelCheckbox, SIGNAL(toggled(bool)), StelApp::ge tInstance().getCore(), SLOT(setFlagGravityLabels(bool))); connect(ui->gravityLabelCheckbox, SIGNAL(toggled(bool)), StelApp::ge tInstance().getCore(), SLOT(setFlagGravityLabels(bool)));
ui->selectSingleConstellationButton->setChecked(cmgr->getFlagIsolate Selected()); ui->selectSingleConstellationButton->setChecked(cmgr->getFlagIsolate Selected());
connect(ui->selectSingleConstellationButton, SIGNAL(toggled(bool)), cmgr, SLOT(setFlagIsolateSelected(bool))); connect(ui->selectSingleConstellationButton, SIGNAL(toggled(bool)), cmgr, SLOT(setFlagIsolateSelected(bool)));
ui->diskViewportCheckbox->setChecked(proj->getMaskType() == StelProj ector::MaskDisk); ui->diskViewportCheckbox->setChecked(proj->getMaskType() == StelProj ector::MaskDisk);
connect(ui->diskViewportCheckbox, SIGNAL(toggled(bool)), this, SLOT( setDiskViewport(bool))); connect(ui->diskViewportCheckbox, SIGNAL(toggled(bool)), this, SLOT( setDiskViewport(bool)));
ui->autoZoomResetsDirectionCheckbox->setChecked(mvmgr->getFlagAutoZo omOutResetsDirection()); ui->autoZoomResetsDirectionCheckbox->setChecked(mvmgr->getFlagAutoZo omOutResetsDirection());
connect(ui->autoZoomResetsDirectionCheckbox, SIGNAL(toggled(bool)), mvmgr, SLOT(setFlagAutoZoomOutResetsDirection(bool))); connect(ui->autoZoomResetsDirectionCheckbox, SIGNAL(toggled(bool)), mvmgr, SLOT(setFlagAutoZoomOutResetsDirection(bool)));
ui->renderSolarShadowsCheckbox->setChecked(StelApp::getInstance().ge
tRenderSolarShadows());
connect(ui->renderSolarShadowsCheckbox, SIGNAL(toggled(bool)), &Stel
App::getInstance(), SLOT(setRenderSolarShadows(bool)));
ui->showFlipButtonsCheckbox->setChecked(gui->getFlagShowFlipButtons( )); ui->showFlipButtonsCheckbox->setChecked(gui->getFlagShowFlipButtons( ));
connect(ui->showFlipButtonsCheckbox, SIGNAL(toggled(bool)), gui, SLO T(setFlagShowFlipButtons(bool))); connect(ui->showFlipButtonsCheckbox, SIGNAL(toggled(bool)), gui, SLO T(setFlagShowFlipButtons(bool)));
ui->showNebulaBgButtonCheckbox->setChecked(gui->getFlagShowNebulaBac kgroundButton()); ui->showNebulaBgButtonCheckbox->setChecked(gui->getFlagShowNebulaBac kgroundButton());
connect(ui->showNebulaBgButtonCheckbox, SIGNAL(toggled(bool)), gui, SLOT(setFlagShowNebulaBackgroundButton(bool))); connect(ui->showNebulaBgButtonCheckbox, SIGNAL(toggled(bool)), gui, SLOT(setFlagShowNebulaBackgroundButton(bool)));
ui->mouseTimeoutCheckbox->setChecked(StelMainGraphicsView::getInstan ui->mouseTimeoutCheckbox->setChecked(StelMainView::getInstance().get
ce().getFlagCursorTimeout()); FlagCursorTimeout());
ui->mouseTimeoutSpinBox->setValue(StelMainGraphicsView::getInstance( ui->mouseTimeoutSpinBox->setValue(StelMainView::getInstance().getCur
).getCursorTimeout()); sorTimeout());
connect(ui->mouseTimeoutCheckbox, SIGNAL(clicked()), this, SLOT(curs orTimeOutChanged())); connect(ui->mouseTimeoutCheckbox, SIGNAL(clicked()), this, SLOT(curs orTimeOutChanged()));
connect(ui->mouseTimeoutCheckbox, SIGNAL(toggled(bool)), this, SLOT( cursorTimeOutChanged())); connect(ui->mouseTimeoutCheckbox, SIGNAL(toggled(bool)), this, SLOT( cursorTimeOutChanged()));
connect(ui->mouseTimeoutSpinBox, SIGNAL(valueChanged(double)), this, SLOT(cursorTimeOutChanged(double))); connect(ui->mouseTimeoutSpinBox, SIGNAL(valueChanged(double)), this, SLOT(cursorTimeOutChanged(double)));
connect(ui->setViewingOptionAsDefaultPushButton, SIGNAL(clicked()), this, SLOT(saveCurrentViewOptions())); connect(ui->setViewingOptionAsDefaultPushButton, SIGNAL(clicked()), this, SLOT(saveCurrentViewOptions()));
connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(set DefaultViewOptions())); connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(set DefaultViewOptions()));
ui->screenshotDirEdit->setText(StelFileMgr::getScreenshotDir()); ui->screenshotDirEdit->setText(StelFileMgr::getScreenshotDir());
connect(ui->screenshotDirEdit, SIGNAL(textChanged(QString)), this, S LOT(selectScreenshotDir(QString))); connect(ui->screenshotDirEdit, SIGNAL(textChanged(QString)), this, S LOT(selectScreenshotDir(QString)));
connect(ui->screenshotBrowseButton, SIGNAL(clicked()), this, SLOT(br owseForScreenshotDir())); connect(ui->screenshotBrowseButton, SIGNAL(clicked()), this, SLOT(br owseForScreenshotDir()));
ui->invertScreenShotColorsCheckBox->setChecked(StelMainGraphicsView: ui->invertScreenShotColorsCheckBox->setChecked(StelMainView::getInst
:getInstance().getFlagInvertScreenShotColors()); ance().getFlagInvertScreenShotColors());
connect(ui->invertScreenShotColorsCheckBox, SIGNAL(toggled(bool)), & connect(ui->invertScreenShotColorsCheckBox, SIGNAL(toggled(bool)), &
StelMainGraphicsView::getInstance(), SLOT(setFlagInvertScreenShotColors(boo StelMainView::getInstance(), SLOT(setFlagInvertScreenShotColors(bool)));
l)));
LandscapeMgr *lmgr = GETSTELMODULE(LandscapeMgr);
ui->autoEnableAtmosphereCheckBox->setChecked(lmgr->getFlagAtmosphere
AutoEnable());
connect(ui->autoEnableAtmosphereCheckBox, SIGNAL(toggled(bool)), lmg
r, SLOT(setFlagAtmosphereAutoEnable(bool)));
// script tab controls // script tab controls
#ifndef DISABLE_SCRIPTING #ifndef DISABLE_SCRIPTING
StelScriptMgr& scriptMgr = StelMainGraphicsView::getInstance().getSc riptMgr(); StelScriptMgr& scriptMgr = StelApp::getInstance().getScriptMgr();
connect(ui->scriptListWidget, SIGNAL(currentTextChanged(const QStrin g&)), this, SLOT(scriptSelectionChanged(const QString&))); connect(ui->scriptListWidget, SIGNAL(currentTextChanged(const QStrin g&)), this, SLOT(scriptSelectionChanged(const QString&)));
connect(ui->runScriptButton, SIGNAL(clicked()), this, SLOT(runScript Clicked())); connect(ui->runScriptButton, SIGNAL(clicked()), this, SLOT(runScript Clicked()));
connect(ui->stopScriptButton, SIGNAL(clicked()), this, SLOT(stopScri ptClicked())); connect(ui->stopScriptButton, SIGNAL(clicked()), this, SLOT(stopScri ptClicked()));
if (scriptMgr.scriptIsRunning()) if (scriptMgr.scriptIsRunning())
aScriptIsRunning(); aScriptIsRunning();
else else
aScriptHasStopped(); aScriptHasStopped();
connect(&scriptMgr, SIGNAL(scriptRunning()), this, SLOT(aScriptIsRun ning())); connect(&scriptMgr, SIGNAL(scriptRunning()), this, SLOT(aScriptIsRun ning()));
connect(&scriptMgr, SIGNAL(scriptStopped()), this, SLOT(aScriptHasSt opped())); connect(&scriptMgr, SIGNAL(scriptStopped()), this, SLOT(aScriptHasSt opped()));
ui->scriptListWidget->setSortingEnabled(true); ui->scriptListWidget->setSortingEnabled(true);
populateScriptsList(); populateScriptsList();
connect(this, SIGNAL(visibleChanged(bool)), this, SLOT(populateScrip tsList())); connect(this, SIGNAL(visibleChanged(bool)), this, SLOT(populateScrip tsList()));
#endif #endif
// plugins control // plugins control
connect(ui->pluginsListWidget, SIGNAL(currentTextChanged(const QStri ng&)), this, SLOT(pluginsSelectionChanged(const QString&))); connect(ui->pluginsListWidget, SIGNAL(currentItemChanged(QListWidget Item*, QListWidgetItem*)), this, SLOT(pluginsSelectionChanged(QListWidgetIt em*, QListWidgetItem*)));
connect(ui->pluginLoadAtStartupCheckBox, SIGNAL(stateChanged(int)), this, SLOT(loadAtStartupChanged(int))); connect(ui->pluginLoadAtStartupCheckBox, SIGNAL(stateChanged(int)), this, SLOT(loadAtStartupChanged(int)));
connect(ui->pluginsListWidget, SIGNAL(doubleClicked(QModelIndex)), t his, SLOT(pluginConfigureCurrentSelection()));
connect(ui->pluginConfigureButton, SIGNAL(clicked()), this, SLOT(plu ginConfigureCurrentSelection())); connect(ui->pluginConfigureButton, SIGNAL(clicked()), this, SLOT(plu ginConfigureCurrentSelection()));
populatePluginsList(); populatePluginsList();
updateConfigLabels(); updateConfigLabels();
updateTabBarListWidgetWidth(); updateTabBarListWidgetWidth();
} }
void ConfigurationDialog::setUpdatesFlag(bool b)
{
StelApp::getInstance().getSettings()->setValue("main/check_updates_e
nabled", b);
}
void ConfigurationDialog::updateCurrentLanguage()
{
QComboBox* cb = ui->programLanguageComboBox;
QString appLang = StelApp::getInstance().getLocaleMgr().getAppLangua
ge();
QString l2 = StelTranslator::iso639_1CodeToNativeName(appLang);
if (cb->currentText() == l2)
return;
int lt = cb->findText(l2, Qt::MatchExactly);
if (lt == -1 && appLang.contains('_'))
{
l2 = appLang.left(appLang.indexOf('_'));
l2=StelTranslator::iso639_1CodeToNativeName(l2);
lt = cb->findText(l2, Qt::MatchExactly);
}
if (lt!=-1)
cb->setCurrentIndex(lt);
}
void ConfigurationDialog::selectLanguage(const QString& langName) void ConfigurationDialog::selectLanguage(const QString& langName)
{ {
QString code = StelTranslator::nativeNameToIso639_1Code(langName); QString code = StelTranslator::nativeNameToIso639_1Code(langName);
StelApp::getInstance().getLocaleMgr().setAppLanguage(code); StelApp::getInstance().getLocaleMgr().setAppLanguage(code);
StelApp::getInstance().getLocaleMgr().setSkyLanguage(code); StelApp::getInstance().getLocaleMgr().setSkyLanguage(code);
StelMainWindow::getInstance().initTitleI18n(); StelMainView::getInstance().initTitleI18n();
} }
void ConfigurationDialog::setStartupTimeMode() void ConfigurationDialog::setStartupTimeMode()
{ {
if (ui->systemTimeRadio->isChecked()) if (ui->systemTimeRadio->isChecked())
StelApp::getInstance().getCore()->setStartupTimeMode("actual "); StelApp::getInstance().getCore()->setStartupTimeMode("actual ");
else if (ui->todayRadio->isChecked()) else if (ui->todayRadio->isChecked())
StelApp::getInstance().getCore()->setStartupTimeMode("today" ); StelApp::getInstance().getCore()->setStartupTimeMode("today" );
else else
StelApp::getInstance().getCore()->setStartupTimeMode("preset "); StelApp::getInstance().getCore()->setStartupTimeMode("preset ");
StelApp::getInstance().getCore()->setInitTodayTime(ui->todayTimeSpin Box->time()); StelApp::getInstance().getCore()->setInitTodayTime(ui->todayTimeSpin Box->time());
StelApp::getInstance().getCore()->setPresetSkyTime(ui->fixedDateTime Edit->dateTime()); StelApp::getInstance().getCore()->setPresetSkyTime(ui->fixedDateTime Edit->dateTime());
} }
void ConfigurationDialog::showShortcutsWindow() void ConfigurationDialog::showShortcutsWindow()
{ {
QAction* action = gui->getGuiAction("actionShow_Shortcuts_Window_Glo bal"); StelAction* action = StelApp::getInstance().getStelActionManager()-> findAction("actionShow_Shortcuts_Window_Global");
if (action) if (action)
{
if (action->isChecked())
action->setChecked(false);
action->setChecked(true); action->setChecked(true);
}
} }
void ConfigurationDialog::setDiskViewport(bool b) void ConfigurationDialog::setDiskViewport(bool b)
{ {
if (b) if (b)
StelApp::getInstance().getCore()->setMaskType(StelProjector: :MaskDisk); StelApp::getInstance().getCore()->setMaskType(StelProjector: :MaskDisk);
else else
StelApp::getInstance().getCore()->setMaskType(StelProjector: :MaskNone); StelApp::getInstance().getCore()->setMaskType(StelProjector: :MaskNone);
} }
void ConfigurationDialog::setSphericMirror(bool b) void ConfigurationDialog::setSphericMirror(bool b)
{ {
StelCore* core = StelApp::getInstance().getCore(); StelCore* core = StelApp::getInstance().getCore();
if (b) if (b)
{ {
savedProjectionType = core->getCurrentProjectionType(); savedProjectionType = core->getCurrentProjectionType();
core->setCurrentProjectionType(StelCore::ProjectionFisheye); core->setCurrentProjectionType(StelCore::ProjectionFisheye);
StelMainGraphicsView::getInstance().getStelAppGraphicsWidget // XXX: to reintroduce
()->setViewportEffect("sphericMirrorDistorter"); // StelMainView::getInstance().getStelAppGraphicsWidget()->s
etViewportEffect("sphericMirrorDistorter");
} }
else else
{ {
core->setCurrentProjectionType((StelCore::ProjectionType)sav edProjectionType); core->setCurrentProjectionType((StelCore::ProjectionType)sav edProjectionType);
StelMainGraphicsView::getInstance().getStelAppGraphicsWidget // XXX: to reintroduce
()->setViewportEffect("none"); // StelMainView::getInstance().getStelAppGraphicsWidget()->s
etViewportEffect("none");
} }
} }
void ConfigurationDialog::setNoSelectedInfo(void) void ConfigurationDialog::setNoSelectedInfo(void)
{ {
gui->setInfoTextFilters(StelObject::InfoStringGroup(0)); gui->setInfoTextFilters(StelObject::InfoStringGroup(0));
updateSelectedInfoCheckBoxes(); updateSelectedInfoCheckBoxes();
} }
void ConfigurationDialog::setAllSelectedInfo(void) void ConfigurationDialog::setAllSelectedInfo(void)
skipping to change at line 413 skipping to change at line 420
if (ui->checkBoxRaDecOfDate->isChecked()) if (ui->checkBoxRaDecOfDate->isChecked())
flags |= StelObject::RaDecOfDate; flags |= StelObject::RaDecOfDate;
if (ui->checkBoxHourAngle->isChecked()) if (ui->checkBoxHourAngle->isChecked())
flags |= StelObject::HourAngle; flags |= StelObject::HourAngle;
if (ui->checkBoxAltAz->isChecked()) if (ui->checkBoxAltAz->isChecked())
flags |= StelObject::AltAzi; flags |= StelObject::AltAzi;
if (ui->checkBoxDistance->isChecked()) if (ui->checkBoxDistance->isChecked())
flags |= StelObject::Distance; flags |= StelObject::Distance;
if (ui->checkBoxSize->isChecked()) if (ui->checkBoxSize->isChecked())
flags |= StelObject::Size; flags |= StelObject::Size;
if (ui->checkBoxExtra1->isChecked()) if (ui->checkBoxExtra->isChecked())
flags |= StelObject::Extra1; flags |= StelObject::Extra;
if (ui->checkBoxExtra2->isChecked()) if (ui->checkBoxGalacticCoordinates->isChecked())
flags |= StelObject::Extra2; flags |= StelObject::GalacticCoord;
if (ui->checkBoxExtra3->isChecked()) if (ui->checkBoxType->isChecked())
flags |= StelObject::Extra3; flags |= StelObject::ObjectType;
if (ui->checkBoxGalacticCoordJ2000->isChecked()) if (ui->checkBoxTEclipticCoords->isChecked())
flags |= StelObject::GalCoordJ2000; flags |= StelObject::EclTopocentricCoord;
gui->setInfoTextFilters(flags); gui->setInfoTextFilters(flags);
} }
void ConfigurationDialog::cursorTimeOutChanged() void ConfigurationDialog::cursorTimeOutChanged()
{ {
StelMainGraphicsView::getInstance().setFlagCursorTimeout(ui->mouseTi StelMainView::getInstance().setFlagCursorTimeout(ui->mouseTimeoutChe
meoutCheckbox->isChecked()); ckbox->isChecked());
StelMainGraphicsView::getInstance().setCursorTimeout(ui->mouseTimeou StelMainView::getInstance().setCursorTimeout(ui->mouseTimeoutSpinBox
tSpinBox->value()); ->value());
} }
void ConfigurationDialog::browseForScreenshotDir() void ConfigurationDialog::browseForScreenshotDir()
{ {
QString oldScreenshorDir = StelFileMgr::getScreenshotDir(); QString oldScreenshorDir = StelFileMgr::getScreenshotDir();
#ifdef Q_OS_MAC QString newScreenshotDir = QFileDialog::getExistingDirectory(NULL, q
//work-around for Qt bug - http://bugreports.qt.nokia.com/b _("Select screenshot directory"), oldScreenshorDir, QFileDialog::ShowDirsOn
rowse/QTBUG-16722 ly);
QString newScreenshotDir = QFileDialog::getExistingDirectory
(NULL, q_("Select screenshot directory"), oldScreenshorDir, QFileDialog::Do
ntUseNativeDialog);
#else
QString newScreenshotDir = QFileDialog::getExistingDirectory
(NULL, q_("Select screenshot directory"), oldScreenshorDir, QFileDialog::Sh
owDirsOnly);
#endif
if (!newScreenshotDir.isEmpty()) { if (!newScreenshotDir.isEmpty()) {
// remove trailing slash // remove trailing slash
if (newScreenshotDir.right(1) == "/") if (newScreenshotDir.right(1) == "/")
newScreenshotDir = newScreenshotDir.left(newScreensh otDir.length()-1); newScreenshotDir = newScreenshotDir.left(newScreensh otDir.length()-1);
ui->screenshotDirEdit->setText(newScreenshotDir); ui->screenshotDirEdit->setText(newScreenshotDir);
} }
} }
void ConfigurationDialog::selectScreenshotDir(const QString& dir) void ConfigurationDialog::selectScreenshotDir(const QString& dir)
{ {
try try
{ {
StelFileMgr::setScreenshotDir(dir); StelFileMgr::setScreenshotDir(dir);
} }
catch (std::runtime_error& e) catch (std::runtime_error& e)
{ {
Q_UNUSED(e);
// nop // nop
// this will happen when people are only half way through ty ping dirs // this will happen when people are only half way through ty ping dirs
} }
} }
// Save the current viewing option including landscape, location and sky cu lture // Save the current viewing option including landscape, location and sky cu lture
// This doesn't include the current viewing direction, time and FOV since t hose have specific controls // This doesn't include the current viewing direction, time and FOV since t hose have specific controls
void ConfigurationDialog::saveCurrentViewOptions() void ConfigurationDialog::saveCurrentViewOptions()
{ {
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
skipping to change at line 512 skipping to change at line 515
conf->setValue("astro/flag_nebula_magnitude_limit", conf->setValue("astro/flag_nebula_magnitude_limit",
skyd->getFlagNebulaMagnitudeLimit()); skyd->getFlagNebulaMagnitudeLimit());
conf->setValue("astro/nebula_magnitude_limit", conf->setValue("astro/nebula_magnitude_limit",
skyd->getCustomNebulaMagnitudeLimit()); skyd->getCustomNebulaMagnitudeLimit());
conf->setValue("viewing/use_luminance_adaptation", skyd->getFlagLumi nanceAdaptation()); conf->setValue("viewing/use_luminance_adaptation", skyd->getFlagLumi nanceAdaptation());
conf->setValue("astro/flag_planets", ssmgr->getFlagPlanets()); conf->setValue("astro/flag_planets", ssmgr->getFlagPlanets());
conf->setValue("astro/flag_planets_hints", ssmgr->getFlagHints()); conf->setValue("astro/flag_planets_hints", ssmgr->getFlagHints());
conf->setValue("astro/flag_planets_orbits", ssmgr->getFlagOrbits()); conf->setValue("astro/flag_planets_orbits", ssmgr->getFlagOrbits());
conf->setValue("astro/flag_light_travel_time", ssmgr->getFlagLightTr avelTime()); conf->setValue("astro/flag_light_travel_time", ssmgr->getFlagLightTr avelTime());
conf->setValue("viewing/flag_moon_scaled", ssmgr->getFlagMoonScale() ); conf->setValue("viewing/flag_moon_scaled", ssmgr->getFlagMoonScale() );
conf->setValue("viewing/moon_scale", ssmgr->getMoonScale());
conf->setValue("astro/meteor_rate", mmgr->getZHR()); conf->setValue("astro/meteor_rate", mmgr->getZHR());
conf->setValue("astro/milky_way_intensity", GETSTELMODULE(MilkyWay)- >getIntensity()); conf->setValue("astro/milky_way_intensity", GETSTELMODULE(MilkyWay)- >getIntensity());
// view dialog / markings tab settings // view dialog / markings tab settings
conf->setValue("viewing/flag_azimuthal_grid", glmgr->getFlagAzimutha lGrid()); conf->setValue("viewing/flag_azimuthal_grid", glmgr->getFlagAzimutha lGrid());
conf->setValue("viewing/flag_equatorial_grid", glmgr->getFlagEquator Grid()); conf->setValue("viewing/flag_equatorial_grid", glmgr->getFlagEquator Grid());
conf->setValue("viewing/flag_equator_line", glmgr->getFlagEquatorLin e()); conf->setValue("viewing/flag_equator_line", glmgr->getFlagEquatorLin e());
conf->setValue("viewing/flag_ecliptic_line", glmgr->getFlagEclipticL ine()); conf->setValue("viewing/flag_ecliptic_line", glmgr->getFlagEclipticL ine());
conf->setValue("viewing/flag_ecliptic_J2000_grid", glmgr->getFlagEcl ipticJ2000Grid()); conf->setValue("viewing/flag_ecliptic_J2000_grid", glmgr->getFlagEcl ipticJ2000Grid());
conf->setValue("viewing/flag_meridian_line", glmgr->getFlagMeridianL ine()); conf->setValue("viewing/flag_meridian_line", glmgr->getFlagMeridianL ine());
skipping to change at line 533 skipping to change at line 537
conf->setValue("viewing/flag_equatorial_J2000_grid", glmgr->getFlagE quatorJ2000Grid()); conf->setValue("viewing/flag_equatorial_J2000_grid", glmgr->getFlagE quatorJ2000Grid());
conf->setValue("viewing/flag_galactic_grid", glmgr->getFlagGalacticG rid()); conf->setValue("viewing/flag_galactic_grid", glmgr->getFlagGalacticG rid());
conf->setValue("viewing/flag_galactic_plane_line", glmgr->getFlagGal acticPlaneLine()); conf->setValue("viewing/flag_galactic_plane_line", glmgr->getFlagGal acticPlaneLine());
conf->setValue("viewing/flag_cardinal_points", lmgr->getFlagCardinal sPoints()); conf->setValue("viewing/flag_cardinal_points", lmgr->getFlagCardinal sPoints());
conf->setValue("viewing/flag_constellation_drawing", cmgr->getFlagLi nes()); conf->setValue("viewing/flag_constellation_drawing", cmgr->getFlagLi nes());
conf->setValue("viewing/flag_constellation_name", cmgr->getFlagLabel s()); conf->setValue("viewing/flag_constellation_name", cmgr->getFlagLabel s());
conf->setValue("viewing/flag_constellation_boundaries", cmgr->getFla gBoundaries()); conf->setValue("viewing/flag_constellation_boundaries", cmgr->getFla gBoundaries());
conf->setValue("viewing/flag_constellation_art", cmgr->getFlagArt()) ; conf->setValue("viewing/flag_constellation_art", cmgr->getFlagArt()) ;
conf->setValue("viewing/flag_constellation_isolate_selected", cmgr-> getFlagIsolateSelected()); conf->setValue("viewing/flag_constellation_isolate_selected", cmgr-> getFlagIsolateSelected());
conf->setValue("viewing/flag_landscape_autoselection", lmgr->getFlag LandscapeAutoSelection()); conf->setValue("viewing/flag_landscape_autoselection", lmgr->getFlag LandscapeAutoSelection());
conf->setValue("viewing/flag_light_pollution_database", lmgr->getFla
gUseLightPollutionFromDatabase());
conf->setValue("viewing/flag_atmopshere_auto_enable", lmgr->getFlagA
tmosphereAutoEnable());
conf->setValue("viewing/constellation_art_intensity", cmgr->getArtIn tensity()); conf->setValue("viewing/constellation_art_intensity", cmgr->getArtIn tensity());
conf->setValue("viewing/flag_night", StelApp::getInstance().getVisio nModeNight()); conf->setValue("viewing/flag_night", StelApp::getInstance().getVisio nModeNight());
conf->setValue("astro/flag_star_name", smgr->getFlagLabels()); conf->setValue("astro/flag_star_name", smgr->getFlagLabels());
conf->setValue("stars/labels_amount", smgr->getLabelsAmount()); conf->setValue("stars/labels_amount", smgr->getLabelsAmount());
conf->setValue("astro/flag_planets_labels", ssmgr->getFlagLabels()); conf->setValue("astro/flag_planets_labels", ssmgr->getFlagLabels());
conf->setValue("astro/labels_amount", ssmgr->getLabelsAmount()); conf->setValue("astro/labels_amount", ssmgr->getLabelsAmount());
conf->setValue("astro/nebula_hints_amount", nmgr->getHintsAmount()); conf->setValue("astro/nebula_hints_amount", nmgr->getHintsAmount());
conf->setValue("astro/flag_nebula_name", nmgr->getFlagHints()); conf->setValue("astro/flag_nebula_name", nmgr->getFlagHints());
conf->setValue("projection/type", core->getCurrentProjectionTypeKey( )); conf->setValue("projection/type", core->getCurrentProjectionTypeKey( ));
// view dialog / landscape tab settings // view dialog / landscape tab settings
lmgr->setDefaultLandscapeID(lmgr->getCurrentLandscapeID()); lmgr->setDefaultLandscapeID(lmgr->getCurrentLandscapeID());
conf->setValue("landscape/flag_landscape_sets_location", lmgr->getFl agLandscapeSetsLocation()); conf->setValue("landscape/flag_landscape_sets_location", lmgr->getFl agLandscapeSetsLocation());
conf->setValue("landscape/flag_landscape", lmgr->getFlagLandscape()) ; conf->setValue("landscape/flag_landscape", lmgr->getFlagLandscape()) ;
conf->setValue("landscape/flag_atmosphere", lmgr->getFlagAtmosphere( )); conf->setValue("landscape/flag_atmosphere", lmgr->getFlagAtmosphere( ));
conf->setValue("landscape/flag_brightness", lmgr->getFlagLandscapeNi ghtBrightness()); conf->setValue("landscape/flag_brightness", lmgr->getFlagLandscapeSe tsMinimalBrightness());
conf->setValue("landscape/flag_fog", lmgr->getFlagFog()); conf->setValue("landscape/flag_fog", lmgr->getFlagFog());
conf->setValue("stars/init_bortle_scale", core->getSkyDrawer()->getB ortleScale()); conf->setValue("stars/init_bortle_scale", core->getSkyDrawer()->getB ortleScaleIndex());
conf->setValue("landscape/atmospheric_extinction_coefficient", core ->getSkyDrawer()->getExtinctionCoefficient()); conf->setValue("landscape/atmospheric_extinction_coefficient", core ->getSkyDrawer()->getExtinctionCoefficient());
conf->setValue("landscape/pressure_mbar", core->getSkyDrawer()->get AtmospherePressure()); conf->setValue("landscape/pressure_mbar", core->getSkyDrawer()->get AtmospherePressure());
conf->setValue("landscape/temperature_C", core->getSkyDrawer()->get AtmosphereTemperature()); conf->setValue("landscape/temperature_C", core->getSkyDrawer()->get AtmosphereTemperature());
// view dialog / starlore tab // view dialog / starlore tab
StelApp::getInstance().getSkyCultureMgr().setDefaultSkyCultureID(Ste lApp::getInstance().getSkyCultureMgr().getCurrentSkyCultureID()); StelApp::getInstance().getSkyCultureMgr().setDefaultSkyCultureID(Ste lApp::getInstance().getSkyCultureMgr().getCurrentSkyCultureID());
// Save default location // Save default location
StelApp::getInstance().getCore()->setDefaultLocationID(core->getCurr entLocation().getID()); StelApp::getInstance().getCore()->setDefaultLocationID(core->getCurr entLocation().getID());
skipping to change at line 590 skipping to change at line 596
conf->setValue("flag_show_name", (bool) (flags & StelObject: :Name)); conf->setValue("flag_show_name", (bool) (flags & StelObject: :Name));
conf->setValue("flag_show_catalognumber", conf->setValue("flag_show_catalognumber",
(bool) (flags & StelObject::CatalogNumber)); (bool) (flags & StelObject::CatalogNumber));
conf->setValue("flag_show_magnitude", conf->setValue("flag_show_magnitude",
(bool) (flags & StelObject::Magnitude)); (bool) (flags & StelObject::Magnitude));
conf->setValue("flag_show_absolutemagnitude", conf->setValue("flag_show_absolutemagnitude",
(bool) (flags & StelObject::AbsoluteMagnitude )); (bool) (flags & StelObject::AbsoluteMagnitude ));
conf->setValue("flag_show_radecj2000", conf->setValue("flag_show_radecj2000",
(bool) (flags & StelObject::RaDecJ2000)); (bool) (flags & StelObject::RaDecJ2000));
conf->setValue("flag_show_radecofdate", conf->setValue("flag_show_radecofdate",
(bool) (flags & StelObject::RaDecOfDate)); (bool) (flags & StelObject::RaDecOfDate));
conf->setValue("flag_show_hourangle", conf->setValue("flag_show_hourangle",
(bool) (flags & StelObject::HourAngle)); (bool) (flags & StelObject::HourAngle));
conf->setValue("flag_show_altaz", conf->setValue("flag_show_altaz",
(bool) (flags & StelObject::AltAzi)); (bool) (flags & StelObject::AltAzi));
conf->setValue("flag_show_distance", conf->setValue("flag_show_distance",
(bool) (flags & StelObject::Distance)); (bool) (flags & StelObject::Distance));
conf->setValue("flag_show_size", conf->setValue("flag_show_size",
(bool) (flags & StelObject::Size)); (bool) (flags & StelObject::Size));
conf->setValue("flag_show_extra1", conf->setValue("flag_show_extra",
(bool) (flags & StelObject::Extra1)); (bool) (flags & StelObject::Extra));
conf->setValue("flag_show_extra2", conf->setValue("flag_show_galcoord",
(bool) (flags & StelObject::Extra2)); (bool) (flags & StelObject::GalacticCoord));
conf->setValue("flag_show_extra3", conf->setValue("flag_show_type",
(bool) (flags & StelObject::Extra3)); (bool) (flags & StelObject::ObjectType));
conf->setValue("flag_show_galcoordj2000", conf->setValue("flag_show_eclcoord",
(bool) (flags & StelObject::GalCoordJ2000)); (bool) (flags & StelObject::EclTopocentricCoo
rd));
conf->endGroup(); conf->endGroup();
} }
// toolbar auto-hide status // toolbar auto-hide status
conf->setValue("gui/auto_hide_horizontal_toolbar", gui->getAutoHideH orizontalButtonBar()); conf->setValue("gui/auto_hide_horizontal_toolbar", gui->getAutoHideH orizontalButtonBar());
conf->setValue("gui/auto_hide_vertical_toolbar", gui->getAutoHideVer ticalButtonBar()); conf->setValue("gui/auto_hide_vertical_toolbar", gui->getAutoHideVer ticalButtonBar());
conf->setValue("gui/flag_show_nebulae_background_button", gui->getFl agShowNebulaBackgroundButton()); conf->setValue("gui/flag_show_nebulae_background_button", gui->getFl agShowNebulaBackgroundButton());
mvmgr->setInitFov(mvmgr->getCurrentFov()); mvmgr->setInitFov(mvmgr->getCurrentFov());
mvmgr->setInitViewDirectionToCurrent(); mvmgr->setInitViewDirectionToCurrent();
skipping to change at line 634 skipping to change at line 640
conf->setValue("navigation/preset_sky_time", core->getPresetSkyTime( )); conf->setValue("navigation/preset_sky_time", core->getPresetSkyTime( ));
conf->setValue("navigation/time_correction_algorithm", core->getCurr entDeltaTAlgorithmKey()); conf->setValue("navigation/time_correction_algorithm", core->getCurr entDeltaTAlgorithmKey());
conf->setValue("navigation/init_fov", mvmgr->getInitFov()); conf->setValue("navigation/init_fov", mvmgr->getInitFov());
if (mvmgr->getMountMode() == StelMovementMgr::MountAltAzimuthal) if (mvmgr->getMountMode() == StelMovementMgr::MountAltAzimuthal)
conf->setValue("navigation/viewing_mode", "horizon"); conf->setValue("navigation/viewing_mode", "horizon");
else else
conf->setValue("navigation/viewing_mode", "equator"); conf->setValue("navigation/viewing_mode", "equator");
// configuration dialog / tools tab // configuration dialog / tools tab
conf->setValue("gui/flag_show_flip_buttons", gui->getFlagShowFlipBut tons()); conf->setValue("gui/flag_show_flip_buttons", gui->getFlagShowFlipBut tons());
conf->setValue("video/viewport_effect", StelMainGraphicsView::getIns // XXX: to reintroduce.
tance().getStelAppGraphicsWidget()->getViewportEffect()); // conf->setValue("video/viewport_effect", StelMainView::getInstance
().getStelAppGraphicsWidget()->getViewportEffect());
conf->setValue("projection/viewport", StelProjector::maskTypeToStrin g(proj->getMaskType())); conf->setValue("projection/viewport", StelProjector::maskTypeToStrin g(proj->getMaskType()));
conf->setValue("viewing/flag_gravity_labels", proj->getFlagGravityLa bels()); conf->setValue("viewing/flag_gravity_labels", proj->getFlagGravityLa bels());
conf->setValue("viewing/flag_render_solar_shadows", StelApp::getInst ance().getRenderSolarShadows());
conf->setValue("navigation/auto_zoom_out_resets_direction", mvmgr->g etFlagAutoZoomOutResetsDirection()); conf->setValue("navigation/auto_zoom_out_resets_direction", mvmgr->g etFlagAutoZoomOutResetsDirection());
conf->setValue("gui/flag_mouse_cursor_timeout", StelMainGraphicsView conf->setValue("gui/flag_mouse_cursor_timeout", StelMainView::getIns
::getInstance().getFlagCursorTimeout()); tance().getFlagCursorTimeout());
conf->setValue("gui/mouse_cursor_timeout", StelMainGraphicsView::get conf->setValue("gui/mouse_cursor_timeout", StelMainView::getInstance
Instance().getCursorTimeout()); ().getCursorTimeout());
conf->setValue("main/screenshot_dir", StelFileMgr::getScreenshotDir( )); conf->setValue("main/screenshot_dir", StelFileMgr::getScreenshotDir( ));
conf->setValue("main/invert_screenshots_colors", StelMainGraphicsVie w::getInstance().getFlagInvertScreenShotColors()); conf->setValue("main/invert_screenshots_colors", StelMainView::getIn stance().getFlagInvertScreenShotColors());
// full screen and window size // full screen and window size
conf->setValue("video/fullscreen", StelMainWindow::getInstance().get conf->setValue("video/fullscreen", StelMainView::getInstance().isFul
FullScreen()); lScreen());
if (!StelMainWindow::getInstance().getFullScreen()) if (!StelMainView::getInstance().isFullScreen())
{ {
StelMainWindow& mainWindow = StelMainWindow::getInstance(); QWidget& mainWindow = StelMainView::getInstance();
conf->setValue("video/screen_w", mainWindow.size().width()); conf->setValue("video/screen_w", mainWindow.size().width());
conf->setValue("video/screen_h", mainWindow.size().height()) ; conf->setValue("video/screen_h", mainWindow.size().height()) ;
conf->setValue("video/screen_x", mainWindow.x()); conf->setValue("video/screen_x", mainWindow.x());
conf->setValue("video/screen_y", mainWindow.y()); conf->setValue("video/screen_y", mainWindow.y());
} }
// clear the restore defaults flag if it is set. // clear the restore defaults flag if it is set.
conf->setValue("main/restore_defaults", false); conf->setValue("main/restore_defaults", false);
updateConfigLabels(); updateConfigLabels();
skipping to change at line 685 skipping to change at line 691
void ConfigurationDialog::setDefaultViewOptions() void ConfigurationDialog::setDefaultViewOptions()
{ {
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
Q_ASSERT(conf); Q_ASSERT(conf);
conf->setValue("main/restore_defaults", true); conf->setValue("main/restore_defaults", true);
} }
void ConfigurationDialog::populatePluginsList() void ConfigurationDialog::populatePluginsList()
{ {
int prevSel = ui->pluginsListWidget->currentRow(); QListWidget *plugins = ui->pluginsListWidget;
ui->pluginsListWidget->clear(); plugins->blockSignals(true);
int currentRow = plugins->currentRow();
QString selectedPluginId = "";
if (currentRow>0)
selectedPluginId = plugins->currentItem()->data(Qt::UserRol
e).toString();
plugins->clear();
QString selectedPluginName = "";
const QList<StelModuleMgr::PluginDescriptor> pluginsList = StelApp:: getInstance().getModuleMgr().getPluginsList(); const QList<StelModuleMgr::PluginDescriptor> pluginsList = StelApp:: getInstance().getModuleMgr().getPluginsList();
foreach (const StelModuleMgr::PluginDescriptor& desc, pluginsList) foreach (const StelModuleMgr::PluginDescriptor& desc, pluginsList)
{ {
QString label = q_(desc.info.displayedName); QString label = q_(desc.info.displayedName);
QListWidgetItem* item = new QListWidgetItem(label); QListWidgetItem* item = new QListWidgetItem(label);
item->setData(Qt::UserRole, desc.info.id); item->setData(Qt::UserRole, desc.info.id);
ui->pluginsListWidget->addItem(item); plugins->addItem(item);
if (currentRow>0 && item->data(Qt::UserRole).toString()==sel
ectedPluginId)
selectedPluginName = label;
} }
ui->pluginsListWidget->sortItems(Qt::AscendingOrder); plugins->sortItems(Qt::AscendingOrder);
plugins->blockSignals(false);
// If we had a valid previous selection (i.e. not first time we popu late), restore it // If we had a valid previous selection (i.e. not first time we popu late), restore it
if (prevSel >= 0 && prevSel < ui->pluginsListWidget->count())
ui->pluginsListWidget->setCurrentRow(prevSel); if (!selectedPluginName.isEmpty())
plugins->setCurrentItem(plugins->findItems(selectedPluginNam
e, Qt::MatchExactly).at(0));
else else
ui->pluginsListWidget->setCurrentRow(0); plugins->setCurrentRow(0);
} }
void ConfigurationDialog::pluginsSelectionChanged(const QString& s) void ConfigurationDialog::pluginsSelectionChanged(QListWidgetItem* item, QL istWidgetItem* previousItem)
{ {
Q_UNUSED(previousItem);
const QList<StelModuleMgr::PluginDescriptor> pluginsList = StelApp:: getInstance().getModuleMgr().getPluginsList(); const QList<StelModuleMgr::PluginDescriptor> pluginsList = StelApp:: getInstance().getModuleMgr().getPluginsList();
foreach (const StelModuleMgr::PluginDescriptor& desc, pluginsList) foreach (const StelModuleMgr::PluginDescriptor& desc, pluginsList)
{ {
if (s==q_(desc.info.displayedName))//TODO: Use ID! if (item->data(Qt::UserRole).toString()==desc.info.id)
{ {
QString html = "<html><head></head><body>"; QString html = "<html><head></head><body>";
html += "<h2>" + q_(desc.info.displayedName) + "</h2 >"; html += "<h2>" + q_(desc.info.displayedName) + "</h2 >";
QString d = desc.info.description; QString d = desc.info.description;
d.replace("\n", "<br />"); d.replace("\n", "<br />");
html += "<p>" + q_(d) + "</p>"; html += "<p>" + q_(d) + "</p>";
html += "<p><strong>" + q_("Authors") + "</strong>: " + desc.info.authors; html += "<p><strong>" + q_("Authors") + "</strong>: " + desc.info.authors;
html += "<br /><strong>" + q_("Contact") + "</strong >: " + desc.info.contact; html += "<br /><strong>" + q_("Contact") + "</strong >: " + desc.info.contact;
if (!desc.info.version.isEmpty())
html += "<br /><strong>" + q_("Version") + "
</strong>: " + desc.info.version;
html += "</p></body></html>"; html += "</p></body></html>";
ui->pluginsInfoBrowser->setHtml(html); ui->pluginsInfoBrowser->setHtml(html);
ui->pluginLoadAtStartupCheckBox->setChecked(desc.loa dAtStartup); ui->pluginLoadAtStartupCheckBox->setChecked(desc.loa dAtStartup);
StelModule* pmod = StelApp::getInstance().getModuleM gr().getModule(desc.info.id, true); StelModule* pmod = StelApp::getInstance().getModuleM gr().getModule(desc.info.id, true);
if (pmod != NULL) if (pmod != NULL)
ui->pluginConfigureButton->setEnabled(pmod-> configureGui(false)); ui->pluginConfigureButton->setEnabled(pmod-> configureGui(false));
else else
ui->pluginConfigureButton->setEnabled(false) ; ui->pluginConfigureButton->setEnabled(false) ;
return; return;
} }
skipping to change at line 742 skipping to change at line 763
QString id = ui->pluginsListWidget->currentItem()->data(Qt::UserRole ).toString(); QString id = ui->pluginsListWidget->currentItem()->data(Qt::UserRole ).toString();
if (id.isEmpty()) if (id.isEmpty())
return; return;
StelModuleMgr& moduleMgr = StelApp::getInstance().getModuleMgr(); StelModuleMgr& moduleMgr = StelApp::getInstance().getModuleMgr();
const QList<StelModuleMgr::PluginDescriptor> pluginsList = moduleMgr .getPluginsList(); const QList<StelModuleMgr::PluginDescriptor> pluginsList = moduleMgr .getPluginsList();
foreach (const StelModuleMgr::PluginDescriptor& desc, pluginsList) foreach (const StelModuleMgr::PluginDescriptor& desc, pluginsList)
{ {
if (id == desc.info.id) if (id == desc.info.id)
{ {
StelModule* pmod = moduleMgr.getModule(desc.info.id) ; StelModule* pmod = moduleMgr.getModule(desc.info.id, QObject::sender()->objectName()=="pluginsListWidget");
if (pmod != NULL) if (pmod != NULL)
{ {
pmod->configureGui(true); pmod->configureGui(true);
} }
return; return;
} }
} }
} }
void ConfigurationDialog::loadAtStartupChanged(int state) void ConfigurationDialog::loadAtStartupChanged(int state)
skipping to change at line 774 skipping to change at line 795
moduleMgr.setPluginLoadAtStartup(id, state == Qt::Ch ecked); moduleMgr.setPluginLoadAtStartup(id, state == Qt::Ch ecked);
break; break;
} }
} }
} }
#ifndef DISABLE_SCRIPTING #ifndef DISABLE_SCRIPTING
void ConfigurationDialog::populateScriptsList(void) void ConfigurationDialog::populateScriptsList(void)
{ {
int prevSel = ui->scriptListWidget->currentRow(); int prevSel = ui->scriptListWidget->currentRow();
StelScriptMgr& scriptMgr = StelMainGraphicsView::getInstance().getSc riptMgr(); StelScriptMgr& scriptMgr = StelApp::getInstance().getScriptMgr();
ui->scriptListWidget->clear(); ui->scriptListWidget->clear();
ui->scriptListWidget->addItems(scriptMgr.getScriptList()); ui->scriptListWidget->addItems(scriptMgr.getScriptList());
// If we had a valid previous selection (i.e. not first time we popu late), restore it // If we had a valid previous selection (i.e. not first time we popu late), restore it
if (prevSel >= 0 && prevSel < ui->scriptListWidget->count()) if (prevSel >= 0 && prevSel < ui->scriptListWidget->count())
ui->scriptListWidget->setCurrentRow(prevSel); ui->scriptListWidget->setCurrentRow(prevSel);
else else
ui->scriptListWidget->setCurrentRow(0); ui->scriptListWidget->setCurrentRow(0);
} }
void ConfigurationDialog::scriptSelectionChanged(const QString& s) void ConfigurationDialog::scriptSelectionChanged(const QString& s)
{ {
if (s.isEmpty()) if (s.isEmpty())
return; return;
StelScriptMgr& scriptMgr = StelMainGraphicsView::getInstance().getSc riptMgr(); StelScriptMgr& scriptMgr = StelApp::getInstance().getScriptMgr();
//ui->scriptInfoBrowser->document()->setDefaultStyleSheet(QString(St elApp::getInstance().getCurrentStelStyle()->htmlStyleSheet)); //ui->scriptInfoBrowser->document()->setDefaultStyleSheet(QString(St elApp::getInstance().getCurrentStelStyle()->htmlStyleSheet));
QString html = "<html><head></head><body>"; QString html = "<html><head></head><body>";
html += "<h2>" + q_(scriptMgr.getName(s).trimmed()) + "</h2>"; html += "<h2>" + q_(scriptMgr.getName(s).trimmed()) + "</h2>";
QString d = scriptMgr.getDescription(s).trimmed(); QString d = scriptMgr.getDescription(s).trimmed();
d.replace("\n", "<br />"); d.replace("\n", "<br />");
d.replace(QRegExp("\\s{2,}"), " "); d.replace(QRegExp("\\s{2,}"), " ");
html += "<p>" + q_(d) + "</p>"; html += "<p>" + q_(d) + "</p>";
html += "<p>"; html += "<p>";
if (!scriptMgr.getAuthor(s).trimmed().isEmpty()) if (!scriptMgr.getAuthor(s).trimmed().isEmpty())
{ {
html += "<strong>" + q_("Author") + "</strong>: " + scriptMg r.getAuthor(s) + "<br />"; html += "<strong>" + q_("Author") + "</strong>: " + scriptMg r.getAuthor(s) + "<br />";
} }
if (!scriptMgr.getLicense(s).trimmed().isEmpty()) if (!scriptMgr.getLicense(s).trimmed().isEmpty())
{ {
html += "<strong>" + q_("License") + "</strong>: " + scriptM html += "<strong>" + q_("License") + "</strong>: " + scriptM
gr.getLicense(s); gr.getLicense(s) + "<br />";
}
if (!scriptMgr.getShortcut(s).trimmed().isEmpty())
{
html += "<strong>" + q_("Shortcut") + "</strong>: " + script
Mgr.getShortcut(s);
} }
html += "</p></body></html>"; html += "</p></body></html>";
ui->scriptInfoBrowser->setHtml(html); ui->scriptInfoBrowser->setHtml(html);
} }
void ConfigurationDialog::runScriptClicked(void) void ConfigurationDialog::runScriptClicked(void)
{ {
if (ui->closeWindowAtScriptRunCheckbox->isChecked()) if (ui->closeWindowAtScriptRunCheckbox->isChecked())
this->close(); this->close();
StelScriptMgr& scriptMgr = StelMainGraphicsView::getInstance().getSc riptMgr(); StelScriptMgr& scriptMgr = StelApp::getInstance().getScriptMgr();
if (ui->scriptListWidget->currentItem()) if (ui->scriptListWidget->currentItem())
{ {
scriptMgr.runScript(ui->scriptListWidget->currentItem()->tex t()); scriptMgr.runScript(ui->scriptListWidget->currentItem()->tex t());
} }
} }
void ConfigurationDialog::stopScriptClicked(void) void ConfigurationDialog::stopScriptClicked(void)
{ {
StelMainGraphicsView::getInstance().getScriptMgr().stopScript(); StelApp::getInstance().getScriptMgr().stopScript();
} }
void ConfigurationDialog::aScriptIsRunning(void) void ConfigurationDialog::aScriptIsRunning(void)
{ {
ui->scriptStatusLabel->setText(q_("Running script: ") + StelMainGrap hicsView::getInstance().getScriptMgr().runningScriptId()); ui->scriptStatusLabel->setText(q_("Running script: ") + StelApp::get Instance().getScriptMgr().runningScriptId());
ui->runScriptButton->setEnabled(false); ui->runScriptButton->setEnabled(false);
ui->stopScriptButton->setEnabled(true); ui->stopScriptButton->setEnabled(true);
} }
void ConfigurationDialog::aScriptHasStopped(void) void ConfigurationDialog::aScriptHasStopped(void)
{ {
ui->scriptStatusLabel->setText(q_("Running script: [none]")); ui->scriptStatusLabel->setText(q_("Running script: [none]"));
ui->runScriptButton->setEnabled(true); ui->runScriptButton->setEnabled(true);
ui->stopScriptButton->setEnabled(false); ui->stopScriptButton->setEnabled(false);
} }
skipping to change at line 944 skipping to change at line 969
starCatalogDownloadReply->abort(); starCatalogDownloadReply->abort();
} }
void ConfigurationDialog::newStarCatalogData() void ConfigurationDialog::newStarCatalogData()
{ {
Q_ASSERT(currentDownloadFile); Q_ASSERT(currentDownloadFile);
Q_ASSERT(starCatalogDownloadReply); Q_ASSERT(starCatalogDownloadReply);
Q_ASSERT(progressBar); Q_ASSERT(progressBar);
int size = starCatalogDownloadReply->bytesAvailable(); int size = starCatalogDownloadReply->bytesAvailable();
progressBar->setValue((float)progressBar->value()+(float)size/1024); progressBar->setValue((float)progressBar->getValue()+(float)size/102 4);
currentDownloadFile->write(starCatalogDownloadReply->read(size)); currentDownloadFile->write(starCatalogDownloadReply->read(size));
} }
void ConfigurationDialog::downloadStars() void ConfigurationDialog::downloadStars()
{ {
Q_ASSERT(!nextStarCatalogToDownload.isEmpty()); Q_ASSERT(!nextStarCatalogToDownload.isEmpty());
Q_ASSERT(!isDownloadingStarCatalog); Q_ASSERT(!isDownloadingStarCatalog);
Q_ASSERT(starCatalogDownloadReply==NULL); Q_ASSERT(starCatalogDownloadReply==NULL);
Q_ASSERT(currentDownloadFile==NULL); Q_ASSERT(currentDownloadFile==NULL);
Q_ASSERT(progressBar==NULL); Q_ASSERT(progressBar==NULL);
skipping to change at line 978 skipping to change at line 1003
isDownloadingStarCatalog = true; isDownloadingStarCatalog = true;
updateStarCatalogControlsText(); updateStarCatalogControlsText();
ui->downloadCancelButton->setVisible(true); ui->downloadCancelButton->setVisible(true);
ui->downloadRetryButton->setVisible(false); ui->downloadRetryButton->setVisible(false);
ui->getStarsButton->setVisible(true); ui->getStarsButton->setVisible(true);
ui->getStarsButton->setEnabled(false); ui->getStarsButton->setEnabled(false);
QNetworkRequest req(nextStarCatalogToDownload.value("url").toString( )); QNetworkRequest req(nextStarCatalogToDownload.value("url").toString( ));
req.setAttribute(QNetworkRequest::CacheSaveControlAttribute, false); req.setAttribute(QNetworkRequest::CacheSaveControlAttribute, false);
req.setAttribute(QNetworkRequest::RedirectionTargetAttribute, false) ; req.setAttribute(QNetworkRequest::RedirectionTargetAttribute, false) ;
req.setRawHeader("User-Agent", StelUtils::getApplicationName().toAsc ii()); req.setRawHeader("User-Agent", StelUtils::getApplicationName().toLat in1());
starCatalogDownloadReply = StelApp::getInstance().getNetworkAccessMa nager()->get(req); starCatalogDownloadReply = StelApp::getInstance().getNetworkAccessMa nager()->get(req);
starCatalogDownloadReply->setReadBufferSize(1024*1024*2); starCatalogDownloadReply->setReadBufferSize(1024*1024*2);
connect(starCatalogDownloadReply, SIGNAL(readyRead()), this, SLOT(ne wStarCatalogData())); connect(starCatalogDownloadReply, SIGNAL(readyRead()), this, SLOT(ne wStarCatalogData()));
connect(starCatalogDownloadReply, SIGNAL(finished()), this, SLOT(dow nloadFinished())); connect(starCatalogDownloadReply, SIGNAL(finished()), this, SLOT(dow nloadFinished()));
connect(starCatalogDownloadReply, SIGNAL(error(QNetworkReply::Networ kError)), this, SLOT(downloadError(QNetworkReply::NetworkError))); connect(starCatalogDownloadReply, SIGNAL(error(QNetworkReply::Networ kError)), this, SLOT(downloadError(QNetworkReply::NetworkError)));
progressBar = StelApp::getInstance().getGui()->addProgressBar(); progressBar = StelApp::getInstance().addProgressBar();
progressBar->setValue(0); progressBar->setValue(0);
progressBar->setMaximum(nextStarCatalogToDownload.value("sizeMb").to progressBar->setRange(0, nextStarCatalogToDownload.value("sizeMb").t
Double()*1024); oDouble()*1024);
progressBar->setVisible(true);
progressBar->setFormat(QString("%1: %p%").arg(nextStarCatalogToDownl oad.value("id").toString())); progressBar->setFormat(QString("%1: %p%").arg(nextStarCatalogToDownl oad.value("id").toString()));
} }
void ConfigurationDialog::downloadError(QNetworkReply::NetworkError) void ConfigurationDialog::downloadError(QNetworkReply::NetworkError)
{ {
Q_ASSERT(currentDownloadFile); Q_ASSERT(currentDownloadFile);
Q_ASSERT(starCatalogDownloadReply); Q_ASSERT(starCatalogDownloadReply);
isDownloadingStarCatalog = false; isDownloadingStarCatalog = false;
qWarning() << "Error downloading file" << starCatalogDownloadReply-> url() << ": " << starCatalogDownloadReply->errorString(); qWarning() << "Error downloading file" << starCatalogDownloadReply-> url() << ": " << starCatalogDownloadReply->errorString();
skipping to change at line 1019 skipping to change at line 1043
Q_ASSERT(starCatalogDownloadReply); Q_ASSERT(starCatalogDownloadReply);
Q_ASSERT(progressBar); Q_ASSERT(progressBar);
if (starCatalogDownloadReply->error()!=QNetworkReply::NoError) if (starCatalogDownloadReply->error()!=QNetworkReply::NoError)
{ {
starCatalogDownloadReply->deleteLater(); starCatalogDownloadReply->deleteLater();
starCatalogDownloadReply = NULL; starCatalogDownloadReply = NULL;
currentDownloadFile->close(); currentDownloadFile->close();
currentDownloadFile->deleteLater(); currentDownloadFile->deleteLater();
currentDownloadFile = NULL; currentDownloadFile = NULL;
progressBar->deleteLater(); StelApp::getInstance().removeProgressBar(progressBar);
progressBar=NULL; progressBar=NULL;
return; return;
} }
Q_ASSERT(starCatalogDownloadReply->bytesAvailable()==0); Q_ASSERT(starCatalogDownloadReply->bytesAvailable()==0);
const QVariant& redirect = starCatalogDownloadReply->attribute(QNetw orkRequest::RedirectionTargetAttribute); const QVariant& redirect = starCatalogDownloadReply->attribute(QNetw orkRequest::RedirectionTargetAttribute);
if (!redirect.isNull()) if (!redirect.isNull())
{ {
// We got a redirection, we need to follow // We got a redirection, we need to follow
starCatalogDownloadReply->deleteLater(); starCatalogDownloadReply->deleteLater();
QNetworkRequest req(redirect.toUrl()); QNetworkRequest req(redirect.toUrl());
req.setAttribute(QNetworkRequest::CacheSaveControlAttribute, false); req.setAttribute(QNetworkRequest::CacheSaveControlAttribute, false);
req.setRawHeader("User-Agent", StelUtils::getApplicationName ().toAscii()); req.setRawHeader("User-Agent", StelUtils::getApplicationName ().toLatin1());
starCatalogDownloadReply = StelApp::getInstance().getNetwork AccessManager()->get(req); starCatalogDownloadReply = StelApp::getInstance().getNetwork AccessManager()->get(req);
starCatalogDownloadReply->setReadBufferSize(1024*1024*2); starCatalogDownloadReply->setReadBufferSize(1024*1024*2);
connect(starCatalogDownloadReply, SIGNAL(readyRead()), this, SLOT(newStarCatalogData())); connect(starCatalogDownloadReply, SIGNAL(readyRead()), this, SLOT(newStarCatalogData()));
connect(starCatalogDownloadReply, SIGNAL(finished()), this, SLOT(downloadFinished())); connect(starCatalogDownloadReply, SIGNAL(finished()), this, SLOT(downloadFinished()));
connect(starCatalogDownloadReply, SIGNAL(error(QNetworkReply ::NetworkError)), this, SLOT(downloadError(QNetworkReply::NetworkError))); connect(starCatalogDownloadReply, SIGNAL(error(QNetworkReply ::NetworkError)), this, SLOT(downloadError(QNetworkReply::NetworkError)));
return; return;
} }
isDownloadingStarCatalog = false; isDownloadingStarCatalog = false;
currentDownloadFile->close(); currentDownloadFile->close();
currentDownloadFile->deleteLater(); currentDownloadFile->deleteLater();
currentDownloadFile = NULL; currentDownloadFile = NULL;
starCatalogDownloadReply->deleteLater(); starCatalogDownloadReply->deleteLater();
starCatalogDownloadReply = NULL; starCatalogDownloadReply = NULL;
progressBar->deleteLater(); StelApp::getInstance().removeProgressBar(progressBar);
progressBar=NULL; progressBar=NULL;
ui->downloadLabel->setText(q_("Verifying file integrity...")); ui->downloadLabel->setText(q_("Verifying file integrity..."));
if (GETSTELMODULE(StarMgr)->checkAndLoadCatalog(nextStarCatalogToDow nload)==false) if (GETSTELMODULE(StarMgr)->checkAndLoadCatalog(nextStarCatalogToDow nload)==false)
{ {
ui->getStarsButton->setVisible(false); ui->getStarsButton->setVisible(false);
ui->downloadLabel->setText(q_("Error downloading %1:\nFile i s corrupted.").arg(nextStarCatalogToDownload.value("id").toString())); ui->downloadLabel->setText(q_("Error downloading %1:\nFile i s corrupted.").arg(nextStarCatalogToDownload.value("id").toString()));
ui->downloadCancelButton->setVisible(false); ui->downloadCancelButton->setVisible(false);
ui->downloadRetryButton->setVisible(true); ui->downloadRetryButton->setVisible(true);
} }
skipping to change at line 1081 skipping to change at line 1105
ui->checkBoxName->setChecked(flags & StelObject::Name); ui->checkBoxName->setChecked(flags & StelObject::Name);
ui->checkBoxCatalogNumbers->setChecked(flags & StelObject::CatalogNu mber); ui->checkBoxCatalogNumbers->setChecked(flags & StelObject::CatalogNu mber);
ui->checkBoxVisualMag->setChecked(flags & StelObject::Magnitude); ui->checkBoxVisualMag->setChecked(flags & StelObject::Magnitude);
ui->checkBoxAbsoluteMag->setChecked(flags & StelObject::AbsoluteMagn itude); ui->checkBoxAbsoluteMag->setChecked(flags & StelObject::AbsoluteMagn itude);
ui->checkBoxRaDecJ2000->setChecked(flags & StelObject::RaDecJ2000); ui->checkBoxRaDecJ2000->setChecked(flags & StelObject::RaDecJ2000);
ui->checkBoxRaDecOfDate->setChecked(flags & StelObject::RaDecOfDate) ; ui->checkBoxRaDecOfDate->setChecked(flags & StelObject::RaDecOfDate) ;
ui->checkBoxHourAngle->setChecked(flags & StelObject::HourAngle); ui->checkBoxHourAngle->setChecked(flags & StelObject::HourAngle);
ui->checkBoxAltAz->setChecked(flags & StelObject::AltAzi); ui->checkBoxAltAz->setChecked(flags & StelObject::AltAzi);
ui->checkBoxDistance->setChecked(flags & StelObject::Distance); ui->checkBoxDistance->setChecked(flags & StelObject::Distance);
ui->checkBoxSize->setChecked(flags & StelObject::Size); ui->checkBoxSize->setChecked(flags & StelObject::Size);
ui->checkBoxExtra1->setChecked(flags & StelObject::Extra1); ui->checkBoxExtra->setChecked(flags & StelObject::Extra);
ui->checkBoxExtra2->setChecked(flags & StelObject::Extra2); ui->checkBoxGalacticCoordinates->setChecked(flags & StelObject::Gala
ui->checkBoxExtra3->setChecked(flags & StelObject::Extra3); cticCoord);
ui->checkBoxGalacticCoordJ2000->setChecked(flags & StelObject::GalCo ui->checkBoxType->setChecked(flags & StelObject::ObjectType);
ordJ2000); ui->checkBoxTEclipticCoords->setChecked(flags & StelObject::EclTopoc
entricCoord);
} }
void ConfigurationDialog::updateTabBarListWidgetWidth() void ConfigurationDialog::updateTabBarListWidgetWidth()
{ {
QAbstractItemModel* model = ui->stackListWidget->model(); QAbstractItemModel* model = ui->stackListWidget->model();
if (!model) if (!model)
return; return;
// Update list item sizes after translation // Update list item sizes after translation
ui->stackListWidget->adjustSize(); ui->stackListWidget->adjustSize();
 End of changes. 65 change blocks. 
146 lines changed or deleted 176 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/