[Kstars-devel] [kstars] kstars/tools: Lets users choose which planets they want to be drawn in Sky Calendar tool
Jérome SONRIER
jsid at emor3j.fr.eu.org
Sun Jul 17 02:24:05 CEST 2011
Git commit 82abf095c56a93cf725f537474d2a7ee72ca70ee by Jérome SONRIER.
Committed on 17/07/2011 at 02:21.
Pushed by jsonrier into branch 'master'.
Lets users choose which planets they want to be drawn in Sky Calendar tool
CCBUG: 267102
CCMAIL: kstars-devel at kde.org
M +113 -31 kstars/tools/skycalendar.ui
M +16 -8 kstars/tools/skycalendar.cpp
http://commits.kde.org/kstars/82abf095c56a93cf725f537474d2a7ee72ca70ee
diff --git a/kstars/tools/skycalendar.cpp b/kstars/tools/skycalendar.cpp
index 9ece02d..915c1a8 100644
--- a/kstars/tools/skycalendar.cpp
+++ b/kstars/tools/skycalendar.cpp
@@ -101,14 +101,22 @@ void SkyCalendar::slotFillCalendar() {
scUI->CalendarView->resetPlot();
scUI->CalendarView->setLimits( -9.0, 9.0, 0.0, 366.0 );
- addPlanetEvents( KSPlanetBase::MERCURY );
- addPlanetEvents( KSPlanetBase::VENUS );
- addPlanetEvents( KSPlanetBase::MARS );
- addPlanetEvents( KSPlanetBase::JUPITER );
- addPlanetEvents( KSPlanetBase::SATURN );
- addPlanetEvents( KSPlanetBase::URANUS );
- addPlanetEvents( KSPlanetBase::NEPTUNE );
- addPlanetEvents( KSPlanetBase::PLUTO );
+ if ( scUI->checkBox_Mercury->isChecked() )
+ addPlanetEvents( KSPlanetBase::MERCURY );
+ if ( scUI->checkBox_Venus->isChecked() )
+ addPlanetEvents( KSPlanetBase::VENUS );
+ if ( scUI->checkBox_Mars->isChecked() )
+ addPlanetEvents( KSPlanetBase::MARS );
+ if ( scUI->checkBox_Jupiter->isChecked() )
+ addPlanetEvents( KSPlanetBase::JUPITER );
+ if ( scUI->checkBox_Saturn->isChecked() )
+ addPlanetEvents( KSPlanetBase::SATURN );
+ if ( scUI->checkBox_Uranus->isChecked() )
+ addPlanetEvents( KSPlanetBase::URANUS );
+ if ( scUI->checkBox_Neptune->isChecked() )
+ addPlanetEvents( KSPlanetBase::NEPTUNE );
+ if ( scUI->checkBox_Pluto->isChecked() )
+ addPlanetEvents( KSPlanetBase::PLUTO );
update();
}
diff --git a/kstars/tools/skycalendar.ui b/kstars/tools/skycalendar.ui
index 7b41fa1..ccaba95 100644
--- a/kstars/tools/skycalendar.ui
+++ b/kstars/tools/skycalendar.ui
@@ -1,39 +1,40 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>SkyCalendar</class>
- <widget class="QWidget" name="SkyCalendar" >
- <property name="geometry" >
+ <widget class="QWidget" name="SkyCalendar">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
- <width>488</width>
+ <width>498</width>
<height>764</height>
</rect>
</property>
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Sky Calendar</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout" >
+ <layout class="QVBoxLayout" name="verticalLayout">
<item>
- <layout class="QHBoxLayout" name="horizontalLayout" >
+ <layout class="QHBoxLayout" name="horizontalLayout">
<item>
- <widget class="KPushButton" name="LocationButton" >
- <property name="text" >
+ <widget class="KPushButton" name="LocationButton">
+ <property name="text">
<string>Greenwich, United Kingdom</string>
</property>
</widget>
</item>
<item>
- <spacer name="horizontalSpacer" >
- <property name="orientation" >
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" stdset="0" >
+ <property name="sizeHint" stdset="0">
<size>
<width>18</width>
<height>17</height>
@@ -42,37 +43,37 @@
</spacer>
</item>
<item>
- <widget class="QLabel" name="label_2" >
- <property name="text" >
+ <widget class="QLabel" name="label_2">
+ <property name="text">
<string>Year:</string>
</property>
- <property name="alignment" >
+ <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
- <widget class="KIntSpinBox" name="Year" >
- <property name="alignment" >
+ <widget class="KIntSpinBox" name="Year">
+ <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
- <property name="minimum" >
+ <property name="minimum">
<number>-4713</number>
</property>
- <property name="maximum" >
+ <property name="maximum">
<number>9999</number>
</property>
- <property name="value" >
+ <property name="value">
<number>2000</number>
</property>
</widget>
</item>
<item>
- <spacer name="horizontalSpacer_5" >
- <property name="orientation" >
+ <spacer name="horizontalSpacer_5">
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" stdset="0" >
+ <property name="sizeHint" stdset="0">
<size>
<width>18</width>
<height>14</height>
@@ -81,8 +82,8 @@
</spacer>
</item>
<item>
- <widget class="KPushButton" name="CreateButton" >
- <property name="text" >
+ <widget class="KPushButton" name="CreateButton">
+ <property name="text">
<string>Update</string>
</property>
</widget>
@@ -90,14 +91,90 @@
</layout>
</item>
<item>
- <widget class="CalendarWidget" name="CalendarView" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QCheckBox" name="checkBox_Mercury">
+ <property name="text">
+ <string>Mercury</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="checkBox_Venus">
+ <property name="text">
+ <string>Venus</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QCheckBox" name="checkBox_Mars">
+ <property name="text">
+ <string>Mars</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="checkBox_Jupiter">
+ <property name="text">
+ <string>Jupiter</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <widget class="QCheckBox" name="checkBox_Saturn">
+ <property name="text">
+ <string>Saturn</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="checkBox_Uranus">
+ <property name="text">
+ <string>Uranus</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_5">
+ <item>
+ <widget class="QCheckBox" name="checkBox_Neptune">
+ <property name="text">
+ <string>Neptune</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="checkBox_Pluto">
+ <property name="text">
+ <string>Pluto</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="CalendarWidget" name="CalendarView">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="minimumSize" >
+ <property name="minimumSize">
<size>
<width>480</width>
<height>500</height>
@@ -114,6 +191,11 @@
<header>knuminput.h</header>
</customwidget>
<customwidget>
+ <class>KPlotWidget</class>
+ <extends>QFrame</extends>
+ <header>kplotwidget.h</header>
+ </customwidget>
+ <customwidget>
<class>KPushButton</class>
<extends>QPushButton</extends>
<header>kpushbutton.h</header>
More information about the Kstars-devel
mailing list