Skip to content

Commit 61abea5

Browse files
author
macho
committed
last ui cleanups from my list -> buttonbox
git-svn-id: http://svn.osgeo.org/qgis/trunk@12080 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent fe94d6b commit 61abea5

File tree

3 files changed

+170
-195
lines changed

3 files changed

+170
-195
lines changed

src/app/qgswmssourceselect.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,16 @@ QgsWMSSourceSelect::QgsWMSSourceSelect( QWidget * parent, Qt::WFlags fl )
5656
mWmsProvider( 0 )
5757
{
5858
setupUi( this );
59+
mAddButton = new QPushButton( tr( "&Add" ) );
60+
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
61+
connect( mAddButton,SIGNAL( clicked() ), this, SLOT( addClicked() ) );
62+
connect( buttonBox,SIGNAL( helpRequested() ), this, SLOT( helpClicked() ) );
63+
5964
mLayerUpButton->setIcon( QgisApp::getThemeIcon( "/mActionArrowUp.png" ) );
6065
mLayerDownButton->setIcon( QgisApp::getThemeIcon( "/mActionArrowDown.png" ) );
61-
connect( btnCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
66+
67+
mAddButton->setEnabled( false );
68+
populateConnectionList();
6269

6370
// Qt Designer 4.1 doesn't let us use a QButtonGroup, so it has to
6471
// be done manually... Unless I'm missing something, it's a whole
@@ -201,7 +208,7 @@ void QgsWMSSourceSelect::on_btnDelete_clicked()
201208
}
202209
}
203210

204-
void QgsWMSSourceSelect::on_btnHelp_clicked()
211+
void QgsWMSSourceSelect::helpClicked()
205212
{
206213

207214
QgsContextHelp::run( context_id );
@@ -283,7 +290,7 @@ bool QgsWMSSourceSelect::populateLayerList( QgsWmsProvider *wmsProvider )
283290
// If we got some layers, let the user add them to the map
284291
if ( lstLayers->topLevelItemCount() > 0 )
285292
{
286-
btnAdd->setEnabled( TRUE );
293+
mAddButton->setEnabled( TRUE );
287294

288295
if ( lstLayers->topLevelItemCount() == 1 )
289296
{
@@ -292,7 +299,7 @@ bool QgsWMSSourceSelect::populateLayerList( QgsWmsProvider *wmsProvider )
292299
}
293300
else
294301
{
295-
btnAdd->setEnabled( FALSE );
302+
mAddButton->setEnabled( FALSE );
296303
}
297304

298305
return TRUE;
@@ -427,7 +434,7 @@ void QgsWMSSourceSelect::on_btnConnect_clicked()
427434

428435
}
429436

430-
void QgsWMSSourceSelect::on_btnAdd_clicked()
437+
void QgsWMSSourceSelect::addClicked()
431438
{
432439
if ( selectedLayers().empty() == TRUE )
433440
{

src/app/qgswmssourceselect.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "qgisgui.h"
2323

2424
#include <QStringList>
25+
#include <QPushButton>
2526

2627
class QgisApp;
2728
class QgsWmsProvider;
@@ -103,13 +104,14 @@ class QgsWMSSourceSelect : public QDialog, private Ui::QgsWMSSourceSelectBase
103104
void on_btnConnect_clicked();
104105

105106
//! Determines the layers the user selected
106-
void on_btnAdd_clicked();
107+
void addClicked();
108+
107109

108110
//! Opens the Spatial Reference System dialog.
109111
void on_btnChangeSpatialRefSys_clicked();
110112

111113
//! Opens help application
112-
void on_btnHelp_clicked();
114+
void helpClicked();
113115

114116
//! Signaled when a layer selection is changed. Ensures that only one style is selected per layer.
115117
void on_lstLayers_itemSelectionChanged();
@@ -182,6 +184,8 @@ class QgsWMSSourceSelect : public QDialog, private Ui::QgsWMSSourceSelectBase
182184
QButtonGroup* m_imageFormatGroup;
183185
QHBoxLayout* m_imageFormatLayout;
184186

187+
QPushButton * mAddButton;
188+
185189
//! The WMS provider that retrieves information for this dialog
186190
QgsWmsProvider * mWmsProvider;
187191

0 commit comments

Comments
 (0)