summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp8
-rw-r--r--korganizer/calendarview.h1
-rw-r--r--korganizer/main.cpp6
-rw-r--r--korganizer/mainwindow.cpp59
-rw-r--r--korganizer/mainwindow.h12
5 files changed, 77 insertions, 9 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 884c61a..0306e07 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1236,2 +1236,3 @@ void CalendarView::syncExternal( int mode )
1236 PhoneFormat* phoneFormat = 0; 1236 PhoneFormat* phoneFormat = 0;
1237 emit tempDisableBR(true);
1237#ifndef DESKTOP_VERSION 1238#ifndef DESKTOP_VERSION
@@ -1251,4 +1252,6 @@ void CalendarView::syncExternal( int mode )
1251 1252
1252 } else 1253 } else {
1253 return; 1254 emit tempDisableBR(false);
1255 return;
1256 }
1254 if ( loadSuccess ) { 1257 if ( loadSuccess ) {
@@ -1305,2 +1308,3 @@ void CalendarView::syncExternal( int mode )
1305 updateView(); 1308 updateView();
1309 emit tempDisableBR(false);
1306 return ;//syncOK; 1310 return ;//syncOK;
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 1cd896d..2818ee9 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -119,2 +119,3 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
119 signals: 119 signals:
120 void tempDisableBR(bool);
120 /** This todo has been modified */ 121 /** This todo has been modified */
diff --git a/korganizer/main.cpp b/korganizer/main.cpp
index 16186c0..c8a55d2 100644
--- a/korganizer/main.cpp
+++ b/korganizer/main.cpp
@@ -82,4 +82,3 @@ int main( int argc, char **argv )
82#ifndef DESKTOP_VERSION 82#ifndef DESKTOP_VERSION
83 QCopChannel* c1 = new QCopChannel("QPE/Application/datebook",&m, "channel" ) ; 83
84 QObject::connect( c1, SIGNAL (received ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& )));
85 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); 84 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& )));
@@ -101,5 +100,2 @@ int main( int argc, char **argv )
101 a.exec(); 100 a.exec();
102#ifndef DESKTOP_VERSION
103 delete c1;
104#endif
105 101
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 02ca523..9e215b9 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -239,2 +239,4 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
239 239
240 connect( mView, SIGNAL( tempDisableBR(bool) ),
241 SLOT( disableBR(bool) ) );
240 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); 242 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) );
@@ -275,3 +277,8 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
275#endif 277#endif
276 278#ifndef DESKTOP_VERSION
279 infrared = 0;
280#endif
281
282 mBRdisabled = false;
283 toggleBeamReceive();
277} 284}
@@ -283,4 +290,48 @@ MainWindow::~MainWindow()
283 delete mSyncManager; 290 delete mSyncManager;
291 if ( infrared )
292 delete infrared;
293
294
295}
296
297void MainWindow::disableBR(bool b)
298{
299 if ( b ) {
300 if ( infrared ) {
301 toggleBeamReceive();
302 mBRdisabled = true;
303 }
304 } else {
305 if ( mBRdisabled ) {
306 mBRdisabled = false;
307 toggleBeamReceive();
308 }
309 }
284 310
311}
312bool MainWindow::beamReceiveEnabled()
313{
314#ifndef DESKTOP_VERSION
315 return ( infrared != 0 );
316#endif
317 return false;
318}
285 319
320void MainWindow::toggleBeamReceive()
321{
322 if ( mBRdisabled )
323 return;
324#ifndef DESKTOP_VERSION
325 if ( infrared ) {
326 qDebug("disable BeamReceive ");
327 delete infrared;
328 infrared = 0;
329 brAction->setOn(false);
330 return;
331 }
332 qDebug("enable BeamReceive ");
333 brAction->setOn(true);
334 infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ;
335 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& )));
336#endif
286} 337}
@@ -753,2 +804,8 @@ void MainWindow::initActions()
753 importMenu->insertSeparator(); 804 importMenu->insertSeparator();
805 brAction = new QAction( "beam toggle", i18n("Beam receice enabled"), 0,
806 this );
807 brAction->addTo( importMenu );
808 brAction->setToggleAction (true ) ;
809 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) );
810
754 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, 811 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0,
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index e3383ed..0926313 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -13,3 +13,5 @@
13#include <ksyncmanager.h> 13#include <ksyncmanager.h>
14 14#ifndef DESKTOP_VERSION
15#include <qcopchannel_qws.h>
16#endif
15class QAction; 17class QAction;
@@ -37,2 +39,3 @@ class MainWindow : public QMainWindow
37 ~MainWindow(); 39 ~MainWindow();
40 bool beamReceiveEnabled();
38 public slots: 41 public slots:
@@ -78,2 +81,4 @@ class MainWindow : public QMainWindow
78 void exportToPhone( int ); 81 void exportToPhone( int );
82 void toggleBeamReceive();
83 void disableBR(bool);
79 84
@@ -93,2 +98,7 @@ class MainWindow : public QMainWindow
93 private: 98 private:
99 bool mBRdisabled;
100#ifndef DESKTOP_VERSION
101 QCopChannel* infrared;
102#endif
103 QAction* brAction;
94 KSyncManager* mSyncManager; 104 KSyncManager* mSyncManager;