Diffstat (limited to 'korganizer/kowhatsnextview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/kowhatsnextview.cpp | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index f88403c..bfe930f 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp | |||
@@ -18,14 +18,20 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <qlayout.h> | 20 | #include <qlayout.h> |
21 | #include <qtextbrowser.h> | 21 | #include <q3textbrowser.h> |
22 | #include <qtextcodec.h> | 22 | #include <qtextcodec.h> |
23 | #include <qfileinfo.h> | 23 | #include <qfileinfo.h> |
24 | #include <qlabel.h> | 24 | #include <qlabel.h> |
25 | 25 | ||
26 | #include <qapplication.h> | 26 | #include <qapplication.h> |
27 | #include <QDesktopWidget> | ||
27 | #ifdef DESKTOP_VERSION | 28 | #ifdef DESKTOP_VERSION |
28 | #include <qpaintdevicemetrics.h> | 29 | #include <q3paintdevicemetrics.h> |
30 | //Added by qt3to4: | ||
31 | #include <Q3PtrList> | ||
32 | #include <QHideEvent> | ||
33 | #include <Q3VBoxLayout> | ||
34 | #include <QShowEvent> | ||
29 | #endif | 35 | #endif |
30 | #include <kglobal.h> | 36 | #include <kglobal.h> |
31 | #include <klocale.h> | 37 | #include <klocale.h> |
@@ -42,7 +48,7 @@ | |||
42 | #include "koprefs.h" | 48 | #include "koprefs.h" |
43 | #include "koeventviewerdialog.h" | 49 | #include "koeventviewerdialog.h" |
44 | #include "koeventviewer.h" | 50 | #include "koeventviewer.h" |
45 | #include <qstylesheet.h> | 51 | #include <q3stylesheet.h> |
46 | #include "kowhatsnextview.h" | 52 | #include "kowhatsnextview.h" |
47 | using namespace KOrg; | 53 | using namespace KOrg; |
48 | 54 | ||
@@ -56,7 +62,7 @@ void WhatsNextTextBrowser::setSource(const QString& n) | |||
56 | emit showIncidence(n); | 62 | emit showIncidence(n); |
57 | return; | 63 | return; |
58 | } else { | 64 | } else { |
59 | QTextBrowser::setSource(n); | 65 | Q3TextBrowser::setSource(n); |
60 | } | 66 | } |
61 | } | 67 | } |
62 | void WhatsNextTextBrowser::printMe() | 68 | void WhatsNextTextBrowser::printMe() |
@@ -72,7 +78,7 @@ void WhatsNextTextBrowser::printMe() | |||
72 | return; | 78 | return; |
73 | QPainter p; | 79 | QPainter p; |
74 | p.begin ( &printer ); | 80 | p.begin ( &printer ); |
75 | QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); | 81 | Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer ); |
76 | float dx, dy; | 82 | float dx, dy; |
77 | int wid = (m.width() * 9)/10; | 83 | int wid = (m.width() * 9)/10; |
78 | dx = (float) wid/(float)contentsWidth (); | 84 | dx = (float) wid/(float)contentsWidth (); |
@@ -103,19 +109,19 @@ KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, | |||
103 | setFont( KOPrefs::instance()->mWhatsNextFont ); | 109 | setFont( KOPrefs::instance()->mWhatsNextFont ); |
104 | mView = new WhatsNextTextBrowser(this); | 110 | mView = new WhatsNextTextBrowser(this); |
105 | connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &))); | 111 | connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &))); |
106 | QStyleSheet* stsh = mView->styleSheet(); | 112 | Q3StyleSheet* stsh = mView->styleSheet(); |
107 | QStyleSheetItem * style ; | 113 | Q3StyleSheetItem * style ; |
108 | style = stsh->item ("h2" ); | 114 | style = stsh->item ("h2" ); |
109 | if ( style ) { | 115 | if ( style ) { |
110 | style->setMargin(QStyleSheetItem::MarginAll,0); | 116 | style->setMargin(Q3StyleSheetItem::MarginAll,0); |
111 | } | 117 | } |
112 | style = stsh->item ("h3" ); | 118 | style = stsh->item ("h3" ); |
113 | if ( style ) { | 119 | if ( style ) { |
114 | style->setMargin(QStyleSheetItem::MarginAll,0); | 120 | style->setMargin(Q3StyleSheetItem::MarginAll,0); |
115 | } | 121 | } |
116 | mEventViewer = 0; | 122 | mEventViewer = 0; |
117 | 123 | ||
118 | QBoxLayout *topLayout = new QVBoxLayout(this); | 124 | Q3BoxLayout *topLayout = new Q3VBoxLayout(this); |
119 | // topLayout->addWidget(mDateLabel); | 125 | // topLayout->addWidget(mDateLabel); |
120 | topLayout->addWidget(mView); | 126 | topLayout->addWidget(mView); |
121 | mTimer = new QTimer( this ); | 127 | mTimer = new QTimer( this ); |
@@ -144,9 +150,9 @@ void KOWhatsNextView::clearList() | |||
144 | mTimer->stop(); | 150 | mTimer->stop(); |
145 | mView->setText(" "); | 151 | mView->setText(" "); |
146 | } | 152 | } |
147 | QPtrList<Incidence> KOWhatsNextView::selectedIncidences() | 153 | Q3PtrList<Incidence> KOWhatsNextView::selectedIncidences() |
148 | { | 154 | { |
149 | QPtrList<Incidence> eventList; | 155 | Q3PtrList<Incidence> eventList; |
150 | 156 | ||
151 | return eventList; | 157 | return eventList; |
152 | } | 158 | } |
@@ -219,8 +225,8 @@ void KOWhatsNextView::updateView() | |||
219 | mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>"; | 225 | mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>"; |
220 | int iii; | 226 | int iii; |
221 | mTodos.clear(); | 227 | mTodos.clear(); |
222 | QPtrList<Event> events; | 228 | Q3PtrList<Event> events; |
223 | QPtrList<Todo> todos = calendar()->todos(); | 229 | Q3PtrList<Todo> todos = calendar()->todos(); |
224 | Todo * todo; | 230 | Todo * todo; |
225 | //mText += "<h2>" + i18n("Events: ") + "</h2>\n"; | 231 | //mText += "<h2>" + i18n("Events: ") + "</h2>\n"; |
226 | int daysToShow = KOPrefs::instance()->mWhatsNextDays ; | 232 | int daysToShow = KOPrefs::instance()->mWhatsNextDays ; |
@@ -454,7 +460,7 @@ void KOWhatsNextView::showDates(const QDate &, const QDate &) | |||
454 | updateView(); | 460 | updateView(); |
455 | } | 461 | } |
456 | 462 | ||
457 | void KOWhatsNextView::showEvents(QPtrList<Event>) | 463 | void KOWhatsNextView::showEvents(Q3PtrList<Event>) |
458 | { | 464 | { |
459 | } | 465 | } |
460 | 466 | ||
@@ -741,7 +747,7 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) | |||
741 | ind += "-"; | 747 | ind += "-"; |
742 | mText += "</li>\n"; | 748 | mText += "</li>\n"; |
743 | } | 749 | } |
744 | QPtrList<Incidence> Relations = ev->relations(); | 750 | Q3PtrList<Incidence> Relations = ev->relations(); |
745 | Incidence *to; | 751 | Incidence *to; |
746 | for (to=Relations.first();to;to=Relations.next()) { | 752 | for (to=Relations.first();to;to=Relations.next()) { |
747 | if (!((Todo*)to)->isCompleted() && ((Todo*)to)->priority() <= mCurrentMaxPrio ) | 753 | if (!((Todo*)to)->isCompleted() && ((Todo*)to)->priority() <= mCurrentMaxPrio ) |