Index: src/plugins/oracle/qgsoracle_plugin.cpp
===================================================================
--- src/plugins/oracle/qgsoracle_plugin.cpp (revision 0)
+++ src/plugins/oracle/qgsoracle_plugin.cpp (revision 0)
@@ -0,0 +1,153 @@
+/***************************************************************************
+ oracleplugin.cpp Access Oracle Spatial Plugin
+ -------------------
+ begin : Oracle Spatial Plugin
+ copyright : (C) Ivan Lucena
+ email : ivan.lucena@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 *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/* $Id$ */
+
+#include "qgsoracle_plugin.h"
+#include "qgsselectgeoraster_ui.h"
+
+static const char * const sIdent = "$Id: oracleplugin.cpp $";
+static const QString sName = QObject::tr("Oracle Spatial");
+static const QString sDescription = QObject::tr("Access Oracle Spatial Data");
+static const QString sPluginVersion = QObject::tr("Version 0.1");
+static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
+
+//////////////////////////////////////////////////////////////////////
+//
+// THE FOLLOWING METHODS ARE MANDATORY FOR ALL PLUGINS
+//
+//////////////////////////////////////////////////////////////////////
+
+/**
+ * Constructor for the plugin. The plugin is passed a pointer
+ * 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()
+{
+
+}
+
+/*
+ * Initialize the GUI interface for the plugin - this is only called once when the plugin is
+ * added to the plugin registry in the QGIS application.
+ */
+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);
+
+}
+//method defined in interface
+
+void QgsOraclePlugin::help()
+{
+ //implement me!
+}
+
+// Slot called when the menu item is triggered
+// If you created more menu items / toolbar buttons in initiGui, you should
+// create a separate handler for each action - this single run() method will
+// not be enough
+
+void QgsOraclePlugin::run()
+{
+ QgsOracleSelectGeoraster *myPluginGui = new QgsOracleSelectGeoraster(mQGisIface->mainWindow(), mQGisIface, QgisGui::ModalDialogFlags);
+ myPluginGui->setAttribute(Qt::WA_DeleteOnClose);
+
+ 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;
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+//
+//
+// THE FOLLOWING CODE IS AUTOGENERATED BY THE PLUGIN BUILDER SCRIPT
+// YOU WOULD NORMALLY NOT NEED TO MODIFY THIS, AND YOUR PLUGIN
+// MAY NOT WORK PROPERLY IF YOU MODIFY THIS INCORRECTLY
+//
+//
+//////////////////////////////////////////////////////////////////////////
+
+
+/**
+ * Required extern functions needed for every plugin
+ * These functions can be called prior to creating an instance
+ * of the plugin class
+ */
+// Class factory to return a new instance of the plugin class
+
+QGISEXTERN QgisPlugin * classFactory(QgisInterface * 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 the description
+
+QGISEXTERN QString description()
+{
+ return sDescription;
+}
+
+// Return the type (either UI or MapLayer plugin)
+
+QGISEXTERN int type()
+{
+ return sPluginType;
+}
+
+// Return the version number for the plugin
+
+QGISEXTERN QString version()
+{
+ return sPluginVersion;
+}
+
+// Delete ourself
+
+QGISEXTERN void unload(QgisPlugin * thePluginPointer)
+{
+ delete thePluginPointer;
+}
Index: src/plugins/oracle/qgsoracleconnectbase.ui
===================================================================
--- src/plugins/oracle/qgsoracleconnectbase.ui (revision 0)
+++ src/plugins/oracle/qgsoracleconnectbase.ui (revision 0)
@@ -0,0 +1,248 @@
+
+ OracleConnectGuiBase
+
+
+
+ 0
+ 0
+ 436
+ 207
+
+
+
+ Create Oracle Connection
+
+
+
+
+
+
+
+
+
+ 339
+ 11
+ 89
+ 189
+
+
+
+
+ 6
+
+
+ 0
+
+ -
+
+
+ OK
+
+
+
+
+
+ true
+
+
+ true
+
+
+
+ -
+
+
+ Cancel
+
+
+
+
+
+ true
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Expanding
+
+
+
+ 87
+ 121
+
+
+
+
+
+
+
+
+
+ 10
+ 10
+ 322
+ 191
+
+
+
+ Connection Information
+
+
+
+ 0
+
+
+ 0
+
+ -
+
+
+ 6
+
+
+ 0
+
+
-
+
+
+ 6
+
+
+ 0
+
+
-
+
+
+ Name
+
+
+ txtName
+
+
+
+ -
+
+
+ Database instance
+
+
+ txtDatabase
+
+
+
+ -
+
+
+ Username
+
+
+ txtUsername
+
+
+
+ -
+
+
+ Password
+
+
+ txtPassword
+
+
+
+
+
+ -
+
+
+ 6
+
+
+ 0
+
+
-
+
+
+ Name of the new connection
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ QLineEdit::Password
+
+
+
+
+
+
+
+ -
+
+
+ 6
+
+
+ 0
+
+
-
+
+
+ Save Password
+
+
+
+
+
+
+
+
+
+
+
+
+ btnOk
+ clicked()
+ OracleConnectGuiBase
+ accept()
+
+
+ 383
+ 24
+
+
+ 217
+ 103
+
+
+
+
+ btnCancel
+ clicked()
+ OracleConnectGuiBase
+ reject()
+
+
+ 383
+ 56
+
+
+ 217
+ 103
+
+
+
+
+
Index: src/plugins/oracle/qgsoracle_plugin.h
===================================================================
--- src/plugins/oracle/qgsoracle_plugin.h (revision 0)
+++ src/plugins/oracle/qgsoracle_plugin.h (revision 0)
@@ -0,0 +1,65 @@
+/***************************************************************************
+ oracleplugin.h
+ -------------------
+ begin : Oracle Spatial Plugin
+ copyright : (C) Ivan Lucena
+ email : ivan.lucena@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 *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/* $Id$ */
+
+#ifndef OraclePlugin_H
+#define OraclePlugin_H
+
+// Qt Includes
+#include
+#include
+
+// QGIS Includes
+#include
+#include
+#include
+
+class QgsOraclePlugin : public QObject, public QgisPlugin
+{
+ Q_OBJECT
+
+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);
+ //! Destructor
+ virtual ~QgsOraclePlugin();
+
+public slots:
+
+ //! init the gui
+ virtual void initGui();
+ //! Show the dialog box
+ void run();
+ //! unload the plugin
+ void unload();
+ //! show the help document
+ void help();
+
+private:
+
+ int mPluginType;
+ //! Pointer to the QGIS interface object
+ QgisInterface *mQGisIface;
+ //!pointer to the qaction for this plugin
+ QAction * mQActionPointer;
+
+};
+
+#endif //OraclePlugin_H
Index: src/plugins/oracle/qgsselectgeoraster_ui.cpp
===================================================================
--- src/plugins/oracle/qgsselectgeoraster_ui.cpp (revision 0)
+++ src/plugins/oracle/qgsselectgeoraster_ui.cpp (revision 0)
@@ -0,0 +1,302 @@
+/***************************************************************************
+ oracleselectgui.cpp
+ -------------------
+ begin : Oracle Spatial Plugin
+ copyright : (C) Ivan Lucena
+ email : ivan.lucena@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 *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/* $Id$ */
+
+#include "qgsselectgeoraster_ui.h"
+#include "qgsoracleconnect_ui.h"
+
+//GDAL includes
+#include "gdal.h"
+#include "ogr_api.h"
+#include "ogrsf_frmts.h"
+
+QgsOracleSelectGeoraster::QgsOracleSelectGeoraster(QWidget* parent,
+ QgisInterface* iface,
+ Qt::WFlags fl) : QDialog(parent, fl), mIface(iface)
+{
+ setupUi(this);
+ /*
+ * Load the list of connection from the registry
+ */
+ populateConnectionList();
+}
+
+QgsOracleSelectGeoraster::~QgsOracleSelectGeoraster()
+{
+}
+
+void QgsOracleSelectGeoraster::populateConnectionList()
+{
+ QSettings settings;
+ settings.beginGroup("/Oracle/connections");
+ QStringList keys = settings.childGroups();
+ QStringList::Iterator it = keys.begin();
+
+ /*
+ * Fillup the combobox with connection names
+ */
+
+ cmbConnections->clear();
+ while (it != keys.end())
+ {
+ cmbConnections->addItem(*it);
+ ++it;
+ }
+ settings.endGroup();
+ setConnectionListPosition();
+
+ /*
+ * 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);
+ }
+}
+
+void QgsOracleSelectGeoraster::addNewConnection()
+{
+ 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();
+ }
+}
+
+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);
+ cmbConnections->removeItem(cmbConnections->currentIndex());
+ setConnectionListPosition();
+ }
+}
+
+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 database = settings.value(key + "/database").toString();
+ QString connString = "GEOR:" + username + "/" + password + "@" + database;
+ bool makeConnection = true;
+ if (password == QString::null)
+ {
+ makeConnection = false;
+ QString password = QInputDialog::getText(this,
+ tr("Password for ") + username + "/@" + database,
+ tr("Please enter your password:"),
+ QLineEdit::Password,
+ QString::null,
+ &makeConnection);
+ }
+ if (makeConnection)
+ {
+ settings.setValue("/Oracle/connections/selected",
+ cmbConnections->currentText());
+ showSelection(connString);
+ }
+}
+
+void QgsOracleSelectGeoraster::showSelection(const QString & line)
+{
+ QString identification;
+
+ if (line == "..")
+ {
+ identification = mLastQuery;
+ }
+ else
+ {
+ identification = line;
+ }
+
+ GDALDatasetH hDS = NULL;
+ GDALAccess eAccess = GA_ReadOnly;
+
+ /*
+ * Set access mode
+ */
+
+ if( checkBox->checkState() == Qt::Checked)
+ {
+ eAccess = GA_Update;
+ }
+
+ /*
+ * Try to open georaster dataset
+ */
+
+ hDS = GDALOpenShared(identification.toAscii(), eAccess);
+
+ 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);
+
+ char **papszMetadata = NULL;
+ papszMetadata = GDALGetMetadata(hDS, "SUBDATASETS");
+ int nSubDatasets = CSLCount(papszMetadata);
+
+ /*
+ * Add GeoRaster Layer
+ */
+
+ if (!nSubDatasets)
+ {
+ mIface->addRasterLayer(identification);
+ GDALClose(hDS);
+ return;
+ }
+
+ /*
+ * List subdatasets
+ */
+
+ QStringList fields = identification.split(',');
+ QString count = QString::number(nSubDatasets/2);
+
+ 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);
+ }
+
+ /*
+ * Populate selection list based on subdataset names
+ */
+
+ //TODO: Change thar list to a QTreeWidget or QTableWidget
+
+ listWidget->clear();
+ QListWidgetItem *textItem;
+
+ if (fields.size() > 3)
+ {
+ textItem = new QListWidgetItem("..");
+ listWidget->addItem(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
+}
+
+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)
+ {
+ if (cmbConnections->itemText(i) == toSelect)
+ {
+ 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);
+ }
+}
+
Index: src/plugins/oracle/oracleplugin.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: src/plugins/oracle/oracleplugin.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: src/plugins/oracle/oracleplugin.qrc
===================================================================
--- src/plugins/oracle/oracleplugin.qrc (revision 0)
+++ src/plugins/oracle/oracleplugin.qrc (revision 0)
@@ -0,0 +1,5 @@
+
+
+ oracleplugin.png
+
+
Index: src/plugins/oracle/qgsoracleconnect_ui.cpp
===================================================================
--- src/plugins/oracle/qgsoracleconnect_ui.cpp (revision 0)
+++ src/plugins/oracle/qgsoracleconnect_ui.cpp (revision 0)
@@ -0,0 +1,83 @@
+/***************************************************************************
+ oracleconnectgui.cpp
+ -------------------
+ begin : Oracle Spatial Plugin
+ copyright : (C) Ivan Lucena
+ email : ivan.lucena@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 *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/* $Id$ */
+
+#include "qgsoracleconnect_ui.h"
+
+// Qt Includes
+#include
+#include
+
+QgsOracleConnect::QgsOracleConnect(QWidget* parent,
+ const QString& connName,
+ Qt::WFlags fl) : QDialog(parent, fl)
+{
+ setupUi(this);
+
+ if (!connName.isEmpty())
+ {
+ // populate the dialog with the information stored for the connection
+ // populate the fields with the stored setting parameters
+
+ QSettings settings;
+
+ QString key = "/Oracle/connections/" + connName;
+
+ txtDatabase->setText(settings.value(key + "/database").toString());
+ txtUsername->setText(settings.value(key + "/username").toString());
+
+ if (settings.value(key + "/save").toString() == "true")
+ {
+ txtPassword->setText(settings.value(key + "/password").toString());
+ chkStorePassword->setChecked(true);
+ }
+ txtName->setText(connName);
+ }
+}
+
+QgsOracleConnect::~QgsOracleConnect()
+{
+}
+
+void QgsOracleConnect::on_btnCancel_clicked()
+{
+ helpInfo();
+}
+
+void QgsOracleConnect::on_btnOk_clicked()
+{
+ saveConnection();
+}
+
+void QgsOracleConnect::saveConnection()
+{
+ QSettings settings;
+
+ 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());
+
+ accept();
+}
+
+void QgsOracleConnect::helpInfo()
+{
+ // QgsContextHelp::run( context_id );
+}
+
Index: src/plugins/oracle/qgsselectgeorasterbase.new
===================================================================
--- src/plugins/oracle/qgsselectgeorasterbase.new (revision 0)
+++ src/plugins/oracle/qgsselectgeorasterbase.new (revision 0)
@@ -0,0 +1,336 @@
+
+ SelectGeoRasterBase
+
+
+
+ 0
+ 0
+ 480
+ 505
+
+
+
+ Select Oracle Spatial GeoRaster
+
+
+
+ ../../ui../../ui
+
+
+ true
+
+
+ true
+
+
+
+ 9
+
+
+ 6
+
+ -
+
+
+ Server Connections
+
+
+
+ 9
+
+
+ 6
+
+
-
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Expanding
+
+
+
+ 131
+ 30
+
+
+
+
+ -
+
+
+ -
+
+
+ false
+
+
+ C&onnect
+
+
+
+ -
+
+
+ false
+
+
+ Edit
+
+
+
+ -
+
+
+ false
+
+
+ Delete
+
+
+
+ -
+
+
+ &New
+
+
+
+
+
+
+ -
+
+
+ Selection
+
+
+
+ 6
+
+
+ 9
+
+
-
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+ Update
+
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Ready
+
+
+ false
+
+
+
+ -
+
+
+ false
+
+
+ &Add
+
+
+ Alt+A
+
+
+ true
+
+
+ true
+
+
+
+ -
+
+
+ Layers
+
+
+
+ 6
+
+
+ 9
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+ QAbstractItemView::MultiSelection
+
+
+ true
+
+
+
+ ID
+
+
+
+
+ Name
+
+
+
+
+ Title
+
+
+
+
+ Abstract
+
+
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 16
+ 64
+
+
+
+ Subdatasets
+
+
+
+
+ 11
+ 20
+ 420
+ 31
+
+
+
+
+ 0
+ 0
+
+
+
+ false
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Expanding
+
+
+
+ 284
+ 31
+
+
+
+
+ -
+
+
+ true
+
+
+ Help
+
+
+ F1
+
+
+ true
+
+
+
+ -
+
+
+ C&lose
+
+
+ Alt+L
+
+
+ true
+
+
+
+
+
+
+
+ cmbConnections
+ btnConnect
+ btnNew
+ btnEdit
+ btnDelete
+ btnHelp
+ btnAdd
+ btnCancel
+
+
+
+
+ btnCancel
+ clicked()
+ SelectGeoRasterBase
+ reject()
+
+
+ 410
+ 457
+
+
+ 229
+ 252
+
+
+
+
+
Index: src/plugins/oracle/qgsselectgeoraster_ui.h
===================================================================
--- src/plugins/oracle/qgsselectgeoraster_ui.h (revision 0)
+++ src/plugins/oracle/qgsselectgeoraster_ui.h (revision 0)
@@ -0,0 +1,89 @@
+/***************************************************************************
+ oracleselectgui.h
+ -------------------
+ begin : Oracle Spatial Plugin
+ copyright : (C) Ivan Lucena
+ email : ivan.lucena@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 *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/* $Id$ */
+
+#ifndef OraclePluginGUI_H
+#define OraclePluginGUI_H
+
+// Qt Designer Includes
+#include "ui_qgsselectgeorasterbase.h"
+
+//Qt includes
+#include
+#include
+#include
+
+// QGIS Includes
+#include
+#include
+
+class QgsOracleSelectGeoraster : public QDialog, private Ui::SelectGeoRasterBase
+{
+ Q_OBJECT
+
+public:
+ QgsOracleSelectGeoraster(QWidget* parent, QgisInterface* iface, Qt::WFlags fl = 0);
+ ~QgsOracleSelectGeoraster();
+
+private:
+ QgisInterface* mIface;
+ QString mUri;
+ QString mLastQuery;
+
+private:
+ void addNewConnection();
+ void editConnection();
+ void deleteConnection();
+ void populateConnectionList();
+ void connectToServer();
+ void showHelp();
+ void setConnectionListPosition();
+ void showSelection(const QString & line);
+
+public slots:
+
+ void on_btnNew_clicked()
+ {
+ addNewConnection();
+ };
+
+ void on_btnEdit_clicked()
+ {
+ editConnection();
+ };
+
+ void on_btnDelete_clicked()
+ {
+ deleteConnection();
+ };
+
+ void on_btnConnect_clicked()
+ {
+ connectToServer();
+ };
+
+ void on_listWidget_clicked(QModelIndex Index)
+ {
+ lineEdit->setText(listWidget->currentItem()->text());
+ }
+
+ void on_btnAdd_clicked()
+ {
+ showSelection(lineEdit->text());
+ };
+
+};
+
+#endif
Index: src/plugins/oracle/CMakeLists.txt
===================================================================
--- src/plugins/oracle/CMakeLists.txt (revision 0)
+++ src/plugins/oracle/CMakeLists.txt (revision 0)
@@ -0,0 +1,54 @@
+
+########################################################
+# Files
+
+SET (ORACLE_SRCS
+ qgsoracle_plugin.cpp
+ qgsselectgeoraster_ui.cpp
+ qgsoracleconnect_ui.cpp
+)
+
+SET (ORACLE_UIS
+ qgsselectgeorasterbase.ui
+ qgsoracleconnectbase.ui
+)
+
+SET (ORACLE_MOC_HDRS
+ qgsoracle_plugin.h
+ qgsselectgeoraster_ui.h
+ qgsoracleconnect_ui.h
+)
+
+SET (ORACLE_RCCS oracleplugin.qrc)
+
+########################################################
+# Build
+
+QT4_WRAP_UI (ORACLE_UIS_H ${ORACLE_UIS})
+
+QT4_WRAP_CPP (ORACLE_MOC_SRCS ${ORACLE_MOC_HDRS})
+
+QT4_ADD_RESOURCES(ORACLE_RCC_SRCS ${ORACLE_RCCS})
+
+ADD_LIBRARY (oracleplugin MODULE ${ORACLE_SRCS} ${ORACLE_MOC_SRCS} ${ORACLE_RCC_SRCS} ${ORACLE_UIS_H})
+
+INCLUDE_DIRECTORIES(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ../../core ../../core/raster ../../core/renderer ../../core/symbology
+ ../../gui
+ ..
+)
+
+TARGET_LINK_LIBRARIES(oracleplugin
+ qgis_core
+ qgis_gui
+)
+
+
+########################################################
+# Install
+
+INSTALL(TARGETS oracleplugin
+ RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
+ LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
+
Index: src/plugins/oracle/qgsselectgeorasterbase.ui
===================================================================
--- src/plugins/oracle/qgsselectgeorasterbase.ui (revision 0)
+++ src/plugins/oracle/qgsselectgeorasterbase.ui (revision 0)
@@ -0,0 +1,284 @@
+
+ SelectGeoRasterBase
+
+
+
+ 0
+ 0
+ 461
+ 454
+
+
+
+ Select Oracle Spatial GeoRaster
+
+
+
+ ../../ui../../ui
+
+
+ true
+
+
+ true
+
+
+
+ 9
+
+
+ 6
+
+ -
+
+
+ Server Connections
+
+
+
+ 9
+
+
+ 6
+
+
-
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Expanding
+
+
+
+ 131
+ 30
+
+
+
+
+ -
+
+
+ -
+
+
+ false
+
+
+ C&onnect
+
+
+
+ -
+
+
+ false
+
+
+ Edit
+
+
+
+ -
+
+
+ false
+
+
+ Delete
+
+
+
+ -
+
+
+ &New
+
+
+
+
+
+
+ -
+
+
+ Selection
+
+
+
+ 6
+
+
+ 9
+
+
-
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+ false
+
+
+ Update
+
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Ready
+
+
+ false
+
+
+
+ -
+
+
+ false
+
+
+ &Select
+
+
+ Alt+A
+
+
+ true
+
+
+ true
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 16
+ 64
+
+
+
+ Subdatasets
+
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+ false
+
+
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Expanding
+
+
+
+ 284
+ 31
+
+
+
+
+ -
+
+
+ true
+
+
+ Help
+
+
+ F1
+
+
+ true
+
+
+
+ -
+
+
+ C&lose
+
+
+ Alt+L
+
+
+ true
+
+
+
+
+
+
+
+ cmbConnections
+ btnConnect
+ btnNew
+ btnEdit
+ btnDelete
+ btnHelp
+ btnAdd
+ btnCancel
+
+
+
+
+ btnCancel
+ clicked()
+ SelectGeoRasterBase
+ reject()
+
+
+ 410
+ 457
+
+
+ 229
+ 252
+
+
+
+
+
Index: src/plugins/oracle/qgsoracleconnect_ui.h
===================================================================
--- src/plugins/oracle/qgsoracleconnect_ui.h (revision 0)
+++ src/plugins/oracle/qgsoracleconnect_ui.h (revision 0)
@@ -0,0 +1,46 @@
+/***************************************************************************
+ oracleconnectgui.u
+ -------------------
+ begin : Oracle Spatial Plugin
+ copyright : (C) Ivan Lucena
+ email : ivan.lucena@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 *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+/* $Id$ */
+
+#ifndef QgsOracleConnect_H
+#define QgsOracleConnect_H
+
+// Qt Designer Includes
+#include "ui_qgsoracleconnectbase.h"
+
+// QGIS Includes
+#include
+
+class QgsOracleConnect : public QDialog, private Ui::OracleConnectGuiBase
+{
+ Q_OBJECT
+
+public:
+ QgsOracleConnect(QWidget* parent = 0,
+ const QString& connName = QString::null,
+ Qt::WFlags fl = QgisGui::ModalDialogFlags);
+ ~QgsOracleConnect();
+
+private:
+ void saveConnection();
+ void helpInfo();
+
+public slots:
+ void on_btnOk_clicked();
+ void on_btnCancel_clicked();
+ void on_btnHelp_clicked();
+};
+
+#endif /* _ORACLECONNECTGUI_H */