summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-07-03 08:42:34 (UTC)
committer zautrix <zautrix>2005-07-03 08:42:34 (UTC)
commit971bfd3cf502fbbafc96bef70e21beb545e450b5 (patch) (unidiff)
tree2d4b2d0d291c5a23bb39e3f448403acbe86cc071 /korganizer
parent914c795a77d8bb28fc8c2155cfc9524f3effdde1 (diff)
downloadkdepimpi-971bfd3cf502fbbafc96bef70e21beb545e450b5.zip
kdepimpi-971bfd3cf502fbbafc96bef70e21beb545e450b5.tar.gz
kdepimpi-971bfd3cf502fbbafc96bef70e21beb545e450b5.tar.bz2
fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp16
-rw-r--r--korganizer/koeventpopupmenu.cpp12
-rw-r--r--korganizer/kolistview.cpp7
-rw-r--r--korganizer/koviewmanager.cpp3
-rw-r--r--korganizer/mainwindow.cpp4
5 files changed, 23 insertions, 19 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index a10e93c..72221fd 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -629,107 +629,113 @@ void CalendarView::init()
629 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); 629 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) );
630 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); 630 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) );
631 mAlarmDialog = new AlarmDialog( this ); 631 mAlarmDialog = new AlarmDialog( this );
632 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); 632 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) );
633 mAlarmDialog->setServerNotification( false ); 633 mAlarmDialog->setServerNotification( false );
634 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); 634 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
635 635
636 636
637#ifndef DESKTOP_VERSION 637#ifndef DESKTOP_VERSION
638//US listen for arriving address resultsets 638//US listen for arriving address resultsets
639 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), 639 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
640 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 640 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
641#endif 641#endif
642 mDateNavigator->setCalendar( mCalendar ); 642 mDateNavigator->setCalendar( mCalendar );
643} 643}
644 644
645 645
646CalendarView::~CalendarView() 646CalendarView::~CalendarView()
647{ 647{
648 // kdDebug() << "~CalendarView()" << endl; 648 // kdDebug() << "~CalendarView()" << endl;
649 //qDebug("CalendarView::~CalendarView() "); 649 //qDebug("CalendarView::~CalendarView() ");
650 delete mDialogManager; 650 delete mDialogManager;
651 delete mViewManager; 651 delete mViewManager;
652 delete mStorage; 652 delete mStorage;
653 delete mDateFrame ; 653 delete mDateFrame ;
654 delete mEventViewerDialog; 654 delete mEventViewerDialog;
655 //kdDebug() << "~CalendarView() done" << endl; 655 //kdDebug() << "~CalendarView() done" << endl;
656} 656}
657void CalendarView::setCalReadOnly( int id, bool readO ) 657void CalendarView::setCalReadOnly( int id, bool readO )
658{ 658{
659 if ( readO ) { 659 if ( readO ) {
660 emit save(); 660 emit save();
661 } 661 }
662 mCalendar->setReadOnly( id, readO ); 662 mCalendar->setReadOnly( id, readO );
663} 663}
664void CalendarView::setScrollBarStep(int val ) 664void CalendarView::setScrollBarStep(int val )
665{ 665{
666#ifdef DESKTOP_VERSION 666#ifdef DESKTOP_VERSION
667 mDateScrollBar->setLineStep ( val ); 667 mDateScrollBar->setLineStep ( val );
668#endif 668#endif
669} 669}
670void CalendarView::scrollBarValue(int val ) 670void CalendarView::scrollBarValue(int val )
671{ 671{
672#ifdef DESKTOP_VERSION 672#ifdef DESKTOP_VERSION
673 if ( QApplication::desktop()->width() < 800 ) return; 673 if ( QApplication::desktop()->width() < 800 ) return;
674 static bool block = false; 674 static bool block = false;
675 if ( block ) return; 675 if ( block ) return;
676 block = true; 676 block = true;
677 val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
678 //qDebug("VAL %d ",val );
679 int count = mNavigator->selectedDates().count(); 677 int count = mNavigator->selectedDates().count();
680 int year = mNavigator->selectedDates().first().year();
681 int day = mNavigator->selectedDates().first().dayOfYear(); 678 int day = mNavigator->selectedDates().first().dayOfYear();
682 if ( val == day -1 ) { 679 int stepdays = val;
680 if ( mDateScrollBar->lineStep () <= count ) {
681 val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
682 //qDebug("VAL %d ",val );
683 stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
684 stepdays = day-1+stepdays;
685 if ( stepdays < 0 ) stepdays = 0;
686 }
687 if ( stepdays == day -1 ) {
683 block = false; 688 block = false;
684 return; 689 return;
685 } 690 }
691 int year = mNavigator->selectedDates().first().year();
686 QDate d ( year,1,1 ); 692 QDate d ( year,1,1 );
687 mNavigator->selectDates( d.addDays( val ), count ); 693 mNavigator->selectDates( d.addDays( stepdays) , count );
688 block = false; 694 block = false;
689#endif 695#endif
690 696
691} 697}
692void CalendarView::checkFiles() 698void CalendarView::checkFiles()
693{ 699{
694 QString message; 700 QString message;
695 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 701 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
696 KopiCalendarFile * cal = calendars.first(); 702 KopiCalendarFile * cal = calendars.first();
697 while ( cal ) { 703 while ( cal ) {
698 if ( cal->mErrorOnLoad ) { 704 if ( cal->mErrorOnLoad ) {
699 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; 705 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n";
700 } 706 }
701 cal = calendars.next(); 707 cal = calendars.next();
702 } 708 }
703 if ( !message.isEmpty() ) { 709 if ( !message.isEmpty() ) {
704 message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0); 710 message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0);
705 KMessageBox::error(this,message, i18n("Loding of calendar(s) failed")); 711 KMessageBox::error(this,message, i18n("Loding of calendar(s) failed"));
706 } 712 }
707 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() )); 713 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() ));
708} 714}
709void CalendarView::checkAlarms() 715void CalendarView::checkAlarms()
710{ 716{
711 717
712 718
713 KConfig *config = KOGlobals::config(); 719 KConfig *config = KOGlobals::config();
714 config->setGroup( "AppRun" ); 720 config->setGroup( "AppRun" );
715 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 721 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
716 int daysto = dt.daysTo( QDate::currentDate() ); 722 int daysto = dt.daysTo( QDate::currentDate() );
717 int days = config->readNumEntry( "LatestProgramStopDays" , daysto); 723 int days = config->readNumEntry( "LatestProgramStopDays" , daysto);
718 dt = dt.addDays( days ); 724 dt = dt.addDays( days );
719 int secto = dt.secsTo( QDateTime::currentDateTime() ); 725 int secto = dt.secsTo( QDateTime::currentDateTime() );
720 int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30; 726 int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30;
721 //qDebug("KO: Reading program stop %d ", secs); 727 //qDebug("KO: Reading program stop %d ", secs);
722 //secs -= ( 3600 * 24*3 ); // debug only 728 //secs -= ( 3600 * 24*3 ); // debug only
723 QDateTime latest = dt.addSecs ( secs ); 729 QDateTime latest = dt.addSecs ( secs );
724 qDebug("KO: Last termination on %s ", latest.toString().latin1()); 730 qDebug("KO: Last termination on %s ", latest.toString().latin1());
725 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 731 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
726 QPtrList<Incidence> el = mCalendar->rawIncidences(); 732 QPtrList<Incidence> el = mCalendar->rawIncidences();
727 QPtrList<Incidence> al; 733 QPtrList<Incidence> al;
728 Incidence* inL = el.first(); 734 Incidence* inL = el.first();
729 QDateTime cur = QDateTime::currentDateTime().addSecs(-59); 735 QDateTime cur = QDateTime::currentDateTime().addSecs(-59);
730 qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); 736 qDebug("KO: Checking alarm until %s ", cur.toString().latin1());
731 while ( inL ) { 737 while ( inL ) {
732 bool ok = false; 738 bool ok = false;
733 int offset = 0; 739 int offset = 0;
734 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; 740 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ;
735 if ( ok ) { 741 if ( ok ) {
diff --git a/korganizer/koeventpopupmenu.cpp b/korganizer/koeventpopupmenu.cpp
index 0b0fe8e..77322e7 100644
--- a/korganizer/koeventpopupmenu.cpp
+++ b/korganizer/koeventpopupmenu.cpp
@@ -16,146 +16,152 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
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 <qcursor.h> 24#include <qcursor.h>
25 25
26#include <klocale.h> 26#include <klocale.h>
27#include <kdebug.h> 27#include <kdebug.h>
28#include <kiconloader.h> 28#include <kiconloader.h>
29 29
30#include <libkcal/event.h> 30#include <libkcal/event.h>
31 31
32#include "koeventpopupmenu.h" 32#include "koeventpopupmenu.h"
33#include "koprefs.h" 33#include "koprefs.h"
34 34
35KOEventPopupMenu::KOEventPopupMenu(): QPopupMenu() 35KOEventPopupMenu::KOEventPopupMenu(): QPopupMenu()
36{ 36{
37 mCurrentIncidence = 0; 37 mCurrentIncidence = 0;
38 mHasAdditionalItems = false; 38 mHasAdditionalItems = false;
39 39
40 40
41 mSingleOnlyItems.append( insertItem (i18n("&Show"),this,SLOT(popupShow()))); 41 mSingleOnlyItems.append( insertItem (i18n("&Show"),this,SLOT(popupShow())));
42 mEditOnlyItems.append(insertItem (i18n("&Edit..."),this,SLOT(popupEdit()))); 42 mEditOnlyItems.append(insertItem (i18n("&Edit..."),this,SLOT(popupEdit())));
43 mEditOnlyItems.append(insertItem (i18n("&Delete..."), 43 mEditOnlyItems.append(insertItem (i18n("&Delete..."),
44 this,SLOT(popupDelete()))); 44 this,SLOT(popupDelete())));
45 mEditOnlyItems.append(insertItem (i18n("&Clone..."), 45 mEditOnlyItems.append(insertItem (i18n("&Clone..."),
46 this,SLOT(popupClone()))); 46 this,SLOT(popupClone())));
47 mEditOnlyItems.append(insertItem (i18n("&Move..."), 47 mEditOnlyItems.append(insertItem (i18n("&Move..."),
48 this,SLOT(popupMove()))); 48 this,SLOT(popupMove())));
49#ifndef DESKTOP_VERSION 49#ifndef DESKTOP_VERSION
50 mEditOnlyItems.append(insertItem (i18n("&Beam..."), 50 mEditOnlyItems.append(insertItem (i18n("&Beam..."),
51 this,SLOT(popupBeam()))); 51 this,SLOT(popupBeam())));
52#endif 52#endif
53 mEditOnlyItems.append(insertItem (i18n("&Toggle Cancel"), 53 mEditOnlyItems.append(insertItem (i18n("&Toggle Cancel"),
54 this,SLOT(popupCancel()))); 54 this,SLOT(popupCancel())));
55 isDisabled = false; 55 isDisabled = false;
56 mCatPopup = new QPopupMenu ( this ); 56 mCatPopup = new QPopupMenu ( this );
57 mCatPopup->setCheckable (true); 57 mCatPopup->setCheckable (true);
58 connect(mCatPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCatPopup())); 58 connect(mCatPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCatPopup()));
59 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCatPopup( int ))); 59 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCatPopup( int )));
60 mCalPopup = new QPopupMenu ( this ); 60 mCalPopup = new QPopupMenu ( this );
61 mCalPopup->setCheckable (true); 61 mCalPopup->setCheckable (true);
62 connect(mCalPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCalPopup())); 62 connect(mCalPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCalPopup()));
63 connect(mCalPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCalPopup( int ))); 63 connect(mCalPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCalPopup( int )));
64 mEditOnlyItems.append(insertItem (i18n("Categories"),mCatPopup )); 64 //mEditOnlyItems.append(insertItem (i18n("Categories"),mCatPopup ));
65 mEditOnlyItems.append(insertItem (i18n("Calendar"),mCalPopup )); 65 //mEditOnlyItems.append(insertItem (i18n("Calendar"),mCalPopup ));
66 insertItem (i18n("Categories"),mCatPopup );
67 insertItem (i18n("Calendar"),mCalPopup );
66 QValueList<int>::Iterator it; 68 QValueList<int>::Iterator it;
67 for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { 69 for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) {
68 mSingleOnlyItems.append(*it); 70 mSingleOnlyItems.append(*it);
69 } 71 }
70 72
71} 73}
72void KOEventPopupMenu::enableDefault( bool enable ) 74void KOEventPopupMenu::enableDefault( bool enable )
73{ 75{
74 isDisabled = !enable; 76 isDisabled = !enable;
75 QValueList<int>::Iterator it; 77 QValueList<int>::Iterator it;
76 for( it = mSingleOnlyItems.begin(); it != mSingleOnlyItems.end(); ++it ) { 78 for( it = mSingleOnlyItems.begin(); it != mSingleOnlyItems.end(); ++it ) {
77 setItemEnabled(*it,enable); 79 setItemEnabled(*it,enable);
78 } 80 }
79 81
80} 82}
81 83
82void KOEventPopupMenu::fillCalPopup() // CAL 84void KOEventPopupMenu::fillCalPopup() // CAL
83{ 85{
84 mCalPopup->clear(); 86 mCalPopup->clear();
85 if (!mCurrentIncidence) return; 87 if (!mCurrentIncidence) return;
88 bool readO = mCurrentIncidence->isReadOnly()|| isDisabled;
86 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 89 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
87 while ( kkf ) { 90 while ( kkf ) {
88 int index = mCalPopup->insertItem( kkf->mName, kkf->mCalNumber); 91 int index = mCalPopup->insertItem( kkf->mName, kkf->mCalNumber);
89 if ( kkf->mErrorOnLoad || kkf->isReadOnly ) 92 if ( kkf->mErrorOnLoad || kkf->isReadOnly || readO )
90 mCalPopup->setItemEnabled( index, false ); 93 mCalPopup->setItemEnabled( index, false );
91 mCalPopup->setItemChecked (index, kkf->mCalNumber == mCurrentIncidence->calID()); 94 mCalPopup->setItemChecked (index, kkf->mCalNumber == mCurrentIncidence->calID());
92 kkf = KOPrefs::instance()->mCalendars.next(); 95 kkf = KOPrefs::instance()->mCalendars.next();
93 } 96 }
94} 97}
95void KOEventPopupMenu::computeCalPopup( int index ) // CAL 98void KOEventPopupMenu::computeCalPopup( int index ) // CAL
96{ 99{
97 if (!mCurrentIncidence) return; 100 if (!mCurrentIncidence) return;
98 mCurrentIncidence->setCalID( index ); 101 mCurrentIncidence->setCalID( index );
99 emit categoryChanged( mCurrentIncidence ); 102 emit categoryChanged( mCurrentIncidence );
100} 103}
101void KOEventPopupMenu::fillCatPopup() 104void KOEventPopupMenu::fillCatPopup()
102{ 105{
103 mCatPopup->clear(); 106 mCatPopup->clear();
104 if (!mCurrentIncidence) return; 107 if (!mCurrentIncidence) return;
108 bool readO = mCurrentIncidence->isReadOnly() || isDisabled;
105 QStringList checkedCategories = mCurrentIncidence->categories(); 109 QStringList checkedCategories = mCurrentIncidence->categories();
106 int index = 0; 110 int index = 0;
107 for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); 111 for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin ();
108 it != KOPrefs::instance()->mCustomCategories.end (); 112 it != KOPrefs::instance()->mCustomCategories.end ();
109 ++it) { 113 ++it) {
110 mCatPopup->insertItem (*it, index ); 114 mCatPopup->insertItem (*it, index );
111 if (checkedCategories.find (*it) != checkedCategories.end ()) { 115 if (checkedCategories.find (*it) != checkedCategories.end ()) {
112 mCatPopup->setItemChecked (index, true); 116 mCatPopup->setItemChecked (index, true);
113 } 117 }
118 if ( readO )
119 mCatPopup->setItemEnabled( index, false );
114 ++index; 120 ++index;
115 } 121 }
116} 122}
117void KOEventPopupMenu::computeCatPopup( int index ) 123void KOEventPopupMenu::computeCatPopup( int index )
118{ 124{
119 if (!mCurrentIncidence) return; 125 if (!mCurrentIncidence) return;
120 QStringList categories = mCurrentIncidence->categories(); 126 QStringList categories = mCurrentIncidence->categories();
121 QString colcat = categories.first(); 127 QString colcat = categories.first();
122 if (categories.find (KOPrefs::instance()->mCustomCategories[index]) != categories.end ()) 128 if (categories.find (KOPrefs::instance()->mCustomCategories[index]) != categories.end ())
123 categories.remove (KOPrefs::instance()->mCustomCategories[index]); 129 categories.remove (KOPrefs::instance()->mCustomCategories[index]);
124 else 130 else
125 categories.insert (categories.end(), KOPrefs::instance()->mCustomCategories[index]); 131 categories.insert (categories.end(), KOPrefs::instance()->mCustomCategories[index]);
126 categories.sort (); 132 categories.sort ();
127 if ( !colcat.isEmpty() ) { 133 if ( !colcat.isEmpty() ) {
128 if ( categories.find ( colcat ) != categories.end () ) { 134 if ( categories.find ( colcat ) != categories.end () ) {
129 categories.remove( colcat ); 135 categories.remove( colcat );
130 categories.prepend( colcat ); 136 categories.prepend( colcat );
131 } 137 }
132 } 138 }
133 mCurrentIncidence->setCategories( categories ); 139 mCurrentIncidence->setCategories( categories );
134 emit categoryChanged( mCurrentIncidence ); 140 emit categoryChanged( mCurrentIncidence );
135} 141}
136void KOEventPopupMenu::showIncidencePopup(Incidence *incidence) 142void KOEventPopupMenu::showIncidencePopup(Incidence *incidence)
137{ 143{
138 if ( !incidence) return; 144 if ( !incidence) return;
139 mCurrentIncidence = incidence; 145 mCurrentIncidence = incidence;
140 146
141 if (mCurrentIncidence) { 147 if (mCurrentIncidence) {
142 // Enable/Disabled menu items only valid for editable events. 148 // Enable/Disabled menu items only valid for editable events.
143 if ( !isDisabled ) { 149 if ( !isDisabled ) {
144 QValueList<int>::Iterator it; 150 QValueList<int>::Iterator it;
145 for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { 151 for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) {
146 setItemEnabled(*it,!mCurrentIncidence->isReadOnly()); 152 setItemEnabled(*it,!mCurrentIncidence->isReadOnly());
147 } 153 }
148 } 154 }
149 popup(QCursor::pos()); 155 popup(QCursor::pos());
150 } 156 }
151} 157}
152 158
153void KOEventPopupMenu::addAdditionalItem(const QIconSet &icon,const QString &text, 159void KOEventPopupMenu::addAdditionalItem(const QIconSet &icon,const QString &text,
154 const QObject *receiver, const char *member, 160 const QObject *receiver, const char *member,
155 bool editOnly) 161 bool editOnly)
156{ 162{
157 if (!mHasAdditionalItems) { 163 if (!mHasAdditionalItems) {
158 mHasAdditionalItems = true; 164 mHasAdditionalItems = true;
159 insertSeparator(); 165 insertSeparator();
160 } 166 }
161 int id = insertItem(icon,text,receiver,member); 167 int id = insertItem(icon,text,receiver,member);
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index cec0476..25e599d 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -275,125 +275,125 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
275 mListView->addColumn(i18n("End Time")); 275 mListView->addColumn(i18n("End Time"));
276 mListView->addColumn(i18n("Alarm")); // alarm set? 276 mListView->addColumn(i18n("Alarm")); // alarm set?
277 mListView->addColumn(i18n("Recurs")); // recurs? 277 mListView->addColumn(i18n("Recurs")); // recurs?
278 mListView->addColumn(i18n("Due Date")); 278 mListView->addColumn(i18n("Due Date"));
279 mListView->addColumn(i18n("Due Time")); 279 mListView->addColumn(i18n("Due Time"));
280 mListView->addColumn(i18n("Cancelled")); 280 mListView->addColumn(i18n("Cancelled"));
281 mListView->addColumn(i18n("Categories")); 281 mListView->addColumn(i18n("Categories"));
282 mListView->addColumn(i18n("Calendar")); 282 mListView->addColumn(i18n("Calendar"));
283 mListView->addColumn(i18n("Last Modified")); 283 mListView->addColumn(i18n("Last Modified"));
284 284
285 mListView->setColumnAlignment(0,AlignLeft); 285 mListView->setColumnAlignment(0,AlignLeft);
286 mListView->setColumnAlignment(1,AlignLeft); 286 mListView->setColumnAlignment(1,AlignLeft);
287 mListView->setColumnAlignment(2,AlignHCenter); 287 mListView->setColumnAlignment(2,AlignHCenter);
288 mListView->setColumnAlignment(3,AlignLeft); 288 mListView->setColumnAlignment(3,AlignLeft);
289 mListView->setColumnAlignment(4,AlignHCenter); 289 mListView->setColumnAlignment(4,AlignHCenter);
290 mListView->setColumnAlignment(5,AlignLeft); 290 mListView->setColumnAlignment(5,AlignLeft);
291 mListView->setColumnAlignment(6,AlignLeft); 291 mListView->setColumnAlignment(6,AlignLeft);
292 mListView->setColumnAlignment(7,AlignLeft); 292 mListView->setColumnAlignment(7,AlignLeft);
293 mListView->setColumnAlignment(8,AlignLeft); 293 mListView->setColumnAlignment(8,AlignLeft);
294 mListView->setColumnAlignment(9,AlignLeft); 294 mListView->setColumnAlignment(9,AlignLeft);
295 mListView->setColumnAlignment(10,AlignLeft); 295 mListView->setColumnAlignment(10,AlignLeft);
296 mListView->setColumnAlignment(11,AlignLeft); 296 mListView->setColumnAlignment(11,AlignLeft);
297 mListView->setColumnAlignment(12,AlignLeft); 297 mListView->setColumnAlignment(12,AlignLeft);
298 mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this); 298 mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this);
299 299
300 int iii = 0; 300 int iii = 0;
301 for ( iii = 0; iii< 13 ; ++iii ) 301 for ( iii = 0; iii< 13 ; ++iii )
302 mListView->setColumnWidthMode( iii, QListView::Manual ); 302 mListView->setColumnWidthMode( iii, QListView::Manual );
303 303
304 QBoxLayout *layoutTop = new QVBoxLayout(this); 304 QBoxLayout *layoutTop = new QVBoxLayout(this);
305 layoutTop->addWidget(mListView); 305 layoutTop->addWidget(mListView);
306 mListView->setFont ( KOPrefs::instance()->mListViewFont ); 306 mListView->setFont ( KOPrefs::instance()->mListViewFont );
307 mPopupMenu = eventPopup(); 307 mPopupMenu = eventPopup();
308 QPopupMenu* selPopup = new QPopupMenu ( this ); 308 QPopupMenu* selPopup = new QPopupMenu ( this );
309 mPopupMenu->insertSeparator(); 309 mPopupMenu->insertSeparator();
310 310
311 selPopup->insertItem(i18n("All"),this, 311 selPopup->insertItem(i18n("All"),this,
312 SLOT(allSelection())); 312 SLOT(allSelection()));
313 selPopup->insertItem(i18n("None"),this, 313 selPopup->insertItem(i18n("None"),this,
314 SLOT(clearSelection())); 314 SLOT(clearSelection()));
315 selPopup->insertItem(i18n("Delete selected..."),this, 315 selPopup->insertItem(i18n("Delete selected..."),this,
316 SLOT(deleteAll())); 316 SLOT(deleteAll()));
317 mPopupMenu->insertItem(i18n("Selection"), selPopup ); 317 mPopupMenu->insertItem(i18n("Selection"), selPopup );
318 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 318 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
319 i18n("Hide all selected"),this, 319 i18n("Hide all selected"),this,
320 SLOT(hideAll()),true); 320 SLOT(hideAll()),true);
321 321
322 selPopup->insertSeparator(); 322 selPopup->insertSeparator();
323 QPopupMenu * exportPO = new QPopupMenu ( this );
324 selPopup->insertItem( i18n("Export"), exportPO );
323#ifdef DESKTOP_VERSION 325#ifdef DESKTOP_VERSION
324 mPopupMenu->insertSeparator(); 326 mPopupMenu->insertSeparator();
325 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 327 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
326 i18n("Print complete list"),this, 328 i18n("Print complete list..."),this,
327 SLOT(printList()),true); 329 SLOT(printList()),true);
328#endif 330#endif
329 mCalPopup = new QPopupMenu ( this ); 331 mCalPopup = new QPopupMenu ( this );
330 selPopup->insertItem( i18n("Set Calendar"), mCalPopup ); 332 selPopup->insertItem( i18n("Set Calendar"), mCalPopup );
331 333
332 selPopup->insertItem(i18n("Set categories")+"...",this, 334 selPopup->insertItem(i18n("Set categories")+"...",this,
333 SLOT(setCat()) ); 335 SLOT(setCat()) );
334 selPopup->insertItem( i18n("Set alarm..."),this, 336 selPopup->insertItem( i18n("Set alarm..."),this,
335 SLOT(setAlarm())); 337 SLOT(setAlarm()));
336#if 0 338#if 0
337 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 339 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
338 i18n("Set categories")+"...",this, 340 i18n("Set categories")+"...",this,
339 SLOT(setCat()),true); 341 SLOT(setCat()),true);
340 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 342 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
341 i18n("Set alarm..."),this, 343 i18n("Set alarm..."),this,
342 SLOT(setAlarm()),true); 344 SLOT(setAlarm()),true);
343#endif 345#endif
344 QObject::connect(mCalPopup,SIGNAL(aboutToShow()),this, 346 QObject::connect(mCalPopup,SIGNAL(aboutToShow()),this,
345 SLOT( populateCalPopup() )); 347 SLOT( populateCalPopup() ));
346 QObject::connect(mCalPopup,SIGNAL(activated( int )),this, 348 QObject::connect(mCalPopup,SIGNAL(activated( int )),this,
347 SLOT( setCalendar( int ) )); 349 SLOT( setCalendar( int ) ));
348 QObject::connect(mPopupMenu,SIGNAL(categoryChanged( Incidence * )),this, 350 QObject::connect(mPopupMenu,SIGNAL(categoryChanged( Incidence * )),this,
349 SLOT( catChanged( Incidence * ) )); 351 SLOT( catChanged( Incidence * ) ));
350 QPopupMenu * exportPO = new QPopupMenu ( this );
351 selPopup->insertItem( i18n("Export"), exportPO );
352 exportPO->insertItem( i18n("As iCal (ics) file..."),this, 352 exportPO->insertItem( i18n("As iCal (ics) file..."),this,
353 SLOT(saveToFile())); 353 SLOT(saveToFile()));
354 exportPO->insertItem( i18n("As vCal (vcs) file..."),this, 354 exportPO->insertItem( i18n("As vCal (vcs) file..."),this,
355 SLOT(saveToFileVCS())); 355 SLOT(saveToFileVCS()));
356 exportPO->insertItem( i18n("Journal/Details..."),this, 356 exportPO->insertItem( i18n("Journal/Details..."),this,
357 SLOT(saveDescriptionToFile())); 357 SLOT(saveDescriptionToFile()));
358 // mPopupMenu->insertSeparator(); 358 // mPopupMenu->insertSeparator();
359 // mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 359 // mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
360 // i18n("Add Categ. to selected..."),this, 360 // i18n("Add Categ. to selected..."),this,
361 // SLOT(addCat()),true); 361 // SLOT(addCat()),true);
362 //mPopupMenu->insertSeparator(); 362 //mPopupMenu->insertSeparator();
363#ifndef DESKTOP_VERSION 363#ifndef DESKTOP_VERSION
364 selPopup->insertSeparator(); 364 selPopup->insertSeparator();
365 selPopup->insertItem( i18n("Beam via IR..."),this, 365 selPopup->insertItem( i18n("Beam via IR..."),this,
366 SLOT(beamSelected())); 366 SLOT(beamSelected()));
367#if 0 367#if 0
368 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 368 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
369 i18n("Beam via IR"),this, 369 i18n("Beam via IR"),this,
370 SLOT(beamSelected()),true); 370 SLOT(beamSelected()),true);
371#endif 371#endif
372#endif 372#endif
373 /* 373 /*
374 mPopupMenu = new QPopupMenu; 374 mPopupMenu = new QPopupMenu;
375 mPopupMenu->insertItem(i18n("Edit Event"), this, 375 mPopupMenu->insertItem(i18n("Edit Event"), this,
376 SLOT (editEvent())); 376 SLOT (editEvent()));
377 mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, 377 mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this,
378 SLOT (deleteEvent())); 378 SLOT (deleteEvent()));
379 mPopupMenu->insertSeparator(); 379 mPopupMenu->insertSeparator();
380 mPopupMenu->insertItem(i18n("Show Dates"), this, 380 mPopupMenu->insertItem(i18n("Show Dates"), this,
381 SLOT(showDates())); 381 SLOT(showDates()));
382 mPopupMenu->insertItem(i18n("Hide Dates"), this, 382 mPopupMenu->insertItem(i18n("Hide Dates"), this,
383 SLOT(hideDates())); 383 SLOT(hideDates()));
384 */ 384 */
385 QObject::connect(mListView,SIGNAL( newEvent()), 385 QObject::connect(mListView,SIGNAL( newEvent()),
386 this,SIGNAL(signalNewEvent())); 386 this,SIGNAL(signalNewEvent()));
387 QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), 387 QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)),
388 this,SLOT(defaultItemAction(QListViewItem *))); 388 this,SLOT(defaultItemAction(QListViewItem *)));
389 QObject::connect(mListView,SIGNAL(rightButtonPressed( QListViewItem *, 389 QObject::connect(mListView,SIGNAL(rightButtonPressed( QListViewItem *,
390 const QPoint &, int )), 390 const QPoint &, int )),
391 this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); 391 this,SLOT(popupMenu(QListViewItem *,const QPoint &,int)));
392 QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), 392 QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)),
393 SLOT(processSelectionChange(QListViewItem *))); 393 SLOT(processSelectionChange(QListViewItem *)));
394 QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), 394 QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)),
395 SIGNAL(showIncidenceSignal(Incidence *)) ); 395 SIGNAL(showIncidenceSignal(Incidence *)) );
396 396
397 readSettings(KOGlobals::config(),"KOListView Layout"); 397 readSettings(KOGlobals::config(),"KOListView Layout");
398} 398}
399 399
@@ -1267,97 +1267,96 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e)
1267 ensureItemVisible ( cn ); 1267 ensureItemVisible ( cn );
1268 } 1268 }
1269 emit showIncidence( ci->data()); 1269 emit showIncidence( ci->data());
1270 } 1270 }
1271 } 1271 }
1272 e->accept(); 1272 e->accept();
1273 } 1273 }
1274 break; 1274 break;
1275 case Qt::Key_Return: 1275 case Qt::Key_Return:
1276 case Qt::Key_Enter: 1276 case Qt::Key_Enter:
1277 { 1277 {
1278 QListViewItem* cn; 1278 QListViewItem* cn;
1279 cn = currentItem(); 1279 cn = currentItem();
1280 if ( cn ) { 1280 if ( cn ) {
1281 KOListViewItem* ci = (KOListViewItem*)( cn ); 1281 KOListViewItem* ci = (KOListViewItem*)( cn );
1282 if ( ci ){ 1282 if ( ci ){
1283 if ( e->state() == ShiftButton ) 1283 if ( e->state() == ShiftButton )
1284 ci->setSelected( false ); 1284 ci->setSelected( false );
1285 else 1285 else
1286 ci->setSelected( true ); 1286 ci->setSelected( true );
1287 cn = cn->nextSibling(); 1287 cn = cn->nextSibling();
1288 if ( cn ) { 1288 if ( cn ) {
1289 setCurrentItem ( cn ); 1289 setCurrentItem ( cn );
1290 ensureItemVisible ( cn ); 1290 ensureItemVisible ( cn );
1291 } 1291 }
1292 } 1292 }
1293 } 1293 }
1294 e->accept(); 1294 e->accept();
1295 } 1295 }
1296 break; 1296 break;
1297 default: 1297 default:
1298 e->ignore(); 1298 e->ignore();
1299 } 1299 }
1300} 1300}
1301KOListViewListView::KOListViewListView(KOListView * lv ) 1301KOListViewListView::KOListViewListView(KOListView * lv )
1302 : KListView( lv, "kolistlistview", false ) 1302 : KListView( lv, "kolistlistview", false )
1303{ 1303{
1304 mYMousePos = 0; 1304 mYMousePos = 0;
1305 mPopupTimer = new QTimer(this); 1305 mPopupTimer = new QTimer(this);
1306 connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); 1306 connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu()));
1307#ifndef DESKTOP_VERSION 1307#ifndef DESKTOP_VERSION
1308 //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); 1308 //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold );
1309#endif 1309#endif
1310 setSelectionMode( QListView::Multi ); 1310 setSelectionMode( QListView::Multi );
1311 setMultiSelection( true); 1311 setMultiSelection( true);
1312} 1312}
1313bool KOListViewListView::hasMultiSelection(QListViewItem* item) 1313bool KOListViewListView::hasMultiSelection(QListViewItem* item)
1314{ 1314{
1315 int selCount = 0;
1316 QListViewItem *qitem = firstChild (); 1315 QListViewItem *qitem = firstChild ();
1317 while ( qitem ) { 1316 while ( qitem ) {
1318 if ( qitem->isSelected() && item != qitem ) 1317 if ( qitem->isSelected() && item != qitem )
1319 return true; 1318 return true;
1320 qitem = qitem->nextSibling(); 1319 qitem = qitem->nextSibling();
1321 } 1320 }
1322 return false; 1321 return false;
1323} 1322}
1324void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) 1323void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
1325{ 1324{
1326 if (!e) return; 1325 if (!e) return;
1327 QPoint vp = contentsToViewport(e->pos()); 1326 QPoint vp = contentsToViewport(e->pos());
1328 QListViewItem *item = itemAt(vp); 1327 QListViewItem *item = itemAt(vp);
1329 if (!item) { 1328 if (!item) {
1330 emit newEvent(); 1329 emit newEvent();
1331 return; 1330 return;
1332 } 1331 }
1333 KListView::contentsMouseDoubleClickEvent(e); 1332 KListView::contentsMouseDoubleClickEvent(e);
1334} 1333}
1335#if 0 1334#if 0
1336void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) 1335void KOListViewListView::contentsMousePressEvent(QMouseEvent *e)
1337{ 1336{
1338 //qDebug("contentsMousePressEvent++++ "); 1337 //qDebug("contentsMousePressEvent++++ ");
1339 KListView::contentsMousePressEvent( e ); 1338 KListView::contentsMousePressEvent( e );
1340 if ( e->button() == RightButton ) { 1339 if ( e->button() == RightButton ) {
1341 QListViewItem* ci = currentItem(); 1340 QListViewItem* ci = currentItem();
1342 clearSelection () ; 1341 clearSelection () ;
1343 if ( ci ) 1342 if ( ci )
1344 ci->setSelected( true ); 1343 ci->setSelected( true );
1345 } 1344 }
1346} 1345}
1347void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) 1346void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e)
1348{ 1347{
1349 KListView::contentsMouseReleaseEvent(e); 1348 KListView::contentsMouseReleaseEvent(e);
1350} 1349}
1351void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) 1350void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e)
1352{ 1351{
1353 KListView::contentsMouseMoveEvent(e); 1352 KListView::contentsMouseMoveEvent(e);
1354} 1353}
1355#endif 1354#endif
1356void KOListViewListView::popupMenu() 1355void KOListViewListView::popupMenu()
1357{ 1356{
1358 mPopupTimer->stop(); 1357 mPopupTimer->stop();
1359 QMouseEvent* e = new QMouseEvent( QEvent::MouseButtonPress, mEventPos ,mEventGlobalPos, RightButton , RightButton ); 1358 QMouseEvent* e = new QMouseEvent( QEvent::MouseButtonPress, mEventPos ,mEventGlobalPos, RightButton , RightButton );
1360 QApplication::postEvent( this->viewport(), e ); 1359 QApplication::postEvent( this->viewport(), e );
1361 1360
1362} 1361}
1363void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) 1362void KOListViewListView::contentsMousePressEvent(QMouseEvent *e)
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 792a7b8..ba3bc05 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -510,134 +510,131 @@ void KOViewManager::showAgendaView( bool fullScreen )
510 connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)), 510 connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)),
511 mMainView, SLOT(deleteIncidence(Incidence *))); 511 mMainView, SLOT(deleteIncidence(Incidence *)));
512 512
513 connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ), 513 connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ),
514 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 514 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
515 515
516 connect(mAgendaView, SIGNAL( toggleExpand() ), 516 connect(mAgendaView, SIGNAL( toggleExpand() ),
517 mMainView, SLOT( toggleExpand() ) ); 517 mMainView, SLOT( toggleExpand() ) );
518 518
519 connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ), 519 connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ),
520 mMainView, SLOT(cloneIncidence(Incidence *) ) ) ; 520 mMainView, SLOT(cloneIncidence(Incidence *) ) ) ;
521 connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ), 521 connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ),
522 mMainView, SLOT(cancelIncidence(Incidence *) ) ) ; 522 mMainView, SLOT(cancelIncidence(Incidence *) ) ) ;
523 connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig())); 523 connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig()));
524 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView, 524 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView,
525 SLOT( updateTodo( Todo *, int ) ) ); 525 SLOT( updateTodo( Todo *, int ) ) );
526 connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )), 526 connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )),
527 mMainView, SIGNAL( todoModified( Todo *, int ))); 527 mMainView, SIGNAL( todoModified( Todo *, int )));
528 connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 528 connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
529 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 529 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
530 connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 530 connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
531 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 531 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
532 connect( mAgendaView, SIGNAL( selectWeekNum( int ) ), 532 connect( mAgendaView, SIGNAL( selectWeekNum( int ) ),
533 mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); 533 mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) );
534 mAgendaView->readSettings(); 534 mAgendaView->readSettings();
535 mAgendaView->updateConfig(); 535 mAgendaView->updateConfig();
536 } 536 }
537 537
538 KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW; 538 KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW;
539 showView( mAgendaView, full); 539 showView( mAgendaView, full);
540 KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW; 540 KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW;
541 mMainView->setScrollBarStep( 1 ); 541 mMainView->setScrollBarStep( 1 );
542} 542}
543 543
544void KOViewManager::showDayView() 544void KOViewManager::showDayView()
545{ 545{
546 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); 546 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
547 mFlagShowNextxDays = false; 547 mFlagShowNextxDays = false;
548 globalFlagBlockLabel = 1; 548 globalFlagBlockLabel = 1;
549 globalFlagBlockAgenda = 1; 549 globalFlagBlockAgenda = 1;
550 if ( mCurrentAgendaView != 1 ) 550 if ( mCurrentAgendaView != 1 )
551 mCurrentAgendaView = -1; 551 mCurrentAgendaView = -1;
552 showAgendaView(); 552 showAgendaView();
553 qApp->processEvents(); 553 qApp->processEvents();
554 globalFlagBlockAgenda = 2; 554 globalFlagBlockAgenda = 2;
555 globalFlagBlockLabel = 0; 555 globalFlagBlockLabel = 0;
556 mMainView->dateNavigator()->selectDates( 1 ); 556 mMainView->dateNavigator()->selectDates( 1 );
557 mCurrentAgendaView = 1 ; 557 mCurrentAgendaView = 1 ;
558 mMainView->setScrollBarStep( 1 );
559 558
560} 559}
561 560
562void KOViewManager::showWorkWeekView() 561void KOViewManager::showWorkWeekView()
563{ 562{
564 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); 563 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
565 mFlagShowNextxDays = false; 564 mFlagShowNextxDays = false;
566 globalFlagBlockAgenda = 1; 565 globalFlagBlockAgenda = 1;
567 globalFlagBlockLabel = 1; 566 globalFlagBlockLabel = 1;
568 if ( mCurrentAgendaView != 5 ) 567 if ( mCurrentAgendaView != 5 )
569 mCurrentAgendaView = -1; 568 mCurrentAgendaView = -1;
570 showAgendaView(); 569 showAgendaView();
571 qApp->processEvents(); 570 qApp->processEvents();
572 globalFlagBlockAgenda = 2; 571 globalFlagBlockAgenda = 2;
573 globalFlagBlockLabel = 0; 572 globalFlagBlockLabel = 0;
574 mMainView->dateNavigator()->selectWorkWeek(); 573 mMainView->dateNavigator()->selectWorkWeek();
575 mCurrentAgendaView = 5 ; 574 mCurrentAgendaView = 5 ;
576 mMainView->setScrollBarStep( 1 );
577 575
578} 576}
579 577
580void KOViewManager::showWeekView() 578void KOViewManager::showWeekView()
581{ 579{
582 580
583 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); 581 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
584 mFlagShowNextxDays = false; 582 mFlagShowNextxDays = false;
585 globalFlagBlockAgenda = 1; 583 globalFlagBlockAgenda = 1;
586 globalFlagBlockLabel = 1; 584 globalFlagBlockLabel = 1;
587 if ( mCurrentAgendaView != 7 ) 585 if ( mCurrentAgendaView != 7 )
588 mCurrentAgendaView = -1; 586 mCurrentAgendaView = -1;
589 showAgendaView(); 587 showAgendaView();
590 qApp->processEvents(); 588 qApp->processEvents();
591 globalFlagBlockAgenda = 2; 589 globalFlagBlockAgenda = 2;
592 globalFlagBlockLabel = 0; 590 globalFlagBlockLabel = 0;
593 mMainView->dateNavigator()->selectWeek(); 591 mMainView->dateNavigator()->selectWeek();
594 mCurrentAgendaView = 7 ; 592 mCurrentAgendaView = 7 ;
595 mMainView->setScrollBarStep( 1 );
596} 593}
597 594
598void KOViewManager::showNextXView() 595void KOViewManager::showNextXView()
599{ 596{
600 597
601 KOPrefs::instance()->mCurrentDisplayedView = VIEW_NX_VIEW; 598 KOPrefs::instance()->mCurrentDisplayedView = VIEW_NX_VIEW;
602 globalFlagBlockAgenda = 1; 599 globalFlagBlockAgenda = 1;
603 if ( mCurrentAgendaView != 3 ) 600 if ( mCurrentAgendaView != 3 )
604 mCurrentAgendaView = -1; 601 mCurrentAgendaView = -1;
605 showAgendaView(KOPrefs::instance()->mFullViewMonth); 602 showAgendaView(KOPrefs::instance()->mFullViewMonth);
606 globalFlagBlockAgenda = 2; 603 globalFlagBlockAgenda = 2;
607 mMainView->dateNavigator()->selectDates( QDate::currentDate(), 604 mMainView->dateNavigator()->selectDates( QDate::currentDate(),
608 KOPrefs::instance()->mNextXDays ); 605 KOPrefs::instance()->mNextXDays );
609 mFlagShowNextxDays = true; 606 mFlagShowNextxDays = true;
610 mCurrentAgendaView = 3 ; 607 mCurrentAgendaView = 3 ;
611 KOPrefs::instance()->mCurrentDisplayedView = VIEW_NX_VIEW; 608 KOPrefs::instance()->mCurrentDisplayedView = VIEW_NX_VIEW;
612 mMainView->setScrollBarStep( KOPrefs::instance()->mNextXDays ); 609 mMainView->setScrollBarStep( KOPrefs::instance()->mNextXDays );
613} 610}
614bool KOViewManager::showsNextDays() 611bool KOViewManager::showsNextDays()
615{ 612{
616 return mFlagShowNextxDays; 613 return mFlagShowNextxDays;
617} 614}
618void KOViewManager::createMonthView() 615void KOViewManager::createMonthView()
619{ 616{
620if (!mMonthView) { 617if (!mMonthView) {
621 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); 618 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView");
622 619
623 addView(mMonthView); 620 addView(mMonthView);
624 // mMonthView->show(); 621 // mMonthView->show();
625 // SIGNALS/SLOTS FOR MONTH VIEW 622 // SIGNALS/SLOTS FOR MONTH VIEW
626 623
627 connect(mMonthView,SIGNAL(showJournalSignal( int, QDate )),SLOT(showDateView( int, QDate ))); 624 connect(mMonthView,SIGNAL(showJournalSignal( int, QDate )),SLOT(showDateView( int, QDate )));
628 625
629 connect(mMonthView, SIGNAL(newTodoSignal(QDateTime,bool)), 626 connect(mMonthView, SIGNAL(newTodoSignal(QDateTime,bool)),
630 mMainView, SLOT(newTodoDateTime(QDateTime, bool))); 627 mMainView, SLOT(newTodoDateTime(QDateTime, bool)));
631 628
632 629
633 connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), 630 connect(mMonthView, SIGNAL(newEventSignal(QDateTime)),
634 mMainView, SLOT(newEvent(QDateTime))); 631 mMainView, SLOT(newEvent(QDateTime)));
635 632
636 connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), 633 connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)),
637 mMainView, SLOT(showIncidence(Incidence *))); 634 mMainView, SLOT(showIncidence(Incidence *)));
638 connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), 635 connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)),
639 mMainView, SLOT(editIncidence(Incidence *))); 636 mMainView, SLOT(editIncidence(Incidence *)));
640 connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), 637 connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)),
641 mMainView, SLOT(deleteIncidence(Incidence *))); 638 mMainView, SLOT(deleteIncidence(Incidence *)));
642 639
643 connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), 640 connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ),
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 7a5f3e5..5d26d35 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -785,100 +785,96 @@ void MainWindow::initActions()
785 785
786 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); 786 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
787 action->addTo( mCurrentItemMenu ); 787 action->addTo( mCurrentItemMenu );
788 connect( action, SIGNAL( activated() ), 788 connect( action, SIGNAL( activated() ),
789 mView, SLOT( undo_delete() ) ); 789 mView, SLOT( undo_delete() ) );
790 mCurrentItemMenu->insertSeparator(); 790 mCurrentItemMenu->insertSeparator();
791 icon = loadPixmap( pathString + "newevent" ); 791 icon = loadPixmap( pathString + "newevent" );
792 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); 792 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
793 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); 793 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 );
794 configureToolBarMenu->insertSeparator(); 794 configureToolBarMenu->insertSeparator();
795 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); 795 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 );
796 configureToolBarMenu->insertSeparator(); 796 configureToolBarMenu->insertSeparator();
797 configureToolBarMenu->insertItem(i18n("Week Number"), 400); 797 configureToolBarMenu->insertItem(i18n("Week Number"), 400);
798 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); 798 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
799 799
800 //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); 800 //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu);
801 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); 801 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this );
802 mShowAction->addTo( mCurrentItemMenu ); 802 mShowAction->addTo( mCurrentItemMenu );
803 connect( mShowAction, SIGNAL( activated() ), 803 connect( mShowAction, SIGNAL( activated() ),
804 mView, SLOT( showIncidence() ) ); 804 mView, SLOT( showIncidence() ) );
805 805
806 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); 806 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this );
807 mEditAction->addTo( mCurrentItemMenu ); 807 mEditAction->addTo( mCurrentItemMenu );
808 connect( mEditAction, SIGNAL( activated() ), 808 connect( mEditAction, SIGNAL( activated() ),
809 mView, SLOT( editIncidence() ) ); 809 mView, SLOT( editIncidence() ) );
810 810
811 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); 811 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this );
812 mDeleteAction->addTo( mCurrentItemMenu ); 812 mDeleteAction->addTo( mCurrentItemMenu );
813 connect( mDeleteAction, SIGNAL( activated() ), 813 connect( mDeleteAction, SIGNAL( activated() ),
814 mView, SLOT( deleteIncidence() ) ); 814 mView, SLOT( deleteIncidence() ) );
815 815
816 816
817 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); 817 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this );
818 mCloneAction->addTo( mCurrentItemMenu ); 818 mCloneAction->addTo( mCurrentItemMenu );
819 connect( mCloneAction, SIGNAL( activated() ), 819 connect( mCloneAction, SIGNAL( activated() ),
820 mView, SLOT( cloneIncidence() ) ); 820 mView, SLOT( cloneIncidence() ) );
821 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); 821 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this );
822 mMoveAction->addTo( mCurrentItemMenu ); 822 mMoveAction->addTo( mCurrentItemMenu );
823 connect( mMoveAction, SIGNAL( activated() ), 823 connect( mMoveAction, SIGNAL( activated() ),
824 mView, SLOT( moveIncidence() ) ); 824 mView, SLOT( moveIncidence() ) );
825 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); 825 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this );
826 mBeamAction->addTo(mCurrentItemMenu ); 826 mBeamAction->addTo(mCurrentItemMenu );
827 connect( mBeamAction, SIGNAL( activated() ), 827 connect( mBeamAction, SIGNAL( activated() ),
828 mView, SLOT( beamIncidence() ) ); 828 mView, SLOT( beamIncidence() ) );
829 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); 829 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
830 mCancelAction->addTo( mCurrentItemMenu ); 830 mCancelAction->addTo( mCurrentItemMenu );
831 connect( mCancelAction, SIGNAL( activated() ), 831 connect( mCancelAction, SIGNAL( activated() ),
832 mView, SLOT( toggleCancelIncidence() ) ); 832 mView, SLOT( toggleCancelIncidence() ) );
833#ifdef DESKTOP_VERSION
834 actionMenu->insertSeparator();
835#endif
836
837 833
838 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); 834 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
839 ne_action->addTo( actionMenu ); 835 ne_action->addTo( actionMenu );
840 connect( ne_action, SIGNAL( activated() ), 836 connect( ne_action, SIGNAL( activated() ),
841 mView, SLOT( newEvent() ) ); 837 mView, SLOT( newEvent() ) );
842 icon = loadPixmap( pathString + "newtodo" ); 838 icon = loadPixmap( pathString + "newtodo" );
843 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); 839 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
844 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); 840 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
845 nt_action->addTo( actionMenu ); 841 nt_action->addTo( actionMenu );
846 connect( nt_action, SIGNAL( activated() ), 842 connect( nt_action, SIGNAL( activated() ),
847 mView, SLOT( newTodo() ) ); 843 mView, SLOT( newTodo() ) );
848 844
849 845
850 846
851 // *********************** 847 // ***********************
852 if ( KOPrefs::instance()->mVerticalScreen ) { 848 if ( KOPrefs::instance()->mVerticalScreen ) {
853 icon = SmallIcon( "1updownarrow" ); 849 icon = SmallIcon( "1updownarrow" );
854 } else { 850 } else {
855 icon = SmallIcon("1leftrightarrow" ); 851 icon = SmallIcon("1leftrightarrow" );
856 } 852 }
857 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); 853 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 );
858 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); 854 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this );
859 FSaction->addTo( viewMenu ); 855 FSaction->addTo( viewMenu );
860 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); 856 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() ));
861 857
862 858
863 icon = loadPixmap( pathString + "filter" ); 859 icon = loadPixmap( pathString + "filter" );
864 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); 860 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 );
865 icon = loadPixmap( pathString + "configure" ); 861 icon = loadPixmap( pathString + "configure" );
866 action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); 862 action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this );
867 action->addTo( viewMenu ); 863 action->addTo( viewMenu );
868 connect( action, SIGNAL( activated() ), 864 connect( action, SIGNAL( activated() ),
869 mView, SLOT( toggleFilter() ) ); 865 mView, SLOT( toggleFilter() ) );
870 mToggleFilter = action; 866 mToggleFilter = action;
871 icon = loadPixmap( pathString + "navi" ); 867 icon = loadPixmap( pathString + "navi" );
872 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); 868 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 );
873 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); 869 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this );
874 action->addTo( viewMenu ); 870 action->addTo( viewMenu );
875 connect( action, SIGNAL( activated() ), 871 connect( action, SIGNAL( activated() ),
876 mView, SLOT( toggleDateNavigatorWidget() ) ); 872 mView, SLOT( toggleDateNavigatorWidget() ) );
877 mToggleNav = action ; 873 mToggleNav = action ;
878 icon = loadPixmap( pathString + "allday" ); 874 icon = loadPixmap( pathString + "allday" );
879 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); 875 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 );
880 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); 876 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this );
881 action->addTo( viewMenu ); 877 action->addTo( viewMenu );
882 connect( action, SIGNAL( activated() ), 878 connect( action, SIGNAL( activated() ),
883 mView, SLOT( toggleAllDaySize() ) ); 879 mView, SLOT( toggleAllDaySize() ) );
884 mToggleAllday = action; 880 mToggleAllday = action;