author | zautrix <zautrix> | 2004-10-20 09:45:16 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-20 09:45:16 (UTC) |
commit | b3662915cb2c966ed7b5c563b8e840ae5b82d4e6 (patch) (unidiff) | |
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 | |||
@@ -228,24 +228,26 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
228 | if ( KOPrefs::instance()->mLanguageChanged ) { | 228 | if ( KOPrefs::instance()->mLanguageChanged ) { |
229 | KOPrefs::instance()->setCategoryDefaults(); | 229 | KOPrefs::instance()->setCategoryDefaults(); |
230 | int count = mView->addCategories(); | 230 | int count = mView->addCategories(); |
231 | KOPrefs::instance()->mLanguageChanged = false; | 231 | KOPrefs::instance()->mLanguageChanged = false; |
232 | } | 232 | } |
233 | processIncidenceSelection( 0 ); | 233 | processIncidenceSelection( 0 ); |
234 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), | 234 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), |
235 | SLOT( processIncidenceSelection( Incidence * ) ) ); | 235 | SLOT( processIncidenceSelection( Incidence * ) ) ); |
236 | connect( mView, SIGNAL( modifiedChanged( bool ) ), | 236 | connect( mView, SIGNAL( modifiedChanged( bool ) ), |
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; |
243 | mView->setModified( false ); | 245 | mView->setModified( false ); |
244 | setCentralWidget( mView ); | 246 | setCentralWidget( mView ); |
245 | globalFlagBlockStartup = 0; | 247 | globalFlagBlockStartup = 0; |
246 | mView->show(); | 248 | mView->show(); |
247 | delete splash; | 249 | delete splash; |
248 | if ( newFile ) | 250 | if ( newFile ) |
249 | mView->updateConfig(); | 251 | mView->updateConfig(); |
250 | // qApp->processEvents(); | 252 | // qApp->processEvents(); |
251 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 253 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
@@ -264,34 +266,83 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
264 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); | 266 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); |
265 | if ( showWarning ) { | 267 | if ( showWarning ) { |
266 | KMessageBox::information( this, | 268 | KMessageBox::information( this, |
267 | "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"); | 269 | "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"); |
268 | qApp->processEvents(); | 270 | qApp->processEvents(); |
269 | mView->dialogManager()->showSyncOptions(); | 271 | mView->dialogManager()->showSyncOptions(); |
270 | } | 272 | } |
271 | 273 | ||
272 | //US listen for result adressed from Ka/Pi | 274 | //US listen for result adressed from Ka/Pi |
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 | } |
278 | MainWindow::~MainWindow() | 285 | MainWindow::~MainWindow() |
279 | { | 286 | { |
280 | //qDebug("MainWindow::~MainWindow() "); | 287 | //qDebug("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 | |||
297 | void 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 | } | ||
312 | bool MainWindow::beamReceiveEnabled() | ||
313 | { | ||
314 | #ifndef DESKTOP_VERSION | ||
315 | return ( infrared != 0 ); | ||
316 | #endif | ||
317 | return false; | ||
318 | } | ||
285 | 319 | ||
320 | void 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 | } |
287 | void MainWindow::showMaximized () | 338 | void MainWindow::showMaximized () |
288 | { | 339 | { |
289 | #ifndef DESKTOP_VERSION | 340 | #ifndef DESKTOP_VERSION |
290 | if ( ! globalFlagBlockStartup ) | 341 | if ( ! globalFlagBlockStartup ) |
291 | if ( mClosed ) | 342 | if ( mClosed ) |
292 | mView->goToday(); | 343 | mView->goToday(); |
293 | #endif | 344 | #endif |
294 | QWidget::showMaximized () ; | 345 | QWidget::showMaximized () ; |
295 | mClosed = false; | 346 | mClosed = false; |
296 | } | 347 | } |
297 | void MainWindow::closeEvent( QCloseEvent* ce ) | 348 | void MainWindow::closeEvent( QCloseEvent* ce ) |
@@ -742,24 +793,30 @@ void MainWindow::initActions() | |||
742 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 793 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
743 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 794 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
744 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); | 795 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); |
745 | importMenu->insertItem( i18n("Export to phone"), ex2phone ); | 796 | importMenu->insertItem( i18n("Export to phone"), ex2phone ); |
746 | 797 | ||
747 | importMenu->insertSeparator(); | 798 | importMenu->insertSeparator(); |
748 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, | 799 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, |
749 | this ); | 800 | this ); |
750 | action->addTo( importMenu ); | 801 | action->addTo( importMenu ); |
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 ); |
757 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); | 814 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); |
758 | 815 | ||
759 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, | 816 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, |
760 | this ); | 817 | this ); |
761 | action->addTo( importMenu ); | 818 | action->addTo( importMenu ); |
762 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); | 819 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); |
763 | #else | 820 | #else |
764 | importMenu->insertSeparator(); | 821 | importMenu->insertSeparator(); |
765 | icon = loadPixmap( pathString + "print" ); | 822 | icon = loadPixmap( pathString + "print" ); |