diff options
Diffstat (limited to 'amarok/src/playerwindow.cpp')
-rw-r--r-- | amarok/src/playerwindow.cpp | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/amarok/src/playerwindow.cpp b/amarok/src/playerwindow.cpp index 9d985d4b..885bdf45 100644 --- a/amarok/src/playerwindow.cpp +++ b/amarok/src/playerwindow.cpp @@ -52,16 +52,16 @@ namespace Amarok TQPixmap getPNG( const TQString &filename ) { - TQString file = !filename.endsWith( ".png", false ) ? "amarok/images/%1.png" : "amarok/images/%1"; + TQString file = !filename.tqendsWith( ".png", false ) ? "amarok/images/%1.png" : "amarok/images/%1"; - return TQPixmap( locate( "data", file.arg( filename ) ), "PNG" ); + return TQPixmap( locate( "data", file.tqarg( filename ) ), "PNG" ); } TQPixmap getJPG( const TQString &filename ) { - TQString file = !filename.endsWith( ".jpg", false ) ? "amarok/images/%1.jpg" : "amarok/images/%1"; + TQString file = !filename.tqendsWith( ".jpg", false ) ? "amarok/images/%1.jpg" : "amarok/images/%1"; - return TQPixmap( locate( "data", TQString( "amarok/images/%1.jpg" ).arg( filename ) ), "JPEG" ); + return TQPixmap( locate( "data", TQString( "amarok/images/%1.jpg" ).tqarg( filename ) ), "JPEG" ); } } @@ -71,16 +71,16 @@ using Amarok::getPNG; //fairly pointless template which was designed to make the ctor clearer, //but probably achieves the opposite. Still, the code is neater.. template<class W> static inline W* -createWidget( const TQRect &r, TQWidget *parent, const char *name = 0, Qt::WFlags f = 0 ) +createWidget( const TQRect &r, TQWidget *tqparent, const char *name = 0, TQt::WFlags f = 0 ) { - W *w = new W( parent, name, f ); + W *w = new W( tqparent, name, f ); w->setGeometry( r ); return w; } -PlayerWidget::PlayerWidget( TQWidget *parent, const char *name, bool enablePlaylist ) - : TQWidget( parent, name, Qt::WType_TopLevel ) +PlayerWidget::PlayerWidget( TQWidget *tqparent, const char *name, bool enablePlaylist ) + : TQWidget( tqparent, name, TQt::WType_TopLevel ) , EngineObserver( EngineController::instance() ) , m_minimalView( false ) , m_pAnimTimer( new TQTimer( this ) ) @@ -90,12 +90,12 @@ PlayerWidget::PlayerWidget( TQWidget *parent, const char *name, bool enablePlayl , m_pAnalyzer( 0 ) { //the createWidget template function is used here - //createWidget just creates a widget which has it's geometry set too + //createWidget just creates a widget which has it's tqgeometry set too // Sets caption and icon correctly (needed e.g. for GNOME) kapp->setTopWidget( this ); - parent->installEventFilter( this ); //for hidePLaylistWithMainWindow mode + tqparent->installEventFilter( this ); //for hidePLaylistWithMainWindow mode //if this is the first time we have ever been run we let KWin place us if ( AmarokConfig::playerPos() != TQPoint(-1,-1) ) @@ -117,7 +117,7 @@ PlayerWidget::PlayerWidget( TQWidget *parent, const char *name, bool enablePlayl setFont( font ); { //<NavButtons> - //NOTE we use a layout for the buttons so resizing will be possible + //NOTE we use a tqlayout for the buttons so resizing will be possible m_pFrameButtons = createWidget<TQHBox>( TQRect(0, 118, 311, 22), this ); KActionCollection *ac =Amarok::actionCollection(); @@ -130,8 +130,8 @@ PlayerWidget::PlayerWidget( TQWidget *parent, const char *name, bool enablePlayl new NavButton( m_pFrameButtons, "next", ac->action( "next" ) ); KPushButton *switchView = new KPushButton( KGuiItem( "", "mini_dock" ), m_pFrameButtons ); - switchView->setSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Preferred ); // too big! - switchView->setFocusPolicy( TQWidget::NoFocus ); + switchView->tqsetSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Preferred ); // too big! + switchView->setFocusPolicy( TQ_NoFocus ); connect( switchView, TQT_SIGNAL( clicked() ), TQT_SLOT( toggleView() ) ); @@ -168,7 +168,7 @@ PlayerWidget::PlayerWidget( TQWidget *parent, const char *name, bool enablePlayl } //<TimeLabel> font.setPixelSize( 18 ); - m_pTimeLabel = createWidget<TQLabel>( TQRect(16,36, 9*12+2,18), this, 0, Qt::WNoAutoErase ); + m_pTimeLabel = createWidget<TQLabel>( TQRect(16,36, 9*12+2,18), this, 0, TQt::WNoAutoErase ); m_pTimeLabel->setFont( font ); m_timeBuffer.resize( m_pTimeLabel->size() ); @@ -176,17 +176,17 @@ PlayerWidget::PlayerWidget( TQWidget *parent, const char *name, bool enablePlayl } //<TimeLabel> - m_pButtonEq = new IconButton( this, "eq", this, TQT_SLOT(slotShowEqualizer( bool )) ); + m_pButtonEq = new IconButton( TQT_TQWIDGET(this), "eq", TQT_TQOBJECT(this), TQT_SLOT(slotShowEqualizer( bool )) ); m_pButtonEq->setGeometry( 34,85, 28,13 ); //TODO set isOn() m_pPlaylistButton = new IconButton( this, "pl", TQT_SIGNAL(playlistToggled( bool )) ); m_pPlaylistButton->setGeometry( 5,85, 28,13 ); - m_pPlaylistButton->setOn( parent->isShown() || enablePlaylist ); + m_pPlaylistButton->setOn( tqparent->isShown() || enablePlaylist ); m_pDescription = createWidget<TQLabel>( TQRect(4,6, 250,10), this ); - m_pTimeSign = createWidget<TQLabel>( TQRect(6,40, 10,10), this, 0, Qt::WRepaintNoErase ); + m_pTimeSign = createWidget<TQLabel>( TQRect(6,40, 10,10), this, 0, TQt::WRepaintNoErase ); m_pVolSign = createWidget<TQLabel>( TQRect(295,7, 9,8), this ); m_pDescription->setText( i18n( "Artist-Title|Album|Length" ) ); @@ -296,7 +296,7 @@ void PlayerWidget::drawScroll() subs += dx + ( w - phase2 ); if( subs < 0 ) subs = 0; - bitBlt( buffer, dx, topMargin, scroll, phase2, 0, w - phase2 - subs, h, Qt::CopyROP ); + bitBlt( buffer, dx, topMargin, scroll, phase2, 0, w - phase2 - subs, h, TQt::CopyROP ); dx += w - phase2; phase2 += w - phase2; @@ -323,7 +323,7 @@ void PlayerWidget::engineStateChanged( Engine::State state, Engine::State /*oldS m_pSlider->newBundle( MetaBundle() ); // Set an empty bundle for no moodbar m_pTimeLabel->hide(); m_pTimeSign->hide(); - m_rateString = TQString::null; + m_rateString = TQString(); m_pSlider->setEnabled( false ); setScroll( i18n( "Welcome to Amarok" ) ); update(); @@ -371,7 +371,7 @@ void PlayerWidget::engineNewMetaData( const MetaBundle &bundle, bool ) if( m_rateString.isEmpty() ) m_rateString = Hz; else - m_rateString = i18n("%1 kBit - %2").arg( m_rateString, Hz ); + m_rateString = i18n("%1 kBit - %2").tqarg( m_rateString, Hz ); } TQStringList list( bundle.prettyTitle() ); @@ -435,7 +435,7 @@ void PlayerWidget::determineAmarokColors() //static using namespace Amarok::ColorScheme; - Text = Qt::white; + Text = TQt::white; Background = comodulate( hue, 0x002090 ); Foreground = comodulate( hue, 0x80A0FF ); @@ -446,7 +446,7 @@ void PlayerWidget::determineAmarokColors() //static if ( AmarokConfig::schemeKDE() ) { int h; KGlobalSettings::activeTitleColor().getHsv( &h, &s, &v ); - if( QABS( hue - h ) > 120 ) + if( TQABS( hue - h ) > 120 ) hue = h; } @@ -547,9 +547,9 @@ bool PlayerWidget::event( TQEvent *e ) return true; case 6/*TQEvent::KeyPress*/: - if (static_cast<TQKeyEvent*>(e)->key() == Qt::Key_D/* && (m_pAnalyzer->inherits(TQGLWIDGET_OBJECT_NAME_STRING)*/) + if (TQT_TQKEYEVENT(e)->key() == TQt::Key_D/* && (m_pAnalyzer->inherits(TQGLWIDGET_OBJECT_NAME_STRING)*/) { - if( m_pAnalyzer->parent() ) + if( m_pAnalyzer->tqparent() ) { m_pAnalyzer->reparent( 0, TQPoint(50,50), true ); m_pAnalyzer->setCaption( kapp->makeStdCaption( i18n("Analyzer") ) ); @@ -578,7 +578,7 @@ bool PlayerWidget::event( TQEvent *e ) //create! If you have an issue with the behaviour bring it up on the mailing //list before you even think about committing. Thanks! (includes case Hide) - const WId id = parentWidget()->winId(); + const WId id = tqparentWidget()->winId(); const uint desktop = KWin::windowInfo( winId() ).desktop(); const KWin::WindowInfo info = KWin::windowInfo( id ); @@ -587,15 +587,15 @@ bool PlayerWidget::event( TQEvent *e ) if( info.mappingState() == NET::Withdrawn ) { - //extern Atom qt_wm_state; //XAtom defined by Qt + //extern Atom qt_wm_state; //XAtom defined by TQt //TODO prevent the active Window flicker from playlist to player window please! //TODO look at code for TQWidget::show(); //XDeleteProperty( qt_xdisplay(), id, qt_wm_state ); - //parentWidget()->show(); - //if( !parentWidget()->isShown() ) XMapWindow( qt_xdisplay(), id ); + //tqparentWidget()->show(); + //if( !tqparentWidget()->isShown() ) XMapWindow( qt_xdisplay(), id ); // unsigned long data[2]; // data[0] = (unsigned long) NormalState; // data[1] = (unsigned long) None; @@ -608,7 +608,7 @@ bool PlayerWidget::event( TQEvent *e ) // XMapWindow( qt_xdisplay(), id ); // //KWin::deIconifyWindow( id, false ); - parentWidget()->show(); + tqparentWidget()->show(); } @@ -630,7 +630,7 @@ bool PlayerWidget::event( TQEvent *e ) //this prevents the PlaylistButton being set to off (see the eventFilter) //by leaving it on we ensure that we show the Playlist Window again when //we are next shown (see Show event handler above) - if( parentWidget()->isShown() ) dontChangeButtonState = true; + if( tqparentWidget()->isShown() ) dontChangeButtonState = true; if( e->spontaneous() ) //the window system caused the event { @@ -640,7 +640,7 @@ bool PlayerWidget::event( TQEvent *e ) const KWin::WindowInfo info = KWin::windowInfo( winId() ); - if( info.isMinimized() ) KWin::iconifyWindow( parentWidget()->winId(), false ); + if( info.isMinimized() ) KWin::iconifyWindow( tqparentWidget()->winId(), false ); else //this may seem strange, but it is correct //we have a handler in eventFilter for all other eventualities @@ -651,7 +651,7 @@ bool PlayerWidget::event( TQEvent *e ) //we caused Amarok to hide, so we should hide the Playlist Window //NOTE we "override" closeEvents and thus they count as non-spontaneous //hideEvents; which frankly is a huge relief! - parentWidget()->hide(); + tqparentWidget()->hide(); } return false; @@ -676,9 +676,9 @@ bool PlayerWidget::event( TQEvent *e ) bool PlayerWidget::eventFilter( TQObject *o, TQEvent *e ) { - //NOTE we only monitor for parent() - which is the PlaylistWindow + //NOTE we only monitor for tqparent() - which is the PlaylistWindow - if( o == m_pAnalyzer ) + if( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pAnalyzer) ) { //delete analyzer, create same one back in Player Window if( e->type() == TQEvent::Close ) @@ -693,7 +693,7 @@ PlayerWidget::eventFilter( TQObject *o, TQEvent *e ) { case TQEvent::Close: - static_cast<TQCloseEvent*>(e)->accept(); //close the window! + TQT_TQCLOSEEVENT(e)->accept(); //close the window! return true; //don't let PlaylistWindow have the event - see PlaylistWindow::closeEvent() case TQEvent::Hide: @@ -712,7 +712,7 @@ PlayerWidget::eventFilter( TQObject *o, TQEvent *e ) //we want to avoid setting the button for most spontaneous events //since they are not user driven, two are however: - KWin::WindowInfo info = KWin::windowInfo( parentWidget()->winId() ); + KWin::WindowInfo info = KWin::windowInfo( tqparentWidget()->winId() ); if( !info.isMinimized() ) break; } @@ -760,21 +760,21 @@ void PlayerWidget::contextMenuEvent( TQMouseEvent *e ) void PlayerWidget::mousePressEvent( TQMouseEvent *e ) { - if ( e->button() == TQMouseEvent::RightButton ) + if ( e->button() == Qt::RightButton ) { //Amarok::Menu::instance()->exec( e->globalPos() ); } - else if ( m_pAnalyzer->geometry().contains( e->pos() ) ) + else if ( m_pAnalyzer->tqgeometry().tqcontains( e->pos() ) ) { - createAnalyzer( e->state() & Qt::ControlButton ? -1 : +1 ); + createAnalyzer( e->state() & TQt::ControlButton ? -1 : +1 ); } else { - QRect - rect = m_pTimeLabel->geometry(); - rect |= m_pTimeSign->geometry(); + TQRect + rect = m_pTimeLabel->tqgeometry(); + rect |= m_pTimeSign->tqgeometry(); - if ( rect.contains( e->pos() ) ) + if ( rect.tqcontains( e->pos() ) ) { AmarokConfig::setLeftTimeDisplayRemaining( !AmarokConfig::leftTimeDisplayRemaining() ); timeDisplay( EngineController::engine()->position() ); @@ -814,7 +814,7 @@ void PlayerWidget::startDrag() { TQDragObject *d = new TQTextDrag( EngineController::instance()->bundle().prettyTitle(), this ); d->dragCopy(); - // Qt will delete d for us. + // TQt will delete d for us. } @@ -839,12 +839,12 @@ void PlayerWidget::slotShowEqualizer( bool show ) //SLOT #include <kiconeffect.h> #include <kimageeffect.h> -NavButton::NavButton( TQWidget *parent, const TQString &icon, KAction *action ) - : TQToolButton( parent ) +NavButton::NavButton( TQWidget *tqparent, const TQString &icon, KAction *action ) + : TQToolButton( tqparent ) , m_glowIndex( 0 ) { // Prevent flicker - setWFlags( Qt::WNoAutoErase ); + setWFlags( TQt::WNoAutoErase ); TQPixmap pixmap( getPNG( "b_" + icon ) ); KIconEffect ie; @@ -886,7 +886,7 @@ NavButton::NavButton( TQWidget *parent, const TQString &icon, KAction *action ) iconSet.setPixmap( pixmap, TQIconSet::Automatic, TQIconSet::Disabled, TQIconSet::Off ); setIconSet( iconSet ); - setFocusPolicy( TQWidget::NoFocus ); + setFocusPolicy( TQ_NoFocus ); setEnabled( action->isEnabled() ); connect( action, TQT_SIGNAL( enabled( bool ) ), TQT_SLOT( setEnabled( bool ) ) ); @@ -925,26 +925,26 @@ void NavButton::drawButtonLabel( TQPainter* p ) // CLASS IconButton ////////////////////////////////////////////////////////////////////////////////////////// -IconButton::IconButton( TQWidget *parent, const TQString &icon, const char *signal ) - : TQButton( parent ) +IconButton::IconButton( TQWidget *tqparent, const TQString &icon, const char *signal ) + : TQButton( tqparent ) , m_up( getPNG( icon + "_active2" ) ) //TODO rename files better (like the right way round for one!) , m_down( getPNG( icon + "_inactive2" ) ) { - connect( this, TQT_SIGNAL(toggled( bool )), parent, signal ); + connect( this, TQT_SIGNAL(toggled( bool )), tqparent, signal ); setToggleButton( true ); - setFocusPolicy( NoFocus ); //we have no way to show focus on these widgets currently + setFocusPolicy( TQ_NoFocus ); //we have no way to show focus on these widgets currently } -IconButton::IconButton( TQWidget *parent, const TQString &icon, TQObject* receiver, const char *slot ) - : TQButton( parent ) +IconButton::IconButton( TQWidget *tqparent, const TQString &icon, TQObject* receiver, const char *slot ) + : TQButton( tqparent ) , m_up( getPNG( icon + "_active2" ) ) //TODO rename files better (like the right way round for one!) , m_down( getPNG( icon + "_inactive2" ) ) { connect( this, TQT_SIGNAL(toggled( bool )), receiver, slot ); setToggleButton( true ); - setFocusPolicy( NoFocus ); //we have no way to show focus on these widgets currently + setFocusPolicy( TQ_NoFocus ); //we have no way to show focus on these widgets currently } void IconButton::drawButton( TQPainter *p ) |