summaryrefslogtreecommitdiffabout
path: root/korganizer/koagenda.cpp
authorzautrix <zautrix>2005-01-29 16:41:15 (UTC)
committer zautrix <zautrix>2005-01-29 16:41:15 (UTC)
commit41baa2e15a1ec5e14750297e0a21020c9e53d953 (patch) (side-by-side diff)
tree2a1a1ae20928d4f2dc3ac73e9be82f04563b3604 /korganizer/koagenda.cpp
parentc6548bb194a5e73b9b72505c2e952ef6346dec46 (diff)
downloadkdepimpi-41baa2e15a1ec5e14750297e0a21020c9e53d953.zip
kdepimpi-41baa2e15a1ec5e14750297e0a21020c9e53d953.tar.gz
kdepimpi-41baa2e15a1ec5e14750297e0a21020c9e53d953.tar.bz2
fix
Diffstat (limited to 'korganizer/koagenda.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagenda.cpp59
1 files changed, 32 insertions, 27 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 73ee5cb..0eeacb3 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -165,23 +165,13 @@ 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
@@ -195,22 +185,12 @@ KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent,
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;
@@ -238,13 +218,31 @@ 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;
@@ -559,19 +557,26 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
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;