summaryrefslogtreecommitdiffabout
path: root/korganizer/mainwindow.cpp
authorzautrix <zautrix>2004-10-06 16:02:56 (UTC)
committer zautrix <zautrix>2004-10-06 16:02:56 (UTC)
commita22de800110d8350a5200a994b041e47d51bf4c6 (patch) (unidiff)
treea4de195003d1ceabc3fd9ca4e5cd0510570bcb97 /korganizer/mainwindow.cpp
parentef71411c2f248d1dc908aa2f119c9b281e0e8bb9 (diff)
downloadkdepimpi-a22de800110d8350a5200a994b041e47d51bf4c6.zip
kdepimpi-a22de800110d8350a5200a994b041e47d51bf4c6.tar.gz
kdepimpi-a22de800110d8350a5200a994b041e47d51bf4c6.tar.bz2
added phone export
Diffstat (limited to 'korganizer/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index bd14fbf..2f286e0 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1166,38 +1166,39 @@ void MainWindow::slotSyncMenu( int action )
1166 1166
1167 } 1167 }
1168 } 1168 }
1169 delete temp; 1169 delete temp;
1170 mBlockSaveFlag = false; 1170 mBlockSaveFlag = false;
1171} 1171}
1172void MainWindow::exportToPhone( int mode ) 1172void MainWindow::exportToPhone( int mode )
1173{ 1173{
1174 1174
1175 //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1175 //ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1176 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1176 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1177 KOex2phonePrefs ex2phone; 1177 KOex2phonePrefs ex2phone;
1178 ex2phone.mPhoneConnection->setText( KOPrefs::instance()->mEx2PhoneConnection ); 1178
1179 ex2phone.mPhoneDevice->setText( KOPrefs::instance()->mEx2PhoneDevice ); 1179 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );
1180 ex2phone.mPhoneModel->setText( KOPrefs::instance()->mEx2PhoneModel ); 1180 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice );
1181 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel );
1181 if ( mode == 1 ) 1182 if ( mode == 1 )
1182 ex2phone.setCaption(i18n("Export complete calendar")); 1183 ex2phone.setCaption(i18n("Export complete calendar"));
1183 if ( mode == 2 ) 1184 if ( mode == 2 )
1184 ex2phone.setCaption(i18n("Export filtered calendar")); 1185 ex2phone.setCaption(i18n("Export filtered calendar"));
1185 1186
1186 if ( !ex2phone.exec() ) { 1187 if ( !ex2phone.exec() ) {
1187 return; 1188 return;
1188 } 1189 }
1189 KOPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 1190 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
1190 KOPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 1191 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
1191 KOPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 1192 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
1192 1193
1193 int inFuture = 0; 1194 int inFuture = 0;
1194 if ( ex2phone.mWriteBackFuture->isChecked() ) 1195 if ( ex2phone.mWriteBackFuture->isChecked() )
1195 inFuture = ex2phone.mWriteBackFutureWeeks->value(); 1196 inFuture = ex2phone.mWriteBackFutureWeeks->value();
1196 QPtrList<Incidence> delSel; 1197 QPtrList<Incidence> delSel;
1197 if ( mode == 1 ) 1198 if ( mode == 1 )
1198 delSel = mCalendar->rawIncidences(); 1199 delSel = mCalendar->rawIncidences();
1199 if ( mode == 2 ) 1200 if ( mode == 2 )
1200 delSel = mCalendar->incidences(); 1201 delSel = mCalendar->incidences();
1201 CalendarLocal* cal = new CalendarLocal(); 1202 CalendarLocal* cal = new CalendarLocal();
1202 cal->setLocalTime(); 1203 cal->setLocalTime();
1203 Incidence *incidence = delSel.first(); 1204 Incidence *incidence = delSel.first();
@@ -1223,27 +1224,27 @@ void MainWindow::exportToPhone( int mode )
1223 } 1224 }
1224 if ( dt < cur || dt > end ) { 1225 if ( dt < cur || dt > end ) {
1225 add = false; 1226 add = false;
1226 } 1227 }
1227 } 1228 }
1228 if ( add ) { 1229 if ( add ) {
1229 Incidence *in = incidence->clone(); 1230 Incidence *in = incidence->clone();
1230 cal->addIncidence( in ); 1231 cal->addIncidence( in );
1231 } 1232 }
1232 } 1233 }
1233 incidence = delSel.next(); 1234 incidence = delSel.next();
1234 } 1235 }
1235 PhoneFormat::writeConfig( KOPrefs::instance()->mEx2PhoneDevice, 1236 PhoneFormat::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
1236 KOPrefs::instance()->mEx2PhoneConnection, 1237 KPimGlobalPrefs::instance()->mEx2PhoneConnection,
1237 KOPrefs::instance()->mEx2PhoneModel ); 1238 KPimGlobalPrefs::instance()->mEx2PhoneModel );
1238 1239
1239 setCaption( i18n("Writing to phone...")); 1240 setCaption( i18n("Writing to phone..."));
1240 if ( PhoneFormat::writeToPhone( cal ) ) 1241 if ( PhoneFormat::writeToPhone( cal ) )
1241 setCaption( i18n("Export to phone successful!")); 1242 setCaption( i18n("Export to phone successful!"));
1242 else 1243 else
1243 setCaption( i18n("Error exporting to phone!")); 1244 setCaption( i18n("Error exporting to phone!"));
1244 delete cal; 1245 delete cal;
1245} 1246}
1246 1247
1247 1248
1248void MainWindow::setDefaultPreferences() 1249void MainWindow::setDefaultPreferences()
1249{ 1250{