Commit 931fba08 authored by David Saxton's avatar David Saxton

More Qt4 porting - now Qt3-class-free; only Qt3 support members remain.

svn path=/trunk/KDE/kdeedu/kmplot/; revision=522846
parent 189ef179
......@@ -6,48 +6,53 @@
<version>$VERSION$</version>
<projectmanagement>KDevCustomProject</projectmanagement>
<primarylanguage>C</primarylanguage>
<ignoreparts/>
<ignoreparts>
<part>kdevrbdebugger</part>
</ignoreparts>
<projectdirectory>.</projectdirectory>
<absoluteprojectpath>false</absoluteprojectpath>
<description/>
<description></description>
<secondaryLanguages>
<language>C++</language>
</secondaryLanguages>
<versioncontrol></versioncontrol>
</general>
<kdevcustomproject>
<run>
<mainprogram>kmplot/kmplot</mainprogram>
<directoryradio>executable</directoryradio>
<customdirectory>/</customdirectory>
<programargs/>
<programargs></programargs>
<terminal>false</terminal>
<autocompile>true</autocompile>
<envvars/>
</run>
<build>
<buildtool>make</buildtool>
<builddir/>
<builddir></builddir>
</build>
<make>
<abortonerror>false</abortonerror>
<numberofjobs>1</numberofjobs>
<dontact>false</dontact>
<makebin/>
<makebin></makebin>
<selectedenvironment>default</selectedenvironment>
<environments>
<default/>
</environments>
<makeoptions/>
<makeoptions></makeoptions>
<prio>0</prio>
<defaulttarget></defaulttarget>
</make>
</kdevcustomproject>
<kdevdebugger>
<general>
<dbgshell/>
<programargs/>
<gdbpath/>
<configGdbScript/>
<runShellScript/>
<runGdbScript/>
<dbgshell></dbgshell>
<programargs></programargs>
<gdbpath></gdbpath>
<configGdbScript></configGdbScript>
<runShellScript></runShellScript>
<runGdbScript></runGdbScript>
<breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty>
<floatingtoolbar>false</floatingtoolbar>
......@@ -120,10 +125,7 @@
</useglobaltypes>
</kdevfilecreate>
<kdevcppsupport>
<references>
<pcs>Qt</pcs>
<pcs>KDElibs</pcs>
</references>
<references/>
<codecompletion>
<includeGlobalFunctions>true</includeGlobalFunctions>
<includeTypes>true</includeTypes>
......@@ -136,12 +138,22 @@
<argumentsHintDelay>400</argumentsHintDelay>
<headerCompletionDelay>250</headerCompletionDelay>
</codecompletion>
<qt>
<used>false</used>
<version>3</version>
<root></root>
</qt>
<creategettersetter>
<prefixGet></prefixGet>
<prefixSet>set</prefixSet>
<prefixVariable>m_,_</prefixVariable>
<parameterName>theValue</parameterName>
<inlineGet>true</inlineGet>
<inlineSet>true</inlineSet>
</creategettersetter>
</kdevcppsupport>
<kdevfileview>
<groups>
<hidenonprojectfiles>false</hidenonprojectfiles>
<hidenonlocation>false</hidenonlocation>
</groups>
<groups/>
<tree>
<hidepatterns>*.o,*.lo,CVS,*.moc,*~</hidepatterns>
<hidenonprojectfiles>false</hidenonprojectfiles>
......@@ -153,4 +165,24 @@
<implementationsuffix>.cpp</implementationsuffix>
</filetemplates>
</cppsupportpart>
<kdevvisualadvance>
<emulator>VisualBoyAdvance</emulator>
<binary></binary>
<addOptions></addOptions>
<terminal>false</terminal>
<fullscreen>false</fullscreen>
<graphicFilter>-f0</graphicFilter>
<scaling>-1</scaling>
</kdevvisualadvance>
<kdevdocumentation>
<projectdoc>
<docsystem></docsystem>
<docurl></docurl>
<usermanualurl></usermanualurl>
</projectdoc>
</kdevdocumentation>
<ctagspart>
<customArguments></customArguments>
<customTagfilePath></customTagfilePath>
</ctagspart>
</kdevelop>
......@@ -2,6 +2,8 @@ SUBDIRS = kmplot icons
EXTRA_DIST = KmPlot.kdevelop KmPlot.kdevelop.filelist TODO
KDE_CXXFLAGS = -DQT3_SUPPORT_WARNINGS
AUTOMAKE_OPTIONS = foreign
include ../admin/Doxyfile.am
......@@ -35,7 +35,6 @@
#include <kpushbutton.h>
#include <qcursor.h>
#include <qtimer.h>
//Added by qt3to4:
#include <QShowEvent>
// locale includes
......@@ -147,7 +146,7 @@ void FktDlg::slotEdit()
int const id = getId( currentItem->text().section( ";", 0, 0) ) ;
// find out the function type
char const prefix = m_view->parser()->ufkt[ m_view->parser()->ixValue(id) ].fstr.at(0).latin1();
char const prefix = m_view->parser()->ufkt[ m_view->parser()->ixValue(id) ].fstr.at(0).toLatin1();
if ( prefix == 'r')
slotEditPolar( id );
......
......@@ -26,7 +26,6 @@
// Qt includes
#include <qslider.h>
//Added by qt3to4:
#include <QPixmap>
// KDE includes
......@@ -676,7 +675,7 @@ void MainDlg::loadConstants()
tmp.setNum(i);
QString tmp_constant = conf.readEntry("nameConstant"+tmp, QString(" "));
QString tmp_value = conf.readEntry("valueConstant"+tmp, QString(" "));
// kDebug() << "konstant: " << tmp_constant.latin1() << endl;
// kDebug() << "konstant: " << tmp_constant.toLatin1() << endl;
// kDebug() << "value: " << value << endl;
// kDebug() << "**************" << endl;
......@@ -686,7 +685,7 @@ void MainDlg::loadConstants()
if ( tmp_constant.isEmpty() )
continue;
char constant = tmp_constant[0].toUpper().latin1();
char constant = tmp_constant[0].toUpper().toLatin1();
if ( constant<'A' || constant>'Z')
{
......@@ -767,7 +766,7 @@ void MainDlg::toggleShowSliders()
connect( view->m_sliderWindow, SIGNAL( valueChanged() ), view, SLOT( drawPlot() ) );
connect( view->m_sliderWindow, SIGNAL( windowClosed() ), view, SLOT( slidersWindowClosed() ) );
}
if ( !view->m_sliderWindow->isShown() )
if ( !view->m_sliderWindow->isVisible() )
view->m_sliderWindow->show();
else
view->m_sliderWindow->hide();
......@@ -881,7 +880,7 @@ QWidget * QuickEditAction::createToolBarWidget( QToolBar * parent )
void QuickEditAction::destroyToolBarWidget( QWidget * widget )
{
m_lineEdits.remove( static_cast<KLineEdit*>(widget) );
m_lineEdits.removeAll( static_cast<KLineEdit*>(widget) );
widget->deleteLater();
}
......
# set the include path for X, qt and KDE
INCLUDES= $(all_includes)
KDE_CXXFLAGS = -DQT3_SUPPORT_WARNINGS
# these are the headers for your project
noinst_HEADERS = kmplot.h kmplotprogress.h MainDlg.h
......
......@@ -70,9 +70,9 @@ double View::xmin = 0;
double View::xmax = 0;
View::View(bool const r, bool &mo, KMenu *p, QWidget* parent, KActionCollection *ac, const char* name )
View::View(bool const r, bool &mo, KMenu *p, QWidget* parent, KActionCollection *ac )
: DCOPObject("View"),
QWidget( parent, name , Qt::WStaticContents ),
QWidget( parent, Qt::WStaticContents ),
dgr(this),
buffer( width(), height() ),
m_popupmenu(p),
......@@ -95,7 +95,7 @@ View::View(bool const r, bool &mo, KMenu *p, QWidget* parent, KActionCollection
csypos = 0.0;
rootflg = false;
tlgx = tlgy = drskalx = drskaly = 0.0;;
stepWidth = 0.0;
stepWidth = 0.1;
ymin = 0.0;;
ymax = 0.0;;
m_printHeaderTable = false;
......@@ -152,13 +152,13 @@ void View::draw(QPaintDevice *dev, int form)
lx=(int)((xmax-xmin)*100.*drskalx/tlgx);
ly=(int)((ymax-ymin)*100.*drskaly/tlgy);
DC.scale((float)h/(float)(ly+2*ref.y()), (float)h/(float)(ly+2*ref.y()));
if(DC.xForm(QPoint(lx+2*ref.x(), ly)).x() > DC.viewport().right())
if ( ( QPoint(lx+2*ref.x(), ly) * DC.matrix() ).x() > DC.viewport().right())
{
DC.resetXForm();
DC.resetMatrix();
DC.scale((float)w/(float)(lx+2*ref.x()), (float)w/(float)(lx+2*ref.x()));
}
wm=DC.worldMatrix();
s=DC.xForm(QPoint(1000, 0)).x()/1000.;
wm = DC.matrix();
s=( QPoint(1000, 0) * DC.matrix() ).x()/1000.;
dgr.Create( ref, lx, ly, xmin, xmax, ymin, ymax );
}
else if(form==1) // printer
......@@ -195,7 +195,7 @@ void View::draw(QPaintDevice *dev, int form)
ly=(int)((ymax-ymin)*100.*drskaly/tlgy);
dgr.Create( ref, lx, ly, xmin, xmax, ymin, ymax );
DC.end();
((QPixmap *)dev)->resize((int)(dgr.GetFrame().width()*sf), (int)(dgr.GetFrame().height()*sf));
*((QPixmap *)dev) = QPixmap( (int)(dgr.GetFrame().width()*sf), (int)(dgr.GetFrame().height()*sf) );
((QPixmap *)dev)->fill(backgroundcolor);
DC.begin(dev);
DC.translate(-dgr.GetFrame().left()*sf, -dgr.GetFrame().top()*sf);
......@@ -224,8 +224,9 @@ void View::draw(QPaintDevice *dev, int form)
dgr.Plot(&DC);
PlotArea=dgr.GetPlotArea();
area=DC.xForm(PlotArea);
area=DC.matrix().mapRect(PlotArea);
stepWidth=Settings::stepWidth();
assert( stepWidth != 0.0 );
isDrawing=true;
updateCursor();
......@@ -600,7 +601,8 @@ void View::setpi(QString *s)
int i;
QChar c(960);
while((i=s->find('p')) != -1) s->replace(i, 2, &c, 1);
while((i=s->indexOf('p')) != -1)
s->replace(i, 2, &c, 1);
}
......@@ -718,13 +720,13 @@ void View::resizeEvent(QResizeEvent *)
stop_calculating = true; //stop drawing
return;
}
buffer.resize(size() );
buffer = QPixmap( size() );
drawPlot();
}
void View::drawPlot()
{
if( m_minmax->isShown() )
if( m_minmax->isVisible() )
m_minmax->updateFunctions();
buffer.fill(backgroundcolor);
draw(&buffer, 0);
......@@ -760,7 +762,7 @@ void View::mouseMoveEvent(QMouseEvent *e)
return;
}
if( m_popupmenushown>0 && !m_popupmenu->isShown() )
if( m_popupmenushown>0 && !m_popupmenu->isVisible() )
{
if ( m_popupmenushown==1)
csmode=-1;
......@@ -1588,9 +1590,9 @@ void View::keyPressEvent( QKeyEvent * e)
QMouseEvent *event;
if (e->key() == Qt::Key_Left )
event = new QMouseEvent(QEvent::MouseMove,QPoint(int(fcx-1),int(fcy-1)),Qt::LeftButton,Qt::LeftButton);
event = new QMouseEvent( QEvent::MouseMove, QPoint( int(fcx-1), int(fcy-1) ), Qt::LeftButton, Qt::LeftButton, 0 );
else if (e->key() == Qt::Key_Right )
event = new QMouseEvent(QEvent::MouseMove,QPoint(int(fcx+1),int(fcy+1)),Qt::LeftButton,Qt::LeftButton);
event = new QMouseEvent( QEvent::MouseMove, QPoint( int(fcx+1), int(fcy+1) ), Qt::LeftButton, Qt::LeftButton, 0 );
else if (e->key() == Qt::Key_Up || e->key() == Qt::Key_Down) //switch graph in trace mode
{
QVector<Ufkt>::iterator it = &m_parser->ufkt[m_parser->ixValue(csmode)];
......@@ -1690,18 +1692,18 @@ void View::keyPressEvent( QKeyEvent * e)
break;
}
}
event = new QMouseEvent(QEvent::MouseMove,QPoint(int(fcx),int(fcy)),Qt::LeftButton,Qt::LeftButton);
event = new QMouseEvent( QEvent::MouseMove, QPoint( int(fcx), int(fcy) ), Qt::LeftButton, Qt::LeftButton, 0 );
}
else if ( e->key() == Qt::Key_Space )
{
event = new QMouseEvent(QEvent::MouseButtonPress,QCursor::pos(),Qt::RightButton,Qt::RightButton);
event = new QMouseEvent( QEvent::MouseButtonPress, QCursor::pos(), Qt::RightButton, Qt::RightButton, 0 );
mousePressEvent(event);
delete event;
return;
}
else
{
event = new QMouseEvent(QEvent::MouseButtonPress,QPoint(int(fcx),int(fcy)),Qt::LeftButton,Qt::LeftButton);
event = new QMouseEvent( QEvent::MouseButtonPress, QPoint( int(fcx), int(fcy) ), Qt::LeftButton, Qt::LeftButton, 0 );
mousePressEvent(event);
delete event;
return;
......@@ -1982,14 +1984,14 @@ void View::mnuHide_clicked()
if ( !ufkt->f_mode && !ufkt->f1_mode && !ufkt->f2_mode) //all graphs for the function are hidden
{
csmode=-1;
QMouseEvent *event = new QMouseEvent(QMouseEvent::KeyPress,QCursor::pos(),Qt::LeftButton,Qt::LeftButton);
QMouseEvent *event = new QMouseEvent( QMouseEvent::KeyPress, QCursor::pos(), Qt::LeftButton, Qt::LeftButton, 0 );
mousePressEvent(event); //leave trace mode
delete event;
return;
}
else
{
QKeyEvent *event = new QKeyEvent(QKeyEvent::KeyPress,Qt::Key_Up ,Qt::Key_Up ,0);
QKeyEvent *event = new QKeyEvent( QKeyEvent::KeyPress, Qt::Key_Up, 0 );
keyPressEvent(event); //change selected graph
delete event;
return;
......@@ -2010,7 +2012,7 @@ void View::mnuRemove_clicked()
if (csmode!=-1) // if trace mode is enabled
{
csmode=-1;
QMouseEvent *event = new QMouseEvent(QMouseEvent::KeyPress,QCursor::pos(),Qt::LeftButton,Qt::LeftButton);
QMouseEvent *event = new QMouseEvent( QMouseEvent::KeyPress, QCursor::pos(), Qt::LeftButton, Qt::LeftButton, 0 );
mousePressEvent(event); //leave trace mode
delete event;
}
......
......@@ -31,7 +31,6 @@
// Qt includes
#include <qpixmap.h>
#include <QPointer>
//Added by qt3to4:
#include <QMouseEvent>
#include <QResizeEvent>
#include <QKeyEvent>
......@@ -68,7 +67,7 @@ class View : public QWidget, virtual public ViewIface
Q_OBJECT
public:
/// Contructor sets up the parser, too.
View(bool, bool &, KMenu *, QWidget* parent, KActionCollection *ac, const char* name=NULL );
View(bool, bool &, KMenu *, QWidget* parent, KActionCollection *ac );
void setMinMaxDlg(KMinMax *);
virtual ~View();
......
......@@ -8,8 +8,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>346</width>
<height>534</height>
<width>394</width>
<height>558</height>
</rect>
</property>
<layout class="QVBoxLayout" >
......@@ -476,19 +476,16 @@
<number>6</number>
</property>
<item>
<widget class="Q3ButtonGroup" name="kcfg_GridStyle" >
<widget class="QGroupBox" name="kcfg_GridStyle" >
<property name="title" >
<string>Grid &amp;Style</string>
</property>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
<number>9</number>
</property>
<property name="spacing" >
<number>0</number>
<number>6</number>
</property>
<item>
<widget class="QRadioButton" name="radioButton11" >
......@@ -594,13 +591,6 @@
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<customwidgets>
<customwidget>
<class>Q3ButtonGroup</class>
<extends></extends>
<header>Qt3Support/Q3ButtonGroup</header>
<container>1</container>
<pixmap></pixmap>
</customwidget>
<customwidget>
<class>KLineEdit</class>
<extends></extends>
......
......@@ -67,7 +67,7 @@ EditFunction::EditFunction( XParser* parser, QWidget* parent, const char* name )
editintegralpage = new EditIntegralPage( page2 );
for( int number = 0; number < SLIDER_COUNT; number++ )
{
editfunctionpage->listOfSliders->insertItem( i18n( "Slider No. %1" ).arg( number +1) );
editfunctionpage->listOfSliders->addItem( i18n( "Slider No. %1" ).arg( number +1) );
}
connect( editfunctionpage->cmdParameter, SIGNAL ( clicked() ), this, SLOT( cmdParameter_clicked() ) );
m_updatedfunction = 0;
......@@ -140,7 +140,7 @@ void EditFunction::setWidgets()
else
{
editfunctionpage->useSlider->setChecked( true );
editfunctionpage->listOfSliders->setCurrentItem( ufkt->use_slider );
editfunctionpage->listOfSliders->setCurrentIndex( ufkt->use_slider );
}
editderivativespage->showDerivative1->setChecked( ufkt->f1_mode );
......
......@@ -29,7 +29,7 @@
#include <kdialogbase.h>
#include "xparser.h"
//Added by qt3to4:
#include <QList>
#include "editderivativespage.h"
......
This diff is collapsed.
......@@ -3,6 +3,7 @@
*
* Copyright (C) 2004 Fredrik Edemar
* f_edemar@linux.se
* 2006 David Saxton <david@bluehaze.org>
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
......@@ -29,11 +30,8 @@
#include <kmessagebox.h>
#include <kpushbutton.h>
#include <qlabel.h>
//Added by qt3to4:
#include <QList>
#include <q3listview.h>
#include <QList>
#include "kminmax.h"
#include "xparser.h"
......@@ -49,8 +47,8 @@ KMinMax::KMinMax(View *v, QWidget *parent )
connect( m_mainWidget->cmdClose, SIGNAL( clicked() ), this, SLOT( close() ));
connect( m_mainWidget->cmdFind, SIGNAL( clicked() ), this, SLOT( cmdFind_clicked() ));
connect( m_mainWidget->cmdParameter, SIGNAL( clicked() ), this, SLOT( cmdParameter_clicked() ));
connect( m_mainWidget->list, SIGNAL( highlighted(Q3ListBoxItem*) ), this, SLOT( list_highlighted(Q3ListBoxItem*) ));
connect( m_mainWidget->list, SIGNAL( doubleClicked( Q3ListBoxItem * ) ), this, SLOT( list_doubleClicked(Q3ListBoxItem *) ));
connect( m_mainWidget->list, SIGNAL( currentItemChanged( QListWidgetItem*, QListWidgetItem* ) ), this, SLOT( list_currentChanged(QListWidgetItem*) ));
connect( m_mainWidget->list, SIGNAL( itemDoubleClicked( QListWidgetItem * ) ), this, SLOT( list_doubleClicked(QListWidgetItem *) ));
parameter="";
}
......@@ -141,7 +139,9 @@ void KMinMax::init(char m)
void KMinMax::updateFunctions()
{
QString const selected_item(m_mainWidget->list->currentText() );
QListWidgetItem * currentItem = m_mainWidget->list->currentItem();
QString const selected_item( currentItem ? currentItem->text() : QString::null );
m_mainWidget->list->clear();
for( QVector<Ufkt>::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it)
......@@ -149,7 +149,7 @@ void KMinMax::updateFunctions()
if( it->fname[0] != 'x' && it->fname[0] != 'y' && it->fname[0] != 'r' && !it->fname.isEmpty())
{
if ( it->f_mode )
m_mainWidget->list->insertItem(it->fstr);
m_mainWidget->list->addItem(it->fstr);
if ( it->f1_mode ) //1st derivative
{
......@@ -157,7 +157,7 @@ void KMinMax::updateFunctions()
int i= function.indexOf('(');
function.truncate(i);
function +="\'";
m_mainWidget->list->insertItem(function );
m_mainWidget->list->addItem(function );
}
if ( it->f2_mode )//2nd derivative
{
......@@ -165,7 +165,7 @@ void KMinMax::updateFunctions()
int i= function.indexOf('(');
function.truncate(i);
function +="\'\'";
m_mainWidget->list->insertItem(function );
m_mainWidget->list->addItem(function );
}
if ( it->integral_mode )//integral
{
......@@ -173,19 +173,21 @@ void KMinMax::updateFunctions()
int i= function.indexOf('(');
function.truncate(i);
function = function.toUpper();
m_mainWidget->list->insertItem(function );
m_mainWidget->list->addItem(function );
}
}
}
m_mainWidget->list->sort();
m_mainWidget->list->sortItems();
if (m_mainWidget->list->count()==0) //empty m_mainWidget->list
m_mainWidget->cmdFind->setEnabled(false);
else
m_mainWidget->cmdFind->setEnabled(true);
selectItem();
Q3ListBoxItem *found_item = m_mainWidget->list->findItem(selected_item,Q3ListView::ExactMatch);
QList<QListWidgetItem *> foundItems = m_mainWidget->list->findItems( selected_item, Qt::MatchExactly );
QListWidgetItem * found_item = foundItems.isEmpty() ? 0 : foundItems.first();
if ( found_item && m_view->csmode < 0)
m_mainWidget->list->setSelected(found_item,true);
m_mainWidget->list->setItemSelected( found_item, true );
}
void KMinMax::selectItem()
......@@ -209,8 +211,9 @@ void KMinMax::selectItem()
function +="\'";
}
//kDebug() << "function: " << function << endl;
Q3ListBoxItem *item = m_mainWidget->list->findItem(function,Q3ListView::ExactMatch);
m_mainWidget->list->setSelected(item,true);
QList<QListWidgetItem *> foundItems = m_mainWidget->list->findItems( function, Qt::MatchExactly );
if ( !foundItems.isEmpty() )
m_mainWidget->list->setItemSelected( foundItems.first(), true );
if ( !ufkt->parameters.isEmpty() )
parameter = ufkt->parameters[m_view->csparam].expression;
......@@ -222,9 +225,9 @@ KMinMax::~KMinMax()
void KMinMax::cmdFind_clicked()
{
if ( m_mainWidget->list->currentItem() == -1)
if ( !m_mainWidget->list->currentItem() )
{
KMessageBox::error(this, i18n("Please choose a function"));
KMessageBox::sorry(this, i18n("Please choose a function"));
return;
}
double dmin, dmax;
......@@ -246,7 +249,7 @@ void KMinMax::cmdFind_clicked()
}
if ( dmin >= dmax)
{
KMessageBox::error(this,i18n("The minimum range value must be lower than the maximum range value"));
KMessageBox::sorry(this,i18n("The minimum range value must be lower than the maximum range value"));
m_mainWidget->min->setFocus();
m_mainWidget->min->selectAll();
return;
......@@ -254,7 +257,7 @@ void KMinMax::cmdFind_clicked()
if ( dmin<View::xmin || dmax>View::xmax )
{
KMessageBox::error(this,i18n("Please insert a minimum and maximum range between %1 and %2").arg(View::xmin).arg(View::xmax) );
KMessageBox::sorry(this,i18n("Please insert a minimum and maximum range between %1 and %2").arg(View::xmin).arg(View::xmax) );
m_mainWidget->min->setFocus();
m_mainWidget->min->selectAll();
return;
......@@ -262,7 +265,8 @@ void KMinMax::cmdFind_clicked()
}
QString function( m_mainWidget->list->currentText() );
QListWidgetItem * currentItem = m_mainWidget->list->currentItem();
QString function( currentItem ? currentItem->text() : QString::null );
char p_mode = 0;
if ( function.contains('\'') == 1)
{
......@@ -296,7 +300,7 @@ void KMinMax::cmdFind_clicked()
}
if ( !ufkt)
{
KMessageBox::error(this,i18n("Function could not be found"));
KMessageBox::sorry(this,i18n("Function could not be found"));
return;
}
......@@ -304,8 +308,9 @@ void KMinMax::cmdFind_clicked()
parameter = "0";
else if ( parameter.isEmpty())
{
KMessageBox::error(this,i18n("You must choose a parameter for that function"));
list_highlighted(m_mainWidget->list->selectedItem() );
KMessageBox::sorry(this,i18n("You must choose a parameter for that function"));
QList<QListWidgetItem*> selected = m_mainWidget->list->selectedItems();
list_currentChanged( selected.isEmpty() ? 0 : selected.first() );
return;
}
......@@ -347,16 +352,16 @@ void KMinMax::cmdFind_clicked()
}
if ( m_view->isCalculationStopped() )
KMessageBox::error(this,i18n("The operation was cancelled by the user."));
KMessageBox::sorry(this,i18n("The operation was cancelled by the user."));
}
void KMinMax::list_highlighted(Q3ListBoxItem* item)
void KMinMax::list_currentChanged(QListWidgetItem* item)
{
if ( !item)
{
m_mainWidget->cmdParameter->setEnabled( false );
return;
}
QString function( m_mainWidget->list->currentText() );
QString function( item->text() );
char p_mode = 0;
if ( function.contains('\'') == 1)
{
......@@ -394,7 +399,9 @@ void KMinMax::list_highlighted(Q3ListBoxItem* item)
}
void KMinMax::cmdParameter_clicked()