[QGIS Commit] r10570 - in trunk/qgis/src: app
plugins/copyright_label plugins/diagram_overlay
plugins/georeferencer plugins/oracle_raster
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Wed Apr 15 17:08:02 EDT 2009
Author: jef
Date: 2009-04-15 17:08:02 -0400 (Wed, 15 Apr 2009)
New Revision: 10570
Modified:
trunk/qgis/src/app/qgisapp.cpp
trunk/qgis/src/app/qgsspatialitesourceselect.cpp
trunk/qgis/src/plugins/copyright_label/pluginguibase.ui
trunk/qgis/src/plugins/diagram_overlay/qgssvgdiagramfactorywidget.cpp
trunk/qgis/src/plugins/georeferencer/qgspointdialog.cpp
trunk/qgis/src/plugins/oracle_raster/qgsoracle_plugin.cpp
trunk/qgis/src/plugins/oracle_raster/qgsoracle_plugin.h
trunk/qgis/src/plugins/oracle_raster/qgsoracleconnect_ui.cpp
trunk/qgis/src/plugins/oracle_raster/qgsoracleconnect_ui.h
trunk/qgis/src/plugins/oracle_raster/qgsselectgeoraster_ui.cpp
trunk/qgis/src/plugins/oracle_raster/qgsselectgeoraster_ui.h
Log:
news fixes, additions and translation string updates
Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp 2009-04-15 20:59:33 UTC (rev 10569)
+++ trunk/qgis/src/app/qgisapp.cpp 2009-04-15 21:08:02 UTC (rev 10570)
@@ -1853,87 +1853,87 @@
abt->setVersion( versionString );
QString whatsNew = "<html><body>" + tr( "Version" ) + " ";
whatsNew += QGis::QGIS_VERSION;
- whatsNew += "<h2>" + tr("Whats new in Version 1.1.0?") + "</h2>"
- + "<p>"
- + tr("Please note that this is a release in our 'unstable' release series. As such it contains new features and extends the programmatic interface over QGIS 1.0.x. If stability and long term support is more important to you then cool new and untested features, we recommend that you use a copy of QGIS from our stable 1.0.x release series.")
- + "</p>"
- + "<p>"
- + tr("This release includes many bug fixes and enchancements over the QGIS 1.1.0 release. In addition we have added the following new features:")
- + "</p>"
- + "<ul>"
- + "<li>"
- + tr("Updates to translations.")
- + "</li>"
- + "<li>"
- + tr("Improvements and polishing of the Python plugin installer. Switch to the new official QGIS repository.")
- + "</li>"
- + "<li>"
- + tr("Improvements to themes so that plugins and other parts of the GUI are better supported when switching themes. Addition of the new GIS icon theme.")
- + "</li>"
- + "<li>"
- + tr("Improvements to Debian packaging to better support Debian standard requirements.")
- + "</li>"
- + "<li>"
- + tr("Support usb: as a GPS device under Linux.")
- + "</li>"
- + "<li>"
- + tr("WMS plugin now supports sorting and shows nested layers as a tree. WMS provider also support 24bit png images now. The WMS plugin also now provides a search interface for finding WMS servers.")
- + "</li>"
- + "<li>"
- + tr(" Added svg point symbols symbols from Matt Amos (with his permission).")
- + "</li>"
- + "<li>"
- + tr("Improvements to proxy support and support of proxy in WFS provider. The WFS provider now also shows progress information as it is fetching data.")
- + "</li>"
- + "<li>"
- + tr("Improvements the PostGIS client support. Massive speedups in PostGIS layer rendering can now be achieved by disabling SSL in the connection editor.")
- + "</li>"
- + "<li>"
- + tr("Mapserver Export improvements for continuous color support.")
- + "</li>"
- + "<li>"
- + tr("Added tools menu - the fTools plugins are now part of the core QGIS plugins and will always be installed by default.")
- + "</li>"
- + "<li>"
- + tr("Improvements to the print composer including object alignment options. It is also now possible to print maps as postcript raster or vector. For python programmers, the composer classes now have python bindings.")
- + "</li>"
- + "<li>"
- + tr("When using File - Save as image, the saved image is now georeferenced.")
- + "</li>"
- + "<li>"
- + tr("Projection selector now includes quick selection of recently used CRS's.")
- + "</li>"
- + "<li>"
- + tr("Continuous color renderer supports point symbols now too.")
- + "</li>"
- + "<li>"
- + tr("Improved CMake support for building against dependencies from OSGEO4W (Windows only). Addition of an XCode project of developers building under OSX.")
- + "</li>"
- + "<li>"
- + tr("Updates and cleanups to the GRASS toolbox.")
- + "</li>"
- + "<li>"
- + tr("Changes in open vector dialog to support all drivers available in ogr including database and protocol drivers. This brings with it support for SDE, Oracle Spatial, ESRI personal geodatabase and many more OGR supported data stores. Note that in some cases accessing these may require third party libraries to be on your system.")
- + "</li>"
- + "<li>"
- + tr("The middle mouse button can now be used for panning. ")
- + "</li>"
- + "<li>"
- + tr("A new, faster attribute table implementation.")
- + "</li>"
- + "<li>"
- + tr("Numerous cleanups to the user interface.")
- + "</li>"
- + "<li>"
- + tr("A new provider was added for spatiallite - a geodatabase-in-a-file implementation based on the SQLITE database.")
- + "</li>"
- + "<li>"
- + tr("Vector overlay support that can draw pie and bar charts over vector layers based on attribute data.")
- + "</li>"
+ whatsNew += "<h2>" + tr( "Whats new in Version 1.1.0?" ) + "</h2>"
+ + "<p>"
+ + tr( "Please note that this is a release in our 'unstable' release series. As such it contains new features and extends the programmatic interface over QGIS 1.0.x. If stability and long term support is more important to you then cool new and untested features, we recommend that you use a copy of QGIS from our stable 1.0.x release series." )
+ + "</p>"
+ + "<p>"
+ + tr( "This release includes many bug fixes and enhancements over the QGIS 1.0.0 release. In addition we have added the following new features:" )
+ + "</p>"
+ + "<ul>"
+ + "<li>"
+ + tr( "Updates to translations." )
+ + "</li>"
+ + "<li>"
+ + tr( "Improvements and polishing of the Python plugin installer. Switch to the new official QGIS repository." )
+ + "</li>"
+ + "<li>"
+ + tr( "Improvements to themes so that plugins and other parts of the GUI are better supported when switching themes. Addition of the new GIS icon theme." )
+ + "</li>"
+ + "<li>"
+ + tr( "Improvements to Debian packaging to better support Debian standard requirements." )
+ + "</li>"
+ + "<li>"
+ + tr( "Support usb: as a GPS device under Linux." )
+ + "</li>"
+ + "<li>"
+ + tr( "WMS plugin now supports sorting and shows nested layers as a tree. WMS provider also support 24bit png images now. The WMS plugin also now provides a search interface for finding WMS servers." )
+ + "</li>"
+ + "<li>"
+ + tr( "Added svg point symbols from Matt Amos (with his permission)." )
+ + "</li>"
+ + "<li>"
+ + tr( "Improvements to proxy support and support of proxy in WFS provider. The WFS provider now also shows progress information as it is fetching data." )
+ + "</li>"
+ + "<li>"
+ + tr( "Improvements to PostGIS client support. Massive speedups in PostGIS layer rendering can now be achieved by disabling SSL in the connection editor. Support for usage of ctid column as primary key (softens the requirement for integer primary keys)" )
+ + "</li>"
+ + "<li>"
+ + tr( "Mapserver Export improvements for continuous color support." )
+ + "</li>"
+ + "<li>"
+ + tr( "Added tools menu - the fTools plugin is now part of the core QGIS plugins and will always be installed by default." )
+ + "</li>"
+ + "<li>"
+ + tr( "Improvements to the print composer including object alignment options. It is also now possible to print maps as postcript raster or vector. For python programmers, the composer classes now have python bindings." )
+ + "</li>"
+ + "<li>"
+ + tr( "When using File - Save as image, the saved image is now georeferenced." )
+ + "</li>"
+ + "<li>"
+ + tr( "Projection selector now includes quick selection of recently used CRS's." )
+ + "</li>"
+ + "<li>"
+ + tr( "Continuous color renderer supports point symbols now too." )
+ + "</li>"
+ + "<li>"
+ + tr( "Improved CMake support for building against dependencies from OSGEO4W (Windows only). Addition of an XCode project of developers building under OSX." )
+ + "</li>"
+ + "<li>"
+ + tr( "Updates and cleanups to the GRASS toolbox." )
+ + "</li>"
+ + "<li>"
+ + tr( "Changes in open vector dialog to support all drivers available in ogr including database and protocol drivers. This brings with it support for SDE, Oracle Spatial, ESRI personal geodatabase and many more OGR supported data stores. Note that in some cases accessing these may require third party libraries to be on your system." )
+ + "</li>"
+ + "<li>"
+ + tr( "The middle mouse button can now be used for panning. " )
+ + "</li>"
+ + "<li>"
+ + tr( "A new, faster attribute table implementation." )
+ + "</li>"
+ + "<li>"
+ + tr( "Numerous cleanups to the user interface." )
+ + "</li>"
+ + "<li>"
+ + tr( "A new provider was added for spatiallite - a geodatabase-in-a-file implementation based on the SQLITE database." )
+ + "</li>"
+ + "<li>"
+ + tr( "Vector overlay support that can draw pie and bar charts over vector layers based on attribute data." )
+ + "</li>"
//+ "<li>"
//+ tr("X")
//+ "</li>"
- + "</ul></body></html>";
+ + "</ul></body></html>";
abt->setWhatsNew( whatsNew );
@@ -5213,7 +5213,7 @@
mActionSplitFeatures->setEnabled( false );
if ( vlayer->isEditable() && dprovider->capabilities() & QgsVectorDataProvider::ChangeGeometries )
{
- mActionMoveVertex->setEnabled( true );
+ mActionMoveVertex->setEnabled( true );
}
return;
}
Modified: trunk/qgis/src/app/qgsspatialitesourceselect.cpp
===================================================================
--- trunk/qgis/src/app/qgsspatialitesourceselect.cpp 2009-04-15 20:59:33 UTC (rev 10569)
+++ trunk/qgis/src/app/qgsspatialitesourceselect.cpp 2009-04-15 21:08:02 UTC (rev 10570)
@@ -291,7 +291,7 @@
{
// retrieving the SQLite DB name and full path
QString text = *it + tr( " @ " );
- text += settings.value( *it + tr( "/sqlitepath" ), "###unknown###" ).toString();
+ text += settings.value( *it + "/sqlitepath", "###unknown###" ).toString();
cmbConnections->addItem( text );
++it;
@@ -365,7 +365,7 @@
subKey.truncate( idx );
QString key = "/SpatiaLite/connections/" + subKey;
- QString msg = tr( "Are you sure you want to remove the " ) + subKey + tr( " connection and all associated settings?" );
+ QString msg = tr( "Are you sure you want to remove the %1 connection and all associated settings?" ).arg( subKey );
QMessageBox::StandardButton result =
QMessageBox::information( this, tr( "Confirm Delete" ), msg, QMessageBox::Ok | QMessageBox::Cancel );
if ( result == QMessageBox::Ok )
Modified: trunk/qgis/src/plugins/copyright_label/pluginguibase.ui
===================================================================
--- trunk/qgis/src/plugins/copyright_label/pluginguibase.ui 2009-04-15 20:59:33 UTC (rev 10569)
+++ trunk/qgis/src/plugins/copyright_label/pluginguibase.ui 2009-04-15 21:08:02 UTC (rev 10570)
@@ -158,7 +158,7 @@
<string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Verdana'; font-size:10pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">© QGIS 2008</p></body></html></string>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">© QGIS 2009</p></body></html></string>
</property>
</widget>
</item>
Modified: trunk/qgis/src/plugins/diagram_overlay/qgssvgdiagramfactorywidget.cpp
===================================================================
--- trunk/qgis/src/plugins/diagram_overlay/qgssvgdiagramfactorywidget.cpp 2009-04-15 20:59:33 UTC (rev 10569)
+++ trunk/qgis/src/plugins/diagram_overlay/qgssvgdiagramfactorywidget.cpp 2009-04-15 21:08:02 UTC (rev 10570)
@@ -179,7 +179,7 @@
for ( ; fileIt != fileList.constEnd(); ++fileIt )
{
- progress.setLabelText( tr( "Creating icon for file " ) + fileIt->fileName() );
+ progress.setLabelText( tr( "Creating icon for file %1" ).arg( fileIt->fileName() ) );
progress.setValue( counter );
QCoreApplication::processEvents();
if ( progress.wasCanceled() )
Modified: trunk/qgis/src/plugins/georeferencer/qgspointdialog.cpp
===================================================================
--- trunk/qgis/src/plugins/georeferencer/qgspointdialog.cpp 2009-04-15 20:59:33 UTC (rev 10569)
+++ trunk/qgis/src/plugins/georeferencer/qgspointdialog.cpp 2009-04-15 21:08:02 UTC (rev 10570)
@@ -302,9 +302,7 @@
if ( QFile::exists( worldFileName ) )
{
int r = QMessageBox::question( this, tr( "World file exists" ),
- tr( "<p>The selected file already seems to have a " ) +
- tr( "world file! Do you want to replace it with the " ) +
- tr( "new world file?</p>" ),
+ tr( "<p>The selected file already seems to have a world file! Do you want to replace it with the new world file?</p>" ),
QMessageBox::Yes | QMessageBox::Default,
QMessageBox::No | QMessageBox::Escape );
if ( r == QMessageBox::No )
@@ -438,9 +436,8 @@
else
{
QMessageBox::critical( this, tr( "Not implemented!" ),
- tr( "<p>The " ) +
- cmbTransformType->currentText() +
- tr( " transform is not yet supported.</p>" ) );
+ tr( "<p>The %1 transform is not yet supported.</p>" )
+ .arg( cmbTransformType->currentText() ) );
return false;
}
}
@@ -480,7 +477,7 @@
if ( !file.open( QIODevice::WriteOnly ) )
{
QMessageBox::critical( this, tr( "Error" ),
- tr( "Could not write to " ) + worldFileName );
+ tr( "Could not write to %1" ).arg( worldFileName ) );
return false;
}
QTextStream stream( &file );
@@ -667,9 +664,7 @@
if ( QFile::exists( worldfile ) )
{
int r = QMessageBox::question( this, tr( "World file exists" ),
- tr( "<p>The selected file already seems to have a " ) +
- tr( "world file! Do you want to replace it with the " ) +
- tr( "new world file?</p>" ),
+ tr( "<p>The selected file already seems to have a world file! Do you want to replace it with the new world file?</p>" ),
QMessageBox::Yes | QMessageBox::Default,
QMessageBox::No | QMessageBox::Escape );
if ( r == QMessageBox::No )
Modified: trunk/qgis/src/plugins/oracle_raster/qgsoracle_plugin.cpp
===================================================================
--- trunk/qgis/src/plugins/oracle_raster/qgsoracle_plugin.cpp 2009-04-15 20:59:33 UTC (rev 10569)
+++ trunk/qgis/src/plugins/oracle_raster/qgsoracle_plugin.cpp 2009-04-15 21:08:02 UTC (rev 10570)
@@ -4,7 +4,7 @@
begin : Oracle Spatial Plugin
copyright : (C) Ivan Lucena
email : ivan.lucena at pmldnet.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 *
@@ -18,9 +18,9 @@
#include "qgsselectgeoraster_ui.h"
static const char * const sIdent = "$Id: oracleplugin.cpp $";
-static const QString sName = QObject::tr("Oracle Spatial GeoRaster");
-static const QString sDescription = QObject::tr("Access Oracle Spatial GeoRaster");
-static const QString sPluginVersion = QObject::tr("Version 0.1");
+static const QString sName = QObject::tr( "Oracle Spatial GeoRaster" );
+static const QString sDescription = QObject::tr( "Access Oracle Spatial GeoRaster" );
+static const QString sPluginVersion = QObject::tr( "Version 0.1" );
static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
//////////////////////////////////////////////////////////////////////
@@ -34,9 +34,9 @@
* an interface object that provides access to exposed functions in QGIS.
* @param theQGisInterface - Pointer to the QGIS interface object
*/
-QgsOraclePlugin::QgsOraclePlugin(QgisInterface * theQgisInterface) :
-QgisPlugin(sName, sDescription, sPluginVersion, sPluginType),
-mQGisIface(theQgisInterface)
+QgsOraclePlugin::QgsOraclePlugin( QgisInterface * theQgisInterface ) :
+ QgisPlugin( sName, sDescription, sPluginVersion, sPluginType ),
+ mQGisIface( theQgisInterface )
{
}
@@ -52,22 +52,22 @@
void QgsOraclePlugin::initGui()
{
- // Create the action for tool
- mQActionPointer = new QAction(QIcon(":/oracleplugin/oracleplugin.png"), tr("Select GeoRaster"), this);
- // Set the what's this text
- mQActionPointer->setWhatsThis(tr("Open a Oracle Spatial GeoRaster"));
- // Connect the action to the run
- connect(mQActionPointer, SIGNAL(triggered()), this, SLOT(run()));
- // Add the icon to the toolbar
- mQGisIface->addToolBarIcon(mQActionPointer);
- mQGisIface->addPluginToMenu(tr("&Oracle Spatial"), mQActionPointer);
+ // Create the action for tool
+ mQActionPointer = new QAction( QIcon( ":/oracleplugin/oracleplugin.png" ), tr( "Select GeoRaster" ), this );
+ // Set the what's this text
+ mQActionPointer->setWhatsThis( tr( "Open a Oracle Spatial GeoRaster" ) );
+ // Connect the action to the run
+ connect( mQActionPointer, SIGNAL( triggered() ), this, SLOT( run() ) );
+ // Add the icon to the toolbar
+ mQGisIface->addToolBarIcon( mQActionPointer );
+ mQGisIface->addPluginToMenu( tr( "&Oracle Spatial" ), mQActionPointer );
}
//method defined in interface
void QgsOraclePlugin::help()
{
- //implement me!
+ //implement me!
}
// Slot called when the menu item is triggered
@@ -77,20 +77,20 @@
void QgsOraclePlugin::run()
{
- QgsOracleSelectGeoraster *myPluginGui = new QgsOracleSelectGeoraster(mQGisIface->mainWindow(), mQGisIface, QgisGui::ModalDialogFlags);
- myPluginGui->setAttribute(Qt::WA_DeleteOnClose);
+ QgsOracleSelectGeoraster *myPluginGui = new QgsOracleSelectGeoraster( mQGisIface->mainWindow(), mQGisIface, QgisGui::ModalDialogFlags );
+ myPluginGui->setAttribute( Qt::WA_DeleteOnClose );
- myPluginGui->show();
+ myPluginGui->show();
}
// Unload the plugin by cleaning up the GUI
void QgsOraclePlugin::unload()
{
- // remove the GUI
- mQGisIface->removePluginMenu("&Oracle Spatial", mQActionPointer);
- mQGisIface->removeToolBarIcon(mQActionPointer);
- delete mQActionPointer;
+ // remove the GUI
+ mQGisIface->removePluginMenu( "&Oracle Spatial", mQActionPointer );
+ mQGisIface->removeToolBarIcon( mQActionPointer );
+ delete mQActionPointer;
}
@@ -112,42 +112,42 @@
*/
// Class factory to return a new instance of the plugin class
-QGISEXTERN QgisPlugin * classFactory(QgisInterface * theQgisInterfacePointer)
+QGISEXTERN QgisPlugin * classFactory( QgisInterface * theQgisInterfacePointer )
{
- return new QgsOraclePlugin(theQgisInterfacePointer);
+ return new QgsOraclePlugin( theQgisInterfacePointer );
}
// Return the name of the plugin - note that we do not user class members as
// the class may not yet be insantiated when this method is called.
QGISEXTERN QString name()
{
- return sName;
+ return sName;
}
// Return the description
QGISEXTERN QString description()
{
- return sDescription;
+ return sDescription;
}
// Return the type (either UI or MapLayer plugin)
QGISEXTERN int type()
{
- return sPluginType;
+ return sPluginType;
}
// Return the version number for the plugin
QGISEXTERN QString version()
{
- return sPluginVersion;
+ return sPluginVersion;
}
// Delete ourself
-QGISEXTERN void unload(QgisPlugin * thePluginPointer)
+QGISEXTERN void unload( QgisPlugin * thePluginPointer )
{
- delete thePluginPointer;
+ delete thePluginPointer;
}
Modified: trunk/qgis/src/plugins/oracle_raster/qgsoracle_plugin.h
===================================================================
--- trunk/qgis/src/plugins/oracle_raster/qgsoracle_plugin.h 2009-04-15 20:59:33 UTC (rev 10569)
+++ trunk/qgis/src/plugins/oracle_raster/qgsoracle_plugin.h 2009-04-15 21:08:02 UTC (rev 10570)
@@ -4,7 +4,7 @@
begin : Oracle Spatial Plugin
copyright : (C) Ivan Lucena
email : ivan.lucena at pmldnet.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 *
@@ -30,18 +30,18 @@
{
Q_OBJECT
-public:
+ public:
/**
* Constructor for a plugin. The QgisInterface pointer is passed by
* QGIS when it attempts to instantiate the plugin.
* @param theInterface Pointer to the QgisInterface object.
*/
- QgsOraclePlugin(QgisInterface * theInterface);
+ QgsOraclePlugin( QgisInterface * theInterface );
//! Destructor
virtual ~QgsOraclePlugin();
-public slots:
+ public slots:
//! init the gui
virtual void initGui();
@@ -52,7 +52,7 @@
//! show the help document
void help();
-private:
+ private:
int mPluginType;
//! Pointer to the QGIS interface object
Modified: trunk/qgis/src/plugins/oracle_raster/qgsoracleconnect_ui.cpp
===================================================================
--- trunk/qgis/src/plugins/oracle_raster/qgsoracleconnect_ui.cpp 2009-04-15 20:59:33 UTC (rev 10569)
+++ trunk/qgis/src/plugins/oracle_raster/qgsoracleconnect_ui.cpp 2009-04-15 21:08:02 UTC (rev 10570)
@@ -4,7 +4,7 @@
begin : Oracle Spatial Plugin
copyright : (C) Ivan Lucena
email : ivan.lucena at pmldnet.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 *
@@ -20,31 +20,31 @@
#include <QSettings>
#include <QMessageBox>
-QgsOracleConnect::QgsOracleConnect(QWidget* parent,
- const QString& connName,
- Qt::WFlags fl) : QDialog(parent, fl)
+QgsOracleConnect::QgsOracleConnect( QWidget* parent,
+ const QString& connName,
+ Qt::WFlags fl ) : QDialog( parent, fl )
{
- setupUi(this);
+ setupUi( this );
- if ( ! connName.isEmpty() )
- {
- // populate the dialog with the information stored for the connection
- // populate the fields with the stored setting parameters
+ if ( ! connName.isEmpty() )
+ {
+ // populate the dialog with the information stored for the connection
+ // populate the fields with the stored setting parameters
- QSettings settings;
+ QSettings settings;
- QString key = "/Oracle/connections/" + connName;
+ QString key = "/Oracle/connections/" + connName;
- txtDatabase->setText( settings.value( key + "/database" ).toString() );
- txtUsername->setText( settings.value( key + "/username" ).toString() );
+ txtDatabase->setText( settings.value( key + "/database" ).toString() );
+ txtUsername->setText( settings.value( key + "/username" ).toString() );
- if ( settings.value( key + "/savepass" ).toString() == "true" )
- {
- txtPassword->setText( settings.value( key + "/password" ).toString() );
- chkStorePassword->setChecked( true );
- }
- txtName->setText( connName );
+ if ( settings.value( key + "/savepass" ).toString() == "true" )
+ {
+ txtPassword->setText( settings.value( key + "/password" ).toString() );
+ chkStorePassword->setChecked( true );
}
+ txtName->setText( connName );
+ }
}
QgsOracleConnect::~QgsOracleConnect()
@@ -53,36 +53,36 @@
void QgsOracleConnect::on_btnCancel_clicked()
{
- helpInfo();
+ helpInfo();
}
void QgsOracleConnect::on_btnOk_clicked()
{
- saveConnection();
+ saveConnection();
}
void QgsOracleConnect::saveConnection()
{
- QSettings settings;
+ QSettings settings;
- QString baseKey = "/Oracle/connections/";
+ QString baseKey = "/Oracle/connections/";
- settings.setValue( baseKey + "selected", txtName->text() );
- baseKey += txtName->text();
- settings.setValue( baseKey + "/database", txtDatabase->text() );
- settings.setValue( baseKey + "/username", txtUsername->text() );
- settings.setValue( baseKey + "/password", txtPassword->text() );
- settings.setValue( baseKey + "/savepass", chkStorePassword->isChecked() ? "true" : "false" );
- settings.setValue( baseKey + "/subdtset", "GEOR:" +
- txtUsername->text() + "/" +
- txtPassword->text() + "@" +
- txtDatabase->text() );
+ settings.setValue( baseKey + "selected", txtName->text() );
+ baseKey += txtName->text();
+ settings.setValue( baseKey + "/database", txtDatabase->text() );
+ settings.setValue( baseKey + "/username", txtUsername->text() );
+ settings.setValue( baseKey + "/password", txtPassword->text() );
+ settings.setValue( baseKey + "/savepass", chkStorePassword->isChecked() ? "true" : "false" );
+ settings.setValue( baseKey + "/subdtset", "GEOR:" +
+ txtUsername->text() + "/" +
+ txtPassword->text() + "@" +
+ txtDatabase->text() );
- accept();
+ accept();
}
void QgsOracleConnect::helpInfo()
{
- // QgsContextHelp::run( context_id );
+ // QgsContextHelp::run( context_id );
}
Modified: trunk/qgis/src/plugins/oracle_raster/qgsoracleconnect_ui.h
===================================================================
--- trunk/qgis/src/plugins/oracle_raster/qgsoracleconnect_ui.h 2009-04-15 20:59:33 UTC (rev 10569)
+++ trunk/qgis/src/plugins/oracle_raster/qgsoracleconnect_ui.h 2009-04-15 21:08:02 UTC (rev 10570)
@@ -4,7 +4,7 @@
begin : Oracle Spatial Plugin
copyright : (C) Ivan Lucena
email : ivan.lucena at pmldnet.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 *
@@ -15,7 +15,7 @@
/* $Id$ */
#ifndef QgsOracleConnect_H
-#define QgsOracleConnect_H
+#define QgsOracleConnect_H
// Qt Designer Includes
#include "ui_qgsoracleconnectbase.h"
@@ -27,19 +27,19 @@
{
Q_OBJECT
-public:
- QgsOracleConnect(QWidget* parent = 0,
- const QString& connName = QString::null,
- Qt::WFlags fl = QgisGui::ModalDialogFlags);
+ public:
+ QgsOracleConnect( QWidget* parent = 0,
+ const QString& connName = QString::null,
+ Qt::WFlags fl = QgisGui::ModalDialogFlags );
~QgsOracleConnect();
-private:
+ private:
void saveConnection();
void helpInfo();
-public slots:
+ public slots:
void on_btnOk_clicked();
void on_btnCancel_clicked();
};
-#endif /* _ORACLECONNECTGUI_H */
+#endif /* _ORACLECONNECTGUI_H */
Modified: trunk/qgis/src/plugins/oracle_raster/qgsselectgeoraster_ui.cpp
===================================================================
--- trunk/qgis/src/plugins/oracle_raster/qgsselectgeoraster_ui.cpp 2009-04-15 20:59:33 UTC (rev 10569)
+++ trunk/qgis/src/plugins/oracle_raster/qgsselectgeoraster_ui.cpp 2009-04-15 21:08:02 UTC (rev 10570)
@@ -4,7 +4,7 @@
begin : Oracle Spatial Plugin
copyright : (C) Ivan Lucena
email : ivan.lucena at pmldnet.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 *
@@ -24,28 +24,28 @@
#include "ogrsf_frmts.h"
#include "qgsvectorlayer.h"
-QgsOracleSelectGeoraster::QgsOracleSelectGeoraster(QWidget* parent,
- QgisInterface* iface,
- Qt::WFlags fl) : QDialog(parent, fl), mIface(iface)
+QgsOracleSelectGeoraster::QgsOracleSelectGeoraster( QWidget* parent,
+ QgisInterface* iface,
+ Qt::WFlags fl ) : QDialog( parent, fl ), mIface( iface )
{
- setupUi(this);
+ setupUi( this );
- /*
- * Load the list of connection from the registry
- */
-
- populateConnectionList();
+ /*
+ * Load the list of connection from the registry
+ */
- /*
- * Repeat last selected connection
- */
+ populateConnectionList();
- QSettings settings;
- QString selected = settings.value( "/Oracle/connections/selected" ).toString();
- if ( selected == cmbConnections->currentText() )
- {
- this->connectToServer();
- }
+ /*
+ * Repeat last selected connection
+ */
+
+ QSettings settings;
+ QString selected = settings.value( "/Oracle/connections/selected" ).toString();
+ if ( selected == cmbConnections->currentText() )
+ {
+ connectToServer();
+ }
}
QgsOracleSelectGeoraster::~QgsOracleSelectGeoraster()
@@ -54,268 +54,265 @@
void QgsOracleSelectGeoraster::populateConnectionList()
{
- QSettings settings;
- settings.beginGroup( "/Oracle/connections" );
- QStringList keys = settings.childGroups();
- QStringList::Iterator it = keys.begin();
+ QSettings settings;
+ settings.beginGroup( "/Oracle/connections" );
+ QStringList keys = settings.childGroups();
+ QStringList::Iterator it = keys.begin();
- /*
- * Fillup the combobox with connection names
- */
+ /*
+ * Fillup the combobox with connection names
+ */
- cmbConnections->clear();
- while ( it != keys.end() )
- {
- cmbConnections->addItem( *it );
- ++it;
- }
- settings.endGroup();
- setConnectionListPosition();
+ cmbConnections->clear();
+ while ( it != keys.end() )
+ {
+ cmbConnections->addItem( *it );
+ ++it;
+ }
+ settings.endGroup();
+ setConnectionListPosition();
- /*
- * Update the status of several buttons
- */
+ /*
+ * Update the status of several buttons
+ */
- if ( keys.begin() == keys.end() )
- {
- btnConnect->setEnabled( false );
- btnEdit->setEnabled( false );
- btnDelete->setEnabled( false );
- }
- else
- {
- btnConnect->setEnabled( true );
- btnEdit->setEnabled( true );
- btnDelete->setEnabled( true );
- }
+ if ( keys.begin() == keys.end() )
+ {
+ btnConnect->setEnabled( false );
+ btnEdit->setEnabled( false );
+ btnDelete->setEnabled( false );
+ }
+ else
+ {
+ btnConnect->setEnabled( true );
+ btnEdit->setEnabled( true );
+ btnDelete->setEnabled( true );
+ }
}
void QgsOracleSelectGeoraster::addNewConnection()
{
- QgsOracleConnect *oc = new QgsOracleConnect( this, "New Connection" );
- if ( oc->exec() )
- {
- populateConnectionList();
- }
+ QgsOracleConnect *oc = new QgsOracleConnect( this, "New Connection" );
+ if ( oc->exec() )
+ {
+ populateConnectionList();
+ }
}
void QgsOracleSelectGeoraster::editConnection()
{
- QgsOracleConnect *oc = new QgsOracleConnect( this, cmbConnections->currentText() );
- if ( oc->exec() )
- {
- populateConnectionList();
- }
+ QgsOracleConnect *oc = new QgsOracleConnect( this, cmbConnections->currentText() );
+ if ( oc->exec() )
+ {
+ populateConnectionList();
+ }
}
void QgsOracleSelectGeoraster::deleteConnection()
{
- QSettings settings;
- QString key = "/Oracle/connections/" + cmbConnections->currentText();
- QString msg =
- tr( "Are you sure you want to remove the " ) +
- cmbConnections->currentText() +
- tr( " connection and all associated settings?" );
- QMessageBox::StandardButton result = QMessageBox::information( this,
- tr( "Confirm Delete" ),
- msg,
- QMessageBox::Ok | QMessageBox::Cancel );
- if ( result == QMessageBox::Ok )
- {
- settings.remove( key + "/database" );
- settings.remove( key + "/username" );
- settings.remove( key + "/password" );
- settings.remove( key + "/savepass" );
- settings.remove( key + "/subdtset" );
- settings.remove( key );
- cmbConnections->removeItem( cmbConnections->currentIndex() );
- setConnectionListPosition();
- lineEdit->setText( "" );
- listWidget->clear();
- }
+ QSettings settings;
+ QString key = "/Oracle/connections/" + cmbConnections->currentText();
+ QString msg = tr( "Are you sure you want to remove the %1 connection and all associated settings?" )
+ .arg( cmbConnections->currentText() );
+ QMessageBox::StandardButton result = QMessageBox::information( this,
+ tr( "Confirm Delete" ),
+ msg,
+ QMessageBox::Ok | QMessageBox::Cancel );
+ if ( result == QMessageBox::Ok )
+ {
+ settings.remove( key + "/database" );
+ settings.remove( key + "/username" );
+ settings.remove( key + "/password" );
+ settings.remove( key + "/savepass" );
+ settings.remove( key + "/subdtset" );
+ settings.remove( key );
+ cmbConnections->removeItem( cmbConnections->currentIndex() );
+ setConnectionListPosition();
+ lineEdit->setText( "" );
+ listWidget->clear();
+ }
}
void QgsOracleSelectGeoraster::connectToServer()
{
- QSettings settings;
- QString key = "/Oracle/connections/" + cmbConnections->currentText();
- QString username = settings.value( key + "/username" ).toString();
- QString password = settings.value( key + "/password" ).toString();
- QString savepass = settings.value( key + "/savepass" ).toString();
- QString database = settings.value( key + "/database" ).toString();
- QString subdtset = settings.value( key + "/subdtset" ).toString();
- bool makeConnection = true;
- if ( savepass == "false" )
- {
- makeConnection = false;
- QString password = QInputDialog::getText( this,
- tr( "Password for " ) + username + "/<password>@" + database,
- tr( "Please enter your password:" ),
- QLineEdit::Password,
- QString::null,
- &makeConnection);
- }
- if (makeConnection)
- {
- settings.setValue( "/Oracle/connections/selected",
- cmbConnections->currentText() );
- showSelection( subdtset );
- lineEdit->setText( subdtset );
- }
+ QSettings settings;
+ QString key = "/Oracle/connections/" + cmbConnections->currentText();
+ QString username = settings.value( key + "/username" ).toString();
+ QString password = settings.value( key + "/password" ).toString();
+ QString savepass = settings.value( key + "/savepass" ).toString();
+ QString database = settings.value( key + "/database" ).toString();
+ QString subdtset = settings.value( key + "/subdtset" ).toString();
+ bool makeConnection = true;
+ if ( savepass == "false" )
+ {
+ makeConnection = false;
+ QString password = QInputDialog::getText( this,
+ tr( "Password for %1/<password>@%2" ).arg( username ).arg( database ),
+ tr( "Please enter your password:" ),
+ QLineEdit::Password,
+ QString::null,
+ &makeConnection );
+ }
+ if ( makeConnection )
+ {
+ settings.setValue( "/Oracle/connections/selected",
+ cmbConnections->currentText() );
+ showSelection( subdtset );
+ lineEdit->setText( subdtset );
+ }
}
void QgsOracleSelectGeoraster::showSelection( const QString & line )
{
- QString identification = line;
+ QString identification = line;
- GDALDatasetH hDS = NULL;
- GDALAccess eAccess = GA_ReadOnly;
+ GDALDatasetH hDS = NULL;
+ GDALAccess eAccess = GA_ReadOnly;
- /*
- * Set access mode
- */
+ /*
+ * Set access mode
+ */
- if( checkBox->checkState() == Qt::Checked )
- {
- eAccess = GA_Update;
- }
+ if ( checkBox->checkState() == Qt::Checked )
+ {
+ eAccess = GA_Update;
+ }
- /*
- * Try to open georaster dataset
- */
-
- hDS = GDALOpenShared( identification.toAscii(), eAccess );
+ /*
+ * Try to open georaster dataset
+ */
- btnAdd->setEnabled( false );
- if ( hDS == NULL )
- {
- QMessageBox::information( this,
- tr( "Open failed" ),
- tr( "The connection to " + identification.toAscii() +
- " failed. Please verify your connection parameters."
- " Make sure you have the GDAL GeoRaster plugin installed." ) );
- return;
- }
- btnAdd->setEnabled( true );
+ hDS = GDALOpenShared( identification.toAscii(), eAccess );
- /*
- * Get subdataset list
- */
+ btnAdd->setEnabled( false );
+ if ( hDS == NULL )
+ {
+ QMessageBox::information( this,
+ tr( "Open failed" ),
+ tr( "The connection to %1 failed. Please verify your connection parameters. Make sure you have the GDAL GeoRaster plugin installed." )
+ .arg( identification ) );
+ return;
+ }
+ btnAdd->setEnabled( true );
- char **papszMetadata = NULL;
- papszMetadata = GDALGetMetadata( hDS, "SUBDATASETS" );
- int nSubDatasets = CSLCount( papszMetadata );
+ /*
+ * Get subdataset list
+ */
- /*
- * Add GeoRaster Layer
- */
-
- if ( ! nSubDatasets )
- {
- mIface->addRasterLayer( identification );
- GDALClose(hDS);
- return;
- }
+ char **papszMetadata = NULL;
+ papszMetadata = GDALGetMetadata( hDS, "SUBDATASETS" );
+ int nSubDatasets = CSLCount( papszMetadata );
- /*
- * Save subdataset
- */
+ /*
+ * Add GeoRaster Layer
+ */
- QSettings settings;
- settings.setValue( "/Oracle/connections/" +
- cmbConnections->currentText() + "/subdtset", identification );
+ if ( ! nSubDatasets )
+ {
+ mIface->addRasterLayer( identification );
+ GDALClose( hDS );
+ return;
+ }
- /*
- * List subdatasets
- */
+ /*
+ * Save subdataset
+ */
- QStringList fields = identification.split(',');
- QString count = QString::number( nSubDatasets / 2 );
+ QSettings settings;
+ settings.setValue( "/Oracle/connections/" +
+ cmbConnections->currentText() + "/subdtset", identification );
- QString plural = "s";
-
- if ( count == "1" )
- {
- plural = "";
- }
-
- if ( fields.size() < 4 )
- {
- labelStatus->setText( QString( "%1 GeoRaster table%2" )
- .arg( count ).arg( plural ) );
- checkBox->setEnabled( false );
- }
- else if ( fields.size() == 4 )
- {
- labelStatus->setText( QString( "%1 GeoRaster column%2 on table %3" )
- .arg( count ).arg( plural ).arg( fields[3] ) );
- checkBox->setEnabled( false );
- }
- else if ( fields.size() == 5 )
- {
- labelStatus->setText( QString( "%1 GeoRaster object%2 on table %3 column %4" )
- .arg( count ).arg( plural ).arg( fields[3] ).arg( fields[4] ) );
- checkBox->setEnabled( true );
- }
- else
- {
- labelStatus->setText( QString( "%1 GeoRaster object%2 on table %3 column %4 where %5" )
- .arg( count ).arg( plural ).arg( fields[3] ).arg( fields[4] ).arg( fields[5] ) );
- checkBox->setEnabled( true );
- }
+ /*
+ * List subdatasets
+ */
- /*
- * Populate selection list based on subdataset names
- */
+ QStringList fields = identification.split( ',' );
+ QString count = QString::number( nSubDatasets / 2 );
- listWidget->clear();
- QListWidgetItem *textItem;
-
- for ( int i = 0; i < nSubDatasets; i += 2 )
- {
- QString metadata = papszMetadata[i];
- QStringList subdataset = metadata.split( '=' );
- textItem = new QListWidgetItem( subdataset[1] );
- listWidget->addItem( textItem );
- }
+ QString plural = "s";
- GDALClose(hDS);
+ if ( count == "1" )
+ {
+ plural = "";
+ }
+
+ if ( fields.size() < 4 )
+ {
+ labelStatus->setText( QString( "%1 GeoRaster table%2" )
+ .arg( count ).arg( plural ) );
+ checkBox->setEnabled( false );
+ }
+ else if ( fields.size() == 4 )
+ {
+ labelStatus->setText( QString( "%1 GeoRaster column%2 on table %3" )
+ .arg( count ).arg( plural ).arg( fields[3] ) );
+ checkBox->setEnabled( false );
+ }
+ else if ( fields.size() == 5 )
+ {
+ labelStatus->setText( QString( "%1 GeoRaster object%2 on table %3 column %4" )
+ .arg( count ).arg( plural ).arg( fields[3] ).arg( fields[4] ) );
+ checkBox->setEnabled( true );
+ }
+ else
+ {
+ labelStatus->setText( QString( "%1 GeoRaster object%2 on table %3 column %4 where %5" )
+ .arg( count ).arg( plural ).arg( fields[3] ).arg( fields[4] ).arg( fields[5] ) );
+ checkBox->setEnabled( true );
+ }
+
+ /*
+ * Populate selection list based on subdataset names
+ */
+
+ listWidget->clear();
+ QListWidgetItem *textItem;
+
+ for ( int i = 0; i < nSubDatasets; i += 2 )
+ {
+ QString metadata = papszMetadata[i];
+ QStringList subdataset = metadata.split( '=' );
+ textItem = new QListWidgetItem( subdataset[1] );
+ listWidget->addItem( textItem );
+ }
+
+ GDALClose( hDS );
}
void QgsOracleSelectGeoraster::showHelp()
{
- // implement me
+ // implement me
}
void QgsOracleSelectGeoraster::setConnectionListPosition()
{
- QSettings settings;
- // If possible, set the item currently displayed database
- QString toSelect = settings.value( "/Oracle/connections/selected" ).toString();
- // Does toSelect exist in cmbConnections?
- bool set = false;
- for ( int i = 0; i < cmbConnections->count(); ++ i)
+ QSettings settings;
+ // If possible, set the item currently displayed database
+ QString toSelect = settings.value( "/Oracle/connections/selected" ).toString();
+ // Does toSelect exist in cmbConnections?
+ bool set = false;
+ for ( int i = 0; i < cmbConnections->count(); ++ i )
+ {
+ if ( cmbConnections->itemText( i ) == toSelect )
{
- if ( cmbConnections->itemText(i) == toSelect )
- {
- cmbConnections->setCurrentIndex( i );
- set = true;
- break;
- }
+ cmbConnections->setCurrentIndex( i );
+ set = true;
+ break;
}
- // If we couldn't find the stored item, but there are some,
- // default to the last item (this makes some sense when deleting
- // items as it allows the user to repeatidly click on delete to
- // remove a whole lot of items).
- if ( ! set && cmbConnections->count() > 0 )
- {
- // If toSelect is null, then the selected connection wasn't found
- // by QSettings, which probably means that this is the first time
- // the user has used qgis with database connections, so default to
- // the first in the list of connetions. Otherwise default to the last.
- if ( toSelect.isNull() )
- cmbConnections->setCurrentIndex( 0 );
- else
- cmbConnections->setCurrentIndex( cmbConnections->count() - 1 );
- }
+ }
+ // If we couldn't find the stored item, but there are some,
+ // default to the last item (this makes some sense when deleting
+ // items as it allows the user to repeatidly click on delete to
+ // remove a whole lot of items).
+ if ( ! set && cmbConnections->count() > 0 )
+ {
+ // If toSelect is null, then the selected connection wasn't found
+ // by QSettings, which probably means that this is the first time
+ // the user has used qgis with database connections, so default to
+ // the first in the list of connetions. Otherwise default to the last.
+ if ( toSelect.isNull() )
+ cmbConnections->setCurrentIndex( 0 );
+ else
+ cmbConnections->setCurrentIndex( cmbConnections->count() - 1 );
+ }
}
Modified: trunk/qgis/src/plugins/oracle_raster/qgsselectgeoraster_ui.h
===================================================================
--- trunk/qgis/src/plugins/oracle_raster/qgsselectgeoraster_ui.h 2009-04-15 20:59:33 UTC (rev 10569)
+++ trunk/qgis/src/plugins/oracle_raster/qgsselectgeoraster_ui.h 2009-04-15 21:08:02 UTC (rev 10570)
@@ -4,7 +4,7 @@
begin : Oracle Spatial Plugin
copyright : (C) Ivan Lucena
email : ivan.lucena at pmldnet.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 *
@@ -33,15 +33,15 @@
{
Q_OBJECT
-public:
- QgsOracleSelectGeoraster(QWidget* parent, QgisInterface* iface, Qt::WFlags fl = 0);
+ public:
+ QgsOracleSelectGeoraster( QWidget* parent, QgisInterface* iface, Qt::WFlags fl = 0 );
~QgsOracleSelectGeoraster();
-private:
+ private:
QgisInterface* mIface;
QString mUri;
-private:
+ private:
void addNewConnection();
void editConnection();
void deleteConnection();
@@ -51,43 +51,43 @@
void setConnectionListPosition();
void showSelection( const QString & line );
-public slots:
+ public slots:
void on_btnNew_clicked()
{
- addNewConnection();
+ addNewConnection();
};
void on_btnEdit_clicked()
{
- editConnection();
+ editConnection();
};
void on_btnDelete_clicked()
{
- deleteConnection();
+ deleteConnection();
};
void on_btnConnect_clicked()
{
- connectToServer();
+ connectToServer();
};
void on_listWidget_clicked( QModelIndex Index )
{
- if( lineEdit->text() == listWidget->currentItem()->text() )
- {
- showSelection( lineEdit->text() );
- }
- else
- {
- lineEdit->setText( listWidget->currentItem()->text() );
- }
+ if ( lineEdit->text() == listWidget->currentItem()->text() )
+ {
+ showSelection( lineEdit->text() );
+ }
+ else
+ {
+ lineEdit->setText( listWidget->currentItem()->text() );
+ }
}
void on_btnAdd_clicked()
{
- showSelection( lineEdit->text() );
+ showSelection( lineEdit->text() );
};
};
More information about the QGIS-commit
mailing list