/* Klat - A LaTeX editor for KDE Copyright (C) 2002-2004 Jori Liesenborgs (jori@lumumba.luc.ac.be) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 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 "klatsplashdialogimpl.h" #include "klatsplashdialogimpl.moc" #include #include #include #include #include KlatSplashDialogImpl::KlatSplashDialogImpl(QWidget *parent,char *name) : KlatSplashDialog(parent,name,true,Qt::WType_Popup|Qt::WStyle_NoBorder) { timer = new QTimer(this); connect(timer,SIGNAL(timeout()),this,SLOT(slotTimeout())); shownormal = true; buffer[0] = ' '; buffer[1] = ' '; buffer[2] = ' '; buffer[3] = ' '; buffer[4] = ' '; } KlatSplashDialogImpl::~KlatSplashDialogImpl() { } void KlatSplashDialogImpl::show() { KlatSplashDialog::show(); if (shownormal) { normalElephant->show(); loveElephant->hide(); } else { loveElephant->show(); normalElephant->hide(); } setFocus(); } int KlatSplashDialogImpl::exec() { timer->start(2000); return KlatSplashDialog::exec(); } void KlatSplashDialogImpl::slotTimeout() { accept(); } void KlatSplashDialogImpl::keyPressEvent(QKeyEvent *e) { if (!shownormal) return; char c = (char)e->ascii(); int i; for (i = 1 ; i < 5 ; i++) buffer[i-1] = buffer[i]; buffer[4] = c; if (memcmp(buffer,"mieke",5) == 0) { subtitleLabel->setText("For Mieke from Jori ;-) x!"); shownormal = false; show(); timer->stop(); timer->start(20000); } }