summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/datenavigatorcontainer.cpp74
-rw-r--r--korganizer/datenavigatorcontainer.h8
-rw-r--r--korganizer/kdatenavigator.cpp2
-rw-r--r--korganizer/koagendaitem.cpp4
-rw-r--r--korganizer/koprefsdialog.cpp18
-rw-r--r--korganizer/mainwindow.cpp4
6 files changed, 65 insertions, 45 deletions
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp
index d1caff3..2290c53 100644
--- a/korganizer/datenavigatorcontainer.cpp
+++ b/korganizer/datenavigatorcontainer.cpp
@@ -29,151 +29,165 @@
29//#include "koglobals.h" 29//#include "koglobals.h"
30#include "navigatorbar.h" 30#include "navigatorbar.h"
31#include "kdatenavigator.h" 31#include "kdatenavigator.h"
32 32
33#include <kcalendarsystem.h> 33#include <kcalendarsystem.h>
34 34
35#include "datenavigatorcontainer.h" 35#include "datenavigatorcontainer.h"
36#include "koprefs.h" 36#include "koprefs.h"
37 37
38DateNavigatorContainer::DateNavigatorContainer( QWidget *parent, 38DateNavigatorContainer::DateNavigatorContainer( QWidget *parent,
39 const char *name ) 39 const char *name )
40 : QWidget( parent, name ), mCalendar( 0 ), 40 : QWidget( parent, name ), mCalendar( 0 ),
41 mHorizontalCount( 1 ), mVerticalCount( 1 ) 41 mHorizontalCount( 1 ), mVerticalCount( 1 )
42{ 42{
43 mExtraViews.setAutoDelete( true ); 43 mExtraViews.setAutoDelete( true );
44 44
45 mNavigatorView = new KDateNavigator( this, name ); 45 mNavigatorView = new KDateNavigator( this, name );
46 46
47 connectNavigatorView( mNavigatorView ); 47 connectNavigatorView( mNavigatorView );
48 //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); 48 //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
49 mLastDisplayedDN = 0; 49 mLastDisplayedDN = 0;
50 mUpdateTimer; 50 mUpdateTimer;
51 mUpdateTimer = new QTimer( this ); 51 mUpdateTimer = new QTimer( this );
52 connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() )); 52 connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() ));
53 mFirstSelectedDate = QDate::currentDate(); 53 mFirstSelectedDate = QDate::currentDate();
54 mSelectedDateCount = 1; 54 mSelectedDateCount = 1;
55} 55}
56 56
57DateNavigatorContainer::~DateNavigatorContainer() 57DateNavigatorContainer::~DateNavigatorContainer()
58{ 58{
59} 59}
60 60
61void DateNavigatorContainer::connectNavigatorView( KDateNavigator *v ) 61void DateNavigatorContainer::connectNavigatorView( KDateNavigator *v )
62{ 62{
63 connect( v, SIGNAL( datesSelected( const KCal::DateList & ) ), 63 connect( v, SIGNAL( datesSelected( const KCal::DateList & ) ),
64 SIGNAL( datesSelected( const KCal::DateList & ) ) ); 64 SIGNAL( datesSelected( const KCal::DateList & ) ) );
65#if 0 65#if 0
66 connect( v, SIGNAL( incidenceDropped( Incidence *, const QDate & ) ), 66 connect( v, SIGNAL( incidenceDropped( Incidence *, const QDate & ) ),
67 SIGNAL( incidenceDropped( Incidence *, const QDate & ) ) ); 67 SIGNAL( incidenceDropped( Incidence *, const QDate & ) ) );
68 connect( v, SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ), 68 connect( v, SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ),
69 SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ) ); 69 SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ) );
70#endif 70#endif
71 connect( v, SIGNAL( weekClicked( const QDate & ) ), 71 connect( v, SIGNAL( weekClicked( const QDate & ) ),
72 SIGNAL( weekClicked( const QDate & ) ) ); 72 SIGNAL( weekClicked( const QDate & ) ) );
73 73
74 connect( v, SIGNAL( goPrevious() ), SIGNAL( goPrevious() ) ); 74 connect( v, SIGNAL( goPrevious() ), SIGNAL( goPrevious() ) );
75 connect( v, SIGNAL( goNext() ), SIGNAL( goNext() ) ); 75 connect( v, SIGNAL( goNext() ), SIGNAL( goNext() ) );
76 76
77 connect( v, SIGNAL( goNextMonth() ), SIGNAL( goNextMonth() ) ); 77 connect( v, SIGNAL( goNextMonth() ), SLOT( slotgoNextMonth() ) );
78 connect( v, SIGNAL( goPrevMonth() ), SIGNAL( goPrevMonth() ) ); 78 connect( v, SIGNAL( goPrevMonth() ), SLOT( slotgoPrevMonth() ) );
79 connect( v, SIGNAL( goNextYear() ), SIGNAL( goNextYear() ) ); 79 connect( v, SIGNAL( goNextYear() ), SLOT( slotgoNextYear() ) );
80 connect( v, SIGNAL( goPrevYear() ), SIGNAL( goPrevYear() ) ); 80 connect( v, SIGNAL( goPrevYear() ), SLOT( slotgoPrevYear() ) );
81 81
82 connect( v, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) ); 82 connect( v, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) );
83} 83}
84void DateNavigatorContainer::slotgoNextYear()
85{
86 jumpMonth( 12 );
87 emit goNextYear();
88
89}
90void DateNavigatorContainer::slotgoPrevYear()
91{
92 jumpMonth( -12 );
93 emit goPrevYear();
94
95}
96void DateNavigatorContainer::slotgoPrevMonth()
97{
98 jumpMonth( -1 );
99 emit goPrevMonth();
100
101}
102void DateNavigatorContainer::slotgoNextMonth()
103{
104 jumpMonth( 1 );
105 emit goNextMonth();
106}
107void DateNavigatorContainer::jumpMonth( int month )
108{
84 109
110 QDate baseDate = mNavigatorView->baseDate();
111 computeMonthSelected( baseDate.month() + month, false );
112}
85void DateNavigatorContainer::slotMonthSelected( int month ) 113void DateNavigatorContainer::slotMonthSelected( int month )
86{ 114{
87 //qDebug("slotMonthSelected %d ", month); 115 computeMonthSelected( month, true );
116}
117void DateNavigatorContainer::computeMonthSelected( int month , bool forceEmit )
118{
119 //qDebug("slotMonthSelected %d ", month);
88 QDate baseDate = mNavigatorView->baseDate(); 120 QDate baseDate = mNavigatorView->baseDate();
89 if ( baseDate.month() == month ) 121 if ( baseDate.month() == month )
90 return; 122 return;
91 //qDebug("month %d %d ",baseDate.month(),month); 123 //qDebug("month %d %d ",baseDate.month(),month);
92 QDate date = QDate ( baseDate.year(), baseDate.month() , 15 ); 124 QDate date = QDate ( baseDate.year(), baseDate.month() , 15 );
93 date = date.addDays( -(baseDate.month()-month ) *30 ); 125 date = date.addDays( -(baseDate.month()-month ) *30 );
94 QDate newBase = QDate ( date.year(), date.month() , baseDate.day() ); 126 QDate newBase = QDate ( date.year(), date.month() , baseDate.day() );
95 127
96#if 0
97 mFirstSelectedDate = dateList.first() ;
98 mSelectedDateCount = dateList.count() ;
99
100 KDateNavigator *view = mExtraViews.at( 0 );
101 QDate date = view->baseDate();
102
103 QDate curEnd = date.addDays( (mLastDisplayedDN)*30 +7);
104 //qDebug("End %s %s ",lDate.toString().latin1(),curEnd.toString().latin1() );
105 if ( lDate < curEnd && date.addDays( -30 ) < fDate) {
106 mNavigatorView->dayMatrix()->setSelectedDaysFrom( fDate , lDate );
107 mNavigatorView->dayMatrix()->repaint( false );
108 for( uint i = 0; i < mLastDisplayedDN; ++i ) {
109 KDateNavigator *n = mExtraViews.at( i );
110 if ( n->dayMatrix()->setSelectedDaysFrom( fDate , lDate ) ) {
111 n->dayMatrix()->repaint( false );
112 }
113 }
114 return;
115 }
116#endif
117 //qDebug("NEW BASE %s", newBase.toString().latin1()); 128 //qDebug("NEW BASE %s", newBase.toString().latin1());
118 mNavigatorView->setBaseDate( newBase ); 129 mNavigatorView->setBaseDate( newBase );
119 QDate last = lastAvailableDate(); 130 QDate last = lastAvailableDate();
120 QDate first = firstAvailableDate(); 131 QDate first = firstAvailableDate();
121 132
122 QDate selFirst = mFirstSelectedDate; 133 QDate selFirst = mFirstSelectedDate;
123 QDate selLast = selFirst.addDays( mSelectedDateCount-1 ); 134 QDate selLast = selFirst.addDays( mSelectedDateCount-1 );
124 if ( selFirst >= first && selLast <= last ) { 135 if ( selFirst >= first && selLast <= last ) {
125 setBaseDates(); 136 setBaseDates();
126 updateDayMatrixDates(); 137 if ( forceEmit )
138 updateDayMatrixDates();
127 } 139 }
128 else { 140 else {
129 setBaseDates(); 141 setBaseDates();
130 updateDayMatrixDates(); 142 if ( forceEmit )
131 emit monthSelected( month ); 143 updateDayMatrixDates();
144 if ( forceEmit )
145 emit monthSelected( month );
132 } 146 }
133} 147}
134void DateNavigatorContainer::setCalendar( Calendar *cal ) 148void DateNavigatorContainer::setCalendar( Calendar *cal )
135{ 149{
136 mCalendar = cal; 150 mCalendar = cal;
137 mNavigatorView->setCalendar( cal ); 151 mNavigatorView->setCalendar( cal );
138 for( uint i = 0; i < mLastDisplayedDN; ++i ) { 152 for( uint i = 0; i < mLastDisplayedDN; ++i ) {
139 KDateNavigator *n = mExtraViews.at( i ); 153 KDateNavigator *n = mExtraViews.at( i );
140 n->setCalendar( cal ); 154 n->setCalendar( cal );
141 } 155 }
142} 156}
143void DateNavigatorContainer::checkUpdateDayMatrixDates() 157void DateNavigatorContainer::checkUpdateDayMatrixDates()
144{ 158{
145 //qDebug("KODNC: wid %d hei %d ", width(), height()); 159 //qDebug("KODNC: wid %d hei %d ", width(), height());
146 mUpdateTimer->stop(); 160 mUpdateTimer->stop();
147 //return; 161 //return;
148 if ( width() < 3 || height() < 3 ) 162 if ( width() < 3 || height() < 3 )
149 return; 163 return;
150 static int lastWid = 0; 164 static int lastWid = 0;
151 static int lastHei = 0; 165 static int lastHei = 0;
152 if ( lastWid == width() && height() == lastHei ) { 166 if ( lastWid == width() && height() == lastHei ) {
153 qDebug("KODNC: No layout computing needed. "); 167 qDebug("KODNC: No layout computing needed. ");
154 } else { 168 } else {
155 lastWid = width(); 169 lastWid = width();
156 lastHei = height(); 170 lastHei = height();
157 171
158 QSize minSize = mNavigatorView->yourSizeHint(); 172 QSize minSize = mNavigatorView->yourSizeHint();
159 173
160 int verticalCount = size().height() / minSize.height(); 174 int verticalCount = size().height() / minSize.height();
161 int horizontalCount = size().width() / minSize.width(); 175 int horizontalCount = size().width() / minSize.width();
162 //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() ); 176 //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() );
163 //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount ); 177 //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount );
164 bool fontchange = false; 178 bool fontchange = false;
165 if ( horizontalCount == 1) 179 if ( horizontalCount == 1)
166 horizontalCount = size().width() / mNavigatorView->yourFullSizeHint().width(); 180 horizontalCount = size().width() / mNavigatorView->yourFullSizeHint().width();
167 QFont fo; 181 QFont fo;
168 if ( horizontalCount != mHorizontalCount || 182 if ( horizontalCount != mHorizontalCount ||
169 verticalCount != mVerticalCount ) { 183 verticalCount != mVerticalCount ) {
170 uint count = horizontalCount * verticalCount; 184 uint count = horizontalCount * verticalCount;
171 if ( count == 0 ) { 185 if ( count == 0 ) {
172 bool ok; 186 bool ok;
173 fo = mNavigatorView->yourFontHint( size() , &ok ); 187 fo = mNavigatorView->yourFontHint( size() , &ok );
174 //mNavigatorView->resize( size() ); 188 //mNavigatorView->resize( size() );
175 //if ( ! ok ) 189 //if ( ! ok )
176 // return; 190 // return;
177 int butt = 2; 191 int butt = 2;
178 horizontalCount = size().width() / mNavigatorView->sizeHintTwoButtons( ).width(); 192 horizontalCount = size().width() / mNavigatorView->sizeHintTwoButtons( ).width();
179 if ( horizontalCount <= 1 ) 193 if ( horizontalCount <= 1 )
diff --git a/korganizer/datenavigatorcontainer.h b/korganizer/datenavigatorcontainer.h
index 9a64720..d2f397d 100644
--- a/korganizer/datenavigatorcontainer.h
+++ b/korganizer/datenavigatorcontainer.h
@@ -13,88 +13,94 @@
13 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details. 15 GNU General Public License for more details.
16 16
17 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software 18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 20
21 As a special exception, permission is given to link this program 21 As a special exception, permission is given to link this program
22 with any edition of Qt, and distribute the resulting executable, 22 with any edition of Qt, and distribute the resulting executable,
23 without including the source code for Qt in the source distribution. 23 without including the source code for Qt in the source distribution.
24*/ 24*/
25#ifndef DATENAVIGATORCONTAINER_H 25#ifndef DATENAVIGATORCONTAINER_H
26#define DATENAVIGATORCONTAINER_H 26#define DATENAVIGATORCONTAINER_H
27 27
28class KDateNavigator; 28class KDateNavigator;
29 29
30#include <qwidget.h> 30#include <qwidget.h>
31#include <qtimer.h> 31#include <qtimer.h>
32#include <libkcal/calendar.h> 32#include <libkcal/calendar.h>
33using namespace KCal; 33using namespace KCal;
34 34
35class DateNavigatorContainer: public QWidget 35class DateNavigatorContainer: public QWidget
36{ 36{
37 Q_OBJECT 37 Q_OBJECT
38 public: 38 public:
39 DateNavigatorContainer( QWidget *parent = 0, const char *name = 0 ); 39 DateNavigatorContainer( QWidget *parent = 0, const char *name = 0 );
40 ~DateNavigatorContainer(); 40 ~DateNavigatorContainer();
41 41
42 /** 42 /**
43 Associate date navigator with a calendar. It is used by KODayMatrix. 43 Associate date navigator with a calendar. It is used by KODayMatrix.
44 */ 44 */
45 void setCalendar( Calendar * ); 45 void setCalendar( Calendar * );
46 46
47 QSize minimumSizeHint() const; 47 QSize minimumSizeHint() const;
48 QSize sizeHint() const; 48 QSize sizeHint() const;
49 KDateNavigator * navigatorView() { return mNavigatorView;} 49 KDateNavigator * navigatorView() { return mNavigatorView;}
50 QDate lastAvailableDate() const ; 50 QDate lastAvailableDate() const ;
51 QDate firstAvailableDate() const ; 51 QDate firstAvailableDate() const ;
52 52
53 public slots: 53 public slots:
54 void selectDates( const KCal::DateList & ); 54 void selectDates( const KCal::DateList & );
55 void updateView(); 55 void updateView();
56 void updateConfig(); 56 void updateConfig();
57 void updateDayMatrix(); 57 void updateDayMatrix();
58 void updateDayMatrixDates(); 58 void updateDayMatrixDates();
59 void checkUpdateDayMatrixDates(); 59 void checkUpdateDayMatrixDates();
60 void updateToday(); 60 void updateToday();
61 void slotMonthSelected( int month ); 61 void slotMonthSelected( int month );
62 void slotgoNextMonth();
63 void slotgoPrevMonth();
64 void slotgoNextYear();
65 void slotgoPrevYear();
62 66
63 signals: 67 signals:
64 void datesSelected( const KCal::DateList & ); 68 void datesSelected( const KCal::DateList & );
65 void incidenceDropped( Incidence *, const QDate & ); 69 void incidenceDropped( Incidence *, const QDate & );
66 void incidenceDroppedMove( Incidence *, const QDate & ); 70 void incidenceDroppedMove( Incidence *, const QDate & );
67 void weekClicked( const QDate &); 71 void weekClicked( const QDate &);
68 72
69 void goPrevious(); 73 void goPrevious();
70 void goNext(); 74 void goNext();
71 75
72 void goNextMonth(); 76 void goNextMonth();
73 void goPrevMonth(); 77 void goPrevMonth();
74 void goNextYear(); 78 void goNextYear();
75 void goPrevYear(); 79 void goPrevYear();
76 80
77 void monthSelected( int month ); 81 void monthSelected( int month );
78 82
79 protected: 83 protected:
84 void computeMonthSelected( int month , bool forceEmit );
85 void jumpMonth( int month );
80 void resizeEvent( QResizeEvent * ); 86 void resizeEvent( QResizeEvent * );
81 87
82 void setBaseDates(); 88 void setBaseDates();
83 void connectNavigatorView( KDateNavigator *v ); 89 void connectNavigatorView( KDateNavigator *v );
84 90
85 private: 91 private:
86 QTimer* mUpdateTimer; 92 QTimer* mUpdateTimer;
87 int mLastDisplayedDN; 93 int mLastDisplayedDN;
88 QDate mFirstSelectedDate; 94 QDate mFirstSelectedDate;
89 int mSelectedDateCount; 95 int mSelectedDateCount;
90 KDateNavigator *mNavigatorView; 96 KDateNavigator *mNavigatorView;
91 97
92 KCal::Calendar *mCalendar; 98 KCal::Calendar *mCalendar;
93 99
94 QPtrList<KDateNavigator> mExtraViews; 100 QPtrList<KDateNavigator> mExtraViews;
95 101
96 int mHorizontalCount; 102 int mHorizontalCount;
97 int mVerticalCount; 103 int mVerticalCount;
98}; 104};
99 105
100#endif 106#endif
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index d62402f..6438c9a 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -74,97 +74,97 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name )
74 74
75 // get the day of the week on the first day 75 // get the day of the week on the first day
76 QDate dayone(m_MthYr.year(), m_MthYr.month(), 1); 76 QDate dayone(m_MthYr.year(), m_MthYr.month(), 1);
77 m_fstDayOfWk = dayone.dayOfWeek(); 77 m_fstDayOfWk = dayone.dayOfWeek();
78 78
79 int i; 79 int i;
80 80
81 // Set up the heading fields. 81 // Set up the heading fields.
82 for( i = 0; i < 7; i++ ) { 82 for( i = 0; i < 7; i++ ) {
83 headings[i] = new QLabel("",this); 83 headings[i] = new QLabel("",this);
84 //headings[i]->setFont(QFont("Arial", 10, QFont::Bold)); 84 //headings[i]->setFont(QFont("Arial", 10, QFont::Bold));
85 headings[i]->setAlignment(AlignCenter); 85 headings[i]->setAlignment(AlignCenter);
86 headings[i]->installEventFilter(this); 86 headings[i]->installEventFilter(this);
87 87
88 topLayout->addWidget(headings[i],1,i+1); 88 topLayout->addWidget(headings[i],1,i+1);
89 } 89 }
90 90
91 // Create the weeknumber labels 91 // Create the weeknumber labels
92 for( i = 0; i < 6; i++ ) { 92 for( i = 0; i < 6; i++ ) {
93 weeknos[i] = new QLabel(this); 93 weeknos[i] = new QLabel(this);
94 weeknos[i]->setAlignment(AlignCenter); 94 weeknos[i]->setAlignment(AlignCenter);
95 //weeknos[i]->setFont(QFont("Arial", 10)); 95 //weeknos[i]->setFont(QFont("Arial", 10));
96 if(!m_bShowWeekNums) { 96 if(!m_bShowWeekNums) {
97 weeknos[i]->hide(); 97 weeknos[i]->hide();
98 } 98 }
99 weeknos[i]->installEventFilter(this); 99 weeknos[i]->installEventFilter(this);
100 100
101 topLayout->addWidget(weeknos[i],i+2,0); 101 topLayout->addWidget(weeknos[i],i+2,0);
102 } 102 }
103 103
104 daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix"); 104 daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix");
105 daymatrix->setFrameStyle(QFrame::Panel|QFrame::Sunken); 105 daymatrix->setFrameStyle(QFrame::Panel|QFrame::Sunken);
106 daymatrix->setLineWidth(1); 106 daymatrix->setLineWidth(1);
107 107
108 connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ), 108 connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ),
109 SIGNAL( datesSelected( const KCal::DateList & ) ) ); 109 SIGNAL( datesSelected( const KCal::DateList & ) ) );
110 110
111 connect( daymatrix, SIGNAL( eventDropped( Event * ) ), 111 connect( daymatrix, SIGNAL( eventDropped( Event * ) ),
112 SIGNAL( eventDropped( Event * ) ) ); 112 SIGNAL( eventDropped( Event * ) ) );
113 113
114 topLayout->addMultiCellWidget(daymatrix,2,7,1,7); 114 topLayout->addMultiCellWidget(daymatrix,2,7,1,7);
115 115
116 // read settings from configuration file. 116 // read settings from configuration file.
117 updateConfig(); 117 updateConfig();
118 enableRollover(FollowMonth); 118 enableRollover(FollowMonth);
119 mySizeHint = sizeHintTwoButtons(); 119 mySizeHint = sizeHintTwoButtons();
120 myFullSizeHint = sizeHintTwoButtons( 4 ); 120 myFullSizeHint = sizeHintTwoButtons( 4 );
121 mFontChanged = false; 121 mFontChanged = false;
122 resize ( mySizeHint ); 122 resize ( 0,0 );
123} 123}
124void KDateNavigator::changeFont ( QFont fo ) 124void KDateNavigator::changeFont ( QFont fo )
125{ 125{
126 setFont( fo ); 126 setFont( fo );
127 mNavigatorBar->resetFont( fo ); 127 mNavigatorBar->resetFont( fo );
128} 128}
129QFont KDateNavigator::yourFontHint( QSize si , bool *b) 129QFont KDateNavigator::yourFontHint( QSize si , bool *b)
130{ 130{
131 QFont fo = KOPrefs::instance()->mDateNavigatorFont; 131 QFont fo = KOPrefs::instance()->mDateNavigatorFont;
132 *b = false; 132 *b = false;
133 int fontPoint = fo.pointSize(); 133 int fontPoint = fo.pointSize();
134 while ( fontPoint > 5 ) { 134 while ( fontPoint > 5 ) {
135 --fontPoint; 135 --fontPoint;
136 fo.setPointSize( fontPoint ); 136 fo.setPointSize( fontPoint );
137 setFont( fo ); 137 setFont( fo );
138 mFontChanged = true; 138 mFontChanged = true;
139 mNavigatorBar->resetFont( fo ); 139 mNavigatorBar->resetFont( fo );
140 QSize sh = sizeHintTwoButtons( 2 ); 140 QSize sh = sizeHintTwoButtons( 2 );
141 //qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() ); 141 //qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() );
142 if ( si.width() > sh.width() && si.height() > sh.height()) { 142 if ( si.width() > sh.width() && si.height() > sh.height()) {
143 if ( si.width() / sh.width() == 1 ) { 143 if ( si.width() / sh.width() == 1 ) {
144 if ( si.width() < sizeHintTwoButtons( 4 ).width()) 144 if ( si.width() < sizeHintTwoButtons( 4 ).width())
145 continue; 145 continue;
146 } 146 }
147 *b = true; 147 *b = true;
148 //qDebug("fooooooooooooooooooooooouuuuund "); 148 //qDebug("fooooooooooooooooooooooouuuuund ");
149 break; 149 break;
150 } 150 }
151 } 151 }
152 //qDebug("returnnnnnnnnnnnnnnnnnnn %d", fo.pointSize() ); 152 //qDebug("returnnnnnnnnnnnnnnnnnnn %d", fo.pointSize() );
153 return fo; 153 return fo;
154} 154}
155QSize KDateNavigator::sizeHint() const 155QSize KDateNavigator::sizeHint() const
156{ 156{
157 QFontMetrics fm ( font() ); 157 QFontMetrics fm ( font() );
158 QSize day = daymatrix->sizeHint(); 158 QSize day = daymatrix->sizeHint();
159 QSize nav = mNavigatorBar->sizeHint(); 159 QSize nav = mNavigatorBar->sizeHint();
160 int wid = fm.width( "30") + day.width()+3; 160 int wid = fm.width( "30") + day.width()+3;
161 int hei = fm.height() +day.height()+nav.height()+2; 161 int hei = fm.height() +day.height()+nav.height()+2;
162 if ( wid < nav.width() ) 162 if ( wid < nav.width() )
163 wid = nav.width() ; 163 wid = nav.width() ;
164 //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); 164 //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei);
165 return QSize ( wid, hei ); 165 return QSize ( wid, hei );
166} 166}
167QSize KDateNavigator::sizeHintTwoButtons( int butnum ) const 167QSize KDateNavigator::sizeHintTwoButtons( int butnum ) const
168{ 168{
169 QFontMetrics fm ( font() ); 169 QFontMetrics fm ( font() );
170 QSize day = daymatrix->sizeHint(); 170 QSize day = daymatrix->sizeHint();
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 82d1eab..b30ad75 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -460,104 +460,104 @@ QPixmap * KOAgendaItem::paintPixSel()
460void KOAgendaItem::paintEvent ( QPaintEvent *e ) 460void KOAgendaItem::paintEvent ( QPaintEvent *e )
461{ 461{
462 462
463 if ( globalFlagBlockAgendaItemPaint ) 463 if ( globalFlagBlockAgendaItemPaint )
464 return; 464 return;
465 if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 ) 465 if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 )
466 return; 466 return;
467 int yy; 467 int yy;
468 if ( mAllDay ) 468 if ( mAllDay )
469 yy = y(); 469 yy = y();
470 else 470 else
471 yy = mCellYTop * ( height() / cellHeight() ); 471 yy = mCellYTop * ( height() / cellHeight() );
472 int xx = x(); 472 int xx = x();
473 473
474 if ( xPaintCoord != xx || yPaintCoord != yy || 474 if ( xPaintCoord != xx || yPaintCoord != yy ||
475 wPaintCoord != width() || hPaintCoord != height()) { 475 wPaintCoord != width() || hPaintCoord != height()) {
476 xPaintCoord= xx; 476 xPaintCoord= xx;
477 yPaintCoord = yy; 477 yPaintCoord = yy;
478 wPaintCoord = width(); 478 wPaintCoord = width();
479 hPaintCoord = height(); 479 hPaintCoord = height();
480 globalFlagBlockAgendaItemUpdate = 0; 480 globalFlagBlockAgendaItemUpdate = 0;
481 paintMe( mSelected ); 481 paintMe( mSelected );
482 //qDebug("calling paintMe "); 482 //qDebug("calling paintMe ");
483 globalFlagBlockAgendaItemUpdate = 1; 483 globalFlagBlockAgendaItemUpdate = 1;
484 } 484 }
485 int rx, ry, rw, rh; 485 int rx, ry, rw, rh;
486 rx = e->rect().x(); 486 rx = e->rect().x();
487 ry = e->rect().y(); 487 ry = e->rect().y();
488 rw = e->rect().width(); 488 rw = e->rect().width();
489 rh = e->rect().height(); 489 rh = e->rect().height();
490 //qDebug(" paintevent %s %d %d %d %d", mIncidence->summary().latin1(), x(), yy, width(), height()); 490 //qDebug(" paintevent %s %d %d %d %d", mIncidence->summary().latin1(), x(), yy, width(), height());
491 491
492 QPixmap* paintFrom ; 492 QPixmap* paintFrom ;
493 if ( mSelected ) { 493 if ( mSelected ) {
494 paintFrom = paintPixSel(); 494 paintFrom = paintPixSel();
495 } else { 495 } else {
496 if ( mAllDay ) 496 if ( mAllDay )
497 paintFrom = paintPixAllday(); 497 paintFrom = paintPixAllday();
498 else 498 else
499 paintFrom = paintPix(); 499 paintFrom = paintPix();
500 } 500 }
501 xx += rx; 501 xx += rx;
502 502
503 if ( xx < 0 ) { 503 if ( xx < 0 ) {
504 rw = rw + xx; 504 rw = rw + xx;
505 rx -= xx; 505 rx -= xx;
506 xx = 0; 506 xx = 0;
507 if ( rw <= 1 ) { 507 if ( rw <= 1 ) {
508 qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1()); 508 //qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1());
509 return; 509 return;
510 } 510 }
511 } 511 }
512 if ( paintFrom->width() < xx+rw ) { 512 if ( paintFrom->width() < xx+rw ) {
513 rw = paintFrom->width() - xx; 513 rw = paintFrom->width() - xx;
514 if ( rw <= 1 ) { 514 if ( rw <= 1 ) {
515 qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() ); 515 //qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() );
516 return; 516 return;
517 } 517 }
518 } 518 }
519 //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh); 519 //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh);
520 bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP); 520 bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP);
521} 521}
522void KOAgendaItem::computeText() 522void KOAgendaItem::computeText()
523{ 523{
524 524
525 mDisplayedText = mIncidence->summary(); 525 mDisplayedText = mIncidence->summary();
526 if ( (mIncidence->type() == "Todo") ) { 526 if ( (mIncidence->type() == "Todo") ) {
527 if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) { 527 if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) {
528 if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) 528 if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() )
529 mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; 529 mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")";
530 else if ( !(mIncidence->doesFloat())) 530 else if ( !(mIncidence->doesFloat()))
531 mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; 531 mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")";
532 } 532 }
533 } else { 533 } else {
534 if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda) 534 if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda)
535 mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ; 535 mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ;
536 536
537 if ( mAllDay ) { 537 if ( mAllDay ) {
538 if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) { 538 if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) {
539 mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ; 539 mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ;
540 } 540 }
541 } 541 }
542 542
543 } 543 }
544 544
545 if ( !mIncidence->location().isEmpty() ) { 545 if ( !mIncidence->location().isEmpty() ) {
546 if ( mAllDay ) 546 if ( mAllDay )
547 mDisplayedText += " ("; 547 mDisplayedText += " (";
548 else 548 else
549 mDisplayedText += "\n("; 549 mDisplayedText += "\n(";
550 mDisplayedText += mIncidence->location() +")"; 550 mDisplayedText += mIncidence->location() +")";
551 } 551 }
552 552
553 QString tipText = mIncidence->summary(); 553 QString tipText = mIncidence->summary();
554 if ( !mIncidence->doesFloat() ) { 554 if ( !mIncidence->doesFloat() ) {
555 if ( mIncidence->type() == "Event" ) { 555 if ( mIncidence->type() == "Event" ) {
556 if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) { 556 if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) {
557 tipText += "\n"+i18n("From: ")+mIncidence->dtStartStr(); 557 tipText += "\n"+i18n("From: ")+mIncidence->dtStartStr();
558 tipText += "\n"+i18n("To: ")+(static_cast<Event*>(mIncidence))->dtEndStr(); 558 tipText += "\n"+i18n("To: ")+(static_cast<Event*>(mIncidence))->dtEndStr();
559 } 559 }
560 else { 560 else {
561 tipText += "\n"+i18n("Time: ")+mIncidence->dtStartTimeStr(); 561 tipText += "\n"+i18n("Time: ")+mIncidence->dtStartTimeStr();
562 tipText += " - "+(static_cast<Event*>(mIncidence))->dtEndTimeStr(); 562 tipText += " - "+(static_cast<Event*>(mIncidence))->dtEndTimeStr();
563 } 563 }
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 40e8a99..74037e6 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -545,167 +545,167 @@ void KOPrefsDialog::setupTimeTab()
545 addWidBool(i18n("Exclude Saturdays"), 545 addWidBool(i18n("Exclude Saturdays"),
546 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); 546 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox);
547 547
548// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), 548// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"),
549 // &(KOPrefs::instance()->mMarcusBainsShowSeconds), 549 // &(KOPrefs::instance()->mMarcusBainsShowSeconds),
550 // topFrame); 550 // topFrame);
551// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); 551// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0);
552 552
553 // topLayout->setRowStretch(6,1); 553 // topLayout->setRowStretch(6,1);
554} 554}
555 555
556 556
557void KOPrefsDialog::setupViewsTab() 557void KOPrefsDialog::setupViewsTab()
558{ 558{
559 559
560 QFrame *topFrame = addPage(i18n("Views"),0,0); 560 QFrame *topFrame = addPage(i18n("Views"),0,0);
561 // DesktopIcon("viewmag",KIcon::SizeMedium)); 561 // DesktopIcon("viewmag",KIcon::SizeMedium));
562 562
563 QGridLayout *topLayout = new QGridLayout(topFrame,6,1); 563 QGridLayout *topLayout = new QGridLayout(topFrame,6,1);
564 topLayout->setSpacing(spacingHint()); 564 topLayout->setSpacing(spacingHint());
565 topLayout->setMargin(marginHint()); 565 topLayout->setMargin(marginHint());
566 566
567// QBoxLayout *dayBeginsLayout = new QHBoxLayout; 567// QBoxLayout *dayBeginsLayout = new QHBoxLayout;
568// topLayout->addLayout(dayBeginsLayout,0,0); 568// topLayout->addLayout(dayBeginsLayout,0,0);
569 569
570// KPrefsDialogWidTime *dayBegins = 570// KPrefsDialogWidTime *dayBegins =
571// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 571// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
572// topFrame); 572// topFrame);
573// dayBeginsLayout->addWidget(dayBegins->label()); 573// dayBeginsLayout->addWidget(dayBegins->label());
574// dayBeginsLayout->addStretch(1); 574// dayBeginsLayout->addStretch(1);
575// dayBeginsLayout->addWidget(dayBegins->spinBox()); 575// dayBeginsLayout->addWidget(dayBegins->spinBox());
576 576
577// QBoxLayout *nextDaysLayout = new QHBoxLayout; 577// QBoxLayout *nextDaysLayout = new QHBoxLayout;
578// topLayout->addLayout(nextDaysLayout,1,0); 578// topLayout->addLayout(nextDaysLayout,1,0);
579// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); 579// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame));
580// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); 580// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame);
581// nextDaysLayout->addStretch(1); 581// nextDaysLayout->addStretch(1);
582// nextDaysLayout->addWidget(mNextXDaysSpin); 582// nextDaysLayout->addWidget(mNextXDaysSpin);
583 583
584 584
585 int ii = 0; 585 int ii = 0;
586 KPrefsDialogWidBool *dummy = 586 KPrefsDialogWidBool *dummy =
587 addWidBool(i18n("Edit item on doubleclick (if not, show)"), 587 addWidBool(i18n("Edit item on doubleclick (if not, show)"),
588 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); 588 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame);
589 topLayout->addWidget(dummy->checkBox(),ii++,0); 589 topLayout->addWidget(dummy->checkBox(),ii++,0);
590 590
591 591
592 592
593 if ( QApplication::desktop()->width() > 640 ) { 593
594
595 KPrefsDialogWidBool *enableToolTips =
596 addWidBool(i18n("Enable tooltips displaying summary of ev."),
597 &(KOPrefs::instance()->mEnableToolTips),topFrame);
598 topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
599
600 }
601
602 594
603 595
604 // topLayout->addWidget(hourSizeGroup,ii++,0); 596 // topLayout->addWidget(hourSizeGroup,ii++,0);
605 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); 597 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0);
606 //topLayout->setRowStretch(11,1); 598 //topLayout->setRowStretch(11,1);
607 599
608 600
609 601
610 602
611#if 0 603#if 0
612 604
613 topFrame = addPage(i18n("ViewChange"),0,0); 605 topFrame = addPage(i18n("ViewChange"),0,0);
614 // DesktopIcon("viewmag",KIcon::SizeMedium)); 606 // DesktopIcon("viewmag",KIcon::SizeMedium));
615 607
616 topLayout = new QGridLayout(topFrame,6,1); 608 topLayout = new QGridLayout(topFrame,6,1);
617 topLayout->setSpacing(spacingHint()); 609 topLayout->setSpacing(spacingHint());
618 topLayout->setMargin(marginHint()); 610 topLayout->setMargin(marginHint());
619 ii = 0; 611 ii = 0;
620 612
621#endif 613#endif
622 614
623 dummy = 615 dummy =
624 addWidBool(i18n("Hold fullscreen on view change"), 616 addWidBool(i18n("Hold fullscreen on view change"),
625 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); 617 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame);
626 topLayout->addWidget(dummy->checkBox(),ii++,0); 618 topLayout->addWidget(dummy->checkBox(),ii++,0);
627 619
628 dummy = 620 dummy =
629 addWidBool(i18n("Hold non-fullscreen on view change"), 621 addWidBool(i18n("Hold non-fullscreen on view change"),
630 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); 622 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame);
631 topLayout->addWidget(dummy->checkBox(),ii++,0); 623 topLayout->addWidget(dummy->checkBox(),ii++,0);
632 624
633 625
634 626
635 KPrefsDialogWidBool *fullViewMonth = 627 KPrefsDialogWidBool *fullViewMonth =
636 addWidBool(i18n("Next days view uses full window"), 628 addWidBool(i18n("Next days view uses full window"),
637 &(KOPrefs::instance()->mFullViewMonth),topFrame); 629 &(KOPrefs::instance()->mFullViewMonth),topFrame);
638 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); 630 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0);
639 631
640 632
641 KPrefsDialogWidBool *fullViewTodo = 633 KPrefsDialogWidBool *fullViewTodo =
642 addWidBool(i18n("Event list view uses full window"), 634 addWidBool(i18n("Event list view uses full window"),
643 &(KOPrefs::instance()->mFullViewTodo),topFrame); 635 &(KOPrefs::instance()->mFullViewTodo),topFrame);
644 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); 636 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0);
645 dummy = 637 dummy =
646 addWidBool(i18n("Listview uses monthly timespan"), 638 addWidBool(i18n("Listview uses monthly timespan"),
647 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); 639 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame);
648 topLayout->addWidget(dummy->checkBox(),ii++,0); 640 topLayout->addWidget(dummy->checkBox(),ii++,0);
649 dummy = 641 dummy =
650 addWidBool(i18n("Highlight selection in Time Edit"), 642 addWidBool(i18n("Highlight selection in Time Edit"),
651 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); 643 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame);
652 topLayout->addWidget( dummy->checkBox(), ii++,0); 644 topLayout->addWidget( dummy->checkBox(), ii++,0);
653 645
654 KPrefsDialogWidBool *dailyRecur = 646 KPrefsDialogWidBool *dailyRecur =
655 addWidBool(i18n("Show events that recur daily in date nav."), 647 addWidBool(i18n("Show events that recur daily in date nav."),
656 &(KOPrefs::instance()->mDailyRecur),topFrame); 648 &(KOPrefs::instance()->mDailyRecur),topFrame);
657 topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 649 topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
658 650
659 KPrefsDialogWidBool *weeklyRecur = 651 KPrefsDialogWidBool *weeklyRecur =
660 addWidBool(i18n("Show ev. that recur weekly in date nav."), 652 addWidBool(i18n("Show ev. that recur weekly in date nav."),
661 &(KOPrefs::instance()->mWeeklyRecur),topFrame); 653 &(KOPrefs::instance()->mWeeklyRecur),topFrame);
662 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); 654 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0);
663 655
656
657 KPrefsDialogWidBool *enableToolTips =
658 addWidBool(i18n("Enable tooltips displaying summary of ev."),
659 &(KOPrefs::instance()->mEnableToolTips),topFrame);
660 topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
661
662 // *********************************************************
663
664 topFrame = addPage(i18n("Agenda View"),0,0); 664 topFrame = addPage(i18n("Agenda View"),0,0);
665 // DesktopIcon("viewmag",KIcon::SizeMedium)); 665 // DesktopIcon("viewmag",KIcon::SizeMedium));
666 666
667 topLayout = new QGridLayout(topFrame,5,1); 667 topLayout = new QGridLayout(topFrame,5,1);
668 topLayout->setSpacing(spacingHint()); 668 topLayout->setSpacing(spacingHint());
669 topLayout->setMargin(marginHint()); 669 topLayout->setMargin(marginHint());
670 ii = 0; 670 ii = 0;
671 671
672 672
673 dummy = 673 dummy =
674 addWidBool(i18n("Show time in agenda items"), 674 addWidBool(i18n("Show time in agenda items"),
675 &(KOPrefs::instance()->mShowTimeInAgenda),topFrame); 675 &(KOPrefs::instance()->mShowTimeInAgenda),topFrame);
676 topLayout->addWidget(dummy->checkBox(),ii++,0); 676 topLayout->addWidget(dummy->checkBox(),ii++,0);
677 677
678 dummy = 678 dummy =
679 addWidBool(i18n("Highlight current day in agenda"), 679 addWidBool(i18n("Highlight current day in agenda"),
680 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); 680 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame);
681 topLayout->addWidget(dummy->checkBox(),ii++,0); 681 topLayout->addWidget(dummy->checkBox(),ii++,0);
682 682
683 dummy = 683 dummy =
684 addWidBool(i18n("Use light color for highlight current day"), 684 addWidBool(i18n("Use light color for highlight current day"),
685 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); 685 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame);
686 topLayout->addWidget(dummy->checkBox(),ii++,0); 686 topLayout->addWidget(dummy->checkBox(),ii++,0);
687 687
688 688
689 KPrefsDialogWidBool *marcusBainsEnabled = 689 KPrefsDialogWidBool *marcusBainsEnabled =
690 addWidBool(i18n("Show current time"), 690 addWidBool(i18n("Show current time"),
691 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); 691 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame);
692 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); 692 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0);
693 693
694 694
695 dummy = 695 dummy =
696 addWidBool(i18n("Set agenda to DayBeginsAt on change"), 696 addWidBool(i18n("Set agenda to DayBeginsAt on change"),
697 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); 697 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame);
698 topLayout->addWidget(dummy->checkBox(),ii++,0); 698 topLayout->addWidget(dummy->checkBox(),ii++,0);
699 699
700 dummy = 700 dummy =
701 addWidBool(i18n("Set agenda to current time on change"), 701 addWidBool(i18n("Set agenda to current time on change"),
702 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); 702 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame);
703 topLayout->addWidget(dummy->checkBox(),ii++,0); 703 topLayout->addWidget(dummy->checkBox(),ii++,0);
704 704
705 705
706 706
707 707
708 708
709 709
710 710
711 topFrame = addPage(i18n("Month View"),0,0); 711 topFrame = addPage(i18n("Month View"),0,0);
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index bd9efc8..7faf675 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -955,96 +955,98 @@ void MainWindow::initActions()
955 SLOT( synchowto() ) ); 955 SLOT( synchowto() ) );
956 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); 956 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this );
957 action->addTo( helpMenu ); 957 action->addTo( helpMenu );
958 connect( action, SIGNAL( activated() ), 958 connect( action, SIGNAL( activated() ),
959 SLOT( kdesynchowto() ) ); 959 SLOT( kdesynchowto() ) );
960 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); 960 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this );
961 action->addTo( helpMenu ); 961 action->addTo( helpMenu );
962 connect( action, SIGNAL( activated() ), 962 connect( action, SIGNAL( activated() ),
963 SLOT( multisynchowto() ) ); 963 SLOT( multisynchowto() ) );
964 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); 964 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this );
965 action->addTo( helpMenu ); 965 action->addTo( helpMenu );
966 connect( action, SIGNAL( activated() ), 966 connect( action, SIGNAL( activated() ),
967 SLOT( aboutAutoSaving() ) ); 967 SLOT( aboutAutoSaving() ) );
968 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); 968 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this );
969 action->addTo( helpMenu ); 969 action->addTo( helpMenu );
970 connect( action, SIGNAL( activated() ), 970 connect( action, SIGNAL( activated() ),
971 SLOT( aboutKnownBugs() ) ); 971 SLOT( aboutKnownBugs() ) );
972 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); 972 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this );
973 action->addTo( helpMenu ); 973 action->addTo( helpMenu );
974 connect( action, SIGNAL( activated() ), 974 connect( action, SIGNAL( activated() ),
975 SLOT( usertrans() ) ); 975 SLOT( usertrans() ) );
976 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); 976 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this );
977 action->addTo( helpMenu ); 977 action->addTo( helpMenu );
978 connect( action, SIGNAL( activated() ), 978 connect( action, SIGNAL( activated() ),
979 SLOT( faq() ) ); 979 SLOT( faq() ) );
980 action = new QAction( "licence", i18n("Licence..."), 0, this ); 980 action = new QAction( "licence", i18n("Licence..."), 0, this );
981 action->addTo( helpMenu ); 981 action->addTo( helpMenu );
982 connect( action, SIGNAL( activated() ), 982 connect( action, SIGNAL( activated() ),
983 SLOT( licence() ) ); 983 SLOT( licence() ) );
984 action = new QAction( "about", i18n("About..."), 0, this ); 984 action = new QAction( "about", i18n("About..."), 0, this );
985 action->addTo( helpMenu ); 985 action->addTo( helpMenu );
986 connect( action, SIGNAL( activated() ), 986 connect( action, SIGNAL( activated() ),
987 SLOT( about() ) ); 987 SLOT( about() ) );
988 //menuBar->insertSeparator(); 988 //menuBar->insertSeparator();
989 989
990 // ****************************************************** 990 // ******************************************************
991 // menubar icons 991 // menubar icons
992 992
993 993
994 iconToolBar->setHorizontalStretchable (true ); 994 iconToolBar->setHorizontalStretchable (true );
995 //menuBar->insertItem( iconToolBar ); 995 //menuBar->insertItem( iconToolBar );
996 //xdays_action 996 //xdays_action
997 if (p-> mShowIconNewEvent) 997 if (p-> mShowIconNewEvent)
998 ne_action->addTo( iconToolBar ); 998 ne_action->addTo( iconToolBar );
999 if (p->mShowIconNewTodo ) 999 if (p->mShowIconNewTodo )
1000 nt_action->addTo( iconToolBar ); 1000 nt_action->addTo( iconToolBar );
1001 if (p-> mShowIconSearch) 1001 if (p-> mShowIconSearch)
1002 search_action->addTo( iconToolBar ); 1002 search_action->addTo( iconToolBar );
1003 if (p-> mShowIconWhatsThis)
1004 QWhatsThis::whatsThisButton ( iconToolBar );
1003 if (p-> mShowIconNext) 1005 if (p-> mShowIconNext)
1004 whatsnext_action->addTo( iconToolBar ); 1006 whatsnext_action->addTo( iconToolBar );
1005 if (p-> mShowIconNextDays) 1007 if (p-> mShowIconNextDays)
1006 xdays_action->addTo( iconToolBar ); 1008 xdays_action->addTo( iconToolBar );
1007 if (p-> mShowIconList) 1009 if (p-> mShowIconList)
1008 showlist_action->addTo( iconToolBar ); 1010 showlist_action->addTo( iconToolBar );
1009 if (p-> mShowIconDay1) 1011 if (p-> mShowIconDay1)
1010 day1_action->addTo( iconToolBar ); 1012 day1_action->addTo( iconToolBar );
1011 if (p-> mShowIconDay5) 1013 if (p-> mShowIconDay5)
1012 day5_action->addTo( iconToolBar ); 1014 day5_action->addTo( iconToolBar );
1013 if (p-> mShowIconDay7) 1015 if (p-> mShowIconDay7)
1014 day7_action->addTo( iconToolBar ); 1016 day7_action->addTo( iconToolBar );
1015 if (p-> mShowIconDay6) 1017 if (p-> mShowIconDay6)
1016 day6_action->addTo( iconToolBar ); 1018 day6_action->addTo( iconToolBar );
1017 if (p-> mShowIconMonth) 1019 if (p-> mShowIconMonth)
1018 month_action->addTo( iconToolBar ); 1020 month_action->addTo( iconToolBar );
1019 if (p-> mShowIconTodoview) 1021 if (p-> mShowIconTodoview)
1020 todoview_action->addTo( iconToolBar ); 1022 todoview_action->addTo( iconToolBar );
1021 if (p-> mShowIconJournal) 1023 if (p-> mShowIconJournal)
1022 viewjournal_action->addTo( iconToolBar ); 1024 viewjournal_action->addTo( iconToolBar );
1023 icon = loadPixmap( pathString + "2leftarrowB" ); 1025 icon = loadPixmap( pathString + "2leftarrowB" );
1024 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); 1026 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14);
1025 if (p-> mShowIconBackFast) { 1027 if (p-> mShowIconBackFast) {
1026 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); 1028 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this );
1027 connect( action, SIGNAL( activated() ), 1029 connect( action, SIGNAL( activated() ),
1028 mView, SLOT( goPreviousMonth() ) ); 1030 mView, SLOT( goPreviousMonth() ) );
1029 action->addTo( iconToolBar ); 1031 action->addTo( iconToolBar );
1030 } 1032 }
1031 icon = loadPixmap( pathString + "1leftarrowB" ); 1033 icon = loadPixmap( pathString + "1leftarrowB" );
1032 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); 1034 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15);
1033 if (p-> mShowIconBack) { 1035 if (p-> mShowIconBack) {
1034 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); 1036 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this );
1035 connect( action, SIGNAL( activated() ), 1037 connect( action, SIGNAL( activated() ),
1036 mView, SLOT( goPrevious() ) ); 1038 mView, SLOT( goPrevious() ) );
1037 action->addTo( iconToolBar ); 1039 action->addTo( iconToolBar );
1038 } 1040 }
1039 icon = loadPixmap( pathString + "today" ); 1041 icon = loadPixmap( pathString + "today" );
1040 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); 1042 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130);
1041 if (p-> mShowIconToday) 1043 if (p-> mShowIconToday)
1042 today_action->addTo( iconToolBar ); 1044 today_action->addTo( iconToolBar );
1043 icon = loadPixmap( pathString + "1rightarrowB" ); 1045 icon = loadPixmap( pathString + "1rightarrowB" );
1044 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); 1046 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220);
1045 if (p-> mShowIconForward) { 1047 if (p-> mShowIconForward) {
1046 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); 1048 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this );
1047 connect( action, SIGNAL( activated() ), 1049 connect( action, SIGNAL( activated() ),
1048 mView, SLOT( goNext() ) ); 1050 mView, SLOT( goNext() ) );
1049 action->addTo( iconToolBar ); 1051 action->addTo( iconToolBar );
1050 } 1052 }
@@ -1061,98 +1063,96 @@ void MainWindow::initActions()
1061 configureToolBarMenu->insertItem(i18n("What's This?"), 300); 1063 configureToolBarMenu->insertItem(i18n("What's This?"), 300);
1062 1064
1063 if (p-> mShowIconNewEvent) 1065 if (p-> mShowIconNewEvent)
1064 configureToolBarMenu->setItemChecked( 10, true ); 1066 configureToolBarMenu->setItemChecked( 10, true );
1065 if (p->mShowIconNewTodo ) 1067 if (p->mShowIconNewTodo )
1066 configureToolBarMenu->setItemChecked( 20, true ); 1068 configureToolBarMenu->setItemChecked( 20, true );
1067 if (p-> mShowIconSearch) 1069 if (p-> mShowIconSearch)
1068 configureToolBarMenu->setItemChecked( 120, true ); 1070 configureToolBarMenu->setItemChecked( 120, true );
1069 if (p-> mShowIconList) 1071 if (p-> mShowIconList)
1070 configureToolBarMenu->setItemChecked( 30, true ); 1072 configureToolBarMenu->setItemChecked( 30, true );
1071 if (p-> mShowIconDay1) 1073 if (p-> mShowIconDay1)
1072 configureToolBarMenu->setItemChecked( 40, true ); 1074 configureToolBarMenu->setItemChecked( 40, true );
1073 if (p-> mShowIconDay5) 1075 if (p-> mShowIconDay5)
1074 configureToolBarMenu->setItemChecked( 50, true ); 1076 configureToolBarMenu->setItemChecked( 50, true );
1075 if (p-> mShowIconDay6) 1077 if (p-> mShowIconDay6)
1076 configureToolBarMenu->setItemChecked( 75, true ); 1078 configureToolBarMenu->setItemChecked( 75, true );
1077 if (p-> mShowIconDay7) 1079 if (p-> mShowIconDay7)
1078 configureToolBarMenu->setItemChecked( 60, true ); 1080 configureToolBarMenu->setItemChecked( 60, true );
1079 if (p-> mShowIconMonth) 1081 if (p-> mShowIconMonth)
1080 configureToolBarMenu->setItemChecked( 70, true ); 1082 configureToolBarMenu->setItemChecked( 70, true );
1081 if (p-> mShowIconTodoview) 1083 if (p-> mShowIconTodoview)
1082 configureToolBarMenu->setItemChecked( 80, true ); 1084 configureToolBarMenu->setItemChecked( 80, true );
1083 if (p-> mShowIconBackFast) 1085 if (p-> mShowIconBackFast)
1084 configureToolBarMenu->setItemChecked( 200, true ); 1086 configureToolBarMenu->setItemChecked( 200, true );
1085 if (p-> mShowIconBack) 1087 if (p-> mShowIconBack)
1086 configureToolBarMenu->setItemChecked( 210, true ); 1088 configureToolBarMenu->setItemChecked( 210, true );
1087 if (p-> mShowIconToday) 1089 if (p-> mShowIconToday)
1088 configureToolBarMenu->setItemChecked( 130, true ); 1090 configureToolBarMenu->setItemChecked( 130, true );
1089 if (p-> mShowIconForward) 1091 if (p-> mShowIconForward)
1090 configureToolBarMenu->setItemChecked( 220, true ); 1092 configureToolBarMenu->setItemChecked( 220, true );
1091 if (p-> mShowIconForwardFast) 1093 if (p-> mShowIconForwardFast)
1092 configureToolBarMenu->setItemChecked( 230, true ); 1094 configureToolBarMenu->setItemChecked( 230, true );
1093 if (p-> mShowIconNextDays) 1095 if (p-> mShowIconNextDays)
1094 configureToolBarMenu->setItemChecked( 100, true ); 1096 configureToolBarMenu->setItemChecked( 100, true );
1095 if (p-> mShowIconNext) 1097 if (p-> mShowIconNext)
1096 configureToolBarMenu->setItemChecked( 110, true ); 1098 configureToolBarMenu->setItemChecked( 110, true );
1097 if (p-> mShowIconJournal) 1099 if (p-> mShowIconJournal)
1098 configureToolBarMenu->setItemChecked( 90, true ); 1100 configureToolBarMenu->setItemChecked( 90, true );
1099 if (p-> mShowIconWhatsThis) 1101 if (p-> mShowIconWhatsThis)
1100 configureToolBarMenu->setItemChecked( 300, true ); 1102 configureToolBarMenu->setItemChecked( 300, true );
1101 if (p-> mShowIconWeekNum) 1103 if (p-> mShowIconWeekNum)
1102 configureToolBarMenu->setItemChecked( 400, true ); 1104 configureToolBarMenu->setItemChecked( 400, true );
1103 QLabel* dummy = new QLabel( iconToolBar ); 1105 QLabel* dummy = new QLabel( iconToolBar );
1104 dummy->setBackgroundColor( iconToolBar->backgroundColor() ); 1106 dummy->setBackgroundColor( iconToolBar->backgroundColor() );
1105 if (!p-> mShowIconStretch) 1107 if (!p-> mShowIconStretch)
1106 iconToolBar->setStretchableWidget ( dummy ) ; 1108 iconToolBar->setStretchableWidget ( dummy ) ;
1107 else 1109 else
1108 configureToolBarMenu->setItemChecked( 5, true ); 1110 configureToolBarMenu->setItemChecked( 5, true );
1109 if (p-> mShowIconWhatsThis)
1110 QWhatsThis::whatsThisButton ( iconToolBar );
1111 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); 1111 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) );
1112 configureAgenda( p->mHourSize ); 1112 configureAgenda( p->mHourSize );
1113 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); 1113 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) );
1114} 1114}
1115 1115
1116void MainWindow::exportToPhone( int mode ) 1116void MainWindow::exportToPhone( int mode )
1117{ 1117{
1118 1118
1119 //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1119 //ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1120 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1120 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1121 KOex2phonePrefs ex2phone; 1121 KOex2phonePrefs ex2phone;
1122 1122
1123 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); 1123 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );
1124 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); 1124 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice );
1125 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1125 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel );
1126 if ( mode == 1 ) 1126 if ( mode == 1 )
1127 ex2phone.setCaption(i18n("Export complete calendar")); 1127 ex2phone.setCaption(i18n("Export complete calendar"));
1128 if ( mode == 2 ) 1128 if ( mode == 2 )
1129 ex2phone.setCaption(i18n("Export filtered calendar")); 1129 ex2phone.setCaption(i18n("Export filtered calendar"));
1130 1130
1131 if ( !ex2phone.exec() ) { 1131 if ( !ex2phone.exec() ) {
1132 return; 1132 return;
1133 } 1133 }
1134 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 1134 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
1135 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 1135 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
1136 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 1136 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
1137 1137
1138 int inFuture = 0; 1138 int inFuture = 0;
1139 if ( ex2phone.mWriteBackFuture->isChecked() ) 1139 if ( ex2phone.mWriteBackFuture->isChecked() )
1140 inFuture = ex2phone.mWriteBackFutureWeeks->value(); 1140 inFuture = ex2phone.mWriteBackFutureWeeks->value();
1141 QPtrList<Incidence> delSel; 1141 QPtrList<Incidence> delSel;
1142 if ( mode == 1 ) 1142 if ( mode == 1 )
1143 delSel = mCalendar->rawIncidences(); 1143 delSel = mCalendar->rawIncidences();
1144 if ( mode == 2 ) 1144 if ( mode == 2 )
1145 delSel = mCalendar->incidences(); 1145 delSel = mCalendar->incidences();
1146 CalendarLocal* cal = new CalendarLocal(); 1146 CalendarLocal* cal = new CalendarLocal();
1147 cal->setLocalTime(); 1147 cal->setLocalTime();
1148 Incidence *incidence = delSel.first(); 1148 Incidence *incidence = delSel.first();
1149 QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); 1149 QDateTime cur = QDateTime::currentDateTime().addDays( -7 );
1150 QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); 1150 QDateTime end = cur.addDays( ( inFuture +1 ) *7 );
1151 while ( incidence ) { 1151 while ( incidence ) {
1152 if ( incidence->type() != "Journal" ) { 1152 if ( incidence->type() != "Journal" ) {
1153 bool add = true; 1153 bool add = true;
1154 if ( inFuture ) { 1154 if ( inFuture ) {
1155 QDateTime dt; 1155 QDateTime dt;
1156 if ( incidence->type() == "Todo" ) { 1156 if ( incidence->type() == "Todo" ) {
1157 Todo * t = (Todo*)incidence; 1157 Todo * t = (Todo*)incidence;
1158 if ( t->hasDueDate() ) 1158 if ( t->hasDueDate() )