ConfigurationDialog.cpp   ConfigurationDialog.cpp 
skipping to change at line 45 skipping to change at line 45
#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"
#include "StelSkyLayerMgr.hpp"
#include "SolarSystem.hpp" #include "SolarSystem.hpp"
#include "MeteorMgr.hpp" #include "MeteorMgr.hpp"
#include "ConstellationMgr.hpp" #include "ConstellationMgr.hpp"
#include "StarMgr.hpp" #include "StarMgr.hpp"
#include "NebulaMgr.hpp" #include "NebulaMgr.hpp"
#include "GridLinesMgr.hpp" #include "GridLinesMgr.hpp"
#include "MilkyWay.hpp" #include "MilkyWay.hpp"
#include "ZodiacalLight.hpp" #include "ZodiacalLight.hpp"
#ifndef DISABLE_SCRIPTING #ifndef DISABLE_SCRIPTING
#include "StelScriptMgr.hpp" #include "StelScriptMgr.hpp"
skipping to change at line 68 skipping to change at line 69
#include "SkyGui.hpp" #include "SkyGui.hpp"
#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>
#include <QDesktopWidget>
ConfigurationDialog::ConfigurationDialog(StelGui* agui, QObject* parent) ConfigurationDialog::ConfigurationDialog(StelGui* agui, QObject* parent)
: StelDialog(parent) : StelDialog(parent)
, nextStarCatalogToDownloadIndex(0) , nextStarCatalogToDownloadIndex(0)
, starCatalogsCount(0) , starCatalogsCount(0)
, starCatalogDownloadReply(NULL) , starCatalogDownloadReply(NULL)
, currentDownloadFile(NULL) , currentDownloadFile(NULL)
, progressBar(NULL) , progressBar(NULL)
, gui(agui) , gui(agui)
{ {
skipping to change at line 108 skipping to change at line 110
customDeltaTEquationDialog = NULL; customDeltaTEquationDialog = NULL;
} }
void ConfigurationDialog::retranslate() void ConfigurationDialog::retranslate()
{ {
if (dialog) { if (dialog) {
ui->retranslateUi(dialog); ui->retranslateUi(dialog);
//Hack to shrink the tabs to optimal size after language cha nge //Hack to shrink the tabs to optimal size after language cha nge
//by causing the list items to be laid out again. //by causing the list items to be laid out again.
ui->stackListWidget->setWrapping(false);
updateTabBarListWidgetWidth(); updateTabBarListWidgetWidth();
//Initial FOV and direction on the "Main" page //Initial FOV and direction on the "Main" page
updateConfigLabels(); updateConfigLabels();
//Star catalog download button and info //Star catalog download button and info
updateStarCatalogControlsText(); updateStarCatalogControlsText();
//Script information //Script information
//(trigger re-displaying the description of the current item ) //(trigger re-displaying the description of the current item )
skipping to change at line 169 skipping to change at line 170
connect(cb, SIGNAL(currentIndexChanged(const QString&)), this, SLOT( selectLanguage(const QString&))); connect(cb, SIGNAL(currentIndexChanged(const QString&)), this, SLOT( selectLanguage(const QString&)));
// Do the same for sky language: // Do the same for sky language:
cb = ui->skycultureLanguageComboBox; cb = ui->skycultureLanguageComboBox;
cb->clear(); cb->clear();
cb->addItems(StelTranslator::globalTranslator->getAvailableLanguages NamesNative(StelFileMgr::getLocaleDir())); cb->addItems(StelTranslator::globalTranslator->getAvailableLanguages NamesNative(StelFileMgr::getLocaleDir()));
cb->model()->sort(0); cb->model()->sort(0);
updateCurrentSkyLanguage(); updateCurrentSkyLanguage();
connect(cb->lineEdit(), SIGNAL(editingFinished()), this, SLOT(update CurrentSkyLanguage())); connect(cb->lineEdit(), SIGNAL(editingFinished()), this, SLOT(update CurrentSkyLanguage()));
connect(cb, SIGNAL(currentIndexChanged(const QString&)), this, SLOT( selectSkyLanguage(const QString&))); connect(cb, SIGNAL(currentIndexChanged(const QString&)), this, SLOT( selectSkyLanguage(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();
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
//Kinetic scrolling for tablet pc and pc //Kinetic scrolling for tablet pc and pc
QList<QWidget *> addscroll; QList<QWidget *> addscroll;
addscroll << ui->pluginsListWidget << ui->scriptListWidget; addscroll << ui->pluginsListWidget << ui->scriptListWidget;
installKineticScrolling(addscroll); installKineticScrolling(addscroll);
skipping to change at line 266 skipping to change at line 264
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->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->decimalDegreeCheckBox->setChecked(gui->getFlagShowDecimalDegrees ()); ui->decimalDegreeCheckBox->setChecked(StelApp::getInstance().getFlag ShowDecimalDegrees());
connect(ui->decimalDegreeCheckBox, SIGNAL(toggled(bool)), gui, SLOT( setFlagShowDecimalDegrees(bool))); connect(ui->decimalDegreeCheckBox, SIGNAL(toggled(bool)), gui, SLOT( setFlagShowDecimalDegrees(bool)));
ui->mouseTimeoutCheckbox->setChecked(StelMainView::getInstance().get FlagCursorTimeout()); ui->mouseTimeoutCheckbox->setChecked(StelMainView::getInstance().get FlagCursorTimeout());
ui->mouseTimeoutSpinBox->setValue(StelMainView::getInstance().getCur sorTimeout()); ui->mouseTimeoutSpinBox->setValue(StelMainView::getInstance().getCur 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()));
skipping to change at line 317 skipping to change at line 315
connect(ui->pluginsListWidget, SIGNAL(currentItemChanged(QListWidget Item*, QListWidgetItem*)), this, SLOT(pluginsSelectionChanged(QListWidgetIt em*, QListWidgetItem*))); 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->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() void ConfigurationDialog::updateCurrentLanguage()
{ {
QComboBox* cb = ui->programLanguageComboBox; QComboBox* cb = ui->programLanguageComboBox;
QString appLang = StelApp::getInstance().getLocaleMgr().getAppLangua ge(); QString appLang = StelApp::getInstance().getLocaleMgr().getAppLangua ge();
QString l2 = StelTranslator::iso639_1CodeToNativeName(appLang); QString l2 = StelTranslator::iso639_1CodeToNativeName(appLang);
if (cb->currentText() == l2) if (cb->currentText() == l2)
return; return;
int lt = cb->findText(l2, Qt::MatchExactly); int lt = cb->findText(l2, Qt::MatchExactly);
skipping to change at line 576 skipping to change at line 569
conf->setValue("astro/milky_way_intensity", GETSTELMODULE(MilkyWay)- >getIntensity()); conf->setValue("astro/milky_way_intensity", GETSTELMODULE(MilkyWay)- >getIntensity());
conf->setValue("astro/zodiacal_light_intensity", GETSTELMODULE(Zodia calLight)->getIntensity()); conf->setValue("astro/zodiacal_light_intensity", GETSTELMODULE(Zodia calLight)->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());
conf->setValue("viewing/flag_longitude_line", glmgr->getFlagLongitud eLine());
conf->setValue("viewing/flag_horizon_line", glmgr->getFlagHorizonLin e()); conf->setValue("viewing/flag_horizon_line", glmgr->getFlagHorizonLin e());
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_equator_line", glmgr->getFlagG alacticEquatorLine()); conf->setValue("viewing/flag_galactic_equator_line", glmgr->getFlagG alacticEquatorLine());
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_light_pollution_database", lmgr->getFla gUseLightPollutionFromDatabase());
conf->setValue("viewing/flag_atmosphere_auto_enable", lmgr->getFlagA tmosphereAutoEnable()); conf->setValue("viewing/flag_atmosphere_auto_enable", lmgr->getFlagA tmosphereAutoEnable());
conf->setValue("viewing/flag_planets_native_names", ssmgr->getFlagNa tiveNames()); conf->setValue("viewing/flag_planets_native_names", ssmgr->getFlagNa tiveNames());
conf->setValue("viewing/constellation_art_intensity", cmgr->getArtIn tensity()); conf->setValue("viewing/constellation_art_intensity", cmgr->getArtIn tensity());
conf->setValue("viewing/constellation_name_style", cmgr->getConstell ationDisplayStyleString()); conf->setValue("viewing/constellation_name_style", cmgr->getConstell ationDisplayStyleString());
conf->setValue("viewing/constellation_line_thickness", cmgr->getCons tellationLineThickness());
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("astro/flag_nebula_display_no_texture", !GETSTELMODUL E(StelSkyLayerMgr)->getFlagShow());
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->getFlagLandscapeSe tsMinimalBrightness()); conf->setValue("landscape/flag_brightness", lmgr->getFlagLandscapeSe tsMinimalBrightness());
conf->setValue("landscape/flag_fog", lmgr->getFlagFog()); conf->setValue("landscape/flag_fog", lmgr->getFlagFog());
conf->setValue("landscape/flag_enable_illumination_layer", lmgr->get FlagIllumination()); conf->setValue("landscape/flag_enable_illumination_layer", lmgr->get FlagIllumination());
skipping to change at line 676 skipping to change at line 672
(bool) (flags & StelObject::ObjectType)); (bool) (flags & StelObject::ObjectType));
conf->setValue("flag_show_eclcoord", conf->setValue("flag_show_eclcoord",
(bool) (flags & StelObject::EclipticCoord)); (bool) (flags & StelObject::EclipticCoord));
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());
conf->setValue("gui/flag_show_decimal_degrees", gui->getFlagShowDeci malDegrees()); conf->setValue("gui/flag_show_decimal_degrees", StelApp::getInstance ().getFlagShowDecimalDegrees());
mvmgr->setInitFov(mvmgr->getCurrentFov()); mvmgr->setInitFov(mvmgr->getCurrentFov());
mvmgr->setInitViewDirectionToCurrent(); mvmgr->setInitViewDirectionToCurrent();
// configuration dialog / navigation tab // configuration dialog / navigation tab
conf->setValue("navigation/flag_enable_zoom_keys", mvmgr->getFlagEna bleZoomKeys()); conf->setValue("navigation/flag_enable_zoom_keys", mvmgr->getFlagEna bleZoomKeys());
conf->setValue("navigation/flag_enable_mouse_navigation", mvmgr->get FlagEnableMouseNavigation()); conf->setValue("navigation/flag_enable_mouse_navigation", mvmgr->get FlagEnableMouseNavigation());
conf->setValue("navigation/flag_enable_move_keys", mvmgr->getFlagEna bleMoveKeys()); conf->setValue("navigation/flag_enable_move_keys", mvmgr->getFlagEna bleMoveKeys());
conf->setValue("navigation/startup_time_mode", core->getStartupTimeM ode()); conf->setValue("navigation/startup_time_mode", core->getStartupTimeM ode());
conf->setValue("navigation/today_time", core->getInitTodayTime()); conf->setValue("navigation/today_time", core->getInitTodayTime());
skipping to change at line 707 skipping to change at line 703
conf->setValue("video/viewport_effect", StelApp::getInstance().getVi ewportEffect()); conf->setValue("video/viewport_effect", StelApp::getInstance().getVi ewportEffect());
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("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", StelMainView::getIns tance().getFlagCursorTimeout()); conf->setValue("gui/flag_mouse_cursor_timeout", StelMainView::getIns tance().getFlagCursorTimeout());
conf->setValue("gui/mouse_cursor_timeout", StelMainView::getInstance ().getCursorTimeout()); conf->setValue("gui/mouse_cursor_timeout", StelMainView::getInstance ().getCursorTimeout());
conf->setValue("main/screenshot_dir", StelFileMgr::getScreenshotDir( )); conf->setValue("main/screenshot_dir", StelFileMgr::getScreenshotDir( ));
conf->setValue("main/invert_screenshots_colors", StelMainView::getIn stance().getFlagInvertScreenShotColors()); conf->setValue("main/invert_screenshots_colors", StelMainView::getIn stance().getFlagInvertScreenShotColors());
int screenNum = qApp->desktop()->screenNumber(&StelMainView::getInst
ance());
conf->setValue("video/screen_number", screenNum);
// full screen and window size // full screen and window size
conf->setValue("video/fullscreen", StelMainView::getInstance().isFul lScreen()); conf->setValue("video/fullscreen", StelMainView::getInstance().isFul lScreen());
if (!StelMainView::getInstance().isFullScreen()) if (!StelMainView::getInstance().isFullScreen())
{ {
QRect screenGeom = QApplication::desktop()->screenGeometry(s creenNum);
QWidget& mainWindow = StelMainView::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() - screenGeom
conf->setValue("video/screen_y", mainWindow.y()); .x());
conf->setValue("video/screen_y", mainWindow.y() - screenGeom
.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();
} }
void ConfigurationDialog::updateConfigLabels() void ConfigurationDialog::updateConfigLabels()
{ {
skipping to change at line 1169 skipping to change at line 1169
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->checkBoxExtra->setChecked(flags & StelObject::Extra); ui->checkBoxExtra->setChecked(flags & StelObject::Extra);
ui->checkBoxGalacticCoordinates->setChecked(flags & StelObject::Gala cticCoord); ui->checkBoxGalacticCoordinates->setChecked(flags & StelObject::Gala cticCoord);
ui->checkBoxType->setChecked(flags & StelObject::ObjectType); ui->checkBoxType->setChecked(flags & StelObject::ObjectType);
ui->checkBoxEclipticCoords->setChecked(flags & StelObject::EclipticC oord); ui->checkBoxEclipticCoords->setChecked(flags & StelObject::EclipticC oord);
} }
void ConfigurationDialog::updateTabBarListWidgetWidth() void ConfigurationDialog::updateTabBarListWidgetWidth()
{ {
ui->stackListWidget->setWrapping(false);
// Update list item sizes after translation
ui->stackListWidget->adjustSize();
QAbstractItemModel* model = ui->stackListWidget->model(); QAbstractItemModel* model = ui->stackListWidget->model();
if (!model) if (!model)
{
return; return;
}
// Update list item sizes after translation // stackListWidget->font() does not work properly!
ui->stackListWidget->adjustSize(); // It has a incorrect fontSize in the first loading, which produces
the bug#995107.
QFont font;
font.setPixelSize(14);
font.setWeight(75);
QFontMetrics fontMetrics(font);
int iconSize = ui->stackListWidget->iconSize().width();
int width = 0; int width = 0;
for (int row = 0; row < model->rowCount(); row++) for (int row = 0; row < model->rowCount(); row++)
{ {
QModelIndex index = model->index(row, 0); int textWidth = fontMetrics.width(ui->stackListWidget->item(
width += ui->stackListWidget->sizeHintForIndex(index).width( row)->text());
); width += iconSize > textWidth ? iconSize : textWidth; // use
the wider one
width += 24; // margin - 12px left and 12px right
} }
// TODO: Limit the width to the width of the screen *available to th
e window*
// FIXME: This works only sometimes...
/*if (width <= ui->stackListWidget->width())
{
//qDebug() << width << ui->stackListWidget->width();
return;
}*/
// Hack to force the window to be resized... // Hack to force the window to be resized...
ui->stackListWidget->setMinimumWidth(width); ui->stackListWidget->setMinimumWidth(width);
// FIXME: This works only sometimes...
/*
dialog->adjustSize();
dialog->update();
// ... and allow manual resize later.
ui->stackListWidget->setMinimumWidth(0);
*/
} }
void ConfigurationDialog::populateDeltaTAlgorithmsList() void ConfigurationDialog::populateDeltaTAlgorithmsList()
{ {
Q_ASSERT(ui->deltaTAlgorithmComboBox); Q_ASSERT(ui->deltaTAlgorithmComboBox);
// TRANSLATORS: Full phrase is "Algorithm of DeltaT" // TRANSLATORS: Full phrase is "Algorithm of DeltaT"
ui->deltaTLabel->setText(QString("%1 %2T:").arg(q_("Algorithm of")). arg(QChar(0x0394))); ui->deltaTLabel->setText(QString("%1 %2T:").arg(q_("Algorithm of")). arg(QChar(0x0394)));
QComboBox* algorithms = ui->deltaTAlgorithmComboBox; QComboBox* algorithms = ui->deltaTAlgorithmComboBox;
skipping to change at line 1249 skipping to change at line 1247
algorithms->addItem(q_("JPL Horizons"), "JPLHorizons"); algorithms->addItem(q_("JPL Horizons"), "JPLHorizons");
algorithms->addItem(q_("Meeus & Simons (2000)"), "MeeusSimons"); algorithms->addItem(q_("Meeus & Simons (2000)"), "MeeusSimons");
algorithms->addItem(q_("Montenbruck & Pfleger (2000)"), "Montenbruck Pfleger"); algorithms->addItem(q_("Montenbruck & Pfleger (2000)"), "Montenbruck Pfleger");
algorithms->addItem(q_("Reingold & Dershowitz (2002, 2007)"), "Reing oldDershowitz"); algorithms->addItem(q_("Reingold & Dershowitz (2002, 2007)"), "Reing oldDershowitz");
algorithms->addItem(q_("Morrison & Stephenson (2004, 2005)"), "Morri sonStephenson2004"); algorithms->addItem(q_("Morrison & Stephenson (2004, 2005)"), "Morri sonStephenson2004");
// Espenak & Meeus (2006) used by default // Espenak & Meeus (2006) used by default
algorithms->addItem(q_("Espenak & Meeus (2006)").append(" *"), "Espe nakMeeus"); algorithms->addItem(q_("Espenak & Meeus (2006)").append(" *"), "Espe nakMeeus");
algorithms->addItem(q_("Reijs (2006)"), "Reijs"); algorithms->addItem(q_("Reijs (2006)"), "Reijs");
algorithms->addItem(q_("Banjevic (2006)"), "Banjevic"); algorithms->addItem(q_("Banjevic (2006)"), "Banjevic");
algorithms->addItem(q_("Islam, Sadiq & Qureshi (2008, 2013)"), "Isla mSadiqQureshi"); algorithms->addItem(q_("Islam, Sadiq & Qureshi (2008, 2013)"), "Isla mSadiqQureshi");
algorithms->addItem(q_("Khalid, Sultana & Zaidi (2014)"), "KhalidSul tanaZaidi");
algorithms->addItem(q_("Custom equation of %1T").arg(QChar(0x0394)), "Custom"); algorithms->addItem(q_("Custom equation of %1T").arg(QChar(0x0394)), "Custom");
//Restore the selection //Restore the selection
index = algorithms->findData(selectedAlgorithmId, Qt::UserRole, Qt:: MatchCaseSensitive); index = algorithms->findData(selectedAlgorithmId, Qt::UserRole, Qt:: MatchCaseSensitive);
algorithms->setCurrentIndex(index); algorithms->setCurrentIndex(index);
//algorithms->model()->sort(0); //algorithms->model()->sort(0);
algorithms->blockSignals(false); algorithms->blockSignals(false);
setDeltaTAlgorithmDescription(); setDeltaTAlgorithmDescription();
} }
 End of changes. 21 change blocks. 
38 lines changed or deleted 38 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/