summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kolistview.cpp10
-rw-r--r--korganizer/kolistview.h1
-rw-r--r--korganizer/komonthview.cpp35
-rw-r--r--korganizer/komonthview.h6
4 files changed, 35 insertions, 17 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 1b4397f..db3f802 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -325,4 +325,6 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
QObject::connect(mCalPopup,SIGNAL(activated( int )),this,
SLOT( setCalendar( int ) ));
+ QObject::connect(mPopupMenu,SIGNAL(categoryChanged( Incidence * )),this,
+ SLOT( catChanged( Incidence * ) ));
QPopupMenu * exportPO = new QPopupMenu ( this );
mPopupMenu->insertItem( i18n("Export"), exportPO );
@@ -381,4 +383,12 @@ KOListView::~KOListView()
}
+void KOListView::catChanged( Incidence* inc)
+{
+ KOListViewItem* item = getItemForEvent(inc);
+ if (item) {
+ ListItemVisitor v(item, mStartDate );
+ inc->accept(v);
+ }
+}
QString KOListView::getWhatsThisText(QPoint p)
{
diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h
index a54b550..99d0561 100644
--- a/korganizer/kolistview.h
+++ b/korganizer/kolistview.h
@@ -295,4 +295,5 @@ class KOListView : public KOEventView
protected slots:
void processSelectionChange(QListViewItem *);
+ void catChanged( Incidence* );
protected:
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 4fc447e..2289977 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -203,5 +203,5 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
}
if ( count () ) {
- if ( currentItem()+1 == count () ) {
+ if ( ((uint)currentItem()+1) == count () ) {
emit nextCell();
} else {
@@ -244,5 +244,5 @@ void KNoScrollListBox::oneDown()
{
if ( count () ) {
- if ( currentItem()+1 == count () ) {
+ if ( ((uint)currentItem()+1) == count () ) {
emit nextCell();
} else {
@@ -1293,4 +1293,6 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
SLOT(slotEditJournal()),false);
+ connect (mContextMenu ,SIGNAL(categoryChanged( Incidence * )),this,
+ SLOT( catChanged( Incidence * ) ));
@@ -1349,4 +1351,8 @@ KOMonthView::~KOMonthView()
}
+void KOMonthView::catChanged( Incidence * )
+{
+ updateView();
+}
void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int mday )
{
@@ -1361,5 +1367,5 @@ void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int
bool weekview = false;
- int index = 0;
+ uint index = 0;
for (uint i = 0; i < mCellsW.count(); ++i) {
if ( mCellsW[i] == mc ) {
@@ -1387,5 +1393,5 @@ void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int
return;
- int count = (*cells).count();
+ uint count = (*cells).count();
bool goLeft = (mday > 1 && index > 0);
bool goRight = (mday < 3 && mday > 0 && index < count -1);
@@ -1400,5 +1406,5 @@ void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int
}
if ( goRight ) {
- int right = index + iii;
+ uint right = index + iii;
if ( right < count ) {
if ( (*cells)[right]->doHighLight(inc) )
@@ -1490,5 +1496,5 @@ DateList KOMonthView::selectedDates()
return selected;
}
-
+#if 0
void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd,
const QDate &td)
@@ -1498,5 +1504,5 @@ void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd,
#endif
}
-
+#endif
void KOMonthView::updateConfig()
{
@@ -1584,5 +1590,5 @@ void KOMonthView::showDates(const QDate &start, const QDate &)
QPtrVector<QLabel> *dayLabels;
QPtrVector<KOWeekButton> *weekLabels;
- int weekNum = 6;
+ uint weekNum = 6;
mStartDate = start;
if ( mShowWeekView ) {
@@ -1610,5 +1616,4 @@ void KOMonthView::showDates(const QDate &start, const QDate &)
mStartDate = mStartDate.addDays( -1 );
}
- bool primary = false;
uint i;
for( i = 0; i < (*cells).size(); ++i ) {
@@ -1680,5 +1685,4 @@ void KOMonthView::updateView()
Event *event;
QDateTime dt;
- bool ok;
QDate endDate = mStartDate.addDays( timeSpan );
for( event = events.first(); event; event = events.next() ) { // for event
@@ -1812,4 +1816,5 @@ void KOMonthView::resizeEvent(QResizeEvent * e)
} else
mComputeLayoutTimer->start( 100 );
+ KOEventView::resizeEvent( e );
}
@@ -1862,5 +1867,4 @@ void KOMonthView::computeLayoutWeek()
int colWid = wid / daysToShow;
- int lastCol = wid - ( colWid*6 );
int dayLabelHei = mDayLabelsW[0]->sizeHint().height();
int cellHei = (hei - (5- daysToShow )*dayLabelHei) /(5- daysToShow );
@@ -1906,5 +1910,6 @@ void KOMonthView::computeLayoutWeek()
h = cellHei;
int max = 0;
- for ( i = 0; i < mCellsW.count(); ++i) {
+ int w_count = mCellsW.count();
+ for ( i = 0; i < w_count; ++i) {
if ( i > 6 ) {
mCellsW[i]->hide();
@@ -1998,5 +2003,4 @@ void KOMonthView::computeLayout()
int colWid = wid / daysToShow;
- int lastCol = wid - ( colWid*6 );
int dayLabelHei = mDayLabels[0]->sizeHint().height();
int cellHei = (hei - dayLabelHei) /6;
@@ -2033,5 +2037,6 @@ void KOMonthView::computeLayout()
h = cellHei ;
int max = 0;
- for ( i = 0; i < mCells.count(); ++i) {
+ int mc_count = mCells.count();
+ for ( i = 0; i < mc_count; ++i) {
//qDebug("iii %d ", i);
w = colWid;
@@ -2211,5 +2216,5 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e )
void KOMonthView::nextCell()
{
- bool res = focusNextPrevChild ( true );
+ focusNextPrevChild ( true );
}
void KOMonthView::prevCell()
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index a41eb54..4d62e9b 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -197,5 +197,5 @@ public slots:
void deHighLight();
void repaintfinishUpdateCell();
- protected slots:
+ protected slots:
void defaultAction( QListBoxItem * );
void contextMenu( QListBoxItem * );
@@ -251,7 +251,8 @@ class KOMonthView: public KOEventView
/** returns dates of the currently selected events */
virtual DateList selectedDates();
-
+#if 0
virtual void printPreview(CalPrinter *calPrinter,
const QDate &, const QDate &);
+#endif
bool isMonthView() { return !mShowWeekView; }
bool isUpdatePossible() { return updatePossible; }
@@ -282,4 +283,5 @@ class KOMonthView: public KOEventView
protected slots:
+ void catChanged( Incidence * );
void setKeyBoardFocus();
void slotNewTodo();