• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • @topname@
  • Sitemap
  • Contact Us
 

knewstuff

ghns.cpp

00001 /*
00002     This file is part of KDE.
00003 
00004     Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 */
00021 #include <iostream>
00022 
00023 #include <qlayout.h>
00024 #include <qfile.h>
00025 #include <qtextstream.h>
00026 #include <qlabel.h>
00027 
00028 #include <kaboutdata.h>
00029 #include <kapplication.h>
00030 #include <kdebug.h>
00031 #include <klocale.h>
00032 #include <kcmdlineargs.h>
00033 #include <kprocess.h>
00034 #include <kdialog.h>
00035 
00036 #include "knewstuffgeneric.h"
00037 
00038 #include "ghns.h"
00039 
00040 using namespace std;
00041 
00042 GhnsWidget::GhnsWidget()
00043 {
00044   mWallpapers = new KNewStuffGeneric( "kdesktop/wallpaper", this );
00045 
00046   QBoxLayout *topLayout = new QVBoxLayout( this );
00047   topLayout->setMargin( KDialog::marginHint() );
00048   topLayout->setSpacing( KDialog::spacingHint() );
00049 
00050   topLayout->addWidget( new QLabel( i18n("Get hot new stuff:"), this ) );
00051 
00052   QPushButton *button = new QPushButton( "Wallpapers", this );
00053   topLayout->addWidget( button );
00054   connect( button, SIGNAL( clicked() ), SLOT( downloadWallpapers() ) );
00055 
00056   topLayout->addSpacing( 5 );
00057 
00058   QBoxLayout *buttonLayout = new QHBoxLayout( topLayout );
00059 
00060   buttonLayout->addStretch();
00061 
00062   QPushButton *closeButton = new QPushButton( "Close", this );
00063   buttonLayout->addWidget( closeButton );
00064   connect( closeButton, SIGNAL( clicked() ), kapp, SLOT( quit() ) );
00065 }
00066 
00067 GhnsWidget::~GhnsWidget()
00068 {
00069   delete mWallpapers;
00070 }
00071 
00072 void GhnsWidget::downloadWallpapers()
00073 {
00074   kdDebug() << "downloadWallpapers()" << endl;
00075 
00076   mWallpapers->download();
00077 }
00078 
00079 int main(int argc,char **argv)
00080 {
00081   KAboutData aboutData("ghns","Get Hot New Stuff","0.1");
00082   KCmdLineArgs::init(argc,argv,&aboutData);
00083 
00084   KApplication app;
00085 
00086   GhnsWidget wid;
00087   app.setMainWidget( &wid );
00088   wid.show();
00089 
00090   app.exec();
00091 }
00092 
00093 #include "ghns.moc"

knewstuff

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

@topname@

Skip menu "@topname@"
  •     kdnssd-avahi
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for @topname@ by doxygen 1.5.5
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal