void KJavaAppletServer::waitForReturnData(JSStackFrame * frame) { kDebug(6100) << ">KJavaAppletServer::waitForReturnData"; killTimers(); startTimer(15000); while (!frame->exit) { QAbstractEventDispatcher::instance()->processEvents (QEventLoop::AllEvents | QEventLoop::WaitForMoreEvents); } if (d->jsstack.size() <= 1) killTimers(); kDebug(6100) << "<KJavaAppletServer::waitForReturnData stacksize:" << d->jsstack.size(); }
void KTriangleButton::timerEvent(QTimerEvent *) { if (!usingTimer) {killTimers();return;}; if (timeCount==0) { timeCount++; killTimers(); startTimer(25); } emit clickedQuickly(); }
KJFilename::KJFilename(const QStringList &l, KJLoader *p) : QObject(0), KJWidget(p), mBack(0) { int x = l[1].toInt(); int y = l[2].toInt(); int xs = l[3].toInt() - x; int ys = l[4].toInt() - y; // fix for all those weird skins where the filenamewindow has more // height than needed for the font // ( ... usually resulting in garbage on-screen ) if ( ys > (textFont().fontHeight()) ) ys = textFont().fontHeight(); // background under filename-scroller QPixmap tmp = p->pixmap(p->item("backgroundimage")[1]); mBack = new KPixmap ( QSize(xs,ys) ); bitBlt( mBack, 0, 0, &tmp, x, y, xs, ys, Qt::CopyROP ); setRect(x,y,xs,ys); // how far it moves per cycle // TODO: make that configurable for the user //mDistance = 1; // mDistance = (int)(textFont().fontWidth()/2); readConfig(); prepareString(i18n("Welcome to Noatun").local8Bit()); killTimers(); }
void Feld::load (const KSimpleConfig& config) { if(moving) killTimers(); mol->load(config); QString key; for (int j = 0; j < FIELD_SIZE; j++) { key.sprintf("feld_%02d", j); QString line = config.readEntry(key); for (int i = 0; i < FIELD_SIZE; i++) feld[i][j] = atom2int(line[i].latin1()); } moves = 0; chosen = false; moving = false; undoSize = redoSize = undoBegin = 0; emit enableUndo(false); emit enableRedo(false); xpos = ypos = 0; nextAtom(); }
void KJFilename::prepareString(const QCString &str) { killTimers(); // i.e. stop timers mView = textFont().draw(str, rect().width()); startTimer(mTimerUpdates); }
void KJavaAppletServer::endWaitForReturnData() { kDebug(6100) << "KJavaAppletServer::endWaitForReturnData"; killTimers(); JSStack::iterator it = d->jsstack.begin(); JSStack::iterator itEnd = d->jsstack.end(); for (; it != itEnd; ++it) it.value()->exit = true; }
void KNoteTip::setNote(KNotesIconViewItem *item) { if(mNoteIVI == item) return; mNoteIVI = item; if(!mNoteIVI) { killTimers(); if(isVisible()) { setFilter(false); hide(); } } else { KCal::Journal *journal = item->journal(); if(journal->customProperty("KNotes", "RichText") == "true") mPreview->setTextFormat(Qt::RichText); else mPreview->setTextFormat(Qt::PlainText); QColor fg(journal->customProperty("KNotes", "FgColor")); QColor bg(journal->customProperty("KNotes", "BgColor")); setColor(fg, bg); mPreview->setText(journal->description()); mPreview->zoomTo(8); mPreview->sync(); int w = 400; int h = mPreview->heightForWidth(w); while(w > 60 && h == mPreview->heightForWidth(w - 20)) w -= 20; QRect desk = KGlobalSettings::desktopGeometry(mNoteIVI->rect().center()); resize(w, QMIN(h, desk.height() / 2 - 20)); hide(); killTimers(); setFilter(true); startTimer(600); // delay showing the tooltip for 0.7 sec } }
void AreaSelect::disableSelection() { // stop all the timer killTimers(); if (showedSF) { drawFrame(); // to erase the frame } }
/** * @brief Reinitialized the core. * @warning Must be called from the Core thread, with the GUI thread ready to process events. */ void Core::reset() { assert(QThread::currentThread() == coreThread); QByteArray toxsave = getToxSaveData(); ready = false; killTimers(true); deadifyTox(); emit selfAvatarChanged(QPixmap(":/img/contact_dark.svg")); GUI::clearContacts(); start(toxsave); }
void MediaPlayer::stopChangingVolume() { killTimers(); // Get rid of the on-screen display stuff drawnOnScreenDisplay = FALSE; onScreenDisplayVolume = 0; int w = audioUI->width(); int h = audioUI->height(); audioUI->repaint( (w - 200) / 2, h - yoff, 200 + 9, 70, FALSE ); }
void HoldLine::pauseGame(){ if(paused){ startTimers(); paused = false; } else{ if(!gameOver && gameStarted){ paused = true; killTimers(); } } }
void DiskInfoWidget::setUpdateFrequency( int frequency ) { // // Kill current timer and restart it if the frequency is // larger than zero. // killTimers(); if( frequency > 0 ) { startTimer( frequency * 1000 ); } }
void VerifyDlg::slotProcessExited( KProcess* ) { killTimers(); delete _proc; // Set this, or we get caught in a loop. _done = TRUE; _ok->setEnabled( TRUE ); _save->setEnabled( TRUE ); _abort->setEnabled( FALSE ); }
void Example::refresh() { textsprite.visible(!!btext); drawnsprite->visible(!!dsprite); polygon->visible(!!dpoly); if ( count != bouncers ) setCount(bouncers); frames=0; timer.start(); killTimers(); startTimer(refresh_delay); emit refreshSlaves(); view->repaint(FALSE); }
void setup() { // enable output on solenoid and piezo DDRB = (1<<SOLENOID_PIN) | (1<<PIEZO_PIN); // configure trigger interrupt (INT0) on any change EIMSK = (1<<INT0); EICRA = (1<<ISC00); configureTimers(); // disable timers killTimers(); // enable global interrupts sei(); // setup Serial Serial.begin(9600); }
void BackupDlg::slotAbort() { killTimers(); if ( _proc ) { _proc->kill(); delete _proc; } delete _archive; _aborted = TRUE; _ok->setEnabled( TRUE ); _ok->setDefault( TRUE ); _save->setEnabled( TRUE ); _abort->setEnabled( FALSE ); }
void KNoteTip::timerEvent(QTimerEvent *) { killTimers(); if(!isVisible()) { startTimer(15000); // show the tooltip for 15 sec reposition(); show(); } else { setFilter(false); hide(); } }
/* menu-slot: "stop" selected in menu */ void TopLevel::stop() { killTimers(); running = false; ready = false; enable_menuEntries(); // disable "top", enable "start" if (shooting) { // re-check current tea shooting = false; if (!listempty) menu->setItemChecked(current_selected, true); } setToolTip(i18n("The Tea Cooker"), true); repaint(); }
Core::~Core() { if (coreThread->isRunning()) { if (QThread::currentThread() == coreThread) killTimers(false); else QMetaObject::invokeMethod(this, "killTimers", Qt::BlockingQueuedConnection, Q_ARG(bool, false)); } coreThread->exit(0); while (coreThread->isRunning()) { qApp->processEvents(); coreThread->wait(500); } deadifyTox(); }
void Feld::timerEvent (QTimerEvent *) { // animation beenden if (frames <= 0) { moving = false; killTimers (); done(); dir = None; } else { frames -= settings.anim_speed; if (frames < 0) frames = 0; paintMovingAtom(); } }
bool KNoteTip::eventFilter(QObject *, QEvent *e) { switch(e->type()) { case QEvent::Leave: case QEvent::MouseButtonPress: case QEvent::MouseButtonRelease: case QEvent::KeyPress: case QEvent::KeyRelease: case QEvent::FocusIn: case QEvent::FocusOut: case QEvent::Wheel: killTimers(); setFilter(false); hide(); default: break; } return false; }
void QLineEdit::mousePressEvent( QMouseEvent *e ) { killTimers(); d->inDoubleClick = FALSE; int margin = frame() ? 4 : 2; cursorPos = offset + xPosToCursorPos( &tbuf[(int)offset], fontMetrics(), e->pos().x() - margin, width() - 2*margin ); if ( e->button() == MidButton ) { #if defined(_WS_X11_) insert( QApplication::clipboard()->text() ); #else if ( style() == MotifStyle ) insert( QApplication::clipboard()->text() ); #endif return; #if 0 // it works, but it's wait until we have an API } else if ( hasMarkedText() && e->button() == LeftButton && ( (markAnchor > cursorPos && markDrag < cursorPos) || (markAnchor < cursorPos && markDrag > cursorPos) ) ) { QTextDrag * tdo = new QTextDrag( this ); tdo->setText( markedText() ); tdo->dragCopy(); delete tdo; return; #endif } int m1 = minMark(); int m2 = maxMark(); markAnchor = cursorPos; newMark( markAnchor, FALSE ); if ( cursorPos > m2 ) m2 = cursorPos; else if ( cursorPos < m1 ) m1 = cursorPos; repaintArea( m1, m2 ); dragScrolling = FALSE; }
/* menu-slot: "start" selected in menu */ void TopLevel::start() { if (listempty && !shooting) { KMessageBox::error(this, i18n("There is no tea to begin steeping."), i18n("No Tea")); } else { if (!shooting) { current_name = teas[current_selected].name; // remember name of current tea startSeconds = teas[current_selected].time; // initialize time for current tea seconds = startSeconds; percentDone = 0; } // else both are already defined by dialog handler killTimers(); startTimer(1000); // 1000ms = 1s (sufficient resolution) running = true; ready = false; enable_menuEntries(); // disable "start", enable "stop" repaint(); } }
void BackupDlg::slotProcessExited( KProcess* ) { updateStats(); _archive->setEndBlock( _totalRecords / ( Options::instance()->getTapeBlockSize() / 512 ) ); if ( _fileName.length() > 0 ) { _archive->addFile( _fileSize, _fileMTime, _fileStartRecord, _totalRecords, _fileName ); _fileName = QString::null; } TapeDrive::instance()->close(); TapeDrive::instance()->open(); killTimers(); delete _proc; _tape->addChild( _archive ); _ok->setEnabled( TRUE ); _ok->setDefault( TRUE ); _save->setEnabled( TRUE ); _abort->setEnabled( FALSE ); }
void QApplicationWindow::timerEvent(QTimerEvent *) { if (application().closeView()) { myCloseFlag = true; } killTimers(); }
void QApplicationWindow::keyPressEvent(QKeyEvent *event) { killTimers(); application().doActionByKey(QKeyUtil::keyName(event)); }
KSircIOLAG::~KSircIOLAG() { killTimers(); }
void KMDITitleLabel::readConfiguration(){ KConfig* config; QString key; // int i; killTimers(); config = new("KConfig") KConfig(KApplication::kde_configdir() + "/kwmrc", KApplication::localconfigdir() + "/kwmrc"); // this belongs in kapp.... config->setGroup("WM"); activeTitleBlend = config->readColorEntry( "activeBlend",&black); inactiveTitleBlend = config->readColorEntry( "inactiveBlend",&kapp->backgroundColor); config->setGroup( "General" ); //BORDER = 4; key = config->readEntry("WindowMoveType"); if( key == "Transparent") options.WindowMoveType = TRANSPARENT; else if( key == "Opaque") options.WindowMoveType = OPAQUE; else{ config->writeEntry("WindowMoveType","Transparent"); options.WindowMoveType = TRANSPARENT; } key = config->readEntry("WindowResizeType"); if( key == "Transparent") options.WindowResizeType = TRANSPARENT; else if( key == "Opaque") options.WindowResizeType = OPAQUE; else{ config->writeEntry("WindowResizeType","Transparent"); options.WindowResizeType = TRANSPARENT; } key = config->readEntry("FocusPolicy"); if( key == "ClickToFocus") options.FocusPolicy = CLICK_TO_FOCUS; else if( key == "FocusFollowsMouse" || key == "FocusFollowMouse") options.FocusPolicy = FOCUS_FOLLOWS_MOUSE; else if( key == "ClassicFocusFollowsMouse" || key == "ClassicFocusFollowMouse") options.FocusPolicy = CLASSIC_FOCUS_FOLLOWS_MOUSE; else if( key == "ClassicSloppyFocus") options.FocusPolicy = CLASSIC_SLOPPY_FOCUS; else{ config->writeEntry("FocusPolicy","ClickToFocus"); options.FocusPolicy = CLICK_TO_FOCUS; } key = config->readEntry("AltTabMode"); if( key == "KDE") options.AltTabMode = KDE_STYLE; else if( key == "CDE") options.AltTabMode = CDE_STYLE; else{ config->writeEntry("AltTabMode","KDE"); options.AltTabMode = KDE_STYLE; } if (CLASSIC_FOCUS) options.AltTabMode = CDE_STYLE; key = config->readEntry("TitlebarLook"); if( key == "shadedHorizontal") options.TitlebarLook = H_SHADED; else if( key == "shadedVertical") options.TitlebarLook = V_SHADED; else if( key == "plain") options.TitlebarLook = PLAIN; else if( key == "pixmap") options.TitlebarLook = PIXMAP; else{ config->writeEntry("TitlebarLook", "shadedHorizontal"); options.TitlebarLook = H_SHADED; } //CT 23Sep1998 - fixed the name of the titlebar pixmaps to become // consistent with the buttons pixmaps definition technique if (options.TitlebarLook == PIXMAP) { *options.titlebarPixmapActive = loadIcon("activetitlebar.xpm"); *options.titlebarPixmapInactive = loadIcon("inactivetitlebar.xpm"); if (options.titlebarPixmapInactive->size() == QSize(0,0)) *options.titlebarPixmapInactive = *options.titlebarPixmapActive; if (options.titlebarPixmapActive->size() == QSize(0,0)) options.TitlebarLook = PLAIN; } //CT 12Jun1998 - variable animation speed from 0 (none!!) to 10 (max) if (config->hasKey("ResizeAnimation")) { options.ResizeAnimation = config->readNumEntry("ResizeAnimation"); if( options.ResizeAnimation < 1 ) options.ResizeAnimation = 0; if( options.ResizeAnimation > 10 ) options.ResizeAnimation = 10; } else{ options.ResizeAnimation = 1; config->writeEntry("ResizeAnimation", options.ResizeAnimation); } config->sync(); delete config; }
void hide() { QWidget::hide(); killTimers(); }
void CannonField::stopShooting() { shooting = FALSE; killTimers(); }