Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix #2526
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13017 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Mar 7, 2010
1 parent 82764c6 commit a1563a3
Show file tree
Hide file tree
Showing 3 changed files with 149 additions and 53 deletions.
17 changes: 13 additions & 4 deletions src/app/postgres/qgspgsourceselect.cpp
Expand Up @@ -50,6 +50,16 @@ QgsPgSourceSelect::QgsPgSourceSelect( QWidget *parent, Qt::WFlags fl )
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
connect( mAddButton, SIGNAL( clicked() ), this, SLOT( addTables() ) );

QPushButton *pb = new QPushButton( tr( "&Save" ) );
pb->setToolTip( tr( "Save connections" ) );
buttonBox->addButton( pb, QDialogButtonBox::ActionRole );
connect( pb, SIGNAL( clicked() ), this, SLOT( saveClicked() ) );

pb = new QPushButton( tr( "&Load" ) );
pb->setToolTip( tr( "Load connections" ) );
buttonBox->addButton( pb, QDialogButtonBox::ActionRole );
connect( pb, SIGNAL( clicked() ), this, SLOT( loadClicked() ) );

mAddButton->setEnabled( false );
populateConnectionList();

Expand Down Expand Up @@ -94,7 +104,7 @@ QgsPgSourceSelect::QgsPgSourceSelect( QWidget *parent, Qt::WFlags fl )
}

//hide the search options by default
//they will be shown when the user ticks
//they will be shown when the user ticks
//the search options group box
mSearchLabel->setVisible( false );
mSearchColumnComboBox->setVisible( false );
Expand Down Expand Up @@ -139,13 +149,13 @@ void QgsPgSourceSelect::on_btnDelete_clicked()
populateConnectionList();
}

void QgsPgSourceSelect::on_btnSave_clicked()
void QgsPgSourceSelect::saveClicked()
{
QgsManageConnectionsDialog dlg( this, QgsManageConnectionsDialog::Save, QgsManageConnectionsDialog::PostGIS );
dlg.exec();
}

void QgsPgSourceSelect::on_btnLoad_clicked()
void QgsPgSourceSelect::loadClicked()
{
QgsManageConnectionsDialog dlg( this, QgsManageConnectionsDialog::Load, QgsManageConnectionsDialog::PostGIS );
dlg.exec();
Expand Down Expand Up @@ -840,7 +850,6 @@ void QgsGeomColumnTypeThread::getLayerTypes()
// Now tell the layer list dialog box...
emit setLayerType( schemas[i], tables[i], columns[i], type );
}

}

PQfinish( pd );
Expand Down
4 changes: 2 additions & 2 deletions src/app/postgres/qgspgsourceselect.h
Expand Up @@ -132,9 +132,9 @@ class QgsPgSourceSelect : public QDialog, private Ui::QgsPgSourceSelectBase
//! Deletes the selected connection
void on_btnDelete_clicked();
//! Saves the selected connections to the file
void on_btnSave_clicked();
void saveClicked();
//! Loads the selected connections from the file
void on_btnLoad_clicked();
void loadClicked();
void on_mSearchTableEdit_textChanged( const QString & text );
void on_mSearchColumnComboBox_currentIndexChanged( const QString & text );
void on_mSearchModeComboBox_currentIndexChanged( const QString & text );
Expand Down
181 changes: 134 additions & 47 deletions src/ui/qgspgsourceselectbase.ui
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>406</width>
<height>500</height>
<width>362</width>
<height>476</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -71,24 +71,6 @@
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="btnSave">
<property name="text">
<string>Save connections</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnLoad">
<property name="text">
<string>Load connections</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTreeView" name="mTablesTreeView">
<property name="selectionMode">
Expand All @@ -107,29 +89,18 @@
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
<widget class="QGroupBox" name="mSearchGroupBox">
<property name="title">
<string>Search options</string>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>271</width>
<height>20</height>
</size>
<property name="flat">
<bool>true</bool>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="mSearchOptionsButton">
<property name="text">
<string>Search options...</string>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="mSearchGroupBox">
<property name="title">
<string/>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QGridLayout">
<property name="margin">
Expand All @@ -140,6 +111,9 @@
</property>
<item row="0" column="0">
<widget class="QLabel" name="mSearchLabel">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Search:</string>
</property>
Expand All @@ -150,6 +124,9 @@
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="mSearchModeLabel">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Search mode:</string>
</property>
Expand All @@ -159,10 +136,17 @@
</widget>
</item>
<item row="2" column="2">
<widget class="QComboBox" name="mSearchModeComboBox"/>
<widget class="QComboBox" name="mSearchModeComboBox">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="mSearchColumnsLabel">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Search in columns:</string>
</property>
Expand All @@ -172,10 +156,18 @@
</widget>
</item>
<item row="1" column="2">
<widget class="QComboBox" name="mSearchColumnComboBox"/>
<widget class="QComboBox" name="mSearchColumnComboBox">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QLineEdit" name="mSearchTableEdit"/>
<widget class="QLineEdit" name="mSearchTableEdit">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
Expand All @@ -198,7 +190,6 @@
<tabstop>btnDelete</tabstop>
<tabstop>mTablesTreeView</tabstop>
<tabstop>btnBuildQuery</tabstop>
<tabstop>mSearchOptionsButton</tabstop>
<tabstop>mSearchTableEdit</tabstop>
<tabstop>mSearchColumnComboBox</tabstop>
<tabstop>mSearchModeComboBox</tabstop>
Expand All @@ -213,14 +204,110 @@
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>353</x>
<y>446</y>
<x>352</x>
<y>466</y>
</hint>
<hint type="destinationlabel">
<x>404</x>
<x>361</x>
<y>421</y>
</hint>
</hints>
</connection>
<connection>
<sender>mSearchGroupBox</sender>
<signal>toggled(bool)</signal>
<receiver>mSearchTableEdit</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>85</x>
<y>324</y>
</hint>
<hint type="destinationlabel">
<x>177</x>
<y>360</y>
</hint>
</hints>
</connection>
<connection>
<sender>mSearchGroupBox</sender>
<signal>toggled(bool)</signal>
<receiver>mSearchColumnComboBox</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>88</x>
<y>325</y>
</hint>
<hint type="destinationlabel">
<x>254</x>
<y>381</y>
</hint>
</hints>
</connection>
<connection>
<sender>mSearchGroupBox</sender>
<signal>toggled(bool)</signal>
<receiver>mSearchModeComboBox</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>106</x>
<y>333</y>
</hint>
<hint type="destinationlabel">
<x>281</x>
<y>410</y>
</hint>
</hints>
</connection>
<connection>
<sender>mSearchGroupBox</sender>
<signal>toggled(bool)</signal>
<receiver>mSearchLabel</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>124</x>
<y>327</y>
</hint>
<hint type="destinationlabel">
<x>58</x>
<y>360</y>
</hint>
</hints>
</connection>
<connection>
<sender>mSearchGroupBox</sender>
<signal>toggled(bool)</signal>
<receiver>mSearchColumnsLabel</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>42</x>
<y>327</y>
</hint>
<hint type="destinationlabel">
<x>39</x>
<y>379</y>
</hint>
</hints>
</connection>
<connection>
<sender>mSearchGroupBox</sender>
<signal>toggled(bool)</signal>
<receiver>mSearchModeLabel</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>73</x>
<y>322</y>
</hint>
<hint type="destinationlabel">
<x>68</x>
<y>411</y>
</hint>
</hints>
</connection>
</connections>
</ui>

0 comments on commit a1563a3

Please sign in to comment.