Commit bae8774f authored by David Saxton's avatar David Saxton

Removed Move Function and Copy Function actions, now that they are redundant.

svn path=/trunk/KDE/kdeedu/kmplot/; revision=525056
parent 77193ec7
......@@ -208,7 +208,6 @@ void MainDlg::setupActions()
//BEGIN tools menu
KAction *mnuYValue = new KAction( i18n( "&Get y-Value..." ), actionCollection(), "yvalue" );
mnuYValue->setIcon( KIcon("") );
connect( mnuYValue, SIGNAL(triggered(bool)), this, SLOT( getYValue() ) );
KAction *mnuMinValue = new KAction( i18n( "&Search for Minimum Value..." ), actionCollection(), "minimumvalue" );
......@@ -220,7 +219,6 @@ void MainDlg::setupActions()
connect( mnuMaxValue, SIGNAL(triggered(bool)), this, SLOT( findMaximumValue() ) );
KAction *mnuArea = new KAction( i18n( "&Area Under Graph..." ), actionCollection(), "grapharea" );
mnuArea->setIcon( KIcon("") );
connect( mnuArea, SIGNAL(triggered(bool)),this, SLOT( graphArea() ) );
//END tools menu
......@@ -270,18 +268,6 @@ void MainDlg::setupActions()
connect(mnuEdit , SIGNAL(triggered(bool)), view, SLOT( mnuEdit_clicked() ) );
mnuEdit->plug(m_popupmenu);
m_popupmenu->addSeparator();
KAction *mnuCopy = new KAction(i18n("&Copy"), actionCollection(),"mnucopy" );
mnuCopy->setIcon( KIcon("") );
connect( mnuCopy, SIGNAL(triggered(bool)), view, SLOT( mnuCopy_clicked() ) );
mnuCopy->plug(m_popupmenu);
KAction *mnuMove = new KAction(i18n("&Move"),actionCollection(),"mnumove" );
mnuMove->setIcon( KIcon("") );
connect( mnuMove, SIGNAL(triggered(bool)), view, SLOT( mnuMove_clicked() ) );
mnuMove->plug(m_popupmenu);
m_popupmenu->addSeparator();
mnuYValue->plug(m_popupmenu);
mnuMinValue->plug(m_popupmenu);
......
......@@ -2369,29 +2369,6 @@ void View::mnuEdit_clicked()
#endif
}
void View::mnuCopy_clicked()
{
if ( csmode == -1 )
return;
if ( m_parser->sendFunction(csmode) )
m_modified = true;
}
void View::mnuMove_clicked()
{
if ( csmode == -1 )
return;
if ( m_parser->sendFunction(csmode) )
{
if (!m_parser->delfkt(csmode) )
return;
drawPlot();
m_modified = true;
}
}
void View::mnuZoomIn_clicked()
{
......
......@@ -120,8 +120,6 @@ public slots:
/// Called when the graph should be updated
void drawPlot();
///Slots for the three first items in popup menu
void mnuCopy_clicked();
void mnuMove_clicked();
void mnuHide_clicked();
void mnuRemove_clicked();
void mnuEdit_clicked();
......
......@@ -687,72 +687,3 @@ bool XParser::setFunctionExpression(const QString &f_str, uint id)
return true;
}
bool XParser::sendFunction(int id, const QString &dcopclient_target)
{
DCOPCStringList cstr_list = kapp->dcopClient()->registeredApplications();
QStringList str_list;
for ( DCOPCStringList::iterator it = cstr_list.begin(); it!=cstr_list.end();++it )
if ( QString(*it).startsWith("kmplot") && *it!=kapp->dcopClient()->appId() )
str_list.append(*it);
if ( str_list.isEmpty() )
{
KMessageBox::error(0, i18n("There are no other Kmplot instances running"));
return false;
}
Ufkt *item = m_ufkt[id];
kDebug() << "Transferring " << item->fname << endl;
QString str_result;
if ( dcopclient_target.isEmpty() && item->fname.at(0) == 'y' )
return false;
else if ( dcopclient_target.isEmpty() )
{
bool ok;
str_result = KInputDialog::getItem(i18n("kmplot"), i18n("Choose which KmPlot instance\nyou want to copy the function to:"), str_list, 0, false, &ok);
if (!ok)
return false;
}
else
str_result = dcopclient_target;
QByteArray parameters;
QDataStream arg( &parameters,QIODevice::WriteOnly);
arg.setVersion(QDataStream::Qt_3_1);
QString str_dmin;
if (!item->usecustomxmin)
str_dmin = item->str_dmin;
QString str_dmax;
if (!item->usecustomxmax)
str_dmax = item->str_dmax;
QStringList str_parameters;
for ( QList<ParameterValueItem>::Iterator it = item->parameters.begin(); it != item->parameters.end(); ++it )
str_parameters.append( (*it).expression);
arg << item->fstr << item->f_mode << item->f1_mode << item->f2_mode << item->integral_mode << item->integral_use_precision << item->linewidth << item->f1_linewidth << item->f2_linewidth << item->integral_linewidth << str_dmin << str_dmax << item->str_startx << item->str_starty << item->integral_precision << item->color << item->f1_color << item->f2_color << item->integral_color << str_parameters << item->use_slider;
QByteArray replay_data;
DCOPCString replay_type;
bool ok = kapp->dcopClient()->call( str_result.toUtf8(), "Parser", "addFunction(QString,bool,bool,bool,bool,bool,int,int,int,int,QString,QString,QString,QString,double,QRgb,QRgb,QRgb,QRgb,QStringList,int)", parameters, replay_type, replay_data, false);
if (!ok)
{
KMessageBox::error(0, i18n("An error appeared during the transfer"));
return false;
}
QDataStream replay_arg( &replay_data,QIODevice::ReadOnly);
replay_arg.setVersion(QDataStream::Qt_3_1);
bool result;
replay_arg >> result;
if (!result)
{
KMessageBox::error(0, i18n("An error appeared during the transfer"));
return false;
}
kapp->dcopClient()->send(str_result.toUtf8(), "View","drawPlot()",QByteArray() ); //update the other window
if (item->fname.at(0) == 'x') // a parametric function
return sendFunction(id+1, str_result);
else
return true;
}
......@@ -65,9 +65,6 @@ public:
/// Interpretates the extended function string (only used by the old file format)
bool getext( Ufkt *, const QString );
/// Send a function to an other instance of Kmplot. Returns true if it success, otherwise false
bool sendFunction(int id, const QString &dcopclient_target="");
/// Functions for the DCOP interface:
/// Returns a list with all functions
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment