summaryrefslogtreecommitdiffabout
path: root/korganizer/koeditorgeneral.cpp
Unidiff
Diffstat (limited to 'korganizer/koeditorgeneral.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeditorgeneral.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index 50a04ea..5c94f62 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -150,39 +150,38 @@ void KOEditorGeneral::showCatPopup()
150 int index = 0; 150 int index = 0;
151 for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); 151 for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin ();
152 it != KOPrefs::instance()->mCustomCategories.end (); 152 it != KOPrefs::instance()->mCustomCategories.end ();
153 ++it) { 153 ++it) {
154 mCatPopup->insertItem (*it, index ); 154 mCatPopup->insertItem (*it, index );
155 //mCategory[index] = *it; 155 //mCategory[index] = *it;
156 if (checkedCategories.find (*it) != checkedCategories.end ()) mCatPopup->setItemChecked (index, true); 156 if (checkedCategories.find (*it) != checkedCategories.end ()) mCatPopup->setItemChecked (index, true);
157 ++index; 157 ++index;
158 } 158 }
159} 159}
160void KOEditorGeneral::selectedCatPopup( int index ) 160void KOEditorGeneral::selectedCatPopup( int index )
161{ 161{
162 qDebug("i %d c %d ", index, KOPrefs::instance()->mCustomCategories.count());
163 QStringList categories = QStringList::split (",", mCategoriesLabel->text()); 162 QStringList categories = QStringList::split (",", mCategoriesLabel->text());
164 QString colcat = categories.first(); 163 QString colcat = categories.first();
165 if (categories.find (KOPrefs::instance()->mCustomCategories[index]) != categories.end ()) 164 if (categories.find (KOPrefs::instance()->mCustomCategories[index]) != categories.end ())
166 categories.remove (KOPrefs::instance()->mCustomCategories[index]); 165 categories.remove (KOPrefs::instance()->mCustomCategories[index]);
167 else 166 else
168 categories.insert (categories.end(), KOPrefs::instance()->mCustomCategories[index]); 167 categories.insert (categories.end(), KOPrefs::instance()->mCustomCategories[index]);
169 categories.sort (); 168 categories.sort ();
170 if ( !colcat.isEmpty() ) { 169 if ( !colcat.isEmpty() ) {
171 if ( categories.find ( colcat ) != categories.end () ) { 170 if ( categories.find ( colcat ) != categories.end () ) {
172 categories.remove( colcat ); 171 categories.remove( colcat );
173 categories.prepend( colcat ); 172 categories.prepend( colcat );
174 } 173 }
175 } 174 }
176 mCategoriesLabel->setText( categories.join(",") ); 175 setCategories( categories.join(",") );
177} 176}
178 177
179void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) 178void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout)
180{ 179{
181 QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout ); 180 QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout );
182 mCatPopup = new QPopupMenu ( parent ); 181 mCatPopup = new QPopupMenu ( parent );
183 mCatPopup->setCheckable (true); 182 mCatPopup->setCheckable (true);
184 connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup())); 183 connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup()));
185 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int ))); 184 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int )));
186 mCategoriesButton = new QPushButton(parent); 185 mCategoriesButton = new QPushButton(parent);
187 mCategoriesButton->setText(i18n("Categories")); 186 mCategoriesButton->setText(i18n("Categories"));
188 //connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); 187 //connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() ));
@@ -389,24 +388,26 @@ void KOEditorGeneral::alarmDisable(bool disable)
389 //mAlarmBell->setEnabled(false); 388 //mAlarmBell->setEnabled(false);
390 mAlarmButton->setEnabled(false); 389 mAlarmButton->setEnabled(false);
391 mAlarmButton->setChecked(false); 390 mAlarmButton->setChecked(false);
392 mAlarmTimeEdit->setEnabled(false); 391 mAlarmTimeEdit->setEnabled(false);
393 mAlarmSoundButton->setEnabled(false); 392 mAlarmSoundButton->setEnabled(false);
394 mAlarmProgramButton->setEnabled(false); 393 mAlarmProgramButton->setEnabled(false);
395 mAlarmIncrCombo->setEnabled(false); 394 mAlarmIncrCombo->setEnabled(false);
396 } 395 }
397} 396}
398 397
399void KOEditorGeneral::setCategories(const QString &str) 398void KOEditorGeneral::setCategories(const QString &str)
400{ 399{
400 QString tt = str;
401 QToolTip::add( mCategoriesLabel, i18n("<b>Click here to edit categories: </b>") +"<em>"+tt.replace( QRegExp(","),", ")+"</em>");
401 mCategoriesLabel->setText(str); 402 mCategoriesLabel->setText(str);
402} 403}
403 404
404void KOEditorGeneral::setDefaults(bool allDay) 405void KOEditorGeneral::setDefaults(bool allDay)
405{ 406{
406#if 0 407#if 0
407 mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName()); 408 mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName());
408#endif 409#endif
409 410
410 mAlarmMessage = i18n("Edit new item"); 411 mAlarmMessage = i18n("Edit new item");
411 enableAlarmEdit( !allDay ); 412 enableAlarmEdit( !allDay );
412 413