kget
errorgraph.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "errorgraph.h"
00022 #include "transfergraph.h"
00023
00024 #include <plasma/widgets/icon.h>
00025 #include <plasma/widgets/label.h>
00026 #include <plasma/layouts/boxlayout.h>
00027 #include <plasma/widgets/pushbutton.h>
00028
00029 #include <KIcon>
00030 #include <QProcess>
00031
00032 ErrorGraph::ErrorGraph(Plasma::Applet *parent, Plasma::BoxLayout *mainlayout, const QString &message)
00033 : TransferGraph(parent)
00034 {
00035 m_layout = mainlayout;
00036
00037 m_icon = new Plasma::Icon(KIcon("dialog-warning"), "", m_applet);
00038
00039
00040 m_errorLabel = new Plasma::Label(m_applet);
00041 m_errorLabel->setText(message);
00042 m_errorLabel->setPen(QPen(Qt::white));
00043 m_errorLabel->setAlignment(Qt::AlignCenter);
00044
00045 m_launchButton = new Plasma::PushButton(KIcon("kget"), "Launch KGet", m_applet);
00046
00047 m_layout->addItem(m_icon);
00048 m_layout->addItem(m_errorLabel);
00049 m_layout->addItem(m_launchButton);
00050
00051 connect(m_launchButton, SIGNAL(clicked()), SLOT(launchKGet()));
00052 }
00053
00054 ErrorGraph::~ErrorGraph()
00055 {
00056 delete m_icon;
00057 delete m_errorLabel;
00058 delete m_launchButton;
00059 }
00060
00061 void ErrorGraph::launchKGet()
00062 {
00063 QProcess *kgetProcess = new QProcess(this);
00064 kgetProcess->startDetached("kget");
00065 }