summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-15 10:59:28 (UTC)
committer zautrix <zautrix>2005-03-15 10:59:28 (UTC)
commitf695ed8bf462bab5df0f6b41d3d3e6ed5b803484 (patch) (side-by-side diff)
tree993f48f8048eb37354c3326ee8fc998afc598f81
parentefa425789895481dd918a55af27895a7917d2a20 (diff)
downloadkdepimpi-f695ed8bf462bab5df0f6b41d3d3e6ed5b803484.zip
kdepimpi-f695ed8bf462bab5df0f6b41d3d3e6ed5b803484.tar.gz
kdepimpi-f695ed8bf462bab5df0f6b41d3d3e6ed5b803484.tar.bz2
sync conflict dialog fix
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koeventviewerdialog.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index f606124..f734696 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -42,96 +42,97 @@ KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name)
{
sendSignalViewerClosed = true;
mEventViewer = new KOEventViewer(this);
mEventViewer->setFont( KOPrefs::instance()->mEventViewFont );
setMainWidget(mEventViewer);
setButtonText(Ok, i18n("Edit") );
QObject::connect(findButton( Ok ),SIGNAL(clicked()),
SLOT(editIncidence()));
QObject::connect(this,SIGNAL(user1Clicked()),
SLOT(showIncidence()));
mIncidence = 0;
// TODO: Set a sensible size (based on the content?).
//showMaximized();
//qDebug("++++++++++++KOEventViewerDialog() ");
// if ( KOPrefs::instance()->mCompactDialogs ) {
// setFixedSize( 240,284 );
// move( 0, 15 );
// } else {
// setMinimumSize(300,200);
// resize(320,300);
// }
mSyncMode = false;
mSyncResult = 0;
}
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();
+ //raise();
}
void KOEventViewerDialog::setSyncMode( bool b )
{
mSyncMode = b;
//qDebug("KOEventViewerDialog::setSyncMode %d ",mSyncMode );
if ( mSyncMode ) {
findButton( Close )->setText( i18n("Cancel Sync"));
findButton( Ok )->setText( i18n("Remote"));
findButton( User1 )->setText( i18n("Local"));
} else {
findButton( Close )->setText( i18n("Close"));
findButton( Ok )->setText( i18n("Edit"));
findButton( User1 )->setText( i18n("Agenda"));
}
mEventViewer->setSyncMode( b );
}
void KOEventViewerDialog::setColorMode( int m )
{
mEventViewer->setColorMode( m );
}
int KOEventViewerDialog::executeS( bool local )
{
mSyncResult = 3;
if ( local )
findButton( User1 )->setFocus();
else
findButton( Ok )->setFocus();
exec();
return mSyncResult;
}
void KOEventViewerDialog::updateConfig()
{
mEventViewer->setFont( KOPrefs::instance()->mEventViewFont );
}
void KOEventViewerDialog::setEvent(Event *event)
{
mEventViewer->setEvent(event);
mIncidence = event;
mEventViewer->setFocus();
//findButton( Close )->setFocus();
if ( !mSyncMode ) {
findButton( User1 )->setText( i18n("Agenda"));
}
}
void KOEventViewerDialog::setIncidence(Incidence *in )
@@ -244,55 +245,58 @@ void KOEventViewerDialog::showIncidence()
date = mIncidence->dtStart().date();
globalFlagBlockAgenda = 1;
emit showAgendaView( false );
globalFlagBlockAgenda = 2;
emit jumpToTime( date );
}
}
void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e )
{
switch ( e->key() ) {
case Qt::Key_A :
case Qt::Key_L :
showIncidence();
break;
case Qt::Key_E :
case Qt::Key_R :
editIncidence();
break;
case Qt::Key_C:
case Qt::Key_Escape:
sendSignalViewerClosed = true;
close();
break;
case Qt::Key_I:
#ifndef DESKTOP_VERSION
sendSignalViewerClosed = true;
close();
#else
sendSignalViewerClosed = true;
slotViewerClosed();
//accept();
#endif
break;
default:
KDialogBase::keyPressEvent ( e );
break;
}
}
void KOEventViewerDialog::hideEvent ( QHideEvent * e )
{
KDialogBase::hideEvent ( e );
QTimer::singleShot( 1, this, SLOT (slotViewerClosed() ) );
}
void KOEventViewerDialog::slotViewerClosed()
{
+ if ( mSyncMode )
+ return;
+
if ( sendSignalViewerClosed ) {
//qDebug("KOEventViewerDialog::hideEvent ");
emit signalViewerClosed();
}
sendSignalViewerClosed = true;
}