SciDAVis  1.D4
ImportASCIIDialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : ImportASCIIDialog.h
3  Project : SciDAVis
4  --------------------------------------------------------------------
5  Copyright : (C) 2006,2007 by Ion Vasilief,
6  Tilman Benkert, Knut Franke
7  Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net,
8  knut.franke*gmx.de
9  Description : Import ASCII file(s) dialog
10 
11  ***************************************************************************/
12 
13 /***************************************************************************
14  * *
15  * This program is free software; you can redistribute it and/or modify *
16  * it under the terms of the GNU General Public License as published by *
17  * the Free Software Foundation; either version 2 of the License, or *
18  * (at your option) any later version. *
19  * *
20  * This program is distributed in the hope that it will be useful, *
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
23  * GNU General Public License for more details. *
24  * *
25  * You should have received a copy of the GNU General Public License *
26  * along with this program; if not, write to the Free Software *
27  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
28  * Boston, MA 02110-1301 USA *
29  * *
30  ***************************************************************************/
31 #ifndef IMPORTFILESDIALOG_H
32 #define IMPORTFILESDIALOG_H
33 
34 #include "ExtensibleFileDialog.h"
35 
36 #include <QComboBox>
37 #include <QCheckBox>
38 #include <QSpinBox>
39 
40 class QGroupBox;
41 class QPushButton;
42 
45 {
46  Q_OBJECT
47 
48 public:
50 
53  enum ImportMode {
58  };
59 
61 
67  ImportASCIIDialog(bool importModeEnabled, QWidget * parent = 0, bool extended = true, Qt::WFlags flags = 0 );
68 
70 
73  ImportMode importMode() const { return (ImportMode) d_import_mode->currentIndex(); }
75  const QString columnSeparator() const;
77  int ignoredLines() const { return d_ignored_lines->value(); }
79  bool renameColumns() const { return d_rename_columns->isChecked(); }
81  bool simplifySpaces() const { return d_simplify_spaces->isChecked(); }
83  bool stripSpaces() const { return d_strip_spaces->isChecked(); }
85  bool rememberOptions() const { return d_remember_options->isChecked(); }
86 
88  void setColumnSeparator(const QString &sep);
89 
91  QLocale decimalSeparators();
93  bool convertToNumeric() const { return d_convert_to_numeric->isChecked(); };
94 
95 private slots:
97  void displayHelp();
99  void updateImportMode(int mode);
100 
101 private:
102  void closeEvent(QCloseEvent*);
104  void initAdvancedOptions();
105 
107  QGroupBox *d_advanced_options;
109  QPushButton *d_help_button;
110  // the actual options
112  QSpinBox *d_ignored_lines;
114 };
115 
116 
117 #endif