summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-02-06 20:09:33 (UTC)
committer zautrix <zautrix>2005-02-06 20:09:33 (UTC)
commit961fc44f4092c1f981eb3be4284715e6829f885c (patch) (unidiff)
tree005e999ddbf07af42c7da4f9193874ba0ba3870c
parent536a16498de6b9c10b3f5b147ca18c5e4421401c (diff)
downloadkdepimpi-961fc44f4092c1f981eb3be4284715e6829f885c.zip
kdepimpi-961fc44f4092c1f981eb3be4284715e6829f885c.tar.gz
kdepimpi-961fc44f4092c1f981eb3be4284715e6829f885c.tar.bz2
fixesss
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.cpp94
-rw-r--r--korganizer/komonthview.h3
-rw-r--r--korganizer/koviewmanager.cpp4
3 files changed, 44 insertions, 57 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index ffb2e1e..70cbf96 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -898,25 +898,32 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
898 898
899 connect( cell, SIGNAL( defaultAction( Incidence * ) ), 899 connect( cell, SIGNAL( defaultAction( Incidence * ) ),
900 SLOT( defaultAction( Incidence * ) ) ); 900 SLOT( defaultAction( Incidence * ) ) );
901 connect( cell, SIGNAL( newEventSignal( QDateTime ) ), 901 connect( cell, SIGNAL( newEventSignal( QDateTime ) ),
902 SIGNAL( newEventSignal( QDateTime ) ) ); 902 SIGNAL( newEventSignal( QDateTime ) ) );
903 connect( cell, SIGNAL( showDaySignal( QDate ) ), 903 connect( cell, SIGNAL( showDaySignal( QDate ) ),
904 SIGNAL( showDaySignal( QDate ) ) ); 904 SIGNAL( showDaySignal( QDate ) ) );
905 cell->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont ); 905 cell->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont );
906 } 906 }
907 907
908 //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) ); 908 //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) );
909 mContextMenu = eventPopup(); 909 mContextMenu = eventPopup();
910 updateConfig(); //useless here 910 //updateConfig(); //useless here ...
911 // ... but we need mWidthLongDayLabel computed
912 QFontMetrics fontmetric(mDayLabels[0]->font());
913 mWidthLongDayLabel = 0;
914 for (int i = 0; i < 7; i++) {
915 int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1));
916 if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width;
917 }
911 918
912 //mWeekLabels[mNumWeeks]->setText( i18n("W")); 919 //mWeekLabels[mNumWeeks]->setText( i18n("W"));
913 920
914 if ( mShowWeekView ) 921 if ( mShowWeekView )
915 mWidStack->raiseWidget( mWeekView ); 922 mWidStack->raiseWidget( mWeekView );
916 else 923 else
917 mWidStack->raiseWidget( mMonthView ); 924 mWidStack->raiseWidget( mMonthView );
918 925
919 emit incidenceSelected( 0 ); 926 emit incidenceSelected( 0 );
920} 927}
921 928
922KOMonthView::~KOMonthView() 929KOMonthView::~KOMonthView()
@@ -998,25 +1005,24 @@ void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd,
998} 1005}
999 1006
1000void KOMonthView::updateConfig() 1007void KOMonthView::updateConfig()
1001{ 1008{
1002 1009
1003 mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); 1010 mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
1004 1011
1005 if ( mShowWeekView ) { 1012 if ( mShowWeekView ) {
1006 mWeekStartsMonday = true; 1013 mWeekStartsMonday = true;
1007 } 1014 }
1008 QFontMetrics fontmetric(mDayLabels[0]->font()); 1015 QFontMetrics fontmetric(mDayLabels[0]->font());
1009 mWidthLongDayLabel = 0; 1016 mWidthLongDayLabel = 0;
1010 qDebug("KOMonthView::updateConfig() ");
1011 for (int i = 0; i < 7; i++) { 1017 for (int i = 0; i < 7; i++) {
1012 int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); 1018 int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1));
1013 if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; 1019 if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width;
1014 } 1020 }
1015 if ( ! mShowWeekView ) { 1021 if ( ! mShowWeekView ) {
1016 computeLayout(); 1022 computeLayout();
1017 } 1023 }
1018 updateDayLabels(); 1024 updateDayLabels();
1019 //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks); 1025 //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks);
1020 //int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks; 1026 //int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks;
1021 //resizeEvent( 0 ); 1027 //resizeEvent( 0 );
1022 for (uint i = 0; i < mCells.count(); ++i) { 1028 for (uint i = 0; i < mCells.count(); ++i) {
@@ -1027,31 +1033,25 @@ void KOMonthView::updateConfig()
1027 mCellsW[i]->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont); 1033 mCellsW[i]->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont);
1028 } 1034 }
1029#ifdef DESKTOP_VERSION 1035#ifdef DESKTOP_VERSION
1030 MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); 1036 MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips);
1031#endif 1037#endif
1032 updateView(); 1038 updateView();
1033} 1039}
1034 1040
1035void KOMonthView::updateDayLabels() 1041void KOMonthView::updateDayLabels()
1036{ 1042{
1037 1043
1038 QPtrVector<QLabel> *mDayLabelsT; 1044 QPtrVector<QLabel> *mDayLabelsT;
1039#if 0 1045
1040 if (mShowWeekView )
1041 mDayLabelsT = &mDayLabelsW;
1042 else
1043 mDayLabelsT = &mDayLabels;
1044#endif
1045 qDebug("updateDayLabels W %d M %d ",mShortDayLabelsW ,mShortDayLabelsM);
1046 mDayLabelsT = &mDayLabelsW; 1046 mDayLabelsT = &mDayLabelsW;
1047 for (int i = 0; i < 7; i++) { 1047 for (int i = 0; i < 7; i++) {
1048 if (mWeekStartsMonday) { 1048 if (mWeekStartsMonday) {
1049 bool show = mShortDayLabelsW; 1049 bool show = mShortDayLabelsW;
1050 if ( i > 4 && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() ) 1050 if ( i > 4 && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() )
1051 show = true; 1051 show = true;
1052 (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); 1052 (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show));
1053 } else { 1053 } else {
1054 if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabelsW)); 1054 if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabelsW));
1055 else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabelsW)); 1055 else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabelsW));
1056 1056
1057 } 1057 }
@@ -1254,65 +1254,57 @@ void KOMonthView::updateView()
1254 1254
1255 //qDebug("KOMonthView::updateView() "); 1255 //qDebug("KOMonthView::updateView() ");
1256 processSelectionChange(); 1256 processSelectionChange();
1257 // qDebug("---------------------------------------------------------------------+ "); 1257 // qDebug("---------------------------------------------------------------------+ ");
1258 (*cells)[0]->setFocus(); 1258 (*cells)[0]->setFocus();
1259#endif 1259#endif
1260 1260
1261 //qDebug("update time %d ", ti.elapsed()); 1261 //qDebug("update time %d ", ti.elapsed());
1262} 1262}
1263 1263
1264void KOMonthView::resizeEvent(QResizeEvent * e) 1264void KOMonthView::resizeEvent(QResizeEvent * e)
1265{ 1265{
1266 qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height()); 1266 //qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height());
1267 if ( ignoreResizeEvent ) { 1267 if ( ignoreResizeEvent ) {
1268 int diff = e->size().height() - e->oldSize().height(); 1268 //qDebug("KOMonthView::resizeEvent ignored ");
1269 if ( diff < 0 ) 1269 --ignoreResizeEvent;
1270 diff = diff * (-1); 1270 return;
1271 if ( diff == ignoreResizeEventHeight ) {
1272 qDebug("KOMonthView::resizeEvent ignored ");
1273 --ignoreResizeEvent;
1274 return;
1275 }
1276 ignoreResizeEvent = 0;
1277 } 1271 }
1278 if ( e->size().width()+ e->size().height() < 240 ) 1272 if ( e->size().width()+ e->size().height() < 240 )
1279 return; 1273 return;
1280 computeLayout(); 1274 computeLayout();
1281 clPending = true; 1275 clPending = true;
1282 if ( mShowWeekView ) 1276 if ( mShowWeekView )
1283 mCellsW[0]->setFocus(); 1277 mCellsW[0]->setFocus();
1284 else 1278 else
1285 mCells[0]->setFocus(); 1279 mCells[0]->setFocus();
1286} 1280}
1287void KOMonthView::computeLayoutWeek() 1281void KOMonthView::computeLayoutWeek()
1288{ 1282{
1289 1283 static int widd = 0;
1284 static int heigg = 0;
1285 if ( widd == width() && heigg == height () ) {
1286 return;
1287 }
1288 widd = width() ;
1289 heigg = height ();
1290 int daysToShow; 1290 int daysToShow;
1291 int tWid = topLevelWidget()->size().width();
1292 int tHei = topLevelWidget()->size().height();
1293
1294 int wid = size().width();//e 1291 int wid = size().width();//e
1295 int hei = size().height()-1; 1292 int hei = size().height()-1;
1296
1297 if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei )
1298 return;
1299
1300 if ( wid < hei ) 1293 if ( wid < hei )
1301 daysToShow = 2; 1294 daysToShow = 2;
1302 else 1295 else
1303 daysToShow = 3; 1296 daysToShow = 3;
1304 bool combinedSatSun = true; 1297 bool combinedSatSun = true;
1305 1298
1306 //qDebug("KOMonthView::computeLayout()------------------------------------ ");
1307 QFontMetrics fm ( mWeekLabels[0]->font() ); 1299 QFontMetrics fm ( mWeekLabels[0]->font() );
1308 int weeklabelwid = fm.width( "888" ); 1300 int weeklabelwid = fm.width( "888" );
1309 wid -= weeklabelwid; 1301 wid -= weeklabelwid;
1310 1302
1311 int colWid = wid / daysToShow; 1303 int colWid = wid / daysToShow;
1312 int lastCol = wid - ( colWid*6 ); 1304 int lastCol = wid - ( colWid*6 );
1313 int dayLabelHei = mDayLabelsW[0]->sizeHint().height(); 1305 int dayLabelHei = mDayLabelsW[0]->sizeHint().height();
1314 int cellHei = (hei - (5- daysToShow )*dayLabelHei) /(5- daysToShow ); 1306 int cellHei = (hei - (5- daysToShow )*dayLabelHei) /(5- daysToShow );
1315 int colModulo = wid % daysToShow; 1307 int colModulo = wid % daysToShow;
1316 int rowModulo = (hei- (5- daysToShow )*dayLabelHei) % daysToShow-1; 1308 int rowModulo = (hei- (5- daysToShow )*dayLabelHei) % daysToShow-1;
1317 //qDebug("rowmod %d ", rowModulo); 1309 //qDebug("rowmod %d ", rowModulo);
1318 int i; 1310 int i;
@@ -1371,59 +1363,68 @@ void KOMonthView::computeLayoutWeek()
1371 1363
1372 1364
1373 x += w; 1365 x += w;
1374 if ( x + w/2 > wid ) { 1366 if ( x + w/2 > wid ) {
1375 x = 0; 1367 x = 0;
1376 y += h+dayLabelHei ; 1368 y += h+dayLabelHei ;
1377 } 1369 }
1378 } 1370 }
1379 y= dayLabelHei; 1371 y= dayLabelHei;
1380 h = cellHei ; 1372 h = cellHei ;
1381 mWeekLabelsW[0]->setGeometry( 0,y,weeklabelwid,hei-dayLabelHei); 1373 mWeekLabelsW[0]->setGeometry( 0,y,weeklabelwid,hei-dayLabelHei);
1382 mWeekLabelsW[1]->setGeometry( 0,0,weeklabelwid,dayLabelHei); 1374 mWeekLabelsW[1]->setGeometry( 0,0,weeklabelwid,dayLabelHei);
1383 // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height()); 1375
1384 //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height());
1385 mShortDayLabelsW = mDayLabelsW[0]->width() < mWidthLongDayLabel ; 1376 mShortDayLabelsW = mDayLabelsW[0]->width() < mWidthLongDayLabel ;
1386 updateDayLabels(); 1377 updateDayLabels();
1387 bool forceUpdate = !updatePossible; 1378 bool forceUpdate = !updatePossible;
1388 updatePossible = true; 1379 updatePossible = true;
1389 //mWeekLabels[mNumWeeks]->setText( i18n("M")); 1380 //mWeekLabels[mNumWeeks]->setText( i18n("M"));
1390 if ( forceUpdate ) 1381 if ( forceUpdate )
1391 updateView(); 1382 updateView();
1392} 1383}
1393void KOMonthView::computeLayout() 1384void KOMonthView::computeLayout()
1394{ 1385{
1395 // select the appropriate heading string size. E.g. "Wednesday" or "Wed". 1386 // select the appropriate heading string size. E.g. "Wednesday" or "Wed".
1396 // note this only changes the text if the requested size crosses the 1387 // note this only changes the text if the requested size crosses the
1397 // threshold between big enough to support the full name and not big 1388 // threshold between big enough to support the full name and not big
1398 // enough. 1389 // enough.
1390
1391 int tWid = topLevelWidget()->size().width();
1392 int tHei = topLevelWidget()->size().height();
1393
1394 int wid = size().width();//e
1395 int hei = size().height()-1;
1396
1397 if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei )
1398 return;
1399
1400
1399 if ( mShowWeekView ){ 1401 if ( mShowWeekView ){
1400 computeLayoutWeek(); 1402 computeLayoutWeek();
1401 return; 1403 return;
1402 } 1404 }
1405 static int widd = 0;
1406 static int heigg = 0;
1407 if ( widd == width() && heigg == height () ) {
1408 return;
1409 }
1410 widd = width() ;
1411 heigg = height ();
1412
1403 int daysToShow = 7; 1413 int daysToShow = 7;
1404 bool combinedSatSun = false; 1414 bool combinedSatSun = false;
1405 if (KOPrefs::instance()->mMonthViewSatSunTog ) { 1415 if (KOPrefs::instance()->mMonthViewSatSunTog ) {
1406 daysToShow = 6; 1416 daysToShow = 6;
1407 combinedSatSun = true; 1417 combinedSatSun = true;
1408 } 1418 }
1409 int tWid = topLevelWidget()->size().width();
1410 int tHei = topLevelWidget()->size().height();
1411
1412 int wid = size().width();//e
1413 int hei = size().height()-1;
1414
1415 if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei )
1416 return;
1417 //qDebug("KOMonthView::computeLayout()------------------------------------ ");
1418 QFontMetrics fm ( mWeekLabels[0]->font() ); 1419 QFontMetrics fm ( mWeekLabels[0]->font() );
1419 int weeklabelwid = fm.width( "888" ); 1420 int weeklabelwid = fm.width( "888" );
1420 wid -= weeklabelwid; 1421 wid -= weeklabelwid;
1421 1422
1422 int colWid = wid / daysToShow; 1423 int colWid = wid / daysToShow;
1423 int lastCol = wid - ( colWid*6 ); 1424 int lastCol = wid - ( colWid*6 );
1424 int dayLabelHei = mDayLabels[0]->sizeHint().height(); 1425 int dayLabelHei = mDayLabels[0]->sizeHint().height();
1425 int cellHei = (hei - dayLabelHei) /6; 1426 int cellHei = (hei - dayLabelHei) /6;
1426 int colModulo = wid % daysToShow; 1427 int colModulo = wid % daysToShow;
1427 int rowModulo = (hei- dayLabelHei) % 6; 1428 int rowModulo = (hei- dayLabelHei) % 6;
1428 //qDebug("rowmod %d ", rowModulo); 1429 //qDebug("rowmod %d ", rowModulo);
1429 int i; 1430 int i;
@@ -1478,63 +1479,50 @@ void KOMonthView::computeLayout()
1478 y += h; 1479 y += h;
1479 } 1480 }
1480 } 1481 }
1481 y= dayLabelHei; 1482 y= dayLabelHei;
1482 h = cellHei ; 1483 h = cellHei ;
1483 for ( i = 0; i < 6; i++) { 1484 for ( i = 0; i < 6; i++) {
1484 if ( i == (6-rowModulo)) 1485 if ( i == (6-rowModulo))
1485 ++h; 1486 ++h;
1486 mWeekLabels[i]->setGeometry( 0,y,weeklabelwid,h); 1487 mWeekLabels[i]->setGeometry( 0,y,weeklabelwid,h);
1487 y += h; 1488 y += h;
1488 } 1489 }
1489 mWeekLabels[6]->setGeometry( 0,0,weeklabelwid,dayLabelHei); 1490 mWeekLabels[6]->setGeometry( 0,0,weeklabelwid,dayLabelHei);
1490 // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height());
1491 //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height());
1492 mShortDayLabelsM = mDayLabels[0]->width() < mWidthLongDayLabel ; 1491 mShortDayLabelsM = mDayLabels[0]->width() < mWidthLongDayLabel ;
1493 qDebug("dlwid %d %d ",mDayLabels[0]->width() , mWidthLongDayLabel); 1492 qDebug("dlwid %d %d ",mDayLabels[0]->width() , mWidthLongDayLabel);
1494 updateDayLabels(); 1493 updateDayLabels();
1495 bool forceUpdate = !updatePossible; 1494 bool forceUpdate = !updatePossible;
1496 updatePossible = true; 1495 updatePossible = true;
1497 //mWeekLabels[mNumWeeks]->setText( i18n("W"));
1498 if ( forceUpdate ) 1496 if ( forceUpdate )
1499 updateView(); 1497 updateView();
1500} 1498}
1501 1499
1502void KOMonthView::showContextMenu( Incidence *incidence ) 1500void KOMonthView::showContextMenu( Incidence *incidence )
1503{ 1501{
1504 mContextMenu->showIncidencePopup(incidence); 1502 mContextMenu->showIncidencePopup(incidence);
1505 /* 1503
1506 if( incidence && incidence->type() == "Event" ) {
1507 Event *event = static_cast<Event *>(incidence);
1508 mContextMenu->showEventPopup(event);
1509 } else {
1510 kdDebug() << "MonthView::showContextMenu(): cast failed." << endl;
1511 }
1512 */
1513} 1504}
1514MonthViewCell * KOMonthView::selectedCell( ) 1505MonthViewCell * KOMonthView::selectedCell( )
1515{ 1506{
1516 return mSelectedCell; 1507 return mSelectedCell;
1517} 1508}
1518void KOMonthView::setSelectedCell( MonthViewCell *cell ) 1509void KOMonthView::setSelectedCell( MonthViewCell *cell )
1519{ 1510{
1520 //qDebug("KOMonthView::setSelectedCell %x ", cell);
1521 if ( mSelectedCell && mSelectedCell != cell ) { 1511 if ( mSelectedCell && mSelectedCell != cell ) {
1522 MonthViewCell * mvc = mSelectedCell; 1512 MonthViewCell * mvc = mSelectedCell;
1523 mSelectedCell = cell; 1513 mSelectedCell = cell;
1524 mvc->deselect(); 1514 mvc->deselect();
1525 } else 1515 } else
1526 mSelectedCell = cell; 1516 mSelectedCell = cell;
1527 // if ( mSelectedCell )
1528 // mSelectedCell->select();
1529 if ( !mSelectedCell ) 1517 if ( !mSelectedCell )
1530 emit incidenceSelected( 0 ); 1518 emit incidenceSelected( 0 );
1531 else 1519 else
1532 emit incidenceSelected( mSelectedCell->selectedIncidence() ); 1520 emit incidenceSelected( mSelectedCell->selectedIncidence() );
1533} 1521}
1534 1522
1535void KOMonthView::processSelectionChange() 1523void KOMonthView::processSelectionChange()
1536{ 1524{
1537 QPtrList<Incidence> incidences = selectedIncidences(); 1525 QPtrList<Incidence> incidences = selectedIncidences();
1538 if (incidences.count() > 0) { 1526 if (incidences.count() > 0) {
1539 emit incidenceSelected( incidences.first() ); 1527 emit incidenceSelected( incidences.first() );
1540 } else { 1528 } else {
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index d70cda1..9dbe319 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -217,25 +217,25 @@ class KOMonthView: public KOEventView
217 virtual int currentDateCount(); 217 virtual int currentDateCount();
218 218
219 /** returns the currently selected events */ 219 /** returns the currently selected events */
220 virtual QPtrList<Incidence> selectedIncidences(); 220 virtual QPtrList<Incidence> selectedIncidences();
221 221
222 /** returns dates of the currently selected events */ 222 /** returns dates of the currently selected events */
223 virtual DateList selectedDates(); 223 virtual DateList selectedDates();
224 224
225 virtual void printPreview(CalPrinter *calPrinter, 225 virtual void printPreview(CalPrinter *calPrinter,
226 const QDate &, const QDate &); 226 const QDate &, const QDate &);
227 bool isMonthView() { return true; } 227 bool isMonthView() { return true; }
228 bool isUpdatePossible() { return updatePossible; } 228 bool isUpdatePossible() { return updatePossible; }
229 void setIgnoreResizeEvent( int c, int h ) { ignoreResizeEvent = c ;ignoreResizeEventHeight = h;} 229 void setIgnoreResizeEvent( int c ) { ignoreResizeEvent = c ;}
230 230
231 MonthViewCell * selectedCell(); 231 MonthViewCell * selectedCell();
232 public slots: 232 public slots:
233 virtual void updateView(); 233 virtual void updateView();
234 virtual void updateConfig(); 234 virtual void updateConfig();
235 virtual void showDates(const QDate &start, const QDate &end); 235 virtual void showDates(const QDate &start, const QDate &end);
236 virtual void showEvents(QPtrList<Event> eventList); 236 virtual void showEvents(QPtrList<Event> eventList);
237 237
238 void changeEventDisplay(Event *, int); 238 void changeEventDisplay(Event *, int);
239 239
240 void clearSelection(); 240 void clearSelection();
241 241
@@ -251,25 +251,24 @@ class KOMonthView: public KOEventView
251 void nextMonth(); 251 void nextMonth();
252 void prevMonth(); 252 void prevMonth();
253 void showNavigator( bool ); 253 void showNavigator( bool );
254 void selectWeekNum ( int ); 254 void selectWeekNum ( int );
255 void showDaySignal( QDate ); 255 void showDaySignal( QDate );
256 protected: 256 protected:
257 void resizeEvent(QResizeEvent *); 257 void resizeEvent(QResizeEvent *);
258 void viewChanged(); 258 void viewChanged();
259 void updateDayLabels(); 259 void updateDayLabels();
260 260
261 private: 261 private:
262 int ignoreResizeEvent; 262 int ignoreResizeEvent;
263 int ignoreResizeEventHeight;
264 int currentWeek(); 263 int currentWeek();
265 bool clPending; 264 bool clPending;
266 QWidgetStack * mWidStack; 265 QWidgetStack * mWidStack;
267 QWidget* mMonthView; 266 QWidget* mMonthView;
268 QWidget* mWeekView; 267 QWidget* mWeekView;
269 bool mShowWeekView; 268 bool mShowWeekView;
270 bool updatePossible; 269 bool updatePossible;
271 int mDaysPerWeek; 270 int mDaysPerWeek;
272 int mNumWeeks; 271 int mNumWeeks;
273 int mNumCells; 272 int mNumCells;
274 bool mWeekStartsMonday; 273 bool mWeekStartsMonday;
275 void computeLayout(); 274 void computeLayout();
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index c35de0a..62d3e7f 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -191,49 +191,49 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
191 //if(view == mCurrentView) return; 191 //if(view == mCurrentView) return;
192 if ( view == 0 ) { 192 if ( view == 0 ) {
193 view = mCurrentView; 193 view = mCurrentView;
194 if ( view == 0 ) 194 if ( view == 0 )
195 return; 195 return;
196 } 196 }
197 bool full = fullScreen; 197 bool full = fullScreen;
198 if(view == mCurrentView && view != mWhatsNextView ) { 198 if(view == mCurrentView && view != mWhatsNextView ) {
199 if ( mCurrentAgendaView < 0 ) 199 if ( mCurrentAgendaView < 0 )
200 return; 200 return;
201 full = mMainView->leftFrame()->isVisible(); 201 full = mMainView->leftFrame()->isVisible();
202 } else { 202 } else {
203 if ( view == mMonthView && mMonthView)
204 mMonthView->setIgnoreResizeEvent( 1 );
203 mCurrentView = view; 205 mCurrentView = view;
204 // bool full = fullScreen; 206 // bool full = fullScreen;
205 bool isFull = !mMainView->leftFrame()->isVisible(); 207 bool isFull = !mMainView->leftFrame()->isVisible();
206 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) 208 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen )
207 full = true; 209 full = true;
208 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) 210 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen )
209 full = false; 211 full = false;
210 } 212 }
211 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); 213 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime();
212 //raiseCurrentView( full ); 214 //raiseCurrentView( full );
213 mMainView->processIncidenceSelection( 0 ); 215 mMainView->processIncidenceSelection( 0 );
214 //mMainView->updateView(); 216 //mMainView->updateView();
215 raiseCurrentView( full, true ); 217 raiseCurrentView( full, true );
216 mMainView->adaptNavigationUnits(); 218 mMainView->adaptNavigationUnits();
217} 219}
218 220
219void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) 221void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView )
220{ 222{
221 mCurrentAgendaView = 0; 223 mCurrentAgendaView = 0;
222 int wid = mMainView->width() ; 224 int wid = mMainView->width() ;
223 int hei = mMainView->height(); 225 int hei = mMainView->height();
224 if ( mCurrentView == mMonthView ) { 226 if ( mCurrentView == mMonthView ) {
225 if ( true /* !KOPrefs::instance()->mMonthViewWeek*/ ) { 227 if ( true /* !KOPrefs::instance()->mMonthViewWeek*/ ) {
226
227 mMonthView->setIgnoreResizeEvent( 2 ,mMainView->navigatorBar()->height());
228 mMainView->navigatorBar()->show(); 228 mMainView->navigatorBar()->show();
229 hei -= mMainView->navigatorBar()->sizeHint().height(); 229 hei -= mMainView->navigatorBar()->sizeHint().height();
230 } 230 }
231 //mMainView->navigatorBar()->hide(); 231 //mMainView->navigatorBar()->hide();
232 } else { 232 } else {
233 mMainView->navigatorBar()->hide(); 233 mMainView->navigatorBar()->hide();
234 } 234 }
235 if ( fullScreen ) { 235 if ( fullScreen ) {
236 mMainView->leftFrame()->hide(); 236 mMainView->leftFrame()->hide();
237 } else { 237 } else {
238 mMainView->leftFrame()->show(); 238 mMainView->leftFrame()->show();
239 if ( KOPrefs::instance()->mVerticalScreen ) 239 if ( KOPrefs::instance()->mVerticalScreen )