summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt2
-rw-r--r--kaddressbook/kaimportoldialog.cpp7
-rw-r--r--korganizer/koimportoldialog.cpp8
3 files changed, 10 insertions, 7 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index 792cb91..5e2180f 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -782,97 +782,97 @@
782{ "KO/Pi:Loaded %1","KO/Pi:Geladen %1" }, 782{ "KO/Pi:Loaded %1","KO/Pi:Geladen %1" },
783{ "Save backup filename","Speichere Backup Dateiname" }, 783{ "Save backup filename","Speichere Backup Dateiname" },
784{ "Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n","Backup Datei\nexistiert bereits!\nAlte Backup Datei vom:\n%1\nÜberschreiben?\n" }, 784{ "Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n","Backup Datei\nexistiert bereits!\nAlte Backup Datei vom:\n%1\nÜberschreiben?\n" },
785{ "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" }, 785{ "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" },
786{ "Details of attendee","Teilnehmerdetails" }, 786{ "Details of attendee","Teilnehmerdetails" },
787{ "Work phone:\n","Telefon Arbeit:\n" }, 787{ "Work phone:\n","Telefon Arbeit:\n" },
788{ "Work mobile phone:\n","Mobiltelefon Arbeit:\n" }, 788{ "Work mobile phone:\n","Mobiltelefon Arbeit:\n" },
789{ "Home phone:\n","Telefon privat:\n" }, 789{ "Home phone:\n","Telefon privat:\n" },
790{ "Mobile home phone:\n","Mobiltelefon privat:\n" }, 790{ "Mobile home phone:\n","Mobiltelefon privat:\n" },
791{ "Email:\n","Email:\n" }, 791{ "Email:\n","Email:\n" },
792{ "Alarm disabled for this item","Alarm deaktiviert für dieses Item" }, 792{ "Alarm disabled for this item","Alarm deaktiviert für dieses Item" },
793{ "Audio Al.: ","Audio Al.: " }, 793{ "Audio Al.: ","Audio Al.: " },
794{ "Proc.Al.: ","Proz.Al.: " }, 794{ "Proc.Al.: ","Proz.Al.: " },
795{ "No sound set","Kein Sound definiert" }, 795{ "No sound set","Kein Sound definiert" },
796{ "*.wav|Wav Files","*.wav|Wav Dateien" }, 796{ "*.wav|Wav Files","*.wav|Wav Dateien" },
797{ "No program set","Kein Programm definiert" }, 797{ "No program set","Kein Programm definiert" },
798{ "Running '%1'","Ausführen '%1'" }, 798{ "Running '%1'","Ausführen '%1'" },
799{ "Playing '%1'","Abspielen '%1'" }, 799{ "Playing '%1'","Abspielen '%1'" },
800{ "User defined (usertranslation.txt)","Benutzerdefiniert (usertranslation.txt)" }, 800{ "User defined (usertranslation.txt)","Benutzerdefiniert (usertranslation.txt)" },
801{ "Load!","Laden!" }, 801{ "Load!","Laden!" },
802{ "Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n","Backup Datei vom:\n%1\nDas Laden der Backup Datei\nlöscht die aktuellen Daten!\n" }, 802{ "Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n","Backup Datei vom:\n%1\nDas Laden der Backup Datei\nlöscht die aktuellen Daten!\n" },
803{ "KO/Pi Features and hints","KO/Pi Eigenschaften und Tipps" }, 803{ "KO/Pi Features and hints","KO/Pi Eigenschaften und Tipps" },
804{ "KO/Pi User translation HowTo","KO/Pi Benutzer-Übersetzung HowTo" }, 804{ "KO/Pi User translation HowTo","KO/Pi Benutzer-Übersetzung HowTo" },
805{ "KO/Pi Synchronization HowTo","KO/Pi Synchronisation HowTo" }, 805{ "KO/Pi Synchronization HowTo","KO/Pi Synchronisation HowTo" },
806{ "Features + hints...","Eigenschaften + Tipps..." }, 806{ "Features + hints...","Eigenschaften + Tipps..." },
807{ "User translation...","Benutzer Übersetzung..." }, 807{ "User translation...","Benutzer Übersetzung..." },
808{ "Sync HowTo...","Synchronisation HowTo..." }, 808{ "Sync HowTo...","Synchronisation HowTo..." },
809{ "Print calendar...","Drucke Kalender..." }, 809{ "Print calendar...","Drucke Kalender..." },
810{ "Anniversary","Jahrestag" }, 810{ "Anniversary","Jahrestag" },
811{ "When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n","Wenn Geburtstage mehrfach importiert\nwerden, werden doppelte Einträge ignoriert\nwenn sie nicht verändert wurden.\n" }, 811{ "When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n","Wenn Geburtstage mehrfach importiert\nwerden, werden doppelte Einträge ignoriert\nwenn sie nicht verändert wurden.\n" },
812{ "Import Birthdays (KA/Pi)","Importiere Geburtstage (KA/Pi)" }, 812{ "Import Birthdays (KA/Pi)","Importiere Geburtstage (KA/Pi)" },
813{ "Next recurrence is on: ","Nächste Wiederholung ist am:" }, 813{ "Next recurrence is on: ","Nächste Wiederholung ist am:" },
814{ "<b>Alarm on: </b>","<b>Alarm am: </b>" }, 814{ "<b>Alarm on: </b>","<b>Alarm am: </b>" },
815{ "<b>Access: </b>","<b>Zugriff: </b>" }, 815{ "<b>Access: </b>","<b>Zugriff: </b>" },
816{ "(%1 min before)","(%1 min vorher)" }, 816{ "(%1 min before)","(%1 min vorher)" },
817{ "<b>Categories: </b>","<b>Kategorien: </b>" }, 817{ "<b>Categories: </b>","<b>Kategorien: </b>" },
818{ "Save Journal/Description...","Speichere Journal/Details..." }, 818{ "Save Journal/Description...","Speichere Journal/Details..." },
819{ "This saves the text/details of selected\nJournals and Events/Todos\nto a text file.","Das speichert den Text bzw.\ndie Details von selektierten\nJournalen und Events/Todos\nin eine Textdatei." }, 819{ "This saves the text/details of selected\nJournals and Events/Todos\nto a text file.","Das speichert den Text bzw.\ndie Details von selektierten\nJournalen und Events/Todos\nin eine Textdatei." },
820{ "Continue","Weitermachen" }, 820{ "Continue","Weitermachen" },
821{ " birthdays/anniversaries added!"," Geburts-/Jahrestage hinzugefügt" }, 821{ " birthdays/anniversaries added!"," Geburts-/Jahrestage hinzugefügt" },
822{ "Attendee:","Teilnehmer:" }, 822{ "Attendee:","Teilnehmer:" },
823{ "Click OK to search ->","Klicke zum Suchen auf OK ->" }, 823{ "Click OK to search ->","Klicke zum Suchen auf OK ->" },
824{ "On day ","Am Tag " }, 824{ "On day ","Am Tag " },
825{ "%1 of ","%1 des Monats" }, 825{ "%1 of ","%1 des Monats" },
826{ "%1 of the year","%1 des Jahres" }, 826{ "%1 of the year","%1 des Jahres" },
827{ "Anonymous","Anonymo" }, 827{ "Anonymous","Anonymo" },
828{ "nobody@nowhere","niemand@nirgendwo" }, 828{ "nobody@nowhere","niemand@nirgendwo" },
829{ "calendar.html","calendar.html" }, 829{ "calendar.html","calendar.html" },
830{ " Local Time"," Locale Zeit" }, 830{ " Local Time"," Lokale Zeit" },
831{ "Unknown Name","Unbekannter Name" }, 831{ "Unknown Name","Unbekannter Name" },
832{ "unknown@nowhere","unbekannt@nirgendwo" }, 832{ "unknown@nowhere","unbekannt@nirgendwo" },
833{ "Beam via IR!","Beam via IR!" }, 833{ "Beam via IR!","Beam via IR!" },
834{ "Next Month","Nächster Monat" }, 834{ "Next Month","Nächster Monat" },
835{ "Prio","Prio" }, 835{ "Prio","Prio" },
836{ "Reparent Todo","Mache Sub-Todo" }, 836{ "Reparent Todo","Mache Sub-Todo" },
837{ "tomorrow","morgen" }, 837{ "tomorrow","morgen" },
838{ "today","heute" }, 838{ "today","heute" },
839{ "yesterday","gestern" }, 839{ "yesterday","gestern" },
840{ "Ok","Ok" }, 840{ "Ok","Ok" },
841{ "Ok+Agenda","Ok+Agenda" }, 841{ "Ok+Agenda","Ok+Agenda" },
842{ "Email","Email" }, 842{ "Email","Email" },
843{ "RSVP","RSVP" }, 843{ "RSVP","RSVP" },
844{ "Email:","Email:" }, 844{ "Email:","Email:" },
845{ "Appointment Time ","Termin Zeit " }, 845{ "Appointment Time ","Termin Zeit " },
846{ "2","2" }, 846{ "2","2" },
847{ "3","3" }, 847{ "3","3" },
848{ "4","4" }, 848{ "4","4" },
849{ " 0 %"," 0 %" }, 849{ " 0 %"," 0 %" },
850{ " 20 %"," 20 %" }, 850{ " 20 %"," 20 %" },
851{ " 40 %"," 40 %" }, 851{ " 40 %"," 40 %" },
852{ " 60 %"," 60 %" }, 852{ " 60 %"," 60 %" },
853{ " 80 %"," 80 %" }, 853{ " 80 %"," 80 %" },
854{ "100 %","100 %" }, 854{ "100 %","100 %" },
855{ "Filter","Filter" }, 855{ "Filter","Filter" },
856{ "Configure","Konfiguriere" }, 856{ "Configure","Konfiguriere" },
857{ "What's Next","What's Next" }, 857{ "What's Next","What's Next" },
858{ "Complete calendar...","Kompletten Kalender..." }, 858{ "Complete calendar...","Kompletten Kalender..." },
859{ "Filtered calendar...","Gefilterten Kalender..." }, 859{ "Filtered calendar...","Gefilterten Kalender..." },
860{ "Export to phone","Exportiere zum Handy" }, 860{ "Export to phone","Exportiere zum Handy" },
861{ "Beam receive enabled","Beam Empfang an" }, 861{ "Beam receive enabled","Beam Empfang an" },
862{ "What's new?","Was ist neu?" }, 862{ "What's new?","Was ist neu?" },
863{ "FAQ...","FAQ..." }, 863{ "FAQ...","FAQ..." },
864{ "Licence...","Licence..." }, 864{ "Licence...","Licence..." },
865{ "What's This?","What's This?" }, 865{ "What's This?","What's This?" },
866{ "&Edit...","&Editiere..." }, 866{ "&Edit...","&Editiere..." },
867{ "Oktober","Oktober" }, 867{ "Oktober","Oktober" },
868{ "Title","Titel" }, 868{ "Title","Titel" },
869{ "%1 %","%1 %" }, 869{ "%1 %","%1 %" },
870{ "Enable Pi-Sync","Schalte Pi-Sync an" }, 870{ "Enable Pi-Sync","Schalte Pi-Sync an" },
871{ "Import!","Importiere!" }, 871{ "Import!","Importiere!" },
872{ "inserting birthdays - close to abort!","Burzeltage werden eingefügt - schließe um abzubrechen!" }, 872{ "inserting birthdays - close to abort!","Burzeltage werden eingefügt - schließe um abzubrechen!" },
873{ "Export to phone options","Export ans Handy Optionen" }, 873{ "Export to phone options","Export ans Handy Optionen" },
874{ "Please read Help-Sync Howto\nto know what settings to use.","Bitte lese Hilfe-Sync Howto\num zu erfahren welche Einstellungen\ndie richtigen sind." }, 874{ "Please read Help-Sync Howto\nto know what settings to use.","Bitte lese Hilfe-Sync Howto\num zu erfahren welche Einstellungen\ndie richtigen sind." },
875{ "I/O device: ","I/O device: " }, 875{ "I/O device: ","I/O device: " },
876{ "Connection: ","Connection: " }, 876{ "Connection: ","Connection: " },
877{ "Model(opt.): ","Model(opt.): " }, 877{ "Model(opt.): ","Model(opt.): " },
878{ "Write back events in future only","Schreibe nur zukünftige Termine zurück" }, 878{ "Write back events in future only","Schreibe nur zukünftige Termine zurück" },
diff --git a/kaddressbook/kaimportoldialog.cpp b/kaddressbook/kaimportoldialog.cpp
index 7bb8bd8..2f794d6 100644
--- a/kaddressbook/kaimportoldialog.cpp
+++ b/kaddressbook/kaimportoldialog.cpp
@@ -1,76 +1,77 @@
1/* 1/*
2 This file is part of KAddressbook/Pi. 2 This file is part of KAddressbook/Pi.
3 Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org> 3 Copyright (c) 2004 Lutz Rogowski <rogowski@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 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 <qtooltip.h> 24#include <qtooltip.h>
25#include <qframe.h> 25#include <qframe.h>
26#include <qpixmap.h> 26#include <qpixmap.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qprogressbar.h> 28#include <qprogressbar.h>
29#include <qprogressdialog.h>
29#include <qwidgetstack.h> 30#include <qwidgetstack.h>
30#include <qdatetime.h> 31#include <qdatetime.h>
31#include <qdir.h> 32#include <qdir.h>
32#include <qregexp.h> 33#include <qregexp.h>
33#include <qapplication.h> 34#include <qapplication.h>
34#include <qhbox.h> 35#include <qhbox.h>
35#include <qheader.h> 36#include <qheader.h>
36#include <qdatetime.h> 37#include <qdatetime.h>
37#include <qlistview.h> 38#include <qlistview.h>
38 39
39#include <kdebug.h> 40#include <kdebug.h>
40#include <klocale.h> 41#include <klocale.h>
41#include <kstandarddirs.h> 42#include <kstandarddirs.h>
42#include <kmessagebox.h> 43#include <kmessagebox.h>
43#include <kfiledialog.h> 44#include <kfiledialog.h>
44 45
45#include <libkdepim/categoryselectdialog.h> 46#include <libkdepim/categoryselectdialog.h>
46#include <libkdepim/kinputdialog.h> 47#include <libkdepim/kinputdialog.h>
47 48
48#include <libkcal/calendarlocal.h> 49#include <libkcal/calendarlocal.h>
49#include <libkcal/icalformat.h> 50#include <libkcal/icalformat.h>
50 51
51#include <kabc/addresseelist.h> 52#include <kabc/addresseelist.h>
52#include <kabc/phonenumber.h> 53#include <kabc/phonenumber.h>
53 54
54#include "kaimportoldialog.h" 55#include "kaimportoldialog.h"
55 56
56#include "../outport/msoutl9.h" 57#include "../outport/msoutl9.h"
57#include <ole2.h> 58#include <ole2.h>
58#include <comutil.h> 59#include <comutil.h>
59_Application gOlAppAB; 60_Application gOlAppAB;
60 61
61QDateTime mDdate2Qdtr( DATE dt) 62QDateTime mDdate2Qdtr( DATE dt)
62{ 63{
63 COleDateTime odt; 64 COleDateTime odt;
64 SYSTEMTIME st; 65 SYSTEMTIME st;
65 odt = dt; 66 odt = dt;
66 if ( odt.GetStatus() != 0 ) 67 if ( odt.GetStatus() != 0 )
67 return QDateTime(); 68 return QDateTime();
68 odt.GetAsSystemTime(st); 69 odt.GetAsSystemTime(st);
69 if ( st.wYear > 4000 ) // this program as a year 4000 bug! 70 if ( st.wYear > 4000 ) // this program as a year 4000 bug!
70 return QDateTime(); 71 return QDateTime();
71 // it seems so, that 1.1.4501 indicates: DATE invalid 72 // it seems so, that 1.1.4501 indicates: DATE invalid
72 QDateTime qdt (QDate(st.wYear, st.wMonth,st.wDay ),QTime( st.wHour, st.wMinute,st.wSecond ) ); 73 QDateTime qdt (QDate(st.wYear, st.wMonth,st.wDay ),QTime( st.wHour, st.wMinute,st.wSecond ) );
73 return qdt; 74 return qdt;
74} 75}
75 76
76class OLEListViewItem : public QCheckListItem 77class OLEListViewItem : public QCheckListItem
@@ -173,103 +174,103 @@ void KAImportOLdialog::addFolder(OLEListViewItem* iParent, LPDISPATCH dispParent
173 ts = i18n("Calendar"); 174 ts = i18n("Calendar");
174 break; 175 break;
175 case 2: 176 case 2:
176 ts = i18n("Contacts"); 177 ts = i18n("Contacts");
177 break; 178 break;
178 case 3: 179 case 3:
179 ts = i18n("Todos"); 180 ts = i18n("Todos");
180 break; 181 break;
181 case 4: 182 case 4:
182 ts = i18n("Journals"); 183 ts = i18n("Journals");
183 break; 184 break;
184 case 5: 185 case 5:
185 ts = i18n("Notes"); 186 ts = i18n("Notes");
186 break; 187 break;
187 default: 188 default:
188 ts = i18n("Unknown"); 189 ts = i18n("Unknown");
189 } 190 }
190 hChild->setText( 1,ts); 191 hChild->setText( 1,ts);
191 hChild->setData( (DWORD) mfChild.m_lpDispatch ); 192 hChild->setData( (DWORD) mfChild.m_lpDispatch );
192 mfChild.m_lpDispatch->AddRef(); 193 mfChild.m_lpDispatch->AddRef();
193 addFolder(hChild, mfChild.m_lpDispatch); 194 addFolder(hChild, mfChild.m_lpDispatch);
194 } 195 }
195} 196}
196 197
197void KAImportOLdialog::slotApply() 198void KAImportOLdialog::slotApply()
198{ 199{
199 importedItems = 0; 200 importedItems = 0;
200 OLEListViewItem* child = (OLEListViewItem*) mListView->firstChild(); 201 OLEListViewItem* child = (OLEListViewItem*) mListView->firstChild();
201 while ( child ) { 202 while ( child ) {
202 if ( child->isOn() ) 203 if ( child->isOn() )
203 readContactData( child->data() ); 204 readContactData( child->data() );
204 child = (OLEListViewItem*) child->itemBelow(); 205 child = (OLEListViewItem*) child->itemBelow();
205 } 206 }
206 QString mes = i18n("Importing complete.\n\n%1 items imported.").arg( importedItems); 207 QString mes = i18n("Importing complete.\n\n%1 items imported.").arg( importedItems);
207 KMessageBox::information(this,mes); 208 KMessageBox::information(this,mes);
208} 209}
209void KAImportOLdialog::readContactData( DWORD folder ) 210void KAImportOLdialog::readContactData( DWORD folder )
210{ 211{
211 212
212 LPDISPATCH dispItem = (LPDISPATCH)folder; 213 LPDISPATCH dispItem = (LPDISPATCH)folder;
213 dispItem->AddRef(); 214 dispItem->AddRef();
214 MAPIFolder mf(dispItem); 215 MAPIFolder mf(dispItem);
215 mf.m_lpDispatch->AddRef(); 216 mf.m_lpDispatch->AddRef();
216 _Items folderItems; 217 _Items folderItems;
217 _variant_t indx((long)0); 218 _variant_t indx((long)0);
218 LPDISPATCH itm; 219 LPDISPATCH itm;
219 int i; 220 int i;
220 folderItems = mf.GetItems(); 221 folderItems = mf.GetItems();
221 QProgressBar bar( folderItems.GetCount(),0 ); 222 QProgressDialog bar( i18n("Importing contact data"),i18n("Abort"), folderItems.GetCount(),this);
222 bar.setCaption (i18n("Importing - close to abort!") ); 223 bar.setCaption (i18n("Importing!") );
223 int h = bar.sizeHint().height() ; 224 int h = bar.sizeHint().height() ;
224 int w = 300; 225 int w = 300;
225 int dw = QApplication::desktop()->width(); 226 int dw = QApplication::desktop()->width();
226 int dh = QApplication::desktop()->height(); 227 int dh = QApplication::desktop()->height();
227 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 228 //bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
228 bar.show(); 229 bar.show();
229 for(i=1; i <= folderItems.GetCount(); ++i) 230 for(i=1; i <= folderItems.GetCount(); ++i)
230 { 231 {
231 qApp->processEvents(); 232 qApp->processEvents();
232 if ( ! bar.isVisible() ) 233 if ( ! bar.isVisible() )
233 return ; 234 return ;
234 bar.setProgress( i ); 235 bar.setProgress( i );
235 indx = (long)i; 236 indx = (long)i;
236 itm = folderItems.Item(indx.Detach()); 237 itm = folderItems.Item(indx.Detach());
237 _ContactItem * pItem = (_ContactItem *)&itm; 238 _ContactItem * pItem = (_ContactItem *)&itm;
238 ol2kapiContact( pItem ); 239 ol2kapiContact( pItem );
239 itm->Release(); 240 itm->Release();
240 } 241 }
241} 242}
242void KAImportOLdialog::slotOk() 243void KAImportOLdialog::slotOk()
243{ 244{
244 QDialog::accept(); 245 QDialog::accept();
245} 246}
246 247
247void KAImportOLdialog::ol2kapiContact( _ContactItem * aItem ) 248void KAImportOLdialog::ol2kapiContact( _ContactItem * aItem )
248{ 249{
249 KABC::Addressee addressee; 250 KABC::Addressee addressee;
250 251
251 addressee.setUid( QString::fromUcs2(aItem->GetEntryID().GetBuffer())); 252 addressee.setUid( QString::fromUcs2(aItem->GetEntryID().GetBuffer()));
252 //GetLastModificationTime() 253 //GetLastModificationTime()
253 //addressee.setName( const QString &name ); 254 //addressee.setName( const QString &name );
254 //addressee.setFormattedName( const QString &formattedName ); 255 //addressee.setFormattedName( const QString &formattedName );
255 addressee.setFamilyName( QString::fromUcs2(aItem->GetLastName().GetBuffer()) ); 256 addressee.setFamilyName( QString::fromUcs2(aItem->GetLastName().GetBuffer()) );
256 addressee.setGivenName( QString::fromUcs2(aItem->GetFirstName().GetBuffer()) ); 257 addressee.setGivenName( QString::fromUcs2(aItem->GetFirstName().GetBuffer()) );
257 addressee.setAdditionalName( QString::fromUcs2(aItem->GetMiddleName().GetBuffer()) ); 258 addressee.setAdditionalName( QString::fromUcs2(aItem->GetMiddleName().GetBuffer()) );
258 addressee.setPrefix(QString::fromUcs2(aItem->GetTitle().GetBuffer()) ); 259 addressee.setPrefix(QString::fromUcs2(aItem->GetTitle().GetBuffer()) );
259 addressee.setSuffix( QString::fromUcs2(aItem->GetSuffix().GetBuffer()) ); 260 addressee.setSuffix( QString::fromUcs2(aItem->GetSuffix().GetBuffer()) );
260 addressee.setNickName( QString::fromUcs2(aItem->GetNickName().GetBuffer()) ); 261 addressee.setNickName( QString::fromUcs2(aItem->GetNickName().GetBuffer()) );
261 QDateTime dtb = mDdate2Qdtr(aItem->GetBirthday()); 262 QDateTime dtb = mDdate2Qdtr(aItem->GetBirthday());
262 if ( dtb.isValid() ) 263 if ( dtb.isValid() )
263 addressee.setBirthday( mDdate2Qdtr(aItem->GetBirthday())); 264 addressee.setBirthday( mDdate2Qdtr(aItem->GetBirthday()));
264 265
265 //QString::fromUcs2(aItem->.GetBuffer()) 266 //QString::fromUcs2(aItem->.GetBuffer())
266 //addressee.setMailer( const QString &mailer ); 267 //addressee.setMailer( const QString &mailer );
267 //addressee.setTimeZone( const TimeZone &timeZone ); 268 //addressee.setTimeZone( const TimeZone &timeZone );
268 //addressee.setGeo( const Geo &geo ); 269 //addressee.setGeo( const Geo &geo );
269 //addressee.setTitle( QString::fromUcs2(aItem->GetJobTitle().GetBuffer()) );// titel is the prefix 270 //addressee.setTitle( QString::fromUcs2(aItem->GetJobTitle().GetBuffer()) );// titel is the prefix
270 addressee.setRole( QString::fromUcs2(aItem->GetJobTitle().GetBuffer()) ); 271 addressee.setRole( QString::fromUcs2(aItem->GetJobTitle().GetBuffer()) );
271 addressee.setOrganization( QString::fromUcs2(aItem->GetCompanyName().GetBuffer()).replace( QRegExp("\\r"), "") ); 272 addressee.setOrganization( QString::fromUcs2(aItem->GetCompanyName().GetBuffer()).replace( QRegExp("\\r"), "") );
272 QString notesStr = QString::fromUcs2(aItem->GetBody().GetBuffer()); 273 QString notesStr = QString::fromUcs2(aItem->GetBody().GetBuffer());
273 notesStr.replace( QRegExp("\\r"), ""); 274 notesStr.replace( QRegExp("\\r"), "");
274 275
275 addressee.setProductId( QString::fromUcs2(aItem->GetCustomerID().GetBuffer()) ); 276 addressee.setProductId( QString::fromUcs2(aItem->GetCustomerID().GetBuffer()) );
diff --git a/korganizer/koimportoldialog.cpp b/korganizer/koimportoldialog.cpp
index 7aa6076..2af436c 100644
--- a/korganizer/koimportoldialog.cpp
+++ b/korganizer/koimportoldialog.cpp
@@ -1,76 +1,77 @@
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 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 <qtooltip.h> 24#include <qtooltip.h>
25#include <qframe.h> 25#include <qframe.h>
26#include <qpixmap.h> 26#include <qpixmap.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qprogressbar.h> 28#include <qprogressbar.h>
29#include <qprogressdialog.h>
29#include <qwidgetstack.h> 30#include <qwidgetstack.h>
30#include <qdatetime.h> 31#include <qdatetime.h>
31#include <qdir.h> 32#include <qdir.h>
32#include <qapplication.h> 33#include <qapplication.h>
33#include <qhbox.h> 34#include <qhbox.h>
34#include <qregexp.h> 35#include <qregexp.h>
35#include <qheader.h> 36#include <qheader.h>
36#include <qdatetime.h> 37#include <qdatetime.h>
37#include <qlistview.h> 38#include <qlistview.h>
38 39
39#include <kdebug.h> 40#include <kdebug.h>
40#include <klocale.h> 41#include <klocale.h>
41#include <kstandarddirs.h> 42#include <kstandarddirs.h>
42#include <kmessagebox.h> 43#include <kmessagebox.h>
43#include <kfiledialog.h> 44#include <kfiledialog.h>
44 45
45#include <libkdepim/categoryselectdialog.h> 46#include <libkdepim/categoryselectdialog.h>
46#include <libkdepim/kinputdialog.h> 47#include <libkdepim/kinputdialog.h>
47 48
48#include <libkcal/calendarlocal.h> 49#include <libkcal/calendarlocal.h>
49#include <libkcal/icalformat.h> 50#include <libkcal/icalformat.h>
50#include <kabc/stdaddressbook.h> 51#include <kabc/stdaddressbook.h>
51 52
52#include "koprefs.h" 53#include "koprefs.h"
53#include "koglobals.h" 54#include "koglobals.h"
54 55
55#include "koimportoldialog.h" 56#include "koimportoldialog.h"
56 57
57#include "../outport/msoutl9.h" 58#include "../outport/msoutl9.h"
58#include <ole2.h> 59#include <ole2.h>
59#include <comutil.h> 60#include <comutil.h>
60_Application gOlApp; 61_Application gOlApp;
61 62
62QDateTime mDdate2Qdtr( DATE dt) 63QDateTime mDdate2Qdtr( DATE dt)
63{ 64{
64 COleDateTime odt; 65 COleDateTime odt;
65 SYSTEMTIME st; 66 SYSTEMTIME st;
66 odt = dt; 67 odt = dt;
67 odt.GetAsSystemTime(st); 68 odt.GetAsSystemTime(st);
68 QDateTime qdt (QDate(st.wYear, st.wMonth,st.wDay ),QTime( st.wHour, st.wMinute,st.wSecond ) ); 69 QDateTime qdt (QDate(st.wYear, st.wMonth,st.wDay ),QTime( st.wHour, st.wMinute,st.wSecond ) );
69 return qdt; 70 return qdt;
70} 71}
71 72
72class OLEListViewItem : public QCheckListItem 73class OLEListViewItem : public QCheckListItem
73{ 74{
74 public: 75 public:
75 OLEListViewItem( QListView *parent, QString text ) : 76 OLEListViewItem( QListView *parent, QString text ) :
76 QCheckListItem( parent, text, QCheckListItem::CheckBox ) { mData = 0; }; 77 QCheckListItem( parent, text, QCheckListItem::CheckBox ) { mData = 0; };
@@ -166,110 +167,111 @@ void KOImportOLdialog::addFolder(OLEListViewItem* iParent, LPDISPATCH dispParent
166 ts = i18n("Calendar"); 167 ts = i18n("Calendar");
167 break; 168 break;
168 case 2: 169 case 2:
169 ts = i18n("Contacts"); 170 ts = i18n("Contacts");
170 break; 171 break;
171 case 3: 172 case 3:
172 ts = i18n("Todos"); 173 ts = i18n("Todos");
173 break; 174 break;
174 case 4: 175 case 4:
175 ts = i18n("Journals"); 176 ts = i18n("Journals");
176 break; 177 break;
177 case 5: 178 case 5:
178 ts = i18n("Notes"); 179 ts = i18n("Notes");
179 break; 180 break;
180 default: 181 default:
181 ts = i18n("Unknown"); 182 ts = i18n("Unknown");
182 } 183 }
183 hChild->setText( 1,ts); 184 hChild->setText( 1,ts);
184 hChild->setData( (DWORD) mfChild.m_lpDispatch ); 185 hChild->setData( (DWORD) mfChild.m_lpDispatch );
185 mfChild.m_lpDispatch->AddRef(); 186 mfChild.m_lpDispatch->AddRef();
186 addFolder(hChild, mfChild.m_lpDispatch); 187 addFolder(hChild, mfChild.m_lpDispatch);
187 } 188 }
188} 189}
189 190
190void KOImportOLdialog::slotApply() 191void KOImportOLdialog::slotApply()
191{ 192{
192 importedItems = 0; 193 importedItems = 0;
193 OLEListViewItem* child = (OLEListViewItem*) mListView->firstChild(); 194 OLEListViewItem* child = (OLEListViewItem*) mListView->firstChild();
194 while ( child ) { 195 while ( child ) {
195 if ( child->isOn()&& child->data() ) 196 if ( child->isOn()&& child->data() )
196 readCalendarData( child->data() ); 197 readCalendarData( child->data() );
197 child = (OLEListViewItem*) child->itemBelow(); 198 child = (OLEListViewItem*) child->itemBelow();
198 } 199 }
199 QString mes = i18n("Importing complete.\n\n%1 items imported.").arg( importedItems); 200 QString mes = i18n("Importing complete.\n\n%1 items imported.").arg( importedItems);
200 KMessageBox::information(this,mes); 201 KMessageBox::information(this,mes);
201} 202}
202void KOImportOLdialog::readCalendarData( DWORD folder ) 203void KOImportOLdialog::readCalendarData( DWORD folder )
203{ 204{
204 205
205 LPDISPATCH dispItem = (LPDISPATCH)folder; 206 LPDISPATCH dispItem = (LPDISPATCH)folder;
206 dispItem->AddRef(); 207 dispItem->AddRef();
207 MAPIFolder mf(dispItem); 208 MAPIFolder mf(dispItem);
208 mf.m_lpDispatch->AddRef(); 209 mf.m_lpDispatch->AddRef();
209 _Items folderItems; 210 _Items folderItems;
210 _variant_t indx((long)0); 211 _variant_t indx((long)0);
211 LPDISPATCH itm; 212 LPDISPATCH itm;
212 int i; 213 int i;
213 folderItems = mf.GetItems(); 214 folderItems = mf.GetItems();
214 QProgressBar bar( folderItems.GetCount(),0 ); 215 QProgressDialog bar( i18n("Importing calendar data"),i18n("Abort"), folderItems.GetCount(),this );
215 bar.setCaption (i18n("Importing - close to abort!") ); 216 bar.setCaption (i18n("Importing!") );
216 int h = bar.sizeHint().height() ; 217 int h = bar.sizeHint().height() ;
217 int w = 300; 218 int w = 300;
218 int dw = QApplication::desktop()->width(); 219 int dw = QApplication::desktop()->width();
219 int dh = QApplication::desktop()->height(); 220 int dh = QApplication::desktop()->height();
220 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 221 //bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
221 bar.show(); 222 bar.show();
222 for(i=1; i <= folderItems.GetCount(); ++i) 223 for(i=1; i <= folderItems.GetCount(); ++i)
223 { 224 {
224 qApp->processEvents(); 225 qApp->processEvents();
225 if ( ! bar.isVisible() ) 226 if ( ! bar.isVisible() )
226 return ; 227 return ;
227 bar.setProgress( i ); 228 bar.setProgress( i );
229 bar.raise();
228 indx = (long)i; 230 indx = (long)i;
229 itm = folderItems.Item(indx.Detach()); 231 itm = folderItems.Item(indx.Detach());
230 _AppointmentItem * pItem = (_AppointmentItem *)&itm; 232 _AppointmentItem * pItem = (_AppointmentItem *)&itm;
231 ol2kopiCalendar( pItem ); 233 ol2kopiCalendar( pItem );
232 itm->Release(); 234 itm->Release();
233 } 235 }
234} 236}
235void KOImportOLdialog::slotOk() 237void KOImportOLdialog::slotOk()
236{ 238{
237 QDialog::accept(); 239 QDialog::accept();
238} 240}
239 241
240void KOImportOLdialog::ol2kopiCalendar( _AppointmentItem * aItem, bool computeRecurrence ) 242void KOImportOLdialog::ol2kopiCalendar( _AppointmentItem * aItem, bool computeRecurrence )
241{ 243{
242 KCal::Event* event = new KCal::Event(); 244 KCal::Event* event = new KCal::Event();
243 if ( aItem->GetAllDayEvent() ){ 245 if ( aItem->GetAllDayEvent() ){
244 event->setDtStart( QDateTime( mDdate2Qdtr( aItem->GetStart()).date(),QTime(0,0,0 ) )); 246 event->setDtStart( QDateTime( mDdate2Qdtr( aItem->GetStart()).date(),QTime(0,0,0 ) ));
245 event->setDtEnd( QDateTime( mDdate2Qdtr( aItem->GetEnd()) .date(),QTime(0,0,0 )).addDays(-1)); 247 event->setDtEnd( QDateTime( mDdate2Qdtr( aItem->GetEnd()) .date(),QTime(0,0,0 )).addDays(-1));
246 event->setFloats( true ); 248 event->setFloats( true );
247 } else { 249 } else {
248 event->setDtStart( mDdate2Qdtr( aItem->GetStart()) ); 250 event->setDtStart( mDdate2Qdtr( aItem->GetStart()) );
249 event->setDtEnd( mDdate2Qdtr( aItem->GetEnd()) ); 251 event->setDtEnd( mDdate2Qdtr( aItem->GetEnd()) );
250 event->setFloats( false ); 252 event->setFloats( false );
251 } 253 }
252 event->setSummary( QString::fromUcs2( aItem->GetSubject().GetBuffer()) ); 254 event->setSummary( QString::fromUcs2( aItem->GetSubject().GetBuffer()) );
253 event->setLocation( QString::fromUcs2( aItem->GetLocation().GetBuffer()) ); 255 event->setLocation( QString::fromUcs2( aItem->GetLocation().GetBuffer()) );
254 event->setDescription( QString::fromUcs2( aItem->GetBody().GetBuffer()).replace( QRegExp("\\r"), "") ); 256 event->setDescription( QString::fromUcs2( aItem->GetBody().GetBuffer()).replace( QRegExp("\\r"), "") );
255 QString cat = QString::fromUcs2( aItem->GetCategories().GetBuffer()).replace( QRegExp("; "), ";"); 257 QString cat = QString::fromUcs2( aItem->GetCategories().GetBuffer()).replace( QRegExp("; "), ";");
256 event->setCategories( QStringList::split( ";", cat ) ); 258 event->setCategories( QStringList::split( ";", cat ) );
257 if ( aItem->GetReminderSet() ) { 259 if ( aItem->GetReminderSet() ) {
258 event->clearAlarms(); 260 event->clearAlarms();
259 Alarm* alarm = event->newAlarm(); 261 Alarm* alarm = event->newAlarm();
260 alarm->setStartOffset( -aItem->GetReminderMinutesBeforeStart()*60 ); 262 alarm->setStartOffset( -aItem->GetReminderMinutesBeforeStart()*60 );
261 alarm->setEnabled( true ); 263 alarm->setEnabled( true );
262 if ( aItem->GetReminderPlaySound() ) { 264 if ( aItem->GetReminderPlaySound() ) {
263 alarm->setType( Alarm::Audio ); 265 alarm->setType( Alarm::Audio );
264 alarm->setAudioFile( QString::fromUcs2( aItem->GetReminderSoundFile().GetBuffer())); 266 alarm->setAudioFile( QString::fromUcs2( aItem->GetReminderSoundFile().GetBuffer()));
265 } 267 }
266 else 268 else
267 alarm->setType( Alarm::Display ); 269 alarm->setType( Alarm::Display );
268 alarm->setRepeatCount( aItem->GetReplyTime() ); 270 alarm->setRepeatCount( aItem->GetReplyTime() );
269 } 271 }
270 // OL :pub 0 - pers 1 - priv 2 - conf 3 272 // OL :pub 0 - pers 1 - priv 2 - conf 3
271 // KO : pub 0 - priv 1 - conf 2 273 // KO : pub 0 - priv 1 - conf 2
272 int sec = aItem->GetSensitivity() ; 274 int sec = aItem->GetSensitivity() ;
273 if ( sec > 1 )// mapping pers -> private 275 if ( sec > 1 )// mapping pers -> private
274 --sec; 276 --sec;
275 event->setSecrecy( sec ); 277 event->setSecrecy( sec );