ConfigDialog.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     File                 : ConfigDialog.h
00003     Project              : QtiPlot
00004     --------------------------------------------------------------------
00005     Copyright            : (C) 2006 by Ion Vasilief
00006     Email (use @ for *)  : ion_vasilief*yahoo.fr
00007     Description          : Preferences dialog
00008 
00009  ***************************************************************************/
00010 
00011 /***************************************************************************
00012  *                                                                         *
00013  *  This program is free software; you can redistribute it and/or modify   *
00014  *  it under the terms of the GNU General Public License as published by   *
00015  *  the Free Software Foundation; either version 2 of the License, or      *
00016  *  (at your option) any later version.                                    *
00017  *                                                                         *
00018  *  This program is distributed in the hope that it will be useful,        *
00019  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
00020  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
00021  *  GNU General Public License for more details.                           *
00022  *                                                                         *
00023  *   You should have received a copy of the GNU General Public License     *
00024  *   along with this program; if not, write to the Free Software           *
00025  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
00026  *   Boston, MA  02110-1301  USA                                           *
00027  *                                                                         *
00028  ***************************************************************************/
00029 #ifndef ConfigDialog_H
00030 #define ConfigDialog_H
00031 
00032 #include <FrameWidget.h>
00033 
00034 #include <QDialog>
00035 #include <QCheckBox>
00036 
00037 class QNetworkProxy;
00038 class QLineEdit;
00039 class QGroupBox;
00040 class QGridLayout;
00041 class QPushButton;
00042 class QTabWidget;
00043 class QStackedWidget;
00044 class QWidget;
00045 class QComboBox;
00046 class QSpinBox;
00047 class QLabel;
00048 class QRadioButton;
00049 class QListWidget;
00050 class ColorButton;
00051 class DoubleSpinBox;
00052 class QFontComboBox;
00053 class ColorMapEditor;
00054 class QTableWidget;
00055 class SymbolBox;
00056 class PatternBox;
00057 class PenStyleBox;
00058 
00060 class ConfigDialog : public QDialog
00061 {
00062     Q_OBJECT
00063 
00064 public:
00066 
00070     ConfigDialog( QWidget* parent, Qt::WFlags fl = 0 );
00071     void setColumnSeparator(const QString& sep);
00072 
00073 private slots:
00074     virtual void languageChange();
00075     void insertLanguagesList();
00076 
00077     void accept();
00078     void apply();
00079 
00080     void setCurrentPage(int index);
00081 
00082     //table fonts
00083     void pickTextFont();
00084     void pickHeaderFont();
00085 
00086     //graph fonts
00087     void pickAxesFont();
00088     void pickNumbersFont();
00089     void pickLegendFont();
00090     void pickTitleFont();
00091 
00092     void showFrameWidth(bool ok);
00093 
00094     //application
00095     void pickApplicationFont();
00096 
00097     //2D curves
00098     int curveStyle();
00099     void pick3DTitleFont();
00100     void pick3DNumbersFont();
00101     void pick3DAxesFont();
00102 
00103     //Fitting
00104     void showPointsBox(bool);
00105 
00106     void switchToLanguage(int param);
00107 
00108     void chooseTranslationsFolder();
00109     void chooseHelpFolder();
00110 #ifdef SCRIPTING_PYTHON
00111     void choosePythonConfigFolder();
00112 #endif
00113     void rehighlight();
00114     void customizeNotes();
00115     void chooseTexCompiler();
00116     bool validateTexCompiler();
00117 
00118     void enableMajorGrids(bool on);
00119     void enableMinorGrids(bool on);
00120 
00121     void updateCanvasSize(int unit);
00122     void adjustCanvasHeight(double width);
00123     void adjustCanvasWidth(double height);
00124 
00125     void moveColor(bool up = true);
00126     void moveColorDown();
00127     void removeColor();
00128     void newColor();
00129     void loadDefaultColors();
00130     void showColorDialog(int, int);
00131     void changeColorName(int, int);
00132     void updateSymbolsList(int);
00133     void setCurrentSymbol(SymbolBox *);
00134     void loadDefaultSymbols();
00135     void moveSymbol(bool up = true);
00136     void moveSymbolDown(){moveSymbol(false);};
00137 
00138 private:
00139     void setSymbolsList(const QList<int>& symbList);
00140     void setColorsList(const QList<QColor>& colList, const QStringList& colNames);
00141     void initPlotsPage();
00142     void initAppPage();
00143     void initCurvesPage();
00144     void initAxesPage();
00145     void initPlots3DPage();
00146     void initTablesPage();
00147     void initConfirmationsPage();
00148     void initFileLocationsPage();
00149     void initFittingPage();
00150     void initNotesPage();
00151     void initProxyPage();
00152     void initLayerGeometryPage();
00154     void updateMenuList();
00155     bool validFolderPath(const QString& path);
00156     QNetworkProxy setApplicationCustomProxy();
00157     int convertToPixels(double w, FrameWidget::Unit unit, int dimension);
00158     double convertFromPixels(int w, FrameWidget::Unit unit, int dimension);
00159 
00160     QFont textFont, headerFont, axesFont, numbersFont, legendFont, titleFont, appFont;
00161     QFont d_3D_title_font, d_3D_numbers_font, d_3D_axes_font;
00162 
00163     QCheckBox *boxScaleLayersOnPrint, *boxPrintCropmarks, *linearFit2PointsBox;
00164     QTabWidget *plotsTabWidget, *appTabWidget;
00165     ColorButton *btnBackground3D, *btnMesh, *btnAxes, *btnLabels, *btnNumbers;
00166     QGroupBox *colorMapBox;
00167     ColorMapEditor *colorMapEditor;
00168     QPushButton *btnTitleFnt, *btnLabelsFnt, *btnNumFnt;
00169     ColorButton *buttonBackground, *buttonText, *buttonHeader;
00170     QPushButton *buttonOk, *buttonCancel, *buttonApply;
00171     QPushButton* buttonTextFont, *buttonHeaderFont;
00172     QStackedWidget * generalDialog;
00173     QWidget *appColors, *tables, *plotOptions, *plotTicks, *plotFonts, *confirm, *plotPrint;
00174     QWidget *application, *curves, *axesPage, *plots3D, *fitPage, *numericFormatPage, *notesPage, *plotGeometryPage;
00175     QPushButton* buttonAxesFont, *buttonNumbersFont, *buttonLegendFont, *buttonTitleFont, *fontsBtn;
00176     QCheckBox *boxSearchUpdates, *boxOrthogonal, *logBox, *plotLabelBox, *scaleErrorsBox;
00177     QCheckBox *boxTitle, *boxFrame, *boxPlots3D, *boxPlots2D, *boxTables, *boxNotes, *boxFolders;
00178     QCheckBox *boxSave, *boxBackbones, *boxShowLegend, *boxSmoothMesh;
00179     QCheckBox *boxAutoscaling, *boxMatrices, *boxScaleFonts, *boxResize;
00180     QComboBox *boxMajTicks, *boxMinTicks, *boxStyle, *boxCurveStyle, *boxSeparator, *boxLanguage, *boxDecimalSeparator;
00181     QComboBox *boxClipboardLocale, *boxProjection;
00182     QLabel *lblClipboardSeparator, *lblFloorStyle;
00183     QSpinBox *boxMinutes, *boxLineWidth, *boxFrameWidth, *boxResolution, *boxMargin, *boxPrecision, *boxAppPrecision;
00184     QSpinBox *boxSymbolSize, *boxMinTicksLength, *boxMajTicksLength, *generatePointsBox;
00185     DoubleSpinBox *boxCurveLineWidth;
00186     ColorButton *btnWorkspace, *btnPanels, *btnPanelsText;
00187     QListWidget * itemsList;
00188     QLabel *labelFrameWidth, *lblLanguage, *lblWorkspace, *lblPanels, *lblPageHeader;
00189     QLabel *lblPanelsText, *lblFonts, *lblStyle, *lblDecimalSeparator, *lblAppPrecision;
00190     QGroupBox *groupBoxConfirm;
00191     QGroupBox *groupBoxTableFonts, *groupBoxTableCol;
00192     QLabel *lblSeparator, *lblTableBackground, *lblTextColor, *lblHeaderColor;
00193     QLabel *lblSymbSize, *lblAxesLineWidth, *lblCurveStyle, *lblResolution, *lblPrecision;
00194     QGroupBox *groupBox3DFonts, *groupBox3DCol;
00195     QLabel *lblMargin, *lblMajTicks, *lblMajTicksLength, *lblLineWidth, *lblMinTicks, *lblMinTicksLength, *lblPoints, *lblPeaksColor;
00196     QGroupBox *groupBoxFittingCurve, *groupBoxFitParameters;
00197     QRadioButton *samePointsBtn, *generatePointsBtn;
00198     QGroupBox *groupBoxMultiPeak;
00199     ColorButton *boxPeaksColor;
00200     QLabel *lblScriptingLanguage, *lblInitWindow;
00201     QComboBox *boxScriptingLanguage, *boxInitWindow;
00202     QCheckBox *boxAntialiasing, *boxAutoscale3DPlots, *boxTableComments, *boxThousandsSeparator;
00203     QCheckBox *boxPromptRenameTables, *boxBackupProject, *boxLabelsEditing;
00204     QWidget *fileLocationsPage;
00205     QLabel *lblTranslationsPath, *lblHelpPath, *lblUndoStackSize, *lblEndOfLine;
00206     QLineEdit *translationsPathLine, *helpPathLine;
00207     QSpinBox *undoStackSizeBox;
00208     QComboBox *boxEndLine;
00209 #ifdef SCRIPTING_PYTHON
00210     QLabel *lblPythonConfigDir;
00211     QLineEdit *pythonConfigDirLine;
00212 #endif
00213     QCheckBox *boxUpdateTableValues;
00214     QGroupBox *groupBackgroundOptions;
00215     QLabel *labelGraphFrameColor, *labelGraphFrameWidth;
00216     QLabel *labelGraphBkgColor, *labelGraphCanvasColor;
00217     QLabel *labelGraphBkgOpacity, *labelGraphCanvasOpacity;
00218     ColorButton *boxBackgroundColor, *boxCanvasColor, *boxBorderColor;
00219     QSpinBox *boxBackgroundTransparency, *boxCanvasTransparency, *boxBorderWidth, *boxTabLength;
00220     QCheckBox *completionBox, *lineNumbersBox;
00221     QLabel *labelTabLength, *labelNotesFont;
00222     QFontComboBox *boxFontFamily;
00223     QSpinBox *boxFontSize;
00224     QPushButton *buttonItalicFont, *buttonBoldFont;
00225     QLabel *labelGraphAxesLabelsDist, *labelTickLabelsDist;
00226     QSpinBox *boxAxesLabelsDist, *boxTickLabelsDist;
00227     QLabel *xBottomLabel, *xTopLabel, *yLeftLabel, *yRightLabel, *enableAxisLabel, *showNumbersLabel;
00228     QCheckBox *boxEnableAxis, *boxShowAxisLabels;
00229     QGroupBox * enabledAxesGroupBox;
00230     QGridLayout *enabledAxesGrid;
00231 
00232     QWidget *proxyPage;
00233     QGroupBox *proxyGroupBox;
00234     QLineEdit *proxyHostLine, *proxyUserNameLine, *proxyPasswordLine;
00235     QSpinBox *proxyPortBox;
00236     QLabel *proxyHostLabel, *proxyPortLabel, *proxyUserLabel, *proxyPasswordLabel;
00237 
00238     QLineEdit *texCompilerPathBox;
00239     QPushButton *browseTexCompilerBtn;
00240     QLabel *texCompilerLabel;
00241 
00242     QComboBox *legendDisplayBox;
00243     QLabel *legendDisplayLabel;
00244 
00245     DoubleSpinBox *boxMajorGridWidth, *boxMinorGridWidth;
00246     QComboBox *boxMajorGridStyle, *boxMinorGridStyle;
00247     QCheckBox *boxMajorGrids, *boxMinorGrids;
00248     ColorButton *btnGrid, *btnGridMinor;
00249     QLabel *label3DGridsColor, *label3DGridsWidth, *label3DGridsStyle;
00250     QGroupBox *groupBox3DGrids;
00251 
00252     QGroupBox *groupSyntaxHighlighter;
00253     ColorButton *buttonCommentColor, *buttonNumericColor, *buttonQuotationColor;
00254     ColorButton *buttonKeywordColor, *buttonFunctionColor, *buttonClassColor;
00255     QLabel *buttonCommentLabel, *buttonNumericLabel, *buttonQuotationLabel;
00256     QLabel *buttonKeywordLabel, *buttonFunctionLabel, *buttonClassLabel;
00257 
00258     QCheckBox *boxMuParserCLocale, *boxConfirmOverwrite;
00259     DoubleSpinBox *boxCanvasHeight, *boxCanvasWidth;
00260     QComboBox *unitBox;
00261     QLabel *unitBoxLabel, *canvasWidthLabel, *canvasHeightLabel;
00262     QCheckBox *keepRatioBox, *boxMultiPeakMsgs;
00263 
00264     double aspect_ratio;
00265 
00266     QGroupBox *groupIndexedColors, *symbolGroupBox, *groupIndexedSymbols, *fillCurvesGroupBox;
00267     QTableWidget *colorsList, *symbolsList;
00268     QPushButton *btnColorUp, *btnColorDown, *btnRemoveColor, *btnNewColor, *btnLoadDefaultColors;
00269     QList<QColor> d_indexed_colors;
00270     QStringList d_indexed_color_names;
00271     QCheckBox *fillSymbolsBox;
00272     DoubleSpinBox *symbolEdgeBox;
00273     QLabel *lblSymbEdge, *lblSymbBox;
00274     SymbolBox *symbolBox;
00275     QList<int> d_indexed_symbols;
00276     QPushButton *btnLoadDefaultSymbols, *btnSymbolUp, *btnSymbolDown;
00277     PatternBox *patternBox;
00278     QLabel *lblPattern, *lblCurveAlpha, *lblLineStyle;
00279     QSpinBox *curveAlphaBox;
00280     PenStyleBox *lineStyleBox;
00281     QGroupBox * curvesGroupBox;
00282     QLabel *lblAxisLabeling;
00283     QComboBox *axisLabelingBox;
00284     QCheckBox *boxSynchronizeScales;
00285 };
00286 
00287 #endif // CONFIGDIALOG_H