Skip to content

Commit

Permalink
ui update
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@4468 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Jan 4, 2006
1 parent b277692 commit 8d1ed17
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 25 deletions.
33 changes: 24 additions & 9 deletions plugins/grass/qgsgrassselect.cpp
Expand Up @@ -40,6 +40,9 @@ QgsGrassSelect::QgsGrassSelect(int type):QgsGrassSelectBase()
#ifdef QGISDEBUG
std::cerr << "QgsGrassSelect() type = " << type << std::endl;
#endif

setupUi(this);

if ( first ) {
if ( QgsGrass::activeMode() ) {
lastGisdbase = QgsGrass::getDefaultGisdbase();
Expand Down Expand Up @@ -222,7 +225,7 @@ void QgsGrassSelect::setMapsets()
idx++;
}
}
if ( idx >= 0 ) {
if ( sel >= 0 ) {
emapset->setCurrentItem(sel);
}

Expand Down Expand Up @@ -307,11 +310,15 @@ void QgsGrassSelect::setMaps()
idx++;
}
}
if ( idx >= 0 ) {
if ( sel >= 0 ) {
emap->setCurrentItem(sel);
} else {
emap->clearEdit(); // set box line empty
}
/*
else
{
emap->clearEdit(); // set box line empty
}
*/

setLayers();
}
Expand Down Expand Up @@ -340,7 +347,7 @@ void QgsGrassSelect::setLayers()
idx++;
}

if ( idx >= 0 ) {
if ( sel >= 0 ) {
elayer->setCurrentItem(sel);
} else {
elayer->clearEdit(); // set box line empty
Expand Down Expand Up @@ -392,6 +399,10 @@ QStringList QgsGrassSelect::vectorLayers ( QString gisdbase,
QString fs;
fs.sprintf("%d",field);

#ifdef QGISDEBUG
std::cerr << "i = " << i << " layer = " << field << std::endl;
#endif

/* Points */
int npoints = Vect_cidx_get_type_count ( &map, field, GV_POINT);
if ( npoints > 0 ) {
Expand Down Expand Up @@ -425,15 +436,19 @@ QStringList QgsGrassSelect::vectorLayers ( QString gisdbase,
return list;
}

void QgsGrassSelect::getGisdbase()
void QgsGrassSelect::on_GisdbaseBrowse_clicked()
{

QString Gisdbase = QFileDialog::getExistingDirectory( this,
"Choose existing GISDBASE", egisdbase->text() );
egisdbase->setText ( Gisdbase );

if ( !Gisdbase.isNull() )
{
egisdbase->setText ( Gisdbase );
}
}

void QgsGrassSelect::accept()
void QgsGrassSelect::on_ok_clicked()
{
saveWindowLocation();

Expand Down Expand Up @@ -482,7 +497,7 @@ void QgsGrassSelect::accept()
QDialog::accept();
}

void QgsGrassSelect::reject()
void QgsGrassSelect::on_cancel_clicked()
{
saveWindowLocation();
QDialog::reject();
Expand Down
38 changes: 22 additions & 16 deletions plugins/grass/qgsgrassselect.h
Expand Up @@ -41,36 +41,42 @@ class QgsGrassSelect: public QDialog, private Ui::QgsGrassSelectBase
MAPCALC // file in $MAPSET/mapcalc directory (used by QgsGrassMapcalc)
};

//! Get list of vector layer
static QStringList vectorLayers ( QString, QString, QString, QString );

QString gisdbase;
QString location;
QString mapset;
QString map;
QString layer;
int selectedType; // RASTER or GROUP

public slots:
//! OK
void accept (void);
void on_ok_clicked();

//! Cancel
void reject (void);
void on_cancel_clicked();

//! Open dialog for Gisdbase
void getGisdbase(void);
void on_GisdbaseBrowse_clicked();

//! Reset combobox of locations for current Gisdbase
void setLocations (void );
void on_egisdbase_textChanged() { setLocations(); }
void setLocations();

//! Reset combobox of mapsets for current Location
void setMapsets (void );
void on_elocation_activated() { setMapsets(); }
void setMapsets();

//! Reset combobox of maps for current Gisdbase + Location
void setMaps (void );
void on_emapset_activated() { setMaps(); }
void setMaps();

//! Reset combobox of layers for current Gisdbase + Location + Map
void setLayers (void );
void on_emap_activated() { setLayers(); }
void setLayers();

//! Get list of vector layer
static QStringList vectorLayers ( QString, QString, QString, QString );

QString gisdbase;
QString location;
QString mapset;
QString map;
QString layer;
int selectedType; // RASTER or GROUP

private:
int type; // map type (mapset element)
Expand Down

0 comments on commit 8d1ed17

Please sign in to comment.