summaryrefslogtreecommitdiffabout
path: root/libkdepim
Unidiff
Diffstat (limited to 'libkdepim') (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/phoneaccess.cpp49
1 files changed, 46 insertions, 3 deletions
diff --git a/libkdepim/phoneaccess.cpp b/libkdepim/phoneaccess.cpp
index 8298aa6..e24ad9e 100644
--- a/libkdepim/phoneaccess.cpp
+++ b/libkdepim/phoneaccess.cpp
@@ -27,2 +27,3 @@
27#include <qfile.h> 27#include <qfile.h>
28#include <qlabel.h>
28#include <qtextstream.h> 29#include <qtextstream.h>
@@ -141,4 +142,23 @@ bool PhoneAccess::writeToPhone( QString fileName)
141#endif 142#endif
142 int ret; 143 int ret = 1;
143 while ( (ret = system ( command.latin1())) != 0 ) { 144 while ( ret != 0 ) {
145 QLabel* status = new QLabel( i18n(" This may take 1-3 minutes!"), 0 );
146 int w = 235;
147 int h = status->sizeHint().height()+20 ;
148 int dw = QApplication::desktop()->width();
149 int dh = QApplication::desktop()->height();
150 if ( dw > 310 )
151 w = 310;
152 status->setCaption(i18n("Writing to phone...") );
153 status->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
154 status->show();
155 status->raise();
156 status->update();
157 qApp->processEvents();
158 status->update();
159 qApp->processEvents();
160 ret = system ( command.latin1());
161 delete status;
162 qApp->processEvents();
163 if ( ret ) {
144 qDebug("Error S::command returned %d.", ret); 164 qDebug("Error S::command returned %d.", ret);
@@ -149,2 +169,3 @@ bool PhoneAccess::writeToPhone( QString fileName)
149 } 169 }
170 }
150 return true; 171 return true;
@@ -164,3 +185,22 @@ bool PhoneAccess::readFromPhone( QString fileName)
164 int ret; 185 int ret;
165 while ( (ret = system ( command.latin1())) != 0 ) { 186 while ( ret != 0 ) {
187 QLabel* status = new QLabel( i18n(" This may take 1-3 minutes!"), 0 );
188 int w = 235;
189 int h = status->sizeHint().height()+20 ;
190 int dw = QApplication::desktop()->width();
191 int dh = QApplication::desktop()->height();
192 if ( dw > 310 )
193 w = 310;
194 status->setCaption(i18n("Reading from phone...") );
195 status->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
196 status->show();
197 status->raise();
198 status->update();
199 qApp->processEvents();
200 status->update();
201 qApp->processEvents();
202 ret = system ( command.latin1() );
203 delete status;
204 qApp->processEvents();
205 if ( ret ) {
166 qDebug("Error reading from phone:Command returned %d", ret); 206 qDebug("Error reading from phone:Command returned %d", ret);
@@ -170,3 +210,6 @@ bool PhoneAccess::readFromPhone( QString fileName)
170 return false; 210 return false;
211
212 }
171 } 213 }
214 qApp->processEvents();
172 return true; 215 return true;