summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp16
-rw-r--r--korganizer/koagenda.cpp25
-rw-r--r--korganizer/koagendaitem.cpp18
-rw-r--r--korganizer/koagendaitem.h1
-rw-r--r--korganizer/koeventviewerdialog.cpp11
5 files changed, 68 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 1009956..d6918d3 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -477,12 +477,13 @@ CalendarView::~CalendarView()
//qDebug("CalendarView::~CalendarView() ");
delete mDialogManager;
delete mViewManager;
delete mStorage;
delete mDateFrame ;
delete beamDialog;
+ delete mEventViewerDialog;
//kdDebug() << "~CalendarView() done" << endl;
}
void CalendarView::showDay( QDate d )
{
dateNavigator()->blockSignals( true );
@@ -2524,13 +2525,19 @@ void CalendarView::showDatePicker( )
mDatePicker->setDate( mNavigator->selectedDates().first() );
}
void CalendarView::showEventEditor()
{
#ifdef DESKTOP_VERSION
+ int x,y,w,h;
+ x = mEventEditor->geometry().x();
+ y = mEventEditor->geometry().y();
+ w = mEventEditor->width();
+ h = mEventEditor->height();
mEventEditor->show();
+ mEventEditor->setGeometry(x,y,w,h);
#else
if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) {
topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() );
qApp->processEvents();
delete mEventEditor;
@@ -2540,13 +2547,19 @@ void CalendarView::showEventEditor()
mEventEditor->showMaximized();
#endif
}
void CalendarView::showTodoEditor()
{
#ifdef DESKTOP_VERSION
+ int x,y,w,h;
+ x = mTodoEditor->geometry().x();
+ y = mTodoEditor->geometry().y();
+ w = mTodoEditor->width();
+ h = mTodoEditor->height();
mTodoEditor->show();
+ mTodoEditor->setGeometry(x,y,w,h);
#else
if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) {
topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() );
qApp->processEvents();
delete mTodoEditor;
@@ -2790,13 +2803,13 @@ void CalendarView::editTodo( Todo *todo )
}
KOEventViewerDialog* CalendarView::getEventViewerDialog()
{
if ( !mEventViewerDialog ) {
- mEventViewerDialog = new KOEventViewerDialog(this);
+ mEventViewerDialog = new KOEventViewerDialog(0);
connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) );
connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig()));
connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)),
dateNavigator(), SLOT( selectWeek( const QDate & ) ) );
connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ),
viewManager(), SLOT( showAgendaView( bool ) ) );
@@ -3964,11 +3977,12 @@ void CalendarView::resetFocus()
} else
mViewerCallerIsSearchDialog = false;
}
if ( !mViewerCallerIsSearchDialog ) {
//mViewManager->currentView()->setFocus();
//qDebug("sssssssssssssssset focus ");
+ topLevelWidget()->raise();
setActiveWindow();
//setFocus();
}
mViewerCallerIsSearchDialog = false;
}
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 195b1fa..ec81d44 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -1178,13 +1178,36 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch)
}
void KOAgenda::finishUpdate()
{
KOAgendaItem *item;
- globalFlagBlockAgendaItemPaint = 1;
+ globalFlagBlockAgendaItemPaint = 1;
+ // Adjust sub cell geometry of all conflict items of all conflict items of all conflict items ... of the conflict item with the max number of conflictitems
+ for ( item=mItems.first(); item != 0; item=mItems.next() ) {
+ if ( !item->checkLayout() ) {
+ //qDebug(" conflictitem found ");
+ int newSubCellWidth;
+ if (mAllDayMode) newSubCellWidth = mGridSpacingY / item->subCells();
+ else newSubCellWidth = mGridSpacingX / item->subCells();
+
+ if (mAllDayMode) {
+ item->resize(item->cellWidth() * mGridSpacingX, newSubCellWidth);
+ } else {
+ item->resize(newSubCellWidth, item->cellHeight() * mGridSpacingY);
+ }
+ int x,y;
+ gridToContents(item->cellX(),item->cellYTop(),x,y);
+ if (mAllDayMode) {
+ y += item->subCell() * newSubCellWidth;
+ } else {
+ x += item->subCell() * newSubCellWidth;
+ }
+ moveChild(item,x,y);
+ }
+ }
for ( item=mItems.first(); item != 0; item=mItems.next() ) {
if ( !item->isVisible() )
item->show();
}
globalFlagBlockAgendaItemUpdate = 0;
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 38bd93a..042a789 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -761,6 +761,24 @@ void KOAgendaItem::setConflictItems(QPtrList<KOAgendaItem> ci)
void KOAgendaItem::addConflictItem(KOAgendaItem *ci)
{
if (mConflictItems.find(ci)<0)
mConflictItems.append(ci);
}
+
+bool KOAgendaItem::checkLayout()
+{
+ if ( !mConflictItems.count() )
+ return true;
+ int max = 0;
+ KOAgendaItem *item;
+ for ( item=mConflictItems.first(); item != 0;
+ item=mConflictItems.next() ) {
+ if ( item->subCells() > max )
+ max = item->subCells();
+ }
+ if ( max > subCells() ) {
+ setSubCells( max );
+ return false;
+ }
+ return true;
+}
diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h
index 5b8f420..b4dba79 100644
--- a/korganizer/koagendaitem.h
+++ b/korganizer/koagendaitem.h
@@ -104,12 +104,13 @@ class KOAgendaItem : public QWidget
static QPixmap * paintPix();
static QPixmap * paintPixSel();
static QPixmap * paintPixAllday();
void updateItem();
void computeText();
void recreateIncidence();
+ bool checkLayout();
public slots:
bool updateIcons( QPainter *, bool );
void select(bool=true);
protected:
void dragEnterEvent(QDragEnterEvent *e);
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index 8bada3b..e2c8e6e 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -71,16 +71,23 @@ KOEventViewerDialog::~KOEventViewerDialog()
//qDebug("-------~KOEventViewerDialog() ");
}
void KOEventViewerDialog::showMe()
{
#ifdef DESKTOP_VERSION
+ int x,y,w,h;
+ x = geometry().x();
+ y = geometry().y();
+ w = width();
+ h = height();
show();
+ setGeometry(x,y,w,h);
#else
showMaximized();
#endif
+ raise();
setActiveWindow();
mEventViewer->setFocus();
}
void KOEventViewerDialog::setSyncMode( bool b )
{
@@ -255,13 +262,15 @@ void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e )
break;
case Qt::Key_C:
case Qt::Key_Escape:
close();
break;
case Qt::Key_I:
- accept();
+ sendSignalViewerClosed = true;
+ slotViewerClosed();
+ //accept();
break;
default:
KDialogBase::keyPressEvent ( e );
break;
}