-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Various changes relating to projection selector: Renamed QgsLayerProj…
…ectionSelector to QgsGenericProjectionSelector so that it can be used in other contexts too. Added setSelectedEpsg call to projection selector. Added setMessage() call to generic projection selector. Updated python bindings accordingly. git-svn-id: http://svn.osgeo.org/qgis/trunk@9011 c8812cc2-4d05-0410-92ff-de0c093fc19c
- Loading branch information
timlinux
committed
Aug 7, 2008
1 parent
4f015a3
commit aa896df
Showing
20 changed files
with
230 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 15 additions & 10 deletions
25
python/gui/qgslayerprojectionselector.sip → python/gui/qgsgenericprojectionselector.sip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
/*************************************************************************** | ||
qgsgenericprojectionselector.cpp | ||
Set user defined CRS using projection selector widget | ||
------------------- | ||
begin : May 28, 2004 | ||
copyright : (C) 2004 by Gary E.Sherman | ||
email : sherman at mrcc.com | ||
***************************************************************************/ | ||
|
||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
/* $Id$ */ | ||
#include "qgsgenericprojectionselector.h" | ||
#include <QApplication> | ||
|
||
/** | ||
* \class QgsGenericProjectionSelector | ||
* \brief A generic dialog to prompt the user for a Coordinate Reference System | ||
*/ | ||
QgsGenericProjectionSelector::QgsGenericProjectionSelector(QWidget *parent, | ||
Qt::WFlags fl) | ||
: QDialog(parent, fl) | ||
{ | ||
setupUi(this); | ||
|
||
|
||
connect(pbnOK, SIGNAL(clicked()), this, SLOT( accept())); | ||
//we will show this only when a message is set | ||
textEdit->hide(); | ||
QApplication::restoreOverrideCursor(); | ||
} | ||
|
||
void QgsGenericProjectionSelector::setMessage(QString theMessage) | ||
{ | ||
//short term kludge to make the layer selector default to showing | ||
//a layer projection selection message. If you want the selector | ||
if (theMessage.isEmpty()) | ||
{ | ||
// Set up text edit pane | ||
QString format("<h2>%1</h2>%2 %3"); | ||
QString header = tr("Define this layer's projection:"); | ||
QString sentence1 = tr("This layer appears to have no projection specification."); | ||
QString sentence2 = tr("By default, this layer will now have its projection set to that of the project" | ||
", but you may override this by selecting a different projection below."); | ||
textEdit->setHtml(format.arg(header).arg(sentence1) | ||
.arg(sentence2)); | ||
} | ||
else | ||
{ | ||
textEdit->setHtml(theMessage); | ||
} | ||
textEdit->show(); | ||
|
||
} | ||
//! Destructor | ||
QgsGenericProjectionSelector::~QgsGenericProjectionSelector() | ||
{} | ||
|
||
void QgsGenericProjectionSelector::setSelectedSRSName(QString theName) | ||
{ | ||
projectionSelector->setSelectedSRSName(theName); | ||
} | ||
|
||
void QgsGenericProjectionSelector::setSelectedSRSID(long theID) | ||
{ | ||
projectionSelector->setSelectedSRSID(theID); | ||
} | ||
|
||
void QgsGenericProjectionSelector::setSelectedEpsg(long theID) | ||
{ | ||
projectionSelector->setSelectedEpsg(theID); | ||
} | ||
|
||
QString QgsGenericProjectionSelector::getSelectedProj4String() | ||
{ | ||
//@NOTE dont use getSelectedWKT as that just returns the name part! | ||
return projectionSelector->getSelectedProj4String(); | ||
} | ||
|
||
long QgsGenericProjectionSelector::getSelectedSRSID() | ||
{ | ||
//@NOTE dont use getSelectedWKT as that just returns the name part! | ||
return projectionSelector->getSelectedSRSID(); | ||
} | ||
|
||
long QgsGenericProjectionSelector::getSelectedEpsg() | ||
{ | ||
return projectionSelector->getSelectedEpsg(); | ||
} | ||
|
||
void QgsGenericProjectionSelector::setOgcWmsCrsFilter(QSet<QString> crsFilter) | ||
{ | ||
projectionSelector->setOgcWmsCrsFilter(crsFilter); | ||
} | ||
|
Oops, something went wrong.