scidavis  2.3.0
About: SciDAVis is a free application for Scientific Data Analysis and Visualization (a fork off of QtiPlot).
  Fossies Dox: scidavis-2.3.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

ConfigDialog.cpp
Go to the documentation of this file.
1 
11 
29 #include "ConfigDialog.h"
30 #include "ApplicationWindow.h"
31 #include "MultiLayer.h"
32 #include "Graph.h"
33 #include "Matrix.h"
34 #include "ColorButton.h"
35 
36 #include <QLocale>
37 #include <QPushButton>
38 #include <QLabel>
39 #include <QGridLayout>
40 #include <QGroupBox>
41 #include <QFont>
42 #include <QFontDialog>
43 #include <QColorDialog>
44 #include <QTabWidget>
45 #include <QStackedWidget>
46 #include <QWidget>
47 #include <QComboBox>
48 #include <QSpinBox>
49 #include <QRadioButton>
50 #include <QStyleFactory>
51 #include <QRegExp>
52 #include <QMessageBox>
53 #include <QTranslator>
54 #include <QApplication>
55 #include <QDir>
56 #include <QPixmap>
57 #include <QHBoxLayout>
58 #include <QVBoxLayout>
59 #include <QListWidget>
60 #include <QFontMetrics>
61 #include <QSettings>
62 
63 ConfigDialog::ConfigDialog( QWidget* parent, Qt::WindowFlags fl )
64  : QDialog( parent, fl )
65 {
66  // get current values from app window
67  ApplicationWindow *app = (ApplicationWindow *)parentWidget();
72  textFont = app->tableTextFont;
74  appFont = app->appFont;
75  axesFont = app->plotAxesFont;
78  titleFont = app->plotTitleFont;
79 
80  QPalette pal;
81  pal.setColor(QPalette::Window, app->palette().color(QPalette::Window));
82 
83  // create the GUI
84  generalDialog = new QStackedWidget();
85  itemsList = new QListWidget();
86  itemsList->setSpacing(10);
87  itemsList->setAlternatingRowColors( true );
88 
89  initAppPage();
91  initPlotsPage();
94 
95  generalDialog->addWidget(appTabWidget);
96  generalDialog->addWidget(tables);
97  generalDialog->addWidget(plotsTabWidget);
98  generalDialog->addWidget(plots3D);
99  generalDialog->addWidget(fitPage);
100 
101  QVBoxLayout * rightLayout = new QVBoxLayout();
102  lblPageHeader = new QLabel();
103  QFont fnt = this->font();
104  fnt.setPointSize(fnt.pointSize() + 3);
105  fnt.setBold(true);
106  lblPageHeader->setFont(fnt);
107 
108  lblPageHeader->setPalette(pal);
109  lblPageHeader->setAutoFillBackground( true );
110 
111  rightLayout->setSpacing(10);
112  rightLayout->addWidget( lblPageHeader );
113  rightLayout->addWidget( generalDialog );
114 
115  QHBoxLayout * topLayout = new QHBoxLayout();
116  topLayout->setSpacing(5);
117  topLayout->setMargin(5);
118  topLayout->addWidget( itemsList );
119  topLayout->addLayout( rightLayout );
120 
121  QHBoxLayout * bottomButtons = new QHBoxLayout();
122  bottomButtons->addStretch();
123  buttonApply = new QPushButton();
124  buttonApply->setAutoDefault( true );
125  bottomButtons->addWidget( buttonApply );
126 
127  buttonOk = new QPushButton();
128  buttonOk->setAutoDefault( true );
129  buttonOk->setDefault( true );
130  bottomButtons->addWidget( buttonOk );
131 
132  buttonCancel = new QPushButton();
133  buttonCancel->setAutoDefault( true );
134  bottomButtons->addWidget( buttonCancel );
135 
136  QVBoxLayout * mainLayout = new QVBoxLayout( this );
137  mainLayout->addLayout(topLayout);
138  mainLayout->addLayout(bottomButtons);
139 
140  languageChange();
141 
142  // signals and slots connections
143  connect( itemsList, SIGNAL(currentRowChanged(int)), this, SLOT(setCurrentPage(int)));
144  connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
145  connect( buttonApply, SIGNAL( clicked() ), this, SLOT( apply() ) );
146  connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
147  connect( buttonBackground, SIGNAL( clicked() ), this, SLOT( pickBgColor() ) );
148  connect( buttonText, SIGNAL( clicked() ), this, SLOT( pickTextColor() ) );
149  connect( buttonHeader, SIGNAL( clicked() ), this, SLOT( pickHeaderColor() ) );
150  connect( buttonTextFont, SIGNAL( clicked() ), this, SLOT( pickTextFont() ) );
151  connect( buttonHeaderFont, SIGNAL( clicked() ), this, SLOT( pickHeaderFont() ) );
152 
153  setCurrentPage(0);
154 }
155 
157 {
158  generalDialog->setCurrentIndex(index);
159  if(itemsList->currentItem())
160  lblPageHeader->setText(itemsList->currentItem()->text());
161 }
162 
164 {
165  ApplicationWindow *app = (ApplicationWindow *)parentWidget();
166  tables = new QWidget();
167 
168  QHBoxLayout * topLayout = new QHBoxLayout();
169  topLayout->setSpacing(5);
170 
171  lblSeparator = new QLabel();
172  topLayout->addWidget( lblSeparator );
173  boxSeparator = new QComboBox();
174  boxSeparator->setEditable( true );
175  topLayout->addWidget( boxSeparator );
176 
177  QString help = tr("The column separator can be customized. \nThe following special codes can be used:\n\\t for a TAB character \n\\s for a SPACE");
178  help += "\n"+tr("The separator must not contain the following characters: \n0-9eE.+-");
179 
180  boxSeparator->setWhatsThis(help);
181  boxSeparator->setToolTip(help);
182  lblSeparator->setWhatsThis(help);
183  lblSeparator->setToolTip(help);
184 
185  groupBoxTableCol = new QGroupBox();
186  QGridLayout * colorsLayout = new QGridLayout(groupBoxTableCol);
187 
188  lblTableBackground = new QLabel();
189  colorsLayout->addWidget( lblTableBackground, 0, 0 );
192  colorsLayout->addWidget( buttonBackground, 0, 1 );
193 
194  lblTextColor = new QLabel();
195  colorsLayout->addWidget( lblTextColor, 1, 0 );
196  buttonText= new ColorButton();
198  colorsLayout->addWidget( buttonText, 1, 1 );
199 
200  lblHeaderColor = new QLabel();
201  colorsLayout->addWidget( lblHeaderColor, 2, 0 );
202  buttonHeader= new ColorButton();
204  colorsLayout->addWidget( buttonHeader, 2, 1 );
205 
206  groupBoxTableFonts = new QGroupBox();
207  QHBoxLayout * bottomLayout = new QHBoxLayout( groupBoxTableFonts );
208 
209  buttonTextFont= new QPushButton();
210  bottomLayout->addWidget( buttonTextFont );
211  buttonHeaderFont= new QPushButton();
212  bottomLayout->addWidget( buttonHeaderFont );
213 
214  boxTableComments = new QCheckBox();
215  boxTableComments->setChecked(app->d_show_table_comments);
216 
217  // Set table row height
218  QHBoxLayout *tableRowHeightLayout = new QHBoxLayout();
219  lblTableRowHeight = new QLabel();
220  lblTableRowHeight->setText(tr("Default Row Height"));
221  tableRowHeightLayout->addWidget(lblTableRowHeight);
222  boxTableRowHeight = new QSpinBox();
223  boxTableRowHeight->setRange(15, 100);
224  tableRowHeightLayout->addWidget(boxTableRowHeight);
225 #ifdef Q_OS_MAC
226  QSettings settings(QSettings::IniFormat,QSettings::UserScope,
227  "SciDAVis", "SciDAVis");
228 #else
229  QSettings settings(QSettings::NativeFormat,QSettings::UserScope,
230  "SciDAVis", "SciDAVis");
231 #endif
232  settings.beginGroup("[Table]");
233  boxTableRowHeight->setValue(settings.value("DefaultRowHeight", 20).toInt());
234  settings.endGroup();
235 
236  QVBoxLayout * tablesPageLayout = new QVBoxLayout( tables );
237  tablesPageLayout->addWidget(boxTableComments);
238  tablesPageLayout->addLayout(tableRowHeightLayout,1);
239  tablesPageLayout->addLayout(topLayout,1);
240  tablesPageLayout->addWidget(groupBoxTableCol);
241  tablesPageLayout->addWidget(groupBoxTableFonts);
242  tablesPageLayout->addStretch();
243 }
244 
246 {
247  ApplicationWindow *app = (ApplicationWindow *)parentWidget();
248 
249  plotsTabWidget = new QTabWidget();
250  plotOptions = new QWidget();
251 
252  QVBoxLayout * optionsTabLayout = new QVBoxLayout( plotOptions );
253  optionsTabLayout->setSpacing(5);
254 
255  QGroupBox * groupBoxOptions = new QGroupBox();
256  optionsTabLayout->addWidget( groupBoxOptions );
257 
258  QGridLayout * optionsLayout = new QGridLayout( groupBoxOptions );
259 
260  boxAutoscaling = new QCheckBox();
261  boxAutoscaling->setChecked(app->autoscale2DPlots);
262  optionsLayout->addWidget( boxAutoscaling, 0, 0 );
263 
264  boxScaleFonts = new QCheckBox();
265  boxScaleFonts->setChecked(app->autoScaleFonts);
266  optionsLayout->addWidget( boxScaleFonts, 0, 1 );
267 
268  boxTitle = new QCheckBox();
269  boxTitle->setChecked(app->titleOn);
270  optionsLayout->addWidget( boxTitle, 1, 0 );
271 
272  boxAllAxes = new QCheckBox();
273  boxAllAxes->setChecked (app->allAxesOn);
274  optionsLayout->addWidget( boxAllAxes, 1, 1 );
275 
276  boxAntialiasing = new QCheckBox();
277  boxAntialiasing->setChecked(app->antialiasing2DPlots);
278  optionsLayout->addWidget( boxAntialiasing, 2, 0 );
279 
280  boxBackbones= new QCheckBox();
281  boxBackbones->setChecked(app->drawBackbones);
282  optionsLayout->addWidget( boxBackbones, 2, 1 );
283 
284  boxFrame = new QCheckBox();
285  boxFrame->setChecked(app->canvasFrameOn);
286  optionsLayout->addWidget( boxFrame, 3, 0 );
287 
288  labelFrameWidth = new QLabel();
289  optionsLayout->addWidget( labelFrameWidth, 4, 0 );
290  boxFrameWidth= new QSpinBox();
291  optionsLayout->addWidget( boxFrameWidth, 4, 1 );
292  boxFrameWidth->setRange(1, 100);
293  boxFrameWidth->setValue(app->canvasFrameWidth);
294  if (!app->canvasFrameOn)
295  {
296  labelFrameWidth->hide();
297  boxFrameWidth->hide();
298  }
299 
300  lblAxesLineWidth = new QLabel();
301  optionsLayout->addWidget( lblAxesLineWidth, 5, 0 );
302  boxLineWidth= new QSpinBox();
303  boxLineWidth->setRange(0, 100);
304  boxLineWidth->setValue(app->axesLineWidth);
305  optionsLayout->addWidget( boxLineWidth, 5, 1 );
306 
307  lblMargin = new QLabel();
308  optionsLayout->addWidget( lblMargin, 6, 0 );
309  boxMargin= new QSpinBox();
310  boxMargin->setRange(0, 1000);
311  boxMargin->setSingleStep(5);
312  boxMargin->setValue(app->defaultPlotMargin);
313  optionsLayout->addWidget( boxMargin, 6, 1 );
314 
315  optionsLayout->setRowStretch( 7, 1 );
316 
317  boxResize = new QCheckBox();
318  boxResize->setChecked(!app->autoResizeLayers);
319  if(boxResize->isChecked())
320  boxScaleFonts->setEnabled(false);
321 
322  optionsTabLayout->addWidget( boxResize );
323 
324  plotsTabWidget->addTab( plotOptions, QString() );
325 
326  initCurvesPage();
327 
328  plotsTabWidget->addTab( curves, QString() );
329 
330  plotTicks = new QWidget();
331  QVBoxLayout * plotTicksLayout = new QVBoxLayout( plotTicks );
332 
333  QGroupBox * ticksGroupBox = new QGroupBox();
334  QGridLayout * ticksLayout = new QGridLayout( ticksGroupBox );
335  plotTicksLayout->addWidget( ticksGroupBox );
336 
337  lblMajTicks = new QLabel();
338  ticksLayout->addWidget( lblMajTicks, 0, 0 );
339  boxMajTicks = new QComboBox();
340  ticksLayout->addWidget( boxMajTicks, 0, 1 );
341 
342  lblMajTicksLength = new QLabel();
343  ticksLayout->addWidget( lblMajTicksLength, 0, 2 );
344  boxMajTicksLength = new QSpinBox();
345  boxMajTicksLength->setRange(0, 100);
346  boxMajTicksLength->setValue(app->majTicksLength);
347  ticksLayout->addWidget( boxMajTicksLength, 0, 3 );
348 
349  lblMinTicks = new QLabel();
350  ticksLayout->addWidget( lblMinTicks, 1, 0 );
351  boxMinTicks = new QComboBox();
352  ticksLayout->addWidget( boxMinTicks, 1, 1 );
353 
354  lblMinTicksLength = new QLabel();
355  ticksLayout->addWidget( lblMinTicksLength, 1, 2 );
356  boxMinTicksLength = new QSpinBox();
357  boxMinTicksLength->setRange(0, 100);
358  boxMinTicksLength->setValue(app->minTicksLength);
359  ticksLayout->addWidget( boxMinTicksLength, 1, 3 );
360 
361  ticksLayout->setRowStretch( 4, 1 );
362 
363  plotsTabWidget->addTab( plotTicks, QString() );
364 
365  plotFonts = new QWidget();
366  QVBoxLayout * plotFontsLayout = new QVBoxLayout( plotFonts );
367 
368  QGroupBox * groupBox2DFonts = new QGroupBox();
369  plotFontsLayout->addWidget( groupBox2DFonts );
370  QVBoxLayout * fontsLayout = new QVBoxLayout( groupBox2DFonts );
371  buttonTitleFont= new QPushButton();
372  fontsLayout->addWidget( buttonTitleFont );
373  buttonLegendFont= new QPushButton();
374  fontsLayout->addWidget( buttonLegendFont );
375  buttonAxesFont= new QPushButton();
376  fontsLayout->addWidget( buttonAxesFont );
377  buttonNumbersFont= new QPushButton();
378  fontsLayout->addWidget( buttonNumbersFont );
379  fontsLayout->addStretch();
380 
381  plotsTabWidget->addTab( plotFonts, QString() );
382 
383  plotPrint = new QWidget();
384  QVBoxLayout *printLayout = new QVBoxLayout( plotPrint );
385 
386  boxScaleLayersOnPrint = new QCheckBox();
388  printLayout->addWidget( boxScaleLayersOnPrint );
389 
390  boxPrintCropmarks = new QCheckBox();
391  boxPrintCropmarks->setChecked(app->d_print_cropmarks);
392  printLayout->addWidget( boxPrintCropmarks );
393  printLayout->addStretch();
394  plotsTabWidget->addTab(plotPrint, QString());
395 
396  connect( boxResize, SIGNAL( clicked() ), this, SLOT( enableScaleFonts() ) );
397  connect( boxFrame, SIGNAL( toggled(bool) ), this, SLOT( showFrameWidth(bool) ) );
398  connect( buttonAxesFont, SIGNAL( clicked() ), this, SLOT( pickAxesFont() ) );
399  connect( buttonNumbersFont, SIGNAL( clicked() ), this, SLOT( pickNumbersFont() ) );
400  connect( buttonLegendFont, SIGNAL( clicked() ), this, SLOT( pickLegendFont() ) );
401  connect( buttonTitleFont, SIGNAL( clicked() ), this, SLOT( pickTitleFont() ) );
402 }
403 
405 {
406  if(boxResize->isChecked())
407  boxScaleFonts->setEnabled(false);
408  else
409  boxScaleFonts->setEnabled(true);
410 }
411 
413 {
414  if (!ok)
415  {
416  boxFrameWidth->hide();
417  labelFrameWidth->hide();
418  }
419  else
420  {
421  boxFrameWidth->show();
422  labelFrameWidth->show();
423  }
424 }
425 
427 {
428  ApplicationWindow *app = (ApplicationWindow *)parentWidget();
429  plots3D = new QWidget();
430 
431  QGroupBox * topBox = new QGroupBox();
432  QGridLayout * topLayout = new QGridLayout( topBox );
433  topLayout->setSpacing(5);
434 
435  lblResolution = new QLabel();
436  topLayout->addWidget( lblResolution, 0, 0 );
437  boxResolution = new QSpinBox();
438  boxResolution->setRange(1, 100);
439  boxResolution->setValue(app->plot3DResolution);
440  topLayout->addWidget( boxResolution, 0, 1 );
441 
442  boxShowLegend = new QCheckBox();
443  boxShowLegend->setChecked(app->showPlot3DLegend);
444  topLayout->addWidget( boxShowLegend, 1, 0 );
445 
446  boxShowProjection = new QCheckBox();
447  boxShowProjection->setChecked(app->showPlot3DProjection);
448  topLayout->addWidget( boxShowProjection, 1, 1 );
449 
450  boxSmoothMesh = new QCheckBox();
451  boxSmoothMesh->setChecked(app->smooth3DMesh);
452  topLayout->addWidget( boxSmoothMesh, 2, 0 );
453 
454  boxOrthogonal = new QCheckBox();
455  boxOrthogonal->setChecked(app->orthogonal3DPlots);
456  topLayout->addWidget( boxOrthogonal, 2, 1 );
457 
458  boxAutoscale3DPlots = new QCheckBox();
459  boxAutoscale3DPlots->setChecked(app->autoscale3DPlots);
460  topLayout->addWidget( boxAutoscale3DPlots, 3, 0 );
461 
462  groupBox3DCol = new QGroupBox();
463  QGridLayout * middleLayout = new QGridLayout( groupBox3DCol );
464 
465  btnFromColor = new QPushButton();
466  middleLayout->addWidget( btnFromColor, 0, 0 );
467  btnLabels = new QPushButton();
468  middleLayout->addWidget( btnLabels, 0, 1 );
469  btnMesh = new QPushButton();
470  middleLayout->addWidget( btnMesh, 0, 2 );
471  btnGrid = new QPushButton();
472  middleLayout->addWidget( btnGrid, 0, 3 );
473  btnToColor = new QPushButton();
474  middleLayout->addWidget( btnToColor, 1, 0 );
475  btnNumbers = new QPushButton();
476  middleLayout->addWidget( btnNumbers, 1, 1 );
477  btnAxes = new QPushButton();
478  middleLayout->addWidget( btnAxes, 1, 2 );
479  btnBackground3D = new QPushButton();
480  middleLayout->addWidget( btnBackground3D, 1, 3 );
481 
482  groupBox3DFonts = new QGroupBox();
483  QHBoxLayout * bottomLayout = new QHBoxLayout( groupBox3DFonts );
484 
485  btnTitleFnt = new QPushButton();
486  bottomLayout->addWidget( btnTitleFnt );
487  btnLabelsFnt = new QPushButton();
488  bottomLayout->addWidget( btnLabelsFnt );
489  btnNumFnt = new QPushButton();
490  bottomLayout->addWidget( btnNumFnt );
491 
492  QVBoxLayout * plots3DPageLayout = new QVBoxLayout( plots3D );
493  plots3DPageLayout->addWidget(topBox);
494  plots3DPageLayout->addWidget(groupBox3DCol);
495  plots3DPageLayout->addWidget(groupBox3DFonts);
496  plots3DPageLayout->addStretch();
497 
498  connect( btnAxes, SIGNAL( clicked() ), this, SLOT(pick3DAxesColor() ) );
499  connect( btnLabels, SIGNAL( clicked() ), this, SLOT(pick3DLabelsColor() ) );
500  connect( btnNumbers, SIGNAL( clicked() ), this, SLOT(pick3DNumbersColor() ) );
501  connect( btnBackground3D, SIGNAL( clicked() ), this, SLOT(pick3DBackgroundColor()));
502  connect( btnFromColor, SIGNAL( clicked() ), this, SLOT(pickDataMinColor() ) );
503  connect( btnToColor, SIGNAL( clicked() ), this, SLOT(pickDataMaxColor() ) );
504  connect( btnGrid, SIGNAL( clicked() ), this, SLOT(pickGridColor() ) );
505  connect( btnMesh, SIGNAL( clicked() ), this, SLOT(pickMeshColor() ) );
506 
507  connect( btnNumFnt, SIGNAL( clicked() ), this, SLOT(pick3DNumbersFont() ) );
508  connect( btnTitleFnt, SIGNAL( clicked() ), this, SLOT(pick3DTitleFont() ) );
509  connect( btnLabelsFnt, SIGNAL( clicked() ), this, SLOT(pick3DAxesFont() ) );
510 }
511 
513 {
514  ApplicationWindow *app = (ApplicationWindow *)parentWidget();
515 
516  appTabWidget = new QTabWidget(generalDialog);
517 
518  application = new QWidget();
519  QVBoxLayout * applicationLayout = new QVBoxLayout( application );
520  QGroupBox * groupBoxApp = new QGroupBox();
521  applicationLayout->addWidget(groupBoxApp);
522  QGridLayout * topBoxLayout = new QGridLayout( groupBoxApp );
523 
524  lblLanguage = new QLabel();
525  topBoxLayout->addWidget( lblLanguage, 0, 0 );
526  boxLanguage = new QComboBox();
528  topBoxLayout->addWidget( boxLanguage, 0, 1 );
529 
530  lblStyle = new QLabel();
531  topBoxLayout->addWidget( lblStyle, 1, 0 );
532  boxStyle = new QComboBox();
533  topBoxLayout->addWidget( boxStyle, 1, 1 );
534  QStringList styles = QStyleFactory::keys();
535  styles.sort();
536  boxStyle->addItems(styles);
537  boxStyle->setCurrentIndex(boxStyle->findText(app->appStyle,Qt::MatchWildcard));
538 
539  lblFonts = new QLabel();
540  topBoxLayout->addWidget( lblFonts, 2, 0 );
541  fontsBtn= new QPushButton();
542  topBoxLayout->addWidget( fontsBtn, 2, 1 );
543 
544  lblScriptingLanguage = new QLabel();
545  topBoxLayout->addWidget( lblScriptingLanguage, 3, 0 );
546  boxScriptingLanguage = new QComboBox();
547  QStringList llist = ScriptingLangManager::languages();
548  boxScriptingLanguage->addItems(llist);
549  boxScriptingLanguage->setCurrentIndex(llist.indexOf(app->defaultScriptingLang));
550  topBoxLayout->addWidget( boxScriptingLanguage, 3, 1 );
551 
552  boxSave= new QCheckBox();
553  boxSave->setChecked(app->autoSave);
554  topBoxLayout->addWidget( boxSave, 4, 0 );
555 
556  boxMinutes = new QSpinBox();
557  boxMinutes->setRange(1,100);
558  boxMinutes->setValue(app->autoSaveTime);
559  boxMinutes->setEnabled(app->autoSave);
560  topBoxLayout->addWidget( boxMinutes, 4, 1 );
561 
562  lblUndoLimit = new QLabel();
563  topBoxLayout->addWidget( lblUndoLimit, 5, 0 );
564  boxUndoLimit = new QSpinBox();
565  boxUndoLimit->setRange(1,10000);
566  boxUndoLimit->setValue(app->undoLimit);
567  topBoxLayout->addWidget( boxUndoLimit, 5, 1 );
568 
569 #ifdef SEARCH_FOR_UPDATES
570  boxSearchUpdates = new QCheckBox();
571  boxSearchUpdates->setChecked(app->autoSearchUpdates);
572  topBoxLayout->addWidget( boxSearchUpdates, 6, 0, 1, 2 );
573 #endif
574 
575  topBoxLayout->setRowStretch( 7, 1 );
576 
577  appTabWidget->addTab( application, QString() );
578 
580 
581  appTabWidget->addTab( confirm, QString() );
582 
583  appColors = new QWidget();
584  QVBoxLayout * appColorsLayout = new QVBoxLayout( appColors );
585  QGroupBox * groupBoxAppCol = new QGroupBox();
586  appColorsLayout->addWidget( groupBoxAppCol );
587  QGridLayout * colorsBoxLayout = new QGridLayout( groupBoxAppCol );
588 
589  lblWorkspace = new QLabel();
590  colorsBoxLayout->addWidget( lblWorkspace, 0, 0 );
591  btnWorkspace = new ColorButton();
593  colorsBoxLayout->addWidget( btnWorkspace, 0, 1 );
594 
595  lblPanels = new QLabel();
596  colorsBoxLayout->addWidget( lblPanels, 1, 0 );
597  btnPanels = new ColorButton();
598  colorsBoxLayout->addWidget( btnPanels, 1, 1 );
600 
601  lblPanelsText = new QLabel();
602  colorsBoxLayout->addWidget( lblPanelsText, 2, 0 );
603  btnPanelsText = new ColorButton();
604  colorsBoxLayout->addWidget( btnPanelsText, 2, 1 );
606 
607  colorsBoxLayout->setRowStretch( 3, 1 );
608 
609  appTabWidget->addTab( appColors, QString() );
610 
611  numericFormatPage = new QWidget();
612  QVBoxLayout *numLayout = new QVBoxLayout( numericFormatPage );
613  QGroupBox *numericFormatBox = new QGroupBox();
614  numLayout->addWidget( numericFormatBox );
615  QGridLayout *numericFormatLayout = new QGridLayout( numericFormatBox );
616 
617  lblAppPrecision = new QLabel();
618  numericFormatLayout->addWidget(lblAppPrecision, 0, 0);
619  boxAppPrecision = new QSpinBox();
620  boxAppPrecision->setRange(0, 16);
621  boxAppPrecision->setValue(app->d_decimal_digits);
622  numericFormatLayout->addWidget(boxAppPrecision, 0, 1);
623 
624  lblDecimalSeparator = new QLabel();
625  numericFormatLayout->addWidget(lblDecimalSeparator, 1, 0 );
626  boxDecimalSeparator = new QComboBox();
627 
628  numericFormatLayout->addWidget(boxDecimalSeparator, 1, 1);
629 
630  boxUseGroupSeparator = new QCheckBox();
631  boxUseGroupSeparator->setChecked(!(QLocale().numberOptions() & QLocale::OmitGroupSeparator));
632 
633  numericFormatLayout->addWidget(boxUseGroupSeparator, 2, 0);
634 
635  boxSeparatorPreview = new QLabel();
636  boxSeparatorPreview->setFrameStyle(QFrame::Panel | QFrame::Sunken);
637  numericFormatLayout->addWidget(boxSeparatorPreview, 2, 1);
638 
639  lblDefaultNumericFormat = new QLabel();
640  boxDefaultNumericFormat = new QComboBox();
641 
642  numericFormatLayout->addWidget(lblDefaultNumericFormat, 3, 0);
643  numericFormatLayout->addWidget(boxDefaultNumericFormat, 3, 1);
644 
645  numericFormatLayout->setRowStretch(4, 1);
646 
647  appTabWidget->addTab( numericFormatPage, QString() );
648 
649  connect( boxLanguage, SIGNAL( activated(int) ), this, SLOT( switchToLanguage(int) ) );
650  connect( fontsBtn, SIGNAL( clicked() ), this, SLOT( pickApplicationFont() ) );
651  connect( boxSave, SIGNAL( toggled(bool) ), boxMinutes, SLOT( setEnabled(bool) ) );
652  connect( btnWorkspace, SIGNAL( clicked() ), this, SLOT( pickWorkspaceColor() ) );
653  connect( btnPanels, SIGNAL( clicked() ), this, SLOT( pickPanelsColor() ) );
654  connect( btnPanelsText, SIGNAL( clicked() ), this, SLOT( pickPanelsTextColor() ) );
655  connect( boxUseGroupSeparator, SIGNAL( toggled(bool) ), this, SLOT(updateDecSepPreview()) );
656  connect( boxDecimalSeparator, SIGNAL( currentIndexChanged(int) ), this, SLOT(updateDecSepPreview()) );
657  connect( boxAppPrecision, SIGNAL( valueChanged(int) ), this, SLOT(updateDecSepPreview()) );
658 }
659 
661 {
662  ApplicationWindow *app = (ApplicationWindow *)parentWidget();
663  fitPage = new QWidget();
664 
665  groupBoxFittingCurve = new QGroupBox();
666  QGridLayout * fittingCurveLayout = new QGridLayout(groupBoxFittingCurve);
667  fittingCurveLayout->setSpacing(5);
668 
669  generatePointsBtn = new QRadioButton();
671  fittingCurveLayout->addWidget(generatePointsBtn, 0, 0);
672 
673  lblPoints = new QLabel();
674  fittingCurveLayout->addWidget(lblPoints, 0, 1);
675  generatePointsBox = new QSpinBox();
676  generatePointsBox->setRange(0, 1000000);
677  generatePointsBox->setSingleStep(10);
678  generatePointsBox->setValue(app->fitPoints);
679  fittingCurveLayout->addWidget(generatePointsBox, 0, 2);
680 
681  linearFit2PointsBox = new QCheckBox();
682  linearFit2PointsBox->setChecked(app->d_2_linear_fit_points);
683  fittingCurveLayout->addWidget(linearFit2PointsBox, 0, 3);
684 
686 
687  samePointsBtn = new QRadioButton();
688  samePointsBtn->setChecked(!app->generateUniformFitPoints);
689  fittingCurveLayout->addWidget(samePointsBtn, 1, 0);
690 
691  groupBoxMultiPeak = new QGroupBox();
692  groupBoxMultiPeak->setCheckable(true);
693  groupBoxMultiPeak->setChecked(app->generatePeakCurves);
694 
695  QHBoxLayout * multiPeakLayout = new QHBoxLayout(groupBoxMultiPeak);
696 
697  lblPeaksColor = new QLabel();
698  multiPeakLayout->addWidget(lblPeaksColor);
699  boxPeaksColor = new ColorButton();
701  multiPeakLayout->addWidget(boxPeaksColor);
702 
703  groupBoxFitParameters = new QGroupBox();
704  QGridLayout * fitParamsLayout = new QGridLayout(groupBoxFitParameters);
705 
706  lblPrecision = new QLabel();
707  fitParamsLayout->addWidget(lblPrecision, 0, 0);
708  boxPrecision = new QSpinBox();
709  fitParamsLayout->addWidget(boxPrecision, 0, 1);
710  boxPrecision->setValue(app->fit_output_precision);
711 
712  logBox = new QCheckBox();
713  logBox->setChecked(app->writeFitResultsToLog);
714  fitParamsLayout->addWidget(logBox, 1, 0);
715 
716  plotLabelBox = new QCheckBox();
717  plotLabelBox->setChecked(app->pasteFitResultsToPlot);
718  fitParamsLayout->addWidget(plotLabelBox, 2, 0);
719 
720  scaleErrorsBox = new QCheckBox();
721  fitParamsLayout->addWidget(scaleErrorsBox, 3, 0);
722  scaleErrorsBox->setChecked(app->fit_scale_errors);
723 
724  QVBoxLayout* fitPageLayout = new QVBoxLayout(fitPage);
725  fitPageLayout->addWidget(groupBoxFittingCurve);
726  fitPageLayout->addWidget(groupBoxMultiPeak);
727  fitPageLayout->addWidget(groupBoxFitParameters);
728  fitPageLayout->addStretch();
729 
730  connect(samePointsBtn, SIGNAL(toggled(bool)), this, SLOT(showPointsBox(bool)));
731  connect(generatePointsBtn, SIGNAL(toggled(bool)), this, SLOT(showPointsBox(bool)));
732 }
733 
734 
736 {
737  ApplicationWindow *app = (ApplicationWindow *)parentWidget();
738 
739  curves = new QWidget();
740 
741  QGroupBox * curvesGroupBox = new QGroupBox();
742  QGridLayout * curvesBoxLayout = new QGridLayout( curvesGroupBox );
743 
744  lblCurveStyle = new QLabel();
745  curvesBoxLayout->addWidget( lblCurveStyle, 0, 0 );
746  boxCurveStyle = new QComboBox();
747  curvesBoxLayout->addWidget( boxCurveStyle, 0, 1 );
748 
749  lblLineWidth = new QLabel();
750  curvesBoxLayout->addWidget( lblLineWidth, 1, 0 );
751  boxCurveLineWidth = new QSpinBox();
752  boxCurveLineWidth->setRange(1,100);
754  curvesBoxLayout->addWidget( boxCurveLineWidth, 1, 1 );
755 
756  lblSymbSize = new QLabel();
757  curvesBoxLayout->addWidget( lblSymbSize, 2, 0 );
758  boxSymbolSize = new QSpinBox();
759  boxSymbolSize->setRange(1,100);
760  boxSymbolSize->setValue(app->defaultSymbolSize/2);
761  curvesBoxLayout->addWidget( boxSymbolSize, 2, 1 );
762 
763  curvesBoxLayout->setRowStretch( 3, 1 );
764 
765  QHBoxLayout * curvesPageLayout = new QHBoxLayout( curves );
766  curvesPageLayout->addWidget( curvesGroupBox );
767 }
768 
770 {
771  ApplicationWindow *app = (ApplicationWindow *)parentWidget();
772  confirm = new QWidget();
773 
774  groupBoxConfirm = new QGroupBox();
775  QVBoxLayout * layout = new QVBoxLayout( groupBoxConfirm );
776 
777  boxFolders = new QCheckBox();
778  boxFolders->setChecked(app->confirmCloseFolder);
779  layout->addWidget( boxFolders );
780 
781  boxTables = new QCheckBox();
782  boxTables->setChecked(app->confirmCloseTable);
783  layout->addWidget( boxTables );
784 
785  boxMatrices = new QCheckBox();
786  boxMatrices->setChecked(app->confirmCloseMatrix);
787  layout->addWidget( boxMatrices );
788 
789  boxPlots2D = new QCheckBox();
790  boxPlots2D->setChecked(app->confirmClosePlot2D);
791  layout->addWidget( boxPlots2D );
792 
793  boxPlots3D = new QCheckBox();
794  boxPlots3D->setChecked(app->confirmClosePlot3D);
795  layout->addWidget( boxPlots3D );
796 
797  boxNotes = new QCheckBox();
798  boxNotes->setChecked(app->confirmCloseNotes);
799  layout->addWidget( boxNotes );
800 
801  layout->addStretch();
802 
803  QHBoxLayout * confirmPageLayout = new QHBoxLayout( confirm );
804  confirmPageLayout->addWidget(groupBoxConfirm);
805 }
806 
808 {
809  setWindowTitle( tr( "Preferences" ) );
810  ApplicationWindow *app = (ApplicationWindow *)parentWidget();
811 
812  // pages list
813  itemsList->clear();
814  itemsList->addItem( tr( "General" ) );
815  itemsList->addItem( tr( "Tables" ) );
816  itemsList->addItem( tr( "2D Plots" ) );
817  itemsList->addItem( tr( "3D Plots" ) );
818  itemsList->addItem( tr( "Fitting" ) );
819  itemsList->setCurrentRow(0);
820  itemsList->item(0)->setIcon(QIcon(QPixmap(":/general.xpm")));
821  itemsList->item(1)->setIcon(QIcon(QPixmap(":/configTable.xpm")));
822  itemsList->item(2)->setIcon(QIcon(QPixmap(":/config_curves.xpm")));
823  itemsList->item(3)->setIcon(QIcon(QPixmap(":/3dplots.xpm")));
824  itemsList->item(4)->setIcon(QIcon(QPixmap(":/fit.xpm")));
825  itemsList->setIconSize(QSize(32,32));
826  // calculate a sensible width for the items list
827  // (default QListWidget size is 256 which looks too big)
828  QFontMetrics fm(itemsList->font());
829  int width = 32,i;
830  for(i=0 ; i<itemsList->count() ; i++)
831  if( fm.width(itemsList->item(i)->text()) > width)
832  width = fm.width(itemsList->item(i)->text());
833  itemsList->setMaximumWidth( itemsList->iconSize().width() + width + 50 );
834  // resize the list to the maximum width
835  itemsList->resize(itemsList->maximumWidth(),itemsList->height());
836 
837  //plots 2D page
838  plotsTabWidget->setTabText(plotsTabWidget->indexOf(plotOptions), tr("Options"));
839  plotsTabWidget->setTabText(plotsTabWidget->indexOf(curves), tr("Curves"));
840  plotsTabWidget->setTabText(plotsTabWidget->indexOf(plotTicks), tr("Ticks"));
841  plotsTabWidget->setTabText(plotsTabWidget->indexOf(plotFonts), tr("Fonts"));
842 
843  boxResize->setText(tr("Do not &resize layers when window size changes"));
844 
845  lblMinTicksLength->setText(tr("Length"));
846 
847  lblAxesLineWidth->setText(tr("Axes linewidth" ));
848  lblMajTicksLength->setText(tr("Length" ));
849  lblMajTicks->setText(tr("Major Ticks" ));
850  lblMinTicks->setText(tr("Minor Ticks" ));
851 
852  lblMargin->setText(tr("Margin" ));
853  labelFrameWidth->setText(tr("Frame width" ));
854  boxBackbones->setText(tr("Axes &backbones"));
855  boxFrame->setText(tr("Canvas Fra&me"));
856  boxAllAxes->setText(tr("Sho&w all axes"));
857  boxTitle->setText(tr("Show &Title"));
858  boxScaleFonts->setText(tr("Scale &Fonts"));
859  boxAutoscaling->setText(tr("Auto&scaling"));
860  boxAntialiasing->setText(tr("Antia&liasing"));
861 
862  boxMajTicks->clear();
863  boxMajTicks->addItem(tr("None"));
864  boxMajTicks->addItem(tr("Out"));
865  boxMajTicks->addItem(tr("In & Out"));
866  boxMajTicks->addItem(tr("In"));
867 
868  boxMinTicks->clear();
869  boxMinTicks->addItem(tr("None"));
870  boxMinTicks->addItem(tr("Out"));
871  boxMinTicks->addItem(tr("In & Out"));
872  boxMinTicks->addItem(tr("In"));
873 
874  boxMajTicks->setCurrentIndex(app->majTicksStyle);
875  boxMinTicks->setCurrentIndex(app->minTicksStyle);
876 
877  plotsTabWidget->setTabText(plotsTabWidget->indexOf(plotPrint), tr("Print"));
878  boxPrintCropmarks->setText(tr("Print Crop &Marks"));
879  boxScaleLayersOnPrint->setText(tr("&Scale layers to paper size"));
880 
881  //confirmations page
882  groupBoxConfirm->setTitle(tr("Prompt on closing"));
883  boxFolders->setText(tr("Folders"));
884  boxTables->setText(tr("Tables"));
885  boxPlots3D->setText(tr("3D Plots"));
886  boxPlots2D->setText(tr("2D Plots"));
887  boxMatrices->setText(tr("Matrices"));
888  boxNotes->setText(tr("&Notes"));
889 
890  buttonOk->setText( tr( "&OK" ) );
891  buttonCancel->setText( tr( "&Cancel" ) );
892  buttonApply->setText( tr( "&Apply" ) );
893  buttonTextFont->setText( tr( "&Text Font" ) );
894  buttonHeaderFont->setText( tr( "&Labels Font" ) );
895  buttonAxesFont->setText( tr( "A&xes Labels" ) );
896  buttonNumbersFont->setText( tr( "Axes &Numbers" ) );
897  buttonLegendFont->setText( tr( "&Legend" ) );
898  buttonTitleFont->setText( tr( "T&itle" ) );
899 
900  //application page
901  appTabWidget->setTabText(appTabWidget->indexOf(application), tr("Application"));
902  appTabWidget->setTabText(appTabWidget->indexOf(confirm), tr("Confirmations"));
903  appTabWidget->setTabText(appTabWidget->indexOf(appColors), tr("Colors"));
904  appTabWidget->setTabText(appTabWidget->indexOf(numericFormatPage), tr("Numeric Format"));
905 
906  lblLanguage->setText(tr("Language"));
907  lblStyle->setText(tr("Style"));
908  lblFonts->setText(tr("Main Font"));
909  fontsBtn->setText(tr("Choose &font"));
910  lblWorkspace->setText(tr("Workspace"));
911  lblPanelsText->setText(tr("Panels text"));
912  lblPanels->setText(tr("Panels"));
913  lblUndoLimit->setText(tr("Undo/Redo History limit"));
914  boxSave->setText(tr("Save every"));
915 #ifdef SEARCH_FOR_UPDATES
916  boxSearchUpdates->setText(tr("Check for new versions at startup"));
917 #endif
918  boxMinutes->setSuffix(tr(" minutes"));
919  lblScriptingLanguage->setText(tr("Default scripting language"));
920 
921  lblDefaultNumericFormat->setText(tr("Default numeric format"));
922  boxDefaultNumericFormat->clear();
923  boxDefaultNumericFormat->addItem(tr("Decimal"), QVariant('f'));
924  boxDefaultNumericFormat->addItem(tr("Scientific (e)"), QVariant('e'));
925  boxDefaultNumericFormat->addItem(tr("Scientific (E)"), QVariant('E'));
926  boxDefaultNumericFormat->addItem(tr("Automatic (e)"), QVariant('g'));
927  boxDefaultNumericFormat->addItem(tr("Automatic (E)"), QVariant('G'));
928  int format_index = boxDefaultNumericFormat->findData(app->d_default_numeric_format);
929  boxDefaultNumericFormat->setCurrentIndex(format_index);
930 
931  boxUseGroupSeparator->setText(tr("Use group separator","option: use separator every 3 digits"));
932  lblAppPrecision->setText(tr("Default Number of Decimal Digits"));
933  lblDecimalSeparator->setText(tr("Decimal Separators"));
934  boxDecimalSeparator->clear();
935  boxDecimalSeparator->addItem(tr("default") + " (" + QLocale::system().toString(1000.0, 'f', 1) +")");
936  boxDecimalSeparator->addItem(QLocale::c().toString(1000.0, 'f', 1));
937  boxDecimalSeparator->addItem(QLocale(QLocale::German).toString(1000.0, 'f', 1));
938  boxDecimalSeparator->addItem(QLocale(QLocale::French).toString(1000.0, 'f', 1));
939 
940  if (QLocale().name() == QLocale::c().name())
941  boxDecimalSeparator->setCurrentIndex(1);
942  else if (QLocale().name() == QLocale(QLocale::German).name())
943  boxDecimalSeparator->setCurrentIndex(2);
944  else if (QLocale().name() == QLocale(QLocale::French).name())
945  boxDecimalSeparator->setCurrentIndex(3);
946 
947  boxSeparatorPreview->setText(tr("Preview:","preview of the decimal separator") + " " + QLocale().toString(1000.1234567890123456, 'f', boxAppPrecision->value()) );
948 
949  //tables page
950  boxTableComments->setText(tr("&Display Comments in Header"));
951  groupBoxTableCol->setTitle(tr("Colors"));
952  lblSeparator->setText(tr("Default Column Separator"));
953  boxSeparator->clear();
954  boxSeparator->addItem(tr("TAB"));
955  boxSeparator->addItem(tr("SPACE"));
956  boxSeparator->addItem(";" + tr("TAB"));
957  boxSeparator->addItem("," + tr("TAB"));
958  boxSeparator->addItem(";" + tr("SPACE"));
959  boxSeparator->addItem("," + tr("SPACE"));
960  boxSeparator->addItem(";");
961  boxSeparator->addItem(",");
963 
964  lblTableBackground->setText(tr( "Background" ));
965  lblTextColor->setText(tr( "Text" ));
966  lblHeaderColor->setText(tr("Labels"));
967  groupBoxTableFonts->setTitle(tr("Fonts"));
968 
969  //curves page
970  lblCurveStyle->setText(tr( "Default curve style" ));
971  lblLineWidth->setText(tr( "Line width" ));
972  lblSymbSize->setText(tr( "Symbol size" ));
973 
974  boxCurveStyle->clear();
975  boxCurveStyle->addItem( QPixmap(":/lPlot.xpm"), tr( " Line" ) );
976  boxCurveStyle->addItem( QPixmap(":/pPlot.xpm"), tr( " Scatter" ) );
977  boxCurveStyle->addItem( QPixmap(":/lpPlot.xpm"), tr( " Line + Symbol" ) );
978  boxCurveStyle->addItem( QPixmap(":/dropLines.xpm"), tr( " Vertical drop lines" ) );
979  boxCurveStyle->addItem( QPixmap(":/spline.xpm"), tr( " Spline" ) );
980  boxCurveStyle->addItem( QPixmap(":/vert_steps.xpm"), tr( " Vertical steps" ) );
981  boxCurveStyle->addItem( QPixmap(":/hor_steps.xpm"), tr( " Horizontal steps" ) );
982  boxCurveStyle->addItem( QPixmap(":/area.xpm"), tr( " Area" ) );
983  boxCurveStyle->addItem( QPixmap(":/vertBars.xpm"), tr( " Vertical Bars" ) );
984  boxCurveStyle->addItem( QPixmap(":/hBars.xpm"), tr( " Horizontal Bars" ) );
985 
986  int style = app->defaultCurveStyle;
987  if (style == Graph::Line)
988  boxCurveStyle->setCurrentIndex(0);
989  else if (style == Graph::Scatter)
990  boxCurveStyle->setCurrentIndex(1);
991  else if (style == Graph::LineSymbols)
992  boxCurveStyle->setCurrentIndex(2);
993  else if (style == Graph::VerticalDropLines)
994  boxCurveStyle->setCurrentIndex(3);
995  else if (style == Graph::Spline)
996  boxCurveStyle->setCurrentIndex(4);
997  else if (style == Graph::VerticalSteps)
998  boxCurveStyle->setCurrentIndex(5);
999  else if (style == Graph::HorizontalSteps)
1000  boxCurveStyle->setCurrentIndex(6);
1001  else if (style == Graph::Area)
1002  boxCurveStyle->setCurrentIndex(7);
1003  else if (style == Graph::VerticalBars)
1004  boxCurveStyle->setCurrentIndex(8);
1005  else if (style == Graph::HorizontalBars)
1006  boxCurveStyle->setCurrentIndex(9);
1007 
1008  //plots 3D
1009  lblResolution->setText(tr("Resolution"));
1010  boxResolution->setSpecialValueText( "1 " + tr("(all data shown)") );
1011  boxShowLegend->setText(tr( "&Show Legend" ));
1012  boxShowProjection->setText(tr( "Show &Projection" ));
1013  btnFromColor->setText( tr( "&Data Max" ) );
1014  boxSmoothMesh->setText(tr( "Smoot&h Line" ));
1015  boxOrthogonal->setText(tr( "O&rthogonal" ));
1016  btnLabels->setText( tr( "Lab&els" ) );
1017  btnMesh->setText( tr( "Mesh &Line" ) );
1018  btnGrid->setText( tr( "&Grid" ) );
1019  btnToColor->setText( tr( "Data &Min" ) );
1020  btnNumbers->setText( tr( "&Numbers" ) );
1021  btnAxes->setText( tr( "A&xes" ) );
1022  btnBackground3D->setText( tr( "&Background" ) );
1023  groupBox3DCol->setTitle(tr("Colors" ));
1024  groupBox3DFonts->setTitle(tr("Fonts" ));
1025  btnTitleFnt->setText( tr( "&Title" ) );
1026  btnLabelsFnt->setText( tr( "&Axes Labels" ) );
1027  btnNumFnt->setText( tr( "&Numbers" ) );
1028  boxAutoscale3DPlots->setText( tr( "Autosca&ling" ) );
1029 
1030  //Fitting page
1031  groupBoxFittingCurve->setTitle(tr("Generated Fit Curve"));
1032  generatePointsBtn->setText(tr("Uniform X Function"));
1033  lblPoints->setText( tr("Points") );
1034  samePointsBtn->setText( tr( "Same X as Fitting Data" ) );
1035  linearFit2PointsBox->setText( tr( "2 points for linear fits" ) );
1036 
1037  groupBoxMultiPeak->setTitle(tr("Display Peak Curves for Multi-peak Fits"));
1038 
1039  groupBoxFitParameters->setTitle(tr("Parameters Output"));
1040  lblPrecision->setText(tr("Significant Digits"));
1041  logBox->setText(tr("Write Parameters to Result Log"));
1042  plotLabelBox->setText(tr("Paste Parameters to Plot"));
1043  scaleErrorsBox->setText(tr("Scale Errors with sqrt(Chi^2/doF)"));
1044  groupBoxMultiPeak->setTitle(tr("Display Peak Curves for Multi-peak Fits"));
1045  lblPeaksColor->setText(tr("Peaks Color"));
1046 }
1047 
1049 {
1050  apply();
1051  close();
1052 }
1053 
1055 {
1056  ApplicationWindow *app = (ApplicationWindow *)parentWidget();
1057  if (!app)
1058  return;
1059 
1060  // tables page
1061  QString sep = boxSeparator->currentText();
1062  sep.replace(tr("TAB"), "\t", Qt::CaseInsensitive);
1063  sep.replace("\\t", "\t");
1064  sep.replace(tr("SPACE"), " ");
1065  sep.replace("\\s", " ");
1066 
1067  if (sep.contains(QRegExp("[0-9.eE+-]"))!=0)
1068  {
1069  QMessageBox::warning(0, tr("Import options error"),
1070  tr("The separator must not contain the following characters: 0-9eE.+-"));
1071  return;
1072  }
1073 
1074  app->columnSeparator = sep;
1077  // 2D plots page: options tab
1078  app->titleOn=boxTitle->isChecked();
1079  app->allAxesOn = boxAllAxes->isChecked();
1080  app->canvasFrameOn=boxFrame->isChecked();
1081  app->canvasFrameWidth = boxFrameWidth->value();
1082  app->drawBackbones = boxBackbones->isChecked();
1083  app->axesLineWidth = boxLineWidth->value();
1084  app->defaultPlotMargin = boxMargin->value();
1085  app->setGraphDefaultSettings(boxAutoscaling->isChecked(),boxScaleFonts->isChecked(),
1086  boxResize->isChecked(), boxAntialiasing->isChecked());
1087  // 2D plots page: curves tab
1088  app->defaultCurveStyle = curveStyle();
1089  app->defaultCurveLineWidth = boxCurveLineWidth->value();
1090  app->defaultSymbolSize = 2*boxSymbolSize->value() + 1;
1091  // 2D plots page: ticks tab
1092  app->majTicksLength = boxMajTicksLength->value();
1093  app->minTicksLength = boxMinTicksLength->value();
1094  app->majTicksStyle = boxMajTicks->currentIndex();
1095  app->minTicksStyle = boxMinTicks->currentIndex();
1096  // 2D plots page: fonts tab
1097  app->plotAxesFont=axesFont;
1100  app->plotTitleFont=titleFont;
1101  // 2D plots page: print tab
1102  app->d_print_cropmarks = boxPrintCropmarks->isChecked();
1103  app->d_scale_plots_on_print = boxScaleLayersOnPrint->isChecked();
1104  QList<MyWidget*> windows = app->windowsList();
1105  foreach(MyWidget *w, windows)
1106  {
1107  if (w->inherits("MultiLayer"))
1108  {
1109  ((MultiLayer*)w)->setScaleLayersOnPrint(boxScaleLayersOnPrint->isChecked());
1110  ((MultiLayer*)w)->printCropmarks(boxPrintCropmarks->isChecked());
1111  }
1112  }
1113  // general page: application tab
1114  app->changeAppFont(appFont);
1115  setFont(appFont);
1116  app->changeAppStyle(boxStyle->currentText());
1117 #ifdef SEARCH_FOR_UPDATES
1118  app->autoSearchUpdates = boxSearchUpdates->isChecked();
1119 #endif
1120  app->setSaveSettings(boxSave->isChecked(), boxMinutes->value());
1121  app->defaultScriptingLang = boxScriptingLanguage->currentText();
1122 
1123  app->undoLimit = boxUndoLimit->value(); // FIXME: can apply only after restart
1124 
1125  // general page: numeric format tab
1126  app->d_decimal_digits = boxAppPrecision->value();
1127  QLocale locale;
1128  switch (boxDecimalSeparator->currentIndex())
1129  {
1130  case 0:
1131  locale = QLocale::system();
1132  break;
1133  case 1:
1134  locale = QLocale::c();
1135  break;
1136  case 2:
1137  locale = QLocale(QLocale::German);
1138  break;
1139  case 3:
1140  locale = QLocale(QLocale::French);
1141  break;
1142  }
1143 
1144  int currentBoxIndex = boxDefaultNumericFormat->currentIndex();
1145  if (currentBoxIndex > -1)
1146  {
1147  app->d_default_numeric_format = boxDefaultNumericFormat->itemData(currentBoxIndex).toChar().toLatin1();
1148  }
1149 
1150  if(boxUseGroupSeparator->isChecked())
1151  locale.setNumberOptions(locale.numberOptions() & ~QLocale::OmitGroupSeparator);
1152  else
1153  locale.setNumberOptions(locale.numberOptions() | QLocale::OmitGroupSeparator);
1154 
1155  if (QLocale() != locale){
1156  QLocale::setDefault(locale);
1157  }
1158 
1159  // general page: confirmations tab
1160  app->confirmCloseFolder = boxFolders->isChecked();
1161  app->updateConfirmOptions(boxTables->isChecked(), boxMatrices->isChecked(),
1162  boxPlots2D->isChecked(), boxPlots3D->isChecked(),
1163  boxNotes->isChecked());
1164  // general page: colors tab
1166  // 3D plots page
1167  app->plot3DColors = plot3DColors;
1168  app->showPlot3DLegend = boxShowLegend->isChecked();
1169  app->showPlot3DProjection = boxShowProjection->isChecked();
1170  app->plot3DResolution = boxResolution->value();
1174  app->orthogonal3DPlots = boxOrthogonal->isChecked();
1175  app->smooth3DMesh = boxSmoothMesh->isChecked();
1176  app->autoscale3DPlots = boxAutoscale3DPlots->isChecked();
1177  app->setPlot3DOptions();
1178 
1179  // fitting page
1180  app->fit_output_precision = boxPrecision->value();
1181  app->pasteFitResultsToPlot = plotLabelBox->isChecked();
1182  app->writeFitResultsToLog = logBox->isChecked();
1183  app->fitPoints = generatePointsBox->value();
1184  app->generateUniformFitPoints = generatePointsBtn->isChecked();
1185  app->generatePeakCurves = groupBoxMultiPeak->isChecked();
1187  app->fit_scale_errors = scaleErrorsBox->isChecked();
1188  app->d_2_linear_fit_points = linearFit2PointsBox->isChecked();
1189  app->saveSettings();
1190 
1191  // calculate a sensible width for the items list
1192  // (default QListWidget size is 256 which looks too big)
1193  QFontMetrics fm(itemsList->font());
1194  int width = 32,i;
1195  for(i=0 ; i<itemsList->count() ; i++)
1196  if( fm.width(itemsList->item(i)->text()) > width)
1197  width = fm.width(itemsList->item(i)->text());
1198  itemsList->setMaximumWidth( itemsList->iconSize().width() + width + 50 );
1199  // resize the list to the maximum width
1200  itemsList->resize(itemsList->maximumWidth(),itemsList->height());
1201 
1202 #ifdef Q_OS_MAC
1203  QSettings settings(QSettings::IniFormat,QSettings::UserScope,
1204  "SciDAVis", "SciDAVis");
1205 #else
1206  QSettings settings(QSettings::NativeFormat,QSettings::UserScope,
1207  "SciDAVis", "SciDAVis");
1208 #endif
1209  settings.beginGroup("[Table]");
1210  settings.setValue("DefaultRowHeight", boxTableRowHeight->value());
1211  settings.endGroup();
1212 }
1213 
1215 {
1216  int style = 0;
1217  switch (boxCurveStyle->currentIndex())
1218  {
1219  case 0:
1220  style = Graph::Line;
1221  break;
1222  case 1:
1223  style = Graph::Scatter;
1224  break;
1225  case 2:
1226  style = Graph::LineSymbols;
1227  break;
1228  case 3:
1229  style = Graph::VerticalDropLines;
1230  break;
1231  case 4:
1232  style = Graph::Spline;
1233  break;
1234  case 5:
1235  style = Graph::VerticalSteps;
1236  break;
1237  case 6:
1238  style = Graph::HorizontalSteps;
1239  break;
1240  case 7:
1241  style = Graph::Area;
1242  break;
1243  case 8:
1244  style = Graph::VerticalBars;
1245  break;
1246  case 9:
1247  style = Graph::HorizontalBars;
1248  break;
1249  }
1250  return style;
1251 }
1252 
1254 {
1255  QColor c = QColorDialog::getColor(buttonBackground->color(), this);
1256  if ( !c.isValid() || c == buttonBackground->color())
1257  return;
1258 
1260 }
1261 
1263 {
1264  QColor c = QColorDialog::getColor(buttonText->color(), this);
1265  if ( !c.isValid() || c == buttonText->color())
1266  return;
1267 
1268  buttonText->setColor(c);
1269 }
1270 
1272 {
1273  QColor c = QColorDialog::getColor(buttonHeader->color(), this);
1274  if ( !c.isValid() || c == buttonHeader->color())
1275  return;
1276 
1277  buttonHeader->setColor(c);
1278 }
1279 
1281 {
1282  bool ok;
1283  QFont font = QFontDialog::getFont(&ok,textFont,this);
1284  if ( ok ) {
1285  textFont = font;
1286  } else {
1287  return;
1288  }
1289 }
1290 
1292 {
1293  bool ok;
1294  QFont font = QFontDialog::getFont(&ok,headerFont,this);
1295  if ( ok ) {
1296  headerFont = font;
1297  } else {
1298  return;
1299  }
1300 }
1301 
1303 {
1304  bool ok;
1305  QFont font = QFontDialog::getFont(&ok,legendFont,this);
1306  if ( ok ) {
1307  legendFont = font;
1308  } else {
1309  return;
1310  }
1311 }
1312 
1314 {
1315  bool ok;
1316  QFont font = QFontDialog::getFont(&ok,axesFont,this);
1317  if ( ok ) {
1318  axesFont = font;
1319  } else {
1320  return;
1321  }
1322 }
1323 
1325 {
1326  bool ok;
1327  QFont font = QFontDialog::getFont(&ok,numbersFont,this);
1328  if ( ok ) {
1329  numbersFont = font;
1330  } else {
1331  return;
1332  }
1333 }
1334 
1336 {
1337  bool ok;
1338  QFont font = QFontDialog::getFont(&ok,titleFont,this);
1339  if ( ok )
1340  titleFont = font;
1341  else
1342  return;
1343 }
1344 
1346 {
1347  bool ok;
1348  QFont font = QFontDialog::getFont(&ok,appFont,this);
1349  if ( ok )
1350  appFont = font;
1351  else
1352  return;
1353  fontsBtn->setFont(appFont);
1354 }
1355 
1357 {
1358  QColor c = QColorDialog::getColor(btnPanelsText->color(), this);
1359  if ( !c.isValid() || c == btnPanelsText->color())
1360  return;
1361 
1362  btnPanelsText->setColor(c);
1363 }
1364 
1366 {
1367  QColor c = QColorDialog::getColor(btnPanels->color(), this);
1368  if ( !c.isValid() || c == btnPanels->color())
1369  return;
1370 
1371  btnPanels->setColor(c);
1372 }
1373 
1375 {
1376  QColor c = QColorDialog::getColor(btnWorkspace->color(), this);
1377  if ( !c.isValid() || c == btnWorkspace->color())
1378  return;
1379 
1380  btnWorkspace->setColor(c);
1381 }
1382 
1384 {
1385  QColor c = QColorDialog::getColor(QColor(COLORVALUE(plot3DColors[0])), this );
1386  if ( !c.isValid() )
1387  return;
1388 
1389  plot3DColors[0] = c.name();
1390 }
1391 
1393 {
1394  QColor c = QColorDialog::getColor(QColor(COLORVALUE(plot3DColors[4])), this );
1395  if ( !c.isValid() )
1396  return;
1397 
1398  plot3DColors[4] = c.name();
1399 }
1400 
1402 {
1403  QColor c = QColorDialog::getColor(QColor(COLORVALUE(plot3DColors[7])), this );
1404  if ( !c.isValid() )
1405  return;
1406 
1407  plot3DColors[7] = c.name();
1408 }
1409 
1411 {
1412  QColor c = QColorDialog::getColor(QColor(COLORVALUE(plot3DColors[2])), this );
1413  if ( !c.isValid() )
1414  return;
1415 
1416  plot3DColors[2] = c.name();
1417 }
1418 
1420 {
1421  QColor c = QColorDialog::getColor(QColor(COLORVALUE(plot3DColors[3])), this );
1422  if ( !c.isValid() )
1423  return;
1424 
1425  plot3DColors[3] = c.name();
1426 }
1427 
1429 {
1430  QColor c = QColorDialog::getColor(QColor(COLORVALUE(plot3DColors[6])), this );
1431  if ( !c.isValid() )
1432  return;
1433 
1434  plot3DColors[6] = c.name();
1435 }
1436 
1438 {
1439  QColor c = QColorDialog::getColor(QColor(COLORVALUE(plot3DColors[5])), this );
1440  if ( !c.isValid() )
1441  return;
1442 
1443  plot3DColors[5] = c.name();
1444 }
1445 
1447 {
1448  QColor c = QColorDialog::getColor(QColor(COLORVALUE(plot3DColors[1])), this );
1449  if ( !c.isValid() )
1450  return;
1451 
1452  plot3DColors[1] = c.name();
1453 }
1454 
1456 {
1457  bool ok;
1458  QFont font = QFontDialog::getFont(&ok, plot3DTitleFont,this);
1459  if ( ok )
1460  plot3DTitleFont = font;
1461  else
1462  return;
1463 }
1464 
1466 {
1467  bool ok;
1468  QFont font = QFontDialog::getFont(&ok, plot3DNumbersFont,this);
1469  if ( ok )
1470  plot3DNumbersFont = font;
1471  else
1472  return;
1473 }
1474 
1476 {
1477  bool ok;
1478  QFont font = QFontDialog::getFont(&ok, plot3DAxesFont,this);
1479  if ( ok )
1480  plot3DAxesFont = font;
1481  else
1482  return;
1483 }
1484 
1485 void ConfigDialog::setColumnSeparator(const QString& sep)
1486 {
1487  if (sep=="\t")
1488  boxSeparator->setCurrentIndex(0);
1489  else if (sep==" ")
1490  boxSeparator->setCurrentIndex(1);
1491  else if (sep==";\t")
1492  boxSeparator->setCurrentIndex(2);
1493  else if (sep==",\t")
1494  boxSeparator->setCurrentIndex(3);
1495  else if (sep=="; ")
1496  boxSeparator->setCurrentIndex(4);
1497  else if (sep==", ")
1498  boxSeparator->setCurrentIndex(5);
1499  else if (sep==";")
1500  boxSeparator->setCurrentIndex(6);
1501  else if (sep==",")
1502  boxSeparator->setCurrentIndex(7);
1503  else
1504  {
1505  QString separator = sep;
1506  boxSeparator->setEditText(separator.replace(" ","\\s").replace("\t","\\t"));
1507  }
1508 }
1509 
1511 {
1512  ApplicationWindow *app = (ApplicationWindow *)parentWidget();
1513  app->switchToLanguage(param);
1514  languageChange();
1515 }
1516 
1518 {
1519  ApplicationWindow *app = (ApplicationWindow *)parentWidget();
1520  QDir dir(app->qmPath);
1521  QStringList locales = app->locales;
1522  QStringList languages;
1523  int lang = 0;
1524  for (int i=0; i < (int)locales.size(); i++)
1525  {
1526  if (locales[i] == "en")
1527  languages.push_back("English");
1528  else
1529  {
1530  QTranslator translator;
1531  translator.load("scidavis_"+locales[i], app->qmPath);
1532 
1533  QString language = translator.translate("ApplicationWindow", "English", "translate this to the language of the translation file, NOT to the meaning of English!");
1534  if (!language.isEmpty())
1535  languages.push_back(language);
1536  else
1537  languages.push_back(locales[i]);
1538  }
1539 
1540  if (locales[i] == app->appLanguage)
1541  lang = i;
1542  }
1543  boxLanguage->addItems(languages);
1544  boxLanguage->setCurrentIndex(lang);
1545 }
1546 
1547 
1549 {
1550  if (generatePointsBtn->isChecked())
1551  {
1552  lblPoints->show();
1553  generatePointsBox->show();
1554  linearFit2PointsBox->show();
1555  }
1556  else
1557  {
1558  lblPoints->hide();
1559  generatePointsBox->hide();
1560  linearFit2PointsBox->hide();
1561  }
1562 }
1563 
1565 {
1566  QLocale locale;
1567  switch (boxDecimalSeparator->currentIndex())
1568  {
1569  case 0:
1570  locale = QLocale::system();
1571  break;
1572  case 1:
1573  locale = QLocale::c();
1574  break;
1575  case 2:
1576  locale = QLocale(QLocale::German);
1577  break;
1578  case 3:
1579  locale = QLocale(QLocale::French);
1580  break;
1581  }
1582 
1583  if(boxUseGroupSeparator->isChecked())
1584  locale.setNumberOptions(locale.numberOptions() & ~QLocale::OmitGroupSeparator);
1585  else
1586  locale.setNumberOptions(locale.numberOptions() | QLocale::OmitGroupSeparator);
1587 
1588  boxSeparatorPreview->setText(tr("Preview:","preview of the decimal separator") + " " + locale.toString(1000.1234567890123456, 'f', boxAppPrecision->value()) );
1589 }
ApplicationWindow::plot3DTitleFont
QFont plot3DTitleFont
Definition: ApplicationWindow.h:988
ConfigDialog::samePointsBtn
QRadioButton * samePointsBtn
Definition: ConfigDialog.h:171
ConfigDialog::updateDecSepPreview
void updateDecSepPreview()
Update the decimal separator preview.
Definition: ConfigDialog.cpp:1564
ConfigDialog::lblLineWidth
QLabel * lblLineWidth
Definition: ConfigDialog.h:168
ApplicationWindow::windowsList
QList< MyWidget * > windowsList()
Definition: ApplicationWindow.cpp:11686
ConfigDialog::boxAutoscaling
QCheckBox * boxAutoscaling
Definition: ConfigDialog.h:149
ConfigDialog::boxMajTicks
QComboBox * boxMajTicks
Definition: ConfigDialog.h:150
ConfigDialog::lblTextColor
QLabel * lblTextColor
Definition: ConfigDialog.h:165
ApplicationWindow::autoscale3DPlots
bool autoscale3DPlots
Definition: ApplicationWindow.h:997
ConfigDialog::buttonBackground
ColorButton * buttonBackground
Definition: ConfigDialog.h:139
ConfigDialog::plotsTabWidget
QTabWidget * plotsTabWidget
Definition: ConfigDialog.h:135
ConfigDialog::boxTables
QCheckBox * boxTables
Definition: ConfigDialog.h:147
ApplicationWindow::autoSave
bool autoSave
Definition: ApplicationWindow.h:979
ConfigDialog::plotTicks
QWidget * plotTicks
Definition: ConfigDialog.h:143
ConfigDialog::pickGridColor
void pickGridColor()
Definition: ConfigDialog.cpp:1419
ConfigDialog::boxResize
QCheckBox * boxResize
Definition: ConfigDialog.h:149
ConfigDialog::textFont
QFont textFont
Definition: ConfigDialog.h:130
ConfigDialog::lblTableBackground
QLabel * lblTableBackground
Definition: ConfigDialog.h:165
ConfigDialog::groupBoxTableCol
QGroupBox * groupBoxTableCol
Definition: ConfigDialog.h:164
ApplicationWindow::minTicksLength
int minTicksLength
Definition: ApplicationWindow.h:985
ConfigDialog::btnTitleFnt
QPushButton * btnTitleFnt
Definition: ConfigDialog.h:138
ColorButton
A button used for color selection.
Definition: ColorButton.h:54
ApplicationWindow::defaultCurveLineWidth
int defaultCurveLineWidth
Definition: ApplicationWindow.h:986
ConfigDialog::generatePointsBtn
QRadioButton * generatePointsBtn
Definition: ConfigDialog.h:171
ConfigDialog::lblMajTicksLength
QLabel * lblMajTicksLength
Definition: ConfigDialog.h:168
ApplicationWindow::pasteFitResultsToPlot
bool pasteFitResultsToPlot
Definition: ApplicationWindow.h:947
ConfigDialog::boxTableRowHeight
QSpinBox * boxTableRowHeight
Definition: ConfigDialog.h:155
ConfigDialog::pick3DNumbersColor
void pick3DNumbersColor()
Definition: ConfigDialog.cpp:1437
ConfigDialog::lblMargin
QLabel * lblMargin
Definition: ConfigDialog.h:168
ConfigDialog::btnToColor
QPushButton * btnToColor
Definition: ConfigDialog.h:137
ApplicationWindow::setAppColors
void setAppColors(const QColor &wc, const QColor &pc, const QColor &tpc)
Definition: ApplicationWindow.cpp:10406
ConfigDialog::apply
void apply()
Definition: ConfigDialog.cpp:1054
ApplicationWindow::confirmCloseNotes
bool confirmCloseNotes
Definition: ApplicationWindow.h:978
ApplicationWindow::appStyle
QString appStyle
Definition: ApplicationWindow.h:969
ConfigDialog::lblDecimalSeparator
QLabel * lblDecimalSeparator
Definition: ConfigDialog.h:162
ConfigDialog::lblSeparator
QLabel * lblSeparator
Definition: ConfigDialog.h:165
ConfigDialog::generatePointsBox
QSpinBox * generatePointsBox
Definition: ConfigDialog.h:157
ApplicationWindow::majTicksStyle
int majTicksStyle
Definition: ApplicationWindow.h:980
MultiLayer
An MDI window (MyWidget) managing one or more Graph objects.
Definition: MultiLayer.h:67
ConfigDialog::initTablesPage
void initTablesPage()
Definition: ConfigDialog.cpp:163
ConfigDialog::lblTableRowHeight
QLabel * lblTableRowHeight
Definition: ConfigDialog.h:154
ConfigDialog::boxAppPrecision
QSpinBox * boxAppPrecision
Definition: ConfigDialog.h:156
ConfigDialog::lblPoints
QLabel * lblPoints
Definition: ConfigDialog.h:168
ConfigDialog::boxUndoLimit
QSpinBox * boxUndoLimit
Definition: ConfigDialog.h:158
ApplicationWindow::defaultScriptingLang
QString defaultScriptingLang
The scripting language to use for new projects.
Definition: ApplicationWindow.h:1030
ConfigDialog::languageChange
virtual void languageChange()
Definition: ConfigDialog.cpp:807
ConfigDialog::enableScaleFonts
void enableScaleFonts()
Definition: ConfigDialog.cpp:404
ConfigDialog::btnPanelsText
ColorButton * btnPanelsText
Definition: ConfigDialog.h:159
ConfigDialog::groupBoxMultiPeak
QGroupBox * groupBoxMultiPeak
Definition: ConfigDialog.h:172
ConfigDialog::groupBoxFittingCurve
QGroupBox * groupBoxFittingCurve
Definition: ConfigDialog.h:170
ApplicationWindow::tableHeaderColor
QColor tableHeaderColor
Definition: ApplicationWindow.h:990
ConfigDialog::boxPrecision
QSpinBox * boxPrecision
Definition: ConfigDialog.h:156
ConfigDialog::lblPeaksColor
QLabel * lblPeaksColor
Definition: ConfigDialog.h:168
Matrix.h
ConfigDialog::boxSmoothMesh
QCheckBox * boxSmoothMesh
Definition: ConfigDialog.h:148
ConfigDialog::plotPrint
QWidget * plotPrint
Definition: ConfigDialog.h:143
ConfigDialog::boxMatrices
QCheckBox * boxMatrices
Definition: ConfigDialog.h:149
ConfigDialog::pickTextFont
void pickTextFont()
Definition: ConfigDialog.cpp:1280
ConfigDialog::boxPlots3D
QCheckBox * boxPlots3D
Definition: ConfigDialog.h:147
ApplicationWindow::writeFitResultsToLog
bool writeFitResultsToLog
Write fit output information to Result Log.
Definition: ApplicationWindow.h:950
MyWidget
Base class of all MDI client windows.
Definition: MyWidget.h:52
ConfigDialog::switchToLanguage
void switchToLanguage(int param)
Definition: ConfigDialog.cpp:1510
ConfigDialog::lblPanelsText
QLabel * lblPanelsText
Definition: ConfigDialog.h:162
ConfigDialog::lblAppPrecision
QLabel * lblAppPrecision
Definition: ConfigDialog.h:162
ApplicationWindow::confirmCloseFolder
bool confirmCloseFolder
Definition: ApplicationWindow.h:978
ConfigDialog::boxUseGroupSeparator
QCheckBox * boxUseGroupSeparator
Definition: ConfigDialog.h:149
ConfigDialog::boxStyle
QComboBox * boxStyle
Definition: ConfigDialog.h:150
ApplicationWindow::plot3DColors
QStringList plot3DColors
Definition: ApplicationWindow.h:998
ConfigDialog::groupBox3DCol
QGroupBox * groupBox3DCol
Definition: ConfigDialog.h:167
ApplicationWindow::allAxesOn
bool allAxesOn
Definition: ApplicationWindow.h:979
ConfigDialog::pickApplicationFont
void pickApplicationFont()
Definition: ConfigDialog.cpp:1345
ConfigDialog::btnPanels
ColorButton * btnPanels
Definition: ConfigDialog.h:159
ConfigDialog::btnNumbers
QPushButton * btnNumbers
Definition: ConfigDialog.h:136
ConfigDialog::boxScaleLayersOnPrint
QCheckBox * boxScaleLayersOnPrint
Definition: ConfigDialog.h:134
ConfigDialog::curves
QWidget * curves
Definition: ConfigDialog.h:144
ApplicationWindow::d_2_linear_fit_points
bool d_2_linear_fit_points
Calculate only 2 points in a generated linear fit function curve.
Definition: ApplicationWindow.h:945
ConfigDialog::scaleErrorsBox
QCheckBox * scaleErrorsBox
Definition: ConfigDialog.h:146
ColorButton.h
ApplicationWindow::saveSettings
void saveSettings()
Definition: ApplicationWindow.cpp:4451
Graph::Spline
@ Spline
Definition: Graph.h:130
ConfigDialog::setColumnSeparator
void setColumnSeparator(const QString &sep)
Definition: ConfigDialog.cpp:1485
ConfigDialog::showPointsBox
void showPointsBox(bool)
Definition: ConfigDialog.cpp:1548
ConfigDialog::lblWorkspace
QLabel * lblWorkspace
Definition: ConfigDialog.h:161
toString
S toString(const QString &x)
Deal with conversion between QString and std::string/std::wstring in a generic way.
ApplicationWindow::tableTextFont
QFont tableTextFont
Definition: ApplicationWindow.h:989
ConfigDialog::pickPanelsTextColor
void pickPanelsTextColor()
Definition: ConfigDialog.cpp:1356
ApplicationWindow::defaultPlotMargin
int defaultPlotMargin
Definition: ApplicationWindow.h:985
ConfigDialog::groupBoxConfirm
QGroupBox * groupBoxConfirm
Definition: ConfigDialog.h:163
ConfigDialog::pickTextColor
void pickTextColor()
Definition: ConfigDialog.cpp:1262
ConfigDialog::buttonHeaderFont
QPushButton * buttonHeaderFont
Definition: ConfigDialog.h:141
ConfigDialog::application
QWidget * application
Definition: ConfigDialog.h:144
ConfigDialog::appColors
QWidget * appColors
Definition: ConfigDialog.h:143
ApplicationWindow::fitPoints
int fitPoints
Number of points in a generated fit curve.
Definition: ApplicationWindow.h:942
ConfigDialog::boxResolution
QSpinBox * boxResolution
Definition: ConfigDialog.h:156
ConfigDialog::buttonLegendFont
QPushButton * buttonLegendFont
Definition: ConfigDialog.h:145
ConfigDialog::appTabWidget
QTabWidget * appTabWidget
Definition: ConfigDialog.h:135
ApplicationWindow::minTicksStyle
int minTicksStyle
Definition: ApplicationWindow.h:980
ConfigDialog::pick3DBackgroundColor
void pick3DBackgroundColor()
Definition: ConfigDialog.cpp:1401
ApplicationWindow::autoScaleFonts
bool autoScaleFonts
Definition: ApplicationWindow.h:973
ConfigDialog::initConfirmationsPage
void initConfirmationsPage()
Definition: ConfigDialog.cpp:769
ConfigDialog::lblAxesLineWidth
QLabel * lblAxesLineWidth
Definition: ConfigDialog.h:166
ApplicationWindow::fit_output_precision
int fit_output_precision
precision used for the output of the fit operations
Definition: ApplicationWindow.h:953
ConfigDialog::buttonApply
QPushButton * buttonApply
Definition: ConfigDialog.h:140
ConfigDialog::buttonTextFont
QPushButton * buttonTextFont
Definition: ConfigDialog.h:141
ConfigDialog::initFittingPage
void initFittingPage()
Definition: ConfigDialog.cpp:660
ApplicationWindow::undoLimit
int undoLimit
Definition: ApplicationWindow.h:987
ApplicationWindow::plotLegendFont
QFont plotLegendFont
Definition: ApplicationWindow.h:989
ColorButton::color
QColor color() const
Get the color of the display part.
Definition: ColorButton.cpp:140
ApplicationWindow::tableTextColor
QColor tableTextColor
Definition: ApplicationWindow.h:990
ApplicationWindow::locales
QStringList locales
Definition: ApplicationWindow.h:998
ApplicationWindow::d_show_table_comments
bool d_show_table_comments
Definition: ApplicationWindow.h:927
ApplicationWindow::canvasFrameOn
bool canvasFrameOn
Definition: ApplicationWindow.h:979
ApplicationWindow::plot3DNumbersFont
QFont plot3DNumbersFont
Definition: ApplicationWindow.h:988
ConfigDialog::boxMinTicksLength
QSpinBox * boxMinTicksLength
Definition: ConfigDialog.h:157
ConfigDialog::lblMajTicks
QLabel * lblMajTicks
Definition: ConfigDialog.h:168
ConfigDialog::boxSave
QCheckBox * boxSave
Definition: ConfigDialog.h:148
ApplicationWindow::confirmClosePlot3D
bool confirmClosePlot3D
Definition: ApplicationWindow.h:977
ConfigDialog::boxFrame
QCheckBox * boxFrame
Definition: ConfigDialog.h:147
ConfigDialog::boxMinutes
QSpinBox * boxMinutes
Definition: ConfigDialog.h:156
ConfigDialog::curveStyle
int curveStyle()
Definition: ConfigDialog.cpp:1214
ConfigDialog::pickHeaderFont
void pickHeaderFont()
Definition: ConfigDialog.cpp:1291
ConfigDialog::boxScriptingLanguage
QComboBox * boxScriptingLanguage
Definition: ConfigDialog.h:175
ApplicationWindow::plotAxesFont
QFont plotAxesFont
Definition: ApplicationWindow.h:989
ConfigDialog::boxShowProjection
QCheckBox * boxShowProjection
Definition: ConfigDialog.h:149
ConfigDialog::generalDialog
QStackedWidget * generalDialog
Definition: ConfigDialog.h:142
ConfigDialog::linearFit2PointsBox
QCheckBox * linearFit2PointsBox
Definition: ConfigDialog.h:134
ConfigDialog::buttonAxesFont
QPushButton * buttonAxesFont
Definition: ConfigDialog.h:145
ConfigDialog::insertLanguagesList
void insertLanguagesList()
Definition: ConfigDialog.cpp:1517
ConfigDialog::boxAutoscale3DPlots
QCheckBox * boxAutoscale3DPlots
Definition: ConfigDialog.h:176
ConfigDialog::pickBgColor
void pickBgColor()
Definition: ConfigDialog.cpp:1253
ApplicationWindow::plot3DResolution
int plot3DResolution
Definition: ApplicationWindow.h:993
ConfigDialog::boxShowLegend
QCheckBox * boxShowLegend
Definition: ConfigDialog.h:148
ConfigDialog::boxTableComments
QCheckBox * boxTableComments
Definition: ConfigDialog.h:176
ConfigDialog::boxBackbones
QCheckBox * boxBackbones
Definition: ConfigDialog.h:148
Graph::VerticalDropLines
@ VerticalDropLines
Definition: Graph.h:129
ApplicationWindow::plot3DAxesFont
QFont plot3DAxesFont
Definition: ApplicationWindow.h:988
ApplicationWindow::defaultCurveStyle
int defaultCurveStyle
Definition: ApplicationWindow.h:986
ApplicationWindow::switchToLanguage
void switchToLanguage(int param)
Definition: ApplicationWindow.cpp:12048
ConfigDialog::boxSeparator
QComboBox * boxSeparator
Definition: ConfigDialog.h:150
ConfigDialog::headerFont
QFont headerFont
Definition: ConfigDialog.h:130
MultiLayer.h
ApplicationWindow::changeAppFont
void changeAppFont(const QFont &f)
Definition: ApplicationWindow.cpp:3074
Graph::Area
@ Area
Definition: Graph.h:129
ApplicationWindow::drawBackbones
bool drawBackbones
Definition: ApplicationWindow.h:979
ConfigDialog::buttonHeader
ColorButton * buttonHeader
Definition: ConfigDialog.h:139
ConfigDialog::buttonCancel
QPushButton * buttonCancel
Definition: ConfigDialog.h:140
ConfigDialog::lblMinTicks
QLabel * lblMinTicks
Definition: ConfigDialog.h:168
ConfigDialog::boxAllAxes
QCheckBox * boxAllAxes
Definition: ConfigDialog.h:148
ApplicationWindow::customizeTables
void customizeTables(const QColor &bgColor, const QColor &textColor, const QColor &headerColor, const QFont &textFont, const QFont &headerFont, bool showComments)
Definition: ApplicationWindow.cpp:2422
ConfigDialog::pick3DTitleFont
void pick3DTitleFont()
Definition: ConfigDialog.cpp:1455
ConfigDialog::btnMesh
QPushButton * btnMesh
Definition: ConfigDialog.h:136
ApplicationWindow::autoSaveTime
int autoSaveTime
Definition: ApplicationWindow.h:980
Graph::HorizontalBars
@ HorizontalBars
Definition: Graph.h:130
ConfigDialog::groupBox3DFonts
QGroupBox * groupBox3DFonts
Definition: ConfigDialog.h:167
ConfigDialog::tables
QWidget * tables
Definition: ConfigDialog.h:143
ConfigDialog::boxPeaksColor
ColorButton * boxPeaksColor
Definition: ConfigDialog.h:173
ConfigDialog::fontsBtn
QPushButton * fontsBtn
Definition: ConfigDialog.h:145
ConfigDialog::buttonOk
QPushButton * buttonOk
Definition: ConfigDialog.h:140
ApplicationWindow::defaultSymbolSize
int defaultSymbolSize
Definition: ApplicationWindow.h:986
ApplicationWindow::qmPath
QString qmPath
location of translation resources
Definition: ApplicationWindow.h:1032
ConfigDialog::showFrameWidth
void showFrameWidth(bool ok)
Definition: ConfigDialog.cpp:412
ConfigDialog::pickAxesFont
void pickAxesFont()
Definition: ConfigDialog.cpp:1313
ConfigDialog::lblPageHeader
QLabel * lblPageHeader
Definition: ConfigDialog.h:161
ConfigDialog::btnAxes
QPushButton * btnAxes
Definition: ConfigDialog.h:136
ConfigDialog::boxSymbolSize
QSpinBox * boxSymbolSize
Definition: ConfigDialog.h:157
ApplicationWindow::majTicksLength
int majTicksLength
Definition: ApplicationWindow.h:985
ConfigDialog::boxCurveStyle
QComboBox * boxCurveStyle
Definition: ConfigDialog.h:150
ApplicationWindow::confirmCloseMatrix
bool confirmCloseMatrix
Definition: ApplicationWindow.h:977
ConfigDialog::groupBoxTableFonts
QGroupBox * groupBoxTableFonts
Definition: ConfigDialog.h:164
ConfigDialog::initAppPage
void initAppPage()
Definition: ConfigDialog.cpp:512
ConfigDialog::plotFonts
QWidget * plotFonts
Definition: ConfigDialog.h:143
ConfigDialog::lblDefaultNumericFormat
QLabel * lblDefaultNumericFormat
Definition: ConfigDialog.h:151
ConfigDialog::lblScriptingLanguage
QLabel * lblScriptingLanguage
Definition: ConfigDialog.h:174
Graph::Scatter
@ Scatter
Definition: Graph.h:129
ConfigDialog::boxPrintCropmarks
QCheckBox * boxPrintCropmarks
Definition: ConfigDialog.h:134
ConfigDialog::lblSymbSize
QLabel * lblSymbSize
Definition: ConfigDialog.h:166
ConfigDialog::btnFromColor
QPushButton * btnFromColor
Definition: ConfigDialog.h:137
ApplicationWindow::titleOn
bool titleOn
Definition: ApplicationWindow.h:979
ApplicationWindow::panelsColor
QColor panelsColor
Definition: ApplicationWindow.h:968
ConfigDialog::confirm
QWidget * confirm
Definition: ConfigDialog.h:143
ConfigDialog::ConfigDialog
ConfigDialog(QWidget *parent, Qt::WindowFlags fl=0)
Constructor.
Definition: ConfigDialog.cpp:63
ConfigDialog::initPlots3DPage
void initPlots3DPage()
Definition: ConfigDialog.cpp:426
ApplicationWindow::confirmCloseTable
bool confirmCloseTable
Definition: ApplicationWindow.h:977
Graph::HorizontalSteps
@ HorizontalSteps
Definition: Graph.h:130
ConfigDialog::lblStyle
QLabel * lblStyle
Definition: ConfigDialog.h:162
ConfigDialog::plot3DTitleFont
QFont plot3DTitleFont
Definition: ConfigDialog.h:131
ConfigDialog::plot3DColors
QStringList plot3DColors
Definition: ConfigDialog.h:132
ApplicationWindow::setSaveSettings
void setSaveSettings(bool autoSaving, int min)
Definition: ApplicationWindow.cpp:3043
ConfigDialog::pickMeshColor
void pickMeshColor()
Definition: ConfigDialog.cpp:1410
ConfigDialog::buttonText
ColorButton * buttonText
Definition: ConfigDialog.h:139
ApplicationWindow::generateUniformFitPoints
bool generateUniformFitPoints
Definition: ApplicationWindow.h:932
ApplicationWindow
SciDAVis's main window.
Definition: ApplicationWindow.h:122
ApplicationWindow::panelsTextColor
QColor panelsTextColor
Definition: ApplicationWindow.h:968
ConfigDialog::boxSearchUpdates
QCheckBox * boxSearchUpdates
Definition: ConfigDialog.h:146
ConfigDialog::boxMargin
QSpinBox * boxMargin
Definition: ConfigDialog.h:156
Graph::Line
@ Line
Definition: Graph.h:129
ApplicationWindow::setGraphDefaultSettings
void setGraphDefaultSettings(bool autoscale, bool scaleFonts, bool resizeLayers, bool antialiasing)
Definition: ApplicationWindow.cpp:3172
ConfigDialog::boxPlots2D
QCheckBox * boxPlots2D
Definition: ConfigDialog.h:147
ConfigDialog::lblPrecision
QLabel * lblPrecision
Definition: ConfigDialog.h:166
ConfigDialog::boxTitle
QCheckBox * boxTitle
Definition: ConfigDialog.h:147
ConfigDialog.h
ConfigDialog::boxOrthogonal
QCheckBox * boxOrthogonal
Definition: ConfigDialog.h:146
ConfigDialog::pick3DAxesFont
void pick3DAxesFont()
Definition: ConfigDialog.cpp:1475
ApplicationWindow::appFont
QFont appFont
Definition: ApplicationWindow.h:988
ConfigDialog::btnLabels
QPushButton * btnLabels
Definition: ConfigDialog.h:136
ConfigDialog::plots3D
QWidget * plots3D
Definition: ConfigDialog.h:144
ConfigDialog::groupBoxFitParameters
QGroupBox * groupBoxFitParameters
Definition: ConfigDialog.h:170
ConfigDialog::boxLanguage
QComboBox * boxLanguage
Definition: ConfigDialog.h:150
ConfigDialog::numericFormatPage
QWidget * numericFormatPage
Definition: ConfigDialog.h:144
ConfigDialog::pick3DNumbersFont
void pick3DNumbersFont()
Definition: ConfigDialog.cpp:1465
ApplicationWindow::columnSeparator
QString columnSeparator
Definition: ApplicationWindow.h:991
ConfigDialog::btnNumFnt
QPushButton * btnNumFnt
Definition: ConfigDialog.h:138
ConfigDialog::pickDataMaxColor
void pickDataMaxColor()
Definition: ConfigDialog.cpp:1383
ConfigDialog::titleFont
QFont titleFont
Definition: ConfigDialog.h:130
Graph.h
ApplicationWindow::workspaceColor
QColor workspaceColor
Definition: ApplicationWindow.h:968
ConfigDialog::boxFrameWidth
QSpinBox * boxFrameWidth
Definition: ConfigDialog.h:156
ApplicationWindow::changeAppStyle
void changeAppStyle(const QString &s)
Definition: ApplicationWindow.cpp:3059
name
char * name()
Definition: exp_saturation.c:45
ApplicationWindow::orthogonal3DPlots
bool orthogonal3DPlots
Definition: ApplicationWindow.h:997
ApplicationWindow::tableHeaderFont
QFont tableHeaderFont
Definition: ApplicationWindow.h:989
ConfigDialog::fitPage
QWidget * fitPage
Definition: ConfigDialog.h:144
COLORVALUE
static QString COLORVALUE(QString s)
Definition: ColorButton.h:43
ConfigDialog::boxMajTicksLength
QSpinBox * boxMajTicksLength
Definition: ConfigDialog.h:157
ConfigDialog::setCurrentPage
void setCurrentPage(int index)
Definition: ConfigDialog.cpp:156
ConfigDialog::btnGrid
QPushButton * btnGrid
Definition: ConfigDialog.h:137
ConfigDialog::boxMinTicks
QComboBox * boxMinTicks
Definition: ConfigDialog.h:150
ApplicationWindow::canvasFrameWidth
int canvasFrameWidth
Definition: ApplicationWindow.h:980
ConfigDialog::boxSeparatorPreview
QLabel * boxSeparatorPreview
Definition: ConfigDialog.h:153
ConfigDialog::numbersFont
QFont numbersFont
Definition: ConfigDialog.h:130
ConfigDialog::buttonTitleFont
QPushButton * buttonTitleFont
Definition: ConfigDialog.h:145
ApplicationWindow::fit_scale_errors
bool fit_scale_errors
Scale the errors output in fit operations with reduced chi^2.
Definition: ApplicationWindow.h:939
ConfigDialog::pickHeaderColor
void pickHeaderColor()
Definition: ConfigDialog.cpp:1271
ConfigDialog::legendFont
QFont legendFont
Definition: ConfigDialog.h:130
ConfigDialog::boxAntialiasing
QCheckBox * boxAntialiasing
Definition: ConfigDialog.h:176
ConfigDialog::lblLanguage
QLabel * lblLanguage
Definition: ConfigDialog.h:161
ConfigDialog::itemsList
QListWidget * itemsList
Definition: ConfigDialog.h:160
ApplicationWindow::plotTitleFont
QFont plotTitleFont
Definition: ApplicationWindow.h:989
ConfigDialog::lblPanels
QLabel * lblPanels
Definition: ConfigDialog.h:161
ApplicationWindow::generatePeakCurves
bool generatePeakCurves
Definition: ApplicationWindow.h:933
ConfigDialog::boxDefaultNumericFormat
QComboBox * boxDefaultNumericFormat
Definition: ConfigDialog.h:152
ConfigDialog::boxLineWidth
QSpinBox * boxLineWidth
Definition: ConfigDialog.h:156
ConfigDialog::pickTitleFont
void pickTitleFont()
Definition: ConfigDialog.cpp:1335
ConfigDialog::lblHeaderColor
QLabel * lblHeaderColor
Definition: ConfigDialog.h:165
ApplicationWindow::autoscale2DPlots
bool autoscale2DPlots
Definition: ApplicationWindow.h:979
ConfigDialog::lblFonts
QLabel * lblFonts
Definition: ConfigDialog.h:162
ApplicationWindow::setPlot3DOptions
void setPlot3DOptions()
Definition: ApplicationWindow.cpp:10431
ApplicationWindow::autoResizeLayers
bool autoResizeLayers
Definition: ApplicationWindow.h:973
ApplicationWindow::showPlot3DProjection
bool showPlot3DProjection
Definition: ApplicationWindow.h:997
ApplicationWindow::plotNumbersFont
QFont plotNumbersFont
Definition: ApplicationWindow.h:989
ScriptingLangManager::languages
static QStringList languages()
Return the names of available implementations.
Definition: Script.cpp:82
ConfigDialog::buttonNumbersFont
QPushButton * buttonNumbersFont
Definition: ConfigDialog.h:145
ApplicationWindow::axesLineWidth
int axesLineWidth
Definition: ApplicationWindow.h:980
ConfigDialog::axesFont
QFont axesFont
Definition: ConfigDialog.h:130
ConfigDialog::pick3DLabelsColor
void pick3DLabelsColor()
Definition: ConfigDialog.cpp:1446
ConfigDialog::lblResolution
QLabel * lblResolution
Definition: ConfigDialog.h:166
ConfigDialog::labelFrameWidth
QLabel * labelFrameWidth
Definition: ConfigDialog.h:161
ApplicationWindow::smooth3DMesh
bool smooth3DMesh
Definition: ApplicationWindow.h:973
ConfigDialog::pickNumbersFont
void pickNumbersFont()
Definition: ConfigDialog.cpp:1324
ConfigDialog::btnWorkspace
ColorButton * btnWorkspace
Definition: ConfigDialog.h:159
ConfigDialog::initPlotsPage
void initPlotsPage()
Definition: ConfigDialog.cpp:245
ApplicationWindow::peakCurvesColor
QColor peakCurvesColor
Definition: ApplicationWindow.h:934
ApplicationWindow::appLanguage
QString appLanguage
Definition: ApplicationWindow.h:991
ConfigDialog::plot3DAxesFont
QFont plot3DAxesFont
Definition: ConfigDialog.h:131
ConfigDialog::boxNotes
QCheckBox * boxNotes
Definition: ConfigDialog.h:147
ConfigDialog::boxDecimalSeparator
QComboBox * boxDecimalSeparator
Definition: ConfigDialog.h:150
ApplicationWindow::d_print_cropmarks
bool d_print_cropmarks
Definition: ApplicationWindow.h:926
ConfigDialog::boxScaleFonts
QCheckBox * boxScaleFonts
Definition: ConfigDialog.h:149
ConfigDialog::initCurvesPage
void initCurvesPage()
Definition: ConfigDialog.cpp:735
ConfigDialog::lblCurveStyle
QLabel * lblCurveStyle
Definition: ConfigDialog.h:166
Graph::VerticalSteps
@ VerticalSteps
Definition: Graph.h:131
ApplicationWindow::antialiasing2DPlots
bool antialiasing2DPlots
Definition: ApplicationWindow.h:979
ApplicationWindow::tableBkgdColor
QColor tableBkgdColor
Definition: ApplicationWindow.h:990
ApplicationWindow.h
ConfigDialog::lblUndoLimit
QLabel * lblUndoLimit
Definition: ConfigDialog.h:169
ConfigDialog::pickDataMinColor
void pickDataMinColor()
Definition: ConfigDialog.cpp:1392
ConfigDialog::plot3DNumbersFont
QFont plot3DNumbersFont
Definition: ConfigDialog.h:131
ConfigDialog::pick3DAxesColor
void pick3DAxesColor()
Definition: ConfigDialog.cpp:1428
ConfigDialog::plotOptions
QWidget * plotOptions
Definition: ConfigDialog.h:143
ConfigDialog::plotLabelBox
QCheckBox * plotLabelBox
Definition: ConfigDialog.h:146
ApplicationWindow::d_scale_plots_on_print
bool d_scale_plots_on_print
Definition: ApplicationWindow.h:926
ApplicationWindow::showPlot3DLegend
bool showPlot3DLegend
Definition: ApplicationWindow.h:997
ApplicationWindow::d_decimal_digits
int d_decimal_digits
default precision to be used for all other operations than fitting
Definition: ApplicationWindow.h:956
ConfigDialog::pickPanelsColor
void pickPanelsColor()
Definition: ConfigDialog.cpp:1365
Graph::LineSymbols
@ LineSymbols
Definition: Graph.h:129
ConfigDialog::appFont
QFont appFont
Definition: ConfigDialog.h:130
ApplicationWindow::d_default_numeric_format
char d_default_numeric_format
Definition: ApplicationWindow.h:958
ConfigDialog::accept
void accept()
Definition: ConfigDialog.cpp:1048
ConfigDialog::pickWorkspaceColor
void pickWorkspaceColor()
Definition: ConfigDialog.cpp:1374
ConfigDialog::logBox
QCheckBox * logBox
Definition: ConfigDialog.h:146
ConfigDialog::boxCurveLineWidth
QSpinBox * boxCurveLineWidth
Definition: ConfigDialog.h:157
ConfigDialog::pickLegendFont
void pickLegendFont()
Definition: ConfigDialog.cpp:1302
ConfigDialog::btnLabelsFnt
QPushButton * btnLabelsFnt
Definition: ConfigDialog.h:138
ConfigDialog::btnBackground3D
QPushButton * btnBackground3D
Definition: ConfigDialog.h:136
Graph::VerticalBars
@ VerticalBars
Definition: Graph.h:129
ApplicationWindow::updateConfirmOptions
void updateConfirmOptions(bool askTables, bool askMatrixes, bool askPlots2D, bool askPlots3D, bool askNotes)
Definition: ApplicationWindow.cpp:3116
ConfigDialog::lblMinTicksLength
QLabel * lblMinTicksLength
Definition: ConfigDialog.h:168
ColorButton::setColor
void setColor(const QColor &c)
Set the color of the display part.
Definition: ColorButton.cpp:132
ApplicationWindow::confirmClosePlot2D
bool confirmClosePlot2D
Definition: ApplicationWindow.h:977
ConfigDialog::boxFolders
QCheckBox * boxFolders
Definition: ConfigDialog.h:147