ViewDialog.cpp   ViewDialog.cpp 
skipping to change at line 85 skipping to change at line 85
{ {
if (dialog) if (dialog)
{ {
ui->retranslateUi(dialog); ui->retranslateUi(dialog);
updateZhrDescription(); updateZhrDescription();
populateLists(); populateLists();
populateLightPollution(); populateLightPollution();
//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();
} }
} }
void ViewDialog::styleChanged() void ViewDialog::styleChanged()
{ {
if (dialog) if (dialog)
{ {
populateLists(); populateLists();
} }
} }
skipping to change at line 271 skipping to change at line 271
ui->useAsDefaultLandscapeCheckBox->setEnabled(lmgr->getCurrentLandsc apeID()!=lmgr->getDefaultLandscapeID()); ui->useAsDefaultLandscapeCheckBox->setEnabled(lmgr->getCurrentLandsc apeID()!=lmgr->getDefaultLandscapeID());
connect(ui->useAsDefaultLandscapeCheckBox, SIGNAL(clicked()), this, SLOT(setCurrentLandscapeAsDefault())); connect(ui->useAsDefaultLandscapeCheckBox, SIGNAL(clicked()), this, SLOT(setCurrentLandscapeAsDefault()));
connect(GETSTELMODULE(LandscapeMgr), SIGNAL(landscapesChanged()), th is, SLOT(populateLists())); connect(GETSTELMODULE(LandscapeMgr), SIGNAL(landscapesChanged()), th is, SLOT(populateLists()));
connect(ui->pushButtonAddRemoveLandscapes, SIGNAL(clicked()), this, SLOT(showAddRemoveLandscapesDialog())); connect(ui->pushButtonAddRemoveLandscapes, SIGNAL(clicked()), this, SLOT(showAddRemoveLandscapesDialog()));
// Grid and lines // Grid and lines
connectCheckBox(ui->showEquatorLineCheckBox, "actionShow_Equator_Lin e"); connectCheckBox(ui->showEquatorLineCheckBox, "actionShow_Equator_Lin e");
connectCheckBox(ui->showEclipticLineCheckBox, "actionShow_Ecliptic_L ine"); connectCheckBox(ui->showEclipticLineCheckBox, "actionShow_Ecliptic_L ine");
connectCheckBox(ui->showMeridianLineCheckBox, "actionShow_Meridian_L ine"); connectCheckBox(ui->showMeridianLineCheckBox, "actionShow_Meridian_L ine");
connectCheckBox(ui->showLongitudeLineCheckBox, "actionShow_Longitude _Line");
connectCheckBox(ui->showHorizonLineCheckBox, "actionShow_Horizon_Lin e"); connectCheckBox(ui->showHorizonLineCheckBox, "actionShow_Horizon_Lin e");
connectCheckBox(ui->showEquatorialGridCheckBox, "actionShow_Equatori al_Grid"); connectCheckBox(ui->showEquatorialGridCheckBox, "actionShow_Equatori al_Grid");
connectCheckBox(ui->showGalacticGridCheckBox, "actionShow_Galactic_G rid"); connectCheckBox(ui->showGalacticGridCheckBox, "actionShow_Galactic_G rid");
connectCheckBox(ui->showGalacticEquatorLineCheckBox, "actionShow_Gal actic_Equator_Line"); connectCheckBox(ui->showGalacticEquatorLineCheckBox, "actionShow_Gal actic_Equator_Line");
connectCheckBox(ui->showAzimuthalGridCheckBox, "actionShow_Azimuthal _Grid"); connectCheckBox(ui->showAzimuthalGridCheckBox, "actionShow_Azimuthal _Grid");
connectCheckBox(ui->showEquatorialJ2000GridCheckBox, "actionShow_Equ atorial_J2000_Grid"); connectCheckBox(ui->showEquatorialJ2000GridCheckBox, "actionShow_Equ atorial_J2000_Grid");
connectCheckBox(ui->showEclipticGridJ2000CheckBox, "actionShow_Eclip tic_J2000_Grid"); connectCheckBox(ui->showEclipticGridJ2000CheckBox, "actionShow_Eclip tic_J2000_Grid");
connectCheckBox(ui->showCardinalPointsCheckBox, "actionShow_Cardinal _Points"); connectCheckBox(ui->showCardinalPointsCheckBox, "actionShow_Cardinal _Points");
// Constellations // Constellations
ConstellationMgr* cmgr = GETSTELMODULE(ConstellationMgr); ConstellationMgr* cmgr = GETSTELMODULE(ConstellationMgr);
connectCheckBox(ui->showConstellationLinesCheckBox, "actionShow_Cons tellation_Lines"); connectCheckBox(ui->showConstellationLinesCheckBox, "actionShow_Cons tellation_Lines");
connectCheckBox(ui->showConstellationLabelsCheckBox, "actionShow_Con stellation_Labels"); connectCheckBox(ui->showConstellationLabelsCheckBox, "actionShow_Con stellation_Labels");
connectCheckBox(ui->showConstellationBoundariesCheckBox, "actionShow _Constellation_Boundaries"); connectCheckBox(ui->showConstellationBoundariesCheckBox, "actionShow _Constellation_Boundaries");
connectCheckBox(ui->showConstellationArtCheckBox, "actionShow_Conste llation_Art"); connectCheckBox(ui->showConstellationArtCheckBox, "actionShow_Conste llation_Art");
ui->constellationArtBrightnessSpinBox->setValue(cmgr->getArtIntensit y()); ui->constellationArtBrightnessSpinBox->setValue(cmgr->getArtIntensit y());
connect(ui->constellationArtBrightnessSpinBox, SIGNAL(valueChanged(d ouble)), cmgr, SLOT(setArtIntensity(double))); connect(ui->constellationArtBrightnessSpinBox, SIGNAL(valueChanged(d ouble)), cmgr, SLOT(setArtIntensity(double)));
ui->constellationLineThicknessSpinBox->setValue(cmgr->getConstellati
onLineThickness());
connect(ui->constellationLineThicknessSpinBox, SIGNAL(valueChanged(d
ouble)), cmgr, SLOT(setConstellationLineThickness(double)));
// Starlore // Starlore
connect(ui->useAsDefaultSkyCultureCheckBox, SIGNAL(clicked()), this, SLOT(setCurrentCultureAsDefault())); connect(ui->useAsDefaultSkyCultureCheckBox, SIGNAL(clicked()), this, SLOT(setCurrentCultureAsDefault()));
const bool b = StelApp::getInstance().getSkyCultureMgr().getCurrentS kyCultureID()==StelApp::getInstance().getSkyCultureMgr().getDefaultSkyCultu reID(); const bool b = StelApp::getInstance().getSkyCultureMgr().getCurrentS kyCultureID()==StelApp::getInstance().getSkyCultureMgr().getDefaultSkyCultu reID();
ui->useAsDefaultSkyCultureCheckBox->setChecked(b); ui->useAsDefaultSkyCultureCheckBox->setChecked(b);
ui->useAsDefaultSkyCultureCheckBox->setEnabled(!b); ui->useAsDefaultSkyCultureCheckBox->setEnabled(!b);
connect(ui->nativeNameCheckBox, SIGNAL(clicked(bool)), ssmgr, SLOT(s etFlagNativeNames(bool))); connect(ui->nativeNameCheckBox, SIGNAL(clicked(bool)), ssmgr, SLOT(s etFlagNativeNames(bool)));
ui->nativeNameCheckBox->setChecked(ssmgr->getFlagNativeNames()); ui->nativeNameCheckBox->setChecked(ssmgr->getFlagNativeNames());
// GZ NEW allow to display short names and inhibit translation. // GZ NEW allow to display short names and inhibit translation.
connect(ui->skyCultureNamesStyleComboBox, SIGNAL(currentIndexChanged (int)), cmgr, SLOT(setConstellationDisplayStyle(int))); connect(ui->skyCultureNamesStyleComboBox, SIGNAL(currentIndexChanged (int)), cmgr, SLOT(setConstellationDisplayStyle(int)));
skipping to change at line 309 skipping to change at line 312
// Sky layers. This not yet finished and not visible in releases. // Sky layers. This not yet finished and not visible in releases.
populateSkyLayersList(); populateSkyLayersList();
connect(this, SIGNAL(visibleChanged(bool)), this, SLOT(populateSkyLa yersList())); connect(this, SIGNAL(visibleChanged(bool)), this, SLOT(populateSkyLa yersList()));
connect(ui->skyLayerListWidget, SIGNAL(currentTextChanged(const QStr ing&)), this, SLOT(skyLayersSelectionChanged(const QString&))); connect(ui->skyLayerListWidget, SIGNAL(currentTextChanged(const QStr ing&)), this, SLOT(skyLayersSelectionChanged(const QString&)));
connect(ui->stackListWidget, SIGNAL(currentItemChanged(QListWidgetIt em *, QListWidgetItem *)), this, SLOT(changePage(QListWidgetItem *, QListWi dgetItem*))); connect(ui->stackListWidget, SIGNAL(currentItemChanged(QListWidgetIt em *, QListWidgetItem *)), this, SLOT(changePage(QListWidgetItem *, QListWi dgetItem*)));
connect(ui->skyLayerEnableCheckBox, SIGNAL(stateChanged(int)), this, SLOT(skyLayersEnabledChanged(int))); connect(ui->skyLayerEnableCheckBox, SIGNAL(stateChanged(int)), this, SLOT(skyLayersEnabledChanged(int)));
QTimer* refreshTimer = new QTimer(this); QTimer* refreshTimer = new QTimer(this);
connect(refreshTimer, SIGNAL(timeout()), this, SLOT(updateFromProgra m())); connect(refreshTimer, SIGNAL(timeout()), this, SLOT(updateFromProgra m()));
refreshTimer->start(200); refreshTimer->start(200);
updateTabBarListWidgetWidth();
}
void ViewDialog::updateTabBarListWidgetWidth()
{
ui->stackListWidget->setWrapping(false);
// Update list item sizes after translation
ui->stackListWidget->adjustSize();
QAbstractItemModel* model = ui->stackListWidget->model();
if (!model)
{
return;
}
// stackListWidget->font() does not work properly!
// 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;
for (int row = 0; row < model->rowCount(); row++)
{
int textWidth = fontMetrics.width(ui->stackListWidget->item(
row)->text());
width += iconSize > textWidth ? iconSize : textWidth; // use
the wider one
width += 24; // margin - 12px left and 12px right
}
// Hack to force the window to be resized...
ui->stackListWidget->setMinimumWidth(width);
} }
void ViewDialog::setFlagLandscapeUseMinimalBrightness(bool b) void ViewDialog::setFlagLandscapeUseMinimalBrightness(bool b)
{ {
LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr); LandscapeMgr* lmgr = GETSTELMODULE(LandscapeMgr);
lmgr->setFlagLandscapeUseMinimalBrightness(b); lmgr->setFlagLandscapeUseMinimalBrightness(b);
populateLandscapeMinimalBrightness(); populateLandscapeMinimalBrightness();
} }
void ViewDialog::populateLandscapeMinimalBrightness() void ViewDialog::populateLandscapeMinimalBrightness()
 End of changes. 4 change blocks. 
1 lines changed or deleted 45 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/