-rw-r--r-- | libkdepim/phoneaccess.cpp | 24 | ||||
-rw-r--r-- | libkdepim/phoneaccess.h | 2 |
2 files changed, 25 insertions, 1 deletions
diff --git a/libkdepim/phoneaccess.cpp b/libkdepim/phoneaccess.cpp index fe914dd..5fafa1f 100644 --- a/libkdepim/phoneaccess.cpp +++ b/libkdepim/phoneaccess.cpp @@ -134,18 +134,40 @@ bool PhoneAccess::writeToPhone( QString fileName) #ifdef _WIN32_ QString command ="kammu --restore " + fileName ; #else QString command ="./kammu --restore " + fileName ; #endif #else QString command ="kammu --restore " + fileName ; #endif int ret; while ( (ret = system ( command.latin1())) != 0 ) { qDebug("Error S::command returned %d.", ret); int retval = KMessageBox::warningContinueCancel(0, - i18n("Error accessing device!\nPlease turn on connection\nand retry!"),i18n("KO/Pi phone access"),i18n("Retry"),i18n("Cancel")); + i18n("Error accessing device!\nPlease turn on connection\nand retry!"),i18n("KDE/Pim phone access"),i18n("Retry"),i18n("Cancel")); + if ( retval != KMessageBox::Continue ) + return false; + } + return true; +} +bool PhoneAccess::readFromPhone( QString fileName) +{ + +#ifdef DESKTOP_VERSION +#ifdef _WIN32_ + QString command ="kammu --backup " + fileName + " -yes" ; +#else + QString command ="./kammu --backup " + fileName + " -yes" ; +#endif +#else + QString command ="kammu --backup " + fileName + " -yes" ; +#endif + int ret; + while ( (ret = system ( command.latin1())) != 0 ) { + qDebug("Error S::command returned %d.", ret); + int retval = KMessageBox::warningContinueCancel(0, + i18n("Error accessing device!\nPlease turn on connection\nand retry!"),i18n("KDE/Pim phone access"),i18n("Retry"),i18n("Cancel")); if ( retval != KMessageBox::Continue ) return false; } return true; } diff --git a/libkdepim/phoneaccess.h b/libkdepim/phoneaccess.h index b7c4732..80840e2 100644 --- a/libkdepim/phoneaccess.h +++ b/libkdepim/phoneaccess.h @@ -13,30 +13,32 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef PHONEACCESS_H #define PHONEACCESS_H #include <qstring.h> +#include <qobject.h> /** This class implements the calendar format used by Phone. */ class PhoneAccess : public QObject { public: static void writeConfig( QString device,QString connection, QString model ); static bool writeToPhone( QString fileName ); + static bool readFromPhone( QString fileName ); }; #endif |