author | zautrix <zautrix> | 2005-02-09 19:31:50 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-09 19:31:50 (UTC) |
commit | a9eff860d8399a198a9fdc04e09ed369097fc745 (patch) (unidiff) | |
tree | c953f38ef75bed96bdedd61b1b4bf369e08cddee | |
parent | 22d5db839c9741cb2e988e84bbb367617934ebd9 (diff) | |
download | kdepimpi-a9eff860d8399a198a9fdc04e09ed369097fc745.zip kdepimpi-a9eff860d8399a198a9fdc04e09ed369097fc745.tar.gz kdepimpi-a9eff860d8399a198a9fdc04e09ed369097fc745.tar.bz2 |
fixes
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 9 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 18 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 1 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.cpp | 13 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.h | 2 |
5 files changed, 34 insertions, 9 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 65bb075..6ccf763 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,34 +1,43 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.0.6 ************ | ||
4 | |||
5 | Two bugfixes in the pi-sync mode. | ||
6 | KO/Pi: | ||
7 | Made the todolist using alternate background. | ||
8 | |||
9 | Other minor fixes in KO/Pi. | ||
10 | |||
11 | |||
3 | ********** VERSION 2.0.5 ************ | 12 | ********** VERSION 2.0.5 ************ |
4 | 13 | ||
5 | Bugfixes in KO/Pi. | 14 | Bugfixes in KO/Pi. |
6 | 15 | ||
7 | ********** VERSION 2.0.4 ************ | 16 | ********** VERSION 2.0.4 ************ |
8 | 17 | ||
9 | KO/Pi: | 18 | KO/Pi: |
10 | Fixed problem loading translations for summary/location edit boxes in event/todo editor. | 19 | Fixed problem loading translations for summary/location edit boxes in event/todo editor. |
11 | 20 | ||
12 | Added a general "select week number" to the toolbar. | 21 | Added a general "select week number" to the toolbar. |
13 | 22 | ||
14 | Fixed some small problem of the new features introduced in version 2.0.3. | 23 | Fixed some small problem of the new features introduced in version 2.0.3. |
15 | 24 | ||
16 | Made it possible to specify one specific category as category color, | 25 | Made it possible to specify one specific category as category color, |
17 | if more than one categories are selected. | 26 | if more than one categories are selected. |
18 | 27 | ||
19 | Fixed a bug in saving colors for categories with non-ascii characters. | 28 | Fixed a bug in saving colors for categories with non-ascii characters. |
20 | (Like, e.g. German Umlauts). | 29 | (Like, e.g. German Umlauts). |
21 | Propably you have to set your colors again for those categories. | 30 | Propably you have to set your colors again for those categories. |
22 | 31 | ||
23 | 32 | ||
24 | ********** VERSION 2.0.3 ************ | 33 | ********** VERSION 2.0.3 ************ |
25 | 34 | ||
26 | KO/Pi: | 35 | KO/Pi: |
27 | Added feature for changing alarm settings for many items at once: | 36 | Added feature for changing alarm settings for many items at once: |
28 | Open list view (or search dialog), select the desired items and choose in | 37 | Open list view (or search dialog), select the desired items and choose in |
29 | the popup menu: Set alarm for selected... | 38 | the popup menu: Set alarm for selected... |
30 | 39 | ||
31 | Added to the event/todo viewer the option to send an email to | 40 | Added to the event/todo viewer the option to send an email to |
32 | all attendees or all selected (with RSVP) attendees. | 41 | all attendees or all selected (with RSVP) attendees. |
33 | 42 | ||
34 | Made the week-month mode changing in month view faster. | 43 | Made the week-month mode changing in month view faster. |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 468fd5b..18a4b12 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -236,65 +236,65 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
236 | KOPrefs::instance()->setAllDefaults(); | 236 | KOPrefs::instance()->setAllDefaults(); |
237 | int count = mView->addCategories(); | 237 | int count = mView->addCategories(); |
238 | } | 238 | } |
239 | processIncidenceSelection( 0 ); | 239 | processIncidenceSelection( 0 ); |
240 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), | 240 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), |
241 | SLOT( processIncidenceSelection( Incidence * ) ) ); | 241 | SLOT( processIncidenceSelection( Incidence * ) ) ); |
242 | connect( mView, SIGNAL( modifiedChanged( bool ) ), | 242 | connect( mView, SIGNAL( modifiedChanged( bool ) ), |
243 | SLOT( slotModifiedChanged( bool ) ) ); | 243 | SLOT( slotModifiedChanged( bool ) ) ); |
244 | 244 | ||
245 | 245 | ||
246 | connect( mView, SIGNAL( tempDisableBR(bool) ), | 246 | connect( mView, SIGNAL( tempDisableBR(bool) ), |
247 | SLOT( disableBR(bool) ) ); | 247 | SLOT( disableBR(bool) ) ); |
248 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); | 248 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); |
249 | mView->setModified( false ); | 249 | mView->setModified( false ); |
250 | mBlockAtStartup = false; | 250 | mBlockAtStartup = false; |
251 | mView->setModified( false ); | 251 | mView->setModified( false ); |
252 | setCentralWidget( mView ); | 252 | setCentralWidget( mView ); |
253 | globalFlagBlockStartup = 0; | 253 | globalFlagBlockStartup = 0; |
254 | mView->show(); | 254 | mView->show(); |
255 | delete splash; | 255 | delete splash; |
256 | if ( newFile ) | 256 | if ( newFile ) |
257 | mView->updateConfig(); | 257 | mView->updateConfig(); |
258 | // qApp->processEvents(); | 258 | // qApp->processEvents(); |
259 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 259 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
260 | //fillSyncMenu(); | 260 | //fillSyncMenu(); |
261 | 261 | ||
262 | 262 | ||
263 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); | 263 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); |
264 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); | 264 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); |
265 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); | 265 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); |
266 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); | 266 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); |
267 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); | 267 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); |
268 | mSyncManager->setDefaultFileName( defaultFileName()); | 268 | mSyncManager->setDefaultFileName( sentSyncFile()); |
269 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); | 269 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); |
270 | mSyncManager->fillSyncMenu(); | 270 | mSyncManager->fillSyncMenu(); |
271 | 271 | ||
272 | 272 | ||
273 | 273 | ||
274 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); | 274 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); |
275 | if ( showWarning ) { | 275 | if ( showWarning ) { |
276 | KMessageBox::information( this, | 276 | KMessageBox::information( this, |
277 | "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); | 277 | "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); |
278 | qApp->processEvents(); | 278 | qApp->processEvents(); |
279 | mView->dialogManager()->showSyncOptions(); | 279 | mView->dialogManager()->showSyncOptions(); |
280 | } | 280 | } |
281 | 281 | ||
282 | //US listen for result adressed from Ka/Pi | 282 | //US listen for result adressed from Ka/Pi |
283 | #ifndef DESKTOP_VERSION | 283 | #ifndef DESKTOP_VERSION |
284 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 284 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
285 | #endif | 285 | #endif |
286 | #ifndef DESKTOP_VERSION | 286 | #ifndef DESKTOP_VERSION |
287 | infrared = 0; | 287 | infrared = 0; |
288 | #endif | 288 | #endif |
289 | updateWeek( mView->startDate() ); | 289 | updateWeek( mView->startDate() ); |
290 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), | 290 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), |
291 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); | 291 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); |
292 | mBRdisabled = false; | 292 | mBRdisabled = false; |
293 | //toggleBeamReceive(); | 293 | //toggleBeamReceive(); |
294 | } | 294 | } |
295 | MainWindow::~MainWindow() | 295 | MainWindow::~MainWindow() |
296 | { | 296 | { |
297 | //qDebug("MainWindow::~MainWindow() "); | 297 | //qDebug("MainWindow::~MainWindow() "); |
298 | //save toolbar location | 298 | //save toolbar location |
299 | delete mCalendar; | 299 | delete mCalendar; |
300 | delete mSyncManager; | 300 | delete mSyncManager; |
@@ -1963,79 +1963,91 @@ void MainWindow::importIcal() | |||
1963 | 1963 | ||
1964 | void MainWindow::exportVCalendar() | 1964 | void MainWindow::exportVCalendar() |
1965 | { | 1965 | { |
1966 | QString fn = KOPrefs::instance()->mLastVcalFile; | 1966 | QString fn = KOPrefs::instance()->mLastVcalFile; |
1967 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); | 1967 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); |
1968 | if ( fn == "" ) | 1968 | if ( fn == "" ) |
1969 | return; | 1969 | return; |
1970 | QFileInfo info; | 1970 | QFileInfo info; |
1971 | info.setFile( fn ); | 1971 | info.setFile( fn ); |
1972 | QString mes; | 1972 | QString mes; |
1973 | bool createbup = true; | 1973 | bool createbup = true; |
1974 | if ( info. exists() ) { | 1974 | if ( info. exists() ) { |
1975 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); | 1975 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); |
1976 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 1976 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
1977 | i18n("Overwrite!"), i18n("Cancel"), 0, | 1977 | i18n("Overwrite!"), i18n("Cancel"), 0, |
1978 | 0, 1 ); | 1978 | 0, 1 ); |
1979 | if ( result != 0 ) { | 1979 | if ( result != 0 ) { |
1980 | createbup = false; | 1980 | createbup = false; |
1981 | } | 1981 | } |
1982 | } | 1982 | } |
1983 | if ( createbup ) { | 1983 | if ( createbup ) { |
1984 | if ( mView->exportVCalendar( fn ) ) { | 1984 | if ( mView->exportVCalendar( fn ) ) { |
1985 | KOPrefs::instance()->mLastVcalFile = fn; | 1985 | KOPrefs::instance()->mLastVcalFile = fn; |
1986 | if ( fn.length() > 20 ) | 1986 | if ( fn.length() > 20 ) |
1987 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; | 1987 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; |
1988 | else | 1988 | else |
1989 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); | 1989 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); |
1990 | setCaption(mes); | 1990 | setCaption(mes); |
1991 | } | 1991 | } |
1992 | } | 1992 | } |
1993 | 1993 | ||
1994 | } | 1994 | } |
1995 | QString MainWindow::sentSyncFile() | ||
1996 | { | ||
1997 | #ifdef DESKTOP_VERSION | ||
1998 | return locateLocal( "tmp", "copysynccal.ics" ); | ||
1999 | #else | ||
2000 | return QString( "/tmp/copysynccal.ics" ); | ||
2001 | #endif | ||
2002 | } | ||
1995 | 2003 | ||
1996 | void MainWindow::syncFileRequest() | 2004 | void MainWindow::syncFileRequest() |
1997 | { | 2005 | { |
1998 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 2006 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
1999 | mSyncManager->slotSyncMenu( 999 ); | 2007 | mSyncManager->slotSyncMenu( 999 ); |
2000 | } | 2008 | } |
2001 | save(); | 2009 | |
2010 | setCaption(i18n("Saving Data to temp file ..." )); | ||
2011 | mView->saveCalendar( sentSyncFile() ); | ||
2012 | setCaption(i18n("Data saved to temp file!" )); | ||
2013 | |||
2002 | } | 2014 | } |
2003 | void MainWindow::getFile( bool success ) | 2015 | void MainWindow::getFile( bool success ) |
2004 | { | 2016 | { |
2005 | if ( ! success ) { | 2017 | if ( ! success ) { |
2006 | setCaption( i18n("Error receiving file. Nothing changed!") ); | 2018 | setCaption( i18n("Error receiving file. Nothing changed!") ); |
2007 | return; | 2019 | return; |
2008 | } | 2020 | } |
2009 | mView->openCalendar( defaultFileName() ); | 2021 | mView->openCalendar( sentSyncFile() ); |
2010 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 2022 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
2011 | mSyncManager->slotSyncMenu( 999 ); | 2023 | mSyncManager->slotSyncMenu( 999 ); |
2012 | } | 2024 | } |
2013 | setCaption( i18n("Pi-Sync successful!") ); | 2025 | setCaption( i18n("Pi-Sync successful!") ); |
2014 | } | 2026 | } |
2015 | 2027 | ||
2016 | void MainWindow::printSel( ) | 2028 | void MainWindow::printSel( ) |
2017 | { | 2029 | { |
2018 | mView->viewManager()->agendaView()->agenda()->printSelection(); | 2030 | mView->viewManager()->agendaView()->agenda()->printSelection(); |
2019 | } | 2031 | } |
2020 | 2032 | ||
2021 | void MainWindow::printCal() | 2033 | void MainWindow::printCal() |
2022 | { | 2034 | { |
2023 | mView->print();//mCp->showDialog(); | 2035 | mView->print();//mCp->showDialog(); |
2024 | } | 2036 | } |
2025 | 2037 | ||
2026 | 2038 | ||
2027 | #include "libkdepim/kdatepicker.h" | 2039 | #include "libkdepim/kdatepicker.h" |
2028 | #include <kdatetbl.h> | 2040 | #include <kdatetbl.h> |
2029 | void MainWindow::weekAction() | 2041 | void MainWindow::weekAction() |
2030 | { | 2042 | { |
2031 | int month; | 2043 | int month; |
2032 | KPopupFrame* popup = new KPopupFrame(this); | 2044 | KPopupFrame* popup = new KPopupFrame(this); |
2033 | KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup); | 2045 | KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup); |
2034 | // ----- | 2046 | // ----- |
2035 | picker->resize(picker->sizeHint()); | 2047 | picker->resize(picker->sizeHint()); |
2036 | popup->setMainWidget(picker); | 2048 | popup->setMainWidget(picker); |
2037 | picker->setFocus(); | 2049 | picker->setFocus(); |
2038 | connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); | 2050 | connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); |
2039 | int x = 0; | 2051 | int x = 0; |
2040 | int y = iconToolBar->height(); | 2052 | int y = iconToolBar->height(); |
2041 | int dX = 0; | 2053 | int dX = 0; |
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 5b9f903..5808700 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -74,64 +74,65 @@ class MainWindow : public QMainWindow | |||
74 | void processIncidenceSelection( Incidence * ); | 74 | void processIncidenceSelection( Incidence * ); |
75 | 75 | ||
76 | void importQtopia(); | 76 | void importQtopia(); |
77 | void importBday(); | 77 | void importBday(); |
78 | void importOL(); | 78 | void importOL(); |
79 | void importIcal(); | 79 | void importIcal(); |
80 | void importFile( QString, bool ); | 80 | void importFile( QString, bool ); |
81 | void quickImportIcal(); | 81 | void quickImportIcal(); |
82 | 82 | ||
83 | void slotModifiedChanged( bool ); | 83 | void slotModifiedChanged( bool ); |
84 | 84 | ||
85 | void save(); | 85 | void save(); |
86 | void saveStopTimer(); | 86 | void saveStopTimer(); |
87 | void configureToolBar( int ); | 87 | void configureToolBar( int ); |
88 | void printSel(); | 88 | void printSel(); |
89 | void printCal(); | 89 | void printCal(); |
90 | void saveCalendar(); | 90 | void saveCalendar(); |
91 | void loadCalendar(); | 91 | void loadCalendar(); |
92 | void exportVCalendar(); | 92 | void exportVCalendar(); |
93 | void fillFilterMenu(); | 93 | void fillFilterMenu(); |
94 | void selectFilter( int ); | 94 | void selectFilter( int ); |
95 | void exportToPhone( int ); | 95 | void exportToPhone( int ); |
96 | void toggleBeamReceive(); | 96 | void toggleBeamReceive(); |
97 | void disableBR(bool); | 97 | void disableBR(bool); |
98 | signals: | 98 | signals: |
99 | void selectWeek ( int ); | 99 | void selectWeek ( int ); |
100 | private slots: | 100 | private slots: |
101 | void showConfigureAgenda(); | 101 | void showConfigureAgenda(); |
102 | void getFile( bool ); | 102 | void getFile( bool ); |
103 | void syncFileRequest(); | 103 | void syncFileRequest(); |
104 | 104 | ||
105 | protected: | 105 | protected: |
106 | QString sentSyncFile(); | ||
106 | void displayText( QString, QString); | 107 | void displayText( QString, QString); |
107 | void enableIncidenceActions( bool ); | 108 | void enableIncidenceActions( bool ); |
108 | 109 | ||
109 | private: | 110 | private: |
110 | bool mBRdisabled; | 111 | bool mBRdisabled; |
111 | #ifndef DESKTOP_VERSION | 112 | #ifndef DESKTOP_VERSION |
112 | QCopChannel* infrared; | 113 | QCopChannel* infrared; |
113 | #endif | 114 | #endif |
114 | QAction* brAction; | 115 | QAction* brAction; |
115 | KSyncManager* mSyncManager; | 116 | KSyncManager* mSyncManager; |
116 | bool mClosed; | 117 | bool mClosed; |
117 | void saveOnClose(); | 118 | void saveOnClose(); |
118 | bool mFlagKeyPressed; | 119 | bool mFlagKeyPressed; |
119 | bool mBlockAtStartup; | 120 | bool mBlockAtStartup; |
120 | QPEToolBar *iconToolBar; | 121 | QPEToolBar *iconToolBar; |
121 | void initActions(); | 122 | void initActions(); |
122 | void setDefaultPreferences(); | 123 | void setDefaultPreferences(); |
123 | void keyPressEvent ( QKeyEvent * ) ; | 124 | void keyPressEvent ( QKeyEvent * ) ; |
124 | void keyReleaseEvent ( QKeyEvent * ) ; | 125 | void keyReleaseEvent ( QKeyEvent * ) ; |
125 | QPopupMenu *configureToolBarMenu; | 126 | QPopupMenu *configureToolBarMenu; |
126 | QPopupMenu *selectFilterMenu; | 127 | QPopupMenu *selectFilterMenu; |
127 | QPopupMenu *configureAgendaMenu, *syncMenu; | 128 | QPopupMenu *configureAgendaMenu, *syncMenu; |
128 | CalendarLocal *mCalendar; | 129 | CalendarLocal *mCalendar; |
129 | CalendarView *mView; | 130 | CalendarView *mView; |
130 | QAction *mNewSubTodoAction; | 131 | QAction *mNewSubTodoAction; |
131 | QAction *mWeekAction; | 132 | QAction *mWeekAction; |
132 | QFont mWeekFont; | 133 | QFont mWeekFont; |
133 | QPixmap mWeekPixmap; | 134 | QPixmap mWeekPixmap; |
134 | QColor mWeekBgColor; | 135 | QColor mWeekBgColor; |
135 | 136 | ||
136 | QAction *mShowAction; | 137 | QAction *mShowAction; |
137 | QAction *mEditAction; | 138 | QAction *mEditAction; |
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 9177f63..c8d0e0d 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp | |||
@@ -43,74 +43,78 @@ | |||
43 | #include <qtimer.h> | 43 | #include <qtimer.h> |
44 | #include <qmessagebox.h> | 44 | #include <qmessagebox.h> |
45 | #include <qapplication.h> | 45 | #include <qapplication.h> |
46 | #include <qlineedit.h> | 46 | #include <qlineedit.h> |
47 | #include <qdialog.h> | 47 | #include <qdialog.h> |
48 | #include <qlayout.h> | 48 | #include <qlayout.h> |
49 | #include <qtextcodec.h> | 49 | #include <qtextcodec.h> |
50 | #include <qlabel.h> | 50 | #include <qlabel.h> |
51 | #include <qcheckbox.h> | 51 | #include <qcheckbox.h> |
52 | 52 | ||
53 | #include <klocale.h> | 53 | #include <klocale.h> |
54 | #include <kglobal.h> | 54 | #include <kglobal.h> |
55 | #include <kconfig.h> | 55 | #include <kconfig.h> |
56 | #include <kfiledialog.h> | 56 | #include <kfiledialog.h> |
57 | 57 | ||
58 | QDateTime KSyncManager::mRequestedSyncEvent; | 58 | QDateTime KSyncManager::mRequestedSyncEvent; |
59 | 59 | ||
60 | 60 | ||
61 | KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu) | 61 | KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu) |
62 | : QObject(), mPrefs(prefs ), mParent(parent),mImplementation(implementation), mTargetApp(ta), mSyncMenu(syncmenu) | 62 | : QObject(), mPrefs(prefs ), mParent(parent),mImplementation(implementation), mTargetApp(ta), mSyncMenu(syncmenu) |
63 | { | 63 | { |
64 | mServerSocket = 0; | 64 | mServerSocket = 0; |
65 | bar = new QProgressBar ( 1, 0 ); | 65 | bar = new QProgressBar ( 1, 0 ); |
66 | bar->setCaption (""); | 66 | bar->setCaption (""); |
67 | mWriteBackInPast = 2; | 67 | mWriteBackInPast = 2; |
68 | int w = 300; | 68 | int w = 300; |
69 | if ( QApplication::desktop()->width() < 320 ) | 69 | if ( QApplication::desktop()->width() < 320 ) |
70 | w = 220; | 70 | w = 220; |
71 | int h = bar->sizeHint().height() ; | 71 | int h = bar->sizeHint().height() ; |
72 | int dw = QApplication::desktop()->width(); | 72 | int dw = QApplication::desktop()->width(); |
73 | int dh = QApplication::desktop()->height(); | 73 | int dh = QApplication::desktop()->height(); |
74 | bar->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 74 | bar->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
75 | if ( mPrefs->mPassiveSyncAutoStart ) | ||
76 | enableQuick( false ); | ||
77 | 75 | ||
78 | } | 76 | } |
79 | 77 | ||
80 | KSyncManager::~KSyncManager() | 78 | KSyncManager::~KSyncManager() |
81 | { | 79 | { |
82 | delete bar; | 80 | delete bar; |
83 | } | 81 | } |
84 | 82 | ||
83 | void KSyncManager::setDefaultFileName( QString s) | ||
84 | { | ||
85 | mDefFileName = s ; | ||
86 | if ( mPrefs->mPassiveSyncAutoStart ) | ||
87 | enableQuick( false ); | ||
88 | } | ||
85 | 89 | ||
86 | void KSyncManager::fillSyncMenu() | 90 | void KSyncManager::fillSyncMenu() |
87 | { | 91 | { |
88 | if ( mSyncMenu->count() ) | 92 | if ( mSyncMenu->count() ) |
89 | mSyncMenu->clear(); | 93 | mSyncMenu->clear(); |
90 | 94 | ||
91 | mSyncMenu->insertItem( i18n("Configure..."), 0 ); | 95 | mSyncMenu->insertItem( i18n("Configure..."), 0 ); |
92 | mSyncMenu->insertSeparator(); | 96 | mSyncMenu->insertSeparator(); |
93 | QPopupMenu *clearMenu = new QPopupMenu ( mSyncMenu ); | 97 | QPopupMenu *clearMenu = new QPopupMenu ( mSyncMenu ); |
94 | mSyncMenu->insertItem( i18n("Remove sync info"),clearMenu, 5000 ); | 98 | mSyncMenu->insertItem( i18n("Remove sync info"),clearMenu, 5000 ); |
95 | clearMenu->insertItem( i18n("For all profiles"), 1 ); | 99 | clearMenu->insertItem( i18n("For all profiles"), 1 ); |
96 | clearMenu->insertSeparator(); | 100 | clearMenu->insertSeparator(); |
97 | connect ( clearMenu, SIGNAL( activated ( int ) ), this, SLOT (slotClearMenu( int ) ) ); | 101 | connect ( clearMenu, SIGNAL( activated ( int ) ), this, SLOT (slotClearMenu( int ) ) ); |
98 | mSyncMenu->insertSeparator(); | 102 | mSyncMenu->insertSeparator(); |
99 | if ( mServerSocket == 0 ) { | 103 | if ( mServerSocket == 0 ) { |
100 | mSyncMenu->insertItem( i18n("Enable Pi-Sync"), 2 ); | 104 | mSyncMenu->insertItem( i18n("Enable Pi-Sync"), 2 ); |
101 | } else { | 105 | } else { |
102 | mSyncMenu->insertItem( i18n("Disable Pi-Sync"), 3 ); | 106 | mSyncMenu->insertItem( i18n("Disable Pi-Sync"), 3 ); |
103 | } | 107 | } |
104 | mSyncMenu->insertSeparator(); | 108 | mSyncMenu->insertSeparator(); |
105 | mSyncMenu->insertItem( i18n("Multiple sync"), 1 ); | 109 | mSyncMenu->insertItem( i18n("Multiple sync"), 1 ); |
106 | mSyncMenu->insertSeparator(); | 110 | mSyncMenu->insertSeparator(); |
107 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); | 111 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); |
108 | config.setGroup("General"); | 112 | config.setGroup("General"); |
109 | QStringList prof = config.readListEntry("SyncProfileNames"); | 113 | QStringList prof = config.readListEntry("SyncProfileNames"); |
110 | mLocalMachineName = config.readEntry("LocalMachineName","undefined"); | 114 | mLocalMachineName = config.readEntry("LocalMachineName","undefined"); |
111 | if ( prof.count() < 2 ) { | 115 | if ( prof.count() < 2 ) { |
112 | prof.clear(); | 116 | prof.clear(); |
113 | QString externalName; | 117 | QString externalName; |
114 | #ifdef DESKTOP_VERSION | 118 | #ifdef DESKTOP_VERSION |
115 | #ifdef _WIN32_ | 119 | #ifdef _WIN32_ |
116 | externalName = "OutLook(not_implemented)"; | 120 | externalName = "OutLook(not_implemented)"; |
@@ -383,65 +387,64 @@ void KSyncManager::enableQuick( bool ask ) | |||
383 | if ( ! dia.exec() ) | 387 | if ( ! dia.exec() ) |
384 | return; | 388 | return; |
385 | dia.hide(); | 389 | dia.hide(); |
386 | qApp->processEvents(); | 390 | qApp->processEvents(); |
387 | if ( mPrefs->mPassiveSyncPw != lepw.text() ) { | 391 | if ( mPrefs->mPassiveSyncPw != lepw.text() ) { |
388 | changed = true; | 392 | changed = true; |
389 | mPrefs->mPassiveSyncPw = lepw.text(); | 393 | mPrefs->mPassiveSyncPw = lepw.text(); |
390 | } | 394 | } |
391 | if ( mPrefs->mPassiveSyncPort != lab.text() ) { | 395 | if ( mPrefs->mPassiveSyncPort != lab.text() ) { |
392 | mPrefs->mPassiveSyncPort = lab.text(); | 396 | mPrefs->mPassiveSyncPort = lab.text(); |
393 | changed = true; | 397 | changed = true; |
394 | } | 398 | } |
395 | autoStart = autostart.isChecked(); | 399 | autoStart = autostart.isChecked(); |
396 | if (mPrefs->mPassiveSyncWithDesktop != syncdesktop.isChecked() ) { | 400 | if (mPrefs->mPassiveSyncWithDesktop != syncdesktop.isChecked() ) { |
397 | changed = true; | 401 | changed = true; |
398 | mPrefs->mPassiveSyncWithDesktop = syncdesktop.isChecked(); | 402 | mPrefs->mPassiveSyncWithDesktop = syncdesktop.isChecked(); |
399 | } | 403 | } |
400 | } | 404 | } |
401 | else | 405 | else |
402 | autoStart = mPrefs->mPassiveSyncAutoStart; | 406 | autoStart = mPrefs->mPassiveSyncAutoStart; |
403 | if ( autoStart != mPrefs->mPassiveSyncAutoStart ) | 407 | if ( autoStart != mPrefs->mPassiveSyncAutoStart ) |
404 | changed = true; | 408 | changed = true; |
405 | bool ok; | 409 | bool ok; |
406 | mPrefs->mPassiveSyncAutoStart = false; | 410 | mPrefs->mPassiveSyncAutoStart = false; |
407 | Q_UINT16 port = mPrefs->mPassiveSyncPort.toUInt(&ok); | 411 | Q_UINT16 port = mPrefs->mPassiveSyncPort.toUInt(&ok); |
408 | if ( ! ok ) { | 412 | if ( ! ok ) { |
409 | KMessageBox::information( 0, i18n("No valid port")); | 413 | KMessageBox::information( 0, i18n("No valid port")); |
410 | return; | 414 | return; |
411 | } | 415 | } |
412 | //qDebug("port %d ", port); | 416 | //qDebug("port %d ", port); |
413 | mServerSocket = new KServerSocket ( mPrefs->mPassiveSyncPw, port ,1 ); | 417 | mServerSocket = new KServerSocket ( mPrefs->mPassiveSyncPw, port ,1 ); |
414 | mServerSocket->setFileName( defaultFileName() );//bbb | 418 | mServerSocket->setFileName( defaultFileName() );//bbb |
415 | //qDebug("connected "); | ||
416 | if ( !mServerSocket->ok() ) { | 419 | if ( !mServerSocket->ok() ) { |
417 | KMessageBox::information( 0, i18n("Failed to bind or\nlisten to the port!")); | 420 | KMessageBox::information( 0, i18n("Failed to bind or\nlisten to the port!")); |
418 | delete mServerSocket; | 421 | delete mServerSocket; |
419 | mServerSocket = 0; | 422 | mServerSocket = 0; |
420 | return; | 423 | return; |
421 | } | 424 | } |
422 | mPrefs->mPassiveSyncAutoStart = autoStart; | 425 | mPrefs->mPassiveSyncAutoStart = autoStart; |
423 | if ( changed ) { | 426 | if ( changed ) { |
424 | mPrefs->writeConfig(); | 427 | mPrefs->writeConfig(); |
425 | } | 428 | } |
426 | connect( mServerSocket, SIGNAL ( request_file() ),this, SIGNAL ( request_file() ) ); | 429 | connect( mServerSocket, SIGNAL ( request_file() ),this, SIGNAL ( request_file() ) ); |
427 | connect( mServerSocket, SIGNAL ( file_received( bool ) ), this, SIGNAL ( getFile( bool ) ) ); | 430 | connect( mServerSocket, SIGNAL ( file_received( bool ) ), this, SIGNAL ( getFile( bool ) ) ); |
428 | } | 431 | } |
429 | 432 | ||
430 | void KSyncManager::syncLocalFile() | 433 | void KSyncManager::syncLocalFile() |
431 | { | 434 | { |
432 | 435 | ||
433 | QString fn =mPrefs->mLastSyncedLocalFile; | 436 | QString fn =mPrefs->mLastSyncedLocalFile; |
434 | QString ext; | 437 | QString ext; |
435 | 438 | ||
436 | switch(mTargetApp) | 439 | switch(mTargetApp) |
437 | { | 440 | { |
438 | case (KAPI): | 441 | case (KAPI): |
439 | ext = "(*.vcf)"; | 442 | ext = "(*.vcf)"; |
440 | break; | 443 | break; |
441 | case (KOPI): | 444 | case (KOPI): |
442 | ext = "(*.ics/*.vcs)"; | 445 | ext = "(*.ics/*.vcs)"; |
443 | break; | 446 | break; |
444 | case (PWMPI): | 447 | case (PWMPI): |
445 | ext = "(*.pwm)"; | 448 | ext = "(*.pwm)"; |
446 | break; | 449 | break; |
447 | default: | 450 | default: |
@@ -1088,65 +1091,65 @@ void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state) | |||
1088 | mPisyncFinished = true; | 1091 | mPisyncFinished = true; |
1089 | } | 1092 | } |
1090 | 1093 | ||
1091 | delete s; | 1094 | delete s; |
1092 | } | 1095 | } |
1093 | 1096 | ||
1094 | void KSyncManager::readFileFromSocket() | 1097 | void KSyncManager::readFileFromSocket() |
1095 | { | 1098 | { |
1096 | QString fileName = syncFileName(); | 1099 | QString fileName = syncFileName(); |
1097 | mParent->topLevelWidget()->setCaption( i18n("Remote file saved to temp file.") ); | 1100 | mParent->topLevelWidget()->setCaption( i18n("Remote file saved to temp file.") ); |
1098 | if ( ! syncWithFile( fileName , true ) ) { | 1101 | if ( ! syncWithFile( fileName , true ) ) { |
1099 | mParent->topLevelWidget()->setCaption( i18n("Syncing failed.") ); | 1102 | mParent->topLevelWidget()->setCaption( i18n("Syncing failed.") ); |
1100 | mPisyncFinished = true; | 1103 | mPisyncFinished = true; |
1101 | return; | 1104 | return; |
1102 | } | 1105 | } |
1103 | KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this, mParent->topLevelWidget() ); | 1106 | KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this, mParent->topLevelWidget() ); |
1104 | connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int)), this, SLOT(deleteCommandSocket(KCommandSocket*, int )) ); | 1107 | connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int)), this, SLOT(deleteCommandSocket(KCommandSocket*, int )) ); |
1105 | if ( mWriteBackFile ) | 1108 | if ( mWriteBackFile ) |
1106 | commandSocket->writeFile( fileName ); | 1109 | commandSocket->writeFile( fileName ); |
1107 | else { | 1110 | else { |
1108 | commandSocket->sendStop(); | 1111 | commandSocket->sendStop(); |
1109 | mParent->topLevelWidget()->setCaption( i18n("Pi-Sync succesful!") ); | 1112 | mParent->topLevelWidget()->setCaption( i18n("Pi-Sync succesful!") ); |
1110 | mPisyncFinished = true; | 1113 | mPisyncFinished = true; |
1111 | } | 1114 | } |
1112 | } | 1115 | } |
1113 | 1116 | ||
1114 | KServerSocket:: KServerSocket ( QString pw, Q_UINT16 port, int backlog, QObject * parent, const char * name ) : QServerSocket( port, backlog, parent, name ) | 1117 | KServerSocket:: KServerSocket ( QString pw, Q_UINT16 port, int backlog, QObject * parent, const char * name ) : QServerSocket( port, backlog, parent, name ) |
1115 | { | 1118 | { |
1116 | mPassWord = pw; | 1119 | mPassWord = pw; |
1117 | mSocket = 0; | 1120 | mSocket = 0; |
1118 | mSyncActionDialog = 0; | 1121 | mSyncActionDialog = 0; |
1119 | blockRC = false; | 1122 | blockRC = false; |
1120 | }; | 1123 | } |
1121 | 1124 | ||
1122 | void KServerSocket::newConnection ( int socket ) | 1125 | void KServerSocket::newConnection ( int socket ) |
1123 | { | 1126 | { |
1124 | // qDebug("KServerSocket:New connection %d ", socket); | 1127 | // qDebug("KServerSocket:New connection %d ", socket); |
1125 | if ( mSocket ) { | 1128 | if ( mSocket ) { |
1126 | qDebug("KSS::newConnection Socket deleted! "); | 1129 | qDebug("KSS::newConnection Socket deleted! "); |
1127 | delete mSocket; | 1130 | delete mSocket; |
1128 | mSocket = 0; | 1131 | mSocket = 0; |
1129 | } | 1132 | } |
1130 | mSocket = new QSocket( this ); | 1133 | mSocket = new QSocket( this ); |
1131 | connect( mSocket , SIGNAL(readyRead()), this, SLOT(readClient()) ); | 1134 | connect( mSocket , SIGNAL(readyRead()), this, SLOT(readClient()) ); |
1132 | connect( mSocket , SIGNAL(delayedCloseFinished()), this, SLOT(discardClient()) ); | 1135 | connect( mSocket , SIGNAL(delayedCloseFinished()), this, SLOT(discardClient()) ); |
1133 | mSocket->setSocket( socket ); | 1136 | mSocket->setSocket( socket ); |
1134 | } | 1137 | } |
1135 | 1138 | ||
1136 | void KServerSocket::discardClient() | 1139 | void KServerSocket::discardClient() |
1137 | { | 1140 | { |
1138 | //qDebug(" KServerSocket::discardClient()"); | 1141 | //qDebug(" KServerSocket::discardClient()"); |
1139 | if ( mSocket ) { | 1142 | if ( mSocket ) { |
1140 | delete mSocket; | 1143 | delete mSocket; |
1141 | mSocket = 0; | 1144 | mSocket = 0; |
1142 | } | 1145 | } |
1143 | //emit endConnect(); | 1146 | //emit endConnect(); |
1144 | } | 1147 | } |
1145 | void KServerSocket::readClient() | 1148 | void KServerSocket::readClient() |
1146 | { | 1149 | { |
1147 | if ( blockRC ) | 1150 | if ( blockRC ) |
1148 | return; | 1151 | return; |
1149 | if ( mSocket == 0 ) { | 1152 | if ( mSocket == 0 ) { |
1150 | qDebug("ERROR::KSS::readClient(): mSocket == 0 "); | 1153 | qDebug("ERROR::KSS::readClient(): mSocket == 0 "); |
1151 | return; | 1154 | return; |
1152 | } | 1155 | } |
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index 9a3066e..09bd1c1 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h | |||
@@ -92,65 +92,65 @@ class KCommandSocket : public QObject | |||
92 | void writeFileToSocket(); | 92 | void writeFileToSocket(); |
93 | private : | 93 | private : |
94 | QWidget* tlw; | 94 | QWidget* tlw; |
95 | QSocket* mSocket; | 95 | QSocket* mSocket; |
96 | QString mPassWord; | 96 | QString mPassWord; |
97 | Q_UINT16 mPort; | 97 | Q_UINT16 mPort; |
98 | QString mHost; | 98 | QString mHost; |
99 | QString mFileName; | 99 | QString mFileName; |
100 | QTimer* mTimerSocket; | 100 | QTimer* mTimerSocket; |
101 | int mRetVal; | 101 | int mRetVal; |
102 | QTime mTime; | 102 | QTime mTime; |
103 | QString mFileString; | 103 | QString mFileString; |
104 | bool mFirst; | 104 | bool mFirst; |
105 | }; | 105 | }; |
106 | 106 | ||
107 | 107 | ||
108 | class KSyncManager : public QObject | 108 | class KSyncManager : public QObject |
109 | { | 109 | { |
110 | Q_OBJECT | 110 | Q_OBJECT |
111 | 111 | ||
112 | public: | 112 | public: |
113 | enum TargetApp { | 113 | enum TargetApp { |
114 | KOPI = 0, | 114 | KOPI = 0, |
115 | KAPI = 1, | 115 | KAPI = 1, |
116 | PWMPI = 2 }; | 116 | PWMPI = 2 }; |
117 | 117 | ||
118 | KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); | 118 | KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); |
119 | ~KSyncManager() ; | 119 | ~KSyncManager() ; |
120 | 120 | ||
121 | void multiSync( bool askforPrefs ); | 121 | void multiSync( bool askforPrefs ); |
122 | bool blockSave() { return mBlockSaveFlag; } | 122 | bool blockSave() { return mBlockSaveFlag; } |
123 | void setBlockSave(bool sa) { mBlockSaveFlag = sa; } | 123 | void setBlockSave(bool sa) { mBlockSaveFlag = sa; } |
124 | void setDefaultFileName( QString s) { mDefFileName = s ;} | 124 | void setDefaultFileName( QString s) ; |
125 | QString defaultFileName() { return mDefFileName ;} | 125 | QString defaultFileName() { return mDefFileName ;} |
126 | QString syncFileName(); | 126 | QString syncFileName(); |
127 | void enableQuick( bool ask = true); | 127 | void enableQuick( bool ask = true); |
128 | 128 | ||
129 | bool syncWithDesktop () { return mSyncWithDesktop;} | 129 | bool syncWithDesktop () { return mSyncWithDesktop;} |
130 | QString getCurrentSyncDevice() { return mCurrentSyncDevice; } | 130 | QString getCurrentSyncDevice() { return mCurrentSyncDevice; } |
131 | QString getCurrentSyncName() { return mCurrentSyncName; } | 131 | QString getCurrentSyncName() { return mCurrentSyncName; } |
132 | 132 | ||
133 | void showProgressBar(int percentage, QString caption = QString::null, int total=100); | 133 | void showProgressBar(int percentage, QString caption = QString::null, int total=100); |
134 | void hideProgressBar(); | 134 | void hideProgressBar(); |
135 | bool isProgressBarCanceled(); | 135 | bool isProgressBarCanceled(); |
136 | 136 | ||
137 | // sync stuff | 137 | // sync stuff |
138 | QString mLocalMachineName; | 138 | QString mLocalMachineName; |
139 | QStringList mExternSyncProfiles; | 139 | QStringList mExternSyncProfiles; |
140 | QStringList mSyncProfileNames; | 140 | QStringList mSyncProfileNames; |
141 | bool mAskForPreferences; | 141 | bool mAskForPreferences; |
142 | bool mShowSyncSummary; | 142 | bool mShowSyncSummary; |
143 | bool mIsKapiFile; | 143 | bool mIsKapiFile; |
144 | bool mWriteBackExistingOnly; | 144 | bool mWriteBackExistingOnly; |
145 | int mSyncAlgoPrefs; | 145 | int mSyncAlgoPrefs; |
146 | bool mWriteBackFile; | 146 | bool mWriteBackFile; |
147 | int mWriteBackInFuture; | 147 | int mWriteBackInFuture; |
148 | int mWriteBackInPast; | 148 | int mWriteBackInPast; |
149 | QString mPhoneDevice; | 149 | QString mPhoneDevice; |
150 | QString mPhoneConnection; | 150 | QString mPhoneConnection; |
151 | QString mPhoneModel; | 151 | QString mPhoneModel; |
152 | QString mPassWordPiSync; | 152 | QString mPassWordPiSync; |
153 | QString mActiveSyncPort; | 153 | QString mActiveSyncPort; |
154 | QString mActiveSyncIP ; | 154 | QString mActiveSyncIP ; |
155 | QString mFilterInCal; | 155 | QString mFilterInCal; |
156 | QString mFilterOutCal; | 156 | QString mFilterOutCal; |