[Kstars-devel] KDE/kdeedu/kstars/kstars/tools
Jason Harris
kstars at 30doradus.org
Mon Nov 19 00:12:12 CET 2007
SVN commit 738456 by harris:
Fix slotHighlight() so that the selected plot object in the list is
highlighted in the plot, and its coordinates are displayed in the edit
fields.
CCMAIL: kstars-devel at kde.org
M +6 -8 altvstime.cpp
M +1 -1 altvstime.h
--- trunk/KDE/kdeedu/kstars/kstars/tools/altvstime.cpp #738455:738456
@@ -112,9 +112,9 @@
connect( avtUI->clearFieldsButton, SIGNAL( clicked() ), this, SLOT( slotClearBoxes() ) );
connect( avtUI->longBox, SIGNAL( returnPressed() ), this, SLOT( slotAdvanceFocus() ) );
connect( avtUI->latBox, SIGNAL( returnPressed() ), this, SLOT( slotAdvanceFocus() ) );
- connect( avtUI->PlotList, SIGNAL( itemSelectionChanged(int) ), this, SLOT( slotHighlight() ) );
+ connect( avtUI->PlotList, SIGNAL( currentRowChanged(int) ), this, SLOT( slotHighlight(int) ) );
- //ther edit boxes should not pass on the return key!
+ //the edit boxes should not pass on the return key!
avtUI->nameBox->setTrapReturnKey( true );
avtUI->raBox->setTrapReturnKey( true );
avtUI->decBox->setTrapReturnKey( true );
@@ -290,15 +290,13 @@
return p->alt()->Degrees();
}
-void AltVsTime::slotHighlight(void) {
- int iPlotList = avtUI->PlotList->currentRow();
-
+void AltVsTime::slotHighlight( int row ) {
//highlight the curve of the selected object
QList< KPlotObject* > objects = avtUI->View->plotObjects();
for ( int i=0; i<objects.count(); ++i ) {
KPlotObject *obj = objects.at( i );
- if ( i == iPlotList ) {
+ if ( i == row ) {
obj->setLinePen( QPen( Qt::white, 2 ) );
} else {
obj->setLinePen( QPen( Qt::red, 1 ) );
@@ -308,7 +306,7 @@
avtUI->View->update();
for ( int i=0; i < pList.size(); ++i ) {
- if ( i == iPlotList ) {
+ if ( i == row ) {
SkyObject *p = pList.at(i);
avtUI->raBox->showInHours( p->ra() );
avtUI->decBox->showInDegrees( p->dec() );
@@ -439,7 +437,7 @@
else DayOffset = 0;
setLSTLimits();
- slotHighlight();
+ slotHighlight( avtUI->PlotList->currentRow() );
avtUI->View->update();
delete num;
--- trunk/KDE/kdeedu/kstars/kstars/tools/altvstime.h #738455:738456
@@ -159,7 +159,7 @@
/**Update the plot to highlight the altitude curve of the objects
*which is highlighted in the listbox.
*/
- void slotHighlight(void);
+ void slotHighlight(int);
private:
AltVsTimeUI *avtUI;
More information about the Kstars-devel
mailing list