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

kdf

  • sources
  • kde-4.12
  • kdeutils
  • kdf
kdf.cpp
Go to the documentation of this file.
1 /*
2  * kdf.cpp - KDiskFree
3  *
4  * Copyright 1998-2001 by Michael Kropfberger <michael.kropfberger@gmx.net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  *
20  */
21 
22 #include "kdf.h"
23 
24 #include <kapplication.h>
25 #include <kcmdlineargs.h>
26 #include <kaboutdata.h>
27 #include <kxmlguifactory.h>
28 
29 #include <kmenu.h>
30 #include <kdebug.h>
31 #include <kmenubar.h>
32 #include <kaction.h>
33 #include <kstandardshortcut.h>
34 #include <kstandardaction.h>
35 #include <kactioncollection.h>
36 
37 static const char description[] =
38  I18N_NOOP("KDE free disk space utility");
39 
40 static const char version[] = "v0.15";
41 
42 
43 /***************************************************************/
44 KDFTopLevel::KDFTopLevel(QWidget *)
45  : KXmlGuiWindow(0)
46 {
47  kdf = new KDFWidget(this,false);
48  Q_CHECK_PTR(kdf);
49  QAction *action = actionCollection()->addAction( QLatin1String( "updatedf" ));
50  action->setText( i18nc( "Update action", "&Update" ) );
51  connect(action, SIGNAL(triggered(bool)), kdf, SLOT(updateDF()));
52 
53  KStandardAction::quit(this, SLOT(close()), actionCollection());
54  KStandardAction::preferences(kdf, SLOT(settingsBtnClicked()), actionCollection());
55  KStandardAction::keyBindings(guiFactory(), SLOT(configureShortcuts()),
56  actionCollection());
57  setCentralWidget(kdf);
58  // kdf->setMinimumSize(kdf->sizeHint());
59  kdf->resize(kdf->sizeHint());
60  setupGUI(KXmlGuiWindow::Keys | StatusBar | Save | Create);
61 }
62 
63 
64 bool KDFTopLevel::queryExit( void )
65 {
66  kdf->applySettings();
67  return( true );
68 }
69 
70 
71 /***************************************************************/
72 int main(int argc, char **argv)
73 {
74  KAboutData aboutData( "kdf", 0, ki18n("KDiskFree"),
75  version, ki18n(description), KAboutData::License_GPL,
76  ki18n("(c) 1998-2001, Michael Kropfberger"), KLocalizedString(),
77  "http://utils.kde.org/projects/kdf");
78  aboutData.addAuthor(ki18n("Michael Kropfberger"),KLocalizedString(), "michael.kropfberger@gmx.net");
79  KCmdLineArgs::init( argc, argv, &aboutData );
80 
81  KApplication app;
82 
83  if( app.isSessionRestored() ) //SessionManagement
84  {
85  for( int n=1; KDFTopLevel::canBeRestored(n); n++ )
86  {
87  KDFTopLevel *ktl = new KDFTopLevel();
88  Q_CHECK_PTR(ktl);
89  ktl->restore(n);
90  }
91  }
92  else
93  {
94  KDFTopLevel *ktl = new KDFTopLevel();
95  Q_CHECK_PTR(ktl);
96  ktl->show();
97  }
98 
99  return app.exec();
100 }
101 
102 #include "kdf.moc"
103 
KDFTopLevel::queryExit
virtual bool queryExit(void)
Definition: kdf.cpp:64
KDFTopLevel::KDFTopLevel
KDFTopLevel(QWidget *parent=0)
Definition: kdf.cpp:44
description
static const char description[]
Definition: kdf.cpp:37
QWidget
KDFTopLevel
Definition: kdf.h:30
KDFWidget::applySettings
void applySettings(void)
Definition: kdfwidget.cpp:154
KXmlGuiWindow
version
static const char version[]
Definition: kdf.cpp:40
kdf.h
KDFWidget
Definition: kdfwidget.h:62
main
int main(int argc, char **argv)
Definition: kdf.cpp:72
KDFTopLevel::kdf
KDFWidget * kdf
Definition: kdf.h:41
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:08:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdf

Skip menu "kdf"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • kremotecontrol
  • ktimer
  • kwallet
  • superkaramba
  • sweeper

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