Diffstat (limited to 'core/pim/datebook/datebook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/datebook.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp index c0d45c9..7dd93a6 100644 --- a/core/pim/datebook/datebook.cpp +++ b/core/pim/datebook/datebook.cpp | |||
@@ -77,12 +77,14 @@ | |||
77 | 77 | ||
78 | DateBook::DateBook( QWidget *parent, const char *, WFlags f ) | 78 | DateBook::DateBook( QWidget *parent, const char *, WFlags f ) |
79 | : QMainWindow( parent, "datebook", f ), | 79 | : QMainWindow( parent, "datebook", f ), |
80 | aPreset( FALSE ), | 80 | aPreset( FALSE ), |
81 | presetTime( -1 ), | 81 | presetTime( -1 ), |
82 | startTime( 8 ), // an acceptable default | 82 | startTime( 8 ), // an acceptable default |
83 | rowStyle( 0 ), | ||
84 | bJumpToCurTime(FALSE), | ||
83 | syncing(FALSE), | 85 | syncing(FALSE), |
84 | inSearch(FALSE), | 86 | inSearch(FALSE), |
85 | alarmCounter(0) | 87 | alarmCounter(0) |
86 | { | 88 | { |
87 | QTime t; | 89 | QTime t; |
88 | t.start(); | 90 | t.start(); |
@@ -246,22 +248,28 @@ DateBook::~DateBook() | |||
246 | 248 | ||
247 | void DateBook::slotSettings() | 249 | void DateBook::slotSettings() |
248 | { | 250 | { |
249 | DateBookSettings frmSettings( ampm, this ); | 251 | DateBookSettings frmSettings( ampm, this ); |
250 | frmSettings.setStartTime( startTime ); | 252 | frmSettings.setStartTime( startTime ); |
251 | frmSettings.setAlarmPreset( aPreset, presetTime ); | 253 | frmSettings.setAlarmPreset( aPreset, presetTime ); |
254 | frmSettings.setJumpToCurTime( bJumpToCurTime ); | ||
255 | frmSettings.setRowStyle( rowStyle ); | ||
252 | #if defined (Q_WS_QWS) || defined(_WS_QWS_) | 256 | #if defined (Q_WS_QWS) || defined(_WS_QWS_) |
253 | frmSettings.showMaximized(); | 257 | frmSettings.showMaximized(); |
254 | #endif | 258 | #endif |
255 | 259 | ||
256 | if ( frmSettings.exec() ) { | 260 | if ( frmSettings.exec() ) { |
257 | aPreset = frmSettings.alarmPreset(); | 261 | aPreset = frmSettings.alarmPreset(); |
258 | presetTime = frmSettings.presetTime(); | 262 | presetTime = frmSettings.presetTime(); |
259 | startTime = frmSettings.startTime(); | 263 | startTime = frmSettings.startTime(); |
264 | bJumpToCurTime = frmSettings.jumpToCurTime(); | ||
265 | rowStyle = frmSettings.rowStyle(); | ||
260 | if ( dayView ) | 266 | if ( dayView ) |
261 | dayView->setStartViewTime( startTime ); | 267 | dayView->setStartViewTime( startTime ); |
268 | dayView->setJumpToCurTime( bJumpToCurTime ); | ||
269 | dayView->setRowStyle( rowStyle ); | ||
262 | if ( weekView ) | 270 | if ( weekView ) |
263 | weekView->setStartViewTime( startTime ); | 271 | weekView->setStartViewTime( startTime ); |
264 | saveSettings(); | 272 | saveSettings(); |
265 | 273 | ||
266 | // make the change obvious | 274 | // make the change obvious |
267 | if ( views->visibleWidget() ) { | 275 | if ( views->visibleWidget() ) { |
@@ -450,12 +458,14 @@ void DateBook::showDay( int year, int month, int day ) | |||
450 | void DateBook::initDay() | 458 | void DateBook::initDay() |
451 | { | 459 | { |
452 | if ( !dayView ) { | 460 | if ( !dayView ) { |
453 | dayView = new DateBookDay( ampm, onMonday, db, views, "day view" ); | 461 | dayView = new DateBookDay( ampm, onMonday, db, views, "day view" ); |
454 | views->addWidget( dayView, DAY ); | 462 | views->addWidget( dayView, DAY ); |
455 | dayView->setStartViewTime( startTime ); | 463 | dayView->setStartViewTime( startTime ); |
464 | dayView->setJumpToCurTime( bJumpToCurTime ); | ||
465 | dayView->setRowStyle( rowStyle ); | ||
456 | connect( this, SIGNAL( newEvent() ), | 466 | connect( this, SIGNAL( newEvent() ), |
457 | dayView, SLOT( redraw() ) ); | 467 | dayView, SLOT( redraw() ) ); |
458 | connect( dayView, SIGNAL( newEvent() ), | 468 | connect( dayView, SIGNAL( newEvent() ), |
459 | this, SLOT( fileNew() ) ); | 469 | this, SLOT( fileNew() ) ); |
460 | connect( dayView, SIGNAL( removeEvent( const Event & ) ), | 470 | connect( dayView, SIGNAL( removeEvent( const Event & ) ), |
461 | this, SLOT( removeEvent( const Event & ) ) ); | 471 | this, SLOT( removeEvent( const Event & ) ) ); |
@@ -544,23 +554,27 @@ void DateBook::loadSettings() | |||
544 | { | 554 | { |
545 | Config config("DateBook"); | 555 | Config config("DateBook"); |
546 | config.setGroup("Main"); | 556 | config.setGroup("Main"); |
547 | startTime = config.readNumEntry("startviewtime", 8); | 557 | startTime = config.readNumEntry("startviewtime", 8); |
548 | aPreset = config.readBoolEntry("alarmpreset"); | 558 | aPreset = config.readBoolEntry("alarmpreset"); |
549 | presetTime = config.readNumEntry("presettime"); | 559 | presetTime = config.readNumEntry("presettime"); |
560 | bJumpToCurTime = config.readBoolEntry("jumptocurtime"); | ||
561 | rowStyle = config.readNumEntry("rowstyle"); | ||
550 | } | 562 | } |
551 | } | 563 | } |
552 | 564 | ||
553 | void DateBook::saveSettings() | 565 | void DateBook::saveSettings() |
554 | { | 566 | { |
555 | Config config( "qpe" ); | 567 | Config config( "qpe" ); |
556 | Config configDB( "DateBook" ); | 568 | Config configDB( "DateBook" ); |
557 | configDB.setGroup( "Main" ); | 569 | configDB.setGroup( "Main" ); |
558 | configDB.writeEntry("startviewtime",startTime); | 570 | configDB.writeEntry("startviewtime",startTime); |
559 | configDB.writeEntry("alarmpreset",aPreset); | 571 | configDB.writeEntry("alarmpreset",aPreset); |
560 | configDB.writeEntry("presettime",presetTime); | 572 | configDB.writeEntry("presettime",presetTime); |
573 | configDB.writeEntry("jumptocurtime", bJumpToCurTime); | ||
574 | configDB.writeEntry("rowstyle", rowStyle); | ||
561 | } | 575 | } |
562 | 576 | ||
563 | void DateBook::newDefaultView(QAction *a) { | 577 | void DateBook::newDefaultView(QAction *a) { |
564 | int val=DAY; | 578 | int val=DAY; |
565 | if (a->text() == "Day") val=DAY; | 579 | if (a->text() == "Day") val=DAY; |
566 | if (a->text() == "Week") val=WEEK; | 580 | if (a->text() == "Week") val=WEEK; |