summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp53
-rw-r--r--korganizer/kodaymatrix.h1
-rw-r--r--korganizer/komonthview.cpp3
-rw-r--r--korganizer/koprefsdialog.cpp11
-rw-r--r--korganizer/koviewmanager.cpp9
-rw-r--r--korganizer/mainwindow.cpp11
-rw-r--r--korganizer/mainwindow.h2
7 files changed, 73 insertions, 17 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 17a1d13..df606d0 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -367,5 +367,7 @@ void KODayMatrix::computeEvent(Event *event, int i )
holiStr += " (" + event->location() + ")";
mHolidays[i] =holiStr ;
+ eDays.setBit(i);
}
+ if ( KOPrefs::instance()->mCurrentDisplayedView != VIEW_T_VIEW && KOPrefs::instance()->mCurrentDisplayedView != VIEW_J_VIEW ) {
if ( event->isBirthday()) {
pDays.setBit(i);
@@ -378,4 +380,6 @@ void KODayMatrix::computeEvent(Event *event, int i )
mHolidays[i] =holiStr ;
}
+ }
+ if ( KOPrefs::instance()->mCurrentDisplayedView != VIEW_J_VIEW )
eDays.setBit(i);
}
@@ -389,4 +393,5 @@ void KODayMatrix::updateViewTimed()
#if 1
+
int i;
int timeSpan = NUMDAYS-1;
@@ -470,8 +475,8 @@ void KODayMatrix::updateViewTimed()
}
}
-
-#if 0
+ if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) {
+ bDays.fill( false);
// insert due todos
- QPtrList<Todo> todos = calendar()->todos( );
+ QPtrList<Todo> todos = mCalendar->todos( );
Todo *todo;
for(todo = todos.first(); todo; todo = todos.next()) {
@@ -480,10 +485,40 @@ void KODayMatrix::updateViewTimed()
int day = mStartDate.daysTo( todo->dtDue().date() );
if ( day >= 0 && day < timeSpan + 1) {
- (*cells)[day]->insertTodo( todo );
+ int i = day;
+ QString holiStr = mHolidays[i];
+ pDays.setBit(i);
+ if ( !holiStr.isEmpty() )
+ holiStr += "\n";
+ holiStr += i18n("Todo") + ": "+todo->summary();
+ if ( !todo->location().isEmpty() )
+ holiStr += " (" + todo->location() + ")";
+ bDays.setBit(i);
+ mHolidays[i] =holiStr ;
+ eDays.setBit(i);
}
}
}
-#endif
+ }
+ if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) {
+ bDays.fill( false);
+ // insert due todos
+ QPtrList<Journal> todos = mCalendar->journals( );
+ Journal *todo;
+ for(todo = todos.first(); todo; todo = todos.next()) {
+ int day = mStartDate.daysTo( todo->dtStart().date() );
+ if ( day >= 0 && day < timeSpan + 1) {
+ int i = day;
+ QString holiStr = mHolidays[i];
+ pDays.setBit(i);
+ if ( !holiStr.isEmpty() )
+ holiStr += "\n";
+ holiStr += i18n("Journal");
+ bDays.setBit(i);
+ mHolidays[i] =holiStr ;
+ eDays.setBit(i);
+ }
+ }
+ }
#else
//qDebug("KODayMatrix::updateViewTimed ");
@@ -537,5 +572,7 @@ void KODayMatrix::updateViewTimed()
void KODayMatrix::updateView(QDate actdate)
{
-
+ if ( mLastView != KOPrefs::instance()->mCurrentDisplayedView )
+ mRedrawNeeded = true;
+ mLastView = KOPrefs::instance()->mCurrentDisplayedView;
if ( ! actdate.isValid() ) {
//qDebug("date not valid ");
@@ -1053,7 +1090,7 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
if ( bDays.testBit(i) ) {
if ( hDays.testBit(i) )
- p.setPen(QColor(Qt::green));
+ p.setPen(QColor(0,200,0));
else
- p.setPen(QColor(Qt::green).dark());
+ p.setPen(QColor(Qt::blue));
} else {
if (actcol == mDefaultTextColor ) {
diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h
index b686bd7..a3216d6 100644
--- a/korganizer/kodaymatrix.h
+++ b/korganizer/kodaymatrix.h
@@ -228,4 +228,5 @@ protected:
private:
+ int mLastView;
void computeEvent(Event *even, int dayindex );
int oldW, oldH;
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 843526d..ae61db6 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -1558,4 +1558,7 @@ void KOMonthView::updateView()
}
} else { // no recur
+ if ( !KOPrefs::instance()->mShowSyncEvents && event->uid().left(2) == QString("la") )
+ if ( event->uid().left(15) == QString("last-syncEvent-") )
+ continue;
int st = event->dtStart().date().daysTo( endDate );
if ( st >= 0 ) { // start before timeend
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index cb9c272..d9d7924 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -857,8 +857,5 @@ void KOPrefsDialog::setupViewsTab()
topLayout->addWidget(passwdk->checkBox(), ii++,0);
- passwdk =
- addWidBool(i18n("Show Sync Events in WN+Agenda"),
- &(KOPrefs::instance()->mShowSyncEvents),topFrame);
- topLayout->addWidget(passwdk->checkBox(), ii++,0);
+
passwdk =
addWidBool(i18n("Use short date in WN+Event view"),
@@ -954,4 +951,10 @@ dummy =
topLayout->setMargin(mMarginHint);
ii = 0;
+
+ dummy =
+ addWidBool(i18n("Show Sync Events"),
+ &(KOPrefs::instance()->mShowSyncEvents),topFrame);
+ topLayout->addWidget(dummy->checkBox(), ii++,0);
+
lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame);
topLayout->addWidget(lab ,ii++,0);
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 3aa9b6c..2e5a943 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -318,4 +318,5 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
raiseCurrentView( full, callupdate );
mMainView->adaptNavigationUnits();
+ mMainView->updateUnmanagedViews();
}
@@ -398,4 +399,5 @@ void KOViewManager::showWhatsNextView()
}
globalFlagBlockAgenda = 1;
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_WN_VIEW;
showView(mWhatsNextView, true );
//mWhatsNextView->updateView();
@@ -444,4 +446,5 @@ void KOViewManager::showListView()
mMainView->setBlockShowDates( false );
}
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW;
showView(mListView, KOPrefs::instance()->mFullViewTodo);
//mFlagShowNextxDays = temp;
@@ -511,4 +514,5 @@ void KOViewManager::showAgendaView( bool fullScreen )
}
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW;
showView( mAgendaView, full);
KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW;
@@ -569,4 +573,5 @@ void KOViewManager::showNextXView()
{
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_NX_VIEW;
globalFlagBlockAgenda = 1;
if ( mCurrentAgendaView != 3 )
@@ -656,4 +661,5 @@ void KOViewManager::showMonthViewWeek()
{
createMonthView();
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_ML_VIEW ;
globalFlagBlockAgenda = 1;
bool full = true;
@@ -684,4 +690,5 @@ void KOViewManager::showMonthView()
createMonthView();
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_M_VIEW ;
globalFlagBlockAgenda = 1;
//mFlagShowNextxDays = false;
@@ -755,4 +762,5 @@ void KOViewManager::showTodoView()
}
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ;
globalFlagBlockAgenda = 1;
showView( mTodoView, true );
@@ -773,4 +781,5 @@ void KOViewManager::showJournalView()
}
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ;
showView(mJournalView);
mMainView->dateNavigator()->selectDates( 1 );
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 95bef66..87cef20 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -187,14 +187,17 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
}
filterToolBar = new QPEToolBar ( this );
- filterMenubar = new QPEMenuBar( filterToolBar );
+ filterMenubar = new QMenuBar( filterToolBar );
QFontMetrics fm ( filterMenubar->font() );
filterPopupMenu = new QPopupMenu( this );
filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 );
- QString addTest = "Ax";
+ QString addTest = "A";
+ filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) );
#ifdef DESKTOP_VERSION
- addTest = "AAAx";
+ addTest = "AAABBBCCCx";
+#else
+ addTest = "AAx";
#endif
- filterMenubar->setFixedWidth( fm.width( i18n("No Filter")+addTest ) );
+ filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) );
addToolBar (filterToolBar , tbd );
connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) );
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 45ed04d..8fd3d24 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -124,5 +124,5 @@ class MainWindow : public QMainWindow
QPEToolBar *navigatorToolBar;
QPEToolBar *filterToolBar;
- QPEMenuBar *filterMenubar;
+ QMenuBar *filterMenubar;
QPopupMenu * filterPopupMenu;
void initActions();