author | zautrix <zautrix> | 2004-08-01 12:56:11 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-01 12:56:11 (UTC) |
commit | cc2643f4be54269db8c24f66fdcbbf6954d5f537 (patch) (unidiff) | |
tree | 3562598dac624305dfb9fd1911a4b314ae40945d | |
parent | c31e99f265dbe8762efca20667f8ccd973840f8f (diff) | |
download | kdepimpi-cc2643f4be54269db8c24f66fdcbbf6954d5f537.zip kdepimpi-cc2643f4be54269db8c24f66fdcbbf6954d5f537.tar.gz kdepimpi-cc2643f4be54269db8c24f66fdcbbf6954d5f537.tar.bz2 |
Made sync profile dialog korganizer independent
-rw-r--r-- | korganizer/calendarview.cpp | 28 | ||||
-rw-r--r-- | korganizer/calendarview.h | 2 | ||||
-rw-r--r-- | korganizer/kosyncprefsdialog.cpp | 44 | ||||
-rw-r--r-- | korganizer/kosyncprefsdialog.h | 4 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 21 |
5 files changed, 47 insertions, 52 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index b543eca..c75d10e 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -227,25 +227,24 @@ CalendarView::CalendarView( Calendar *calendar, | |||
227 | void CalendarView::init() | 227 | void CalendarView::init() |
228 | { | 228 | { |
229 | beamDialog = new KOBeamPrefs(); | 229 | beamDialog = new KOBeamPrefs(); |
230 | mDatePickerMode = 0; | 230 | mDatePickerMode = 0; |
231 | mCurrentSyncDevice = ""; | 231 | mCurrentSyncDevice = ""; |
232 | writeLocale(); | 232 | writeLocale(); |
233 | mViewManager = new KOViewManager( this ); | 233 | mViewManager = new KOViewManager( this ); |
234 | mDialogManager = new KODialogManager( this ); | 234 | mDialogManager = new KODialogManager( this ); |
235 | mEventViewerDialog = 0; | 235 | mEventViewerDialog = 0; |
236 | mModified = false; | 236 | mModified = false; |
237 | mReadOnly = false; | 237 | mReadOnly = false; |
238 | mSelectedIncidence = 0; | 238 | mSelectedIncidence = 0; |
239 | mSyncProfiles.setAutoDelete(true); | ||
240 | mCalPrinter = 0; | 239 | mCalPrinter = 0; |
241 | mFilters.setAutoDelete(true); | 240 | mFilters.setAutoDelete(true); |
242 | 241 | ||
243 | mCalendar->registerObserver( this ); | 242 | mCalendar->registerObserver( this ); |
244 | // TODO: Make sure that view is updated, when calendar is changed. | 243 | // TODO: Make sure that view is updated, when calendar is changed. |
245 | 244 | ||
246 | mStorage = new FileStorage( mCalendar ); | 245 | mStorage = new FileStorage( mCalendar ); |
247 | mNavigator = new DateNavigator( this, "datevav", mViewManager ); | 246 | mNavigator = new DateNavigator( this, "datevav", mViewManager ); |
248 | 247 | ||
249 | QBoxLayout *topLayout = (QBoxLayout*)layout(); | 248 | QBoxLayout *topLayout = (QBoxLayout*)layout(); |
250 | #ifndef KORG_NOSPLITTER | 249 | #ifndef KORG_NOSPLITTER |
251 | // create the main layout frames. | 250 | // create the main layout frames. |
@@ -681,32 +680,34 @@ void CalendarView::createPrinter() | |||
681 | mCalPrinter = new CalPrinter(this, mCalendar); | 680 | mCalPrinter = new CalPrinter(this, mCalendar); |
682 | connect(this, SIGNAL(configChanged()), mCalPrinter, SLOT(updateConfig())); | 681 | connect(this, SIGNAL(configChanged()), mCalPrinter, SLOT(updateConfig())); |
683 | } | 682 | } |
684 | #endif | 683 | #endif |
685 | } | 684 | } |
686 | 685 | ||
687 | void CalendarView::confSync() | 686 | void CalendarView::confSync() |
688 | { | 687 | { |
689 | static KOSyncPrefsDialog* sp = 0; | 688 | static KOSyncPrefsDialog* sp = 0; |
690 | if ( ! sp ) { | 689 | if ( ! sp ) { |
691 | sp = new KOSyncPrefsDialog( this, "syncprefs", true ); | 690 | sp = new KOSyncPrefsDialog( this, "syncprefs", true ); |
692 | } | 691 | } |
692 | sp->setLocalMachineName ( KOPrefs::instance()->mLocalMachineName ); | ||
693 | sp->usrReadConfig(); | 693 | sp->usrReadConfig(); |
694 | #ifndef DESKTOP_VERSION | 694 | #ifndef DESKTOP_VERSION |
695 | sp->showMaximized(); | 695 | sp->showMaximized(); |
696 | #else | 696 | #else |
697 | sp->show(); | 697 | sp->show(); |
698 | #endif | 698 | #endif |
699 | sp->exec(); | 699 | sp->exec(); |
700 | 700 | KOPrefs::instance()->mSyncProfileNames = sp->getSyncProfileNames(); | |
701 | KOPrefs::instance()->mLocalMachineName = sp->getLocalMachineName (); | ||
701 | } | 702 | } |
702 | 703 | ||
703 | 704 | ||
704 | //KOPrefs::instance()->mWriteBackFile | 705 | //KOPrefs::instance()->mWriteBackFile |
705 | //KOPrefs::instance()->mWriteBackExistingOnly | 706 | //KOPrefs::instance()->mWriteBackExistingOnly |
706 | 707 | ||
707 | // 0 syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); | 708 | // 0 syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); |
708 | // 1 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); | 709 | // 1 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); |
709 | // 2 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); | 710 | // 2 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); |
710 | // 3 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); | 711 | // 3 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); |
711 | // 4 syncPrefsGroup->addRadio(i18n("Force take local entry always")); | 712 | // 4 syncPrefsGroup->addRadio(i18n("Force take local entry always")); |
712 | // 5 syncPrefsGroup->addRadio(i18n("Force take remote entry always")); | 713 | // 5 syncPrefsGroup->addRadio(i18n("Force take remote entry always")); |
@@ -1554,47 +1555,24 @@ void CalendarView::readSettings() | |||
1554 | 1555 | ||
1555 | } | 1556 | } |
1556 | list = config->readListEntry("ViewerLayout"); | 1557 | list = config->readListEntry("ViewerLayout"); |
1557 | if ( ! list.isEmpty() ) { | 1558 | if ( ! list.isEmpty() ) { |
1558 | x = list[0].toInt(); | 1559 | x = list[0].toInt(); |
1559 | y = list[1].toInt(); | 1560 | y = list[1].toInt(); |
1560 | w = list[2].toInt(); | 1561 | w = list[2].toInt(); |
1561 | h = list[3].toInt(); | 1562 | h = list[3].toInt(); |
1562 | getEventViewerDialog()->setGeometry(x,y,w,h); | 1563 | getEventViewerDialog()->setGeometry(x,y,w,h); |
1563 | } | 1564 | } |
1564 | #endif | 1565 | #endif |
1565 | 1566 | ||
1566 | |||
1567 | // pending read sync settings; | ||
1568 | mSyncProfileNames.clear(); | ||
1569 | mSyncProfileNames << "Profile_1"; | ||
1570 | mSyncProfileNames << "Profile_2"; | ||
1571 | mSyncProfileNames << "Profile_3"; | ||
1572 | mSyncProfileNames << "Profile_4"; | ||
1573 | mSyncProfileNames << "Profile_5"; | ||
1574 | KSyncProfile* temp = new KSyncProfile (); | ||
1575 | temp->setName("Profile_1" ); | ||
1576 | mSyncProfiles.append( temp ); | ||
1577 | temp = new KSyncProfile (); | ||
1578 | temp->setName("Profile_2" ); | ||
1579 | mSyncProfiles.append( temp ); | ||
1580 | temp = new KSyncProfile (); | ||
1581 | temp->setName("Profile_3" ); | ||
1582 | mSyncProfiles.append( temp ); | ||
1583 | temp = new KSyncProfile (); | ||
1584 | temp->setName("Profile_4" ); | ||
1585 | mSyncProfiles.append( temp ); | ||
1586 | temp = new KSyncProfile (); | ||
1587 | temp->setName("Profile_5" ); | ||
1588 | mSyncProfiles.append( temp ); | ||
1589 | } | 1567 | } |
1590 | 1568 | ||
1591 | 1569 | ||
1592 | void CalendarView::writeSettings() | 1570 | void CalendarView::writeSettings() |
1593 | { | 1571 | { |
1594 | // kdDebug() << "CalendarView::writeSettings" << endl; | 1572 | // kdDebug() << "CalendarView::writeSettings" << endl; |
1595 | 1573 | ||
1596 | KConfig *config = KOGlobals::config(); | 1574 | KConfig *config = KOGlobals::config(); |
1597 | 1575 | ||
1598 | #ifndef KORG_NOSPLITTER | 1576 | #ifndef KORG_NOSPLITTER |
1599 | config->setGroup("KOrganizer Geometry"); | 1577 | config->setGroup("KOrganizer Geometry"); |
1600 | 1578 | ||
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index fda02f7..8aa5e1c 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -473,26 +473,24 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
473 | AlarmDialog * mAlarmDialog; | 473 | AlarmDialog * mAlarmDialog; |
474 | QString mAlarmNotification; | 474 | QString mAlarmNotification; |
475 | QString mSuspendAlarmNotification; | 475 | QString mSuspendAlarmNotification; |
476 | QTimer* mSuspendTimer; | 476 | QTimer* mSuspendTimer; |
477 | QTimer* mAlarmTimer; | 477 | QTimer* mAlarmTimer; |
478 | QTimer* mRecheckAlarmTimer; | 478 | QTimer* mRecheckAlarmTimer; |
479 | void computeAlarm( QString ); | 479 | void computeAlarm( QString ); |
480 | void startAlarm( QString, QString ); | 480 | void startAlarm( QString, QString ); |
481 | void setSyncEventsReadOnly(); | 481 | void setSyncEventsReadOnly(); |
482 | 482 | ||
483 | QDateTime loadedFileVersion; | 483 | QDateTime loadedFileVersion; |
484 | void checkSharpEvent( Event* lastSync, Incidence* toDelete ); | 484 | void checkSharpEvent( Event* lastSync, Incidence* toDelete ); |
485 | QPtrList<KSyncProfile> mSyncProfiles; | ||
486 | QStringList mSyncProfileNames; | ||
487 | void checkZaurusId( int id, bool todo = false ); | 485 | void checkZaurusId( int id, bool todo = false ); |
488 | int mGlobalSyncMode; | 486 | int mGlobalSyncMode; |
489 | QString mCurrentSyncDevice; | 487 | QString mCurrentSyncDevice; |
490 | QString mCurrentSyncName; | 488 | QString mCurrentSyncName; |
491 | KOBeamPrefs* beamDialog; | 489 | KOBeamPrefs* beamDialog; |
492 | void init(); | 490 | void init(); |
493 | int mDatePickerMode; | 491 | int mDatePickerMode; |
494 | bool mFlagEditDescription; | 492 | bool mFlagEditDescription; |
495 | QDateTime mLastCalendarSync; | 493 | QDateTime mLastCalendarSync; |
496 | void createPrinter(); | 494 | void createPrinter(); |
497 | 495 | ||
498 | void calendarModified( bool, Calendar * ); | 496 | void calendarModified( bool, Calendar * ); |
diff --git a/korganizer/kosyncprefsdialog.cpp b/korganizer/kosyncprefsdialog.cpp index b7e4265..7c838f5 100644 --- a/korganizer/kosyncprefsdialog.cpp +++ b/korganizer/kosyncprefsdialog.cpp | |||
@@ -20,24 +20,25 @@ | |||
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 <qlayout.h> | 24 | #include <qlayout.h> |
25 | #include <qlabel.h> | 25 | #include <qlabel.h> |
26 | #include <qgroupbox.h> | 26 | #include <qgroupbox.h> |
27 | #include <qbuttongroup.h> | 27 | #include <qbuttongroup.h> |
28 | #include <qlineedit.h> | 28 | #include <qlineedit.h> |
29 | #include <qfont.h> | 29 | #include <qfont.h> |
30 | #include <qslider.h> | 30 | #include <qslider.h> |
31 | #include <qfile.h> | 31 | #include <qfile.h> |
32 | #include <qdir.h> | ||
32 | #include <qtextstream.h> | 33 | #include <qtextstream.h> |
33 | #include <qcombobox.h> | 34 | #include <qcombobox.h> |
34 | #include <qvbox.h> | 35 | #include <qvbox.h> |
35 | #include <qhbox.h> | 36 | #include <qhbox.h> |
36 | #include <qspinbox.h> | 37 | #include <qspinbox.h> |
37 | #include <qdatetime.h> | 38 | #include <qdatetime.h> |
38 | #include <qcheckbox.h> | 39 | #include <qcheckbox.h> |
39 | #include <qradiobutton.h> | 40 | #include <qradiobutton.h> |
40 | #include <qpushbutton.h> | 41 | #include <qpushbutton.h> |
41 | #include <qstrlist.h> | 42 | #include <qstrlist.h> |
42 | #include <qapplication.h> | 43 | #include <qapplication.h> |
43 | 44 | ||
@@ -50,28 +51,28 @@ | |||
50 | #include <kcolordialog.h> | 51 | #include <kcolordialog.h> |
51 | #include <kiconloader.h> | 52 | #include <kiconloader.h> |
52 | #include <kemailsettings.h> | 53 | #include <kemailsettings.h> |
53 | #include <kstandarddirs.h> | 54 | #include <kstandarddirs.h> |
54 | #include <kfiledialog.h> | 55 | #include <kfiledialog.h> |
55 | #include <kmessagebox.h> | 56 | #include <kmessagebox.h> |
56 | 57 | ||
57 | #include <kurlrequester.h> | 58 | #include <kurlrequester.h> |
58 | #include <klineedit.h> | 59 | #include <klineedit.h> |
59 | #include <libkdepim/ksyncprofile.h> | 60 | #include <libkdepim/ksyncprofile.h> |
60 | 61 | ||
61 | 62 | ||
62 | #include "koprefs.h" | 63 | //#include "koprefs.h" |
63 | 64 | ||
64 | #include "kosyncprefsdialog.h" | 65 | #include "kosyncprefsdialog.h" |
65 | #include "koglobals.h" | 66 | //#include "koglobals.h" |
66 | 67 | ||
67 | 68 | ||
68 | KOSyncPrefsDialog::KOSyncPrefsDialog(QWidget *parent, char *name, bool modal) : | 69 | KOSyncPrefsDialog::KOSyncPrefsDialog(QWidget *parent, char *name, bool modal) : |
69 | KDialog(parent,name,true) | 70 | KDialog(parent,name,true) |
70 | { | 71 | { |
71 | 72 | ||
72 | setCaption( i18n("Synchronization Preferences")); | 73 | setCaption( i18n("Synchronization Preferences")); |
73 | 74 | ||
74 | mSyncProfiles.setAutoDelete( true ); | 75 | mSyncProfiles.setAutoDelete( true ); |
75 | setupSyncAlgTab(); | 76 | setupSyncAlgTab(); |
76 | } | 77 | } |
77 | 78 | ||
@@ -224,25 +225,25 @@ void KOSyncPrefsDialog::slotOK() | |||
224 | return; | 225 | return; |
225 | } | 226 | } |
226 | } | 227 | } |
227 | usrWriteConfig(); | 228 | usrWriteConfig(); |
228 | QDialog::accept(); | 229 | QDialog::accept(); |
229 | } | 230 | } |
230 | void KOSyncPrefsDialog::accept() | 231 | void KOSyncPrefsDialog::accept() |
231 | { | 232 | { |
232 | slotOK(); | 233 | slotOK(); |
233 | } | 234 | } |
234 | void KOSyncPrefsDialog::chooseFile() | 235 | void KOSyncPrefsDialog::chooseFile() |
235 | { | 236 | { |
236 | QString fn =KOPrefs::instance()->mLastSyncedLocalFile; | 237 | QString fn = QDir::homeDirPath(); |
237 | 238 | ||
238 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); | 239 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); |
239 | if ( fn == "" ) | 240 | if ( fn == "" ) |
240 | return; | 241 | return; |
241 | mRemoteFile->setText( fn ); | 242 | mRemoteFile->setText( fn ); |
242 | } | 243 | } |
243 | 244 | ||
244 | void KOSyncPrefsDialog::textChanged( const QString & s ) | 245 | void KOSyncPrefsDialog::textChanged( const QString & s ) |
245 | { | 246 | { |
246 | if ( mProfileBox->count() == 0 ) | 247 | if ( mProfileBox->count() == 0 ) |
247 | return; | 248 | return; |
248 | if ( currentSelection < 3 ) { | 249 | if ( currentSelection < 3 ) { |
@@ -404,49 +405,64 @@ void KOSyncPrefsDialog::newProfile() | |||
404 | { | 405 | { |
405 | addProfile ( new KSyncProfile () ); | 406 | addProfile ( new KSyncProfile () ); |
406 | } | 407 | } |
407 | 408 | ||
408 | void KOSyncPrefsDialog::cloneProfile() | 409 | void KOSyncPrefsDialog::cloneProfile() |
409 | { | 410 | { |
410 | if ( currentSelection >= 0 ) | 411 | if ( currentSelection >= 0 ) |
411 | addProfile (mSyncProfiles.at(currentSelection)->clone()) ; | 412 | addProfile (mSyncProfiles.at(currentSelection)->clone()) ; |
412 | else | 413 | else |
413 | newProfile(); | 414 | newProfile(); |
414 | } | 415 | } |
415 | 416 | ||
417 | void KOSyncPrefsDialog::setLocalMachineName ( const QString& name ) | ||
418 | { | ||
419 | mMyMachineName->setText( name ); | ||
416 | 420 | ||
421 | } | ||
422 | QString KOSyncPrefsDialog::getLocalMachineName ( ) | ||
423 | { | ||
424 | return mMyMachineName->text(); | ||
425 | } | ||
426 | |||
427 | QStringList KOSyncPrefsDialog::getSyncProfileNames() | ||
428 | { | ||
429 | return mSyncProfileNames; | ||
430 | } | ||
417 | void KOSyncPrefsDialog::usrReadConfig() | 431 | void KOSyncPrefsDialog::usrReadConfig() |
418 | { | 432 | { |
419 | KConfig *config = KOGlobals::config(); | 433 | //KConfig *config = KOGlobals::config(); |
420 | config->setGroup("SyncProfiles"); | 434 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); |
421 | mSyncProfileNames = KOPrefs::instance()->mSyncProfileNames; | 435 | config.setGroup("SyncProfiles"); |
436 | mSyncProfileNames =config.readListEntry("SyncProfileNames"); | ||
422 | int i; | 437 | int i; |
423 | KSyncProfile* temp ; | 438 | KSyncProfile* temp ; |
424 | mSyncProfiles.clear(); | 439 | mSyncProfiles.clear(); |
425 | for ( i = 0; i < mSyncProfileNames.count();++i ) { | 440 | for ( i = 0; i < mSyncProfileNames.count();++i ) { |
426 | temp = new KSyncProfile (); | 441 | temp = new KSyncProfile (); |
427 | temp->setName( mSyncProfileNames[i] ); | 442 | temp->setName( mSyncProfileNames[i] ); |
428 | temp->readConfig( config ); | 443 | temp->readConfig( &config ); |
429 | mSyncProfiles.append( temp ); | 444 | mSyncProfiles.append( temp ); |
430 | } | 445 | } |
431 | insertProfiles(); | 446 | insertProfiles(); |
432 | mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); | 447 | //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); |
433 | } | 448 | } |
434 | 449 | ||
435 | 450 | ||
436 | void KOSyncPrefsDialog::usrWriteConfig() | 451 | void KOSyncPrefsDialog::usrWriteConfig() |
437 | { | 452 | { |
438 | saveProfile(); | 453 | saveProfile(); |
439 | if ( currentSelection >= 0 ) | 454 | if ( currentSelection >= 0 ) |
440 | profileChanged(currentSelection); | 455 | profileChanged(currentSelection); |
441 | KConfig *config = KOGlobals::config(); | 456 | //KConfig *config = KOGlobals::config(); |
442 | config->setGroup("SyncProfiles"); | 457 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); |
458 | config.setGroup("SyncProfiles"); | ||
443 | KSyncProfile* prof = mSyncProfiles.first(); | 459 | KSyncProfile* prof = mSyncProfiles.first(); |
444 | while ( prof ) { | 460 | while ( prof ) { |
445 | prof->writeConfig(config); | 461 | prof->writeConfig(&config); |
446 | prof = mSyncProfiles.next(); | 462 | prof = mSyncProfiles.next(); |
447 | } | 463 | } |
448 | KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; | 464 | //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; |
449 | KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); | 465 | //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); |
450 | config->writeEntry("SyncProfileNames",&mSyncProfileNames); | 466 | config.writeEntry("SyncProfileNames",&mSyncProfileNames); |
451 | } | 467 | } |
452 | 468 | ||
diff --git a/korganizer/kosyncprefsdialog.h b/korganizer/kosyncprefsdialog.h index d2d8c6f..541d18b 100644 --- a/korganizer/kosyncprefsdialog.h +++ b/korganizer/kosyncprefsdialog.h | |||
@@ -46,24 +46,28 @@ class QStringList; | |||
46 | class KSyncProfile; | 46 | class KSyncProfile; |
47 | 47 | ||
48 | /** Dialog to change the korganizer configuration. | 48 | /** Dialog to change the korganizer configuration. |
49 | */ | 49 | */ |
50 | class KOSyncPrefsDialog : public KDialog | 50 | class KOSyncPrefsDialog : public KDialog |
51 | { | 51 | { |
52 | Q_OBJECT | 52 | Q_OBJECT |
53 | public: | 53 | public: |
54 | /** Initialize dialog and pages */ | 54 | /** Initialize dialog and pages */ |
55 | KOSyncPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false); | 55 | KOSyncPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false); |
56 | ~KOSyncPrefsDialog(); | 56 | ~KOSyncPrefsDialog(); |
57 | void usrReadConfig(); | 57 | void usrReadConfig(); |
58 | void setLocalMachineName ( const QString& name ); | ||
59 | QString getLocalMachineName ( ); | ||
60 | |||
61 | QStringList getSyncProfileNames(); | ||
58 | 62 | ||
59 | public slots: | 63 | public slots: |
60 | protected slots: | 64 | protected slots: |
61 | void accept(); | 65 | void accept(); |
62 | void deleteProfile(); | 66 | void deleteProfile(); |
63 | void newProfile(); | 67 | void newProfile(); |
64 | void cloneProfile(); | 68 | void cloneProfile(); |
65 | void kindChanged(bool); | 69 | void kindChanged(bool); |
66 | void fillSSH(); | 70 | void fillSSH(); |
67 | void fillFTP(); | 71 | void fillFTP(); |
68 | void textChanged( const QString & ); | 72 | void textChanged( const QString & ); |
69 | void profileChanged( int ); | 73 | void profileChanged( int ); |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index a487f14..589ab2d 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -809,45 +809,44 @@ void MainWindow::initActions() | |||
809 | QWhatsThis::whatsThisButton ( iconToolBar ); | 809 | QWhatsThis::whatsThisButton ( iconToolBar ); |
810 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); | 810 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); |
811 | configureAgenda( p->mHourSize ); | 811 | configureAgenda( p->mHourSize ); |
812 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); | 812 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); |
813 | } | 813 | } |
814 | void MainWindow::fillSyncMenu() | 814 | void MainWindow::fillSyncMenu() |
815 | { | 815 | { |
816 | syncMenu->clear(); | 816 | syncMenu->clear(); |
817 | syncMenu->insertItem( i18n("Configure..."), 0 ); | 817 | syncMenu->insertItem( i18n("Configure..."), 0 ); |
818 | syncMenu->insertSeparator(); | 818 | syncMenu->insertSeparator(); |
819 | syncMenu->insertItem( i18n("Multiple sync"), 1 ); | 819 | syncMenu->insertItem( i18n("Multiple sync"), 1 ); |
820 | syncMenu->insertSeparator(); | 820 | syncMenu->insertSeparator(); |
821 | 821 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); | |
822 | QStringList prof = KOPrefs::instance()->mSyncProfileNames; | 822 | config.setGroup("SyncProfiles"); |
823 | 823 | QStringList prof = config.readListEntry("SyncProfileNames"); | |
824 | |||
824 | if ( prof.count() < 3 ) { | 825 | if ( prof.count() < 3 ) { |
825 | KConfig *config = KOGlobals::config(); | ||
826 | prof.clear(); | 826 | prof.clear(); |
827 | prof << i18n("Sharp-DTM"); | 827 | prof << i18n("Sharp-DTM"); |
828 | prof << i18n("Local file"); | 828 | prof << i18n("Local file"); |
829 | prof << i18n("Last file"); | 829 | prof << i18n("Last file"); |
830 | KSyncProfile* temp = new KSyncProfile (); | 830 | KSyncProfile* temp = new KSyncProfile (); |
831 | temp->setName( prof[0] ); | 831 | temp->setName( prof[0] ); |
832 | temp->writeConfig(config); | 832 | temp->writeConfig(&config); |
833 | temp->setName( prof[1] ); | 833 | temp->setName( prof[1] ); |
834 | temp->writeConfig(config); | 834 | temp->writeConfig(&config); |
835 | temp->setName( prof[2] ); | 835 | temp->setName( prof[2] ); |
836 | temp->writeConfig(config); | 836 | temp->writeConfig(&config); |
837 | config->sync(); | 837 | config.sync(); |
838 | delete temp; | 838 | delete temp; |
839 | KOPrefs::instance()->mSyncProfileNames = prof; | ||
840 | } | 839 | } |
841 | 840 | KOPrefs::instance()->mSyncProfileNames = prof; | |
842 | int i; | 841 | int i; |
843 | for ( i = 0; i < prof.count(); ++i ) { | 842 | for ( i = 0; i < prof.count(); ++i ) { |
844 | 843 | ||
845 | syncMenu->insertItem( prof[i], 1000+i ); | 844 | syncMenu->insertItem( prof[i], 1000+i ); |
846 | if ( i == 2 ) | 845 | if ( i == 2 ) |
847 | syncMenu->insertSeparator(); | 846 | syncMenu->insertSeparator(); |
848 | } | 847 | } |
849 | QDir app_dir; | 848 | QDir app_dir; |
850 | if ( !app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { | 849 | if ( !app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { |
851 | syncMenu->setItemEnabled( false , 1000 ); | 850 | syncMenu->setItemEnabled( false , 1000 ); |
852 | } | 851 | } |
853 | } | 852 | } |
@@ -1791,25 +1790,25 @@ void MainWindow::quickSyncLocalFile() | |||
1791 | // Event* e = mView->getLastSyncEvent(); | 1790 | // Event* e = mView->getLastSyncEvent(); |
1792 | // e->setReadOnly( false ); | 1791 | // e->setReadOnly( false ); |
1793 | // e->setLocation( i18n("Quick with file: ")+ KOPrefs::instance()->mLastSyncedLocalFile); | 1792 | // e->setLocation( i18n("Quick with file: ")+ KOPrefs::instance()->mLastSyncedLocalFile); |
1794 | // e->setReadOnly( true ); | 1793 | // e->setReadOnly( true ); |
1795 | 1794 | ||
1796 | } | 1795 | } |
1797 | } | 1796 | } |
1798 | 1797 | ||
1799 | void MainWindow::confSync() | 1798 | void MainWindow::confSync() |
1800 | { | 1799 | { |
1801 | mView->confSync(); | 1800 | mView->confSync(); |
1802 | fillSyncMenu(); | 1801 | fillSyncMenu(); |
1803 | mView->writeSettings(); | 1802 | //mView->writeSettings(); |
1804 | 1803 | ||
1805 | 1804 | ||
1806 | } | 1805 | } |
1807 | void MainWindow::syncRemote( KSyncProfile* prof, bool ask) | 1806 | void MainWindow::syncRemote( KSyncProfile* prof, bool ask) |
1808 | { | 1807 | { |
1809 | QString question; | 1808 | QString question; |
1810 | if ( ask ) { | 1809 | if ( ask ) { |
1811 | question = i18n("Do you really want\nto remote sync\nwith profile \n")+ prof->getName()+" ?\n"; | 1810 | question = i18n("Do you really want\nto remote sync\nwith profile \n")+ prof->getName()+" ?\n"; |
1812 | if ( QMessageBox::information( this, i18n("KO/Pi Sync"), | 1811 | if ( QMessageBox::information( this, i18n("KO/Pi Sync"), |
1813 | question, | 1812 | question, |
1814 | i18n("Yes"), i18n("No"), | 1813 | i18n("Yes"), i18n("No"), |
1815 | 0, 0 ) != 0 ) | 1814 | 0, 0 ) != 0 ) |