Skip to content
Permalink
Browse files

another few ui cleanups

git-svn-id: http://svn.osgeo.org/qgis/trunk@12029 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
macho
macho committed Nov 8, 2009
1 parent 6ca251d commit 42c6e2542eed3efe0c04a8e90316419dd3a3d212
@@ -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" ) );
@@ -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();
}
@@ -104,7 +109,7 @@ void QgsPgSourceSelect::on_btnEdit_clicked()
}

// Slot for showing help
void QgsPgSourceSelect::on_btnHelp_clicked()
void QgsPgSourceSelect::helpClicked()
{
showHelp();
}
@@ -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
@@ -21,6 +21,7 @@
#include "qgisgui.h"
#include "qgsdbfilterproxymodel.h"
#include "qgsdbtablemodel.h"
#include <QPushButton>

extern "C"
{
@@ -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();
@@ -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 );
@@ -188,6 +191,7 @@ class QgsPgSourceSelect : public QDialog, private Ui::QgsPgSourceSelectBase
QgsDbFilterProxyModel mProxyModel;

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


@@ -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">
@@ -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>
@@ -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/>
@@ -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">
@@ -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">
@@ -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"/>
@@ -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>

0 comments on commit 42c6e25

Please sign in to comment.
You can’t perform that action at this time.