summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-04-19 19:32:54 (UTC)
committer zautrix <zautrix>2005-04-19 19:32:54 (UTC)
commitcdcb0e0d0163695c56cf7cf9bd3f046ac63173ee (patch) (side-by-side diff)
tree70cb7e2db9d7075a7c7e7c38adbad0c50e5d8dc4 /korganizer
parentb36bdf88fbf3cc78e4bf072b5eb3ec16bd8ec235 (diff)
downloadkdepimpi-cdcb0e0d0163695c56cf7cf9bd3f046ac63173ee.zip
kdepimpi-cdcb0e0d0163695c56cf7cf9bd3f046ac63173ee.tar.gz
kdepimpi-cdcb0e0d0163695c56cf7cf9bd3f046ac63173ee.tar.bz2
fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp87
-rw-r--r--korganizer/kodaymatrix.h1
-rw-r--r--korganizer/komonthview.cpp3
-rw-r--r--korganizer/koprefsdialog.cpp13
-rw-r--r--korganizer/koviewmanager.cpp9
-rw-r--r--korganizer/mainwindow.cpp13
-rw-r--r--korganizer/mainwindow.h2
7 files changed, 92 insertions, 36 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 17a1d13..df606d0 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -363,34 +363,39 @@ void KODayMatrix::computeEvent(Event *event, int i )
if ( !holiStr.isEmpty() )
holiStr += "\n";
holiStr += event->summary();
if ( !event->location().isEmpty() )
holiStr += " (" + event->location() + ")";
mHolidays[i] =holiStr ;
+ eDays.setBit(i);
}
- if ( event->isBirthday()) {
- pDays.setBit(i);
- if ( !holiStr.isEmpty() )
- holiStr += "\n";
- holiStr += i18n("Birthday") + ": "+event->summary();
- if ( !event->location().isEmpty() )
- holiStr += " (" + event->location() + ")";
- bDays.setBit(i);
- mHolidays[i] =holiStr ;
+ if ( KOPrefs::instance()->mCurrentDisplayedView != VIEW_T_VIEW && KOPrefs::instance()->mCurrentDisplayedView != VIEW_J_VIEW ) {
+ if ( event->isBirthday()) {
+ pDays.setBit(i);
+ if ( !holiStr.isEmpty() )
+ holiStr += "\n";
+ holiStr += i18n("Birthday") + ": "+event->summary();
+ if ( !event->location().isEmpty() )
+ holiStr += " (" + event->location() + ")";
+ bDays.setBit(i);
+ mHolidays[i] =holiStr ;
+ }
}
- eDays.setBit(i);
+ if ( KOPrefs::instance()->mCurrentDisplayedView != VIEW_J_VIEW )
+ eDays.setBit(i);
}
void KODayMatrix::updateViewTimed()
{
mUpdateTimer->stop();
if ( !mCalendar ) {
qDebug("NOT CAL ");
return;
}
#if 1
+
int i;
int timeSpan = NUMDAYS-1;
QPtrList<Event> events = mCalendar->events();
Event *event;
QDateTime dt;
bool ok;
@@ -466,28 +471,58 @@ void KODayMatrix::updateViewTimed()
int startDay = days[0].dayOfWeek(); // 1...7 7 = sunday
for(i = 0; i < NUMDAYS; i++) {
if ( ( (i+startDay) % 7 == 0 ) ) {
pDays.setBit(i);
}
}
-
-#if 0
- // insert due todos
- QPtrList<Todo> todos = calendar()->todos( );
- Todo *todo;
- for(todo = todos.first(); todo; todo = todos.next()) {
- //insertTodo( todo );
- if ( todo->hasDueDate() ) {
- int day = mStartDate.daysTo( todo->dtDue().date() );
+ if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) {
+ bDays.fill( false);
+ // insert due todos
+ QPtrList<Todo> todos = mCalendar->todos( );
+ Todo *todo;
+ for(todo = todos.first(); todo; todo = todos.next()) {
+ //insertTodo( todo );
+ if ( todo->hasDueDate() ) {
+ int day = mStartDate.daysTo( todo->dtDue().date() );
+ if ( day >= 0 && day < timeSpan + 1) {
+ 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);
+ }
+ }
+ }
+ }
+ 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) {
- (*cells)[day]->insertTodo( todo );
+ 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);
+
}
}
}
-#endif
-
#else
//qDebug("KODayMatrix::updateViewTimed ");
for(int i = 0; i < NUMDAYS; i++) {
// if events are set for the day then remember to draw it bold
QPtrList<Event> eventlist = mCalendar->events(days[i]);
Event *event;
@@ -533,13 +568,15 @@ void KODayMatrix::updateViewTimed()
mRedrawNeeded = true;
if ( ! mPendingUpdateBeforeRepaint )
repaint(false);
}
void KODayMatrix::updateView(QDate actdate)
{
-
+ if ( mLastView != KOPrefs::instance()->mCurrentDisplayedView )
+ mRedrawNeeded = true;
+ mLastView = KOPrefs::instance()->mCurrentDisplayedView;
if ( ! actdate.isValid() ) {
//qDebug("date not valid ");
return;
}
mDayChanged = false;
//flag to indicate if the starting day of the matrix has changed by this call
@@ -1049,15 +1086,15 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
}
// if it is a holiday then use the default holiday color
if ( pDays.testBit(i)) {
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 ) {
p.setPen(KOPrefs::instance()->mHolidayColor);
} else {
p.setPen(mHolidayColorShaded);
}
diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h
index b686bd7..a3216d6 100644
--- a/korganizer/kodaymatrix.h
+++ b/korganizer/kodaymatrix.h
@@ -224,12 +224,13 @@ protected:
void dropEvent(QDropEvent *);
void resizeEvent(QResizeEvent *);
private:
+ int mLastView;
void computeEvent(Event *even, int dayindex );
int oldW, oldH;
bool mRedrawNeeded;
KODaymatrixWhatsThis* mKODaymatrixWhatsThis;
bool mouseDown;
QBitArray bDays;
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 843526d..ae61db6 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -1554,12 +1554,15 @@ void KOMonthView::updateView()
if ( ! ok )
break;
if ( incidenceStart.date() > endDate )
break;
}
} 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
int end = mStartDate.daysTo( event->dtEnd().date() );
if ( end >= 0 ) { // end after timestart --- got one!
//normalize
st = timeSpan - st;
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index cb9c272..d9d7924 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -853,16 +853,13 @@ void KOPrefsDialog::setupViewsTab()
passwdk =
addWidBool(i18n("Show location"),
&(KOPrefs::instance()->mWNViewShowLocation),topFrame);
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"),
&(KOPrefs::instance()->mShortDateInViewer),topFrame);
topLayout->addWidget(passwdk->checkBox(), ii++,0);
@@ -949,13 +946,19 @@ dummy =
topFrame = addPage(i18n("View Options"),0,0);
topLayout = new QGridLayout(topFrame,4,1);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
- ii = 0;
+ 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);
dummy = addWidBool(i18n("Details"),
&(KOPrefs::instance()->mEVshowDetails),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 3aa9b6c..2e5a943 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -314,12 +314,13 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
if ( mAgendaView ) mAgendaView->deleteSelectedDateTime();
//raiseCurrentView( full );
mMainView->processIncidenceSelection( 0 );
//mMainView->updateView();
raiseCurrentView( full, callupdate );
mMainView->adaptNavigationUnits();
+ mMainView->updateUnmanagedViews();
}
void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView )
{
mCurrentAgendaView = 0;
if ( fullScreen ) {
@@ -394,12 +395,13 @@ void KOViewManager::showWhatsNextView()
connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig()));
addView(mWhatsNextView);
connect(this, SIGNAL( printWNV() ),
mWhatsNextView, SLOT( printMe() ) );
}
globalFlagBlockAgenda = 1;
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_WN_VIEW;
showView(mWhatsNextView, true );
//mWhatsNextView->updateView();
KOPrefs::instance()->mCurrentDisplayedView = VIEW_WN_VIEW;
}
void KOViewManager::slotprintWNV()
@@ -440,12 +442,13 @@ void KOViewManager::showListView()
globalFlagBlockAgenda = 1;
if ( KOPrefs::instance()->mListViewMonthTimespan ) {
mMainView->setBlockShowDates( true );
mMainView->dateNavigator()->selectMonth();
mMainView->setBlockShowDates( false );
}
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW;
showView(mListView, KOPrefs::instance()->mFullViewTodo);
//mFlagShowNextxDays = temp;
KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW;
}
void KOViewManager::showAgendaView( bool fullScreen )
@@ -507,12 +510,13 @@ void KOViewManager::showAgendaView( bool fullScreen )
connect( mAgendaView, SIGNAL( selectWeekNum( int ) ),
mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) );
mAgendaView->readSettings();
mAgendaView->updateConfig();
}
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW;
showView( mAgendaView, full);
KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW;
}
void KOViewManager::showDayView()
{
@@ -565,12 +569,13 @@ void KOViewManager::showWeekView()
mCurrentAgendaView = 7 ;
}
void KOViewManager::showNextXView()
{
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_NX_VIEW;
globalFlagBlockAgenda = 1;
if ( mCurrentAgendaView != 3 )
mCurrentAgendaView = -1;
showAgendaView(KOPrefs::instance()->mFullViewMonth);
globalFlagBlockAgenda = 2;
mMainView->dateNavigator()->selectDates( QDate::currentDate(),
@@ -652,12 +657,13 @@ if (!mMonthView) {
}
}
void KOViewManager::showMonthViewWeek()
{
createMonthView();
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_ML_VIEW ;
globalFlagBlockAgenda = 1;
bool full = true;
if ( mCurrentView == mMonthView)
full = mMainView->leftFrame()->isVisible();
if ( !KOPrefs::instance()->mMonthViewWeek ) {
mMonthView->switchView();
@@ -680,12 +686,13 @@ void KOViewManager::showMonth( const QDate & date )
showMonthView();
}
void KOViewManager::showMonthView()
{
createMonthView();
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_M_VIEW ;
globalFlagBlockAgenda = 1;
//mFlagShowNextxDays = false;
bool full = true;
if ( mCurrentView == mMonthView)
full = mMainView->leftFrame()->isVisible();
// if(mMonthView == mCurrentView) return;
@@ -751,12 +758,13 @@ void KOViewManager::showTodoView()
mMainView, SLOT ( beamIncidence( Incidence * ) ) );
KConfig *config = KOGlobals::config();
mTodoView->restoreLayout(config,"Todo View");
mTodoView->setNavigator( mMainView->dateNavigator() );
}
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ;
globalFlagBlockAgenda = 1;
showView( mTodoView, true );
KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ;
}
@@ -769,12 +777,13 @@ void KOViewManager::showJournalView()
connect( mMainView, SIGNAL( configChanged() ), mJournalView,
SLOT( updateConfig() ) );
connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) );
addView(mJournalView);
}
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ;
showView(mJournalView);
mMainView->dateNavigator()->selectDates( 1 );
KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ;
}
void KOViewManager::showTimeSpanView()
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 95bef66..87cef20 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -183,22 +183,25 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
if ( p->mToolBarUpF )
tbd = Right;
else
tbd = Left;
}
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";
-#endif
- filterMenubar->setFixedWidth( fm.width( i18n("No Filter")+addTest ) );
+ addTest = "AAABBBCCCx";
+#else
+ addTest = "AAx";
+#endif
+ filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) );
addToolBar (filterToolBar , tbd );
connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) );
connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) );
if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar )
filterToolBar->hide();
} else {
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 45ed04d..8fd3d24 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -120,13 +120,13 @@ class MainWindow : public QMainWindow
bool mFlagKeyPressed;
bool mBlockAtStartup;
QPEToolBar *iconToolBar;
QPEToolBar *viewToolBar;
QPEToolBar *navigatorToolBar;
QPEToolBar *filterToolBar;
- QPEMenuBar *filterMenubar;
+ QMenuBar *filterMenubar;
QPopupMenu * filterPopupMenu;
void initActions();
void setDefaultPreferences();
void resizeEvent( QResizeEvent* e);
void keyPressEvent ( QKeyEvent * ) ;
void keyReleaseEvent ( QKeyEvent * ) ;