19
19
#define QGSDBSOURCESELECT_H
20
20
#include " ui_qgsdbsourceselectbase.h"
21
21
#include " qgisgui.h"
22
+ #include " qgsdbfilterproxymodel.h"
23
+ #include " qgsdbtablemodel.h"
24
+
22
25
extern " C"
23
26
{
24
27
#include < libpq-fe.h>
@@ -68,8 +71,6 @@ class QgsDbSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
68
71
QStringList selectedTables ();
69
72
// ! Connection info (database, host, user, password)
70
73
QString connInfo ();
71
- // ! Return the name of the selected encoding (e.g. UTf-8, ISO-8559-1, etc/)
72
- QString encoding ();
73
74
// Store the selected database
74
75
void dbChanged ();
75
76
// Utility function to construct the query for finding out the
@@ -85,12 +86,18 @@ class QgsDbSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
85
86
void on_btnNew_clicked ();
86
87
void on_btnEdit_clicked ();
87
88
void on_btnDelete_clicked ();
88
- void on_lstTables_itemDoubleClicked (QTableWidgetItem *);
89
- void setSql (QTableWidgetItem *);
89
+ void on_mSearchOptionsButton_clicked ();
90
+ void on_mSearchTableEdit_textChanged (const QString & text);
91
+ void on_mSearchColumnComboBox_currentIndexChanged (const QString & text);
92
+ void on_mSearchModeComboBox_currentIndexChanged (const QString & text);
93
+ void setSql (const QModelIndex& index);
90
94
void on_btnHelp_clicked ();
91
95
void on_cmbConnections_activated (int );
92
96
void setLayerType (QString schema, QString table, QString column,
93
97
QString type);
98
+ // !Sets a new regular expression to the model
99
+ void setSearchExpression (const QString& regexp);
100
+
94
101
private:
95
102
enum columns {
96
103
dbssType=0 ,
@@ -107,6 +114,9 @@ class QgsDbSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
107
114
bool searchGeometryColumnsOnly,
108
115
bool searchPublicOnly);
109
116
117
+ /* *Inserts information about the spatial tables into mTableModel*/
118
+ bool getTableInfo (PGconn *pg, bool searchGeometryColumnsOnly, bool searchPublicOnly);
119
+
110
120
// queue another query for the thread
111
121
void addSearchGeometryColumn (const QString &schema, const QString &table, const QString &column);
112
122
@@ -115,10 +125,6 @@ class QgsDbSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
115
125
void setConnectionListPosition ();
116
126
// Show the context help for the dialog
117
127
void showHelp ();
118
- // initialize row
119
- void initRow (int row);
120
- // update the row
121
- void updateRow (int row, QString detail, QString type);
122
128
// Combine the schema, table and column data into a single string
123
129
// useful for display to the user
124
130
QString fullDescription (QString schema, QString table, QString column, QString type);
@@ -130,14 +136,13 @@ class QgsDbSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
130
136
QStringList m_selectedTables;
131
137
// Storage for the range of layer type icons
132
138
QMap<QString, QPair<QString, QIcon> > mLayerIcons ;
133
- #if 0
134
- // minlength of layer type combobox
135
- int mCbMinLength;
136
- #endif
137
139
// ! Pointer to the qgis application mainwindow
138
140
QgisApp *qgisApp;
139
141
PGconn *pd;
140
142
static const int context_id = 939347163 ;
143
+ // ! Model that acts as datasource for mTableTreeWidget
144
+ QgsDbTableModel mTableModel ;
145
+ QgsDbFilterProxyModel mProxyModel ;
141
146
};
142
147
143
148
0 commit comments