[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/marble
From:       Torsten Rahn <tackat () kde ! org>
Date:       2008-04-27 10:10:08
Message-ID: 1209291008.239640.8933.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 801645 by rahn:

    - QObjectifiying GeoSceneDocument, Settings, Group and Property.
    - Adding valueChanged( QString property, bool enabled ) signals.
    - Adding GeoSceneDocument style mapTheme setters and getters to 
      ViewParams ...



 M  +15 -0     ChangeLog  
 M  +4 -0      src/lib/MarbleLegendBrowser.cpp  
 M  +14 -0     src/lib/ViewParams.cpp  
 M  +6 -0      src/lib/ViewParams.h  
 M  +1 -1      src/lib/geodata/handlers/dgml/DGMLPropertyTagHandler.cpp  
 M  +5 -1      src/lib/geodata/scene/GeoSceneDocument.cpp  
 M  +8 -2      src/lib/geodata/scene/GeoSceneDocument.h  
 M  +7 -3      src/lib/geodata/scene/GeoSceneGroup.cpp  
 M  +7 -1      src/lib/geodata/scene/GeoSceneGroup.h  
 M  +7 -1      src/lib/geodata/scene/GeoSceneProperty.cpp  
 M  +11 -1     src/lib/geodata/scene/GeoSceneProperty.h  
 M  +6 -3      src/lib/geodata/scene/GeoSceneSettings.cpp  
 M  +7 -1      src/lib/geodata/scene/GeoSceneSettings.h  


--- trunk/KDE/kdeedu/marble/ChangeLog #801644:801645
@@ -1,3 +1,18 @@
+2008-04-27  Torsten Rahn  <rahn@kde.org>
+
+    * src/lib/MarbleLegendBrowser.cpp:
+    * src/lib/geodata/handlers/dgml/DGMLPropertyTagHandler.cpp:
+    * src/lib/ViewParams.{cpp,h}:
+    * src/lib/geodata/scene/GeoSceneGroup.{cpp,h}:
+    * src/lib/geodata/scene/GeoSceneSettings.{cpp,h}:
+    * src/lib/geodata/scene/GeoSceneDocument.{cpp,h}:
+    * src/lib/geodata/scene/GeoSceneProperty.{cpp,h}:
+
+    - QObjectifiying GeoSceneDocument, Settings, Group and Property.
+    - Adding valueChanged( QString property, bool enabled ) signals.
+    - Adding GeoSceneDocument style mapTheme setters and getters to 
+      ViewParams ...
+
 2008-04-27  Inge Wallin  <inge@lysator.liu.se>
 
 	Add a maxLat() method to all projections.
--- trunk/KDE/kdeedu/marble/src/lib/MarbleLegendBrowser.cpp #801644:801645
@@ -115,6 +115,10 @@
     if ( d->m_marbleWidget ) {
         connect ( d->m_marbleWidget, SIGNAL( themeChanged( QString ) ),
                   this, SLOT( loadLegend() ) );
+/*        connect ( d->m_marbleWidget->map()->viewParams()->mapTheme()
+                  SIGNAL( themeChanged( QString ) ),
+                  this, SLOT( loadLegend() ) );
+*/
     }
 }
 
--- trunk/KDE/kdeedu/marble/src/lib/ViewParams.cpp #801644:801645
@@ -79,11 +79,25 @@
     m_viewport.setProjection( newProjection );
 }
 
+GeoSceneDocument *ViewParams::mapTheme()
+{
+    return m_mapTheme; 
+}
+
 MapQuality ViewParams::mapQuality()
 {
     return m_mapQuality; 
 }
 
+void ViewParams::setMapTheme( GeoSceneDocument *mapTheme )
+{
+    // Don't replace a working theme with one that obviously wouldn't work
+    if ( mapTheme != 0 ) {
+        delete m_mapTheme;
+        m_mapTheme = mapTheme; 
+    }
+}
+
 void ViewParams::setMapQuality( MapQuality mapQuality )
 {
     m_mapQuality = mapQuality; 
--- trunk/KDE/kdeedu/marble/src/lib/ViewParams.h #801644:801645
@@ -24,6 +24,7 @@
 
 #include <QtCore/QDebug>
 
+#include "GeoSceneDocument.h"
 #include "Quaternion.h"
 #include "BoundingBox.h"
 #include "ViewportParams.h"
@@ -47,10 +48,14 @@
 
     // Getters and setters
     ViewportParams  *viewport();
+
     Projection projection() const;
     AbstractProjection *currentProjection() const;
     void setProjection(Projection newProjection);
 
+    GeoSceneDocument *mapTheme();
+    void setMapTheme( GeoSceneDocument* );
+
     Marble::MapQuality mapQuality();
     void setMapQuality( Marble::MapQuality );
 
@@ -66,6 +71,7 @@
     ViewportParams  m_viewport;
     //Projection  m_projection;
     Projection  m_oldProjection;
+    GeoSceneDocument *m_mapTheme;
 
     MapQuality  m_mapQuality;
 
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DGMLPropertyTagHandler.cpp #801644:801645
@@ -59,7 +59,7 @@
     GeoStackItem parentItem = parser.parentElement();
     if (parentItem.represents(dgmlTag_Settings)) {
         GeoSceneProperty* property = new GeoSceneProperty( name );
-        parentItem.nodeAs<GeoSceneSettings>()->addProperty( property);
+        parentItem.nodeAs<GeoSceneSettings>()->addProperty( property );
     }
     if (parentItem.represents(dgmlTag_Group)) {
         GeoSceneProperty* property = new GeoSceneProperty( name );
--- trunk/KDE/kdeedu/marble/src/lib/geodata/scene/GeoSceneDocument.cpp #801644:801645
@@ -29,7 +29,9 @@
     , m_settings(new GeoSceneSettings)
     , m_legend(new GeoSceneLegend)
 {
-    /* NOOP */
+    // Establish connection of property changes to the outside, e.g. the LegendBrowser
+    connect ( m_settings, SIGNAL( valueChanged( QString, bool ) ), 
+                          SIGNAL( valueChanged( QString, bool ) ) );
 }
 
 GeoSceneDocument::~GeoSceneDocument()
@@ -60,3 +62,5 @@
 {
     return m_legend;
 }
+
+#include "GeoSceneDocument.moc"
--- trunk/KDE/kdeedu/marble/src/lib/geodata/scene/GeoSceneDocument.h #801644:801645
@@ -33,8 +33,11 @@
 /**
  * @short A container for features parsed from the DGML file.
  */
-class GEODATA_EXPORT GeoSceneDocument : public GeoDocument,
-                         public GeoNode {
+class GEODATA_EXPORT GeoSceneDocument : public QObject, 
+                                        public GeoDocument,
+                                        public GeoNode {
+    Q_OBJECT
+
  public:
     GeoSceneDocument();
     ~GeoSceneDocument();
@@ -46,6 +49,9 @@
     GeoSceneSettings* settings() const;
     GeoSceneLegend*   legend() const;
 
+ Q_SIGNALS:
+    void valueChanged( QString, bool );
+
  protected:
     GeoSceneHead*     m_head;
     GeoSceneMap*      m_map;
--- trunk/KDE/kdeedu/marble/src/lib/geodata/scene/GeoSceneGroup.cpp #801644:801645
@@ -53,6 +53,11 @@
 
     if ( property ) {
         m_properties.append( property );
+
+        // Establish connection to the outside, e.g. the LegendBrowser
+        connect ( property, SIGNAL( valueChanged( QString, bool ) ), 
+                            SIGNAL( valueChanged( QString, bool ) ) );
+        emit valueChanged( property->name(), property->value() );
     }
 }
 
@@ -71,9 +76,6 @@
         return property;
     }
 
-    property = new GeoSceneProperty( name );
-    addProperty( property );
-
     return property;
 }
 
@@ -86,3 +88,5 @@
 {
     return m_name;
 }
+
+#include "GeoSceneGroup.moc"
--- trunk/KDE/kdeedu/marble/src/lib/geodata/scene/GeoSceneGroup.h #801644:801645
@@ -32,7 +32,10 @@
  * @short Group inside the settings of a GeoScene document.
  */
 
-class GeoSceneGroup : public GeoNode {
+class GeoSceneGroup : public QObject, 
+                      public GeoNode {
+    Q_OBJECT
+
  public:
     GeoSceneGroup( const QString& name );
     ~GeoSceneGroup();
@@ -47,6 +50,9 @@
 
     QString name() const;
 
+ Q_SIGNALS:
+    void valueChanged( QString, bool );
+
  protected:
     /// The vector holding all the properties in this settings group.
     QVector<GeoSceneProperty*> m_properties;
--- trunk/KDE/kdeedu/marble/src/lib/geodata/scene/GeoSceneProperty.cpp #801644:801645
@@ -27,7 +27,6 @@
       m_defaultValue( false ),
       m_value( false )
 {
-    /* NOOP */
 }
 
 GeoSceneProperty::~GeoSceneProperty()
@@ -67,5 +66,12 @@
 
 void GeoSceneProperty::setValue( bool value )
 {
+    if ( m_value == value ) 
+        return;
+
     m_value = value;
+
+    emit valueChanged( m_name, m_value );
 }
+
+#include "GeoSceneProperty.moc"
--- trunk/KDE/kdeedu/marble/src/lib/geodata/scene/GeoSceneProperty.h #801644:801645
@@ -22,16 +22,23 @@
 #ifndef GEOSCENEPROPERTY_H
 #define GEOSCENEPROPERTY_H
 
+#include <QtCore/QObject>
 #include <QtCore/QString>
 
 #include <geodata_export.h>
 
 #include "GeoDocument.h"
 
+
+
 /**
  * @short Settings property within a GeoScene document.
  */
-class GEODATA_EXPORT GeoSceneProperty : public GeoNode {
+
+class GEODATA_EXPORT GeoSceneProperty : public QObject, 
+                                        public GeoNode {
+    Q_OBJECT
+
  public:
     GeoSceneProperty( const QString& name );
     ~GeoSceneProperty();
@@ -44,6 +51,9 @@
     bool value() const;
     void setValue( bool value );
 
+ Q_SIGNALS:
+    void valueChanged( QString, bool );
+
  protected:
     QString  m_name;
     bool     m_available;
--- trunk/KDE/kdeedu/marble/src/lib/geodata/scene/GeoSceneSettings.cpp #801644:801645
@@ -39,6 +39,10 @@
 {
     if ( group ) {
         m_groups.insert( group->name(), group );
+
+        // Establish connection to the outside, e.g. the LegendBrowser
+        connect ( group, SIGNAL( valueChanged( QString, bool ) ), 
+                         SIGNAL( valueChanged( QString, bool ) ) );
     }
 }
 
@@ -50,9 +54,6 @@
         return group;
     }
 
-    group = new GeoSceneGroup( name );
-    addGroup( group );
-
     return group;
 }
 
@@ -76,3 +77,5 @@
 
     return property;
 }
+
+#include "GeoSceneSettings.moc"
--- trunk/KDE/kdeedu/marble/src/lib/geodata/scene/GeoSceneSettings.h #801644:801645
@@ -34,7 +34,10 @@
 /**
  * @short Settings of a GeoScene document.
  */
-class GEODATA_EXPORT GeoSceneSettings : public GeoNode {
+class GEODATA_EXPORT GeoSceneSettings : public QObject, 
+                                        public GeoNode {
+    Q_OBJECT
+
  public:
     GeoSceneSettings();
     virtual ~GeoSceneSettings();
@@ -53,6 +56,9 @@
     void addProperty( GeoSceneProperty* );
     GeoSceneProperty* property( const QString& );
 
+ Q_SIGNALS:
+    void valueChanged( QString, bool );
+
  protected:
     /// The hash table holding all the properties in the settings.
     QHash<QString, GeoSceneProperty*> m_properties;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic