author | zautrix <zautrix> | 2005-02-17 21:31:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-17 21:31:18 (UTC) |
commit | 8e8d2bd0c31eb272a7f26756252ff4930d0602bc (patch) (unidiff) | |
tree | 8392e9ca561d1444bcd949e9f1aaf78f698cde98 | |
parent | 002e4f8cea2352e4b9a046b98f66be946fbeb5fc (diff) | |
download | kdepimpi-8e8d2bd0c31eb272a7f26756252ff4930d0602bc.zip kdepimpi-8e8d2bd0c31eb272a7f26756252ff4930d0602bc.tar.gz kdepimpi-8e8d2bd0c31eb272a7f26756252ff4930d0602bc.tar.bz2 |
fixes
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 11 | ||||
-rw-r--r-- | korganizer/koagendaitem.cpp | 5 | ||||
-rw-r--r-- | korganizer/koeventviewer.cpp | 31 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 5 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 6 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 8 | ||||
-rw-r--r-- | korganizer/koprefs.h | 8 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 32 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 5 | ||||
-rw-r--r-- | libkcal/kincidenceformatter.cpp | 46 | ||||
-rw-r--r-- | libkcal/kincidenceformatter.h | 3 |
11 files changed, 132 insertions, 28 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 6b93606..ab6d220 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1215,69 +1215,78 @@ | |||
1215 | { "Mail to all","Mail an Alle" }, | 1215 | { "Mail to all","Mail an Alle" }, |
1216 | { "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, | 1216 | { "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, |
1217 | { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, | 1217 | { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, |
1218 | { " on"," am" }, | 1218 | { " on"," am" }, |
1219 | { " completed on "," erledigt am " }, | 1219 | { " completed on "," erledigt am " }, |
1220 | { "Save as Event template","Speichere als Vorlage" }, | 1220 | { "Save as Event template","Speichere als Vorlage" }, |
1221 | { "Load Event template","Lade Termin Vorlage" }, | 1221 | { "Load Event template","Lade Termin Vorlage" }, |
1222 | { "Save as Journal template","Speichere als Journal Vorlage" }, | 1222 | { "Save as Journal template","Speichere als Journal Vorlage" }, |
1223 | { "Insert Journal template","Füge Journal Vorlage ein" }, | 1223 | { "Insert Journal template","Füge Journal Vorlage ein" }, |
1224 | { "Sub todos:<br>","Unter Todos:<br>" }, | 1224 | { "Sub todos:<br>","Unter Todos:<br>" }, |
1225 | { "Parent todo:<br>","Über Todo:<br>" }, | 1225 | { "Parent todo:<br>","Über Todo:<br>" }, |
1226 | { "Set current as color category","Setze Gewählte als Farbkategorie" }, | 1226 | { "Set current as color category","Setze Gewählte als Farbkategorie" }, |
1227 | { " completed"," erledigt" }, | 1227 | { " completed"," erledigt" }, |
1228 | { "(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.net --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!","(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi basiert auf KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) und das KDE Team.\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.pi-sync.net --- www.korganizer.org\nBesonderen Dank an Michael und Ben\nfür intensives Testen!" }, | 1228 | { "(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.net --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!","(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi basiert auf KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) und das KDE Team.\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.pi-sync.net --- www.korganizer.org\nBesonderen Dank an Michael und Ben\nfür intensives Testen!" }, |
1229 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, | 1229 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, |
1230 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, | 1230 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, |
1231 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, | 1231 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, |
1232 | { "Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?","Verbindungsversuch wegen\nZeitüberschreitung gescheitert!\nWurde vergessen Pi-Sync auf\nder Gegenstelle anzuschalten?" }, | 1232 | { "Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?","Verbindungsversuch wegen\nZeitüberschreitung gescheitert!\nWurde vergessen Pi-Sync auf\nder Gegenstelle anzuschalten?" }, |
1233 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, | 1233 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, |
1234 | { "Error","Fehler" }, | 1234 | { "Error","Fehler" }, |
1235 | { ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, | 1235 | { ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, |
1236 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, | 1236 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, |
1237 | { "Warning","Warnung" }, | 1237 | { "Warning","Warnung" }, |
1238 | { "Select week number","Wähle Wochen Nummer" }, | 1238 | { "Select week number","Wähle Wochen Nummer" }, |
1239 | { "Februar","Februar" }, | 1239 | { "Februar","Februar" }, |
1240 | { "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, | 1240 | { "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, |
1241 | { "W","W" }, | 1241 | { "W","W" }, |
1242 | { "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, | 1242 | { "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, |
1243 | { "T: %1","T: %1" }, | 1243 | { "T: %1","T: %1" }, |
1244 | { "Start: ","Start: " }, | 1244 | { "Start: ","Start: " }, |
1245 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, | 1245 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, |
1246 | { "Password for remote access:","Passwort für fernen Zugriff:" }, | 1246 | { "Password for remote access:","Passwort für fernen Zugriff:" }, |
1247 | { "Remote IP address:","Ferne IP Adresse:" }, | 1247 | { "Remote IP address:","Ferne IP Adresse:" }, |
1248 | { "Remote port number:","Ferne Port Nummer:" }, | 1248 | { "Remote port number:","Ferne Port Nummer:" }, |
1249 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, | 1249 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, |
1250 | { "Remote from: ","Fern von: " }, | 1250 | { "Remote from: ","Fern von: " }, |
1251 | { "Local from: ","Lokal von: " }, | 1251 | { "Local from: ","Lokal von: " }, |
1252 | { "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" }, | 1252 | { "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" }, |
1253 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, | 1253 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, |
1254 | { "Write back","Schreibe zurück" }, | 1254 | { "Write back","Schreibe zurück" }, |
1255 | { "KO/Pi Synchronization","KO/Pi Synchronisation" }, | 1255 | { "KO/Pi Synchronization","KO/Pi Synchronisation" }, |
1256 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, | 1256 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, |
1257 | { "Received sync request","Sync Anfrage erhalten" }, | 1257 | { "Received sync request","Sync Anfrage erhalten" }, |
1258 | { "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." }, | 1258 | { "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." }, |
1259 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, | 1259 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, |
1260 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, | 1260 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, |
1261 | { "Sending file...","Sende Datei..." }, | 1261 | { "Sending file...","Sende Datei..." }, |
1262 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, | 1262 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, |
1263 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, | 1263 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, |
1264 | { "Received %1 bytes","%1 Bytes erhalten" }, | 1264 | { "Received %1 bytes","%1 Bytes erhalten" }, |
1265 | { "Writing file to disk...","Speichere Datei..." }, | 1265 | { "Writing file to disk...","Speichere Datei..." }, |
1266 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, | 1266 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, |
1267 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, | 1267 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, |
1268 | { "Synchronize!","Synchronisiere!" }, | 1268 | { "Synchronize!","Synchronisiere!" }, |
1269 | { "High clock skew!","Großer Uhrzeitunterschied!" }, | 1269 | { "High clock skew!","Großer Uhrzeitunterschied!" }, |
1270 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, | 1270 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, |
1271 | { "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, | 1271 | { "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, |
1272 | { "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, | 1272 | { "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, |
1273 | { "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, | 1273 | { "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, |
1274 | { "List week view","Listenwochenansicht" }, | 1274 | { "List week view","Listenwochenansicht" }, |
1275 | { "List week","Listenwochenansicht" }, | 1275 | { "List week","Listenwochenansicht" }, |
1276 | { "Next Week","Nächste Woche" }, | 1276 | { "Next Week","Nächste Woche" }, |
1277 | { "Previous Week","Vorherige Woche" }, | 1277 | { "Previous Week","Vorherige Woche" }, |
1278 | { "No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.","Keine Einträge gefunden die\ndem Suchausdruck entsprechen.\nBenutze Platzhalter Zeichen\n'*' und '?' wo benötigt." }, | 1278 | { "No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.","Keine Einträge gefunden die\ndem Suchausdruck entsprechen.\nBenutze Platzhalter Zeichen\n'*' und '?' wo benötigt." }, |
1279 | { "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, | ||
1280 | { "Details","Details" }, | ||
1281 | { "Created time","Erstellt Zeit" }, | ||
1282 | { "Last modified time","Geändert Zeit" }, | ||
1283 | { "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, | ||
1284 | { "View Options","Anzeige Optionen" }, | ||
1285 | { "<b>Created: ","<b>Erstellt am: " }, | ||
1286 | { "<b>Last modified: ","<b>Zuletzt geändert am: " }, | ||
1287 | { "","" }, | ||
1279 | { "","" }, | 1288 | { "","" }, |
1280 | { "","" }, | 1289 | { "","" }, |
1281 | { "","" }, | 1290 | { "","" }, |
1282 | { "","" }, | 1291 | { "","" }, |
1283 | { "","" }, \ No newline at end of file | 1292 | |
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 6a312b3..cead612 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp | |||
@@ -29,129 +29,132 @@ | |||
29 | 29 | ||
30 | #include <kiconloader.h> | 30 | #include <kiconloader.h> |
31 | #include <kdebug.h> | 31 | #include <kdebug.h> |
32 | #include <kglobal.h> | 32 | #include <kglobal.h> |
33 | #include <klocale.h> | 33 | #include <klocale.h> |
34 | #ifndef DESKTOP_VERSION | 34 | #ifndef DESKTOP_VERSION |
35 | #include <qpe/qpeapplication.h> | 35 | #include <qpe/qpeapplication.h> |
36 | #define AGENDA_ICON_SIZE 5 | 36 | #define AGENDA_ICON_SIZE 5 |
37 | #else | 37 | #else |
38 | #define AGENDA_ICON_SIZE 7 | 38 | #define AGENDA_ICON_SIZE 7 |
39 | #endif | 39 | #endif |
40 | #include <libkcal/icaldrag.h> | 40 | #include <libkcal/icaldrag.h> |
41 | #include <libkcal/vcaldrag.h> | 41 | #include <libkcal/vcaldrag.h> |
42 | #include <libkcal/kincidenceformatter.h> | 42 | #include <libkcal/kincidenceformatter.h> |
43 | extern int globalFlagBlockAgenda; | 43 | extern int globalFlagBlockAgenda; |
44 | extern int globalFlagBlockAgendaItemPaint; | 44 | extern int globalFlagBlockAgendaItemPaint; |
45 | extern int globalFlagBlockAgendaItemUpdate; | 45 | extern int globalFlagBlockAgendaItemUpdate; |
46 | 46 | ||
47 | #include "koprefs.h" | 47 | #include "koprefs.h" |
48 | 48 | ||
49 | #include "koagendaitem.h" | 49 | #include "koagendaitem.h" |
50 | //#include "koagendaitem.moc" | 50 | //#include "koagendaitem.moc" |
51 | 51 | ||
52 | 52 | ||
53 | //-------------------------------------------------------------------------- | 53 | //-------------------------------------------------------------------------- |
54 | 54 | ||
55 | QToolTipGroup *KOAgendaItem::mToolTipGroup = 0; | 55 | QToolTipGroup *KOAgendaItem::mToolTipGroup = 0; |
56 | 56 | ||
57 | //-------------------------------------------------------------------------- | 57 | //-------------------------------------------------------------------------- |
58 | 58 | ||
59 | class KOAgendaItemWhatsThis :public QWhatsThis | 59 | class KOAgendaItemWhatsThis :public QWhatsThis |
60 | { | 60 | { |
61 | public: | 61 | public: |
62 | KOAgendaItemWhatsThis( KOAgendaItem* view ) : QWhatsThis( view ),_view (view) { }; | 62 | KOAgendaItemWhatsThis( KOAgendaItem* view ) : QWhatsThis( view ),_view (view) { }; |
63 | 63 | ||
64 | protected: | 64 | protected: |
65 | virtual QString text( const QPoint& ) | 65 | virtual QString text( const QPoint& ) |
66 | { | 66 | { |
67 | return _view->getWhatsThisText() ; | 67 | return _view->getWhatsThisText() ; |
68 | } | 68 | } |
69 | private: | 69 | private: |
70 | KOAgendaItem * _view; | 70 | KOAgendaItem * _view; |
71 | }; | 71 | }; |
72 | 72 | ||
73 | KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday, | 73 | KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday, |
74 | const char *name,WFlags) : | 74 | const char *name,WFlags) : |
75 | QWidget(parent, name), mIncidence(incidence), mDate(qd) | 75 | QWidget(parent, name), mIncidence(incidence), mDate(qd) |
76 | { | 76 | { |
77 | #ifndef DESKTOP_VERSION | 77 | #ifndef DESKTOP_VERSION |
78 | QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); | 78 | QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); |
79 | #endif | 79 | #endif |
80 | new KOAgendaItemWhatsThis(this); | 80 | new KOAgendaItemWhatsThis(this); |
81 | int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase | 81 | int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase |
82 | setWFlags ( wflags); | 82 | setWFlags ( wflags); |
83 | mAllDay = allday; | 83 | mAllDay = allday; |
84 | init ( incidence, qd ); | 84 | init ( incidence, qd ); |
85 | setMouseTracking(true); | 85 | setMouseTracking(true); |
86 | //setAcceptDrops(true); | 86 | //setAcceptDrops(true); |
87 | xPaintCoord = -1; | 87 | xPaintCoord = -1; |
88 | yPaintCoord = -1; | 88 | yPaintCoord = -1; |
89 | } | 89 | } |
90 | QString KOAgendaItem::getWhatsThisText() | 90 | QString KOAgendaItem::getWhatsThisText() |
91 | { | 91 | { |
92 | if ( mIncidence ) | 92 | if ( mIncidence ) |
93 | return KIncidenceFormatter::instance()->getFormattedText( mIncidence ); | 93 | return KIncidenceFormatter::instance()->getFormattedText( mIncidence, |
94 | KOPrefs::instance()->mWTshowDetails, | ||
95 | KOPrefs::instance()->mWTshowCreated, | ||
96 | KOPrefs::instance()->mWTshowChanged); | ||
94 | return "KOAgendaItem::getWhatsThisText()::internal error"; | 97 | return "KOAgendaItem::getWhatsThisText()::internal error"; |
95 | } | 98 | } |
96 | void KOAgendaItem::init ( Incidence *incidence, QDate qd ) | 99 | void KOAgendaItem::init ( Incidence *incidence, QDate qd ) |
97 | { | 100 | { |
98 | mIncidence = incidence; | 101 | mIncidence = incidence; |
99 | mDate = qd; | 102 | mDate = qd; |
100 | mFirstMultiItem = 0; | 103 | mFirstMultiItem = 0; |
101 | mNextMultiItem = 0; | 104 | mNextMultiItem = 0; |
102 | mLastMultiItem = 0; | 105 | mLastMultiItem = 0; |
103 | computeText(); | 106 | computeText(); |
104 | 107 | ||
105 | if ( (incidence->type() == "Todo") && | 108 | if ( (incidence->type() == "Todo") && |
106 | ( !((static_cast<Todo*>(incidence))->isCompleted()) && | 109 | ( !((static_cast<Todo*>(incidence))->isCompleted()) && |
107 | ((static_cast<Todo*>(incidence))->dtDue().date() <= QDate::currentDate()) ) ) { | 110 | ((static_cast<Todo*>(incidence))->dtDue().date() <= QDate::currentDate()) ) ) { |
108 | if ( (static_cast<Todo*>(incidence))->dtDue() < QDateTime::currentDateTime().date()) | 111 | if ( (static_cast<Todo*>(incidence))->dtDue() < QDateTime::currentDateTime().date()) |
109 | mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; | 112 | mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; |
110 | else | 113 | else |
111 | mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor; | 114 | mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor; |
112 | } | 115 | } |
113 | else { | 116 | else { |
114 | QStringList categories = mIncidence->categories(); | 117 | QStringList categories = mIncidence->categories(); |
115 | QString cat = categories.first(); | 118 | QString cat = categories.first(); |
116 | if (cat.isEmpty()) { | 119 | if (cat.isEmpty()) { |
117 | if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) ) | 120 | if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) ) |
118 | mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; | 121 | mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; |
119 | else | 122 | else |
120 | mBackgroundColor =KOPrefs::instance()->mEventColor; | 123 | mBackgroundColor =KOPrefs::instance()->mEventColor; |
121 | } else { | 124 | } else { |
122 | mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); | 125 | mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); |
123 | if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) ) { | 126 | if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) ) { |
124 | if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) | 127 | if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) |
125 | mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; | 128 | mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; |
126 | } | 129 | } |
127 | } | 130 | } |
128 | 131 | ||
129 | } | 132 | } |
130 | mColorGroup = QColorGroup( mBackgroundColor.light(), | 133 | mColorGroup = QColorGroup( mBackgroundColor.light(), |
131 | mBackgroundColor.dark(),mBackgroundColor.light(), | 134 | mBackgroundColor.dark(),mBackgroundColor.light(), |
132 | mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ; | 135 | mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ; |
133 | setBackgroundColor( mBackgroundColor ); | 136 | setBackgroundColor( mBackgroundColor ); |
134 | 137 | ||
135 | setCellXY(0,0,1); | 138 | setCellXY(0,0,1); |
136 | setCellXWidth(0); | 139 | setCellXWidth(0); |
137 | setSubCell(0); | 140 | setSubCell(0); |
138 | setSubCells(1); | 141 | setSubCells(1); |
139 | setMultiItem(0,0,0); | 142 | setMultiItem(0,0,0); |
140 | startMove(); | 143 | startMove(); |
141 | mSelected = true; | 144 | mSelected = true; |
142 | select(false); | 145 | select(false); |
143 | QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont); | 146 | QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont); |
144 | mFontPixelSize = fontinf.height();; | 147 | mFontPixelSize = fontinf.height();; |
145 | hide(); | 148 | hide(); |
146 | xPaintCoord = -1; | 149 | xPaintCoord = -1; |
147 | yPaintCoord = -1; | 150 | yPaintCoord = -1; |
148 | } | 151 | } |
149 | 152 | ||
150 | 153 | ||
151 | KOAgendaItem::~KOAgendaItem() | 154 | KOAgendaItem::~KOAgendaItem() |
152 | { | 155 | { |
153 | // qDebug("deleteKOAgendaItem::~KOAgendaItem( "); | 156 | // qDebug("deleteKOAgendaItem::~KOAgendaItem( "); |
154 | 157 | ||
155 | } | 158 | } |
156 | 159 | ||
157 | void KOAgendaItem::recreateIncidence() | 160 | void KOAgendaItem::recreateIncidence() |
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index f6c9624..d87938a 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp | |||
@@ -278,210 +278,225 @@ void KOEventViewer::appendEvent(Event *event, int mode ) | |||
278 | } | 278 | } |
279 | if (event->doesFloat()) { | 279 | if (event->doesFloat()) { |
280 | if (event->isMultiDay()) { | 280 | if (event->isMultiDay()) { |
281 | mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") | 281 | mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") |
282 | .arg(event->dtStartDateStr(shortDate)) | 282 | .arg(event->dtStartDateStr(shortDate)) |
283 | .arg(event->dtEndDateStr(shortDate))); | 283 | .arg(event->dtEndDateStr(shortDate))); |
284 | } else { | 284 | } else { |
285 | mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); | 285 | mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); |
286 | } | 286 | } |
287 | } else { | 287 | } else { |
288 | if (event->isMultiDay()) { | 288 | if (event->isMultiDay()) { |
289 | mText.append(i18n("<p><b>From:</b> %1</p> ") | 289 | mText.append(i18n("<p><b>From:</b> %1</p> ") |
290 | .arg(event->dtStartStr( shortDate))); | 290 | .arg(event->dtStartStr( shortDate))); |
291 | mText.append(i18n("<p><b>To:</b> %1</p>") | 291 | mText.append(i18n("<p><b>To:</b> %1</p>") |
292 | .arg(event->dtEndStr(shortDate))); | 292 | .arg(event->dtEndStr(shortDate))); |
293 | } else { | 293 | } else { |
294 | mText.append(i18n("<p><b>On:</b> %1</p> ") | 294 | mText.append(i18n("<p><b>On:</b> %1</p> ") |
295 | .arg(event->dtStartDateStr( shortDate ))); | 295 | .arg(event->dtStartDateStr( shortDate ))); |
296 | mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") | 296 | mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") |
297 | .arg(event->dtStartTimeStr()) | 297 | .arg(event->dtStartTimeStr()) |
298 | .arg(event->dtEndTimeStr())); | 298 | .arg(event->dtEndTimeStr())); |
299 | } | 299 | } |
300 | } | 300 | } |
301 | 301 | ||
302 | if (event->recurrence()->doesRecur()) { | 302 | if (event->recurrence()->doesRecur()) { |
303 | 303 | ||
304 | QString recurText = event->recurrence()->recurrenceText(); | 304 | QString recurText = event->recurrence()->recurrenceText(); |
305 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); | 305 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); |
306 | bool ok; | 306 | bool ok; |
307 | QDate start = QDate::currentDate(); | 307 | QDate start = QDate::currentDate(); |
308 | QDateTime next; | 308 | QDateTime next; |
309 | next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); | 309 | next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); |
310 | if ( ok ) { | 310 | if ( ok ) { |
311 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); | 311 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); |
312 | addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); | 312 | addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); |
313 | mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true ); | 313 | mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true ); |
314 | 314 | ||
315 | } else { | 315 | } else { |
316 | bool last; | 316 | bool last; |
317 | QDate nextd; | 317 | QDate nextd; |
318 | nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); | 318 | nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); |
319 | if ( last ) { | 319 | if ( last ) { |
320 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); | 320 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); |
321 | addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); | 321 | addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); |
322 | } | 322 | } |
323 | } | 323 | } |
324 | } else { | 324 | } else { |
325 | mMailSubject += i18n(" - " )+event->dtStartStr( true ); | 325 | mMailSubject += i18n(" - " )+event->dtStartStr( true ); |
326 | 326 | ||
327 | } | 327 | } |
328 | 328 | ||
329 | 329 | ||
330 | if (event->isAlarmEnabled()) { | 330 | if (event->isAlarmEnabled()) { |
331 | Alarm *alarm =event->alarms().first() ; | 331 | Alarm *alarm =event->alarms().first() ; |
332 | QDateTime t = alarm->time(); | 332 | QDateTime t = alarm->time(); |
333 | int min = t.secsTo( event->dtStart() )/60; | 333 | int min = t.secsTo( event->dtStart() )/60; |
334 | QString s =i18n("( %1 min before )").arg( min ); | 334 | QString s =i18n("( %1 min before )").arg( min ); |
335 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); | 335 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); |
336 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); | 336 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); |
337 | //addTag("p",s); | 337 | //addTag("p",s); |
338 | } | 338 | } |
339 | 339 | ||
340 | addTag("b",i18n("Access: ")); | 340 | addTag("b",i18n("Access: ")); |
341 | mText.append(event->secrecyStr()+"<br>"); | 341 | mText.append(event->secrecyStr()+"<br>"); |
342 | if (!event->description().isEmpty()) { | 342 | |
343 | addTag("p",i18n("<b>Details: </b>")); | ||
344 | addTag("p",event->description()); | ||
345 | } | ||
346 | 343 | ||
344 | if ( KOPrefs::instance()->mEVshowDetails ) { | ||
345 | if (!event->description().isEmpty()) { | ||
346 | addTag("p",i18n("<b>Details: </b>")); | ||
347 | addTag("p",event->description()); | ||
348 | } | ||
349 | } | ||
347 | formatCategories(event); | 350 | formatCategories(event); |
348 | 351 | ||
349 | formatReadOnly(event); | 352 | formatReadOnly(event); |
350 | formatAttendees(event); | 353 | formatAttendees(event); |
351 | 354 | ||
355 | if ( KOPrefs::instance()->mEVshowCreated ) { | ||
356 | addTag("p",i18n("<b>Created: ") +" </b>"); | ||
357 | addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); | ||
358 | |||
359 | } | ||
360 | if ( KOPrefs::instance()->mEVshowChanged ) { | ||
361 | addTag("p",i18n("<b>Last modified: ") +" </b>"); | ||
362 | addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); | ||
363 | |||
364 | } | ||
352 | setText(mText); | 365 | setText(mText); |
353 | //QWhatsThis::add(this,mText); | 366 | //QWhatsThis::add(this,mText); |
354 | 367 | ||
355 | } | 368 | } |
356 | 369 | ||
357 | void KOEventViewer::appendTodo(Todo *event, int mode ) | 370 | void KOEventViewer::appendTodo(Todo *event, int mode ) |
358 | { | 371 | { |
359 | mMailSubject = ""; | 372 | mMailSubject = ""; |
360 | mCurrentIncidence = event; | 373 | mCurrentIncidence = event; |
361 | topLevelWidget()->setCaption(i18n("Todo Viewer")); | 374 | topLevelWidget()->setCaption(i18n("Todo Viewer")); |
362 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; | 375 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; |
363 | if (mode == 0 ) | 376 | if (mode == 0 ) |
364 | addTag("h2",event->summary()); | 377 | addTag("h2",event->summary()); |
365 | else { | 378 | else { |
366 | if ( mColorMode == 1 ) { | 379 | if ( mColorMode == 1 ) { |
367 | mText +="<font color=\"#00A000\">"; | 380 | mText +="<font color=\"#00A000\">"; |
368 | } | 381 | } |
369 | if ( mColorMode == 2 ) { | 382 | if ( mColorMode == 2 ) { |
370 | mText +="<font color=\"#B00000\">"; | 383 | mText +="<font color=\"#B00000\">"; |
371 | } | 384 | } |
372 | if ( mode == 1 ) { | 385 | if ( mode == 1 ) { |
373 | addTag("h2",i18n( "Local: " ) +event->summary()); | 386 | addTag("h2",i18n( "Local: " ) +event->summary()); |
374 | } else { | 387 | } else { |
375 | addTag("h2",i18n( "Remote: " ) +event->summary()); | 388 | addTag("h2",i18n( "Remote: " ) +event->summary()); |
376 | } | 389 | } |
377 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); | 390 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); |
378 | if ( mColorMode ) | 391 | if ( mColorMode ) |
379 | mText += "</font>"; | 392 | mText += "</font>"; |
380 | } | 393 | } |
381 | mMailSubject += i18n( "Todo " )+ event->summary(); | 394 | mMailSubject += i18n( "Todo " )+ event->summary(); |
382 | 395 | ||
383 | if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { | 396 | if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { |
384 | mText +="<font color=\"#B00000\">"; | 397 | mText +="<font color=\"#B00000\">"; |
385 | addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) ); | 398 | addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) ); |
386 | mText += "</font>"; | 399 | mText += "</font>"; |
387 | } else { | 400 | } else { |
388 | mText.append(i18n("<p><i>%1 % completed</i></p>") | 401 | mText.append(i18n("<p><i>%1 % completed</i></p>") |
389 | .arg(event->percentComplete())); | 402 | .arg(event->percentComplete())); |
390 | } | 403 | } |
391 | 404 | ||
392 | if (event->cancelled ()) { | 405 | if (event->cancelled ()) { |
393 | mText +="<font color=\"#B00000\">"; | 406 | mText +="<font color=\"#B00000\">"; |
394 | addTag("i",i18n("This todo has been cancelled!")); | 407 | addTag("i",i18n("This todo has been cancelled!")); |
395 | mText.append("<br>"); | 408 | mText.append("<br>"); |
396 | mText += "</font>"; | 409 | mText += "</font>"; |
397 | mMailSubject += i18n("(cancelled)"); | 410 | mMailSubject += i18n("(cancelled)"); |
398 | } | 411 | } |
399 | 412 | ||
400 | if (!event->location().isEmpty()) { | 413 | if (!event->location().isEmpty()) { |
401 | addTag("b",i18n("Location: ")); | 414 | addTag("b",i18n("Location: ")); |
402 | mText.append(event->location()+"<br>"); | 415 | mText.append(event->location()+"<br>"); |
403 | mMailSubject += i18n(" at ") + event->location(); | 416 | mMailSubject += i18n(" at ") + event->location(); |
404 | } | 417 | } |
405 | 418 | ||
406 | if (event->recurrence()->doesRecur()) { | 419 | if (event->recurrence()->doesRecur()) { |
407 | 420 | ||
408 | QString recurText = event->recurrence()->recurrenceText(); | 421 | QString recurText = event->recurrence()->recurrenceText(); |
409 | addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); | 422 | addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); |
410 | 423 | ||
411 | } | 424 | } |
412 | if (event->hasStartDate()) { | 425 | if (event->hasStartDate()) { |
413 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); | 426 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); |
414 | } | 427 | } |
415 | if (event->hasDueDate()) { | 428 | if (event->hasDueDate()) { |
416 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); | 429 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); |
417 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); | 430 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); |
418 | } | 431 | } |
419 | addTag("b",i18n("Access: ")); | 432 | addTag("b",i18n("Access: ")); |
420 | mText.append(event->secrecyStr()+"<br>"); | 433 | mText.append(event->secrecyStr()+"<br>"); |
421 | if (!event->description().isEmpty()) { | 434 | if ( KOPrefs::instance()->mEVshowDetails ) { |
422 | addTag("p",i18n("<b>Details: </b>")); | 435 | if (!event->description().isEmpty()) { |
423 | addTag("p",event->description()); | 436 | addTag("p",i18n("<b>Details: </b>")); |
437 | addTag("p",event->description()); | ||
438 | } | ||
424 | } | 439 | } |
425 | 440 | ||
426 | formatCategories(event); | 441 | formatCategories(event); |
427 | 442 | ||
428 | mText.append(i18n("<p><b>Priority:</b> %2</p>") | 443 | mText.append(i18n("<p><b>Priority:</b> %2</p>") |
429 | .arg(QString::number(event->priority()))); | 444 | .arg(QString::number(event->priority()))); |
430 | 445 | ||
431 | formatReadOnly(event); | 446 | formatReadOnly(event); |
432 | formatAttendees(event); | 447 | formatAttendees(event); |
433 | if ( event->relatedTo() ) { | 448 | if ( event->relatedTo() ) { |
434 | addTag("b",i18n("Parent todo:<br>")); | 449 | addTag("b",i18n("Parent todo:<br>")); |
435 | mText.append(event->relatedTo()->summary()+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); | 450 | mText.append(event->relatedTo()->summary()+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); |
436 | } | 451 | } |
437 | QPtrList<Incidence> Relations = event->relations(); | 452 | QPtrList<Incidence> Relations = event->relations(); |
438 | Incidence *to; | 453 | Incidence *to; |
439 | if ( Relations.first() ) | 454 | if ( Relations.first() ) |
440 | addTag("b",i18n("Sub todos:<br>")); | 455 | addTag("b",i18n("Sub todos:<br>")); |
441 | for (to=Relations.first();to;to=Relations.next()) { | 456 | for (to=Relations.first();to;to=Relations.next()) { |
442 | mText.append( to->summary()+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>"); | 457 | mText.append( to->summary()+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>"); |
443 | 458 | ||
444 | } | 459 | } |
445 | setText(mText); | 460 | setText(mText); |
446 | } | 461 | } |
447 | 462 | ||
448 | void KOEventViewer::formatCategories(Incidence *event) | 463 | void KOEventViewer::formatCategories(Incidence *event) |
449 | { | 464 | { |
450 | if (!event->categoriesStr().isEmpty()) { | 465 | if (!event->categoriesStr().isEmpty()) { |
451 | if (event->categories().count() == 1) { | 466 | if (event->categories().count() == 1) { |
452 | addTag("h3",i18n("Category")); | 467 | addTag("h3",i18n("Category")); |
453 | } else { | 468 | } else { |
454 | addTag("h3",i18n("Categories")); | 469 | addTag("h3",i18n("Categories")); |
455 | } | 470 | } |
456 | addTag("p",event->categoriesStr()); | 471 | addTag("p",event->categoriesStr()); |
457 | } | 472 | } |
458 | } | 473 | } |
459 | void KOEventViewer::formatAttendees(Incidence *event) | 474 | void KOEventViewer::formatAttendees(Incidence *event) |
460 | { | 475 | { |
461 | QPtrList<Attendee> attendees = event->attendees(); | 476 | QPtrList<Attendee> attendees = event->attendees(); |
462 | if (attendees.count()) { | 477 | if (attendees.count()) { |
463 | 478 | ||
464 | 479 | ||
465 | QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); | 480 | QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); |
466 | QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); | 481 | QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); |
467 | addTag("h3",i18n("Organizer")); | 482 | addTag("h3",i18n("Organizer")); |
468 | mText.append("<ul><li>"); | 483 | mText.append("<ul><li>"); |
469 | #ifndef KORG_NOKABC | 484 | #ifndef KORG_NOKABC |
470 | 485 | ||
471 | #ifdef DESKTOP_VERSION | 486 | #ifdef DESKTOP_VERSION |
472 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); | 487 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); |
473 | KABC::Addressee::List addressList; | 488 | KABC::Addressee::List addressList; |
474 | addressList = add_book->findByEmail(event->organizer()); | 489 | addressList = add_book->findByEmail(event->organizer()); |
475 | KABC::Addressee o = addressList.first(); | 490 | KABC::Addressee o = addressList.first(); |
476 | if (!o.isEmpty() && addressList.size()<2) { | 491 | if (!o.isEmpty() && addressList.size()<2) { |
477 | mText += "<a href=\"uid:" + o.uid() + "\">"; | 492 | mText += "<a href=\"uid:" + o.uid() + "\">"; |
478 | mText += o.formattedName(); | 493 | mText += o.formattedName(); |
479 | mText += "</a>\n"; | 494 | mText += "</a>\n"; |
480 | } else { | 495 | } else { |
481 | mText.append(event->organizer()); | 496 | mText.append(event->organizer()); |
482 | } | 497 | } |
483 | #else //DESKTOP_VERSION | 498 | #else //DESKTOP_VERSION |
484 | mText += "<a href=\"uid:organizer\">"; | 499 | mText += "<a href=\"uid:organizer\">"; |
485 | mText += event->organizer(); | 500 | mText += event->organizer(); |
486 | mText += "</a>\n"; | 501 | mText += "</a>\n"; |
487 | #endif //DESKTOP_VERSION | 502 | #endif //DESKTOP_VERSION |
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index d8e940b..1f5afc0 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -264,129 +264,132 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, | |||
264 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 264 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
265 | i18n("Delete all selected"),this, | 265 | i18n("Delete all selected"),this, |
266 | SLOT(deleteAll()),true); | 266 | SLOT(deleteAll()),true); |
267 | mPopupMenu->insertSeparator(); | 267 | mPopupMenu->insertSeparator(); |
268 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 268 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
269 | i18n("Save selected to file..."),this, | 269 | i18n("Save selected to file..."),this, |
270 | SLOT(saveToFile()),true); | 270 | SLOT(saveToFile()),true); |
271 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 271 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
272 | i18n("Save Journal/Description..."),this, | 272 | i18n("Save Journal/Description..."),this, |
273 | SLOT(saveDescriptionToFile()),true); | 273 | SLOT(saveDescriptionToFile()),true); |
274 | // mPopupMenu->insertSeparator(); | 274 | // mPopupMenu->insertSeparator(); |
275 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 275 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
276 | i18n("Add Categ. to selected..."),this, | 276 | i18n("Add Categ. to selected..."),this, |
277 | SLOT(addCat()),true); | 277 | SLOT(addCat()),true); |
278 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 278 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
279 | i18n("Set Categ. for selected..."),this, | 279 | i18n("Set Categ. for selected..."),this, |
280 | SLOT(setCat()),true); | 280 | SLOT(setCat()),true); |
281 | //mPopupMenu->insertSeparator(); | 281 | //mPopupMenu->insertSeparator(); |
282 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 282 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
283 | i18n("Set alarm for selected..."),this, | 283 | i18n("Set alarm for selected..."),this, |
284 | SLOT(setAlarm()),true); | 284 | SLOT(setAlarm()),true); |
285 | 285 | ||
286 | 286 | ||
287 | #ifndef DESKTOP_VERSION | 287 | #ifndef DESKTOP_VERSION |
288 | mPopupMenu->insertSeparator(); | 288 | mPopupMenu->insertSeparator(); |
289 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 289 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
290 | i18n("Beam selected via IR"),this, | 290 | i18n("Beam selected via IR"),this, |
291 | SLOT(beamSelected()),true); | 291 | SLOT(beamSelected()),true); |
292 | #endif | 292 | #endif |
293 | /* | 293 | /* |
294 | mPopupMenu = new QPopupMenu; | 294 | mPopupMenu = new QPopupMenu; |
295 | mPopupMenu->insertItem(i18n("Edit Event"), this, | 295 | mPopupMenu->insertItem(i18n("Edit Event"), this, |
296 | SLOT (editEvent())); | 296 | SLOT (editEvent())); |
297 | mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, | 297 | mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, |
298 | SLOT (deleteEvent())); | 298 | SLOT (deleteEvent())); |
299 | mPopupMenu->insertSeparator(); | 299 | mPopupMenu->insertSeparator(); |
300 | mPopupMenu->insertItem(i18n("Show Dates"), this, | 300 | mPopupMenu->insertItem(i18n("Show Dates"), this, |
301 | SLOT(showDates())); | 301 | SLOT(showDates())); |
302 | mPopupMenu->insertItem(i18n("Hide Dates"), this, | 302 | mPopupMenu->insertItem(i18n("Hide Dates"), this, |
303 | SLOT(hideDates())); | 303 | SLOT(hideDates())); |
304 | */ | 304 | */ |
305 | QObject::connect(mListView,SIGNAL( newEvent()), | 305 | QObject::connect(mListView,SIGNAL( newEvent()), |
306 | this,SIGNAL(signalNewEvent())); | 306 | this,SIGNAL(signalNewEvent())); |
307 | QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), | 307 | QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), |
308 | this,SLOT(defaultItemAction(QListViewItem *))); | 308 | this,SLOT(defaultItemAction(QListViewItem *))); |
309 | QObject::connect(mListView,SIGNAL(rightButtonClicked ( QListViewItem *, | 309 | QObject::connect(mListView,SIGNAL(rightButtonClicked ( QListViewItem *, |
310 | const QPoint &, int )), | 310 | const QPoint &, int )), |
311 | this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); | 311 | this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); |
312 | QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), | 312 | QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), |
313 | SLOT(processSelectionChange(QListViewItem *))); | 313 | SLOT(processSelectionChange(QListViewItem *))); |
314 | QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), | 314 | QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), |
315 | SIGNAL(showIncidenceSignal(Incidence *)) ); | 315 | SIGNAL(showIncidenceSignal(Incidence *)) ); |
316 | 316 | ||
317 | readSettings(KOGlobals::config(),"KOListView Layout"); | 317 | readSettings(KOGlobals::config(),"KOListView Layout"); |
318 | } | 318 | } |
319 | 319 | ||
320 | KOListView::~KOListView() | 320 | KOListView::~KOListView() |
321 | { | 321 | { |
322 | delete mPopupMenu; | 322 | delete mPopupMenu; |
323 | } | 323 | } |
324 | QString KOListView::getWhatsThisText(QPoint p) | 324 | QString KOListView::getWhatsThisText(QPoint p) |
325 | { | 325 | { |
326 | KOListViewItem* item = ( KOListViewItem* ) mListView->itemAt( p ); | 326 | KOListViewItem* item = ( KOListViewItem* ) mListView->itemAt( p ); |
327 | if ( item ) | 327 | if ( item ) |
328 | return KIncidenceFormatter::instance()->getFormattedText( item->data() ); | 328 | return KIncidenceFormatter::instance()->getFormattedText( item->data(), |
329 | KOPrefs::instance()->mWTshowDetails, | ||
330 | KOPrefs::instance()->mWTshowCreated, | ||
331 | KOPrefs::instance()->mWTshowChanged); | ||
329 | return i18n("That is the list view" ); | 332 | return i18n("That is the list view" ); |
330 | 333 | ||
331 | } | 334 | } |
332 | 335 | ||
333 | void KOListView::updateList() | 336 | void KOListView::updateList() |
334 | { | 337 | { |
335 | // qDebug(" KOListView::updateList() "); | 338 | // qDebug(" KOListView::updateList() "); |
336 | 339 | ||
337 | } | 340 | } |
338 | 341 | ||
339 | void KOListView::addCat( ) | 342 | void KOListView::addCat( ) |
340 | { | 343 | { |
341 | setCategories( false ); | 344 | setCategories( false ); |
342 | } | 345 | } |
343 | void KOListView::setCat() | 346 | void KOListView::setCat() |
344 | { | 347 | { |
345 | setCategories( true ); | 348 | setCategories( true ); |
346 | } | 349 | } |
347 | void KOListView::setAlarm() | 350 | void KOListView::setAlarm() |
348 | { | 351 | { |
349 | KOAlarmPrefs kap( this); | 352 | KOAlarmPrefs kap( this); |
350 | if ( !kap.exec() ) | 353 | if ( !kap.exec() ) |
351 | return; | 354 | return; |
352 | 355 | ||
353 | 356 | ||
354 | QStringList itemList; | 357 | QStringList itemList; |
355 | QPtrList<KOListViewItem> sel ; | 358 | QPtrList<KOListViewItem> sel ; |
356 | QListViewItem *qitem = mListView->firstChild (); | 359 | QListViewItem *qitem = mListView->firstChild (); |
357 | while ( qitem ) { | 360 | while ( qitem ) { |
358 | if ( qitem->isSelected() ) { | 361 | if ( qitem->isSelected() ) { |
359 | Incidence* inc = ((KOListViewItem *) qitem)->data(); | 362 | Incidence* inc = ((KOListViewItem *) qitem)->data(); |
360 | if ( inc->type() != "Journal" ) { | 363 | if ( inc->type() != "Journal" ) { |
361 | if ( inc->type() == "Todo" ) { | 364 | if ( inc->type() == "Todo" ) { |
362 | if ( ((Todo*)inc)->hasDueDate() ) | 365 | if ( ((Todo*)inc)->hasDueDate() ) |
363 | sel.append(((KOListViewItem *)qitem)); | 366 | sel.append(((KOListViewItem *)qitem)); |
364 | } else | 367 | } else |
365 | sel.append(((KOListViewItem *)qitem)); | 368 | sel.append(((KOListViewItem *)qitem)); |
366 | } | 369 | } |
367 | } | 370 | } |
368 | qitem = qitem->nextSibling(); | 371 | qitem = qitem->nextSibling(); |
369 | } | 372 | } |
370 | int count = 0; | 373 | int count = 0; |
371 | KOListViewItem * item, *temp; | 374 | KOListViewItem * item, *temp; |
372 | item = sel.first(); | 375 | item = sel.first(); |
373 | Incidence* inc; | 376 | Incidence* inc; |
374 | while ( item ) { | 377 | while ( item ) { |
375 | inc = item->data(); | 378 | inc = item->data(); |
376 | ++count; | 379 | ++count; |
377 | if (kap.mAlarmButton->isChecked()) { | 380 | if (kap.mAlarmButton->isChecked()) { |
378 | if (inc->alarms().count() == 0) | 381 | if (inc->alarms().count() == 0) |
379 | inc->newAlarm(); | 382 | inc->newAlarm(); |
380 | QPtrList<Alarm> alarms = inc->alarms(); | 383 | QPtrList<Alarm> alarms = inc->alarms(); |
381 | Alarm *alarm; | 384 | Alarm *alarm; |
382 | for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { | 385 | for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { |
383 | alarm->setEnabled(true); | 386 | alarm->setEnabled(true); |
384 | int j = kap.mAlarmTimeEdit->value()* -60; | 387 | int j = kap.mAlarmTimeEdit->value()* -60; |
385 | if (kap.mAlarmIncrCombo->currentItem() == 1) | 388 | if (kap.mAlarmIncrCombo->currentItem() == 1) |
386 | j = j * 60; | 389 | j = j * 60; |
387 | else if (kap.mAlarmIncrCombo->currentItem() == 2) | 390 | else if (kap.mAlarmIncrCombo->currentItem() == 2) |
388 | j = j * (60 * 24); | 391 | j = j * (60 * 24); |
389 | alarm->setStartOffset( j ); | 392 | alarm->setStartOffset( j ); |
390 | 393 | ||
391 | if (!kap.mAlarmProgram.isEmpty() && kap.mAlarmProgramButton->isOn()) { | 394 | if (!kap.mAlarmProgram.isEmpty() && kap.mAlarmProgramButton->isOn()) { |
392 | alarm->setProcedureAlarm(kap.mAlarmProgram); | 395 | alarm->setProcedureAlarm(kap.mAlarmProgram); |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index f9bc1ca..2fe80af 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -33,230 +33,232 @@ | |||
33 | #include <qpe/qpeapplication.h> | 33 | #include <qpe/qpeapplication.h> |
34 | #else | 34 | #else |
35 | #include <qapplication.h> | 35 | #include <qapplication.h> |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | #include <kdebug.h> | 38 | #include <kdebug.h> |
39 | #include <klocale.h> | 39 | #include <klocale.h> |
40 | #include <kglobal.h> | 40 | #include <kglobal.h> |
41 | #include <kconfig.h> | 41 | #include <kconfig.h> |
42 | #include <kiconloader.h> | 42 | #include <kiconloader.h> |
43 | 43 | ||
44 | #include <kcalendarsystem.h> | 44 | #include <kcalendarsystem.h> |
45 | 45 | ||
46 | #ifndef KORG_NOPRINTER | 46 | #ifndef KORG_NOPRINTER |
47 | #include "calprinter.h" | 47 | #include "calprinter.h" |
48 | #endif | 48 | #endif |
49 | #include "koprefs.h" | 49 | #include "koprefs.h" |
50 | #ifndef KORG_NOPLUGINS | 50 | #ifndef KORG_NOPLUGINS |
51 | #include "kocore.h" | 51 | #include "kocore.h" |
52 | #endif | 52 | #endif |
53 | #include "koglobals.h" | 53 | #include "koglobals.h" |
54 | #include <libkcal/kincidenceformatter.h> | 54 | #include <libkcal/kincidenceformatter.h> |
55 | 55 | ||
56 | #include "komonthview.h" | 56 | #include "komonthview.h" |
57 | 57 | ||
58 | #define PIXMAP_SIZE 5 | 58 | #define PIXMAP_SIZE 5 |
59 | #ifdef DESKTOP_VERSION | 59 | #ifdef DESKTOP_VERSION |
60 | QToolTipGroup *MonthViewCell::mToolTipGroup = 0; | 60 | QToolTipGroup *MonthViewCell::mToolTipGroup = 0; |
61 | #endif | 61 | #endif |
62 | class KNOWhatsThis :public QWhatsThis | 62 | class KNOWhatsThis :public QWhatsThis |
63 | { | 63 | { |
64 | public: | 64 | public: |
65 | KNOWhatsThis( KNoScrollListBox* sbox ) : QWhatsThis( sbox ), _wid( sbox) { }; | 65 | KNOWhatsThis( KNoScrollListBox* sbox ) : QWhatsThis( sbox ), _wid( sbox) { }; |
66 | //~KNOWhatsThis( ) {qDebug("~KNOWhatsThis( ) "); }; | 66 | //~KNOWhatsThis( ) {qDebug("~KNOWhatsThis( ) "); }; |
67 | 67 | ||
68 | protected: | 68 | protected: |
69 | virtual QString text( const QPoint& p) | 69 | virtual QString text( const QPoint& p) |
70 | { | 70 | { |
71 | return _wid->getWhatsThisText(p) ; | 71 | return _wid->getWhatsThisText(p) ; |
72 | }; | 72 | }; |
73 | private: | 73 | private: |
74 | KNoScrollListBox* _wid; | 74 | KNoScrollListBox* _wid; |
75 | 75 | ||
76 | }; | 76 | }; |
77 | 77 | ||
78 | 78 | ||
79 | KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) | 79 | KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) |
80 | : QListBox(parent, name, WRepaintNoErase) | 80 | : QListBox(parent, name, WRepaintNoErase) |
81 | { | 81 | { |
82 | #ifndef DESKTOP_VERSION | 82 | #ifndef DESKTOP_VERSION |
83 | QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); | 83 | QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); |
84 | #endif | 84 | #endif |
85 | mWT = new KNOWhatsThis(this); | 85 | mWT = new KNOWhatsThis(this); |
86 | } | 86 | } |
87 | KNoScrollListBox::~KNoScrollListBox() | 87 | KNoScrollListBox::~KNoScrollListBox() |
88 | { | 88 | { |
89 | 89 | ||
90 | } | 90 | } |
91 | QString KNoScrollListBox::getWhatsThisText(QPoint p) | 91 | QString KNoScrollListBox::getWhatsThisText(QPoint p) |
92 | { | 92 | { |
93 | QListBoxItem* item = itemAt ( p ); | 93 | QListBoxItem* item = itemAt ( p ); |
94 | if ( ! item ) { | 94 | if ( ! item ) { |
95 | return i18n("Click in the cell\nto add an event!"); | 95 | return i18n("Click in the cell\nto add an event!"); |
96 | } | 96 | } |
97 | return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence()); | 97 | return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence(), |
98 | KOPrefs::instance()->mWTshowDetails, | ||
99 | KOPrefs::instance()->mWTshowCreated, | ||
100 | KOPrefs::instance()->mWTshowChanged); | ||
98 | } | 101 | } |
99 | void KNoScrollListBox::keyPressEvent(QKeyEvent *e) | 102 | void KNoScrollListBox::keyPressEvent(QKeyEvent *e) |
100 | { | 103 | { |
101 | 104 | ||
102 | switch(e->key()) { | 105 | switch(e->key()) { |
103 | case Key_Right: | 106 | case Key_Right: |
104 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 107 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
105 | { | 108 | { |
106 | e->ignore(); | 109 | e->ignore(); |
107 | return; | 110 | return; |
108 | } | 111 | } |
109 | scrollBy(10,0); | 112 | scrollBy(10,0); |
110 | break; | 113 | break; |
111 | case Key_Left: | 114 | case Key_Left: |
112 | if (e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 115 | if (e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
113 | { | 116 | { |
114 | e->ignore(); | 117 | e->ignore(); |
115 | return; | 118 | return; |
116 | } | 119 | } |
117 | scrollBy(-10,0); | 120 | scrollBy(-10,0); |
118 | break; | 121 | break; |
119 | case Key_Up: | 122 | case Key_Up: |
120 | if( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { | 123 | if( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { |
121 | e->ignore(); | 124 | e->ignore(); |
122 | break; | 125 | break; |
123 | } | 126 | } |
124 | setCurrentItem((currentItem()+count()-1)%count()); | 127 | setCurrentItem((currentItem()+count()-1)%count()); |
125 | if(!itemVisible(currentItem())) { | 128 | if(!itemVisible(currentItem())) { |
126 | if((unsigned int) currentItem() == (count()-1)) { | 129 | if((unsigned int) currentItem() == (count()-1)) { |
127 | setTopItem(currentItem()-numItemsVisible()+1); | 130 | setTopItem(currentItem()-numItemsVisible()+1); |
128 | } else { | 131 | } else { |
129 | setTopItem(topItem()-1); | 132 | setTopItem(topItem()-1); |
130 | } | 133 | } |
131 | } | 134 | } |
132 | break; | 135 | break; |
133 | case Key_Down: | 136 | case Key_Down: |
134 | if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { | 137 | if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { |
135 | e->ignore(); | 138 | e->ignore(); |
136 | break; | 139 | break; |
137 | } | 140 | } |
138 | setCurrentItem((currentItem()+1)%count()); | 141 | setCurrentItem((currentItem()+1)%count()); |
139 | if(!itemVisible(currentItem())) { | 142 | if(!itemVisible(currentItem())) { |
140 | if(currentItem() == 0) { | 143 | if(currentItem() == 0) { |
141 | setTopItem(0); | 144 | setTopItem(0); |
142 | } else { | 145 | } else { |
143 | setTopItem(topItem()+1); | 146 | setTopItem(topItem()+1); |
144 | } | 147 | } |
145 | } | 148 | } |
146 | break; | 149 | break; |
147 | case Key_I: | 150 | case Key_I: |
148 | QTimer::singleShot( 11, this, SLOT ( oneDown() ) ); | 151 | QTimer::singleShot( 11, this, SLOT ( oneDown() ) ); |
149 | e->ignore(); | 152 | e->ignore(); |
150 | break; | 153 | break; |
151 | case Key_Shift: | 154 | case Key_Shift: |
152 | emit shiftDown(); | 155 | emit shiftDown(); |
153 | break; | 156 | break; |
154 | default: | 157 | default: |
155 | e->ignore(); | 158 | e->ignore(); |
156 | break; | 159 | break; |
157 | } | 160 | } |
158 | } | 161 | } |
159 | 162 | ||
160 | void KNoScrollListBox::oneDown() | 163 | void KNoScrollListBox::oneDown() |
161 | { | 164 | { |
162 | setCurrentItem((currentItem()+1)%count()); | 165 | setCurrentItem((currentItem()+1)%count()); |
163 | if(!itemVisible(currentItem())) { | 166 | if(!itemVisible(currentItem())) { |
164 | if(currentItem() == 0) { | 167 | if(currentItem() == 0) { |
165 | setTopItem(0); | 168 | setTopItem(0); |
166 | } else { | 169 | } else { |
167 | setTopItem(topItem()+1); | 170 | setTopItem(topItem()+1); |
168 | } | 171 | } |
169 | } | 172 | } |
170 | } | 173 | } |
171 | void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) | 174 | void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) |
172 | { | 175 | { |
173 | switch(e->key()) { | 176 | switch(e->key()) { |
174 | case Key_Shift: | 177 | case Key_Shift: |
175 | emit shiftUp(); | 178 | emit shiftUp(); |
176 | break; | 179 | break; |
177 | default: | 180 | default: |
178 | break; | 181 | break; |
179 | } | 182 | } |
180 | } | 183 | } |
181 | 184 | ||
182 | void KNoScrollListBox::mousePressEvent(QMouseEvent *e) | 185 | void KNoScrollListBox::mousePressEvent(QMouseEvent *e) |
183 | { | 186 | { |
184 | QListBox::mousePressEvent(e); | 187 | QListBox::mousePressEvent(e); |
185 | 188 | ||
186 | if(e->button() == RightButton) { | 189 | if(e->button() == RightButton) { |
187 | emit rightClick(); | 190 | emit rightClick(); |
188 | } | 191 | } |
189 | } | 192 | } |
190 | 193 | ||
191 | MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s) | 194 | MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s) |
192 | : QListBoxItem() | 195 | : QListBoxItem() |
193 | { | 196 | { |
194 | setText( s ); | 197 | setText( s ); |
195 | 198 | ||
196 | mIncidence = incidence; | 199 | mIncidence = incidence; |
197 | mDate = qd; | 200 | mDate = qd; |
198 | // QWhatsThis::add(this,KIncidenceFormatter::instance()->getFormattedText( mIncidence )); | ||
199 | mRecur = false; | 201 | mRecur = false; |
200 | mAlarm = false; | 202 | mAlarm = false; |
201 | mReply = false; | 203 | mReply = false; |
202 | mInfo = false; | 204 | mInfo = false; |
203 | } | 205 | } |
204 | 206 | ||
205 | void MonthViewItem::paint(QPainter *p) | 207 | void MonthViewItem::paint(QPainter *p) |
206 | { | 208 | { |
207 | #if QT_VERSION >= 0x030000 | 209 | #if QT_VERSION >= 0x030000 |
208 | bool sel = isSelected(); | 210 | bool sel = isSelected(); |
209 | #else | 211 | #else |
210 | bool sel = selected(); | 212 | bool sel = selected(); |
211 | #endif | 213 | #endif |
212 | 214 | ||
213 | 215 | ||
214 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) | 216 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) |
215 | { | 217 | { |
216 | p->setBackgroundColor( palette().color( QPalette::Normal, \ | 218 | p->setBackgroundColor( palette().color( QPalette::Normal, \ |
217 | sel ? QColorGroup::Highlight : QColorGroup::Background ) ); | 219 | sel ? QColorGroup::Highlight : QColorGroup::Background ) ); |
218 | p->eraseRect( 0, 0, listBox()->maxItemWidth(), height( listBox() ) ); | 220 | p->eraseRect( 0, 0, listBox()->maxItemWidth(), height( listBox() ) ); |
219 | } | 221 | } |
220 | int x = 1; | 222 | int x = 1; |
221 | int y = 3;//(height() - mRecurPixmap.height()) /2; | 223 | int y = 3;//(height() - mRecurPixmap.height()) /2; |
222 | int size = PIXMAP_SIZE; | 224 | int size = PIXMAP_SIZE; |
223 | if ( QApplication::desktop()->width() < 300 ) | 225 | if ( QApplication::desktop()->width() < 300 ) |
224 | size = 3; | 226 | size = 3; |
225 | if ( KOPrefs::instance()->mMonthShowIcons ) { | 227 | if ( KOPrefs::instance()->mMonthShowIcons ) { |
226 | if ( mInfo ) { | 228 | if ( mInfo ) { |
227 | p->fillRect ( x, y,size,size, Qt::darkGreen ); | 229 | p->fillRect ( x, y,size,size, Qt::darkGreen ); |
228 | x += size + 1; | 230 | x += size + 1; |
229 | } | 231 | } |
230 | if ( mRecur ) { | 232 | if ( mRecur ) { |
231 | p->fillRect ( x, y,size,size, Qt::blue ); | 233 | p->fillRect ( x, y,size,size, Qt::blue ); |
232 | x += size + 1; | 234 | x += size + 1; |
233 | } | 235 | } |
234 | if ( mAlarm ) { | 236 | if ( mAlarm ) { |
235 | p->fillRect ( x, y,size,size, Qt::red ); | 237 | p->fillRect ( x, y,size,size, Qt::red ); |
236 | x += size + 1; | 238 | x += size + 1; |
237 | } | 239 | } |
238 | if ( mReply ) { | 240 | if ( mReply ) { |
239 | p->fillRect ( x, y,size,size, Qt::yellow ); | 241 | p->fillRect ( x, y,size,size, Qt::yellow ); |
240 | x += size + 1; | 242 | x += size + 1; |
241 | } | 243 | } |
242 | } | 244 | } |
243 | QFontMetrics fm = p->fontMetrics(); | 245 | QFontMetrics fm = p->fontMetrics(); |
244 | int yPos; | 246 | int yPos; |
245 | int pmheight = size; | 247 | int pmheight = size; |
246 | if( pmheight < fm.height() ) | 248 | if( pmheight < fm.height() ) |
247 | yPos = fm.ascent() + fm.leading()/2; | 249 | yPos = fm.ascent() + fm.leading()/2; |
248 | else | 250 | else |
249 | yPos = pmheight/2 - fm.height()/2 + fm.ascent(); | 251 | yPos = pmheight/2 - fm.height()/2 + fm.ascent(); |
250 | p->setPen( palette().color( QPalette::Normal, sel ? \ | 252 | p->setPen( palette().color( QPalette::Normal, sel ? \ |
251 | QColorGroup::HighlightedText : QColorGroup::Foreground ) ); | 253 | QColorGroup::HighlightedText : QColorGroup::Foreground ) ); |
252 | p->drawText( x, yPos, text() ); | 254 | p->drawText( x, yPos, text() ); |
253 | if ( mIncidence->cancelled() ) { | 255 | if ( mIncidence->cancelled() ) { |
254 | int wid = fm.width( text() ); | 256 | int wid = fm.width( text() ); |
255 | p->drawLine( x, yPos- fm.height()/2+3,x+wid, yPos- fm.height()/2 +3); | 257 | p->drawLine( x, yPos- fm.height()/2+3,x+wid, yPos- fm.height()/2 +3); |
256 | } | 258 | } |
257 | 259 | ||
258 | } | 260 | } |
259 | 261 | ||
260 | int MonthViewItem::height(const QListBox *lb) const | 262 | int MonthViewItem::height(const QListBox *lb) const |
261 | { | 263 | { |
262 | return lb->fontMetrics().lineSpacing()+1; | 264 | return lb->fontMetrics().lineSpacing()+1; |
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 5efc247..a91074f 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -230,129 +230,135 @@ KOPrefs::KOPrefs() : | |||
230 | addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); | 230 | addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); |
231 | addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); | 231 | addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); |
232 | addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); | 232 | addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); |
233 | addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); | 233 | addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); |
234 | addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); | 234 | addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); |
235 | addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); | 235 | addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); |
236 | addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; | 236 | addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; |
237 | addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); | 237 | addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); |
238 | addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); | 238 | addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); |
239 | addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); | 239 | addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); |
240 | addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); | 240 | addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); |
241 | addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); | 241 | addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); |
242 | addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); | 242 | addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); |
243 | addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); | 243 | addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); |
244 | addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); | 244 | addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); |
245 | addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); | 245 | addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); |
246 | addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); | 246 | addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); |
247 | #ifdef DESKTOP_VERSION | 247 | #ifdef DESKTOP_VERSION |
248 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); | 248 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); |
249 | #else | 249 | #else |
250 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); | 250 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); |
251 | #endif | 251 | #endif |
252 | addItemInt("Day Begins",&mDayBegins,7); | 252 | addItemInt("Day Begins",&mDayBegins,7); |
253 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); | 253 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); |
254 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); | 254 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); |
255 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); | 255 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); |
256 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); | 256 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); |
257 | 257 | ||
258 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); | 258 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); |
259 | addItemBool("Full View Month",&mFullViewMonth,true); | 259 | addItemBool("Full View Month",&mFullViewMonth,true); |
260 | addItemBool("Full View Todo",&mFullViewTodo,true); | 260 | addItemBool("Full View Todo",&mFullViewTodo,true); |
261 | addItemBool("Quick Todo",&mEnableQuickTodo,false); | 261 | addItemBool("Quick Todo",&mEnableQuickTodo,false); |
262 | 262 | ||
263 | addItemInt("Next X Days",&mNextXDays,3); | 263 | addItemInt("Next X Days",&mNextXDays,3); |
264 | 264 | ||
265 | KPrefs::setCurrentGroup("Printer"); | 265 | KPrefs::setCurrentGroup("Printer"); |
266 | 266 | ||
267 | KPrefs::setCurrentGroup("Layout"); | 267 | KPrefs::setCurrentGroup("Layout"); |
268 | 268 | ||
269 | addItemBool("CompactDialogs",&mCompactDialogs,false); | 269 | addItemBool("CompactDialogs",&mCompactDialogs,false); |
270 | addItemBool("VerticalScreen",&mVerticalScreen,true); | 270 | addItemBool("VerticalScreen",&mVerticalScreen,true); |
271 | 271 | ||
272 | KPrefs::setCurrentGroup("KOrganizer Plugins"); | 272 | KPrefs::setCurrentGroup("KOrganizer Plugins"); |
273 | 273 | ||
274 | addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); | 274 | addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); |
275 | 275 | ||
276 | KPrefs::setCurrentGroup("Group Scheduling"); | 276 | KPrefs::setCurrentGroup("Group Scheduling"); |
277 | 277 | ||
278 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); | 278 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); |
279 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); | 279 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); |
280 | addItemStringList("AdditionalMails",&mAdditionalMails,""); | 280 | addItemStringList("AdditionalMails",&mAdditionalMails,""); |
281 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); | 281 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); |
282 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); | 282 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); |
283 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); | 283 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); |
284 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); | 284 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); |
285 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); | 285 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); |
286 | 286 | ||
287 | KPrefs::setCurrentGroup( "Editors" ); | 287 | KPrefs::setCurrentGroup( "Editors" ); |
288 | 288 | ||
289 | addItemStringList( "EventTemplates", &mEventTemplates ); | 289 | addItemStringList( "EventTemplates", &mEventTemplates ); |
290 | addItemStringList( "TodoTemplates", &mTodoTemplates ); | 290 | addItemStringList( "TodoTemplates", &mTodoTemplates ); |
291 | 291 | ||
292 | addItemInt("DestinationPolicy",&mDestination,standardDestination); | 292 | addItemInt("DestinationPolicy",&mDestination,standardDestination); |
293 | 293 | ||
294 | 294 | KPrefs::setCurrentGroup( "ViewOptions" ); | |
295 | addItemBool("EVshowDetails",&mEVshowDetails,true); | ||
296 | addItemBool("EVshowCreated",&mEVshowCreated,true); | ||
297 | addItemBool("EVshowChanged",&mEVshowChanged,true); | ||
298 | addItemBool("WTshowDetails",&mWTshowDetails,false); | ||
299 | addItemBool("WTshowCreated",&mWTshowCreated,false); | ||
300 | addItemBool("WTshowChanged",&mWTshowChanged,false); | ||
295 | 301 | ||
296 | } | 302 | } |
297 | 303 | ||
298 | 304 | ||
299 | KOPrefs::~KOPrefs() | 305 | KOPrefs::~KOPrefs() |
300 | { | 306 | { |
301 | if (mInstance == this) | 307 | if (mInstance == this) |
302 | mInstance = insd.setObject(0); | 308 | mInstance = insd.setObject(0); |
303 | 309 | ||
304 | //qDebug("KOPrefs::~KOPrefs() "); | 310 | //qDebug("KOPrefs::~KOPrefs() "); |
305 | } | 311 | } |
306 | 312 | ||
307 | 313 | ||
308 | KOPrefs *KOPrefs::instance() | 314 | KOPrefs *KOPrefs::instance() |
309 | { | 315 | { |
310 | if (!mInstance) { | 316 | if (!mInstance) { |
311 | mInstance = insd.setObject(new KOPrefs()); | 317 | mInstance = insd.setObject(new KOPrefs()); |
312 | mInstance->readConfig(); | 318 | mInstance->readConfig(); |
313 | } | 319 | } |
314 | 320 | ||
315 | return mInstance; | 321 | return mInstance; |
316 | } | 322 | } |
317 | 323 | ||
318 | void KOPrefs::usrSetDefaults() | 324 | void KOPrefs::usrSetDefaults() |
319 | { | 325 | { |
320 | 326 | ||
321 | } | 327 | } |
322 | 328 | ||
323 | void KOPrefs::fillMailDefaults() | 329 | void KOPrefs::fillMailDefaults() |
324 | { | 330 | { |
325 | if (mName.isEmpty()) mName = i18n("Anonymous"); | 331 | if (mName.isEmpty()) mName = i18n("Anonymous"); |
326 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); | 332 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); |
327 | } | 333 | } |
328 | 334 | ||
329 | void KOPrefs::setTimeZoneIdDefault() | 335 | void KOPrefs::setTimeZoneIdDefault() |
330 | { | 336 | { |
331 | ; | 337 | ; |
332 | } | 338 | } |
333 | 339 | ||
334 | void KOPrefs::setAllDefaults() | 340 | void KOPrefs::setAllDefaults() |
335 | { | 341 | { |
336 | setCategoryDefaults(); | 342 | setCategoryDefaults(); |
337 | mEventSummaryUser = getDefaultList() ; | 343 | mEventSummaryUser = getDefaultList() ; |
338 | mTodoSummaryUser = getDefaultList() ; | 344 | mTodoSummaryUser = getDefaultList() ; |
339 | mLocationDefaults = getLocationDefaultList(); | 345 | mLocationDefaults = getLocationDefaultList(); |
340 | } | 346 | } |
341 | 347 | ||
342 | void KOPrefs::setCategoryDefaults() | 348 | void KOPrefs::setCategoryDefaults() |
343 | { | 349 | { |
344 | mCustomCategories.clear(); | 350 | mCustomCategories.clear(); |
345 | mCustomCategories = getDefaultList(); | 351 | mCustomCategories = getDefaultList(); |
346 | 352 | ||
347 | QStringList::Iterator it; | 353 | QStringList::Iterator it; |
348 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { | 354 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { |
349 | setCategoryColor(*it,mDefaultCategoryColor); | 355 | setCategoryColor(*it,mDefaultCategoryColor); |
350 | } | 356 | } |
351 | } | 357 | } |
352 | QStringList KOPrefs::getLocationDefaultList() | 358 | QStringList KOPrefs::getLocationDefaultList() |
353 | { | 359 | { |
354 | QStringList retval ; | 360 | QStringList retval ; |
355 | retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") | 361 | retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") |
356 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") | 362 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") |
357 | << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") | 363 | << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") |
358 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; | 364 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; |
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index e300067..e4e3dd7 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h | |||
@@ -208,77 +208,85 @@ class KOPrefs : public KPimPrefs | |||
208 | 208 | ||
209 | QStringList mSelectedPlugins; | 209 | QStringList mSelectedPlugins; |
210 | 210 | ||
211 | QString mLastImportFile; | 211 | QString mLastImportFile; |
212 | QString mLastVcalFile; | 212 | QString mLastVcalFile; |
213 | QString mLastSaveFile; | 213 | QString mLastSaveFile; |
214 | QString mLastLoadFile; | 214 | QString mLastLoadFile; |
215 | 215 | ||
216 | 216 | ||
217 | QString mDefaultAlarmFile; | 217 | QString mDefaultAlarmFile; |
218 | int mIMIPScheduler; | 218 | int mIMIPScheduler; |
219 | int mIMIPSend; | 219 | int mIMIPSend; |
220 | QStringList mAdditionalMails; | 220 | QStringList mAdditionalMails; |
221 | int mIMIPAutoRefresh; | 221 | int mIMIPAutoRefresh; |
222 | int mIMIPAutoInsertReply; | 222 | int mIMIPAutoInsertReply; |
223 | int mIMIPAutoInsertRequest; | 223 | int mIMIPAutoInsertRequest; |
224 | int mIMIPAutoFreeBusy; | 224 | int mIMIPAutoFreeBusy; |
225 | int mIMIPAutoFreeBusyReply; | 225 | int mIMIPAutoFreeBusyReply; |
226 | 226 | ||
227 | QStringList mTodoTemplates; | 227 | QStringList mTodoTemplates; |
228 | QStringList mEventTemplates; | 228 | QStringList mEventTemplates; |
229 | 229 | ||
230 | int mDestination; | 230 | int mDestination; |
231 | 231 | ||
232 | 232 | ||
233 | bool mEditOnDoubleClick; | 233 | bool mEditOnDoubleClick; |
234 | bool mViewChangeHoldFullscreen; | 234 | bool mViewChangeHoldFullscreen; |
235 | bool mViewChangeHoldNonFullscreen; | 235 | bool mViewChangeHoldNonFullscreen; |
236 | bool mCenterOnCurrentTime; | 236 | bool mCenterOnCurrentTime; |
237 | bool mSetTimeToDayStartAt; | 237 | bool mSetTimeToDayStartAt; |
238 | bool mHighlightCurrentDay; | 238 | bool mHighlightCurrentDay; |
239 | bool mUseHighlightLightColor; | 239 | bool mUseHighlightLightColor; |
240 | bool mListViewMonthTimespan; | 240 | bool mListViewMonthTimespan; |
241 | bool mWNViewShowsParents; | 241 | bool mWNViewShowsParents; |
242 | bool mWNViewShowsPast; | 242 | bool mWNViewShowsPast; |
243 | bool mWNViewShowLocation; | 243 | bool mWNViewShowLocation; |
244 | bool mTodoViewShowsPercentage; | 244 | bool mTodoViewShowsPercentage; |
245 | bool mTodoViewUsesCatColors; | 245 | bool mTodoViewUsesCatColors; |
246 | bool mMonthViewUsesBigFont; | 246 | bool mMonthViewUsesBigFont; |
247 | bool mTodoViewUsesSmallFont; | 247 | bool mTodoViewUsesSmallFont; |
248 | bool mTodoViewUsesForegroundColor; | 248 | bool mTodoViewUsesForegroundColor; |
249 | bool mMonthViewUsesForegroundColor; | 249 | bool mMonthViewUsesForegroundColor; |
250 | 250 | ||
251 | bool mHightlightDateTimeEdit; | 251 | bool mHightlightDateTimeEdit; |
252 | bool mShortDateInViewer; | 252 | bool mShortDateInViewer; |
253 | 253 | ||
254 | bool mShowDateNavigator; | 254 | bool mShowDateNavigator; |
255 | 255 | ||
256 | QStringList mLocationDefaults; | 256 | QStringList mLocationDefaults; |
257 | QStringList mEventSummaryUser; | 257 | QStringList mEventSummaryUser; |
258 | QStringList mTodoSummaryUser; | 258 | QStringList mTodoSummaryUser; |
259 | 259 | ||
260 | bool mUseInternalAlarmNotification; | 260 | bool mUseInternalAlarmNotification; |
261 | int mAlarmPlayBeeps; | 261 | int mAlarmPlayBeeps; |
262 | int mAlarmSuspendTime; | 262 | int mAlarmSuspendTime; |
263 | int mAlarmSuspendCount; | 263 | int mAlarmSuspendCount; |
264 | int mAlarmBeepInterval; | 264 | int mAlarmBeepInterval; |
265 | int mOldLanguage; | 265 | int mOldLanguage; |
266 | int mOldLoadedLanguage; | 266 | int mOldLoadedLanguage; |
267 | 267 | ||
268 | 268 | ||
269 | QString mActiveSyncPort; | 269 | QString mActiveSyncPort; |
270 | QString mActiveSyncIP; | 270 | QString mActiveSyncIP; |
271 | 271 | ||
272 | // settings for eventviewer | ||
273 | bool mEVshowDetails; | ||
274 | bool mEVshowCreated; | ||
275 | bool mEVshowChanged; | ||
276 | bool mWTshowDetails; | ||
277 | bool mWTshowCreated; | ||
278 | bool mWTshowChanged; | ||
279 | |||
272 | private: | 280 | private: |
273 | QDict<QColor> mCategoryColors; | 281 | QDict<QColor> mCategoryColors; |
274 | QColor mDefaultCategoryColor; | 282 | QColor mDefaultCategoryColor; |
275 | 283 | ||
276 | QFont mDefaultTimeBarFont; | 284 | QFont mDefaultTimeBarFont; |
277 | QFont mDefaultViewFont; | 285 | QFont mDefaultViewFont; |
278 | QFont mDefaultMonthViewFont; | 286 | QFont mDefaultMonthViewFont; |
279 | 287 | ||
280 | QString mName; | 288 | QString mName; |
281 | QString mEmail; | 289 | QString mEmail; |
282 | }; | 290 | }; |
283 | 291 | ||
284 | #endif | 292 | #endif |
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index 452d019..443508d 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp | |||
@@ -843,128 +843,160 @@ void KOPrefsDialog::setupViewsTab() | |||
843 | topLayout = new QGridLayout(topFrame,4,1); | 843 | topLayout = new QGridLayout(topFrame,4,1); |
844 | topLayout->setSpacing(spacingHint()); | 844 | topLayout->setSpacing(spacingHint()); |
845 | topLayout->setMargin(marginHint()); | 845 | topLayout->setMargin(marginHint()); |
846 | ii = 0; | 846 | ii = 0; |
847 | dummy = | 847 | dummy = |
848 | addWidBool(i18n("Hide not running Todos in To-do view"), | 848 | addWidBool(i18n("Hide not running Todos in To-do view"), |
849 | &(KOPrefs::instance()->mHideNonStartedTodos),topFrame); | 849 | &(KOPrefs::instance()->mHideNonStartedTodos),topFrame); |
850 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 850 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
851 | 851 | ||
852 | 852 | ||
853 | KPrefsDialogWidBool *showCompletedTodo = | 853 | KPrefsDialogWidBool *showCompletedTodo = |
854 | addWidBool(i18n("To-do view shows completed Todos"), | 854 | addWidBool(i18n("To-do view shows completed Todos"), |
855 | &(KOPrefs::instance()->mShowCompletedTodo),topFrame); | 855 | &(KOPrefs::instance()->mShowCompletedTodo),topFrame); |
856 | topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); | 856 | topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); |
857 | dummy = | 857 | dummy = |
858 | addWidBool(i18n("To-do view shows complete as 'xx %'"), | 858 | addWidBool(i18n("To-do view shows complete as 'xx %'"), |
859 | &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); | 859 | &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); |
860 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 860 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
861 | 861 | ||
862 | dummy = | 862 | dummy = |
863 | addWidBool(i18n("Small To-do view uses smaller font"), | 863 | addWidBool(i18n("Small To-do view uses smaller font"), |
864 | &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); | 864 | &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); |
865 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 865 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
866 | 866 | ||
867 | 867 | ||
868 | 868 | ||
869 | dummy = | 869 | dummy = |
870 | addWidBool(i18n("Todo view uses category colors"), | 870 | addWidBool(i18n("Todo view uses category colors"), |
871 | &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); | 871 | &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); |
872 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 872 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
873 | 873 | ||
874 | 874 | ||
875 | QWidget* wid = new QWidget( topFrame ); | 875 | QWidget* wid = new QWidget( topFrame ); |
876 | // Todo due today color | 876 | // Todo due today color |
877 | KPrefsDialogWidColor *todoDueTodayColor = | 877 | KPrefsDialogWidColor *todoDueTodayColor = |
878 | addWidColor(i18n("Todo due today color:"), | 878 | addWidColor(i18n("Todo due today color:"), |
879 | &(KOPrefs::instance()->mTodoDueTodayColor),wid); | 879 | &(KOPrefs::instance()->mTodoDueTodayColor),wid); |
880 | QHBoxLayout *widLayout = new QHBoxLayout(wid); | 880 | QHBoxLayout *widLayout = new QHBoxLayout(wid); |
881 | widLayout->addWidget( todoDueTodayColor->label() ); | 881 | widLayout->addWidget( todoDueTodayColor->label() ); |
882 | widLayout->addWidget( todoDueTodayColor->button() ); | 882 | widLayout->addWidget( todoDueTodayColor->button() ); |
883 | topLayout->addWidget(wid,ii++,0); | 883 | topLayout->addWidget(wid,ii++,0); |
884 | //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); | 884 | //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); |
885 | 885 | ||
886 | // Todo overdue color | 886 | // Todo overdue color |
887 | wid = new QWidget( topFrame ); | 887 | wid = new QWidget( topFrame ); |
888 | widLayout = new QHBoxLayout(wid); | 888 | widLayout = new QHBoxLayout(wid); |
889 | KPrefsDialogWidColor *todoOverdueColor = | 889 | KPrefsDialogWidColor *todoOverdueColor = |
890 | addWidColor(i18n("Todo overdue color:"), | 890 | addWidColor(i18n("Todo overdue color:"), |
891 | &(KOPrefs::instance()->mTodoOverdueColor),wid); | 891 | &(KOPrefs::instance()->mTodoOverdueColor),wid); |
892 | widLayout->addWidget(todoOverdueColor->label()); | 892 | widLayout->addWidget(todoOverdueColor->label()); |
893 | widLayout->addWidget(todoOverdueColor->button()); | 893 | widLayout->addWidget(todoOverdueColor->button()); |
894 | topLayout->addWidget(wid,ii++,0); | 894 | topLayout->addWidget(wid,ii++,0); |
895 | 895 | ||
896 | dummy = | 896 | dummy = |
897 | addWidBool(i18n("Colors are applied to text"), | 897 | addWidBool(i18n("Colors are applied to text"), |
898 | &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); | 898 | &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); |
899 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 899 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
900 | 900 | ||
901 | dummy = | 901 | dummy = |
902 | addWidBool(i18n("Allday Agenda view shows todos"), | 902 | addWidBool(i18n("Allday Agenda view shows todos"), |
903 | &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); | 903 | &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); |
904 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 904 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
905 | 905 | ||
906 | 906 | ||
907 | topFrame = addPage(i18n("View Options"),0,0); | ||
908 | |||
909 | topLayout = new QGridLayout(topFrame,4,1); | ||
910 | topLayout->setSpacing(spacingHint()); | ||
911 | topLayout->setMargin(marginHint()); | ||
912 | ii = 0; | ||
913 | lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame); | ||
914 | topLayout->addWidget(lab ,ii++,0); | ||
915 | |||
916 | dummy = addWidBool(i18n("Details"), | ||
917 | &(KOPrefs::instance()->mEVshowDetails),topFrame); | ||
918 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
919 | dummy = addWidBool(i18n("Created time"), | ||
920 | &(KOPrefs::instance()->mEVshowCreated),topFrame); | ||
921 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
922 | dummy = addWidBool(i18n("Last modified time"), | ||
923 | &(KOPrefs::instance()->mEVshowChanged),topFrame); | ||
924 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
925 | |||
926 | |||
927 | lab = new QLabel( i18n("Show in What'sThis quick overview:"), topFrame); | ||
928 | topLayout->addWidget(lab ,ii++,0); | ||
929 | |||
930 | dummy = addWidBool(i18n("Details"), | ||
931 | &(KOPrefs::instance()->mWTshowDetails),topFrame); | ||
932 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
933 | dummy = addWidBool(i18n("Created time"), | ||
934 | &(KOPrefs::instance()->mWTshowCreated),topFrame); | ||
935 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
936 | dummy = addWidBool(i18n("Last modified time"), | ||
937 | &(KOPrefs::instance()->mWTshowChanged),topFrame); | ||
938 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
907 | 939 | ||
908 | 940 | ||
909 | topFrame = addPage(i18n("Alarm"),0,0); | 941 | topFrame = addPage(i18n("Alarm"),0,0); |
910 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 942 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
911 | 943 | ||
912 | topLayout = new QGridLayout(topFrame,2,1); | 944 | topLayout = new QGridLayout(topFrame,2,1); |
913 | topLayout->setSpacing(spacingHint()); | 945 | topLayout->setSpacing(spacingHint()); |
914 | topLayout->setMargin(marginHint()); | 946 | topLayout->setMargin(marginHint()); |
915 | int iii = 0; | 947 | int iii = 0; |
916 | 948 | ||
917 | dummy = | 949 | dummy = |
918 | addWidBool(i18n("Use internal alarm notification"), | 950 | addWidBool(i18n("Use internal alarm notification"), |
919 | &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); | 951 | &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); |
920 | topLayout->addWidget(dummy->checkBox(),iii++,0); | 952 | topLayout->addWidget(dummy->checkBox(),iii++,0); |
921 | lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); | 953 | lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); |
922 | 954 | ||
923 | topLayout->addWidget(lab ,iii++,0); | 955 | topLayout->addWidget(lab ,iii++,0); |
924 | #ifndef DESKTOP_VERSION | 956 | #ifndef DESKTOP_VERSION |
925 | lab->setAlignment( AlignLeft|WordBreak|AlignTop); | 957 | lab->setAlignment( AlignLeft|WordBreak|AlignTop); |
926 | #else | 958 | #else |
927 | lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); | 959 | lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); |
928 | lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); | 960 | lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); |
929 | #endif | 961 | #endif |
930 | 962 | ||
931 | QHBox* dummyBox = new QHBox(topFrame); | 963 | QHBox* dummyBox = new QHBox(topFrame); |
932 | new QLabel(i18n("Play beeps count:"),dummyBox); | 964 | new QLabel(i18n("Play beeps count:"),dummyBox); |
933 | mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); | 965 | mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); |
934 | topLayout->addWidget(dummyBox,iii++,0); | 966 | topLayout->addWidget(dummyBox,iii++,0); |
935 | 967 | ||
936 | dummyBox = new QHBox(topFrame); | 968 | dummyBox = new QHBox(topFrame); |
937 | new QLabel(i18n("Beeps interval in sec:"),dummyBox); | 969 | new QLabel(i18n("Beeps interval in sec:"),dummyBox); |
938 | mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); | 970 | mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); |
939 | topLayout->addWidget(dummyBox,iii++,0); | 971 | topLayout->addWidget(dummyBox,iii++,0); |
940 | 972 | ||
941 | dummyBox = new QHBox(topFrame); | 973 | dummyBox = new QHBox(topFrame); |
942 | new QLabel(i18n("Default suspend time in min:"),dummyBox); | 974 | new QLabel(i18n("Default suspend time in min:"),dummyBox); |
943 | mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); | 975 | mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); |
944 | topLayout->addWidget(dummyBox,iii++,0); | 976 | topLayout->addWidget(dummyBox,iii++,0); |
945 | 977 | ||
946 | dummyBox = new QHBox(topFrame); | 978 | dummyBox = new QHBox(topFrame); |
947 | new QLabel(i18n("Auto suspend count:"),dummyBox); | 979 | new QLabel(i18n("Auto suspend count:"),dummyBox); |
948 | mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); | 980 | mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); |
949 | topLayout->addWidget(dummyBox,iii++,0); | 981 | topLayout->addWidget(dummyBox,iii++,0); |
950 | 982 | ||
951 | 983 | ||
952 | 984 | ||
953 | 985 | ||
954 | 986 | ||
955 | 987 | ||
956 | 988 | ||
957 | QHBox* hbo = new QHBox ( topFrame ); | 989 | QHBox* hbo = new QHBox ( topFrame ); |
958 | mDefaultAlarmFile = new QLineEdit(hbo); | 990 | mDefaultAlarmFile = new QLineEdit(hbo); |
959 | QPushButton * loadTemplate = new QPushButton(hbo); | 991 | QPushButton * loadTemplate = new QPushButton(hbo); |
960 | QPixmap icon; | 992 | QPixmap icon; |
961 | if ( QApplication::desktop()->width() < 321 ) | 993 | if ( QApplication::desktop()->width() < 321 ) |
962 | icon = SmallIcon("fileimport16"); | 994 | icon = SmallIcon("fileimport16"); |
963 | else | 995 | else |
964 | icon = SmallIcon("fileimport"); | 996 | icon = SmallIcon("fileimport"); |
965 | loadTemplate->setIconSet (icon ) ; | 997 | loadTemplate->setIconSet (icon ) ; |
966 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); | 998 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); |
967 | int size = loadTemplate->sizeHint().height(); | 999 | int size = loadTemplate->sizeHint().height(); |
968 | loadTemplate->setFixedSize( size, size ); | 1000 | loadTemplate->setFixedSize( size, size ); |
969 | //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); | 1001 | //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); |
970 | // topLayout->addWidget(lab ,iii++,0); | 1002 | // topLayout->addWidget(lab ,iii++,0); |
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 3011458..3483e95 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -495,129 +495,132 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | |||
495 | mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); | 495 | mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); |
496 | mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); | 496 | mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); |
497 | 497 | ||
498 | mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); | 498 | mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); |
499 | mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); | 499 | mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); |
500 | 500 | ||
501 | mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); | 501 | mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); |
502 | mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); | 502 | mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); |
503 | 503 | ||
504 | 504 | ||
505 | // Double clicking conflicts with opening/closing the subtree | 505 | // Double clicking conflicts with opening/closing the subtree |
506 | connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), | 506 | connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), |
507 | SLOT( editItem( QListViewItem *) ) ); | 507 | SLOT( editItem( QListViewItem *) ) ); |
508 | /* | 508 | /* |
509 | connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, | 509 | connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, |
510 | const QPoint &,int ) ), | 510 | const QPoint &,int ) ), |
511 | SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); | 511 | SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); |
512 | */ | 512 | */ |
513 | connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *, | 513 | connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *, |
514 | const QPoint &,int ) ), | 514 | const QPoint &,int ) ), |
515 | SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); | 515 | SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); |
516 | connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ), | 516 | connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ), |
517 | SLOT( itemClicked( QListViewItem * ) ) ); | 517 | SLOT( itemClicked( QListViewItem * ) ) ); |
518 | connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ), | 518 | connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ), |
519 | SLOT( itemDoubleClicked( QListViewItem * ) ) ); | 519 | SLOT( itemDoubleClicked( QListViewItem * ) ) ); |
520 | connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), | 520 | connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), |
521 | SLOT( updateView() ) ); | 521 | SLOT( updateView() ) ); |
522 | connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), | 522 | connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), |
523 | SLOT( todoModified(Todo *, int) ) ); | 523 | SLOT( todoModified(Todo *, int) ) ); |
524 | connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), | 524 | connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), |
525 | SLOT( itemStateChanged( QListViewItem * ) ) ); | 525 | SLOT( itemStateChanged( QListViewItem * ) ) ); |
526 | connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), | 526 | connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), |
527 | SLOT( itemStateChanged( QListViewItem * ) ) ); | 527 | SLOT( itemStateChanged( QListViewItem * ) ) ); |
528 | connect( mTodoListView, SIGNAL( paintNeeded() ), | 528 | connect( mTodoListView, SIGNAL( paintNeeded() ), |
529 | SLOT( paintNeeded()) ); | 529 | SLOT( paintNeeded()) ); |
530 | 530 | ||
531 | #if 0 | 531 | #if 0 |
532 | connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), | 532 | connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), |
533 | SLOT(selectionChanged(QListViewItem *))); | 533 | SLOT(selectionChanged(QListViewItem *))); |
534 | connect(mTodoListView,SIGNAL(clicked(QListViewItem *)), | 534 | connect(mTodoListView,SIGNAL(clicked(QListViewItem *)), |
535 | SLOT(selectionChanged(QListViewItem *))); | 535 | SLOT(selectionChanged(QListViewItem *))); |
536 | connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), | 536 | connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), |
537 | SLOT(selectionChanged(QListViewItem *))); | 537 | SLOT(selectionChanged(QListViewItem *))); |
538 | #endif | 538 | #endif |
539 | 539 | ||
540 | connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) )); | 540 | connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) )); |
541 | connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) )); | 541 | connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) )); |
542 | connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) )); | 542 | connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) )); |
543 | 543 | ||
544 | connect( mTodoListView, SIGNAL(selectionChanged() ), | 544 | connect( mTodoListView, SIGNAL(selectionChanged() ), |
545 | SLOT( processSelectionChange() ) ); | 545 | SLOT( processSelectionChange() ) ); |
546 | connect( mQuickAdd, SIGNAL( returnPressed () ), | 546 | connect( mQuickAdd, SIGNAL( returnPressed () ), |
547 | SLOT( addQuickTodo() ) ); | 547 | SLOT( addQuickTodo() ) ); |
548 | 548 | ||
549 | } | 549 | } |
550 | 550 | ||
551 | KOTodoView::~KOTodoView() | 551 | KOTodoView::~KOTodoView() |
552 | { | 552 | { |
553 | delete mDocPrefs; | 553 | delete mDocPrefs; |
554 | } | 554 | } |
555 | QString KOTodoView::getWhatsThisText(QPoint p) | 555 | QString KOTodoView::getWhatsThisText(QPoint p) |
556 | { | 556 | { |
557 | KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p ); | 557 | KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p ); |
558 | if ( item ) | 558 | if ( item ) |
559 | return KIncidenceFormatter::instance()->getFormattedText( item->todo() ); | 559 | return KIncidenceFormatter::instance()->getFormattedText( item->todo(), |
560 | KOPrefs::instance()->mWTshowDetails, | ||
561 | KOPrefs::instance()->mWTshowCreated, | ||
562 | KOPrefs::instance()->mWTshowChanged); | ||
560 | return i18n("That is the todo view" ); | 563 | return i18n("That is the todo view" ); |
561 | 564 | ||
562 | } | 565 | } |
563 | 566 | ||
564 | void KOTodoView::jumpToDate () | 567 | void KOTodoView::jumpToDate () |
565 | { | 568 | { |
566 | // if (mActiveItem) { | 569 | // if (mActiveItem) { |
567 | // mActiveItem->todo()); | 570 | // mActiveItem->todo()); |
568 | // if ( mActiveItem->todo()->hasDueDate() ) | 571 | // if ( mActiveItem->todo()->hasDueDate() ) |
569 | // emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); | 572 | // emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); |
570 | } | 573 | } |
571 | void KOTodoView::paintNeeded() | 574 | void KOTodoView::paintNeeded() |
572 | { | 575 | { |
573 | if ( mPendingUpdateBeforeRepaint ) { | 576 | if ( mPendingUpdateBeforeRepaint ) { |
574 | updateView(); | 577 | updateView(); |
575 | mPendingUpdateBeforeRepaint = false; | 578 | mPendingUpdateBeforeRepaint = false; |
576 | } | 579 | } |
577 | } | 580 | } |
578 | void KOTodoView::paintEvent(QPaintEvent * pevent) | 581 | void KOTodoView::paintEvent(QPaintEvent * pevent) |
579 | { | 582 | { |
580 | if ( mPendingUpdateBeforeRepaint ) { | 583 | if ( mPendingUpdateBeforeRepaint ) { |
581 | updateView(); | 584 | updateView(); |
582 | mPendingUpdateBeforeRepaint = false; | 585 | mPendingUpdateBeforeRepaint = false; |
583 | } | 586 | } |
584 | KOrg::BaseView::paintEvent( pevent); | 587 | KOrg::BaseView::paintEvent( pevent); |
585 | } | 588 | } |
586 | 589 | ||
587 | void KOTodoView::updateView() | 590 | void KOTodoView::updateView() |
588 | { | 591 | { |
589 | pendingSubtodo = 0; | 592 | pendingSubtodo = 0; |
590 | if ( mBlockUpdate ) { | 593 | if ( mBlockUpdate ) { |
591 | return; | 594 | return; |
592 | } | 595 | } |
593 | if ( !isVisible() ) { | 596 | if ( !isVisible() ) { |
594 | mPendingUpdateBeforeRepaint = true; | 597 | mPendingUpdateBeforeRepaint = true; |
595 | return; | 598 | return; |
596 | } | 599 | } |
597 | //qDebug("KOTodoView::updateView() %x", this); | 600 | //qDebug("KOTodoView::updateView() %x", this); |
598 | if ( isFlatDisplay ) { | 601 | if ( isFlatDisplay ) { |
599 | displayAllFlat(); | 602 | displayAllFlat(); |
600 | return; | 603 | return; |
601 | } | 604 | } |
602 | //qDebug("update "); | 605 | //qDebug("update "); |
603 | // kdDebug() << "KOTodoView::updateView()" << endl; | 606 | // kdDebug() << "KOTodoView::updateView()" << endl; |
604 | QFont fo = KOPrefs::instance()->mTodoViewFont; | 607 | QFont fo = KOPrefs::instance()->mTodoViewFont; |
605 | mTodoListView->clear(); | 608 | mTodoListView->clear(); |
606 | if ( mName == "todolistsmall" ) { | 609 | if ( mName == "todolistsmall" ) { |
607 | if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { | 610 | if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { |
608 | int ps = fo.pointSize() -2; | 611 | int ps = fo.pointSize() -2; |
609 | if ( ps > 12 ) | 612 | if ( ps > 12 ) |
610 | ps -= 2; | 613 | ps -= 2; |
611 | fo.setPointSize( ps ); | 614 | fo.setPointSize( ps ); |
612 | } | 615 | } |
613 | } | 616 | } |
614 | 617 | ||
615 | mTodoListView->setFont( fo ); | 618 | mTodoListView->setFont( fo ); |
616 | // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont ); | 619 | // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont ); |
617 | //mTodoListView->header()->setMaximumHeight(fm.height()); | 620 | //mTodoListView->header()->setMaximumHeight(fm.height()); |
618 | QPtrList<Todo> todoList = calendar()->todos(); | 621 | QPtrList<Todo> todoList = calendar()->todos(); |
619 | 622 | ||
620 | /* | 623 | /* |
621 | kdDebug() << "KOTodoView::updateView(): Todo List:" << endl; | 624 | kdDebug() << "KOTodoView::updateView(): Todo List:" << endl; |
622 | Event *t; | 625 | Event *t; |
623 | for(t = todoList.first(); t; t = todoList.next()) { | 626 | for(t = todoList.first(); t; t = todoList.next()) { |
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp index cc3088a..1751ae3 100644 --- a/libkcal/kincidenceformatter.cpp +++ b/libkcal/kincidenceformatter.cpp | |||
@@ -1,288 +1,310 @@ | |||
1 | #include "kincidenceformatter.h" | 1 | #include "kincidenceformatter.h" |
2 | #include <kstaticdeleter.h> | 2 | #include <kstaticdeleter.h> |
3 | #include <kglobal.h> | 3 | #include <kglobal.h> |
4 | #include <klocale.h> | 4 | #include <klocale.h> |
5 | #ifdef DEKTOP_VERSION | 5 | #ifdef DEKTOP_VERSION |
6 | #include <kabc/stdaddressbook.h> | 6 | #include <kabc/stdaddressbook.h> |
7 | #define size count | 7 | #define size count |
8 | #endif | 8 | #endif |
9 | 9 | ||
10 | KIncidenceFormatter* KIncidenceFormatter::mInstance = 0; | 10 | KIncidenceFormatter* KIncidenceFormatter::mInstance = 0; |
11 | static KStaticDeleter<KIncidenceFormatter> insd; | 11 | static KStaticDeleter<KIncidenceFormatter> insd; |
12 | 12 | ||
13 | QString KIncidenceFormatter::getFormattedText( Incidence * inc ) | 13 | QString KIncidenceFormatter::getFormattedText( Incidence * inc, bool details, bool created , bool modified ) |
14 | { | 14 | { |
15 | // #ifndef QT_NO_INPUTDIALOG | 15 | // #ifndef QT_NO_INPUTDIALOG |
16 | // return QInputDialog::getItem( caption, label, items, current, editable ); | 16 | // return QInputDialog::getItem( caption, label, items, current, editable ); |
17 | // #else | 17 | // #else |
18 | // return QString::null; | 18 | // return QString::null; |
19 | // #endif | 19 | // #endif |
20 | mDetails = details; | ||
21 | mCreated = created ; | ||
22 | mModified = modified; | ||
20 | mText = ""; | 23 | mText = ""; |
21 | if ( inc->type() == "Event" ) | 24 | if ( inc->type() == "Event" ) |
22 | setEvent((Event *) inc ); | 25 | setEvent((Event *) inc ); |
23 | else if ( inc->type() == "Todo" ) | 26 | else if ( inc->type() == "Todo" ) |
24 | setTodo((Todo *) inc ); | 27 | setTodo((Todo *) inc ); |
25 | return mText; | 28 | return mText; |
26 | } | 29 | } |
27 | 30 | ||
28 | KIncidenceFormatter* KIncidenceFormatter::instance() | 31 | KIncidenceFormatter* KIncidenceFormatter::instance() |
29 | { | 32 | { |
30 | if (!mInstance) { | 33 | if (!mInstance) { |
31 | mInstance = insd.setObject(new KIncidenceFormatter()); | 34 | mInstance = insd.setObject(new KIncidenceFormatter()); |
32 | } | 35 | } |
33 | return mInstance; | 36 | return mInstance; |
34 | } | 37 | } |
35 | KIncidenceFormatter::~KIncidenceFormatter() | 38 | KIncidenceFormatter::~KIncidenceFormatter() |
36 | { | 39 | { |
37 | if (mInstance == this) | 40 | if (mInstance == this) |
38 | mInstance = insd.setObject(0); | 41 | mInstance = insd.setObject(0); |
39 | //qDebug("KIncidenceFormatter::~KIncidenceFormatter "); | 42 | //qDebug("KIncidenceFormatter::~KIncidenceFormatter "); |
40 | } | 43 | } |
41 | KIncidenceFormatter::KIncidenceFormatter() | 44 | KIncidenceFormatter::KIncidenceFormatter() |
42 | { | 45 | { |
43 | mColorMode = 0; | 46 | mColorMode = 0; |
44 | } | 47 | } |
45 | void KIncidenceFormatter::setEvent(Event *event) | 48 | void KIncidenceFormatter::setEvent(Event *event) |
46 | { | 49 | { |
47 | int mode = 0; | 50 | int mode = 0; |
48 | mCurrentIncidence = event; | 51 | mCurrentIncidence = event; |
49 | bool shortDate = true; | 52 | bool shortDate = true; |
50 | if ( mode == 0 ) { | 53 | if ( mode == 0 ) { |
51 | addTag("h3",event->summary()); | 54 | addTag("h3",event->summary()); |
52 | } | 55 | } |
53 | else { | 56 | else { |
54 | if ( mColorMode == 1 ) { | 57 | if ( mColorMode == 1 ) { |
55 | mText +="<font color=\"#00A000\">"; | 58 | mText +="<font color=\"#00A000\">"; |
56 | } | 59 | } |
57 | if ( mColorMode == 2 ) { | 60 | if ( mColorMode == 2 ) { |
58 | mText +="<font color=\"#C00000\">"; | 61 | mText +="<font color=\"#C00000\">"; |
59 | } | 62 | } |
60 | // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; | 63 | // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; |
61 | if ( mode == 1 ) { | 64 | if ( mode == 1 ) { |
62 | addTag("h2",i18n( "Local: " ) +event->summary()); | 65 | addTag("h2",i18n( "Local: " ) +event->summary()); |
63 | } else { | 66 | } else { |
64 | addTag("h2",i18n( "Remote: " ) +event->summary()); | 67 | addTag("h2",i18n( "Remote: " ) +event->summary()); |
65 | } | 68 | } |
66 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); | 69 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); |
67 | if ( mColorMode ) | 70 | if ( mColorMode ) |
68 | mText += "</font>"; | 71 | mText += "</font>"; |
69 | } | 72 | } |
70 | if (event->cancelled ()) { | 73 | if (event->cancelled ()) { |
71 | mText +="<font color=\"#B00000\">"; | 74 | mText +="<font color=\"#B00000\">"; |
72 | addTag("i",i18n("This event has been cancelled!")); | 75 | addTag("i",i18n("This event has been cancelled!")); |
73 | mText.append("<br>"); | 76 | mText.append("<br>"); |
74 | mText += "</font>"; | 77 | mText += "</font>"; |
75 | } | 78 | } |
76 | if (!event->location().isEmpty()) { | 79 | if (!event->location().isEmpty()) { |
77 | addTag("b",i18n("Location: ")); | 80 | addTag("b",i18n("Location: ")); |
78 | mText.append(event->location()+"<br>"); | 81 | mText.append(event->location()+"<br>"); |
79 | } | 82 | } |
80 | if (event->doesFloat()) { | 83 | if (event->doesFloat()) { |
81 | if (event->isMultiDay()) { | 84 | if (event->isMultiDay()) { |
82 | mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") | 85 | mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") |
83 | .arg(event->dtStartDateStr(shortDate)) | 86 | .arg(event->dtStartDateStr(shortDate)) |
84 | .arg(event->dtEndDateStr(shortDate))); | 87 | .arg(event->dtEndDateStr(shortDate))); |
85 | } else { | 88 | } else { |
86 | mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); | 89 | mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); |
87 | } | 90 | } |
88 | } else { | 91 | } else { |
89 | if (event->isMultiDay()) { | 92 | if (event->isMultiDay()) { |
90 | mText.append(i18n("<p><b>From:</b> %1</p> ") | 93 | mText.append(i18n("<p><b>From:</b> %1</p> ") |
91 | .arg(event->dtStartStr( shortDate))); | 94 | .arg(event->dtStartStr( shortDate))); |
92 | mText.append(i18n("<p><b>To:</b> %1</p>") | 95 | mText.append(i18n("<p><b>To:</b> %1</p>") |
93 | .arg(event->dtEndStr(shortDate))); | 96 | .arg(event->dtEndStr(shortDate))); |
94 | } else { | 97 | } else { |
95 | mText.append(i18n("<p><b>On:</b> %1</p> ") | 98 | mText.append(i18n("<p><b>On:</b> %1</p> ") |
96 | .arg(event->dtStartDateStr( shortDate ))); | 99 | .arg(event->dtStartDateStr( shortDate ))); |
97 | mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") | 100 | mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") |
98 | .arg(event->dtStartTimeStr()) | 101 | .arg(event->dtStartTimeStr()) |
99 | .arg(event->dtEndTimeStr())); | 102 | .arg(event->dtEndTimeStr())); |
100 | } | 103 | } |
101 | } | 104 | } |
102 | 105 | ||
103 | if (event->recurrence()->doesRecur()) { | 106 | if (event->recurrence()->doesRecur()) { |
104 | 107 | ||
105 | QString recurText = event->recurrence()->recurrenceText(); | 108 | QString recurText = event->recurrence()->recurrenceText(); |
106 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); | 109 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); |
107 | 110 | ||
108 | bool ok; | 111 | bool ok; |
109 | QDate start = QDate::currentDate(); | 112 | QDate start = QDate::currentDate(); |
110 | QDateTime next; | 113 | QDateTime next; |
111 | next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); | 114 | next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); |
112 | if ( ok ) { | 115 | if ( ok ) { |
113 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); | 116 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); |
114 | addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); | 117 | addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); |
115 | 118 | ||
116 | } else { | 119 | } else { |
117 | bool last; | 120 | bool last; |
118 | QDate nextd; | 121 | QDate nextd; |
119 | nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); | 122 | nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); |
120 | if ( last ) { | 123 | if ( last ) { |
121 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); | 124 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); |
122 | addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); | 125 | addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); |
123 | } | 126 | } |
124 | } | 127 | } |
125 | } | 128 | } |
126 | 129 | ||
127 | 130 | ||
128 | if (event->isAlarmEnabled()) { | 131 | if (event->isAlarmEnabled()) { |
129 | Alarm *alarm =event->alarms().first() ; | 132 | Alarm *alarm =event->alarms().first() ; |
130 | QDateTime t = alarm->time(); | 133 | QDateTime t = alarm->time(); |
131 | int min = t.secsTo( event->dtStart() )/60; | 134 | int min = t.secsTo( event->dtStart() )/60; |
132 | QString s =i18n("(%1 min before)").arg( min ); | 135 | QString s =i18n("(%1 min before)").arg( min ); |
133 | addTag("p",i18n("<b>Alarm on: </b>") + s + ": "+KGlobal::locale()->formatDateTime( t, shortDate )); | 136 | addTag("p",i18n("<b>Alarm on: </b>") + s + ": "+KGlobal::locale()->formatDateTime( t, shortDate )); |
134 | //addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); | 137 | //addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); |
135 | //addTag("p",s); | 138 | //addTag("p",s); |
136 | } | 139 | } |
137 | 140 | ||
138 | addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); | 141 | addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); |
139 | // mText.append(event->secrecyStr()+"<br>"); | 142 | // mText.append(event->secrecyStr()+"<br>"); |
140 | formatCategories(event); | 143 | formatCategories(event); |
141 | if (!event->description().isEmpty()) { | 144 | if ( mDetails ) { |
142 | addTag("p",i18n("<b>Details: </b>")); | 145 | if (!event->description().isEmpty()) { |
143 | addTag("p",event->description()); | 146 | addTag("p",i18n("<b>Details: </b>")); |
147 | addTag("p",event->description()); | ||
148 | } | ||
144 | } | 149 | } |
145 | 150 | ||
146 | |||
147 | formatReadOnly(event); | 151 | formatReadOnly(event); |
148 | formatAttendees(event); | 152 | formatAttendees(event); |
149 | 153 | ||
154 | if ( mCreated ) { | ||
155 | addTag("p",i18n("<b>Created: ") +" </b>"); | ||
156 | addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); | ||
157 | |||
158 | } | ||
159 | if ( mModified ) { | ||
160 | addTag("p",i18n("<b>Last modified: ") +" </b>"); | ||
161 | addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); | ||
162 | |||
163 | } | ||
150 | 164 | ||
151 | } | 165 | } |
152 | 166 | ||
153 | void KIncidenceFormatter::setTodo(Todo *event ) | 167 | void KIncidenceFormatter::setTodo(Todo *event ) |
154 | { | 168 | { |
155 | int mode = 0; | 169 | int mode = 0; |
156 | mCurrentIncidence = event; | 170 | mCurrentIncidence = event; |
157 | bool shortDate = true; | 171 | bool shortDate = true; |
158 | if (mode == 0 ) | 172 | if (mode == 0 ) |
159 | addTag("h3",event->summary()); | 173 | addTag("h3",event->summary()); |
160 | else { | 174 | else { |
161 | if ( mColorMode == 1 ) { | 175 | if ( mColorMode == 1 ) { |
162 | mText +="<font color=\"#00A000\">"; | 176 | mText +="<font color=\"#00A000\">"; |
163 | } | 177 | } |
164 | if ( mColorMode == 2 ) { | 178 | if ( mColorMode == 2 ) { |
165 | mText +="<font color=\"#B00000\">"; | 179 | mText +="<font color=\"#B00000\">"; |
166 | } | 180 | } |
167 | if ( mode == 1 ) { | 181 | if ( mode == 1 ) { |
168 | addTag("h2",i18n( "Local: " ) +event->summary()); | 182 | addTag("h2",i18n( "Local: " ) +event->summary()); |
169 | } else { | 183 | } else { |
170 | addTag("h2",i18n( "Remote: " ) +event->summary()); | 184 | addTag("h2",i18n( "Remote: " ) +event->summary()); |
171 | } | 185 | } |
172 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); | 186 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); |
173 | if ( mColorMode ) | 187 | if ( mColorMode ) |
174 | mText += "</font>"; | 188 | mText += "</font>"; |
175 | } | 189 | } |
176 | if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { | 190 | if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { |
177 | mText +="<font color=\"#B00000\">"; | 191 | mText +="<font color=\"#B00000\">"; |
178 | addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(shortDate) ) ); | 192 | addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(shortDate) ) ); |
179 | mText += "</font>"; | 193 | mText += "</font>"; |
180 | } else { | 194 | } else { |
181 | mText.append(i18n("<p><i>%1 % completed</i></p>") | 195 | mText.append(i18n("<p><i>%1 % completed</i></p>") |
182 | .arg(event->percentComplete())); | 196 | .arg(event->percentComplete())); |
183 | } | 197 | } |
184 | if (event->cancelled ()) { | 198 | if (event->cancelled ()) { |
185 | mText +="<font color=\"#B00000\">"; | 199 | mText +="<font color=\"#B00000\">"; |
186 | addTag("i",i18n("This todo has been cancelled!")); | 200 | addTag("i",i18n("This todo has been cancelled!")); |
187 | mText.append("<br>"); | 201 | mText.append("<br>"); |
188 | mText += "</font>"; | 202 | mText += "</font>"; |
189 | } | 203 | } |
190 | 204 | ||
191 | if (!event->location().isEmpty()) { | 205 | if (!event->location().isEmpty()) { |
192 | addTag("b",i18n("Location: ")); | 206 | addTag("b",i18n("Location: ")); |
193 | mText.append(event->location()+"<br>"); | 207 | mText.append(event->location()+"<br>"); |
194 | } | 208 | } |
195 | 209 | ||
196 | if (event->recurrence()->doesRecur()) { | 210 | if (event->recurrence()->doesRecur()) { |
197 | 211 | ||
198 | QString recurText = event->recurrence()->recurrenceText(); | 212 | QString recurText = event->recurrence()->recurrenceText(); |
199 | addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); | 213 | addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); |
200 | } | 214 | } |
201 | 215 | ||
202 | if (event->hasStartDate()) { | 216 | if (event->hasStartDate()) { |
203 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(shortDate))); | 217 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(shortDate))); |
204 | } | 218 | } |
205 | 219 | ||
206 | 220 | ||
207 | if (event->hasDueDate()) { | 221 | if (event->hasDueDate()) { |
208 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(shortDate))); | 222 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(shortDate))); |
209 | } | 223 | } |
210 | mText.append(i18n("<p><b>Priority:</b> %2</p>") | 224 | mText.append(i18n("<p><b>Priority:</b> %2</p>") |
211 | .arg(QString::number(event->priority()))); | 225 | .arg(QString::number(event->priority()))); |
212 | 226 | ||
213 | addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); | 227 | addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); |
214 | formatCategories(event); | 228 | formatCategories(event); |
215 | if (!event->description().isEmpty()) { | 229 | if ( mDetails ) { |
216 | addTag("p",i18n("<b>Details: </b>")); | 230 | if (!event->description().isEmpty()) { |
217 | addTag("p",event->description()); | 231 | addTag("p",i18n("<b>Details: </b>")); |
232 | addTag("p",event->description()); | ||
233 | } | ||
218 | } | 234 | } |
219 | |||
220 | |||
221 | |||
222 | formatReadOnly(event); | 235 | formatReadOnly(event); |
223 | formatAttendees(event); | 236 | formatAttendees(event); |
224 | 237 | if ( mCreated ) { | |
238 | addTag("p",i18n("<b>Created: ") +" </b>"); | ||
239 | addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); | ||
240 | |||
241 | } | ||
242 | if ( mModified ) { | ||
243 | addTag("p",i18n("<b>Last modified: ") +" </b>"); | ||
244 | addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); | ||
245 | |||
246 | } | ||
225 | } | 247 | } |
226 | 248 | ||
227 | void KIncidenceFormatter::setJournal(Journal* ) | 249 | void KIncidenceFormatter::setJournal(Journal* ) |
228 | { | 250 | { |
229 | 251 | ||
230 | } | 252 | } |
231 | 253 | ||
232 | void KIncidenceFormatter::formatCategories(Incidence *event) | 254 | void KIncidenceFormatter::formatCategories(Incidence *event) |
233 | { | 255 | { |
234 | if (!event->categoriesStr().isEmpty()) { | 256 | if (!event->categoriesStr().isEmpty()) { |
235 | addTag("p",i18n("<b>Categories: </b>")+event->categoriesStr() ); | 257 | addTag("p",i18n("<b>Categories: </b>")+event->categoriesStr() ); |
236 | //mText.append(event->categoriesStr()); | 258 | //mText.append(event->categoriesStr()); |
237 | } | 259 | } |
238 | } | 260 | } |
239 | void KIncidenceFormatter::addTag(const QString & tag,const QString & text) | 261 | void KIncidenceFormatter::addTag(const QString & tag,const QString & text) |
240 | { | 262 | { |
241 | int number=text.contains("\n"); | 263 | int number=text.contains("\n"); |
242 | QString str = "<" + tag + ">"; | 264 | QString str = "<" + tag + ">"; |
243 | QString tmpText=text; | 265 | QString tmpText=text; |
244 | QString tmpStr=str; | 266 | QString tmpStr=str; |
245 | if(number !=-1) | 267 | if(number !=-1) |
246 | { | 268 | { |
247 | if (number > 0) { | 269 | if (number > 0) { |
248 | int pos=0; | 270 | int pos=0; |
249 | QString tmp; | 271 | QString tmp; |
250 | for(int i=0;i<=number;i++) { | 272 | for(int i=0;i<=number;i++) { |
251 | pos=tmpText.find("\n"); | 273 | pos=tmpText.find("\n"); |
252 | tmp=tmpText.left(pos); | 274 | tmp=tmpText.left(pos); |
253 | tmpText=tmpText.right(tmpText.length()-pos-1); | 275 | tmpText=tmpText.right(tmpText.length()-pos-1); |
254 | tmpStr+=tmp+"<br>"; | 276 | tmpStr+=tmp+"<br>"; |
255 | } | 277 | } |
256 | } | 278 | } |
257 | else tmpStr += tmpText; | 279 | else tmpStr += tmpText; |
258 | tmpStr+="</" + tag + ">"; | 280 | tmpStr+="</" + tag + ">"; |
259 | mText.append(tmpStr); | 281 | mText.append(tmpStr); |
260 | } | 282 | } |
261 | else | 283 | else |
262 | { | 284 | { |
263 | str += text + "</" + tag + ">"; | 285 | str += text + "</" + tag + ">"; |
264 | mText.append(str); | 286 | mText.append(str); |
265 | } | 287 | } |
266 | } | 288 | } |
267 | 289 | ||
268 | void KIncidenceFormatter::formatAttendees(Incidence *event) | 290 | void KIncidenceFormatter::formatAttendees(Incidence *event) |
269 | { | 291 | { |
270 | QPtrList<Attendee> attendees = event->attendees(); | 292 | QPtrList<Attendee> attendees = event->attendees(); |
271 | if (attendees.count()) { | 293 | if (attendees.count()) { |
272 | QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); | 294 | QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); |
273 | QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); | 295 | QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); |
274 | addTag("h3",i18n("Organizer")); | 296 | addTag("h3",i18n("Organizer")); |
275 | mText.append("<ul><li>"); | 297 | mText.append("<ul><li>"); |
276 | #if 0 | 298 | #if 0 |
277 | //ndef KORG_NOKABC | 299 | //ndef KORG_NOKABC |
278 | 300 | ||
279 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); | 301 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); |
280 | KABC::Addressee::List addressList; | 302 | KABC::Addressee::List addressList; |
281 | addressList = add_book->findByEmail(event->organizer()); | 303 | addressList = add_book->findByEmail(event->organizer()); |
282 | KABC::Addressee o = addressList.first(); | 304 | KABC::Addressee o = addressList.first(); |
283 | if (!o.isEmpty() && addressList.size()<2) { | 305 | if (!o.isEmpty() && addressList.size()<2) { |
284 | mText += "<a href=\"uid:" + o.uid() + "\">"; | 306 | mText += "<a href=\"uid:" + o.uid() + "\">"; |
285 | mText += o.formattedName(); | 307 | mText += o.formattedName(); |
286 | mText += "</a>\n"; | 308 | mText += "</a>\n"; |
287 | } else { | 309 | } else { |
288 | mText.append(event->organizer()); | 310 | mText.append(event->organizer()); |
diff --git a/libkcal/kincidenceformatter.h b/libkcal/kincidenceformatter.h index 6165a9f..068e6d2 100644 --- a/libkcal/kincidenceformatter.h +++ b/libkcal/kincidenceformatter.h | |||
@@ -1,42 +1,43 @@ | |||
1 | #ifndef KINCIDENCENFORMATTER_H | 1 | #ifndef KINCIDENCENFORMATTER_H |
2 | #define KINCIDENCENFORMATTER_H | 2 | #define KINCIDENCENFORMATTER_H |
3 | 3 | ||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | #include <qobject.h> | 5 | #include <qobject.h> |
6 | 6 | ||
7 | #include "incidence.h" | 7 | #include "incidence.h" |
8 | #include "event.h" | 8 | #include "event.h" |
9 | #include "todo.h" | 9 | #include "todo.h" |
10 | #include "journal.h" | 10 | #include "journal.h" |
11 | 11 | ||
12 | using namespace KCal; | 12 | using namespace KCal; |
13 | 13 | ||
14 | class KIncidenceFormatter : public QObject | 14 | class KIncidenceFormatter : public QObject |
15 | { | 15 | { |
16 | public: | 16 | public: |
17 | static KIncidenceFormatter* instance(); | 17 | static KIncidenceFormatter* instance(); |
18 | KIncidenceFormatter(); | 18 | KIncidenceFormatter(); |
19 | ~KIncidenceFormatter(); | 19 | ~KIncidenceFormatter(); |
20 | QString getFormattedText( Incidence * inc ); | 20 | QString getFormattedText( Incidence * inc , bool details = false, bool created = false, bool modified = false ); |
21 | 21 | ||
22 | void setEvent(Event *event); | 22 | void setEvent(Event *event); |
23 | void setTodo(Todo *event ); | 23 | void setTodo(Todo *event ); |
24 | void setJournal(Journal* ); | 24 | void setJournal(Journal* ); |
25 | 25 | ||
26 | protected: | 26 | protected: |
27 | int mColorMode; | 27 | int mColorMode; |
28 | void addTag(const QString & tag,const QString & text); | 28 | void addTag(const QString & tag,const QString & text); |
29 | 29 | ||
30 | void formatCategories(Incidence *event); | 30 | void formatCategories(Incidence *event); |
31 | void formatAttendees(Incidence *event); | 31 | void formatAttendees(Incidence *event); |
32 | void formatReadOnly(Incidence *event); | 32 | void formatReadOnly(Incidence *event); |
33 | 33 | ||
34 | private: | 34 | private: |
35 | bool mSyncMode; | 35 | bool mSyncMode; |
36 | bool mDetails, mCreated ,mModified; | ||
36 | 37 | ||
37 | QString mText; | 38 | QString mText; |
38 | Incidence* mCurrentIncidence; | 39 | Incidence* mCurrentIncidence; |
39 | static KIncidenceFormatter* mInstance; | 40 | static KIncidenceFormatter* mInstance; |
40 | }; | 41 | }; |
41 | 42 | ||
42 | #endif | 43 | #endif |