Commit 8226e760 authored by Torsten Rahn's avatar Torsten Rahn
Browse files

	- Correct legend terms (deeply sorry for the translation team).
	  Added shipwreck category.


svn path=/trunk/KDE/kdeedu/marble/; revision=717447
parent 9f7a24f4
2007-09-26 Torsten Rahn <rahn@kde.org>
- Correct legend terms (deeply sorry for the translation team).
Added shipwreck category.
* src/lib/MarbleWidget.{h,cpp}:
* src/lib/PlaceMarkLayout.cpp:
* src/lib/XmlHandler.cpp:
* src/lib/PlaceMarkContainer.cpp:
* src/lib/MarbleLegendBrowser.{h,cpp}:
* src/lib/PlaceMarkManager.cpp:
* src/lib/ViewParams.h:
* src/lib/PlaceMarkInfoDialog.cpp:
* src/lib/MarbleControlBox.cpp:
* src/lib/PlaceMark.cpp:
* data/placemarks/baseplacemarks.cache:
* data/placemarks/elevplacemarks.cache:
* data/placemarks/otherplacemarks.kml:
* data/placemarks/otherplacemarks.cache:
* data/legend.html:
2007-09-26 Torsten Rahn <rahn@kde.org>
* src/lib/TextureColorizer.cpp:
* src/lib/texturepalette.cpp:
......
......@@ -19,7 +19,7 @@
string of your choice.
-->
<H4> <!--Locations checkbox--><a href="checkbox:cities"><span style="text-decoration: none"><img src="checkbox:cities">&nbsp;</span></a> Cities</H4>
<H4> <!--Locations checkbox--><a href="checkbox:cities"><span style="text-decoration: none"><img src="checkbox:cities">&nbsp;</span></a> Populated Places</H4>
<div>
<i>Population:</i>
</div>
......@@ -92,16 +92,16 @@
<i>Capitals:</i>
</div>
<div>
Red:&nbsp;state
Red:&nbsp;Nation
</div>
<div>
Orange:&nbsp;region
Orange:&nbsp;State
</div>
<div>
Yellow:&nbsp;province
Yellow:&nbsp;County
</div>
<div>
White:&nbsp;none
White:&nbsp;None
</div>
<H4> <!--Terrain checkbox--><a href="checkbox:terrain"><span style="text-decoration: none"><img src="checkbox:terrain">&nbsp;</span></a> Terrain</H4>
......@@ -124,14 +124,14 @@
</tr>
</table>
<H4> <!--Borders checkbox--><a href="checkbox:borders"><span style="text-decoration: none"><img src="checkbox:borders">&nbsp;</span></a> Borders</H4>
<H4> <!--Borders checkbox--><a href="checkbox:borders"><span style="text-decoration: none"><img src="checkbox:borders">&nbsp;</span></a> Boundaries</H4>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="24">
<img src="./bitmaps/border_1.png">
</td>
<td align="left" valign="top">
Country border
International
</td>
</tr>
<tr>
......@@ -139,7 +139,7 @@
<img src="./bitmaps/border_2.png">
</td>
<td align="left" valign="top">
State border
State
</td>
</tr>
</table>
......@@ -164,6 +164,34 @@
</tr>
</table>
<H4> <!--Other checkbox--><a href="checkbox:otherplaces"><span style="text-decoration: none"><img src="checkbox:otherplaces">&nbsp;</span></a> Places of Interest</H4>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="24">
<img src="./bitmaps/pole_1.png">
</td>
<td align="left" valign="top">
Geographic Pole
</td>
</tr>
<tr>
<td align="left" valign="top" width="24">
<img src="./bitmaps/pole_2.png">
</td>
<td align="left" valign="top">
Magnetic Pole
</td>
</tr>
<tr>
<td align="left" valign="top" width="24">
<img src="./bitmaps/shipwreck.png">
</td>
<td align="left" valign="top">
Shipwreck
</td>
</tr>
</table>
<H4> <!--Ice & Glaciers checkbox--><a href="checkbox:ice"><span style="text-decoration: none"><img src="checkbox:ice">&nbsp;</span></a> Ice &amp; Glaciers</H4>
<H4> <!--Relief checkbox--><a href="checkbox:relief"><span style="text-decoration: none"><img src="checkbox:relief">&nbsp;</span></a> Relief</H4>
......
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
<Document>
<SimpleField>
<name>pop</name>
<type>int</type>
</SimpleField>
<SimpleField>
<name>state</name>
<type>string</type>
</SimpleField>
<SimpleField>
<name>country</name>
<type>string</type>
</SimpleField>
<SimpleField>
<name>role</name>
<type>string</type>
</SimpleField>
<Placemark>
<name>RMS Titanic</name>
<description>British ocean liner that collided with an iceberg in 1912. At that time the RMS Titanic was on her maiden voyage from Southampton to New York. Of the 2,228 passengers and crew on board, only 705 did survive.</description>
<role>W</role>
<Point>
<coordinates>-49.947, 41.725,-3925</coordinates>
</Point>
</Placemark>
</Document>
</kml>
......@@ -230,6 +230,7 @@ void MarbleControlBox::addMarbleWidget(MarbleWidget *widget)
d->uiWidget.marbleLegendBrowser->setCheckedBorders( d->m_widget->showBorders() );
d->uiWidget.marbleLegendBrowser->setCheckedWaterBodies( d->m_widget->showLakes()
&& d->m_widget->showRivers() );
d->uiWidget.marbleLegendBrowser->setCheckedOtherPlaces( d->m_widget->showOtherPlaces() );
d->uiWidget.marbleLegendBrowser->setCheckedGrid( d->m_widget->showGrid() );
d->uiWidget.marbleLegendBrowser->setCheckedIceLayer( d->m_widget->showIceLayer() );
d->uiWidget.marbleLegendBrowser->setCheckedRelief( d->m_widget->showRelief() );
......@@ -272,6 +273,8 @@ void MarbleControlBox::addMarbleWidget(MarbleWidget *widget)
d->m_widget, SLOT( setShowRivers( bool ) ) );
connect( d->uiWidget.marbleLegendBrowser, SIGNAL( toggledWaterBodies( bool ) ),
d->m_widget, SLOT( setShowLakes( bool ) ) );
connect( d->uiWidget.marbleLegendBrowser, SIGNAL( toggledOtherPlaces( bool ) ),
d->m_widget, SLOT( setShowOtherPlaces( bool ) ) );
connect( d->uiWidget.marbleLegendBrowser, SIGNAL( toggledGrid( bool ) ),
d->m_widget, SLOT( setShowGrid( bool ) ) );
connect( d->uiWidget.marbleLegendBrowser, SIGNAL( toggledIceLayer( bool ) ),
......
......@@ -150,6 +150,9 @@ void MarbleLegendBrowser::sendSignals( const QString &name, bool checked )
if ( name == "waterbodies"){
emit toggledWaterBodies( checked );
}
if ( name == "otherplaces"){
emit toggledOtherPlaces( checked );
}
if ( name == "grid"){
emit toggledGrid( checked );
}
......@@ -197,6 +200,11 @@ void MarbleLegendBrowser::setCheckedWaterBodies( bool checked )
d->m_checkBoxMap[ "waterbodies" ] = checked;
}
void MarbleLegendBrowser::setCheckedOtherPlaces( bool checked )
{
d->m_checkBoxMap[ "otherplaces" ] = checked;
}
void MarbleLegendBrowser::setCheckedIceLayer( bool checked )
{
d->m_checkBoxMap[ "ice" ] = checked;
......
......@@ -40,6 +40,7 @@ class MARBLE_EXPORT MarbleLegendBrowser : public QTextBrowser
void setCheckedBorders( bool checked );
void setCheckedWaterBodies( bool checked );
void setCheckedIceLayer( bool checked );
void setCheckedOtherPlaces( bool checked );
void setCheckedGrid( bool checked );
void setCheckedRelief( bool checked );
void setCheckedCompass( bool checked );
......@@ -51,6 +52,7 @@ class MARBLE_EXPORT MarbleLegendBrowser : public QTextBrowser
void toggledTerrain( bool );
void toggledBorders( bool );
void toggledWaterBodies( bool );
void toggledOtherPlaces( bool );
void toggledIceLayer( bool );
void toggledGrid( bool );
void toggledRelief( bool );
......
......@@ -322,6 +322,11 @@ bool MarbleWidget::showTerrain() const
return d->m_viewParams.m_showTerrain;
}
bool MarbleWidget::showOtherPlaces() const
{
return d->m_viewParams.m_showOtherPlaces;
}
bool MarbleWidget::showRelief() const
{
return d->m_viewParams.m_showRelief;
......@@ -1054,6 +1059,12 @@ void MarbleWidget::setShowTerrain( bool visible )
repaint();
}
void MarbleWidget::setShowOtherPlaces( bool visible )
{
d->m_viewParams.m_showOtherPlaces = visible;
repaint();
}
void MarbleWidget::setShowRelief( bool visible )
{
d->m_viewParams.m_showRelief = visible;
......
......@@ -112,6 +112,7 @@ class MARBLE_EXPORT MarbleWidget : public QWidget
Q_PROPERTY(bool showPlaces READ showPlaces WRITE setShowPlaces)
Q_PROPERTY(bool showCities READ showCities WRITE setShowCities)
Q_PROPERTY(bool showTerrain READ showTerrain WRITE setShowTerrain)
Q_PROPERTY(bool showOtherPlaces READ showOtherPlaces WRITE setShowOtherPlaces)
Q_PROPERTY(bool showRelief READ showRelief WRITE setShowRelief)
Q_PROPERTY(bool showElevationModel READ showElevationModel WRITE setShowElevationModel)
......@@ -312,6 +313,12 @@ class MARBLE_EXPORT MarbleWidget : public QWidget
*/
bool showTerrain() const;
/**
* @brief Return whether other places are visible.
* @return The visibility of other places.
*/
bool showOtherPlaces() const;
/**
* @brief Return whether the relief is visible.
* @return The relief visibility.
......@@ -595,6 +602,12 @@ class MARBLE_EXPORT MarbleWidget : public QWidget
*/
void setShowTerrain( bool visible );
/**
* @brief Set whether the other places overlay is visible
* @param visible visibility of other places
*/
void setShowOtherPlaces( bool visible );
/**
* @brief Set whether the relief is visible
* @param visible visibility of the relief
......
......@@ -100,7 +100,7 @@ void PlaceMark::setPopularity( int popularity )
const QSize PlaceMark::symbolSize() const
{
static QSize placeSize[ 22 ] = {
static QSize placeSize[ 23 ] = {
QSize( 5, 5 ),
QSize( 5, 5 ),
QSize( 5, 5 ),
......@@ -121,11 +121,12 @@ const QSize PlaceMark::symbolSize() const
QSize( 8, 8 ),
QSize( 8, 8 ),
QSize( 5, 5 ),
QSize( 6, 6 ),
QSize( 8, 8 ),
QSize( 8, 8 ),
QSize( 5, 5 ),
QSize( 6, 6 ),
QSize( 12, 12 ),
QSize( 12, 12 ),
QSize( 7, 7 )
};
......@@ -136,7 +137,7 @@ const QSize PlaceMark::symbolSize() const
const QPixmap PlaceMark::symbolPixmap() const
{
static QPixmap placeSymbol[ 22 ] = {
static QPixmap placeSymbol[ 23 ] = {
QPixmap( MarbleDirs::path( "bitmaps/city_4_white.png" ) ),
QPixmap( MarbleDirs::path( "bitmaps/city_4_yellow.png" ) ),
QPixmap( MarbleDirs::path( "bitmaps/city_4_orange.png" ) ),
......@@ -157,11 +158,12 @@ const QPixmap PlaceMark::symbolPixmap() const
QPixmap( MarbleDirs::path( "bitmaps/city_1_orange.png" ) ),
QPixmap( MarbleDirs::path( "bitmaps/city_1_red.png" ) ),
QPixmap( MarbleDirs::path( "bitmaps/pole_1.png" ) ),
QPixmap( MarbleDirs::path( "bitmaps/pole_2.png" ) ),
QPixmap( MarbleDirs::path( "bitmaps/mountain_1.png" ) ),
QPixmap( MarbleDirs::path( "bitmaps/volcano_1.png" ) ),
QPixmap( MarbleDirs::path( "bitmaps/pole_1.png" ) ),
QPixmap( MarbleDirs::path( "bitmaps/pole_2.png" ) ),
QPixmap( MarbleDirs::path( "bitmaps/shipwreck.png" ) ),
QPixmap( MarbleDirs::path( "bitmaps/airport.png" ) ),
QPixmap( MarbleDirs::path( "bitmaps/default_location.png" ) )
};
......
......@@ -27,7 +27,7 @@ inline bool populationLessThan( PlaceMark* mark1, PlaceMark* mark2 )
{
// If compared items do not differ in terms of being selected,
// compare them based on population numbers.
return (mark1->popularity() > mark2->popularity());
return ( abs( mark1->popularity() ) > abs( mark2->popularity() ) );
}
......
......@@ -79,10 +79,14 @@ void PlaceMarkInfoDialog::showContent()
case 'V':
rolestring = tr("Volcano");
break;
default:
case 'W':
rolestring = tr("Shipwreck");
break;
case 'N':
rolestring = tr("City");
break;
default:
rolestring = tr("Other Place");
}
role_val_lbl->setText( rolestring );
......@@ -99,7 +103,7 @@ void PlaceMarkInfoDialog::showContent()
const int popularity = m_index.data( PlaceMarkModel::PopularityRole ).toInt();
const QChar role = m_index.data( PlaceMarkModel::GeoTypeRole ).toChar();
if ( role == 'H' || role == 'V' ) {
if ( role == 'H' || role == 'V' || role == 'W') {
population_val_lbl->setVisible( false );
population_lbl->setVisible( false );
......
......@@ -57,7 +57,7 @@ PlaceMarkLayout::PlaceMarkLayout( QObject* parent )
// Old weightfilter array. Still here
// to be able to compare performance
/*
m_weightfilter
<< 9999
<< 4200
......@@ -78,7 +78,7 @@ PlaceMarkLayout::PlaceMarkLayout( QObject* parent )
<< 400
<< 200
<< 0;
/*
*/
m_weightfilter
<< 49300
<< 40300
......@@ -99,7 +99,7 @@ PlaceMarkLayout::PlaceMarkLayout( QObject* parent )
<< 800
<< 300
<< 0;
*/
m_placeMarkPainter = new PlaceMarkPainter( this );
}
......@@ -285,9 +285,14 @@ void PlaceMarkLayout::paintPlaceFolder(QPainter* painter,
// Skip terrain marks if we're not showing terrain.
if ( !viewParams->m_showTerrain
&& ( symbolIndex >= 16 && symbolIndex <= 20 ) )
&& ( symbolIndex >= 16 && symbolIndex <= 17 ) )
continue;
if ( !viewParams->m_showOtherPlaces
&& ( symbolIndex >= 18 && symbolIndex <= 21 ) )
continue;
const bool isSelected = selection.contains( index );
/**
......
......@@ -58,6 +58,7 @@ void PlaceMarkManager::loadStandardPlaceMarks()
addPlaceMarkFile( "cityplacemarks" );
addPlaceMarkFile( "baseplacemarks" );
addPlaceMarkFile( "elevplacemarks" );
addPlaceMarkFile( "otherplacemarks" );
}
void PlaceMarkManager::addPlaceMarkFile( const QString& filepath )
......
......@@ -84,6 +84,7 @@ class ViewParams
bool m_showCities; // About placemarks
bool m_showTerrain;
bool m_showOtherPlaces;
bool m_showGps; //for gps layer
......
......@@ -119,17 +119,18 @@ bool XmlHandler::endElement( const QString&, const QString&,
if ( m_inKml && nameLower == "placemark" ) {
if ( m_placemark->role() == 'P' ) m_placemark->setSymbolIndex(16);
else if ( m_placemark->role() == 'M' ) m_placemark->setSymbolIndex(17);
else if ( m_placemark->role() == 'H' ) m_placemark->setSymbolIndex(18);
else if ( m_placemark->role() == 'V' ) m_placemark->setSymbolIndex(19);
else if ( m_placemark->role() == 'F' ) m_placemark->setSymbolIndex(20);
if ( m_placemark->role() == 'H' ) m_placemark->setSymbolIndex(16);
else if ( m_placemark->role() == 'V' ) m_placemark->setSymbolIndex(17);
else if ( m_placemark->role() == 'P' ) m_placemark->setSymbolIndex(18);
else if ( m_placemark->role() == 'M' ) m_placemark->setSymbolIndex(19);
else if ( m_placemark->role() == 'W' ) m_placemark->setSymbolIndex(20);
else if ( m_placemark->role() == 'F' ) m_placemark->setSymbolIndex(21);
else if ( m_placemark->role() == 'N' ) m_placemark->setSymbolIndex( ( m_placemark->popularityIndex() -1 ) / 4 * 4 );
else if ( m_placemark->role() == 'R' ) m_placemark->setSymbolIndex( ( m_placemark->popularityIndex() -1 ) / 4 * 4 + 2);
else if ( m_placemark->role() == 'C' || m_placemark->role() == 'B' )
m_placemark->setSymbolIndex( ( m_placemark->popularityIndex() -1 ) / 4 * 4 + 3 );
else if ( m_placemark->role().isNull() && !m_hasPopulation )
m_placemark->setSymbolIndex(21);
m_placemark->setSymbolIndex(22);
if ( m_coordsset == true )
m_placeMarkContainer->append( m_placemark );
......@@ -221,5 +222,7 @@ int XmlHandler::popIdx( int population )
else if ( population < 2500000) popidx=13;
else if ( population < 5000000) popidx=14;
if ( m_placemark->role() == 'W' && popidx > 12 ) popidx = 12;
return popidx;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment