Skip to content

Commit

Permalink
another few ui cleanups
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12029 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
macho committed Nov 8, 2009
1 parent 7e7f550 commit 9039bc7
Show file tree
Hide file tree
Showing 5 changed files with 326 additions and 375 deletions.
13 changes: 9 additions & 4 deletions src/app/qgspgsourceselect.cpp
Expand Up @@ -43,7 +43,12 @@ QgsPgSourceSelect::QgsPgSourceSelect( QWidget *parent, Qt::WFlags fl )
: QDialog( parent, fl ), mColumnTypeThread( NULL ), pd( 0 )
{
setupUi( this );
btnAdd->setEnabled( false );
mAddButton = new QPushButton( tr( "&Add" ) );
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
connect( mAddButton,SIGNAL( clicked() ), this, SLOT( addClicked() ) );
connect( buttonBox,SIGNAL( helpRequested() ), this, SLOT( helpClicked() ) );

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

mSearchModeComboBox->addItem( tr( "Wildcard" ) );
Expand Down Expand Up @@ -92,7 +97,7 @@ void QgsPgSourceSelect::on_btnDelete_clicked()
deleteConnection();
}
// Slot for performing action when the Add button is clicked
void QgsPgSourceSelect::on_btnAdd_clicked()
void QgsPgSourceSelect::addClicked()
{
addTables();
}
Expand All @@ -104,7 +109,7 @@ void QgsPgSourceSelect::on_btnEdit_clicked()
}

// Slot for showing help
void QgsPgSourceSelect::on_btnHelp_clicked()
void QgsPgSourceSelect::helpClicked()
{
showHelp();
}
Expand Down Expand Up @@ -466,7 +471,7 @@ void QgsPgSourceSelect::on_btnConnect_clicked()
}
// BEGIN CHANGES ECOS
if ( cmbConnections->count() > 0 )
btnAdd->setEnabled( true );
mAddButton->setEnabled( true );
// END CHANGES ECOS
}
else
Expand Down
8 changes: 6 additions & 2 deletions src/app/qgspgsourceselect.h
Expand Up @@ -21,6 +21,7 @@
#include "qgisgui.h"
#include "qgsdbfilterproxymodel.h"
#include "qgsdbtablemodel.h"
#include <QPushButton>

extern "C"
{
Expand Down Expand Up @@ -124,11 +125,14 @@ class QgsPgSourceSelect : public QDialog, private Ui::QgsPgSourceSelectBase
void dbChanged();

public slots:

void helpClicked();
void addClicked();

/*! Connects to the database using the stored connection parameters.
* Once connected, available layers are displayed.
*/
void on_btnConnect_clicked();
void on_btnAdd_clicked();
void on_btnNew_clicked();
void on_btnEdit_clicked();
void on_btnBuildQuery_clicked();
Expand All @@ -138,7 +142,6 @@ class QgsPgSourceSelect : public QDialog, private Ui::QgsPgSourceSelectBase
void on_mSearchColumnComboBox_currentIndexChanged( const QString & text );
void on_mSearchModeComboBox_currentIndexChanged( const QString & text );
void setSql( const QModelIndex& index );
void on_btnHelp_clicked();
void on_cmbConnections_activated( int );
void setLayerType( QString schema, QString table, QString column,
QString type );
Expand Down Expand Up @@ -188,6 +191,7 @@ class QgsPgSourceSelect : public QDialog, private Ui::QgsPgSourceSelectBase
QgsDbFilterProxyModel mProxyModel;

QString layerURI( const QModelIndex &index );
QPushButton * mAddButton;
};


Expand Down
185 changes: 64 additions & 121 deletions src/ui/qgspgsourceselectbase.ui
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>672</width>
<height>687</height>
<width>406</width>
<height>470</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -24,21 +24,8 @@
<property name="modal">
<bool>true</bool>
</property>
<layout class="QGridLayout">
<property name="margin">
<number>9</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="1" column="0" colspan="6">
<widget class="QTreeView" name="mTablesTreeView">
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
</widget>
</item>
<item row="0" column="0" colspan="6">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>PostgreSQL Connections</string>
Expand Down Expand Up @@ -84,78 +71,44 @@
</layout>
</widget>
</item>
<item row="4" column="0" colspan="6">
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
<item>
<widget class="QTreeView" name="mTablesTreeView">
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="margin">
<number>11</number>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnBuildQuery">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Build query</string>
</property>
<item>
<widget class="QPushButton" name="btnHelp">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Help</string>
</property>
<property name="shortcut">
<string>F1</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>141</width>
<height>21</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnAdd">
<property name="text">
<string>Add</string>
</property>
<property name="shortcut">
<string/>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnCancel">
<property name="text">
<string>Close</string>
</property>
<property name="shortcut">
<string/>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>271</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0" colspan="6">
<item>
<widget class="QPushButton" name="mSearchOptionsButton">
<property name="text">
<string>Search options...</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="mSearchGroupBox">
<property name="title">
<string/>
Expand All @@ -172,13 +125,19 @@
<property name="text">
<string>Search:</string>
</property>
<property name="buddy">
<cstring>mSearchTableEdit</cstring>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="mSearchModeLabel">
<property name="text">
<string>Search mode:</string>
</property>
<property name="buddy">
<cstring>mSearchModeComboBox</cstring>
</property>
</widget>
</item>
<item row="2" column="2">
Expand All @@ -189,6 +148,9 @@
<property name="text">
<string>Search in columns:</string>
</property>
<property name="buddy">
<cstring>mSearchColumnComboBox</cstring>
</property>
</widget>
</item>
<item row="1" column="2">
Expand All @@ -200,36 +162,13 @@
</layout>
</widget>
</item>
<item row="2" column="4">
<widget class="QPushButton" name="btnBuildQuery">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Build query</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="mSearchOptionsButton">
<property name="text">
<string>Search options...</string>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Close|QDialogButtonBox::Help</set>
</property>
</widget>
</item>
<item row="2" column="3">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>271</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
Expand All @@ -239,25 +178,29 @@
<tabstop>btnNew</tabstop>
<tabstop>btnEdit</tabstop>
<tabstop>btnDelete</tabstop>
<tabstop>btnHelp</tabstop>
<tabstop>btnAdd</tabstop>
<tabstop>btnCancel</tabstop>
<tabstop>mTablesTreeView</tabstop>
<tabstop>btnBuildQuery</tabstop>
<tabstop>mSearchOptionsButton</tabstop>
<tabstop>mSearchTableEdit</tabstop>
<tabstop>mSearchColumnComboBox</tabstop>
<tabstop>mSearchModeComboBox</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>btnCancel</sender>
<signal>clicked()</signal>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>QgsPgSourceSelectBase</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>404</x>
<x>353</x>
<y>446</y>
</hint>
<hint type="destinationlabel">
<x>229</x>
<y>236</y>
<x>404</x>
<y>421</y>
</hint>
</hints>
</connection>
Expand Down

0 comments on commit 9039bc7

Please sign in to comment.