patch_for_oralce_plugin_1593.txt

Path for Oracle Plugin - ilucena -, 2009-03-24 08:32 PM

Download (49.1 KB)

 
1
Index: src/plugins/oracle/qgsoracle_plugin.cpp
2
===================================================================
3
--- src/plugins/oracle/qgsoracle_plugin.cpp	(revision 0)
4
+++ src/plugins/oracle/qgsoracle_plugin.cpp	(revision 0)
5
@@ -0,0 +1,153 @@
6
+/***************************************************************************
7
+    oracleplugin.cpp  Access Oracle Spatial Plugin
8
+    -------------------
9
+    begin                : Oracle Spatial Plugin
10
+    copyright            : (C) Ivan Lucena
11
+    email                : [email protected]
12
+/***************************************************************************
13
+ *                                                                         *
14
+ *   This program is free software; you can redistribute it and/or modify  *
15
+ *   it under the terms of the GNU General Public License as published by  *
16
+ *   the Free Software Foundation; either version 2 of the License, or     *
17
+ *   (at your option) any later version.                                   *
18
+ *                                                                         *
19
+ ***************************************************************************/
20
+/* $Id$ */
21
+
22
+#include "qgsoracle_plugin.h"
23
+#include "qgsselectgeoraster_ui.h"
24
+
25
+static const char * const sIdent = "$Id: oracleplugin.cpp  $";
26
+static const QString sName = QObject::tr("Oracle Spatial");
27
+static const QString sDescription = QObject::tr("Access Oracle Spatial Data");
28
+static const QString sPluginVersion = QObject::tr("Version 0.1");
29
+static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
30
+
31
+//////////////////////////////////////////////////////////////////////
32
+//
33
+// THE FOLLOWING METHODS ARE MANDATORY FOR ALL PLUGINS
34
+//
35
+//////////////////////////////////////////////////////////////////////
36
+
37
+/**
38
+ * Constructor for the plugin. The plugin is passed a pointer
39
+ * an interface object that provides access to exposed functions in QGIS.
40
+ * @param theQGisInterface - Pointer to the QGIS interface object
41
+ */
42
+QgsOraclePlugin::QgsOraclePlugin(QgisInterface * theQgisInterface) :
43
+QgisPlugin(sName, sDescription, sPluginVersion, sPluginType),
44
+mQGisIface(theQgisInterface)
45
+{
46
+}
47
+
48
+QgsOraclePlugin::~QgsOraclePlugin()
49
+{
50
+
51
+}
52
+
53
+/*
54
+ * Initialize the GUI interface for the plugin - this is only called once when the plugin is
55
+ * added to the plugin registry in the QGIS application.
56
+ */
57
+void QgsOraclePlugin::initGui()
58
+{
59
+
60
+    // Create the action for tool
61
+    mQActionPointer = new QAction(QIcon(":/oracleplugin/oracleplugin.png"), tr("Select GeoRaster"), this);
62
+    // Set the what's this text
63
+    mQActionPointer->setWhatsThis(tr("Open a Oracle Spatial GeoRaster"));
64
+    // Connect the action to the run
65
+    connect(mQActionPointer, SIGNAL(triggered()), this, SLOT(run()));
66
+    // Add the icon to the toolbar
67
+    mQGisIface->addToolBarIcon(mQActionPointer);
68
+    mQGisIface->addPluginToMenu(tr("&Oracle Spatial"), mQActionPointer);
69
+
70
+}
71
+//method defined in interface
72
+
73
+void QgsOraclePlugin::help()
74
+{
75
+    //implement me!
76
+}
77
+
78
+// Slot called when the menu item is triggered
79
+// If you created more menu items / toolbar buttons in initiGui, you should
80
+// create a separate handler for each action - this single run() method will
81
+// not be enough
82
+
83
+void QgsOraclePlugin::run()
84
+{
85
+    QgsOracleSelectGeoraster *myPluginGui = new QgsOracleSelectGeoraster(mQGisIface->mainWindow(), mQGisIface, QgisGui::ModalDialogFlags);
86
+    myPluginGui->setAttribute(Qt::WA_DeleteOnClose);
87
+
88
+    myPluginGui->show();
89
+}
90
+
91
+// Unload the plugin by cleaning up the GUI
92
+
93
+void QgsOraclePlugin::unload()
94
+{
95
+    // remove the GUI
96
+    mQGisIface->removePluginMenu("&Oracle Spatial", mQActionPointer);
97
+    mQGisIface->removeToolBarIcon(mQActionPointer);
98
+    delete mQActionPointer;
99
+}
100
+
101
+
102
+//////////////////////////////////////////////////////////////////////////
103
+//
104
+//
105
+//  THE FOLLOWING CODE IS AUTOGENERATED BY THE PLUGIN BUILDER SCRIPT
106
+//    YOU WOULD NORMALLY NOT NEED TO MODIFY THIS, AND YOUR PLUGIN
107
+//      MAY NOT WORK PROPERLY IF YOU MODIFY THIS INCORRECTLY
108
+//
109
+//
110
+//////////////////////////////////////////////////////////////////////////
111
+
112
+
113
+/**
114
+ * Required extern functions needed  for every plugin
115
+ * These functions can be called prior to creating an instance
116
+ * of the plugin class
117
+ */
118
+// Class factory to return a new instance of the plugin class
119
+
120
+QGISEXTERN QgisPlugin * classFactory(QgisInterface * theQgisInterfacePointer)
121
+{
122
+    return new QgsOraclePlugin(theQgisInterfacePointer);
123
+}
124
+// Return the name of the plugin - note that we do not user class members as
125
+// the class may not yet be insantiated when this method is called.
126
+
127
+QGISEXTERN QString name()
128
+{
129
+    return sName;
130
+}
131
+
132
+// Return the description
133
+
134
+QGISEXTERN QString description()
135
+{
136
+    return sDescription;
137
+}
138
+
139
+// Return the type (either UI or MapLayer plugin)
140
+
141
+QGISEXTERN int type()
142
+{
143
+    return sPluginType;
144
+}
145
+
146
+// Return the version number for the plugin
147
+
148
+QGISEXTERN QString version()
149
+{
150
+    return sPluginVersion;
151
+}
152
+
153
+// Delete ourself
154
+
155
+QGISEXTERN void unload(QgisPlugin * thePluginPointer)
156
+{
157
+    delete thePluginPointer;
158
+}
159
Index: src/plugins/oracle/qgsoracleconnectbase.ui
160
===================================================================
161
--- src/plugins/oracle/qgsoracleconnectbase.ui	(revision 0)
162
+++ src/plugins/oracle/qgsoracleconnectbase.ui	(revision 0)
163
@@ -0,0 +1,248 @@
164
+<ui version="4.0" >
165
+ <class>OracleConnectGuiBase</class>
166
+ <widget class="QDialog" name="OracleConnectGuiBase" >
167
+  <property name="geometry" >
168
+   <rect>
169
+    <x>0</x>
170
+    <y>0</y>
171
+    <width>436</width>
172
+    <height>207</height>
173
+   </rect>
174
+  </property>
175
+  <property name="windowTitle" >
176
+   <string>Create Oracle Connection</string>
177
+  </property>
178
+  <property name="windowIcon" >
179
+   <iconset>
180
+    <normaloff/>
181
+   </iconset>
182
+  </property>
183
+  <widget class="QWidget" name="layoutWidget" >
184
+   <property name="geometry" >
185
+    <rect>
186
+     <x>339</x>
187
+     <y>11</y>
188
+     <width>89</width>
189
+     <height>189</height>
190
+    </rect>
191
+   </property>
192
+   <layout class="QVBoxLayout" name="boxConfirm" >
193
+    <property name="spacing" >
194
+     <number>6</number>
195
+    </property>
196
+    <property name="margin" >
197
+     <number>0</number>
198
+    </property>
199
+    <item>
200
+     <widget class="QPushButton" name="btnOk" >
201
+      <property name="text" >
202
+       <string>OK</string>
203
+      </property>
204
+      <property name="shortcut" >
205
+       <string/>
206
+      </property>
207
+      <property name="autoDefault" >
208
+       <bool>true</bool>
209
+      </property>
210
+      <property name="default" >
211
+       <bool>true</bool>
212
+      </property>
213
+     </widget>
214
+    </item>
215
+    <item>
216
+     <widget class="QPushButton" name="btnCancel" >
217
+      <property name="text" >
218
+       <string>Cancel</string>
219
+      </property>
220
+      <property name="shortcut" >
221
+       <string/>
222
+      </property>
223
+      <property name="autoDefault" >
224
+       <bool>true</bool>
225
+      </property>
226
+     </widget>
227
+    </item>
228
+    <item>
229
+     <spacer>
230
+      <property name="orientation" >
231
+       <enum>Qt::Vertical</enum>
232
+      </property>
233
+      <property name="sizeType" >
234
+       <enum>QSizePolicy::Expanding</enum>
235
+      </property>
236
+      <property name="sizeHint" stdset="0" >
237
+       <size>
238
+        <width>87</width>
239
+        <height>121</height>
240
+       </size>
241
+      </property>
242
+     </spacer>
243
+    </item>
244
+   </layout>
245
+  </widget>
246
+  <widget class="QGroupBox" name="GroupBox1" >
247
+   <property name="geometry" >
248
+    <rect>
249
+     <x>10</x>
250
+     <y>10</y>
251
+     <width>322</width>
252
+     <height>191</height>
253
+    </rect>
254
+   </property>
255
+   <property name="title" >
256
+    <string>Connection Information</string>
257
+   </property>
258
+   <layout class="QVBoxLayout" name="_2" >
259
+    <property name="spacing" >
260
+     <number>0</number>
261
+    </property>
262
+    <property name="margin" >
263
+     <number>0</number>
264
+    </property>
265
+    <item>
266
+     <layout class="QHBoxLayout" name="boxFields" >
267
+      <property name="spacing" >
268
+       <number>6</number>
269
+      </property>
270
+      <property name="margin" >
271
+       <number>0</number>
272
+      </property>
273
+      <item>
274
+       <layout class="QVBoxLayout" name="boxFieldLabels" >
275
+        <property name="spacing" >
276
+         <number>6</number>
277
+        </property>
278
+        <property name="margin" >
279
+         <number>0</number>
280
+        </property>
281
+        <item>
282
+         <widget class="QLabel" name="TextLabel1_2" >
283
+          <property name="text" >
284
+           <string>Name</string>
285
+          </property>
286
+          <property name="buddy" >
287
+           <cstring>txtName</cstring>
288
+          </property>
289
+         </widget>
290
+        </item>
291
+        <item>
292
+         <widget class="QLabel" name="TextLabel2" >
293
+          <property name="text" >
294
+           <string>Database instance</string>
295
+          </property>
296
+          <property name="buddy" >
297
+           <cstring>txtDatabase</cstring>
298
+          </property>
299
+         </widget>
300
+        </item>
301
+        <item>
302
+         <widget class="QLabel" name="TextLabel3" >
303
+          <property name="text" >
304
+           <string>Username</string>
305
+          </property>
306
+          <property name="buddy" >
307
+           <cstring>txtUsername</cstring>
308
+          </property>
309
+         </widget>
310
+        </item>
311
+        <item>
312
+         <widget class="QLabel" name="TextLabel3_2" >
313
+          <property name="text" >
314
+           <string>Password</string>
315
+          </property>
316
+          <property name="buddy" >
317
+           <cstring>txtPassword</cstring>
318
+          </property>
319
+         </widget>
320
+        </item>
321
+       </layout>
322
+      </item>
323
+      <item>
324
+       <layout class="QVBoxLayout" name="boxFieldEntries" >
325
+        <property name="spacing" >
326
+         <number>6</number>
327
+        </property>
328
+        <property name="margin" >
329
+         <number>0</number>
330
+        </property>
331
+        <item>
332
+         <widget class="QLineEdit" name="txtName" >
333
+          <property name="toolTip" >
334
+           <string>Name of the new connection</string>
335
+          </property>
336
+         </widget>
337
+        </item>
338
+        <item>
339
+         <widget class="QLineEdit" name="txtDatabase" />
340
+        </item>
341
+        <item>
342
+         <widget class="QLineEdit" name="txtUsername" />
343
+        </item>
344
+        <item>
345
+         <widget class="QLineEdit" name="txtPassword" >
346
+          <property name="echoMode" >
347
+           <enum>QLineEdit::Password</enum>
348
+          </property>
349
+         </widget>
350
+        </item>
351
+       </layout>
352
+      </item>
353
+     </layout>
354
+    </item>
355
+    <item>
356
+     <layout class="QHBoxLayout" name="boxCheckbox" >
357
+      <property name="spacing" >
358
+       <number>6</number>
359
+      </property>
360
+      <property name="margin" >
361
+       <number>0</number>
362
+      </property>
363
+      <item>
364
+       <widget class="QCheckBox" name="chkStorePassword" >
365
+        <property name="text" >
366
+         <string>Save Password</string>
367
+        </property>
368
+       </widget>
369
+      </item>
370
+     </layout>
371
+    </item>
372
+   </layout>
373
+  </widget>
374
+ </widget>
375
+ <layoutdefault spacing="6" margin="11" />
376
+ <resources/>
377
+ <connections>
378
+  <connection>
379
+   <sender>btnOk</sender>
380
+   <signal>clicked()</signal>
381
+   <receiver>OracleConnectGuiBase</receiver>
382
+   <slot>accept()</slot>
383
+   <hints>
384
+    <hint type="sourcelabel" >
385
+     <x>383</x>
386
+     <y>24</y>
387
+    </hint>
388
+    <hint type="destinationlabel" >
389
+     <x>217</x>
390
+     <y>103</y>
391
+    </hint>
392
+   </hints>
393
+  </connection>
394
+  <connection>
395
+   <sender>btnCancel</sender>
396
+   <signal>clicked()</signal>
397
+   <receiver>OracleConnectGuiBase</receiver>
398
+   <slot>reject()</slot>
399
+   <hints>
400
+    <hint type="sourcelabel" >
401
+     <x>383</x>
402
+     <y>56</y>
403
+    </hint>
404
+    <hint type="destinationlabel" >
405
+     <x>217</x>
406
+     <y>103</y>
407
+    </hint>
408
+   </hints>
409
+  </connection>
410
+ </connections>
411
+</ui>
412
Index: src/plugins/oracle/qgsoracle_plugin.h
413
===================================================================
414
--- src/plugins/oracle/qgsoracle_plugin.h	(revision 0)
415
+++ src/plugins/oracle/qgsoracle_plugin.h	(revision 0)
416
@@ -0,0 +1,65 @@
417
+/***************************************************************************
418
+    oracleplugin.h
419
+    -------------------
420
+    begin                : Oracle Spatial Plugin
421
+    copyright            : (C) Ivan Lucena
422
+    email                : [email protected]
423
+/***************************************************************************
424
+ *                                                                         *
425
+ *   This program is free software; you can redistribute it and/or modify  *
426
+ *   it under the terms of the GNU General Public License as published by  *
427
+ *   the Free Software Foundation; either version 2 of the License, or     *
428
+ *   (at your option) any later version.                                   *
429
+ *                                                                         *
430
+ ***************************************************************************/
431
+/* $Id$ */
432
+
433
+#ifndef OraclePlugin_H
434
+#define OraclePlugin_H
435
+
436
+// Qt Includes
437
+#include <QObject>
438
+#include <QAction>
439
+
440
+// QGIS Includes
441
+#include <qgisplugin.h>
442
+#include <qgisinterface.h>
443
+#include <qgisgui.h>
444
+
445
+class QgsOraclePlugin : public QObject, public QgisPlugin
446
+{
447
+    Q_OBJECT
448
+
449
+public:
450
+
451
+    /**
452
+     * Constructor for a plugin. The QgisInterface pointer is passed by
453
+     * QGIS when it attempts to instantiate the plugin.
454
+     * @param theInterface Pointer to the QgisInterface object.
455
+     */
456
+    QgsOraclePlugin(QgisInterface * theInterface);
457
+    //! Destructor
458
+    virtual ~QgsOraclePlugin();
459
+
460
+public slots:
461
+
462
+    //! init the gui
463
+    virtual void initGui();
464
+    //! Show the dialog box
465
+    void run();
466
+    //! unload the plugin
467
+    void unload();
468
+    //! show the help document
469
+    void help();
470
+
471
+private:
472
+
473
+    int mPluginType;
474
+    //! Pointer to the QGIS interface object
475
+    QgisInterface *mQGisIface;
476
+    //!pointer to the qaction for this plugin
477
+    QAction * mQActionPointer;
478
+
479
+};
480
+
481
+#endif //OraclePlugin_H
482
Index: src/plugins/oracle/qgsselectgeoraster_ui.cpp
483
===================================================================
484
--- src/plugins/oracle/qgsselectgeoraster_ui.cpp	(revision 0)
485
+++ src/plugins/oracle/qgsselectgeoraster_ui.cpp	(revision 0)
486
@@ -0,0 +1,302 @@
487
+/***************************************************************************
488
+  oracleselectgui.cpp
489
+  -------------------
490
+    begin                : Oracle Spatial Plugin
491
+    copyright            : (C) Ivan Lucena
492
+    email                : [email protected]
493
+/***************************************************************************
494
+ *                                                                         *
495
+ *   This program is free software; you can redistribute it and/or modify  *
496
+ *   it under the terms of the GNU General Public License as published by  *
497
+ *   the Free Software Foundation; either version 2 of the License, or     *
498
+ *   (at your option) any later version.                                   *
499
+ *                                                                         *
500
+ ***************************************************************************/
501
+/* $Id$ */
502
+
503
+#include "qgsselectgeoraster_ui.h"
504
+#include "qgsoracleconnect_ui.h"
505
+
506
+//GDAL includes
507
+#include "gdal.h"
508
+#include "ogr_api.h"
509
+#include "ogrsf_frmts.h"
510
+
511
+QgsOracleSelectGeoraster::QgsOracleSelectGeoraster(QWidget* parent,
512
+        QgisInterface* iface,
513
+        Qt::WFlags fl) : QDialog(parent, fl), mIface(iface)
514
+{
515
+    setupUi(this);
516
+    /*
517
+     *  Load the list of connection from the registry
518
+     */
519
+    populateConnectionList();
520
+}
521
+
522
+QgsOracleSelectGeoraster::~QgsOracleSelectGeoraster()
523
+{
524
+}
525
+
526
+void QgsOracleSelectGeoraster::populateConnectionList()
527
+{
528
+    QSettings settings;
529
+    settings.beginGroup("/Oracle/connections");
530
+    QStringList keys = settings.childGroups();
531
+    QStringList::Iterator it = keys.begin();
532
+
533
+    /*
534
+     *  Fillup the combobox with connection names
535
+     */
536
+
537
+    cmbConnections->clear();
538
+    while (it != keys.end())
539
+    {
540
+        cmbConnections->addItem(*it);
541
+        ++it;
542
+    }
543
+    settings.endGroup();
544
+    setConnectionListPosition();
545
+
546
+    /*
547
+     *  Update the status of several buttons
548
+     */
549
+
550
+    if (keys.begin() == keys.end())
551
+    {
552
+        btnConnect->setEnabled(FALSE);
553
+        btnEdit->setEnabled(FALSE);
554
+        btnDelete->setEnabled(FALSE);
555
+    } else
556
+    {
557
+        btnConnect->setEnabled(TRUE);
558
+        btnEdit->setEnabled(TRUE);
559
+        btnDelete->setEnabled(TRUE);
560
+    }
561
+}
562
+
563
+void QgsOracleSelectGeoraster::addNewConnection()
564
+{
565
+    QgsOracleConnect *oc = new QgsOracleConnect(this, "New Connection");
566
+    if (oc->exec())
567
+    {
568
+        populateConnectionList();
569
+    }
570
+}
571
+
572
+void QgsOracleSelectGeoraster::editConnection()
573
+{
574
+    QgsOracleConnect *oc = new QgsOracleConnect(this, cmbConnections->currentText());
575
+    if (oc->exec())
576
+    {
577
+        populateConnectionList();
578
+    }
579
+}
580
+
581
+void QgsOracleSelectGeoraster::deleteConnection()
582
+{
583
+    QSettings settings;
584
+    QString key = "/Oracle/connections/" + cmbConnections->currentText();
585
+    QString msg =
586
+            tr("Are you sure you want to remove the ") +
587
+            cmbConnections->currentText() +
588
+            tr(" connection and all associated settings?");
589
+    QMessageBox::StandardButton result = QMessageBox::information(this,
590
+            tr("Confirm Delete"),
591
+            msg,
592
+            QMessageBox::Ok | QMessageBox::Cancel);
593
+    if (result == QMessageBox::Ok)
594
+    {
595
+        settings.remove(key + "/database");
596
+        settings.remove(key + "/username");
597
+        settings.remove(key + "/password");
598
+        settings.remove(key);
599
+        cmbConnections->removeItem(cmbConnections->currentIndex());
600
+        setConnectionListPosition();
601
+    }
602
+}
603
+
604
+void QgsOracleSelectGeoraster::connectToServer()
605
+{
606
+    QSettings settings;
607
+    QString key = "/Oracle/connections/" + cmbConnections->currentText();
608
+    QString username = settings.value(key + "/username").toString();
609
+    QString password = settings.value(key + "/password").toString();
610
+    QString database = settings.value(key + "/database").toString();
611
+    QString connString = "GEOR:" + username + "/" + password + "@" + database;
612
+    bool makeConnection = true;
613
+    if (password == QString::null)
614
+    {
615
+        makeConnection = false;
616
+        QString password = QInputDialog::getText(this,
617
+                tr("Password for ") + username + "/<password>@" + database,
618
+                tr("Please enter your password:"),
619
+                QLineEdit::Password,
620
+                QString::null,
621
+                &makeConnection);
622
+    }
623
+    if (makeConnection)
624
+    {
625
+        settings.setValue("/Oracle/connections/selected",
626
+                cmbConnections->currentText());
627
+        showSelection(connString);
628
+    }
629
+}
630
+
631
+void QgsOracleSelectGeoraster::showSelection(const QString & line)
632
+{
633
+    QString identification;
634
+
635
+    if (line == "..")
636
+    {
637
+        identification = mLastQuery;
638
+    }
639
+    else
640
+    {
641
+        identification = line;
642
+    }
643
+
644
+    GDALDatasetH hDS = NULL;
645
+    GDALAccess eAccess = GA_ReadOnly;
646
+
647
+    /*
648
+     *  Set access mode
649
+     */
650
+
651
+    if( checkBox->checkState() == Qt::Checked)
652
+    {
653
+        eAccess = GA_Update;
654
+    }
655
+
656
+    /*
657
+     *  Try to open georaster dataset
658
+     */
659
+    
660
+    hDS = GDALOpenShared(identification.toAscii(), eAccess);
661
+
662
+    btnAdd->setEnabled(false);
663
+    if (hDS == NULL)
664
+    {
665
+        QMessageBox::information(this,
666
+                tr("Open failed"), tr("The connection to " + identification.toAscii() +
667
+                " failed. Please verify your connection parameters."
668
+                " Make sure you have the GDAL GeoRaster plugin installed."));
669
+        return;
670
+    }
671
+    btnAdd->setEnabled(true);
672
+
673
+    char **papszMetadata = NULL;
674
+    papszMetadata = GDALGetMetadata(hDS, "SUBDATASETS");
675
+    int nSubDatasets = CSLCount(papszMetadata);
676
+
677
+    /*
678
+     *  Add GeoRaster Layer
679
+     */
680
+    
681
+    if (!nSubDatasets)
682
+    {
683
+        mIface->addRasterLayer(identification);
684
+        GDALClose(hDS);
685
+        return;
686
+    }
687
+    
688
+    /*
689
+     *  List subdatasets
690
+     */
691
+
692
+    QStringList fields = identification.split(',');
693
+    QString count = QString::number(nSubDatasets/2);
694
+
695
+    QString plural = "s";
696
+    if (count == "1")
697
+    {
698
+        plural = "";
699
+    }
700
+    
701
+    if (fields.size() < 4)
702
+    {
703
+        labelStatus->setText(QString("%1 GeoRaster table%2")
704
+          .arg(count).arg(plural));
705
+        checkBox->setEnabled(false);
706
+    }
707
+    else if (fields.size() == 4)
708
+    {
709
+        labelStatus->setText(QString("%1 GeoRaster column%2 on table %3")
710
+          .arg(count).arg(plural).arg(fields[3]));
711
+        checkBox->setEnabled(false);
712
+    }
713
+    else if (fields.size() == 5)
714
+    {
715
+        labelStatus->setText(QString("%1 GeoRaster object%2 on table %3 column %4")
716
+          .arg(count).arg(plural).arg(fields[3]).arg(fields[4]));
717
+        checkBox->setEnabled(true);
718
+    } else
719
+    {
720
+        labelStatus->setText(QString("%1 GeoRaster object%2 on table %3 column %4 where %5")
721
+          .arg(count).arg(plural).arg(fields[3]).arg(fields[4]).arg(fields[5]));
722
+        checkBox->setEnabled(true);
723
+    }
724
+
725
+    /*
726
+     *  Populate selection list based on subdataset names
727
+     */
728
+
729
+    //TODO: Change thar list to a QTreeWidget or QTableWidget
730
+
731
+    listWidget->clear();
732
+    QListWidgetItem *textItem;
733
+
734
+    if (fields.size() > 3)
735
+    { 
736
+      textItem = new QListWidgetItem("..");
737
+      listWidget->addItem(textItem);
738
+    }
739
+    
740
+    for (int i = 0; i < nSubDatasets; i += 2)
741
+    {
742
+        QString metadata = papszMetadata[i];
743
+        QStringList subdataset = metadata.split('=');
744
+        textItem = new QListWidgetItem(subdataset[1]);
745
+        listWidget->addItem(textItem);
746
+    }
747
+
748
+    GDALClose(hDS);
749
+}
750
+
751
+void QgsOracleSelectGeoraster::showHelp()
752
+{
753
+    // implement me
754
+}
755
+
756
+void QgsOracleSelectGeoraster::setConnectionListPosition()
757
+{
758
+    QSettings settings;
759
+    // If possible, set the item currently displayed database
760
+    QString toSelect = settings.value("/Oracle/connections/selected").toString();
761
+    // Does toSelect exist in cmbConnections?
762
+    bool set = false;
763
+    for (int i = 0; i < cmbConnections->count(); ++i)
764
+    {
765
+        if (cmbConnections->itemText(i) == toSelect)
766
+        {
767
+            cmbConnections->setCurrentIndex(i);
768
+            set = true;
769
+            break;
770
+        }
771
+    }
772
+    // If we couldn't find the stored item, but there are some,
773
+    // default to the last item (this makes some sense when deleting
774
+    // items as it allows the user to repeatidly click on delete to
775
+    // remove a whole lot of items).
776
+    if (!set && cmbConnections->count() > 0)
777
+    {
778
+        // If toSelect is null, then the selected connection wasn't found
779
+        // by QSettings, which probably means that this is the first time
780
+        // the user has used qgis with database connections, so default to
781
+        // the first in the list of connetions. Otherwise default to the last.
782
+        if (toSelect.isNull())
783
+            cmbConnections->setCurrentIndex(0);
784
+        else
785
+            cmbConnections->setCurrentIndex(cmbConnections->count() - 1);
786
+    }
787
+}
788
+
789
Index: src/plugins/oracle/oracleplugin.png
790
===================================================================
791
Cannot display: file marked as a binary type.
792
svn:mime-type = application/octet-stream
793

    
794
Property changes on: src/plugins/oracle/oracleplugin.png
795
___________________________________________________________________
796
Added: svn:mime-type
797
   + application/octet-stream
798

    
799
Index: src/plugins/oracle/oracleplugin.qrc
800
===================================================================
801
--- src/plugins/oracle/oracleplugin.qrc	(revision 0)
802
+++ src/plugins/oracle/oracleplugin.qrc	(revision 0)
803
@@ -0,0 +1,5 @@
804
+<RCC>
805
+    <qresource prefix="/oracleplugin/" >
806
+        <file>oracleplugin.png</file>
807
+    </qresource>
808
+</RCC>
809
Index: src/plugins/oracle/qgsoracleconnect_ui.cpp
810
===================================================================
811
--- src/plugins/oracle/qgsoracleconnect_ui.cpp	(revision 0)
812
+++ src/plugins/oracle/qgsoracleconnect_ui.cpp	(revision 0)
813
@@ -0,0 +1,83 @@
814
+/***************************************************************************
815
+    oracleconnectgui.cpp
816
+    -------------------
817
+    begin                : Oracle Spatial Plugin
818
+    copyright            : (C) Ivan Lucena
819
+    email                : [email protected]
820
+/***************************************************************************
821
+ *                                                                         *
822
+ *   This program is free software; you can redistribute it and/or modify  *
823
+ *   it under the terms of the GNU General Public License as published by  *
824
+ *   the Free Software Foundation; either version 2 of the License, or     *
825
+ *   (at your option) any later version.                                   *
826
+ *                                                                         *
827
+ ***************************************************************************/
828
+/* $Id$ */
829
+
830
+#include "qgsoracleconnect_ui.h"
831
+
832
+// Qt Includes
833
+#include <QSettings>
834
+#include <QMessageBox>
835
+
836
+QgsOracleConnect::QgsOracleConnect(QWidget* parent,
837
+        const QString& connName,
838
+        Qt::WFlags fl) : QDialog(parent, fl)
839
+{
840
+    setupUi(this);
841
+
842
+    if (!connName.isEmpty())
843
+    {
844
+        // populate the dialog with the information stored for the connection
845
+        // populate the fields with the stored setting parameters
846
+
847
+        QSettings settings;
848
+
849
+        QString key = "/Oracle/connections/" + connName;
850
+
851
+        txtDatabase->setText(settings.value(key + "/database").toString());
852
+        txtUsername->setText(settings.value(key + "/username").toString());
853
+
854
+        if (settings.value(key + "/save").toString() == "true")
855
+        {
856
+            txtPassword->setText(settings.value(key + "/password").toString());
857
+            chkStorePassword->setChecked(true);
858
+        }
859
+        txtName->setText(connName);
860
+    }
861
+}
862
+
863
+QgsOracleConnect::~QgsOracleConnect()
864
+{
865
+}
866
+
867
+void QgsOracleConnect::on_btnCancel_clicked()
868
+{
869
+    helpInfo();
870
+}
871
+
872
+void QgsOracleConnect::on_btnOk_clicked()
873
+{
874
+    saveConnection();
875
+}
876
+
877
+void QgsOracleConnect::saveConnection()
878
+{
879
+    QSettings settings;
880
+
881
+    QString baseKey = "/Oracle/connections/";
882
+
883
+    settings.setValue(baseKey + "selected", txtName->text());
884
+    baseKey += txtName->text();
885
+    settings.setValue(baseKey + "/database", txtDatabase->text());
886
+    settings.setValue(baseKey + "/username", txtUsername->text());
887
+    settings.setValue(baseKey + "/password", txtPassword->text());
888
+
889
+    accept();
890
+}
891
+
892
+void QgsOracleConnect::helpInfo()
893
+{
894
+    //  QgsContextHelp::run( context_id );
895
+}
896
+
897
Index: src/plugins/oracle/qgsselectgeorasterbase.new
898
===================================================================
899
--- src/plugins/oracle/qgsselectgeorasterbase.new	(revision 0)
900
+++ src/plugins/oracle/qgsselectgeorasterbase.new	(revision 0)
901
@@ -0,0 +1,336 @@
902
+<ui version="4.0" >
903
+ <class>SelectGeoRasterBase</class>
904
+ <widget class="QDialog" name="SelectGeoRasterBase" >
905
+  <property name="geometry" >
906
+   <rect>
907
+    <x>0</x>
908
+    <y>0</y>
909
+    <width>480</width>
910
+    <height>505</height>
911
+   </rect>
912
+  </property>
913
+  <property name="windowTitle" >
914
+   <string>Select Oracle Spatial GeoRaster</string>
915
+  </property>
916
+  <property name="windowIcon" >
917
+   <iconset>
918
+    <normaloff>../../ui</normaloff>../../ui</iconset>
919
+  </property>
920
+  <property name="sizeGripEnabled" >
921
+   <bool>true</bool>
922
+  </property>
923
+  <property name="modal" >
924
+   <bool>true</bool>
925
+  </property>
926
+  <layout class="QGridLayout" >
927
+   <property name="margin" >
928
+    <number>9</number>
929
+   </property>
930
+   <property name="spacing" >
931
+    <number>6</number>
932
+   </property>
933
+   <item row="0" column="0" colspan="4" >
934
+    <widget class="QGroupBox" name="GroupBox1" >
935
+     <property name="title" >
936
+      <string>Server Connections</string>
937
+     </property>
938
+     <layout class="QGridLayout" >
939
+      <property name="margin" >
940
+       <number>9</number>
941
+      </property>
942
+      <property name="spacing" >
943
+       <number>6</number>
944
+      </property>
945
+      <item row="1" column="4" >
946
+       <spacer>
947
+        <property name="orientation" >
948
+         <enum>Qt::Horizontal</enum>
949
+        </property>
950
+        <property name="sizeType" >
951
+         <enum>QSizePolicy::Expanding</enum>
952
+        </property>
953
+        <property name="sizeHint" stdset="0" >
954
+         <size>
955
+          <width>131</width>
956
+          <height>30</height>
957
+         </size>
958
+        </property>
959
+       </spacer>
960
+      </item>
961
+      <item row="0" column="0" colspan="5" >
962
+       <widget class="QComboBox" name="cmbConnections" />
963
+      </item>
964
+      <item row="1" column="0" >
965
+       <widget class="QPushButton" name="btnConnect" >
966
+        <property name="enabled" >
967
+         <bool>false</bool>
968
+        </property>
969
+        <property name="text" >
970
+         <string>C&amp;onnect</string>
971
+        </property>
972
+       </widget>
973
+      </item>
974
+      <item row="1" column="2" >
975
+       <widget class="QPushButton" name="btnEdit" >
976
+        <property name="enabled" >
977
+         <bool>false</bool>
978
+        </property>
979
+        <property name="text" >
980
+         <string>Edit</string>
981
+        </property>
982
+       </widget>
983
+      </item>
984
+      <item row="1" column="3" >
985
+       <widget class="QPushButton" name="btnDelete" >
986
+        <property name="enabled" >
987
+         <bool>false</bool>
988
+        </property>
989
+        <property name="text" >
990
+         <string>Delete</string>
991
+        </property>
992
+       </widget>
993
+      </item>
994
+      <item row="1" column="1" >
995
+       <widget class="QPushButton" name="btnNew" >
996
+        <property name="text" >
997
+         <string>&amp;New</string>
998
+        </property>
999
+       </widget>
1000
+      </item>
1001
+     </layout>
1002
+    </widget>
1003
+   </item>
1004
+   <item row="3" column="0" colspan="4" >
1005
+    <widget class="QGroupBox" name="gbCRS" >
1006
+     <property name="title" >
1007
+      <string>Selection</string>
1008
+     </property>
1009
+     <layout class="QHBoxLayout" >
1010
+      <property name="spacing" >
1011
+       <number>6</number>
1012
+      </property>
1013
+      <property name="margin" >
1014
+       <number>9</number>
1015
+      </property>
1016
+      <item>
1017
+       <widget class="QLabel" name="labelCoordRefSys" >
1018
+        <property name="text" >
1019
+         <string/>
1020
+        </property>
1021
+       </widget>
1022
+      </item>
1023
+      <item>
1024
+       <widget class="QLineEdit" name="lineEdit" />
1025
+      </item>
1026
+      <item>
1027
+       <widget class="QCheckBox" name="checkBox" >
1028
+        <property name="text" >
1029
+         <string>Update</string>
1030
+        </property>
1031
+       </widget>
1032
+      </item>
1033
+     </layout>
1034
+    </widget>
1035
+   </item>
1036
+   <item row="5" column="0" colspan="4" >
1037
+    <widget class="QLabel" name="labelStatus" >
1038
+     <property name="sizePolicy" >
1039
+      <sizepolicy vsizetype="Preferred" hsizetype="Ignored" >
1040
+       <horstretch>0</horstretch>
1041
+       <verstretch>0</verstretch>
1042
+      </sizepolicy>
1043
+     </property>
1044
+     <property name="text" >
1045
+      <string>Ready</string>
1046
+     </property>
1047
+     <property name="wordWrap" >
1048
+      <bool>false</bool>
1049
+     </property>
1050
+    </widget>
1051
+   </item>
1052
+   <item row="4" column="2" >
1053
+    <widget class="QPushButton" name="btnAdd" >
1054
+     <property name="enabled" >
1055
+      <bool>false</bool>
1056
+     </property>
1057
+     <property name="text" >
1058
+      <string>&amp;Add</string>
1059
+     </property>
1060
+     <property name="shortcut" >
1061
+      <string>Alt+A</string>
1062
+     </property>
1063
+     <property name="autoDefault" >
1064
+      <bool>true</bool>
1065
+     </property>
1066
+     <property name="default" >
1067
+      <bool>true</bool>
1068
+     </property>
1069
+    </widget>
1070
+   </item>
1071
+   <item row="2" column="0" colspan="4" >
1072
+    <widget class="QGroupBox" name="groupBox2" >
1073
+     <property name="title" >
1074
+      <string>Layers</string>
1075
+     </property>
1076
+     <layout class="QVBoxLayout" >
1077
+      <property name="spacing" >
1078
+       <number>6</number>
1079
+      </property>
1080
+      <property name="margin" >
1081
+       <number>9</number>
1082
+      </property>
1083
+      <item>
1084
+       <widget class="QTreeWidget" name="lstLayers" >
1085
+        <property name="sizePolicy" >
1086
+         <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
1087
+          <horstretch>0</horstretch>
1088
+          <verstretch>0</verstretch>
1089
+         </sizepolicy>
1090
+        </property>
1091
+        <property name="selectionMode" >
1092
+         <enum>QAbstractItemView::MultiSelection</enum>
1093
+        </property>
1094
+        <property name="allColumnsShowFocus" >
1095
+         <bool>true</bool>
1096
+        </property>
1097
+        <column>
1098
+         <property name="text" >
1099
+          <string>ID</string>
1100
+         </property>
1101
+        </column>
1102
+        <column>
1103
+         <property name="text" >
1104
+          <string>Name</string>
1105
+         </property>
1106
+        </column>
1107
+        <column>
1108
+         <property name="text" >
1109
+          <string>Title</string>
1110
+         </property>
1111
+        </column>
1112
+        <column>
1113
+         <property name="text" >
1114
+          <string>Abstract</string>
1115
+         </property>
1116
+        </column>
1117
+       </widget>
1118
+      </item>
1119
+     </layout>
1120
+    </widget>
1121
+   </item>
1122
+   <item row="1" column="0" colspan="4" >
1123
+    <widget class="QGroupBox" name="btnGrpImageEncoding" >
1124
+     <property name="sizePolicy" >
1125
+      <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
1126
+       <horstretch>0</horstretch>
1127
+       <verstretch>0</verstretch>
1128
+      </sizepolicy>
1129
+     </property>
1130
+     <property name="minimumSize" >
1131
+      <size>
1132
+       <width>16</width>
1133
+       <height>64</height>
1134
+      </size>
1135
+     </property>
1136
+     <property name="title" >
1137
+      <string>Subdatasets</string>
1138
+     </property>
1139
+     <widget class="QListWidget" name="listWidget" >
1140
+      <property name="geometry" >
1141
+       <rect>
1142
+        <x>11</x>
1143
+        <y>20</y>
1144
+        <width>420</width>
1145
+        <height>31</height>
1146
+       </rect>
1147
+      </property>
1148
+      <property name="sizePolicy" >
1149
+       <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
1150
+        <horstretch>0</horstretch>
1151
+        <verstretch>0</verstretch>
1152
+       </sizepolicy>
1153
+      </property>
1154
+      <property name="autoFillBackground" >
1155
+       <bool>false</bool>
1156
+      </property>
1157
+     </widget>
1158
+    </widget>
1159
+   </item>
1160
+   <item row="4" column="1" >
1161
+    <spacer>
1162
+     <property name="orientation" >
1163
+      <enum>Qt::Horizontal</enum>
1164
+     </property>
1165
+     <property name="sizeType" >
1166
+      <enum>QSizePolicy::Expanding</enum>
1167
+     </property>
1168
+     <property name="sizeHint" stdset="0" >
1169
+      <size>
1170
+       <width>284</width>
1171
+       <height>31</height>
1172
+      </size>
1173
+     </property>
1174
+    </spacer>
1175
+   </item>
1176
+   <item row="4" column="0" >
1177
+    <widget class="QPushButton" name="btnHelp" >
1178
+     <property name="enabled" >
1179
+      <bool>true</bool>
1180
+     </property>
1181
+     <property name="text" >
1182
+      <string>Help</string>
1183
+     </property>
1184
+     <property name="shortcut" >
1185
+      <string>F1</string>
1186
+     </property>
1187
+     <property name="autoDefault" >
1188
+      <bool>true</bool>
1189
+     </property>
1190
+    </widget>
1191
+   </item>
1192
+   <item row="4" column="3" >
1193
+    <widget class="QPushButton" name="btnCancel" >
1194
+     <property name="text" >
1195
+      <string>C&amp;lose</string>
1196
+     </property>
1197
+     <property name="shortcut" >
1198
+      <string>Alt+L</string>
1199
+     </property>
1200
+     <property name="autoDefault" >
1201
+      <bool>true</bool>
1202
+     </property>
1203
+    </widget>
1204
+   </item>
1205
+  </layout>
1206
+ </widget>
1207
+ <layoutdefault spacing="6" margin="11" />
1208
+ <tabstops>
1209
+  <tabstop>cmbConnections</tabstop>
1210
+  <tabstop>btnConnect</tabstop>
1211
+  <tabstop>btnNew</tabstop>
1212
+  <tabstop>btnEdit</tabstop>
1213
+  <tabstop>btnDelete</tabstop>
1214
+  <tabstop>btnHelp</tabstop>
1215
+  <tabstop>btnAdd</tabstop>
1216
+  <tabstop>btnCancel</tabstop>
1217
+ </tabstops>
1218
+ <resources/>
1219
+ <connections>
1220
+  <connection>
1221
+   <sender>btnCancel</sender>
1222
+   <signal>clicked()</signal>
1223
+   <receiver>SelectGeoRasterBase</receiver>
1224
+   <slot>reject()</slot>
1225
+   <hints>
1226
+    <hint type="sourcelabel" >
1227
+     <x>410</x>
1228
+     <y>457</y>
1229
+    </hint>
1230
+    <hint type="destinationlabel" >
1231
+     <x>229</x>
1232
+     <y>252</y>
1233
+    </hint>
1234
+   </hints>
1235
+  </connection>
1236
+ </connections>
1237
+</ui>
1238
Index: src/plugins/oracle/qgsselectgeoraster_ui.h
1239
===================================================================
1240
--- src/plugins/oracle/qgsselectgeoraster_ui.h	(revision 0)
1241
+++ src/plugins/oracle/qgsselectgeoraster_ui.h	(revision 0)
1242
@@ -0,0 +1,89 @@
1243
+/***************************************************************************
1244
+    oracleselectgui.h
1245
+    -------------------
1246
+    begin                : Oracle Spatial Plugin
1247
+    copyright            : (C) Ivan Lucena
1248
+    email                : [email protected]
1249
+/***************************************************************************
1250
+ *                                                                         *
1251
+ *   This program is free software; you can redistribute it and/or modify  *
1252
+ *   it under the terms of the GNU General Public License as published by  *
1253
+ *   the Free Software Foundation; either version 2 of the License, or     *
1254
+ *   (at your option) any later version.                                   *
1255
+ *                                                                         *
1256
+ ***************************************************************************/
1257
+/* $Id$ */
1258
+
1259
+#ifndef OraclePluginGUI_H
1260
+#define OraclePluginGUI_H
1261
+
1262
+// Qt Designer Includes
1263
+#include "ui_qgsselectgeorasterbase.h"
1264
+
1265
+//Qt includes
1266
+#include <QSettings>
1267
+#include <QMessageBox>
1268
+#include <QInputDialog>
1269
+
1270
+// QGIS Includes
1271
+#include <qgisinterface.h>
1272
+#include <qgsmapcanvas.h>
1273
+
1274
+class QgsOracleSelectGeoraster : public QDialog, private Ui::SelectGeoRasterBase
1275
+{
1276
+    Q_OBJECT
1277
+
1278
+public:
1279
+    QgsOracleSelectGeoraster(QWidget* parent, QgisInterface* iface, Qt::WFlags fl = 0);
1280
+    ~QgsOracleSelectGeoraster();
1281
+
1282
+private:
1283
+    QgisInterface* mIface;
1284
+    QString mUri;
1285
+    QString mLastQuery;
1286
+
1287
+private:
1288
+    void addNewConnection();
1289
+    void editConnection();
1290
+    void deleteConnection();
1291
+    void populateConnectionList();
1292
+    void connectToServer();
1293
+    void showHelp();
1294
+    void setConnectionListPosition();
1295
+    void showSelection(const QString & line);
1296
+
1297
+public slots:
1298
+
1299
+    void on_btnNew_clicked()
1300
+    {
1301
+        addNewConnection();
1302
+    };
1303
+
1304
+    void on_btnEdit_clicked()
1305
+    {
1306
+        editConnection();
1307
+    };
1308
+
1309
+    void on_btnDelete_clicked()
1310
+    {
1311
+        deleteConnection();
1312
+    };
1313
+
1314
+    void on_btnConnect_clicked()
1315
+    {
1316
+        connectToServer();
1317
+    };
1318
+
1319
+    void on_listWidget_clicked(QModelIndex Index)
1320
+    {
1321
+        lineEdit->setText(listWidget->currentItem()->text());
1322
+    }
1323
+
1324
+    void on_btnAdd_clicked()
1325
+    {
1326
+        showSelection(lineEdit->text());
1327
+    };
1328
+
1329
+};
1330
+
1331
+#endif
1332
Index: src/plugins/oracle/CMakeLists.txt
1333
===================================================================
1334
--- src/plugins/oracle/CMakeLists.txt	(revision 0)
1335
+++ src/plugins/oracle/CMakeLists.txt	(revision 0)
1336
@@ -0,0 +1,54 @@
1337
+
1338
+########################################################
1339
+# Files
1340
+
1341
+SET (ORACLE_SRCS
1342
+     qgsoracle_plugin.cpp
1343
+     qgsselectgeoraster_ui.cpp
1344
+     qgsoracleconnect_ui.cpp
1345
+)
1346
+
1347
+SET (ORACLE_UIS
1348
+     qgsselectgeorasterbase.ui
1349
+     qgsoracleconnectbase.ui
1350
+)
1351
+
1352
+SET (ORACLE_MOC_HDRS
1353
+     qgsoracle_plugin.h
1354
+     qgsselectgeoraster_ui.h
1355
+     qgsoracleconnect_ui.h
1356
+)
1357
+
1358
+SET (ORACLE_RCCS  oracleplugin.qrc)
1359
+
1360
+########################################################
1361
+# Build
1362
+
1363
+QT4_WRAP_UI (ORACLE_UIS_H  ${ORACLE_UIS})
1364
+
1365
+QT4_WRAP_CPP (ORACLE_MOC_SRCS  ${ORACLE_MOC_HDRS})
1366
+
1367
+QT4_ADD_RESOURCES(ORACLE_RCC_SRCS ${ORACLE_RCCS})
1368
+
1369
+ADD_LIBRARY (oracleplugin MODULE ${ORACLE_SRCS} ${ORACLE_MOC_SRCS} ${ORACLE_RCC_SRCS} ${ORACLE_UIS_H})
1370
+
1371
+INCLUDE_DIRECTORIES(
1372
+     ${CMAKE_CURRENT_BINARY_DIR}
1373
+     ../../core ../../core/raster ../../core/renderer ../../core/symbology
1374
+     ../../gui
1375
+     ..
1376
+)
1377
+
1378
+TARGET_LINK_LIBRARIES(oracleplugin
1379
+  qgis_core
1380
+  qgis_gui
1381
+)
1382
+
1383
+
1384
+########################################################
1385
+# Install
1386
+
1387
+INSTALL(TARGETS oracleplugin
1388
+  RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
1389
+  LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
1390
+
1391
Index: src/plugins/oracle/qgsselectgeorasterbase.ui
1392
===================================================================
1393
--- src/plugins/oracle/qgsselectgeorasterbase.ui	(revision 0)
1394
+++ src/plugins/oracle/qgsselectgeorasterbase.ui	(revision 0)
1395
@@ -0,0 +1,284 @@
1396
+<ui version="4.0" >
1397
+ <class>SelectGeoRasterBase</class>
1398
+ <widget class="QDialog" name="SelectGeoRasterBase" >
1399
+  <property name="geometry" >
1400
+   <rect>
1401
+    <x>0</x>
1402
+    <y>0</y>
1403
+    <width>461</width>
1404
+    <height>454</height>
1405
+   </rect>
1406
+  </property>
1407
+  <property name="windowTitle" >
1408
+   <string>Select Oracle Spatial GeoRaster</string>
1409
+  </property>
1410
+  <property name="windowIcon" >
1411
+   <iconset>
1412
+    <normaloff>../../ui</normaloff>../../ui</iconset>
1413
+  </property>
1414
+  <property name="sizeGripEnabled" >
1415
+   <bool>true</bool>
1416
+  </property>
1417
+  <property name="modal" >
1418
+   <bool>true</bool>
1419
+  </property>
1420
+  <layout class="QGridLayout" >
1421
+   <property name="margin" >
1422
+    <number>9</number>
1423
+   </property>
1424
+   <property name="spacing" >
1425
+    <number>6</number>
1426
+   </property>
1427
+   <item row="0" column="0" colspan="4" >
1428
+    <widget class="QGroupBox" name="GroupBox1" >
1429
+     <property name="title" >
1430
+      <string>Server Connections</string>
1431
+     </property>
1432
+     <layout class="QGridLayout" >
1433
+      <property name="margin" >
1434
+       <number>9</number>
1435
+      </property>
1436
+      <property name="spacing" >
1437
+       <number>6</number>
1438
+      </property>
1439
+      <item row="1" column="4" >
1440
+       <spacer>
1441
+        <property name="orientation" >
1442
+         <enum>Qt::Horizontal</enum>
1443
+        </property>
1444
+        <property name="sizeType" >
1445
+         <enum>QSizePolicy::Expanding</enum>
1446
+        </property>
1447
+        <property name="sizeHint" stdset="0" >
1448
+         <size>
1449
+          <width>131</width>
1450
+          <height>30</height>
1451
+         </size>
1452
+        </property>
1453
+       </spacer>
1454
+      </item>
1455
+      <item row="0" column="0" colspan="5" >
1456
+       <widget class="QComboBox" name="cmbConnections" />
1457
+      </item>
1458
+      <item row="1" column="0" >
1459
+       <widget class="QPushButton" name="btnConnect" >
1460
+        <property name="enabled" >
1461
+         <bool>false</bool>
1462
+        </property>
1463
+        <property name="text" >
1464
+         <string>C&amp;onnect</string>
1465
+        </property>
1466
+       </widget>
1467
+      </item>
1468
+      <item row="1" column="2" >
1469
+       <widget class="QPushButton" name="btnEdit" >
1470
+        <property name="enabled" >
1471
+         <bool>false</bool>
1472
+        </property>
1473
+        <property name="text" >
1474
+         <string>Edit</string>
1475
+        </property>
1476
+       </widget>
1477
+      </item>
1478
+      <item row="1" column="3" >
1479
+       <widget class="QPushButton" name="btnDelete" >
1480
+        <property name="enabled" >
1481
+         <bool>false</bool>
1482
+        </property>
1483
+        <property name="text" >
1484
+         <string>Delete</string>
1485
+        </property>
1486
+       </widget>
1487
+      </item>
1488
+      <item row="1" column="1" >
1489
+       <widget class="QPushButton" name="btnNew" >
1490
+        <property name="text" >
1491
+         <string>&amp;New</string>
1492
+        </property>
1493
+       </widget>
1494
+      </item>
1495
+     </layout>
1496
+    </widget>
1497
+   </item>
1498
+   <item row="2" column="0" colspan="4" >
1499
+    <widget class="QGroupBox" name="gbCRS" >
1500
+     <property name="title" >
1501
+      <string>Selection</string>
1502
+     </property>
1503
+     <layout class="QHBoxLayout" >
1504
+      <property name="spacing" >
1505
+       <number>6</number>
1506
+      </property>
1507
+      <property name="margin" >
1508
+       <number>9</number>
1509
+      </property>
1510
+      <item>
1511
+       <widget class="QLabel" name="labelCoordRefSys" >
1512
+        <property name="text" >
1513
+         <string/>
1514
+        </property>
1515
+       </widget>
1516
+      </item>
1517
+      <item>
1518
+       <widget class="QLineEdit" name="lineEdit" />
1519
+      </item>
1520
+      <item>
1521
+       <widget class="QCheckBox" name="checkBox" >
1522
+        <property name="enabled" >
1523
+         <bool>false</bool>
1524
+        </property>
1525
+        <property name="text" >
1526
+         <string>Update</string>
1527
+        </property>
1528
+       </widget>
1529
+      </item>
1530
+     </layout>
1531
+    </widget>
1532
+   </item>
1533
+   <item row="4" column="0" colspan="4" >
1534
+    <widget class="QLabel" name="labelStatus" >
1535
+     <property name="sizePolicy" >
1536
+      <sizepolicy vsizetype="Preferred" hsizetype="Ignored" >
1537
+       <horstretch>0</horstretch>
1538
+       <verstretch>0</verstretch>
1539
+      </sizepolicy>
1540
+     </property>
1541
+     <property name="text" >
1542
+      <string>Ready</string>
1543
+     </property>
1544
+     <property name="wordWrap" >
1545
+      <bool>false</bool>
1546
+     </property>
1547
+    </widget>
1548
+   </item>
1549
+   <item row="3" column="2" >
1550
+    <widget class="QPushButton" name="btnAdd" >
1551
+     <property name="enabled" >
1552
+      <bool>false</bool>
1553
+     </property>
1554
+     <property name="text" >
1555
+      <string>&amp;Select</string>
1556
+     </property>
1557
+     <property name="shortcut" >
1558
+      <string>Alt+A</string>
1559
+     </property>
1560
+     <property name="autoDefault" >
1561
+      <bool>true</bool>
1562
+     </property>
1563
+     <property name="default" >
1564
+      <bool>true</bool>
1565
+     </property>
1566
+    </widget>
1567
+   </item>
1568
+   <item row="1" column="0" colspan="4" >
1569
+    <widget class="QGroupBox" name="btnGrpImageEncoding" >
1570
+     <property name="sizePolicy" >
1571
+      <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
1572
+       <horstretch>0</horstretch>
1573
+       <verstretch>0</verstretch>
1574
+      </sizepolicy>
1575
+     </property>
1576
+     <property name="minimumSize" >
1577
+      <size>
1578
+       <width>16</width>
1579
+       <height>64</height>
1580
+      </size>
1581
+     </property>
1582
+     <property name="title" >
1583
+      <string>Subdatasets</string>
1584
+     </property>
1585
+     <layout class="QVBoxLayout" name="verticalLayout" >
1586
+      <item>
1587
+       <widget class="QListWidget" name="listWidget" >
1588
+        <property name="sizePolicy" >
1589
+         <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
1590
+          <horstretch>0</horstretch>
1591
+          <verstretch>0</verstretch>
1592
+         </sizepolicy>
1593
+        </property>
1594
+        <property name="autoFillBackground" >
1595
+         <bool>false</bool>
1596
+        </property>
1597
+       </widget>
1598
+      </item>
1599
+     </layout>
1600
+    </widget>
1601
+   </item>
1602
+   <item row="3" column="1" >
1603
+    <spacer>
1604
+     <property name="orientation" >
1605
+      <enum>Qt::Horizontal</enum>
1606
+     </property>
1607
+     <property name="sizeType" >
1608
+      <enum>QSizePolicy::Expanding</enum>
1609
+     </property>
1610
+     <property name="sizeHint" stdset="0" >
1611
+      <size>
1612
+       <width>284</width>
1613
+       <height>31</height>
1614
+      </size>
1615
+     </property>
1616
+    </spacer>
1617
+   </item>
1618
+   <item row="3" column="0" >
1619
+    <widget class="QPushButton" name="btnHelp" >
1620
+     <property name="enabled" >
1621
+      <bool>true</bool>
1622
+     </property>
1623
+     <property name="text" >
1624
+      <string>Help</string>
1625
+     </property>
1626
+     <property name="shortcut" >
1627
+      <string>F1</string>
1628
+     </property>
1629
+     <property name="autoDefault" >
1630
+      <bool>true</bool>
1631
+     </property>
1632
+    </widget>
1633
+   </item>
1634
+   <item row="3" column="3" >
1635
+    <widget class="QPushButton" name="btnCancel" >
1636
+     <property name="text" >
1637
+      <string>C&amp;lose</string>
1638
+     </property>
1639
+     <property name="shortcut" >
1640
+      <string>Alt+L</string>
1641
+     </property>
1642
+     <property name="autoDefault" >
1643
+      <bool>true</bool>
1644
+     </property>
1645
+    </widget>
1646
+   </item>
1647
+  </layout>
1648
+ </widget>
1649
+ <layoutdefault spacing="6" margin="11" />
1650
+ <tabstops>
1651
+  <tabstop>cmbConnections</tabstop>
1652
+  <tabstop>btnConnect</tabstop>
1653
+  <tabstop>btnNew</tabstop>
1654
+  <tabstop>btnEdit</tabstop>
1655
+  <tabstop>btnDelete</tabstop>
1656
+  <tabstop>btnHelp</tabstop>
1657
+  <tabstop>btnAdd</tabstop>
1658
+  <tabstop>btnCancel</tabstop>
1659
+ </tabstops>
1660
+ <resources/>
1661
+ <connections>
1662
+  <connection>
1663
+   <sender>btnCancel</sender>
1664
+   <signal>clicked()</signal>
1665
+   <receiver>SelectGeoRasterBase</receiver>
1666
+   <slot>reject()</slot>
1667
+   <hints>
1668
+    <hint type="sourcelabel" >
1669
+     <x>410</x>
1670
+     <y>457</y>
1671
+    </hint>
1672
+    <hint type="destinationlabel" >
1673
+     <x>229</x>
1674
+     <y>252</y>
1675
+    </hint>
1676
+   </hints>
1677
+  </connection>
1678
+ </connections>
1679
+</ui>
1680
Index: src/plugins/oracle/qgsoracleconnect_ui.h
1681
===================================================================
1682
--- src/plugins/oracle/qgsoracleconnect_ui.h	(revision 0)
1683
+++ src/plugins/oracle/qgsoracleconnect_ui.h	(revision 0)
1684
@@ -0,0 +1,46 @@
1685
+/***************************************************************************
1686
+    oracleconnectgui.u
1687
+    -------------------
1688
+    begin                : Oracle Spatial Plugin
1689
+    copyright            : (C) Ivan Lucena
1690
+    email                : [email protected]
1691
+/***************************************************************************
1692
+ *                                                                         *
1693
+ *   This program is free software; you can redistribute it and/or modify  *
1694
+ *   it under the terms of the GNU General Public License as published by  *
1695
+ *   the Free Software Foundation; either version 2 of the License, or     *
1696
+ *   (at your option) any later version.                                   *
1697
+ *                                                                         *
1698
+ ***************************************************************************/
1699
+/* $Id$ */
1700
+
1701
+#ifndef QgsOracleConnect_H
1702
+#define	QgsOracleConnect_H
1703
+
1704
+// Qt Designer Includes
1705
+#include "ui_qgsoracleconnectbase.h"
1706
+
1707
+// QGIS Includes
1708
+#include <qgisgui.h>
1709
+
1710
+class QgsOracleConnect : public QDialog, private Ui::OracleConnectGuiBase
1711
+{
1712
+    Q_OBJECT
1713
+
1714
+public:
1715
+    QgsOracleConnect(QWidget* parent = 0,
1716
+            const QString& connName = QString::null,
1717
+            Qt::WFlags fl = QgisGui::ModalDialogFlags);
1718
+    ~QgsOracleConnect();
1719
+
1720
+private:
1721
+    void saveConnection();
1722
+    void helpInfo();
1723
+
1724
+public slots:
1725
+    void on_btnOk_clicked();
1726
+    void on_btnCancel_clicked();
1727
+    void on_btnHelp_clicked();
1728
+};
1729
+
1730
+#endif	/* _ORACLECONNECTGUI_H */