File indexing completed on 2024-05-12 05:09:49
0001 /*************************************************************************** 0002 Copyright (C) 2005-2009 Robby Stephenson <robby@periapsis.org> 0003 Copyright (C) 2011 Pedro Miguel Carvalho <kde@pmc.com.pt> 0004 ***************************************************************************/ 0005 0006 /*************************************************************************** 0007 * * 0008 * This program is free software; you can redistribute it and/or * 0009 * modify it under the terms of the GNU General Public License as * 0010 * published by the Free Software Foundation; either version 2 of * 0011 * the License or (at your option) version 3 or any later version * 0012 * accepted by the membership of KDE e.V. (or its successor approved * 0013 * by the membership of KDE e.V.), which shall act as a proxy * 0014 * defined in Section 14 of version 3 of the license. * 0015 * * 0016 * This program is distributed in the hope that it will be useful, * 0017 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0019 * GNU General Public License for more details. * 0020 * * 0021 * You should have received a copy of the GNU General Public License * 0022 * along with this program. If not, see <http://www.gnu.org/licenses/>. * 0023 * * 0024 ***************************************************************************/ 0025 0026 // much of this code is adapted from amarok 0027 // which is GPL licensed, Copyright (C) 2005 by Max Howell 0028 0029 #ifndef TELLICO_STATUSBAR_H 0030 #define TELLICO_STATUSBAR_H 0031 0032 #include <QStatusBar> 0033 0034 class QLabel; 0035 class QPushButton; 0036 0037 namespace Tellico { 0038 namespace GUI { 0039 class Progress; 0040 } 0041 class MainWindow; 0042 0043 /** 0044 * @author Robby Stephenson 0045 */ 0046 class StatusBar : public QStatusBar { 0047 Q_OBJECT 0048 0049 public: 0050 void clearStatus(); 0051 void setStatus(const QString& status); 0052 void setCount(const QString& count); 0053 0054 static StatusBar* self() { return s_self; } 0055 0056 virtual void ensurePolished() const; 0057 0058 private Q_SLOTS: 0059 void slotProgress(qulonglong progress); 0060 void slotUpdate(); 0061 0062 private: 0063 static StatusBar* s_self; 0064 0065 friend class MainWindow; 0066 0067 StatusBar(QWidget* parent); 0068 0069 QLabel* m_mainLabel; 0070 QLabel* m_countLabel; 0071 GUI::Progress* m_progress; 0072 QPushButton* m_cancelButton; 0073 }; 0074 0075 } 0076 0077 #endif