Skip to content

Commit fe94d6b

Browse files
author
macho
committed
ui cleanup to buttonbox
git-svn-id: http://svn.osgeo.org/qgis/trunk@12079 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 6b7ad07 commit fe94d6b

9 files changed

+269
-375
lines changed

src/app/qgsmapserverexport.cpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ email : sherman at mrcc.com
1919
#include "qgis.h"
2020
#include "qgsdatasourceuri.h"
2121
#include "qgshelpviewer.h"
22+
#include "qgscontexthelp.h"
2223
#include "qgsmapcanvas.h"
2324
#include "qgsmaplayer.h"
2425
#include "qgsrectangle.h"
@@ -37,6 +38,7 @@ QgsMapserverExport::QgsMapserverExport( QgsMapCanvas * _map, QWidget * parent, Q
3738
: QDialog( parent, fl ), map( _map )
3839
{
3940
setupUi( this );
41+
connect( buttonBox, SIGNAL( helpRequested() ),this,SLOT( help() ) );
4042
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
4143
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
4244
// These values shouldn't be translated, the units should be in english in the map file
@@ -360,11 +362,12 @@ void QgsMapserverExport::on_btnChooseFile_clicked()
360362
txtMapFilePath->setText( s );
361363
}
362364

363-
void QgsMapserverExport::on_buttonHelp_clicked()
365+
void QgsMapserverExport::help()
364366
{
367+
QgsContextHelp::run( context_id );
365368
//QMessageBox::information(this, "Help","Help");
366-
QgsHelpViewer *hv = new QgsHelpViewer( this );
369+
//QgsHelpViewer *hv = new QgsHelpViewer( this );
367370
// causes problems in qt3.1.x: hv->setModal(false);
368-
hv->setCaption( "QGIS Help - Mapserver Export" );
369-
hv->show();
371+
//hv->setCaption( "QGIS Help - Mapserver Export" );
372+
//hv->show();
370373
}

src/app/qgsmapserverexport.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,16 @@ class QgsMapserverExport: public QDialog, private Ui::QgsMapserverExportBase
5555
public slots:
5656
void on_chkExpLayersOnly_clicked();
5757
void on_btnChooseFile_clicked();
58-
void on_buttonHelp_clicked();
58+
void help();
59+
5960
private:
6061
void writeMapFile( void );
6162
QString fileName;
6263
QString fullPath;
6364
bool neverSaved;
6465
QgsMapCanvas *map;
6566
int action;
67+
static const int context_id = 0;
6668
};
6769

6870
#endif //QGSMAPSERVEREXPORT_H

src/app/qgsnewconnection.cpp

+3-8
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ QgsNewConnection::QgsNewConnection( QWidget *parent, const QString& connName, Qt
3333
: QDialog( parent, fl ), mOriginalConnName( connName )
3434
{
3535
setupUi( this );
36-
connect( buttonBox, SIGNAL( helpRequested() ),this,SLOT( help() ) );
36+
connect( buttonBox, SIGNAL( helpRequested() ),this,SLOT( helpClicked() ) );
3737

3838
cbxSSLmode->insertItem( QgsDataSourceURI::SSLprefer, tr( "prefer" ) );
3939
cbxSSLmode->insertItem( QgsDataSourceURI::SSLrequire, tr( "require" ) );
@@ -84,9 +84,9 @@ void QgsNewConnection::accept()
8484
QDialog::accept();
8585
}
8686

87-
void QgsNewConnection::help()
87+
void QgsNewConnection::helpClicked()
8888
{
89-
helpInfo();
89+
QgsContextHelp::run( context_id );
9090
}
9191

9292
void QgsNewConnection::on_btnConnect_clicked()
@@ -151,11 +151,6 @@ void QgsNewConnection::saveConnection()
151151
settings.setValue( baseKey + "/sslmode", cbxSSLmode->currentIndex() );
152152
}
153153

