void ConvertDialog::convertQuestion( KProcess *proc, char *buffer, int buflen ) {
	QStringList buf = QStringList::split( '\n', QString::fromLatin1( buffer, buflen ) );

	for ( uint i = 0; i < buf.count(); i++ ) {
		if ( buf[i].startsWith( "# list pattern" ) ) {
			QRegExp regExp( "\\b\\d+\\b" );
			int pos, x, y, w, h;

			// get the unknown cluster's coordinates
			pos = regExp.search( buf[i] );
			x = regExp.cap( 0 ).toUInt();
			pos = regExp.search( buf[i], pos + regExp.matchedLength() );
			y = regExp.cap( 0 ).toUInt();
			pos = regExp.search( buf[i], pos + regExp.matchedLength() );
			w = regExp.cap( 0 ).toUInt();
			pos = regExp.search( buf[i], pos + regExp.matchedLength() );
			h = regExp.cap( 0 ).toUInt();

			// load the subtitle and mark the unknown cluster on the image
			loadSubtitle( QRect( x, y, w, h) );

		} else if ( buf[i].startsWith( "The upper char" ) ) {
			setEnabledWidgetsInput( true );
			line->setFocus();

		} else if ( buf[i].startsWith( " Store the pattern?" ) ) {
			int option;

			if ( checkbox->isChecked() ) option = 2;
			else option = 0;

			writeStdin( proc, option );
		}
	}
}
void ConvertDialog::slotOk() {
	writeStdin( process, line->text() );

	setEnabledWidgetsInput( false );
	enableButton( User1, false );

	image->clearSubtitle();
	subtitle->setText( QString::null );
	line->clear();
}
Exemple #3
0
void TEPty::doSendJobs() {
  if(pendingSendJobs.isEmpty())
  {
     emit buffer_empty();
     return;
  }
  
  SendJob& job = pendingSendJobs.first();
  if (!writeStdin(job.buffer.data(), job.length))
  {
    qWarning("Uh oh.. can't write data..");
    return;
  }
  m_bufferFull = true;
}
void ConvertDialog::writeStdin( KProcess *proc, int data ) {
	writeStdin( proc, QString::number( data ) );
}