/*************************************************************************** artscontrolapplet.cpp - description ------------------- begin : Don Jan 30 20:42:53 CET 2003 copyright : (C) 2003 by Arnold Krille email : arnold@arnoldarts.de ***************************************************************************/ /*************************************************************************** * * * 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 #include #include #include #include #include #include #include #include "artscontrolapplet.h" #include "artscontrolapplet_private.h" extern "C" { KDE_EXPORT KPanelApplet* init( TQWidget *parent, const TQString configFile) { KGlobal::locale()->insertCatalogue("artscontrol"); return new ArtsControlApplet(configFile, KPanelApplet::Normal, KPanelApplet::About /*| KPanelApplet::Help | KPanelApplet::Preferences*/, parent, "artscontrolapplet"); } } ArtsControlApplet::ArtsControlApplet(const TQString& configFile, Type type, int actions, TQWidget *parent, const char *name) : KPanelApplet(configFile, type, actions, parent, name) { //kdDebug()<<"ArtsControlApplet::ArtsControlApplet( const TQString& "<barts ) KMessageBox::information(0, i18n("Something with the ArtsServer went wrong. You probably need to restart aRts and then reload this applet.")); setCustomMenu(p->menu); p->layout = new TQBoxLayout( this, TQBoxLayout::LeftToRight ); p->layout->setSpacing( 2 ); if( p->barts ) { p->vu = Arts::StereoVolumeControlGui( p->volume ); p->vu.label().fontsize( 8 ); p->vuw = new KArtsWidget( p->vu, this ); p->vuw->setMinimumSize( 16,16 ); p->layout->addWidget( p->vuw ); } p->layout->activate(); TQTimer::singleShot( 100, this, TQT_SLOT( supdatelayout() ) ); kdDebug()<<"ArtsControlApplet::ArtsControlApplet() finished."< #include void ArtsControlApplet::about() { KAboutData about( "artscontrolapplet", I18N_NOOP( "aRts Control Applet" ), "0.5", I18N_NOOP( "A kickerapplet to control aRts." ), KAboutData::License_GPL, I18N_NOOP( "(c) 2003 by Arnold Krille" ) ); about.addAuthor( "Arnold Krille", I18N_NOOP( "Author of the Applet" ), "arnold@arnoldarts.de" ); about.addCredit( "Stefan Westerfeld", I18N_NOOP( "Thanks for creating aRts!" ) ); KAboutApplication a( &about, this ); a.exec(); } void ArtsControlApplet::help() { kdDebug()<layout->sizeHint().width(); } int ArtsControlApplet::heightForWidth( int w ) const { kdDebug()<<"ArtsControlApplet::heightForWidth( int "<layout->sizeHint().height(); } void ArtsControlApplet::resizeEvent( TQResizeEvent * /*_Event*/ ) { kdDebug()<<"ArtsControlApplet::resizeEvent( TQResizeEvent * )"<button() /*|| Qt::LeftButton == ev->button()*/ ) p->menu->exec( TQCursor::pos() ); } void ArtsControlApplet::positionChange( Position ) { kdDebug() << k_funcinfo << endl; resetLayout(); } void ArtsControlApplet::resetLayout() { kdDebug()<