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