[Kstars-devel] KDE/kdeedu/kstars/kstars
Jérôme Sonrier
jsid at emor3j.fr.eu.org
Sun Feb 15 23:00:00 CET 2009
SVN commit 926639 by jsonrier:
Add a flag manager (in the Tools menu) which permit to add and remove flags to the map.
CCMAIL: kstars-devel at kde.org
FEATURE: 79671
M +5 -1 CMakeLists.txt
M +1 -1 data/CMakeLists.txt
AM data/defaultflag.gif
AM icons/hi22-action-kstars_flag.png
AM icons/hi32-action-kstars_flag.png
AM icons/hi48-action-kstars_flag.png
AM icons/hi64-action-kstars_flag.png
A icons/hisc-action-kstars_flag.svg
M +2 -1 kstars.cpp
M +7 -0 kstars.h
M +5 -0 kstars.kcfg
M +12 -0 kstarsactions.cpp
M +10 -0 kstarsinit.cpp
M +1 -0 kstarsui-indi.rc
M +1 -0 kstarsui-win.rc
M +1 -0 kstarsui.rc
M +27 -16 opsguides.ui
A skycomponents/flagcomponent.cpp [License: GPL (v2+)]
A skycomponents/flagcomponent.h [License: GPL (v2+)]
M +10 -0 skycomponents/skymapcomposite.cpp
M +4 -0 skycomponents/skymapcomposite.h
A tools/flagmanager.cpp [License: GPL (v2+)]
A tools/flagmanager.h [License: GPL (v2+)]
A tools/flagmanager.ui
--- trunk/KDE/kdeedu/kstars/kstars/CMakeLists.txt #926638:926639
@@ -99,6 +99,7 @@
tools/scriptfunction.cpp
tools/skycalendar.cpp
tools/wutdialog.cpp
+ tools/flagmanager.cpp
)
kde4_add_ui_files(libkstarstools_SRCS
@@ -158,7 +159,9 @@
tools/scriptbuilder.ui
tools/scriptnamedialog.ui
tools/skycalendar.ui
- tools/wutdialog.ui )
+ tools/wutdialog.ui
+ tools/flagmanager.ui
+ )
set(libkstarscomponents_SRCS
@@ -203,6 +206,7 @@
skycomponents/starblocklist.cpp
skycomponents/starblockfactory.cpp
skycomponents/culturelist.cpp
+ skycomponents/flagcomponent.cpp
)
set(libkstarswidgets_SRCS ${fitswidgets_SRCS}
--- trunk/KDE/kdeedu/kstars/kstars/data/CMakeLists.txt #926638:926639
@@ -67,7 +67,7 @@
wzstars.png wzgeo.png wzscope.png wzdownload.png chart.colors
classic.colors moonless-night.colors night.colors
tips TZrules.dat valaav.txt advinterface.dat satellites.dat
- histogram.png noimage.png glossary.xml
+ histogram.png noimage.png glossary.xml defaultflag.gif
DESTINATION ${DATA_INSTALL_DIR}/kstars
)
** trunk/KDE/kdeedu/kstars/kstars/data/defaultflag.gif #property svn:mime-type
+ application/octet-stream
** trunk/KDE/kdeedu/kstars/kstars/icons/hi22-action-kstars_flag.png #property svn:mime-type
+ application/octet-stream
** trunk/KDE/kdeedu/kstars/kstars/icons/hi32-action-kstars_flag.png #property svn:mime-type
+ application/octet-stream
** trunk/KDE/kdeedu/kstars/kstars/icons/hi48-action-kstars_flag.png #property svn:mime-type
+ application/octet-stream
** trunk/KDE/kdeedu/kstars/kstars/icons/hi64-action-kstars_flag.png #property svn:mime-type
+ application/octet-stream
--- trunk/KDE/kdeedu/kstars/kstars/kstars.cpp #926638:926639
@@ -61,7 +61,7 @@
KXmlGuiWindow(), kstarsData(0), splash(0), skymap(0), TimeStep(0),
colorActionMenu(0), fovActionMenu(0),
AAVSODialog(0), findDialog(0), obsList(0), avt(0), wut(0), skycal(0),
- sb(0), pv(0), jmt(0), indimenu(0), indidriver(0), indiseq(0),
+ sb(0), pv(0), jmt(0), fm(0), indimenu(0), indidriver(0), indiseq(0),
DialogIsObsolete(false), StartClockRunning( clockrun ),
StartDateString( startdate )
{
@@ -182,6 +182,7 @@
((KToggleAction*)actionCollection()->action("show_mw"))->setChecked( Options::showMilkyWay() );
((KToggleAction*)actionCollection()->action("show_grid"))->setChecked( Options::showGrid() );
((KToggleAction*)actionCollection()->action("show_horizon"))->setChecked( Options::showGround() );
+ ((KToggleAction*)actionCollection()->action("show_flags"))->setChecked( Options::showFlags() );
//color scheme
kstarsData->colorScheme()->loadFromConfig();
--- trunk/KDE/kdeedu/kstars/kstars/kstars.h #926638:926639
@@ -49,6 +49,7 @@
class PlanetViewer;
class JMoonTool;
class ImageViewer;
+class FlagManager;
class OpsCatalog;
class OpsGuides;
@@ -562,6 +563,11 @@
void slotJMoonTool();
/**
+ * action slot: open Flag Manager
+ */
+ void slotFlagManager();
+
+ /**
* action slot: open Telescope wizard
*/
void slotTelescopeWizard();
@@ -709,6 +715,7 @@
PlanetViewer *pv;
JMoonTool *jmt;
QList<ImageViewer*> m_ImageViewerList;
+ FlagManager *fm;
INDIMenu *indimenu;
INDIDriver *indidriver;
--- trunk/KDE/kdeedu/kstars/kstars/kstars.kcfg #926638:926639
@@ -430,6 +430,11 @@
<whatsthis>Toggle whether the horizon line is drawn in the sky map.</whatsthis>
<default>true</default>
</entry>
+ <entry name="ShowFlags" type="Bool">
+ <label>Draw flags in the sky map?</label>
+ <whatsthis>Toggle whether flags are drawn in the sky map.</whatsthis>
+ <default>true</default>
+ </entry>
<entry name="ShowIC" type="Bool">
<label>Draw IC objects in the sky map?</label>
<whatsthis>Toggle whether IC objects are drawn in the sky map.</whatsthis>
--- trunk/KDE/kdeedu/kstars/kstars/kstarsactions.cpp #926638:926639
@@ -79,6 +79,7 @@
#include "tools/scriptbuilder.h"
#include "tools/planetviewer.h"
#include "tools/jmoontool.h"
+#include "tools/flagmanager.h"
#include "imageviewer.h"
#include <config-kstars.h>
@@ -158,6 +159,11 @@
if ( kcd ) {
opguides->kcfg_ShowGround->setChecked( a->isChecked() );
}
+ } else if ( a == actionCollection()->action( "show_flags" ) ) {
+ Options::setShowFlags( a->isChecked() );
+ if ( kcd ) {
+ opguides->kcfg_ShowFlags->setChecked( a->isChecked() );
+ }
}
// update time for all objects because they might be not initialized
@@ -278,6 +284,11 @@
jmt->show();
}
+void KStars::slotFlagManager() {
+ if ( ! fm ) fm = new FlagManager(this);
+ fm->show();
+}
+
void KStars::slotImageSequence()
{
#ifdef HAVE_INDI_H
@@ -1162,6 +1173,7 @@
if ( sb ) delete sb;
if ( pv ) delete pv;
if ( jmt ) delete jmt;
+ if ( fm ) delete fm;
while ( ! m_ImageViewerList.isEmpty() )
delete m_ImageViewerList.takeFirst();
--- trunk/KDE/kdeedu/kstars/kstars/kstarsinit.cpp #926638:926639
@@ -383,6 +383,10 @@
ka->setShortcuts( KShortcut(Qt::CTRL+Qt::Key_J ) );
connect( ka, SIGNAL( triggered() ), this, SLOT( slotJMoonTool() ) );
+ ka = actionCollection()->addAction( "flagmanager" );
+ ka->setText( i18n( "Flags...") );
+ connect( ka, SIGNAL( triggered() ), this, SLOT( slotFlagManager() ) );
+
// devices Menu
#ifdef HAVE_INDI_H
#ifndef Q_WS_WIN
@@ -493,6 +497,12 @@
ta->setToolTip( i18n("Toggle opaque ground") );
connect( ta, SIGNAL( triggered() ), this, SLOT( slotViewToolBar() ) );
+ //show_flags:
+ ta = actionCollection()->add<KToggleAction>( "show_flags" );
+ ta->setIcon( KIcon( "kstars_flag" ) );
+ ta->setText( i18nc( "Toggle flags in the display", "Flags" ) );
+ ta->setToolTip( i18n("Toggle flags") );
+ connect( ta, SIGNAL( triggered() ), this, SLOT( slotViewToolBar() ) );
setXMLFile( "kstarsui.rc" );
--- trunk/KDE/kdeedu/kstars/kstars/kstarsui-indi.rc #926638:926639
@@ -76,6 +76,7 @@
<Action name="scriptbuilder" />
<Action name="solarsystem" />
<Action name="jmoontool" />
+ <Action name="flagmanager" />
</Menu>
<Menu name="settings" noMerge="1"><text>&Settings</text>
--- trunk/KDE/kdeedu/kstars/kstars/kstarsui-win.rc #926638:926639
@@ -66,6 +66,7 @@
<Action name="scriptbuilder" />
<Action name="solarsystem" />
<Action name="jmoontool" />
+ <Action name="flagmanager" />
</Menu>
<Menu name="settings" noMerge="1"><text>&Settings</text>
--- trunk/KDE/kdeedu/kstars/kstars/kstarsui.rc #926638:926639
@@ -67,6 +67,7 @@
<Action name="scriptbuilder" />
<Action name="solarsystem" />
<Action name="jmoontool" />
+ <Action name="flagmanager" />
</Menu>
<Menu name="settings" noMerge="1"><text>&Settings</text>
--- trunk/KDE/kdeedu/kstars/kstars/opsguides.ui #926638:926639
@@ -25,12 +25,12 @@
</item>
<item>
<layout class="QHBoxLayout" >
+ <property name="spacing" >
+ <number>6</number>
+ </property>
<property name="margin" >
<number>0</number>
</property>
- <property name="spacing" >
- <number>6</number>
- </property>
<item>
<widget class="QLabel" name="textLabelSkyCulture" >
<property name="text" >
@@ -89,18 +89,9 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
+ <property name="margin" >
<number>8</number>
</property>
- <property name="topMargin" >
- <number>8</number>
- </property>
- <property name="rightMargin" >
- <number>8</number>
- </property>
- <property name="bottomMargin" >
- <number>8</number>
- </property>
<item>
<widget class="QRadioButton" name="kcfg_UseLatinConstellNames" >
<property name="toolTip" >
@@ -151,7 +142,7 @@
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>16</height>
@@ -193,7 +184,7 @@
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>16</height>
@@ -267,6 +258,19 @@
</widget>
</item>
<item>
+ <widget class="QCheckBox" name="kcfg_ShowFlags" >
+ <property name="toolTip" >
+ <string>Draw flags?</string>
+ </property>
+ <property name="whatsThis" >
+ <string>If checked, flags will be drawn on the sky map</string>
+ </property>
+ <property name="text" >
+ <string>Flags</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
@@ -274,7 +278,7 @@
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>389</width>
<height>16</height>
@@ -286,6 +290,13 @@
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <customwidgets>
+ <customwidget>
+ <class>KComboBox</class>
+ <extends>QComboBox</extends>
+ <header>kcombobox.h</header>
+ </customwidget>
+ </customwidgets>
<resources/>
<connections/>
</ui>
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/skymapcomposite.cpp #926638:926639
@@ -114,6 +114,9 @@
m_SolarSystem = new SolarSystemComposite( this, data );
addComponent( m_SolarSystem );
+ m_Flags = new FlagComponent( this );
+ addComponent( m_Flags );
+
connect( this, SIGNAL( progressText( const QString & ) ),
data, SIGNAL( progressText( const QString & ) ) );
}
@@ -123,6 +126,7 @@
delete m_skyLabeler; // These are on the heap to avoid header file hell.
delete m_skyMesh;
delete m_Cultures;
+ delete m_Flags;
}
void SkyMapComposite::update(KStarsData *data, KSNumbers *num )
@@ -254,6 +258,8 @@
m_CNames->draw( psky );
m_Stars->drawLabels( psky );
+ m_Flags->draw( psky );
+
m_skyMesh->inDraw( false );
//kDebug() << QString("draw took %1 ms").arg( t.elapsed() );
@@ -578,4 +584,8 @@
return m_Cultures->current();
}
+FlagComponent* SkyMapComposite::flags() {
+ return m_Flags;
+}
+
#include "skymapcomposite.moc"
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/skymapcomposite.h #926638:926639
@@ -23,6 +23,7 @@
#include "skycomposite.h"
#include "ksnumbers.h"
#include "starcomponent.h"
+#include "flagcomponent.h"
class SkyMesh;
class SkyLabeler;
@@ -175,6 +176,8 @@
void reloadCLines( KStarsData *data );
void reloadCNames( KStarsData *data );
+ FlagComponent* flags();
+
//Accessors for StarComponent
SkyObject* findStarByGenetiveName( const QString name );
float faintStarMagnitude() const;
@@ -223,6 +226,7 @@
SkyComposite *m_CustomCatalogs;
StarComponent *m_Stars;
SatelliteComposite *m_Satellites;
+ FlagComponent *m_Flags;
SkyMesh* m_skyMesh;
SkyLabeler* m_skyLabeler;
More information about the Kstars-devel
mailing list