Skip to content

Commit e70e53d

Browse files
author
mhugent
committedJan 10, 2008
Commit postgis dialog extension to trunk
git-svn-id: http://svn.osgeo.org/qgis/trunk@7920 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent db0ca5b commit e70e53d

File tree

9 files changed

+875
-359
lines changed

9 files changed

+875
-359
lines changed
 

‎src/app/qgsdbsourceselect.cpp

Lines changed: 327 additions & 259 deletions
Large diffs are not rendered by default.

‎src/app/qgsdbsourceselect.h

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
#define QGSDBSOURCESELECT_H
2020
#include "ui_qgsdbsourceselectbase.h"
2121
#include "qgisgui.h"
22+
#include "qgsdbfilterproxymodel.h"
23+
#include "qgsdbtablemodel.h"
24+
2225
extern "C"
2326
{
2427
#include <libpq-fe.h>
@@ -68,8 +71,6 @@ class QgsDbSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
6871
QStringList selectedTables();
6972
//! Connection info (database, host, user, password)
7073
QString connInfo();
71-
//! Return the name of the selected encoding (e.g. UTf-8, ISO-8559-1, etc/)
72-
QString encoding();
7374
// Store the selected database
7475
void dbChanged();
7576
// Utility function to construct the query for finding out the
@@ -85,12 +86,18 @@ class QgsDbSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
8586
void on_btnNew_clicked();
8687
void on_btnEdit_clicked();
8788
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);
9094
void on_btnHelp_clicked();
9195
void on_cmbConnections_activated(int);
9296
void setLayerType(QString schema, QString table, QString column,
9397
QString type);
98+
//!Sets a new regular expression to the model
99+
void setSearchExpression(const QString& regexp);
100+
94101
private:
95102
enum columns {
96103
dbssType=0,
@@ -107,6 +114,9 @@ class QgsDbSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
107114
bool searchGeometryColumnsOnly,
108115
bool searchPublicOnly);
109116

117+
/**Inserts information about the spatial tables into mTableModel*/
118+
bool getTableInfo(PGconn *pg, bool searchGeometryColumnsOnly, bool searchPublicOnly);
119+
110120
// queue another query for the thread
111121
void addSearchGeometryColumn(const QString &schema, const QString &table, const QString &column);
112122

@@ -115,10 +125,6 @@ class QgsDbSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
115125
void setConnectionListPosition();
116126
// Show the context help for the dialog
117127
void showHelp();
118-
// initialize row
119-
void initRow(int row);
120-
// update the row
121-
void updateRow(int row, QString detail, QString type);
122128
// Combine the schema, table and column data into a single string
123129
// useful for display to the user
124130
QString fullDescription(QString schema, QString table, QString column, QString type);
@@ -130,14 +136,13 @@ class QgsDbSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
130136
QStringList m_selectedTables;
131137
// Storage for the range of layer type icons
132138
QMap<QString, QPair<QString, QIcon> > mLayerIcons;
133-
#if 0
134-
// minlength of layer type combobox
135-
int mCbMinLength;
136-
#endif
137139
//! Pointer to the qgis application mainwindow
138140
QgisApp *qgisApp;
139141
PGconn *pd;
140142
static const int context_id = 939347163;
143+
//! Model that acts as datasource for mTableTreeWidget
144+
QgsDbTableModel mTableModel;
145+
QgsDbFilterProxyModel mProxyModel;
141146
};
142147

143148

‎src/core/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ qgsclipper.cpp
1111
qgscontexthelp.cpp
1212
qgscoordinatetransform.cpp
1313
qgsdatasourceuri.cpp
14+
qgsdbfilterproxymodel.cpp
15+
qgsdbtablemodel.cpp
1416
qgsdistancearea.cpp
1517
qgsexception.cpp
1618
qgsfeature.cpp

‎src/core/qgsdbfilterproxymodel.cpp

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/***************************************************************************
2+
qgsdbfilterproxymodel.cpp - description
3+
-------------------------
4+
begin : Dec 2007
5+
copyright : (C) 2007 by Marco Hugentobler
6+
email : marco dot hugentobler at karto dot baug dot ethz dot ch
7+
***************************************************************************/
8+
9+
/***************************************************************************
10+
* *
11+
* This program is free software; you can redistribute it and/or modify *
12+
* it under the terms of the GNU General Public License as published by *
13+
* the Free Software Foundation; either version 2 of the License, or *
14+
* (at your option) any later version. *
15+
* *
16+
***************************************************************************/
17+
18+
#include "qgsdbfilterproxymodel.h"
19+
20+
QgsDbFilterProxyModel::QgsDbFilterProxyModel(QObject* parent): QSortFilterProxyModel(parent)
21+
{
22+
23+
}
24+
25+
QgsDbFilterProxyModel::~QgsDbFilterProxyModel()
26+
{
27+
28+
}
29+
30+
bool QgsDbFilterProxyModel::filterAcceptsRow(int row, const QModelIndex & source_parent ) const
31+
{
32+
//if parent is valid, we have a toplevel item that should be always shown
33+
if(!source_parent.isValid())
34+
{
35+
return true;
36+
}
37+
38+
//else we have a row that describes a table and that
39+
//should be tested using the given wildcard/regexp
40+
return QSortFilterProxyModel::filterAcceptsRow(row, source_parent);
41+
}
42+
43+
void QgsDbFilterProxyModel::_setFilterWildcard(const QString& pattern)
44+
{
45+
QSortFilterProxyModel::setFilterWildcard(pattern);
46+
emit layoutChanged();
47+
}
48+
49+
void QgsDbFilterProxyModel::_setFilterRegExp(const QString& pattern)
50+
{
51+
QSortFilterProxyModel::setFilterRegExp(pattern);
52+
emit layoutChanged();
53+
}

‎src/core/qgsdbfilterproxymodel.h

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/***************************************************************************
2+
qgsdbfilterproxymodel.h - description
3+
-----------------------
4+
begin : Dec 2007
5+
copyright : (C) 2007 by Marco Hugentobler
6+
email : marco dot hugentobler at karto dot baug dot ethz dot ch
7+
***************************************************************************/
8+
9+
/***************************************************************************
10+
* *
11+
* This program is free software; you can redistribute it and/or modify *
12+
* it under the terms of the GNU General Public License as published by *
13+
* the Free Software Foundation; either version 2 of the License, or *
14+
* (at your option) any later version. *
15+
* *
16+
***************************************************************************/
17+
18+
#ifndef QGSDBFILTERPROXYMODEL_H
19+
#define QGSDBFILTERPROXYMODEL_H
20+
21+
#include <QSortFilterProxyModel>
22+
23+
/**A class that implements a custom filter and can be used
24+
as a proxy for QgsDbTableModel*/
25+
class CORE_EXPORT QgsDbFilterProxyModel: public QSortFilterProxyModel
26+
{
27+
public:
28+
QgsDbFilterProxyModel(QObject* parent = 0);
29+
~QgsDbFilterProxyModel();
30+
/**Calls QSortFilterProxyModel::setFilterWildcard and triggers update*/
31+
void _setFilterWildcard(const QString& pattern);
32+
/**Calls QSortFilterProxyModel::setFilterRegExp and triggers update*/
33+
void _setFilterRegExp(const QString& pattern);
34+
35+
protected:
36+
virtual bool filterAcceptsRow(int row, const QModelIndex & source_parent ) const;
37+
};
38+
39+
#endif

‎src/core/qgsdbtablemodel.cpp

Lines changed: 284 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,284 @@
1+
/***************************************************************************
2+
qgsdbtablemodel.cpp - description
3+
-------------------
4+
begin : Dec 2007
5+
copyright : (C) 2007 by Marco Hugentobler
6+
email : marco dot hugentobler at karto dot baug dot ethz dot ch
7+
***************************************************************************/
8+
9+
/***************************************************************************
10+
* *
11+
* This program is free software; you can redistribute it and/or modify *
12+
* it under the terms of the GNU General Public License as published by *
13+
* the Free Software Foundation; either version 2 of the License, or *
14+
* (at your option) any later version. *
15+
* *
16+
***************************************************************************/
17+
18+
#include "qgsdbtablemodel.h"
19+
#include "qgsapplication.h"
20+
21+
QgsDbTableModel::QgsDbTableModel(): QStandardItemModel(), mTableCount(0)
22+
{
23+
QStringList headerLabels;
24+
headerLabels << tr("Schema");
25+
headerLabels << tr("Table");
26+
headerLabels << tr("Type");
27+
headerLabels << tr("Geometry column");
28+
headerLabels << tr("Sql");
29+
setHorizontalHeaderLabels(headerLabels);
30+
}
31+
32+
QgsDbTableModel::~QgsDbTableModel()
33+
{
34+
35+
}
36+
37+
void QgsDbTableModel::addTableEntry(QString type, QString schemaName, QString tableName, QString geometryColName, QString sql)
38+
{
39+
//is there already a root item with the given scheme Name?
40+
QStandardItem* schemaItem;
41+
QList<QStandardItem*> schemaItems = findItems(schemaName, Qt::MatchExactly, 0);
42+
43+
//there is already an item for this schema
44+
if(schemaItems.size() > 0)
45+
{
46+
schemaItem = schemaItems.at(0);
47+
}
48+
else //create a new toplevel item for this schema
49+
{
50+
schemaItem = new QStandardItem(schemaName);
51+
schemaItem->setFlags(Qt::ItemIsEnabled);
52+
invisibleRootItem()->setChild (invisibleRootItem()->rowCount(), schemaItem);
53+
}
54+
55+
//path to icon for specified type
56+
QString myThemePath = QgsApplication::themePath();
57+
QString typeName;
58+
QString iconFile;
59+
60+
QGis::WKBTYPE wkbType = qgisTypeFromDbType(type);
61+
iconFile = iconFilePathForType(wkbType);
62+
63+
QList<QStandardItem*> childItemList;
64+
QStandardItem* schemaNameItem = new QStandardItem(schemaName);
65+
schemaNameItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
66+
QStandardItem* typeItem = new QStandardItem(QIcon(iconFile), type);
67+
typeItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
68+
QStandardItem* tableItem = new QStandardItem(tableName);
69+
tableItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
70+
QStandardItem* geomItem = new QStandardItem(geometryColName);
71+
geomItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
72+
QStandardItem* sqlItem = new QStandardItem(sql);
73+
sqlItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
74+
75+
76+
childItemList.push_back(schemaNameItem);
77+
childItemList.push_back(tableItem);
78+
childItemList.push_back(typeItem);
79+
childItemList.push_back(geomItem);
80+
childItemList.push_back(sqlItem);
81+
82+
schemaItem->appendRow(childItemList);
83+
++mTableCount;
84+
}
85+
86+
void QgsDbTableModel::setSql(const QModelIndex& index, const QString& sql)
87+
{
88+
if(!index.isValid() || !index.parent().isValid())
89+
{
90+
return;
91+
}
92+
93+
//find out schema name and table name
94+
QModelIndex schemaSibling = index.sibling(index.row(), 0);
95+
QModelIndex tableSibling = index.sibling(index.row(), 1);
96+
97+
if(!schemaSibling.isValid() || !tableSibling.isValid())
98+
{
99+
return;
100+
}
101+
102+
QString schemaName = itemFromIndex(schemaSibling)->text();
103+
QString tableName = itemFromIndex(tableSibling)->text();
104+
105+
QList<QStandardItem*> schemaItems = findItems(schemaName, Qt::MatchExactly, 0);
106+
if(schemaItems.size() < 1)
107+
{
108+
return;
109+
}
110+
111+
QStandardItem* schemaItem = schemaItems.at(0);
112+
int numChildren = schemaItem->rowCount();
113+
114+
QModelIndex currentChildIndex;
115+
QModelIndex currentTableIndex;
116+
117+
for(int i = 0; i < numChildren; ++i)
118+
{
119+
currentChildIndex = indexFromItem(schemaItem->child(i, 0));
120+
if(!currentChildIndex.isValid())
121+
{
122+
continue;
123+
}
124+
currentTableIndex = currentChildIndex.sibling(i, 1);
125+
if(!currentTableIndex.isValid())
126+
{
127+
continue;
128+
}
129+
130+
if(itemFromIndex(currentTableIndex)->text() == tableName)
131+
{
132+
QModelIndex sqlIndex = currentChildIndex.sibling(i, 4);
133+
if(sqlIndex.isValid())
134+
{
135+
itemFromIndex(sqlIndex)->setText(sql);
136+
break;
137+
}
138+
}
139+
}
140+
}
141+
142+
void QgsDbTableModel::setGeometryTypesForTable(const QString& schema, const QString& table, const QString& attribute, const QString& type)
143+
{
144+
bool typeIsEmpty = type.isEmpty(); //true means the table has no valid geometry entry and the item for this table should be removed
145+
QStringList typeList = type.split(",");
146+
147+
//find schema item and table item
148+
QStandardItem* schemaItem;
149+
QList<QStandardItem*> schemaItems = findItems(schema, Qt::MatchExactly, 0);
150+
151+
if(schemaItems.size() < 1)
152+
{
153+
return;
154+
}
155+
schemaItem = schemaItems.at(0);
156+
int numChildren = schemaItem->rowCount();
157+
158+
QModelIndex currentChildIndex;
159+
QModelIndex currentTableIndex;
160+
QModelIndex currentTypeIndex;
161+
QModelIndex currentGeomColumnIndex;
162+
163+
for(int i = 0; i < numChildren; ++i)
164+
{
165+
currentChildIndex = indexFromItem(schemaItem->child(i, 0));
166+
if(!currentChildIndex.isValid())
167+
{
168+
continue;
169+
}
170+
currentTableIndex = currentChildIndex.sibling(i, 1);
171+
currentTypeIndex = currentChildIndex.sibling(i, 2);
172+
currentGeomColumnIndex = currentChildIndex.sibling(i, 3);
173+
QString geomColText = itemFromIndex(currentGeomColumnIndex)->text();
174+
175+
if(!currentTypeIndex.isValid() || !currentTableIndex.isValid() || !currentGeomColumnIndex.isValid())
176+
{
177+
continue;
178+
}
179+
180+
if(itemFromIndex(currentTableIndex)->text() == table)
181+
{
182+
if(typeIsEmpty)
183+
{
184+
removeRow(i, indexFromItem(schemaItem));
185+
return;
186+
}
187+
for(int j = 0; j < typeList.size(); ++j)
188+
{
189+
if(j == 0)
190+
{
191+
QGis::WKBTYPE wkbType = qgisTypeFromDbType(typeList.at(0));
192+
QString iconPath = iconFilePathForType(wkbType);
193+
itemFromIndex(currentTypeIndex)->setText(typeList.at(0)); //todo: add other rows
194+
itemFromIndex(currentTypeIndex)->setIcon(QIcon(iconPath));
195+
if(!geomColText.contains("AS"))
196+
{
197+
itemFromIndex(currentGeomColumnIndex)->setText(geomColText + " AS " + typeList.at(0));
198+
}
199+
}
200+
else
201+
{
202+
//todo: add correct type
203+
addTableEntry(typeList.at(j), schema, table, geomColText + " AS " + typeList.at(j), "");
204+
}
205+
}
206+
}
207+
}
208+
}
209+
210+
QString QgsDbTableModel::iconFilePathForType(QGis::WKBTYPE type) const
211+
{
212+
QString myThemePath = QgsApplication::themePath();
213+
if(type == QGis::WKBPoint || type == QGis::WKBPoint25D || type == QGis::WKBMultiPoint || type == QGis::WKBMultiPoint25D)
214+
{
215+
return myThemePath+"/mIconPointLayer.png";
216+
}
217+
else if(type == QGis::WKBLineString || type == QGis::WKBLineString25D || type == QGis::WKBMultiLineString || type == QGis::WKBMultiLineString25D)
218+
{
219+
return myThemePath+"/mIconLineLayer.png";
220+
}
221+
else if(type == QGis::WKBPolygon || type == QGis::WKBPolygon25D || type == QGis::WKBMultiPolygon || type == QGis::WKBMultiPolygon25D)
222+
{
223+
return myThemePath+"/mIconPolygonLayer.png";
224+
}
225+
else return "";
226+
}
227+
228+
QString QgsDbTableModel::displayStringForType(QGis::WKBTYPE type) const
229+
{
230+
if(type == QGis::WKBPoint || type == QGis::WKBPoint25D)
231+
{
232+
return tr("Point");
233+
}
234+
else if(type == QGis::WKBMultiPoint || type == QGis::WKBMultiPoint25D)
235+
{
236+
return tr("Multipoint");
237+
}
238+
else if(type == QGis::WKBLineString || type == QGis::WKBLineString25D)
239+
{
240+
return tr("Line");
241+
}
242+
else if(type == QGis::WKBMultiLineString || type == QGis::WKBMultiLineString25D)
243+
{
244+
return tr("Multiline");
245+
}
246+
else if(type == QGis::WKBPolygon || type == QGis::WKBPolygon25D)
247+
{
248+
return tr("Polygon");
249+
}
250+
else if(type == QGis::WKBMultiPolygon || type == QGis::WKBMultiPolygon25D)
251+
{
252+
return tr("Multipolygon");
253+
}
254+
return "Unknown";
255+
}
256+
257+
QGis::WKBTYPE QgsDbTableModel::qgisTypeFromDbType(const QString& dbType) const
258+
{
259+
if(dbType == "POINT")
260+
{
261+
return QGis::WKBPoint;
262+
}
263+
else if(dbType == "MULTIPOINT")
264+
{
265+
return QGis::WKBMultiPoint;
266+
}
267+
else if(dbType == "LINESTRING")
268+
{
269+
return QGis::WKBLineString;
270+
}
271+
else if(dbType == "MULTILINESTRING")
272+
{
273+
return QGis::WKBMultiLineString;
274+
}
275+
else if(dbType == "POLYGON")
276+
{
277+
return QGis::WKBPolygon;
278+
}
279+
else if(dbType == "MULTIPOLYGON")
280+
{
281+
return QGis::WKBMultiPolygon;
282+
}
283+
return QGis::WKBUnknown;
284+
}

‎src/core/qgsdbtablemodel.h

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/***************************************************************************
2+
qgsdbtablemodel.h - description
3+
-------------------
4+
begin : Dec 2007
5+
copyright : (C) 2007 by Marco Hugentobler
6+
email : marco dot hugentobler at karto dot baug dot ethz dot ch
7+
***************************************************************************/
8+
9+
/***************************************************************************
10+
* *
11+
* This program is free software; you can redistribute it and/or modify *
12+
* it under the terms of the GNU General Public License as published by *
13+
* the Free Software Foundation; either version 2 of the License, or *
14+
* (at your option) any later version. *
15+
* *
16+
***************************************************************************/
17+
18+
#include <QStandardItemModel>
19+
#include "qgis.h"
20+
21+
/**A model that holds the tables of a database in a hierarchy where the
22+
schemas are the root elements that contain the individual tables as children.
23+
The tables have the following columns: Type, Schema, Tablename, Geometry Column, Sql*/
24+
class CORE_EXPORT QgsDbTableModel: public QStandardItemModel
25+
{
26+
public:
27+
QgsDbTableModel();
28+
~QgsDbTableModel();
29+
/**Adds entry for one database table to the model*/
30+
void addTableEntry(QString type, QString schemaName, QString tableName, QString geometryColName, QString Sql);
31+
/**Sets an sql statement that belongs to a cell specified by a model index*/
32+
void setSql(const QModelIndex& index, const QString& sql);
33+
/**Sets one or more geometry types to a row. In case of several types, additional rows are inserted.
34+
This is for tables where the type is dectected later by thread*/
35+
void setGeometryTypesForTable(const QString& schema, const QString& table, const QString& attribute, const QString& type);
36+
/**Returns the number of tables in the model*/
37+
int tableCount() const {return mTableCount;}
38+
39+
private:
40+
/**Number of tables in the model*/
41+
int mTableCount;
42+
43+
QString iconFilePathForType(QGis::WKBTYPE type) const;
44+
QString displayStringForType(QGis::WKBTYPE type) const;
45+
/**Returns qgis wkbtype from database typename*/
46+
QGis::WKBTYPE qgisTypeFromDbType(const QString& dbType) const;
47+
};
48+

‎src/providers/postgres/qgspostgresprovider.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2536,7 +2536,16 @@ bool QgsPostgresProvider::getGeometryDetails()
25362536
sql = "select "
25372537
"srid(\"" + geometryColumn + "\"), "
25382538
"geometrytype(\"" + geometryColumn + "\") from " +
2539-
mSchemaTableName + " limit 1";
2539+
mSchemaTableName;
2540+
2541+
//it is possible that the where clause restricts the feature type
2542+
if(!sqlWhereClause.isEmpty())
2543+
{
2544+
sql += " WHERE ";
2545+
sql += sqlWhereClause;
2546+
}
2547+
2548+
sql += " limit 1";
25402549

25412550
result = executeDbCommand(connection, sql);
25422551

‎src/ui/qgsdbsourceselectbase.ui

Lines changed: 95 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<rect>
66
<x>0</x>
77
<y>0</y>
8-
<width>494</width>
9-
<height>481</height>
8+
<width>472</width>
9+
<height>687</height>
1010
</rect>
1111
</property>
1212
<property name="windowTitle" >
@@ -28,10 +28,76 @@
2828
<property name="spacing" >
2929
<number>6</number>
3030
</property>
31-
<item row="3" column="0" colspan="2" >
31+
<item row="2" column="0" >
32+
<spacer>
33+
<property name="orientation" >
34+
<enum>Qt::Horizontal</enum>
35+
</property>
36+
<property name="sizeHint" >
37+
<size>
38+
<width>271</width>
39+
<height>20</height>
40+
</size>
41+
</property>
42+
</spacer>
43+
</item>
44+
<item row="1" column="0" colspan="2" >
45+
<widget class="QTreeView" name="mTablesTreeView" >
46+
<property name="selectionMode" >
47+
<enum>QAbstractItemView::MultiSelection</enum>
48+
</property>
49+
</widget>
50+
</item>
51+
<item row="0" column="0" colspan="2" >
52+
<widget class="QGroupBox" name="groupBox" >
53+
<property name="title" >
54+
<string>PostgreSQL Connections</string>
55+
</property>
56+
<layout class="QGridLayout" >
57+
<property name="margin" >
58+
<number>11</number>
59+
</property>
60+
<property name="spacing" >
61+
<number>6</number>
62+
</property>
63+
<item row="1" column="3" >
64+
<widget class="QPushButton" name="btnDelete" >
65+
<property name="text" >
66+
<string>Delete</string>
67+
</property>
68+
</widget>
69+
</item>
70+
<item row="1" column="2" >
71+
<widget class="QPushButton" name="btnEdit" >
72+
<property name="text" >
73+
<string>Edit</string>
74+
</property>
75+
</widget>
76+
</item>
77+
<item row="1" column="1" >
78+
<widget class="QPushButton" name="btnNew" >
79+
<property name="text" >
80+
<string>New</string>
81+
</property>
82+
</widget>
83+
</item>
84+
<item row="1" column="0" >
85+
<widget class="QPushButton" name="btnConnect" >
86+
<property name="text" >
87+
<string>Connect</string>
88+
</property>
89+
</widget>
90+
</item>
91+
<item row="0" column="0" colspan="4" >
92+
<widget class="QComboBox" name="cmbConnections" />
93+
</item>
94+
</layout>
95+
</widget>
96+
</item>
97+
<item row="4" column="0" colspan="2" >
3298
<layout class="QHBoxLayout" >
3399
<property name="margin" >
34-
<number>0</number>
100+
<number>11</number>
35101
</property>
36102
<property name="spacing" >
37103
<number>6</number>
@@ -99,20 +165,10 @@
99165
</item>
100166
</layout>
101167
</item>
102-
<item row="2" column="1" >
103-
<widget class="QComboBox" name="mEncodingComboBox" />
104-
</item>
105-
<item row="2" column="0" >
106-
<widget class="QLabel" name="mEncodingLabel" >
107-
<property name="text" >
108-
<string>Encoding:</string>
109-
</property>
110-
</widget>
111-
</item>
112-
<item row="1" column="0" colspan="2" >
113-
<widget class="QGroupBox" name="groupBox_2" >
168+
<item row="3" column="0" colspan="2" >
169+
<widget class="QGroupBox" name="mSearchGroupBox" >
114170
<property name="title" >
115-
<string>Tables:</string>
171+
<string/>
116172
</property>
117173
<layout class="QGridLayout" >
118174
<property name="margin" >
@@ -122,91 +178,45 @@
122178
<number>6</number>
123179
</property>
124180
<item row="0" column="0" >
125-
<widget class="QTableWidget" name="lstTables" >
126-
<property name="mouseTracking" >
127-
<bool>true</bool>
128-
</property>
129-
<property name="editTriggers" >
130-
<set>QAbstractItemView::NoEditTriggers</set>
131-
</property>
132-
<property name="selectionMode" >
133-
<enum>QAbstractItemView::ExtendedSelection</enum>
134-
</property>
135-
<property name="selectionBehavior" >
136-
<enum>QAbstractItemView::SelectRows</enum>
137-
</property>
138-
<property name="showGrid" >
139-
<bool>false</bool>
140-
</property>
141-
<property name="gridStyle" >
142-
<enum>Qt::SolidLine</enum>
143-
</property>
144-
<column>
145-
<property name="text" >
146-
<string>Type</string>
147-
</property>
148-
</column>
149-
<column>
150-
<property name="text" >
151-
<string>Name</string>
152-
</property>
153-
</column>
154-
<column>
155-
<property name="text" >
156-
<string>Sql</string>
157-
</property>
158-
</column>
159-
</widget>
160-
</item>
161-
</layout>
162-
</widget>
163-
</item>
164-
<item row="0" column="0" colspan="2" >
165-
<widget class="QGroupBox" name="groupBox" >
166-
<property name="title" >
167-
<string>PostgreSQL Connections</string>
168-
</property>
169-
<layout class="QGridLayout" >
170-
<property name="margin" >
171-
<number>9</number>
172-
</property>
173-
<property name="spacing" >
174-
<number>6</number>
175-
</property>
176-
<item row="1" column="3" >
177-
<widget class="QPushButton" name="btnDelete" >
181+
<widget class="QLabel" name="mSearchLabel" >
178182
<property name="text" >
179-
<string>Delete</string>
183+
<string>Search:</string>
180184
</property>
181185
</widget>
182186
</item>
183-
<item row="1" column="2" >
184-
<widget class="QPushButton" name="btnEdit" >
187+
<item row="2" column="0" colspan="2" >
188+
<widget class="QLabel" name="mSearchModeLabel" >
185189
<property name="text" >
186-
<string>Edit</string>
190+
<string>Search mode:</string>
187191
</property>
188192
</widget>
189193
</item>
190-
<item row="1" column="1" >
191-
<widget class="QPushButton" name="btnNew" >
192-
<property name="text" >
193-
<string>New</string>
194-
</property>
195-
</widget>
194+
<item row="2" column="2" >
195+
<widget class="QComboBox" name="mSearchModeComboBox" />
196196
</item>
197-
<item row="1" column="0" >
198-
<widget class="QPushButton" name="btnConnect" >
197+
<item row="1" column="0" colspan="2" >
198+
<widget class="QLabel" name="mSearchColumnsLabel" >
199199
<property name="text" >
200-
<string>Connect</string>
200+
<string>Search in columns:</string>
201201
</property>
202202
</widget>
203203
</item>
204-
<item row="0" column="0" colspan="4" >
205-
<widget class="QComboBox" name="cmbConnections" />
204+
<item row="1" column="2" >
205+
<widget class="QComboBox" name="mSearchColumnComboBox" />
206+
</item>
207+
<item row="0" column="1" colspan="2" >
208+
<widget class="QLineEdit" name="mSearchTableEdit" />
206209
</item>
207210
</layout>
208211
</widget>
209212
</item>
213+
<item row="2" column="1" >
214+
<widget class="QPushButton" name="mSearchOptionsButton" >
215+
<property name="text" >
216+
<string>Search options...</string>
217+
</property>
218+
</widget>
219+
</item>
210220
</layout>
211221
</widget>
212222
<layoutdefault spacing="6" margin="11" />
@@ -216,8 +226,6 @@
216226
<tabstop>btnNew</tabstop>
217227
<tabstop>btnEdit</tabstop>
218228
<tabstop>btnDelete</tabstop>
219-
<tabstop>lstTables</tabstop>
220-
<tabstop>mEncodingComboBox</tabstop>
221229
<tabstop>btnHelp</tabstop>
222230
<tabstop>btnAdd</tabstop>
223231
<tabstop>btnCancel</tabstop>

0 commit comments

Comments
 (0)
Please sign in to comment.