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

KNewStuff

  • knewstuff
  • knewstuff2
  • ui
knewstuff2/ui/knewstuffbutton.cpp
Go to the documentation of this file.
1/*
2 This file is part of KNewStuff2.
3 Copyright (c) 2004 Aaron J. Seigo <aseigo@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#include "knewstuffbutton.h"
20
21#include <kiconloader.h>
22#include <klocale.h>
23#include <kicon.h>
24
25#include "knewstuff2/engine.h"
26
27namespace KNS
28{
29
30Button::Button(const QString& what,
31 const QString& providerList,
32 const QString& resourceType,
33 QWidget* parent)
34 : KPushButton(parent),
35 d(0),
36 m_providerList(providerList),
37 m_type(resourceType),
38 m_engine(0)
39{
40 setText(what);
41 init();
42}
43
44Button::Button(QWidget* parent)
45 : KPushButton(parent),
46 d(0),
47 m_engine(0)
48{
49 setButtonText(i18n("Download New Stuff..."));
50 init();
51}
52
53void Button::init()
54{
55 setIcon(KIcon("get-hot-new-stuff"));
56 connect(this, SIGNAL(clicked()), SLOT(showDialog()));
57}
58
59void Button::setButtonText(const QString& what)
60{
61 setText(what);
62}
63
64void Button::setProviderList(const QString& providerList)
65{
66 m_providerList = providerList;
67}
68
69void Button::setResourceType(const QString& resourceType)
70{
71 m_type = resourceType;
72}
73
74void Button::showDialog()
75{
76 emit aboutToShowDialog();
77
78 /*if (!m_engine)
79 {
80 m_engine = new Engine();
81 }*/
82
83 //m_downloadDialog->setCategory(m_type);
84 //m_downloadDialog->load(m_providerList);
85
86 //m_downloadDialog->exec(); // TODO: make non-modal?
87
88 KNS::Engine::download();
89
90 emit dialogFinished();
91}
92
93}
94
95#include "knewstuffbutton.moc"
KIcon
KNS::Button::setResourceType
void setResourceType(const QString &resourceType)
the Hotstuff data type for this downlaod such as "korganizer/calendar"
Definition: knewstuff2/ui/knewstuffbutton.cpp:69
KNS::Button::Button
Button(const QString &what, const QString &providerList, const QString &resourceType, QWidget *parent)
Constructor used when the details of the KHotNewStuff download is known when the button is created.
Definition: knewstuff2/ui/knewstuffbutton.cpp:30
KNS::Button::aboutToShowDialog
void aboutToShowDialog()
emitted when the Hot New Stuff dialog is about to be shown, usually as a result of the user having cl...
KNS::Button::setProviderList
void setProviderList(const QString &providerList)
set the URL to the list of providers for this button to use
Definition: knewstuff2/ui/knewstuffbutton.cpp:64
KNS::Button::setButtonText
void setButtonText(const QString &what)
set the text that should appear on the button.
Definition: knewstuff2/ui/knewstuffbutton.cpp:59
KNS::Button::showDialog
void showDialog()
Definition: knewstuff2/ui/knewstuffbutton.cpp:74
KNS::Button::dialogFinished
void dialogFinished()
emitted when the Hot New Stuff dialog has been closed
KNS::Engine::download
static KNS::Entry::List download()
Recommended download workflow entry point.
Definition: knewstuff2/engine.cpp:176
KPushButton
KPushButton::setIcon
void setIcon(const KIcon &icon)
KPushButton::setText
void setText(const QString &text)
QWidget
kicon.h
kiconloader.h
klocale.h
i18n
QString i18n(const char *text)
engine.h
knewstuffbutton.h
KNS
Definition: knewstuff2/core/author.h:27
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
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