summaryrefslogtreecommitdiff
path: root/core/pim/datebook/datebookweekheaderimpl.cpp
Unidiff
Diffstat (limited to 'core/pim/datebook/datebookweekheaderimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebookweekheaderimpl.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/pim/datebook/datebookweekheaderimpl.cpp b/core/pim/datebook/datebookweekheaderimpl.cpp
index 123a478..7462de7 100644
--- a/core/pim/datebook/datebookweekheaderimpl.cpp
+++ b/core/pim/datebook/datebookweekheaderimpl.cpp
@@ -48,64 +48,64 @@ DateBookWeekHeader::DateBookWeekHeader( bool startOnMonday, QWidget* parent, con
48 */ 48 */
49DateBookWeekHeader::~DateBookWeekHeader() 49DateBookWeekHeader::~DateBookWeekHeader()
50{ 50{
51 // no need to delete child widgets, Qt does it all for us 51 // no need to delete child widgets, Qt does it all for us
52} 52}
53 53
54void DateBookWeekHeader::pickDate() 54void DateBookWeekHeader::pickDate()
55{ 55{
56 static QPopupMenu *m1 = 0; 56 static QPopupMenu *m1 = 0;
57 static DateBookMonth *picker = 0; 57 static DateBookMonth *picker = 0;
58 if ( !m1 ) { 58 if ( !m1 ) {
59 m1 = new QPopupMenu( this ); 59 m1 = new QPopupMenu( this );
60 picker = new DateBookMonth( m1, 0, TRUE ); 60 picker = new DateBookMonth( m1, 0, TRUE );
61 m1->insertItem( picker ); 61 m1->insertItem( picker );
62 connect( picker, SIGNAL( dateClicked(int,int,int) ), this, SLOT( setDate(int,int,int) ) ); 62 connect( picker, SIGNAL( dateClicked(int,int,int) ), this, SLOT( setDate(int,int,int) ) );
63 // connect( m1, SIGNAL( aboutToHide() ), this, SLOT( gotHide() ) ); 63 // connect( m1, SIGNAL( aboutToHide() ), this, SLOT( gotHide() ) );
64 } 64 }
65 picker->setDate( date.year(), date.month(), date.day() ); 65 picker->setDate( date.year(), date.month(), date.day() );
66 m1->popup(mapToGlobal(labelDate->pos()+QPoint(0,labelDate->height()))); 66 m1->popup(mapToGlobal(labelDate->pos()+QPoint(0,labelDate->height())));
67 picker->setFocus(); 67 picker->setFocus();
68} 68}
69 69
70void DateBookWeekHeader::nextMonth() 70void DateBookWeekHeader::nextMonth()
71{ 71{
72 Opie::Core::owarn << "nextMonth()" << oendl; 72 owarn << "nextMonth()" << oendl;
73 setDate(date.addDays(28)); 73 setDate(date.addDays(28));
74} 74}
75void DateBookWeekHeader::prevMonth() 75void DateBookWeekHeader::prevMonth()
76{ 76{
77 Opie::Core::owarn << "prevMonth()" << oendl; 77 owarn << "prevMonth()" << oendl;
78 setDate(date.addDays(-28)); 78 setDate(date.addDays(-28));
79} 79}
80void DateBookWeekHeader::nextWeek() 80void DateBookWeekHeader::nextWeek()
81{ 81{
82 Opie::Core::owarn << "nextWeek()" << oendl; 82 owarn << "nextWeek()" << oendl;
83 setDate(date.addDays(7)); 83 setDate(date.addDays(7));
84} 84}
85void DateBookWeekHeader::prevWeek() 85void DateBookWeekHeader::prevWeek()
86{ 86{
87 Opie::Core::owarn << "prevWeek()" << oendl; 87 owarn << "prevWeek()" << oendl;
88 setDate(date.addDays(-7)); 88 setDate(date.addDays(-7));
89} 89}
90 90
91void DateBookWeekHeader::setDate( int y, int m, int d ) 91void DateBookWeekHeader::setDate( int y, int m, int d )
92{ 92{
93 setDate(QDate(y,m,d)); 93 setDate(QDate(y,m,d));
94} 94}
95 95
96void DateBookWeekHeader::setDate(const QDate &d) { 96void DateBookWeekHeader::setDate(const QDate &d) {
97 int year,week,dayofweek; 97 int year,week,dayofweek;
98 date=d; 98 date=d;
99 dayofweek=d.dayOfWeek(); 99 dayofweek=d.dayOfWeek();
100 if(bStartOnMonday) 100 if(bStartOnMonday)
101 dayofweek--; 101 dayofweek--;
102 else if( dayofweek == 7 ) 102 else if( dayofweek == 7 )
103 // we already have the right day -7 would lead to the current week.. 103 // we already have the right day -7 would lead to the current week..
104 dayofweek = 0; 104 dayofweek = 0;
105 105
106 date=date.addDays(-dayofweek); 106 date=date.addDays(-dayofweek);
107 calcWeek(date,week,year,bStartOnMonday); 107 calcWeek(date,week,year,bStartOnMonday);
108 QDate start=date; 108 QDate start=date;
109 QDate stop=start.addDays(6); 109 QDate stop=start.addDays(6);
110 labelDate->setText( QString::number(start.day()) + "." + 110 labelDate->setText( QString::number(start.day()) + "." +
111 Calendar::nameOfMonth( start.month()) + "-" + 111 Calendar::nameOfMonth( start.month()) + "-" +