• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
  • indi
opsindi.cpp
Go to the documentation of this file.
1 /* INDI Options
2  Copyright (C) 2003 Jasem Mutlaq (mutlaqja@ikarustech.com)
3 
4  This application is free software; you can redistribute it and/or
5  modify it under the terms of the GNU General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  */
10 
11 #include "opsindi.h"
12 
13 #include <kpushbutton.h>
14 #include <kfiledialog.h>
15 #include <klineedit.h>
16 #include <kconfigdialog.h>
17 
18 #include <QCheckBox>
19 #include <QStringList>
20 #include <QComboBox>
21 
22 #include "Options.h"
23 
24 #include "kstars.h"
25 
26 OpsINDI::OpsINDI( KStars *_ks )
27  : QFrame( _ks )
28 {
29  setupUi(this);
30 
31  //Get a pointer to the KConfigDialog
32  m_ConfigDialog = KConfigDialog::exists( "settings" );
33 
34  if (Options::fitsDir().isEmpty())
35  {
36  kcfg_fitsDir->setText (QDir:: homePath());
37  Options::setFitsDir( kcfg_fitsDir->text());
38  }
39  else
40  kcfg_fitsDir->setText ( Options::fitsDir());
41 
42  if (Options::filterAlias().empty())
43  m_filterList << "1" << "2" << "3" << "4" << "5" << "6" << "7" << "8" << "9" << "10";
44  else
45  m_filterList = Options::filterAlias();
46 
47  for (int i=m_filterList.count(); i < 10; i++)
48  m_filterList << QString::number(i+1);
49 
50  filterSlotCombo->setCurrentIndex(0);
51  kcfg_filterAlias->setText(m_filterList[0]);
52 
53  selectFITSDirB->setIcon( KIcon( "document-open" ) );
54  selectDriversDirB->setIcon( KIcon( "document-open" ) );
55 
56  connect(selectFITSDirB, SIGNAL(clicked()), this, SLOT(saveFITSDirectory()));
57  connect(selectDriversDirB, SIGNAL(clicked()), this, SLOT(saveDriversDirectory()));
58  connect(kcfg_filterAlias, SIGNAL(editingFinished()), this, SLOT(saveFilterAlias()));
59  connect(filterSlotCombo, SIGNAL(activated(int)), this, SLOT(updateFilterAlias(int)));
60 
61  connect( m_ConfigDialog, SIGNAL( applyClicked() ), SLOT( slotApply() ) );
62  connect( m_ConfigDialog, SIGNAL( okClicked() ), SLOT( slotApply() ) );
63  connect( m_ConfigDialog, SIGNAL( cancelClicked() ), SLOT( slotCancel() ) );
64 }
65 
66 
67 OpsINDI::~OpsINDI() {}
68 
69 void OpsINDI::saveFITSDirectory()
70 {
71  QString dir = KFileDialog::getExistingDirectory(kcfg_fitsDir->text());
72 
73  if (!dir.isEmpty())
74  kcfg_fitsDir->setText(dir);
75 }
76 
77 void OpsINDI::saveDriversDirectory()
78 {
79  QString dir = KFileDialog::getExistingDirectory(kcfg_indiDriversDir->text());
80 
81  if (!dir.isEmpty())
82  kcfg_indiDriversDir->setText(dir);
83 }
84 
85 void OpsINDI::saveFilterAlias()
86 {
87  m_filterList[filterSlotCombo->currentIndex()] = kcfg_filterAlias->text();
88 
89 }
90 
91 void OpsINDI::updateFilterAlias(int index)
92 {
93  if (index < 0) return;
94 
95  kcfg_filterAlias->setText(m_filterList[index]);
96 }
97 
98 void OpsINDI::slotApply()
99 {
100  Options::setFilterAlias(m_filterList);
101 }
102 
103 void OpsINDI::slotCancel()
104 {
105  m_filterList = Options::filterAlias();
106 }
107 
108 #include "opsindi.moc"
Options::setFilterAlias
static void setFilterAlias(const QStringList &v)
Set Aliases for filter wheel slots.
Definition: Options.h:742
OpsINDI::~OpsINDI
~OpsINDI()
Definition: opsindi.cpp:67
KStars
This is the main window for KStars.
Definition: kstars.h:94
Options::setFitsDir
static void setFitsDir(const QString &v)
Set FITS Default directory.
Definition: Options.h:685
Options::fitsDir
static QString fitsDir()
Get FITS Default directory.
Definition: Options.h:695
opsindi.h
Options.h
OpsINDI::OpsINDI
OpsINDI(KStars *_ks)
Definition: opsindi.cpp:26
QFrame
kstars.h
Options::filterAlias
static QStringList filterAlias()
Get Aliases for filter wheel slots.
Definition: Options.h:752
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

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

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal