[Kstars-devel] branches/kstars/summer/kstars/kstars
Prakash Mohan
prak902000 at gmail.com
Sun Jun 7 20:57:05 CEST 2009
SVN commit 978640 by prakash:
Adding an option in the KStars config, so that the user can specify whether we've to retain the downloaded DSS/SDSS images or discard them on exit.
CCMAIL: kstars-devel at kde.org
M +5 -0 kstars.kcfg
M +3 -0 kstarsactions.cpp
M +1 -0 kstarsdcop.cpp
M +13 -0 options/opsadvanced.ui
M +1 -0 tools/observinglist.cpp
M +13 -7 tools/observinglist.h
--- branches/kstars/summer/kstars/kstars/kstars.kcfg #978639:978640
@@ -615,6 +615,11 @@
<whatsthis>Objects in the observing list will be highlighted with a colored name label in the map.</whatsthis>
<default>false</default>
</entry>
+ <entry name="ObsListSaveImage" type="Bool">
+ <label>Save the DSS/SDSS images to harddisk</label>
+ <whatisthis>The images of objects in the obseving list will be autosaved if you download them</whatisthis>
+ <default>false</default>
+ </entry>
<entry name="UseRefraction" type="Bool">
<label>Correct positions for atmospheric refraction?</label>
<whatsthis>Toggle whether object positions are corrected for the effects of atmospheric refraction (only applies when horizontal coordinates are used).</whatsthis>
--- branches/kstars/summer/kstars/kstars/kstarsactions.cpp #978639:978640
@@ -1178,6 +1178,9 @@
clearCachedFindDialog();
delete AAVSODialog;
+ if( ! Options::obsListSaveImage() )
+ foreach ( QString file, obsList->imageList() )
+ QFile::remove( KStandardDirs::locateLocal( "appdata", file ) );
delete obsList;
if ( findDialog ) delete findDialog;
if ( avt ) delete avt;
--- branches/kstars/summer/kstars/kstars/kstarsdcop.cpp #978639:978640
@@ -331,6 +331,7 @@
if ( op == "ShowPlanetNames" && bOk ) Options::setShowPlanetNames( bVal );
if ( op == "ShowPlanetImages" && bOk ) Options::setShowPlanetImages( bVal );
if ( op == "HideOnSlew" && bOk ) Options::setHideOnSlew( bVal );
+ if ( op == "ObsListSaveImage" && bOk ) Options::setObsListSaveImage( bVal );
if ( op == "HideStars" && bOk ) Options::setHideStars( bVal );
if ( op == "HidePlanets" && bOk ) Options::setHidePlanets( bVal );
if ( op == "HideMessier" && bOk ) Options::setHideMessier( bVal );
--- branches/kstars/summer/kstars/kstars/options/opsadvanced.ui #978639:978640
@@ -145,6 +145,19 @@
</spacer>
</item>
<item>
+ <widget class="QCheckBox" name="kcfg_ObsListSaveImage" >
+ <property name="toolTip" >
+ <string>Save the downloaded DSS/SDSS images?</string>
+ </property>
+ <property name="whatsThis" >
+ <string>When the observing list, do you want the downloaded DSS/SDSS images to be saved or discarded?</string>
+ </property>
+ <property name="text" >
+ <string>Save downloaded images on exit</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="QCheckBox" name="kcfg_HideOnSlew" >
<property name="toolTip" >
<string>Do not draw all objects while the map is moving?</string>
--- branches/kstars/summer/kstars/kstars/tools/observinglist.cpp #978639:978640
@@ -1151,6 +1151,7 @@
// set downloadJob to 0, but don't delete it - the job will be deleted automatically
downloadJob = 0;
ui->ImagePreview->showPreview( KUrl( KStandardDirs::locateLocal( "appdata", CurrentImage ) ) );
+ ImageList.append( CurrentImage );
}
#include "observinglist.moc"
--- branches/kstars/summer/kstars/kstars/tools/observinglist.h #978639:978640
@@ -20,14 +20,16 @@
#include <QList>
#include <QAbstractTableModel>
+
#include <kdialog.h>
+#include <kio/copyjob.h>
+#include "ui_observinglist.h"
#include "skyobjects/skyobject.h"
-#include "ui_observinglist.h"
#include "kstarsdatetime.h"
-#include <kio/copyjob.h>
#include "geolocation.h"
#include "ksalmanac.h"
+
class KSAlmanac;
class QSortFilterProxyModel;
class QStandardItemModel;
@@ -60,7 +62,7 @@
*list data (TBD: as HTML table? CSV format? plain text?)
*
*The observing notes associated with the selected object are displayed
- *below the list. (TBD)
+ *below the list.
*
*TODO:
*+ Implement a "shaded" state, in which the UI is compressed to
@@ -78,7 +80,7 @@
Q_OBJECT
public:
- /**@short Cunstructor
+ /**@short Constructor
*/
ObservingList( KStars *_ks );
/**@short Destuctor (empty)
@@ -123,6 +125,9 @@
*/
double findAltitude( SkyPoint *p, double hour=0);
+ /**@short Return the list of downloaded images
+ */
+ QList<QString> imageList() { return ImageList; }
public slots:
/**@short add a new object to list
*@p o pointer to the object to add to the list
@@ -199,7 +204,7 @@
/**@short save the current session
*/
void slotSaveSession();
-
+
/**@short construct a new observing list using the wizard.
*/
void slotWizard();
@@ -219,7 +224,7 @@
*which is the currentIndex of the table
*/
void slotChangeTab(int index);
-
+
/**@short Opens the Location dialog to set the GeoLocation
*for the sessionlist.
*/
@@ -228,7 +233,7 @@
/**@short Updates the tableviews for the new geolocation and date
*/
void slotUpdate();
-
+
/**@short Takes the time from the QTimeEdit box and sets it as the
*time parameter in the tableview of the SessionList.
*/
@@ -259,6 +264,7 @@
QSortFilterProxyModel *m_SortModel, *m_SortModelSession;
KIO::Job *downloadJob; // download job of image -> 0 == no job is running
QHash<QString, QTime> TimeHash;
+ QList<QString> ImageList;
};
#endif // OBSERVINGLIST_H_
More information about the Kstars-devel
mailing list