-rw-r--r-- | core/pim/datebook/datebookday.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/pim/datebook/datebookday.cpp b/core/pim/datebook/datebookday.cpp index 5474cfc..325b902 100644 --- a/core/pim/datebook/datebookday.cpp +++ b/core/pim/datebook/datebookday.cpp | |||
@@ -7,48 +7,49 @@ | |||
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qmessagebox.h> | 20 | #include <qmessagebox.h> |
21 | 21 | ||
22 | #include "datebookday.h" | 22 | #include "datebookday.h" |
23 | #include "datebookdayheaderimpl.h" | 23 | #include "datebookdayheaderimpl.h" |
24 | 24 | ||
25 | #include <qpe/datebookdb.h> | 25 | #include <qpe/datebookdb.h> |
26 | #include <qpe/resource.h> | 26 | #include <qpe/resource.h> |
27 | #include <qpe/event.h> | 27 | #include <qpe/event.h> |
28 | #include <qpe/qpeapplication.h> | 28 | #include <qpe/qpeapplication.h> |
29 | #include <qpe/timestring.h> | 29 | #include <qpe/timestring.h> |
30 | #include <qpe/qpedebug.h> | 30 | #include <qpe/qpedebug.h> |
31 | #include <qpe/ir.h> | ||
31 | 32 | ||
32 | #include <qheader.h> | 33 | #include <qheader.h> |
33 | #include <qdatetime.h> | 34 | #include <qdatetime.h> |
34 | #include <qpainter.h> | 35 | #include <qpainter.h> |
35 | #include <qsimplerichtext.h> | 36 | #include <qsimplerichtext.h> |
36 | #include <qpopupmenu.h> | 37 | #include <qpopupmenu.h> |
37 | #include <qtextcodec.h> | 38 | #include <qtextcodec.h> |
38 | #include <qpalette.h> | 39 | #include <qpalette.h> |
39 | 40 | ||
40 | #include <qtimer.h> | 41 | #include <qtimer.h> |
41 | 42 | ||
42 | DateBookDayView::DateBookDayView( bool whichClock, QWidget *parent, | 43 | DateBookDayView::DateBookDayView( bool whichClock, QWidget *parent, |
43 | const char *name ) | 44 | const char *name ) |
44 | : QTable( 24, 1, parent, name ), | 45 | : QTable( 24, 1, parent, name ), |
45 | ampm( whichClock ) | 46 | ampm( whichClock ) |
46 | { | 47 | { |
47 | enableClipper(TRUE); | 48 | enableClipper(TRUE); |
48 | setTopMargin( 0 ); | 49 | setTopMargin( 0 ); |
49 | horizontalHeader()->hide(); | 50 | horizontalHeader()->hide(); |
50 | setLeftMargin(38); | 51 | setLeftMargin(38); |
51 | setColumnStretchable( 0, TRUE ); | 52 | setColumnStretchable( 0, TRUE ); |
52 | setHScrollBarMode( QScrollView::AlwaysOff ); | 53 | setHScrollBarMode( QScrollView::AlwaysOff ); |
53 | verticalHeader()->setPalette(white); | 54 | verticalHeader()->setPalette(white); |
54 | verticalHeader()->setResizeEnabled(FALSE); | 55 | verticalHeader()->setResizeEnabled(FALSE); |
@@ -701,49 +702,49 @@ void DateBookDayWidget::paintEvent( QPaintEvent *e ) | |||
701 | p.drawPixmap( width() - 16, y, Resource::loadPixmap( "repeat" ) ); | 702 | p.drawPixmap( width() - 16, y, Resource::loadPixmap( "repeat" ) ); |
702 | d = 20; | 703 | d = 20; |
703 | y += 20; | 704 | y += 20; |
704 | } | 705 | } |
705 | 706 | ||
706 | QSimpleRichText rt( text, font() ); | 707 | QSimpleRichText rt( text, font() ); |
707 | rt.setWidth( geom.width() - d - 6 ); | 708 | rt.setWidth( geom.width() - d - 6 ); |
708 | rt.draw( &p, 7, 0, e->region(), colorGroup() ); | 709 | rt.draw( &p, 7, 0, e->region(), colorGroup() ); |
709 | } | 710 | } |
710 | 711 | ||
711 | void DateBookDayWidget::mousePressEvent( QMouseEvent *e ) | 712 | void DateBookDayWidget::mousePressEvent( QMouseEvent *e ) |
712 | { | 713 | { |
713 | DateBookDayWidget *item; | 714 | DateBookDayWidget *item; |
714 | 715 | ||
715 | item = dateBook->getSelectedWidget(); | 716 | item = dateBook->getSelectedWidget(); |
716 | if (item) item->update(); | 717 | if (item) item->update(); |
717 | 718 | ||
718 | dateBook->setSelectedWidget(this); | 719 | dateBook->setSelectedWidget(this); |
719 | update(); | 720 | update(); |
720 | dateBook->repaint(); | 721 | dateBook->repaint(); |
721 | 722 | ||
722 | QPopupMenu m; | 723 | QPopupMenu m; |
723 | m.insertItem( tr( "Edit" ), 1 ); | 724 | m.insertItem( tr( "Edit" ), 1 ); |
724 | m.insertItem( tr( "Delete" ), 2 ); | 725 | m.insertItem( tr( "Delete" ), 2 ); |
725 | m.insertItem( tr( "Beam" ), 3 ); | 726 | if(Ir::supported()) m.insertItem( tr( "Beam" ), 3 ); |
726 | int r = m.exec( e->globalPos() ); | 727 | int r = m.exec( e->globalPos() ); |
727 | if ( r == 1 ) { | 728 | if ( r == 1 ) { |
728 | emit editMe( ev.event() ); | 729 | emit editMe( ev.event() ); |
729 | } else if ( r == 2 ) { | 730 | } else if ( r == 2 ) { |
730 | emit deleteMe( ev.event() ); | 731 | emit deleteMe( ev.event() ); |
731 | } else if ( r == 3 ) { | 732 | } else if ( r == 3 ) { |
732 | emit beamMe( ev.event() ); | 733 | emit beamMe( ev.event() ); |
733 | } | 734 | } |
734 | } | 735 | } |
735 | 736 | ||
736 | void DateBookDayWidget::setGeometry( const QRect &r ) | 737 | void DateBookDayWidget::setGeometry( const QRect &r ) |
737 | { | 738 | { |
738 | geom = r; | 739 | geom = r; |
739 | setFixedSize( r.width()+1, r.height()+1 ); | 740 | setFixedSize( r.width()+1, r.height()+1 ); |
740 | dateBook->dayView()->moveChild( this, r.x(), r.y()-1 ); | 741 | dateBook->dayView()->moveChild( this, r.x(), r.y()-1 ); |
741 | show(); | 742 | show(); |
742 | } | 743 | } |
743 | 744 | ||
744 | 745 | ||
745 | //--------------------------------------------------------------------------------------------- | 746 | //--------------------------------------------------------------------------------------------- |
746 | //--------------------------------------------------------------------------------------------- | 747 | //--------------------------------------------------------------------------------------------- |
747 | 748 | ||
748 | 749 | ||
749 | DateBookDayTimeMarker::DateBookDayTimeMarker( DateBookDay *db ) | 750 | DateBookDayTimeMarker::DateBookDayTimeMarker( DateBookDay *db ) |