-rw-r--r-- | core/pim/datebook/datebookweek.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/core/pim/datebook/datebookweek.cpp b/core/pim/datebook/datebookweek.cpp index e49ed28..2ad7aa9 100644 --- a/core/pim/datebook/datebookweek.cpp +++ b/core/pim/datebook/datebookweek.cpp | |||
@@ -63,99 +63,99 @@ DateBookWeekView::DateBookWeekView( bool ap, bool startOnMonday, | |||
63 | : QScrollView( parent, name ), ampm( ap ), bOnMonday( startOnMonday ), | 63 | : QScrollView( parent, name ), ampm( ap ), bOnMonday( startOnMonday ), |
64 | showingEvent( false ) | 64 | showingEvent( false ) |
65 | { | 65 | { |
66 | items.setAutoDelete( true ); | 66 | items.setAutoDelete( true ); |
67 | 67 | ||
68 | viewport()->setBackgroundMode( PaletteBase ); | 68 | viewport()->setBackgroundMode( PaletteBase ); |
69 | 69 | ||
70 | header = new QHeader( this ); | 70 | header = new QHeader( this ); |
71 | header->addLabel( "" ); | 71 | header->addLabel( "" ); |
72 | 72 | ||
73 | header->setMovingEnabled( false ); | 73 | header->setMovingEnabled( false ); |
74 | header->setResizeEnabled( false ); | 74 | header->setResizeEnabled( false ); |
75 | header->setClickEnabled( false, 0 ); | 75 | header->setClickEnabled( false, 0 ); |
76 | initNames(); | 76 | initNames(); |
77 | 77 | ||
78 | 78 | ||
79 | connect( header, SIGNAL(clicked(int)), this, SIGNAL(showDay(int)) ); | 79 | connect( header, SIGNAL(clicked(int)), this, SIGNAL(showDay(int)) ); |
80 | 80 | ||
81 | QObject::connect(qApp, SIGNAL(clockChanged(bool)), | 81 | QObject::connect(qApp, SIGNAL(clockChanged(bool)), |
82 | this, SLOT(slotChangeClock(bool))); | 82 | this, SLOT(slotChangeClock(bool))); |
83 | 83 | ||
84 | QFontMetrics fm( font() ); | 84 | QFontMetrics fm( font() ); |
85 | rowHeight = fm.height()+2; | 85 | rowHeight = fm.height()+2; |
86 | 86 | ||
87 | resizeContents( width(), 24*rowHeight ); | 87 | resizeContents( width(), 24*rowHeight ); |
88 | } | 88 | } |
89 | 89 | ||
90 | void DateBookWeekView::initNames() | 90 | void DateBookWeekView::initNames() |
91 | { | 91 | { |
92 | static bool bFirst = true; | 92 | static bool bFirst = true; |
93 | if ( bFirst ) { | 93 | if ( bFirst ) { |
94 | if ( bOnMonday ) { | 94 | if ( bOnMonday ) { |
95 | header->addLabel( tr("M", "Monday" ) ); | 95 | header->addLabel( tr("Mo", "Monday" ) ); |
96 | header->addLabel( tr("T", "Tuesday") ); | 96 | header->addLabel( tr("Tu", "Tuesday") ); |
97 | header->addLabel( tr("W", "Wednesday" ) ); | 97 | header->addLabel( tr("We", "Wednesday" ) ); |
98 | header->addLabel( tr("T", "Thursday" ) ); | 98 | header->addLabel( tr("Th", "Thursday" ) ); |
99 | header->addLabel( tr("F", "Friday" ) ); | 99 | header->addLabel( tr("Fr", "Friday" ) ); |
100 | header->addLabel( tr("S", "Saturday" ) ); | 100 | header->addLabel( tr("Sa", "Saturday" ) ); |
101 | header->addLabel( tr("S", "Sunday" ) ); | 101 | header->addLabel( tr("Su", "Sunday" ) ); |
102 | } else { | 102 | } else { |
103 | header->addLabel( tr("S", "Sunday" ) ); | 103 | header->addLabel( tr("Su", "Sunday" ) ); |
104 | header->addLabel( tr("M", "Monday") ); | 104 | header->addLabel( tr("Mo", "Monday") ); |
105 | header->addLabel( tr("T", "Tuesday") ); | 105 | header->addLabel( tr("Tu", "Tuesday") ); |
106 | header->addLabel( tr("W", "Wednesday" ) ); | 106 | header->addLabel( tr("We", "Wednesday" ) ); |
107 | header->addLabel( tr("T", "Thursday" ) ); | 107 | header->addLabel( tr("Th", "Thursday" ) ); |
108 | header->addLabel( tr("F", "Friday" ) ); | 108 | header->addLabel( tr("Fr", "Friday" ) ); |
109 | header->addLabel( tr("S", "Saturday" ) ); | 109 | header->addLabel( tr("Sa", "Saturday" ) ); |
110 | } | 110 | } |
111 | bFirst = false; | 111 | bFirst = false; |
112 | } else { | 112 | } else { |
113 | // we are change things... | 113 | // we are change things... |
114 | if ( bOnMonday ) { | 114 | if ( bOnMonday ) { |
115 | header->setLabel( 1, tr("M", "Monday") ); | 115 | header->setLabel( 1, tr("Mo", "Monday") ); |
116 | header->setLabel( 2, tr("T", "Tuesday") ); | 116 | header->setLabel( 2, tr("Tu", "Tuesday") ); |
117 | header->setLabel( 3, tr("W", "Wednesday" ) ); | 117 | header->setLabel( 3, tr("We", "Wednesday" ) ); |
118 | header->setLabel( 4, tr("T", "Thursday" ) ); | 118 | header->setLabel( 4, tr("Th", "Thursday" ) ); |
119 | header->setLabel( 5, tr("F", "Friday" ) ); | 119 | header->setLabel( 5, tr("Fr", "Friday" ) ); |
120 | header->setLabel( 6, tr("S", "Saturday" ) ); | 120 | header->setLabel( 6, tr("Sa", "Saturday" ) ); |
121 | header->setLabel( 7, tr("S", "Sunday" ) ); | 121 | header->setLabel( 7, tr("Su", "Sunday" ) ); |
122 | } else { | 122 | } else { |
123 | header->setLabel( 1, tr("S", "Sunday" ) ); | 123 | header->setLabel( 1, tr("Su", "Sunday" ) ); |
124 | header->setLabel( 2, tr("M", "Monday") ); | 124 | header->setLabel( 2, tr("Mo", "Monday") ); |
125 | header->setLabel( 3, tr("T", "Tuesday") ); | 125 | header->setLabel( 3, tr("Tu", "Tuesday") ); |
126 | header->setLabel( 4, tr("W", "Wednesday" ) ); | 126 | header->setLabel( 4, tr("We", "Wednesday" ) ); |
127 | header->setLabel( 5, tr("T", "Thursday" ) ); | 127 | header->setLabel( 5, tr("Th", "Thursday" ) ); |
128 | header->setLabel( 6, tr("F", "Friday" ) ); | 128 | header->setLabel( 6, tr("Fr", "Friday" ) ); |
129 | header->setLabel( 7, tr("S", "Saturday" ) ); | 129 | header->setLabel( 7, tr("Sa", "Saturday" ) ); |
130 | } | 130 | } |
131 | } | 131 | } |
132 | } | 132 | } |
133 | 133 | ||
134 | 134 | ||
135 | 135 | ||
136 | void DateBookWeekView::showEvents( QValueList<EffectiveEvent> &ev ) | 136 | void DateBookWeekView::showEvents( QValueList<EffectiveEvent> &ev ) |
137 | { | 137 | { |
138 | items.clear(); | 138 | items.clear(); |
139 | QValueListIterator<EffectiveEvent> it; | 139 | QValueListIterator<EffectiveEvent> it; |
140 | for ( it = ev.begin(); it != ev.end(); ++it ) { | 140 | for ( it = ev.begin(); it != ev.end(); ++it ) { |
141 | DateBookWeekItem *i = new DateBookWeekItem( *it ); | 141 | DateBookWeekItem *i = new DateBookWeekItem( *it ); |
142 | if(!((i->event().end().hour()==0) && (i->event().end().minute()==0) && (i->event().startDate()!=i->event().date()))) {// Skip events ending at 00:00 starting at another day. | 142 | if(!((i->event().end().hour()==0) && (i->event().end().minute()==0) && (i->event().startDate()!=i->event().date()))) {// Skip events ending at 00:00 starting at another day. |
143 | positionItem( i ); | 143 | positionItem( i ); |
144 | items.append( i ); | 144 | items.append( i ); |
145 | } | 145 | } |
146 | } | 146 | } |
147 | viewport()->update(); | 147 | viewport()->update(); |
148 | } | 148 | } |
149 | 149 | ||
150 | void DateBookWeekView::moveToHour( int h ) | 150 | void DateBookWeekView::moveToHour( int h ) |
151 | { | 151 | { |
152 | int offset = h*rowHeight; | 152 | int offset = h*rowHeight; |
153 | setContentsPos( 0, offset ); | 153 | setContentsPos( 0, offset ); |
154 | } | 154 | } |
155 | 155 | ||
156 | void DateBookWeekView::keyPressEvent( QKeyEvent *e ) | 156 | void DateBookWeekView::keyPressEvent( QKeyEvent *e ) |
157 | { | 157 | { |
158 | e->ignore(); | 158 | e->ignore(); |
159 | } | 159 | } |
160 | 160 | ||
161 | void DateBookWeekView::slotChangeClock( bool c ) | 161 | void DateBookWeekView::slotChangeClock( bool c ) |