~ubuntu-branches/ubuntu/wily/qgis/wily

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Johan Van de Wauw
  • Date: 2010-07-11 20:23:24 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100711202324-5ktghxa7hracohmr
Tags: 1.4.0+12730-3ubuntu1
* Merge from Debian unstable (LP: #540941).
* Fix compilation issues with QT 4.7
* Add build-depends on libqt4-webkit-dev 

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#ifndef QGSGRASSNEWMAPSET_H
17
17
#define QGSGRASSNEWMAPSET_H
18
18
 
19
 
#include <vector>
20
 
//Added by qt3to4:
21
 
#include <QPixmap>
22
 
#include <QKeyEvent>
23
 
#include <QCloseEvent>
24
 
class QString;
25
 
class QCloseEvent;
26
 
#include <qlabel.h>
27
 
 
28
 
// Must be here, so that it is included to moc file
29
 
#include "qgisapp.h"
30
 
#include "qgisiface.h"
31
 
#include "qgspoint.h"
32
 
#include "qgsspatialrefsys.h"
33
 
#include "qgsprojectionselector.h"
34
 
 
35
 
class QgsGrassProvider;
36
 
#include "qgsgrassplugin.h"
37
19
#include "ui_qgsgrassnewmapsetbase.h"
38
 
#include <Q3Wizard>
39
 
#include "qgsgrassselect.h"
40
 
#include "qgsgrassattributes.h"
41
 
 
42
 
extern "C" {
 
20
#include "qgscoordinatereferencesystem.h"
 
21
 
 
22
class QgsGrassPlugin;
 
23
class QgisInterface;
 
24
class QgsPoint;
 
25
class QgsProjectionSelector;
 
26
 
 
27
extern "C"
 
28
{
43
29
#include <grass/gis.h>
44
 
#include <grass/gprojects.h>
45
 
#include <grass/Vect.h>
46
30
}
47
31
 
 
32
 
48
33
/*! \class QgsGrassNewMapset
49
34
 *  \brief GRASS vector edit.
50
35
 *
51
36
 */
52
 
class QgsGrassNewMapset : public Q3Wizard, private Ui::QgsGrassNewMapsetBase
 
37
class QgsGrassNewMapset : public QWizard, private Ui::QgsGrassNewMapsetBase
53
38
{
54
 
    Q_OBJECT;
55
 
 
56
 
public:
57
 
 
58
 
    enum PAGE { 
59
 
                DATABASE, 
60
 
                LOCATION, 
61
 
                PROJECTION,
62
 
                REGION,
63
 
                MAPSET, 
64
 
                FINISH
65
 
              };
66
 
    
 
39
    Q_OBJECT
 
40
 
 
41
  public:
 
42
 
 
43
    enum PAGE
 
44
    {
 
45
      DATABASE,
 
46
      LOCATION,
 
47
      CRS,
 
48
      REGION,
 
49
      MAPSET,
 
50
      FINISH
 
51
    };
 
52
 
67
53
    //! Constructor
68
 
    QgsGrassNewMapset ( QgisApp *qgisApp, QgisIface *iface,
69
 
                   QgsGrassPlugin *plugin, 
70
 
          QWidget * parent = 0, const char * name = "", Qt::WFlags f = 0 );
 
54
    QgsGrassNewMapset( QgisInterface *iface,
 
55
                       QgsGrassPlugin *plugin,
 
56
                       QWidget * parent = 0, Qt::WFlags f = 0 );
71
57
 
72
58
    //! Destructor
73
59
    ~QgsGrassNewMapset();
74
60
 
75
 
    //! Is running 
 
61
    //! Next page
 
62
    int nextId() const;
 
63
 
 
64
    //! Is running
76
65
    static bool isRunning();
77
66
 
78
67
    //! Close
79
 
    void close(); 
 
68
    void close();
80
69
 
81
 
public slots:
 
70
  public slots:
82
71
    //! Browse database
83
72
    void on_mDatabaseButton_clicked() { browseDatabase(); }
84
73
    void browseDatabase();
87
76
    void on_mDatabaseLineEdit_returnPressed() { databaseChanged(); }
88
77
    void on_mDatabaseLineEdit_textChanged() { databaseChanged(); }
89
78
    void databaseChanged();
90
 
    
 
79
 
91
80
    /***************** LOCATION *****************/
92
81
    //! Set location page
93
 
    void setLocationPage ( );
 
82
    void setLocationPage( );
94
83
 
95
84
    //! Set locations
96
 
    void setLocations ( );
 
85
    void setLocations( );
97
86
 
98
87
    //! Location radio switched
99
88
    void on_mCreateLocationRadioButton_clicked() { locationRadioSwitched(); }
100
89
    void on_mSelectLocationRadioButton_clicked() { locationRadioSwitched(); }
101
 
    void locationRadioSwitched ( );
 
90
    void locationRadioSwitched( );
102
91
 
103
92
    //! Existing location selection
104
 
    void on_mLocationComboBox_textChanged(const QString &txt) {
105
 
            existingLocationChanged ( txt ); }
106
 
    void existingLocationChanged(const QString&);
 
93
    void on_mLocationComboBox_textChanged( const QString &txt )
 
94
    {
 
95
      existingLocationChanged( txt );
 
96
    }
 
97
    void existingLocationChanged( const QString& );
107
98
 
108
99
    //! New location name has changed
109
100
    void on_mLocationLineEdit_returnPressed() { newLocationChanged(); }
113
104
    //! Check location
114
105
    void checkLocation();
115
106
 
116
 
    /***************** PROJECTION ****************/
 
107
    /***************** CRS ****************/
117
108
    //! Set projection page, called when entered from location page
118
109
    void setProjectionPage();
119
110
 
120
111
    //! Projection selected
121
 
    void sridSelected(QString);
 
112
    void sridSelected( QString );
122
113
    void projectionSelected();
123
114
 
124
115
    //! Location radio switched
125
116
    void on_mNoProjRadioButton_clicked() { projRadioSwitched(); }
126
117
    void on_mProjRadioButton_clicked() { projRadioSwitched(); }
127
 
    void projRadioSwitched ( );
 
118
    void projRadioSwitched( );
128
119
 
129
120
    //! Set GRASS projection structures for currently selected projection
130
 
    // or PROJECTION_XY if 'not defined' is selected
 
121
    // or CRS_XY if 'not defined' is selected
131
122
    void setGrassProjection();
132
 
    
 
123
 
133
124
    /******************* REGION ******************/
134
125
    //! Set region page, called when entered from projection
135
126
    void setRegionPage();
173
164
    //! Set finish page
174
165
    void setFinishPage();
175
166
 
176
 
    //! Finish / accept 
177
 
    void accept ();
 
167
    //! Finish / accept
 
168
    void accept();
178
169
 
179
170
    //! Create new mapset
180
171
    void createMapset();
181
172
 
182
173
    //! New page was selected
183
 
    void pageSelected ( const QString & );
 
174
    void pageSelected( int index );
184
175
 
185
176
    //! Close event
186
 
    void closeEvent(QCloseEvent *e);
 
177
    void closeEvent( QCloseEvent *e );
187
178
 
188
179
    //! Key event
189
 
    void keyPressEvent ( QKeyEvent * e );
 
180
    void keyPressEvent( QKeyEvent * e );
190
181
 
191
182
    //! Set error line
192
 
    void setError ( QLabel *line, const QString &err ); 
193
 
private:
194
 
    //! QGIS application
195
 
    QgisApp *mQgisApp; 
196
 
    
 
183
    void setError( QLabel *line, const QString &err );
 
184
  private:
197
185
    //! Pointer to the QGIS interface object
198
 
    QgisIface *mIface;
 
186
    QgisInterface *mIface;
199
187
 
200
188
    //! Plugin
201
189
    QgsGrassPlugin *mPlugin;
202
190
 
203
191
    //! Editing is already running
204
192
    static bool mRunning;
205
 
    
 
193
 
206
194
    //! Projection selector
207
195
    QgsProjectionSelector *mProjectionSelector;
208
196
 
217
205
    //! Was the region page modified by user
218
206
    bool mRegionModified;
219
207
 
220
 
    //! Check region seting 
 
208
    //! Check region seting
221
209
    void checkRegion();
222
210
 
223
211
    //! Region map
233
221
    //std::vector<double> mRegionsPoints;
234
222
 
235
223
    //! Last projection used for region
236
 
    QgsSpatialRefSys mSrs;
237
 
    //bool mSrsSet; 
 
224
    QgsCoordinateReferenceSystem mSrs;
 
225
    //bool mSrsSet;
238
226
};
239
227
 
240
228
#endif // QGSGRASSNEWMAPSET_H