Diffstat (limited to 'core/pim/datebook/modules/weeklst/datebookweeklstdblview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/modules/weeklst/datebookweeklstdblview.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/pim/datebook/modules/weeklst/datebookweeklstdblview.cpp b/core/pim/datebook/modules/weeklst/datebookweeklstdblview.cpp index 6389822..5182df1 100644 --- a/core/pim/datebook/modules/weeklst/datebookweeklstdblview.cpp +++ b/core/pim/datebook/modules/weeklst/datebookweeklstdblview.cpp | |||
@@ -1,131 +1,131 @@ | |||
1 | #include "datebookweeklstdblview.h" | 1 | #include "datebookweeklstdblview.h" |
2 | #include "datebookweeklstview.h" | 2 | #include "datebookweeklstview.h" |
3 | 3 | ||
4 | #include <qlayout.h> | 4 | #include <qlayout.h> |
5 | 5 | ||
6 | DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, | 6 | DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, |
7 | QValueList<EffectiveEvent> &ev2, | 7 | QValueList<EffectiveEvent> &ev2, |
8 | QDate &d, bool onM, | 8 | QDate &d, bool onM, bool showAmPm, |
9 | QWidget* parent, | 9 | QWidget* parent, |
10 | const char* name, WFlags fl) | 10 | const char* name, WFlags fl) |
11 | : QWidget( parent, name, fl ) | 11 | : QWidget( parent, name, fl ), ampm( showAmPm ) |
12 | { | 12 | { |
13 | m_MainLayout = new QHBoxLayout( this ); | 13 | m_MainLayout = new QHBoxLayout( this ); |
14 | 14 | ||
15 | leftView = 0; | 15 | leftView = 0; |
16 | rightView = 0; | 16 | rightView = 0; |
17 | setEvents(ev1,ev2,d,onM); | 17 | setEvents(ev1,ev2,d,onM); |
18 | } | 18 | } |
19 | 19 | ||
20 | DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, | 20 | DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, |
21 | QDate &d, bool onM, | 21 | QDate &d, bool onM, bool showAmPm, |
22 | QWidget* parent, | 22 | QWidget* parent, |
23 | const char* name, WFlags fl) | 23 | const char* name, WFlags fl) |
24 | : QWidget( parent, name, fl ) | 24 | : QWidget( parent, name, fl ), ampm( showAmPm ) |
25 | { | 25 | { |
26 | m_MainLayout = new QHBoxLayout( this ); | 26 | m_MainLayout = new QHBoxLayout( this ); |
27 | 27 | ||
28 | leftView = 0; | 28 | leftView = 0; |
29 | rightView = 0; | 29 | rightView = 0; |
30 | setEvents(ev1,d,onM); | 30 | setEvents(ev1,d,onM); |
31 | } | 31 | } |
32 | 32 | ||
33 | /* setting the variant with both views */ | 33 | /* setting the variant with both views */ |
34 | void DateBookWeekLstDblView::setEvents(QValueList<EffectiveEvent> &ev1,QValueList<EffectiveEvent> &ev2,QDate &d, bool onM) | 34 | void DateBookWeekLstDblView::setEvents(QValueList<EffectiveEvent> &ev1,QValueList<EffectiveEvent> &ev2,QDate &d, bool onM) |
35 | { | 35 | { |
36 | setUpdatesEnabled(false); | 36 | setUpdatesEnabled(false); |
37 | if (!leftView) { | 37 | if (!leftView) { |
38 | leftView=new DateBookWeekLstView(ev1,d,onM,this); | 38 | leftView=new DateBookWeekLstView(ev1, d, onM, ampm, this); |
39 | m_MainLayout->addWidget(leftView); | 39 | m_MainLayout->addWidget(leftView); |
40 | connect (leftView, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); | 40 | connect (leftView, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); |
41 | connect (leftView, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); | 41 | connect (leftView, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); |
42 | connect (leftView, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &))); | 42 | connect (leftView, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &))); |
43 | connect (leftView, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &))); | 43 | connect (leftView, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &))); |
44 | connect (leftView, SIGNAL(redraw()), this, SIGNAL(redraw())); | 44 | connect (leftView, SIGNAL(redraw()), this, SIGNAL(redraw())); |
45 | connect (leftView, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); | 45 | connect (leftView, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); |
46 | connect (leftView, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)), | 46 | connect (leftView, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)), |
47 | this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); | 47 | this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); |
48 | 48 | ||
49 | } else { | 49 | } else { |
50 | leftView->hide(); | 50 | leftView->hide(); |
51 | leftView->setEvents(ev1,d,onM); | 51 | leftView->setEvents(ev1,d,onM); |
52 | } | 52 | } |
53 | 53 | ||
54 | if (!rightView) { | 54 | if (!rightView) { |
55 | rightView=new DateBookWeekLstView(ev2,d.addDays(7),onM,this); | 55 | rightView=new DateBookWeekLstView(ev2, d.addDays(7), onM, ampm, this); |
56 | m_MainLayout->addWidget(rightView); | 56 | m_MainLayout->addWidget(rightView); |
57 | connect (rightView, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); | 57 | connect (rightView, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); |
58 | connect (rightView, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); | 58 | connect (rightView, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); |
59 | connect (rightView, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &))); | 59 | connect (rightView, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &))); |
60 | connect (rightView, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &))); | 60 | connect (rightView, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &))); |
61 | connect (rightView, SIGNAL(redraw()), this, SIGNAL(redraw())); | 61 | connect (rightView, SIGNAL(redraw()), this, SIGNAL(redraw())); |
62 | connect (rightView, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); | 62 | connect (rightView, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); |
63 | connect (rightView, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)), | 63 | connect (rightView, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)), |
64 | this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); | 64 | this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); |
65 | } else { | 65 | } else { |
66 | rightView->hide(); | 66 | rightView->hide(); |
67 | rightView->setEvents(ev2,d.addDays(7),onM); | 67 | rightView->setEvents(ev2,d.addDays(7),onM); |
68 | } | 68 | } |
69 | 69 | ||
70 | leftView->show(); | 70 | leftView->show(); |
71 | rightView->show(); | 71 | rightView->show(); |
72 | setUpdatesEnabled(true); | 72 | setUpdatesEnabled(true); |
73 | } | 73 | } |
74 | 74 | ||
75 | void DateBookWeekLstDblView::setEvents(QValueList<EffectiveEvent> &ev1,QDate &d, bool onM) | 75 | void DateBookWeekLstDblView::setEvents(QValueList<EffectiveEvent> &ev1,QDate &d, bool onM) |
76 | { | 76 | { |
77 | if (!leftView) { | 77 | if (!leftView) { |
78 | leftView=new DateBookWeekLstView(ev1,d,onM,this); | 78 | leftView=new DateBookWeekLstView(ev1, d, onM, ampm, this); |
79 | m_MainLayout->addWidget(leftView); | 79 | m_MainLayout->addWidget(leftView); |
80 | connect (leftView, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); | 80 | connect (leftView, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); |
81 | connect (leftView, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); | 81 | connect (leftView, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); |
82 | connect (leftView, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &))); | 82 | connect (leftView, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &))); |
83 | connect (leftView, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &))); | 83 | connect (leftView, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &))); |
84 | connect (leftView, SIGNAL(redraw()), this, SIGNAL(redraw())); | 84 | connect (leftView, SIGNAL(redraw()), this, SIGNAL(redraw())); |
85 | connect (leftView, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); | 85 | connect (leftView, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); |
86 | connect (leftView, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)), | 86 | connect (leftView, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)), |
87 | this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); | 87 | this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); |
88 | } else { | 88 | } else { |
89 | leftView->hide(); | 89 | leftView->hide(); |
90 | leftView->setEvents(ev1,d,onM); | 90 | leftView->setEvents(ev1,d,onM); |
91 | } | 91 | } |
92 | leftView->show(); | 92 | leftView->show(); |
93 | 93 | ||
94 | if (rightView) { | 94 | if (rightView) { |
95 | rightView->hide(); | 95 | rightView->hide(); |
96 | } | 96 | } |
97 | } | 97 | } |
98 | 98 | ||
99 | void DateBookWeekLstDblView::setRightEvents(QValueList<EffectiveEvent> &ev1,QDate &d, bool onM) | 99 | void DateBookWeekLstDblView::setRightEvents(QValueList<EffectiveEvent> &ev1,QDate &d, bool onM) |
100 | { | 100 | { |
101 | if (!rightView) { | 101 | if (!rightView) { |
102 | rightView=new DateBookWeekLstView(ev1,d,onM,this); | 102 | rightView=new DateBookWeekLstView(ev1, d, onM, ampm, this); |
103 | m_MainLayout->addWidget(rightView); | 103 | m_MainLayout->addWidget(rightView); |
104 | connect (leftView, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); | 104 | connect (leftView, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); |
105 | connect (leftView, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); | 105 | connect (leftView, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); |
106 | connect (leftView, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &))); | 106 | connect (leftView, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &))); |
107 | connect (leftView, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &))); | 107 | connect (leftView, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &))); |
108 | connect (leftView, SIGNAL(redraw()), this, SIGNAL(redraw())); | 108 | connect (leftView, SIGNAL(redraw()), this, SIGNAL(redraw())); |
109 | connect (leftView, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); | 109 | connect (leftView, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); |
110 | connect (leftView, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)), | 110 | connect (leftView, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)), |
111 | this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); | 111 | this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); |
112 | } else { | 112 | } else { |
113 | rightView->hide(); | 113 | rightView->hide(); |
114 | rightView->setEvents(ev1,d,onM); | 114 | rightView->setEvents(ev1,d,onM); |
115 | } | 115 | } |
116 | rightView->show(); | 116 | rightView->show(); |
117 | } | 117 | } |
118 | 118 | ||
119 | bool DateBookWeekLstDblView::toggleDoubleView(bool how) | 119 | bool DateBookWeekLstDblView::toggleDoubleView(bool how) |
120 | { | 120 | { |
121 | if (rightView) { | 121 | if (rightView) { |
122 | if (how) rightView->show(); | 122 | if (how) rightView->show(); |
123 | else rightView->hide(); | 123 | else rightView->hide(); |
124 | return true; | 124 | return true; |
125 | } | 125 | } |
126 | return false; | 126 | return false; |
127 | } | 127 | } |
128 | 128 | ||
129 | DateBookWeekLstDblView::~DateBookWeekLstDblView() | 129 | DateBookWeekLstDblView::~DateBookWeekLstDblView() |
130 | { | 130 | { |
131 | } | 131 | } |