author | hakan <hakan> | 2002-05-07 10:43:49 (UTC) |
---|---|---|
committer | hakan <hakan> | 2002-05-07 10:43:49 (UTC) |
commit | cfe30703da090180b66bc571e85654c71a7ee8e0 (patch) (unidiff) | |
tree | d6954140f2208becb9a6beb5b8a21529bfd5bceb | |
parent | c9849cc04b668f1cda7a16d868299c436d1de042 (diff) | |
download | opie-cfe30703da090180b66bc571e85654c71a7ee8e0.zip opie-cfe30703da090180b66bc571e85654c71a7ee8e0.tar.gz opie-cfe30703da090180b66bc571e85654c71a7ee8e0.tar.bz2 |
Moved ClickableLabel to libopie/OClickableLabel
-rw-r--r-- | core/pim/datebook/datebook.pro | 4 | ||||
-rw-r--r-- | core/pim/datebook/datebookweeklst.cpp | 2 | ||||
-rw-r--r-- | core/pim/datebook/datebookweeklst.h | 4 | ||||
-rw-r--r-- | core/pim/datebook/datebookweeklstdayhdr.ui | 8 | ||||
-rw-r--r-- | core/pim/datebook/dateentryimpl.cpp | 8 | ||||
-rw-r--r-- | core/pim/datebook/opie-datebook.control | 2 | ||||
-rw-r--r-- | core/pim/datebook/timepicker.cpp | 19 | ||||
-rw-r--r-- | core/pim/datebook/timepicker.h | 6 | ||||
-rw-r--r-- | libopie/libopie.pro | 4 | ||||
-rw-r--r-- | libopie/oclickablelabel.cpp (renamed from core/pim/datebook/clickablelabel.cpp) | 18 | ||||
-rw-r--r-- | libopie/oclickablelabel.h (renamed from core/pim/datebook/clickablelabel.h) | 4 |
11 files changed, 40 insertions, 39 deletions
diff --git a/core/pim/datebook/datebook.pro b/core/pim/datebook/datebook.pro index a8a9285..9383053 100644 --- a/core/pim/datebook/datebook.pro +++ b/core/pim/datebook/datebook.pro | |||
@@ -6,43 +6,41 @@ HEADERS = datebookday.h \ | |||
6 | datebook.h \ | 6 | datebook.h \ |
7 | dateentryimpl.h \ | 7 | dateentryimpl.h \ |
8 | datebookdayheaderimpl.h \ | 8 | datebookdayheaderimpl.h \ |
9 | datebooksettings.h \ | 9 | datebooksettings.h \ |
10 | datebookweek.h \ | 10 | datebookweek.h \ |
11 | datebookweeklst.h \ | 11 | datebookweeklst.h \ |
12 | datebookweekheaderimpl.h \ | 12 | datebookweekheaderimpl.h \ |
13 | repeatentry.h \ | 13 | repeatentry.h \ |
14 | clickablelabel.h \ | ||
15 | timepicker.h | 14 | timepicker.h |
16 | 15 | ||
17 | SOURCES= main.cpp \ | 16 | SOURCES= main.cpp \ |
18 | datebookday.cpp \ | 17 | datebookday.cpp \ |
19 | datebook.cpp \ | 18 | datebook.cpp \ |
20 | dateentryimpl.cpp \ | 19 | dateentryimpl.cpp \ |
21 | datebookdayheaderimpl.cpp \ | 20 | datebookdayheaderimpl.cpp \ |
22 | datebooksettings.cpp \ | 21 | datebooksettings.cpp \ |
23 | datebookweek.cpp \ | 22 | datebookweek.cpp \ |
24 | datebookweeklst.cpp \ | 23 | datebookweeklst.cpp \ |
25 | datebookweekheaderimpl.cpp \ | 24 | datebookweekheaderimpl.cpp \ |
26 | repeatentry.cpp \ | 25 | repeatentry.cpp \ |
27 | clickablelabel.cpp \ | ||
28 | timepicker.cpp | 26 | timepicker.cpp |
29 | 27 | ||
30 | INTERFACES= dateentry.ui \ | 28 | INTERFACES= dateentry.ui \ |
31 | datebookdayheader.ui \ | 29 | datebookdayheader.ui \ |
32 | datebooksettingsbase.ui \ | 30 | datebooksettingsbase.ui \ |
33 | datebookweekheader.ui \ | 31 | datebookweekheader.ui \ |
34 | datebookweeklstheader.ui \ | 32 | datebookweeklstheader.ui \ |
35 | datebookweeklstdayhdr.ui \ | 33 | datebookweeklstdayhdr.ui \ |
36 | repeatentrybase.ui | 34 | repeatentrybase.ui |
37 | 35 | ||
38 | INCLUDEPATH += $(OPIEDIR)/include | 36 | INCLUDEPATH += $(OPIEDIR)/include |
39 | DEPENDPATH+= $(OPIEDIR)/include | 37 | DEPENDPATH+= $(OPIEDIR)/include |
40 | LIBS += -lqpe | 38 | LIBS += -lqpe -lopie |
41 | 39 | ||
42 | TARGET = datebook | 40 | TARGET = datebook |
43 | 41 | ||
44 | TRANSLATIONS = ../i18n/pt_BR/datebook.ts | 42 | TRANSLATIONS = ../i18n/pt_BR/datebook.ts |
45 | TRANSLATIONS += ../i18n/de/datebook.ts | 43 | TRANSLATIONS += ../i18n/de/datebook.ts |
46 | TRANSLATIONS += ../i18n/en/datebook.ts | 44 | TRANSLATIONS += ../i18n/en/datebook.ts |
47 | TRANSLATIONS += ../i18n/hu/datebook.ts | 45 | TRANSLATIONS += ../i18n/hu/datebook.ts |
48 | TRANSLATIONS += ../i18n/pl/datebook.ts | 46 | TRANSLATIONS += ../i18n/pl/datebook.ts |
diff --git a/core/pim/datebook/datebookweeklst.cpp b/core/pim/datebook/datebookweeklst.cpp index 85c745a..8e88377 100644 --- a/core/pim/datebook/datebookweeklst.cpp +++ b/core/pim/datebook/datebookweeklst.cpp | |||
@@ -138,17 +138,17 @@ void DateBookWeekLstDayHdr::newEvent() { | |||
138 | stop.setTime(QTime(12,0)); | 138 | stop.setTime(QTime(12,0)); |
139 | 139 | ||
140 | emit addEvent(start,stop,""); | 140 | emit addEvent(start,stop,""); |
141 | } | 141 | } |
142 | DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev, | 142 | DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev, |
143 | QWidget* parent, | 143 | QWidget* parent, |
144 | const char* name, | 144 | const char* name, |
145 | WFlags fl) : | 145 | WFlags fl) : |
146 | ClickableLabel(parent,name,fl), | 146 | OClickableLabel(parent,name,fl), |
147 | event(ev) | 147 | event(ev) |
148 | { | 148 | { |
149 | char s[10]; | 149 | char s[10]; |
150 | if ( ev.startDate() != ev.date() ) { // multiday event (not first day) | 150 | if ( ev.startDate() != ev.date() ) { // multiday event (not first day) |
151 | if ( ev.endDate() == ev.date() ) { // last day | 151 | if ( ev.endDate() == ev.date() ) { // last day |
152 | strcpy(s, "__|__"); | 152 | strcpy(s, "__|__"); |
153 | } else { | 153 | } else { |
154 | strcpy(s, " |---"); | 154 | strcpy(s, " |---"); |
diff --git a/core/pim/datebook/datebookweeklst.h b/core/pim/datebook/datebookweeklst.h index b0b0417..24f6c83 100644 --- a/core/pim/datebook/datebookweeklst.h +++ b/core/pim/datebook/datebookweeklst.h | |||
@@ -5,17 +5,17 @@ | |||
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 "clickablelabel.h" | 13 | #include <opie/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: |
@@ -50,17 +50,17 @@ public slots: | |||
50 | signals: | 50 | signals: |
51 | void showDate(int y, int m, int d); | 51 | void showDate(int y, int m, int d); |
52 | void addEvent(const QDateTime &start, const QDateTime &stop, | 52 | void addEvent(const QDateTime &start, const QDateTime &stop, |
53 | const QString &str); | 53 | const QString &str); |
54 | private: | 54 | private: |
55 | QDate date; | 55 | QDate date; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | class DateBookWeekLstEvent: public ClickableLabel | 58 | class DateBookWeekLstEvent: public OClickableLabel |
59 | { | 59 | { |
60 | Q_OBJECT | 60 | Q_OBJECT |
61 | public: | 61 | public: |
62 | DateBookWeekLstEvent(const EffectiveEvent &ev, | 62 | DateBookWeekLstEvent(const EffectiveEvent &ev, |
63 | QWidget* parent = 0, const char* name = 0, | 63 | QWidget* parent = 0, const char* name = 0, |
64 | WFlags fl = 0); | 64 | WFlags fl = 0); |
65 | signals: | 65 | signals: |
66 | void editEvent(const Event &e); | 66 | void editEvent(const Event &e); |
diff --git a/core/pim/datebook/datebookweeklstdayhdr.ui b/core/pim/datebook/datebookweeklstdayhdr.ui index 2b68754..9499726 100644 --- a/core/pim/datebook/datebookweeklstdayhdr.ui +++ b/core/pim/datebook/datebookweeklstdayhdr.ui | |||
@@ -55,17 +55,17 @@ | |||
55 | </size> | 55 | </size> |
56 | </property> | 56 | </property> |
57 | <property stdset="1"> | 57 | <property stdset="1"> |
58 | <name>orientation</name> | 58 | <name>orientation</name> |
59 | <enum>Horizontal</enum> | 59 | <enum>Horizontal</enum> |
60 | </property> | 60 | </property> |
61 | </widget> | 61 | </widget> |
62 | <widget> | 62 | <widget> |
63 | <class>ClickableLabel</class> | 63 | <class>OClickableLabel</class> |
64 | <property stdset="1"> | 64 | <property stdset="1"> |
65 | <name>name</name> | 65 | <name>name</name> |
66 | <cstring>label</cstring> | 66 | <cstring>label</cstring> |
67 | </property> | 67 | </property> |
68 | <property stdset="1"> | 68 | <property stdset="1"> |
69 | <name>sizePolicy</name> | 69 | <name>sizePolicy</name> |
70 | <sizepolicy> | 70 | <sizepolicy> |
71 | <hsizetype>0</hsizetype> | 71 | <hsizetype>0</hsizetype> |
@@ -100,35 +100,35 @@ | |||
100 | </size> | 100 | </size> |
101 | </property> | 101 | </property> |
102 | <property stdset="1"> | 102 | <property stdset="1"> |
103 | <name>orientation</name> | 103 | <name>orientation</name> |
104 | <enum>Horizontal</enum> | 104 | <enum>Horizontal</enum> |
105 | </property> | 105 | </property> |
106 | </widget> | 106 | </widget> |
107 | <widget> | 107 | <widget> |
108 | <class>ClickableLabel</class> | 108 | <class>OClickableLabel</class> |
109 | <property stdset="1"> | 109 | <property stdset="1"> |
110 | <name>name</name> | 110 | <name>name</name> |
111 | <cstring>add</cstring> | 111 | <cstring>add</cstring> |
112 | </property> | 112 | </property> |
113 | <property stdset="1"> | 113 | <property stdset="1"> |
114 | <name>sizePolicy</name> | 114 | <name>sizePolicy</name> |
115 | <sizepolicy> | 115 | <sizepolicy> |
116 | <hsizetype>0</hsizetype> | 116 | <hsizetype>0</hsizetype> |
117 | <vsizetype>0</vsizetype> | 117 | <vsizetype>0</vsizetype> |
118 | </sizepolicy> | 118 | </sizepolicy> |
119 | </property> | 119 | </property> |
120 | </widget> | 120 | </widget> |
121 | </hbox> | 121 | </hbox> |
122 | </widget> | 122 | </widget> |
123 | <customwidgets> | 123 | <customwidgets> |
124 | <customwidget> | 124 | <customwidget> |
125 | <class>ClickableLabel</class> | 125 | <class>OClickableLabel</class> |
126 | <header location="local">clickablelabel.h</header> | 126 | <header location="global">opie/oclickablelabel.h</header> |
127 | <sizehint> | 127 | <sizehint> |
128 | <width>-1</width> | 128 | <width>-1</width> |
129 | <height>-1</height> | 129 | <height>-1</height> |
130 | </sizehint> | 130 | </sizehint> |
131 | <container>0</container> | 131 | <container>0</container> |
132 | <sizepolicy> | 132 | <sizepolicy> |
133 | <hordata>5</hordata> | 133 | <hordata>5</hordata> |
134 | <verdata>5</verdata> | 134 | <verdata>5</verdata> |
diff --git a/core/pim/datebook/dateentryimpl.cpp b/core/pim/datebook/dateentryimpl.cpp index e14e2f5..c4f6c68 100644 --- a/core/pim/datebook/dateentryimpl.cpp +++ b/core/pim/datebook/dateentryimpl.cpp | |||
@@ -38,31 +38,33 @@ | |||
38 | #include <qpopupmenu.h> | 38 | #include <qpopupmenu.h> |
39 | #include <qscrollview.h> | 39 | #include <qscrollview.h> |
40 | #include <qspinbox.h> | 40 | #include <qspinbox.h> |
41 | #include <qtoolbutton.h> | 41 | #include <qtoolbutton.h> |
42 | 42 | ||
43 | #include "timepicker.h" | 43 | #include "timepicker.h" |
44 | 44 | ||
45 | #include <stdlib.h> | 45 | #include <stdlib.h> |
46 | #include <stdio.h> | ||
46 | 47 | ||
47 | /* | 48 | /* |
48 | * Constructs a DateEntry which is a child of 'parent', with the | 49 | * Constructs a DateEntry which is a child of 'parent', with the |
49 | * name 'name' and widget flags set to 'f' | 50 | * name 'name' and widget flags set to 'f' |
50 | * | 51 | * |
51 | * The dialog will by default be modeless, unless you set 'modal' to | 52 | * The dialog will by default be modeless, unless you set 'modal' to |
52 | * TRUE to construct a modal dialog. | 53 | * TRUE to construct a modal dialog. |
53 | */ | 54 | */ |
54 | 55 | ||
55 | DateEntry::DateEntry( bool startOnMonday, const QDateTime &start, | 56 | DateEntry::DateEntry( bool startOnMonday, const QDateTime &start, |
56 | const QDateTime &end, bool whichClock, QWidget* parent, | 57 | const QDateTime &end, bool whichClock, QWidget* parent, |
57 | const char* name ) | 58 | const char* name ) |
58 | : DateEntryBase( parent, name ), | 59 | : DateEntryBase( parent, name ), |
59 | ampm( whichClock ), | 60 | ampm( whichClock ), |
60 | startWeekOnMonday( startOnMonday ) | 61 | startWeekOnMonday( startOnMonday ), |
62 | m_showStart(true) | ||
61 | { | 63 | { |
62 | init(); | 64 | init(); |
63 | setDates(start,end); | 65 | setDates(start,end); |
64 | setFocusProxy(comboDescription); | 66 | setFocusProxy(comboDescription); |
65 | } | 67 | } |
66 | 68 | ||
67 | bool DateEntry::eventFilter(QObject *obj, QEvent *ev ) | 69 | bool DateEntry::eventFilter(QObject *obj, QEvent *ev ) |
68 | { | 70 | { |
@@ -108,17 +110,19 @@ static void addOrPick( QComboBox* combo, const QString& t ) | |||
108 | combo->insertItem(t); | 110 | combo->insertItem(t); |
109 | combo->setCurrentItem(combo->count()-1); | 111 | combo->setCurrentItem(combo->count()-1); |
110 | } | 112 | } |
111 | 113 | ||
112 | DateEntry::DateEntry( bool startOnMonday, const Event &event, bool whichClock, | 114 | DateEntry::DateEntry( bool startOnMonday, const Event &event, bool whichClock, |
113 | QWidget* parent, const char* name ) | 115 | QWidget* parent, const char* name ) |
114 | : DateEntryBase( parent, name ), | 116 | : DateEntryBase( parent, name ), |
115 | ampm( whichClock ), | 117 | ampm( whichClock ), |
116 | startWeekOnMonday( startOnMonday ) | 118 | startWeekOnMonday( startOnMonday ), |
119 | m_showStart(true) | ||
120 | |||
117 | { | 121 | { |
118 | init(); | 122 | init(); |
119 | setDates(event.start(),event.end()); | 123 | setDates(event.start(),event.end()); |
120 | comboCategory->setCategories( event.categories(), "Calendar", tr("Calendar") ); | 124 | comboCategory->setCategories( event.categories(), "Calendar", tr("Calendar") ); |
121 | if(!event.description().isEmpty()) | 125 | if(!event.description().isEmpty()) |
122 | addOrPick( comboDescription, event.description() ); | 126 | addOrPick( comboDescription, event.description() ); |
123 | if(!event.location().isEmpty()) | 127 | if(!event.location().isEmpty()) |
124 | addOrPick( comboLocation, event.location() ); | 128 | addOrPick( comboLocation, event.location() ); |
diff --git a/core/pim/datebook/opie-datebook.control b/core/pim/datebook/opie-datebook.control index 6566d50..9bef119 100644 --- a/core/pim/datebook/opie-datebook.control +++ b/core/pim/datebook/opie-datebook.control | |||
@@ -1,9 +1,9 @@ | |||
1 | Files: bin/datebook apps/Applications/datebook.desktop | 1 | Files: bin/datebook apps/Applications/datebook.desktop |
2 | Priority: optional | 2 | Priority: optional |
3 | Section: opie/applications | 3 | Section: opie/applications |
4 | Maintainer: Warwick Allison <warwick@trolltech.com> | 4 | Maintainer: Warwick Allison <warwick@trolltech.com> |
5 | Architecture: arm | 5 | Architecture: arm |
6 | Version: $QPE_VERSION-$SUB_VERSION | 6 | Version: $QPE_VERSION-$SUB_VERSION |
7 | Depends: opie-base ($QPE_VERSION) | 7 | Depends: opie-base ($QPE_VERSION), libopie ($QPE_VERSION) |
8 | Description: A datebook/appointment manager | 8 | Description: A datebook/appointment manager |
9 | A datebook/appointment manager for the Opie environment. | 9 | A datebook/appointment manager for the Opie environment. |
diff --git a/core/pim/datebook/timepicker.cpp b/core/pim/datebook/timepicker.cpp index 43e05ad..f2cb71d 100644 --- a/core/pim/datebook/timepicker.cpp +++ b/core/pim/datebook/timepicker.cpp | |||
@@ -1,34 +1,33 @@ | |||
1 | #include "timepicker.h" | 1 | #include "timepicker.h" |
2 | 2 | ||
3 | #include <qbuttongroup.h> | 3 | #include <qbuttongroup.h> |
4 | #include <qtoolbutton.h> | 4 | #include <qtoolbutton.h> |
5 | #include <qlayout.h> | 5 | #include <qlayout.h> |
6 | #include "clickablelabel.h" | ||
7 | #include <qstring.h> | 6 | #include <qstring.h> |
8 | #include <stdio.h> | 7 | #include <stdio.h> |
9 | 8 | ||
10 | TimePicker::TimePicker(QWidget* parent, const char* name, | 9 | TimePicker::TimePicker(QWidget* parent, const char* name, |
11 | WFlags fl) : | 10 | WFlags fl) : |
12 | QWidget(parent,name,fl) | 11 | QWidget(parent,name,fl) |
13 | { | 12 | { |
14 | QVBoxLayout *vbox=new QVBoxLayout(this); | 13 | QVBoxLayout *vbox=new QVBoxLayout(this); |
15 | 14 | ||
16 | ClickableLabel *r; | 15 | OClickableLabel *r; |
17 | QString s; | 16 | QString s; |
18 | 17 | ||
19 | // Hour Row | 18 | // Hour Row |
20 | QWidget *row=new QWidget(this); | 19 | QWidget *row=new QWidget(this); |
21 | QHBoxLayout *l=new QHBoxLayout(row); | 20 | QHBoxLayout *l=new QHBoxLayout(row); |
22 | vbox->addWidget(row); | 21 | vbox->addWidget(row); |
23 | 22 | ||
24 | 23 | ||
25 | for (int i=0; i<24; i++) { | 24 | for (int i=0; i<24; i++) { |
26 | r=new ClickableLabel(row); | 25 | r=new OClickableLabel(row); |
27 | hourLst.append(r); | 26 | hourLst.append(r); |
28 | s.sprintf("%.2d",i); | 27 | s.sprintf("%.2d",i); |
29 | r->setText(s); | 28 | r->setText(s); |
30 | r->setToggleButton(true); | 29 | r->setToggleButton(true); |
31 | r->setAlignment(AlignHCenter | AlignVCenter); | 30 | r->setAlignment(AlignHCenter | AlignVCenter); |
32 | l->addWidget(r); | 31 | l->addWidget(r); |
33 | connect(r, SIGNAL(toggled(bool)), | 32 | connect(r, SIGNAL(toggled(bool)), |
34 | this, SLOT(slotHour(bool))); | 33 | this, SLOT(slotHour(bool))); |
@@ -41,80 +40,80 @@ TimePicker::TimePicker(QWidget* parent, const char* name, | |||
41 | } | 40 | } |
42 | 41 | ||
43 | // Minute Row | 42 | // Minute Row |
44 | row=new QWidget(this); | 43 | row=new QWidget(this); |
45 | l=new QHBoxLayout(row); | 44 | l=new QHBoxLayout(row); |
46 | vbox->addWidget(row); | 45 | vbox->addWidget(row); |
47 | 46 | ||
48 | for (int i=0; i<60; i+=5) { | 47 | for (int i=0; i<60; i+=5) { |
49 | r=new ClickableLabel(row); | 48 | r=new OClickableLabel(row); |
50 | minuteLst.append(r); | 49 | minuteLst.append(r); |
51 | s.sprintf("%.2d",i); | 50 | s.sprintf("%.2d",i); |
52 | r->setText(s); | 51 | r->setText(s); |
53 | r->setToggleButton(true); | 52 | r->setToggleButton(true); |
54 | r->setAlignment(AlignHCenter | AlignVCenter); | 53 | r->setAlignment(AlignHCenter | AlignVCenter); |
55 | l->addWidget(r); | 54 | l->addWidget(r); |
56 | connect(r, SIGNAL(toggled(bool)), | 55 | connect(r, SIGNAL(toggled(bool)), |
57 | this, SLOT(slotMinute(bool))); | 56 | this, SLOT(slotMinute(bool))); |
58 | } | 57 | } |
59 | } | 58 | } |
60 | 59 | ||
61 | void TimePicker::slotHour(bool b) { | 60 | void TimePicker::slotHour(bool b) { |
62 | 61 | ||
63 | ClickableLabel *r = (ClickableLabel *) sender(); | 62 | OClickableLabel *r = (OClickableLabel *) sender(); |
64 | 63 | ||
65 | if (b) { | 64 | if (b) { |
66 | QValueListIterator<ClickableLabel *> it; | 65 | QValueListIterator<OClickableLabel *> it; |
67 | for (it=hourLst.begin(); it!=hourLst.end(); it++) { | 66 | for (it=hourLst.begin(); it!=hourLst.end(); it++) { |
68 | if (*it != r) (*it)->setOn(false); | 67 | if (*it != r) (*it)->setOn(false); |
69 | else tm.setHMS((*it)->text().toInt(), tm.minute(), 0); | 68 | else tm.setHMS((*it)->text().toInt(), tm.minute(), 0); |
70 | } | 69 | } |
71 | emit timeChanged(tm); | 70 | emit timeChanged(tm); |
72 | } else { | 71 | } else { |
73 | r->setOn(true); | 72 | r->setOn(true); |
74 | } | 73 | } |
75 | 74 | ||
76 | } | 75 | } |
77 | 76 | ||
78 | void TimePicker::slotMinute(bool b) { | 77 | void TimePicker::slotMinute(bool b) { |
79 | 78 | ||
80 | ClickableLabel *r = (ClickableLabel *) sender(); | 79 | OClickableLabel *r = (OClickableLabel *) sender(); |
81 | 80 | ||
82 | if (b) { | 81 | if (b) { |
83 | QValueListIterator<ClickableLabel *> it; | 82 | QValueListIterator<OClickableLabel *> it; |
84 | for (it=minuteLst.begin(); it!=minuteLst.end(); it++) { | 83 | for (it=minuteLst.begin(); it!=minuteLst.end(); it++) { |
85 | if (*it != r) (*it)->setOn(false); | 84 | if (*it != r) (*it)->setOn(false); |
86 | else tm.setHMS(tm.hour(),(*it)->text().toInt(), 0); | 85 | else tm.setHMS(tm.hour(),(*it)->text().toInt(), 0); |
87 | } | 86 | } |
88 | emit timeChanged(tm); | 87 | emit timeChanged(tm); |
89 | } else { | 88 | } else { |
90 | r->setOn(true); | 89 | r->setOn(true); |
91 | } | 90 | } |
92 | 91 | ||
93 | } | 92 | } |
94 | 93 | ||
95 | void TimePicker::setMinute(int m) { | 94 | void TimePicker::setMinute(int m) { |
96 | 95 | ||
97 | QString minute; | 96 | QString minute; |
98 | minute.sprintf("%.2d",m); | 97 | minute.sprintf("%.2d",m); |
99 | 98 | ||
100 | QValueListIterator<ClickableLabel *> it; | 99 | QValueListIterator<OClickableLabel *> it; |
101 | for (it=minuteLst.begin(); it!=minuteLst.end(); it++) { | 100 | for (it=minuteLst.begin(); it!=minuteLst.end(); it++) { |
102 | if ((*it)->text() == minute) (*it)->setOn(true); | 101 | if ((*it)->text() == minute) (*it)->setOn(true); |
103 | else (*it)->setOn(false); | 102 | else (*it)->setOn(false); |
104 | } | 103 | } |
105 | 104 | ||
106 | tm.setHMS(tm.hour(),m,0); | 105 | tm.setHMS(tm.hour(),m,0); |
107 | } | 106 | } |
108 | 107 | ||
109 | void TimePicker::setHour(int h) { | 108 | void TimePicker::setHour(int h) { |
110 | 109 | ||
111 | QString hour; | 110 | QString hour; |
112 | hour.sprintf("%.2d",h); | 111 | hour.sprintf("%.2d",h); |
113 | 112 | ||
114 | QValueListIterator<ClickableLabel *> it; | 113 | QValueListIterator<OClickableLabel *> it; |
115 | for (it=hourLst.begin(); it!=hourLst.end(); it++) { | 114 | for (it=hourLst.begin(); it!=hourLst.end(); it++) { |
116 | if ((*it)->text() == hour) (*it)->setOn(true); | 115 | if ((*it)->text() == hour) (*it)->setOn(true); |
117 | else (*it)->setOn(false); | 116 | else (*it)->setOn(false); |
118 | } | 117 | } |
119 | tm.setHMS(h,tm.minute(),0); | 118 | tm.setHMS(h,tm.minute(),0); |
120 | } | 119 | } |
diff --git a/core/pim/datebook/timepicker.h b/core/pim/datebook/timepicker.h index 0acadcb..1c35600 100644 --- a/core/pim/datebook/timepicker.h +++ b/core/pim/datebook/timepicker.h | |||
@@ -1,28 +1,28 @@ | |||
1 | #ifndef TIMEPICKER_H | 1 | #ifndef TIMEPICKER_H |
2 | #define TIMEPICKER_H | 2 | #define TIMEPICKER_H |
3 | 3 | ||
4 | #include <qwidget.h> | 4 | #include <qwidget.h> |
5 | #include <qvaluelist.h> | 5 | #include <qvaluelist.h> |
6 | #include "clickablelabel.h" | 6 | #include <opie/oclickablelabel.h> |
7 | #include <qdatetime.h> | 7 | #include <qdatetime.h> |
8 | 8 | ||
9 | class TimePicker: public QWidget { | 9 | class TimePicker: public QWidget { |
10 | Q_OBJECT | 10 | Q_OBJECT |
11 | 11 | ||
12 | public: | 12 | public: |
13 | TimePicker(QWidget* parent = 0, const char* name = 0, | 13 | TimePicker(QWidget* parent = 0, const char* name = 0, |
14 | WFlags fl = 0); | 14 | WFlags fl = 0); |
15 | void setHour(int h); | 15 | void setHour(int h); |
16 | void setMinute(int m); | 16 | void setMinute(int m); |
17 | 17 | ||
18 | private: | 18 | private: |
19 | QValueList<ClickableLabel *> hourLst; | 19 | QValueList<OClickableLabel *> hourLst; |
20 | QValueList<ClickableLabel *> minuteLst; | 20 | QValueList<OClickableLabel *> minuteLst; |
21 | QTime tm; | 21 | QTime tm; |
22 | 22 | ||
23 | private slots: | 23 | private slots: |
24 | void slotHour(bool b); | 24 | void slotHour(bool b); |
25 | void slotMinute(bool b); | 25 | void slotMinute(bool b); |
26 | 26 | ||
27 | signals: | 27 | signals: |
28 | void timeChanged(const QTime &); | 28 | void timeChanged(const QTime &); |
diff --git a/libopie/libopie.pro b/libopie/libopie.pro index ba64bda..337206a 100644 --- a/libopie/libopie.pro +++ b/libopie/libopie.pro | |||
@@ -1,8 +1,8 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qte warn_on release | 2 | CONFIG += qte warn_on release |
3 | HEADERS = ofontmenu.h ofileselector.h ofiledialog.h ofileview.h tododb.h todoevent.h todoresource.h todovcalresource.h xmltree.h colordialog.h colorpopupmenu.h | 3 | HEADERS = ofontmenu.h ofileselector.h ofiledialog.h ofileview.h tododb.h todoevent.h todoresource.h todovcalresource.h xmltree.h colordialog.h colorpopupmenu.h oclickablelabel.h |
4 | SOURCES = ofontmenu.cc ofileselector.cc ofiledialog.cc xmltree.cc tododb.cpp todoevent.cpp todovcalresource.cpp colordialog.cpp colorpopupmenu.cpp | 4 | SOURCES = ofontmenu.cc ofileselector.cc ofiledialog.cc xmltree.cc tododb.cpp todoevent.cpp todovcalresource.cpp colordialog.cpp colorpopupmenu.cpp oclickablelabel.cpp |
5 | TARGET = opie | 5 | TARGET = opie |
6 | INCLUDEPATH += $(OPIEDIR)/include | 6 | INCLUDEPATH += $(OPIEDIR)/include |
7 | DESTDIR = $(QTDIR)/lib$(PROJMAK) | 7 | DESTDIR = $(QTDIR)/lib$(PROJMAK) |
8 | #VERSION = 1.0.0 | 8 | #VERSION = 1.0.0 |
diff --git a/core/pim/datebook/clickablelabel.cpp b/libopie/oclickablelabel.cpp index 128bebb..43a0524 100644 --- a/core/pim/datebook/clickablelabel.cpp +++ b/libopie/oclickablelabel.cpp | |||
@@ -1,88 +1,88 @@ | |||
1 | #include "clickablelabel.h" | 1 | #include "oclickablelabel.h" |
2 | #include <stdio.h> | 2 | #include <stdio.h> |
3 | 3 | ||
4 | ClickableLabel::ClickableLabel(QWidget* parent, | 4 | OClickableLabel::OClickableLabel(QWidget* parent, |
5 | const char* name, | 5 | const char* name, |
6 | WFlags fl) : | 6 | WFlags fl) : |
7 | QLabel(parent,name,fl) | 7 | QLabel(parent,name,fl) |
8 | { | 8 | { |
9 | textInverted=false; | 9 | textInverted=false; |
10 | isToggle=false; | 10 | isToggle=false; |
11 | isDown=false; | 11 | isDown=false; |
12 | showState(false); | 12 | showState(false); |
13 | setFrameShadow(Sunken); | 13 | setFrameShadow(Sunken); |
14 | } | 14 | } |
15 | 15 | ||
16 | void ClickableLabel::setToggleButton(bool t) { | 16 | void OClickableLabel::setToggleButton(bool t) { |
17 | isToggle=t; | 17 | isToggle=t; |
18 | } | 18 | } |
19 | 19 | ||
20 | void ClickableLabel::mousePressEvent( QMouseEvent *e ) { | 20 | void OClickableLabel::mousePressEvent( QMouseEvent *e ) { |
21 | if (isToggle && isDown) { | 21 | if (isToggle && isDown) { |
22 | showState(false); | 22 | showState(false); |
23 | } else { | 23 | } else { |
24 | showState(true); | 24 | showState(true); |
25 | } | 25 | } |
26 | } | 26 | } |
27 | 27 | ||
28 | void ClickableLabel::mouseReleaseEvent( QMouseEvent *e ) { | 28 | void OClickableLabel::mouseReleaseEvent( QMouseEvent *e ) { |
29 | if (rect().contains(e->pos()) && isToggle) isDown=!isDown; | 29 | if (rect().contains(e->pos()) && isToggle) isDown=!isDown; |
30 | 30 | ||
31 | if (isToggle && isDown) { | 31 | if (isToggle && isDown) { |
32 | showState(true); | 32 | showState(true); |
33 | } else { | 33 | } else { |
34 | showState(false); | 34 | showState(false); |
35 | } | 35 | } |
36 | 36 | ||
37 | if (rect().contains(e->pos())) { | 37 | if (rect().contains(e->pos())) { |
38 | if (isToggle) { | 38 | if (isToggle) { |
39 | emit toggled(isDown); | 39 | emit toggled(isDown); |
40 | } | 40 | } |
41 | emit clicked(); | 41 | emit clicked(); |
42 | } | 42 | } |
43 | } | 43 | } |
44 | 44 | ||
45 | void ClickableLabel::mouseMoveEvent( QMouseEvent *e ) { | 45 | void OClickableLabel::mouseMoveEvent( QMouseEvent *e ) { |
46 | if (rect().contains(e->pos())) { | 46 | if (rect().contains(e->pos())) { |
47 | if (isToggle && isDown) { | 47 | if (isToggle && isDown) { |
48 | showState(false); | 48 | showState(false); |
49 | } else { | 49 | } else { |
50 | showState(true); | 50 | showState(true); |
51 | } | 51 | } |
52 | } else { | 52 | } else { |
53 | if (isToggle && isDown) { | 53 | if (isToggle && isDown) { |
54 | showState(true); | 54 | showState(true); |
55 | } else { | 55 | } else { |
56 | showState(false); | 56 | showState(false); |
57 | } | 57 | } |
58 | } | 58 | } |
59 | } | 59 | } |
60 | 60 | ||
61 | void ClickableLabel::showState(bool on) { | 61 | void OClickableLabel::showState(bool on) { |
62 | if (on) { | 62 | if (on) { |
63 | //setFrameShape(Panel); | 63 | //setFrameShape(Panel); |
64 | setInverted(true); | 64 | setInverted(true); |
65 | setBackgroundMode(PaletteHighlight); | 65 | setBackgroundMode(PaletteHighlight); |
66 | } else { | 66 | } else { |
67 | //setFrameShape(NoFrame); | 67 | //setFrameShape(NoFrame); |
68 | setInverted(false); | 68 | setInverted(false); |
69 | setBackgroundMode(PaletteBackground); | 69 | setBackgroundMode(PaletteBackground); |
70 | } | 70 | } |
71 | repaint(); | 71 | repaint(); |
72 | } | 72 | } |
73 | 73 | ||
74 | void ClickableLabel::setInverted(bool on) { | 74 | void OClickableLabel::setInverted(bool on) { |
75 | if ( (!textInverted && on) || (textInverted && !on) ) { | 75 | if ( (!textInverted && on) || (textInverted && !on) ) { |
76 | QPalette pal=palette(); | 76 | QPalette pal=palette(); |
77 | QColor col=pal.color(QPalette::Normal, QColorGroup::Foreground); | 77 | QColor col=pal.color(QPalette::Normal, QColorGroup::Foreground); |
78 | col.setRgb(255-col.red(),255-col.green(),255-col.blue()); | 78 | col.setRgb(255-col.red(),255-col.green(),255-col.blue()); |
79 | pal.setColor(QPalette::Normal, QColorGroup::Foreground, col); | 79 | pal.setColor(QPalette::Normal, QColorGroup::Foreground, col); |
80 | setPalette(pal); | 80 | setPalette(pal); |
81 | textInverted=!textInverted; | 81 | textInverted=!textInverted; |
82 | } | 82 | } |
83 | } | 83 | } |
84 | 84 | ||
85 | void ClickableLabel::setOn(bool on) { | 85 | void OClickableLabel::setOn(bool on) { |
86 | isDown=on; | 86 | isDown=on; |
87 | showState(isDown); | 87 | showState(isDown); |
88 | } | 88 | } |
diff --git a/core/pim/datebook/clickablelabel.h b/libopie/oclickablelabel.h index d00fee6..f65c440 100644 --- a/core/pim/datebook/clickablelabel.h +++ b/libopie/oclickablelabel.h | |||
@@ -1,18 +1,18 @@ | |||
1 | #ifndef CLICKABLELABEL | 1 | #ifndef CLICKABLELABEL |
2 | #define CLICKABLELABEL | 2 | #define CLICKABLELABEL |
3 | 3 | ||
4 | #include <qlabel.h> | 4 | #include <qlabel.h> |
5 | 5 | ||
6 | class ClickableLabel: public QLabel | 6 | class OClickableLabel: public QLabel |
7 | { | 7 | { |
8 | Q_OBJECT | 8 | Q_OBJECT |
9 | public: | 9 | public: |
10 | ClickableLabel(QWidget* parent = 0, const char* name = 0, | 10 | OClickableLabel(QWidget* parent = 0, const char* name = 0, |
11 | WFlags fl = 0); | 11 | WFlags fl = 0); |
12 | void setToggleButton(bool t); | 12 | void setToggleButton(bool t); |
13 | protected: | 13 | protected: |
14 | void mousePressEvent( QMouseEvent *e ); | 14 | void mousePressEvent( QMouseEvent *e ); |
15 | void mouseReleaseEvent( QMouseEvent *e ); | 15 | void mouseReleaseEvent( QMouseEvent *e ); |
16 | void mouseMoveEvent( QMouseEvent *e ); | 16 | void mouseMoveEvent( QMouseEvent *e ); |
17 | public slots: | 17 | public slots: |
18 | void setOn(bool on); | 18 | void setOn(bool on); |