summaryrefslogtreecommitdiffstats
path: root/kstars/kstars/ksnewstuff.h
blob: 69e8fbc49984cf01b64e435403f99dd88914fb69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/***************************************************************************
                          ksnewstuff.h  -  description
                             -------------------
    begin                : Wed 21 May 2004
    copyright            : (C) 2004 by Jason Harris
    email                : kstars@30doradus.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

/**
	*@class KSNewStuff 
	*Subclass of TDENewStuff, which provides a GUI for downloading extra 
	*application data from the internet.  The KStars version is cutomized to 
	*parse the newly downloaded data and incorporate it immediately into 
	*the program.
	*@note This class is only compiled if the user has KDE >= 3.2.90, because
	*earlier versions of KDE did not have TDENewStuff.
	*@author Jason Harris
	*@version 1.0
	*/

#ifndef KSNEWSTUFF_H
#define KSNEWSTUFF_H

#include <tdeversion.h>

#include <tdelocale.h>
#include <kdebug.h>
#include <tqobject.h>

#include <tdenewstuff/knewstuff.h>

class KDirWatch;
class KStars;

class KSNewStuff : public TQObject, public TDENewStuff
{
	Q_OBJECT
  
	public:
	/**
		*Constructor
		*@p parent pointer to the parent widget
		*/
		KSNewStuff( TQWidget *parent = 0 );

	/**
		*Install new application data
		*@p fileName the name of the file to be installed
		*@note overloaded from TDENewStuff
		*/
		bool install( const TQString &fileName );

	/**
		*Upload a data file
		*@p fileName The file to upload
		*@note this function is not yet implemented, and is just a placeholder
		*/
		bool createUploadFile( const TQString & /*fileName*/ ) {
			kdDebug() << i18n( "Uploading data is not possible yet!" );
			return false;
		}

	public slots:
	/**
		*Incorporate the newly-downloaded data into the program.
		*This slot is called whenever files are added to the data directory
		*@p newFile The name of the file that was just added to the data directory
		*/
		void updateData( const TQString &newFile );

	/**
		*Simply calls kapp->processEvents(), to make the UI responsive while 
		*new NGC/IC data are being added to the program.
		*/
 		void slotProcessEvents();

	private:
		KDirWatch *kdw;
		KStars *ks;
		bool NGCUpdated;
};

#endif  // KSNEWSTUFF_H