[Marble-commits] branches/KDE/4.3/kdeedu/marble/src/lib
Torsten Rahn
tackat at kde.org
Sun Jul 19 16:42:32 CEST 2009
SVN commit 999258 by rahn:
BUG: 200755 Fixed
- Fixing QObject::connect issue and cleaned up lots of issues in the PlacemarkInfoDialog class.
M +4 -2 MarblePlacemarkModel.cpp
M +20 -14 PlacemarkInfoDialog.cpp
M +17 -109 PlacemarkInfoDialog.ui
--- branches/KDE/4.3/kdeedu/marble/src/lib/MarblePlacemarkModel.cpp #999257:999258
@@ -408,9 +408,11 @@
if ( placemark.role() == 'K' )
placemark.setPopularityIndex( 19 );
if ( !placemark.isVisible() ) {
- placemark.setPopulation(-1);
+ placemark.setPopularityIndex( -1 );
}
- if ( placemark.population() < 0 ) {
+ // Workaround: Emulate missing "setVisible" serialization by allowing for population
+ // values smaller than -1 which are considered invisible.
+ if ( placemark.population() < -1 ) {
placemark.setPopularityIndex( -1 );
}
}
--- branches/KDE/4.3/kdeedu/marble/src/lib/PlacemarkInfoDialog.cpp #999257:999258
@@ -17,10 +17,6 @@
#include <QtCore/QFile>
#include <QtCore/QLocale>
#include <QtCore/QTimer>
-#include <QtGui/QPainter>
-#include <QtGui/QLabel>
-#include <QtGui/QTextBrowser>
-#include <QtGui/QTextFrame>
#include "GeoDataCoordinates.h"
#include "MarbleDirs.h"
@@ -33,23 +29,20 @@
{
setupUi(this);
+ setWindowTitle( tr("Marble Info Center - %1").arg( m_index.data().toString() ) );
+ resize( 780, 580 );
+
m_pBackButton->hide();
- m_pForwardButton->hide();
-
+
connect( m_pPrintButton, SIGNAL( clicked() ),
m_pWikipediaBrowser, SLOT( print() ) );
- // m_index.data( MarblePlacemarkModel::CoordinateRole ).value<GeoDataCoordinates>() hold the coordinate of current placemark
- setWindowTitle( tr("Marble Info Center - %1").arg( m_index.data().toString() ) );
-// The page to shown in placemark is emitted here ..
+
connect( m_pWikipediaBrowser, SIGNAL( statusMessage( QString ) ),
this, SLOT( showMessage( QString) ) );
connect( this, SIGNAL( source( QString ) ),
m_pWikipediaBrowser, SLOT( setSource( QString ) ) );//for wikipedia
+
showContent();
-
- QTextFrameFormat format = description_val_browser->document()->rootFrame()->frameFormat();
- format.setMargin( 12) ;
- description_val_browser->document()->rootFrame()->setFrameFormat( format );
}
@@ -177,12 +170,23 @@
if ( altitude <= 0 )
elevation_val_lbl->setText( tr("-") );
- if ( role == 'O' || role == 'o' || role == 'v' || role == 'h' || role == 'u' || role == 'i' || role == 'r' || role == 'a' || role == 'c' || role == 'm') {
+ 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 );
country_val_lbl->setVisible( false );
}
+
+ if ( role == 'A' ) {
+ population_val_lbl->setVisible( false );
+ population_lbl->setVisible( false );
+ country_lbl->setVisible( false );
+ country_val_lbl->setVisible( false );
+ elevation_val_lbl->setVisible( false );
+ elevation_lbl->setVisible( false );
+ }
+
if ( role == 'K' )
{
country_lbl->setVisible( false );
@@ -196,6 +200,8 @@
if ( role == 'H' || role == 'V' || role == 'W') {
population_val_lbl->setVisible( false );
population_lbl->setVisible( false );
+ area_val_lbl->setVisible( false );
+ area_lbl->setVisible( false );
}
else if ( role == 'P' || role == 'M' ) {
population_val_lbl->setVisible( false );
--- branches/KDE/4.3/kdeedu/marble/src/lib/PlacemarkInfoDialog.ui #999257:999258
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>537</width>
- <height>578</height>
+ <width>780</width>
+ <height>580</height>
</rect>
</property>
<property name="windowTitle">
@@ -457,7 +457,7 @@
<item>
<widget class="QToolButton" name="m_pBackButton">
<property name="enabled">
- <bool>false</bool>
+ <bool>true</bool>
</property>
<property name="toolTip">
<string>Back</string>
@@ -478,26 +478,6 @@
</widget>
</item>
<item>
- <widget class="QToolButton" name="m_pForwardButton">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="toolTip">
- <string>Forward</string>
- </property>
- <property name="whatsThis">
- <string>Move forward one step in the browsing history.</string>
- </property>
- <property name="text">
- <string>...</string>
- </property>
- <property name="icon">
- <iconset>
- <normaloff>../../../../../../../../.designer/backup</normaloff>../../../../../../../../.designer/backup</iconset>
- </property>
- </widget>
- </item>
- <item>
<widget class="QToolButton" name="m_pPrintButton">
<property name="text">
<string>Print Page</string>
@@ -527,7 +507,14 @@
</layout>
</item>
<item>
- <widget class="TinyWebBrowser" name="m_pWikipediaBrowser"/>
+ <widget class="TinyWebBrowser" name="m_pWikipediaBrowser" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
</item>
</layout>
</widget>
@@ -562,8 +549,9 @@
<customwidgets>
<customwidget>
<class>TinyWebBrowser</class>
- <extends>QTextBrowser</extends>
+ <extends>QWidget</extends>
<header>TinyWebBrowser.h</header>
+ <container>1</container>
</customwidget>
</customwidgets>
<resources>
@@ -577,94 +565,14 @@
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
- <x>266</x>
- <y>555</y>
+ <x>490</x>
+ <y>557</y>
</hint>
<hint type="destinationlabel">
- <x>157</x>
- <y>274</y>
+ <x>533</x>
+ <y>553</y>
</hint>
</hints>
</connection>
- <connection>
- <sender>m_pButtonBox</sender>
- <signal>rejected()</signal>
- <receiver>PlacemarkInfoDialog</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>334</x>
- <y>555</y>
- </hint>
- <hint type="destinationlabel">
- <x>286</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>m_pBackButton</sender>
- <signal>clicked()</signal>
- <receiver>m_pWikipediaBrowser</receiver>
- <slot>backward()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>54</x>
- <y>60</y>
- </hint>
- <hint type="destinationlabel">
- <x>55</x>
- <y>125</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>m_pForwardButton</sender>
- <signal>clicked()</signal>
- <receiver>m_pWikipediaBrowser</receiver>
- <slot>forward()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>98</x>
- <y>70</y>
- </hint>
- <hint type="destinationlabel">
- <x>106</x>
- <y>113</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>m_pWikipediaBrowser</sender>
- <signal>forwardAvailable(bool)</signal>
- <receiver>m_pForwardButton</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel">
- <x>135</x>
- <y>109</y>
- </hint>
- <hint type="destinationlabel">
- <x>98</x>
- <y>70</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>m_pWikipediaBrowser</sender>
- <signal>backwardAvailable(bool)</signal>
- <receiver>m_pBackButton</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel">
- <x>39</x>
- <y>129</y>
- </hint>
- <hint type="destinationlabel">
- <x>32</x>
- <y>54</y>
- </hint>
- </hints>
- </connection>
</connections>
</ui>
More information about the Marble-commits
mailing list