/
qgsopenvectorlayerdialog.h
91 lines (83 loc) · 3.59 KB
/
qgsopenvectorlayerdialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/***************************************************************************
qgsopenvectorlayerdialog.h
Dialog to select the type and source for ogr vectors, supports
file, database, directory and protocol sources.
-------------------
begin : Mon Jan 2 2009
copyright : (C) 2009 by Godofredo Contreras Nava
email : frdcn at hotmail.com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/* $Id:$ */
#ifndef QGSOPENVECTORLAYERDIALOG_H
#define QGSOPENVECTORLAYERDIALOG_H
#include <ui_qgsopenvectorlayerdialogbase.h>
#include <QDialog>
#include "qgscontexthelp.h"
/**
* Class for a dialog to select the type and source for ogr vectors, supports
* file, database, directory and protocol sources.
*/
class QgsOpenVectorLayerDialog : public QDialog, private Ui::QgsOpenVectorLayerDialogBase
{
Q_OBJECT
public:
QgsOpenVectorLayerDialog( QWidget* parent = 0, Qt::WFlags fl = 0 );
~QgsOpenVectorLayerDialog();
//! Opens a dialog to select a file datasource*/
QStringList openFile();
//! Opens a dialog to select a directory datasource*/
QString openDirectory();
//! Returns a list of selected datasources*/
QStringList dataSources();
//! Returns the encoding selected for user*/
QString encoding();
//! Returns the connection type
QString dataSourceType();
private:
//! Stores the file vector filters */
QString mVectorFileFilter;
//! Stores the selected datasources */
QStringList mDataSources;
//! Stores the user selected encoding
QString mEnc;
//! Stores the datasource type
QString mDataSourceType;
private slots:
//! Opens the create connection dialog to build a new connection
void addNewConnection();
//! Opens a dialog to edit an existing connection
void editConnection();
//! Deletes the selected connection
void deleteConnection();
//! Populate the connection list combo box
void populateConnectionList();
//! Sets the actual position in connection list
void setConnectionListPosition();
//! Sets the actual position in types connection list
void setConnectionTypeListPosition();
//! Sets the selected connection type
void setSelectedConnectionType();
//! Sets the selected connection
void setSelectedConnection();
void accept();
void on_buttonSelectSrc_clicked();
void on_radioSrcFile_toggled( bool checked );
void on_radioSrcDirectory_toggled( bool checked );
void on_radioSrcDatabase_toggled( bool checked );
void on_radioSrcProtocol_toggled( bool checked );
void on_btnNew_clicked();
void on_btnEdit_clicked();
void on_btnDelete_clicked();
void on_cmbDatabaseTypes_currentIndexChanged( const QString & text );
void on_cmbConnections_currentIndexChanged( const QString & text );
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
};
#endif // QGSOPENVECTORDIALOG_H