mainwindow.cpp
changeset 620 24bfecc949a0
parent 615 497f19b3c1fe
child 625 22955004d512
     1.1 --- a/mainwindow.cpp	Tue Nov 06 13:54:41 2007 +0000
     1.2 +++ b/mainwindow.cpp	Thu Nov 08 15:28:03 2007 +0000
     1.3 @@ -2773,6 +2773,88 @@
     1.4  	} // currentMapEditor()	
     1.5  }
     1.6  
     1.7 +void Main::editAttributeFinished()
     1.8 +{
     1.9 +	// only called from editHeading(), so there is a currentME
    1.10 +
    1.11 +	/*
    1.12 +	MapEditor *me=currentMapEditor();
    1.13 +	if (me)
    1.14 +	{
    1.15 +		me->setStateEditHeading (false);
    1.16 +		QPoint p;	//Not used here, only to find out pos of branch
    1.17 +		bool ok;
    1.18 +		QString s=me->getHeading(ok,p);
    1.19 +
    1.20 +#if defined(Q_OS_MACX)
    1.21 +#else
    1.22 +		if (ok && s!=lineedit->text())
    1.23 +			me->setHeading(lineedit->text());
    1.24 +			
    1.25 +		lineedit->releaseKeyboard();
    1.26 +		lineedit->hide();
    1.27 +		setFocus();
    1.28 +#endif	
    1.29 +		if (!actionSettingsAutoSelectNewBranch->isOn() && 
    1.30 +			!prevSelection.isEmpty()) 
    1.31 +			me->select(prevSelection);
    1.32 +		prevSelection="";
    1.33 +	}
    1.34 +	*/
    1.35 +}
    1.36 +
    1.37 +void Main::editAttribute()
    1.38 +{
    1.39 +	/*
    1.40 +	if (currentMapEditor())
    1.41 +	{
    1.42 +		MapEditor *me=currentMapEditor();
    1.43 +		QString oldSel=me->getSelectString();
    1.44 +
    1.45 +		if (lineedit->isVisible())
    1.46 +			editAttributeFinished();
    1.47 +		else
    1.48 +		{
    1.49 +			bool ok;
    1.50 +			QPoint p;
    1.51 +			QString s=me->getHeading(ok,p);
    1.52 +
    1.53 +			if (ok)
    1.54 +			{
    1.55 +				me->setStateEditHeading (true);
    1.56 +#if defined(Q_OS_MACX)
    1.57 +				p=me->mapToGlobal (p);
    1.58 +				QDialog *d =new QDialog(NULL);
    1.59 +				QLineEdit *le=new QLineEdit (d);
    1.60 +				d->setWindowFlags (Qt::FramelessWindowHint);
    1.61 +				d->setGeometry(p.x(),p.y(),230,25);
    1.62 +				le->resize (d->width()-10,d->height());
    1.63 +				le->setText (s);
    1.64 +				le->selectAll();
    1.65 +				connect (le, SIGNAL (returnPressed()), d, SLOT (accept()));
    1.66 +				d->activateWindow();
    1.67 +				d->exec();
    1.68 +				me->setHeading (le->text());
    1.69 +				delete (le);
    1.70 +				delete (d);
    1.71 +				editHeadingFinished();
    1.72 +#else
    1.73 +				p=me->mapTo (this,p);
    1.74 +				lineedit->setGeometry(p.x(),p.y(),230,25);
    1.75 +				lineedit->setText(s);
    1.76 +				lineedit->setCursorPosition(1);
    1.77 +				lineedit->selectAll();
    1.78 +				lineedit->show();
    1.79 +				lineedit->grabKeyboard();
    1.80 +				lineedit->setFocus();
    1.81 +#endif
    1.82 +			}
    1.83 +		} 
    1.84 +	} // currentMapEditor()	
    1.85 +
    1.86 +	*/
    1.87 +}
    1.88 +
    1.89  void Main::openVymLinks(const QStringList &vl)
    1.90  {
    1.91  	for (int j=0; j<vl.size(); j++)
    1.92 @@ -3646,7 +3728,8 @@
    1.93  void Main::testFunction1()
    1.94  {
    1.95  	if (!currentMapEditor()) return;
    1.96 -	currentMapEditor()->testFunction1();
    1.97 +	//currentMapEditor()->testFunction1();
    1.98 +	editAttribute();
    1.99  }
   1.100  
   1.101  void Main::testFunction2()