Skip to content
Permalink
Browse files

ui cleanup to buttonbox

git-svn-id: http://svn.osgeo.org/qgis/trunk@12079 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
macho
macho committed Nov 10, 2009
1 parent 6b7ad07 commit fe94d6b59a309fbc77dbc7da90fd8cd8b24347f4
@@ -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"
@@ -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
@@ -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();
}
@@ -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
@@ -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" ) );
@@ -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()
@@ -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()
{
@@ -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:
@@ -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" ) );
@@ -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 **/
@@ -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 );
@@ -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 = "";
@@ -21,6 +21,7 @@
#include "qgisgui.h"
#include "qgsspatialitefilterproxymodel.h"
#include "qgsspatialitetablemodel.h"
#include <QPushButton>

extern "C"
{
@@ -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
@@ -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 );
@@ -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 fe94d6b

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