25 #include <tqdatetime.h>
27 #include <kdialogbase.h>
29 #include "preferences.h"
30 #include "recurrenceedit.h"
31 #include "soundpicker.h"
40 class FontColourChooser;
44 class SpecialActionsButton;
46 class FontColourPrefTab;
54 class KAlarmPrefDlg :
public KDialogBase
59 static void display();
62 FontColourPrefTab* mFontColourPage;
63 EditPrefTab* mEditPage;
64 EmailPrefTab* mEmailPage;
65 ViewPrefTab* mViewPage;
66 MiscPrefTab* mMiscPage;
69 virtual void slotOk();
70 virtual void slotApply();
71 virtual void slotHelp();
72 virtual void slotDefault();
73 virtual void slotCancel();
79 static KAlarmPrefDlg* mInstance;
84 class PrefsTabBase :
public TQWidget
89 PrefsTabBase(TQVBox*);
91 void setPreferences();
92 virtual void restore() = 0;
93 virtual void apply(
bool syncToDisc) = 0;
94 virtual void setDefaults() = 0;
95 static int indentWidth() {
return mIndentWidth; }
101 static int mIndentWidth;
106 class MiscPrefTab :
public PrefsTabBase
111 MiscPrefTab(TQVBox*);
113 virtual void restore();
114 virtual void apply(
bool syncToDisc);
115 virtual void setDefaults();
118 void slotAutostartDaemonClicked();
119 void slotRunModeToggled(
bool);
120 void slotDisableIfStoppedToggled(
bool);
121 void slotExpiredToggled(
bool);
122 void slotClearExpired();
123 void slotOtherTerminalToggled(
bool);
125 void slotAutostartToggled(
bool);
129 void setExpiredControls(
int purgeDays);
131 TQCheckBox* mAutostartDaemon;
132 TQRadioButton* mRunInSystemTray;
133 TQRadioButton* mRunOnDemand;
134 TQCheckBox* mDisableAlarmsIfStopped;
135 TQCheckBox* mQuitWarn;
136 TQCheckBox* mAutostartTrayIcon;
137 TQCheckBox* mConfirmAlarmDeletion;
138 TQCheckBox* mKeepExpired;
139 TQCheckBox* mPurgeExpired;
140 SpinBox* mPurgeAfter;
141 TQLabel* mPurgeAfterLabel;
142 TQPushButton* mClearExpired;
143 TimeEdit* mStartOfDay;
144 TQButtonGroup* mXtermType;
145 TQLineEdit* mXtermCommand;
152 class EmailPrefTab :
public PrefsTabBase
157 EmailPrefTab(TQVBox*);
160 virtual void restore();
161 virtual void apply(
bool syncToDisc);
162 virtual void setDefaults();
165 void slotEmailClientChanged(
int);
166 void slotFromAddrChanged(
int);
167 void slotBccAddrChanged(
int);
168 void slotAddressChanged() { mAddressChanged =
true; }
171 void setEmailAddress(Preferences::MailFrom,
const TQString& address);
172 void setEmailBccAddress(
bool useControlCentre,
const TQString& address);
173 TQString validateAddr(ButtonGroup*, TQLineEdit* addr,
const TQString& msg);
175 ButtonGroup* mEmailClient;
176 ButtonGroup* mFromAddressGroup;
177 TQLineEdit* mEmailAddress;
178 ButtonGroup* mBccAddressGroup;
179 TQLineEdit* mEmailBccAddress;
180 TQCheckBox* mEmailQueuedNotify;
181 TQCheckBox* mEmailCopyToKMail;
182 bool mAddressChanged;
183 bool mBccAddressChanged;
188 class EditPrefTab :
public PrefsTabBase
193 EditPrefTab(TQVBox*);
196 virtual void restore();
197 virtual void apply(
bool syncToDisc);
198 virtual void setDefaults();
201 void slotBrowseSoundFile();
204 TQCheckBox* mAutoClose;
205 TQCheckBox* mConfirmAck;
206 TQComboBox* mReminderUnits;
207 SpecialActionsButton* mSpecialActionsButton;
208 TQCheckBox* mCmdScript;
209 TQCheckBox* mCmdXterm;
210 TQCheckBox* mEmailBcc;
212 TQLabel* mSoundFileLabel;
213 TQLineEdit* mSoundFile;
214 TQPushButton* mSoundFileBrowse;
215 TQCheckBox* mSoundRepeat;
216 TQCheckBox* mCopyToKOrganizer;
217 TQCheckBox* mLateCancel;
218 TQComboBox* mRecurPeriod;
219 TQButtonGroup* mFeb29;
221 static int soundIndex(SoundPicker::Type);
222 static int recurIndex(RecurrenceEdit::RepeatType);
227 class ViewPrefTab :
public PrefsTabBase
232 ViewPrefTab(TQVBox*);
234 virtual void restore();
235 virtual void apply(
bool syncToDisc);
236 virtual void setDefaults();
239 void slotTooltipAlarmsToggled(
bool);
240 void slotTooltipMaxToggled(
bool);
241 void slotTooltipTimeToggled(
bool);
242 void slotTooltipTimeToToggled(
bool);
245 void setTooltip(
int maxAlarms,
bool time,
bool timeTo,
const TQString& prefix);
247 TQCheckBox* mTooltipShowAlarms;
248 TQCheckBox* mTooltipMaxAlarms;
249 SpinBox* mTooltipMaxAlarmCount;
250 TQCheckBox* mTooltipShowTime;
251 TQCheckBox* mTooltipShowTimeTo;
252 TQLineEdit* mTooltipTimeToPrefix;
253 TQLabel* mTooltipTimeToPrefixLabel;
254 TQCheckBox* mModalMessages;
255 SpinBox* mDaemonTrayCheckInterval;
260 class FontColourPrefTab :
public PrefsTabBase
265 FontColourPrefTab(TQVBox*);
267 virtual void restore();
268 virtual void apply(
bool syncToDisc);
269 virtual void setDefaults();
272 FontColourChooser* mFontChooser;
273 KColorCombo* mDisabledColour;
274 KColorCombo* mExpiredColour;