[Marble-commits] KDE/kdeedu/marble/src
Torsten Rahn
tackat at kde.org
Fri Jan 7 00:54:03 CET 2011
SVN commit 1212431 by rahn:
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
--- trunk/KDE/kdeedu/marble/src/lib/RenderPlugin.cpp #1212430:1212431
@@ -189,6 +189,11 @@
return false;
}
+void RenderPlugin::restoreDefaultSettings()
+{
+ setSettings( QHash<QString,QVariant>() );
+}
+
} // namespace Marble
#include "RenderPlugin.moc"
--- trunk/KDE/kdeedu/marble/src/lib/RenderPlugin.h #1212430:1212431
@@ -124,6 +124,7 @@
public Q_SLOTS:
void setEnabled( bool enabled );
void setVisible( bool visible );
+ void restoreDefaultSettings();
Q_SIGNALS:
/**
--- trunk/KDE/kdeedu/marble/src/plugins/render/earthquake/EarthquakeConfigWidget.ui #1212430:1212431
@@ -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>
--- trunk/KDE/kdeedu/marble/src/plugins/render/earthquake/EarthquakePlugin.cpp #1212430:1212431
@@ -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"
--- trunk/KDE/kdeedu/marble/src/plugins/render/earthquake/EarthquakePlugin.h #1212430:1212431
@@ -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 );
};
}
--- trunk/KDE/kdeedu/marble/src/plugins/render/graticule/GraticuleConfigWidget.ui #1212430:1212431
@@ -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>
--- trunk/KDE/kdeedu/marble/src/plugins/render/graticule/GraticulePlugin.cpp #1212430:1212431
@@ -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"
--- trunk/KDE/kdeedu/marble/src/plugins/render/graticule/GraticulePlugin.h #1212430:1212431
@@ -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 );
};
}
--- trunk/KDE/kdeedu/marble/src/plugins/render/positionmarker/PositionMarker.cpp #1212430:1212431
@@ -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"
--- trunk/KDE/kdeedu/marble/src/plugins/render/positionmarker/PositionMarker.h #1212430:1212431
@@ -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 );
};
}
--- trunk/KDE/kdeedu/marble/src/plugins/render/positionmarker/PositionMarkerConfigWidget.ui #1212430:1212431
@@ -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>
More information about the Marble-commits
mailing list