1 /***************************************************************************
2 addcatdialog.h - description
5 copyright : (C) 2002 by Jason Harris
6 email : kstars@30doradus.org
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
18 #ifndef ADDCATDIALOG_H
19 #define ADDCATDIALOG_H
24 #include <kdialogbase.h>
25 #include <klineedit.h>
26 #include <kurlrequester.h>
27 #include "deepskyobject.h"
28 #include "addcatdialogui.h"
33 /**@class AddCatDialog
34 *@short Dialog for adding custom object catalogs to KStars
39 class AddCatDialog
: public KDialogBase
{
42 /**Default constructor
44 AddCatDialog( QWidget
*parent
=0 );
50 /**@return the name for the custom catalog.
52 QString
name() const { return acd
->catName
->text(); }
54 /**@return the filename of the custom catalog.
56 QString
filename() const { return acd
->catFileName
->lineEdit()->text(); }
58 /**@return QPtrList of SkyObjects as parsed from the custom catalog file.
60 QPtrList
<DeepSkyObject
> objectList() { return objList
; }
63 /**If both the "catalog name" and "catalog filename" fields are filled,
64 *enable the "Ok" button.
66 void slotCheckLineEdits();
68 /**Attempt to parse SkyObjects from the custom catalog file.
69 *If at least on e object is read successfully, close the dialog.
71 void slotValidateFile();
73 /**Overridden from KDialogBase to show short help in a dialog rather
74 *than launch KHelpCenter.
78 /**Overridden from KDialogBase, so that the entered file can be parsed
79 *before window is closed.
86 QPtrList
<DeepSkyObject
> objList
;