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

KNewStuff

  • sources
  • kde-4.12
  • kdelibs
  • 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 
26 namespace KNS3
27 {
28  class Button::Private {
29  public:
30  QString configFile;
31  };
32 
33 Button::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 
44 Button::Button(QWidget* parent)
45  : KPushButton(parent),
46  d(new Private)
47 {
48  setButtonText(i18n("Download New Stuff..."));
49  init();
50 }
51 
52 Button::~Button()
53 {
54  delete d;
55 }
56 
57 void Button::init()
58 {
59  setIcon(KIcon("get-hot-new-stuff"));
60  connect(this, SIGNAL(clicked()), SLOT(showDialog()));
61 }
62 
63 void Button::setButtonText(const QString& what)
64 {
65  setText(what);
66 }
67 
68 void Button::setConfigFile(const QString& configFile)
69 {
70  d->configFile = configFile;
71 }
72 
73 void 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"
i18n
QString i18n(const char *text)
KPushButton
QWidget
kiconloader.h
QString
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...
klocale.h
KNS3::DownloadDialog
KNewStuff download dialog.
Definition: knewstuff3/downloaddialog.h:72
KPushButton::setText
void setText(const QString &text)
KIcon
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::changedEntries
KNS3::Entry::List changedEntries()
The list of entries with changed status (installed/uninstalled)
Definition: knewstuff3/downloaddialog.cpp:105
KNS3::Button::setButtonText
void setButtonText(const QString &text)
set the text that should appear on the button.
Definition: knewstuff3/knewstuffbutton.cpp:63
KNS3::Button::setConfigFile
void setConfigFile(const QString &configFile)
set the name of the .knsrc file to use
Definition: knewstuff3/knewstuffbutton.cpp:68
knewstuffbutton.h
KNS3::Button::~Button
~Button()
Definition: knewstuff3/knewstuffbutton.cpp:52
KPushButton::setIcon
void setIcon(const KIcon &icon)
downloaddialog.h
KNS3::Button::dialogFinished
void dialogFinished(const KNS3::Entry::List &changedEntries)
emitted when the Hot New Stuff dialog has been closed
kicon.h
KNS3::Button::showDialog
void showDialog()
Definition: knewstuff3/knewstuffbutton.cpp:73
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:48 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • 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