• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kstars

indifitsconf.cpp

Go to the documentation of this file.
00001 //
00002 // C++ Implementation: 
00003 //
00004 // Description: 
00005 //
00006 //
00007 // Author: Jason Harris <kstars@30doradus.org>, (C) 2004
00008 //
00009 // Copyright: See COPYING file that comes with this distribution
00010 //
00011 //
00012 
00013 
00014 #include "indifitsconf.h"
00015 #include <kiconloader.h>
00016 #include <kpushbutton.h>
00017 #include <kfiledialog.h>
00018 #include <klineedit.h>
00019 
00020 #include <qcheckbox.h>
00021 #include <qstringlist.h>
00022 #include <qcombobox.h>
00023 
00024 #include "Options.h"
00025 
00026 INDIFITSConf::INDIFITSConf(QWidget* parent, const char* name, bool modal, WFlags fl)
00027 : INDIConf(parent,name, modal,fl)
00028 {
00029 
00030   KIconLoader *icons = KGlobal::iconLoader();
00031   selectDirB->setPixmap( icons->loadIcon( "fileopen", KIcon::Toolbar ) );
00032   connect(selectDirB, SIGNAL(clicked()), this, SLOT(saveFITSDirectory()));
00033   connect(filterCombo, SIGNAL(activated (int)), this, SLOT(comboUpdate(int)));
00034 }
00035 
00036 
00037 INDIFITSConf::~INDIFITSConf()
00038 {
00039 }
00040 
00041 /*$SPECIALIZATION$*/
00042 
00043 void INDIFITSConf::saveFITSDirectory()
00044 {
00045   QString dir = KFileDialog::getExistingDirectory(fitsDIR_IN->text());
00046   
00047   if (!dir.isEmpty())
00048     fitsDIR_IN->setText(dir);
00049 }
00050 
00051 void INDIFITSConf::loadOptions()
00052 {
00053    QStringList filterNumbers;
00054    lastIndex = 0;
00055 
00056    filterNumbers << "0" << "1" << "2" << "3" << "4" << "5" << "6" << "7" << "8" << "9";
00057    filterCombo->insertStringList(filterNumbers);
00058 
00059    timeCheck->setChecked( Options::indiAutoTime() );
00060    GeoCheck->setChecked( Options::indiAutoGeo() );
00061    crosshairCheck->setChecked( Options::indiCrosshairs() );
00062    messagesCheck->setChecked ( Options::indiMessages() );
00063    fitsAutoDisplayCheck->setChecked( Options::indiFITSDisplay() );
00064    telPort_IN->setText ( Options::indiTelescopePort());
00065    vidPort_IN->setText ( Options::indiVideoPort());
00066 
00067    if (Options::fitsSaveDirectory().isEmpty())
00068    {
00069      fitsDIR_IN->setText (QDir:: homeDirPath());
00070      Options::setFitsSaveDirectory( fitsDIR_IN->text());
00071    }
00072    else
00073      fitsDIR_IN->setText ( Options::fitsSaveDirectory());
00074 
00075    if (Options::filterAlias().empty())
00076          filterList << "0" << "1" << "2" << "3" << "4" << "5" << "6" << "7" << "8" << "9";
00077    else
00078          filterList = Options::filterAlias();
00079 
00080      filterCombo->setCurrentItem(lastIndex);
00081      filterAlias->setText(filterList[lastIndex]);
00082 
00083 }
00084 
00085 void INDIFITSConf::saveOptions()
00086 {
00087   
00088      Options::setIndiAutoTime( timeCheck->isChecked() );
00089      Options::setIndiAutoGeo( GeoCheck->isChecked() );
00090      Options::setIndiCrosshairs( crosshairCheck->isChecked() );
00091      Options::setIndiMessages( messagesCheck->isChecked() );
00092      Options::setIndiFITSDisplay (fitsAutoDisplayCheck->isChecked());
00093      Options::setIndiTelescopePort ( telPort_IN->text());
00094      Options::setIndiVideoPort( vidPort_IN->text());
00095      Options::setFitsSaveDirectory( fitsDIR_IN->text());
00096 
00097      filterList[lastIndex] = filterAlias->text();
00098      Options::setFilterAlias(filterList);
00099 
00100 }
00101 
00102 void INDIFITSConf::comboUpdate(int newIndex)
00103 {
00104   filterList[lastIndex] = filterAlias->text();
00105   lastIndex = newIndex;
00106 
00107   filterAlias->setText(filterList[lastIndex]);
00108 
00109 }
00110 
00111 
00112 
00113 #include "indifitsconf.moc"
00114 

kstars

Skip menu "kstars"
  • Main Page
  • Modules
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • keduca
  • kstars
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal