Diffstat (limited to 'korganizer/koeditorgeneraltodo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koeditorgeneraltodo.cpp | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp index d32d5a5..baee9fc 100644 --- a/korganizer/koeditorgeneraltodo.cpp +++ b/korganizer/koeditorgeneraltodo.cpp | |||
@@ -19,20 +19,27 @@ | |||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qtooltip.h> | 24 | #include <qtooltip.h> |
25 | #include <qfiledialog.h> | 25 | #include <q3filedialog.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qvbox.h> | 27 | #include <q3vbox.h> |
28 | #include <qbuttongroup.h> | 28 | #include <q3buttongroup.h> |
29 | #include <qvgroupbox.h> | 29 | #include <q3vgroupbox.h> |
30 | #include <qwidgetstack.h> | 30 | #include <q3widgetstack.h> |
31 | #include <qdatetime.h> | 31 | #include <qdatetime.h> |
32 | #include <qapplication.h> | 32 | #include <qapplication.h> |
33 | #include <QDesktopWidget> | ||
34 | //Added by qt3to4: | ||
35 | #include <Q3HBoxLayout> | ||
36 | #include <Q3GridLayout> | ||
37 | #include <Q3Frame> | ||
38 | #include <QLabel> | ||
39 | #include <Q3VBoxLayout> | ||
33 | 40 | ||
34 | #include <kglobal.h> | 41 | #include <kglobal.h> |
35 | #include <klocale.h> | 42 | #include <klocale.h> |
36 | #include <kiconloader.h> | 43 | #include <kiconloader.h> |
37 | #include <kmessagebox.h> | 44 | #include <kmessagebox.h> |
38 | #include <kdebug.h> | 45 | #include <kdebug.h> |
@@ -79,24 +86,24 @@ void KOEditorGeneralTodo::finishSetup() | |||
79 | // QWidget::setTabOrder(mCategoriesButton, mSecrecyCombo); | 86 | // QWidget::setTabOrder(mCategoriesButton, mSecrecyCombo); |
80 | // QWidget::setTabOrder(mSecrecyCombo, mDescriptionEdit); | 87 | // QWidget::setTabOrder(mSecrecyCombo, mDescriptionEdit); |
81 | mSummaryEdit->load(KOLocationBox::SUMMARYTODO); | 88 | mSummaryEdit->load(KOLocationBox::SUMMARYTODO); |
82 | mSummaryEdit->setFocus(); | 89 | mSummaryEdit->setFocus(); |
83 | } | 90 | } |
84 | 91 | ||
85 | void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) | 92 | void KOEditorGeneralTodo::initTime(QWidget *parent,Q3BoxLayout *topLayout) |
86 | { | 93 | { |
87 | QBoxLayout *timeLayout = new QVBoxLayout(topLayout); | 94 | Q3BoxLayout *timeLayout = new Q3VBoxLayout(topLayout); |
88 | 95 | ||
89 | QGroupBox *timeGroupBox = new QGroupBox(1,QGroupBox::Horizontal, | 96 | Q3GroupBox *timeGroupBox = new Q3GroupBox(1,Qt::Horizontal, |
90 | i18n("Date && Time"),parent); | 97 | i18n("Date && Time"),parent); |
91 | timeLayout->addWidget(timeGroupBox); | 98 | timeLayout->addWidget(timeGroupBox); |
92 | timeGroupBox->layout()->setSpacing( KDialog::spacingHint()-2 ); | 99 | timeGroupBox->layout()->setSpacing( KDialog::spacingHint()-2 ); |
93 | timeGroupBox->layout()->setMargin( KDialog::marginHint() ); | 100 | timeGroupBox->layout()->setMargin( KDialog::marginHint() ); |
94 | QFrame *timeBoxFrame = new QFrame(timeGroupBox); | 101 | Q3Frame *timeBoxFrame = new Q3Frame(timeGroupBox); |
95 | 102 | ||
96 | QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,3,3); | 103 | Q3GridLayout *layoutTimeBox = new Q3GridLayout(timeBoxFrame,3,3); |
97 | layoutTimeBox->setSpacing(KDialog::spacingHintSmall()); | 104 | layoutTimeBox->setSpacing(KDialog::spacingHintSmall()); |
98 | layoutTimeBox->setColStretch( 1, 1 ); | 105 | layoutTimeBox->setColStretch( 1, 1 ); |
99 | 106 | ||
100 | mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame); | 107 | mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame); |
101 | layoutTimeBox->addWidget(mStartCheck,0,0); | 108 | layoutTimeBox->addWidget(mStartCheck,0,0); |
102 | connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool))); | 109 | connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool))); |
@@ -130,13 +137,13 @@ void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) | |||
130 | this, SLOT(startDateChanged(QDate))); | 137 | this, SLOT(startDateChanged(QDate))); |
131 | // some more layouting | 138 | // some more layouting |
132 | //layoutTimeBox->setColStretch(3,1); | 139 | //layoutTimeBox->setColStretch(3,1); |
133 | } | 140 | } |
134 | 141 | ||
135 | 142 | ||
136 | void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) | 143 | void KOEditorGeneralTodo::initCompletion(QWidget *parent, Q3BoxLayout *topLayout) |
137 | { | 144 | { |
138 | mCompletedCombo = new QComboBox(parent); | 145 | mCompletedCombo = new QComboBox(parent); |
139 | // xgettext:no-c-format | 146 | // xgettext:no-c-format |
140 | mCompletedCombo->insertItem(i18n(" 0 %")); | 147 | mCompletedCombo->insertItem(i18n(" 0 %")); |
141 | // xgettext:no-c-format | 148 | // xgettext:no-c-format |
142 | mCompletedCombo->insertItem(i18n(" 20 %")); | 149 | mCompletedCombo->insertItem(i18n(" 20 %")); |
@@ -170,31 +177,31 @@ void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) | |||
170 | else | 177 | else |
171 | mCompleteDateEdit->setMaximumWidth( 140 ); | 178 | mCompleteDateEdit->setMaximumWidth( 140 ); |
172 | topLayout->setSpacing( 0 ); | 179 | topLayout->setSpacing( 0 ); |
173 | } | 180 | } |
174 | } | 181 | } |
175 | 182 | ||
176 | void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout) | 183 | void KOEditorGeneralTodo::initPriority(QWidget *parent, Q3BoxLayout *topLayout) |
177 | { | 184 | { |
178 | 185 | ||
179 | QHBox* h = new QHBox ( parent ); | 186 | Q3HBox* h = new Q3HBox ( parent ); |
180 | topLayout->addWidget( h ); | 187 | topLayout->addWidget( h ); |
181 | QLabel *priorityLabel = new QLabel(i18n("Priority:"), h); | 188 | QLabel *priorityLabel = new QLabel(i18n("Priority:"), h); |
182 | // topLayout->addWidget(priorityLabel); | 189 | // topLayout->addWidget(priorityLabel); |
183 | mPriorityCombo = new QComboBox( h ); | 190 | mPriorityCombo = new QComboBox( h ); |
184 | mPriorityCombo->insertItem(i18n("1 (high)")); | 191 | mPriorityCombo->insertItem(i18n("1 (high)")); |
185 | mPriorityCombo->insertItem(i18n("2")); | 192 | mPriorityCombo->insertItem(i18n("2")); |
186 | mPriorityCombo->insertItem(i18n("3")); | 193 | mPriorityCombo->insertItem(i18n("3")); |
187 | mPriorityCombo->insertItem(i18n("4")); | 194 | mPriorityCombo->insertItem(i18n("4")); |
188 | mPriorityCombo->insertItem(i18n("5 (low)")); | 195 | mPriorityCombo->insertItem(i18n("5 (low)")); |
189 | //topLayout->addWidget(mPriorityCombo); | 196 | //topLayout->addWidget(mPriorityCombo); |
190 | } | 197 | } |
191 | 198 | ||
192 | void KOEditorGeneralTodo::initStatus(QWidget *parent,QBoxLayout *topLayout) | 199 | void KOEditorGeneralTodo::initStatus(QWidget *parent,Q3BoxLayout *topLayout) |
193 | { | 200 | { |
194 | QBoxLayout *statusLayout = new QHBoxLayout(topLayout); | 201 | Q3BoxLayout *statusLayout = new Q3HBoxLayout(topLayout); |
195 | 202 | ||
196 | initCompletion( parent, statusLayout ); | 203 | initCompletion( parent, statusLayout ); |
197 | 204 | ||
198 | statusLayout->addStretch( 1 ); | 205 | statusLayout->addStretch( 1 ); |
199 | 206 | ||
200 | initPriority( parent, statusLayout ); | 207 | initPriority( parent, statusLayout ); |
@@ -393,13 +400,13 @@ void KOEditorGeneralTodo::enableStartEdit( bool enable ) | |||
393 | } | 400 | } |
394 | emit datesChecked(); | 401 | emit datesChecked(); |
395 | } | 402 | } |
396 | void KOEditorGeneralTodo::startDateChanged(QDate newdate) | 403 | void KOEditorGeneralTodo::startDateChanged(QDate newdate) |
397 | { | 404 | { |
398 | if ( mDueCheck->isChecked() ) | 405 | if ( mDueCheck->isChecked() ) |
399 | emit dateTimesChanged(newdate,mDueDateEdit->date()); | 406 | emit dateTimesChanged((QDateTime)newdate,(QDateTime)mDueDateEdit->date()); |
400 | } | 407 | } |
401 | void KOEditorGeneralTodo::enableTimeEdits(bool enable) | 408 | void KOEditorGeneralTodo::enableTimeEdits(bool enable) |
402 | { | 409 | { |
403 | if(mStartCheck->isChecked()) { | 410 | if(mStartCheck->isChecked()) { |
404 | mStartTimeEdit->setEnabled( enable ); | 411 | mStartTimeEdit->setEnabled( enable ); |
405 | } | 412 | } |