Skip to content

Commit

Permalink
ui cleanup to buttonbox
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12079 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
macho committed Nov 10, 2009
1 parent 88e59f5 commit 307c869
Show file tree
Hide file tree
Showing 9 changed files with 269 additions and 375 deletions.
11 changes: 7 additions & 4 deletions src/app/qgsmapserverexport.cpp
Expand Up @@ -19,6 +19,7 @@ email : sherman at mrcc.com
#include "qgis.h"
#include "qgsdatasourceuri.h"
#include "qgshelpviewer.h"
#include "qgscontexthelp.h"
#include "qgsmapcanvas.h"
#include "qgsmaplayer.h"
#include "qgsrectangle.h"
Expand All @@ -37,6 +38,7 @@ QgsMapserverExport::QgsMapserverExport( QgsMapCanvas * _map, QWidget * parent, Q
: QDialog( parent, fl ), map( _map )
{
setupUi( this );
connect( buttonBox, SIGNAL( helpRequested() ),this,SLOT( help() ) );
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
// These values shouldn't be translated, the units should be in english in the map file
Expand Down Expand Up @@ -360,11 +362,12 @@ void QgsMapserverExport::on_btnChooseFile_clicked()
txtMapFilePath->setText( s );
}

void QgsMapserverExport::on_buttonHelp_clicked()
void QgsMapserverExport::help()
{
QgsContextHelp::run( context_id );
//QMessageBox::information(this, "Help","Help");
QgsHelpViewer *hv = new QgsHelpViewer( this );
//QgsHelpViewer *hv = new QgsHelpViewer( this );
// causes problems in qt3.1.x: hv->setModal(false);
hv->setCaption( "QGIS Help - Mapserver Export" );
hv->show();
//hv->setCaption( "QGIS Help - Mapserver Export" );
//hv->show();
}
4 changes: 3 additions & 1 deletion src/app/qgsmapserverexport.h
Expand Up @@ -55,14 +55,16 @@ class QgsMapserverExport: public QDialog, private Ui::QgsMapserverExportBase
public slots:
void on_chkExpLayersOnly_clicked();
void on_btnChooseFile_clicked();
void on_buttonHelp_clicked();
void help();

private:
void writeMapFile( void );
QString fileName;
QString fullPath;
bool neverSaved;
QgsMapCanvas *map;
int action;
static const int context_id = 0;
};

#endif //QGSMAPSERVEREXPORT_H
Expand Down
11 changes: 3 additions & 8 deletions src/app/qgsnewconnection.cpp
Expand Up @@ -33,7 +33,7 @@ QgsNewConnection::QgsNewConnection( QWidget *parent, const QString& connName, Qt
: QDialog( parent, fl ), mOriginalConnName( connName )
{
setupUi( this );
connect( buttonBox, SIGNAL( helpRequested() ),this,SLOT( help() ) );
connect( buttonBox, SIGNAL( helpRequested() ),this,SLOT( helpClicked() ) );

cbxSSLmode->insertItem( QgsDataSourceURI::SSLprefer, tr( "prefer" ) );
cbxSSLmode->insertItem( QgsDataSourceURI::SSLrequire, tr( "require" ) );
Expand Down Expand Up @@ -84,9 +84,9 @@ void QgsNewConnection::accept()
QDialog::accept();
}

void QgsNewConnection::help()
void QgsNewConnection::helpClicked()
{
helpInfo();
QgsContextHelp::run( context_id );
}

void QgsNewConnection::on_btnConnect_clicked()
Expand Down Expand Up @@ -151,11 +151,6 @@ void QgsNewConnection::saveConnection()
settings.setValue( baseKey + "/sslmode", cbxSSLmode->currentIndex() );
}

void QgsNewConnection::helpInfo()
{
QgsContextHelp::run( context_id );
}

