summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeditorgeneralevent.cpp3
-rw-r--r--korganizer/koeditorgeneraltodo.cpp5
2 files changed, 7 insertions, 1 deletions
diff --git a/korganizer/koeditorgeneralevent.cpp b/korganizer/koeditorgeneralevent.cpp
index d4aa78c..3b2a276 100644
--- a/korganizer/koeditorgeneralevent.cpp
+++ b/korganizer/koeditorgeneralevent.cpp
@@ -113,64 +113,67 @@ void KOEditorGeneralEvent::initTime(QWidget *parent,QBoxLayout *topLayout)
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
147void KOEditorGeneralEvent::initClass(QWidget *parent,QBoxLayout *topLayout) 150void 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
160void KOEditorGeneralEvent::timeStuffDisable(bool disable) 163void 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
169void KOEditorGeneralEvent::dontAssociateTime(bool noTime) 172void 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
176void KOEditorGeneralEvent::setDateTimes(QDateTime start, QDateTime end) 179void KOEditorGeneralEvent::setDateTimes(QDateTime start, QDateTime end)
diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp
index a03ec52..4a1576a 100644
--- a/korganizer/koeditorgeneraltodo.cpp
+++ b/korganizer/koeditorgeneraltodo.cpp
@@ -95,104 +95,107 @@ void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout)
95 QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,3,3); 95 QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,3,3);
96 layoutTimeBox->setSpacing(topLayout->spacing()); 96 layoutTimeBox->setSpacing(topLayout->spacing());
97 layoutTimeBox->setColStretch( 1, 1 ); 97 layoutTimeBox->setColStretch( 1, 1 );
98 98
99 mDueCheck = new QCheckBox(i18n("Due:"),timeBoxFrame); 99 mDueCheck = new QCheckBox(i18n("Due:"),timeBoxFrame);
100 layoutTimeBox->addWidget(mDueCheck,0,0); 100 layoutTimeBox->addWidget(mDueCheck,0,0);
101 connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(enableDueEdit(bool))); 101 connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(enableDueEdit(bool)));
102 connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(showAlarm())); 102 connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(showAlarm()));
103 103
104 104
105 mDueDateEdit = new KDateEdit(timeBoxFrame); 105 mDueDateEdit = new KDateEdit(timeBoxFrame);
106 layoutTimeBox->addWidget(mDueDateEdit,0,1); 106 layoutTimeBox->addWidget(mDueDateEdit,0,1);
107 107
108 mDueTimeEdit = new KOTimeEdit(timeBoxFrame); 108 mDueTimeEdit = new KOTimeEdit(timeBoxFrame);
109 layoutTimeBox->addWidget(mDueTimeEdit,0,2); 109 layoutTimeBox->addWidget(mDueTimeEdit,0,2);
110 110
111 111
112 mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame); 112 mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame);
113 layoutTimeBox->addWidget(mStartCheck,1,0); 113 layoutTimeBox->addWidget(mStartCheck,1,0);
114 connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool))); 114 connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool)));
115 115
116 mStartDateEdit = new KDateEdit(timeBoxFrame); 116 mStartDateEdit = new KDateEdit(timeBoxFrame);
117 layoutTimeBox->addWidget(mStartDateEdit,1,1); 117 layoutTimeBox->addWidget(mStartDateEdit,1,1);
118 118
119 mStartTimeEdit = new KOTimeEdit(timeBoxFrame); 119 mStartTimeEdit = new KOTimeEdit(timeBoxFrame);
120 layoutTimeBox->addWidget(mStartTimeEdit,1,2); 120 layoutTimeBox->addWidget(mStartTimeEdit,1,2);
121 121
122 122
123 mTimeButton = new QCheckBox(i18n("Time associated"),timeBoxFrame); 123 mTimeButton = new QCheckBox(i18n("Time associated"),timeBoxFrame);
124 layoutTimeBox->addMultiCellWidget(mTimeButton,2,2,0,1); 124 layoutTimeBox->addMultiCellWidget(mTimeButton,2,2,0,1);
125 125
126 connect(mTimeButton,SIGNAL(toggled(bool)),SLOT(enableTimeEdits(bool))); 126 connect(mTimeButton,SIGNAL(toggled(bool)),SLOT(enableTimeEdits(bool)));
127 connect(mDueDateEdit,SIGNAL(setTimeTo(QTime)),mDueTimeEdit,SLOT(setTime(QTime)));
128 connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),mStartTimeEdit,SLOT(setTime(QTime)));
127 129
128 // some more layouting 130 // some more layouting
129 //layoutTimeBox->setColStretch(3,1); 131 //layoutTimeBox->setColStretch(3,1);
130} 132}
131 133
132 134
133void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) 135void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout)
134{ 136{
135 mCompletedCombo = new QComboBox(parent); 137 mCompletedCombo = new QComboBox(parent);
136 // xgettext:no-c-format 138 // xgettext:no-c-format
137 mCompletedCombo->insertItem(i18n(" 0 %")); 139 mCompletedCombo->insertItem(i18n(" 0 %"));
138 // xgettext:no-c-format 140 // xgettext:no-c-format
139 mCompletedCombo->insertItem(i18n(" 20 %")); 141 mCompletedCombo->insertItem(i18n(" 20 %"));
140 // xgettext:no-c-format 142 // xgettext:no-c-format
141 mCompletedCombo->insertItem(i18n(" 40 %")); 143 mCompletedCombo->insertItem(i18n(" 40 %"));
142 // xgettext:no-c-format 144 // xgettext:no-c-format
143 mCompletedCombo->insertItem(i18n(" 60 %")); 145 mCompletedCombo->insertItem(i18n(" 60 %"));
144 // xgettext:no-c-format 146 // xgettext:no-c-format
145 mCompletedCombo->insertItem(i18n(" 80 %")); 147 mCompletedCombo->insertItem(i18n(" 80 %"));
146 // xgettext:no-c-format 148 // xgettext:no-c-format
147 mCompletedCombo->insertItem(i18n("100 %")); 149 mCompletedCombo->insertItem(i18n("100 %"));
148 connect(mCompletedCombo,SIGNAL(activated(int)),SLOT(completedChanged(int))); 150 connect(mCompletedCombo,SIGNAL(activated(int)),SLOT(completedChanged(int)));
149 topLayout->addWidget(mCompletedCombo); 151 topLayout->addWidget(mCompletedCombo);
150 152
151 mCompletedLabel = new QLabel(i18n("completed"),parent); 153 mCompletedLabel = new QLabel(i18n("completed"),parent);
152 topLayout->addWidget(mCompletedLabel); 154 topLayout->addWidget(mCompletedLabel);
153 155
154 mCompleteDateEdit = new KDateEdit(parent); 156 mCompleteDateEdit = new KDateEdit(parent);
155 topLayout->addWidget(mCompleteDateEdit ); 157 topLayout->addWidget(mCompleteDateEdit );
156 158
157 mCompleteTimeEdit = new KOTimeEdit(parent); 159 mCompleteTimeEdit = new KOTimeEdit(parent);
158 topLayout->addWidget( mCompleteTimeEdit); 160 topLayout->addWidget( mCompleteTimeEdit);
159 161
160 mCompletedCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred,QSizePolicy::Preferred) ); 162 mCompletedCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred,QSizePolicy::Preferred) );
161 mCompletedLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,QSizePolicy::Preferred) ); 163 mCompletedLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,QSizePolicy::Preferred) );
164 connect(mCompleteDateEdit,SIGNAL(setTimeTo(QTime)),mCompleteTimeEdit,SLOT(setTime(QTime)));
162 165
163 if ( QApplication::desktop()->width() <= 480 ) { 166 if ( QApplication::desktop()->width() <= 480 ) {
164 if ( QApplication::desktop()->width() < 320 ) 167 if ( QApplication::desktop()->width() < 320 )
165 mCompleteDateEdit->setMaximumWidth( 85 ); 168 mCompleteDateEdit->setMaximumWidth( 85 );
166 else 169 else
167 mCompleteDateEdit->setMaximumWidth( 140 ); 170 mCompleteDateEdit->setMaximumWidth( 140 );
168 topLayout->setSpacing( 0 ); 171 topLayout->setSpacing( 0 );
169 } 172 }
170} 173}
171 174
172void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout) 175void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout)
173{ 176{
174 177
175 QHBox* h = new QHBox ( parent ); 178 QHBox* h = new QHBox ( parent );
176 topLayout->addWidget( h ); 179 topLayout->addWidget( h );
177 QLabel *priorityLabel = new QLabel(i18n("Priority:"), h); 180 QLabel *priorityLabel = new QLabel(i18n("Priority:"), h);
178 // topLayout->addWidget(priorityLabel); 181 // topLayout->addWidget(priorityLabel);
179 mPriorityCombo = new QComboBox( h ); 182 mPriorityCombo = new QComboBox( h );
180 mPriorityCombo->insertItem(i18n("1 (high)")); 183 mPriorityCombo->insertItem(i18n("1 (high)"));
181 mPriorityCombo->insertItem(i18n("2")); 184 mPriorityCombo->insertItem(i18n("2"));
182 mPriorityCombo->insertItem(i18n("3")); 185 mPriorityCombo->insertItem(i18n("3"));
183 mPriorityCombo->insertItem(i18n("4")); 186 mPriorityCombo->insertItem(i18n("4"));
184 mPriorityCombo->insertItem(i18n("5 (low)")); 187 mPriorityCombo->insertItem(i18n("5 (low)"));
185 //topLayout->addWidget(mPriorityCombo); 188 //topLayout->addWidget(mPriorityCombo);
186} 189}
187 190
188void KOEditorGeneralTodo::initStatus(QWidget *parent,QBoxLayout *topLayout) 191void KOEditorGeneralTodo::initStatus(QWidget *parent,QBoxLayout *topLayout)
189{ 192{
190 QBoxLayout *statusLayout = new QHBoxLayout(topLayout); 193 QBoxLayout *statusLayout = new QHBoxLayout(topLayout);
191 194
192 initCompletion( parent, statusLayout ); 195 initCompletion( parent, statusLayout );
193 196
194 statusLayout->addStretch( 1 ); 197 statusLayout->addStretch( 1 );
195 198
196 initPriority( parent, statusLayout ); 199 initPriority( parent, statusLayout );
197} 200}
198 201