Commit 35ebebb9 authored by Allen Winter's avatar Allen Winter

Replace KDateEdit with KDateComboBox from kdelibs

Replace KTimeEdit with KTimeComboBox from kdelibs
... and a few other minor cleanings
parent 9a6a9866
......@@ -33,8 +33,7 @@
#include "timezonecombo.h"
#include "alarmtimewidget.moc"
#include <libkdepim/kdateedit.h>
#include <kdatecombobox.h>
#include <kdialog.h>
#include <klocale.h>
......@@ -82,7 +81,7 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
{
static const QString recurText = i18nc("@info/plain",
"If a recurrence is configured, the start date/time will be adjusted "
"to the first recurrence on or after the entered date/time.");
"to the first recurrence on or after the entered date/time.");
static const QString tzText = i18nc("@info/plain",
"This uses KAlarm's default time zone, set in the Configuration dialog.");
......@@ -112,7 +111,7 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
mButtonGroup->addButton(mAtTimeRadio);
// Date edit box
mDateEdit = new KPIM::KDateEdit(topWidget);
mDateEdit = new KDateComboBox(topWidget);
connect(mDateEdit, SIGNAL(dateEntered(QDate)), SLOT(dateTimeChanged()));
mDateEdit->setWhatsThis(i18nc("@info:whatsthis",
"<para>Enter the date to schedule the alarm.</para>"
......@@ -244,7 +243,10 @@ void AlarmTimeWidget::init(Mode mode, const QString& title)
void AlarmTimeWidget::setReadOnly(bool ro)
{
mAtTimeRadio->setReadOnly(ro);
mDateEdit->setReadOnly(ro);
if ( ro )
mDateEdit->setOptions( mDateEdit->options() & ~KDateComboBox::EditDate );
else
mDateEdit->setOptions( mDateEdit->options() | KDateComboBox::EditDate );
mTimeEdit->setReadOnly(ro);
if (mAnyTimeCheckBox)
mAnyTimeCheckBox->setReadOnly(ro);
......
......@@ -25,8 +25,8 @@
#include <QFrame>
class QAbstractButton;
class KDateComboBox;
class KHBox;
namespace KPIM { class KDateEdit; }
class ButtonGroup;
class RadioButton;
class CheckBox;
......@@ -89,7 +89,7 @@ class AlarmTimeWidget : public QFrame
RadioButton* mAtTimeRadio;
RadioButton* mAfterTimeRadio;
CheckBox* mAnyTimeCheckBox;
KPIM::KDateEdit* mDateEdit;
KDateComboBox* mDateEdit;
TimeEdit* mTimeEdit;
TimeSpinBox* mDelayTimeEdit;
PushButton* mTimeZoneButton;
......
......@@ -56,6 +56,7 @@ using namespace KCal;
#include <kdialog.h>
#include <kmessagebox.h>
#include <kdebug.h>
#include <kdatecombobox.h>
#include <QPushButton>
#include <QLabel>
......@@ -280,8 +281,11 @@ RecurrenceEdit::RecurrenceEdit(bool readOnly, QWidget* parent)
i18nc("@info:whatsthis", "<para>Repeat the alarm until the date/time specified.</para>"
"<para><note>This applies to the main recurrence only. It does not limit any sub-repetition which will occur regardless after the last main recurrence.</note></para>"));
mRangeButtonGroup->addButton(mEndDateButton);
mEndDateEdit = new KPIM::KDateEdit(mRangeButtonBox);
mEndDateEdit->setReadOnly(mReadOnly);
mEndDateEdit = new KDateComboBox(mRangeButtonBox);
if ( mReadOnly )
mEndDateEdit->setOptions( mEndDateEdit->options() & ~KDateComboBox::EditDate );
else
mEndDateEdit->setOptions( mEndDateEdit->options() | KDateComboBox::EditDate );
static const QString tzText = i18nc("@info/plain", "This uses the same time zone as the start time.");
mEndDateEdit->setWhatsThis(i18nc("@info:whatsthis",
"<para>Enter the last date to repeat the alarm.</para><para>%1</para>", tzText));
......@@ -340,7 +344,7 @@ RecurrenceEdit::RecurrenceEdit(bool readOnly, QWidget* parent)
vlayout = new QVBoxLayout();
vlayout->setMargin(0);
hlayout->addLayout(vlayout);
mExceptionDateEdit = new KPIM::KDateEdit(mExceptionGroup);
mExceptionDateEdit = new KDateComboBox(mExceptionGroup);
mExceptionDateEdit->setDate(KDateTime::currentLocalDate());
mExceptionDateEdit->setWhatsThis(i18nc("@info:whatsthis",
"Enter a date to insert in the exceptions list. "
......
......@@ -29,10 +29,7 @@
#include <QFrame>
namespace KPIM {
class KDateEdit;
}
class KDateComboBox;
class QShowEvent;
class QStackedWidget;
class QGroupBox;
......@@ -154,14 +151,14 @@ class RecurrenceEdit : public QFrame
SpinBox* mRepeatCountEntry;
QLabel* mRepeatCountLabel;
RadioButton* mEndDateButton;
KPIM::KDateEdit* mEndDateEdit;
KDateComboBox* mEndDateEdit;
TimeEdit* mEndTimeEdit;
CheckBox* mEndAnyTimeCheckBox;
// Exceptions
QGroupBox* mExceptionGroup;
QListWidget* mExceptionDateList;
KPIM::KDateEdit* mExceptionDateEdit;
KDateComboBox* mExceptionDateEdit;
QPushButton* mChangeExceptionButton;
QPushButton* mDeleteExceptionButton;
CheckBox* mExcludeHolidays;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment