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