summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-07-04 08:17:48 (UTC)
committer zautrix <zautrix>2005-07-04 08:17:48 (UTC)
commite19b410f43c4fcf35d3d62fc312d1b5251068691 (patch) (unidiff)
treec3aecb6089dbb2e068ad072226e227c14cd8c2cf
parent068a89b64d8ef4cb49702ed53ab4e415a0b90a80 (diff)
downloadkdepimpi-e19b410f43c4fcf35d3d62fc312d1b5251068691.zip
kdepimpi-e19b410f43c4fcf35d3d62fc312d1b5251068691.tar.gz
kdepimpi-e19b410f43c4fcf35d3d62fc312d1b5251068691.tar.bz2
fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt2
-rw-r--r--korganizer/koeditorgeneral.cpp65
-rw-r--r--korganizer/koeditorgeneral.h4
-rw-r--r--korganizer/koeventpopupmenu.cpp1
-rw-r--r--libkcal/calendarlocal.cpp7
5 files changed, 69 insertions, 10 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 71d7208..27d37c4 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -5,2 +5,4 @@ Info about the changes in new versions of KDE-Pim/Pi
5Fixed a problem in KA/Pi search. 5Fixed a problem in KA/Pi search.
6Fixed some minor problems in KO/Pi.
7Added calendar selection possibility to the todo view popup and to the event/todo editor.
6 8
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index 29e68b3..753630b 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -83,3 +83,3 @@ void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout)
83 QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent); 83 QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent);
84 headerLayout->addWidget(summaryLabel,1,0); 84 headerLayout->addWidget(summaryLabel,0,0);
85 85
@@ -95,3 +95,6 @@ void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout)
95 // mSummaryEdit = new QLineEdit(parent); 95 // mSummaryEdit = new QLineEdit(parent);
96 headerLayout->addWidget(mSummaryEdit,1,1); 96 if ( QApplication::desktop()->height() < 320 )
97 headerLayout->addWidget(mSummaryEdit,0,1);
98 else
99 headerLayout->addMultiCellWidget(mSummaryEdit,0,0,1,2);
97 connect ( mSummaryEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); 100 connect ( mSummaryEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) );
@@ -100,5 +103,5 @@ void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout)
100 if ( QApplication::desktop()->height() < 320 ) 103 if ( QApplication::desktop()->height() < 320 )
101 headerLayout->addWidget(locationLabel,1,2); 104 headerLayout->addWidget(locationLabel,0,2);
102 else 105 else
103 headerLayout->addWidget(locationLabel,2,0); 106 headerLayout->addWidget(locationLabel,1,0);
104 107
@@ -111,11 +114,18 @@ void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout)
111 connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); 114 connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) );
115
116 mCalendarBox = new QComboBox ( parent );
117 mCalendarBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) );
112 if ( QApplication::desktop()->height() < 320 ) { 118 if ( QApplication::desktop()->height() < 320 ) {
113 headerLayout->addWidget(mLocationEdit,1,3); 119 headerLayout->addWidget(mLocationEdit,0,3);
120 headerLayout->addWidget(mCalendarBox,0,4);
114 headerLayout->setColStretch( 1, 10); 121 headerLayout->setColStretch( 1, 10);
115 headerLayout->setColStretch( 3, 10); 122 headerLayout->setColStretch( 3, 10);
123 mCalendarBox->setMaximumWidth( 64 );
116 } 124 }
117 else { 125 else {
118 headerLayout->addWidget(mLocationEdit,2,1); 126 headerLayout->addWidget(mLocationEdit,1,1);
127 headerLayout->addWidget(mCalendarBox,1,2);
119 headerLayout->setColStretch( 1, 10); 128 headerLayout->setColStretch( 1, 10);
120 } 129 }
130
121} 131}
@@ -438,2 +448,3 @@ void KOEditorGeneral::setDefaults(bool allDay)
438 setCategories(""); 448 setCategories("");
449 fillCalCombo();
439} 450}
@@ -443,5 +454,44 @@ void KOEditorGeneral::setSecrecy( int num )
443} 454}
444void KOEditorGeneral::readIncidence(Incidence *event) 455void KOEditorGeneral::fillCalCombo( int setToID )
445{ 456{
457 mCalendarBox->clear();
458 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
459 int std = 0;
460 int count = 0;
461 while ( kkf ) {
462 if ( !kkf->mErrorOnLoad &&! kkf->isReadOnly ) {
463 if ( setToID ) {
464 if ( kkf->mCalNumber == setToID )
465 std = count;
466 } else {
467 if ( kkf->isStandard ) {
468 std = count;
469 }
470 }
471 ++count;
472 mCalendarBox->insertItem( kkf->mName );
473 }
474 kkf = KOPrefs::instance()->mCalendars.next();
475 }
476 mCalendarBox->setCurrentItem( std );
477 if ( KOPrefs::instance()->mCalendars.count() == 1 )
478 mCalendarBox->hide();
479 else
480 mCalendarBox->show();
481
482}
483int KOEditorGeneral::getCalendarID()
484{
485 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
486 while ( kkf ) {
487 if ( mCalendarBox->currentText() == kkf->mName)
488 return kkf->mCalNumber;
489 kkf = KOPrefs::instance()->mCalendars.next();
490 }
491 return 1;
492}
446 493
494void KOEditorGeneral::readIncidence(Incidence *event)
495{
496 fillCalCombo( event->calID() );
447 mAlarmMessage = event->summary(); 497 mAlarmMessage = event->summary();
@@ -571,2 +621,3 @@ void KOEditorGeneral::writeIncidence(Incidence *event)
571 } 621 }
622 event->setCalID( getCalendarID() );
572} 623}
diff --git a/korganizer/koeditorgeneral.h b/korganizer/koeditorgeneral.h
index c463403..d8b15af 100644
--- a/korganizer/koeditorgeneral.h
+++ b/korganizer/koeditorgeneral.h
@@ -37,2 +37,3 @@
37#include <qspinbox.h> 37#include <qspinbox.h>
38#include <qcombobox.h>
38 39
@@ -74,2 +75,3 @@ class KOEditorGeneral : public QObject
74 void setSecrecy( int num ); 75 void setSecrecy( int num );
76 int getCalendarID();
75 public slots: 77 public slots:
@@ -94,2 +96,3 @@ class KOEditorGeneral : public QObject
94 protected: 96 protected:
97 void fillCalCombo( int setToID = 0 );
95 int mNextFocus; 98 int mNextFocus;
@@ -99,2 +102,3 @@ class KOEditorGeneral : public QObject
99 KOLocationBox *mLocationEdit; 102 KOLocationBox *mLocationEdit;
103 QComboBox *mCalendarBox;
100 QLabel *mAlarmBell; 104 QLabel *mAlarmBell;
diff --git a/korganizer/koeventpopupmenu.cpp b/korganizer/koeventpopupmenu.cpp
index 77322e7..fc4d9a4 100644
--- a/korganizer/koeventpopupmenu.cpp
+++ b/korganizer/koeventpopupmenu.cpp
@@ -80,3 +80,2 @@ void KOEventPopupMenu::enableDefault( bool enable )
80 } 80 }
81
82} 81}
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index ca64e66..cce798f 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -225,3 +225,4 @@ bool CalendarLocal::addEvent( Event *event )
225 setModified( true ); 225 setModified( true );
226 event->setCalID( mDefaultCalendar ); 226 if ( event->calID() == 0 )
227 event->setCalID( mDefaultCalendar );
227 event->setCalEnabled( true ); 228 event->setCalEnabled( true );
@@ -279,2 +280,3 @@ bool CalendarLocal::addTodo( Todo *todo )
279 setModified( true ); 280 setModified( true );
281 if ( todo->calID() == 0 )
280 todo->setCalID( mDefaultCalendar ); 282 todo->setCalID( mDefaultCalendar );
@@ -783,3 +785,4 @@ bool CalendarLocal::addJournal(Journal *journal)
783 setModified( true ); 785 setModified( true );
784 journal->setCalID( mDefaultCalendar ); 786 if ( journal->calID() == 0 )
787 journal->setCalID( mDefaultCalendar );
785 journal->setCalEnabled( true ); 788 journal->setCalEnabled( true );