summaryrefslogtreecommitdiffabout
path: root/korganizer/mainwindow.cpp
Unidiff
Diffstat (limited to 'korganizer/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp59
1 files changed, 58 insertions, 1 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 02ca523..9e215b9 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -237,6 +237,8 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
237 SLOT( slotModifiedChanged( bool ) ) ); 237 SLOT( slotModifiedChanged( bool ) ) );
238 238
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() ) );
241 mView->setModified( false ); 243 mView->setModified( false );
242 mBlockAtStartup = false; 244 mBlockAtStartup = false;
@@ -273,7 +275,12 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
273#ifndef DESKTOP_VERSION 275#ifndef DESKTOP_VERSION
274 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 276 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
275#endif 277#endif
276 278#ifndef DESKTOP_VERSION
279 infrared = 0;
280#endif
281
282 mBRdisabled = false;
283 toggleBeamReceive();
277} 284}
278MainWindow::~MainWindow() 285MainWindow::~MainWindow()
279{ 286{
@@ -281,8 +288,52 @@ MainWindow::~MainWindow()
281 //save toolbar location 288 //save toolbar location
282 delete mCalendar; 289 delete mCalendar;
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}
287void MainWindow::showMaximized () 338void MainWindow::showMaximized ()
288{ 339{
@@ -751,6 +802,12 @@ void MainWindow::initActions()
751 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); 802 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) );
752#ifndef DESKTOP_VERSION 803#ifndef DESKTOP_VERSION
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,
755 this ); 812 this );
756 action->addTo( importMenu ); 813 action->addTo( importMenu );