author | zautrix <zautrix> | 2004-10-20 09:45:16 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-20 09:45:16 (UTC) |
commit | b3662915cb2c966ed7b5c563b8e840ae5b82d4e6 (patch) (side-by-side diff) | |
tree | bc09d046e1d47fe94acb538af88458f716993dfc /korganizer/mainwindow.cpp | |
parent | 40eaafc9e008dc004b6ebc65fae8d89c8883ee8b (diff) | |
download | kdepimpi-b3662915cb2c966ed7b5c563b8e840ae5b82d4e6.zip kdepimpi-b3662915cb2c966ed7b5c563b8e840ae5b82d4e6.tar.gz kdepimpi-b3662915cb2c966ed7b5c563b8e840ae5b82d4e6.tar.bz2 |
fixed br for kopi
-rw-r--r-- | korganizer/mainwindow.cpp | 59 |
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) : SLOT( slotModifiedChanged( bool ) ) ); + connect( mView, SIGNAL( tempDisableBR(bool) ), + SLOT( disableBR(bool) ) ); connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); mView->setModified( false ); mBlockAtStartup = false; @@ -273,7 +275,12 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : #ifndef DESKTOP_VERSION connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); #endif - +#ifndef DESKTOP_VERSION + infrared = 0; +#endif + + mBRdisabled = false; + toggleBeamReceive(); } MainWindow::~MainWindow() { @@ -281,8 +288,52 @@ MainWindow::~MainWindow() //save toolbar location delete mCalendar; delete mSyncManager; + if ( infrared ) + delete infrared; + + +} + +void MainWindow::disableBR(bool b) +{ + if ( b ) { + if ( infrared ) { + toggleBeamReceive(); + mBRdisabled = true; + } + } else { + if ( mBRdisabled ) { + mBRdisabled = false; + toggleBeamReceive(); + } + } +} +bool MainWindow::beamReceiveEnabled() +{ +#ifndef DESKTOP_VERSION + return ( infrared != 0 ); +#endif + return false; +} +void MainWindow::toggleBeamReceive() +{ + if ( mBRdisabled ) + return; +#ifndef DESKTOP_VERSION + if ( infrared ) { + qDebug("disable BeamReceive "); + delete infrared; + infrared = 0; + brAction->setOn(false); + return; + } + qDebug("enable BeamReceive "); + brAction->setOn(true); + infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; + QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); +#endif } void MainWindow::showMaximized () { @@ -751,6 +802,12 @@ void MainWindow::initActions() connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); #ifndef DESKTOP_VERSION importMenu->insertSeparator(); + brAction = new QAction( "beam toggle", i18n("Beam receice enabled"), 0, + this ); + brAction->addTo( importMenu ); + brAction->setToggleAction (true ) ; + connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); + action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, this ); action->addTo( importMenu ); |