Skip to content

Commit

Permalink
another ui cleanups (mainly exchanged buttons with buttonbox)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@12037 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
macho committed Nov 8, 2009
1 parent 2a439e4 commit e2c27ac
Show file tree
Hide file tree
Showing 6 changed files with 1,051 additions and 1,149 deletions.
1,761 changes: 875 additions & 886 deletions i18n/qgis_uk.ts

Large diffs are not rendered by default.

7 changes: 1 addition & 6 deletions src/app/qgspgsourceselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void QgsPgSourceSelect::on_btnEdit_clicked()
// Slot for showing help
void QgsPgSourceSelect::helpClicked()
{
showHelp();
QgsContextHelp::run( context_id );
}
/** End Autoconnected SLOTS **/

Expand Down Expand Up @@ -730,11 +730,6 @@ bool QgsPgSourceSelect::getTableInfo( PGconn *pg, bool searchGeometryColumnsOnly
return n > 0;
}

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

QString QgsPgSourceSelect::fullDescription( QString schema, QString table,
QString column, QString type )
{
Expand Down
2 changes: 0 additions & 2 deletions src/app/qgspgsourceselect.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ class QgsPgSourceSelect : public QDialog, private Ui::QgsPgSourceSelectBase
// 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 schema, table and column data into a single string
// useful for display to the user
QString fullDescription( QString schema, QString table, QString column, QString type );
Expand Down
24 changes: 20 additions & 4 deletions src/app/qgsquerybuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ QgsQueryBuilder::QgsQueryBuilder( QgsVectorLayer *layer,
: QDialog( parent, fl ), mLayer( layer )
{
setupUi( this );
connect( buttonBox, SIGNAL( helpRequested() ), this, SLOT( helpClicked() ) );

QPushButton *pbn = new QPushButton( tr( "&Test" ) );
buttonBox->addButton( pbn, QDialogButtonBox::ActionRole );
connect( pbn, SIGNAL( clicked() ), this, SLOT( on_btnTest_clicked() ) );

pbn = new QPushButton( tr( "&Clear" ) );
buttonBox->addButton( pbn, QDialogButtonBox::ActionRole );
connect( pbn, SIGNAL( clicked() ), this, SLOT( on_btnClear_clicked() ) );

setupGuiViews();

mOrigSubsetString = layer->subsetString();
Expand Down Expand Up @@ -166,7 +176,13 @@ void QgsQueryBuilder::on_btnTest_clicked()
}
}

void QgsQueryBuilder::on_btnOk_clicked()
// Slot for showing help
void QgsQueryBuilder::helpClicked()
{
// QgsContextHelp::run( context_id );
}

void QgsQueryBuilder::accept()
{
// if user hits Ok and there is no query, skip the validation
if ( !txtSQL->toPlainText().trimmed().isEmpty() )
Expand All @@ -179,15 +195,15 @@ void QgsQueryBuilder::on_btnOk_clicked()
}
}

accept();
QDialog::accept();
}

void QgsQueryBuilder::on_btnCancel_clicked()
void QgsQueryBuilder::reject()
{
if ( mLayer->subsetString() != mOrigSubsetString )
mLayer->setSubsetString( mOrigSubsetString );

reject();
QDialog::reject();
}

void QgsQueryBuilder::on_btnEqual_clicked()
Expand Down
11 changes: 6 additions & 5 deletions src/app/qgsquerybuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
#include "ui_qgsquerybuilderbase.h"
#include "qgisgui.h"
#include "qgsfield.h"
#include <QPushButton>

class QgsVectorLayer;


/*!
* \class QgsQueryBuilder
* \brief Query Builder for PostgreSQL layers.
Expand Down Expand Up @@ -70,9 +69,11 @@ class QgsQueryBuilder : public QDialog, private Ui::QgsQueryBuilderBase
~QgsQueryBuilder();

public slots:
void accept();
void reject();
void helpClicked();
void on_btnClear_clicked();
void on_btnEqual_clicked();
void on_btnOk_clicked();
void on_btnCancel_clicked();
void on_btnLessThan_clicked();
void on_btnGreaterThan_clicked();
void on_btnPct_clicked();
Expand All @@ -91,7 +92,7 @@ class QgsQueryBuilder : public QDialog, private Ui::QgsQueryBuilderBase
void on_btnAnd_clicked();
void on_btnNot_clicked();
void on_btnOr_clicked();
void on_btnClear_clicked();

/*! Test the constructed sql statement to see if the database likes it.
* The number of rows that would be returned is displayed in a message box.
* The test uses a "select count(*) from ..." query to test the SQL
Expand Down
Loading

0 comments on commit e2c27ac

Please sign in to comment.