@ -23,19 +23,19 @@
# include <klineedit.h>
# include <kpushbutton.h>
# include <kcombobox.h>
# include < qlabel.h>
# include < t qlabel.h>
# include <klocale.h>
# include < qcheckbox.h>
# include < qradiobutton.h>
# include < qbuttongroup.h>
# include < qspinbox.h>
# include < t qcheckbox.h>
# include < t qradiobutton.h>
# include < t qbuttongroup.h>
# include < t qspinbox.h>
# include <kmessagebox.h>
# include < qlayout.h>
# include < t qlayout.h>
# include <ktextedit.h>
# include <klistview.h>
# include <kdeversion.h>
# if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2
# include < qtabwidget.h>
# include < t qtabwidget.h>
# else
# include <ktabwidget.h>
# endif
@ -46,22 +46,22 @@
extern PlotLegendPlacement default_plot_legend_placement ;
extern bool default_plot_display_grid ;
extern bool default_plot_full_border ;
extern QString default_plot_min ;
extern QString default_plot_max ;
extern QString default_plot_step ;
extern T QString default_plot_min ;
extern T QString default_plot_max ;
extern T QString default_plot_step ;
extern int default_plot_sampling_rate ;
extern bool default_plot_use_sampling_rate ;
extern bool default_plot_rows ;
extern int default_plot_type ;
extern PlotStyle default_plot_style ;
extern PlotSmoothing default_plot_smoothing ;
extern QString default_plot_variable ;
extern T QString default_plot_variable ;
extern bool default_plot_color ;
extern bool enable_plot_expression_completion ;
extern EvaluationOptions evalops ;
QalculatePlotDialog : : QalculatePlotDialog ( QWidget * parent , const char * name ) : KDialogBase ( parent , name , false , i18n ( " Plot " ) , User1 | Close | Help , Close , false , KStdGuiItem : : save ( ) ) {
QalculatePlotDialog : : QalculatePlotDialog ( T QWidget * parent , const char * name ) : KDialogBase ( parent , name , false , i18n ( " Plot " ) , User1 | Close | Help , Close , false , KStdGuiItem : : save ( ) ) {
actionButton ( Close ) - > setAutoDefault ( false ) ;
actionButton ( Close ) - > setDefault ( false ) ;
@ -71,46 +71,46 @@ QalculatePlotDialog::QalculatePlotDialog(QWidget *parent, const char *name) : KD
actionButton ( User1 ) - > setEnabled ( false ) ;
# if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2
tabs = new QTabWidget( this ) ;
tabs = new T QTabWidget( this ) ;
# else
tabs = new KTabWidget ( this ) ;
# endif
setMainWidget ( tabs ) ;
QWidget * page1 = new QWidget( this ) ;
QWidget * page2 = new QWidget( this ) ;
QWidget * page3 = new QWidget( this ) ;
T QWidget * page1 = new T QWidget( this ) ;
T QWidget * page2 = new T QWidget( this ) ;
T QWidget * page3 = new T QWidget( this ) ;
tabs - > addTab ( page1 , i18n ( " Data " ) ) ;
tabs - > addTab ( page2 , i18n ( " Function Range " ) ) ;
tabs - > addTab ( page3 , i18n ( " Appearance " ) ) ;
QGridLayout * grid = new QGridLayout( page1 , 1 , 1 , spacingHint ( ) ) ;
grid - > addWidget ( new QLabel( i18n ( " Title: " ) , page1 ) , 0 , 0 ) ;
T QGridLayout * grid = new T QGridLayout( page1 , 1 , 1 , spacingHint ( ) ) ;
grid - > addWidget ( new T QLabel( i18n ( " Title: " ) , page1 ) , 0 , 0 ) ;
seriesTitleEdit = new KLineEdit ( page1 ) ;
grid - > addWidget ( seriesTitleEdit , 0 , 1 ) ;
grid - > addWidget ( new QLabel( i18n ( " Expression: " ) , page1 ) , 1 , 0 ) ;
grid - > addWidget ( new T QLabel( i18n ( " Expression: " ) , page1 ) , 1 , 0 ) ;
expressionEdit = new QalculateExpressionEdit ( false , page1 ) ;
if ( ! enable_plot_expression_completion ) expressionEdit - > disableCompletion ( ) ;
expressionEdit - > updateCompletion ( ) ;
grid - > addWidget ( expressionEdit , 1 , 1 ) ;
QHBoxLayout * hbox = new QHBoxLayout( 0 , 0 , spacingHint ( ) ) ;
T QHBoxLayout * hbox = new T QHBoxLayout( 0 , 0 , spacingHint ( ) ) ;
grid - > addMultiCellLayout ( hbox , 2 , 2 , 0 , 1 ) ;
hbox - > addItem ( new QSpacerItem( 0 , 0 , QSizePolicy: : Expanding , QSizePolicy: : Minimum ) ) ;
typeGroup = new QButtonGroup( ) ;
functionButton = new QRadioButton( i18n ( " Function " ) , page1 ) ;
hbox - > addItem ( new T QSpacerItem( 0 , 0 , T QSizePolicy: : Expanding , T QSizePolicy: : Minimum ) ) ;
typeGroup = new T QButtonGroup( ) ;
functionButton = new T QRadioButton( i18n ( " Function " ) , page1 ) ;
typeGroup - > insert ( functionButton , 0 ) ;
hbox - > addWidget ( functionButton ) ;
vectorMatrixButton = new QRadioButton( i18n ( " Vector/matrix " ) , page1 ) ;
vectorMatrixButton = new T QRadioButton( i18n ( " Vector/matrix " ) , page1 ) ;
typeGroup - > insert ( vectorMatrixButton , 1 ) ;
hbox - > addWidget ( vectorMatrixButton ) ;
pairedMatrixButton = new QRadioButton( i18n ( " Paired matrix " ) , page1 ) ;
pairedMatrixButton = new T QRadioButton( i18n ( " Paired matrix " ) , page1 ) ;
typeGroup - > insert ( pairedMatrixButton , 2 ) ;
hbox - > addWidget ( pairedMatrixButton ) ;
rowsButton = new QCheckBox( i18n ( " Rows " ) , page1 ) ;
rowsButton = new T QCheckBox( i18n ( " Rows " ) , page1 ) ;
hbox - > addWidget ( rowsButton ) ;
xVariableLabel = new QLabel( i18n ( " X variable: " ) , page1 ) ;
xVariableLabel = new T QLabel( i18n ( " X variable: " ) , page1 ) ;
grid - > addWidget ( xVariableLabel , 3 , 0 ) ;
xVariableEdit = new KLineEdit ( page1 ) ;
grid - > addWidget ( xVariableEdit , 3 , 1 ) ;
grid - > addWidget ( new QLabel( i18n ( " Style: " ) , page1 ) , 4 , 0 ) ;
grid - > addWidget ( new T QLabel( i18n ( " Style: " ) , page1 ) , 4 , 0 ) ;
styleCombo = new KComboBox ( page1 ) ;
styleCombo - > insertItem ( i18n ( " Line " ) ) ;
styleCombo - > insertItem ( i18n ( " Points " ) ) ;
@ -121,7 +121,7 @@ QalculatePlotDialog::QalculatePlotDialog(QWidget *parent, const char *name) : KD
styleCombo - > insertItem ( i18n ( " Candlesticks " ) ) ;
styleCombo - > insertItem ( i18n ( " Dots " ) ) ;
grid - > addWidget ( styleCombo , 4 , 1 ) ;
grid - > addWidget ( new QLabel( i18n ( " Smoothing: " ) , page1 ) , 5 , 0 ) ;
grid - > addWidget ( new T QLabel( i18n ( " Smoothing: " ) , page1 ) , 5 , 0 ) ;
smoothingCombo = new KComboBox ( page1 ) ;
smoothingCombo - > insertItem ( i18n ( " None " ) ) ;
smoothingCombo - > insertItem ( i18n ( " Monotonic " ) ) ;
@ -129,25 +129,25 @@ QalculatePlotDialog::QalculatePlotDialog(QWidget *parent, const char *name) : KD
smoothingCombo - > insertItem ( i18n ( " Bezier " ) ) ;
smoothingCombo - > insertItem ( i18n ( " Bezier (monotonic) " ) ) ;
grid - > addWidget ( smoothingCombo , 5 , 1 ) ;
grid - > addWidget ( new QLabel( i18n ( " Y-axis: " ) , page1 ) , 6 , 0 ) ;
hbox = new QHBoxLayout( 0 , 0 , spacingHint ( ) ) ;
grid - > addWidget ( new T QLabel( i18n ( " Y-axis: " ) , page1 ) , 6 , 0 ) ;
hbox = new T QHBoxLayout( 0 , 0 , spacingHint ( ) ) ;
grid - > addLayout ( hbox , 6 , 1 ) ;
QButtonGroup * group = new QButtonGroup( ) ;
primaryButton = new QRadioButton( i18n ( " Primary " ) , page1 ) ;
T QButtonGroup * group = new T QButtonGroup( ) ;
primaryButton = new T QRadioButton( i18n ( " Primary " ) , page1 ) ;
group - > insert ( primaryButton , 0 ) ;
hbox - > addWidget ( primaryButton ) ;
secondaryButton = new QRadioButton( i18n ( " Secondary " ) , page1 ) ;
secondaryButton = new T QRadioButton( i18n ( " Secondary " ) , page1 ) ;
group - > insert ( secondaryButton , 1 ) ;
hbox - > addWidget ( secondaryButton ) ;
hbox - > addItem ( new QSpacerItem( 0 , 0 , QSizePolicy: : Expanding , QSizePolicy: : Minimum ) ) ;
hbox = new QHBoxLayout( 0 , 0 , spacingHint ( ) ) ;
hbox - > addItem ( new T QSpacerItem( 0 , 0 , T QSizePolicy: : Expanding , T QSizePolicy: : Minimum ) ) ;
hbox = new T QHBoxLayout( 0 , 0 , spacingHint ( ) ) ;
grid - > addMultiCellLayout ( hbox , 7 , 7 , 0 , 1 ) ;
hbox - > addItem ( new QSpacerItem( 0 , 0 , QSizePolicy: : Expanding , QSizePolicy: : Minimum ) ) ;
addButton = new QPushButton( i18n ( " Add " ) , page1 ) ;
hbox - > addItem ( new T QSpacerItem( 0 , 0 , T QSizePolicy: : Expanding , T QSizePolicy: : Minimum ) ) ;
addButton = new T QPushButton( i18n ( " Add " ) , page1 ) ;
hbox - > addWidget ( addButton ) ;
modifyButton = new QPushButton( i18n ( " Modify " ) , page1 ) ;
modifyButton = new T QPushButton( i18n ( " Modify " ) , page1 ) ;
hbox - > addWidget ( modifyButton ) ;
removeButton = new QPushButton( i18n ( " Remove " ) , page1 ) ;
removeButton = new T QPushButton( i18n ( " Remove " ) , page1 ) ;
hbox - > addWidget ( removeButton ) ;
seriesView = new KListView ( page1 ) ;
seriesView - > addColumn ( i18n ( " Title " ) ) ;
@ -160,68 +160,68 @@ QalculatePlotDialog::QalculatePlotDialog(QWidget *parent, const char *name) : KD
seriesView - > setSorting ( - 1 ) ;
grid - > addMultiCellWidget ( seriesView , 8 , 8 , 0 , 1 ) ;
grid = new QGridLayout( page2 , 1 , 1 , spacingHint ( ) ) ;
grid - > addWidget ( new QLabel( i18n ( " Min: " ) , page2 ) , 0 , 0 ) ;
grid = new T QGridLayout( page2 , 1 , 1 , spacingHint ( ) ) ;
grid - > addWidget ( new T QLabel( i18n ( " Min: " ) , page2 ) , 0 , 0 ) ;
minEdit = new KLineEdit ( page2 ) ;
grid - > addWidget ( minEdit , 0 , 1 ) ;
grid - > addWidget ( new QLabel( i18n ( " Max: " ) , page2 ) , 1 , 0 ) ;
grid - > addWidget ( new T QLabel( i18n ( " Max: " ) , page2 ) , 1 , 0 ) ;
maxEdit = new KLineEdit ( page2 ) ;
grid - > addWidget ( maxEdit , 1 , 1 ) ;
rangeGroup = new QButtonGroup( ) ;
samplingRateButton = new QRadioButton( i18n ( " Sampling rate: " ) , page2 ) ;
rangeGroup = new T QButtonGroup( ) ;
samplingRateButton = new T QRadioButton( i18n ( " Sampling rate: " ) , page2 ) ;
rangeGroup - > insert ( samplingRateButton , 0 ) ;
grid - > addWidget ( samplingRateButton , 2 , 0 ) ;
samplingRateBox = new QSpinBox( 1 , 10000 , 10 , page2 ) ;
samplingRateBox = new T QSpinBox( 1 , 10000 , 10 , page2 ) ;
grid - > addWidget ( samplingRateBox , 2 , 1 ) ;
stepSizeButton = new QRadioButton( i18n ( " Step size: " ) , page2 ) ;
stepSizeButton = new T QRadioButton( i18n ( " Step size: " ) , page2 ) ;
rangeGroup - > insert ( stepSizeButton , 1 ) ;
grid - > addWidget ( stepSizeButton , 3 , 0 ) ;
stepSizeEdit = new KLineEdit ( page2 ) ;
grid - > addWidget ( stepSizeEdit , 3 , 1 ) ;
hbox = new QHBoxLayout( 0 , 0 , spacingHint ( ) ) ;
hbox = new T QHBoxLayout( 0 , 0 , spacingHint ( ) ) ;
grid - > addMultiCellLayout ( hbox , 4 , 4 , 0 , 1 ) ;
hbox - > addItem ( new QSpacerItem( 0 , 0 , QSizePolicy: : Expanding , QSizePolicy: : Minimum ) ) ;
hbox - > addItem ( new T QSpacerItem( 0 , 0 , T QSizePolicy: : Expanding , T QSizePolicy: : Minimum ) ) ;
applyRangeButton = new KPushButton ( KStdGuiItem : : apply ( ) , page2 ) ;
hbox - > addWidget ( applyRangeButton ) ;
grid - > addItem ( new QSpacerItem( 0 , 0 , QSizePolicy: : Minimum , QSizePolicy: : Expanding ) , 5 , 0 ) ;
grid - > addItem ( new T QSpacerItem( 0 , 0 , T QSizePolicy: : Minimum , T QSizePolicy: : Expanding ) , 5 , 0 ) ;
grid = new QGridLayout( page3 , 1 , 1 , spacingHint ( ) ) ;
grid - > addWidget ( new QLabel( i18n ( " Title: " ) , page3 ) , 0 , 0 ) ;
grid = new T QGridLayout( page3 , 1 , 1 , spacingHint ( ) ) ;
grid - > addWidget ( new T QLabel( i18n ( " Title: " ) , page3 ) , 0 , 0 ) ;
titleEdit = new KLineEdit ( page3 ) ;
grid - > addWidget ( titleEdit , 0 , 1 ) ;
hbox = new QHBoxLayout( 0 , 0 , spacingHint ( ) ) ;
hbox = new T QHBoxLayout( 0 , 0 , spacingHint ( ) ) ;
grid - > addMultiCellLayout ( hbox , 1 , 1 , 0 , 1 ) ;
gridButton = new QCheckBox( i18n ( " Display grid " ) , page3 ) ;
gridButton = new T QCheckBox( i18n ( " Display grid " ) , page3 ) ;
hbox - > addWidget ( gridButton ) ;
fullBorderButton = new QCheckBox( i18n ( " Display full border " ) , page3 ) ;
fullBorderButton = new T QCheckBox( i18n ( " Display full border " ) , page3 ) ;
hbox - > addWidget ( fullBorderButton ) ;
hbox - > addItem ( new QSpacerItem( 0 , 0 , QSizePolicy: : Expanding , QSizePolicy: : Minimum ) ) ;
logXButton = new QCheckBox( i18n ( " Logarithmic x scale: " ) , page3 ) ;
hbox - > addItem ( new T QSpacerItem( 0 , 0 , T QSizePolicy: : Expanding , T QSizePolicy: : Minimum ) ) ;
logXButton = new T QCheckBox( i18n ( " Logarithmic x scale: " ) , page3 ) ;
grid - > addWidget ( logXButton , 2 , 0 ) ;
logXBox = new QSpinBox( 2 , 100 , 1 , page3 ) ;
logXBox = new T QSpinBox( 2 , 100 , 1 , page3 ) ;
grid - > addWidget ( logXBox , 2 , 1 ) ;
logYButton = new QCheckBox( i18n ( " Logarithmic y scale: " ) , page3 ) ;
logYButton = new T QCheckBox( i18n ( " Logarithmic y scale: " ) , page3 ) ;
grid - > addWidget ( logYButton , 3 , 0 ) ;
logYBox = new QSpinBox( 2 , 100 , 1 , page3 ) ;
logYBox = new T QSpinBox( 2 , 100 , 1 , page3 ) ;
grid - > addWidget ( logYBox , 3 , 1 ) ;
grid - > addWidget ( new QLabel( i18n ( " X-axis label: " ) , page3 ) , 4 , 0 ) ;
grid - > addWidget ( new T QLabel( i18n ( " X-axis label: " ) , page3 ) , 4 , 0 ) ;
xLabelEdit = new KLineEdit ( page3 ) ;
grid - > addWidget ( xLabelEdit , 4 , 1 ) ;
grid - > addWidget ( new QLabel( i18n ( " Y-axis label: " ) , page3 ) , 5 , 0 ) ;
grid - > addWidget ( new T QLabel( i18n ( " Y-axis label: " ) , page3 ) , 5 , 0 ) ;
yLabelEdit = new KLineEdit ( page3 ) ;
grid - > addWidget ( yLabelEdit , 5 , 1 ) ;
grid - > addWidget ( new QLabel( i18n ( " Color display: " ) , page3 ) , 6 , 0 ) ;
hbox = new QHBoxLayout( 0 , 0 , spacingHint ( ) ) ;
grid - > addWidget ( new T QLabel( i18n ( " Color display: " ) , page3 ) , 6 , 0 ) ;
hbox = new T QHBoxLayout( 0 , 0 , spacingHint ( ) ) ;
grid - > addLayout ( hbox , 6 , 1 ) ;
group = new QButtonGroup( ) ;
colorButton = new QRadioButton( i18n ( " Color " ) , page3 ) ;
group = new T QButtonGroup( ) ;
colorButton = new T QRadioButton( i18n ( " Color " ) , page3 ) ;
group - > insert ( colorButton , 0 ) ;
hbox - > addWidget ( colorButton ) ;
monochromeButton = new QRadioButton( i18n ( " Monochrome " ) , page3 ) ;
monochromeButton = new T QRadioButton( i18n ( " Monochrome " ) , page3 ) ;
group - > insert ( monochromeButton , 1 ) ;
hbox - > addWidget ( monochromeButton ) ;
hbox - > addItem ( new QSpacerItem( 0 , 0 , QSizePolicy: : Expanding , QSizePolicy: : Minimum ) ) ;
grid - > addWidget ( new QLabel( i18n ( " Legend placement: " ) , page3 ) , 7 , 0 ) ;
hbox - > addItem ( new T QSpacerItem( 0 , 0 , T QSizePolicy: : Expanding , T QSizePolicy: : Minimum ) ) ;
grid - > addWidget ( new T QLabel( i18n ( " Legend placement: " ) , page3 ) , 7 , 0 ) ;
legendPlacementCombo = new KComboBox ( page3 ) ;
legendPlacementCombo - > insertItem ( i18n ( " Hide " ) ) ;
legendPlacementCombo - > insertItem ( i18n ( " Top-left " ) ) ;
@ -231,12 +231,12 @@ QalculatePlotDialog::QalculatePlotDialog(QWidget *parent, const char *name) : KD
legendPlacementCombo - > insertItem ( i18n ( " Below " ) ) ;
legendPlacementCombo - > insertItem ( i18n ( " Outside " ) ) ;
grid - > addWidget ( legendPlacementCombo , 7 , 1 ) ;
hbox = new QHBoxLayout( 0 , 0 , spacingHint ( ) ) ;
hbox = new T QHBoxLayout( 0 , 0 , spacingHint ( ) ) ;
grid - > addMultiCellLayout ( hbox , 8 , 8 , 0 , 1 ) ;
hbox - > addItem ( new QSpacerItem( 0 , 0 , QSizePolicy: : Expanding , QSizePolicy: : Minimum ) ) ;
hbox - > addItem ( new T QSpacerItem( 0 , 0 , T QSizePolicy: : Expanding , T QSizePolicy: : Minimum ) ) ;
applyAppearanceButton = new KPushButton ( KStdGuiItem : : apply ( ) , page3 ) ;
hbox - > addWidget ( applyAppearanceButton ) ;
grid - > addItem ( new QSpacerItem( 0 , 0 , QSizePolicy: : Minimum , QSizePolicy: : Expanding ) , 9 , 0 ) ;
grid - > addItem ( new T QSpacerItem( 0 , 0 , T QSizePolicy: : Minimum , T QSizePolicy: : Expanding ) , 9 , 0 ) ;
primaryButton - > setChecked ( true ) ;
modifyButton - > setEnabled ( false ) ;
@ -303,7 +303,7 @@ QalculatePlotDialog::QalculatePlotDialog(QWidget *parent, const char *name) : KD
connect ( applyRangeButton , SIGNAL ( clicked ( ) ) , this , SLOT ( applyRange ( ) ) ) ;
connect ( applyAppearanceButton , SIGNAL ( clicked ( ) ) , this , SLOT ( applyAppearance ( ) ) ) ;
connect ( seriesView , SIGNAL ( selectionChanged ( ) ) , this , SLOT ( seriesSelected ( ) ) ) ;
connect ( seriesView , SIGNAL ( itemRenamed ( QListViewItem* , const QString& , int ) ) , this , SLOT ( seriesItemRenamed ( QListViewItem* , const QString& , int ) ) ) ;
connect ( seriesView , SIGNAL ( itemRenamed ( T QListViewItem* , const T QString& , int ) ) , this , SLOT ( seriesItemRenamed ( T QListViewItem* , const T QString& , int ) ) ) ;
connect ( addButton , SIGNAL ( clicked ( ) ) , this , SLOT ( addSeries ( ) ) ) ;
connect ( modifyButton , SIGNAL ( clicked ( ) ) , this , SLOT ( modifySeries ( ) ) ) ;
connect ( removeButton , SIGNAL ( clicked ( ) ) , this , SLOT ( removeSeries ( ) ) ) ;
@ -372,7 +372,7 @@ void QalculatePlotDialog::onClosing() {
removeButton - > setEnabled ( false ) ;
actionButton ( User1 ) - > setEnabled ( false ) ;
QListViewItemIterator it ( seriesView ) ;
T QListViewItemIterator it ( seriesView ) ;
while ( it . current ( ) ) {
MathStructure * y_vector = itemYVector [ it . current ( ) ] , * x_vector = itemXVector [ it . current ( ) ] ;
if ( y_vector ) delete y_vector ;
@ -394,7 +394,7 @@ void QalculatePlotDialog::onClosing() {
CALCULATOR - > closeGnuplot ( ) ;
}
void QalculatePlotDialog : : seriesItemRenamed ( QListViewItem * i , const QString & str , int col ) {
void QalculatePlotDialog : : seriesItemRenamed ( T QListViewItem * i , const T QString & str , int col ) {
if ( ! i ) return ;
if ( col = = 0 ) {
updatePlot ( ) ;
@ -415,7 +415,7 @@ void QalculatePlotDialog::seriesItemRenamed(QListViewItem *i, const QString &str
seriesSelected ( ) ;
}
void QalculatePlotDialog : : seriesSelected ( ) {
QListViewItem * i = seriesView - > selectedItem ( ) ;
T QListViewItem * i = seriesView - > selectedItem ( ) ;
if ( i ) {
modifyButton - > setEnabled ( true ) ;
removeButton - > setEnabled ( true ) ;
@ -444,7 +444,7 @@ void QalculatePlotDialog::typeChanged(int i) {
xVariableLabel - > setEnabled ( i ! = 1 & & i ! = 2 ) ;
}
void QalculatePlotDialog : : expressionActivated ( ) {
QListViewItem * i = seriesView - > selectedItem ( ) ;
T QListViewItem * i = seriesView - > selectedItem ( ) ;
if ( i ) {
modifySeries ( ) ;
} else {
@ -452,7 +452,7 @@ void QalculatePlotDialog::expressionActivated() {
}
}
void QalculatePlotDialog : : addSeries ( ) {
QString expression = expressionEdit - > text ( ) ;
T QString expression = expressionEdit - > text ( ) ;
if ( expression . stripWhiteSpace ( ) . isEmpty ( ) ) {
expressionEdit - > setFocus ( ) ;
KMessageBox : : error ( this , i18n ( " Empty expression. " ) ) ;
@ -460,13 +460,13 @@ void QalculatePlotDialog::addSeries() {
}
int type = 0 , axis = 1 ;
bool rows = false ;
QString title = seriesTitleEdit - > text ( ) ;
T QString title = seriesTitleEdit - > text ( ) ;
if ( vectorMatrixButton - > isChecked ( ) ) {
type = 1 ;
} else if ( pairedMatrixButton - > isChecked ( ) ) {
type = 2 ;
}
QString str_x = xVariableEdit - > text ( ) . stripWhiteSpace ( ) ;
T QString str_x = xVariableEdit - > text ( ) . stripWhiteSpace ( ) ;
if ( str_x . isEmpty ( ) & & type = = 0 ) {
xVariableEdit - > setFocus ( ) ;
KMessageBox : : error ( this , i18n ( " Empty x variable. " ) ) ;
@ -485,7 +485,7 @@ void QalculatePlotDialog::addSeries() {
MathStructure * x_vector , * y_vector ;
generatePlotSeries ( & x_vector , & y_vector , type , expression . ascii ( ) , str_x . ascii ( ) ) ;
rows = rowsButton - > isChecked ( ) ;
QListViewItem * i = new KListViewItem ( seriesView , seriesView - > lastChild ( ) , title , expression ) ;
T QListViewItem * i = new KListViewItem ( seriesView , seriesView - > lastChild ( ) , title , expression ) ;
itemStyle [ i ] = styleCombo - > currentItem ( ) ;
itemSmoothing [ i ] = smoothingCombo - > currentItem ( ) ;
itemType [ i ] = type ;
@ -498,22 +498,22 @@ void QalculatePlotDialog::addSeries() {
updatePlot ( ) ;
}
void QalculatePlotDialog : : modifySeries ( ) {
QListViewItem * i = seriesView - > selectedItem ( ) ;
T QListViewItem * i = seriesView - > selectedItem ( ) ;
if ( i ) {
QString expression = expressionEdit - > text ( ) ;
T QString expression = expressionEdit - > text ( ) ;
if ( expression . stripWhiteSpace ( ) . isEmpty ( ) ) {
expressionEdit - > setFocus ( ) ;
KMessageBox : : error ( this , i18n ( " Empty expression. " ) ) ;
return ;
}
int type = 0 , axis = 1 ;
QString title = seriesTitleEdit - > text ( ) ;
T QString title = seriesTitleEdit - > text ( ) ;
if ( vectorMatrixButton - > isChecked ( ) ) {
type = 1 ;
} else if ( pairedMatrixButton - > isChecked ( ) ) {
type = 2 ;
}
QString str_x = xVariableEdit - > text ( ) . stripWhiteSpace ( ) ;
T QString str_x = xVariableEdit - > text ( ) . stripWhiteSpace ( ) ;
if ( str_x . isEmpty ( ) & & type = = 0 ) {
xVariableEdit - > setFocus ( ) ;
KMessageBox : : error ( this , i18n ( " Empty x variable. " ) ) ;
@ -549,7 +549,7 @@ void QalculatePlotDialog::modifySeries() {
}
}
void QalculatePlotDialog : : removeSeries ( ) {
QListViewItem * i = seriesView - > selectedItem ( ) ;
T QListViewItem * i = seriesView - > selectedItem ( ) ;
if ( i ) {
MathStructure * x_vector = itemXVector [ i ] , * y_vector = itemYVector [ i ] ;
if ( x_vector ) delete x_vector ;
@ -569,7 +569,7 @@ void QalculatePlotDialog::removeSeries() {
}
}
void QalculatePlotDialog : : applyRange ( ) {
QListViewItemIterator it ( seriesView ) ;
T QListViewItemIterator it ( seriesView ) ;
while ( it . current ( ) ) {
MathStructure * x_vector = itemXVector [ it . current ( ) ] , * y_vector = itemYVector [ it . current ( ) ] ;
if ( y_vector ) delete y_vector ;
@ -588,13 +588,13 @@ void QalculatePlotDialog::applyAppearance() {
}
bool QalculatePlotDialog : : generatePlot ( PlotParameters & pp , vector < MathStructure > & y_vectors , vector < MathStructure > & x_vectors , vector < PlotDataParameters * > & pdps ) {
QListViewItemIterator it ( seriesView ) ;
T QListViewItemIterator it ( seriesView ) ;
if ( ! it . current ( ) ) {
return false ;
}
while ( it . current ( ) ) {
int count = 1 ;
QString title = it . current ( ) - > text ( 0 ) , expression = it . current ( ) - > text ( 1 ) ;
T QString title = it . current ( ) - > text ( 0 ) , expression = it . current ( ) - > text ( 1 ) ;
int style = itemStyle [ it . current ( ) ] ;
int smoothing = itemSmoothing [ it . current ( ) ] ;
int type = itemType [ it . current ( ) ] ;
@ -715,19 +715,19 @@ bool QalculatePlotDialog::generatePlot(PlotParameters &pp, vector<MathStructure>
return true ;
}
void QalculatePlotDialog : : savePlot ( ) {
QString title = titleEdit - > text ( ) . ascii ( ) ;
T QString title = titleEdit - > text ( ) . ascii ( ) ;
if ( title . isEmpty ( ) ) {
title = " plot.png " ;
} else {
title + = " .png " ;
}
QString filename ;
T QString filename ;
while ( true ) {
filename = KFileDialog : : getSaveFileName ( title , " image/png image/svg application/postscript image/x-eps /text/x-tex image/x-xfig " , this , i18n ( " Save Image " ) ) ;
if ( filename . isEmpty ( ) ) {
return ;
} else {
if ( QFile: : exists ( filename ) ) {
if ( T QFile: : exists ( filename ) ) {
if ( KMessageBox : : warningContinueCancel ( this , i18n ( " A file named \" %1 \" already exists. Are you sure you want to overwrite it? " ) . arg ( filename ) , i18n ( " Overwrite File? " ) , i18n ( " &Overwrite " ) ) ! = KMessageBox : : Cancel ) {
break ;
}