/* Kopete Yahoo Protocol Copyright (c) 2005 by Matt Rogers Kopete (c) 2002-2005 by the Kopete developers ************************************************************************* * * * 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. * * * ************************************************************************* */ #include "yahoowebcamdialog.h" #include #include #include #include #include #include #include #include #include YahooWebcamDialog::YahooWebcamDialog( const TQString &contactId, TQWidget * tqparent, const char * name ) : KDialogBase( KDialogBase::Plain, i18n( "Webcam for %1" ).tqarg( contactId ), KDialogBase::Close, KDialogBase::Close, tqparent, name, false, true /*seperator*/ ) { setInitialSize( TQSize(320,290), false ); setEscapeButton( KDialogBase::Close ); TQObject::connect( this, TQT_SIGNAL( closeClicked() ), this, TQT_SIGNAL( closingWebcamDialog() ) ); contactName = contactId; TQWidget *page = plainPage(); setMainWidget(page); TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() ); m_imageContainer = new Kopete::WebcamWidget( page ); m_imageContainer->setText( i18n( "No webcam image received" ) ); m_imageContainer->setMinimumSize(320,240); m_imageContainer->tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding); topLayout->add( m_imageContainer ); m_Viewer = new TQLabel( page ); m_Viewer->tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding); m_Viewer->hide(); topLayout->add( m_Viewer ); show(); } YahooWebcamDialog::~ YahooWebcamDialog( ) { } void YahooWebcamDialog::newImage( const TQPixmap &image ) { m_imageContainer->updatePixmap( image ); } void YahooWebcamDialog::webcamPaused() { m_imageContainer->setText( TQString::tqfromLatin1("*** Webcam paused ***") ); } void YahooWebcamDialog::webcamClosed( int reason ) { kdDebug(14180) << k_funcinfo << "webcam closed with reason?? " << reason <clear(); m_imageContainer->setText( closeReason ); } void YahooWebcamDialog::setViewer( const TQStringList &viewer ) { TQString s = i18n( "%1 viewer(s)" ).tqarg( viewer.size() ); if( viewer.size() ) { s += ": "; for ( TQStringList::ConstIterator it = viewer.begin(); it != viewer.end(); ++it ) { if( it != viewer.begin() ) s += ", "; s += *it; } } m_Viewer->setText( s ); m_Viewer->show(); } // kate: indent-mode csands; tab-width 4; #include "yahoowebcamdialog.moc"