154-
void QgsNewConnection::helpInfo()
155-
{
156-
QgsContextHelp::run( context_id );
157-
}
158-
159154
#if 0
160155
void QgsNewConnection::saveConnection()
161156
{

src/app/qgsnewconnection.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,9 @@ class QgsNewConnection : public QDialog, private Ui::QgsNewConnectionBase
3535
void testConnection();
3636
//! Saves the connection to ~/.qt/qgisrc
3737
void saveConnection();
38-
//! Display the context help
39-
void helpInfo();
4038
public slots:
4139
void accept();
42-
void help();
40+
void helpClicked();
4341
void on_btnConnect_clicked();
4442
void on_cb_geometryColumnsOnly_clicked();
4543
private:

src/app/qgsspatialitesourceselect.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ QgsSpatiaLiteSourceSelect::QgsSpatiaLiteSourceSelect( QgisApp * app, Qt::WFlags
3939
QDialog( app, fl ), qgisApp( app )
4040
{
4141
setupUi( this );
42-
btnAdd->setEnabled( false );
42+
mAddButton = new QPushButton( tr( "&Add" ) );
43+
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
44+
connect( mAddButton,SIGNAL( clicked() ), this, SLOT( addClicked() ) );
45+
connect( buttonBox,SIGNAL( helpRequested() ), this, SLOT( helpClicked() ) );
46+
47+
mAddButton->setEnabled( false );
4348
populateConnectionList();
4449

4550
mSearchModeComboBox->addItem( tr( "Wildcard" ) );
@@ -79,15 +84,15 @@ void QgsSpatiaLiteSourceSelect::on_btnDelete_clicked()
7984
}
8085

8186
// Slot for performing action when the Add button is clicked
82-
void QgsSpatiaLiteSourceSelect::on_btnAdd_clicked()
87+
void QgsSpatiaLiteSourceSelect::addClicked()
8388
{
8489
addTables();
8590
}
8691

8792
// Slot for showing help
88-
void QgsSpatiaLiteSourceSelect::on_btnHelp_clicked()
93+
void QgsSpatiaLiteSourceSelect::helpClicked()
8994
{
90-
showHelp();
95+
QgsContextHelp::run( context_id );
9196
}
9297

9398
/** End Autoconnected SLOTS **/
@@ -475,7 +480,7 @@ void QgsSpatiaLiteSourceSelect::on_btnConnect_clicked()
475480

476481
// BEGIN CHANGES ECOS
477482
if ( cmbConnections->count() > 0 )
478-
btnAdd->setEnabled( true );
483+
mAddButton->setEnabled( true );
479484
// END CHANGES ECOS
480485

481486
mTablesTreeView->sortByColumn( 0, Qt::AscendingOrder );
@@ -553,11 +558,6 @@ bool QgsSpatiaLiteSourceSelect::getTableInfo( sqlite3 * handle )
553558
return false;
554559
}
555560

556-
void QgsSpatiaLiteSourceSelect::showHelp()
557-
{
558-
QgsContextHelp::run( context_id );
559-
}
560-
561561
QString QgsSpatiaLiteSourceSelect::fullDescription( QString table, QString column, QString type )
562562
{
563563
QString full_desc = "";

src/app/qgsspatialitesourceselect.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "qgisgui.h"
2222
#include "qgsspatialitefilterproxymodel.h"
2323
#include "qgsspatialitetablemodel.h"
24+
#include <QPushButton>
2425

2526
extern "C"
2627
{
@@ -80,14 +81,14 @@ class QgsSpatiaLiteSourceSelect: public QDialog, private Ui::QgsSpatiaLiteSource
8081
* Once connected, available layers are displayed.
8182
*/
8283
void on_btnConnect_clicked();
83-
void on_btnAdd_clicked();
84+
void addClicked();
8485
void on_btnNew_clicked();
8586
void on_btnDelete_clicked();
8687
void on_mSearchOptionsButton_clicked();
8788
void on_mSearchTableEdit_textChanged( const QString & text );
8889
void on_mSearchColumnComboBox_currentIndexChanged( const QString & text );
8990
void on_mSearchModeComboBox_currentIndexChanged( const QString & text );
90-
void on_btnHelp_clicked();
91+
void helpClicked();
9192
void on_cmbConnections_activated( int );
9293
void setLayerType( QString table, QString column, QString type );
9394
//!Sets a new regular expression to the model
@@ -115,8 +116,6 @@ class QgsSpatiaLiteSourceSelect: public QDialog, private Ui::QgsSpatiaLiteSource
115116
// Set the position of the database connection list to the last
116117
// used one.
117118
void setConnectionListPosition();
118-
// Show the context help for the dialog
119-
void showHelp();
120119
// Combine the table and column data into a single string
121120
// useful for display to the user
122121
QString fullDescription( QString table, QString column, QString type );
@@ -132,6 +131,7 @@ class QgsSpatiaLiteSourceSelect: public QDialog, private Ui::QgsSpatiaLiteSource
132131
//! Model that acts as datasource for mTableTreeWidget
133132
QgsSpatiaLiteTableModel mTableModel;
134133
QgsSpatiaLiteFilterProxyModel mProxyModel;
134+
QPushButton * mAddButton;
135135
};
136136

137137
#endif // QGSSPATIALITESOURCESELECT_H

0 commit comments

Comments
 (0)