summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventviewerdialog.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koeventviewerdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventviewerdialog.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index 23e62d3..8bada3b 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -15,16 +15,17 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <klocale.h>
#include <libkcal/event.h>
+#include <qtimer.h>
#include <qpushbutton.h>
#include "koeventviewer.h"
#include "koprefs.h"
#include <libkcal/todo.h>
#include "qapp.h"
#include "koeventviewerdialog.h"
@@ -34,17 +35,17 @@ KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name)
: KDialogBase(parent,name,
#ifndef DESKTOP_VERSION
true ,
#else
false,
#endif
i18n("Event Viewer"),Ok|User1|Close,Close, false, i18n("Agenda"))
{
-
+ 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()),
@@ -184,31 +185,32 @@ void KOEventViewerDialog::setJournal(Journal *j)
void KOEventViewerDialog::addText(QString text)
{
mEventViewer->addText(text);
mEventViewer->setFocus();
//findButton( Close )->setFocus();
}
void KOEventViewerDialog::editIncidence()
{
+ sendSignalViewerClosed = false;
if ( mSyncMode ) {
mSyncResult = 2;
accept();
return;
}
if ( mIncidence ){
#ifndef DESKTOP_VERSION
hide();
#endif
emit editIncidence( mIncidence );
}
}
void KOEventViewerDialog::showIncidence()
{
-
+ sendSignalViewerClosed = false;
if ( mSyncMode ) {
mSyncResult = 1;
accept();
return;
}
if ( mIncidence ){
#ifndef DESKTOP_VERSION
@@ -259,8 +261,23 @@ void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e )
accept();
break;
default:
KDialogBase::keyPressEvent ( e );
break;
}
}
+void KOEventViewerDialog::hideEvent ( QHideEvent * e )
+{
+ KDialogBase::hideEvent ( e );
+ QTimer::singleShot( 1, this, SLOT (slotViewerClosed() ) );
+}
+
+void KOEventViewerDialog::slotViewerClosed()
+{
+ if ( sendSignalViewerClosed ) {
+ //qDebug("KOEventViewerDialog::hideEvent ");
+ emit signalViewerClosed();
+ }
+ sendSignalViewerClosed = true;
+}
+