• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KNewStuff

  • sources
  • kde-4.14
  • kdelibs
  • knewstuff
  • knewstuff3
  • ui
progressindicator.cpp
Go to the documentation of this file.
1 /*
2  This file is part of KNewStuff2.
3  Copyright (c) 2007 Josef Spillner <spillner@kde.org>
4  Copyright (c) 2007 Jeremy Whiting <jpwhiting@kde.org>
5  Copyright (c) 2009-2010 Frederik Gladhorn <gladhorn@kde.org>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Lesser General Public
9  License as published by the Free Software Foundation; either
10  version 2.1 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public
18  License along with this library. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #include "progressindicator.h"
22 
23 #include <QtGui/QProgressBar>
24 #include <QtGui/QPushButton>
25 #include <QtGui/QLabel>
26 #include <QtGui/QLayout>
27 
28 #include "kjob.h"
29 #include "kdebug.h"
30 
31 #include <kiconloader.h>
32 #include <kpixmapsequencewidget.h>
33 
34 using namespace KNS3;
35 
36 ProgressIndicator::ProgressIndicator(QWidget *parent)
37  : QFrame(parent)
38  , m_busyPixmap(KPixmapSequence("process-working", 22))
39  , m_errorPixmap(KPixmapSequence("dialog-error", 22))
40 {
41  setFrameStyle(QFrame::NoFrame);
42  QHBoxLayout *hbox = new QHBoxLayout(this);
43  hbox->setMargin(0);
44 
45  //Busy widget
46  busyWidget = new KPixmapSequenceWidget(this);
47  busyWidget->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
48 
49  busyWidget->setVisible(false);
50  hbox->addWidget(busyWidget);
51 
52  m_statusLabel = new QLabel();
53  hbox->addWidget(m_statusLabel);
54 }
55 
56 void ProgressIndicator::busy(const QString &message)
57 {
58  m_statusLabel->setText(message);
59  busyWidget->setVisible(true);
60  busyWidget->setSequence(m_busyPixmap);
61 }
62 
63 void ProgressIndicator::error(const QString &message)
64 {
65  m_statusLabel->setText(message);
66  busyWidget->setVisible(true);
67  busyWidget->setSequence(m_errorPixmap);
68 }
69 
70 void ProgressIndicator::idle(const QString &message)
71 {
72  m_statusLabel->setText(message);
73  busyWidget->setVisible(false);
74 }
75 
76 #include "progressindicator.moc"
QWidget
KPixmapSequence
kdebug.h
QSizePolicy
QWidget::setVisible
virtual void setVisible(bool visible)
QHBoxLayout
KNS3::ProgressIndicator::idle
void idle(const QString &message)
Definition: progressindicator.cpp:70
kiconloader.h
QFrame::setFrameStyle
void setFrameStyle(int style)
KNS3::ProgressIndicator::busy
void busy(const QString &message)
Definition: progressindicator.cpp:56
QBoxLayout::addWidget
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
KPixmapSequenceWidget
QLabel::setText
void setText(const QString &)
QString
KPixmapSequenceWidget::setSequence
void setSequence(const KPixmapSequence &seq)
QLayout::setMargin
void setMargin(int margin)
QWidget::setSizePolicy
void setSizePolicy(QSizePolicy)
progressindicator.h
QFrame
KNS3::ProgressIndicator::ProgressIndicator
ProgressIndicator(QWidget *parent)
Definition: progressindicator.cpp:36
kjob.h
KNS3::ProgressIndicator::error
void error(const QString &message)
Definition: progressindicator.cpp:63
QLabel
kpixmapsequencewidget.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:25:43 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KNewStuff

Skip menu "KNewStuff"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal