summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-04-17 10:42:07 (UTC)
committer zautrix <zautrix>2005-04-17 10:42:07 (UTC)
commitff7743ec82aa6d70325e613d0a1054c7de83a76c (patch) (unidiff)
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
@@ -1353,3 +1353,3 @@
1353{ "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, 1353{ "Alternating background of list views","Abwechselnder Hintergrund für Listen" },
1354{ "","" }, 1354{ "times","Zeiten" },
1355{ "","" }, 1355{ "","" },
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index b175f9a..2b7e41f 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -408,8 +408,18 @@ void MonthViewItem::paint(QPainter *p)
408 QColorGroup::HighlightedText : QColorGroup::Foreground ) ); 408 QColorGroup::HighlightedText : QColorGroup::Foreground ) );
409 p->drawText( x, yPos, text() ); 409 if ( KOPrefs::instance()->mMonthShowTimes || isWeekItem) {
410 if ( mIncidence->cancelled() ) { 410 p->drawText( x, yPos, text() );
411 int wid = fm.width( text() ); 411 if ( mIncidence->cancelled() ) {
412 p->drawLine( x, heihei/2 ,x+wid, heihei/2 ); 412 int wid = fm.width( text() );
413 } 413 p->drawLine( x, heihei/2 ,x+wid, heihei/2 );
414 414 }
415 } else {
416 QString pText = text();
417 if( pText.mid(2,1) == ":" )
418 pText = pText.mid( 6 );
419 p->drawText( x, yPos, pText );
420 if ( mIncidence->cancelled() ) {
421 int wid = fm.width( pText );
422 p->drawLine( x, heihei/2 ,x+wid, heihei/2 );
423 }
424 }
415} 425}
@@ -1044,2 +1054,3 @@ void MonthViewCell::cellClicked( QListBoxItem *item )
1044{ 1054{
1055 mMonthView->setSelectedCell( this );
1045 qDebug("CELL "); 1056 qDebug("CELL ");
@@ -1055,4 +1066,7 @@ void MonthViewCell::contextMenu( QListBoxItem *item )
1055{ 1066{
1056 if ( !item ) return; 1067 mMonthView->setPopupCell( this );
1057 1068 if ( !item ) {
1069 mMonthView->showContextMenu( 0 );
1070 return;
1071 }
1058 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); 1072 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item );
@@ -1085,2 +1099,3 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
1085 clPending = true; 1099 clPending = true;
1100 mPopupCell = 0;
1086 mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" ); 1101 mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" );
@@ -1202,2 +1217,25 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
1202 mContextMenu = eventPopup(); 1217 mContextMenu = eventPopup();
1218 mContextMenu->addAdditionalItem(QIconSet(QPixmap()),
1219 i18n("New Event..."),this,
1220 SLOT(slotNewEvent()),false);
1221 mContextMenu->addAdditionalItem(QIconSet(QPixmap()),
1222 i18n("New Todo..."),this,
1223 SLOT(slotNewTodo()),false);
1224 mContextMenu->addAdditionalItem(QIconSet(QPixmap()),
1225 i18n("Journal"),this,
1226 SLOT(slotEditJournal()),false);
1227
1228
1229
1230 QString pathString = "";
1231 if ( !KOPrefs::instance()->mToolBarMiniIcons ) {
1232 if ( QApplication::desktop()->width() < 480 )
1233 pathString += "icons16/";
1234 } else
1235 pathString += "iconsmini/";
1236 mNewItemMenu = new QPopupMenu( this );
1237 mNewItemMenu->insertItem( SmallIcon( pathString +"newevent" ), i18n("New Event..."),this, SLOT(slotNewEvent()));
1238 mNewItemMenu->insertItem( SmallIcon( pathString +"newtodo" ),i18n("New Todo..."),this,SLOT(slotNewTodo()),false);
1239 mNewItemMenu->insertItem( SmallIcon( pathString +"journal" ),i18n("Journal"),this,SLOT(slotEditJournal()),false);
1240
1203 // updateConfig(); //useless here... 1241 // updateConfig(); //useless here...
@@ -1895,3 +1933,8 @@ void KOMonthView::showContextMenu( Incidence *incidence )
1895{ 1933{
1896 mContextMenu->showIncidencePopup(incidence); 1934 if( incidence )
1935 mContextMenu->showIncidencePopup(incidence);
1936 else {
1937 //qDebug("KOMonthView::showContextMenu ");
1938 mNewItemMenu->popup(QCursor::pos());
1939 }
1897 /* 1940 /*
@@ -1911,3 +1954,3 @@ void KOMonthView::setSelectedCell( MonthViewCell *cell )
1911{ 1954{
1912 //qDebug("KOMonthView::setSelectedCell "); 1955 //qDebug("KOMonthView::setSelectedCell %d", cell);
1913 if ( mSelectedCell && mSelectedCell != cell ) { 1956 if ( mSelectedCell && mSelectedCell != cell ) {
@@ -2016 +2059,33 @@ void KOMonthView::prevCell()
2016} 2059}
2060
2061void KOMonthView::slotNewTodo()
2062{
2063 //qDebug("KOMonthView::slotNewTodo() ");
2064 if ( mPopupCell ){
2065 QDateTime dt( mPopupCell->date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
2066 emit newTodoSignal(dt,true);
2067 }
2068 mPopupCell = 0;
2069}
2070void KOMonthView::slotNewEvent()
2071{
2072 if ( mPopupCell ) {
2073 QDateTime dt( mPopupCell->date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
2074 emit newEventSignal( dt );
2075 }
2076 //qDebug("KOMonthView::slotNewEvent() ");
2077 mPopupCell = 0;
2078}
2079
2080void KOMonthView::slotEditJournal()
2081{
2082 if ( mPopupCell )
2083 emit showJournalSignal( 7, mPopupCell->date() );
2084 //qDebug("KOMonthView::slotEditJournal() ");
2085 mPopupCell = 0;
2086}
2087
2088void KOMonthView::setPopupCell( MonthViewCell * c)
2089{
2090 mPopupCell = c;
2091}
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index c6b6b5e..de5c014 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -273,2 +273,3 @@ class KOMonthView: public KOEventView
273 void setSelectedCell( MonthViewCell * ); 273 void setSelectedCell( MonthViewCell * );
274 void setPopupCell( MonthViewCell * );
274 void switchView(); 275 void switchView();
@@ -278,2 +279,5 @@ class KOMonthView: public KOEventView
278 protected slots: 279 protected slots:
280 void slotNewTodo();
281 void slotNewEvent();
282 void slotEditJournal();
279 void slotComputeLayout(); 283 void slotComputeLayout();
@@ -287,2 +291,4 @@ class KOMonthView: public KOEventView
287 void showDaySignal( QDate ); 291 void showDaySignal( QDate );
292 void newTodoSignal( QDateTime, bool );
293 void showJournalSignal( int,QDate );
288 protected: 294 protected:
@@ -324,4 +330,6 @@ class KOMonthView: public KOEventView
324 MonthViewCell *mSelectedCell; 330 MonthViewCell *mSelectedCell;
331 MonthViewCell *mPopupCell;
325 bool mFlagKeyPressed; 332 bool mFlagKeyPressed;
326 KOEventPopupMenu *mContextMenu; 333 KOEventPopupMenu *mContextMenu;
334 QPopupMenu *mNewItemMenu;
327 void keyPressEvent ( QKeyEvent * ) ; 335 void keyPressEvent ( QKeyEvent * ) ;
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index a571ed4..34044ab 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -239,2 +239,3 @@ KOPrefs::KOPrefs() :
239 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); 239 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true);
240 addItemBool("ShowTimesInMonthCell",&mMonthShowTimes,true);
240#ifdef DESKTOP_VERION 241#ifdef DESKTOP_VERION
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 2a0ee64..e06df1c 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -161,2 +161,3 @@ class KOPrefs : public KPimPrefs
161 bool mMonthShowIcons; 161 bool mMonthShowIcons;
162 bool mMonthShowTimes;
162 bool mMonthShowShort; 163 bool mMonthShowShort;
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index ad3c61c..cb9c272 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -766,3 +766,5 @@ void KOPrefsDialog::setupViewsTab()
766 &(KOPrefs::instance()->mMonthShowIcons),habo); 766 &(KOPrefs::instance()->mMonthShowIcons),habo);
767 767 weeklyRecur =
768 addWidBool(i18n("times"),
769 &(KOPrefs::instance()->mMonthShowTimes),habo);
768 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 770 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 406e741..f1f2dd2 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -601,2 +601,9 @@ if (!mMonthView) {
601 // SIGNALS/SLOTS FOR MONTH VIEW 601 // SIGNALS/SLOTS FOR MONTH VIEW
602
603 connect(mMonthView,SIGNAL(showJournalSignal( int, QDate )),SLOT(showDateView( int, QDate )));
604
605 connect(mMonthView, SIGNAL(newTodoSignal(QDateTime,bool)),
606 mMainView, SLOT(newTodoDateTime(QDateTime, bool)));
607
608
602 connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), 609 connect(mMonthView, SIGNAL(newEventSignal(QDateTime)),