-rw-r--r-- | libkcal/phoneformat.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp index e43a507..11c68c5 100644 --- a/libkcal/phoneformat.cpp +++ b/libkcal/phoneformat.cpp @@ -769,8 +769,19 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) qDebug(" load "); s.opened = false; s.msg = NULL; s.ConfigNum = 0; + QLabel status ( i18n("Reading data. Opening device ..."), 0 ); + int w = status.sizeHint().width()+20 ; + if ( w < 200 ) w = 200; + int h = status.sizeHint().height()+20 ; + int dw = QApplication::desktop()->width(); + int dh = QApplication::desktop()->height(); + status.setCaption(i18n("Reading Phone Data") ); + status.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); + status.show(); + status.raise(); + qApp->processEvents(); #if 0 static char *cp; static INI_Section *cfg = NULL; cfg=GSM_FindGammuRC(); @@ -823,11 +834,14 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) Phone=s.Phone.Functions; bool gshutdown = false; PhoneParser handler( calendar, mProfileName ); int ccc = 0; + QString message = i18n("Processing event # "); + int procCount = 0; qDebug("Debug: only 10 calender items are downloaded "); while (!gshutdown && ccc++ < 10) { - + status.setText ( message + QString::number ( ++procCount ) ); + qApp->processEvents(); qDebug("readEvent %d ", ccc); error=Phone->GetNextCalendar(&s,¬e,start); if (error == ERR_EMPTY) break; start = false; @@ -836,9 +850,13 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) start = true; GSM_ToDoEntry ToDo; ccc = 0; + message = i18n("Processing todo # "); + procCount = 0; while (!gshutdown) { + status.setText ( message + QString::number ( ++procCount ) ); + qApp->processEvents(); error = Phone->GetNextToDo(&s, &ToDo, start); if (error == ERR_EMPTY) break; start = false; qDebug("ReadTodo %d ", ++ccc); @@ -929,9 +947,9 @@ bool PhoneFormat::save( Calendar *calendar) if ( w < 200 ) w = 200; int h = status.sizeHint().height()+20 ; int dw = QApplication::desktop()->width(); int dh = QApplication::desktop()->height(); - status.setCaption(i18n("Writing DTM Data") ); + status.setCaption(i18n("Writing Phone Data") ); status.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); status.show(); status.raise(); qApp->processEvents(); @@ -981,8 +999,9 @@ bool PhoneFormat::save( Calendar *calendar) event2GSM( ev, &Note ); Note.Location = 0; error = Phone->AddCalendar(&s, &Note); ev->setID( mProfileName, QString::number( Note.Location ) ); + qDebug("New Calendar. Location %d ",Note.Location ); afterSave( ev ); } else { afterSave( ev ); // setting temp sync stat for changed items } @@ -1006,9 +1025,9 @@ bool PhoneFormat::save( Calendar *calendar) else if ( to->getID("Sharp_DTM").isEmpty() ) { // add new ; } else { // change existing - error=Phone->AddToDo(&s,&ToDoEntry); + error=Phone->SetToDo(&s,&ToDoEntry); } } to = tl.next(); } |