QtiPlot  0.9.8.2
ConfigDialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : ConfigDialog.h
3  Project : QtiPlot
4  --------------------------------------------------------------------
5  Copyright : (C) 2006 by Ion Vasilief
6  Email (use @ for *) : ion_vasilief*yahoo.fr
7  Description : Preferences dialog
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  * This program is distributed in the hope that it will be useful, *
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21  * GNU General Public License for more details. *
22  * *
23  * You should have received a copy of the GNU General Public License *
24  * along with this program; if not, write to the Free Software *
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26  * Boston, MA 02110-1301 USA *
27  * *
28  ***************************************************************************/
29 #ifndef ConfigDialog_H
30 #define ConfigDialog_H
31 
32 #include <FrameWidget.h>
33 
34 #include <QDialog>
35 #include <QCheckBox>
36 
37 class QNetworkProxy;
38 class QLineEdit;
39 class QGroupBox;
40 class QGridLayout;
41 class QPushButton;
42 class QTabWidget;
43 class QStackedWidget;
44 class QWidget;
45 class QComboBox;
46 class QSpinBox;
47 class QLabel;
48 class QRadioButton;
49 class QListWidget;
50 class QSlider;
51 class ColorButton;
52 class DoubleSpinBox;
53 class QFontComboBox;
54 class ColorMapEditor;
55 class QTableWidget;
56 class SymbolBox;
57 class PatternBox;
58 class PenStyleBox;
59 class ApplicationWindow;
60 
62 class ConfigDialog : public QDialog
63 {
64  Q_OBJECT
65 
66 public:
68 
72  ConfigDialog( QWidget* parent, Qt::WFlags fl = 0 );
73  void setColumnSeparator(const QString& sep);
74 
75 private slots:
76  virtual void languageChange();
77  void insertLanguagesList();
78 
79  void accept();
80  void apply();
81  void resetDefaultSettings();
82 
83  void setCurrentPage(int index);
84 
85  //table fonts
86  void pickTextFont();
87  void pickHeaderFont();
88 
89  //graph fonts
90  void pickAxesFont();
91  void pickNumbersFont();
92  void pickLegendFont();
93  void pickTitleFont();
94 
95  void showFrameWidth(bool ok);
96 
97  //application
98  void pickApplicationFont();
99 
100  //2D curves
101  int curveStyle();
102  void pick3DTitleFont();
103  void pick3DNumbersFont();
104  void pick3DAxesFont();
105 
106  //Fitting
107  void showPointsBox(bool);
108 
109  void switchToLanguage(int param);
110 
112  void chooseHelpFolder();
113 #ifdef SCRIPTING_PYTHON
114  void choosePythonConfigFolder();
115  void chooseStartupScriptsFolder();
116  void showStartupScriptsFolder(const QString &);
117 #endif
118  void rehighlight();
119  void customizeNotes();
120  void chooseTexCompiler();
121  bool validateTexCompiler();
122 
123  void chooseOffice();
124  bool validateOffice();
125  void chooseJava();
126  bool validateJava();
127  void chooseJODConverter();
128  bool validateJODConverter();
129 
130  void enableMajorGrids(bool on);
131  void enableMinorGrids(bool on);
132 
133  void updateCanvasSize(int unit);
134  void adjustCanvasHeight(double width);
135  void adjustCanvasWidth(double height);
136 
137  void moveColor(bool up = true);
138  void moveColorDown();
139  void removeColor();
140  void newColor();
141  void loadDefaultColors();
142  void showColorDialog(int, int);
143  void changeColorName(int, int);
144  void updateSymbolsList(int);
145  void setCurrentSymbol(SymbolBox *);
146  void loadDefaultSymbols();
147  void moveSymbol(bool up = true);
148  void moveSymbolDown(){moveSymbol(false);};
149  void showGridOptions(int axis);
150  void updateGrid();
151  void majorGridEnabled(bool);
152  void minorGridEnabled(bool);
154 
155 private:
157  void setSymbolsList(const QList<int>& symbList);
158  void setColorsList(const QList<QColor>& colList, const QStringList& colNames);
159  void initPlotsPage();
160  void initAppPage();
161  void initCurvesPage();
162  void initAxesPage();
163  void initGridPage();
164  void initPlots3DPage();
165  void initTablesPage();
166  void initConfirmationsPage();
167  void initFileLocationsPage();
168  void initFittingPage();
169  void initNotesPage();
170  void initProxyPage();
171  void initLayerGeometryPage();
172  void initLayerSpeedPage();
174  void updateMenuList();
175  bool validFolderPath(const QString& path);
176  QNetworkProxy setApplicationCustomProxy();
177  int convertToPixels(double w, FrameWidget::Unit unit, int dimension);
178  double convertFromPixels(int w, FrameWidget::Unit unit, int dimension);
179 
182 
186  QGroupBox *colorMapBox;
192  QStackedWidget * generalDialog;
207  QListWidget * itemsList;
210  QGroupBox *groupBoxConfirm;
218  QGroupBox *groupBoxMultiPeak;
227  QSpinBox *undoStackSizeBox;
228  QComboBox *boxEndLine;
229 #ifdef SCRIPTING_PYTHON
230  QLabel *lblPythonConfigDir;
231  QLineEdit *pythonConfigDirLine;
232  QPushButton *browsePythonScriptsBtn;
233  QLabel *lblPythonScriptsDir;
234  QLineEdit *pythonScriptsDirLine;
235 #endif
246  QFontComboBox *boxFontFamily;
247  QSpinBox *boxFontSize;
253  QGroupBox * enabledAxesGroupBox;
254  QGridLayout *enabledAxesGrid;
255 
256  QWidget *proxyPage;
257  QGroupBox *proxyGroupBox;
259  QSpinBox *proxyPortBox;
261 
262  QLineEdit *texCompilerPathBox;
263  QPushButton *browseTexCompilerBtn;
265 
268 
274  QGroupBox *groupBox3DGrids;
275 
281 
284  QComboBox *unitBox;
287 
288  double aspect_ratio;
289 
291  QTableWidget *colorsList, *symbolsList;
293  QList<QColor> d_indexed_colors;
295  QCheckBox *fillSymbolsBox;
299  QList<int> d_indexed_symbols;
303  QSpinBox *curveAlphaBox;
305  QGroupBox * curvesGroupBox;
307  QComboBox *axisLabelingBox;
309 
310  QWidget *gridPage;
316  QCheckBox *boxAntialiseGrid;
317  QListWidget *axesGridList;
319  QGroupBox * antialiasingGroupBox;
321  QSpinBox *curveSizeBox;
322  QPushButton *btnDefaultSettings;
323 
324  QLineEdit *sofficePathBox;
325  QPushButton *browseOfficeBtn;
326  QLabel *officeLabel;
327 
328  QLineEdit *javaPathBox;
329  QPushButton *browseJavaBtn;
330  QLabel *javaLabel;
331 
333  QPushButton *browseJODConverterBtn;
335 
337  QComboBox *excelImportMethod;
338 };
339 
340 #endif // CONFIGDIALOG_H