author | zautrix <zautrix> | 2004-12-05 11:14:32 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-12-05 11:14:32 (UTC) |
commit | 196365e533c6fd1a8f47aa9579763ef5afcebcda (patch) (unidiff) | |
tree | 3784f0be50b790d9386db1e4ebd29d44317db026 | |
parent | e4e75984b6cb581d87d436cb6c5140eb57dbdc51 (diff) | |
download | kdepimpi-196365e533c6fd1a8f47aa9579763ef5afcebcda.zip kdepimpi-196365e533c6fd1a8f47aa9579763ef5afcebcda.tar.gz kdepimpi-196365e533c6fd1a8f47aa9579763ef5afcebcda.tar.bz2 |
layout bugfixes
-rw-r--r-- | bin/kdepim/kaddressbook/germantranslation.txt | 10 | ||||
-rw-r--r-- | kaddressbook/views/contactlistview.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/xxportselectdialog.cpp | 8 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 14 | ||||
-rw-r--r-- | korganizer/koeditordetails.cpp | 7 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 5 |
6 files changed, 36 insertions, 10 deletions
diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt index b5ad650..08efcf6 100644 --- a/bin/kdepim/kaddressbook/germantranslation.txt +++ b/bin/kdepim/kaddressbook/germantranslation.txt | |||
@@ -290,263 +290,273 @@ | |||
290 | { "Honorific Suffixes","Namen Suffix" }, | 290 | { "Honorific Suffixes","Namen Suffix" }, |
291 | { "Nick Name","Sptitzname" }, | 291 | { "Nick Name","Sptitzname" }, |
292 | { "Birthday","Geburtstag" }, | 292 | { "Birthday","Geburtstag" }, |
293 | { "Home Address Street","Privat Adresse Strasse" }, | 293 | { "Home Address Street","Privat Adresse Strasse" }, |
294 | { "Home Address Locality","Privat Adresse Stadt" }, | 294 | { "Home Address Locality","Privat Adresse Stadt" }, |
295 | { "Home Address Region","Privat Adresse Bundesland" }, | 295 | { "Home Address Region","Privat Adresse Bundesland" }, |
296 | { "Home Address Postal Code","Privat Adresse PLZ" }, | 296 | { "Home Address Postal Code","Privat Adresse PLZ" }, |
297 | { "Home Address Country","Privat Adresse Land" }, | 297 | { "Home Address Country","Privat Adresse Land" }, |
298 | { "Home Address Label","Privat Adresse Label" }, | 298 | { "Home Address Label","Privat Adresse Label" }, |
299 | { "Business Address Street","Büro Adresse Strasse" }, | 299 | { "Business Address Street","Büro Adresse Strasse" }, |
300 | { "Business Address Locality","Büro Adresse Stadt" }, | 300 | { "Business Address Locality","Büro Adresse Stadt" }, |
301 | { "Business Address Region","Büro Adresse Bundesland" }, | 301 | { "Business Address Region","Büro Adresse Bundesland" }, |
302 | { "Business Address Postal Code","Büro Adresse PLZ" }, | 302 | { "Business Address Postal Code","Büro Adresse PLZ" }, |
303 | { "Business Address Country","Büro Adresse Land" }, | 303 | { "Business Address Country","Büro Adresse Land" }, |
304 | { "Business Address Label","Büro Adresse Label" }, | 304 | { "Business Address Label","Büro Adresse Label" }, |
305 | { "Home Phone","Privat Telefon" }, | 305 | { "Home Phone","Privat Telefon" }, |
306 | { "Business Phone","Büro Telefon" }, | 306 | { "Business Phone","Büro Telefon" }, |
307 | { "Mobile Phone","Handy" }, | 307 | { "Mobile Phone","Handy" }, |
308 | { "Home Fax","Privat Fax" }, | 308 | { "Home Fax","Privat Fax" }, |
309 | { "Business Fax","Büro Fax" }, | 309 | { "Business Fax","Büro Fax" }, |
310 | { "Car Phone","Autotelefon" }, | 310 | { "Car Phone","Autotelefon" }, |
311 | { "ISDN","ISDN" }, | 311 | { "ISDN","ISDN" }, |
312 | { "Pager","Pager" }, | 312 | { "Pager","Pager" }, |
313 | { "Mail Client","Mail Client" }, | 313 | { "Mail Client","Mail Client" }, |
314 | { "Title","Titel" }, | 314 | { "Title","Titel" }, |
315 | { "Role","Rolle" }, | 315 | { "Role","Rolle" }, |
316 | { "Note","Notiz" }, | 316 | { "Note","Notiz" }, |
317 | { "URL","URL" }, | 317 | { "URL","URL" }, |
318 | { "Resource","Resource" }, | 318 | { "Resource","Resource" }, |
319 | { "SIP","SIP" }, | 319 | { "SIP","SIP" }, |
320 | { "Default Filter","Default Filter" }, | 320 | { "Default Filter","Default Filter" }, |
321 | { "The default filter will be activated whenever this view is displayed. This feature allows you to configure views that only interact with certain types of information based on the filter. Once the view is activated, the filter can be changed at anytime.","#The default filter will be activated whenever this view is displayed. This feature allows you to configure views that only interact with certain types of information based on the filter. Once the view is activated, the filter can be changed at anytime." }, | 321 | { "The default filter will be activated whenever this view is displayed. This feature allows you to configure views that only interact with certain types of information based on the filter. Once the view is activated, the filter can be changed at anytime.","#The default filter will be activated whenever this view is displayed. This feature allows you to configure views that only interact with certain types of information based on the filter. Once the view is activated, the filter can be changed at anytime." }, |
322 | { "No default filter","Kein default Filter" }, | 322 | { "No default filter","Kein default Filter" }, |
323 | { "Use last active filter","Nutze letzen aktiven Filter" }, | 323 | { "Use last active filter","Nutze letzen aktiven Filter" }, |
324 | { "Use filter:","Nutze Filter:" }, | 324 | { "Use filter:","Nutze Filter:" }, |
325 | { "Look & Feel","Look & Feel" }, | 325 | { "Look & Feel","Look & Feel" }, |
326 | { "Row Separator","Reihen Separator" }, | 326 | { "Row Separator","Reihen Separator" }, |
327 | { "Alternating backgrounds","Abwechselnder Hintergrund" }, | 327 | { "Alternating backgrounds","Abwechselnder Hintergrund" }, |
328 | { "Single line","Einzelne Zeile" }, | 328 | { "Single line","Einzelne Zeile" }, |
329 | { "Enable background image:","Hintergrundbild:" }, | 329 | { "Enable background image:","Hintergrundbild:" }, |
330 | { "Enable contact tooltips","Contact Tooltips" }, | 330 | { "Enable contact tooltips","Contact Tooltips" }, |
331 | { "&Enable custom Colors","Benutzerdef. Farben" }, | 331 | { "&Enable custom Colors","Benutzerdef. Farben" }, |
332 | { "&Colors","Farben" }, | 332 | { "&Colors","Farben" }, |
333 | { "If custom colors are enabled, you may choose the colors for the view below. Otherwise colors from your current KDE color scheme are used.","#If custom colors are enabled, you may choose the colors for the view below. Otherwise colors from your current KDE color scheme are used." }, | 333 | { "If custom colors are enabled, you may choose the colors for the view below. Otherwise colors from your current KDE color scheme are used.","#If custom colors are enabled, you may choose the colors for the view below. Otherwise colors from your current KDE color scheme are used." }, |
334 | { "Double click or press RETURN on a item to select a color for the related strings in the view.","#Double click or press RETURN on a item to select a color for the related strings in the view." }, | 334 | { "Double click or press RETURN on a item to select a color for the related strings in the view.","#Double click or press RETURN on a item to select a color for the related strings in the view." }, |
335 | { "&Enable custom fonts","B&enutzerdefinierte Schriften" }, | 335 | { "&Enable custom fonts","B&enutzerdefinierte Schriften" }, |
336 | { "&Text font:","Textschriftart:" }, | 336 | { "&Text font:","Textschriftart:" }, |
337 | { "&Header font:","Titelschriftart:" }, | 337 | { "&Header font:","Titelschriftart:" }, |
338 | { "If custom fonts are enabled, you may choose which fonts to use for this view below. Otherwise the default KDE font will be used, in bold style for the header and normal style for the data.","#If custom fonts are enabled, you may choose which fonts to use for this view below. Otherwise the default KDE font will be used, in bold style for the header and normal style for the data." }, | 338 | { "If custom fonts are enabled, you may choose which fonts to use for this view below. Otherwise the default KDE font will be used, in bold style for the header and normal style for the data.","#If custom fonts are enabled, you may choose which fonts to use for this view below. Otherwise the default KDE font will be used, in bold style for the header and normal style for the data." }, |
339 | { "&Fonts","Schri&ften" }, | 339 | { "&Fonts","Schri&ften" }, |
340 | { "Background Color","Hintergrundfarbe" }, | 340 | { "Background Color","Hintergrundfarbe" }, |
341 | { "Text Color","Textfarbe" }, | 341 | { "Text Color","Textfarbe" }, |
342 | { "Header Background Color","Titel Hintergrundfarbe" }, | 342 | { "Header Background Color","Titel Hintergrundfarbe" }, |
343 | { "Header Text Color","Titel Farbe" }, | 343 | { "Header Text Color","Titel Farbe" }, |
344 | { "Highlight Color","Auswahlfarbe" }, | 344 | { "Highlight Color","Auswahlfarbe" }, |
345 | { "Highlighted Text Color","Auswahltextfarbe" }, | 345 | { "Highlighted Text Color","Auswahltextfarbe" }, |
346 | { "Alternating Background Color","Abwechselnder Hintergrundfarbe" }, | 346 | { "Alternating Background Color","Abwechselnder Hintergrundfarbe" }, |
347 | { "Postal","Post" }, | 347 | { "Postal","Post" }, |
348 | { "Dr.","Dr." }, | 348 | { "Dr.","Dr." }, |
349 | { "Miss","Frl." }, | 349 | { "Miss","Frl." }, |
350 | { "Mr.","Herr" }, | 350 | { "Mr.","Herr" }, |
351 | { "Mrs.","Frau" }, | 351 | { "Mrs.","Frau" }, |
352 | { "Ms.","Fr." }, | 352 | { "Ms.","Fr." }, |
353 | { "Prof.","Prof." }, | 353 | { "Prof.","Prof." }, |
354 | { "I","I" }, | 354 | { "I","I" }, |
355 | { "II","II" }, | 355 | { "II","II" }, |
356 | { "III","III" }, | 356 | { "III","III" }, |
357 | { "Jr.","Jr." }, | 357 | { "Jr.","Jr." }, |
358 | { "Sr.","Sr." }, | 358 | { "Sr.","Sr." }, |
359 | { "Name:","Name:" }, | 359 | { "Name:","Name:" }, |
360 | { "Documents","Dokumente" }, | 360 | { "Documents","Dokumente" }, |
361 | { "Files","Dateien" }, | 361 | { "Files","Dateien" }, |
362 | { "All Files","Alle Dateien" }, | 362 | { "All Files","Alle Dateien" }, |
363 | { "Name","Name" }, | 363 | { "Name","Name" }, |
364 | { "Size","Größe" }, | 364 | { "Size","Größe" }, |
365 | { "Date","Datum" }, | 365 | { "Date","Datum" }, |
366 | { "Mime Type","Mime Typ" }, | 366 | { "Mime Type","Mime Typ" }, |
367 | { "Geo Data Input","Geo Dateneingabe" }, | 367 | { "Geo Data Input","Geo Dateneingabe" }, |
368 | { "Sexagesimal","Sexagesimal" }, | 368 | { "Sexagesimal","Sexagesimal" }, |
369 | { "North","Nord" }, | 369 | { "North","Nord" }, |
370 | { "South","Süd" }, | 370 | { "South","Süd" }, |
371 | { "East","Ost" }, | 371 | { "East","Ost" }, |
372 | { "West","West" }, | 372 | { "West","West" }, |
373 | { "Undefined","Unbestimmt" }, | 373 | { "Undefined","Unbestimmt" }, |
374 | { "Edit Address","Bearbeite Adresse" }, | 374 | { "Edit Address","Bearbeite Adresse" }, |
375 | { "Street:","Strasse:" }, | 375 | { "Street:","Strasse:" }, |
376 | { "Post office box:","Postfach:" }, | 376 | { "Post office box:","Postfach:" }, |
377 | { "Locality:","Stadt:" }, | 377 | { "Locality:","Stadt:" }, |
378 | { "Region:","Region:" }, | 378 | { "Region:","Region:" }, |
379 | { "Postal code:","PLZ:" }, | 379 | { "Postal code:","PLZ:" }, |
380 | { "Country:","Staat:" }, | 380 | { "Country:","Staat:" }, |
381 | { "This is the preferred address","Dies ist die bevorzugte Adresse" }, | 381 | { "This is the preferred address","Dies ist die bevorzugte Adresse" }, |
382 | { "New...","Neu..." }, | 382 | { "New...","Neu..." }, |
383 | { "Change Type","Ändere Art" }, | 383 | { "Change Type","Ändere Art" }, |
384 | { "Edit Address Type","Ändere Address Art" }, | 384 | { "Edit Address Type","Ändere Address Art" }, |
385 | { "Address Types","Address Art" }, | 385 | { "Address Types","Address Art" }, |
386 | { "Domestic","Inland" }, | 386 | { "Domestic","Inland" }, |
387 | { "International","International" }, | 387 | { "International","International" }, |
388 | { "Parcel","Paket" }, | 388 | { "Parcel","Paket" }, |
389 | { "Edit Contact Name","Ändere Kontakt Name" }, | 389 | { "Edit Contact Name","Ändere Kontakt Name" }, |
390 | { "Honorific prefixes:","Namensprefixes:" }, | 390 | { "Honorific prefixes:","Namensprefixes:" }, |
391 | { "Given name:","Vorname:" }, | 391 | { "Given name:","Vorname:" }, |
392 | { "Additional names:","Mittelnamen:" }, | 392 | { "Additional names:","Mittelnamen:" }, |
393 | { "Family names:","Nachname:" }, | 393 | { "Family names:","Nachname:" }, |
394 | { "Honorific suffixes:","Namenssuffixe:" }, | 394 | { "Honorific suffixes:","Namenssuffixe:" }, |
395 | { "Parse name automatically","Setze Namen automatisch" }, | 395 | { "Parse name automatically","Setze Namen automatisch" }, |
396 | { "Edit Phone Numbers","Bearbeite Telefonnummern" }, | 396 | { "Edit Phone Numbers","Bearbeite Telefonnummern" }, |
397 | { "Number","Nummer" }, | 397 | { "Number","Nummer" }, |
398 | { "Type","Typ" }, | 398 | { "Type","Typ" }, |
399 | { "Edit Phone Number","Bearbeite Telefonnummer" }, | 399 | { "Edit Phone Number","Bearbeite Telefonnummer" }, |
400 | { "Number:","Nummer:" }, | 400 | { "Number:","Nummer:" }, |
401 | { "This is the preferred phone number","Dies ist die bevorzugte Telefonnummer" }, | 401 | { "This is the preferred phone number","Dies ist die bevorzugte Telefonnummer" }, |
402 | { "Types","Typen" }, | 402 | { "Types","Typen" }, |
403 | { "Messenger","Messenger" }, | 403 | { "Messenger","Messenger" }, |
404 | { "Other","Anderes" }, | 404 | { "Other","Anderes" }, |
405 | { "Video","Video" }, | 405 | { "Video","Video" }, |
406 | { "Mailbox","Mailbox" }, | 406 | { "Mailbox","Mailbox" }, |
407 | { "Modem","Modem" }, | 407 | { "Modem","Modem" }, |
408 | { "Car","Auto" }, | 408 | { "Car","Auto" }, |
409 | { "PCS","PCS" }, | 409 | { "PCS","PCS" }, |
410 | { "Category","Kategorie" }, | 410 | { "Category","Kategorie" }, |
411 | { "Select Categories","Wähle Kategorien" }, | 411 | { "Select Categories","Wähle Kategorien" }, |
412 | { " &Deselect All "," &Deselektiere alle " }, | 412 | { " &Deselect All "," &Deselektiere alle " }, |
413 | { " &Edit Categories "," B&earbeite Kategorien " }, | 413 | { " &Edit Categories "," B&earbeite Kategorien " }, |
414 | { "&OK","&OK" }, | 414 | { "&OK","&OK" }, |
415 | { "&Cancel","Abbre&chen" }, | 415 | { "&Cancel","Abbre&chen" }, |
416 | { "Configure","Konfiguriere" }, | 416 | { "Configure","Konfiguriere" }, |
417 | { "Default","Voreinstellungen" }, | 417 | { "Default","Voreinstellungen" }, |
418 | { "Addressbook","Adressbuch" }, | 418 | { "Addressbook","Adressbuch" }, |
419 | { "Details view font","Schriftart Detailansicht" }, | 419 | { "Details view font","Schriftart Detailansicht" }, |
420 | { "phone:123","phone:123" }, | 420 | { "phone:123","phone:123" }, |
421 | { "Search only after <return> key pressed","Suche nur nach <return> Taste" }, | 421 | { "Search only after <return> key pressed","Suche nur nach <return> Taste" }, |
422 | { "Honor KDE single click","Benutze KDE Einzelklick" }, | 422 | { "Honor KDE single click","Benutze KDE Einzelklick" }, |
423 | { "Automatic name parsing for new addressees","Automa. Name Parsen für neue Einträge" }, | 423 | { "Automatic name parsing for new addressees","Automa. Name Parsen für neue Einträge" }, |
424 | { "Display List and Details at once (restart)","Zeige Liste und Details zusammen(neustart)" }, | 424 | { "Display List and Details at once (restart)","Zeige Liste und Details zusammen(neustart)" }, |
425 | { "Ask for quit when closing Ka/Pi","Vor Beenden von Ka/Pi nachfragen" }, | 425 | { "Ask for quit when closing Ka/Pi","Vor Beenden von Ka/Pi nachfragen" }, |
426 | { "General","Algemein" }, | 426 | { "General","Algemein" }, |
427 | { "Extensions (restart)","Extensions (restart)" }, | 427 | { "Extensions (restart)","Extensions (restart)" }, |
428 | { "Description","Beschreibungen" }, | 428 | { "Description","Beschreibungen" }, |
429 | { "Extensions","Extensions" }, | 429 | { "Extensions","Extensions" }, |
430 | { "Prefixes","Prefixe" }, | 430 | { "Prefixes","Prefixe" }, |
431 | { "Inclusions","Inclusions" }, | 431 | { "Inclusions","Inclusions" }, |
432 | { "Suffixes","Suffixe" }, | 432 | { "Suffixes","Suffixe" }, |
433 | { "Default formatted name:","Default format. Name:" }, | 433 | { "Default formatted name:","Default format. Name:" }, |
434 | { "Empty","Leer" }, | 434 | { "Empty","Leer" }, |
435 | { "Simple Name","Einfacher Name" }, | 435 | { "Simple Name","Einfacher Name" }, |
436 | { "Full Name","Voller Name" }, | 436 | { "Full Name","Voller Name" }, |
437 | { "Reverse Name","Namen umdrehen" }, | 437 | { "Reverse Name","Namen umdrehen" }, |
438 | { "Contact","Kontakt" }, | 438 | { "Contact","Kontakt" }, |
439 | { "Global","Allgemein" }, | 439 | { "Global","Allgemein" }, |
440 | { "Phone","Telefon" }, | 440 | { "Phone","Telefon" }, |
441 | { "SMS","SMS" }, | 441 | { "SMS","SMS" }, |
442 | { "Language:(needs restart)","Sprache:(Neustart)" }, | 442 | { "Language:(needs restart)","Sprache:(Neustart)" }, |
443 | { "English","English" }, | 443 | { "English","English" }, |
444 | { "German","Deutsch" }, | 444 | { "German","Deutsch" }, |
445 | { "French","Französisch" }, | 445 | { "French","Französisch" }, |
446 | { "Italian","Italienisch" }, | 446 | { "Italian","Italienisch" }, |
447 | { "User defined (usertranslation.txt)","Benutzerdef. (usertranslation.txt)" }, | 447 | { "User defined (usertranslation.txt)","Benutzerdef. (usertranslation.txt)" }, |
448 | { "Time Format(nr):","Zeit Format(nr):" }, | 448 | { "Time Format(nr):","Zeit Format(nr):" }, |
449 | { "24:00","24:00" }, | 449 | { "24:00","24:00" }, |
450 | { "12:00am","12:00am" }, | 450 | { "12:00am","12:00am" }, |
451 | { "Week starts on Sunday","Woche beginnt Sonntags" }, | 451 | { "Week starts on Sunday","Woche beginnt Sonntags" }, |
452 | { "Locale","Locale" }, | 452 | { "Locale","Locale" }, |
453 | { "Date Format:","Datums Format:" }, | 453 | { "Date Format:","Datums Format:" }, |
454 | { "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" }, | 454 | { "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" }, |
455 | { "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" }, | 455 | { "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" }, |
456 | { "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" }, | 456 | { "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" }, |
457 | { "User defined","Benutzerdefiniert" }, | 457 | { "User defined","Benutzerdefiniert" }, |
458 | { "User long date:","Format langes Datum:" }, | 458 | { "User long date:","Format langes Datum:" }, |
459 | { "User short date:","Format kurzes Datum:" }, | 459 | { "User short date:","Format kurzes Datum:" }, |
460 | { "Daylight start:","Sommerzeit Beginn:" }, | 460 | { "Daylight start:","Sommerzeit Beginn:" }, |
461 | { "Daylight end:","Sommerzeit Ende:" }, | 461 | { "Daylight end:","Sommerzeit Ende:" }, |
462 | { "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" }, | 462 | { "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" }, |
463 | { "Monday 19 April 2004: %A %d %B %Y","Monday 19 April 2004: %A %d %B %Y" }, | 463 | { "Monday 19 April 2004: %A %d %B %Y","Monday 19 April 2004: %A %d %B %Y" }, |
464 | { "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" }, | 464 | { "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" }, |
465 | { "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" }, | 465 | { "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" }, |
466 | { "Date Format","Datums Format" }, | 466 | { "Date Format","Datums Format" }, |
467 | { "Timezone:","Zeitzone:" }, | 467 | { "Timezone:","Zeitzone:" }, |
468 | { "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." }, | 468 | { "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." }, |
469 | { "Timezone has daylight saving","Zeitzone hat Sommerzeit" }, | 469 | { "Timezone has daylight saving","Zeitzone hat Sommerzeit" }, |
470 | { "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" }, | 470 | { "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" }, |
471 | { "Used Mail Client","Benutzter Mail Client" }, | 471 | { "Used Mail Client","Benutzter Mail Client" }, |
472 | { "Channel:","Channel:" }, | 472 | { "Channel:","Channel:" }, |
473 | { "Message:","Message:" }, | 473 | { "Message:","Message:" }, |
474 | { "Parameters:","Parameter:" }, | 474 | { "Parameters:","Parameter:" }, |
475 | { "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" }, | 475 | { "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" }, |
476 | { "extra Message:","extra Message:" }, | 476 | { "extra Message:","extra Message:" }, |
477 | { "extra Parameters:","extra Parameter:" }, | 477 | { "extra Parameters:","extra Parameter:" }, |
478 | { "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" }, | 478 | { "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" }, |
479 | { "External Apps.","Externe Appl." }, | 479 | { "External Apps.","Externe Appl." }, |
480 | { "Used %1 Client","Benutzer %1 Client" }, | 480 | { "Used %1 Client","Benutzer %1 Client" }, |
481 | { "No email client installed","Keine Email Client installiert" }, | 481 | { "No email client installed","Keine Email Client installiert" }, |
482 | { "Userdefined email client","Benutzerdef. Email Client" }, | 482 | { "Userdefined email client","Benutzerdef. Email Client" }, |
483 | { "OM/Pi email client","OM/Pi Email Client" }, | 483 | { "OM/Pi email client","OM/Pi Email Client" }, |
484 | { "Close KA/Pi?","Schließe KA/Pi?" }, | 484 | { "Close KA/Pi?","Schließe KA/Pi?" }, |
485 | { "\nChanges will be saved!","\nÄnderungen werden gespeichert!" }, | 485 | { "\nChanges will be saved!","\nÄnderungen werden gespeichert!" }, |
486 | { "Yes!","Ja!" }, | 486 | { "Yes!","Ja!" }, |
487 | { "There was an error while attempting to save\n the address book. Please check that some \nother application is not using it. ","#There was an error while attempting to save\n the address book. Please check that some \nother application is not using it. " }, | 487 | { "There was an error while attempting to save\n the address book. Please check that some \nother application is not using it. ","#There was an error while attempting to save\n the address book. Please check that some \nother application is not using it. " }, |
488 | { "Saving addressbook ... ","Speichere Adressbuch ... " }, | 488 | { "Saving addressbook ... ","Speichere Adressbuch ... " }, |
489 | { "Addressbook saved!","Adressbuch gespeichert!" }, | 489 | { "Addressbook saved!","Adressbuch gespeichert!" }, |
490 | { "Default Table View","Default Tabellenansicht" }, | 490 | { "Default Table View","Default Tabellenansicht" }, |
491 | { "Merge and Remove","Zusammenfügen/entfernen" }, | 491 | { "Merge and Remove","Zusammenfügen/entfernen" }, |
492 | { "Merge","Zusammenfügen" }, | 492 | { "Merge","Zusammenfügen" }, |
493 | { "Merge Contacts Editor","Contact-Zusammenfüge-Editor" }, | 493 | { "Merge Contacts Editor","Contact-Zusammenfüge-Editor" }, |
494 | { "New List...","Neue Liste..." }, | 494 | { "New List...","Neue Liste..." }, |
495 | { "Rename List...","Ändere Namen..." }, | 495 | { "Rename List...","Ändere Namen..." }, |
496 | { "Remove List","Lösche Liste" }, | 496 | { "Remove List","Lösche Liste" }, |
497 | { "Add Contact","Kontakt hinzu" }, | 497 | { "Add Contact","Kontakt hinzu" }, |
498 | { "Change Email...","Ändere Email..." }, | 498 | { "Change Email...","Ändere Email..." }, |
499 | { "Remove Contact","Entferne Kontakt" }, | 499 | { "Remove Contact","Entferne Kontakt" }, |
500 | { "Use Preferred","Nutze Preferred" }, | 500 | { "Use Preferred","Nutze Preferred" }, |
501 | { "Distribution List Editor","Distribution List Editor" }, | 501 | { "Distribution List Editor","Distribution List Editor" }, |
502 | { "Choose which contacts to export","Wähle Kontakte zum Exportieren" }, | 502 | { "Choose which contacts to export","Wähle Kontakte zum Exportieren" }, |
503 | { "Which contacts do you want to export?","Welche Kontakte sollen exportiert werden?" }, | 503 | { "Which contacts do you want to export?","Welche Kontakte sollen exportiert werden?" }, |
504 | { "Contact Selection","Kontaktauswahl" }, | 504 | { "Contact Selection","Kontaktauswahl" }, |
505 | { "&All","&Alle" }, | 505 | { "&All","&Alle" }, |
506 | { "Export the entire address book","Exportiere das komplette Addressbuch" }, | 506 | { "Export the entire address book","Exportiere das komplette Addressbuch" }, |
507 | { "&Selected","Au&sgewählte" }, | 507 | { "&Selected","Au&sgewählte" }, |
508 | { "Only export contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected.","###Only export contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected." }, | 508 | { "Only export contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected.","###Only export contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected." }, |
509 | { "By matching &filter","Zutreffender &Filter" }, | 509 | { "By matching &filter","Zutreffender &Filter" }, |
510 | { "Only export contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters","###Only export contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters" }, | 510 | { "Only export contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters","###Only export contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters" }, |
511 | { "By Cate&gories","Kategorien" }, | 511 | { "By Cate&gories","Kategorien" }, |
512 | { "Only export contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories.","###Only export contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories." }, | 512 | { "Only export contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories.","###Only export contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories." }, |
513 | { "Select a filter to decide which contacts to export.","Wähle Filter zum Export aus." }, | 513 | { "Select a filter to decide which contacts to export.","Wähle Filter zum Export aus." }, |
514 | { "Check the categories whose members you want to export.","Wähle die Kategorien zum Export aus." }, | 514 | { "Check the categories whose members you want to export.","Wähle die Kategorien zum Export aus." }, |
515 | { "Sorting","Sortieren" }, | 515 | { "Sorting","Sortieren" }, |
516 | { "Criterion:","Merkmal:" }, | 516 | { "Criterion:","Merkmal:" }, |
517 | { "Order:","Reihenfolge:" }, | 517 | { "Order:","Reihenfolge:" }, |
518 | { "Ascending","Aufsteigend" }, | 518 | { "Ascending","Aufsteigend" }, |
519 | { "Descending","Absteigend" }, | 519 | { "Descending","Absteigend" }, |
520 | { "Save file","Datei speichern" }, | 520 | { "Save file","Datei speichern" }, |
521 | { "Error","Fehler" }, | 521 | { "Error","Fehler" }, |
522 | { "Unable to export contacts.","Exportieren der Kontakte geht nicht." }, | 522 | { "Unable to export contacts.","Exportieren der Kontakte geht nicht." }, |
523 | { "\nNo unsaved changes detected!\nNothing will be saved!","\nKeine ungespeicherten\nÄnderungen erkannt!\nNichts wird gespeichert!" }, | 523 | { "\nNo unsaved changes detected!\nNothing will be saved!","\nKeine ungespeicherten\nÄnderungen erkannt!\nNichts wird gespeichert!" }, |
524 | { "Manage new categories...","Verwalte neue Kategorien..." }, | 524 | { "Manage new categories...","Verwalte neue Kategorien..." }, |
525 | { "&File","Datei" }, | 525 | { "&File","Datei" }, |
526 | { "&Edit","Bearbeite" }, | 526 | { "&Edit","Bearbeite" }, |
527 | { "&View","Ansichten" }, | 527 | { "&View","Ansichten" }, |
528 | { "&Settings","Konfiguration" }, | 528 | { "&Settings","Konfiguration" }, |
529 | { "&Change selected","Ändere Selekt." }, | 529 | { "&Change selected","Ändere Selekt." }, |
530 | { "&Help","Hilfe" }, | 530 | { "&Help","Hilfe" }, |
531 | { "Remove sync info","Entferne Sync Info" }, | 531 | { "Remove sync info","Entferne Sync Info" }, |
532 | { "For all profiles","Für alle Profile" }, | 532 | { "For all profiles","Für alle Profile" }, |
533 | { "&Change","Ändere" }, | 533 | { "&Change","Ändere" }, |
534 | { "Import xml (Qtopia)...","Importiere xml (Qtopia)..." }, | 534 | { "Import xml (Qtopia)...","Importiere xml (Qtopia)..." }, |
535 | { "Export xml (Qtopia)...","Exportiere xml (Qtopia)..." }, | 535 | { "Export xml (Qtopia)...","Exportiere xml (Qtopia)..." }, |
536 | { "Export to phone","Exportiere aufs Handy..." }, | 536 | { "Export to phone","Exportiere aufs Handy..." }, |
537 | { "Which contacts do you want to select?","Welche Kontakte möchten Sie wählen?" }, | 537 | { "Which contacts do you want to select?","Welche Kontakte möchten Sie wählen?" }, |
538 | { "&Modify","Ändere" }, | 538 | { "&Modify","Ändere" }, |
539 | { "Choose which contacts to select","Bitte Kontakte auswählen!" }, | 539 | { "Choose which contacts to select","Bitte Kontakte auswählen!" }, |
540 | { "After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n ","Nach dem Importieren/Laden/Syncen\nkann es neue Kategorien in den \nKontakten geben, die nicht\nin der Kategorieliste enthalten sind.\nBitte wählen Sie, was passieren soll:\n " }, | 540 | { "After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n ","Nach dem Importieren/Laden/Syncen\nkann es neue Kategorien in den \nKontakten geben, die nicht\nin der Kategorieliste enthalten sind.\nBitte wählen Sie, was passieren soll:\n " }, |
541 | { "Manage new Categories","Verwalte neue Kategorien" }, | 541 | { "Manage new Categories","Verwalte neue Kategorien" }, |
542 | { "Add to category list","Füge zur Kategorieliste hinzu" }, | 542 | { "Add to category list","Füge zur Kategorieliste hinzu" }, |
543 | { "Remove from addressees","Entferne von den Kontakten" }, | 543 | { "Remove from addressees","Entferne von den Kontakten" }, |
544 | { "New categories not in list:","Kategorien, die nicht in der Liste sind:" }, | 544 | { "New categories not in list:","Kategorien, die nicht in der Liste sind:" }, |
545 | { "A&dd","Hinzufügen" }, | 545 | { "A&dd","Hinzufügen" }, |
546 | { "Please read Help-Sync Howto\nto know what settings to use.","Bitte lese Hilfe-Sync Howto\num zu erfahren welche Einstellungen\ndie richtigen sind." }, | ||
547 | { "NOTE: This will remove all old\ncontact data on phone!","ACHTUNG: Das löscht alle alten\nKontakt Daten auf dem Handy!" }, | ||
548 | { "Export to mobile phone!","Exportiere auf das Handy!" }, | ||
549 | { "Export to phone options","Export ans Handy Optionen" }, | ||
550 | { "Writing to phone...","Sende Daten ans Handy..." }, | ||
551 | { " This may take 1-3 minutes!"," Das kann 1-3 Minuten dauern!" }, | ||
552 | { "Retry","Nochmal versuchen" }, | ||
553 | { "KDE/Pim phone access","KDE/Pim Handy Zugriff" }, | ||
554 | { "Error accessing device!\nPlease turn on connection\nand retry!","Fehler beim Zugriff auf das Gerät!\nBitte die Verbindung aktivieren\nund nochmal versuchen!" }, | ||
555 | { "Error exporting to phone!","Fehler beim Export auf das Handy!" }, | ||
546 | { "","" }, | 556 | { "","" }, |
547 | { "","" }, | 557 | { "","" }, |
548 | { "","" }, | 558 | { "","" }, |
549 | { "","" }, | 559 | { "","" }, |
550 | { "","" }, | 560 | { "","" }, |
551 | { "","" }, | 561 | { "","" }, |
552 | { "","" }, \ No newline at end of file | 562 | { "","" }, \ No newline at end of file |
diff --git a/kaddressbook/views/contactlistview.cpp b/kaddressbook/views/contactlistview.cpp index ad43970..23b091c 100644 --- a/kaddressbook/views/contactlistview.cpp +++ b/kaddressbook/views/contactlistview.cpp | |||
@@ -1,373 +1,373 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> | 3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qheader.h> | 24 | #include <qheader.h> |
25 | #include <qiconset.h> | 25 | #include <qiconset.h> |
26 | #include <qimage.h> | 26 | #include <qimage.h> |
27 | #include <qdragobject.h> | 27 | #include <qdragobject.h> |
28 | #include <qcombobox.h> | 28 | #include <qcombobox.h> |
29 | #include <qpainter.h> | 29 | #include <qpainter.h> |
30 | #include <qbrush.h> | 30 | #include <qbrush.h> |
31 | #include <qevent.h> | 31 | #include <qevent.h> |
32 | 32 | ||
33 | #include <klocale.h> | 33 | #include <klocale.h> |
34 | #include <kglobalsettings.h> | 34 | #include <kglobalsettings.h> |
35 | #include <kiconloader.h> | 35 | #include <kiconloader.h> |
36 | #include <kdebug.h> | 36 | #include <kdebug.h> |
37 | #include <kconfig.h> | 37 | #include <kconfig.h> |
38 | #include <kapplication.h> | 38 | #include <kapplication.h> |
39 | #include <kurl.h> | 39 | #include <kurl.h> |
40 | 40 | ||
41 | #include "kaddressbooktableview.h" | 41 | #include "kaddressbooktableview.h" |
42 | 42 | ||
43 | #include "contactlistview.h" | 43 | #include "contactlistview.h" |
44 | 44 | ||
45 | ///////////////////////////////// | 45 | ///////////////////////////////// |
46 | // DynamicTip Methods | 46 | // DynamicTip Methods |
47 | 47 | ||
48 | DynamicTip::DynamicTip( ContactListView *parent) | 48 | DynamicTip::DynamicTip( ContactListView *parent) |
49 | : QToolTip( parent ) | 49 | : QToolTip( parent ) |
50 | { | 50 | { |
51 | } | 51 | } |
52 | 52 | ||
53 | void DynamicTip::maybeTip( const QPoint &pos ) | 53 | void DynamicTip::maybeTip( const QPoint &pos ) |
54 | { | 54 | { |
55 | static bool ishidden = true; | 55 | static bool ishidden = true; |
56 | if (!parentWidget()->inherits( "ContactListView" )) | 56 | if (!parentWidget()->inherits( "ContactListView" )) |
57 | return; | 57 | return; |
58 | 58 | ||
59 | ContactListView *plv = (ContactListView*)parentWidget(); | 59 | ContactListView *plv = (ContactListView*)parentWidget(); |
60 | if (!plv->tooltips()) | 60 | if (!plv->tooltips()) |
61 | return; | 61 | return; |
62 | 62 | ||
63 | QPoint posVp = plv->viewport()->pos(); | 63 | QPoint posVp = plv->viewport()->pos(); |
64 | 64 | ||
65 | QListViewItem *lvi = plv->itemAt( pos - posVp ); | 65 | QListViewItem *lvi = plv->itemAt( pos - posVp ); |
66 | if (!lvi) | 66 | if (!lvi) |
67 | return; | 67 | return; |
68 | 68 | ||
69 | #ifndef KAB_EMBEDDED | 69 | #ifndef KAB_EMBEDDED |
70 | ContactListViewItem *plvi = dynamic_cast< ContactListViewItem* >(lvi); | 70 | ContactListViewItem *plvi = dynamic_cast< ContactListViewItem* >(lvi); |
71 | #else //KAB_EMBEDDED | 71 | #else //KAB_EMBEDDED |
72 | ContactListViewItem *plvi = (ContactListViewItem*)(lvi); | 72 | ContactListViewItem *plvi = (ContactListViewItem*)(lvi); |
73 | #endif //KAB_EMBEDDED | 73 | #endif //KAB_EMBEDDED |
74 | 74 | ||
75 | if (!plvi) | 75 | if (!plvi) |
76 | return; | 76 | return; |
77 | 77 | ||
78 | if (ishidden) { | 78 | if (ishidden) { |
79 | QString s; | 79 | QString s; |
80 | QRect r = plv->itemRect( lvi ); | 80 | QRect r = plv->itemRect( lvi ); |
81 | r.moveBy( posVp.x(), posVp.y() ); | 81 | r.moveBy( posVp.x(), posVp.y() ); |
82 | 82 | ||
83 | //kdDebug() << "Tip rec: " << r.x() << "," << r.y() << "," << r.width() | 83 | //kdDebug() << "Tip rec: " << r.x() << "," << r.y() << "," << r.width() |
84 | // << "," << r.height() << endl; | 84 | // << "," << r.height() << endl; |
85 | 85 | ||
86 | KABC::Addressee a = plvi->addressee(); | 86 | KABC::Addressee a = plvi->addressee(); |
87 | if (a.isEmpty()) | 87 | if (a.isEmpty()) |
88 | return; | 88 | return; |
89 | 89 | ||
90 | s += i18n("label: value", "%1: %2").arg(a.formattedNameLabel()) | 90 | s += i18n("label: value", "%1: %2").arg(a.formattedNameLabel()) |
91 | .arg(a.formattedName()); | 91 | .arg(a.formattedName()); |
92 | 92 | ||
93 | s += '\n'; | 93 | s += '\n'; |
94 | s += i18n("label: value", "%1: %2").arg(a.organizationLabel()) | 94 | s += i18n("label: value", "%1: %2").arg(a.organizationLabel()) |
95 | .arg(a.organization()); | 95 | .arg(a.organization()); |
96 | 96 | ||
97 | QString notes = a.note().stripWhiteSpace(); | 97 | QString notes = a.note().stripWhiteSpace(); |
98 | if ( !notes.isEmpty() ) { | 98 | if ( !notes.isEmpty() ) { |
99 | notes += '\n'; | 99 | notes += '\n'; |
100 | s += '\n' + i18n("label: value", "%1: \n").arg(a.noteLabel()); | 100 | s += '\n' + i18n("label: value", "%1: \n").arg(a.noteLabel()); |
101 | QFontMetrics fm( font() ); | 101 | QFontMetrics fm( font() ); |
102 | 102 | ||
103 | // Begin word wrap code based on QMultiLineEdit code | 103 | // Begin word wrap code based on QMultiLineEdit code |
104 | int i = 0; | 104 | int i = 0; |
105 | bool doBreak = false; | 105 | bool doBreak = false; |
106 | int linew = 0; | 106 | int linew = 0; |
107 | int lastSpace = -1; | 107 | int lastSpace = -1; |
108 | int a = 0; | 108 | int a = 0; |
109 | int lastw = 0; | 109 | int lastw = 0; |
110 | 110 | ||
111 | while ( i < int(notes.length()) ) { | 111 | while ( i < int(notes.length()) ) { |
112 | doBreak = FALSE; | 112 | doBreak = FALSE; |
113 | if ( notes[i] != '\n' ) | 113 | if ( notes[i] != '\n' ) |
114 | linew += fm.width( notes[i] ); | 114 | linew += fm.width( notes[i] ); |
115 | 115 | ||
116 | if ( lastSpace >= a && notes[i] != '\n' ) | 116 | if ( lastSpace >= a && notes[i] != '\n' ) |
117 | if (linew >= parentWidget()->width()) { | 117 | if (linew >= parentWidget()->width()) { |
118 | doBreak = TRUE; | 118 | doBreak = TRUE; |
119 | if ( lastSpace > a ) { | 119 | if ( lastSpace > a ) { |
120 | i = lastSpace; | 120 | i = lastSpace; |
121 | linew = lastw; | 121 | linew = lastw; |
122 | } | 122 | } |
123 | else | 123 | else |
124 | i = QMAX( a, i-1 ); | 124 | i = QMAX( a, i-1 ); |
125 | } | 125 | } |
126 | 126 | ||
127 | if ( notes[i] == '\n' || doBreak ) { | 127 | if ( notes[i] == '\n' || doBreak ) { |
128 | s += notes.mid( a, i - a + (doBreak?1:0) ) +"\n"; | 128 | s += notes.mid( a, i - a + (doBreak?1:0) ) +"\n"; |
129 | 129 | ||
130 | a = i + 1; | 130 | a = i + 1; |
131 | lastSpace = a; | 131 | lastSpace = a; |
132 | linew = 0; | 132 | linew = 0; |
133 | } | 133 | } |
134 | 134 | ||
135 | if ( notes[i].isSpace() ) { | 135 | if ( notes[i].isSpace() ) { |
136 | lastSpace = i; | 136 | lastSpace = i; |
137 | lastw = linew; | 137 | lastw = linew; |
138 | } | 138 | } |
139 | 139 | ||
140 | if ( lastSpace <= a ) { | 140 | if ( lastSpace <= a ) { |
141 | lastw = linew; | 141 | lastw = linew; |
142 | } | 142 | } |
143 | 143 | ||
144 | ++i; | 144 | ++i; |
145 | } | 145 | } |
146 | } | 146 | } |
147 | 147 | ||
148 | tip( r, s ); | 148 | tip( r, s ); |
149 | } | 149 | } |
150 | else | 150 | else |
151 | hide(); | 151 | hide(); |
152 | ishidden = !ishidden; | 152 | ishidden = !ishidden; |
153 | 153 | ||
154 | } | 154 | } |
155 | 155 | ||
156 | /////////////////////////// | 156 | /////////////////////////// |
157 | // ContactListViewItem Methods | 157 | // ContactListViewItem Methods |
158 | 158 | ||
159 | ContactListViewItem::ContactListViewItem(const KABC::Addressee &a, | 159 | ContactListViewItem::ContactListViewItem(const KABC::Addressee &a, |
160 | ContactListView *parent, | 160 | ContactListView *parent, |
161 | KABC::AddressBook *doc, | 161 | KABC::AddressBook *doc, |
162 | const KABC::Field::List &fields ) | 162 | const KABC::Field::List &fields ) |
163 | : KListViewItem(parent), mAddressee(a), mFields( fields ), | 163 | : KListViewItem(parent), mAddressee(a), mFields( fields ), |
164 | parentListView( parent ), mDocument(doc) | 164 | parentListView( parent ), mDocument(doc) |
165 | { | 165 | { |
166 | refresh(); | 166 | refresh(); |
167 | } | 167 | } |
168 | 168 | ||
169 | QString ContactListViewItem::key(int column, bool ascending) const | 169 | QString ContactListViewItem::key(int column, bool ascending) const |
170 | { | 170 | { |
171 | #ifndef DESKTOP_VERSION | 171 | #ifndef DESKTOP_VERSION |
172 | int lan = KGlobal::locale()->language(); | 172 | int lan = KGlobal::locale()->language(); |
173 | //qDebug("language %d ", lan); | 173 | //qDebug("language %d ", lan); |
174 | if ( lan == 1 ) { //GERMAN | 174 | if ( lan == 1 ) { //GERMAN |
175 | QString ret = QListViewItem::key(column, ascending).lower().utf8(); | 175 | QString ret = QListViewItem::key(column, ascending).lower().utf8(); |
176 | int start = -1; | 176 | int start = -1; |
177 | while ( (start = ret.find( 'ä', start+1)) > 0 ) { | 177 | while ( (start = ret.find( 'ä', start+1)) > 0 ) { |
178 | ret.at(start-1) = 'a'; | 178 | ret.at(start-1) = 'a'; |
179 | } | 179 | } |
180 | start = -1; | 180 | start = -1; |
181 | while ( (start = ret.find( 'ö', start+1)) > 0 ) { | 181 | while ( (start = ret.find( 'ö', start+1)) > 0 ) { |
182 | ret.at(start-1) = 'o'; | 182 | ret.at(start-1) = 'o'; |
183 | } | 183 | } |
184 | start = -1; | 184 | start = -1; |
185 | while ( (start = ret.find( 'ü', start+1)) > 0 ) { | 185 | while ( (start = ret.find( 'ü', start+1)) > 0 ) { |
186 | ret.at(start-1) = 'o'; | 186 | ret.at(start-1) = 'o'; |
187 | } | 187 | } |
188 | start = -1; | 188 | start = -1; |
189 | while ( (start = ret.find( 'ß', start+1)) > 0 ) { | 189 | while ( (start = ret.find( 'ß', start+1)) > 0 ) { |
190 | ret.at(start-1) = 's'; | 190 | ret.at(start-1) = 's'; |
191 | } | 191 | } |
192 | qDebug("conv string %s ", ret.latin1()); | 192 | //qDebug("conv string %s ", ret.latin1()); |
193 | 193 | ||
194 | return ret; | 194 | return ret; |
195 | 195 | ||
196 | } | 196 | } |
197 | else | 197 | else |
198 | #endif | 198 | #endif |
199 | return QListViewItem::key(column, ascending).lower(); | 199 | return QListViewItem::key(column, ascending).lower(); |
200 | } | 200 | } |
201 | 201 | ||
202 | void ContactListViewItem::paintCell(QPainter * p, | 202 | void ContactListViewItem::paintCell(QPainter * p, |
203 | const QColorGroup & cg, | 203 | const QColorGroup & cg, |
204 | int column, | 204 | int column, |
205 | int width, | 205 | int width, |
206 | int align) | 206 | int align) |
207 | { | 207 | { |
208 | KListViewItem::paintCell(p, cg, column, width, align); | 208 | KListViewItem::paintCell(p, cg, column, width, align); |
209 | 209 | ||
210 | if ( !p ) | 210 | if ( !p ) |
211 | return; | 211 | return; |
212 | 212 | ||
213 | if (parentListView->singleLine()) { | 213 | if (parentListView->singleLine()) { |
214 | p->setPen( parentListView->alternateColor() ); | 214 | p->setPen( parentListView->alternateColor() ); |
215 | p->drawLine( 0, height() - 1, width, height() - 1 ); | 215 | p->drawLine( 0, height() - 1, width, height() - 1 ); |
216 | } | 216 | } |
217 | } | 217 | } |
218 | 218 | ||
219 | 219 | ||
220 | ContactListView *ContactListViewItem::parent() | 220 | ContactListView *ContactListViewItem::parent() |
221 | { | 221 | { |
222 | return parentListView; | 222 | return parentListView; |
223 | } | 223 | } |
224 | 224 | ||
225 | 225 | ||
226 | void ContactListViewItem::refresh() | 226 | void ContactListViewItem::refresh() |
227 | { | 227 | { |
228 | // Update our addressee, since it may have changed else were | 228 | // Update our addressee, since it may have changed else were |
229 | mAddressee = mDocument->findByUid(mAddressee.uid()); | 229 | mAddressee = mDocument->findByUid(mAddressee.uid()); |
230 | if (mAddressee.isEmpty()) | 230 | if (mAddressee.isEmpty()) |
231 | return; | 231 | return; |
232 | 232 | ||
233 | int i = 0; | 233 | int i = 0; |
234 | KABC::Field::List::ConstIterator it; | 234 | KABC::Field::List::ConstIterator it; |
235 | for( it = mFields.begin(); it != mFields.end(); ++it ) { | 235 | for( it = mFields.begin(); it != mFields.end(); ++it ) { |
236 | setText( i++, (*it)->value( mAddressee ) ); | 236 | setText( i++, (*it)->value( mAddressee ) ); |
237 | } | 237 | } |
238 | } | 238 | } |
239 | 239 | ||
240 | /////////////////////////////// | 240 | /////////////////////////////// |
241 | // ContactListView | 241 | // ContactListView |
242 | 242 | ||
243 | ContactListView::ContactListView(KAddressBookTableView *view, | 243 | ContactListView::ContactListView(KAddressBookTableView *view, |
244 | KABC::AddressBook* /* doc */, | 244 | KABC::AddressBook* /* doc */, |
245 | QWidget *parent, | 245 | QWidget *parent, |
246 | const char *name ) | 246 | const char *name ) |
247 | : KListView( parent, name ), | 247 | : KListView( parent, name ), |
248 | pabWidget( view ), | 248 | pabWidget( view ), |
249 | oldColumn( 0 ) | 249 | oldColumn( 0 ) |
250 | { | 250 | { |
251 | mABackground = true; | 251 | mABackground = true; |
252 | mSingleLine = false; | 252 | mSingleLine = false; |
253 | mToolTips = true; | 253 | mToolTips = true; |
254 | #ifndef KAB_EMBEDDED | 254 | #ifndef KAB_EMBEDDED |
255 | mAlternateColor = KGlobalSettings::alternateBackgroundColor(); | 255 | mAlternateColor = KGlobalSettings::alternateBackgroundColor(); |
256 | #else //KAB_EMBEDDED | 256 | #else //KAB_EMBEDDED |
257 | mAlternateColor = QColor(240, 240, 240); | 257 | mAlternateColor = QColor(240, 240, 240); |
258 | #endif //KAB_EMBEDDED | 258 | #endif //KAB_EMBEDDED |
259 | 259 | ||
260 | setAlternateBackgroundEnabled(mABackground); | 260 | setAlternateBackgroundEnabled(mABackground); |
261 | setAcceptDrops( true ); | 261 | setAcceptDrops( true ); |
262 | viewport()->setAcceptDrops( true ); | 262 | viewport()->setAcceptDrops( true ); |
263 | setAllColumnsShowFocus( true ); | 263 | setAllColumnsShowFocus( true ); |
264 | setShowSortIndicator(true); | 264 | setShowSortIndicator(true); |
265 | 265 | ||
266 | setSelectionModeExt( KListView::Extended ); | 266 | setSelectionModeExt( KListView::Extended ); |
267 | setDropVisualizer(false); | 267 | setDropVisualizer(false); |
268 | // setFrameStyle(QFrame::NoFrame); | 268 | // setFrameStyle(QFrame::NoFrame); |
269 | //setLineWidth ( 0 ); | 269 | //setLineWidth ( 0 ); |
270 | //setMidLineWidth ( 0 ); | 270 | //setMidLineWidth ( 0 ); |
271 | //setMargin ( 0 ); | 271 | //setMargin ( 0 ); |
272 | #ifndef KAB_EMBEDDED | 272 | #ifndef KAB_EMBEDDED |
273 | connect(this, SIGNAL(dropped(QDropEvent*)), | 273 | connect(this, SIGNAL(dropped(QDropEvent*)), |
274 | this, SLOT(itemDropped(QDropEvent*))); | 274 | this, SLOT(itemDropped(QDropEvent*))); |
275 | #endif //KAB_EMBEDDED | 275 | #endif //KAB_EMBEDDED |
276 | 276 | ||
277 | 277 | ||
278 | new DynamicTip( this ); | 278 | new DynamicTip( this ); |
279 | } | 279 | } |
280 | 280 | ||
281 | void ContactListView::setAlternateColor(const QColor &m_AlternateColor) | 281 | void ContactListView::setAlternateColor(const QColor &m_AlternateColor) |
282 | { | 282 | { |
283 | mAlternateColor = m_AlternateColor; | 283 | mAlternateColor = m_AlternateColor; |
284 | } | 284 | } |
285 | 285 | ||
286 | void ContactListView::paintEmptyArea( QPainter * p, const QRect & rect ) | 286 | void ContactListView::paintEmptyArea( QPainter * p, const QRect & rect ) |
287 | { | 287 | { |
288 | QBrush b = palette().brush(QPalette::Active, QColorGroup::Base); | 288 | QBrush b = palette().brush(QPalette::Active, QColorGroup::Base); |
289 | 289 | ||
290 | // Get the brush, which will have the background pixmap if there is one. | 290 | // Get the brush, which will have the background pixmap if there is one. |
291 | if (b.pixmap()) | 291 | if (b.pixmap()) |
292 | { | 292 | { |
293 | p->drawTiledPixmap( rect.left(), rect.top(), rect.width(), rect.height(), | 293 | p->drawTiledPixmap( rect.left(), rect.top(), rect.width(), rect.height(), |
294 | *(b.pixmap()), | 294 | *(b.pixmap()), |
295 | rect.left() + contentsX(), | 295 | rect.left() + contentsX(), |
296 | rect.top() + contentsY() ); | 296 | rect.top() + contentsY() ); |
297 | } | 297 | } |
298 | 298 | ||
299 | else | 299 | else |
300 | { | 300 | { |
301 | // Do a normal paint | 301 | // Do a normal paint |
302 | KListView::paintEmptyArea(p, rect); | 302 | KListView::paintEmptyArea(p, rect); |
303 | } | 303 | } |
304 | } | 304 | } |
305 | 305 | ||
306 | void ContactListView::contentsMousePressEvent(QMouseEvent* e) | 306 | void ContactListView::contentsMousePressEvent(QMouseEvent* e) |
307 | { | 307 | { |
308 | presspos = e->pos(); | 308 | presspos = e->pos(); |
309 | KListView::contentsMousePressEvent(e); | 309 | KListView::contentsMousePressEvent(e); |
310 | } | 310 | } |
311 | 311 | ||
312 | 312 | ||
313 | // To initiate a drag operation | 313 | // To initiate a drag operation |
314 | void ContactListView::contentsMouseMoveEvent( QMouseEvent *e ) | 314 | void ContactListView::contentsMouseMoveEvent( QMouseEvent *e ) |
315 | { | 315 | { |
316 | if ((e->state() & LeftButton) && (e->pos() - presspos).manhattanLength() > 4 ) { | 316 | if ((e->state() & LeftButton) && (e->pos() - presspos).manhattanLength() > 4 ) { |
317 | emit startAddresseeDrag(); | 317 | emit startAddresseeDrag(); |
318 | } | 318 | } |
319 | else | 319 | else |
320 | KListView::contentsMouseMoveEvent( e ); | 320 | KListView::contentsMouseMoveEvent( e ); |
321 | } | 321 | } |
322 | 322 | ||
323 | bool ContactListView::acceptDrag(QDropEvent *e) const | 323 | bool ContactListView::acceptDrag(QDropEvent *e) const |
324 | { | 324 | { |
325 | #ifndef KAB_EMBEDDED | 325 | #ifndef KAB_EMBEDDED |
326 | return QTextDrag::canDecode(e); | 326 | return QTextDrag::canDecode(e); |
327 | #else //KAB_EMBEDDED | 327 | #else //KAB_EMBEDDED |
328 | qDebug("ContactListView::acceptDrag has to be fixed"); | 328 | qDebug("ContactListView::acceptDrag has to be fixed"); |
329 | return false; | 329 | return false; |
330 | #endif //KAB_EMBEDDED | 330 | #endif //KAB_EMBEDDED |
331 | } | 331 | } |
332 | 332 | ||
333 | void ContactListView::itemDropped(QDropEvent *e) | 333 | void ContactListView::itemDropped(QDropEvent *e) |
334 | { | 334 | { |
335 | contentsDropEvent(e); | 335 | contentsDropEvent(e); |
336 | } | 336 | } |
337 | 337 | ||
338 | void ContactListView::contentsDropEvent( QDropEvent *e ) | 338 | void ContactListView::contentsDropEvent( QDropEvent *e ) |
339 | { | 339 | { |
340 | emit addresseeDropped(e); | 340 | emit addresseeDropped(e); |
341 | } | 341 | } |
342 | 342 | ||
343 | void ContactListView::setAlternateBackgroundEnabled(bool enabled) | 343 | void ContactListView::setAlternateBackgroundEnabled(bool enabled) |
344 | { | 344 | { |
345 | mABackground = enabled; | 345 | mABackground = enabled; |
346 | 346 | ||
347 | if (mABackground) | 347 | if (mABackground) |
348 | { | 348 | { |
349 | setAlternateBackground(mAlternateColor); | 349 | setAlternateBackground(mAlternateColor); |
350 | } | 350 | } |
351 | else | 351 | else |
352 | { | 352 | { |
353 | setAlternateBackground(QColor()); | 353 | setAlternateBackground(QColor()); |
354 | } | 354 | } |
355 | } | 355 | } |
356 | 356 | ||
357 | void ContactListView::setBackgroundPixmap(const QString &filename) | 357 | void ContactListView::setBackgroundPixmap(const QString &filename) |
358 | { | 358 | { |
359 | if (filename.isEmpty()) | 359 | if (filename.isEmpty()) |
360 | { | 360 | { |
361 | unsetPalette(); | 361 | unsetPalette(); |
362 | } | 362 | } |
363 | else | 363 | else |
364 | { | 364 | { |
365 | qDebug("ContactListView::setBackgroundPixmap has to be verified"); | 365 | qDebug("ContactListView::setBackgroundPixmap has to be verified"); |
366 | //US setPaletteBackgroundPixmap(QPixmap(filename)); | 366 | //US setPaletteBackgroundPixmap(QPixmap(filename)); |
367 | KListView::setBackgroundPixmap((const QPixmap&)QPixmap(filename)); | 367 | KListView::setBackgroundPixmap((const QPixmap&)QPixmap(filename)); |
368 | } | 368 | } |
369 | 369 | ||
370 | } | 370 | } |
371 | #ifndef KAB_EMBEDDED | 371 | #ifndef KAB_EMBEDDED |
372 | #include "contactlistview.moc" | 372 | #include "contactlistview.moc" |
373 | #endif //KAB_EMBEDDED | 373 | #endif //KAB_EMBEDDED |
diff --git a/kaddressbook/xxportselectdialog.cpp b/kaddressbook/xxportselectdialog.cpp index ab95d5f..6282453 100644 --- a/kaddressbook/xxportselectdialog.cpp +++ b/kaddressbook/xxportselectdialog.cpp | |||
@@ -1,288 +1,294 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2002 Anders Lund <anders.lund@lund.tdcadsl.dk> | 3 | Copyright (c) 2002 Anders Lund <anders.lund@lund.tdcadsl.dk> |
4 | Tobias Koenig <tokoe@kde.org> | 4 | Tobias Koenig <tokoe@kde.org> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
8 | the Free Software Foundation; either version 2 of the License, or | 8 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. | 9 | (at your option) any later version. |
10 | 10 | ||
11 | This program is distributed in the hope that it will be useful, | 11 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | GNU General Public License for more details. | 14 | GNU General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU General Public License | 16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | 17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 | 19 | ||
20 | As a special exception, permission is given to link this program | 20 | As a special exception, permission is given to link this program |
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | /* | 25 | /* |
26 | Enhanced Version of the file for platform independent KDE tools. | 26 | Enhanced Version of the file for platform independent KDE tools. |
27 | Copyright (c) 2004 Ulf Schenk | 27 | Copyright (c) 2004 Ulf Schenk |
28 | 28 | ||
29 | $Id$ | 29 | $Id$ |
30 | */ | 30 | */ |
31 | 31 | ||
32 | #include <kabc/addressbook.h> | 32 | #include <kabc/addressbook.h> |
33 | #include <kapplication.h> | 33 | #include <kapplication.h> |
34 | #include <kcombobox.h> | 34 | #include <kcombobox.h> |
35 | #include <klocale.h> | 35 | #include <klocale.h> |
36 | #include <kglobal.h> | 36 | #include <kglobal.h> |
37 | 37 | ||
38 | #include <qapplication.h> | ||
38 | #include <qbuttongroup.h> | 39 | #include <qbuttongroup.h> |
39 | #include <qcombobox.h> | 40 | #include <qcombobox.h> |
40 | #include <qheader.h> | 41 | #include <qheader.h> |
41 | #include <qlabel.h> | 42 | #include <qlabel.h> |
42 | #include <qlayout.h> | 43 | #include <qlayout.h> |
43 | #include <qlistview.h> | 44 | #include <qlistview.h> |
44 | #include <qpushbutton.h> | 45 | #include <qpushbutton.h> |
45 | #include <qradiobutton.h> | 46 | #include <qradiobutton.h> |
46 | #include <qstringlist.h> | 47 | #include <qstringlist.h> |
47 | #include <qwhatsthis.h> | 48 | #include <qwhatsthis.h> |
48 | 49 | ||
49 | #include "kabcore.h" | 50 | #include "kabcore.h" |
50 | #include "kabprefs.h" | 51 | #include "kabprefs.h" |
51 | 52 | ||
52 | #include "xxportselectdialog.h" | 53 | #include "xxportselectdialog.h" |
53 | 54 | ||
54 | XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort, | 55 | XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort, |
55 | QWidget* parent, const char* name ) | 56 | QWidget* parent, const char* name ) |
56 | : KDialogBase( Plain, i18n( "Choose which contacts to select" ), Help | Ok | Cancel, | 57 | : KDialogBase( Plain, i18n( "Choose which contacts to select" ), Help | Ok | Cancel, |
57 | Ok, parent, name, true, true ), mCore( core ), | 58 | Ok, parent, name, true, true ), mCore( core ), |
58 | mUseSorting( sort ) | 59 | mUseSorting( sort ) |
59 | { | 60 | { |
60 | initGUI(); | 61 | initGUI(); |
61 | 62 | ||
62 | connect( mFiltersCombo, SIGNAL( activated( int ) ), | 63 | connect( mFiltersCombo, SIGNAL( activated( int ) ), |
63 | SLOT( filterChanged( int ) ) ); | 64 | SLOT( filterChanged( int ) ) ); |
64 | connect( mCategoriesView, SIGNAL( clicked( QListViewItem* ) ), | 65 | connect( mCategoriesView, SIGNAL( clicked( QListViewItem* ) ), |
65 | SLOT( categoryClicked( QListViewItem* ) ) ); | 66 | SLOT( categoryClicked( QListViewItem* ) ) ); |
66 | 67 | ||
67 | // setup filters | 68 | // setup filters |
68 | #ifndef KAB_EMBEDDED | 69 | #ifndef KAB_EMBEDDED |
69 | mFilters = Filter::restore( kapp->config(), "Filter" ); | 70 | mFilters = Filter::restore( kapp->config(), "Filter" ); |
70 | Filter::List::iterator filterIt; | 71 | Filter::List::iterator filterIt; |
71 | #else //KAB_EMBEDDED | 72 | #else //KAB_EMBEDDED |
72 | mFilters = Filter::restore( KGlobal::config(), "Filter" ); | 73 | mFilters = Filter::restore( KGlobal::config(), "Filter" ); |
73 | Filter::List::Iterator filterIt; | 74 | Filter::List::Iterator filterIt; |
74 | #endif //KAB_EMBEDDED | 75 | #endif //KAB_EMBEDDED |
75 | QStringList filters; | 76 | QStringList filters; |
76 | for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt ) | 77 | for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt ) |
77 | filters.append( (*filterIt).name() ); | 78 | filters.append( (*filterIt).name() ); |
78 | 79 | ||
79 | mFiltersCombo->insertStringList( filters ); | 80 | mFiltersCombo->insertStringList( filters ); |
80 | mUseFilters->setEnabled( filters.count() > 0 ); | 81 | mUseFilters->setEnabled( filters.count() > 0 ); |
81 | 82 | ||
82 | // setup categories | 83 | // setup categories |
83 | QStringList categories = KABPrefs::instance()->mCustomCategories; | 84 | QStringList categories = KABPrefs::instance()->mCustomCategories; |
84 | QStringList::Iterator it; | 85 | QStringList::Iterator it; |
85 | for ( it = categories.begin(); it != categories.end(); ++it ) | 86 | for ( it = categories.begin(); it != categories.end(); ++it ) |
86 | new QCheckListItem( mCategoriesView, *it, QCheckListItem::CheckBox ); | 87 | new QCheckListItem( mCategoriesView, *it, QCheckListItem::CheckBox ); |
87 | mUseCategories->setEnabled( categories.count() > 0 ); | 88 | mUseCategories->setEnabled( categories.count() > 0 ); |
88 | 89 | ||
89 | int count = mCore->selectedUIDs().count(); | 90 | int count = mCore->selectedUIDs().count(); |
90 | mUseSelection->setEnabled( count != 0 ); | 91 | mUseSelection->setEnabled( count != 0 ); |
91 | mUseSelection->setChecked( count > 1 ); | 92 | mUseSelection->setChecked( count > 1 ); |
92 | 93 | ||
93 | mSortTypeCombo->insertItem( i18n( "Ascending" ) ); | 94 | mSortTypeCombo->insertItem( i18n( "Ascending" ) ); |
94 | mSortTypeCombo->insertItem( i18n( "Descending" ) ); | 95 | mSortTypeCombo->insertItem( i18n( "Descending" ) ); |
95 | 96 | ||
96 | mFields = mCore->addressBook()->fields( KABC::Field::All ); | 97 | mFields = mCore->addressBook()->fields( KABC::Field::All ); |
97 | KABC::Field::List::Iterator fieldIt; | 98 | KABC::Field::List::Iterator fieldIt; |
98 | for ( fieldIt = mFields.begin(); fieldIt != mFields.end(); ++fieldIt ) | 99 | for ( fieldIt = mFields.begin(); fieldIt != mFields.end(); ++fieldIt ) |
99 | mFieldCombo->insertItem( (*fieldIt)->label() ); | 100 | mFieldCombo->insertItem( (*fieldIt)->label() ); |
100 | } | 101 | } |
101 | 102 | ||
102 | QStringList XXPortSelectDialog::uids() | 103 | QStringList XXPortSelectDialog::uids() |
103 | { | 104 | { |
104 | QStringList uidlist; | 105 | QStringList uidlist; |
105 | KABC::AddresseeList list = contacts(); | 106 | KABC::AddresseeList list = contacts(); |
106 | KABC::Addressee::List::Iterator it; | 107 | KABC::Addressee::List::Iterator it; |
107 | for ( it = list.begin(); it != list.end(); ++it ) | 108 | for ( it = list.begin(); it != list.end(); ++it ) |
108 | uidlist.append((*it).uid()); | 109 | uidlist.append((*it).uid()); |
109 | return uidlist; | 110 | return uidlist; |
110 | } | 111 | } |
111 | KABC::AddresseeList XXPortSelectDialog::contacts() | 112 | KABC::AddresseeList XXPortSelectDialog::contacts() |
112 | { | 113 | { |
113 | QStringList selection = mCore->selectedUIDs(); | 114 | QStringList selection = mCore->selectedUIDs(); |
114 | 115 | ||
115 | KABC::AddresseeList list; | 116 | KABC::AddresseeList list; |
116 | if ( mUseSelection->isChecked() ) { | 117 | if ( mUseSelection->isChecked() ) { |
117 | QStringList::Iterator it; | 118 | QStringList::Iterator it; |
118 | for ( it = selection.begin(); it != selection.end(); ++it ) { | 119 | for ( it = selection.begin(); it != selection.end(); ++it ) { |
119 | KABC::Addressee addr = mCore->addressBook()->findByUid( *it ); | 120 | KABC::Addressee addr = mCore->addressBook()->findByUid( *it ); |
120 | if ( !addr.isEmpty() ) | 121 | if ( !addr.isEmpty() ) |
121 | list.append( addr ); | 122 | list.append( addr ); |
122 | } | 123 | } |
123 | } else if ( mUseFilters->isChecked() ) { | 124 | } else if ( mUseFilters->isChecked() ) { |
124 | // find contacts that can pass selected filter | 125 | // find contacts that can pass selected filter |
125 | Filter::List::Iterator filterIt; | 126 | Filter::List::Iterator filterIt; |
126 | for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt ) | 127 | for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt ) |
127 | if ( (*filterIt).name() == mFiltersCombo->currentText() ) | 128 | if ( (*filterIt).name() == mFiltersCombo->currentText() ) |
128 | break; | 129 | break; |
129 | 130 | ||
130 | KABC::AddressBook::Iterator it; | 131 | KABC::AddressBook::Iterator it; |
131 | for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { | 132 | for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { |
132 | if ( (*filterIt).filterAddressee( *it ) ) | 133 | if ( (*filterIt).filterAddressee( *it ) ) |
133 | list.append( *it ); | 134 | list.append( *it ); |
134 | } | 135 | } |
135 | } else if ( mUseCategories->isChecked() ) { | 136 | } else if ( mUseCategories->isChecked() ) { |
136 | QStringList categorieList = categories(); | 137 | QStringList categorieList = categories(); |
137 | KABC::AddressBook::Iterator it; | 138 | KABC::AddressBook::Iterator it; |
138 | for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { | 139 | for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { |
139 | QStringList tmp( (*it).categories() ); | 140 | QStringList tmp( (*it).categories() ); |
140 | QStringList::Iterator tmpIt; | 141 | QStringList::Iterator tmpIt; |
141 | for ( tmpIt = tmp.begin(); tmpIt != tmp.end(); ++tmpIt ) | 142 | for ( tmpIt = tmp.begin(); tmpIt != tmp.end(); ++tmpIt ) |
142 | if ( categorieList.contains( *tmpIt ) ) { | 143 | if ( categorieList.contains( *tmpIt ) ) { |
143 | list.append( *it ); | 144 | list.append( *it ); |
144 | break; | 145 | break; |
145 | } | 146 | } |
146 | } | 147 | } |
147 | } else { | 148 | } else { |
148 | // create a string list of all entries: | 149 | // create a string list of all entries: |
149 | KABC::AddressBook::Iterator it; | 150 | KABC::AddressBook::Iterator it; |
150 | for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) | 151 | for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) |
151 | list.append( *it ); | 152 | list.append( *it ); |
152 | } | 153 | } |
153 | 154 | ||
154 | if ( mUseSorting ) { | 155 | if ( mUseSorting ) { |
155 | list.setReverseSorting( mSortTypeCombo->currentItem() == 1 ); | 156 | list.setReverseSorting( mSortTypeCombo->currentItem() == 1 ); |
156 | uint pos = mFieldCombo->currentItem(); | 157 | uint pos = mFieldCombo->currentItem(); |
157 | if ( pos < mFields.count() ) | 158 | if ( pos < mFields.count() ) |
158 | list.sortByField( mFields[ pos ] ); | 159 | list.sortByField( mFields[ pos ] ); |
159 | } | 160 | } |
160 | 161 | ||
161 | return list; | 162 | return list; |
162 | } | 163 | } |
163 | 164 | ||
164 | QStringList XXPortSelectDialog::categories() const | 165 | QStringList XXPortSelectDialog::categories() const |
165 | { | 166 | { |
166 | QStringList list; | 167 | QStringList list; |
167 | 168 | ||
168 | QListViewItemIterator it( mCategoriesView ); | 169 | QListViewItemIterator it( mCategoriesView ); |
169 | for ( ; it.current(); ++it ) { | 170 | for ( ; it.current(); ++it ) { |
170 | QCheckListItem* qcli = static_cast<QCheckListItem*>(it.current()); | 171 | QCheckListItem* qcli = static_cast<QCheckListItem*>(it.current()); |
171 | if ( qcli->isOn() ) | 172 | if ( qcli->isOn() ) |
172 | list.append( it.current()->text( 0 ) ); | 173 | list.append( it.current()->text( 0 ) ); |
173 | } | 174 | } |
174 | 175 | ||
175 | return list; | 176 | return list; |
176 | } | 177 | } |
177 | 178 | ||
178 | void XXPortSelectDialog::filterChanged( int ) | 179 | void XXPortSelectDialog::filterChanged( int ) |
179 | { | 180 | { |
180 | mUseFilters->setChecked( true ); | 181 | mUseFilters->setChecked( true ); |
181 | } | 182 | } |
182 | 183 | ||
183 | void XXPortSelectDialog::categoryClicked( QListViewItem *i ) | 184 | void XXPortSelectDialog::categoryClicked( QListViewItem *i ) |
184 | { | 185 | { |
185 | QCheckListItem *qcli = static_cast<QCheckListItem*>( i ); | 186 | QCheckListItem *qcli = static_cast<QCheckListItem*>( i ); |
186 | if ( qcli->isOn() ) | 187 | if ( qcli->isOn() ) |
187 | mUseCategories->setChecked( true ); | 188 | mUseCategories->setChecked( true ); |
188 | } | 189 | } |
189 | 190 | ||
190 | void XXPortSelectDialog::slotHelp() | 191 | void XXPortSelectDialog::slotHelp() |
191 | { | 192 | { |
192 | #ifndef KAB_EMBEDDED | 193 | #ifndef KAB_EMBEDDED |
193 | kapp->invokeHelp( "import-and-export" ); | 194 | kapp->invokeHelp( "import-and-export" ); |
194 | #else //KAB_EMBEDDED | 195 | #else //KAB_EMBEDDED |
195 | qDebug("XXPortSelectDialog::slotHelp is not implemented yet"); | 196 | qDebug("XXPortSelectDialog::slotHelp is not implemented yet"); |
196 | #endif //KAB_EMBEDDED | 197 | #endif //KAB_EMBEDDED |
197 | 198 | ||
198 | } | 199 | } |
199 | 200 | ||
200 | void XXPortSelectDialog::initGUI() | 201 | void XXPortSelectDialog::initGUI() |
201 | { | 202 | { |
202 | QFrame *page = plainPage(); | 203 | QFrame *page = plainPage(); |
203 | 204 | ||
204 | QVBoxLayout *topLayout = new QVBoxLayout( page, KDialog::marginHint(), | 205 | QVBoxLayout *topLayout = new QVBoxLayout( page, KDialog::marginHint(), |
205 | KDialog::spacingHint() ); | 206 | KDialog::spacingHint() ); |
206 | 207 | ||
207 | QLabel *label = new QLabel( i18n( "Which contacts do you want to select?" ), page ); | 208 | QLabel *label = new QLabel( i18n( "Which contacts do you want to select?" ), page ); |
208 | topLayout->addWidget( label ); | 209 | topLayout->addWidget( label ); |
209 | 210 | ||
210 | mButtonGroup = new QButtonGroup( i18n( "Contact Selection" ), page ); | 211 | mButtonGroup = new QButtonGroup( i18n( "Contact Selection" ), page ); |
211 | mButtonGroup->setColumnLayout( 0, Qt::Vertical ); | 212 | mButtonGroup->setColumnLayout( 0, Qt::Vertical ); |
212 | mButtonGroup->layout()->setSpacing( KDialog::spacingHint() ); | 213 | mButtonGroup->layout()->setSpacing( KDialog::spacingHint() ); |
213 | mButtonGroup->layout()->setMargin( KDialog::marginHint() ); | 214 | mButtonGroup->layout()->setMargin( KDialog::marginHint() ); |
214 | 215 | ||
215 | QGridLayout *groupLayout = new QGridLayout( mButtonGroup->layout() ); | 216 | QGridLayout *groupLayout = new QGridLayout( mButtonGroup->layout() ); |
216 | groupLayout->setAlignment( Qt::AlignTop ); | 217 | groupLayout->setAlignment( Qt::AlignTop ); |
217 | 218 | ||
218 | mUseWholeBook = new QRadioButton( i18n( "&All" ), mButtonGroup ); | 219 | mUseWholeBook = new QRadioButton( i18n( "&All" ), mButtonGroup ); |
219 | mUseWholeBook->setChecked( true ); | 220 | mUseWholeBook->setChecked( true ); |
220 | QWhatsThis::add( mUseWholeBook, i18n( "Select the entire address book" ) ); | 221 | QWhatsThis::add( mUseWholeBook, i18n( "Select the entire address book" ) ); |
221 | groupLayout->addWidget( mUseWholeBook, 0, 0 ); | 222 | groupLayout->addWidget( mUseWholeBook, 0, 0 ); |
222 | 223 | ||
223 | mUseSelection = new QRadioButton( i18n( "&Selected" ), mButtonGroup ); | 224 | mUseSelection = new QRadioButton( i18n( "&Selected" ), mButtonGroup ); |
224 | QWhatsThis::add( mUseSelection, i18n( "Only contacts selected in KAddressBook.\n" | 225 | QWhatsThis::add( mUseSelection, i18n( "Only contacts selected in KAddressBook.\n" |
225 | "This option is disabled if no contacts are selected." ) ); | 226 | "This option is disabled if no contacts are selected." ) ); |
226 | groupLayout->addWidget( mUseSelection, 1, 0 ); | 227 | groupLayout->addWidget( mUseSelection, 1, 0 ); |
227 | 228 | ||
228 | mUseFilters = new QRadioButton( i18n( "By matching &filter" ), mButtonGroup ); | 229 | mUseFilters = new QRadioButton( i18n( "By matching &filter" ), mButtonGroup ); |
229 | QWhatsThis::add( mUseFilters, i18n( "Only contacts matching the selected filter.\n" | 230 | QWhatsThis::add( mUseFilters, i18n( "Only contacts matching the selected filter.\n" |
230 | "This option is disabled if you haven't defined any filters" ) ); | 231 | "This option is disabled if you haven't defined any filters" ) ); |
231 | groupLayout->addWidget( mUseFilters, 2, 0 ); | 232 | groupLayout->addWidget( mUseFilters, 2, 0 ); |
232 | 233 | ||
233 | mUseCategories = new QRadioButton( i18n( "By Cate&gories" ), mButtonGroup ); | 234 | mUseCategories = new QRadioButton( i18n( "By Cate&gories" ), mButtonGroup ); |
234 | QWhatsThis::add( mUseCategories, i18n( "Only contacts who are members of a category that is checked on the list to the left.\n" | 235 | QWhatsThis::add( mUseCategories, i18n( "Only contacts who are members of a category that is checked on the list to the left.\n" |
235 | "This option is disabled if you have no categories." ) ); | 236 | "This option is disabled if you have no categories." ) ); |
236 | groupLayout->addWidget( mUseCategories, 3, 0 ); | 237 | groupLayout->addWidget( mUseCategories, 3, 0 ); |
237 | 238 | ||
238 | mFiltersCombo = new QComboBox( false, mButtonGroup ); | 239 | mFiltersCombo = new QComboBox( false, mButtonGroup ); |
239 | QWhatsThis::add( mFiltersCombo, i18n( "Select a filter to decide which contacts to select." ) ); | 240 | QWhatsThis::add( mFiltersCombo, i18n( "Select a filter to decide which contacts to select." ) ); |
240 | groupLayout->addWidget( mFiltersCombo, 2, 1 ); | 241 | groupLayout->addWidget( mFiltersCombo, 2, 1 ); |
241 | 242 | ||
242 | mCategoriesView = new QListView( mButtonGroup ); | 243 | mCategoriesView = new QListView( mButtonGroup ); |
243 | mCategoriesView->addColumn( "" ); | 244 | mCategoriesView->addColumn( "" ); |
244 | mCategoriesView->header()->hide(); | 245 | mCategoriesView->header()->hide(); |
245 | QWhatsThis::add( mCategoriesView, i18n( "Check the categories whose members you want to select." ) ); | 246 | QWhatsThis::add( mCategoriesView, i18n( "Check the categories whose members you want to select." ) ); |
246 | groupLayout->addWidget( mCategoriesView, 3, 1 ); | 247 | groupLayout->addWidget( mCategoriesView, 3, 1 ); |
247 | 248 | ||
249 | // if (QApplication::desktop()->height() == 480 ) | ||
250 | // mCategoriesView->setMaximumHeight( 240 ); | ||
248 | topLayout->addWidget( mButtonGroup ); | 251 | topLayout->addWidget( mButtonGroup ); |
249 | 252 | ||
250 | QButtonGroup *sortingGroup = new QButtonGroup( i18n( "Sorting" ), page ); | 253 | QButtonGroup *sortingGroup = new QButtonGroup( i18n( "Sorting" ), page ); |
251 | sortingGroup->setColumnLayout( 0, Qt::Vertical ); | 254 | sortingGroup->setColumnLayout( 0, Qt::Vertical ); |
252 | QGridLayout *sortLayout = new QGridLayout( sortingGroup->layout(), 2, 2, | 255 | QGridLayout *sortLayout = new QGridLayout( sortingGroup->layout(), 2, 2, |
253 | KDialog::spacingHint() ); | 256 | KDialog::spacingHint() ); |
254 | sortLayout->setAlignment( Qt::AlignTop ); | 257 | sortLayout->setAlignment( Qt::AlignTop ); |
255 | 258 | ||
256 | label = new QLabel( i18n( "Criterion:" ), sortingGroup ); | 259 | label = new QLabel( i18n( "Criterion:" ), sortingGroup ); |
257 | sortLayout->addWidget( label, 0, 0 ); | 260 | sortLayout->addWidget( label, 0, 0 ); |
258 | 261 | ||
259 | #ifndef KAB_EMBEDDED | 262 | #ifndef KAB_EMBEDDED |
260 | mFieldCombo = new KComboBox( false, sortingGroup ); | 263 | mFieldCombo = new KComboBox( false, sortingGroup ); |
261 | #else //KAB_EMBEDDED | 264 | #else //KAB_EMBEDDED |
262 | //US Combobox is not editable anyway | 265 | //US Combobox is not editable anyway |
263 | mFieldCombo = new KComboBox( sortingGroup ); | 266 | mFieldCombo = new KComboBox( sortingGroup ); |
264 | #endif //KAB_EMBEDDED | 267 | #endif //KAB_EMBEDDED |
265 | sortLayout->addWidget( mFieldCombo, 0, 1 ); | 268 | sortLayout->addWidget( mFieldCombo, 0, 1 ); |
266 | 269 | ||
267 | label = new QLabel( i18n( "Order:" ), sortingGroup ); | 270 | label = new QLabel( i18n( "Order:" ), sortingGroup ); |
268 | sortLayout->addWidget( label, 1, 0 ); | 271 | sortLayout->addWidget( label, 1, 0 ); |
269 | 272 | ||
270 | #ifndef KAB_EMBEDDED | 273 | #ifndef KAB_EMBEDDED |
271 | mSortTypeCombo = new KComboBox( false, sortingGroup ); | 274 | mSortTypeCombo = new KComboBox( false, sortingGroup ); |
272 | #else //KAB_EMBEDDED | 275 | #else //KAB_EMBEDDED |
273 | //US Combobox is not editable anyway | 276 | //US Combobox is not editable anyway |
274 | mSortTypeCombo = new KComboBox( sortingGroup ); | 277 | mSortTypeCombo = new KComboBox( sortingGroup ); |
275 | #endif //KAB_EMBEDDED | 278 | #endif //KAB_EMBEDDED |
276 | sortLayout->addWidget( mSortTypeCombo, 1, 1 ); | 279 | sortLayout->addWidget( mSortTypeCombo, 1, 1 ); |
277 | 280 | ||
278 | topLayout->addWidget( sortingGroup ); | 281 | topLayout->addWidget( sortingGroup ); |
279 | 282 | ||
280 | if ( !mUseSorting ) | 283 | if ( !mUseSorting ) |
281 | sortingGroup->hide(); | 284 | sortingGroup->hide(); |
285 | #ifndef DESKTOP_VERSION | ||
286 | hideButtons(); | ||
287 | #endif | ||
282 | } | 288 | } |
283 | 289 | ||
284 | #ifndef KAB_EMBEDDED | 290 | #ifndef KAB_EMBEDDED |
285 | #include "xxportselectdialog.moc" | 291 | #include "xxportselectdialog.moc" |
286 | #endif //KAB_EMBEDDED | 292 | #endif //KAB_EMBEDDED |
287 | 293 | ||
288 | 294 | ||
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 47cd488..543897a 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -2197,524 +2197,530 @@ void CalendarView::edit_paste() | |||
2197 | { | 2197 | { |
2198 | QDate date = mNavigator->selectedDates().first(); | 2198 | QDate date = mNavigator->selectedDates().first(); |
2199 | 2199 | ||
2200 | DndFactory factory( mCalendar ); | 2200 | DndFactory factory( mCalendar ); |
2201 | Event *pastedEvent = factory.pasteEvent( date ); | 2201 | Event *pastedEvent = factory.pasteEvent( date ); |
2202 | 2202 | ||
2203 | changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); | 2203 | changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); |
2204 | } | 2204 | } |
2205 | 2205 | ||
2206 | void CalendarView::edit_options() | 2206 | void CalendarView::edit_options() |
2207 | { | 2207 | { |
2208 | mDialogManager->showOptionsDialog(); | 2208 | mDialogManager->showOptionsDialog(); |
2209 | //writeSettings(); | 2209 | //writeSettings(); |
2210 | } | 2210 | } |
2211 | 2211 | ||
2212 | void CalendarView::slotSelectPickerDate( QDate d) | 2212 | void CalendarView::slotSelectPickerDate( QDate d) |
2213 | { | 2213 | { |
2214 | mDateFrame->hide(); | 2214 | mDateFrame->hide(); |
2215 | if ( mDatePickerMode == 1 ) { | 2215 | if ( mDatePickerMode == 1 ) { |
2216 | mNavigator->slotDaySelect( d ); | 2216 | mNavigator->slotDaySelect( d ); |
2217 | } else if ( mDatePickerMode == 2 ) { | 2217 | } else if ( mDatePickerMode == 2 ) { |
2218 | if ( mMoveIncidence->type() == "Todo" ) { | 2218 | if ( mMoveIncidence->type() == "Todo" ) { |
2219 | Todo * to = (Todo *) mMoveIncidence; | 2219 | Todo * to = (Todo *) mMoveIncidence; |
2220 | QTime tim; | 2220 | QTime tim; |
2221 | if ( to->hasDueDate() ) | 2221 | if ( to->hasDueDate() ) |
2222 | tim = to->dtDue().time(); | 2222 | tim = to->dtDue().time(); |
2223 | else { | 2223 | else { |
2224 | tim = QTime ( 0,0,0 ); | 2224 | tim = QTime ( 0,0,0 ); |
2225 | to->setFloats( true ); | 2225 | to->setFloats( true ); |
2226 | to->setHasDueDate( true ); | 2226 | to->setHasDueDate( true ); |
2227 | } | 2227 | } |
2228 | QDateTime dt ( d,tim ); | 2228 | QDateTime dt ( d,tim ); |
2229 | to->setDtDue( dt ); | 2229 | to->setDtDue( dt ); |
2230 | todoChanged( to ); | 2230 | todoChanged( to ); |
2231 | } else { | 2231 | } else { |
2232 | QTime tim = mMoveIncidence->dtStart().time(); | 2232 | QTime tim = mMoveIncidence->dtStart().time(); |
2233 | int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); | 2233 | int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); |
2234 | QDateTime dt ( d,tim ); | 2234 | QDateTime dt ( d,tim ); |
2235 | mMoveIncidence->setDtStart( dt ); | 2235 | mMoveIncidence->setDtStart( dt ); |
2236 | ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); | 2236 | ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); |
2237 | changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); | 2237 | changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); |
2238 | } | 2238 | } |
2239 | 2239 | ||
2240 | mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); | 2240 | mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); |
2241 | } | 2241 | } |
2242 | } | 2242 | } |
2243 | 2243 | ||
2244 | void CalendarView::removeCategories() | 2244 | void CalendarView::removeCategories() |
2245 | { | 2245 | { |
2246 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); | 2246 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); |
2247 | QStringList catList = KOPrefs::instance()->mCustomCategories; | 2247 | QStringList catList = KOPrefs::instance()->mCustomCategories; |
2248 | QStringList catIncList; | 2248 | QStringList catIncList; |
2249 | QStringList newCatList; | 2249 | QStringList newCatList; |
2250 | Incidence* inc = incList.first(); | 2250 | Incidence* inc = incList.first(); |
2251 | int i; | 2251 | int i; |
2252 | int count = 0; | 2252 | int count = 0; |
2253 | while ( inc ) { | 2253 | while ( inc ) { |
2254 | newCatList.clear(); | 2254 | newCatList.clear(); |
2255 | catIncList = inc->categories() ; | 2255 | catIncList = inc->categories() ; |
2256 | for( i = 0; i< catIncList.count(); ++i ) { | 2256 | for( i = 0; i< catIncList.count(); ++i ) { |
2257 | if ( catList.contains (catIncList[i])) | 2257 | if ( catList.contains (catIncList[i])) |
2258 | newCatList.append( catIncList[i] ); | 2258 | newCatList.append( catIncList[i] ); |
2259 | } | 2259 | } |
2260 | newCatList.sort(); | 2260 | newCatList.sort(); |
2261 | inc->setCategories( newCatList.join(",") ); | 2261 | inc->setCategories( newCatList.join(",") ); |
2262 | inc = incList.next(); | 2262 | inc = incList.next(); |
2263 | } | 2263 | } |
2264 | } | 2264 | } |
2265 | 2265 | ||
2266 | int CalendarView::addCategories() | 2266 | int CalendarView::addCategories() |
2267 | { | 2267 | { |
2268 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); | 2268 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); |
2269 | QStringList catList = KOPrefs::instance()->mCustomCategories; | 2269 | QStringList catList = KOPrefs::instance()->mCustomCategories; |
2270 | QStringList catIncList; | 2270 | QStringList catIncList; |
2271 | Incidence* inc = incList.first(); | 2271 | Incidence* inc = incList.first(); |
2272 | int i; | 2272 | int i; |
2273 | int count = 0; | 2273 | int count = 0; |
2274 | while ( inc ) { | 2274 | while ( inc ) { |
2275 | catIncList = inc->categories() ; | 2275 | catIncList = inc->categories() ; |
2276 | for( i = 0; i< catIncList.count(); ++i ) { | 2276 | for( i = 0; i< catIncList.count(); ++i ) { |
2277 | if ( !catList.contains (catIncList[i])) { | 2277 | if ( !catList.contains (catIncList[i])) { |
2278 | catList.append( catIncList[i] ); | 2278 | catList.append( catIncList[i] ); |
2279 | //qDebug("add cat %s ", catIncList[i].latin1()); | 2279 | //qDebug("add cat %s ", catIncList[i].latin1()); |
2280 | ++count; | 2280 | ++count; |
2281 | } | 2281 | } |
2282 | } | 2282 | } |
2283 | inc = incList.next(); | 2283 | inc = incList.next(); |
2284 | } | 2284 | } |
2285 | catList.sort(); | 2285 | catList.sort(); |
2286 | KOPrefs::instance()->mCustomCategories = catList; | 2286 | KOPrefs::instance()->mCustomCategories = catList; |
2287 | return count; | 2287 | return count; |
2288 | } | 2288 | } |
2289 | 2289 | ||
2290 | void CalendarView::manageCategories() | 2290 | void CalendarView::manageCategories() |
2291 | { | 2291 | { |
2292 | KOCatPrefs* cp = new KOCatPrefs(); | 2292 | KOCatPrefs* cp = new KOCatPrefs(); |
2293 | cp->show(); | 2293 | cp->show(); |
2294 | int w =cp->sizeHint().width() ; | 2294 | int w =cp->sizeHint().width() ; |
2295 | int h = cp->sizeHint().height() ; | 2295 | int h = cp->sizeHint().height() ; |
2296 | int dw = QApplication::desktop()->width(); | 2296 | int dw = QApplication::desktop()->width(); |
2297 | int dh = QApplication::desktop()->height(); | 2297 | int dh = QApplication::desktop()->height(); |
2298 | cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2298 | cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2299 | if ( !cp->exec() ) { | 2299 | if ( !cp->exec() ) { |
2300 | delete cp; | 2300 | delete cp; |
2301 | return; | 2301 | return; |
2302 | } | 2302 | } |
2303 | int count = 0; | 2303 | int count = 0; |
2304 | if ( cp->addCat() ) { | 2304 | if ( cp->addCat() ) { |
2305 | count = addCategories(); | 2305 | count = addCategories(); |
2306 | if ( count ) { | 2306 | if ( count ) { |
2307 | topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); | 2307 | topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); |
2308 | writeSettings(); | 2308 | writeSettings(); |
2309 | } else | 2309 | } else |
2310 | topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! ")); | 2310 | topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! ")); |
2311 | } else { | 2311 | } else { |
2312 | removeCategories(); | 2312 | removeCategories(); |
2313 | updateView(); | 2313 | updateView(); |
2314 | } | 2314 | } |
2315 | delete cp; | 2315 | delete cp; |
2316 | } | 2316 | } |
2317 | 2317 | ||
2318 | void CalendarView::beamIncidence(Incidence * Inc) | 2318 | void CalendarView::beamIncidence(Incidence * Inc) |
2319 | { | 2319 | { |
2320 | QPtrList<Incidence> delSel ; | 2320 | QPtrList<Incidence> delSel ; |
2321 | delSel.append(Inc); | 2321 | delSel.append(Inc); |
2322 | beamIncidenceList( delSel ); | 2322 | beamIncidenceList( delSel ); |
2323 | } | 2323 | } |
2324 | void CalendarView::beamCalendar() | 2324 | void CalendarView::beamCalendar() |
2325 | { | 2325 | { |
2326 | QPtrList<Incidence> delSel = mCalendar->rawIncidences(); | 2326 | QPtrList<Incidence> delSel = mCalendar->rawIncidences(); |
2327 | //qDebug("beamCalendar() "); | 2327 | //qDebug("beamCalendar() "); |
2328 | beamIncidenceList( delSel ); | 2328 | beamIncidenceList( delSel ); |
2329 | } | 2329 | } |
2330 | void CalendarView::beamFilteredCalendar() | 2330 | void CalendarView::beamFilteredCalendar() |
2331 | { | 2331 | { |
2332 | QPtrList<Incidence> delSel = mCalendar->incidences(); | 2332 | QPtrList<Incidence> delSel = mCalendar->incidences(); |
2333 | //qDebug("beamFilteredCalendar() "); | 2333 | //qDebug("beamFilteredCalendar() "); |
2334 | beamIncidenceList( delSel ); | 2334 | beamIncidenceList( delSel ); |
2335 | } | 2335 | } |
2336 | void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) | 2336 | void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) |
2337 | { | 2337 | { |
2338 | if ( beamDialog->exec () == QDialog::Rejected ) | 2338 | if ( beamDialog->exec () == QDialog::Rejected ) |
2339 | return; | 2339 | return; |
2340 | #ifdef DESKTOP_VERSION | 2340 | #ifdef DESKTOP_VERSION |
2341 | QString fn = locateLocal( "tmp", "kopibeamfile" ); | 2341 | QString fn = locateLocal( "tmp", "kopibeamfile" ); |
2342 | #else | 2342 | #else |
2343 | QString fn = "/tmp/kopibeamfile"; | 2343 | QString fn = "/tmp/kopibeamfile"; |
2344 | #endif | 2344 | #endif |
2345 | QString mes; | 2345 | QString mes; |
2346 | bool createbup = true; | 2346 | bool createbup = true; |
2347 | if ( createbup ) { | 2347 | if ( createbup ) { |
2348 | QString description = "\n"; | 2348 | QString description = "\n"; |
2349 | CalendarLocal* cal = new CalendarLocal(); | 2349 | CalendarLocal* cal = new CalendarLocal(); |
2350 | if ( beamDialog->beamLocal() ) | 2350 | if ( beamDialog->beamLocal() ) |
2351 | cal->setLocalTime(); | 2351 | cal->setLocalTime(); |
2352 | else | 2352 | else |
2353 | cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 2353 | cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
2354 | Incidence *incidence = delSel.first(); | 2354 | Incidence *incidence = delSel.first(); |
2355 | bool addText = false; | 2355 | bool addText = false; |
2356 | if ( delSel.count() < 10 ) | 2356 | if ( delSel.count() < 10 ) |
2357 | addText = true; | 2357 | addText = true; |
2358 | else { | 2358 | else { |
2359 | description.sprintf(i18n(" %d items?"),delSel.count() ); | 2359 | description.sprintf(i18n(" %d items?"),delSel.count() ); |
2360 | } | 2360 | } |
2361 | while ( incidence ) { | 2361 | while ( incidence ) { |
2362 | Incidence *in = incidence->clone(); | 2362 | Incidence *in = incidence->clone(); |
2363 | if ( ! in->summary().isEmpty() ) { | 2363 | if ( ! in->summary().isEmpty() ) { |
2364 | in->setDescription(""); | 2364 | in->setDescription(""); |
2365 | } else { | 2365 | } else { |
2366 | in->setSummary( in->description().left(20)); | 2366 | in->setSummary( in->description().left(20)); |
2367 | in->setDescription(""); | 2367 | in->setDescription(""); |
2368 | } | 2368 | } |
2369 | if ( addText ) | 2369 | if ( addText ) |
2370 | description += in->summary() + "\n"; | 2370 | description += in->summary() + "\n"; |
2371 | cal->addIncidence( in ); | 2371 | cal->addIncidence( in ); |
2372 | incidence = delSel.next(); | 2372 | incidence = delSel.next(); |
2373 | } | 2373 | } |
2374 | if ( beamDialog->beamVcal() ) { | 2374 | if ( beamDialog->beamVcal() ) { |
2375 | fn += ".vcs"; | 2375 | fn += ".vcs"; |
2376 | FileStorage storage( cal, fn, new VCalFormat ); | 2376 | FileStorage storage( cal, fn, new VCalFormat ); |
2377 | storage.save(); | 2377 | storage.save(); |
2378 | } else { | 2378 | } else { |
2379 | fn += ".ics"; | 2379 | fn += ".ics"; |
2380 | FileStorage storage( cal, fn, new ICalFormat( ) ); | 2380 | FileStorage storage( cal, fn, new ICalFormat( ) ); |
2381 | storage.save(); | 2381 | storage.save(); |
2382 | } | 2382 | } |
2383 | delete cal; | 2383 | delete cal; |
2384 | mes = i18n("KO/Pi: Ready for beaming"); | 2384 | mes = i18n("KO/Pi: Ready for beaming"); |
2385 | topLevelWidget()->setCaption(mes); | 2385 | topLevelWidget()->setCaption(mes); |
2386 | KApplication::convert2latin1( fn ); | 2386 | KApplication::convert2latin1( fn ); |
2387 | #ifndef DESKTOP_VERSION | 2387 | #ifndef DESKTOP_VERSION |
2388 | Ir *ir = new Ir( this ); | 2388 | Ir *ir = new Ir( this ); |
2389 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); | 2389 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); |
2390 | ir->send( fn, description, "text/x-vCalendar" ); | 2390 | ir->send( fn, description, "text/x-vCalendar" ); |
2391 | #endif | 2391 | #endif |
2392 | } | 2392 | } |
2393 | } | 2393 | } |
2394 | void CalendarView::beamDone( Ir *ir ) | 2394 | void CalendarView::beamDone( Ir *ir ) |
2395 | { | 2395 | { |
2396 | #ifndef DESKTOP_VERSION | 2396 | #ifndef DESKTOP_VERSION |
2397 | delete ir; | 2397 | delete ir; |
2398 | #endif | 2398 | #endif |
2399 | topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); | 2399 | topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); |
2400 | topLevelWidget()->raise(); | 2400 | topLevelWidget()->raise(); |
2401 | } | 2401 | } |
2402 | 2402 | ||
2403 | void CalendarView::moveIncidence(Incidence * inc ) | 2403 | void CalendarView::moveIncidence(Incidence * inc ) |
2404 | { | 2404 | { |
2405 | if ( !inc ) return; | 2405 | if ( !inc ) return; |
2406 | // qDebug("showDatePickerForIncidence( ) "); | 2406 | // qDebug("showDatePickerForIncidence( ) "); |
2407 | if ( mDateFrame->isVisible() ) | 2407 | if ( mDateFrame->isVisible() ) |
2408 | mDateFrame->hide(); | 2408 | mDateFrame->hide(); |
2409 | else { | 2409 | else { |
2410 | int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ; | 2410 | int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ; |
2411 | int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ; | 2411 | int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ; |
2412 | int dw = QApplication::desktop()->width(); | 2412 | int dw = QApplication::desktop()->width(); |
2413 | int dh = QApplication::desktop()->height(); | 2413 | int dh = QApplication::desktop()->height(); |
2414 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2414 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2415 | mDateFrame->show(); | 2415 | mDateFrame->show(); |
2416 | } | 2416 | } |
2417 | mDatePickerMode = 2; | 2417 | mDatePickerMode = 2; |
2418 | mMoveIncidence = inc ; | 2418 | mMoveIncidence = inc ; |
2419 | QDate da; | 2419 | QDate da; |
2420 | if ( mMoveIncidence->type() == "Todo" ) { | 2420 | if ( mMoveIncidence->type() == "Todo" ) { |
2421 | Todo * to = (Todo *) mMoveIncidence; | 2421 | Todo * to = (Todo *) mMoveIncidence; |
2422 | if ( to->hasDueDate() ) | 2422 | if ( to->hasDueDate() ) |
2423 | da = to->dtDue().date(); | 2423 | da = to->dtDue().date(); |
2424 | else | 2424 | else |
2425 | da = QDate::currentDate(); | 2425 | da = QDate::currentDate(); |
2426 | } else { | 2426 | } else { |
2427 | da = mMoveIncidence->dtStart().date(); | 2427 | da = mMoveIncidence->dtStart().date(); |
2428 | } | 2428 | } |
2429 | mDatePicker->setDate( da ); | 2429 | mDatePicker->setDate( da ); |
2430 | } | 2430 | } |
2431 | void CalendarView::showDatePicker( ) | 2431 | void CalendarView::showDatePicker( ) |
2432 | { | 2432 | { |
2433 | //qDebug("CalendarView::showDatePicker( ) "); | 2433 | //qDebug("CalendarView::showDatePicker( ) "); |
2434 | if ( mDateFrame->isVisible() ) | 2434 | if ( mDateFrame->isVisible() ) |
2435 | mDateFrame->hide(); | 2435 | mDateFrame->hide(); |
2436 | else { | 2436 | else { |
2437 | int w =mDatePicker->sizeHint().width() ; | 2437 | int w =mDatePicker->sizeHint().width() ; |
2438 | int h = mDatePicker->sizeHint().height() ; | 2438 | int h = mDatePicker->sizeHint().height() ; |
2439 | int dw = QApplication::desktop()->width(); | 2439 | int dw = QApplication::desktop()->width(); |
2440 | int dh = QApplication::desktop()->height(); | 2440 | int dh = QApplication::desktop()->height(); |
2441 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2441 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2442 | mDateFrame->show(); | 2442 | mDateFrame->show(); |
2443 | } | 2443 | } |
2444 | mDatePickerMode = 1; | 2444 | mDatePickerMode = 1; |
2445 | mDatePicker->setDate( mNavigator->selectedDates().first() ); | 2445 | mDatePicker->setDate( mNavigator->selectedDates().first() ); |
2446 | } | 2446 | } |
2447 | 2447 | ||
2448 | void CalendarView::showEventEditor() | 2448 | void CalendarView::showEventEditor() |
2449 | { | 2449 | { |
2450 | #ifdef DESKTOP_VERSION | 2450 | #ifdef DESKTOP_VERSION |
2451 | mEventEditor->show(); | 2451 | mEventEditor->show(); |
2452 | #else | 2452 | #else |
2453 | if ( mEventEditor->width() != QApplication::desktop()->width() ) | 2453 | if ( mEventEditor->width() != QApplication::desktop()->width() ) { |
2454 | mEventEditor->hide(); | 2454 | qDebug("CalendarView: recreate mEventEditor "); |
2455 | delete mEventEditor; | ||
2456 | mEventEditor = mDialogManager->getEventEditor(); | ||
2457 | } | ||
2455 | mEventEditor->showMaximized(); | 2458 | mEventEditor->showMaximized(); |
2456 | #endif | 2459 | #endif |
2457 | } | 2460 | } |
2458 | void CalendarView::showTodoEditor() | 2461 | void CalendarView::showTodoEditor() |
2459 | { | 2462 | { |
2460 | #ifdef DESKTOP_VERSION | 2463 | #ifdef DESKTOP_VERSION |
2461 | mTodoEditor->show(); | 2464 | mTodoEditor->show(); |
2462 | #else | 2465 | #else |
2463 | if ( mTodoEditor->width() != QApplication::desktop()->width() ) | 2466 | if ( mTodoEditor->width() != QApplication::desktop()->width() ) { |
2464 | mTodoEditor->hide(); | 2467 | qDebug("CalendarView: recreate mTodoEditor "); |
2468 | delete mTodoEditor; | ||
2469 | mTodoEditor = mDialogManager->getTodoEditor(); | ||
2470 | } | ||
2465 | mTodoEditor->showMaximized(); | 2471 | mTodoEditor->showMaximized(); |
2466 | #endif | 2472 | #endif |
2467 | } | 2473 | } |
2468 | 2474 | ||
2469 | void CalendarView::cloneIncidence() | 2475 | void CalendarView::cloneIncidence() |
2470 | { | 2476 | { |
2471 | Incidence *incidence = currentSelection(); | 2477 | Incidence *incidence = currentSelection(); |
2472 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2478 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2473 | if ( incidence ) { | 2479 | if ( incidence ) { |
2474 | cloneIncidence(incidence); | 2480 | cloneIncidence(incidence); |
2475 | } | 2481 | } |
2476 | } | 2482 | } |
2477 | void CalendarView::moveIncidence() | 2483 | void CalendarView::moveIncidence() |
2478 | { | 2484 | { |
2479 | Incidence *incidence = currentSelection(); | 2485 | Incidence *incidence = currentSelection(); |
2480 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2486 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2481 | if ( incidence ) { | 2487 | if ( incidence ) { |
2482 | moveIncidence(incidence); | 2488 | moveIncidence(incidence); |
2483 | } | 2489 | } |
2484 | } | 2490 | } |
2485 | void CalendarView::beamIncidence() | 2491 | void CalendarView::beamIncidence() |
2486 | { | 2492 | { |
2487 | Incidence *incidence = currentSelection(); | 2493 | Incidence *incidence = currentSelection(); |
2488 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2494 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2489 | if ( incidence ) { | 2495 | if ( incidence ) { |
2490 | beamIncidence(incidence); | 2496 | beamIncidence(incidence); |
2491 | } | 2497 | } |
2492 | } | 2498 | } |
2493 | void CalendarView::toggleCancelIncidence() | 2499 | void CalendarView::toggleCancelIncidence() |
2494 | { | 2500 | { |
2495 | Incidence *incidence = currentSelection(); | 2501 | Incidence *incidence = currentSelection(); |
2496 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2502 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2497 | if ( incidence ) { | 2503 | if ( incidence ) { |
2498 | cancelIncidence(incidence); | 2504 | cancelIncidence(incidence); |
2499 | } | 2505 | } |
2500 | } | 2506 | } |
2501 | 2507 | ||
2502 | 2508 | ||
2503 | void CalendarView::cancelIncidence(Incidence * inc ) | 2509 | void CalendarView::cancelIncidence(Incidence * inc ) |
2504 | { | 2510 | { |
2505 | inc->setCancelled( ! inc->cancelled() ); | 2511 | inc->setCancelled( ! inc->cancelled() ); |
2506 | changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); | 2512 | changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); |
2507 | updateView(); | 2513 | updateView(); |
2508 | } | 2514 | } |
2509 | void CalendarView::cloneIncidence(Incidence * orgInc ) | 2515 | void CalendarView::cloneIncidence(Incidence * orgInc ) |
2510 | { | 2516 | { |
2511 | Incidence * newInc = orgInc->clone(); | 2517 | Incidence * newInc = orgInc->clone(); |
2512 | newInc->recreate(); | 2518 | newInc->recreate(); |
2513 | 2519 | ||
2514 | if ( newInc->type() == "Todo" ) { | 2520 | if ( newInc->type() == "Todo" ) { |
2515 | Todo* t = (Todo*) newInc; | 2521 | Todo* t = (Todo*) newInc; |
2516 | mTodoEditor->editTodo( t ); | 2522 | mTodoEditor->editTodo( t ); |
2517 | showTodoEditor(); | 2523 | showTodoEditor(); |
2518 | if ( mTodoEditor->exec() ) { | 2524 | if ( mTodoEditor->exec() ) { |
2519 | mCalendar->addTodo( t ); | 2525 | mCalendar->addTodo( t ); |
2520 | updateView(); | 2526 | updateView(); |
2521 | } else { | 2527 | } else { |
2522 | delete t; | 2528 | delete t; |
2523 | } | 2529 | } |
2524 | } | 2530 | } |
2525 | else { | 2531 | else { |
2526 | Event* e = (Event*) newInc; | 2532 | Event* e = (Event*) newInc; |
2527 | mEventEditor->editEvent( e ); | 2533 | mEventEditor->editEvent( e ); |
2528 | showEventEditor(); | 2534 | showEventEditor(); |
2529 | if ( mEventEditor->exec() ) { | 2535 | if ( mEventEditor->exec() ) { |
2530 | mCalendar->addEvent( e ); | 2536 | mCalendar->addEvent( e ); |
2531 | updateView(); | 2537 | updateView(); |
2532 | } else { | 2538 | } else { |
2533 | delete e; | 2539 | delete e; |
2534 | } | 2540 | } |
2535 | } | 2541 | } |
2536 | } | 2542 | } |
2537 | 2543 | ||
2538 | void CalendarView::newEvent() | 2544 | void CalendarView::newEvent() |
2539 | { | 2545 | { |
2540 | // TODO: Replace this code by a common eventDurationHint of KOBaseView. | 2546 | // TODO: Replace this code by a common eventDurationHint of KOBaseView. |
2541 | KOAgendaView *aView = mViewManager->agendaView(); | 2547 | KOAgendaView *aView = mViewManager->agendaView(); |
2542 | if (aView) { | 2548 | if (aView) { |
2543 | if (aView->selectionStart().isValid()) { | 2549 | if (aView->selectionStart().isValid()) { |
2544 | if (aView->selectedIsAllDay()) { | 2550 | if (aView->selectedIsAllDay()) { |
2545 | newEvent(aView->selectionStart(),aView->selectionEnd(),true); | 2551 | newEvent(aView->selectionStart(),aView->selectionEnd(),true); |
2546 | } else { | 2552 | } else { |
2547 | newEvent(aView->selectionStart(),aView->selectionEnd()); | 2553 | newEvent(aView->selectionStart(),aView->selectionEnd()); |
2548 | } | 2554 | } |
2549 | return; | 2555 | return; |
2550 | } | 2556 | } |
2551 | } | 2557 | } |
2552 | 2558 | ||
2553 | QDate date = mNavigator->selectedDates().first(); | 2559 | QDate date = mNavigator->selectedDates().first(); |
2554 | QDateTime current = QDateTime::currentDateTime(); | 2560 | QDateTime current = QDateTime::currentDateTime(); |
2555 | if ( date <= current.date() ) { | 2561 | if ( date <= current.date() ) { |
2556 | int hour = current.time().hour() +1; | 2562 | int hour = current.time().hour() +1; |
2557 | newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), | 2563 | newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), |
2558 | QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); | 2564 | QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); |
2559 | } else | 2565 | } else |
2560 | newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), | 2566 | newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), |
2561 | QDateTime( date, QTime( KOPrefs::instance()->mStartTime + | 2567 | QDateTime( date, QTime( KOPrefs::instance()->mStartTime + |
2562 | KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); | 2568 | KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); |
2563 | } | 2569 | } |
2564 | 2570 | ||
2565 | void CalendarView::newEvent(QDateTime fh) | 2571 | void CalendarView::newEvent(QDateTime fh) |
2566 | { | 2572 | { |
2567 | newEvent(fh, | 2573 | newEvent(fh, |
2568 | QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); | 2574 | QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); |
2569 | } | 2575 | } |
2570 | 2576 | ||
2571 | void CalendarView::newEvent(QDate dt) | 2577 | void CalendarView::newEvent(QDate dt) |
2572 | { | 2578 | { |
2573 | newEvent(QDateTime(dt, QTime(0,0,0)), | 2579 | newEvent(QDateTime(dt, QTime(0,0,0)), |
2574 | QDateTime(dt, QTime(0,0,0)), true); | 2580 | QDateTime(dt, QTime(0,0,0)), true); |
2575 | } | 2581 | } |
2576 | 2582 | ||
2577 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) | 2583 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) |
2578 | { | 2584 | { |
2579 | 2585 | ||
2580 | mEventEditor->newEvent(fromHint,toHint,allDay); | 2586 | mEventEditor->newEvent(fromHint,toHint,allDay); |
2581 | if ( mFilterView->filtersEnabled() ) { | 2587 | if ( mFilterView->filtersEnabled() ) { |
2582 | CalFilter *filter = mFilterView->selectedFilter(); | 2588 | CalFilter *filter = mFilterView->selectedFilter(); |
2583 | if (filter && filter->showCategories()) { | 2589 | if (filter && filter->showCategories()) { |
2584 | mEventEditor->setCategories(filter->categoryList().join(",") ); | 2590 | mEventEditor->setCategories(filter->categoryList().join(",") ); |
2585 | } | 2591 | } |
2586 | if ( filter ) | 2592 | if ( filter ) |
2587 | mEventEditor->setSecrecy( filter->getSecrecy() ); | 2593 | mEventEditor->setSecrecy( filter->getSecrecy() ); |
2588 | } | 2594 | } |
2589 | showEventEditor(); | 2595 | showEventEditor(); |
2590 | } | 2596 | } |
2591 | void CalendarView::todoAdded(Todo * t) | 2597 | void CalendarView::todoAdded(Todo * t) |
2592 | { | 2598 | { |
2593 | 2599 | ||
2594 | changeTodoDisplay ( t ,KOGlobals::EVENTADDED); | 2600 | changeTodoDisplay ( t ,KOGlobals::EVENTADDED); |
2595 | updateTodoViews(); | 2601 | updateTodoViews(); |
2596 | } | 2602 | } |
2597 | void CalendarView::todoChanged(Todo * t) | 2603 | void CalendarView::todoChanged(Todo * t) |
2598 | { | 2604 | { |
2599 | emit todoModified( t, 4 ); | 2605 | emit todoModified( t, 4 ); |
2600 | // updateTodoViews(); | 2606 | // updateTodoViews(); |
2601 | } | 2607 | } |
2602 | void CalendarView::todoToBeDeleted(Todo *) | 2608 | void CalendarView::todoToBeDeleted(Todo *) |
2603 | { | 2609 | { |
2604 | //qDebug("todoToBeDeleted(Todo *) "); | 2610 | //qDebug("todoToBeDeleted(Todo *) "); |
2605 | updateTodoViews(); | 2611 | updateTodoViews(); |
2606 | } | 2612 | } |
2607 | void CalendarView::todoDeleted() | 2613 | void CalendarView::todoDeleted() |
2608 | { | 2614 | { |
2609 | //qDebug(" todoDeleted()"); | 2615 | //qDebug(" todoDeleted()"); |
2610 | updateTodoViews(); | 2616 | updateTodoViews(); |
2611 | } | 2617 | } |
2612 | 2618 | ||
2613 | 2619 | ||
2614 | 2620 | ||
2615 | void CalendarView::newTodo() | 2621 | void CalendarView::newTodo() |
2616 | { | 2622 | { |
2617 | 2623 | ||
2618 | mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),0,true); | 2624 | mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),0,true); |
2619 | if ( mFilterView->filtersEnabled() ) { | 2625 | if ( mFilterView->filtersEnabled() ) { |
2620 | CalFilter *filter = mFilterView->selectedFilter(); | 2626 | CalFilter *filter = mFilterView->selectedFilter(); |
2621 | if (filter && filter->showCategories()) { | 2627 | if (filter && filter->showCategories()) { |
2622 | mTodoEditor->setCategories(filter->categoryList().join(",") ); | 2628 | mTodoEditor->setCategories(filter->categoryList().join(",") ); |
2623 | } | 2629 | } |
2624 | if ( filter ) | 2630 | if ( filter ) |
2625 | mTodoEditor->setSecrecy( filter->getSecrecy() ); | 2631 | mTodoEditor->setSecrecy( filter->getSecrecy() ); |
2626 | } | 2632 | } |
2627 | showTodoEditor(); | 2633 | showTodoEditor(); |
2628 | } | 2634 | } |
2629 | 2635 | ||
2630 | void CalendarView::newSubTodo() | 2636 | void CalendarView::newSubTodo() |
2631 | { | 2637 | { |
2632 | Todo *todo = selectedTodo(); | 2638 | Todo *todo = selectedTodo(); |
2633 | if ( todo ) newSubTodo( todo ); | 2639 | if ( todo ) newSubTodo( todo ); |
2634 | } | 2640 | } |
2635 | 2641 | ||
2636 | void CalendarView::newSubTodo(Todo *parentEvent) | 2642 | void CalendarView::newSubTodo(Todo *parentEvent) |
2637 | { | 2643 | { |
2638 | 2644 | ||
2639 | mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true); | 2645 | mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true); |
2640 | showTodoEditor(); | 2646 | showTodoEditor(); |
2641 | } | 2647 | } |
2642 | 2648 | ||
2643 | void CalendarView::newFloatingEvent() | 2649 | void CalendarView::newFloatingEvent() |
2644 | { | 2650 | { |
2645 | DateList tmpList = mNavigator->selectedDates(); | 2651 | DateList tmpList = mNavigator->selectedDates(); |
2646 | QDate date = tmpList.first(); | 2652 | QDate date = tmpList.first(); |
2647 | 2653 | ||
2648 | newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), | 2654 | newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), |
2649 | QDateTime( date, QTime( 12, 0, 0 ) ), true ); | 2655 | QDateTime( date, QTime( 12, 0, 0 ) ), true ); |
2650 | } | 2656 | } |
2651 | 2657 | ||
2652 | 2658 | ||
2653 | void CalendarView::editEvent( Event *event ) | 2659 | void CalendarView::editEvent( Event *event ) |
2654 | { | 2660 | { |
2655 | 2661 | ||
2656 | if ( !event ) return; | 2662 | if ( !event ) return; |
2657 | if ( event->isReadOnly() ) { | 2663 | if ( event->isReadOnly() ) { |
2658 | showEvent( event ); | 2664 | showEvent( event ); |
2659 | return; | 2665 | return; |
2660 | } | 2666 | } |
2661 | mEventEditor->editEvent( event , mFlagEditDescription); | 2667 | mEventEditor->editEvent( event , mFlagEditDescription); |
2662 | showEventEditor(); | 2668 | showEventEditor(); |
2663 | } | 2669 | } |
2664 | void CalendarView::editJournal( Journal *jour ) | 2670 | void CalendarView::editJournal( Journal *jour ) |
2665 | { | 2671 | { |
2666 | if ( !jour ) return; | 2672 | if ( !jour ) return; |
2667 | mDialogManager->hideSearchDialog(); | 2673 | mDialogManager->hideSearchDialog(); |
2668 | mViewManager->showJournalView(); | 2674 | mViewManager->showJournalView(); |
2669 | mNavigator->slotDaySelect( jour->dtStart().date() ); | 2675 | mNavigator->slotDaySelect( jour->dtStart().date() ); |
2670 | } | 2676 | } |
2671 | void CalendarView::editTodo( Todo *todo ) | 2677 | void CalendarView::editTodo( Todo *todo ) |
2672 | { | 2678 | { |
2673 | if ( !todo ) return; | 2679 | if ( !todo ) return; |
2674 | 2680 | ||
2675 | if ( todo->isReadOnly() ) { | 2681 | if ( todo->isReadOnly() ) { |
2676 | showTodo( todo ); | 2682 | showTodo( todo ); |
2677 | return; | 2683 | return; |
2678 | } | 2684 | } |
2679 | mTodoEditor->editTodo( todo ,mFlagEditDescription); | 2685 | mTodoEditor->editTodo( todo ,mFlagEditDescription); |
2680 | showTodoEditor(); | 2686 | showTodoEditor(); |
2681 | 2687 | ||
2682 | } | 2688 | } |
2683 | 2689 | ||
2684 | KOEventViewerDialog* CalendarView::getEventViewerDialog() | 2690 | KOEventViewerDialog* CalendarView::getEventViewerDialog() |
2685 | { | 2691 | { |
2686 | if ( !mEventViewerDialog ) { | 2692 | if ( !mEventViewerDialog ) { |
2687 | mEventViewerDialog = new KOEventViewerDialog(this); | 2693 | mEventViewerDialog = new KOEventViewerDialog(this); |
2688 | connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); | 2694 | connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); |
2689 | connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); | 2695 | connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); |
2690 | connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), | 2696 | connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), |
2691 | dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); | 2697 | dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); |
2692 | connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), | 2698 | connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), |
2693 | viewManager(), SLOT( showAgendaView( bool ) ) ); | 2699 | viewManager(), SLOT( showAgendaView( bool ) ) ); |
2694 | mEventViewerDialog->resize( 640, 480 ); | 2700 | mEventViewerDialog->resize( 640, 480 ); |
2695 | 2701 | ||
2696 | } | 2702 | } |
2697 | return mEventViewerDialog; | 2703 | return mEventViewerDialog; |
2698 | } | 2704 | } |
2699 | void CalendarView::showEvent(Event *event) | 2705 | void CalendarView::showEvent(Event *event) |
2700 | { | 2706 | { |
2701 | getEventViewerDialog()->setEvent(event); | 2707 | getEventViewerDialog()->setEvent(event); |
2702 | getEventViewerDialog()->showMe(); | 2708 | getEventViewerDialog()->showMe(); |
2703 | } | 2709 | } |
2704 | 2710 | ||
2705 | void CalendarView::showTodo(Todo *event) | 2711 | void CalendarView::showTodo(Todo *event) |
2706 | { | 2712 | { |
2707 | getEventViewerDialog()->setTodo(event); | 2713 | getEventViewerDialog()->setTodo(event); |
2708 | getEventViewerDialog()->showMe(); | 2714 | getEventViewerDialog()->showMe(); |
2709 | } | 2715 | } |
2710 | void CalendarView::showJournal( Journal *jour ) | 2716 | void CalendarView::showJournal( Journal *jour ) |
2711 | { | 2717 | { |
2712 | getEventViewerDialog()->setJournal(jour); | 2718 | getEventViewerDialog()->setJournal(jour); |
2713 | getEventViewerDialog()->showMe(); | 2719 | getEventViewerDialog()->showMe(); |
2714 | 2720 | ||
2715 | } | 2721 | } |
2716 | // void CalendarView::todoModified (Todo *event, int changed) | 2722 | // void CalendarView::todoModified (Todo *event, int changed) |
2717 | // { | 2723 | // { |
2718 | // // if (mDialogList.find (event) != mDialogList.end ()) { | 2724 | // // if (mDialogList.find (event) != mDialogList.end ()) { |
2719 | // // kdDebug() << "Todo modified and open" << endl; | 2725 | // // kdDebug() << "Todo modified and open" << endl; |
2720 | // // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event]; | 2726 | // // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event]; |
diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp index 66f6977..b73d22f 100644 --- a/korganizer/koeditordetails.cpp +++ b/korganizer/koeditordetails.cpp | |||
@@ -1,412 +1,413 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in thse hope that it will be useful, | 10 | This program is distributed in thse hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qtooltip.h> | 24 | #include <qtooltip.h> |
25 | #include <qfiledialog.h> | 25 | #include <qfiledialog.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qvbox.h> | 27 | #include <qvbox.h> |
28 | #include <qbuttongroup.h> | 28 | #include <qbuttongroup.h> |
29 | #include <qvgroupbox.h> | 29 | #include <qvgroupbox.h> |
30 | #include <qwidgetstack.h> | 30 | #include <qwidgetstack.h> |
31 | #include <qdatetime.h> | 31 | #include <qdatetime.h> |
32 | #include <qapp.h> | 32 | #include <qapp.h> |
33 | 33 | ||
34 | #include <klocale.h> | 34 | #include <klocale.h> |
35 | #include <kglobal.h> | 35 | #include <kglobal.h> |
36 | #include <kiconloader.h> | 36 | #include <kiconloader.h> |
37 | #include <kstandarddirs.h> | 37 | #include <kstandarddirs.h> |
38 | #include <kmessagebox.h> | 38 | #include <kmessagebox.h> |
39 | #ifndef KORG_NOKABC | 39 | #ifndef KORG_NOKABC |
40 | 40 | ||
41 | #ifdef DESKTOP_VERSION | 41 | #ifdef DESKTOP_VERSION |
42 | #include <kabc/addresseedialog.h> | 42 | #include <kabc/addresseedialog.h> |
43 | #else //DESKTOP_VERSION | 43 | #else //DESKTOP_VERSION |
44 | #include <externalapphandler.h> | 44 | #include <externalapphandler.h> |
45 | #endif //DESKTOP_VERSION | 45 | #endif //DESKTOP_VERSION |
46 | 46 | ||
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | #include <libkcal/incidence.h> | 49 | #include <libkcal/incidence.h> |
50 | 50 | ||
51 | #include "koprefs.h" | 51 | #include "koprefs.h" |
52 | 52 | ||
53 | #include "koeditordetails.h" | 53 | #include "koeditordetails.h" |
54 | 54 | ||
55 | template <> | 55 | template <> |
56 | CustomListViewItem<class Attendee *>::~CustomListViewItem() | 56 | CustomListViewItem<class Attendee *>::~CustomListViewItem() |
57 | { | 57 | { |
58 | delete mData; | 58 | delete mData; |
59 | } | 59 | } |
60 | 60 | ||
61 | template <> | 61 | template <> |
62 | void CustomListViewItem<class Attendee *>::updateItem() | 62 | void CustomListViewItem<class Attendee *>::updateItem() |
63 | { | 63 | { |
64 | setText(0,mData->name()); | 64 | setText(0,mData->name()); |
65 | setText(1,mData->email()); | 65 | setText(1,mData->email()); |
66 | setText(2,mData->roleStr()); | 66 | setText(2,mData->roleStr()); |
67 | setText(3,mData->statusStr()); | 67 | setText(3,mData->statusStr()); |
68 | if (mData->RSVP() && !mData->email().isEmpty()) | 68 | if (mData->RSVP() && !mData->email().isEmpty()) |
69 | setPixmap(4,SmallIcon("mailappt")); | 69 | setPixmap(4,SmallIcon("mailappt")); |
70 | else | 70 | else |
71 | setPixmap(4,SmallIcon("nomailappt")); | 71 | setPixmap(4,SmallIcon("nomailappt")); |
72 | } | 72 | } |
73 | 73 | ||
74 | 74 | ||
75 | KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) | 75 | KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) |
76 | : QWidget( parent, name), mDisableItemUpdate( false ) | 76 | : QWidget( parent, name), mDisableItemUpdate( false ) |
77 | { | 77 | { |
78 | QGridLayout *topLayout = new QGridLayout(this); | 78 | QGridLayout *topLayout = new QGridLayout(this); |
79 | topLayout->setSpacing(spacing); | 79 | topLayout->setSpacing(spacing); |
80 | 80 | ||
81 | QString organizer = KOPrefs::instance()->email(); | 81 | QString organizer = KOPrefs::instance()->email(); |
82 | mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this); | 82 | mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this); |
83 | 83 | ||
84 | mListView = new KListView(this,"mListView"); | 84 | mListView = new KListView(this,"mListView"); |
85 | mListView->addColumn(i18n("Name"),180); | 85 | mListView->addColumn(i18n("Name"),180); |
86 | mListView->addColumn(i18n("Email"),180); | 86 | mListView->addColumn(i18n("Email"),180); |
87 | mListView->addColumn(i18n("Role"),60); | 87 | mListView->addColumn(i18n("Role"),60); |
88 | mListView->addColumn(i18n("Status"),100); | 88 | mListView->addColumn(i18n("Status"),100); |
89 | mListView->addColumn(i18n("RSVP"),35); | 89 | mListView->addColumn(i18n("RSVP"),35); |
90 | if ( KOPrefs::instance()->mCompactDialogs ) { | 90 | if ( KOPrefs::instance()->mCompactDialogs ) { |
91 | //mListView->setFixedHeight(78); | 91 | //mListView->setFixedHeight(78); |
92 | } | 92 | } |
93 | 93 | ||
94 | connect(mListView,SIGNAL(selectionChanged(QListViewItem *)), | 94 | connect(mListView,SIGNAL(selectionChanged(QListViewItem *)), |
95 | SLOT(updateAttendeeInput())); | 95 | SLOT(updateAttendeeInput())); |
96 | 96 | ||
97 | QLabel *attendeeLabel = new QLabel(this); | 97 | QLabel *attendeeLabel = new QLabel(this); |
98 | attendeeLabel->setText(i18n("Name:")); | 98 | attendeeLabel->setText(i18n("Name:")); |
99 | attendeeLabel->setFixedSize( attendeeLabel->sizeHint() ); | 99 | attendeeLabel->setFixedSize( attendeeLabel->sizeHint() ); |
100 | mNameEdit = new QLineEdit(this); | 100 | mNameEdit = new QLineEdit(this); |
101 | connect(mNameEdit,SIGNAL(textChanged(const QString &)), | 101 | connect(mNameEdit,SIGNAL(textChanged(const QString &)), |
102 | SLOT(updateAttendeeItem())); | 102 | SLOT(updateAttendeeItem())); |
103 | 103 | ||
104 | mUidEdit = new QLineEdit(0); | 104 | mUidEdit = new QLineEdit(0); |
105 | mUidEdit->setText(""); | 105 | mUidEdit->setText(""); |
106 | 106 | ||
107 | QLabel *emailLabel = new QLabel(this); | 107 | QLabel *emailLabel = new QLabel(this); |
108 | emailLabel->setText(i18n("Email:")); | 108 | emailLabel->setText(i18n("Email:")); |
109 | mEmailEdit = new QLineEdit(this); | 109 | mEmailEdit = new QLineEdit(this); |
110 | connect(mEmailEdit,SIGNAL(textChanged(const QString &)), | 110 | connect(mEmailEdit,SIGNAL(textChanged(const QString &)), |
111 | SLOT(updateAttendeeItem())); | 111 | SLOT(updateAttendeeItem())); |
112 | 112 | ||
113 | QLabel *attendeeRoleLabel = new QLabel(this); | 113 | QLabel *attendeeRoleLabel = new QLabel(this); |
114 | attendeeRoleLabel->setText(i18n("Role:")); | 114 | attendeeRoleLabel->setText(i18n("Role:")); |
115 | mRoleCombo = new QComboBox(false,this); | 115 | mRoleCombo = new QComboBox(false,this); |
116 | mRoleCombo->insertStringList(Attendee::roleList()); | 116 | mRoleCombo->insertStringList(Attendee::roleList()); |
117 | connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); | 117 | connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); |
118 | 118 | ||
119 | QLabel *statusLabel = new QLabel(this); | 119 | QLabel *statusLabel = new QLabel(this); |
120 | statusLabel->setText( i18n("Status:") ); | 120 | statusLabel->setText( i18n("Status:") ); |
121 | 121 | ||
122 | mStatusCombo = new QComboBox(false,this); | 122 | mStatusCombo = new QComboBox(false,this); |
123 | mStatusCombo->insertStringList(Attendee::statusList()); | 123 | mStatusCombo->insertStringList(Attendee::statusList()); |
124 | connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); | 124 | connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); |
125 | 125 | ||
126 | mRsvpButton = new QCheckBox(this); | 126 | mRsvpButton = new QCheckBox(this); |
127 | mRsvpButton->setText(i18n("Request response")); | 127 | mRsvpButton->setText(i18n("Request response")); |
128 | connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem())); | 128 | connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem())); |
129 | QWidget *buttonBox = new QWidget(this); | 129 | QWidget *buttonBox = new QWidget(this); |
130 | QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox); | 130 | QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox); |
131 | 131 | ||
132 | QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox); | 132 | QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox); |
133 | buttonLayout->addWidget(newButton); | 133 | buttonLayout->addWidget(newButton); |
134 | connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee())); | 134 | connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee())); |
135 | 135 | ||
136 | mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox); | 136 | mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox); |
137 | buttonLayout->addWidget(mRemoveButton); | 137 | buttonLayout->addWidget(mRemoveButton); |
138 | connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee())); | 138 | connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee())); |
139 | 139 | ||
140 | mAddressBookButton = new QPushButton(i18n("Address &Book..."),this); | 140 | mAddressBookButton = new QPushButton(i18n("Address &Book..."),this); |
141 | // buttonLayout->addWidget(mAddressBookButton); | 141 | // buttonLayout->addWidget(mAddressBookButton); |
142 | connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook())); | 142 | connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook())); |
143 | //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () ); | 143 | //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () ); |
144 | 144 | ||
145 | if (qApp->desktop()->width() < 300 ) { | 145 | if (qApp->desktop()->width() < 640 ) { |
146 | if ( qApp->desktop()->width() < 300 ) | ||
146 | mListView->setFixedHeight(80); | 147 | mListView->setFixedHeight(80); |
147 | topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,3); | 148 | topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,3); |
148 | topLayout->addMultiCellWidget(mListView,1,1,0,3); | 149 | topLayout->addMultiCellWidget(mListView,1,1,0,3); |
149 | topLayout->addWidget(attendeeLabel,3,0); | 150 | topLayout->addWidget(attendeeLabel,3,0); |
150 | topLayout->addMultiCellWidget(mNameEdit,3,3,1,2); | 151 | topLayout->addMultiCellWidget(mNameEdit,3,3,1,2); |
151 | topLayout->addWidget(emailLabel,4,0); | 152 | topLayout->addWidget(emailLabel,4,0); |
152 | topLayout->addMultiCellWidget(mEmailEdit,4,4,1,2); | 153 | topLayout->addMultiCellWidget(mEmailEdit,4,4,1,2); |
153 | topLayout->addWidget(attendeeRoleLabel,5,0); | 154 | topLayout->addWidget(attendeeRoleLabel,5,0); |
154 | topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2); | 155 | topLayout->addMultiCellWidget(mRoleCombo,5,5,1,3); |
155 | topLayout->addWidget(statusLabel,6,0); | 156 | topLayout->addWidget(statusLabel,6,0); |
156 | topLayout->addMultiCellWidget(mStatusCombo,6,6,1,2); | 157 | topLayout->addMultiCellWidget(mStatusCombo,6,6,1,3); |
157 | topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,3); | 158 | topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,3); |
158 | topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); | 159 | topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); |
159 | topLayout->addMultiCellWidget(buttonBox,3,4,3,3); | 160 | topLayout->addMultiCellWidget(buttonBox,3,4,3,3); |
160 | topLayout->setRowStretch(1,2); | 161 | topLayout->setRowStretch(1,2); |
161 | topLayout->setColStretch(0,0); | 162 | topLayout->setColStretch(0,0); |
162 | topLayout->setColStretch(1,2); | 163 | topLayout->setColStretch(1,2); |
163 | topLayout->setColStretch(2,1); | 164 | topLayout->setColStretch(2,1); |
164 | topLayout->setColStretch(3,1); | 165 | topLayout->setColStretch(3,1); |
165 | 166 | ||
166 | } else { | 167 | } else { |
167 | topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5); | 168 | topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5); |
168 | topLayout->addMultiCellWidget(mListView,1,1,0,5); | 169 | topLayout->addMultiCellWidget(mListView,1,1,0,5); |
169 | topLayout->addWidget(attendeeLabel,3,0); | 170 | topLayout->addWidget(attendeeLabel,3,0); |
170 | topLayout->addMultiCellWidget(mNameEdit,3,3,1,4); | 171 | topLayout->addMultiCellWidget(mNameEdit,3,3,1,4); |
171 | topLayout->addWidget(emailLabel,4,0); | 172 | topLayout->addWidget(emailLabel,4,0); |
172 | topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4); | 173 | topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4); |
173 | topLayout->addWidget(attendeeRoleLabel,5,0); | 174 | topLayout->addWidget(attendeeRoleLabel,5,0); |
174 | topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2); | 175 | topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2); |
175 | topLayout->addWidget(statusLabel,5,3); | 176 | topLayout->addWidget(statusLabel,5,3); |
176 | topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5); | 177 | topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5); |
177 | topLayout->addMultiCellWidget(mAddressBookButton,2,2,4,5); | 178 | topLayout->addMultiCellWidget(mAddressBookButton,2,2,4,5); |
178 | topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); | 179 | topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); |
179 | topLayout->addMultiCellWidget(buttonBox,3,4,5,5); | 180 | topLayout->addMultiCellWidget(buttonBox,3,4,5,5); |
180 | topLayout->setRowStretch(1,5); | 181 | topLayout->setRowStretch(1,5); |
181 | topLayout->setColStretch(0,0); | 182 | topLayout->setColStretch(0,0); |
182 | } | 183 | } |
183 | // #if 0 | 184 | // #if 0 |
184 | // topLayout->setColStretch(2,1); | 185 | // topLayout->setColStretch(2,1); |
185 | // topLayout->addWidget(statusLabel,3,3); | 186 | // topLayout->addWidget(statusLabel,3,3); |
186 | // topLayout->addWidget(mStatusCombo,3,4); | 187 | // topLayout->addWidget(mStatusCombo,3,4); |
187 | // #else | 188 | // #else |
188 | // topLayout->addWidget(statusLabel,4,3); | 189 | // topLayout->addWidget(statusLabel,4,3); |
189 | // // topLayout->addWidget(mStatusCombo,4,3); | 190 | // // topLayout->addWidget(mStatusCombo,4,3); |
190 | // topLayout->addMultiCellWidget(mStatusCombo,4,4,4,5); | 191 | // topLayout->addMultiCellWidget(mStatusCombo,4,4,4,5); |
191 | 192 | ||
192 | // #endif | 193 | // #endif |
193 | // // topLayout->setRowStretch(5,1); | 194 | // // topLayout->setRowStretch(5,1); |
194 | // topLayout->addMultiCellWidget(mRsvpButton,5,5,0,1); | 195 | // topLayout->addMultiCellWidget(mRsvpButton,5,5,0,1); |
195 | // topLayout->addMultiCellWidget(buttonBox,2,3,5,5); | 196 | // topLayout->addMultiCellWidget(buttonBox,2,3,5,5); |
196 | // topLayout->setRowStretch(1,5); | 197 | // topLayout->setRowStretch(1,5); |
197 | // topLayout->setColStretch(0,0); | 198 | // topLayout->setColStretch(0,0); |
198 | 199 | ||
199 | #ifdef KORG_NOKABC | 200 | #ifdef KORG_NOKABC |
200 | mAddressBookButton->hide(); | 201 | mAddressBookButton->hide(); |
201 | #endif | 202 | #endif |
202 | 203 | ||
203 | updateAttendeeInput(); | 204 | updateAttendeeInput(); |
204 | #ifndef DESKTOP_VERSION | 205 | #ifndef DESKTOP_VERSION |
205 | //US listen for arriving address resultsets | 206 | //US listen for arriving address resultsets |
206 | connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), | 207 | connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), |
207 | this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); | 208 | this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); |
208 | #endif | 209 | #endif |
209 | 210 | ||
210 | } | 211 | } |
211 | 212 | ||
212 | KOEditorDetails::~KOEditorDetails() | 213 | KOEditorDetails::~KOEditorDetails() |
213 | { | 214 | { |
214 | } | 215 | } |
215 | 216 | ||
216 | void KOEditorDetails::removeAttendee() | 217 | void KOEditorDetails::removeAttendee() |
217 | { | 218 | { |
218 | AttendeeListItem *aItem = (AttendeeListItem *)mListView->selectedItem(); | 219 | AttendeeListItem *aItem = (AttendeeListItem *)mListView->selectedItem(); |
219 | if (!aItem) return; | 220 | if (!aItem) return; |
220 | 221 | ||
221 | Attendee *delA = new Attendee(aItem->data()->name(),aItem->data()->email(), | 222 | Attendee *delA = new Attendee(aItem->data()->name(),aItem->data()->email(), |
222 | aItem->data()->RSVP(),aItem->data()->status(),aItem->data()->role(), | 223 | aItem->data()->RSVP(),aItem->data()->status(),aItem->data()->role(), |
223 | aItem->data()->uid()); | 224 | aItem->data()->uid()); |
224 | mdelAttendees.append(delA); | 225 | mdelAttendees.append(delA); |
225 | 226 | ||
226 | delete aItem; | 227 | delete aItem; |
227 | 228 | ||
228 | updateAttendeeInput(); | 229 | updateAttendeeInput(); |
229 | } | 230 | } |
230 | 231 | ||
231 | 232 | ||
232 | void KOEditorDetails::openAddressBook() | 233 | void KOEditorDetails::openAddressBook() |
233 | { | 234 | { |
234 | #ifndef KORG_NOKABC | 235 | #ifndef KORG_NOKABC |
235 | 236 | ||
236 | #ifdef DESKTOP_VERSION | 237 | #ifdef DESKTOP_VERSION |
237 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); | 238 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); |
238 | uint i=0; | 239 | uint i=0; |
239 | for (i=0; i < list.count(); i++) { | 240 | for (i=0; i < list.count(); i++) { |
240 | insertAttendee( new Attendee( list[i].realName(), list[i].preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,list[i].uid()) ); | 241 | insertAttendee( new Attendee( list[i].realName(), list[i].preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,list[i].uid()) ); |
241 | } | 242 | } |
242 | #else | 243 | #else |
243 | bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); | 244 | bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); |
244 | // the result should now arrive through method insertAttendees | 245 | // the result should now arrive through method insertAttendees |
245 | #endif | 246 | #endif |
246 | 247 | ||
247 | 248 | ||
248 | #if 0 | 249 | #if 0 |
249 | KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this); | 250 | KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this); |
250 | if (!a.isEmpty()) { | 251 | if (!a.isEmpty()) { |
251 | insertAttendee( new Attendee( a.realName(), a.preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,a.uid()) ); | 252 | insertAttendee( new Attendee( a.realName(), a.preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,a.uid()) ); |
252 | } | 253 | } |
253 | #endif | 254 | #endif |
254 | #endif | 255 | #endif |
255 | } | 256 | } |
256 | 257 | ||
257 | 258 | ||
258 | void KOEditorDetails::addNewAttendee() | 259 | void KOEditorDetails::addNewAttendee() |
259 | { | 260 | { |
260 | #if 0 | 261 | #if 0 |
261 | // this is cool. If they didn't enter an email address, | 262 | // this is cool. If they didn't enter an email address, |
262 | // try to look it up in the address book and fill it in for them. | 263 | // try to look it up in the address book and fill it in for them. |
263 | if (QString(mEmailEdit->text()).stripWhiteSpace().isEmpty()) { | 264 | if (QString(mEmailEdit->text()).stripWhiteSpace().isEmpty()) { |
264 | KabAPI addrBook; | 265 | KabAPI addrBook; |
265 | QString name; | 266 | QString name; |
266 | std::list<AddressBook::Entry> entries; | 267 | std::list<AddressBook::Entry> entries; |
267 | name = mNameEdit->text(); | 268 | name = mNameEdit->text(); |
268 | if (addrBook.init() == AddressBook::NoError) { | 269 | if (addrBook.init() == AddressBook::NoError) { |
269 | if (addrBook.getEntryByName(name, entries, 1) == AddressBook::NoError) { | 270 | if (addrBook.getEntryByName(name, entries, 1) == AddressBook::NoError) { |
270 | kdDebug() << "positive match" << endl; | 271 | kdDebug() << "positive match" << endl; |
271 | // take first email address | 272 | // take first email address |
272 | if (!entries.front().emails.isEmpty() && | 273 | if (!entries.front().emails.isEmpty() && |
273 | entries.front().emails.first().length()>0) | 274 | entries.front().emails.first().length()>0) |
274 | mEmailEdit->setText(entries.front().emails.first()); | 275 | mEmailEdit->setText(entries.front().emails.first()); |
275 | } | 276 | } |
276 | } | 277 | } |
277 | } | 278 | } |
278 | #endif | 279 | #endif |
279 | 280 | ||
280 | Attendee *a = new Attendee(i18n("(EmptyName)"),i18n("(EmptyEmail)")); | 281 | Attendee *a = new Attendee(i18n("(EmptyName)"),i18n("(EmptyEmail)")); |
281 | insertAttendee(a); | 282 | insertAttendee(a); |
282 | } | 283 | } |
283 | 284 | ||
284 | //the map includes name/email pairs, that comes from Ka/Pi | 285 | //the map includes name/email pairs, that comes from Ka/Pi |
285 | void KOEditorDetails::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) | 286 | void KOEditorDetails::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) |
286 | { | 287 | { |
287 | if (uid == this->name()) | 288 | if (uid == this->name()) |
288 | { | 289 | { |
289 | for ( int i = 0; i < nameList.count(); i++) | 290 | for ( int i = 0; i < nameList.count(); i++) |
290 | { | 291 | { |
291 | QString _name = nameList[i]; | 292 | QString _name = nameList[i]; |
292 | QString _email = emailList[i]; | 293 | QString _email = emailList[i]; |
293 | QString _uid = uidList[i]; | 294 | QString _uid = uidList[i]; |
294 | 295 | ||
295 | Attendee *a = new Attendee(_name,_email,false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant, _uid); | 296 | Attendee *a = new Attendee(_name,_email,false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant, _uid); |
296 | insertAttendee(a); | 297 | insertAttendee(a); |
297 | } | 298 | } |
298 | } | 299 | } |
299 | 300 | ||
300 | } | 301 | } |
301 | 302 | ||
302 | void KOEditorDetails::insertAttendee(Attendee *a) | 303 | void KOEditorDetails::insertAttendee(Attendee *a) |
303 | { | 304 | { |
304 | AttendeeListItem *first = (AttendeeListItem*) mListView->firstChild(); | 305 | AttendeeListItem *first = (AttendeeListItem*) mListView->firstChild(); |
305 | while (first) { | 306 | while (first) { |
306 | if ( first->data()->name() == a->name() && first->data()->email() == a->email() ) | 307 | if ( first->data()->name() == a->name() && first->data()->email() == a->email() ) |
307 | return; | 308 | return; |
308 | first = (AttendeeListItem*) first->nextSibling(); | 309 | first = (AttendeeListItem*) first->nextSibling(); |
309 | } | 310 | } |
310 | 311 | ||
311 | AttendeeListItem *item = new AttendeeListItem(a,mListView); | 312 | AttendeeListItem *item = new AttendeeListItem(a,mListView); |
312 | mListView->setSelected( item, true ); | 313 | mListView->setSelected( item, true ); |
313 | } | 314 | } |
314 | 315 | ||
315 | void KOEditorDetails::setDefaults() | 316 | void KOEditorDetails::setDefaults() |
316 | { | 317 | { |
317 | mRsvpButton->setChecked(true); | 318 | mRsvpButton->setChecked(true); |
318 | mListView->clear(); | 319 | mListView->clear(); |
319 | mdelAttendees.clear(); | 320 | mdelAttendees.clear(); |
320 | clearAttendeeInput(); | 321 | clearAttendeeInput(); |
321 | mOrganizerLabel->setText(i18n("Organizer: %1").arg(KOPrefs::instance()->email())); | 322 | mOrganizerLabel->setText(i18n("Organizer: %1").arg(KOPrefs::instance()->email())); |
322 | 323 | ||
323 | mNameEdit->setText(""); | 324 | mNameEdit->setText(""); |
324 | mUidEdit->setText(""); | 325 | mUidEdit->setText(""); |
325 | mEmailEdit->setText(""); | 326 | mEmailEdit->setText(""); |
326 | mRoleCombo->setCurrentItem( 0 ); | 327 | mRoleCombo->setCurrentItem( 0 ); |
327 | mStatusCombo->setCurrentItem( 0 ); | 328 | mStatusCombo->setCurrentItem( 0 ); |
328 | 329 | ||
329 | } | 330 | } |
330 | 331 | ||
331 | void KOEditorDetails::readEvent(Incidence *event) | 332 | void KOEditorDetails::readEvent(Incidence *event) |
332 | { | 333 | { |
333 | setDefaults(); | 334 | setDefaults(); |
334 | //mListView->clear(); | 335 | //mListView->clear(); |
335 | //mdelAttendees.clear(); | 336 | //mdelAttendees.clear(); |
336 | QPtrList<Attendee> tmpAList = event->attendees(); | 337 | QPtrList<Attendee> tmpAList = event->attendees(); |
337 | Attendee *a; | 338 | Attendee *a; |
338 | for (a = tmpAList.first(); a; a = tmpAList.next()) | 339 | for (a = tmpAList.first(); a; a = tmpAList.next()) |
339 | insertAttendee(new Attendee(*a)); | 340 | insertAttendee(new Attendee(*a)); |
340 | 341 | ||
341 | mListView->setSelected( mListView->firstChild(), true ); | 342 | mListView->setSelected( mListView->firstChild(), true ); |
342 | mOrganizerLabel->setText(i18n("Organizer: %1").arg(event->organizer())); | 343 | mOrganizerLabel->setText(i18n("Organizer: %1").arg(event->organizer())); |
343 | } | 344 | } |
344 | 345 | ||
345 | void KOEditorDetails::writeEvent(Incidence *event) | 346 | void KOEditorDetails::writeEvent(Incidence *event) |
346 | { | 347 | { |
347 | event->clearAttendees(); | 348 | event->clearAttendees(); |
348 | QListViewItem *item; | 349 | QListViewItem *item; |
349 | AttendeeListItem *a; | 350 | AttendeeListItem *a; |
350 | for (item = mListView->firstChild(); item; | 351 | for (item = mListView->firstChild(); item; |
351 | item = item->nextSibling()) { | 352 | item = item->nextSibling()) { |
352 | a = (AttendeeListItem *)item; | 353 | a = (AttendeeListItem *)item; |
353 | event->addAttendee(new Attendee(*(a->data()))); | 354 | event->addAttendee(new Attendee(*(a->data()))); |
354 | } | 355 | } |
355 | event->setOrganizer(KOPrefs::instance()->email()); | 356 | event->setOrganizer(KOPrefs::instance()->email()); |
356 | } | 357 | } |
357 | 358 | ||
358 | void KOEditorDetails::cancelAttendeeEvent(Incidence *event) | 359 | void KOEditorDetails::cancelAttendeeEvent(Incidence *event) |
359 | { | 360 | { |
360 | event->clearAttendees(); | 361 | event->clearAttendees(); |
361 | Attendee * att; | 362 | Attendee * att; |
362 | for (att=mdelAttendees.first();att;att=mdelAttendees.next()) { | 363 | for (att=mdelAttendees.first();att;att=mdelAttendees.next()) { |
363 | event->addAttendee(new Attendee(*att)); | 364 | event->addAttendee(new Attendee(*att)); |
364 | } | 365 | } |
365 | mdelAttendees.clear(); | 366 | mdelAttendees.clear(); |
366 | } | 367 | } |
367 | 368 | ||
368 | bool KOEditorDetails::validateInput() | 369 | bool KOEditorDetails::validateInput() |
369 | { | 370 | { |
370 | return true; | 371 | return true; |
371 | } | 372 | } |
372 | 373 | ||
373 | void KOEditorDetails::updateAttendeeInput() | 374 | void KOEditorDetails::updateAttendeeInput() |
374 | { | 375 | { |
375 | QListViewItem *item = mListView->selectedItem(); | 376 | QListViewItem *item = mListView->selectedItem(); |
376 | AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item ); | 377 | AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item ); |
377 | if (aItem) { | 378 | if (aItem) { |
378 | fillAttendeeInput( aItem ); | 379 | fillAttendeeInput( aItem ); |
379 | } else { | 380 | } else { |
380 | clearAttendeeInput(); | 381 | clearAttendeeInput(); |
381 | } | 382 | } |
382 | } | 383 | } |
383 | 384 | ||
384 | void KOEditorDetails::clearAttendeeInput() | 385 | void KOEditorDetails::clearAttendeeInput() |
385 | { | 386 | { |
386 | mNameEdit->setText(""); | 387 | mNameEdit->setText(""); |
387 | mUidEdit->setText(""); | 388 | mUidEdit->setText(""); |
388 | mEmailEdit->setText(""); | 389 | mEmailEdit->setText(""); |
389 | mRoleCombo->setCurrentItem(0); | 390 | mRoleCombo->setCurrentItem(0); |
390 | mStatusCombo->setCurrentItem(0); | 391 | mStatusCombo->setCurrentItem(0); |
391 | mRsvpButton->setChecked(true); | 392 | mRsvpButton->setChecked(true); |
392 | setEnabledAttendeeInput( false ); | 393 | setEnabledAttendeeInput( false ); |
393 | } | 394 | } |
394 | 395 | ||
395 | void KOEditorDetails::fillAttendeeInput( AttendeeListItem *aItem ) | 396 | void KOEditorDetails::fillAttendeeInput( AttendeeListItem *aItem ) |
396 | { | 397 | { |
397 | Attendee *a = aItem->data(); | 398 | Attendee *a = aItem->data(); |
398 | mDisableItemUpdate = true; | 399 | mDisableItemUpdate = true; |
399 | mNameEdit->setText(a->name()); | 400 | mNameEdit->setText(a->name()); |
400 | mUidEdit->setText(a->uid()); | 401 | mUidEdit->setText(a->uid()); |
401 | mEmailEdit->setText(a->email()); | 402 | mEmailEdit->setText(a->email()); |
402 | mRoleCombo->setCurrentItem(a->role()); | 403 | mRoleCombo->setCurrentItem(a->role()); |
403 | mStatusCombo->setCurrentItem(a->status()); | 404 | mStatusCombo->setCurrentItem(a->status()); |
404 | mRsvpButton->setChecked(a->RSVP()); | 405 | mRsvpButton->setChecked(a->RSVP()); |
405 | 406 | ||
406 | mDisableItemUpdate = false; | 407 | mDisableItemUpdate = false; |
407 | 408 | ||
408 | setEnabledAttendeeInput( true ); | 409 | setEnabledAttendeeInput( true ); |
409 | } | 410 | } |
410 | 411 | ||
411 | void KOEditorDetails::setEnabledAttendeeInput( bool enabled ) | 412 | void KOEditorDetails::setEnabledAttendeeInput( bool enabled ) |
412 | { | 413 | { |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 65566b5..46ae6a0 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -1,372 +1,375 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | 2 | ||
3 | #include <qaction.h> | 3 | #include <qaction.h> |
4 | #include <qpopupmenu.h> | 4 | #include <qpopupmenu.h> |
5 | #include <qpainter.h> | 5 | #include <qpainter.h> |
6 | #include <qwhatsthis.h> | 6 | #include <qwhatsthis.h> |
7 | #include <qpushbutton.h> | 7 | #include <qpushbutton.h> |
8 | #include <qmessagebox.h> | 8 | #include <qmessagebox.h> |
9 | #include <qlineedit.h> | 9 | #include <qlineedit.h> |
10 | #include <qtextcodec.h> | 10 | #include <qtextcodec.h> |
11 | #include <qfile.h> | 11 | #include <qfile.h> |
12 | #include <qdir.h> | 12 | #include <qdir.h> |
13 | #include <qapp.h> | 13 | #include <qapp.h> |
14 | #include <qfileinfo.h> | 14 | #include <qfileinfo.h> |
15 | #include <qlabel.h> | 15 | #include <qlabel.h> |
16 | #include <qspinbox.h> | 16 | #include <qspinbox.h> |
17 | #include <qcheckbox.h> | 17 | #include <qcheckbox.h> |
18 | #include <qmap.h> | 18 | #include <qmap.h> |
19 | #include <qwmatrix.h> | 19 | #include <qwmatrix.h> |
20 | #include <qtextbrowser.h> | 20 | #include <qtextbrowser.h> |
21 | #include <qtextstream.h> | 21 | #include <qtextstream.h> |
22 | #ifndef DESKTOP_VERSION | 22 | #ifndef DESKTOP_VERSION |
23 | #include <qpe/global.h> | 23 | #include <qpe/global.h> |
24 | #include <qpe/qpemenubar.h> | 24 | #include <qpe/qpemenubar.h> |
25 | #include <qpe/qpetoolbar.h> | 25 | #include <qpe/qpetoolbar.h> |
26 | #include <qpe/resource.h> | 26 | #include <qpe/resource.h> |
27 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
28 | #include <qtopia/alarmserver.h> | 28 | #include <qtopia/alarmserver.h> |
29 | #include <qtopia/qcopenvelope_qws.h> | 29 | #include <qtopia/qcopenvelope_qws.h> |
30 | #include <unistd.h> // for sleep | 30 | #include <unistd.h> // for sleep |
31 | #else | 31 | #else |
32 | #include <qmenubar.h> | 32 | #include <qmenubar.h> |
33 | #include <qtoolbar.h> | 33 | #include <qtoolbar.h> |
34 | #include <qapplication.h> | 34 | #include <qapplication.h> |
35 | //#include <resource.h> | 35 | //#include <resource.h> |
36 | 36 | ||
37 | #endif | 37 | #endif |
38 | #include <libkcal/calendarlocal.h> | 38 | #include <libkcal/calendarlocal.h> |
39 | #include <libkcal/todo.h> | 39 | #include <libkcal/todo.h> |
40 | #include <libkcal/phoneformat.h> | 40 | #include <libkcal/phoneformat.h> |
41 | #include <libkdepim/ksyncprofile.h> | 41 | #include <libkdepim/ksyncprofile.h> |
42 | #include <libkdepim/phoneaccess.h> | 42 | #include <libkdepim/phoneaccess.h> |
43 | #include <libkcal/kincidenceformatter.h> | 43 | #include <libkcal/kincidenceformatter.h> |
44 | #include <libkdepim/kpimglobalprefs.h> | 44 | #include <libkdepim/kpimglobalprefs.h> |
45 | 45 | ||
46 | #include "calendarview.h" | 46 | #include "calendarview.h" |
47 | #include "koviewmanager.h" | 47 | #include "koviewmanager.h" |
48 | #include "datenavigator.h" | 48 | #include "datenavigator.h" |
49 | #include "koagendaview.h" | 49 | #include "koagendaview.h" |
50 | #include "koagenda.h" | 50 | #include "koagenda.h" |
51 | #include "kodialogmanager.h" | 51 | #include "kodialogmanager.h" |
52 | #include "kdialogbase.h" | 52 | #include "kdialogbase.h" |
53 | #include "kapplication.h" | 53 | #include "kapplication.h" |
54 | #include "kofilterview.h" | 54 | #include "kofilterview.h" |
55 | #include "kstandarddirs.h" | 55 | #include "kstandarddirs.h" |
56 | #include "koprefs.h" | 56 | #include "koprefs.h" |
57 | #include "kfiledialog.h" | 57 | #include "kfiledialog.h" |
58 | #include "koglobals.h" | 58 | #include "koglobals.h" |
59 | #include "kglobal.h" | 59 | #include "kglobal.h" |
60 | #include "klocale.h" | 60 | #include "klocale.h" |
61 | #include "kconfig.h" | 61 | #include "kconfig.h" |
62 | #include "simplealarmclient.h" | 62 | #include "simplealarmclient.h" |
63 | #include "externalapphandler.h" | 63 | #include "externalapphandler.h" |
64 | 64 | ||
65 | using namespace KCal; | 65 | using namespace KCal; |
66 | #ifndef _WIN32_ | 66 | #ifndef _WIN32_ |
67 | #include <unistd.h> | 67 | #include <unistd.h> |
68 | #else | 68 | #else |
69 | #include "koimportoldialog.h" | 69 | #include "koimportoldialog.h" |
70 | #endif | 70 | #endif |
71 | #include "mainwindow.h" | 71 | #include "mainwindow.h" |
72 | 72 | ||
73 | class KOex2phonePrefs : public QDialog | 73 | class KOex2phonePrefs : public QDialog |
74 | { | 74 | { |
75 | public: | 75 | public: |
76 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : | 76 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : |
77 | QDialog( parent, name, true ) | 77 | QDialog( parent, name, true ) |
78 | { | 78 | { |
79 | setCaption( i18n("Export to phone options") ); | 79 | setCaption( i18n("Export to phone options") ); |
80 | QVBoxLayout* lay = new QVBoxLayout( this ); | 80 | QVBoxLayout* lay = new QVBoxLayout( this ); |
81 | lay->setSpacing( 3 ); | 81 | lay->setSpacing( 3 ); |
82 | lay->setMargin( 3 ); | 82 | lay->setMargin( 3 ); |
83 | QLabel *lab; | 83 | QLabel *lab; |
84 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); | 84 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); |
85 | lab->setAlignment (AlignHCenter ); | 85 | lab->setAlignment (AlignHCenter ); |
86 | QHBox* temphb; | 86 | QHBox* temphb; |
87 | temphb = new QHBox( this ); | 87 | temphb = new QHBox( this ); |
88 | new QLabel( i18n("I/O device: "), temphb ); | 88 | new QLabel( i18n("I/O device: "), temphb ); |
89 | mPhoneDevice = new QLineEdit( temphb); | 89 | mPhoneDevice = new QLineEdit( temphb); |
90 | lay->addWidget( temphb ); | 90 | lay->addWidget( temphb ); |
91 | temphb = new QHBox( this ); | 91 | temphb = new QHBox( this ); |
92 | new QLabel( i18n("Connection: "), temphb ); | 92 | new QLabel( i18n("Connection: "), temphb ); |
93 | mPhoneConnection = new QLineEdit( temphb); | 93 | mPhoneConnection = new QLineEdit( temphb); |
94 | lay->addWidget( temphb ); | 94 | lay->addWidget( temphb ); |
95 | temphb = new QHBox( this ); | 95 | temphb = new QHBox( this ); |
96 | new QLabel( i18n("Model(opt.): "), temphb ); | 96 | new QLabel( i18n("Model(opt.): "), temphb ); |
97 | mPhoneModel = new QLineEdit( temphb); | 97 | mPhoneModel = new QLineEdit( temphb); |
98 | lay->addWidget( temphb ); | 98 | lay->addWidget( temphb ); |
99 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); | 99 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); |
100 | mWriteBackFuture->setChecked( true ); | 100 | mWriteBackFuture->setChecked( true ); |
101 | lay->addWidget( mWriteBackFuture ); | 101 | lay->addWidget( mWriteBackFuture ); |
102 | temphb = new QHBox( this ); | 102 | temphb = new QHBox( this ); |
103 | new QLabel( i18n("Max. weeks in future: ") , temphb ); | 103 | new QLabel( i18n("Max. weeks in future: ") , temphb ); |
104 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); | 104 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); |
105 | mWriteBackFutureWeeks->setValue( 8 ); | 105 | mWriteBackFutureWeeks->setValue( 8 ); |
106 | lay->addWidget( temphb ); | 106 | lay->addWidget( temphb ); |
107 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); | 107 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); |
108 | lab->setAlignment (AlignHCenter ); | 108 | lab->setAlignment (AlignHCenter ); |
109 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); | 109 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); |
110 | lay->addWidget( ok ); | 110 | lay->addWidget( ok ); |
111 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 111 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
112 | lay->addWidget( cancel ); | 112 | lay->addWidget( cancel ); |
113 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 113 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
114 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 114 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
115 | resize( 220, 240 ); | 115 | resize( 220, 240 ); |
116 | 116 | qApp->processEvents(); | |
117 | int dw = QApplication::desktop()->width(); | ||
118 | int dh = QApplication::desktop()->height(); | ||
119 | move( (dw-width())/2, (dh - height() )/2 ); | ||
117 | } | 120 | } |
118 | 121 | ||
119 | public: | 122 | public: |
120 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; | 123 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; |
121 | QCheckBox* mWriteBackFuture; | 124 | QCheckBox* mWriteBackFuture; |
122 | QSpinBox* mWriteBackFutureWeeks; | 125 | QSpinBox* mWriteBackFutureWeeks; |
123 | }; | 126 | }; |
124 | 127 | ||
125 | int globalFlagBlockStartup; | 128 | int globalFlagBlockStartup; |
126 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | 129 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : |
127 | QMainWindow( parent, name ) | 130 | QMainWindow( parent, name ) |
128 | { | 131 | { |
129 | 132 | ||
130 | #ifdef DESKTOP_VERSION | 133 | #ifdef DESKTOP_VERSION |
131 | setFont( QFont("Arial"), 14 ); | 134 | setFont( QFont("Arial"), 14 ); |
132 | #endif | 135 | #endif |
133 | mClosed = false; | 136 | mClosed = false; |
134 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; | 137 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; |
135 | QString confFile = locateLocal("config","korganizerrc"); | 138 | QString confFile = locateLocal("config","korganizerrc"); |
136 | QFileInfo finf ( confFile ); | 139 | QFileInfo finf ( confFile ); |
137 | bool showWarning = !finf.exists(); | 140 | bool showWarning = !finf.exists(); |
138 | setIcon(SmallIcon( "ko24" ) ); | 141 | setIcon(SmallIcon( "ko24" ) ); |
139 | mBlockAtStartup = true; | 142 | mBlockAtStartup = true; |
140 | mFlagKeyPressed = false; | 143 | mFlagKeyPressed = false; |
141 | setCaption("KOrganizer/Pi"); | 144 | setCaption("KOrganizer/Pi"); |
142 | KOPrefs *p = KOPrefs::instance(); | 145 | KOPrefs *p = KOPrefs::instance(); |
143 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 146 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
144 | if ( p->mHourSize > 18 ) | 147 | if ( p->mHourSize > 18 ) |
145 | p->mHourSize = 18; | 148 | p->mHourSize = 18; |
146 | QMainWindow::ToolBarDock tbd; | 149 | QMainWindow::ToolBarDock tbd; |
147 | if ( p->mToolBarHor ) { | 150 | if ( p->mToolBarHor ) { |
148 | if ( p->mToolBarUp ) | 151 | if ( p->mToolBarUp ) |
149 | tbd = Bottom; | 152 | tbd = Bottom; |
150 | else | 153 | else |
151 | tbd = Top; | 154 | tbd = Top; |
152 | } | 155 | } |
153 | else { | 156 | else { |
154 | if ( p->mToolBarUp ) | 157 | if ( p->mToolBarUp ) |
155 | tbd = Right; | 158 | tbd = Right; |
156 | else | 159 | else |
157 | tbd = Left; | 160 | tbd = Left; |
158 | } | 161 | } |
159 | if ( KOPrefs::instance()->mUseAppColors ) | 162 | if ( KOPrefs::instance()->mUseAppColors ) |
160 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 163 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
161 | globalFlagBlockStartup = 1; | 164 | globalFlagBlockStartup = 1; |
162 | iconToolBar = new QPEToolBar( this ); | 165 | iconToolBar = new QPEToolBar( this ); |
163 | addToolBar (iconToolBar , tbd ); | 166 | addToolBar (iconToolBar , tbd ); |
164 | mCalendarModifiedFlag = false; | 167 | mCalendarModifiedFlag = false; |
165 | 168 | ||
166 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); | 169 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); |
167 | splash->setAlignment ( AlignCenter ); | 170 | splash->setAlignment ( AlignCenter ); |
168 | setCentralWidget( splash ); | 171 | setCentralWidget( splash ); |
169 | #ifndef DESKTOP_VERSION | 172 | #ifndef DESKTOP_VERSION |
170 | showMaximized(); | 173 | showMaximized(); |
171 | #endif | 174 | #endif |
172 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); | 175 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); |
173 | setDefaultPreferences(); | 176 | setDefaultPreferences(); |
174 | mCalendar = new CalendarLocal(); | 177 | mCalendar = new CalendarLocal(); |
175 | mView = new CalendarView( mCalendar, this,"mCalendar " ); | 178 | mView = new CalendarView( mCalendar, this,"mCalendar " ); |
176 | mView->hide(); | 179 | mView->hide(); |
177 | //mView->resize(splash->size() ); | 180 | //mView->resize(splash->size() ); |
178 | initActions(); | 181 | initActions(); |
179 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); | 182 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); |
180 | mSyncManager->setBlockSave(false); | 183 | mSyncManager->setBlockSave(false); |
181 | mView->setSyncManager(mSyncManager); | 184 | mView->setSyncManager(mSyncManager); |
182 | #ifndef DESKTOP_VERSION | 185 | #ifndef DESKTOP_VERSION |
183 | iconToolBar->show(); | 186 | iconToolBar->show(); |
184 | qApp->processEvents(); | 187 | qApp->processEvents(); |
185 | #endif | 188 | #endif |
186 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); | 189 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); |
187 | int vh = height() ; | 190 | int vh = height() ; |
188 | int vw = width(); | 191 | int vw = width(); |
189 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); | 192 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); |
190 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { | 193 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { |
191 | vh -= iconToolBar->height(); | 194 | vh -= iconToolBar->height(); |
192 | } else { | 195 | } else { |
193 | vw -= iconToolBar->height(); | 196 | vw -= iconToolBar->height(); |
194 | } | 197 | } |
195 | //mView->setMaximumSize( splash->size() ); | 198 | //mView->setMaximumSize( splash->size() ); |
196 | //mView->resize( splash->size() ); | 199 | //mView->resize( splash->size() ); |
197 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 200 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
198 | mView->readSettings(); | 201 | mView->readSettings(); |
199 | bool newFile = false; | 202 | bool newFile = false; |
200 | if( !QFile::exists( defaultFileName() ) ) { | 203 | if( !QFile::exists( defaultFileName() ) ) { |
201 | QFileInfo finfo ( defaultFileName() ); | 204 | QFileInfo finfo ( defaultFileName() ); |
202 | QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); | 205 | QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); |
203 | qDebug("oldfile %s ", oldFile.latin1()); | 206 | qDebug("oldfile %s ", oldFile.latin1()); |
204 | QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; | 207 | QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; |
205 | finfo.setFile( oldFile ); | 208 | finfo.setFile( oldFile ); |
206 | if (finfo.exists() ) { | 209 | if (finfo.exists() ) { |
207 | KMessageBox::information( this, message); | 210 | KMessageBox::information( this, message); |
208 | mView->openCalendar( oldFile ); | 211 | mView->openCalendar( oldFile ); |
209 | qApp->processEvents(); | 212 | qApp->processEvents(); |
210 | } else { | 213 | } else { |
211 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); | 214 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); |
212 | finfo.setFile( oldFile ); | 215 | finfo.setFile( oldFile ); |
213 | if (finfo.exists() ) { | 216 | if (finfo.exists() ) { |
214 | KMessageBox::information( this, message); | 217 | KMessageBox::information( this, message); |
215 | mView->openCalendar( oldFile ); | 218 | mView->openCalendar( oldFile ); |
216 | qApp->processEvents(); | 219 | qApp->processEvents(); |
217 | } | 220 | } |
218 | } | 221 | } |
219 | mView->saveCalendar( defaultFileName() ); | 222 | mView->saveCalendar( defaultFileName() ); |
220 | newFile = true; | 223 | newFile = true; |
221 | } | 224 | } |
222 | 225 | ||
223 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 226 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
224 | mView->openCalendar( defaultFileName() ); | 227 | mView->openCalendar( defaultFileName() ); |
225 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 228 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
226 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); | 229 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); |
227 | 230 | ||
228 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { | 231 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { |
229 | KOPrefs::instance()->setCategoryDefaults(); | 232 | KOPrefs::instance()->setCategoryDefaults(); |
230 | int count = mView->addCategories(); | 233 | int count = mView->addCategories(); |
231 | } | 234 | } |
232 | processIncidenceSelection( 0 ); | 235 | processIncidenceSelection( 0 ); |
233 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), | 236 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), |
234 | SLOT( processIncidenceSelection( Incidence * ) ) ); | 237 | SLOT( processIncidenceSelection( Incidence * ) ) ); |
235 | connect( mView, SIGNAL( modifiedChanged( bool ) ), | 238 | connect( mView, SIGNAL( modifiedChanged( bool ) ), |
236 | SLOT( slotModifiedChanged( bool ) ) ); | 239 | SLOT( slotModifiedChanged( bool ) ) ); |
237 | 240 | ||
238 | 241 | ||
239 | connect( mView, SIGNAL( tempDisableBR(bool) ), | 242 | connect( mView, SIGNAL( tempDisableBR(bool) ), |
240 | SLOT( disableBR(bool) ) ); | 243 | SLOT( disableBR(bool) ) ); |
241 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); | 244 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); |
242 | mView->setModified( false ); | 245 | mView->setModified( false ); |
243 | mBlockAtStartup = false; | 246 | mBlockAtStartup = false; |
244 | mView->setModified( false ); | 247 | mView->setModified( false ); |
245 | setCentralWidget( mView ); | 248 | setCentralWidget( mView ); |
246 | globalFlagBlockStartup = 0; | 249 | globalFlagBlockStartup = 0; |
247 | mView->show(); | 250 | mView->show(); |
248 | delete splash; | 251 | delete splash; |
249 | if ( newFile ) | 252 | if ( newFile ) |
250 | mView->updateConfig(); | 253 | mView->updateConfig(); |
251 | // qApp->processEvents(); | 254 | // qApp->processEvents(); |
252 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 255 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
253 | //fillSyncMenu(); | 256 | //fillSyncMenu(); |
254 | 257 | ||
255 | 258 | ||
256 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); | 259 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); |
257 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); | 260 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); |
258 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); | 261 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); |
259 | mSyncManager->setDefaultFileName( defaultFileName()); | 262 | mSyncManager->setDefaultFileName( defaultFileName()); |
260 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); | 263 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); |
261 | mSyncManager->fillSyncMenu(); | 264 | mSyncManager->fillSyncMenu(); |
262 | 265 | ||
263 | 266 | ||
264 | 267 | ||
265 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); | 268 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); |
266 | if ( showWarning ) { | 269 | if ( showWarning ) { |
267 | KMessageBox::information( this, | 270 | KMessageBox::information( this, |
268 | "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); | 271 | "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); |
269 | qApp->processEvents(); | 272 | qApp->processEvents(); |
270 | mView->dialogManager()->showSyncOptions(); | 273 | mView->dialogManager()->showSyncOptions(); |
271 | } | 274 | } |
272 | 275 | ||
273 | //US listen for result adressed from Ka/Pi | 276 | //US listen for result adressed from Ka/Pi |
274 | #ifndef DESKTOP_VERSION | 277 | #ifndef DESKTOP_VERSION |
275 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 278 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
276 | #endif | 279 | #endif |
277 | #ifndef DESKTOP_VERSION | 280 | #ifndef DESKTOP_VERSION |
278 | infrared = 0; | 281 | infrared = 0; |
279 | #endif | 282 | #endif |
280 | 283 | ||
281 | mBRdisabled = false; | 284 | mBRdisabled = false; |
282 | //toggleBeamReceive(); | 285 | //toggleBeamReceive(); |
283 | } | 286 | } |
284 | MainWindow::~MainWindow() | 287 | MainWindow::~MainWindow() |
285 | { | 288 | { |
286 | //qDebug("MainWindow::~MainWindow() "); | 289 | //qDebug("MainWindow::~MainWindow() "); |
287 | //save toolbar location | 290 | //save toolbar location |
288 | delete mCalendar; | 291 | delete mCalendar; |
289 | delete mSyncManager; | 292 | delete mSyncManager; |
290 | #ifndef DESKTOP_VERSION | 293 | #ifndef DESKTOP_VERSION |
291 | if ( infrared ) | 294 | if ( infrared ) |
292 | delete infrared; | 295 | delete infrared; |
293 | #endif | 296 | #endif |
294 | 297 | ||
295 | 298 | ||
296 | } | 299 | } |
297 | 300 | ||
298 | void MainWindow::disableBR(bool b) | 301 | void MainWindow::disableBR(bool b) |
299 | { | 302 | { |
300 | #ifndef DESKTOP_VERSION | 303 | #ifndef DESKTOP_VERSION |
301 | if ( b ) { | 304 | if ( b ) { |
302 | if ( infrared ) { | 305 | if ( infrared ) { |
303 | toggleBeamReceive(); | 306 | toggleBeamReceive(); |
304 | mBRdisabled = true; | 307 | mBRdisabled = true; |
305 | } | 308 | } |
306 | mBRdisabled = true; | 309 | mBRdisabled = true; |
307 | } else { | 310 | } else { |
308 | if ( mBRdisabled ) { | 311 | if ( mBRdisabled ) { |
309 | mBRdisabled = false; | 312 | mBRdisabled = false; |
310 | //makes no sense,because other cal ap is probably running | 313 | //makes no sense,because other cal ap is probably running |
311 | // toggleBeamReceive(); | 314 | // toggleBeamReceive(); |
312 | } | 315 | } |
313 | } | 316 | } |
314 | #endif | 317 | #endif |
315 | 318 | ||
316 | } | 319 | } |
317 | bool MainWindow::beamReceiveEnabled() | 320 | bool MainWindow::beamReceiveEnabled() |
318 | { | 321 | { |
319 | #ifndef DESKTOP_VERSION | 322 | #ifndef DESKTOP_VERSION |
320 | return ( infrared != 0 ); | 323 | return ( infrared != 0 ); |
321 | #endif | 324 | #endif |
322 | return false; | 325 | return false; |
323 | } | 326 | } |
324 | 327 | ||
325 | void MainWindow::toggleBeamReceive() | 328 | void MainWindow::toggleBeamReceive() |
326 | { | 329 | { |
327 | if ( mBRdisabled ) | 330 | if ( mBRdisabled ) |
328 | return; | 331 | return; |
329 | #ifndef DESKTOP_VERSION | 332 | #ifndef DESKTOP_VERSION |
330 | if ( infrared ) { | 333 | if ( infrared ) { |
331 | qDebug("disable BeamReceive "); | 334 | qDebug("disable BeamReceive "); |
332 | delete infrared; | 335 | delete infrared; |
333 | infrared = 0; | 336 | infrared = 0; |
334 | brAction->setOn(false); | 337 | brAction->setOn(false); |
335 | return; | 338 | return; |
336 | } | 339 | } |
337 | qDebug("enable BeamReceive "); | 340 | qDebug("enable BeamReceive "); |
338 | brAction->setOn(true); | 341 | brAction->setOn(true); |
339 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; | 342 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; |
340 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); | 343 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); |
341 | #endif | 344 | #endif |
342 | } | 345 | } |
343 | void MainWindow::showMaximized () | 346 | void MainWindow::showMaximized () |
344 | { | 347 | { |
345 | #ifndef DESKTOP_VERSION | 348 | #ifndef DESKTOP_VERSION |
346 | if ( ! globalFlagBlockStartup ) | 349 | if ( ! globalFlagBlockStartup ) |
347 | if ( mClosed ) | 350 | if ( mClosed ) |
348 | mView->goToday(); | 351 | mView->goToday(); |
349 | #endif | 352 | #endif |
350 | QWidget::showMaximized () ; | 353 | QWidget::showMaximized () ; |
351 | mClosed = false; | 354 | mClosed = false; |
352 | } | 355 | } |
353 | void MainWindow::closeEvent( QCloseEvent* ce ) | 356 | void MainWindow::closeEvent( QCloseEvent* ce ) |
354 | { | 357 | { |
355 | 358 | ||
356 | 359 | ||
357 | 360 | ||
358 | if ( ! KOPrefs::instance()->mAskForQuit ) { | 361 | if ( ! KOPrefs::instance()->mAskForQuit ) { |
359 | saveOnClose(); | 362 | saveOnClose(); |
360 | mClosed = true; | 363 | mClosed = true; |
361 | ce->accept(); | 364 | ce->accept(); |
362 | return; | 365 | return; |
363 | 366 | ||
364 | } | 367 | } |
365 | 368 | ||
366 | switch( QMessageBox::information( this, "KO/Pi", | 369 | switch( QMessageBox::information( this, "KO/Pi", |
367 | i18n("Do you really want\nto close KO/Pi?"), | 370 | i18n("Do you really want\nto close KO/Pi?"), |
368 | i18n("Close"), i18n("No"), | 371 | i18n("Close"), i18n("No"), |
369 | 0, 0 ) ) { | 372 | 0, 0 ) ) { |
370 | case 0: | 373 | case 0: |
371 | saveOnClose(); | 374 | saveOnClose(); |
372 | mClosed = true; | 375 | mClosed = true; |