summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-04-17 10:42:07 (UTC)
committer zautrix <zautrix>2005-04-17 10:42:07 (UTC)
commitff7743ec82aa6d70325e613d0a1054c7de83a76c (patch) (side-by-side diff)
treee6d4c46a26e120817acd5ab7e47ef41b1428700b
parentfd67a473a94c5a3d63a89c52fb8f612cb19b5363 (diff)
downloadkdepimpi-ff7743ec82aa6d70325e613d0a1054c7de83a76c.zip
kdepimpi-ff7743ec82aa6d70325e613d0a1054c7de83a76c.tar.gz
kdepimpi-ff7743ec82aa6d70325e613d0a1054c7de83a76c.tar.bz2
fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt2
-rw-r--r--korganizer/komonthview.cpp95
-rw-r--r--korganizer/komonthview.h8
-rw-r--r--korganizer/koprefs.cpp1
-rw-r--r--korganizer/koprefs.h1
-rw-r--r--korganizer/koprefsdialog.cpp4
-rw-r--r--korganizer/koviewmanager.cpp7
7 files changed, 106 insertions, 12 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index 4e6f994..2981762 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1352,5 +1352,5 @@
{ "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" },
{ "Alternating background of list views","Abwechselnder Hintergrund für Listen" },
-{ "","" },
+{ "times","Zeiten" },
{ "","" },
{ "","" },
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index b175f9a..2b7e41f 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -407,10 +407,20 @@ void MonthViewItem::paint(QPainter *p)
p->setPen( palette().color( QPalette::Normal, sel ? \
QColorGroup::HighlightedText : QColorGroup::Foreground ) );
- p->drawText( x, yPos, text() );
- if ( mIncidence->cancelled() ) {
- int wid = fm.width( text() );
- p->drawLine( x, heihei/2 ,x+wid, heihei/2 );
- }
-
+ if ( KOPrefs::instance()->mMonthShowTimes || isWeekItem) {
+ p->drawText( x, yPos, text() );
+ if ( mIncidence->cancelled() ) {
+ int wid = fm.width( text() );
+ p->drawLine( x, heihei/2 ,x+wid, heihei/2 );
+ }
+ } else {
+ QString pText = text();
+ if( pText.mid(2,1) == ":" )
+ pText = pText.mid( 6 );
+ p->drawText( x, yPos, pText );
+ if ( mIncidence->cancelled() ) {
+ int wid = fm.width( pText );
+ p->drawLine( x, heihei/2 ,x+wid, heihei/2 );
+ }
+ }
}
@@ -1043,4 +1053,5 @@ void MonthViewCell::newEvent()
void MonthViewCell::cellClicked( QListBoxItem *item )
{
+ mMonthView->setSelectedCell( this );
qDebug("CELL ");
if ( item == 0 ) {
@@ -1054,6 +1065,9 @@ void MonthViewCell::cellClicked( QListBoxItem *item )
void MonthViewCell::contextMenu( QListBoxItem *item )
{
- if ( !item ) return;
-
+ mMonthView->setPopupCell( this );
+ if ( !item ) {
+ mMonthView->showContextMenu( 0 );
+ return;
+ }
MonthViewItem *eventItem = static_cast<MonthViewItem *>( item );
Incidence *incidence = eventItem->incidence();
@@ -1084,4 +1098,5 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
skipResize = false;
clPending = true;
+ mPopupCell = 0;
mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" );
mWidStack = new QWidgetStack( this );
@@ -1201,4 +1216,27 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
//connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) );
mContextMenu = eventPopup();
+ mContextMenu->addAdditionalItem(QIconSet(QPixmap()),
+ i18n("New Event..."),this,
+ SLOT(slotNewEvent()),false);
+ mContextMenu->addAdditionalItem(QIconSet(QPixmap()),
+ i18n("New Todo..."),this,
+ SLOT(slotNewTodo()),false);
+ mContextMenu->addAdditionalItem(QIconSet(QPixmap()),
+ i18n("Journal"),this,
+ SLOT(slotEditJournal()),false);
+
+
+
+ QString pathString = "";
+ if ( !KOPrefs::instance()->mToolBarMiniIcons ) {
+ if ( QApplication::desktop()->width() < 480 )
+ pathString += "icons16/";
+ } else
+ pathString += "iconsmini/";
+ mNewItemMenu = new QPopupMenu( this );
+ mNewItemMenu->insertItem( SmallIcon( pathString +"newevent" ), i18n("New Event..."),this, SLOT(slotNewEvent()));
+ mNewItemMenu->insertItem( SmallIcon( pathString +"newtodo" ),i18n("New Todo..."),this,SLOT(slotNewTodo()),false);
+ mNewItemMenu->insertItem( SmallIcon( pathString +"journal" ),i18n("Journal"),this,SLOT(slotEditJournal()),false);
+
// updateConfig(); //useless here...
// ... but we need mWidthLongDayLabel computed
@@ -1894,5 +1932,10 @@ void KOMonthView::computeLayout()
void KOMonthView::showContextMenu( Incidence *incidence )
{
- mContextMenu->showIncidencePopup(incidence);
+ if( incidence )
+ mContextMenu->showIncidencePopup(incidence);
+ else {
+ //qDebug("KOMonthView::showContextMenu ");
+ mNewItemMenu->popup(QCursor::pos());
+ }
/*
if( incidence && incidence->type() == "Event" ) {
@@ -1910,5 +1953,5 @@ MonthViewCell * KOMonthView::selectedCell( )
void KOMonthView::setSelectedCell( MonthViewCell *cell )
{
- //qDebug("KOMonthView::setSelectedCell ");
+ //qDebug("KOMonthView::setSelectedCell %d", cell);
if ( mSelectedCell && mSelectedCell != cell ) {
MonthViewCell * mvc = mSelectedCell;
@@ -2015,2 +2058,34 @@ void KOMonthView::prevCell()
focusNextPrevChild ( false );
}
+
+void KOMonthView::slotNewTodo()
+{
+ //qDebug("KOMonthView::slotNewTodo() ");
+ if ( mPopupCell ){
+ QDateTime dt( mPopupCell->date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
+ emit newTodoSignal(dt,true);
+ }
+ mPopupCell = 0;
+}
+void KOMonthView::slotNewEvent()
+{
+ if ( mPopupCell ) {
+ QDateTime dt( mPopupCell->date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
+ emit newEventSignal( dt );
+ }
+ //qDebug("KOMonthView::slotNewEvent() ");
+ mPopupCell = 0;
+}
+
+void KOMonthView::slotEditJournal()
+{
+ if ( mPopupCell )
+ emit showJournalSignal( 7, mPopupCell->date() );
+ //qDebug("KOMonthView::slotEditJournal() ");
+ mPopupCell = 0;
+}
+
+void KOMonthView::setPopupCell( MonthViewCell * c)
+{
+ mPopupCell = c;
+}
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index c6b6b5e..de5c014 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -272,4 +272,5 @@ class KOMonthView: public KOEventView
void setSelectedCell( MonthViewCell * );
+ void setPopupCell( MonthViewCell * );
void switchView();
void setKeyBoardFocus();
@@ -277,4 +278,7 @@ class KOMonthView: public KOEventView
protected slots:
+ void slotNewTodo();
+ void slotNewEvent();
+ void slotEditJournal();
void slotComputeLayout();
void selectInternalWeekNum ( int );
@@ -286,4 +290,6 @@ class KOMonthView: public KOEventView
void selectMonth ();
void showDaySignal( QDate );
+ void newTodoSignal( QDateTime, bool );
+ void showJournalSignal( int,QDate );
protected:
void resizeEvent(QResizeEvent *);
@@ -323,6 +329,8 @@ class KOMonthView: public KOEventView
MonthViewCell *mSelectedCell;
+ MonthViewCell *mPopupCell;
bool mFlagKeyPressed;
KOEventPopupMenu *mContextMenu;
+ QPopupMenu *mNewItemMenu;
void keyPressEvent ( QKeyEvent * ) ;
void keyReleaseEvent ( QKeyEvent * ) ;
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index a571ed4..34044ab 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -238,4 +238,5 @@ KOPrefs::KOPrefs() :
addItemBool("ShowShortMonthName",&mMonthShowShort,false);
addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true);
+ addItemBool("ShowTimesInMonthCell",&mMonthShowTimes,true);
#ifdef DESKTOP_VERION
addItemBool("Enable ToolTips",&mEnableToolTips,true);
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 2a0ee64..e06df1c 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -160,4 +160,5 @@ class KOPrefs : public KPimPrefs
bool mMonthWeeklyRecur;
bool mMonthShowIcons;
+ bool mMonthShowTimes;
bool mMonthShowShort;
bool mEnableToolTips;
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index ad3c61c..cb9c272 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -765,5 +765,7 @@ void KOPrefsDialog::setupViewsTab()
addWidBool(i18n("icons"),
&(KOPrefs::instance()->mMonthShowIcons),habo);
-
+ weeklyRecur =
+ addWidBool(i18n("times"),
+ &(KOPrefs::instance()->mMonthShowTimes),habo);
topLayout->addMultiCellWidget(habo,ii, ii,0,1);
ii++;
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 406e741..f1f2dd2 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -600,4 +600,11 @@ if (!mMonthView) {
// mMonthView->show();
// SIGNALS/SLOTS FOR MONTH VIEW
+
+ connect(mMonthView,SIGNAL(showJournalSignal( int, QDate )),SLOT(showDateView( int, QDate )));
+
+ connect(mMonthView, SIGNAL(newTodoSignal(QDateTime,bool)),
+ mMainView, SLOT(newTodoDateTime(QDateTime, bool)));
+
+
connect(mMonthView, SIGNAL(newEventSignal(QDateTime)),
mMainView, SLOT(newEvent(QDateTime)));