From kde-commits Tue Mar 31 22:33:53 2009 From: Torsten Rahn Date: Tue, 31 Mar 2009 22:33:53 +0000 To: kde-commits Subject: KDE/kdeedu/marble/src/lib [POSSIBLY UNSAFE] Message-Id: <1238538833.157994.3940.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=123853884403327 SVN commit 947627 by rahn: - Another patch by Harshit Jain: No population on Moon and Mars. Use diameter instead ... M +21 -4 PlacemarkInfoDialog.cpp [POSSIBLY UNSAFE: system] M +42 -53 PlacemarkInfoDialog.ui --- trunk/KDE/kdeedu/marble/src/lib/PlacemarkInfoDialog.cpp #947626:947627 @@ -50,7 +50,6 @@ QTextFrameFormat format = description_val_browser->document()->rootFrame()->frameFormat(); format.setMargin( 12) ; description_val_browser->document()->rootFrame()->setFrameFormat( format ); - } @@ -63,7 +62,6 @@ name_val_lbl->setText( "

" + m_index.data().toString() + "

" ); altername_val_lbl->setText( "" ); - QString rolestring; switch ( m_index.data( MarblePlacemarkModel::GeoTypeRole ).toChar().toLatin1() ) { case 'C': @@ -108,6 +106,18 @@ case 'A': rolestring = tr("Astronomical observatory"); break; + case 'a': + rolestring = tr("Maria"); + break; + case 'c': + rolestring = tr("Crater"); + break; + case 'h': + case 'r': + case 'u': + case 'i': + rolestring = tr("Landing Site"); + break; default: rolestring = tr("Other Place"); } @@ -117,6 +127,7 @@ m_flagcreator = new DeferredFlag( this ); requestFlag( m_index.data( MarblePlacemarkModel::CountryCodeRole ).toString() ); + const QString description = m_index.data( MarblePlacemarkModel::DescriptionRole ).toString(); description_val_browser->setEnabled( false ); @@ -132,7 +143,6 @@ const qreal area = m_index.data( MarblePlacemarkModel::AreaRole ).toDouble(); const qreal altitude = m_index.data( MarblePlacemarkModel::CoordinateRole ).value().altitude(); - area_lbl->setText( tr("Area:") ); if ( area < 10000000 ) area_val_lbl->setText( tr("%1 sq km").arg( QLocale::system().toString( area ) ) ); @@ -147,6 +157,7 @@ .arg( QLocale::system().toString( population / 1000000.0, 'g', 4 ) ) ); elevation_val_lbl->setText( tr("%1 m").arg( QLocale::system().toString( altitude ) ) ); + diameter_val_lbl->setText( tr("%1 km").arg( QLocale::system().toString( population / 1000.0, 'g', 4 ) ) ); const QChar role = m_index.data( MarblePlacemarkModel::GeoTypeRole ).toChar(); @@ -158,11 +169,13 @@ area_val_lbl->setVisible( true ); population_lbl->setVisible( true ); population_val_lbl->setVisible( true ); + diameter_lbl->setVisible( false ); + diameter_val_lbl->setVisible( false ); if ( altitude <= 0 ) elevation_val_lbl->setText( tr("-") ); - if ( role == 'O' ) { + if ( role == 'O' || role == 'o' || role == 'v' || role == 'h' || role == 'u' || role == 'i' || role == 'r' || role == 'a' || role == 'c' || role == 'm') { population_val_lbl->setVisible( false ); population_lbl->setVisible( false ); country_lbl->setVisible( false ); @@ -173,6 +186,10 @@ country_lbl->setVisible( false ); country_val_lbl->setVisible( false ); } + if ( (role == 'a' || role == 'c' || role == 'm') && m_index.data( MarblePlacemarkModel::PopularityRole ).toInt() > 0) { + diameter_lbl->setVisible( true ); + diameter_val_lbl->setVisible( true ); + } if ( role == 'H' || role == 'V' || role == 'W') { population_val_lbl->setVisible( false ); --- trunk/KDE/kdeedu/marble/src/lib/PlacemarkInfoDialog.ui #947626:947627 @@ -16,18 +16,9 @@ 6 - + 9 - - 9 - - - 9 - - - 9 - @@ -40,24 +31,12 @@ - + 0 - - 0 - - - 0 - - - 0 - - + 6 - - 6 - @@ -82,7 +61,7 @@ Qt::Vertical - + 20 16 @@ -168,7 +147,8 @@ Description field - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;">No description available.</p> @@ -185,7 +165,7 @@ QSizePolicy::Fixed - + 330 16 @@ -240,7 +220,7 @@ Qt::Horizontal - + 40 20 @@ -352,6 +332,29 @@ + + + + Diameter: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + Qt::TextSelectableByMouse + + + + + + + TextLabel + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + @@ -362,41 +365,24 @@ Wikipedia - :/icons/wikipedia.png + + :/icons/wikipedia.png:/icons/wikipedia.png 6 - + 9 - - 9 - - - 9 - - - 9 - 6 - + 0 - - 0 - - - 0 - - - 0 - @@ -412,7 +398,8 @@ Back - ../../../../../../../../.designer/backup + + ../../../../../../../../.designer/backup../../../../../../../../.designer/backup Qt::ToolButtonTextBesideIcon @@ -434,7 +421,8 @@ ... - ../../../../../../../../.designer/backup + + ../../../../../../../../.designer/backup../../../../../../../../.designer/backup @@ -444,7 +432,8 @@ Print Page - :/icons/document-print.png + + :/icons/document-print.png:/icons/document-print.png Qt::ToolButtonTextBesideIcon @@ -456,7 +445,7 @@ Qt::Horizontal - + 281 31