Diffstat (limited to 'korganizer/koeditorgeneralevent.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | korganizer/koeditorgeneralevent.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/korganizer/koeditorgeneralevent.cpp b/korganizer/koeditorgeneralevent.cpp index d4aa78c..3b2a276 100644 --- a/korganizer/koeditorgeneralevent.cpp +++ b/korganizer/koeditorgeneralevent.cpp | |||
@@ -97,96 +97,99 @@ void KOEditorGeneralEvent::initTime(QWidget *parent,QBoxLayout *topLayout) | |||
97 | 97 | ||
98 | QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,2,3); | 98 | QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,2,3); |
99 | layoutTimeBox->setSpacing(topLayout->spacing()); | 99 | layoutTimeBox->setSpacing(topLayout->spacing()); |
100 | 100 | ||
101 | mStartDateLabel = new QLabel(i18n("Start:"),timeBoxFrame); | 101 | mStartDateLabel = new QLabel(i18n("Start:"),timeBoxFrame); |
102 | layoutTimeBox->addWidget(mStartDateLabel,0,0); | 102 | layoutTimeBox->addWidget(mStartDateLabel,0,0); |
103 | 103 | ||
104 | mStartDateEdit = new KDateEdit(timeBoxFrame); | 104 | mStartDateEdit = new KDateEdit(timeBoxFrame); |
105 | layoutTimeBox->addWidget(mStartDateEdit,0,1); | 105 | layoutTimeBox->addWidget(mStartDateEdit,0,1); |
106 | 106 | ||
107 | mStartTimeEdit = new KOTimeEdit(timeBoxFrame); | 107 | mStartTimeEdit = new KOTimeEdit(timeBoxFrame); |
108 | layoutTimeBox->addWidget(mStartTimeEdit,0,2); | 108 | layoutTimeBox->addWidget(mStartTimeEdit,0,2); |
109 | 109 | ||
110 | 110 | ||
111 | mEndDateLabel = new QLabel(i18n("End:"),timeBoxFrame); | 111 | mEndDateLabel = new QLabel(i18n("End:"),timeBoxFrame); |
112 | layoutTimeBox->addWidget(mEndDateLabel,1,0); | 112 | layoutTimeBox->addWidget(mEndDateLabel,1,0); |
113 | 113 | ||
114 | mEndDateEdit = new KDateEdit(timeBoxFrame); | 114 | mEndDateEdit = new KDateEdit(timeBoxFrame); |
115 | layoutTimeBox->addWidget(mEndDateEdit,1,1); | 115 | layoutTimeBox->addWidget(mEndDateEdit,1,1); |
116 | 116 | ||
117 | mEndTimeEdit = new KOTimeEdit(timeBoxFrame); | 117 | mEndTimeEdit = new KOTimeEdit(timeBoxFrame); |
118 | layoutTimeBox->addWidget(mEndTimeEdit,1,2); | 118 | layoutTimeBox->addWidget(mEndTimeEdit,1,2); |
119 | QWidget* duration = new QWidget( timeBoxFrame ); | 119 | QWidget* duration = new QWidget( timeBoxFrame ); |
120 | QHBoxLayout *flagsBox = new QHBoxLayout( duration ); | 120 | QHBoxLayout *flagsBox = new QHBoxLayout( duration ); |
121 | mNoTimeButton = new QCheckBox(i18n("All day event"),duration); | 121 | mNoTimeButton = new QCheckBox(i18n("All day event"),duration); |
122 | flagsBox->addWidget(mNoTimeButton); | 122 | flagsBox->addWidget(mNoTimeButton); |
123 | connect(mNoTimeButton, SIGNAL(toggled(bool)),SLOT(dontAssociateTime(bool))); | 123 | connect(mNoTimeButton, SIGNAL(toggled(bool)),SLOT(dontAssociateTime(bool))); |
124 | mDurationLabel = new QLabel( duration ); | 124 | mDurationLabel = new QLabel( duration ); |
125 | // if ( KOPrefs::instance()->mCompactDialogs ) { | 125 | // if ( KOPrefs::instance()->mCompactDialogs ) { |
126 | //layoutTimeBox->addMultiCellWidget( mDurationLabel, 3, 3, 0, 3 ); | 126 | //layoutTimeBox->addMultiCellWidget( mDurationLabel, 3, 3, 0, 3 ); |
127 | //} else { | 127 | //} else { |
128 | flagsBox->addWidget( mDurationLabel ); | 128 | flagsBox->addWidget( mDurationLabel ); |
129 | //} | 129 | //} |
130 | flagsBox->setStretchFactor(mDurationLabel, 10 ); | 130 | flagsBox->setStretchFactor(mDurationLabel, 10 ); |
131 | mDurationLabel->setAlignment( AlignRight | AlignVCenter); | 131 | mDurationLabel->setAlignment( AlignRight | AlignVCenter); |
132 | layoutTimeBox->addMultiCellWidget( duration, 2, 2, 0, 3 ); | 132 | layoutTimeBox->addMultiCellWidget( duration, 2, 2, 0, 3 ); |
133 | 133 | ||
134 | // time widgets are checked if they contain a valid time | 134 | // time widgets are checked if they contain a valid time |
135 | connect(mStartTimeEdit, SIGNAL(timeChanged(QTime)), | 135 | connect(mStartTimeEdit, SIGNAL(timeChanged(QTime)), |
136 | this, SLOT(startTimeChanged(QTime))); | 136 | this, SLOT(startTimeChanged(QTime))); |
137 | connect(mEndTimeEdit, SIGNAL(timeChanged(QTime)), | 137 | connect(mEndTimeEdit, SIGNAL(timeChanged(QTime)), |
138 | this, SLOT(endTimeChanged(QTime))); | 138 | this, SLOT(endTimeChanged(QTime))); |
139 | 139 | ||
140 | // date widgets are checked if they contain a valid date | 140 | // date widgets are checked if they contain a valid date |
141 | connect(mStartDateEdit, SIGNAL(dateChanged(QDate)), | 141 | connect(mStartDateEdit, SIGNAL(dateChanged(QDate)), |
142 | this, SLOT(startDateChanged(QDate))); | 142 | this, SLOT(startDateChanged(QDate))); |
143 | connect(mEndDateEdit, SIGNAL(dateChanged(QDate)), | 143 | connect(mEndDateEdit, SIGNAL(dateChanged(QDate)), |
144 | this, SLOT(endDateChanged(QDate))); | 144 | this, SLOT(endDateChanged(QDate))); |
145 | connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),mStartTimeEdit,SLOT(setTime(QTime))); | ||
146 | connect(mEndDateEdit,SIGNAL(setTimeTo(QTime)),mEndTimeEdit,SLOT(setTime(QTime))); | ||
147 | |||
145 | } | 148 | } |
146 | 149 | ||
147 | void KOEditorGeneralEvent::initClass(QWidget *parent,QBoxLayout *topLayout) | 150 | void KOEditorGeneralEvent::initClass(QWidget *parent,QBoxLayout *topLayout) |
148 | { | 151 | { |
149 | QBoxLayout *classLayout = new QHBoxLayout(topLayout); | 152 | QBoxLayout *classLayout = new QHBoxLayout(topLayout); |
150 | 153 | ||
151 | QLabel *freeTimeLabel = new QLabel(i18n("Show time as:"),parent); | 154 | QLabel *freeTimeLabel = new QLabel(i18n("Show time as:"),parent); |
152 | classLayout->addWidget(freeTimeLabel); | 155 | classLayout->addWidget(freeTimeLabel); |
153 | 156 | ||
154 | mFreeTimeCombo = new QComboBox(false, parent); | 157 | mFreeTimeCombo = new QComboBox(false, parent); |
155 | mFreeTimeCombo->insertItem(i18n("Busy")); | 158 | mFreeTimeCombo->insertItem(i18n("Busy")); |
156 | mFreeTimeCombo->insertItem(i18n("Free")); | 159 | mFreeTimeCombo->insertItem(i18n("Free")); |
157 | classLayout->addWidget(mFreeTimeCombo); | 160 | classLayout->addWidget(mFreeTimeCombo); |
158 | } | 161 | } |
159 | 162 | ||
160 | void KOEditorGeneralEvent::timeStuffDisable(bool disable) | 163 | void KOEditorGeneralEvent::timeStuffDisable(bool disable) |
161 | { | 164 | { |
162 | mStartTimeEdit->setEnabled( !disable ); | 165 | mStartTimeEdit->setEnabled( !disable ); |
163 | mEndTimeEdit->setEnabled( !disable ); | 166 | mEndTimeEdit->setEnabled( !disable ); |
164 | 167 | ||
165 | setDuration(); | 168 | setDuration(); |
166 | emitDateTimeStr(); | 169 | emitDateTimeStr(); |
167 | } | 170 | } |
168 | 171 | ||
169 | void KOEditorGeneralEvent::dontAssociateTime(bool noTime) | 172 | void KOEditorGeneralEvent::dontAssociateTime(bool noTime) |
170 | { | 173 | { |
171 | timeStuffDisable(noTime); | 174 | timeStuffDisable(noTime); |
172 | //if(alarmButton->isChecked()) alarmStuffDisable(noTime); | 175 | //if(alarmButton->isChecked()) alarmStuffDisable(noTime); |
173 | allDayChanged(noTime); | 176 | allDayChanged(noTime); |
174 | } | 177 | } |
175 | 178 | ||
176 | void KOEditorGeneralEvent::setDateTimes(QDateTime start, QDateTime end) | 179 | void KOEditorGeneralEvent::setDateTimes(QDateTime start, QDateTime end) |
177 | { | 180 | { |
178 | // kdDebug() << "KOEditorGeneralEvent::setDateTimes(): Start DateTime: " << start.toString() << endl; | 181 | // kdDebug() << "KOEditorGeneralEvent::setDateTimes(): Start DateTime: " << start.toString() << endl; |
179 | if ( !mTemplate ) | 182 | if ( !mTemplate ) |
180 | mStartDateEdit->setDate(start.date()); | 183 | mStartDateEdit->setDate(start.date()); |
181 | // KTimeEdit seems to emit some signals when setTime() is called. | 184 | // KTimeEdit seems to emit some signals when setTime() is called. |
182 | mStartTimeEdit->blockSignals( true ); | 185 | mStartTimeEdit->blockSignals( true ); |
183 | mStartTimeEdit->setTime(start.time()); | 186 | mStartTimeEdit->setTime(start.time()); |
184 | mStartTimeEdit->blockSignals( false ); | 187 | mStartTimeEdit->blockSignals( false ); |
185 | if ( !mTemplate ) | 188 | if ( !mTemplate ) |
186 | mEndDateEdit->setDate(end.date()); | 189 | mEndDateEdit->setDate(end.date()); |
187 | mEndTimeEdit->setTime(end.time()); | 190 | mEndTimeEdit->setTime(end.time()); |
188 | 191 | ||
189 | mCurrStartDateTime = start; | 192 | mCurrStartDateTime = start; |
190 | mCurrEndDateTime = end; | 193 | mCurrEndDateTime = end; |
191 | 194 | ||
192 | setDuration(); | 195 | setDuration(); |