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

List:       kde-commits
Subject:    branches/marble/marble-1.1/src
From:       Torsten Rahn <tackat () kde ! org>
Date:       2011-01-06 23:54:55
Message-ID: 20110106235455.96A61AC8B0 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1212432 by rahn:

Backport:
rahn * r1212431 trunk/KDE/kdeedu/marble/src/ (11 files in 4 dirs)
Changes: Restore default settings for Marble Plugins
http://reviewboard.kde.org/r/6295/
by Daniel Marth



 M  +5 -0      lib/RenderPlugin.cpp  
 M  +1 -0      lib/RenderPlugin.h  
 M  +3 -3      plugins/render/earthquake/EarthquakeConfigWidget.ui  
 M  +8 -0      plugins/render/earthquake/EarthquakePlugin.cpp  
 M  +2 -0      plugins/render/earthquake/EarthquakePlugin.h  
 M  +3 -3      plugins/render/graticule/GraticuleConfigWidget.ui  
 M  +8 -0      plugins/render/graticule/GraticulePlugin.cpp  
 M  +5 -2      plugins/render/graticule/GraticulePlugin.h  
 M  +8 -0      plugins/render/positionmarker/PositionMarker.cpp  
 M  +4 -0      plugins/render/positionmarker/PositionMarker.h  
 M  +2 -2      plugins/render/positionmarker/PositionMarkerConfigWidget.ui  


--- branches/marble/marble-1.1/src/lib/RenderPlugin.cpp #1212431:1212432
@@ -189,6 +189,11 @@
     return false;
 }
 
+void RenderPlugin::restoreDefaultSettings()
+{
+    setSettings( QHash<QString,QVariant>() );
+}
+
 } // namespace Marble
 
 #include "RenderPlugin.moc"
--- branches/marble/marble-1.1/src/lib/RenderPlugin.h #1212431:1212432
@@ -124,6 +124,7 @@
  public Q_SLOTS:
     void    setEnabled( bool enabled );
     void    setVisible( bool visible );
