26#include <tqpopupmenu.h>
28#include <tqgroupbox.h>
29#include <tqwidgetstack.h>
30#include <tqdragobject.h>
32#include <tqmessagebox.h>
33#include <tqtabwidget.h>
34#include <tqvalidator.h>
35#include <tqwhatsthis.h>
43#include <tdefiledialog.h>
44#include <kiconloader.h>
45#include <tdeio/netaccess.h>
46#include <tdefileitem.h>
47#include <tdemessagebox.h>
49#include <kurlcompletion.h>
51#include <twinmodule.h>
52#include <tdestandarddirs.h>
53#include <kstdguiitem.h>
54#include <tdeabc/addresseedialog.h>
57#include <libtdepim/maillistdrag.h>
58#include <libtdepim/kvcarddrag.h>
59#include <libkcal/icaldrag.h>
61#include "alarmcalendar.h"
62#include "alarmtimewidget.h"
64#include "colourcombo.h"
66#include "emailidcombo.h"
67#include "fontcolourbutton.h"
71#include "latecancel.h"
75#include "preferences.h"
76#include "radiobutton.h"
77#include "recurrenceedit.h"
79#include "shellprocess.h"
80#include "soundpicker.h"
81#include "specialactions.h"
83#include "templatepickdlg.h"
85#include "timespinbox.h"
87#include "editdlgprivate.moc"
91static const char EDIT_DIALOG_NAME[] =
"EditDialog";
92static const int maxDelayTime = 99*60 + 59;
100 PickAlarmFileRadio(
const TQString& text, TQButtonGroup* parent,
const char* name =
nullptr)
104 return KAlarm::browseFile(i18n(
"Choose Text or Image File to Display"), mDefaultDir,
fileEdit()->text(),
105 TQString(), KFile::ExistingOnly, parentWidget(),
"pickAlarmFile");
108 TQString mDefaultDir;
117 PickLogFileRadio(TQPushButton* b, LineEdit* e,
const TQString& text, TQButtonGroup* parent,
const char* name =
nullptr)
121 return KAlarm::browseFile(i18n(
"Choose Log File"), mDefaultDir,
fileEdit()->text(), TQString(),
122 KFile::LocalOnly, parentWidget(),
"pickLogFile");
125 TQString mDefaultDir;
128inline TQString recurText(
const KAEvent& event)
131 if (event.repeatCount())
132 r = TQString::fromLatin1(
"%1 / %2").arg(event.recurrenceText()).arg(event.repetitionText());
134 r =
event.recurrenceText();
135 return i18n(
"&Recurrence - [%1]").arg(r);
140TQString EditAlarmDlg::i18n_ConfirmAck() {
return i18n(
"Confirm acknowledgment"); }
141TQString EditAlarmDlg::i18n_k_ConfirmAck() {
return i18n(
"Confirm ac&knowledgment"); }
142TQString EditAlarmDlg::i18n_SpecialActions() {
return i18n(
"Special Actions..."); }
143TQString EditAlarmDlg::i18n_ShowInKOrganizer() {
return i18n(
"Show in KOrganizer"); }
144TQString EditAlarmDlg::i18n_g_ShowInKOrganizer() {
return i18n(
"Show in KOr&ganizer"); }
145TQString EditAlarmDlg::i18n_EnterScript() {
return i18n(
"Enter a script"); }
146TQString EditAlarmDlg::i18n_p_EnterScript() {
return i18n(
"Enter a scri&pt"); }
147TQString EditAlarmDlg::i18n_ExecInTermWindow() {
return i18n(
"Execute in terminal window"); }
148TQString EditAlarmDlg::i18n_w_ExecInTermWindow() {
return i18n(
"Execute in terminal &window"); }
149TQString EditAlarmDlg::i18n_u_ExecInTermWindow() {
return i18n(
"Exec&ute in terminal window"); }
150TQString EditAlarmDlg::i18n_g_LogToFile() {
return i18n(
"Lo&g to file"); }
151TQString EditAlarmDlg::i18n_CopyEmailToSelf() {
return i18n(
"Copy email to self"); }
152TQString EditAlarmDlg::i18n_e_CopyEmailToSelf() {
return i18n(
"Copy &email to self"); }
153TQString EditAlarmDlg::i18n_s_CopyEmailToSelf() {
return i18n(
"Copy email to &self"); }
154TQString EditAlarmDlg::i18n_EmailFrom() {
return i18n(
"'From' email address",
"From:"); }
155TQString EditAlarmDlg::i18n_f_EmailFrom() {
return i18n(
"'From' email address",
"&From:"); }
156TQString EditAlarmDlg::i18n_EmailTo() {
return i18n(
"Email addressee",
"To:"); }
157TQString EditAlarmDlg::i18n_EmailSubject() {
return i18n(
"Email subject",
"Subject:"); }
158TQString EditAlarmDlg::i18n_j_EmailSubject() {
return i18n(
"Email subject",
"Sub&ject:"); }
168EditAlarmDlg::EditAlarmDlg(
bool Template,
const TQString& caption, TQWidget* parent,
const char* name,
169 const KAEvent* event,
bool readOnly)
170 : KDialogBase(parent, (name ? name : Template ?
"TemplEditDlg" :
"EditDlg"), true, caption,
171 (readOnly ? Cancel|Try : Template ? Ok|Cancel|Try : Ok|Cancel|Try|Default),
172 (readOnly ? Cancel : Ok)),
173 mMainPageShown(false),
174 mRecurPageShown(false),
175 mRecurSetDefaultEndDate(true),
176 mTemplateName(nullptr),
177 mSpecialActionsButton(nullptr),
178 mReminderDeferral(false),
179 mReminderArchived(false),
180 mEmailRemoveButton(nullptr),
181 mDeferGroup(nullptr),
182 mTimeWidget(nullptr),
183 mShowInKorganizer(nullptr),
184 mDeferGroupHeight(0),
186 mDesiredReadOnly(readOnly),
190 setButtonText(Default, i18n(
"Load Template..."));
191 TQVBox* mainWidget =
new TQVBox(
this);
192 mainWidget->setSpacing(spacingHint());
193 setMainWidget(mainWidget);
196 TQHBox* box =
new TQHBox(mainWidget);
197 box->setSpacing(spacingHint());
198 TQLabel* label =
new TQLabel(i18n(
"Template name:"), box);
199 label->setFixedSize(label->sizeHint());
200 mTemplateName =
new TQLineEdit(box);
201 mTemplateName->setReadOnly(mReadOnly);
202 label->setBuddy(mTemplateName);
203 TQWhatsThis::add(box, i18n(
"Enter the name of the alarm template"));
204 box->setFixedHeight(box->sizeHint().height());
206 mTabs =
new TQTabWidget(mainWidget);
207 mTabs->setMargin(marginHint());
209 TQVBox* mainPageBox =
new TQVBox(mTabs);
210 mainPageBox->setSpacing(spacingHint());
211 mTabs->addTab(mainPageBox, i18n(
"&Alarm"));
213 PageFrame* mainPage =
new PageFrame(mainPageBox);
214 connect(mainPage, TQ_SIGNAL(shown()), TQ_SLOT(slotShowMainPage()));
215 TQVBoxLayout* topLayout =
new TQVBoxLayout(mainPage, 0, spacingHint());
218 TQVBox* recurTab =
new TQVBox(mTabs);
219 mainPageBox->setSpacing(spacingHint());
220 mTabs->addTab(recurTab, TQString());
222 mRecurrenceEdit =
new RecurrenceEdit(readOnly, recurTab,
"recurPage");
223 connect(mRecurrenceEdit, TQ_SIGNAL(shown()), TQ_SLOT(slotShowRecurrenceEdit()));
224 connect(mRecurrenceEdit, TQ_SIGNAL(typeChanged(
int)), TQ_SLOT(slotRecurTypeChange(
int)));
225 connect(mRecurrenceEdit, TQ_SIGNAL(frequencyChanged()), TQ_SLOT(slotRecurFrequencyChange()));
226 connect(mRecurrenceEdit, TQ_SIGNAL(repeatNeedsInitialisation()), TQ_SLOT(slotSetSubRepetition()));
230 mActionGroup =
new ButtonGroup(i18n(
"Action"), mainPage,
"actionGroup");
231 connect(mActionGroup, TQ_SIGNAL(buttonSet(
int)), TQ_SLOT(slotAlarmTypeChanged(
int)));
232 topLayout->addWidget(mActionGroup, 1);
233 TQBoxLayout* layout =
new TQVBoxLayout(mActionGroup, marginHint(), spacingHint());
234 layout->addSpacing(fontMetrics().lineSpacing()/2);
235 TQGridLayout* grid =
new TQGridLayout(layout, 1, 5);
238 mMessageRadio =
new RadioButton(i18n(
"Te&xt"), mActionGroup,
"messageButton");
239 mMessageRadio->setFixedSize(mMessageRadio->sizeHint());
240 TQWhatsThis::add(mMessageRadio,
241 i18n(
"If checked, the alarm will display a text message."));
242 grid->addWidget(mMessageRadio, 1, 0);
243 grid->setColStretch(1, 1);
246 mFileRadio =
new PickAlarmFileRadio(i18n(
"&File"), mActionGroup,
"fileButton");
247 mFileRadio->setFixedSize(mFileRadio->sizeHint());
248 TQWhatsThis::add(mFileRadio,
249 i18n(
"If checked, the alarm will display the contents of a text or image file."));
250 grid->addWidget(mFileRadio, 1, 2);
251 grid->setColStretch(3, 1);
254 mCommandRadio =
new RadioButton(i18n(
"Co&mmand"), mActionGroup,
"cmdButton");
255 mCommandRadio->setFixedSize(mCommandRadio->sizeHint());
256 TQWhatsThis::add(mCommandRadio,
257 i18n(
"If checked, the alarm will execute a shell command."));
258 grid->addWidget(mCommandRadio, 1, 4);
259 grid->setColStretch(5, 1);
262 mEmailRadio =
new RadioButton(i18n(
"&Email"), mActionGroup,
"emailButton");
263 mEmailRadio->setFixedSize(mEmailRadio->sizeHint());
264 TQWhatsThis::add(mEmailRadio,
265 i18n(
"If checked, the alarm will send an email."));
266 grid->addWidget(mEmailRadio, 1, 6);
268 initDisplayAlarms(mActionGroup);
269 layout->addWidget(mDisplayAlarmsFrame);
270 initCommand(mActionGroup);
271 layout->addWidget(mCommandFrame);
272 initEmail(mActionGroup);
273 layout->addWidget(mEmailFrame);
276 mDeferGroup =
new TQGroupBox(1, TQt::Vertical, i18n(
"Deferred Alarm"), mainPage,
"deferGroup");
277 topLayout->addWidget(mDeferGroup);
278 TQLabel* label =
new TQLabel(i18n(
"Deferred to:"), mDeferGroup);
279 label->setFixedSize(label->sizeHint());
280 mDeferTimeLabel =
new TQLabel(mDeferGroup);
282 mDeferChangeButton =
new TQPushButton(i18n(
"C&hange..."), mDeferGroup);
283 mDeferChangeButton->setFixedSize(mDeferChangeButton->sizeHint());
284 connect(mDeferChangeButton, TQ_SIGNAL(clicked()), TQ_SLOT(slotEditDeferral()));
285 TQWhatsThis::add(mDeferChangeButton, i18n(
"Change the alarm's deferred time, or cancel the deferral"));
286 mDeferGroup->addSpace(0);
288 layout =
new TQHBoxLayout(topLayout);
293 mTemplateTimeGroup =
new ButtonGroup(i18n(
"Time"), mainPage,
"templateGroup");
294 connect(mTemplateTimeGroup, TQ_SIGNAL(buttonSet(
int)), TQ_SLOT(slotTemplateTimeType(
int)));
295 layout->addWidget(mTemplateTimeGroup);
296 grid =
new TQGridLayout(mTemplateTimeGroup, 2, 2, marginHint(), spacingHint());
297 grid->addRowSpacing(0, fontMetrics().lineSpacing()/2);
299 int alignment = TQApplication::reverseLayout() ? TQt::AlignRight : TQt::AlignLeft;
301 mTemplateDefaultTime =
new RadioButton(i18n(
"&Default time"), mTemplateTimeGroup,
"templateDefTimeButton");
302 mTemplateDefaultTime->setFixedSize(mTemplateDefaultTime->sizeHint());
303 mTemplateDefaultTime->setReadOnly(mReadOnly);
304 TQWhatsThis::add(mTemplateDefaultTime,
305 i18n(
"Do not specify a start time for alarms based on this template. "
306 "The normal default start time will be used."));
307 grid->addWidget(mTemplateDefaultTime, 0, 0, alignment);
309 TQHBox* box =
new TQHBox(mTemplateTimeGroup);
310 box->setSpacing(spacingHint());
311 mTemplateUseTime =
new RadioButton(i18n(
"Time:"), box,
"templateTimeButton");
312 mTemplateUseTime->setFixedSize(mTemplateUseTime->sizeHint());
313 mTemplateUseTime->setReadOnly(mReadOnly);
314 TQWhatsThis::add(mTemplateUseTime,
315 i18n(
"Specify a start time for alarms based on this template."));
316 mTemplateTimeGroup->insert(mTemplateUseTime);
317 mTemplateTime =
new TimeEdit(box,
"templateTimeEdit");
318 mTemplateTime->setFixedSize(mTemplateTime->sizeHint());
319 mTemplateTime->setReadOnly(mReadOnly);
320 TQWhatsThis::add(mTemplateTime,
321 TQString(
"%1\n\n%2").arg(i18n(
"Enter the start time for alarms based on this template."))
322 .arg(TimeSpinBox::shiftWhatsThis()));
323 box->setStretchFactor(
new TQWidget(box), 1);
324 box->setFixedHeight(box->sizeHint().height());
325 grid->addWidget(box, 0, 1, alignment);
327 mTemplateAnyTime =
new RadioButton(i18n(
"An&y time"), mTemplateTimeGroup,
"templateAnyTimeButton");
328 mTemplateAnyTime->setFixedSize(mTemplateAnyTime->sizeHint());
329 mTemplateAnyTime->setReadOnly(mReadOnly);
330 TQWhatsThis::add(mTemplateAnyTime,
331 i18n(
"Set the '%1' option for alarms based on this template.").arg(i18n(
"Any time")));
332 grid->addWidget(mTemplateAnyTime, 1, 0, alignment);
334 box =
new TQHBox(mTemplateTimeGroup);
335 box->setSpacing(spacingHint());
336 mTemplateUseTimeAfter =
new RadioButton(AlarmTimeWidget::i18n_w_TimeFromNow(), box,
"templateFromNowButton");
337 mTemplateUseTimeAfter->setFixedSize(mTemplateUseTimeAfter->sizeHint());
338 mTemplateUseTimeAfter->setReadOnly(mReadOnly);
339 TQWhatsThis::add(mTemplateUseTimeAfter,
340 i18n(
"Set alarms based on this template to start after the specified time "
341 "interval from when the alarm is created."));
342 mTemplateTimeGroup->insert(mTemplateUseTimeAfter);
343 mTemplateTimeAfter =
new TimeSpinBox(1, maxDelayTime, box);
344 mTemplateTimeAfter->setValue(1439);
345 mTemplateTimeAfter->setFixedSize(mTemplateTimeAfter->sizeHint());
346 mTemplateTimeAfter->setReadOnly(mReadOnly);
347 TQWhatsThis::add(mTemplateTimeAfter,
348 TQString(
"%1\n\n%2").arg(AlarmTimeWidget::i18n_TimeAfterPeriod())
349 .arg(TimeSpinBox::shiftWhatsThis()));
350 box->setFixedHeight(box->sizeHint().height());
351 grid->addWidget(box, 1, 1, alignment);
353 layout->addStretch();
357 mTimeWidget =
new AlarmTimeWidget(i18n(
"Time"), AlarmTimeWidget::AT_TIME, mainPage,
"timeGroup");
358 connect(mTimeWidget, TQ_SIGNAL(anyTimeToggled(
bool)), TQ_SLOT(slotAnyTimeToggled(
bool)));
359 topLayout->addWidget(mTimeWidget);
363 static const TQString reminderText = i18n(
"Enter how long in advance of the main alarm to display a reminder alarm.");
364 mReminder =
new Reminder(i18n(
"Rem&inder:"),
365 i18n(
"Check to additionally display a reminder in advance of the main alarm time(s)."),
366 TQString(
"%1\n\n%2").arg(reminderText).arg(TimeSpinBox::shiftWhatsThis()),
367 true,
true, mainPage);
368 mReminder->setFixedSize(mReminder->sizeHint());
369 topLayout->addWidget(mReminder, 0, TQt::AlignAuto);
372 mLateCancel =
new LateCancelSelector(
true, mainPage);
373 topLayout->addWidget(mLateCancel, 0, TQt::AlignAuto);
376 layout =
new TQHBoxLayout(topLayout, 0);
377 mConfirmAck = createConfirmAckCheckbox(mainPage);
378 mConfirmAck->setFixedSize(mConfirmAck->sizeHint());
379 layout->addWidget(mConfirmAck);
380 layout->addSpacing(2*spacingHint());
381 layout->addStretch();
383 if (theApp()->korganizerEnabled())
386 mShowInKorganizer =
new CheckBox(i18n_ShowInKOrganizer(), mainPage);
387 mShowInKorganizer->setFixedSize(mShowInKorganizer->sizeHint());
388 TQWhatsThis::add(mShowInKorganizer, i18n(
"Check to copy the alarm into KOrganizer's calendar"));
389 layout->addWidget(mShowInKorganizer);
392 setButtonWhatsThis(Ok, i18n(
"Schedule the alarm at the specified time."));
397 mTemplateName->setFocus();
400 saveState((event && (mTemplate || !event->isTemplate())) ? event : nullptr);
406 mDesktop = KWin::currentDesktop();
409EditAlarmDlg::~EditAlarmDlg()
417void EditAlarmDlg::initDisplayAlarms(TQWidget* parent)
419 mDisplayAlarmsFrame =
new TQFrame(parent);
420 mDisplayAlarmsFrame->setFrameStyle(TQFrame::NoFrame);
421 TQBoxLayout* frameLayout =
new TQVBoxLayout(mDisplayAlarmsFrame, 0, spacingHint());
424 mTextMessageEdit =
new TextEdit(mDisplayAlarmsFrame);
425 mTextMessageEdit->setWordWrap(KTextEdit::NoWrap);
426 TQWhatsThis::add(mTextMessageEdit, i18n(
"Enter the text of the alarm message. It may be multi-line."));
427 frameLayout->addWidget(mTextMessageEdit);
430 mFileBox =
new TQHBox(mDisplayAlarmsFrame);
431 frameLayout->addWidget(mFileBox);
432 mFileMessageEdit =
new LineEdit(LineEdit::Url, mFileBox);
433 mFileMessageEdit->setAcceptDrops(
true);
434 TQWhatsThis::add(mFileMessageEdit, i18n(
"Enter the name or URL of a text or image file to display."));
437 mFileBrowseButton =
new TQPushButton(mFileBox);
438 mFileBrowseButton->setPixmap(SmallIcon(
"document-open"));
439 mFileBrowseButton->setFixedSize(mFileBrowseButton->sizeHint());
440 TQToolTip::add(mFileBrowseButton, i18n(
"Choose a file"));
441 TQWhatsThis::add(mFileBrowseButton, i18n(
"Select a text or image file to display."));
442 mFileRadio->init(mFileBrowseButton, mFileMessageEdit);
445 mFontColourButton =
new FontColourButton(mDisplayAlarmsFrame);
446 mFontColourButton->setMaximumHeight(mFontColourButton->sizeHint().height());
447 frameLayout->addWidget(mFontColourButton);
449 TQHBoxLayout* layout =
new TQHBoxLayout(frameLayout, 0,
nullptr);
450 mBgColourBox =
new TQHBox(mDisplayAlarmsFrame);
451 mBgColourBox->setSpacing(spacingHint());
452 layout->addWidget(mBgColourBox);
453 layout->addStretch();
454 TQLabel* label =
new TQLabel(i18n(
"&Background color:"), mBgColourBox);
455 mBgColourButton =
new ColourCombo(mBgColourBox);
456 label->setBuddy(mBgColourButton);
457 TQWhatsThis::add(mBgColourBox, i18n(
"Select the alarm message background color"));
460 layout =
new TQHBoxLayout(frameLayout);
461 mSoundPicker =
new SoundPicker(mDisplayAlarmsFrame);
462 mSoundPicker->setFixedSize(mSoundPicker->sizeHint());
463 layout->addWidget(mSoundPicker);
464 layout->addSpacing(2*spacingHint());
465 layout->addStretch();
467 if (ShellProcess::authorised())
470 mSpecialActionsButton =
new SpecialActionsButton(i18n_SpecialActions(), mDisplayAlarmsFrame);
471 mSpecialActionsButton->setFixedSize(mSpecialActionsButton->sizeHint());
472 layout->addWidget(mSpecialActionsButton);
476 mFilePadding =
new TQHBox(mDisplayAlarmsFrame);
477 frameLayout->addWidget(mFilePadding);
478 frameLayout->setStretchFactor(mFilePadding, 1);
484void EditAlarmDlg::initCommand(TQWidget* parent)
486 mCommandFrame =
new TQFrame(parent);
487 mCommandFrame->setFrameStyle(TQFrame::NoFrame);
488 TQBoxLayout* frameLayout =
new TQVBoxLayout(mCommandFrame, 0, spacingHint());
490 mCmdTypeScript =
new CheckBox(i18n_p_EnterScript(), mCommandFrame);
491 mCmdTypeScript->setFixedSize(mCmdTypeScript->sizeHint());
492 connect(mCmdTypeScript, TQ_SIGNAL(toggled(
bool)), TQ_SLOT(slotCmdScriptToggled(
bool)));
493 TQWhatsThis::add(mCmdTypeScript, i18n(
"Check to enter the contents of a script instead of a shell command line"));
494 frameLayout->addWidget(mCmdTypeScript, 0, TQt::AlignAuto);
496 mCmdCommandEdit =
new LineEdit(LineEdit::Url, mCommandFrame);
497 TQWhatsThis::add(mCmdCommandEdit, i18n(
"Enter a shell command to execute."));
498 frameLayout->addWidget(mCmdCommandEdit);
500 mCmdScriptEdit =
new TextEdit(mCommandFrame);
501 TQWhatsThis::add(mCmdScriptEdit, i18n(
"Enter the contents of a script to execute"));
502 frameLayout->addWidget(mCmdScriptEdit);
506 mCmdOutputGroup =
new ButtonGroup(i18n(
"Command Output"), mCommandFrame);
507 frameLayout->addWidget(mCmdOutputGroup);
508 TQBoxLayout* layout =
new TQVBoxLayout(mCmdOutputGroup, marginHint(), spacingHint());
509 layout->addSpacing(fontMetrics().lineSpacing()/2);
512 RadioButton* button =
new RadioButton(i18n_u_ExecInTermWindow(), mCmdOutputGroup,
"execInTerm");
513 button->setFixedSize(button->sizeHint());
514 TQWhatsThis::add(button, i18n(
"Check to execute the command in a terminal window"));
515 mCmdOutputGroup->insert(button, EXEC_IN_TERMINAL);
516 layout->addWidget(button, 0, TQt::AlignAuto);
519 TQHBox* box =
new TQHBox(mCmdOutputGroup);
520 (
new TQWidget(box))->setFixedWidth(button->style().subRect(TQStyle::SR_RadioButtonIndicator, button).width());
522 mCmdLogFileEdit =
new LineEdit(LineEdit::Url, box);
523 mCmdLogFileEdit->setAcceptDrops(
true);
524 TQWhatsThis::add(mCmdLogFileEdit, i18n(
"Enter the name or path of the log file."));
528 TQPushButton* browseButton =
new TQPushButton(box);
529 browseButton->setPixmap(SmallIcon(
"document-open"));
530 browseButton->setFixedSize(browseButton->sizeHint());
531 TQToolTip::add(browseButton, i18n(
"Choose a file"));
532 TQWhatsThis::add(browseButton, i18n(
"Select a log file."));
535 button =
new PickLogFileRadio(browseButton, mCmdLogFileEdit, i18n_g_LogToFile(), mCmdOutputGroup,
"cmdLog");
536 button->setFixedSize(button->sizeHint());
537 TQWhatsThis::add(button,
538 i18n(
"Check to log the command output to a local file. The output will be appended to any existing contents of the file."));
539 mCmdOutputGroup->insert(button, LOG_TO_FILE);
540 layout->addWidget(button, 0, TQt::AlignAuto);
541 layout->addWidget(box);
544 button =
new RadioButton(i18n(
"Discard"), mCmdOutputGroup,
"cmdDiscard");
545 button->setFixedSize(button->sizeHint());
546 TQWhatsThis::add(button, i18n(
"Check to discard command output."));
547 mCmdOutputGroup->insert(button, DISCARD_OUTPUT);
548 layout->addWidget(button, 0, TQt::AlignAuto);
551 mCmdPadding =
new TQHBox(mCommandFrame);
552 frameLayout->addWidget(mCmdPadding);
553 frameLayout->setStretchFactor(mCmdPadding, 1);
559void EditAlarmDlg::initEmail(TQWidget* parent)
561 mEmailFrame =
new TQFrame(parent);
562 mEmailFrame->setFrameStyle(TQFrame::NoFrame);
563 TQBoxLayout* layout =
new TQVBoxLayout(mEmailFrame, 0, spacingHint());
564 TQGridLayout* grid =
new TQGridLayout(layout, 3, 3, spacingHint());
565 grid->setColStretch(1, 1);
567 mEmailFromList =
nullptr;
568 if (Preferences::emailFrom() == Preferences::MAIL_FROM_KMAIL)
571 TQLabel* label =
new TQLabel(i18n_EmailFrom(), mEmailFrame);
572 label->setFixedSize(label->sizeHint());
573 grid->addWidget(label, 0, 0);
575 mEmailFromList =
new EmailIdCombo(KAMail::identityManager(), mEmailFrame);
576 mEmailFromList->setMinimumSize(mEmailFromList->sizeHint());
577 label->setBuddy(mEmailFromList);
578 TQWhatsThis::add(mEmailFromList,
579 i18n(
"Your email identity, used to identify you as the sender when sending email alarms."));
580 grid->addMultiCellWidget(mEmailFromList, 0, 0, 1, 2);
584 TQLabel* label =
new TQLabel(i18n_EmailTo(), mEmailFrame);
585 label->setFixedSize(label->sizeHint());
586 grid->addWidget(label, 1, 0);
588 mEmailToEdit =
new LineEdit(LineEdit::Emails, mEmailFrame);
589 mEmailToEdit->setMinimumSize(mEmailToEdit->sizeHint());
590 TQWhatsThis::add(mEmailToEdit,
591 i18n(
"Enter the addresses of the email recipients. Separate multiple addresses by "
592 "commas or semicolons."));
593 grid->addWidget(mEmailToEdit, 1, 1);
595 mEmailAddressButton =
new TQPushButton(mEmailFrame);
596 mEmailAddressButton->setPixmap(SmallIcon(
"contents"));
597 mEmailAddressButton->setFixedSize(mEmailAddressButton->sizeHint());
598 connect(mEmailAddressButton, TQ_SIGNAL(clicked()), TQ_SLOT(openAddressBook()));
599 TQToolTip::add(mEmailAddressButton, i18n(
"Open address book"));
600 TQWhatsThis::add(mEmailAddressButton, i18n(
"Select email addresses from your address book."));
601 grid->addWidget(mEmailAddressButton, 1, 2);
604 label =
new TQLabel(i18n_j_EmailSubject(), mEmailFrame);
605 label->setFixedSize(label->sizeHint());
606 grid->addWidget(label, 2, 0);
608 mEmailSubjectEdit =
new LineEdit(mEmailFrame);
609 mEmailSubjectEdit->setMinimumSize(mEmailSubjectEdit->sizeHint());
610 label->setBuddy(mEmailSubjectEdit);
611 TQWhatsThis::add(mEmailSubjectEdit, i18n(
"Enter the email subject."));
612 grid->addMultiCellWidget(mEmailSubjectEdit, 2, 2, 1, 2);
615 mEmailMessageEdit =
new TextEdit(mEmailFrame);
616 TQWhatsThis::add(mEmailMessageEdit, i18n(
"Enter the email message."));
617 layout->addWidget(mEmailMessageEdit);
620 grid =
new TQGridLayout(layout, 2, 3, spacingHint());
621 label =
new TQLabel(i18n(
"Attachment&s:"), mEmailFrame);
622 label->setFixedSize(label->sizeHint());
623 grid->addWidget(label, 0, 0);
625 mEmailAttachList =
new TQComboBox(
true, mEmailFrame);
626 mEmailAttachList->setMinimumSize(mEmailAttachList->sizeHint());
627 mEmailAttachList->lineEdit()->setReadOnly(
true);
628TQListBox* list = mEmailAttachList->listBox();
629TQRect rect = list->geometry();
630list->setGeometry(rect.left() - 50, rect.top(), rect.width(), rect.height());
631 label->setBuddy(mEmailAttachList);
632 TQWhatsThis::add(mEmailAttachList,
633 i18n(
"Files to send as attachments to the email."));
634 grid->addWidget(mEmailAttachList, 0, 1);
635 grid->setColStretch(1, 1);
637 mEmailAddAttachButton =
new TQPushButton(i18n(
"Add..."), mEmailFrame);
638 connect(mEmailAddAttachButton, TQ_SIGNAL(clicked()), TQ_SLOT(slotAddAttachment()));
639 TQWhatsThis::add(mEmailAddAttachButton, i18n(
"Add an attachment to the email."));
640 grid->addWidget(mEmailAddAttachButton, 0, 2);
642 mEmailRemoveButton =
new TQPushButton(i18n(
"Remo&ve"), mEmailFrame);
643 connect(mEmailRemoveButton, TQ_SIGNAL(clicked()), TQ_SLOT(slotRemoveAttachment()));
644 TQWhatsThis::add(mEmailRemoveButton, i18n(
"Remove the highlighted attachment from the email."));
645 grid->addWidget(mEmailRemoveButton, 1, 2);
648 mEmailBcc =
new CheckBox(i18n_s_CopyEmailToSelf(), mEmailFrame);
649 mEmailBcc->setFixedSize(mEmailBcc->sizeHint());
650 TQWhatsThis::add(mEmailBcc,
651 i18n(
"If checked, the email will be blind copied to you."));
652 grid->addMultiCellWidget(mEmailBcc, 1, 1, 0, 1, TQt::AlignAuto);
658void EditAlarmDlg::initialise(
const KAEvent* event)
660 mReadOnly = mDesiredReadOnly;
661 if (!mTemplate && event && event->action() == KAEvent::COMMAND && !ShellProcess::authorised())
666 mOnlyDeferred =
false;
667 mExpiredRecurrence =
false;
668 mKMailSerialNumber = 0;
669 bool deferGroupVisible =
false;
674 mTemplateName->setText(event->templateName());
675 bool recurs =
event->recurs();
676 if ((recurs || event->repeatCount()) && !mTemplate && event->deferred())
678 deferGroupVisible =
true;
679 mDeferDateTime =
event->deferDateTime();
680 mDeferTimeLabel->setText(mDeferDateTime.formatLocale());
683 if (event->defaultFont())
684 mFontColourButton->setDefaultFont();
686 mFontColourButton->setFont(event->font());
687 mFontColourButton->setBgColour(event->bgColour());
688 mFontColourButton->setFgColour(event->fgColour());
689 mBgColourButton->setColour(event->bgColour());
693 int afterTime =
event->isTemplate() ?
event->templateAfterTime() : -1;
694 bool noTime = !afterTime;
695 bool useTime = !
event->mainDateTime().isDateOnly();
696 int button = mTemplateTimeGroup->id(noTime ? mTemplateDefaultTime :
697 (afterTime > 0) ? mTemplateUseTimeAfter :
698 useTime ? mTemplateUseTime : mTemplateAnyTime);
699 mTemplateTimeGroup->setButton(button);
700 mTemplateTimeAfter->setValue(afterTime > 0 ? afterTime : 1);
701 if (!noTime && useTime)
702 mTemplateTime->setValue(event->mainDateTime().time());
704 mTemplateTime->setValue(0);
708 if (event->isTemplate())
711 TQDateTime now = TQDateTime::currentDateTime();
712 int afterTime =
event->templateAfterTime();
715 mTimeWidget->setDateTime(TQDateTime(now.addSecs(afterTime * 60)));
716 mTimeWidget->selectTimeFromNow();
720 TQDate d = now.date();
721 TQTime t =
event->startDateTime().time();
722 bool dateOnly =
event->startDateTime().isDateOnly();
723 if (!dateOnly && now.time() >= t)
725 mTimeWidget->setDateTime(DateTime(TQDateTime(d, t), dateOnly));
730 mExpiredRecurrence = recurs &&
event->mainExpired();
731 mTimeWidget->setDateTime(recurs || event->uidStatus() == KAEvent::EXPIRED ? event->startDateTime()
732 : event->mainExpired() ? event->deferDateTime() : event->mainDateTime());
736 KAEvent::Action action =
event->action();
738 if (event->commandScript())
739 altext.setScript(event->cleanText());
741 altext.setText(event->cleanText());
742 setAction(action, altext);
743 if (action == KAEvent::MESSAGE && event->kmailSerialNumber()
744 && AlarmText::checkIfEmail(event->cleanText()))
745 mKMailSerialNumber =
event->kmailSerialNumber();
746 if (action == KAEvent::EMAIL)
747 mEmailAttachList->insertStringList(event->emailAttachments());
749 mLateCancel->setMinutes(event->lateCancel(), event->startDateTime().isDateOnly(),
750 TimePeriod::HOURS_MINUTES);
751 mLateCancel->showAutoClose(action == KAEvent::MESSAGE || action == KAEvent::FILE);
752 mLateCancel->setAutoClose(event->autoClose());
753 mLateCancel->setFixedSize(mLateCancel->sizeHint());
754 if (mShowInKorganizer)
755 mShowInKorganizer->setChecked(event->copyToKOrganizer());
756 mConfirmAck->setChecked(event->confirmAck());
757 int reminder =
event->reminder();
758 if (!reminder && event->reminderDeferral() && !recurs)
760 reminder =
event->reminderDeferral();
761 mReminderDeferral =
true;
763 if (!reminder && event->reminderArchived() && recurs)
765 reminder =
event->reminderArchived();
766 mReminderArchived =
true;
768 mReminder->setMinutes(reminder, (mTimeWidget ? mTimeWidget->anyTime() : mTemplateAnyTime->isOn()));
769 mReminder->setOnceOnly(event->reminderOnceOnly());
770 mReminder->enableOnceOnly(event->recurs());
771 if (mSpecialActionsButton)
772 mSpecialActionsButton->setActions(event->preAction(), event->postAction());
773 mRecurrenceEdit->set(*event, (mTemplate || event->isTemplate()));
774 mTabs->setTabLabel(mTabs->page(mRecurPageIndex), recurText(*event));
775 SoundPicker::Type soundType =
event->speak() ? SoundPicker::SPEAK
776 :
event->beep() ? SoundPicker::BEEP
777 : !
event->audioFile().isEmpty() ? SoundPicker::PLAY_FILE
779 mSoundPicker->set(soundType, event->audioFile(), event->soundVolume(),
780 event->fadeVolume(), event->fadeSeconds(), event->repeatSound());
781 CmdLogType logType =
event->commandXterm() ? EXEC_IN_TERMINAL
782 : !
event->logFile().isEmpty() ? LOG_TO_FILE
784 if (logType == LOG_TO_FILE)
785 mCmdLogFileEdit->setText(event->logFile());
786 mCmdOutputGroup->setButton(logType);
787 mEmailToEdit->setText(event->emailAddresses(
", "));
788 mEmailSubjectEdit->setText(event->emailSubject());
789 mEmailBcc->setChecked(event->emailBcc());
791 mEmailFromList->setCurrentIdentity(event->emailFromId());
796 if (!ShellProcess::authorised())
799 mCommandRadio->setEnabled(
false);
800 if (mSpecialActionsButton)
801 mSpecialActionsButton->setEnabled(
false);
803 mFontColourButton->setDefaultFont();
804 mFontColourButton->setBgColour(Preferences::defaultBgColour());
805 mFontColourButton->setFgColour(Preferences::defaultFgColour());
806 mBgColourButton->setColour(Preferences::defaultBgColour());
807 TQDateTime defaultTime = TQDateTime::currentDateTime().addSecs(60);
810 mTemplateTimeGroup->setButton(mTemplateTimeGroup->id(mTemplateDefaultTime));
811 mTemplateTime->setValue(0);
812 mTemplateTimeAfter->setValue(1);
815 mTimeWidget->setDateTime(defaultTime);
816 mActionGroup->setButton(mActionGroup->id(mMessageRadio));
817 mLateCancel->setMinutes((Preferences::defaultLateCancel() ? 1 : 0), false, TimePeriod::HOURS_MINUTES);
818 mLateCancel->showAutoClose(
true);
819 mLateCancel->setAutoClose(Preferences::defaultAutoClose());
820 mLateCancel->setFixedSize(mLateCancel->sizeHint());
821 if (mShowInKorganizer)
822 mShowInKorganizer->setChecked(Preferences::defaultCopyToKOrganizer());
823 mConfirmAck->setChecked(Preferences::defaultConfirmAck());
824 if (mSpecialActionsButton)
825 mSpecialActionsButton->setActions(Preferences::defaultPreAction(), Preferences::defaultPostAction());
826 mRecurrenceEdit->setDefaults(defaultTime);
827 slotRecurFrequencyChange();
828 mReminder->setMinutes(0,
false);
829 mReminder->enableOnceOnly(mRecurrenceEdit->isTimedRepeatType());
830 mSoundPicker->set(Preferences::defaultSoundType(), Preferences::defaultSoundFile(),
831 Preferences::defaultSoundVolume(), -1, 0, Preferences::defaultSoundRepeat());
832 mCmdTypeScript->setChecked(Preferences::defaultCmdScript());
833 mCmdLogFileEdit->setText(Preferences::defaultCmdLogFile());
834 mCmdOutputGroup->setButton(Preferences::defaultCmdLogType());
835 mEmailBcc->setChecked(Preferences::defaultEmailBcc());
837 slotCmdScriptToggled(mCmdTypeScript->isChecked());
839 if (!deferGroupVisible)
842 bool enable = !!mEmailAttachList->count();
843 mEmailAttachList->setEnabled(enable);
844 if (mEmailRemoveButton)
845 mEmailRemoveButton->setEnabled(enable);
847 bool empty = cal->isOpen() && !cal->events().count();
848 enableButton(Default, !empty);
854void EditAlarmDlg::setReadOnly()
857 mMessageRadio->setReadOnly(mReadOnly);
858 mFileRadio->setReadOnly(mReadOnly);
859 mCommandRadio->setReadOnly(mReadOnly);
860 mEmailRadio->setReadOnly(mReadOnly);
862 mTimeWidget->setReadOnly(mReadOnly);
863 mLateCancel->setReadOnly(mReadOnly);
865 mDeferChangeButton->hide();
867 mDeferChangeButton->show();
868 if (mShowInKorganizer)
869 mShowInKorganizer->setReadOnly(mReadOnly);
872 mTextMessageEdit->setReadOnly(mReadOnly);
873 mFileMessageEdit->setReadOnly(mReadOnly);
874 mFontColourButton->setReadOnly(mReadOnly);
875 mBgColourButton->setReadOnly(mReadOnly);
876 mSoundPicker->setReadOnly(mReadOnly);
877 mConfirmAck->setReadOnly(mReadOnly);
878 mReminder->setReadOnly(mReadOnly);
879 if (mSpecialActionsButton)
880 mSpecialActionsButton->setReadOnly(mReadOnly);
883 mFileBrowseButton->hide();
884 mFontColourButton->hide();
888 mFileBrowseButton->show();
889 mFontColourButton->show();
893 mCmdTypeScript->setReadOnly(mReadOnly);
894 mCmdCommandEdit->setReadOnly(mReadOnly);
895 mCmdScriptEdit->setReadOnly(mReadOnly);
896 for (
int id = DISCARD_OUTPUT;
id < EXEC_IN_TERMINAL; ++id)
897 ((RadioButton*)mCmdOutputGroup->find(
id))->setReadOnly(mReadOnly);
900 mEmailToEdit->setReadOnly(mReadOnly);
901 mEmailSubjectEdit->setReadOnly(mReadOnly);
902 mEmailMessageEdit->setReadOnly(mReadOnly);
903 mEmailBcc->setReadOnly(mReadOnly);
905 mEmailFromList->setReadOnly(mReadOnly);
908 mEmailAddressButton->hide();
909 mEmailAddAttachButton->hide();
910 mEmailRemoveButton->hide();
914 mEmailAddressButton->show();
915 mEmailAddAttachButton->show();
916 mEmailRemoveButton->show();
923void EditAlarmDlg::setAction(KAEvent::Action action,
const AlarmText& alarmText)
925 TQString text = alarmText.displayText();
927 TQRadioButton* radio;
932 mFileMessageEdit->setText(text);
934 case KAEvent::COMMAND:
935 radio = mCommandRadio;
936 script = alarmText.isScript();
937 mCmdTypeScript->setChecked(script);
939 mCmdScriptEdit->setText(text);
941 mCmdCommandEdit->setText(text);
945 mEmailMessageEdit->setText(text);
947 case KAEvent::MESSAGE:
949 radio = mMessageRadio;
950 mTextMessageEdit->setText(text);
951 mKMailSerialNumber = 0;
952 if (alarmText.isEmail())
954 mKMailSerialNumber = alarmText.kmailSerialNumber();
957 mEmailToEdit->setText(alarmText.to());
958 mEmailSubjectEdit->setText(alarmText.subject());
959 mEmailMessageEdit->setText(alarmText.body());
961 else if (alarmText.isScript())
964 mCmdScriptEdit->setText(text);
965 mCmdTypeScript->setChecked(
true);
969 mActionGroup->setButton(mActionGroup->id(radio));
975CheckBox* EditAlarmDlg::createConfirmAckCheckbox(TQWidget* parent,
const char* name)
977 CheckBox* widget =
new CheckBox(i18n_k_ConfirmAck(), parent, name);
978 TQWhatsThis::add(widget,
979 i18n(
"Check to be prompted for confirmation when you acknowledge the alarm."));
986void EditAlarmDlg::saveState(
const KAEvent* event)
989 mSavedEvent =
nullptr;
991 mSavedEvent =
new KAEvent(*event);
994 mSavedTemplateName = mTemplateName->text();
995 mSavedTemplateTimeType = mTemplateTimeGroup->selected();
996 mSavedTemplateTime = mTemplateTime->time();
997 mSavedTemplateAfterTime = mTemplateTimeAfter->value();
999 mSavedTypeRadio = mActionGroup->selected();
1000 mSavedSoundType = mSoundPicker->sound();
1001 mSavedSoundFile = mSoundPicker->file();
1002 mSavedSoundVolume = mSoundPicker->volume(mSavedSoundFadeVolume, mSavedSoundFadeSeconds);
1003 mSavedRepeatSound = mSoundPicker->repeat();
1004 mSavedConfirmAck = mConfirmAck->isChecked();
1005 mSavedFont = mFontColourButton->font();
1006 mSavedFgColour = mFontColourButton->fgColour();
1007 mSavedBgColour = mFileRadio->isOn() ? mBgColourButton->colour() : mFontColourButton->bgColour();
1008 mSavedReminder = mReminder->minutes();
1009 mSavedOnceOnly = mReminder->isOnceOnly();
1010 if (mSpecialActionsButton)
1012 mSavedPreAction = mSpecialActionsButton->preAction();
1013 mSavedPostAction = mSpecialActionsButton->postAction();
1015 checkText(mSavedTextFileCommandMessage,
false);
1016 mSavedCmdScript = mCmdTypeScript->isChecked();
1017 mSavedCmdOutputRadio = mCmdOutputGroup->selected();
1018 mSavedCmdLogFile = mCmdLogFileEdit->text();
1020 mSavedEmailFrom = mEmailFromList->currentIdentityName();
1021 mSavedEmailTo = mEmailToEdit->text();
1022 mSavedEmailSubject = mEmailSubjectEdit->text();
1023 mSavedEmailAttach.clear();
1024 for (
int i = 0; i < mEmailAttachList->count(); ++i)
1025 mSavedEmailAttach += mEmailAttachList->text(i);
1026 mSavedEmailBcc = mEmailBcc->isChecked();
1028 mSavedDateTime = mTimeWidget->getDateTime(
nullptr,
false,
false);
1029 mSavedLateCancel = mLateCancel->minutes();
1030 mSavedAutoClose = mLateCancel->isAutoClose();
1031 if (mShowInKorganizer)
1032 mSavedShowInKorganizer = mShowInKorganizer->isChecked();
1033 mSavedRecurrenceType = mRecurrenceEdit->repeatType();
1043bool EditAlarmDlg::stateChanged()
const
1046 mOnlyDeferred =
false;
1049 TQString textFileCommandMessage;
1050 checkText(textFileCommandMessage,
false);
1053 if (mSavedTemplateName != mTemplateName->text()
1054 || mSavedTemplateTimeType != mTemplateTimeGroup->selected()
1055 || (mTemplateUseTime->isOn() && mSavedTemplateTime != mTemplateTime->time())
1056 || (mTemplateUseTimeAfter->isOn() && mSavedTemplateAfterTime != mTemplateTimeAfter->value()))
1060 if (mSavedDateTime != mTimeWidget->getDateTime(
nullptr,
false,
false))
1062 if (mSavedTypeRadio != mActionGroup->selected()
1063 || mSavedLateCancel != mLateCancel->minutes()
1064 || (mShowInKorganizer && mSavedShowInKorganizer != mShowInKorganizer->isChecked())
1065 || textFileCommandMessage != mSavedTextFileCommandMessage
1066 || mSavedRecurrenceType != mRecurrenceEdit->repeatType())
1068 if (mMessageRadio->isOn() || mFileRadio->isOn())
1070 if (mSavedSoundType != mSoundPicker->sound()
1071 || mSavedConfirmAck != mConfirmAck->isChecked()
1072 || mSavedFont != mFontColourButton->font()
1073 || mSavedFgColour != mFontColourButton->fgColour()
1074 || mSavedBgColour != (mFileRadio->isOn() ? mBgColourButton->colour() : mFontColourButton->bgColour())
1075 || mSavedReminder != mReminder->minutes()
1076 || mSavedOnceOnly != mReminder->isOnceOnly()
1077 || mSavedAutoClose != mLateCancel->isAutoClose())
1079 if (mSpecialActionsButton)
1081 if (mSavedPreAction != mSpecialActionsButton->preAction()
1082 || mSavedPostAction != mSpecialActionsButton->postAction())
1085 if (mSavedSoundType == SoundPicker::PLAY_FILE)
1087 if (mSavedSoundFile != mSoundPicker->file())
1089 if (!mSavedSoundFile.isEmpty())
1093 if (mSavedRepeatSound != mSoundPicker->repeat()
1094 || mSavedSoundVolume != mSoundPicker->volume(fadeVolume, fadeSecs)
1095 || mSavedSoundFadeVolume != fadeVolume
1096 || mSavedSoundFadeSeconds != fadeSecs)
1101 else if (mCommandRadio->isOn())
1103 if (mSavedCmdScript != mCmdTypeScript->isChecked()
1104 || mSavedCmdOutputRadio != mCmdOutputGroup->selected())
1106 if (mCmdOutputGroup->selectedId() == LOG_TO_FILE)
1108 if (mSavedCmdLogFile != mCmdLogFileEdit->text())
1112 else if (mEmailRadio->isOn())
1114 TQStringList emailAttach;
1115 for (
int i = 0; i < mEmailAttachList->count(); ++i)
1116 emailAttach += mEmailAttachList->text(i);
1117 if ((mEmailFromList && mSavedEmailFrom != mEmailFromList->currentIdentityName())
1118 || mSavedEmailTo != mEmailToEdit->text()
1119 || mSavedEmailSubject != mEmailSubjectEdit->text()
1120 || mSavedEmailAttach != emailAttach
1121 || mSavedEmailBcc != mEmailBcc->isChecked())
1124 if (mRecurrenceEdit->stateChanged())
1126 if (mSavedEvent && mSavedEvent->deferred())
1127 mOnlyDeferred =
true;
1137bool EditAlarmDlg::getEvent(
KAEvent& event)
1142 setEvent(event, mAlarmMessage,
false);
1147 event = *mSavedEvent;
1152 if (mDeferDateTime.isValid())
1153 event.defer(mDeferDateTime, event.reminderDeferral(),
false);
1155 event.cancelDefer();
1165void EditAlarmDlg::setEvent(
KAEvent& event,
const TQString& text,
bool trial)
1171 dt = mAlarmDateTime.dateTime();
1172 else if (mTemplateUseTime->isOn())
1173 dt = TQDateTime(TQDate(2000,1,1), mTemplateTime->time());
1175 KAEvent::Action type = getAlarmType();
1176 event.set(dt, text, (mFileRadio->isOn() ? mBgColourButton->colour() : mFontColourButton->bgColour()),
1177 mFontColourButton->fgColour(), mFontColourButton->font(),
1178 type, (trial ? 0 : mLateCancel->minutes()), getAlarmFlags());
1181 case KAEvent::MESSAGE:
1182 if (AlarmText::checkIfEmail(text))
1183 event.setKMailSerialNumber(mKMailSerialNumber);
1189 float volume = mSoundPicker->volume(fadeVolume, fadeSecs);
1190 event.setAudioFile(mSoundPicker->file(), volume, fadeVolume, fadeSecs);
1192 event.setReminder(mReminder->minutes(), mReminder->isOnceOnly());
1193 if (mSpecialActionsButton)
1194 event.setActions(mSpecialActionsButton->preAction(), mSpecialActionsButton->postAction());
1197 case KAEvent::EMAIL:
1199 uint from = mEmailFromList ? mEmailFromList->currentIdentity() : 0;
1200 event.setEmail(from, mEmailAddresses, mEmailSubjectEdit->text(), mEmailAttachments);
1203 case KAEvent::COMMAND:
1204 if (mCmdOutputGroup->selectedId() == LOG_TO_FILE)
1205 event.setLogFile(mCmdLogFileEdit->text());
1212 if (mRecurrenceEdit->repeatType() != RecurrenceEdit::NO_RECUR)
1214 mRecurrenceEdit->updateEvent(event, !mTemplate);
1215 TQDateTime now = TQDateTime::currentDateTime();
1216 bool dateOnly = mAlarmDateTime.isDateOnly();
1217 if ((dateOnly && mAlarmDateTime.date() < now.date())
1218 || (!dateOnly && mAlarmDateTime.rawDateTime() < now))
1222 event.setNextOccurrence(now);
1224 mAlarmDateTime =
event.startDateTime();
1225 if (mDeferDateTime.isValid() && mDeferDateTime < mAlarmDateTime)
1227 bool deferral =
true;
1228 bool deferReminder =
false;
1229 int reminder = mReminder->minutes();
1232 DateTime remindTime = mAlarmDateTime.addMins(-reminder);
1233 if (mDeferDateTime >= remindTime)
1235 if (remindTime > TQDateTime::currentDateTime())
1237 else if (mDeferDateTime > remindTime)
1238 deferReminder =
true;
1242 event.defer(mDeferDateTime, deferReminder,
false);
1247 int afterTime = mTemplateDefaultTime->isOn() ? 0
1248 : mTemplateUseTimeAfter->isOn() ? mTemplateTimeAfter->value() : -1;
1249 event.setTemplate(mTemplateName->text(), afterTime);
1257int EditAlarmDlg::getAlarmFlags()
const
1259 bool displayAlarm = mMessageRadio->isOn() || mFileRadio->isOn();
1260 bool cmdAlarm = mCommandRadio->isOn();
1261 bool emailAlarm = mEmailRadio->isOn();
1262 return (displayAlarm && mSoundPicker->sound() == SoundPicker::BEEP ? KAEvent::BEEP : 0)
1263 | (displayAlarm && mSoundPicker->sound() == SoundPicker::SPEAK ?
KAEvent::SPEAK : 0)
1264 | (displayAlarm && mSoundPicker->repeat() ?
KAEvent::REPEAT_SOUND : 0)
1265 | (displayAlarm && mConfirmAck->isChecked() ?
KAEvent::CONFIRM_ACK : 0)
1266 | (displayAlarm && mLateCancel->isAutoClose() ?
KAEvent::AUTO_CLOSE : 0)
1267 | (cmdAlarm && mCmdTypeScript->isChecked() ?
KAEvent::SCRIPT : 0)
1268 | (cmdAlarm && mCmdOutputGroup->selectedId() == EXEC_IN_TERMINAL ?
KAEvent::EXEC_IN_XTERM : 0)
1269 | (emailAlarm && mEmailBcc->isChecked() ?
KAEvent::EMAIL_BCC : 0)
1270 | (mShowInKorganizer && mShowInKorganizer->isChecked() ?
KAEvent::COPY_KORGANIZER : 0)
1271 | (mRecurrenceEdit->repeatType() == RecurrenceEdit::AT_LOGIN ?
KAEvent::REPEAT_AT_LOGIN : 0)
1272 | ((mTemplate ? mTemplateAnyTime->isOn() : mAlarmDateTime.isDateOnly()) ?
KAEvent::ANY_TIME : 0)
1273 | (mFontColourButton->defaultFont() ?
KAEvent::DEFAULT_FONT : 0);
1279KAEvent::Action EditAlarmDlg::getAlarmType()
const
1281 return mFileRadio->isOn() ? KAEvent::FILE
1282 : mCommandRadio->isOn() ? KAEvent::COMMAND
1283 : mEmailRadio->isOn() ? KAEvent::EMAIL
1292void EditAlarmDlg::showEvent(TQShowEvent* se)
1294 if (!mDeferGroupHeight)
1296 mDeferGroupHeight = mDeferGroup->height() + spacingHint();
1298 if (KAlarm::readConfigWindowSize(EDIT_DIALOG_NAME, s))
1299 s.setHeight(s.height() + (mDeferGroup->isHidden() ? 0 : mDeferGroupHeight));
1304 KWin::setOnDesktop(winId(), mDesktop);
1305 KDialog::showEvent(se);
1313void EditAlarmDlg::resizeEvent(TQResizeEvent* re)
1317 TQSize s = re->size();
1318 s.setHeight(s.height() - (mDeferGroup->isHidden() ? 0 : mDeferGroupHeight));
1319 KAlarm::writeConfigWindowSize(EDIT_DIALOG_NAME, s);
1321 KDialog::resizeEvent(re);
1328void EditAlarmDlg::slotOk()
1330 if (!stateChanged())
1339 RecurrenceEdit::RepeatType recurType = mRecurrenceEdit->repeatType();
1341 && mTabs->currentPageIndex() == mRecurPageIndex && recurType == RecurrenceEdit::AT_LOGIN)
1342 mTimeWidget->setDateTime(mRecurrenceEdit->endDateTime());
1343 bool timedRecurrence = mRecurrenceEdit->isTimedRepeatType();
1348 TQString name = mTemplateName->text();
1350 errmsg = i18n(
"You must enter a name for the alarm template");
1351 else if (name != mSavedTemplateName)
1354 if (cal && KAEvent::findTemplateName(*cal, name).valid())
1355 errmsg = i18n(
"Template name is already in use");
1357 if (!errmsg.isEmpty())
1359 mTemplateName->setFocus();
1360 KMessageBox::sorry(
this, errmsg);
1366 TQWidget* errWidget;
1367 mAlarmDateTime = mTimeWidget->getDateTime(
nullptr, !timedRecurrence,
false, &errWidget);
1371 mTabs->setCurrentPage(mMainPageIndex);
1372 errWidget->setFocus();
1373 mTimeWidget->getDateTime();
1377 if (!checkCommandData() || !checkEmailData())
1381 if (timedRecurrence)
1385 if (!mRecurrenceEdit->validateDate(mAlarmDateTime))
1387 KMessageBox::sorry(
this, i18n(
"The date/time in the Alarm tab does not "
1388 "match the recurrence settings specified in the Recurrence tab."));
1391 TQDateTime now = TQDateTime::currentDateTime();
1392 if (mAlarmDateTime.date() < now.date()
1393 || (mAlarmDateTime.date() == now.date()
1394 && !mAlarmDateTime.isDateOnly() && mAlarmDateTime.time() < now.time()))
1400 if (( mAlarmDateTime.date() < now.date()
1401 || (mAlarmDateTime.date() == now.date()
1402 && !mAlarmDateTime.isDateOnly() && mAlarmDateTime.time() < now.time()))
1403 && event.nextOccurrence(now, mAlarmDateTime, KAEvent::ALLOW_FOR_REPETITION) == KAEvent::NO_OCCURRENCE)
1405 KMessageBox::sorry(
this, i18n(
"Recurrence has already expired"));
1411 TQWidget* errWidget = mRecurrenceEdit->checkData(mAlarmDateTime.dateTime(), errmsg);
1414 mTabs->setCurrentPage(mRecurPageIndex);
1415 errWidget->setFocus();
1416 KMessageBox::sorry(
this, errmsg);
1420 if (recurType != RecurrenceEdit::NO_RECUR)
1423 int longestRecurInterval = -1;
1424 int reminder = mReminder->minutes();
1425 if (reminder && !mReminder->isOnceOnly())
1427 mRecurrenceEdit->updateEvent(recurEvent,
false);
1428 longestRecurInterval = recurEvent.longestRecurrenceInterval();
1429 if (longestRecurInterval && reminder >= longestRecurInterval)
1431 mTabs->setCurrentPage(mMainPageIndex);
1432 mReminder->setFocusOnCount();
1433 KMessageBox::sorry(
this, i18n(
"Reminder period must be less than the recurrence interval, unless '%1' is checked.").arg(Reminder::i18n_first_recurrence_only()));
1437 if (mRecurrenceEdit->subRepeatCount())
1439 if (longestRecurInterval < 0)
1441 mRecurrenceEdit->updateEvent(recurEvent,
false);
1442 longestRecurInterval = recurEvent.longestRecurrenceInterval();
1444 if (longestRecurInterval > 0
1445 && recurEvent.repeatInterval() * recurEvent.repeatCount() >= longestRecurInterval - reminder)
1447 KMessageBox::sorry(
this, i18n(
"The duration of a repetition within the recurrence must be less than the recurrence interval minus any reminder period"));
1448 mRecurrenceEdit->activateSubRepetition();
1451 if (recurEvent.repeatInterval() % 1440
1452 && ((mTemplate && mTemplateAnyTime->isOn()) || (!mTemplate && mAlarmDateTime.isDateOnly())))
1454 KMessageBox::sorry(
this, i18n(
"For a repetition within the recurrence, its period must be in units of days or weeks for a date-only alarm"));
1455 mRecurrenceEdit->activateSubRepetition();
1460 if (checkText(mAlarmMessage))
1468void EditAlarmDlg::slotTry()
1471 if (checkText(text))
1473 if (mEmailRadio->isOn())
1475 if (!checkEmailData()
1476 || KMessageBox::warningContinueCancel(
this, i18n(
"Do you really want to send the email now to the specified recipient(s)?"),
1477 i18n(
"Confirm Email"), i18n(
"&Send")) != KMessageBox::Continue)
1481 setEvent(event, text,
true);
1482 void* proc = theApp()->execAlarm(event, event.firstAlarm(),
false,
false);
1485 if (mCommandRadio->isOn() && mCmdOutputGroup->selectedId() != EXEC_IN_TERMINAL)
1487 theApp()->commandMessage((ShellProcess*)proc,
this);
1488 KMessageBox::information(
this, i18n(
"Command executed:\n%1").arg(text));
1489 theApp()->commandMessage((ShellProcess*)proc,
nullptr);
1491 else if (mEmailRadio->isOn())
1494 if (mEmailBcc->isChecked())
1495 bcc = i18n(
"\nBcc: %1").arg(Preferences::emailBccAddress());
1496 KMessageBox::information(
this, i18n(
"Email sent to:\n%1%2").arg(mEmailAddresses.join(
"\n")).arg(bcc));
1505void EditAlarmDlg::slotCancel()
1514void EditAlarmDlg::slotDefault()
1516 TemplatePickDlg dlg(
this,
"templPickDlg");
1517 if (dlg.exec() == TQDialog::Accepted)
1518 initialise(dlg.selectedTemplate());
1524void EditAlarmDlg::slotEditDeferral()
1530 int repeatCount = mRecurrenceEdit->subRepeatCount(&repeatInterval);
1531 DateTime start = mSavedEvent->recurs() ? (mExpiredRecurrence ? DateTime() : mSavedEvent->mainDateTime())
1532 : mTimeWidget->getDateTime(nullptr, !repeatCount, !mExpiredRecurrence);
1533 if (!start.isValid())
1535 if (!mExpiredRecurrence)
1539 TQDateTime now = TQDateTime::currentDateTime();
1542 if (repeatCount && start < now)
1545 repeatInterval *= 60;
1546 int repetition = (start.secsTo(now) + repeatInterval - 1) / repeatInterval;
1547 if (repetition > repeatCount)
1549 mTimeWidget->getDateTime();
1552 start = start.addSecs(repetition * repeatInterval);
1556 bool deferred = mDeferDateTime.isValid();
1557 DeferAlarmDlg deferDlg(i18n(
"Defer Alarm"), (deferred ? mDeferDateTime : DateTime(now.addSecs(60))),
1558 deferred, this,
"EditDeferDlg");
1562 int reminder = mReminder->minutes();
1565 DateTime remindTime = start.addMins(-reminder);
1566 if (TQDateTime::currentDateTime() < remindTime)
1569 deferDlg.setLimit(start.addSecs(-60));
1571 if (deferDlg.exec() == TQDialog::Accepted)
1573 mDeferDateTime = deferDlg.getDateTime();
1574 mDeferTimeLabel->setText(mDeferDateTime.isValid() ? mDeferDateTime.formatLocale() : TQString());
1582void EditAlarmDlg::slotShowMainPage()
1584 slotAlarmTypeChanged(-1);
1585 if (!mMainPageShown)
1588 mTemplateName->setFocus();
1589 mMainPageShown =
true;
1593 if (!mReadOnly && mRecurPageShown && mRecurrenceEdit->repeatType() == RecurrenceEdit::AT_LOGIN)
1594 mTimeWidget->setDateTime(mRecurrenceEdit->endDateTime());
1595 if (mReadOnly || mRecurrenceEdit->isTimedRepeatType())
1596 mTimeWidget->setMinDateTime();
1598 mTimeWidget->setMinDateTimeIsCurrent();
1608void EditAlarmDlg::slotShowRecurrenceEdit()
1610 mRecurPageIndex = mTabs->currentPageIndex();
1611 if (!mReadOnly && !mTemplate)
1613 TQDateTime now = TQDateTime::currentDateTime();
1614 mAlarmDateTime = mTimeWidget->getDateTime(
nullptr,
false,
false);
1615 bool expired = (mAlarmDateTime.dateTime() < now);
1616 if (mRecurSetDefaultEndDate)
1618 mRecurrenceEdit->setDefaultEndDate(expired ? now.date() : mAlarmDateTime.date());
1619 mRecurSetDefaultEndDate =
false;
1621 mRecurrenceEdit->setStartDate(mAlarmDateTime.date(), now.date());
1622 if (mRecurrenceEdit->repeatType() == RecurrenceEdit::AT_LOGIN)
1623 mRecurrenceEdit->setEndDateTime(expired ? now : mAlarmDateTime);
1625 mRecurPageShown =
true;
1633void EditAlarmDlg::slotRecurTypeChange(
int repeatType)
1635 bool atLogin = (mRecurrenceEdit->repeatType() == RecurrenceEdit::AT_LOGIN);
1638 bool recurs = (mRecurrenceEdit->repeatType() != RecurrenceEdit::NO_RECUR);
1640 mDeferGroup->setEnabled(recurs);
1641 mTimeWidget->enableAnyTime(!recurs || repeatType != RecurrenceEdit::SUBDAILY);
1644 mAlarmDateTime = mTimeWidget->getDateTime(
nullptr,
false,
false);
1645 mRecurrenceEdit->setEndDateTime(mAlarmDateTime.dateTime());
1647 mReminder->enableOnceOnly(recurs && !atLogin);
1649 mReminder->setEnabled(!atLogin);
1650 mLateCancel->setEnabled(!atLogin);
1651 if (mShowInKorganizer)
1652 mShowInKorganizer->setEnabled(!atLogin);
1653 slotRecurFrequencyChange();
1661void EditAlarmDlg::slotRecurFrequencyChange()
1663 slotSetSubRepetition();
1665 mRecurrenceEdit->updateEvent(event,
false);
1666 mTabs->setTabLabel(mTabs->page(mRecurPageIndex), recurText(event));
1677void EditAlarmDlg::slotSetSubRepetition()
1679 bool dateOnly = mTemplate ? mTemplateAnyTime->isOn() : mTimeWidget->anyTime();
1680 mRecurrenceEdit->setSubRepetition(mReminder->minutes(), dateOnly);
1686bool EditAlarmDlg::checkCommandData()
1688 if (mCommandRadio->isOn() && mCmdOutputGroup->selectedId() == LOG_TO_FILE)
1691 TQString file = mCmdLogFileEdit->text();
1692 TQFileInfo info(file);
1693 TQDir::setCurrent(TQDir::homeDirPath());
1694 bool err = file.isEmpty() || info.isDir();
1699 err = !info.isWritable();
1703 TQFileInfo dirinfo(info.dirPath(
true));
1704 err = (!dirinfo.isDir() || !dirinfo.isWritable());
1709 mTabs->setCurrentPage(mMainPageIndex);
1710 mCmdLogFileEdit->setFocus();
1711 KMessageBox::sorry(
this, i18n(
"Log file must be the name or path of a local file, with write permission."));
1715 mCmdLogFileEdit->setText(info.absFilePath());
1724bool EditAlarmDlg::checkEmailData()
1726 if (mEmailRadio->isOn())
1728 TQString addrs = mEmailToEdit->text();
1729 if (addrs.isEmpty())
1730 mEmailAddresses.clear();
1733 TQString bad = KAMail::convertAddresses(addrs, mEmailAddresses);
1736 mEmailToEdit->setFocus();
1737 KMessageBox::error(
this, i18n(
"Invalid email address:\n%1").arg(bad));
1741 if (mEmailAddresses.isEmpty())
1743 mEmailToEdit->setFocus();
1744 KMessageBox::error(
this, i18n(
"No email address specified"));
1748 mEmailAttachments.clear();
1749 for (
int i = 0; i < mEmailAttachList->count(); ++i)
1751 TQString att = mEmailAttachList->text(i);
1752 switch (KAMail::checkAttachment(att))
1755 mEmailAttachments.append(att);
1760 mEmailAttachList->setFocus();
1761 KMessageBox::error(
this, i18n(
"Invalid email attachment:\n%1").arg(att));
1773void EditAlarmDlg::slotAlarmTypeChanged(
int)
1775 bool displayAlarm =
false;
1776 TQWidget* focus =
nullptr;
1777 if (mMessageRadio->isOn())
1780 mFilePadding->hide();
1781 mTextMessageEdit->show();
1782 mFontColourButton->show();
1783 mBgColourBox->hide();
1784 mSoundPicker->showSpeak(
true);
1785 mDisplayAlarmsFrame->show();
1786 mCommandFrame->hide();
1787 mEmailFrame->hide();
1789 mConfirmAck->show();
1790 setButtonWhatsThis(Try, i18n(
"Display the alarm message now"));
1791 focus = mTextMessageEdit;
1792 displayAlarm =
true;
1794 else if (mFileRadio->isOn())
1796 mTextMessageEdit->hide();
1798 mFilePadding->show();
1799 mFontColourButton->hide();
1800 mBgColourBox->show();
1801 mSoundPicker->showSpeak(
false);
1802 mDisplayAlarmsFrame->show();
1803 mCommandFrame->hide();
1804 mEmailFrame->hide();
1806 mConfirmAck->show();
1807 setButtonWhatsThis(Try, i18n(
"Display the file now"));
1808 mFileMessageEdit->setNoSelect();
1809 focus = mFileMessageEdit;
1810 displayAlarm =
true;
1812 else if (mCommandRadio->isOn())
1814 mDisplayAlarmsFrame->hide();
1815 mCommandFrame->show();
1816 mEmailFrame->hide();
1818 mConfirmAck->hide();
1819 setButtonWhatsThis(Try, i18n(
"Execute the specified command now"));
1820 mCmdCommandEdit->setNoSelect();
1821 focus = mCmdCommandEdit;
1823 else if (mEmailRadio->isOn())
1825 mDisplayAlarmsFrame->hide();
1826 mCommandFrame->hide();
1827 mEmailFrame->show();
1829 mConfirmAck->hide();
1830 setButtonWhatsThis(Try, i18n(
"Send the email to the specified addressees now"));
1831 mEmailToEdit->setNoSelect();
1832 focus = mEmailToEdit;
1834 mLateCancel->showAutoClose(displayAlarm);
1835 mLateCancel->setFixedSize(mLateCancel->sizeHint());
1844void EditAlarmDlg::slotCmdScriptToggled(
bool on)
1848 mCmdCommandEdit->hide();
1849 mCmdPadding->hide();
1850 mCmdScriptEdit->show();
1851 mCmdScriptEdit->setFocus();
1855 mCmdScriptEdit->hide();
1856 mCmdCommandEdit->show();
1857 mCmdPadding->show();
1858 mCmdCommandEdit->setFocus();
1866void EditAlarmDlg::slotTemplateTimeType(
int)
1868 mTemplateTime->setEnabled(mTemplateUseTime->isOn());
1869 mTemplateTimeAfter->setEnabled(mTemplateUseTimeAfter->isOn());
1876void EditAlarmDlg::slotAnyTimeToggled(
bool anyTime)
1878 if (mReminder->isReminder())
1879 mReminder->setDateOnly(anyTime);
1880 mLateCancel->setDateOnly(anyTime);
1886void EditAlarmDlg::openAddressBook()
1888 TDEABC::Addressee a = TDEABC::AddresseeDialog::getAddressee(
this);
1891 Person person(a.realName(), a.preferredEmail());
1892 TQString addrs = mEmailToEdit->text().stripWhiteSpace();
1893 if (!addrs.isEmpty())
1895 addrs += person.fullName();
1896 mEmailToEdit->setText(addrs);
1902void EditAlarmDlg::slotAddAttachment()
1904 TQString url = KAlarm::browseFile(i18n(
"Choose File to Attach"), mAttachDefaultDir, TQString(),
1905 TQString(), KFile::ExistingOnly,
this,
"pickAttachFile");
1908 mEmailAttachList->insertItem(url);
1909 mEmailAttachList->setCurrentItem(mEmailAttachList->count() - 1);
1910 mEmailRemoveButton->setEnabled(
true);
1911 mEmailAttachList->setEnabled(
true);
1918void EditAlarmDlg::slotRemoveAttachment()
1920 int item = mEmailAttachList->currentItem();
1921 mEmailAttachList->removeItem(item);
1922 int count = mEmailAttachList->count();
1924 mEmailAttachList->setCurrentItem(count - 1);
1927 mEmailRemoveButton->setEnabled(
false);
1928 mEmailAttachList->setEnabled(
false);
1935bool EditAlarmDlg::checkText(TQString& result,
bool showErrorMessage)
const
1937 if (mMessageRadio->isOn())
1938 result = mTextMessageEdit->text();
1939 else if (mEmailRadio->isOn())
1940 result = mEmailMessageEdit->text();
1941 else if (mCommandRadio->isOn())
1943 if (mCmdTypeScript->isChecked())
1944 result = mCmdScriptEdit->text();
1946 result = mCmdCommandEdit->text();
1947 result = result.stripWhiteSpace();
1949 else if (mFileRadio->isOn())
1951 TQString alarmtext = mFileMessageEdit->text().stripWhiteSpace();
1954 enum Err { NONE = 0, BLANK, NONEXISTENT, DIRECTORY, UNREADABLE, NOT_TEXT_IMAGE };
1957 int i = alarmtext.find(TQString::fromLatin1(
"/"));
1958 if (i > 0 && alarmtext[i - 1] ==
':')
1962 alarmtext = url.prettyURL();
1963 TDEIO::UDSEntry uds;
1964 if (!TDEIO::NetAccess::stat(url, uds, MainWindow::mainMainWindow()))
1968 KFileItem fi(uds, url);
1969 if (fi.isDir()) err = DIRECTORY;
1970 else if (!fi.isReadable()) err = UNREADABLE;
1973 else if (alarmtext.isEmpty())
1978 TQFileInfo info(alarmtext);
1979 TQDir::setCurrent(TQDir::homeDirPath());
1980 alarmtext = info.absFilePath();
1981 url.setPath(alarmtext);
1982 alarmtext = TQString::fromLatin1(
"file:") + alarmtext;
1985 if (info.isDir()) err = DIRECTORY;
1986 else if (!info.exists()) err = NONEXISTENT;
1987 else if (!info.isReadable()) err = UNREADABLE;
1992 switch (KAlarm::fileType(KFileItem(KFileItem::Unknown, KFileItem::Unknown, url).mimetype()))
1994 case KAlarm::TextFormatted:
1995 case KAlarm::TextPlain:
1996 case KAlarm::TextApplication:
2000 err = NOT_TEXT_IMAGE;
2004 if (err && showErrorMessage)
2006 mFileMessageEdit->setFocus();
2011 KMessageBox::sorry(
const_cast<EditAlarmDlg*
>(
this), i18n(
"Please select a file to display"));
2013 case NONEXISTENT: errmsg = i18n(
"%1\nnot found");
break;
2014 case DIRECTORY: errmsg = i18n(
"%1\nis a folder");
break;
2015 case UNREADABLE: errmsg = i18n(
"%1\nis not readable");
break;
2016 case NOT_TEXT_IMAGE: errmsg = i18n(
"%1\nappears not to be a text or image file");
break;
2021 if (KMessageBox::warningContinueCancel(
const_cast<EditAlarmDlg*
>(
this), errmsg.arg(alarmtext))
2022 == KMessageBox::Cancel)
2036TextEdit::TextEdit(TQWidget* parent,
const char* name)
2037 : KTextEdit(parent, name)
2039 TQSize tsize = sizeHint();
2040 tsize.setHeight(fontMetrics().lineSpacing()*13/4 + 2*frameWidth());
2041 setMinimumSize(tsize);
2044void TextEdit::dragEnterEvent(TQDragEnterEvent* e)
2048 KTextEdit::dragEnterEvent(e);
Provides read and write access to calendar files.
KAEvent corresponds to a KCal::Event instance.
static bool canDecode(TQMimeSource *)
Radio button with associated file picker controls.
virtual TQString pickFile()=0
Chooses a file, for example by displaying a file selection dialogue.
LineEdit * fileEdit() const
Returns the associated file name edit widget, or null if none.
the KAlarm application object
radio button with an associated file picker