1 /***************************************************************************
2 timedialog.h - K Desktop Planetarium
4 begin : Sun Feb 11 2001
5 copyright : (C) 2001 by Jason Harris
6 email : jharris@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 ***************************************************************************/
21 #include <kdialogbase.h>
24 #include "kstarsdatetime.h"
35 *A class for adjusting the Time and Date. Contains a ExtDatePicker widget
36 *for selecting the date, and three QSpinBoxes for selecting the Hour,
37 *Minute and Second. There is also a "Now" QPushbutton for selecting the
38 *Time and Date from the system clock.
39 *@short Dialog for adjusting the Time and Date.
44 class TimeDialog
: public KDialogBase
{
48 *Constructor. Creates widgets and packs them into QLayouts.
49 *Connects Signals and Slots.
51 TimeDialog( const KStarsDateTime
&now
, QWidget
* parent
= 0 );
58 /**@returns a QTime object with the selected time
60 QTime
selectedTime( void );
62 /**@returns a ExtDate object with the selected date
64 ExtDate
selectedDate( void );
66 /**@returns a KStarsDateTime object with the selected date and time
68 KStarsDateTime
selectedDateTime( void );
72 *When the "Now" QPushButton is pressed, read the time and date
73 *from the system clock. Change the selected date in the ExtDatePicker
74 *to the system's date, and the displayed Hour, Minute and Second
80 *When the value of the HourBox QSpinBox is changed, prefix a "0" to
81 *the displayed text, if the value is less than 10.
83 *It would be nice if I could use one slot for these three widgets;
84 *my understanding is that the slot has no knowledge of which
85 *widget sent the signal...
87 void HourPrefix( int value
);
90 *When the value of the MinuteBox QSpinBox is changed, prefix a "0" to
91 *the displayed text, if the value is less than 10.
93 void MinutePrefix( int value
);
96 *When the value of the SecondBox QSpinBox is changed, prefix a "0" to
97 *the displayed text, if the value is less than 10.
99 void SecondPrefix( int value
);
102 bool event( QEvent
* );
103 void keyReleaseEvent( QKeyEvent
* );
110 ExtDatePicker
*dPicker
;
114 QLabel
* TextLabel1_2
;
116 QPushButton
* NowButton
;