summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-01-30 15:38:08 (UTC)
committer zautrix <zautrix>2005-01-30 15:38:08 (UTC)
commit11736af9b5348f251b0e8a3cf90fdb960c877936 (patch) (side-by-side diff)
treeeda181731c3dd76cb448d103b8d8f9d30757450c /korganizer
parent8d543aa1d1d1ed20001c8b18352d1d29c2979e48 (diff)
downloadkdepimpi-11736af9b5348f251b0e8a3cf90fdb960c877936.zip
kdepimpi-11736af9b5348f251b0e8a3cf90fdb960c877936.tar.gz
kdepimpi-11736af9b5348f251b0e8a3cf90fdb960c877936.tar.bz2
fix
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp2
-rw-r--r--korganizer/datenavigator.cpp3
-rw-r--r--korganizer/komonthview.cpp9
-rw-r--r--korganizer/koviewmanager.cpp4
4 files changed, 8 insertions, 10 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 96fb5ca..db33017 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -3668,49 +3668,49 @@ void CalendarView::showView(KOrg::BaseView *view)
Incidence *CalendarView::currentSelection()
{
return mViewManager->currentSelection();
}
void CalendarView::toggleAllDaySize()
{
/*
if ( KOPrefs::instance()->mAllDaySize > 47 )
KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2;
else
KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2;
*/
viewManager()->agendaView()->toggleAllDay();
}
void CalendarView::toggleExpand()
{
// if ( mLeftFrame->isHidden() ) {
// mLeftFrame->show();
// emit calendarViewExpanded( false );
// } else {
// mLeftFrame->hide();
// emit calendarViewExpanded( true );
// }
-
+ //qDebug(" CalendarView::toggleExpand()");
globalFlagBlockAgenda = 1;
emit calendarViewExpanded( !mLeftFrame->isHidden() );
globalFlagBlockAgenda = 5;
mViewManager->raiseCurrentView( !mLeftFrame->isHidden() );
//mViewManager->showView( 0, true );
}
void CalendarView::calendarModified( bool modified, Calendar * )
{
setModified( modified );
}
Todo *CalendarView::selectedTodo()
{
Incidence *incidence = currentSelection();
if ( incidence && incidence->type() == "Todo" ) {
return static_cast<Todo *>( incidence );
}
incidence = mTodoList->selectedIncidences().first();
if ( incidence && incidence->type() == "Todo" ) {
return static_cast<Todo *>( incidence );
}
diff --git a/korganizer/datenavigator.cpp b/korganizer/datenavigator.cpp
index 3156b2b..d2824de 100644
--- a/korganizer/datenavigator.cpp
+++ b/korganizer/datenavigator.cpp
@@ -189,50 +189,49 @@ void DateNavigator::selectWorkWeek( const QDate &d )
{
int dayOfWeek = KOGlobals::self()->calendarSystem()->dayOfWeek( d );
QDate firstDate = d.addDays( 1 - dayOfWeek );
int weekStart = KGlobal::locale()->weekStartDay();
if ( weekStart != 1 && dayOfWeek >= weekStart ) {
firstDate = firstDate.addDays( 7 );
}
selectDates( firstDate, 5 );
}
void DateNavigator::selectTodayMonth()
{
QDate date = QDate::currentDate().addDays( 1-QDate::currentDate().day() );
selectDates( date , date.daysInMonth ());
}
void DateNavigator::selectToday()
{
QDate d = QDate::currentDate();
int dateCount = mSelectedDates.count();
-
- if ( dateCount == 5 ) selectWorkWeek( d );
+ if ( dateCount == 5 && d.dayOfWeek() < 6 ) selectWorkWeek( d );
else if ( dateCount == 7 ) selectWeek( d );
else selectDates( d, dateCount );
}
void DateNavigator::selectPreviousYear()
{
QDate firstSelected = mSelectedDates.first();
int weekDay = firstSelected.dayOfWeek();
firstSelected = KOGlobals::self()->calendarSystem()->addYears( firstSelected, -1 );
selectWeekByDay( weekDay, firstSelected );
}
void DateNavigator::selectPreviousMonth()
{
QDate firstSelected = mSelectedDates.first();
int weekDay = firstSelected.dayOfWeek();
firstSelected = KOGlobals::self()->calendarSystem()->addMonths( firstSelected, -1 );
if ( mSelectedDates.first().day() == 1 && mSelectedDates.count() > 27 )
selectMonthByDate( firstSelected );
else
selectWeekByDay( weekDay, firstSelected );
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 10e4f1d..4cefb26 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -946,49 +946,49 @@ void KOMonthView::showEvents(QPtrList<Event>)
qDebug("KOMonthView::selectEvents is not implemented yet. ");
}
void KOMonthView::changeEventDisplay(Event *, int)
{
// this should be re-written to be much more efficient, but this
// quick-and-dirty-hack gets the job done for right now.
updateView();
}
void KOMonthView::updateView()
{
if ( !updatePossible )
return;
//qDebug("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ");
int i;
for( i = 0; i < mCells.count(); ++i ) {
mCells[i]->updateCell();
}
//qDebug("KOMonthView::updateView() ");
processSelectionChange();
// qDebug("---------------------------------------------------------------------+ ");
- setFocus();
+ mCells[0]->setFocus();
}
void KOMonthView::resizeEvent(QResizeEvent * e)
{
computeLayout();
}
void KOMonthView::computeLayout()
{
// select the appropriate heading string size. E.g. "Wednesday" or "Wed".
// note this only changes the text if the requested size crosses the
// threshold between big enough to support the full name and not big
// enough.
int daysToShow = 7;
bool combinedSatSun = false;
if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) {
daysToShow = 6;
combinedSatSun = true;
}
int tWid = topLevelWidget()->size().width();
int tHei = topLevelWidget()->size().height();
int wid = size().width();//e
int hei = size().height()-1;
@@ -1110,45 +1110,46 @@ void KOMonthView::setSelectedCell( MonthViewCell *cell )
emit incidenceSelected( 0 );
else
emit incidenceSelected( mSelectedCell->selectedIncidence() );
}
void KOMonthView::processSelectionChange()
{
QPtrList<Incidence> incidences = selectedIncidences();
if (incidences.count() > 0) {
emit incidenceSelected( incidences.first() );
} else {
emit incidenceSelected( 0 );
}
}
void KOMonthView::clearSelection()
{
if ( mSelectedCell ) {
mSelectedCell->deselect();
mSelectedCell = 0;
}
}
void KOMonthView::keyPressEvent ( QKeyEvent * e )
{
+ //qDebug("KOMonthView::keyPressEvent ");
switch(e->key()) {
- break;
case Key_Up:
{
emit prevMonth();
- setFocus();
+ mCells[0]->setFocus();
}
e->accept();
break;
case Key_Down:
{
emit nextMonth();
- setFocus();
+ mCells[0]->setFocus();
+
}
e->accept();
break;
default:
e->ignore();
break;
}
}
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 6da4799..4c03f9a 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -81,49 +81,49 @@ KOViewManager::~KOViewManager()
KOrg::BaseView *KOViewManager::currentView()
{
return mCurrentView;
}
void KOViewManager::readSettings(KConfig *config)
{
config->setGroup("General");
QString view = config->readEntry("Current View");
if (view == "WhatsNext") showWhatsNextView();
else if (view == "Month") showMonthView();
else if (view == "List") showListView();
else if (view == "Journal") showJournalView();
else if (view == "TimeSpan") showTimeSpanView();
else if (view == "Todo") showTodoView();
else {
showAgendaView();
}
}
void KOViewManager::showDateView( int view, QDate date)
{
- qDebug("date %d %s", view, date.toString().latin1());
+ //qDebug("date %d %s", view, date.toString().latin1());
#if 0
mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 );
mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next Week"),4 );
mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Two Weeks"),5 );
mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Month"),6 );
mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 );
#endif
if ( view == 3 ) {
mMainView->showDay( date );
} else if (view == 4 ) {
mMainView->dateNavigator()->selectDates( date, 7 );
} else if (view == 5 ) {
mMainView->dateNavigator()->selectDates( date, 14);
} else if (view == 6 ) {
showMonthView();
mMainView->dateNavigator()->selectMonthByDate( date );
mMainView->dateNavigator()->selectDate( date );
} else if (view == 7 ) {
mMainView->dateNavigator()->selectDate( date );
showJournalView();
} else if (view == 8 ) {
globalFlagBlockAgenda = 1;
if ( mCurrentAgendaView != 3 )
mCurrentAgendaView = -1;
@@ -171,67 +171,65 @@ void KOViewManager::writeSettings(KConfig *config)
mListView->writeSettings(config);
}
if (mTodoView) {
mTodoView->saveLayout(config,"Todo View");
}
}
void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
{
//mFlagShowNextxDays = false;
//if(view == mCurrentView) return;
if ( view == 0 ) {
view = mCurrentView;
if ( view == 0 )
return;
}
bool full = fullScreen;
if(view == mCurrentView && view != mWhatsNextView ) {
if ( mCurrentAgendaView < 0 )
return;
full = mMainView->leftFrame()->isVisible();
} else {
mCurrentView = view;
-
// bool full = fullScreen;
bool isFull = !mMainView->leftFrame()->isVisible();
if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen )
full = true;
if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen )
full = false;
}
if ( mAgendaView ) mAgendaView->deleteSelectedDateTime();
//raiseCurrentView( full );
mMainView->processIncidenceSelection( 0 );
mMainView->updateView();
raiseCurrentView( full );
mMainView->adaptNavigationUnits();
}
void KOViewManager::raiseCurrentView( bool fullScreen )
{
- //qDebug("raiseCurrentView ");
mCurrentAgendaView = 0;
int wid = mMainView->width() ;
int hei = mMainView->height();
if ( mCurrentView == mMonthView ) {
mMainView->navigatorBar()->show();
hei -= mMainView->navigatorBar()->sizeHint().height();
//mMainView->navigatorBar()->hide();
} else {
mMainView->navigatorBar()->hide();
}
if ( fullScreen ) {
mMainView->leftFrame()->hide();
} else {
mMainView->leftFrame()->show();
if ( KOPrefs::instance()->mVerticalScreen )
hei -= mMainView->leftFrame()->height();
else
wid -= mMainView->leftFrame()->width();
}
emit signalFullScreen( !fullScreen );
if ( globalFlagBlockAgenda == 5 ) {
globalFlagBlockAgenda = 4;
globalFlagBlockAgendaItemPaint = 1;
}