mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-03-19 05:26:07 -04:00
removed not needed source
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@488 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
2d6af0b4c1
commit
79d0bb9171
@ -1,46 +0,0 @@
|
||||
/****************************************************************
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2006,2007 crypton
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
#include <util/AnimatedButton.h>
|
||||
|
||||
|
||||
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
static const char * MNG_FORMAT = "MNG";
|
||||
|
||||
AnimatedButton::AnimatedButton(QToolButton * button, const QString & animatedIconFilename) {
|
||||
_button = button;
|
||||
_animatedIcon = new QMovie(animatedIconFilename, MNG_FORMAT, _button);
|
||||
connect(_animatedIcon, SIGNAL(frameChanged(int)), SLOT(updateButtonIcon()));
|
||||
_animatedIcon->start();
|
||||
}
|
||||
|
||||
AnimatedButton::~AnimatedButton() {
|
||||
_animatedIcon->stop();
|
||||
delete(_animatedIcon);
|
||||
}
|
||||
|
||||
void AnimatedButton::updateButtonIcon() {
|
||||
QPixmap icon = _animatedIcon->currentPixmap();
|
||||
_button->setIcon(QIcon(icon));
|
||||
_button->repaint();
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
/****************************************************************
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2006,2007 crypton
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
#ifndef ANIMATEDBUTTON_H
|
||||
#define ANIMATEDBUTTON_H
|
||||
|
||||
#include <util/rsqtutildll.h>
|
||||
|
||||
#include <util/NonCopyable.h>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
|
||||
class QToolButton;
|
||||
class QMovie;
|
||||
class QString;
|
||||
|
||||
/**
|
||||
* QAbstractButton with an animated icon (QMovie).
|
||||
*
|
||||
* Animated icon file should be a .mng file.
|
||||
*
|
||||
*
|
||||
*/
|
||||
class RSQTUTIL_API AnimatedButton : public QObject, NonCopyable {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructs a animated button.
|
||||
*
|
||||
* @param button button' icon to animate
|
||||
* @param animatedIconFilename mng filename to animate the button icon
|
||||
*/
|
||||
AnimatedButton(QToolButton * button, const QString & animatedIconFilename);
|
||||
|
||||
~AnimatedButton();
|
||||
|
||||
private Q_SLOTS:
|
||||
|
||||
/**
|
||||
* Button icon should be updated.
|
||||
*/
|
||||
void updateButtonIcon();
|
||||
|
||||
private:
|
||||
|
||||
QToolButton * _button;
|
||||
|
||||
QMovie * _animatedIcon;
|
||||
};
|
||||
|
||||
#endif //ANIMATEDBUTTON_H
|
Loading…
x
Reference in New Issue
Block a user