• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdenewstuff
 

tdenewstuff

  • tdenewstuff
knewstuffbutton.cpp
1 /*
2  Copyright (c) 2004 Aaron J. Seigo <aseigo@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #include <kiconloader.h>
21 #include <tdelocale.h>
22 
23 #include "downloaddialog.h"
24 #include "knewstuffbutton.h"
25 #include "knewstuffbutton.moc"
26 
27 namespace KNS
28 {
29 
30 Button::Button(const TQString& what,
31  const TQString& providerList,
32  const TQString& resourceType,
33  TQWidget* parent, const char* name)
34  : KPushButton(parent, name),
35  d(0),
36  m_providerList(providerList),
37  m_type(resourceType),
38  m_downloadDialog(0)
39 {
40  setButtonText(what);
41  init();
42 }
43 
44 Button::Button(TQWidget* parent, const char* name)
45  : KPushButton(parent, name),
46  d(0),
47  m_downloadDialog(0)
48 {
49  setButtonText(i18n("Download New Stuff"));
50  init();
51 }
52 
53 void Button::init()
54 {
55  setIconSet(SmallIconSet("knewstuff"));
56  connect(this, TQ_SIGNAL(clicked()), TQ_SLOT(showDialog()));
57 }
58 
59 void Button::setButtonText(const TQString& what)
60 {
61  setText(i18n("Download New %1").arg(what));
62 }
63 
64 void Button::setProviderList(const TQString& providerList)
65 {
66  m_providerList = providerList;
67 }
68 
69 void Button::setResourceType(const TQString& resourceType)
70 {
71  m_type = resourceType;
72 }
73 
74 void Button::showDialog()
75 {
76  emit aboutToShowDialog();
77 
78  if (!m_downloadDialog)
79  {
80  m_downloadDialog = new DownloadDialog(0, this);
81  }
82 
83  m_downloadDialog->setType(m_type);
84  m_downloadDialog->load(m_providerList);
85 
86  m_downloadDialog->exec(); // TODO: make non-modal?
87  emit dialogFinished();
88 }
89 
90 }
KNS::Button::setProviderList
void setProviderList(const TQString &providerList)
set the URL to the list of providers for this button to use
Definition: knewstuffbutton.cpp:64
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::setResourceType
void setResourceType(const TQString &resourceType)
the Hotstuff data type for this downlaod such as "korganizer/calendar"
Definition: knewstuffbutton.cpp:69
KNS::Button::dialogFinished
void dialogFinished()
emitted when the Hot New Stuff dialog has been closed
KNS::Button::setButtonText
void setButtonText(const TQString &what)
set the text that should appear on the button.
Definition: knewstuffbutton.cpp:59
KNS::Button::Button
Button(const TQString &what, const TQString &providerList, const TQString &resourceType, TQWidget *parent, const char *name)
Constructor used when the details of the TDEHotNewStuff download is known when the button is created.
Definition: knewstuffbutton.cpp:30
KNS::DownloadDialog
Common download dialog for data browsing and installation.
Definition: downloaddialog.h:58
KNS::DownloadDialog::setType
void setType(TQString type)
Restricts the display of available data to a certain data type.
Definition: downloaddialog.cpp:971
KNS::DownloadDialog::load
void load()
Fetches descriptions of all available data, optionally considering a previously set type.
Definition: downloaddialog.cpp:179
KNS
Handles security releated issues, like signing, verifying.
Definition: downloaddialog.h:37

tdenewstuff

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

tdenewstuff

Skip menu "tdenewstuff"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdenewstuff by doxygen 1.9.1
This website is maintained by Timothy Pearson.