QtiPlot 0.9.8.2
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 class ApplicationWindow;
00059 
00061 class ConfigDialog : public QDialog
00062 {
00063     Q_OBJECT
00064 
00065 public:
00067 
00071     ConfigDialog( QWidget* parent, Qt::WFlags fl = 0 );
00072     void setColumnSeparator(const QString& sep);
00073 
00074 private slots:
00075     virtual void languageChange();
00076     void insertLanguagesList();
00077 
00078     void accept();
00079     void apply();
00080     void resetDefaultSettings();
00081 
00082     void setCurrentPage(int index);
00083 
00084     //table fonts
00085     void pickTextFont();
00086     void pickHeaderFont();
00087 
00088     //graph fonts
00089     void pickAxesFont();
00090     void pickNumbersFont();
00091     void pickLegendFont();
00092     void pickTitleFont();
00093 
00094     void showFrameWidth(bool ok);
00095 
00096     //application
00097     void pickApplicationFont();
00098 
00099     //2D curves
00100     int curveStyle();
00101     void pick3DTitleFont();
00102     void pick3DNumbersFont();
00103     void pick3DAxesFont();
00104 
00105     //Fitting
00106     void showPointsBox(bool);
00107 
00108     void switchToLanguage(int param);
00109 
00110     void chooseTranslationsFolder();
00111     void chooseHelpFolder();
00112 #ifdef SCRIPTING_PYTHON
00113     void choosePythonConfigFolder();
00114     void chooseStartupScriptsFolder();
00115     void showStartupScriptsFolder(const QString &);
00116 #endif
00117     void rehighlight();
00118     void customizeNotes();
00119     void chooseTexCompiler();
00120     bool validateTexCompiler();
00121 
00122     void chooseOffice();
00123     bool validateOffice();
00124     void chooseJava();
00125     bool validateJava();
00126     void chooseJODConverter();
00127     bool validateJODConverter();
00128 
00129     void enableMajorGrids(bool on);
00130     void enableMinorGrids(bool on);
00131 
00132     void updateCanvasSize(int unit);
00133     void adjustCanvasHeight(double width);
00134     void adjustCanvasWidth(double height);
00135 
00136     void moveColor(bool up = true);
00137     void moveColorDown();
00138     void removeColor();
00139     void newColor();
00140     void loadDefaultColors();
00141     void showColorDialog(int, int);
00142     void changeColorName(int, int);
00143     void updateSymbolsList(int);
00144     void setCurrentSymbol(SymbolBox *);
00145     void loadDefaultSymbols();
00146     void moveSymbol(bool up = true);
00147     void moveSymbolDown(){moveSymbol(false);};
00148     void showGridOptions(int axis);
00149     void updateGrid();
00150     void majorGridEnabled(bool);
00151     void minorGridEnabled(bool);
00152     void enableCurveAntialiasingSizeBox(bool);
00153 
00154 private:
00155     void setApplication(ApplicationWindow *app);
00156     void setSymbolsList(const QList<int>& symbList);
00157     void setColorsList(const QList<QColor>& colList, const QStringList& colNames);
00158     void initPlotsPage();
00159     void initAppPage();
00160     void initCurvesPage();
00161     void initAxesPage();
00162     void initGridPage();
00163     void initPlots3DPage();
00164     void initTablesPage();
00165     void initConfirmationsPage();
00166     void initFileLocationsPage();
00167     void initFittingPage();
00168     void initNotesPage();
00169     void initProxyPage();
00170     void initLayerGeometryPage();
00171     void initLayerSpeedPage();
00173     void updateMenuList();
00174     bool validFolderPath(const QString& path);
00175     QNetworkProxy setApplicationCustomProxy();
00176     int convertToPixels(double w, FrameWidget::Unit unit, int dimension);
00177     double convertFromPixels(int w, FrameWidget::Unit unit, int dimension);
00178 
00179     QFont textFont, headerFont, axesFont, numbersFont, legendFont, titleFont, appFont;
00180     QFont d_3D_title_font, d_3D_numbers_font, d_3D_axes_font;
00181 
00182     QCheckBox *boxScaleLayersOnPrint, *boxPrintCropmarks, *linearFit2PointsBox;
00183     QTabWidget *plotsTabWidget, *appTabWidget;
00184     ColorButton *btnBackground3D, *btnMesh, *btnAxes, *btnLabels, *btnNumbers;
00185     QGroupBox *colorMapBox;
00186     ColorMapEditor *colorMapEditor;
00187     QPushButton *btnTitleFnt, *btnLabelsFnt, *btnNumFnt;
00188     ColorButton *buttonBackground, *buttonText, *buttonHeader;
00189     QPushButton *buttonOk, *buttonCancel, *buttonApply;
00190     QPushButton* buttonTextFont, *buttonHeaderFont;
00191     QStackedWidget * generalDialog;
00192     QWidget *appColors, *tables, *plotOptions, *plotTicks, *plotFonts, *confirm, *plotPrint;
00193     QWidget *application, *curves, *axesPage, *plots3D, *fitPage, *numericFormatPage, *notesPage, *plotGeometryPage, *plotSpeedPage;
00194     QPushButton* buttonAxesFont, *buttonNumbersFont, *buttonLegendFont, *buttonTitleFont, *fontsBtn;
00195     QCheckBox *boxSearchUpdates, *boxOrthogonal, *logBox, *plotLabelBox, *scaleErrorsBox;
00196     QCheckBox *boxTitle, *boxFrame, *boxPlots3D, *boxPlots2D, *boxTables, *boxNotes, *boxFolders;
00197     QCheckBox *boxSave, *boxBackbones, *boxShowLegend, *boxSmoothMesh;
00198     QCheckBox *boxAutoscaling, *boxMatrices, *boxScaleFonts, *boxResize;
00199     QComboBox *boxMajTicks, *boxMinTicks, *boxStyle, *boxCurveStyle, *boxSeparator, *boxLanguage, *boxDecimalSeparator;
00200     QComboBox *boxClipboardLocale, *boxProjection;
00201     QLabel *lblClipboardSeparator, *lblFloorStyle;
00202     QSpinBox *boxMinutes, *boxLineWidth, *boxFrameWidth, *boxResolution, *boxMargin, *boxPrecision, *boxAppPrecision;
00203     QSpinBox *boxSymbolSize, *boxMinTicksLength, *boxMajTicksLength, *generatePointsBox;
00204     DoubleSpinBox *boxCurveLineWidth;
00205     ColorButton *btnWorkspace, *btnPanels, *btnPanelsText;
00206     QListWidget * itemsList;
00207     QLabel *labelFrameWidth, *lblLanguage, *lblWorkspace, *lblPanels, *lblPageHeader;
00208     QLabel *lblPanelsText, *lblFonts, *lblStyle, *lblDecimalSeparator, *lblAppPrecision;
00209     QGroupBox *groupBoxConfirm;
00210     QGroupBox *groupBoxTableFonts, *groupBoxTableCol;
00211     QLabel *lblSeparator, *lblTableBackground, *lblTextColor, *lblHeaderColor;
00212     QLabel *lblSymbSize, *lblAxesLineWidth, *lblCurveStyle, *lblResolution, *lblPrecision;
00213     QGroupBox *groupBox3DFonts, *groupBox3DCol;
00214     QLabel *lblMargin, *lblMajTicks, *lblMajTicksLength, *lblLineWidth, *lblMinTicks, *lblMinTicksLength, *lblPoints, *lblPeaksColor;
00215     QGroupBox *groupBoxFittingCurve, *groupBoxFitParameters;
00216     QRadioButton *samePointsBtn, *generatePointsBtn;
00217     QGroupBox *groupBoxMultiPeak;
00218     ColorButton *boxPeaksColor;
00219     QLabel *lblScriptingLanguage, *lblInitWindow;
00220     QComboBox *boxScriptingLanguage, *boxInitWindow;
00221     QCheckBox *boxAutoscale3DPlots, *boxTableComments, *boxThousandsSeparator;
00222     QCheckBox *boxPromptRenameTables, *boxBackupProject, *boxLabelsEditing;
00223     QWidget *fileLocationsPage;
00224     QLabel *lblTranslationsPath, *lblHelpPath, *lblUndoStackSize, *lblEndOfLine;
00225     QLineEdit *translationsPathLine, *helpPathLine;
00226     QSpinBox *undoStackSizeBox;
00227     QComboBox *boxEndLine;
00228 #ifdef SCRIPTING_PYTHON
00229     QLabel *lblPythonConfigDir;
00230     QLineEdit *pythonConfigDirLine;
00231     QPushButton *browsePythonScriptsBtn;
00232     QLabel *lblPythonScriptsDir;
00233     QLineEdit *pythonScriptsDirLine;
00234 #endif
00235     QCheckBox *boxUpdateTableValues, *boxTablePasteDialog;
00236     QGroupBox *groupBackgroundOptions;
00237     QLabel *labelGraphFrameColor, *labelGraphFrameWidth;
00238     QLabel *labelGraphBkgColor, *labelGraphCanvasColor;
00239     QLabel *labelGraphBkgOpacity, *labelGraphCanvasOpacity;
00240     ColorButton *boxBackgroundColor, *boxCanvasColor, *boxBorderColor;
00241     QSpinBox *boxBackgroundTransparency, *boxCanvasTransparency, *boxBorderWidth, *boxTabLength;
00242     QCheckBox *completionBox, *lineNumbersBox;
00243     QLabel *labelTabLength, *labelNotesFont;
00244     QFontComboBox *boxFontFamily;
00245     QSpinBox *boxFontSize;
00246     QPushButton *buttonItalicFont, *buttonBoldFont;
00247     QLabel *labelGraphAxesLabelsDist, *labelTickLabelsDist;
00248     QSpinBox *boxAxesLabelsDist, *boxTickLabelsDist;
00249     QLabel *xBottomLabel, *xTopLabel, *yLeftLabel, *yRightLabel, *enableAxisLabel, *showNumbersLabel;
00250     QCheckBox *boxEnableAxis, *boxShowAxisLabels;
00251     QGroupBox * enabledAxesGroupBox;
00252     QGridLayout *enabledAxesGrid;
00253 
00254     QWidget *proxyPage;
00255     QGroupBox *proxyGroupBox;
00256     QLineEdit *proxyHostLine, *proxyUserNameLine, *proxyPasswordLine;
00257     QSpinBox *proxyPortBox;
00258     QLabel *proxyHostLabel, *proxyPortLabel, *proxyUserLabel, *proxyPasswordLabel;
00259 
00260     QLineEdit *texCompilerPathBox;
00261     QPushButton *browseTexCompilerBtn;
00262     QLabel *texCompilerLabel;
00263 
00264     QComboBox *legendDisplayBox;
00265     QLabel *legendDisplayLabel;
00266 
00267     DoubleSpinBox *boxMajorGridWidth, *boxMinorGridWidth;
00268     QComboBox *boxMajorGridStyle, *boxMinorGridStyle;
00269     QCheckBox *boxMajorGrids, *boxMinorGrids;
00270     ColorButton *btnGrid, *btnGridMinor;
00271     QLabel *label3DGridsColor, *label3DGridsWidth, *label3DGridsStyle;
00272     QGroupBox *groupBox3DGrids;
00273 
00274     QGroupBox *groupSyntaxHighlighter;
00275     ColorButton *buttonCommentColor, *buttonNumericColor, *buttonQuotationColor;
00276     ColorButton *buttonKeywordColor, *buttonFunctionColor, *buttonClassColor;
00277     QLabel *buttonCommentLabel, *buttonNumericLabel, *buttonQuotationLabel;
00278     QLabel *buttonKeywordLabel, *buttonFunctionLabel, *buttonClassLabel;
00279 
00280     QCheckBox *boxMuParserCLocale, *boxConfirmOverwrite, *boxConfirmModifyDataPoints;
00281     DoubleSpinBox *boxCanvasHeight, *boxCanvasWidth;
00282     QComboBox *unitBox;
00283     QLabel *unitBoxLabel, *canvasWidthLabel, *canvasHeightLabel;
00284     QCheckBox *keepRatioBox, *boxMultiPeakMsgs;
00285 
00286     double aspect_ratio;
00287 
00288     QGroupBox *groupIndexedColors, *symbolGroupBox, *groupIndexedSymbols, *fillCurvesGroupBox;
00289     QTableWidget *colorsList, *symbolsList;
00290     QPushButton *btnColorUp, *btnColorDown, *btnRemoveColor, *btnNewColor, *btnLoadDefaultColors;
00291     QList<QColor> d_indexed_colors;
00292     QStringList d_indexed_color_names;
00293     QCheckBox *fillSymbolsBox;
00294     DoubleSpinBox *symbolEdgeBox;
00295     QLabel *lblSymbEdge, *lblSymbBox;
00296     SymbolBox *symbolBox;
00297     QList<int> d_indexed_symbols;
00298     QPushButton *btnLoadDefaultSymbols, *btnSymbolUp, *btnSymbolDown;
00299     PatternBox *patternBox;
00300     QLabel *lblPattern, *lblCurveAlpha, *lblLineStyle;
00301     QSpinBox *curveAlphaBox;
00302     PenStyleBox *lineStyleBox;
00303     QGroupBox * curvesGroupBox;
00304     QLabel *lblAxisLabeling;
00305     QComboBox *axisLabelingBox;
00306     QCheckBox *boxSynchronizeScales;
00307 
00308     QWidget *gridPage;
00309     QCheckBox *boxMinorGrid, *boxMajorGrid;
00310     ColorButton *boxColorMinor, *boxColorMajor;
00311     PenStyleBox *boxTypeMinor, *boxTypeMajor;
00312     DoubleSpinBox *boxWidthMinor, *boxWidthMajor;
00313     QComboBox *boxGridYAxis, *boxGridXAxis;
00314     QCheckBox *boxAntialiseGrid;
00315     QListWidget *axesGridList;
00316     QLabel *gridLineColorLbl, *gridLineWidthLbl, *gridLineTypeLbl, *gridAxesLbl;
00317     QGroupBox * antialiasingGroupBox;
00318     QCheckBox *disableAntialiasingBox, *openLastProjectBox;
00319     QSpinBox *curveSizeBox;
00320     QPushButton *btnDefaultSettings;
00321 
00322     QLineEdit *sofficePathBox;
00323     QPushButton *browseOfficeBtn;
00324     QLabel *officeLabel;
00325 
00326     QLineEdit *javaPathBox;
00327     QPushButton *browseJavaBtn;
00328     QLabel *javaLabel;
00329 
00330     QLineEdit *jodconverterPathBox;
00331     QPushButton *browseJODConverterBtn;
00332     QLabel *jodconverterLabel;
00333 };
00334 
00335 #endif // CONFIGDIALOG_H