[Marble-commits] KDE/kdeedu/marble/src/lib
Bernhard Beschow
bbeschow at cs.tu-berlin.de
Tue Jan 4 00:32:28 CET 2011
SVN commit 1211396 by beschow:
use next button to download base tile also in the static URL case
* get rid of "Test" button
* validate URL before proceeding to the next page
M +3 -14 MapWizard.cpp
M +0 -85 MapWizard.ui
--- trunk/KDE/kdeedu/marble/src/lib/MapWizard.cpp #1211395:1211396
@@ -97,7 +97,7 @@
{
if ( id == 1 ) {
m_serverCapabilitiesValid = false;
- } else if ( id == 2 ) {
+ } else if ( id == 2 || id == 4 ) {
levelZero.clear();
} else if ( id == 5 ) {
if ( mapProviderType == MapWizardPrivate::StaticImageMap ) {
@@ -130,7 +130,6 @@
connect( d->uiWidget.pushButtonPreview, SIGNAL( clicked( bool ) ), this, SLOT( queryPreviewImage() ) );
connect( d->uiWidget.pushButtonLegend, SIGNAL( clicked( bool ) ), this, SLOT( queryLegendImage() ) );
connect( d->uiWidget.pushButtonStaticUrlLegend, SIGNAL( clicked( bool ) ), this, SLOT( queryStaticUrlLegendImage() ) );
- connect( d->uiWidget.pushButtonStaticUrlTest, SIGNAL( clicked( bool ) ), this, SLOT( downloadLevelZero() ) );
connect( d->uiWidget.comboBoxWmsServer, SIGNAL( currentIndexChanged( QString ) ), d->uiWidget.lineEditWmsUrl, SLOT( setText( QString ) ) );
connect( d->uiWidget.comboBoxWmsMap, SIGNAL( currentIndexChanged( QString ) ), this, SLOT( autoFillDetails() ) );
@@ -529,8 +528,6 @@
d->levelZero = reply->readAll();
QImage testImage = QImage::fromData( d->levelZero );
- if ( d->mapProviderType == MapWizardPrivate::WmsMap )
- {
if ( d->levelZero.isNull() ) {
QMessageBox::information( this,
tr( "Base Tile" ),
@@ -540,21 +537,13 @@
QMessageBox::information( this,
tr( "Base Tile" ),
tr( "The base tile could not be downloaded successfully. The server replied:\n\n%1" ).arg( QString( d->levelZero ) ) );
+ d->levelZero.clear();
}
else {
next();
}
}
- if( d->mapProviderType == MapWizardPrivate::StaticUrlMap )
- {
- if ( !testImage.isNull() ) {
- QImage levelZero = testImage.scaled( d->uiWidget.labelStaticUrlTest->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation );
- d->uiWidget.labelStaticUrlTest->setPixmap( QPixmap::fromImage( levelZero ) );
- }
- }
-}
-
void MapWizard::createLegend()
{
QDir map( QString( "%1/maps/earth/%2" ).arg( MarbleDirs::localPath() ).arg( d->mapTheme ) );
@@ -681,7 +670,7 @@
return false;
}
- if ( currentId() == 2 && d->levelZero.isNull() ) {
+ if ( ( currentId() == 2 || currentId() == 4 ) && d->levelZero.isNull() ) {
downloadLevelZero();
button( MapWizard::NextButton )->setEnabled( false );
return false;
--- trunk/KDE/kdeedu/marble/src/lib/MapWizard.ui #1211395:1211396
@@ -434,91 +434,6 @@
</spacer>
</item>
<item>
- <widget class="QLabel" name="label_8">
- <property name="text">
- <string>Preview:</string>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_4">
- <item>
- <widget class="QLabel" name="labelStaticUrlTest">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>92</width>
- <height>92</height>
- </size>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="alignment">
- <set>Qt::AlignCenter</set>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>5</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="pushButtonStaticUrlTest">
- <property name="text">
- <string>Test the Server</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
- <spacer name="verticalSpacer_4">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>5</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Optionally you can provide an image file which displays a map key for your map:</string>
More information about the Marble-commits
mailing list