summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-15 10:59:28 (UTC)
committer zautrix <zautrix>2005-03-15 10:59:28 (UTC)
commitf695ed8bf462bab5df0f6b41d3d3e6ed5b803484 (patch) (unidiff)
tree993f48f8048eb37354c3326ee8fc998afc598f81
parentefa425789895481dd918a55af27895a7917d2a20 (diff)
downloadkdepimpi-f695ed8bf462bab5df0f6b41d3d3e6ed5b803484.zip
kdepimpi-f695ed8bf462bab5df0f6b41d3d3e6ed5b803484.tar.gz
kdepimpi-f695ed8bf462bab5df0f6b41d3d3e6ed5b803484.tar.bz2
sync conflict dialog fix
Diffstat (more/less context) (ignore 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)
42{ 42{
43 sendSignalViewerClosed = true; 43 sendSignalViewerClosed = true;
44 mEventViewer = new KOEventViewer(this); 44 mEventViewer = new KOEventViewer(this);
45 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); 45 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont );
46 setMainWidget(mEventViewer); 46 setMainWidget(mEventViewer);
47 setButtonText(Ok, i18n("Edit") ); 47 setButtonText(Ok, i18n("Edit") );
48 48
49 QObject::connect(findButton( Ok ),SIGNAL(clicked()), 49 QObject::connect(findButton( Ok ),SIGNAL(clicked()),
50 SLOT(editIncidence())); 50 SLOT(editIncidence()));
51 QObject::connect(this,SIGNAL(user1Clicked()), 51 QObject::connect(this,SIGNAL(user1Clicked()),
52 SLOT(showIncidence())); 52 SLOT(showIncidence()));
53 mIncidence = 0; 53 mIncidence = 0;
54 // TODO: Set a sensible size (based on the content?). 54 // TODO: Set a sensible size (based on the content?).
55 //showMaximized(); 55 //showMaximized();
56 //qDebug("++++++++++++KOEventViewerDialog() "); 56 //qDebug("++++++++++++KOEventViewerDialog() ");
57 // if ( KOPrefs::instance()->mCompactDialogs ) { 57 // if ( KOPrefs::instance()->mCompactDialogs ) {
58// setFixedSize( 240,284 ); 58// setFixedSize( 240,284 );
59// move( 0, 15 ); 59// move( 0, 15 );
60// } else { 60// } else {
61// setMinimumSize(300,200); 61// setMinimumSize(300,200);
62// resize(320,300); 62// resize(320,300);
63// } 63// }
64 mSyncMode = false; 64 mSyncMode = false;
65 mSyncResult = 0; 65 mSyncResult = 0;
66 66
67} 67}
68 68
69KOEventViewerDialog::~KOEventViewerDialog() 69KOEventViewerDialog::~KOEventViewerDialog()
70{ 70{
71 //qDebug("-------~KOEventViewerDialog() "); 71 //qDebug("-------~KOEventViewerDialog() ");
72} 72}
73void KOEventViewerDialog::showMe() 73void KOEventViewerDialog::showMe()
74{ 74{
75 75
76#ifdef DESKTOP_VERSION 76#ifdef DESKTOP_VERSION
77 int x,y,w,h; 77 int x,y,w,h;
78 x = geometry().x(); 78 x = geometry().x();
79 y = geometry().y(); 79 y = geometry().y();
80 w = width(); 80 w = width();
81 h = height(); 81 h = height();
82 show(); 82 show();
83 setGeometry(x,y,w,h); 83 setGeometry(x,y,w,h);
84#else 84#else
85 showMaximized(); 85 showMaximized();
86#endif 86#endif
87 raise(); 87 raise();
88 setActiveWindow(); 88 setActiveWindow();
89 mEventViewer->setFocus(); 89 mEventViewer->setFocus();
90 //raise();
90 91
91} 92}
92void KOEventViewerDialog::setSyncMode( bool b ) 93void KOEventViewerDialog::setSyncMode( bool b )
93{ 94{
94 mSyncMode = b; 95 mSyncMode = b;
95 //qDebug("KOEventViewerDialog::setSyncMode %d ",mSyncMode ); 96 //qDebug("KOEventViewerDialog::setSyncMode %d ",mSyncMode );
96 if ( mSyncMode ) { 97 if ( mSyncMode ) {
97 findButton( Close )->setText( i18n("Cancel Sync")); 98 findButton( Close )->setText( i18n("Cancel Sync"));
98 findButton( Ok )->setText( i18n("Remote")); 99 findButton( Ok )->setText( i18n("Remote"));
99 findButton( User1 )->setText( i18n("Local")); 100 findButton( User1 )->setText( i18n("Local"));
100 } else { 101 } else {
101 findButton( Close )->setText( i18n("Close")); 102 findButton( Close )->setText( i18n("Close"));
102 findButton( Ok )->setText( i18n("Edit")); 103 findButton( Ok )->setText( i18n("Edit"));
103 findButton( User1 )->setText( i18n("Agenda")); 104 findButton( User1 )->setText( i18n("Agenda"));
104 } 105 }
105 mEventViewer->setSyncMode( b ); 106 mEventViewer->setSyncMode( b );
106} 107}
107void KOEventViewerDialog::setColorMode( int m ) 108void KOEventViewerDialog::setColorMode( int m )
108{ 109{
109 mEventViewer->setColorMode( m ); 110 mEventViewer->setColorMode( m );
110} 111}
111int KOEventViewerDialog::executeS( bool local ) 112int KOEventViewerDialog::executeS( bool local )
112{ 113{
113 mSyncResult = 3; 114 mSyncResult = 3;
114 if ( local ) 115 if ( local )
115 findButton( User1 )->setFocus(); 116 findButton( User1 )->setFocus();
116 else 117 else
117 findButton( Ok )->setFocus(); 118 findButton( Ok )->setFocus();
118 exec(); 119 exec();
119 return mSyncResult; 120 return mSyncResult;
120} 121}
121 122
122void KOEventViewerDialog::updateConfig() 123void KOEventViewerDialog::updateConfig()
123{ 124{
124 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); 125 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont );
125 126
126} 127}
127void KOEventViewerDialog::setEvent(Event *event) 128void KOEventViewerDialog::setEvent(Event *event)
128{ 129{
129 mEventViewer->setEvent(event); 130 mEventViewer->setEvent(event);
130 mIncidence = event; 131 mIncidence = event;
131 mEventViewer->setFocus(); 132 mEventViewer->setFocus();
132 //findButton( Close )->setFocus(); 133 //findButton( Close )->setFocus();
133 if ( !mSyncMode ) { 134 if ( !mSyncMode ) {
134 findButton( User1 )->setText( i18n("Agenda")); 135 findButton( User1 )->setText( i18n("Agenda"));
135 } 136 }
136} 137}
137void KOEventViewerDialog::setIncidence(Incidence *in ) 138void KOEventViewerDialog::setIncidence(Incidence *in )
@@ -244,55 +245,58 @@ void KOEventViewerDialog::showIncidence()
244 date = mIncidence->dtStart().date(); 245 date = mIncidence->dtStart().date();
245 globalFlagBlockAgenda = 1; 246 globalFlagBlockAgenda = 1;
246 emit showAgendaView( false ); 247 emit showAgendaView( false );
247 globalFlagBlockAgenda = 2; 248 globalFlagBlockAgenda = 2;
248 emit jumpToTime( date ); 249 emit jumpToTime( date );
249 } 250 }
250} 251}
251void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e ) 252void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e )
252{ 253{
253 switch ( e->key() ) { 254 switch ( e->key() ) {
254 255
255 case Qt::Key_A : 256 case Qt::Key_A :
256 case Qt::Key_L : 257 case Qt::Key_L :
257 showIncidence(); 258 showIncidence();
258 break; 259 break;
259 case Qt::Key_E : 260 case Qt::Key_E :
260 case Qt::Key_R : 261 case Qt::Key_R :
261 editIncidence(); 262 editIncidence();
262 break; 263 break;
263 case Qt::Key_C: 264 case Qt::Key_C:
264 case Qt::Key_Escape: 265 case Qt::Key_Escape:
265 sendSignalViewerClosed = true; 266 sendSignalViewerClosed = true;
266 close(); 267 close();
267 break; 268 break;
268 case Qt::Key_I: 269 case Qt::Key_I:
269#ifndef DESKTOP_VERSION 270#ifndef DESKTOP_VERSION
270 sendSignalViewerClosed = true; 271 sendSignalViewerClosed = true;
271 close(); 272 close();
272#else 273#else
273 sendSignalViewerClosed = true; 274 sendSignalViewerClosed = true;
274 slotViewerClosed(); 275 slotViewerClosed();
275 //accept(); 276 //accept();
276#endif 277#endif
277 break; 278 break;
278 default: 279 default:
279 KDialogBase::keyPressEvent ( e ); 280 KDialogBase::keyPressEvent ( e );
280 break; 281 break;
281 } 282 }
282 283
283} 284}
284void KOEventViewerDialog::hideEvent ( QHideEvent * e ) 285void KOEventViewerDialog::hideEvent ( QHideEvent * e )
285{ 286{
286 KDialogBase::hideEvent ( e ); 287 KDialogBase::hideEvent ( e );
287 QTimer::singleShot( 1, this, SLOT (slotViewerClosed() ) ); 288 QTimer::singleShot( 1, this, SLOT (slotViewerClosed() ) );
288} 289}
289 290
290void KOEventViewerDialog::slotViewerClosed() 291void KOEventViewerDialog::slotViewerClosed()
291{ 292{
293 if ( mSyncMode )
294 return;
295
292 if ( sendSignalViewerClosed ) { 296 if ( sendSignalViewerClosed ) {
293 //qDebug("KOEventViewerDialog::hideEvent "); 297 //qDebug("KOEventViewerDialog::hideEvent ");
294 emit signalViewerClosed(); 298 emit signalViewerClosed();
295 } 299 }
296 sendSignalViewerClosed = true; 300 sendSignalViewerClosed = true;
297} 301}
298 302