author | zautrix <zautrix> | 2005-04-21 11:44:00 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-21 11:44:00 (UTC) |
commit | 4d96d7b681ce99d76746a843c289b75f5e7dba64 (patch) (unidiff) | |
tree | 71b6953625d8b096e62177bf93379c3ca6c74d66 | |
parent | f23afbb9c09b4ee0f00af8f04ee4458181792cd0 (diff) | |
download | kdepimpi-4d96d7b681ce99d76746a843c289b75f5e7dba64.zip kdepimpi-4d96d7b681ce99d76746a843c289b75f5e7dba64.tar.gz kdepimpi-4d96d7b681ce99d76746a843c289b75f5e7dba64.tar.bz2 |
memory leaks fixed
-rw-r--r-- | korganizer/koagendaitem.cpp | 8 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 2 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 8 | ||||
-rw-r--r-- | korganizer/kolistview.h | 3 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 6 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 8 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 6 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 1 |
8 files changed, 35 insertions, 7 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 1801d7e..df2e478 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp | |||
@@ -126,66 +126,70 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd ) | |||
126 | mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); | 126 | mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); |
127 | if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) ) { | 127 | if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) ) { |
128 | if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) | 128 | if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) |
129 | mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; | 129 | mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; |
130 | } | 130 | } |
131 | } | 131 | } |
132 | 132 | ||
133 | } | 133 | } |
134 | mColorGroup = QColorGroup( mBackgroundColor.light(), | 134 | mColorGroup = QColorGroup( mBackgroundColor.light(), |
135 | mBackgroundColor.dark(),mBackgroundColor.light(), | 135 | mBackgroundColor.dark(),mBackgroundColor.light(), |
136 | mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ; | 136 | mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ; |
137 | setBackgroundColor( mBackgroundColor ); | 137 | setBackgroundColor( mBackgroundColor ); |
138 | 138 | ||
139 | mConflictItems.clear(); | 139 | mConflictItems.clear(); |
140 | setCellXY(0,0,1); | 140 | setCellXY(0,0,1); |
141 | setCellXWidth(0); | 141 | setCellXWidth(0); |
142 | setSubCell(0); | 142 | setSubCell(0); |
143 | setSubCells(1); | 143 | setSubCells(1); |
144 | setMultiItem(0,0,0); | 144 | setMultiItem(0,0,0); |
145 | startMove(); | 145 | startMove(); |
146 | mSelected = true; | 146 | mSelected = true; |
147 | select(false); | 147 | select(false); |
148 | QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont); | 148 | QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont); |
149 | mFontPixelSize = fontinf.height();; | 149 | mFontPixelSize = fontinf.height();; |
150 | hide(); | 150 | hide(); |
151 | xPaintCoord = -1; | 151 | xPaintCoord = -1; |
152 | yPaintCoord = -1; | 152 | yPaintCoord = -1; |
153 | } | 153 | } |
154 | 154 | ||
155 | 155 | ||
156 | KOAgendaItem::~KOAgendaItem() | 156 | KOAgendaItem::~KOAgendaItem() |
157 | { | 157 | { |
158 | // qDebug("deleteKOAgendaItem::~KOAgendaItem( "); | 158 | #if QT_VERSION >= 0x030000 |
159 | // delete mKOAgendaItemWhatsThis; | 159 | |
160 | #else | ||
161 | delete mKOAgendaItemWhatsThis; | ||
162 | #endif | ||
163 | |||
160 | } | 164 | } |
161 | 165 | ||
162 | void KOAgendaItem::recreateIncidence() | 166 | void KOAgendaItem::recreateIncidence() |
163 | { | 167 | { |
164 | #if 0 | 168 | #if 0 |
165 | Incidence* newInc = mIncidence->clone(); | 169 | Incidence* newInc = mIncidence->clone(); |
166 | newInc->recreate(); | 170 | newInc->recreate(); |
167 | if ( mIncidence->doesRecur() ) { | 171 | if ( mIncidence->doesRecur() ) { |
168 | mIncidence->addExDate( mDate ); | 172 | mIncidence->addExDate( mDate ); |
169 | newInc->recurrence()->unsetRecurs(); | 173 | newInc->recurrence()->unsetRecurs(); |
170 | int len = mIncidence->dtStart().secsTo( ((Event*)mIncidence)->dtEnd()); | 174 | int len = mIncidence->dtStart().secsTo( ((Event*)mIncidence)->dtEnd()); |
171 | QTime tim = mIncidence->dtStart().time(); | 175 | QTime tim = mIncidence->dtStart().time(); |
172 | newInc->setDtStart( QDateTime(mDate, tim) ); | 176 | newInc->setDtStart( QDateTime(mDate, tim) ); |
173 | ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); | 177 | ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); |
174 | } | 178 | } |
175 | #endif | 179 | #endif |
176 | mIncidence = mIncidence->recreateCloneException( mDate ); | 180 | mIncidence = mIncidence->recreateCloneException( mDate ); |
177 | } | 181 | } |
178 | bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) | 182 | bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) |
179 | { | 183 | { |
180 | int size = AGENDA_ICON_SIZE; | 184 | int size = AGENDA_ICON_SIZE; |
181 | 185 | ||
182 | int yOff = 0; | 186 | int yOff = 0; |
183 | int xOff = 0; | 187 | int xOff = 0; |
184 | int x = pos().x() +3; | 188 | int x = pos().x() +3; |
185 | int y; | 189 | int y; |
186 | if ( mAllDay ) | 190 | if ( mAllDay ) |
187 | y = pos().y()+3; | 191 | y = pos().y()+3; |
188 | else | 192 | else |
189 | y = mCellYTop * ( height() / cellHeight() ) +3; | 193 | y = mCellYTop * ( height() / cellHeight() ) +3; |
190 | if (mIncidence->cancelled()) { | 194 | if (mIncidence->cancelled()) { |
191 | int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x; | 195 | int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x; |
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index c32a2a4..53ebdb2 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp | |||
@@ -34,65 +34,65 @@ | |||
34 | 34 | ||
35 | #include <libkcal/vcaldrag.h> | 35 | #include <libkcal/vcaldrag.h> |
36 | #include <libkcal/icaldrag.h> | 36 | #include <libkcal/icaldrag.h> |
37 | #include <libkcal/dndfactory.h> | 37 | #include <libkcal/dndfactory.h> |
38 | #include <libkcal/calendarresources.h> | 38 | #include <libkcal/calendarresources.h> |
39 | #include <libkcal/resourcecalendar.h> | 39 | #include <libkcal/resourcecalendar.h> |
40 | #include <kresources/resourceselectdialog.h> | 40 | #include <kresources/resourceselectdialog.h> |
41 | 41 | ||
42 | #include <kcalendarsystem.h> | 42 | #include <kcalendarsystem.h> |
43 | 43 | ||
44 | #ifndef KORG_NOPLUGINS | 44 | #ifndef KORG_NOPLUGINS |
45 | #include "kocore.h" | 45 | #include "kocore.h" |
46 | #endif | 46 | #endif |
47 | #include "koprefs.h" | 47 | #include "koprefs.h" |
48 | #include "koglobals.h" | 48 | #include "koglobals.h" |
49 | 49 | ||
50 | #include "kodaymatrix.h" | 50 | #include "kodaymatrix.h" |
51 | 51 | ||
52 | // ============================================================================ | 52 | // ============================================================================ |
53 | // D Y N A M I C T I P | 53 | // D Y N A M I C T I P |
54 | // ============================================================================ | 54 | // ============================================================================ |
55 | 55 | ||
56 | DynamicTip::DynamicTip( QWidget * parent ) | 56 | DynamicTip::DynamicTip( QWidget * parent ) |
57 | : QToolTip( parent ) | 57 | : QToolTip( parent ) |
58 | { | 58 | { |
59 | matrix = (KODayMatrix*)parent; | 59 | matrix = (KODayMatrix*)parent; |
60 | } | 60 | } |
61 | 61 | ||
62 | class KODaymatrixWhatsThis :public QWhatsThis | 62 | class KODaymatrixWhatsThis :public QWhatsThis |
63 | { | 63 | { |
64 | public: | 64 | public: |
65 | KODaymatrixWhatsThis( KODayMatrix* view ) : QWhatsThis( view ),_view (view) { ;}; | 65 | KODaymatrixWhatsThis( KODayMatrix* view ) : QWhatsThis( view ),_view (view) { ;}; |
66 | ~KODaymatrixWhatsThis() { qDebug("DELETE KODaymatrixWhatsThis "); }; | 66 | ~KODaymatrixWhatsThis() { ; }; |
67 | 67 | ||
68 | protected: | 68 | protected: |
69 | virtual QString text( const QPoint& p ) | 69 | virtual QString text( const QPoint& p ) |
70 | { | 70 | { |
71 | return _view->getWhatsThisText( p ) ; | 71 | return _view->getWhatsThisText( p ) ; |
72 | } | 72 | } |
73 | private: | 73 | private: |
74 | KODayMatrix * _view; | 74 | KODayMatrix * _view; |
75 | }; | 75 | }; |
76 | 76 | ||
77 | void DynamicTip::maybeTip( const QPoint &pos ) | 77 | void DynamicTip::maybeTip( const QPoint &pos ) |
78 | { | 78 | { |
79 | //calculate which cell of the matrix the mouse is in | 79 | //calculate which cell of the matrix the mouse is in |
80 | QRect sz = matrix->frameRect(); | 80 | QRect sz = matrix->frameRect(); |
81 | int dheight = sz.height()*7 / 42; | 81 | int dheight = sz.height()*7 / 42; |
82 | int dwidth = sz.width() / 7; | 82 | int dwidth = sz.width() / 7; |
83 | int row = pos.y()/dheight; | 83 | int row = pos.y()/dheight; |
84 | int col = pos.x()/dwidth; | 84 | int col = pos.x()/dwidth; |
85 | 85 | ||
86 | QRect rct(col*dwidth, row*dheight, dwidth, dheight); | 86 | QRect rct(col*dwidth, row*dheight, dwidth, dheight); |
87 | 87 | ||
88 | // kdDebug() << "DynamicTip::maybeTip matrix cell index [" << | 88 | // kdDebug() << "DynamicTip::maybeTip matrix cell index [" << |
89 | // col << "][" << row << "] => " <<(col+row*7) << endl; | 89 | // col << "][" << row << "] => " <<(col+row*7) << endl; |
90 | 90 | ||
91 | //show holiday names only | 91 | //show holiday names only |
92 | QString str = matrix->getHolidayLabel(col+row*7); | 92 | QString str = matrix->getHolidayLabel(col+row*7); |
93 | if (str.isEmpty()) return; | 93 | if (str.isEmpty()) return; |
94 | tip(rct, str); | 94 | tip(rct, str); |
95 | } | 95 | } |
96 | 96 | ||
97 | 97 | ||
98 | // ============================================================================ | 98 | // ============================================================================ |
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index fd86095..b94916a 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -232,65 +232,65 @@ bool ListItemVisitor::visit(Journal * j) | |||
232 | } | 232 | } |
233 | 233 | ||
234 | KOListView::KOListView(Calendar *calendar, QWidget *parent, | 234 | KOListView::KOListView(Calendar *calendar, QWidget *parent, |
235 | const char *name) | 235 | const char *name) |
236 | : KOEventView(calendar, parent, name) | 236 | : KOEventView(calendar, parent, name) |
237 | { | 237 | { |
238 | mActiveItem = 0; | 238 | mActiveItem = 0; |
239 | mListView = new KOListViewListView(this); | 239 | mListView = new KOListViewListView(this); |
240 | mListView->addColumn(i18n("Summary")); | 240 | mListView->addColumn(i18n("Summary")); |
241 | mListView->addColumn(i18n("Start Date")); | 241 | mListView->addColumn(i18n("Start Date")); |
242 | mListView->addColumn(i18n("Start Time")); | 242 | mListView->addColumn(i18n("Start Time")); |
243 | mListView->addColumn(i18n("End Date")); | 243 | mListView->addColumn(i18n("End Date")); |
244 | mListView->addColumn(i18n("End Time")); | 244 | mListView->addColumn(i18n("End Time")); |
245 | mListView->addColumn(i18n("Alarm")); // alarm set? | 245 | mListView->addColumn(i18n("Alarm")); // alarm set? |
246 | mListView->addColumn(i18n("Recurs")); // recurs? | 246 | mListView->addColumn(i18n("Recurs")); // recurs? |
247 | mListView->addColumn(i18n("Due Date")); | 247 | mListView->addColumn(i18n("Due Date")); |
248 | mListView->addColumn(i18n("Due Time")); | 248 | mListView->addColumn(i18n("Due Time")); |
249 | mListView->addColumn(i18n("Cancelled")); | 249 | mListView->addColumn(i18n("Cancelled")); |
250 | mListView->addColumn(i18n("Categories")); | 250 | mListView->addColumn(i18n("Categories")); |
251 | 251 | ||
252 | mListView->setColumnAlignment(0,AlignLeft); | 252 | mListView->setColumnAlignment(0,AlignLeft); |
253 | mListView->setColumnAlignment(1,AlignLeft); | 253 | mListView->setColumnAlignment(1,AlignLeft); |
254 | mListView->setColumnAlignment(2,AlignHCenter); | 254 | mListView->setColumnAlignment(2,AlignHCenter); |
255 | mListView->setColumnAlignment(3,AlignLeft); | 255 | mListView->setColumnAlignment(3,AlignLeft); |
256 | mListView->setColumnAlignment(4,AlignHCenter); | 256 | mListView->setColumnAlignment(4,AlignHCenter); |
257 | mListView->setColumnAlignment(5,AlignLeft); | 257 | mListView->setColumnAlignment(5,AlignLeft); |
258 | mListView->setColumnAlignment(6,AlignLeft); | 258 | mListView->setColumnAlignment(6,AlignLeft); |
259 | mListView->setColumnAlignment(7,AlignLeft); | 259 | mListView->setColumnAlignment(7,AlignLeft); |
260 | mListView->setColumnAlignment(8,AlignLeft); | 260 | mListView->setColumnAlignment(8,AlignLeft); |
261 | mListView->setColumnAlignment(9,AlignLeft); | 261 | mListView->setColumnAlignment(9,AlignLeft); |
262 | mListView->setColumnAlignment(10,AlignLeft); | 262 | mListView->setColumnAlignment(10,AlignLeft); |
263 | mListView->setColumnWidthMode(10, QListView::Manual); | 263 | mListView->setColumnWidthMode(10, QListView::Manual); |
264 | new KOListViewWhatsThis(mListView->viewport(),this); | 264 | mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this); |
265 | 265 | ||
266 | int iii = 0; | 266 | int iii = 0; |
267 | for ( iii = 0; iii< 10 ; ++iii ) | 267 | for ( iii = 0; iii< 10 ; ++iii ) |
268 | mListView->setColumnWidthMode( iii, QListView::Manual ); | 268 | mListView->setColumnWidthMode( iii, QListView::Manual ); |
269 | 269 | ||
270 | QBoxLayout *layoutTop = new QVBoxLayout(this); | 270 | QBoxLayout *layoutTop = new QVBoxLayout(this); |
271 | layoutTop->addWidget(mListView); | 271 | layoutTop->addWidget(mListView); |
272 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); | 272 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); |
273 | mPopupMenu = eventPopup(); | 273 | mPopupMenu = eventPopup(); |
274 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 274 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
275 | i18n("Select all"),this, | 275 | i18n("Select all"),this, |
276 | SLOT(allSelection()),true); | 276 | SLOT(allSelection()),true); |
277 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 277 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
278 | i18n("Deselect all"),this, | 278 | i18n("Deselect all"),this, |
279 | SLOT(clearSelection()),true); | 279 | SLOT(clearSelection()),true); |
280 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 280 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
281 | i18n("Delete all selected"),this, | 281 | i18n("Delete all selected"),this, |
282 | SLOT(deleteAll()),true); | 282 | SLOT(deleteAll()),true); |
283 | mPopupMenu->insertSeparator(); | 283 | mPopupMenu->insertSeparator(); |
284 | QPopupMenu * exportPO = new QPopupMenu ( this ); | 284 | QPopupMenu * exportPO = new QPopupMenu ( this ); |
285 | mPopupMenu->insertItem( i18n("Export selected"), exportPO ); | 285 | mPopupMenu->insertItem( i18n("Export selected"), exportPO ); |
286 | exportPO->insertItem( i18n("As iCal (ics) file..."),this, | 286 | exportPO->insertItem( i18n("As iCal (ics) file..."),this, |
287 | SLOT(saveToFile())); | 287 | SLOT(saveToFile())); |
288 | exportPO->insertItem( i18n("As vCal (vcs) file..."),this, | 288 | exportPO->insertItem( i18n("As vCal (vcs) file..."),this, |
289 | SLOT(saveToFileVCS())); | 289 | SLOT(saveToFileVCS())); |
290 | exportPO->insertItem( i18n("Journal/Details..."),this, | 290 | exportPO->insertItem( i18n("Journal/Details..."),this, |
291 | SLOT(saveDescriptionToFile())); | 291 | SLOT(saveDescriptionToFile())); |
292 | // mPopupMenu->insertSeparator(); | 292 | // mPopupMenu->insertSeparator(); |
293 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 293 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
294 | i18n("Add Categ. to selected..."),this, | 294 | i18n("Add Categ. to selected..."),this, |
295 | SLOT(addCat()),true); | 295 | SLOT(addCat()),true); |
296 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 296 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
@@ -309,64 +309,69 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, | |||
309 | SLOT(beamSelected()),true); | 309 | SLOT(beamSelected()),true); |
310 | #endif | 310 | #endif |
311 | /* | 311 | /* |
312 | mPopupMenu = new QPopupMenu; | 312 | mPopupMenu = new QPopupMenu; |
313 | mPopupMenu->insertItem(i18n("Edit Event"), this, | 313 | mPopupMenu->insertItem(i18n("Edit Event"), this, |
314 | SLOT (editEvent())); | 314 | SLOT (editEvent())); |
315 | mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, | 315 | mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, |
316 | SLOT (deleteEvent())); | 316 | SLOT (deleteEvent())); |
317 | mPopupMenu->insertSeparator(); | 317 | mPopupMenu->insertSeparator(); |
318 | mPopupMenu->insertItem(i18n("Show Dates"), this, | 318 | mPopupMenu->insertItem(i18n("Show Dates"), this, |
319 | SLOT(showDates())); | 319 | SLOT(showDates())); |
320 | mPopupMenu->insertItem(i18n("Hide Dates"), this, | 320 | mPopupMenu->insertItem(i18n("Hide Dates"), this, |
321 | SLOT(hideDates())); | 321 | SLOT(hideDates())); |
322 | */ | 322 | */ |
323 | QObject::connect(mListView,SIGNAL( newEvent()), | 323 | QObject::connect(mListView,SIGNAL( newEvent()), |
324 | this,SIGNAL(signalNewEvent())); | 324 | this,SIGNAL(signalNewEvent())); |
325 | QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), | 325 | QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), |
326 | this,SLOT(defaultItemAction(QListViewItem *))); | 326 | this,SLOT(defaultItemAction(QListViewItem *))); |
327 | QObject::connect(mListView,SIGNAL(rightButtonPressed( QListViewItem *, | 327 | QObject::connect(mListView,SIGNAL(rightButtonPressed( QListViewItem *, |
328 | const QPoint &, int )), | 328 | const QPoint &, int )), |
329 | this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); | 329 | this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); |
330 | QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), | 330 | QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), |
331 | SLOT(processSelectionChange(QListViewItem *))); | 331 | SLOT(processSelectionChange(QListViewItem *))); |
332 | QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), | 332 | QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), |
333 | SIGNAL(showIncidenceSignal(Incidence *)) ); | 333 | SIGNAL(showIncidenceSignal(Incidence *)) ); |
334 | 334 | ||
335 | readSettings(KOGlobals::config(),"KOListView Layout"); | 335 | readSettings(KOGlobals::config(),"KOListView Layout"); |
336 | } | 336 | } |
337 | 337 | ||
338 | KOListView::~KOListView() | 338 | KOListView::~KOListView() |
339 | { | 339 | { |
340 | delete mPopupMenu; | 340 | delete mPopupMenu; |
341 | #if QT_VERSION >= 0x030000 | ||
342 | |||
343 | #else | ||
344 | delete mKOListViewWhatsThis; | ||
345 | #endif | ||
341 | } | 346 | } |
342 | 347 | ||
343 | QString KOListView::getWhatsThisText(QPoint p) | 348 | QString KOListView::getWhatsThisText(QPoint p) |
344 | { | 349 | { |
345 | KOListViewItem* item = ( KOListViewItem* ) mListView->itemAt( p ); | 350 | KOListViewItem* item = ( KOListViewItem* ) mListView->itemAt( p ); |
346 | if ( item ) | 351 | if ( item ) |
347 | return KIncidenceFormatter::instance()->getFormattedText( item->data(), | 352 | return KIncidenceFormatter::instance()->getFormattedText( item->data(), |
348 | KOPrefs::instance()->mWTshowDetails, | 353 | KOPrefs::instance()->mWTshowDetails, |
349 | KOPrefs::instance()->mWTshowCreated, | 354 | KOPrefs::instance()->mWTshowCreated, |
350 | KOPrefs::instance()->mWTshowChanged); | 355 | KOPrefs::instance()->mWTshowChanged); |
351 | return i18n("That is the list view" ); | 356 | return i18n("That is the list view" ); |
352 | 357 | ||
353 | } | 358 | } |
354 | 359 | ||
355 | void KOListView::updateList() | 360 | void KOListView::updateList() |
356 | { | 361 | { |
357 | // qDebug(" KOListView::updateList() "); | 362 | // qDebug(" KOListView::updateList() "); |
358 | 363 | ||
359 | } | 364 | } |
360 | 365 | ||
361 | void KOListView::addCat( ) | 366 | void KOListView::addCat( ) |
362 | { | 367 | { |
363 | setCategories( false ); | 368 | setCategories( false ); |
364 | } | 369 | } |
365 | void KOListView::setCat() | 370 | void KOListView::setCat() |
366 | { | 371 | { |
367 | setCategories( true ); | 372 | setCategories( true ); |
368 | } | 373 | } |
369 | void KOListView::setAlarm() | 374 | void KOListView::setAlarm() |
370 | { | 375 | { |
371 | KOAlarmPrefs kap( this); | 376 | KOAlarmPrefs kap( this); |
372 | if ( !kap.exec() ) | 377 | if ( !kap.exec() ) |
@@ -1152,64 +1157,65 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) | |||
1152 | e->accept(); | 1157 | e->accept(); |
1153 | } | 1158 | } |
1154 | break; | 1159 | break; |
1155 | case Qt::Key_Return: | 1160 | case Qt::Key_Return: |
1156 | case Qt::Key_Enter: | 1161 | case Qt::Key_Enter: |
1157 | { | 1162 | { |
1158 | QListViewItem* cn; | 1163 | QListViewItem* cn; |
1159 | cn = currentItem(); | 1164 | cn = currentItem(); |
1160 | if ( cn ) { | 1165 | if ( cn ) { |
1161 | KOListViewItem* ci = (KOListViewItem*)( cn ); | 1166 | KOListViewItem* ci = (KOListViewItem*)( cn ); |
1162 | if ( ci ){ | 1167 | if ( ci ){ |
1163 | if ( e->state() == ShiftButton ) | 1168 | if ( e->state() == ShiftButton ) |
1164 | ci->setSelected( false ); | 1169 | ci->setSelected( false ); |
1165 | else | 1170 | else |
1166 | ci->setSelected( true ); | 1171 | ci->setSelected( true ); |
1167 | cn = cn->nextSibling(); | 1172 | cn = cn->nextSibling(); |
1168 | if ( cn ) { | 1173 | if ( cn ) { |
1169 | setCurrentItem ( cn ); | 1174 | setCurrentItem ( cn ); |
1170 | ensureItemVisible ( cn ); | 1175 | ensureItemVisible ( cn ); |
1171 | } | 1176 | } |
1172 | } | 1177 | } |
1173 | } | 1178 | } |
1174 | e->accept(); | 1179 | e->accept(); |
1175 | } | 1180 | } |
1176 | break; | 1181 | break; |
1177 | default: | 1182 | default: |
1178 | e->ignore(); | 1183 | e->ignore(); |
1179 | } | 1184 | } |
1180 | } | 1185 | } |
1181 | KOListViewListView::KOListViewListView(KOListView * lv ) | 1186 | KOListViewListView::KOListViewListView(KOListView * lv ) |
1182 | : KListView( lv, "kolistlistview", false ) | 1187 | : KListView( lv, "kolistlistview", false ) |
1183 | { | 1188 | { |
1189 | mYMousePos = 0; | ||
1184 | mPopupTimer = new QTimer(this); | 1190 | mPopupTimer = new QTimer(this); |
1185 | connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); | 1191 | connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); |
1186 | #ifndef DESKTOP_VERSION | 1192 | #ifndef DESKTOP_VERSION |
1187 | //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); | 1193 | //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); |
1188 | #endif | 1194 | #endif |
1189 | setSelectionMode( QListView::Multi ); | 1195 | setSelectionMode( QListView::Multi ); |
1190 | setMultiSelection( true); | 1196 | setMultiSelection( true); |
1191 | } | 1197 | } |
1192 | void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) | 1198 | void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) |
1193 | { | 1199 | { |
1194 | if (!e) return; | 1200 | if (!e) return; |
1195 | QPoint vp = contentsToViewport(e->pos()); | 1201 | QPoint vp = contentsToViewport(e->pos()); |
1196 | QListViewItem *item = itemAt(vp); | 1202 | QListViewItem *item = itemAt(vp); |
1197 | if (!item) { | 1203 | if (!item) { |
1198 | emit newEvent(); | 1204 | emit newEvent(); |
1199 | return; | 1205 | return; |
1200 | } | 1206 | } |
1201 | KListView::contentsMouseDoubleClickEvent(e); | 1207 | KListView::contentsMouseDoubleClickEvent(e); |
1202 | } | 1208 | } |
1203 | #if 0 | 1209 | #if 0 |
1204 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) | 1210 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) |
1205 | { | 1211 | { |
1206 | //qDebug("contentsMousePressEvent++++ "); | 1212 | //qDebug("contentsMousePressEvent++++ "); |
1207 | KListView::contentsMousePressEvent( e ); | 1213 | KListView::contentsMousePressEvent( e ); |
1208 | if ( e->button() == RightButton ) { | 1214 | if ( e->button() == RightButton ) { |
1209 | QListViewItem* ci = currentItem(); | 1215 | QListViewItem* ci = currentItem(); |
1210 | clearSelection () ; | 1216 | clearSelection () ; |
1211 | if ( ci ) | 1217 | if ( ci ) |
1212 | ci->setSelected( true ); | 1218 | ci->setSelected( true ); |
1213 | } | 1219 | } |
1214 | } | 1220 | } |
1215 | void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) | 1221 | void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) |
diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h index eb5bb6e..2051d60 100644 --- a/korganizer/kolistview.h +++ b/korganizer/kolistview.h | |||
@@ -13,65 +13,65 @@ | |||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | GNU General Public License for more details. | 14 | GNU General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU General Public License | 16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | 17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 | 19 | ||
20 | As a special exception, permission is given to link this program | 20 | As a special exception, permission is given to link this program |
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | #ifndef _KOLISTVIEW_H | 24 | #ifndef _KOLISTVIEW_H |
25 | #define _KOLISTVIEW_H | 25 | #define _KOLISTVIEW_H |
26 | 26 | ||
27 | #include <qlistview.h> | 27 | #include <qlistview.h> |
28 | #include <qmap.h> | 28 | #include <qmap.h> |
29 | #include <qdict.h> | 29 | #include <qdict.h> |
30 | 30 | ||
31 | #include <klistview.h> | 31 | #include <klistview.h> |
32 | 32 | ||
33 | #ifndef DESKTOP_VERSION | 33 | #ifndef DESKTOP_VERSION |
34 | #include <qtopia/ir.h> | 34 | #include <qtopia/ir.h> |
35 | #else | 35 | #else |
36 | #define Ir char | 36 | #define Ir char |
37 | #endif | 37 | #endif |
38 | #include <libkcal/incidence.h> | 38 | #include <libkcal/incidence.h> |
39 | 39 | ||
40 | #include "koeventview.h" | 40 | #include "koeventview.h" |
41 | #include "customlistviewitem.h" | 41 | #include "customlistviewitem.h" |
42 | 42 | ||
43 | using namespace KCal; | 43 | using namespace KCal; |
44 | 44 | ||
45 | 45 | class KOListViewWhatsThis; | |
46 | 46 | ||
47 | #include <qpushbutton.h> | 47 | #include <qpushbutton.h> |
48 | #include <qlayout.h> | 48 | #include <qlayout.h> |
49 | #include <qdialog.h> | 49 | #include <qdialog.h> |
50 | #include <qtimer.h> | 50 | #include <qtimer.h> |
51 | #include <qcombobox.h> | 51 | #include <qcombobox.h> |
52 | #include <qspinbox.h> | 52 | #include <qspinbox.h> |
53 | #include <qtooltip.h> | 53 | #include <qtooltip.h> |
54 | #include <qcheckbox.h> | 54 | #include <qcheckbox.h> |
55 | #include <qhbox.h> | 55 | #include <qhbox.h> |
56 | #include <qlabel.h> | 56 | #include <qlabel.h> |
57 | #include <kiconloader.h> | 57 | #include <kiconloader.h> |
58 | #include "kfiledialog.h" | 58 | #include "kfiledialog.h" |
59 | #include "koprefs.h" | 59 | #include "koprefs.h" |
60 | class KOAlarmPrefs : public QDialog | 60 | class KOAlarmPrefs : public QDialog |
61 | { | 61 | { |
62 | Q_OBJECT | 62 | Q_OBJECT |
63 | public: | 63 | public: |
64 | KOAlarmPrefs( QWidget *par=0, const char *name=0 ) : | 64 | KOAlarmPrefs( QWidget *par=0, const char *name=0 ) : |
65 | QDialog( par, name, true ) | 65 | QDialog( par, name, true ) |
66 | { | 66 | { |
67 | setCaption( i18n("Alarm Options") ); | 67 | setCaption( i18n("Alarm Options") ); |
68 | QVBoxLayout* alarmLayout = new QVBoxLayout( this ); | 68 | QVBoxLayout* alarmLayout = new QVBoxLayout( this ); |
69 | alarmLayout->setSpacing( 3 ); | 69 | alarmLayout->setSpacing( 3 ); |
70 | alarmLayout->setMargin( 3 ); | 70 | alarmLayout->setMargin( 3 ); |
71 | QWidget *parent = this; | 71 | QWidget *parent = this; |
72 | mAlarmButton = new QCheckBox(i18n("Set reminder ON with offset to:"),parent); | 72 | mAlarmButton = new QCheckBox(i18n("Set reminder ON with offset to:"),parent); |
73 | alarmLayout->addWidget(mAlarmButton); | 73 | alarmLayout->addWidget(mAlarmButton); |
74 | mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ; | 74 | mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ; |
75 | mAlarmTimeEdit->setValue( 15 ); | 75 | mAlarmTimeEdit->setValue( 15 ); |
76 | alarmLayout->addWidget(mAlarmTimeEdit); | 76 | alarmLayout->addWidget(mAlarmTimeEdit); |
77 | mAlarmIncrCombo = new QComboBox(false, parent); | 77 | mAlarmIncrCombo = new QComboBox(false, parent); |
@@ -271,41 +271,42 @@ class KOListView : public KOEventView | |||
271 | void clearSelection(); | 271 | void clearSelection(); |
272 | void allSelection(); | 272 | void allSelection(); |
273 | 273 | ||
274 | void clear(); | 274 | void clear(); |
275 | void beamDone( Ir *ir ); | 275 | void beamDone( Ir *ir ); |
276 | void showDates(); | 276 | void showDates(); |
277 | void hideDates(); | 277 | void hideDates(); |
278 | void deleteAll(); | 278 | void deleteAll(); |
279 | void saveToFile(); | 279 | void saveToFile(); |
280 | void saveToFileVCS(); | 280 | void saveToFileVCS(); |
281 | void saveDescriptionToFile(); | 281 | void saveDescriptionToFile(); |
282 | void beamSelected(); | 282 | void beamSelected(); |
283 | void updateConfig(); | 283 | void updateConfig(); |
284 | void addCat(); | 284 | void addCat(); |
285 | void setCat(); | 285 | void setCat(); |
286 | void setAlarm(); | 286 | void setAlarm(); |
287 | void setCategories( bool removeOld ); | 287 | void setCategories( bool removeOld ); |
288 | void changeEventDisplay(Event *, int); | 288 | void changeEventDisplay(Event *, int); |
289 | 289 | ||
290 | void defaultItemAction(QListViewItem *item); | 290 | void defaultItemAction(QListViewItem *item); |
291 | void popupMenu(QListViewItem *item,const QPoint &,int); | 291 | void popupMenu(QListViewItem *item,const QPoint &,int); |
292 | 292 | ||
293 | protected slots: | 293 | protected slots: |
294 | void processSelectionChange(QListViewItem *); | 294 | void processSelectionChange(QListViewItem *); |
295 | 295 | ||
296 | protected: | 296 | protected: |
297 | void writeToFile( bool iCal ); | 297 | void writeToFile( bool iCal ); |
298 | void addEvents(QPtrList<Event> eventList); | 298 | void addEvents(QPtrList<Event> eventList); |
299 | void addIncidence(Incidence *); | 299 | void addIncidence(Incidence *); |
300 | KOListViewItem *getItemForEvent(Event *event); | 300 | KOListViewItem *getItemForEvent(Event *event); |
301 | 301 | ||
302 | private: | 302 | private: |
303 | KOListViewWhatsThis *mKOListViewWhatsThis; | ||
303 | KOListViewListView *mListView; | 304 | KOListViewListView *mListView; |
304 | KOEventPopupMenu *mPopupMenu; | 305 | KOEventPopupMenu *mPopupMenu; |
305 | KOListViewItem *mActiveItem; | 306 | KOListViewItem *mActiveItem; |
306 | QDict<Incidence> mUidDict; | 307 | QDict<Incidence> mUidDict; |
307 | QDate mStartDate; | 308 | QDate mStartDate; |
308 | void keyPressEvent ( QKeyEvent * ) ; | 309 | void keyPressEvent ( QKeyEvent * ) ; |
309 | }; | 310 | }; |
310 | 311 | ||
311 | #endif | 312 | #endif |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index ae61db6..7927307 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -60,65 +60,69 @@ | |||
60 | QToolTipGroup *MonthViewCell::mToolTipGroup = 0; | 60 | QToolTipGroup *MonthViewCell::mToolTipGroup = 0; |
61 | #endif | 61 | #endif |
62 | class KNOWhatsThis :public QWhatsThis | 62 | class KNOWhatsThis :public QWhatsThis |
63 | { | 63 | { |
64 | public: | 64 | public: |
65 | KNOWhatsThis( KNoScrollListBox* sbox ) : QWhatsThis( sbox ), _wid( sbox) { }; | 65 | KNOWhatsThis( KNoScrollListBox* sbox ) : QWhatsThis( sbox ), _wid( sbox) { }; |
66 | //~KNOWhatsThis( ) {qDebug("~KNOWhatsThis( ) "); }; | 66 | //~KNOWhatsThis( ) {qDebug("~KNOWhatsThis( ) "); }; |
67 | 67 | ||
68 | protected: | 68 | protected: |
69 | virtual QString text( const QPoint& p) | 69 | virtual QString text( const QPoint& p) |
70 | { | 70 | { |
71 | return _wid->getWhatsThisText(p) ; | 71 | return _wid->getWhatsThisText(p) ; |
72 | }; | 72 | }; |
73 | private: | 73 | private: |
74 | KNoScrollListBox* _wid; | 74 | KNoScrollListBox* _wid; |
75 | 75 | ||
76 | }; | 76 | }; |
77 | 77 | ||
78 | 78 | ||
79 | KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) | 79 | KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) |
80 | : QListBox(parent, name, WRepaintNoErase) | 80 | : QListBox(parent, name, WRepaintNoErase) |
81 | { | 81 | { |
82 | #ifndef DESKTOP_VERSION | 82 | #ifndef DESKTOP_VERSION |
83 | QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); | 83 | QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); |
84 | #endif | 84 | #endif |
85 | mWT = new KNOWhatsThis(this); | 85 | mWT = new KNOWhatsThis(this); |
86 | resetOnFocusIn = true; | 86 | resetOnFocusIn = true; |
87 | setVScrollBarMode(QScrollView::AlwaysOff); | 87 | setVScrollBarMode(QScrollView::AlwaysOff); |
88 | setHScrollBarMode(QScrollView::AlwaysOff); | 88 | setHScrollBarMode(QScrollView::AlwaysOff); |
89 | } | 89 | } |
90 | KNoScrollListBox::~KNoScrollListBox() | 90 | KNoScrollListBox::~KNoScrollListBox() |
91 | { | 91 | { |
92 | 92 | #if QT_VERSION >= 0x030000 | |
93 | |||
94 | #else | ||
95 | delete mWT; | ||
96 | #endif | ||
93 | } | 97 | } |
94 | 98 | ||
95 | 99 | ||
96 | void KNoScrollListBox::focusInEvent ( QFocusEvent * e ) | 100 | void KNoScrollListBox::focusInEvent ( QFocusEvent * e ) |
97 | { | 101 | { |
98 | QListBox::focusInEvent ( e ); | 102 | QListBox::focusInEvent ( e ); |
99 | if ( count() ){ | 103 | if ( count() ){ |
100 | int ci = currentItem(); | 104 | int ci = currentItem(); |
101 | if ( ci < 0 ) ci = 0; | 105 | if ( ci < 0 ) ci = 0; |
102 | 106 | ||
103 | setCurrentItem( ci ); | 107 | setCurrentItem( ci ); |
104 | setSelected ( ci, true ); | 108 | setSelected ( ci, true ); |
105 | emit highlighted( item ( ci ) ); | 109 | emit highlighted( item ( ci ) ); |
106 | 110 | ||
107 | resetOnFocusIn = true; | 111 | resetOnFocusIn = true; |
108 | 112 | ||
109 | if ( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) { | 113 | if ( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) { |
110 | QListBoxItem *fi = firstItem (); | 114 | QListBoxItem *fi = firstItem (); |
111 | if (fi ) { | 115 | if (fi ) { |
112 | int ihei = fi->height( this ); | 116 | int ihei = fi->height( this ); |
113 | int hei = numRows () * ihei; | 117 | int hei = numRows () * ihei; |
114 | if ( hei < height() - horizontalScrollBar()->height () ) { | 118 | if ( hei < height() - horizontalScrollBar()->height () ) { |
115 | setVScrollBarMode(QScrollView::AlwaysOff); | 119 | setVScrollBarMode(QScrollView::AlwaysOff); |
116 | } | 120 | } |
117 | else | 121 | else |
118 | setVScrollBarMode(QScrollView::Auto); | 122 | setVScrollBarMode(QScrollView::Auto); |
119 | if ( ihei *3 > height() ) { | 123 | if ( ihei *3 > height() ) { |
120 | setHScrollBarMode(QScrollView::AlwaysOff); | 124 | setHScrollBarMode(QScrollView::AlwaysOff); |
121 | } | 125 | } |
122 | else { | 126 | else { |
123 | setHScrollBarMode(QScrollView::Auto); | 127 | setHScrollBarMode(QScrollView::Auto); |
124 | } | 128 | } |
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index f26d16d..e95039d 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -559,65 +559,71 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | |||
559 | SLOT( updateView() ) ); | 559 | SLOT( updateView() ) ); |
560 | connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), | 560 | connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), |
561 | SLOT( todoModified(Todo *, int) ) ); | 561 | SLOT( todoModified(Todo *, int) ) ); |
562 | connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), | 562 | connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), |
563 | SLOT( itemStateChanged( QListViewItem * ) ) ); | 563 | SLOT( itemStateChanged( QListViewItem * ) ) ); |
564 | connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), | 564 | connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), |
565 | SLOT( itemStateChanged( QListViewItem * ) ) ); | 565 | SLOT( itemStateChanged( QListViewItem * ) ) ); |
566 | connect( mTodoListView, SIGNAL( paintNeeded() ), | 566 | connect( mTodoListView, SIGNAL( paintNeeded() ), |
567 | SLOT( paintNeeded()) ); | 567 | SLOT( paintNeeded()) ); |
568 | 568 | ||
569 | #if 0 | 569 | #if 0 |
570 | connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), | 570 | connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), |
571 | SLOT(selectionChanged(QListViewItem *))); | 571 | SLOT(selectionChanged(QListViewItem *))); |
572 | connect(mTodoListView,SIGNAL(clicked(QListViewItem *)), | 572 | connect(mTodoListView,SIGNAL(clicked(QListViewItem *)), |
573 | SLOT(selectionChanged(QListViewItem *))); | 573 | SLOT(selectionChanged(QListViewItem *))); |
574 | connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), | 574 | connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), |
575 | SLOT(selectionChanged(QListViewItem *))); | 575 | SLOT(selectionChanged(QListViewItem *))); |
576 | #endif | 576 | #endif |
577 | 577 | ||
578 | connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) )); | 578 | connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) )); |
579 | connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) )); | 579 | connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) )); |
580 | connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) )); | 580 | connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) )); |
581 | 581 | ||
582 | connect( mTodoListView, SIGNAL(selectionChanged() ), | 582 | connect( mTodoListView, SIGNAL(selectionChanged() ), |
583 | SLOT( processSelectionChange() ) ); | 583 | SLOT( processSelectionChange() ) ); |
584 | connect( mQuickAdd, SIGNAL( returnPressed () ), | 584 | connect( mQuickAdd, SIGNAL( returnPressed () ), |
585 | SLOT( addQuickTodo() ) ); | 585 | SLOT( addQuickTodo() ) ); |
586 | 586 | ||
587 | } | 587 | } |
588 | 588 | ||
589 | KOTodoView::~KOTodoView() | 589 | KOTodoView::~KOTodoView() |
590 | { | 590 | { |
591 | // delete mKOTodoViewWhatsThis; | 591 | |
592 | #if QT_VERSION >= 0x030000 | ||
593 | |||
594 | #else | ||
595 | delete mKOTodoViewWhatsThis; | ||
596 | #endif | ||
597 | |||
592 | delete mDocPrefs; | 598 | delete mDocPrefs; |
593 | } | 599 | } |
594 | QString KOTodoView::getWhatsThisText(QPoint p) | 600 | QString KOTodoView::getWhatsThisText(QPoint p) |
595 | { | 601 | { |
596 | KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p ); | 602 | KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p ); |
597 | if ( item ) | 603 | if ( item ) |
598 | return KIncidenceFormatter::instance()->getFormattedText( item->todo(), | 604 | return KIncidenceFormatter::instance()->getFormattedText( item->todo(), |
599 | KOPrefs::instance()->mWTshowDetails, | 605 | KOPrefs::instance()->mWTshowDetails, |
600 | KOPrefs::instance()->mWTshowCreated, | 606 | KOPrefs::instance()->mWTshowCreated, |
601 | KOPrefs::instance()->mWTshowChanged); | 607 | KOPrefs::instance()->mWTshowChanged); |
602 | return i18n("That is the todo view" ); | 608 | return i18n("That is the todo view" ); |
603 | 609 | ||
604 | } | 610 | } |
605 | 611 | ||
606 | void KOTodoView::jumpToDate () | 612 | void KOTodoView::jumpToDate () |
607 | { | 613 | { |
608 | // if (mActiveItem) { | 614 | // if (mActiveItem) { |
609 | // mActiveItem->todo()); | 615 | // mActiveItem->todo()); |
610 | // if ( mActiveItem->todo()->hasDueDate() ) | 616 | // if ( mActiveItem->todo()->hasDueDate() ) |
611 | // emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); | 617 | // emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); |
612 | } | 618 | } |
613 | void KOTodoView::paintNeeded() | 619 | void KOTodoView::paintNeeded() |
614 | { | 620 | { |
615 | if ( mPendingUpdateBeforeRepaint ) { | 621 | if ( mPendingUpdateBeforeRepaint ) { |
616 | updateView(); | 622 | updateView(); |
617 | mPendingUpdateBeforeRepaint = false; | 623 | mPendingUpdateBeforeRepaint = false; |
618 | } | 624 | } |
619 | } | 625 | } |
620 | void KOTodoView::paintEvent(QPaintEvent * pevent) | 626 | void KOTodoView::paintEvent(QPaintEvent * pevent) |
621 | { | 627 | { |
622 | if ( mPendingUpdateBeforeRepaint ) { | 628 | if ( mPendingUpdateBeforeRepaint ) { |
623 | updateView(); | 629 | updateView(); |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 87cef20..68e5e5a 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -561,64 +561,70 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | |||
561 | mView->viewManager()->showTodoView(); | 561 | mView->viewManager()->showTodoView(); |
562 | } | 562 | } |
563 | else if ( msg == "-showJournal" ) { | 563 | else if ( msg == "-showJournal" ) { |
564 | mView->dateNavigator()->selectDates( 1 ); | 564 | mView->dateNavigator()->selectDates( 1 ); |
565 | mView->dateNavigator()->selectToday(); | 565 | mView->dateNavigator()->selectToday(); |
566 | mView->viewManager()->showJournalView(); | 566 | mView->viewManager()->showJournalView(); |
567 | } | 567 | } |
568 | else if ( msg == "-showKO" ) { | 568 | else if ( msg == "-showKO" ) { |
569 | mView->viewManager()->showNextXView(); | 569 | mView->viewManager()->showNextXView(); |
570 | } | 570 | } |
571 | else if ( msg == "-showWNext" ) { | 571 | else if ( msg == "-showWNext" ) { |
572 | mView->viewManager()->showWhatsNextView(); | 572 | mView->viewManager()->showWhatsNextView(); |
573 | } | 573 | } |
574 | else if ( msg == "nextView()" ) { | 574 | else if ( msg == "nextView()" ) { |
575 | mView->viewManager()->showNextView(); | 575 | mView->viewManager()->showNextView(); |
576 | } | 576 | } |
577 | else if ( msg == "-showNextXView" ) { | 577 | else if ( msg == "-showNextXView" ) { |
578 | mView->viewManager()->showNextXView(); | 578 | mView->viewManager()->showNextXView(); |
579 | } | 579 | } |
580 | 580 | ||
581 | 581 | ||
582 | } | 582 | } |
583 | 583 | ||
584 | showMaximized(); | 584 | showMaximized(); |
585 | raise(); | 585 | raise(); |
586 | } | 586 | } |
587 | 587 | ||
588 | QPixmap MainWindow::loadPixmap( QString name ) | 588 | QPixmap MainWindow::loadPixmap( QString name ) |
589 | { | 589 | { |
590 | return SmallIcon( name ); | 590 | return SmallIcon( name ); |
591 | 591 | ||
592 | } | 592 | } |
593 | void MainWindow::setUsesBigPixmaps ( bool b ) | ||
594 | { | ||
595 | qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); | ||
596 | if ( b ) | ||
597 | qDebug("KO: BigPixmaps are not supported "); | ||
598 | } | ||
593 | void MainWindow::initActions() | 599 | void MainWindow::initActions() |
594 | { | 600 | { |
595 | //KOPrefs::instance()->mShowFullMenu | 601 | //KOPrefs::instance()->mShowFullMenu |
596 | iconToolBar->clear(); | 602 | iconToolBar->clear(); |
597 | KOPrefs *p = KOPrefs::instance(); | 603 | KOPrefs *p = KOPrefs::instance(); |
598 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 604 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
599 | 605 | ||
600 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 606 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
601 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 607 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
602 | QPopupMenu *importMenu = new QPopupMenu( this ); | 608 | QPopupMenu *importMenu = new QPopupMenu( this ); |
603 | QPopupMenu *importMenu_X = new QPopupMenu( this ); | 609 | QPopupMenu *importMenu_X = new QPopupMenu( this ); |
604 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); | 610 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); |
605 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); | 611 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); |
606 | selectFilterMenu = new QPopupMenu( this ); | 612 | selectFilterMenu = new QPopupMenu( this ); |
607 | selectFilterMenu->setCheckable( true ); | 613 | selectFilterMenu->setCheckable( true ); |
608 | syncMenu = new QPopupMenu( this ); | 614 | syncMenu = new QPopupMenu( this ); |
609 | configureAgendaMenu = new QPopupMenu( this ); | 615 | configureAgendaMenu = new QPopupMenu( this ); |
610 | configureToolBarMenu = new QPopupMenu( this ); | 616 | configureToolBarMenu = new QPopupMenu( this ); |
611 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 617 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
612 | QIconSet icon; | 618 | QIconSet icon; |
613 | int pixWid = 22, pixHei = 22; | 619 | int pixWid = 22, pixHei = 22; |
614 | QString pathString = ""; | 620 | QString pathString = ""; |
615 | if ( !p->mToolBarMiniIcons ) { | 621 | if ( !p->mToolBarMiniIcons ) { |
616 | if ( QApplication::desktop()->width() < 480 ) { | 622 | if ( QApplication::desktop()->width() < 480 ) { |
617 | pathString += "icons16/"; | 623 | pathString += "icons16/"; |
618 | pixWid = 18; pixHei = 16; | 624 | pixWid = 18; pixHei = 16; |
619 | } | 625 | } |
620 | } else { | 626 | } else { |
621 | pathString += "iconsmini/"; | 627 | pathString += "iconsmini/"; |
622 | pixWid = 18; pixHei = 16; | 628 | pixWid = 18; pixHei = 16; |
623 | } | 629 | } |
624 | if ( KOPrefs::instance()->mShowFullMenu ) { | 630 | if ( KOPrefs::instance()->mShowFullMenu ) { |
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 8fd3d24..6895e36 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -14,64 +14,65 @@ | |||
14 | #ifndef DESKTOP_VERSION | 14 | #ifndef DESKTOP_VERSION |
15 | #include <qcopchannel_qws.h> | 15 | #include <qcopchannel_qws.h> |
16 | #endif | 16 | #endif |
17 | class QAction; | 17 | class QAction; |
18 | class CalendarView; | 18 | class CalendarView; |
19 | class KSyncProfile; | 19 | class KSyncProfile; |
20 | #ifdef DESKTOP_VERSION | 20 | #ifdef DESKTOP_VERSION |
21 | 21 | ||
22 | #define QPEToolBar QToolBar | 22 | #define QPEToolBar QToolBar |
23 | #define QPEMenuBar QMenuBar | 23 | #define QPEMenuBar QMenuBar |
24 | #endif | 24 | #endif |
25 | class QPEToolBar; | 25 | class QPEToolBar; |
26 | class QPEMenuBar; | 26 | class QPEMenuBar; |
27 | 27 | ||
28 | 28 | ||
29 | namespace KCal { | 29 | namespace KCal { |
30 | class CalendarLocal; | 30 | class CalendarLocal; |
31 | } | 31 | } |
32 | 32 | ||
33 | using namespace KCal; | 33 | using namespace KCal; |
34 | 34 | ||
35 | class MainWindow : public QMainWindow | 35 | class MainWindow : public QMainWindow |
36 | { | 36 | { |
37 | Q_OBJECT | 37 | Q_OBJECT |
38 | public: | 38 | public: |
39 | MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); | 39 | MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); |
40 | ~MainWindow(); | 40 | ~MainWindow(); |
41 | bool beamReceiveEnabled(); | 41 | bool beamReceiveEnabled(); |
42 | static QString defaultFileName(); | 42 | static QString defaultFileName(); |
43 | static QString syncFileName(); | 43 | static QString syncFileName(); |
44 | static QString resourcePath(); | 44 | static QString resourcePath(); |
45 | public slots: | 45 | public slots: |
46 | void setUsesBigPixmaps ( bool ); | ||
46 | void setCaption ( const QString & ); | 47 | void setCaption ( const QString & ); |
47 | void updateWeekNum(const KCal::DateList &); | 48 | void updateWeekNum(const KCal::DateList &); |
48 | void updateWeek(QDate); | 49 | void updateWeek(QDate); |
49 | void updateFilterToolbar(); | 50 | void updateFilterToolbar(); |
50 | virtual void showMaximized (); | 51 | virtual void showMaximized (); |
51 | void configureAgenda( int ); | 52 | void configureAgenda( int ); |
52 | void recieve( const QCString& msg, const QByteArray& data ); | 53 | void recieve( const QCString& msg, const QByteArray& data ); |
53 | protected slots: | 54 | protected slots: |
54 | void setCaptionToDates(); | 55 | void setCaptionToDates(); |
55 | void weekAction(); | 56 | void weekAction(); |
56 | void about(); | 57 | void about(); |
57 | void licence(); | 58 | void licence(); |
58 | void faq(); | 59 | void faq(); |
59 | void usertrans(); | 60 | void usertrans(); |
60 | void features(); | 61 | void features(); |
61 | void synchowto(); | 62 | void synchowto(); |
62 | void storagehowto(); | 63 | void storagehowto(); |
63 | void timetrackinghowto(); | 64 | void timetrackinghowto(); |
64 | void kdesynchowto(); | 65 | void kdesynchowto(); |
65 | void multisynchowto(); | 66 | void multisynchowto(); |
66 | void whatsNew(); | 67 | void whatsNew(); |
67 | void keyBindings(); | 68 | void keyBindings(); |
68 | void aboutAutoSaving();; | 69 | void aboutAutoSaving();; |
69 | void aboutKnownBugs(); | 70 | void aboutKnownBugs(); |
70 | 71 | ||
71 | void processIncidenceSelection( Incidence * ); | 72 | void processIncidenceSelection( Incidence * ); |
72 | 73 | ||
73 | void importQtopia(); | 74 | void importQtopia(); |
74 | void importBday(); | 75 | void importBday(); |
75 | void importOL(); | 76 | void importOL(); |
76 | void importIcal(); | 77 | void importIcal(); |
77 | void importFile( QString, bool ); | 78 | void importFile( QString, bool ); |