~ubuntu-branches/ubuntu/quantal/qgis/quantal

« back to all changes in this revision

Viewing changes to src/plugins/grass/qgsgrassselect.h

  • Committer: Bazaar Package Importer
  • Author(s): William Grant
  • Date: 2007-05-06 13:42:32 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070506134232-pyli6t388w5asd8x
Tags: 0.8.0-3ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
  - debian/rules, debian/qgis.install, debian/qgis.dirs debian/qgis.desktop:
    Add and install .desktop.
* debian/qgis.desktop: Remove Applications category; it's not real.
* Modify Maintainer value to match Debian-Maintainer-Field Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
    qgsgrassselect.h  -  Select GRASS layer dialog
 
3
                             -------------------
 
4
    begin                : March, 2004
 
5
    copyright            : (C) 2004 by Radim Blazek
 
6
    email                : blazek@itc.it
 
7
 ***************************************************************************/
 
8
/***************************************************************************
 
9
 *                                                                         *
 
10
 *   This program is free software; you can redistribute it and/or modify  *
 
11
 *   it under the terms of the GNU General Public License as published by  *
 
12
 *   the Free Software Foundation; either version 2 of the License, or     *
 
13
 *   (at your option) any later version.                                   *
 
14
 *                                                                         *
 
15
 ***************************************************************************/
 
16
#ifndef QGSGRASSSELECT_H
 
17
#define QGSGRASSSELECT_H
 
18
#include "ui_qgsgrassselectbase.h"
 
19
#include <QDialog>
 
20
/*! \class QgsGrassSelect
 
21
 * \brief Dialog to select GRASS layer.
 
22
 *
 
23
 */
 
24
class QgsGrassSelect: public QDialog, private Ui::QgsGrassSelectBase
 
25
{
 
26
    Q_OBJECT;
 
27
 
 
28
public:
 
29
    //! Constructor
 
30
    //QgsGrassSelect(QWidget *parent = 0, int type = VECTOR );
 
31
    QgsGrassSelect(int type = VECTOR );
 
32
    //! Destructor
 
33
    ~QgsGrassSelect();
 
34
 
 
35
    enum TYPE 
 
36
    { 
 
37
        MAPSET,
 
38
        VECTOR, 
 
39
        RASTER, 
 
40
        GROUP, // group of rasters, used in selectedType
 
41
        MAPCALC // file in $MAPSET/mapcalc directory (used by QgsGrassMapcalc)
 
42
    };
 
43
 
 
44
    //! Get list of vector layer
 
45
    static QStringList vectorLayers ( QString, QString, QString, QString );
 
46
 
 
47
    QString  gisdbase;
 
48
    QString  location;
 
49
    QString  mapset;
 
50
    QString  map;
 
51
    QString  layer;
 
52
    int      selectedType;  // RASTER or GROUP
 
53
 
 
54
public slots:
 
55
    //! OK 
 
56
    void on_ok_clicked();
 
57
 
 
58
    //! Cancel
 
59
    void on_cancel_clicked();
 
60
    
 
61
    //! Open dialog for Gisdbase
 
62
    void on_GisdbaseBrowse_clicked();
 
63
 
 
64
    //! Reset combobox of locations for current Gisdbase
 
65
    void on_egisdbase_textChanged() { setLocations(); }
 
66
    void setLocations();
 
67
    
 
68
    //! Reset combobox of mapsets for current Location
 
69
    void on_elocation_activated() { setMapsets(); }
 
70
    void setMapsets();
 
71
 
 
72
    //! Reset combobox of maps for current Gisdbase + Location
 
73
    void on_emapset_activated() { setMaps(); }
 
74
    void setMaps();
 
75
 
 
76
    //! Reset combobox of layers for current Gisdbase + Location + Map
 
77
    void on_emap_activated() { setLayers(); }
 
78
    void setLayers();
 
79
 
 
80
 
 
81
private:
 
82
    int type; // map type (mapset element)
 
83
    static bool first; // called first time
 
84
    static QString lastGisdbase; // Last selected values
 
85
    static QString lastLocation;
 
86
    static QString lastMapset;
 
87
    static QString lastVectorMap;
 
88
    static QString lastRasterMap;
 
89
    static QString lastLayer; // vector layer
 
90
    static QString lastMapcalc;
 
91
 
 
92
    void restorePosition(void);
 
93
    void saveWindowLocation(void);
 
94
};
 
95
 
 
96
 
 
97
#endif // QGSGRASSSELECT_H