diff --git a/retroshare-gui/src/util/AnimatedButton.cpp b/retroshare-gui/src/util/AnimatedButton.cpp deleted file mode 100644 index 238abead7..000000000 --- a/retroshare-gui/src/util/AnimatedButton.cpp +++ /dev/null @@ -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 - - - -#include - -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(); -} diff --git a/retroshare-gui/src/util/AnimatedButton.h b/retroshare-gui/src/util/AnimatedButton.h deleted file mode 100644 index 4417f1c79..000000000 --- a/retroshare-gui/src/util/AnimatedButton.h +++ /dev/null @@ -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 - -#include - -#include - -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