+    void    restoreDefaultSettings();
 
  Q_SIGNALS:
     /**
--- branches/marble/marble-1.1/src/plugins/render/earthquake/EarthquakeConfigWidget.ui \
#1212431:1212432 @@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>379</width>
-    <height>265</height>
+    <width>420</width>
+    <height>289</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -126,7 +126,7 @@
       <enum>Qt::Horizontal</enum>
      </property>
      <property name="standardButtons">
-      <set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
 +      <set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults</set>
  </property>
     </widget>
    </item>
--- branches/marble/marble-1.1/src/plugins/render/earthquake/EarthquakePlugin.cpp \
#1212431:1212432 @@ -78,6 +78,8 @@
                  SLOT( writeSettings() ) );
         connect( ui_configWidget->m_buttonBox, SIGNAL( rejected() ),
                  SLOT( readSettings() ) );
+        connect( ui_configWidget->m_buttonBox, SIGNAL( clicked ( QAbstractButton * ) \
), +                 SLOT( evaluateClickedButton( QAbstractButton * ) ) );
         QPushButton *applyButton = ui_configWidget->m_buttonBox->button( \
QDialogButtonBox::Apply );  connect( applyButton, SIGNAL( clicked() ),
                  SLOT( writeSettings() ) );
@@ -159,8 +161,14 @@
     ui_configWidget->m_startDate->setMaximumDateTime( \
ui_configWidget->m_endDate->dateTime() );  }
 
+void EarthquakePlugin::evaluateClickedButton( QAbstractButton *button )
+{
+    if( button == ui_configWidget->m_buttonBox->button( \
QDialogButtonBox::RestoreDefaults ) ) +        restoreDefaultSettings();
 }
 
+}
+
 Q_EXPORT_PLUGIN2( EarthquakePlugin, Marble::EarthquakePlugin )
 
 #include "EarthquakePlugin.moc"
--- branches/marble/marble-1.1/src/plugins/render/earthquake/EarthquakePlugin.h \
#1212431:1212432 @@ -17,6 +17,7 @@
 
 #include <QtCore/QHash>
 #include <QtGui/QIcon>
+#include <QtGui/QAbstractButton>
 
 namespace Ui
 {
@@ -74,6 +75,7 @@
 
 private slots:
     void validateDateRange();
+    void evaluateClickedButton( QAbstractButton *button );
 };
 
 }
--- branches/marble/marble-1.1/src/plugins/render/graticule/GraticuleConfigWidget.ui \
#1212431:1212432 @@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>328</width>
-    <height>251</height>
+    <width>445</width>
+    <height>231</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -1402,7 +1402,7 @@
       <enum>Qt::Horizontal</enum>
      </property>
      <property name="standardButtons">
-      <set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
 +      <set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults</set>
  </property>
      <property name="centerButtons">
       <bool>false</bool>
--- branches/marble/marble-1.1/src/plugins/render/graticule/GraticulePlugin.cpp \
#1212431:1212432 @@ -126,6 +126,8 @@
                 SLOT( writeSettings() ) );
         connect( ui_configWidget->m_buttonBox, SIGNAL( rejected() ), this, 
                 SLOT( readSettings() ) );
+        connect( ui_configWidget->m_buttonBox, SIGNAL( clicked ( QAbstractButton * ) \
), +                 SLOT( evaluateClickedButton( QAbstractButton * ) ) );
         QPushButton *applyButton = ui_configWidget->m_buttonBox->button( \
QDialogButtonBox::Apply );  connect( applyButton, SIGNAL( clicked() ),
                  this,        SLOT( writeSettings() ) );
@@ -667,8 +669,14 @@
     m_currentNotation = notation;
 }
 
+void GraticulePlugin::evaluateClickedButton( QAbstractButton *button )
+{
+    if( button == ui_configWidget->m_buttonBox->button( \
QDialogButtonBox::RestoreDefaults ) ) +        restoreDefaultSettings();
 }
 
+}
+
 Q_EXPORT_PLUGIN2(GraticulePlugin, Marble::GraticulePlugin)
 
 #include "GraticulePlugin.moc"
--- branches/marble/marble-1.1/src/plugins/render/graticule/GraticulePlugin.h \
#1212431:1212432 @@ -18,10 +18,11 @@
 #include <QtCore/QMap>
 #include <QtCore/QObject>
 #include <QtCore/QVector>
+#include <QtCore/QHash>
 #include <QtGui/QPen>
-#include <QtCore/QHash>
 #include <QtGui/QIcon>
-#include <QColorDialog>
+#include <QtGui/QColorDialog>
+#include <QtGui/QAbstractButton>
 
 
 #include "AbstractDataPlugin.h"
@@ -205,6 +206,8 @@
     mutable Ui::GraticuleConfigWidget *ui_configWidget;
     mutable QDialog *m_configDialog;
 
+ private slots:
+    void evaluateClickedButton( QAbstractButton *button );
 };
 
 }
--- branches/marble/marble-1.1/src/plugins/render/positionmarker/PositionMarker.cpp \
#1212431:1212432 @@ -145,6 +145,8 @@
                  SLOT( writeSettings() ) );
         connect( ui_configWidget->m_buttonBox, SIGNAL( rejected() ),
                  SLOT( readSettings() ) );
+        connect( ui_configWidget->m_buttonBox, SIGNAL( clicked ( QAbstractButton * ) \
), +                 SLOT( evaluateClickedButton( QAbstractButton * ) ) );
         QPushButton *applyButton = ui_configWidget->m_buttonBox->button( \
QDialogButtonBox::Apply );  connect( applyButton, SIGNAL( clicked() ),
                  SLOT( writeSettings() ) );
@@ -437,8 +439,14 @@
     return 1.0;
 }
 
+void PositionMarker::evaluateClickedButton( QAbstractButton *button )
+{
+    if( button == ui_configWidget->m_buttonBox->button( \
QDialogButtonBox::RestoreDefaults ) ) +        restoreDefaultSettings();
 }
 
+}
+
 Q_EXPORT_PLUGIN2( PositionMarker, Marble::PositionMarker )
 
 #include "PositionMarker.moc"
--- branches/marble/marble-1.1/src/plugins/render/positionmarker/PositionMarker.h \
#1212431:1212432 @@ -16,6 +16,7 @@
 #include <QtCore/QObject>
 #include <QtCore/QHash>
 #include <QtGui/QColor>
+#include <QtGui/QAbstractButton>
 
 #include "RenderPlugin.h"
 #include "GeoDataCoordinates.h"
@@ -122,6 +123,9 @@
 
     void loadCustomCursor( const QString& filename, bool useCursor );
     void loadDefaultCursor();
+
+ private slots:
+    void evaluateClickedButton( QAbstractButton *button );
 };
 
 }
--- branches/marble/marble-1.1/src/plugins/render/positionmarker/PositionMarkerConfigWidget.ui \
#1212431:1212432 @@ -6,7 +6,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>413</width>
+    <width>433</width>
     <height>297</height>
    </rect>
   </property>
@@ -207,7 +207,7 @@
       <enum>Qt::Horizontal</enum>
      </property>
      <property name="standardButtons">
-      <set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
 +      <set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults</set>
  </property>
     </widget>
    </item>


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

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