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

KNewStuff

  • knewstuff
  • knewstuff3
knewstuff3/knewstuffbutton.cpp
Go to the documentation of this file.
1/*
2 knewstuff3/ui/knewstuffbutton.cpp.
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#include "downloaddialog.h"
25
26namespace KNS3
27{
28 class Button::Private {
29 public:
30 QString configFile;
31 };
32
33Button::Button(const QString& text,
34 const QString& configFile,
35 QWidget* parent)
36 : KPushButton(parent),
37 d(new Private)
38{
39 setButtonText(text);
40 d->configFile = configFile;
41 init();
42}
43
44Button::Button(QWidget* parent)
45 : KPushButton(parent),
46 d(new Private)
47{
48 setButtonText(i18n("Download New Stuff..."));
49 init();
50}
51
52Button::~Button()
53{
54 delete d;
55}
56
57void Button::init()
58{
59 setIcon(KIcon("get-hot-new-stuff"));
60 connect(this, SIGNAL(clicked()), SLOT(showDialog()));
61}
62
63void Button::setButtonText(const QString& what)
64{
65 setText(what);
66}
67
68void Button::setConfigFile(const QString& configFile)
69{
70 d->configFile = configFile;
71}
72
73void Button::showDialog()
74{
75 emit aboutToShowDialog();
76
77 DownloadDialog dialog(d->configFile, this);
78 dialog.exec();
79
80 emit dialogFinished(dialog.changedEntries());
81}
82
83}
84
85#include "knewstuffbutton.moc"
KIcon
KNS3::Button::showDialog
void showDialog()
Definition: knewstuff3/knewstuffbutton.cpp:73
KNS3::Button::~Button
~Button()
Definition: knewstuff3/knewstuffbutton.cpp:52
KNS3::Button::setConfigFile
void setConfigFile(const QString &configFile)
set the name of the .knsrc file to use
Definition: knewstuff3/knewstuffbutton.cpp:68
KNS3::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...
KNS3::Button::dialogFinished
void dialogFinished(const KNS3::Entry::List &changedEntries)
emitted when the Hot New Stuff dialog has been closed
KNS3::Button::setButtonText
void setButtonText(const QString &text)
set the text that should appear on the button.
Definition: knewstuff3/knewstuffbutton.cpp:63
KNS3::Button::Button
Button(const QString &text, const QString &configFile, QWidget *parent)
Constructor used when the details of the KHotNewStuff download is known when the button is created.
Definition: knewstuff3/knewstuffbutton.cpp:33
KNS3::DownloadDialog
KNewStuff download dialog.
Definition: knewstuff3/downloaddialog.h:73
KNS3::DownloadDialog::changedEntries
KNS3::Entry::List changedEntries()
The list of entries with changed status (installed/uninstalled)
Definition: knewstuff3/downloaddialog.cpp:105
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)
downloaddialog.h
knewstuffbutton.h
KNS3
Definition: atticaprovider.cpp:36
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