summaryrefslogtreecommitdiffabout
path: root/korganizer/kdatenavigator.cpp
Unidiff
Diffstat (limited to 'korganizer/kdatenavigator.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kdatenavigator.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index 6697602..ecc7a2f 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -13,54 +13,58 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
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 <qstring.h> 24#include <qstring.h>
25#include <qkeycode.h> 25#include <qnamespace.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qtimer.h> 27#include <qtimer.h>
28#include <qframe.h> 28#include <q3frame.h>
29#include <qlabel.h> 29#include <qlabel.h>
30#include <qapplication.h> 30#include <qapplication.h>
31//Added by qt3to4:
32#include <QWheelEvent>
33#include <Q3GridLayout>
34#include <QEvent>
31 35
32#include <kdebug.h> 36#include <kdebug.h>
33#include <klocale.h> 37#include <klocale.h>
34#include <kglobal.h> 38#include <kglobal.h>
35 39
36#include "koglobals.h" 40#include "koglobals.h"
37#include "koprefs.h" 41#include "koprefs.h"
38#ifndef KORG_NOPLUGINS 42#ifndef KORG_NOPLUGINS
39#include "kocore.h" 43#include "kocore.h"
40#endif 44#endif
41 45
42#include <kcalendarsystem.h> 46#include <kcalendarsystem.h>
43 47
44#include "navigatorbar.h" 48#include "navigatorbar.h"
45 49
46#include "kdatenavigator.h" 50#include "kdatenavigator.h"
47 51
48KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) 52KDateNavigator::KDateNavigator( QWidget *parent, const char *name )
49 : QFrame(parent, name), 53 : Q3Frame(parent, name),
50 updateTimer(0L) 54 updateTimer(0L)
51{ 55{
52 setFrameStyle(QFrame::NoFrame); 56 setFrameStyle(Q3Frame::NoFrame);
53 QDate startDate = QDate::currentDate(); 57 QDate startDate = QDate::currentDate();
54 QGridLayout *topLayout = new QGridLayout(this,8,8); 58 Q3GridLayout *topLayout = new Q3GridLayout(this,8,8);
55 59
56 if (! startDate.isValid()) { 60 if (! startDate.isValid()) {
57 qDebug("KDateNavigator::invalid startdate "); 61 qDebug("KDateNavigator::invalid startdate ");
58 startDate = QDate::currentDate(); 62 startDate = QDate::currentDate();
59 } 63 }
60 mMonthSignalOffset = 0; 64 mMonthSignalOffset = 0;
61 mSelectedDates.append(startDate); 65 mSelectedDates.append(startDate);
62 m_MthYr = startDate; 66 m_MthYr = startDate;
63 m_bShowWeekNums = true; 67 m_bShowWeekNums = true;
64 setFont( KOPrefs::instance()->mDateNavigatorFont ); 68 setFont( KOPrefs::instance()->mDateNavigatorFont );
65 mNavigatorBar = new NavigatorBar( startDate, this ); 69 mNavigatorBar = new NavigatorBar( startDate, this );
66 topLayout->addMultiCellWidget( mNavigatorBar, 0, 0, 0, 7 ); 70 topLayout->addMultiCellWidget( mNavigatorBar, 0, 0, 0, 7 );
@@ -72,45 +76,45 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name )
72 connect( mNavigatorBar, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) ); 76 connect( mNavigatorBar, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) );
73 77
74 // get the day of the week on the first day 78 // get the day of the week on the first day
75 QDate dayone(m_MthYr.year(), m_MthYr.month(), 1); 79 QDate dayone(m_MthYr.year(), m_MthYr.month(), 1);
76 m_fstDayOfWk = dayone.dayOfWeek(); 80 m_fstDayOfWk = dayone.dayOfWeek();
77 81
78 int i; 82 int i;
79 83
80 // Set up the heading fields. 84 // Set up the heading fields.
81 for( i = 0; i < 7; i++ ) { 85 for( i = 0; i < 7; i++ ) {
82 headings[i] = new QLabel("",this); 86 headings[i] = new QLabel("",this);
83 //headings[i]->setFont(QFont("Arial", 10, QFont::Bold)); 87 //headings[i]->setFont(QFont("Arial", 10, QFont::Bold));
84 headings[i]->setAlignment(AlignCenter); 88 headings[i]->setAlignment(Qt::AlignCenter);
85 headings[i]->installEventFilter(this); 89 headings[i]->installEventFilter(this);
86 90
87 topLayout->addWidget(headings[i],1,i+1); 91 topLayout->addWidget(headings[i],1,i+1);
88 } 92 }
89 93
90 // Create the weeknumber labels 94 // Create the weeknumber labels
91 for( i = 0; i < 6; i++ ) { 95 for( i = 0; i < 6; i++ ) {
92 weeknos[i] = new QLabel(this); 96 weeknos[i] = new QLabel(this);
93 weeknos[i]->setAlignment(AlignCenter ); 97 weeknos[i]->setAlignment(Qt::AlignCenter );
94 //weeknos[i]->setFont(QFont("Arial", 10)); 98 //weeknos[i]->setFont(QFont("Arial", 10));
95 if(!m_bShowWeekNums) { 99 if(!m_bShowWeekNums) {
96 weeknos[i]->hide(); 100 weeknos[i]->hide();
97 } 101 }
98 weeknos[i]->installEventFilter(this); 102 weeknos[i]->installEventFilter(this);
99 103
100 topLayout->addWidget(weeknos[i],i+2,0); 104 topLayout->addWidget(weeknos[i],i+2,0);
101 } 105 }
102 106
103 daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix"); 107 daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix");
104 daymatrix->setFrameStyle(QFrame::Panel|QFrame::Sunken); 108 daymatrix->setFrameStyle(Q3Frame::Panel|Q3Frame::Sunken);
105 daymatrix->setLineWidth(1); 109 daymatrix->setLineWidth(1);
106 110
107 connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ), 111 connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ),
108 SIGNAL( datesSelected( const KCal::DateList & ) ) ); 112 SIGNAL( datesSelected( const KCal::DateList & ) ) );
109 113
110 connect( daymatrix, SIGNAL( eventDropped( Event * ) ), 114 connect( daymatrix, SIGNAL( eventDropped( Event * ) ),
111 SIGNAL( eventDropped( Event * ) ) ); 115 SIGNAL( eventDropped( Event * ) ) );
112 116
113 topLayout->addMultiCellWidget(daymatrix,2,7,1,7); 117 topLayout->addMultiCellWidget(daymatrix,2,7,1,7);
114 118
115 // read settings from configuration file. 119 // read settings from configuration file.
116 updateConfig(); 120 updateConfig();