author | zecke <zecke> | 2004-03-14 18:58:59 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-14 18:58:59 (UTC) |
commit | d91c046d1faaf9fb039bda5cc186c96d4ff2c227 (patch) (unidiff) | |
tree | c196f20c933d46cc913c9460f02ce3274bd21fc9 | |
parent | ddfee0836adbd62be48888fbe05e7a79481e81c9 (diff) | |
download | opie-d91c046d1faaf9fb039bda5cc186c96d4ff2c227.zip opie-d91c046d1faaf9fb039bda5cc186c96d4ff2c227.tar.gz opie-d91c046d1faaf9fb039bda5cc186c96d4ff2c227.tar.bz2 |
Opie DP changes
-rw-r--r-- | core/pim/datebook/config.in | 2 | ||||
-rw-r--r-- | core/pim/datebook/datebook.pro | 2 | ||||
-rw-r--r-- | core/pim/datebook/datebookweeklst.cpp | 1 | ||||
-rw-r--r-- | core/pim/datebook/datebookweeklst.h | 4 | ||||
-rw-r--r-- | core/pim/datebook/dateentryimpl.cpp | 2 | ||||
-rw-r--r-- | core/pim/datebook/main.cpp | 3 |
6 files changed, 8 insertions, 6 deletions
diff --git a/core/pim/datebook/config.in b/core/pim/datebook/config.in index aa3e8fc..dd9c798 100644 --- a/core/pim/datebook/config.in +++ b/core/pim/datebook/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config DATEBOOK | 1 | config DATEBOOK |
2 | boolean "opie-datebook (a datebook/appointment manager)" | 2 | boolean "opie-datebook (a datebook/appointment manager)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIEUI2 |
diff --git a/core/pim/datebook/datebook.pro b/core/pim/datebook/datebook.pro index f3b5a59..2b2efaa 100644 --- a/core/pim/datebook/datebook.pro +++ b/core/pim/datebook/datebook.pro | |||
@@ -1,40 +1,40 @@ | |||
1 | CONFIG += qt warn_on release quick-app | 1 | CONFIG += qt warn_on release quick-app |
2 | HEADERS= datebookday.h \ | 2 | HEADERS= datebookday.h \ |
3 | datebook.h \ | 3 | datebook.h \ |
4 | dateentryimpl.h \ | 4 | dateentryimpl.h \ |
5 | datebookdayheaderimpl.h \ | 5 | datebookdayheaderimpl.h \ |
6 | datebooksettings.h \ | 6 | datebooksettings.h \ |
7 | datebookweek.h \ | 7 | datebookweek.h \ |
8 | datebookweeklst.h \ | 8 | datebookweeklst.h \ |
9 | datebookweekheaderimpl.h \ | 9 | datebookweekheaderimpl.h \ |
10 | repeatentry.h \ | 10 | repeatentry.h \ |
11 | noteentryimpl.h \ | 11 | noteentryimpl.h \ |
12 | onoteedit.h \ | 12 | onoteedit.h \ |
13 | datebookdayallday.h | 13 | datebookdayallday.h |
14 | SOURCES= main.cpp \ | 14 | SOURCES= main.cpp \ |
15 | datebookday.cpp \ | 15 | datebookday.cpp \ |
16 | datebook.cpp \ | 16 | datebook.cpp \ |
17 | dateentryimpl.cpp \ | 17 | dateentryimpl.cpp \ |
18 | datebookdayheaderimpl.cpp \ | 18 | datebookdayheaderimpl.cpp \ |
19 | datebooksettings.cpp \ | 19 | datebooksettings.cpp \ |
20 | datebookweek.cpp \ | 20 | datebookweek.cpp \ |
21 | datebookweeklst.cpp \ | 21 | datebookweeklst.cpp \ |
22 | datebookweekheaderimpl.cpp \ | 22 | datebookweekheaderimpl.cpp \ |
23 | repeatentry.cpp \ | 23 | repeatentry.cpp \ |
24 | noteentryimpl.cpp \ | 24 | noteentryimpl.cpp \ |
25 | onoteedit.cpp \ | 25 | onoteedit.cpp \ |
26 | datebookdayallday.cpp | 26 | datebookdayallday.cpp |
27 | INTERFACES= dateentry.ui \ | 27 | INTERFACES= dateentry.ui \ |
28 | datebookdayheader.ui \ | 28 | datebookdayheader.ui \ |
29 | datebookweekheader.ui \ | 29 | datebookweekheader.ui \ |
30 | datebookweeklstheader.ui \ | 30 | datebookweeklstheader.ui \ |
31 | datebookweeklstdayhdr.ui \ | 31 | datebookweeklstdayhdr.ui \ |
32 | repeatentrybase.ui \ | 32 | repeatentrybase.ui \ |
33 | datebooksettingsbase.ui \ | 33 | datebooksettingsbase.ui \ |
34 | noteentry.ui | 34 | noteentry.ui |
35 | INCLUDEPATH += $(OPIEDIR)/include | 35 | INCLUDEPATH += $(OPIEDIR)/include |
36 | DEPENDPATH+= $(OPIEDIR)/include | 36 | DEPENDPATH+= $(OPIEDIR)/include |
37 | LIBS += -lqpe -lopie | 37 | LIBS += -lqpe -lopieui2 |
38 | TARGET = datebook | 38 | TARGET = datebook |
39 | 39 | ||
40 | include ( $(OPIEDIR)/include.pro ) | 40 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/core/pim/datebook/datebookweeklst.cpp b/core/pim/datebook/datebookweeklst.cpp index af40143..30c925d 100644 --- a/core/pim/datebook/datebookweeklst.cpp +++ b/core/pim/datebook/datebookweeklst.cpp | |||
@@ -1,79 +1,80 @@ | |||
1 | #include "datebookweeklst.h" | 1 | #include "datebookweeklst.h" |
2 | 2 | ||
3 | 3 | ||
4 | #include "datebook.h" | 4 | #include "datebook.h" |
5 | 5 | ||
6 | #include <qpe/datebookmonth.h> | 6 | #include <qpe/datebookmonth.h> |
7 | #include <qpe/config.h> | 7 | #include <qpe/config.h> |
8 | #include <qpe/resource.h> | 8 | #include <qpe/resource.h> |
9 | 9 | ||
10 | #include <qlayout.h> | 10 | #include <qlayout.h> |
11 | #include <qtoolbutton.h> | 11 | #include <qtoolbutton.h> |
12 | #include <qtl.h> | 12 | #include <qtl.h> |
13 | 13 | ||
14 | bool calcWeek(const QDate &d, int &week, int &year,bool startOnMonday = false); | 14 | bool calcWeek(const QDate &d, int &week, int &year,bool startOnMonday = false); |
15 | 15 | ||
16 | using namespace Opie::Ui; | ||
16 | DateBookWeekLstHeader::DateBookWeekLstHeader(bool onM, QWidget* parent, const char* name, WFlags fl) | 17 | DateBookWeekLstHeader::DateBookWeekLstHeader(bool onM, QWidget* parent, const char* name, WFlags fl) |
17 | : DateBookWeekLstHeaderBase(parent, name, fl) | 18 | : DateBookWeekLstHeaderBase(parent, name, fl) |
18 | { | 19 | { |
19 | setBackgroundMode( PaletteButton ); | 20 | setBackgroundMode( PaletteButton ); |
20 | labelDate->setBackgroundMode( PaletteButton ); | 21 | labelDate->setBackgroundMode( PaletteButton ); |
21 | forwardweek->setBackgroundMode( PaletteButton ); | 22 | forwardweek->setBackgroundMode( PaletteButton ); |
22 | forwardweek->setPixmap( Resource::loadPixmap("forward") ); | 23 | forwardweek->setPixmap( Resource::loadPixmap("forward") ); |
23 | forwardmonth->setBackgroundMode( PaletteButton ); | 24 | forwardmonth->setBackgroundMode( PaletteButton ); |
24 | forwardmonth->setPixmap( Resource::loadPixmap("fastforward") ); | 25 | forwardmonth->setPixmap( Resource::loadPixmap("fastforward") ); |
25 | backweek->setBackgroundMode( PaletteButton ); | 26 | backweek->setBackgroundMode( PaletteButton ); |
26 | backweek->setPixmap( Resource::loadPixmap("back") ); | 27 | backweek->setPixmap( Resource::loadPixmap("back") ); |
27 | backmonth->setBackgroundMode( PaletteButton ); | 28 | backmonth->setBackgroundMode( PaletteButton ); |
28 | backmonth->setPixmap( Resource::loadPixmap("fastback") ); | 29 | backmonth->setPixmap( Resource::loadPixmap("fastback") ); |
29 | DateBookWeekLstHeaderBaseLayout->setSpacing(0); | 30 | DateBookWeekLstHeaderBaseLayout->setSpacing(0); |
30 | DateBookWeekLstHeaderBaseLayout->setMargin(0); | 31 | DateBookWeekLstHeaderBaseLayout->setMargin(0); |
31 | //setSizePolicy(QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding)); | 32 | //setSizePolicy(QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding)); |
32 | setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); | 33 | setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); |
33 | 34 | ||
34 | connect(backmonth, SIGNAL(clicked()), this, SLOT(prevMonth())); | 35 | connect(backmonth, SIGNAL(clicked()), this, SLOT(prevMonth())); |
35 | connect(backweek, SIGNAL(clicked()), this, SLOT(prevWeek())); | 36 | connect(backweek, SIGNAL(clicked()), this, SLOT(prevWeek())); |
36 | connect(forwardweek, SIGNAL(clicked()), this, SLOT(nextWeek())); | 37 | connect(forwardweek, SIGNAL(clicked()), this, SLOT(nextWeek())); |
37 | connect(forwardmonth, SIGNAL(clicked()), this, SLOT(nextMonth())); | 38 | connect(forwardmonth, SIGNAL(clicked()), this, SLOT(nextMonth())); |
38 | connect(labelDate, SIGNAL(clicked()), this, SLOT(pickDate())); | 39 | connect(labelDate, SIGNAL(clicked()), this, SLOT(pickDate())); |
39 | connect(dbl, SIGNAL(toggled(bool)), this, SIGNAL(setDbl(bool))); | 40 | connect(dbl, SIGNAL(toggled(bool)), this, SIGNAL(setDbl(bool))); |
40 | bStartOnMonday=onM; | 41 | bStartOnMonday=onM; |
41 | } | 42 | } |
42 | DateBookWeekLstHeader::~DateBookWeekLstHeader(){} | 43 | DateBookWeekLstHeader::~DateBookWeekLstHeader(){} |
43 | 44 | ||
44 | void DateBookWeekLstHeader::setDate(const QDate &d) { | 45 | void DateBookWeekLstHeader::setDate(const QDate &d) { |
45 | int year,week,dayofweek; | 46 | int year,week,dayofweek; |
46 | date=d; | 47 | date=d; |
47 | dayofweek=d.dayOfWeek(); | 48 | dayofweek=d.dayOfWeek(); |
48 | if(bStartOnMonday) | 49 | if(bStartOnMonday) |
49 | dayofweek--; | 50 | dayofweek--; |
50 | else if( dayofweek == 7 ) | 51 | else if( dayofweek == 7 ) |
51 | /* we already have the right day -7 would lead to the same week */ | 52 | /* we already have the right day -7 would lead to the same week */ |
52 | dayofweek = 0; | 53 | dayofweek = 0; |
53 | 54 | ||
54 | date=date.addDays(-dayofweek); | 55 | date=date.addDays(-dayofweek); |
55 | 56 | ||
56 | calcWeek(date,week,year,bStartOnMonday); | 57 | calcWeek(date,week,year,bStartOnMonday); |
57 | QDate start=date; | 58 | QDate start=date; |
58 | QDate stop=start.addDays(6); | 59 | QDate stop=start.addDays(6); |
59 | labelDate->setText( QString::number(start.day()) + "." + | 60 | labelDate->setText( QString::number(start.day()) + "." + |
60 | Calendar::nameOfMonth( start.month() ) + "-" + | 61 | Calendar::nameOfMonth( start.month() ) + "-" + |
61 | QString::number(stop.day()) + "." + | 62 | QString::number(stop.day()) + "." + |
62 | Calendar::nameOfMonth( stop.month()) +" ("+ | 63 | Calendar::nameOfMonth( stop.month()) +" ("+ |
63 | tr("w")+":"+QString::number( week ) +")"); | 64 | tr("w")+":"+QString::number( week ) +")"); |
64 | date = d; // bugfix: 0001126 - date has to be the selected date, not monday! | 65 | date = d; // bugfix: 0001126 - date has to be the selected date, not monday! |
65 | emit dateChanged(date); | 66 | emit dateChanged(date); |
66 | } | 67 | } |
67 | 68 | ||
68 | void DateBookWeekLstHeader::pickDate() { | 69 | void DateBookWeekLstHeader::pickDate() { |
69 | static QPopupMenu *m1 = 0; | 70 | static QPopupMenu *m1 = 0; |
70 | static DateBookMonth *picker = 0; | 71 | static DateBookMonth *picker = 0; |
71 | if ( !m1 ) { | 72 | if ( !m1 ) { |
72 | m1 = new QPopupMenu( this ); | 73 | m1 = new QPopupMenu( this ); |
73 | picker = new DateBookMonth( m1, 0, TRUE ); | 74 | picker = new DateBookMonth( m1, 0, TRUE ); |
74 | m1->insertItem( picker ); | 75 | m1->insertItem( picker ); |
75 | connect( picker, SIGNAL( dateClicked(int,int,int) ),this, SLOT( setDate(int,int,int) ) ); | 76 | connect( picker, SIGNAL( dateClicked(int,int,int) ),this, SLOT( setDate(int,int,int) ) ); |
76 | //connect( m1, SIGNAL( aboutToHide() ), | 77 | //connect( m1, SIGNAL( aboutToHide() ), |
77 | //this, SLOT( gotHide() ) ); | 78 | //this, SLOT( gotHide() ) ); |
78 | } | 79 | } |
79 | picker->setDate( date.year(), date.month(), date.day() ); | 80 | picker->setDate( date.year(), date.month(), date.day() ); |
diff --git a/core/pim/datebook/datebookweeklst.h b/core/pim/datebook/datebookweeklst.h index f683ce7..32fa23f 100644 --- a/core/pim/datebook/datebookweeklst.h +++ b/core/pim/datebook/datebookweeklst.h | |||
@@ -1,125 +1,125 @@ | |||
1 | #ifndef DATEBOOKWEEKLST | 1 | #ifndef DATEBOOKWEEKLST |
2 | #define DATEBOOKWEEKLST | 2 | #define DATEBOOKWEEKLST |
3 | 3 | ||
4 | #include <qwidget.h> | 4 | #include <qwidget.h> |
5 | #include <qdatetime.h> | 5 | #include <qdatetime.h> |
6 | #include <qpe/event.h> | 6 | #include <qpe/event.h> |
7 | #include <qlabel.h> | 7 | #include <qlabel.h> |
8 | #include <qscrollview.h> | 8 | #include <qscrollview.h> |
9 | 9 | ||
10 | #include "datebookweeklstheader.h" | 10 | #include "datebookweeklstheader.h" |
11 | #include "datebookweeklstdayhdr.h" | 11 | #include "datebookweeklstdayhdr.h" |
12 | 12 | ||
13 | #include <opie/oclickablelabel.h> | 13 | #include <opie2/oclickablelabel.h> |
14 | 14 | ||
15 | class QDateTime; | 15 | class QDateTime; |
16 | class DateBookDB; | 16 | class DateBookDB; |
17 | 17 | ||
18 | class DateBookWeekLstHeader: public DateBookWeekLstHeaderBase | 18 | class DateBookWeekLstHeader: public DateBookWeekLstHeaderBase |
19 | { | 19 | { |
20 | Q_OBJECT | 20 | Q_OBJECT |
21 | public: | 21 | public: |
22 | DateBookWeekLstHeader(bool onM, QWidget* parent = 0, const char* name = 0, | 22 | DateBookWeekLstHeader(bool onM, QWidget* parent = 0, const char* name = 0, |
23 | WFlags fl = 0 ); | 23 | WFlags fl = 0 ); |
24 | ~DateBookWeekLstHeader(); | 24 | ~DateBookWeekLstHeader(); |
25 | void setDate(const QDate &d); | 25 | void setDate(const QDate &d); |
26 | 26 | ||
27 | public slots: | 27 | public slots: |
28 | void nextWeek(); | 28 | void nextWeek(); |
29 | void prevWeek(); | 29 | void prevWeek(); |
30 | void nextMonth(); | 30 | void nextMonth(); |
31 | void prevMonth(); | 31 | void prevMonth(); |
32 | void pickDate(); | 32 | void pickDate(); |
33 | void setDate(int y, int m, int d); | 33 | void setDate(int y, int m, int d); |
34 | signals: | 34 | signals: |
35 | void dateChanged(QDate &newdate); | 35 | void dateChanged(QDate &newdate); |
36 | void setDbl(bool on); | 36 | void setDbl(bool on); |
37 | private: | 37 | private: |
38 | QDate date; | 38 | QDate date; |
39 | //bool onMonday; | 39 | //bool onMonday; |
40 | bool bStartOnMonday; | 40 | bool bStartOnMonday; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | class DateBookWeekLstDayHdr: public DateBookWeekLstDayHdrBase | 43 | class DateBookWeekLstDayHdr: public DateBookWeekLstDayHdrBase |
44 | { | 44 | { |
45 | Q_OBJECT | 45 | Q_OBJECT |
46 | public: | 46 | public: |
47 | DateBookWeekLstDayHdr(const QDate &d, bool onM, | 47 | DateBookWeekLstDayHdr(const QDate &d, bool onM, |
48 | QWidget* parent = 0, const char* name = 0, | 48 | QWidget* parent = 0, const char* name = 0, |
49 | WFlags fl = 0 ); | 49 | WFlags fl = 0 ); |
50 | public slots: | 50 | public slots: |
51 | void showDay(); | 51 | void showDay(); |
52 | void newEvent(); | 52 | void newEvent(); |
53 | signals: | 53 | signals: |
54 | void showDate(int y, int m, int d); | 54 | void showDate(int y, int m, int d); |
55 | void addEvent(const QDateTime &start, const QDateTime &stop, | 55 | void addEvent(const QDateTime &start, const QDateTime &stop, |
56 | const QString &str, const QString &location); | 56 | const QString &str, const QString &location); |
57 | private: | 57 | private: |
58 | QDate date; | 58 | QDate date; |
59 | }; | 59 | }; |
60 | 60 | ||
61 | class DateBookWeekLstEvent: public OClickableLabel | 61 | class DateBookWeekLstEvent: public Opie::Ui::OClickableLabel |
62 | { | 62 | { |
63 | Q_OBJECT | 63 | Q_OBJECT |
64 | public: | 64 | public: |
65 | DateBookWeekLstEvent(const EffectiveEvent &ev, int weeklistviewconfig =1, | 65 | DateBookWeekLstEvent(const EffectiveEvent &ev, int weeklistviewconfig =1, |
66 | QWidget* parent = 0, const char* name = 0, | 66 | QWidget* parent = 0, const char* name = 0, |
67 | WFlags fl = 0); | 67 | WFlags fl = 0); |
68 | signals: | 68 | signals: |
69 | void editEvent(const Event &e); | 69 | void editEvent(const Event &e); |
70 | private slots: | 70 | private slots: |
71 | void editMe(); | 71 | void editMe(); |
72 | private: | 72 | private: |
73 | const EffectiveEvent event; | 73 | const EffectiveEvent event; |
74 | }; | 74 | }; |
75 | 75 | ||
76 | class DateBookWeekLstView: public QWidget | 76 | class DateBookWeekLstView: public QWidget |
77 | { | 77 | { |
78 | Q_OBJECT | 78 | Q_OBJECT |
79 | public: | 79 | public: |
80 | DateBookWeekLstView(QValueList<EffectiveEvent> &ev, const QDate &d, bool onM, | 80 | DateBookWeekLstView(QValueList<EffectiveEvent> &ev, const QDate &d, bool onM, |
81 | QWidget* parent = 0, const char* name = 0, | 81 | QWidget* parent = 0, const char* name = 0, |
82 | WFlags fl = 0 ); | 82 | WFlags fl = 0 ); |
83 | ~DateBookWeekLstView(); | 83 | ~DateBookWeekLstView(); |
84 | signals: | 84 | signals: |
85 | void editEvent(const Event &e); | 85 | void editEvent(const Event &e); |
86 | void showDate(int y, int m, int d); | 86 | void showDate(int y, int m, int d); |
87 | void addEvent(const QDateTime &start, const QDateTime &stop, | 87 | void addEvent(const QDateTime &start, const QDateTime &stop, |
88 | const QString &str, const QString &location); | 88 | const QString &str, const QString &location); |
89 | private: | 89 | private: |
90 | bool bStartOnMonday; | 90 | bool bStartOnMonday; |
91 | protected slots: | 91 | protected slots: |
92 | void keyPressEvent(QKeyEvent *); | 92 | void keyPressEvent(QKeyEvent *); |
93 | }; | 93 | }; |
94 | 94 | ||
95 | class DateBookWeekLstDblView: public QWidget { | 95 | class DateBookWeekLstDblView: public QWidget { |
96 | Q_OBJECT | 96 | Q_OBJECT |
97 | public: | 97 | public: |
98 | DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, | 98 | DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, |
99 | QValueList<EffectiveEvent> &ev2, | 99 | QValueList<EffectiveEvent> &ev2, |
100 | QDate &d, bool onM, | 100 | QDate &d, bool onM, |
101 | QWidget* parent = 0, const char* name = 0, | 101 | QWidget* parent = 0, const char* name = 0, |
102 | WFlags fl = 0 ); | 102 | WFlags fl = 0 ); |
103 | signals: | 103 | signals: |
104 | void editEvent(const Event &e); | 104 | void editEvent(const Event &e); |
105 | void showDate(int y, int m, int d); | 105 | void showDate(int y, int m, int d); |
106 | void addEvent(const QDateTime &start, const QDateTime &stop, | 106 | void addEvent(const QDateTime &start, const QDateTime &stop, |
107 | const QString &str, const QString &location); | 107 | const QString &str, const QString &location); |
108 | }; | 108 | }; |
109 | 109 | ||
110 | class DateBookWeekLst : public QWidget | 110 | class DateBookWeekLst : public QWidget |
111 | { | 111 | { |
112 | Q_OBJECT | 112 | Q_OBJECT |
113 | 113 | ||
114 | public: | 114 | public: |
115 | DateBookWeekLst( bool ampm, bool onM, DateBookDB *newDB, | 115 | DateBookWeekLst( bool ampm, bool onM, DateBookDB *newDB, |
116 | QWidget *parent = 0, | 116 | QWidget *parent = 0, |
117 | const char *name = 0 ); | 117 | const char *name = 0 ); |
118 | ~DateBookWeekLst(); | 118 | ~DateBookWeekLst(); |
119 | void setDate( int y, int w ); | 119 | void setDate( int y, int w ); |
120 | void setDate(const QDate &d ); | 120 | void setDate(const QDate &d ); |
121 | int week() const { return _week; }; | 121 | int week() const { return _week; }; |
122 | QDate date(); | 122 | QDate date(); |
123 | QDate weekDate() const; | 123 | QDate weekDate() const; |
124 | 124 | ||
125 | public slots: | 125 | public slots: |
diff --git a/core/pim/datebook/dateentryimpl.cpp b/core/pim/datebook/dateentryimpl.cpp index 57bcd89..dbff18f 100644 --- a/core/pim/datebook/dateentryimpl.cpp +++ b/core/pim/datebook/dateentryimpl.cpp | |||
@@ -1,96 +1,96 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
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 | 20 | ||
21 | #include "dateentryimpl.h" | 21 | #include "dateentryimpl.h" |
22 | #include "repeatentry.h" | 22 | #include "repeatentry.h" |
23 | 23 | ||
24 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
25 | #include <qpe/categoryselect.h> | 25 | #include <qpe/categoryselect.h> |
26 | #include <qpe/datebookmonth.h> | 26 | #include <qpe/datebookmonth.h> |
27 | #include <qpe/tzselect.h> | 27 | #include <qpe/tzselect.h> |
28 | 28 | ||
29 | #include <qlineedit.h> | 29 | #include <qlineedit.h> |
30 | #include <qspinbox.h> | 30 | #include <qspinbox.h> |
31 | 31 | ||
32 | #include <opie/otimepicker.h> | 32 | #include <opie2/otimepicker.h> |
33 | #include "onoteedit.h" | 33 | #include "onoteedit.h" |
34 | 34 | ||
35 | #include <stdlib.h> | 35 | #include <stdlib.h> |
36 | #include <stdio.h> | 36 | #include <stdio.h> |
37 | 37 | ||
38 | /* | 38 | /* |
39 | * Constructs a DateEntry which is a child of 'parent', with the | 39 | * Constructs a DateEntry which is a child of 'parent', with the |
40 | * name 'name' and widget flags set to 'f' | 40 | * name 'name' and widget flags set to 'f' |
41 | * | 41 | * |
42 | * The dialog will by default be modeless, unless you set 'modal' to | 42 | * The dialog will by default be modeless, unless you set 'modal' to |
43 | * TRUE to construct a modal dialog. | 43 | * TRUE to construct a modal dialog. |
44 | */ | 44 | */ |
45 | 45 | ||
46 | DateEntry::DateEntry( bool startOnMonday, const QDateTime &start, | 46 | DateEntry::DateEntry( bool startOnMonday, const QDateTime &start, |
47 | const QDateTime &end, bool whichClock, QWidget* parent, | 47 | const QDateTime &end, bool whichClock, QWidget* parent, |
48 | const char* name ) | 48 | const char* name ) |
49 | : DateEntryBase( parent, name ), | 49 | : DateEntryBase( parent, name ), |
50 | ampm( whichClock ), | 50 | ampm( whichClock ), |
51 | startWeekOnMonday( startOnMonday ), | 51 | startWeekOnMonday( startOnMonday ), |
52 | m_showStart(true) | 52 | m_showStart(true) |
53 | { | 53 | { |
54 | init(); | 54 | init(); |
55 | setDates(start,end); | 55 | setDates(start,end); |
56 | setFocusProxy(comboDescription); | 56 | setFocusProxy(comboDescription); |
57 | } | 57 | } |
58 | 58 | ||
59 | bool DateEntry::eventFilter(QObject *obj, QEvent *ev ) | 59 | bool DateEntry::eventFilter(QObject *obj, QEvent *ev ) |
60 | { | 60 | { |
61 | if( ev->type() == QEvent::FocusIn ){ | 61 | if( ev->type() == QEvent::FocusIn ){ |
62 | if( obj == comboStart ){ | 62 | if( obj == comboStart ){ |
63 | timePickerStart->setHour(startTime.hour()); | 63 | timePickerStart->setHour(startTime.hour()); |
64 | timePickerStart->setMinute(startTime.minute()); | 64 | timePickerStart->setMinute(startTime.minute()); |
65 | TimePickerLabel->setText( tr("Start Time" ) ); | 65 | TimePickerLabel->setText( tr("Start Time" ) ); |
66 | m_showStart= true; | 66 | m_showStart= true; |
67 | }else if( obj == comboEnd ){ | 67 | }else if( obj == comboEnd ){ |
68 | timePickerStart->setHour(endTime.hour()); | 68 | timePickerStart->setHour(endTime.hour()); |
69 | timePickerStart->setMinute(endTime.minute()); | 69 | timePickerStart->setMinute(endTime.minute()); |
70 | TimePickerLabel->setText( tr("End Time") ); | 70 | TimePickerLabel->setText( tr("End Time") ); |
71 | m_showStart = false; | 71 | m_showStart = false; |
72 | } | 72 | } |
73 | } else if( ev->type() == QEvent::FocusOut ){ | 73 | } else if( ev->type() == QEvent::FocusOut ){ |
74 | // if( obj == comboEnd ){ | 74 | // if( obj == comboEnd ){ |
75 | // QString s; | 75 | // QString s; |
76 | // s.sprintf("%.2d:%.2d",endTime.hour(), endTime.minute()); | 76 | // s.sprintf("%.2d:%.2d",endTime.hour(), endTime.minute()); |
77 | // comboEnd->setText(s); | 77 | // comboEnd->setText(s); |
78 | // } | 78 | // } |
79 | // else if( obj == comboStart ){ | 79 | // else if( obj == comboStart ){ |
80 | // QString s; | 80 | // QString s; |
81 | // s.sprintf("%.2d:%.2d",startTime.hour(), startTime.minute()); | 81 | // s.sprintf("%.2d:%.2d",startTime.hour(), startTime.minute()); |
82 | // comboStart->setText(s); | 82 | // comboStart->setText(s); |
83 | // } | 83 | // } |
84 | } | 84 | } |
85 | 85 | ||
86 | return false; | 86 | return false; |
87 | } | 87 | } |
88 | 88 | ||
89 | static void addOrPick( QComboBox* combo, const QString& t ) | 89 | static void addOrPick( QComboBox* combo, const QString& t ) |
90 | { | 90 | { |
91 | // Pick an item if one excists | 91 | // Pick an item if one excists |
92 | for (int i=0; i<combo->count(); i++) { | 92 | for (int i=0; i<combo->count(); i++) { |
93 | if ( combo->text(i) == t ) { | 93 | if ( combo->text(i) == t ) { |
94 | combo->setCurrentItem(i); | 94 | combo->setCurrentItem(i); |
95 | return; | 95 | return; |
96 | } | 96 | } |
diff --git a/core/pim/datebook/main.cpp b/core/pim/datebook/main.cpp index 421e457..3cb60af 100644 --- a/core/pim/datebook/main.cpp +++ b/core/pim/datebook/main.cpp | |||
@@ -1,24 +1,25 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
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 | 20 | ||
21 | #include "datebook.h" | 21 | #include "datebook.h" |
22 | #include <opie/oapplicationfactory.h> | 22 | #include <opie2/oapplicationfactory.h> |
23 | 23 | ||
24 | using namespace Opie::Core; | ||
24 | OPIE_EXPORT_APP( OApplicationFactory<DateBook> ) | 25 | OPIE_EXPORT_APP( OApplicationFactory<DateBook> ) |