• 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
  • xplanet
opsxplanet.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  opsxplanet.cpp - K Desktop Planetarium
3  -------------------
4  begin : Wed 26 Nov 2008
5  copyright : (C) 2008 by Jerome SONRIER
6  email : jsid@emor3j.fr.eu.org
7  ***************************************************************************/
8 /***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #include "opsxplanet.h"
18 
19 #include "kstars.h"
20 #include "kstarsdata.h"
21 #include "Options.h"
22 
23 OpsXplanet::OpsXplanet( KStars *_ks )
24  : QFrame( _ks ), ksw(_ks)
25 {
26  setupUi( this );
27 
28  // Init projections combobox
29  kcfg_XplanetProjection->addItem( i18nc("Map projection method", "No projection"), "no projection");
30  kcfg_XplanetProjection->addItem( i18nc("Map projection method", "Ancient"), "ancient");
31  kcfg_XplanetProjection->addItem( i18nc("Map projection method", "Azimuthal"), "azimuthal");
32  kcfg_XplanetProjection->addItem( i18nc("Map projection method", "Bonne"), "bonne");
33  kcfg_XplanetProjection->addItem( i18nc("Map projection method", "Gnomonic"), "gnomonic");
34  kcfg_XplanetProjection->addItem( i18nc("Map projection method", "Hemisphere"), "hemisphere");
35  kcfg_XplanetProjection->addItem( i18nc("Map projection method", "Lambert"), "lambert");
36  kcfg_XplanetProjection->addItem( i18nc("Map projection method", "Mercator"), "mercator");
37  kcfg_XplanetProjection->addItem( i18nc("Map projection method", "Mollweide"), "mollweide");
38  kcfg_XplanetProjection->addItem( i18nc("Map projection method", "Orthographic"), "orthographic");
39  kcfg_XplanetProjection->addItem( i18nc("Map projection method", "Peters"), "peters");
40  kcfg_XplanetProjection->addItem( i18nc("Map projection method", "Polyconic"), "polyconic");
41  kcfg_XplanetProjection->addItem( i18nc("Map projection method", "Rectangular"), "rectangular");
42  kcfg_XplanetProjection->addItem( i18nc("Map projection method", "TSC"), "tsc");
43 
44  // Enable/Disable somme widgets
45  connect( kcfg_XplanetWait, SIGNAL( toggled(bool) ), SLOT( slotUpdateWidgets(bool) ) );
46  connect( kcfg_XplanetConfigFile, SIGNAL( toggled(bool) ), SLOT( slotConfigFileWidgets(bool) ) );
47  connect( kcfg_XplanetStarmap, SIGNAL( toggled(bool) ), SLOT( slotStarmapFileWidgets(bool) ) );
48  connect( kcfg_XplanetArcFile, SIGNAL( toggled(bool) ), SLOT( slotArcFileWidgets(bool) ) );
49  connect( kcfg_XplanetLabel, SIGNAL( toggled(bool) ), SLOT( slotLabelWidgets(bool) ) );
50  connect( kcfg_XplanetMarkerFile, SIGNAL( toggled(bool) ), SLOT( slotMarkerFileWidgets(bool) ) );
51  connect( kcfg_XplanetMarkerBounds, SIGNAL( toggled(bool) ), SLOT( slotMarkerBoundsWidgets(bool) ) );
52  connect( kcfg_XplanetProjection, SIGNAL( currentIndexChanged(int) ), SLOT( slotProjectionWidgets(int) ) );
53  connect( kcfg_XplanetBackground, SIGNAL( toggled(bool) ), SLOT( slotBackgroundWidgets(bool) ) );
54 
55  kcfg_XplanetWaitValue->setEnabled( Options::xplanetWait() );
56  textLabelXplanetSecondes->setEnabled( Options::xplanetWait() );
57  kcfg_XplanetConfigFilePath->setEnabled( Options::xplanetConfigFile() );
58  kcfg_XplanetStarmapPath->setEnabled( Options::xplanetStarmap() );
59  kcfg_XplanetArcFilePath->setEnabled( Options::xplanetArcFile() );
60  kcfg_XplanetLabelLocalTime->setEnabled( Options::xplanetLabel() );
61  kcfg_XplanetLabelGMT->setEnabled( Options::xplanetLabel() );
62  textLabelXplanetLabelString->setEnabled( Options::xplanetLabel() );
63  kcfg_XplanetLabelString->setEnabled( Options::xplanetLabel() );
64  textLabelXplanetDateFormat->setEnabled( Options::xplanetLabel() );
65  kcfg_XplanetDateFormat->setEnabled( Options::xplanetLabel() );
66  textLabelXplanetFontSize->setEnabled( Options::xplanetLabel() );
67  kcfg_XplanetFontSize->setEnabled( Options::xplanetLabel() );
68  textLabelXplanetColor->setEnabled( Options::xplanetLabel() );
69  kcfg_XplanetColor->setEnabled( Options::xplanetLabel() );
70  textLabelLabelPos->setEnabled( Options::xplanetLabel() );
71  kcfg_XplanetLabelTL->setEnabled( Options::xplanetLabel() );
72  kcfg_XplanetLabelTR->setEnabled( Options::xplanetLabel() );
73  kcfg_XplanetLabelBR->setEnabled( Options::xplanetLabel() );
74  kcfg_XplanetLabelBL->setEnabled( Options::xplanetLabel() );
75  kcfg_XplanetMarkerFilePath->setEnabled( Options::xplanetMarkerFile() );
76  kcfg_XplanetMarkerBounds->setEnabled( Options::xplanetMarkerFile() );
77  if( Options::xplanetMarkerFile() && Options::xplanetMarkerBounds() )
78  kcfg_XplanetMarkerBoundsPath->setEnabled( true );
79  else
80  kcfg_XplanetMarkerBoundsPath->setEnabled( false );
81  if( Options::xplanetProjection() == 0 )
82  groupBoxBackground->setEnabled( false );
83  kcfg_XplanetBackgroundImage->setEnabled( Options::xplanetBackgroundImage() );
84  kcfg_XplanetBackgroundImagePath->setEnabled( Options::xplanetBackgroundImage() );
85  kcfg_XplanetBackgroundColor->setEnabled( Options::xplanetBackgroundImage() );
86  kcfg_XplanetBackgroundColorValue->setEnabled( Options::xplanetBackgroundImage() );
87  if( Options::xplanetProjection() == 0 )
88  groupBoxBackground->setEnabled( false );
89 }
90 
91 OpsXplanet::~OpsXplanet()
92 {}
93 
94 void OpsXplanet::slotUpdateWidgets( bool on ) {
95  kcfg_XplanetWaitValue->setEnabled( on );
96  textLabelXplanetSecondes->setEnabled( on );
97 }
98 
99 void OpsXplanet::slotConfigFileWidgets( bool on ) {
100  kcfg_XplanetConfigFilePath->setEnabled( on );
101 }
102 
103 void OpsXplanet::slotStarmapFileWidgets( bool on ) {
104  kcfg_XplanetStarmapPath->setEnabled( on );
105 }
106 
107 void OpsXplanet::slotArcFileWidgets( bool on ) {
108  kcfg_XplanetArcFilePath->setEnabled( on );
109 }
110 
111 void OpsXplanet::slotLabelWidgets( bool on ) {
112  kcfg_XplanetLabelLocalTime->setEnabled( on );
113  kcfg_XplanetLabelGMT->setEnabled( on );
114  textLabelXplanetLabelString->setEnabled( on );
115  kcfg_XplanetLabelString->setEnabled( on );
116  textLabelXplanetDateFormat->setEnabled( on );
117  kcfg_XplanetDateFormat->setEnabled( on );
118  textLabelXplanetFontSize->setEnabled( on );
119  kcfg_XplanetFontSize->setEnabled( on );
120  textLabelXplanetColor->setEnabled( on );
121  kcfg_XplanetColor->setEnabled( on );
122  textLabelLabelPos->setEnabled( on );
123  kcfg_XplanetLabelTL->setEnabled( on );
124  kcfg_XplanetLabelTR->setEnabled( on );
125  kcfg_XplanetLabelBR->setEnabled( on );
126  kcfg_XplanetLabelBL->setEnabled( on );
127 }
128 
129 void OpsXplanet::slotMarkerFileWidgets( bool on ) {
130  kcfg_XplanetMarkerFilePath->setEnabled( on );
131  kcfg_XplanetMarkerBounds->setEnabled( on );
132  if (kcfg_XplanetMarkerBounds->isChecked() )
133  kcfg_XplanetMarkerBoundsPath->setEnabled( on );
134 }
135 
136 void OpsXplanet::slotMarkerBoundsWidgets( bool on ) {
137  kcfg_XplanetMarkerBoundsPath->setEnabled( on );
138 }
139 
140 void OpsXplanet::slotProjectionWidgets( int index ) {
141  if( index == 0 )
142  groupBoxBackground->setEnabled( false );
143  else
144  groupBoxBackground->setEnabled( true );
145 
146  if( ! kcfg_XplanetBackground->isChecked() ) {
147  kcfg_XplanetBackgroundImage->setEnabled( false );
148  kcfg_XplanetBackgroundImagePath->setEnabled( false );
149  kcfg_XplanetBackgroundColor->setEnabled( false );
150  kcfg_XplanetBackgroundColorValue->setEnabled( false );
151  }
152 }
153 
154 void OpsXplanet::slotBackgroundWidgets( bool on ) {
155  kcfg_XplanetBackgroundImage->setEnabled( on );
156  kcfg_XplanetBackgroundImagePath->setEnabled( on );
157  kcfg_XplanetBackgroundColor->setEnabled( on );
158  kcfg_XplanetBackgroundColorValue->setEnabled( on );
159 }
160 
161 #include "opsxplanet.moc"
OpsXplanet::~OpsXplanet
~OpsXplanet()
Definition: opsxplanet.cpp:91
Options::xplanetArcFile
static bool xplanetArcFile()
Get Arc file.
Definition: Options.h:4084
Options::xplanetMarkerBounds
static bool xplanetMarkerBounds()
Get Write marker bounds.
Definition: Options.h:4217
KStars
This is the main window for KStars.
Definition: kstars.h:94
Options::xplanetMarkerFile
static bool xplanetMarkerFile()
Get Use marker file.
Definition: Options.h:4179
Options::xplanetWait
static bool xplanetWait()
Get Update view.
Definition: Options.h:3932
Options::xplanetConfigFile
static bool xplanetConfigFile()
Get Config file.
Definition: Options.h:4122
i18nc
i18nc("string from libindi, used in the config dialog","100x")
Options::xplanetLabel
static bool xplanetLabel()
Get Show label.
Definition: Options.h:3609
Options::xplanetBackgroundImage
static bool xplanetBackgroundImage()
Get Use background image.
Definition: Options.h:3989
Options.h
Options::xplanetStarmap
static bool xplanetStarmap()
Get Star map.
Definition: Options.h:4255
kstarsdata.h
Options::xplanetProjection
static uint xplanetProjection()
Get Projection.
Definition: Options.h:3913
OpsXplanet::OpsXplanet
OpsXplanet(KStars *_ks)
Definition: opsxplanet.cpp:23
QFrame
opsxplanet.h
kstars.h
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