Skip to content

Commit

Permalink
last ui cleanups from my list -> buttonbox
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12080 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
macho committed Nov 10, 2009
1 parent 307c869 commit a14f6fe
Show file tree
Hide file tree
Showing 3 changed files with 170 additions and 195 deletions.
17 changes: 12 additions & 5 deletions src/app/qgswmssourceselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,16 @@ QgsWMSSourceSelect::QgsWMSSourceSelect( QWidget * parent, Qt::WFlags fl )
mWmsProvider( 0 )
{
setupUi( this );
mAddButton = new QPushButton( tr( "&Add" ) );
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
connect( mAddButton,SIGNAL( clicked() ), this, SLOT( addClicked() ) );
connect( buttonBox,SIGNAL( helpRequested() ), this, SLOT( helpClicked() ) );

mLayerUpButton->setIcon( QgisApp::getThemeIcon( "/mActionArrowUp.png" ) );
mLayerDownButton->setIcon( QgisApp::getThemeIcon( "/mActionArrowDown.png" ) );
connect( btnCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );

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

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

void QgsWMSSourceSelect::on_btnHelp_clicked()
void QgsWMSSourceSelect::helpClicked()
{

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

if ( lstLayers->topLevelItemCount() == 1 )
{
Expand All @@ -292,7 +299,7 @@ bool QgsWMSSourceSelect::populateLayerList( QgsWmsProvider *wmsProvider )
}
else
{
btnAdd->setEnabled( FALSE );
mAddButton->setEnabled( FALSE );
}

return TRUE;
Expand Down Expand Up @@ -427,7 +434,7 @@ void QgsWMSSourceSelect::on_btnConnect_clicked()

}

void QgsWMSSourceSelect::on_btnAdd_clicked()
void QgsWMSSourceSelect::addClicked()
{
if ( selectedLayers().empty() == TRUE )
{
Expand Down
8 changes: 6 additions & 2 deletions src/app/qgswmssourceselect.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "qgisgui.h"

#include <QStringList>
#include <QPushButton>

class QgisApp;
class QgsWmsProvider;
Expand Down Expand Up @@ -103,13 +104,14 @@ class QgsWMSSourceSelect : public QDialog, private Ui::QgsWMSSourceSelectBase
void on_btnConnect_clicked();

//! Determines the layers the user selected
void on_btnAdd_clicked();
void addClicked();


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

//! Opens help application
void on_btnHelp_clicked();
void helpClicked();

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

QPushButton * mAddButton;

//! The WMS provider that retrieves information for this dialog
QgsWmsProvider * mWmsProvider;

Expand Down
Loading

0 comments on commit a14f6fe

Please sign in to comment.