mainwindow.cpp
changeset 822 c2ce9944148c
parent 821 4a84d7e444d8
child 823 0bba81dde1bc
     1.1 --- a/mainwindow.cpp	Thu Jan 21 11:56:57 2010 +0000
     1.2 +++ b/mainwindow.cpp	Wed Feb 10 13:48:42 2010 +0000
     1.3 @@ -312,7 +312,7 @@
     1.4  		progressDialog.setValue (v+progressDialog.value());
     1.5  }
     1.6  
     1.7 -void Main::removeProgressValue(int v)
     1.8 +void Main::removeProgressCounter()
     1.9  {
    1.10  	progressMax=0;
    1.11  	progressCounter--;
    1.12 @@ -691,6 +691,13 @@
    1.13  	editMenu->addAction (a);
    1.14  	actionSortChildren=a;
    1.15  
    1.16 +	a = new QAction( QPixmap(iconPath+"editsortback.png" ), tr( "Sort children backwards","Edit menu" ), this );
    1.17 +	connect( a, SIGNAL( activated() ), this, SLOT( editSortBackChildren() ) );
    1.18 +	a->setEnabled (true);
    1.19 +	a->addTo( tb );
    1.20 +	editMenu->addAction (a);
    1.21 +	actionSortBackChildren=a;
    1.22 +
    1.23  	alt = new QAction( QPixmap(flagsPath+"flag-scrolled-right.png"), tr( "Scroll branch","Edit menu" ), this);
    1.24  	alt->setShortcut ( Qt::Key_S );					// Scroll branch
    1.25  	alt->setStatusTip (tr( "Scroll branch" )); 
    1.26 @@ -2893,7 +2900,13 @@
    1.27  void Main::editSortChildren()
    1.28  {
    1.29  	VymModel *m=currentModel();
    1.30 -	if (m) m->sortChildren();
    1.31 +	if (m) m->sortChildren(false);
    1.32 +}
    1.33 +
    1.34 +void Main::editSortBackChildren()
    1.35 +{
    1.36 +	VymModel *m=currentModel();
    1.37 +	if (m) m->sortChildren(true);
    1.38  }
    1.39  
    1.40  void Main::editToggleScroll()
    1.41 @@ -3606,6 +3619,7 @@
    1.42  					actionMoveDown->setEnabled (false);
    1.43  
    1.44  				actionSortChildren->setEnabled (true);
    1.45 +				actionSortBackChildren->setEnabled (true);
    1.46  
    1.47  				actionToggleHideExport->setEnabled (true);	
    1.48  				actionToggleHideExport->setChecked (selbi->hideInExport() );	
    1.49 @@ -3657,6 +3671,7 @@
    1.50  			actionMoveDown->setEnabled (false);
    1.51  			actionFormatHideLinkUnselected->setEnabled (false);
    1.52  			actionSortChildren->setEnabled (false);
    1.53 +			actionSortBackChildren->setEnabled (false);
    1.54  			actionToggleHideExport->setEnabled (false);	
    1.55  		}	
    1.56  	} // m
    1.57 @@ -3741,6 +3756,35 @@
    1.58  
    1.59  void Main::testFunction1()
    1.60  {
    1.61 +
    1.62 +	Process p;
    1.63 +	QString script="test/sleep.sh";
    1.64 +	p.start (script);
    1.65 +	if (!p.waitForStarted())
    1.66 +	{
    1.67 +		cout <<"VM::getBugzillaData couldn't start "<<script.toStdString()<<endl;
    1.68 +		return;
    1.69 +	}	
    1.70 +	if (!p.waitForFinished())
    1.71 +	{
    1.72 +		cout <<"VM::getBugzillaData couldn't finish "<<script.toStdString()<<endl;
    1.73 +		return;
    1.74 +	}
    1.75 +	//QByteArray result=p.readAll();
    1.76 +	QString result=p.getStdout();
    1.77 +	while (result.endsWith("\n")) result.chop(1); 
    1.78 +	//cout << QString(result).toStdString()<<endl;
    1.79 +	QString err=p.getErrout();
    1.80 +	if (!err.isEmpty())
    1.81 +	{
    1.82 +		cout << "VM::getBugzillaData Error:\n";
    1.83 +		cout <<err.toStdString()<<endl;
    1.84 +	}
    1.85 +	else if (!result.isEmpty())
    1.86 +	{
    1.87 +		cout << "ok\n";
    1.88 +	}	
    1.89 +/*
    1.90  	int max=100000;
    1.91  	QProgressDialog p ("testprogress","cancel",0,max,this);
    1.92  	p.setWindowModality (Qt::WindowModal);
    1.93 @@ -3768,9 +3812,11 @@
    1.94  	p.setValue (max);
    1.95  	cout << "Done.\n";
    1.96  	return;
    1.97 -
    1.98 +*/
    1.99 +/*
   1.100  	if (!currentMapEditor()) return;
   1.101  	currentMapEditor()->testFunction1();
   1.102 +*/
   1.103  /*
   1.104  
   1.105  	VymModel *m=currentModel();