[Kstars-devel] KDE/kdeedu/kstars/kstars/tools
Akarsh Simha
akarshsimha at gmail.com
Mon Aug 4 12:33:09 CEST 2008
SVN commit 841944 by asimha:
Ensuring that indentation in conjunctions.cpp complies with that used
in the rest of KStars
CCMAIL: kstars-devel at kde.org
M +79 -79 conjunctions.cpp
--- trunk/KDE/kdeedu/kstars/kstars/tools/conjunctions.cpp #841943:841944
@@ -4,7 +4,7 @@
begin : Sun 20th Apr 2008
copyright : (C) 2008 Akarsh Simha
email : akarshsimha at gmail.com
- ***************************************************************************/
+***************************************************************************/
/***************************************************************************
* *
@@ -51,50 +51,50 @@
ConjunctionsTool::ConjunctionsTool(QWidget *parentSplit)
: QFrame(parentSplit), Object1( 0 ), Object2( 0 ) {
- setupUi(this);
+ setupUi(this);
- /*
- OutputView -> setTableFlags( Tbl_autoScrollBars|Tbl_clipCellPainting );
- OutputView -> setAutoUpdate( TRUE );
- OutputView -> setNumRows( 0 );
- OutputView -> setNumCols( 2 );
- OutputView -> selected.setX( -1 );
- OutputView -> selected.setY( -1 );
- */
+ /*
+ OutputView -> setTableFlags( Tbl_autoScrollBars|Tbl_clipCellPainting );
+ OutputView -> setAutoUpdate( TRUE );
+ OutputView -> setNumRows( 0 );
+ OutputView -> setNumCols( 2 );
+ OutputView -> selected.setX( -1 );
+ OutputView -> selected.setY( -1 );
+ */
- KStarsData *kd = KStarsData::Instance();
- KStarsDateTime dtStart ( KStarsDateTime::currentDateTime() );
- KStarsDateTime dtStop ( dtStart.djd() + 365.24 ); // TODO: Refine
+ KStarsData *kd = KStarsData::Instance();
+ KStarsDateTime dtStart ( KStarsDateTime::currentDateTime() );
+ KStarsDateTime dtStop ( dtStart.djd() + 365.24 ); // TODO: Refine
- startDate -> setDateTime( dtStart.dateTime() );
- stopDate -> setDateTime( dtStop.dateTime() );
+ startDate -> setDateTime( dtStart.dateTime() );
+ stopDate -> setDateTime( dtStop.dateTime() );
- geoPlace = kd -> geo();
- LocationButton -> setText( geoPlace -> fullName() );
+ geoPlace = kd -> geo();
+ LocationButton -> setText( geoPlace -> fullName() );
- pNames[KSPlanetBase::MERCURY] = i18n("Mercury");
- pNames[KSPlanetBase::VENUS] = i18n("Venus");
- pNames[KSPlanetBase::MARS] = i18n("Mars");
- pNames[KSPlanetBase::JUPITER] = i18n("Jupiter");
- pNames[KSPlanetBase::SATURN] = i18n("Saturn");
- pNames[KSPlanetBase::URANUS] = i18n("Uranus");
- pNames[KSPlanetBase::NEPTUNE] = i18n("Neptune");
- pNames[KSPlanetBase::PLUTO] = i18n("Pluto");
- pNames[KSPlanetBase::SUN] = i18n("Sun");
- pNames[KSPlanetBase::MOON] = i18n("Moon");
+ pNames[KSPlanetBase::MERCURY] = i18n("Mercury");
+ pNames[KSPlanetBase::VENUS] = i18n("Venus");
+ pNames[KSPlanetBase::MARS] = i18n("Mars");
+ pNames[KSPlanetBase::JUPITER] = i18n("Jupiter");
+ pNames[KSPlanetBase::SATURN] = i18n("Saturn");
+ pNames[KSPlanetBase::URANUS] = i18n("Uranus");
+ pNames[KSPlanetBase::NEPTUNE] = i18n("Neptune");
+ pNames[KSPlanetBase::PLUTO] = i18n("Pluto");
+ pNames[KSPlanetBase::SUN] = i18n("Sun");
+ pNames[KSPlanetBase::MOON] = i18n("Moon");
- for ( int i=0; i<KSPlanetBase::UNKNOWN_PLANET; ++i ) {
- // Obj1ComboBox->insertItem( i, pNames[i] );
- Obj2ComboBox->insertItem( i, pNames[i] );
- }
+ for ( int i=0; i<KSPlanetBase::UNKNOWN_PLANET; ++i ) {
+ // Obj1ComboBox->insertItem( i, pNames[i] );
+ Obj2ComboBox->insertItem( i, pNames[i] );
+ }
- // signals and slots connections
- connect(LocationButton, SIGNAL(clicked()), this, SLOT(slotLocation()));
- connect(Obj1FindButton, SIGNAL(clicked()), this, SLOT(slotFindObject()));
- connect(ComputeButton, SIGNAL(clicked()), this, SLOT(slotCompute()));
- connect( OutputView, SIGNAL( itemDoubleClicked( QListWidgetItem * ) ), this, SLOT( slotGoto() ) );
+ // signals and slots connections
+ connect(LocationButton, SIGNAL(clicked()), this, SLOT(slotLocation()));
+ connect(Obj1FindButton, SIGNAL(clicked()), this, SLOT(slotFindObject()));
+ connect(ComputeButton, SIGNAL(clicked()), this, SLOT(slotCompute()));
+ connect( OutputView, SIGNAL( itemDoubleClicked( QListWidgetItem * ) ), this, SLOT( slotGoto() ) );
- show();
+ show();
}
ConjunctionsTool::~ConjunctionsTool(){
@@ -154,68 +154,68 @@
void ConjunctionsTool::slotLocation()
{
- LocationDialog ld( (KStars*) topLevelWidget()->parent() );
+ LocationDialog ld( (KStars*) topLevelWidget()->parent() );
- if ( ld.exec() == QDialog::Accepted ) {
- geoPlace = ld.selectedCity();
- LocationButton -> setText( geoPlace -> fullName() );
- }
+ if ( ld.exec() == QDialog::Accepted ) {
+ geoPlace = ld.selectedCity();
+ LocationButton -> setText( geoPlace -> fullName() );
+ }
}
void ConjunctionsTool::slotCompute (void)
{
- KStarsDateTime dtStart = startDate -> dateTime();
- KStarsDateTime dtStop = stopDate -> dateTime();
- long double startJD = dtStart.djd();
- long double stopJD = dtStop.djd();
- dms maxSeparation(1.0); // TODO: Make maxSeparation user-specifiable
- // TODO: Get geoPlace from user.
- // dms LST( geoPlace->GSTtoLST( dt.gst() ) );
+ KStarsDateTime dtStart = startDate -> dateTime();
+ KStarsDateTime dtStop = stopDate -> dateTime();
+ long double startJD = dtStart.djd();
+ long double stopJD = dtStop.djd();
+ dms maxSeparation(1.0); // TODO: Make maxSeparation user-specifiable
+ // TODO: Get geoPlace from user.
+ // dms LST( geoPlace->GSTtoLST( dt.gst() ) );
- if( !Object1 ) {
- // TODO: Display some error message
- KMessageBox::sorry( 0, i18n("Please select an object to check conjunctions with, by clicking on the \'Find Object\' button.") );
- return;
- }
- Object2 = KSPlanetBase::createPlanet( Obj2ComboBox->currentIndex() );
+ if( !Object1 ) {
+ // TODO: Display some error message
+ KMessageBox::sorry( 0, i18n("Please select an object to check conjunctions with, by clicking on the \'Find Object\' button.") );
+ return;
+ }
+ Object2 = KSPlanetBase::createPlanet( Obj2ComboBox->currentIndex() );
- QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) );
- KSConjunct ksc;
- ComputeStack->setCurrentIndex( 1 );
- connect( &ksc, SIGNAL(madeProgress(int)), this, SLOT(showProgress(int)) );
+ QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) );
+ KSConjunct ksc;
+ ComputeStack->setCurrentIndex( 1 );
+ connect( &ksc, SIGNAL(madeProgress(int)), this, SLOT(showProgress(int)) );
- showConjunctions( ksc.findClosestApproach(*Object1, *Object2, startJD, stopJD, maxSeparation) );
+ showConjunctions( ksc.findClosestApproach(*Object1, *Object2, startJD, stopJD, maxSeparation) );
- ComputeStack->setCurrentIndex( 0 );
- QApplication::restoreOverrideCursor();
+ ComputeStack->setCurrentIndex( 0 );
+ QApplication::restoreOverrideCursor();
- delete Object2;
- Object2 = NULL;
+ delete Object2;
+ Object2 = NULL;
}
void ConjunctionsTool::showProgress(int n) {
- progress->setValue( n );
+ progress->setValue( n );
}
void ConjunctionsTool::showConjunctions(const QMap<long double, dms> &conjunctionlist) {
- KStarsDateTime dt;
- QMap<long double, dms>::ConstIterator it;
- int i;
+ KStarsDateTime dt;
+ QMap<long double, dms>::ConstIterator it;
+ int i;
- OutputView->clear();
- outputJDList.clear();
- i = 0;
+ OutputView->clear();
+ outputJDList.clear();
+ i = 0;
- for(it = conjunctionlist.constBegin(); it != conjunctionlist.constEnd(); ++it) {
- dt.setDJD( it.key() );
- OutputView -> addItem( i18n("Conjunction on %1 UT: Separation is %2",
- KGlobal::locale()->formatDateTime( dt, KLocale::LongDate ),
- it.value().toDMSString()) );
- outputJDList.insert( i, it.key() );
- ++i;
- }
+ for(it = conjunctionlist.constBegin(); it != conjunctionlist.constEnd(); ++it) {
+ dt.setDJD( it.key() );
+ OutputView -> addItem( i18n("Conjunction on %1 UT: Separation is %2",
+ KGlobal::locale()->formatDateTime( dt, KLocale::LongDate ),
+ it.value().toDMSString()) );
+ outputJDList.insert( i, it.key() );
+ ++i;
+ }
}
More information about the Kstars-devel
mailing list