2
* Kscd - A simple cd player for the KDE Project
4
* Copyright (c) 1997 Bernd Johannes wuebben@math.cornell.edu
5
* Copyright (c) 2002-2003 Aaron J. Seigo <aseigo@kde.org>
6
* Copyright (c) 2004 Alexander Kern <alex.kern@gmx.de>
7
* Copyright (c) 2003-2006 Richard Lärkäng <nouseforaname@home.se>
12
* Stanislas KRZYWDA <stanislas.krzywda@gmail.com>
13
* Sovanramy Var <mastasushi@gmail.com>
14
* Bouchikhi Mohamed-Amine <bouchikhi.amine@gmail.com>
15
* Gastellu Sylvain<sylvain.gastellu@gmail.com>
16
* -----------------------------------------------------------------------------
18
* This program is free software; you can redistribute it and/or modify
19
* it under the terms of the GNU General Public License as published by
20
* the Free Software Foundation; either version 2, or (at your option)
23
* This program is distributed in the hope that it will be useful,
24
* but WITHOUT ANY WARRANTY; without even the implied warranty of
25
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26
* GNU General Public License for more details.
28
* You should have received a copy of the GNU General Public License
29
* along with this program; if not, write to the Free Software
30
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
33
#include "randombutton.h"
36
RandomButton::RandomButton(QWidget * parent):KscdWidget(I18N_NOOP(QLatin1String( "random" )),parent)
40
RandomButton::~RandomButton()
44
void RandomButton::mousePressEvent(QMouseEvent *event)
46
if(m_bounds->contains(event->pos()+(m_bounds->boundingRect()).topLeft()))
49
m_state = QLatin1String( "pressed" );
50
if(m_name== QLatin1String( "random" ))
52
m_id = m_name + QLatin1Char( '_' ) + m_state;
66
void RandomButton::mouseReleaseEvent(QMouseEvent *event)
68
if(m_bounds->contains(event->pos()+(m_bounds->boundingRect()).topLeft()))
71
m_state = QLatin1String( "over" );
72
if(m_name==QLatin1String( "random" ))
75
m_name = QLatin1String( "p_random" );
80
m_name = QLatin1String( "random" );
83
m_id = m_name + QLatin1Char( '_' ) + m_state;
84
emit(buttonClicked(m_name));
92
void RandomButton::enterEvent (QEvent * event )
94
if(m_name == QLatin1String( "p_random" ))
101
m_state = QLatin1String( "over" );
102
m_id = m_name + QLatin1Char( '_' ) + m_state;
104
setToolTip( i18n( qPrintable( m_name ) ) );
108
void RandomButton::leaveEvent (QEvent * event )
110
if(m_name == QLatin1String( "p_random" ))
117
m_state = QLatin1String( "default" );
118
m_id = m_name + QLatin1Char( '_' ) + m_state;