summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt8
-rw-r--r--korganizer/calendarview.cpp1
-rw-r--r--korganizer/koagenda.cpp59
-rw-r--r--korganizer/koagenda.h1
-rw-r--r--korganizer/koagendaview.cpp3
-rw-r--r--korganizer/koagendaview.h1
-rw-r--r--korganizer/koviewmanager.cpp50
-rw-r--r--korganizer/koviewmanager.h1
8 files changed, 93 insertions, 31 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index 6a20868..8572bf9 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1185,17 +1185,21 @@
{ "private","privat" },
{ "confidential","vertraul." },
{ "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" },
{ "Yesterday","Gestern" },
{ "Day after tomorrow","Übermorgen" },
{ "Tomorrow","Morgen" },
{ "Day before yesterday","Vorgestern" },
{ "Size %1","Größe %1" },
{ "New Agendasize: %1","Neue Agendagröße: %1" },
{ " (%1 y.)"," (%1 J.)" },
{ "Allday:","Ganztägig:" },
{ "compl.todos","erled.Todos" },
-{ "","" },
-{ "","" },
+{ "Day view","Tagesansicht" },
+{ "Next days","Nächste Tage" },
+{ "Next week","Nächste Woche" },
+{ "Next two weeks","Nächste zwei Wochen" },
+{ "Next month","Nächster Monat" },
+{ "Journal view","Journal" },
{ "","" },
{ "","" },
{ "","" },
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 035d630..e7b6755 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2680,25 +2680,24 @@ void CalendarView::todoToBeDeleted(Todo *)
//qDebug("todoToBeDeleted(Todo *) ");
updateTodoViews();
}
void CalendarView::todoDeleted()
{
//qDebug(" todoDeleted()");
updateTodoViews();
}
void CalendarView::newTodoDateTime( QDateTime dt, bool allday )
{
- qDebug("datetime ");
showTodoEditor();
mTodoEditor->newTodo(dt,0,allday);
if ( mFilterView->filtersEnabled() ) {
CalFilter *filter = mFilterView->selectedFilter();
if (filter && filter->showCategories()) {
mTodoEditor->setCategories(filter->categoryList().join(",") );
}
if ( filter )
mTodoEditor->setSecrecy( filter->getSecrecy() );
}
}
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 73ee5cb..0eeacb3 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -159,64 +159,44 @@ void MarcusBains::updateLocation(bool recalculate)
////////////////////////////////////////////////////////////////////////////
/*
Create an agenda widget with rows rows and columns columns.
*/
KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent,
const char *name,WFlags f) :
QScrollView(parent,name,f)
{
- mNewItemPopup = new QPopupMenu( this );
- connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) );
- QString pathString = "";
- if ( !KOPrefs::instance()->mToolBarMiniIcons ) {
- if ( QApplication::desktop()->width() < 480 )
- pathString += "icons16/";
- } else
- pathString += "iconsmini/";
-
- mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 );
- mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 );
+
mColumns = columns;
mRows = rows;
mGridSpacingY = rowSize;
mAllDayMode = false;
#ifndef DESKTOP_VERSION
QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
#endif
mHolidayMask = 0;
init();
}
/*
Create an agenda widget with columns columns and one row. This is used for
all-day events.
*/
KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,WFlags f) :
QScrollView(parent,name,f)
{
- mNewItemPopup = new QPopupMenu( this );
- connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) );
- QString pathString = "";
- if ( !KOPrefs::instance()->mToolBarMiniIcons ) {
- if ( QApplication::desktop()->width() < 480 )
- pathString += "icons16/";
- } else
- pathString += "iconsmini/";
- mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."),1 );
- mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 );
blockResize = false;
mColumns = columns;
mRows = 1;
//qDebug("aaaaaaaaaaaaaaaaaaldays %d ", KOPrefs::instance()->mAllDaySize);
mGridSpacingY = KOPrefs::instance()->mAllDaySize;
mAllDayMode = true;
#ifndef DESKTOP_VERSION
QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
#endif
mHolidayMask = 0;
init();
}
@@ -232,25 +212,43 @@ Incidence *KOAgenda::selectedIncidence() const
{
return (mSelectedItem ? mSelectedItem->incidence() : 0);
}
QDate KOAgenda::selectedIncidenceDate() const
{
return (mSelectedItem ? mSelectedItem->itemDate() : QDate());
}
void KOAgenda::init()
-{
+{
+ mNewItemPopup = new QPopupMenu( this );
+ connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) );
+ QString pathString = "";
+ if ( !KOPrefs::instance()->mToolBarMiniIcons ) {
+ if ( QApplication::desktop()->width() < 480 )
+ pathString += "icons16/";
+ } else
+ pathString += "iconsmini/";
+
+ mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 );
+ mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 );
+ mNewItemPopup->insertSeparator ( );
+ mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 );
+ mNewItemPopup->insertItem ( SmallIcon( pathString +"xdays" ), i18n("Next days"),8 );
+ mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next week"),4 );
+ mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 );
+ mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next month"),6 );
+ mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 );
#ifndef _WIN32_
int wflags = viewport()-> getWFlags() |WRepaintNoErase;//WResizeNoErase
viewport()->setWFlags ( wflags);
#endif
mGridSpacingX = 80;
mResizeBorderWidth = 8;
mScrollBorderWidth = 8;
mScrollDelay = 30;
mScrollOffset = 10;
mPaintPixmap.resize( 20,20);
//enableClipper(true);
@@ -553,31 +551,38 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
}
break;
default:
break;
}
return true;
}
void KOAgenda::newItem( int item )
{
- qDebug("new %d ", item);
if ( item == 1 ) { //new event
newEventSignal(mStartCellX ,mStartCellY );
- }
- if ( item == 2 ) { //new event
- newTodoSignal(mStartCellX ,mStartCellY );
- }
+ } else
+ if ( item == 2 ) { //new event
+ newTodoSignal(mStartCellX ,mStartCellY );
+ } else
+ {
+ QDate day = mSelectedDates[mStartCellX];
+ emit showDateView( item, day );
+ // 3Day view
+ // 4Week view
+ // 5Month view
+ // 6Journal view
+ }
}
void KOAgenda::startSelectAction(QPoint viewportPos)
{
//emit newStartSelectSignal();
mActionType = SELECT;
int x,y;
viewportToContents(viewportPos.x(),viewportPos.y(),x,y);
int gx,gy;
contentsToGrid(x,y,gx,gy);
diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h
index 12943d7..2069b22 100644
--- a/korganizer/koagenda.h
+++ b/korganizer/koagenda.h
@@ -135,24 +135,25 @@ class KOAgenda : public QScrollView
void checkScrollBoundaries(int);
/** Deselect selected items. This function does not emit any signals. */
void deselectItem();
/** Select item. If the argument is 0, the currently selected item gets
deselected. This function emits the itemSelected(bool) signal to inform
about selection/deseelction of events. */
void selectItem(KOAgendaItem *);
void finishResize();
signals:
+ void showDateView( int, QDate );
void newEventSignal();
void newEventSignal(int gx,int gy);
void newTodoSignal(int gx,int gy);
void newEventSignal(int gxStart, int gyStart, int gxEnd, int gyEnd);
void newTimeSpanSignal(int gxStart, int gyStart, int gxEnd, int gyEnd);
void newStartSelectSignal();
void showIncidenceSignal(Incidence *);
void editIncidenceSignal(Incidence *);
void deleteIncidenceSignal(Incidence *);
void showIncidencePopupSignal(Incidence *);
void itemModified(KOAgendaItem *item, int );
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 60ae41f..e0a1a21 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -476,24 +476,27 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
// these blank widgets make the All Day Event box line up with the agenda
dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width());
dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width());
mDummyAllDayLeft->setFixedWidth(mTimeLabels->width());
// Scrolling
connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)),
mTimeLabels, SLOT(positionChanged()));
connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)),
SLOT(setContentsPos(int)));
+ connect(mAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate )));
+ connect(mAllDayAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate )));
+
// Create/Show/Edit/Delete Event
connect(mAgenda,SIGNAL(newEventSignal(int,int)),
SLOT(newEvent(int,int)));
connect(mAgenda,SIGNAL(newTodoSignal(int,int)),
SLOT(newTodo(int,int)));
connect(mAgenda,SIGNAL(newEventSignal(int,int,int,int)),
SLOT(newEvent(int,int,int,int)));
connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int)),
SLOT(newEventAllDay(int,int)));
connect(mAllDayAgenda,SIGNAL(newTodoSignal(int,int)),
SLOT(newTodoAllDay(int,int)));
connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int,int,int)),
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h
index 01d74a1..7774fbe 100644
--- a/korganizer/koagendaview.h
+++ b/korganizer/koagendaview.h
@@ -173,24 +173,25 @@ class KOAgendaView : public KOEventView {
void readSettings();
void readSettings(KConfig *);
void writeSettings(KConfig *);
void setContentsPos(int y);
void setExpandedButton( bool expanded );
void scrollOneHourUp();
void scrollOneHourDown();
void addToCalSlot(Incidence *, Incidence *);
signals:
+ void showDateView( int, QDate );
void newTodoSignal( QDateTime ,bool );
void toggleExpand();
void todoMoved( Todo *, int );
void incidenceChanged(Incidence * , int );
// void cloneIncidenceSignal(Incidence *);
protected:
bool mBlockUpdating;
int mUpcomingWidth;
/** Fill agenda beginning with date startDate */
void fillAgenda(const QDate &startDate);
void resizeEvent( QResizeEvent* e );
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index a88276e..6da4799 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -89,24 +89,72 @@ void KOViewManager::readSettings(KConfig *config)
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());
+#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;
+ showAgendaView(KOPrefs::instance()->mFullViewMonth);
+ globalFlagBlockAgenda = 2;
+ mMainView->dateNavigator()->selectDates( date ,
+ KOPrefs::instance()->mNextXDays );
+ mFlagShowNextxDays = true;
+ mCurrentAgendaView = 3 ;
+ }
+
+#if 0
+ dateNavigator()->blockSignals( true );
+ dateNavigator()->selectDate( d );
+ dateNavigator()->blockSignals( false );
+ mViewManager->showDayView();
+#endif
+
+}
+
+
+
void KOViewManager::writeSettings(KConfig *config)
{
config->setGroup("General");
QString view;
if (mCurrentView == mWhatsNextView) view = "WhatsNext";
else if (mCurrentView == mMonthView) view = "Month";
else if (mCurrentView == mListView) view = "List";
else if (mCurrentView == mJournalView) view = "Journal";
else if (mCurrentView == mTimeSpanView) view = "TimeSpan";
else if (mCurrentView == mTodoView) view = "Todo";
else view = "Agenda";
@@ -299,25 +347,25 @@ void KOViewManager::showAgendaView( bool fullScreen )
if (!mAgendaView) {
full = false;
mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView");
addView(mAgendaView);
#ifndef DESKTOP_VERSION
QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold );
#endif
connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )),
mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) ));
// SIGNALS/SLOTS FOR DAY/WEEK VIEW
-
+ connect(mAgendaView,SIGNAL(showDateView( int, QDate )),SLOT(showDateView( int, QDate )));
connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)),
mMainView, SLOT(newTodoDateTime(QDateTime,bool)));
connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)),
mMainView, SLOT(newEvent(QDateTime)));
connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)),
mMainView, SLOT(newEvent(QDateTime,QDateTime)));
connect(mAgendaView,SIGNAL(newEventSignal(QDate)),
mMainView, SLOT(newEvent(QDate)));
connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)),
mMainView, SLOT(editIncidence(Incidence *)));
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h
index c8c7a7a..137eb2d 100644
--- a/korganizer/koviewmanager.h
+++ b/korganizer/koviewmanager.h
@@ -73,24 +73,25 @@ class KOViewManager : public QObject
void addView(KOrg::BaseView *);
Incidence *currentSelection();
QDate currentSelectionDate();
KOAgendaView *agendaView() const { return mAgendaView; }
signals:
void printWNV();
void signalFullScreen( bool );
void signalAgendaView( bool );
public slots:
+ void showDateView( int, QDate );
void updateView();
void showWhatsNextView();
void showListView();
void showAgendaView( bool fullScreen = false );
void showDayView();
void showWorkWeekView();
void showWeekView();
void showNextXView();
void showMonthView();
void showTodoView();
void showJournalView();
void showTimeSpanView();