#if 0
void QgsNewConnection::saveConnection()
{
Expand Down
4 changes: 1 addition & 3 deletions src/app/qgsnewconnection.h
Expand Up @@ -35,11 +35,9 @@ class QgsNewConnection : public QDialog, private Ui::QgsNewConnectionBase
void testConnection();
//! Saves the connection to ~/.qt/qgisrc
void saveConnection();
//! Display the context help
void helpInfo();
public slots:
void accept();
void help();
void helpClicked();
void on_btnConnect_clicked();
void on_cb_geometryColumnsOnly_clicked();
private:
Expand Down
20 changes: 10 additions & 10 deletions src/app/qgsspatialitesourceselect.cpp
Expand Up @@ -39,7 +39,12 @@ QgsSpatiaLiteSourceSelect::QgsSpatiaLiteSourceSelect( QgisApp * app, Qt::WFlags
QDialog( app, fl ), qgisApp( app )
{
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 @@ -79,15 +84,15 @@ void QgsSpatiaLiteSourceSelect::on_btnDelete_clicked()
}

// Slot for performing action when the Add button is clicked
void QgsSpatiaLiteSourceSelect::on_btnAdd_clicked()
void QgsSpatiaLiteSourceSelect::addClicked()
{
addTables();
}

// Slot for showing help
void QgsSpatiaLiteSourceSelect::on_btnHelp_clicked()
void QgsSpatiaLiteSourceSelect::helpClicked()
{
showHelp();
QgsContextHelp::run( context_id );
}

/** End Autoconnected SLOTS **/
Expand Down Expand Up @@ -475,7 +480,7 @@ void QgsSpatiaLiteSourceSelect::on_btnConnect_clicked()

// BEGIN CHANGES ECOS
if ( cmbConnections->count() > 0 )
btnAdd->setEnabled( true );
mAddButton->setEnabled( true );
// END CHANGES ECOS

mTablesTreeView->sortByColumn( 0, Qt::AscendingOrder );
Expand Down Expand Up @@ -553,11 +558,6 @@ bool QgsSpatiaLiteSourceSelect::getTableInfo( sqlite3 * handle )
return false;
}

void QgsSpatiaLiteSourceSelect::showHelp()
{
QgsContextHelp::run( context_id );
}

QString QgsSpatiaLiteSourceSelect::fullDescription( QString table, QString column, QString type )
{
QString full_desc = "";
Expand Down
8 changes: 4 additions & 4 deletions src/app/qgsspatialitesourceselect.h
Expand Up @@ -21,6 +21,7 @@
#include "qgisgui.h"
#include "qgsspatialitefilterproxymodel.h"
#include "qgsspatialitetablemodel.h"
#include <QPushButton>

extern "C"
{
Expand Down Expand Up @@ -80,14 +81,14 @@ class QgsSpatiaLiteSourceSelect: public QDialog, private Ui::QgsSpatiaLiteSource
* Once connected, available layers are displayed.
*/
void on_btnConnect_clicked();
void on_btnAdd_clicked();
void addClicked();
void on_btnNew_clicked();
void on_btnDelete_clicked();
void on_mSearchOptionsButton_clicked();
void on_mSearchTableEdit_textChanged( const QString & text );
void on_mSearchColumnComboBox_currentIndexChanged( const QString & text );
void on_mSearchModeComboBox_currentIndexChanged( const QString & text );
void on_btnHelp_clicked();
void helpClicked();
void on_cmbConnections_activated( int );
void setLayerType( QString table, QString column, QString type );
//!Sets a new regular expression to the model
Expand Down Expand Up @@ -115,8 +116,6 @@ class QgsSpatiaLiteSourceSelect: public QDialog, private Ui::QgsSpatiaLiteSource
// Set the position of the database connection list to the last
// used one.
void setConnectionListPosition();
// Show the context help for the dialog
void showHelp();
// Combine the table and column data into a single string
// useful for display to the user
QString fullDescription( QString table, QString column, QString type );
Expand All @@ -132,6 +131,7 @@ class QgsSpatiaLiteSourceSelect: public QDialog, private Ui::QgsSpatiaLiteSource
//! Model that acts as datasource for mTableTreeWidget
QgsSpatiaLiteTableModel mTableModel;
QgsSpatiaLiteFilterProxyModel mProxyModel;
QPushButton * mAddButton;
};

#endif // QGSSPATIALITESOURCESELECT_H

0 comments on commit 307c869

Please sign in to comment.